import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import BalloonEditorBase from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor'; import InlineEditorBase from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor'; import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials'; import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat'; import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic'; import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote'; import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder'; import Heading from '@ckeditor/ckeditor5-heading/src/heading'; import HtmlEmbed from '@ckeditor/ckeditor5-html-embed/src/htmlembed'; import Image from '@ckeditor/ckeditor5-image/src/image'; import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption'; import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle'; import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar'; import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize'; import LinkImage from '@ckeditor/ckeditor5-link/src/linkimage'; import Indent from '@ckeditor/ckeditor5-indent/src/indent'; import Link from '@ckeditor/ckeditor5-link/src/link'; import List from '@ckeditor/ckeditor5-list/src/list'; import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed'; import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat'; import Table from '@ckeditor/ckeditor5-table/src/table'; import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'; import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation'; import Superscript from "@ckeditor/ckeditor5-basic-styles/src/superscript"; import Subscript from "@ckeditor/ckeditor5-basic-styles/src/subscript"; import Strikethrough from "@ckeditor/ckeditor5-basic-styles/src/strikethrough"; import Underline from "@ckeditor/ckeditor5-basic-styles/src/underline"; import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor'; import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor'; import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment'; import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock'; import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters'; import SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials'; import { TableColumnResize } from '@ckeditor/ckeditor5-table'; import HorizontalLine from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; class ClassicEditor extends ClassicEditorBase {} class BalloonEditor extends BalloonEditorBase {} class InlineEditor extends InlineEditorBase {} function SpecialCharactersEmoji( editor ) { editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji', [ { title: 'cool', character: '😎' }, { title: 'surprise', character: '😮' }, { title: 'confusion', character: '😕' }, { title: 'crying', character: '😢' }, { character: '🙂', title: 'Slightly smiling face' }, { character: '😀', title: 'Smiling face' }, { character: '😃', title: 'Smiling face with big eyes' }, { character: '😄', title: 'Smiling face with smiling eyes' }, { character: '😁', title: 'Beaming face with smiling eyes' }, { character: '😅', title: 'Smiling face with tears' }, { character: '😆', title: 'Grinning face' }, { character: '🤣', title: 'Rolling on the floor laughing' }, { character: '😂', title: 'Lauging with tears' }, { character: '🙃', title: 'Upside down face' }, { character: '😉', title: 'Winking face' }, { character: '😊', title: 'Smiling face with smiling eyes' }, { character: '😇', title: 'Smiling face with halo' }, { character: '🤓', title: 'Nerdy face' }, { character: '🧐', title: 'Face with monocle' }, { character: '🥳', title: 'Partying face' }, ] ); } // Plugins to include in the build. const builtinPlugins = [ Essentials, UploadAdapter, Autoformat, Bold, Clipboard, Italic, Underline, Strikethrough, Subscript, Superscript, BlockQuote, CKFinder, Heading, HtmlEmbed, Image, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, ImageResize, LinkImage, Indent, Link, List, MediaEmbed, Paragraph, PasteFromOffice, RemoveFormat, Table, TableColumnResize, TableToolbar, TextTransformation, FontColor, FontBackgroundColor, Alignment, SpecialCharacters, CodeBlock, SpecialCharactersEssentials, HorizontalLine, SpecialCharactersEmoji ]; BalloonEditor.builtinPlugins = builtinPlugins; ClassicEditor.builtinPlugins = builtinPlugins; InlineEditor.builtinPlugins = builtinPlugins; // Editor configuration. const defaultConfig = { alignment: { options: ['left', 'center', 'right', 'justify'] }, toolbar: { items: [ 'heading', '|', 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript', 'link', 'bulletedList', 'numberedList', '|', 'fontColor', 'fontBackgroundColor', '|', 'alignment', '|', 'indent', 'outdent', '|', 'imageUpload', 'blockQuote', 'insertTable', 'horizontalLine', 'mediaEmbed', 'codeBlock', 'undo', 'redo', 'specialCharacters' ] }, image: { styles: [ 'alignLeft', 'alignCenter', 'alignRight' ], resizeOptions: [ { name: 'imageResize:original', label: 'Original', value: null }, { name: 'imageResize:100', label: '100%', value: '100' }, { name: 'imageResize:75', label: '75%', value: '75' }, { name: 'imageResize:50', label: '50%', value: '50' }, ], toolbar: [ 'imageStyle:alignCenter', 'imageStyle:alignLeft', 'imageStyle:alignRight', '|', 'imageResize', '|', 'imageTextAlternative', ] }, table: { contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ] }, // This value must be kept in sync with the language defined in webpack.config.js. language: 'en' }; BalloonEditor.defaultConfig = defaultConfig; ClassicEditor.defaultConfig = defaultConfig; InlineEditor.defaultConfig = defaultConfig; export default { BalloonEditor, ClassicEditor, InlineEditor, };