mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-30 22:34:17 +00:00
feat(core): Update to ckeditor 5. Fixes #5920.
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* @license Copyright (c) 2014-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
|
||||
|
||||
import { Alignment } from '@ckeditor/ckeditor5-alignment';
|
||||
import { Autoformat } from '@ckeditor/ckeditor5-autoformat';
|
||||
import {
|
||||
Bold,
|
||||
Code,
|
||||
Italic,
|
||||
Strikethrough,
|
||||
Subscript,
|
||||
Superscript,
|
||||
Underline
|
||||
} from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
|
||||
import { CloudServices } from '@ckeditor/ckeditor5-cloud-services';
|
||||
import type { EditorConfig } from '@ckeditor/ckeditor5-core';
|
||||
import { Essentials } from '@ckeditor/ckeditor5-essentials';
|
||||
import { FontBackgroundColor, FontColor, FontFamily, FontSize } from '@ckeditor/ckeditor5-font';
|
||||
import { Heading } from '@ckeditor/ckeditor5-heading';
|
||||
import { Highlight } from '@ckeditor/ckeditor5-highlight';
|
||||
import { GeneralHtmlSupport } from '@ckeditor/ckeditor5-html-support';
|
||||
import {
|
||||
AutoImage,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageInsert,
|
||||
ImageResize,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload
|
||||
} from '@ckeditor/ckeditor5-image';
|
||||
import { Indent } from '@ckeditor/ckeditor5-indent';
|
||||
import { AutoLink, Link } from '@ckeditor/ckeditor5-link';
|
||||
import { List } from '@ckeditor/ckeditor5-list';
|
||||
import { MediaEmbed } from '@ckeditor/ckeditor5-media-embed';
|
||||
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office';
|
||||
import { SourceEditing } from '@ckeditor/ckeditor5-source-editing';
|
||||
import {
|
||||
SpecialCharacters,
|
||||
SpecialCharactersEssentials
|
||||
} from '@ckeditor/ckeditor5-special-characters';
|
||||
import { Table, TableToolbar } from '@ckeditor/ckeditor5-table';
|
||||
import { TextTransformation } from '@ckeditor/ckeditor5-typing';
|
||||
import { Undo } from '@ckeditor/ckeditor5-undo';
|
||||
import { Base64UploadAdapter } from '@ckeditor/ckeditor5-upload';
|
||||
|
||||
// You can read more about extending the build with additional plugins in the "Installing plugins" guide.
|
||||
// See https://ckeditor.com/docs/ckeditor5/latest/installation/plugins/installing-plugins.html for details.
|
||||
|
||||
class Editor extends ClassicEditor {
|
||||
public static override builtinPlugins = [
|
||||
Alignment,
|
||||
AutoImage,
|
||||
AutoLink,
|
||||
Autoformat,
|
||||
Base64UploadAdapter,
|
||||
BlockQuote,
|
||||
Bold,
|
||||
CloudServices,
|
||||
Code,
|
||||
Essentials,
|
||||
FontBackgroundColor,
|
||||
FontColor,
|
||||
FontFamily,
|
||||
FontSize,
|
||||
GeneralHtmlSupport,
|
||||
Heading,
|
||||
Highlight,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageInsert,
|
||||
ImageResize,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
Indent,
|
||||
Italic,
|
||||
Link,
|
||||
List,
|
||||
MediaEmbed,
|
||||
Paragraph,
|
||||
PasteFromOffice,
|
||||
SourceEditing,
|
||||
SpecialCharacters,
|
||||
SpecialCharactersEssentials,
|
||||
Strikethrough,
|
||||
Subscript,
|
||||
Superscript,
|
||||
Table,
|
||||
TableToolbar,
|
||||
TextTransformation,
|
||||
Underline,
|
||||
Undo
|
||||
];
|
||||
|
||||
public static override defaultConfig: EditorConfig = {
|
||||
toolbar: {
|
||||
items: [
|
||||
'bold',
|
||||
'italic',
|
||||
'underline',
|
||||
'|',
|
||||
'fontColor',
|
||||
'fontFamily',
|
||||
'fontSize',
|
||||
'|',
|
||||
'numberedList',
|
||||
'bulletedList',
|
||||
'|',
|
||||
'outdent',
|
||||
'indent',
|
||||
'|',
|
||||
'blockQuote',
|
||||
'|',
|
||||
'alignment',
|
||||
'|',
|
||||
'link',
|
||||
'|',
|
||||
'insertTable',
|
||||
'specialCharacters',
|
||||
'imageUpload',
|
||||
'|',
|
||||
'undo',
|
||||
'redo',
|
||||
'sourceEditing'
|
||||
]
|
||||
},
|
||||
language: 'en',
|
||||
image: {
|
||||
toolbar: [
|
||||
'imageTextAlternative',
|
||||
'toggleImageCaption',
|
||||
'imageStyle:inline',
|
||||
'imageStyle:block',
|
||||
'imageStyle:side'
|
||||
]
|
||||
},
|
||||
table: {
|
||||
contentToolbar: [
|
||||
'tableColumn',
|
||||
'tableRow',
|
||||
'mergeTableCells'
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default Editor;
|
||||
Reference in New Issue
Block a user