/** * This file is used to test the package during development. When you run the `start` script, * a local server is started with the `index.html` as a starting point. The `index.html` file * loads this script which creates and configures the editor instance. */ import { ClassicEditor, Autoformat, Base64UploadAdapter, BlockQuote, Bold, Code, CodeBlock, Essentials, Heading, Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, Indent, Italic, Link, List, MediaEmbed, Paragraph, Table, TableToolbar } from 'ckeditor5'; import CKEditorInspector from '@ckeditor/ckeditor5-inspector'; import 'ckeditor5/ckeditor5.css'; import { <%= formattedNames.plugin.pascalCase %> } from '../src/index.js'; declare global { interface Window { editor: ClassicEditor; } } ClassicEditor .create( { attachTo: document.querySelector( '#editor' )!, licenseKey: 'GPL', plugins: [ <%= formattedNames.plugin.pascalCase %>, Essentials, Autoformat, BlockQuote, Bold, Heading, Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, Indent, Italic, Link, List, MediaEmbed, Paragraph, Table, TableToolbar, CodeBlock, Code, Base64UploadAdapter ], toolbar: [ 'undo', 'redo', '|', '<%= formattedNames.plugin.camelCase %>', '|', 'heading', '|', 'bold', 'italic', 'link', 'code', 'bulletedList', 'numberedList', '|', 'outdent', 'indent', '|', 'uploadImage', 'blockQuote', 'insertTable', 'mediaEmbed', 'codeBlock' ], image: { toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|', 'imageTextAlternative' ] }, table: { contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] } } ) .then( editor => { window.editor = editor; CKEditorInspector.attach( editor ); console.log( 'CKEditor 5 is ready.', editor ); } ) .catch( err => { console.error( err.stack ); } );