mirror of
https://github.com/zadam/trilium.git
synced 2025-12-24 08:14:25 +01:00
Deduplicate plugins for the two editor types
This commit is contained in:
parent
db8ab2bc72
commit
8945b5ab69
@ -5,146 +5,14 @@
|
||||
|
||||
// The editor creator to use.
|
||||
import { BalloonEditor as BalloonEditorBase } from '@ckeditor/ckeditor5-editor-balloon';
|
||||
|
||||
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
|
||||
import { CKFinderUploadAdapter } from '@ckeditor/ckeditor5-adapter-ckfinder';
|
||||
import { Autoformat } from '@ckeditor/ckeditor5-autoformat';
|
||||
import { Bold } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Italic } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Superscript } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Subscript } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Underline } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Strikethrough } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Code } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
|
||||
import { Heading } from '@ckeditor/ckeditor5-heading';
|
||||
import { Image, ImageInline } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageCaption } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageStyle } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageToolbar } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageUpload } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageResize } from '@ckeditor/ckeditor5-image';
|
||||
import { Link } from '@ckeditor/ckeditor5-link';
|
||||
import { AutoLink } from '@ckeditor/ckeditor5-link';
|
||||
import { List } from '@ckeditor/ckeditor5-list';
|
||||
import { ListProperties } from '@ckeditor/ckeditor5-list';
|
||||
import { TodoList } from '@ckeditor/ckeditor5-list';
|
||||
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office';
|
||||
import { PictureEditing } from '@ckeditor/ckeditor5-image';
|
||||
import { Table } from '@ckeditor/ckeditor5-table';
|
||||
import { TableToolbar } from '@ckeditor/ckeditor5-table';
|
||||
import { TableProperties } from '@ckeditor/ckeditor5-table';
|
||||
import { TableCellProperties } from '@ckeditor/ckeditor5-table';
|
||||
import { TableCaption } from '@ckeditor/ckeditor5-table';
|
||||
import { TableSelection } from '@ckeditor/ckeditor5-table';
|
||||
import { TableColumnResize } from '@ckeditor/ckeditor5-table';
|
||||
import { BlockToolbar } from '@ckeditor/ckeditor5-ui';
|
||||
import { HeadingButtonsUI } from '@ckeditor/ckeditor5-heading';
|
||||
import { ParagraphButtonUI } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { TextTransformation } from '@ckeditor/ckeditor5-typing';
|
||||
import { Font } from '@ckeditor/ckeditor5-font';
|
||||
import { FontColor } from '@ckeditor/ckeditor5-font';
|
||||
import { FontBackgroundColor } from '@ckeditor/ckeditor5-font';
|
||||
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
|
||||
import { Mention } from '@ckeditor/ckeditor5-mention';
|
||||
import { Indent } from '@ckeditor/ckeditor5-indent';
|
||||
import { IndentBlock } from '@ckeditor/ckeditor5-indent';
|
||||
import { SelectAll } from '@ckeditor/ckeditor5-select-all';
|
||||
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
|
||||
import { Clipboard } from '@ckeditor/ckeditor5-clipboard';
|
||||
import { Enter } from '@ckeditor/ckeditor5-enter';
|
||||
import { ShiftEnter } from '@ckeditor/ckeditor5-enter';
|
||||
import { Typing } from '@ckeditor/ckeditor5-typing';
|
||||
import { Undo } from '@ckeditor/ckeditor5-undo';
|
||||
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
|
||||
import { EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';
|
||||
import { SpecialCharacters, SpecialCharactersEssentials } from '@ckeditor/ckeditor5-special-characters';
|
||||
import Uploadfileplugin from "../../ckeditor5-file-upload/uploadfileplugin";
|
||||
|
||||
import Math from '@triliumnext/ckeditor5-math/src/math';
|
||||
import AutoformatMath from '@triliumnext/ckeditor5-math/src/autoformatmath';
|
||||
|
||||
import MentionCustomization from './mention_customization';
|
||||
import UploadimagePlugin from './uploadimage';
|
||||
import InternalLinkPlugin from './internallink';
|
||||
import MarkdownImportPlugin from './markdownimport';
|
||||
import CuttonotePlugin from './cuttonote';
|
||||
import IncludeNote from './includenote';
|
||||
import ReferenceLink from './referencelink';
|
||||
import indentBlockShortcutPlugin from './indent_block_shortcut';
|
||||
import removeFormatLinksPlugin from './remove_format_links';
|
||||
|
||||
import '../theme/theme.css';
|
||||
import {SpecialCharactersEmoji} from "./special_characters_emoji";
|
||||
import { COMMON_PLUGINS } from './config';
|
||||
|
||||
export default class BalloonEditor extends BalloonEditorBase {
|
||||
public static override builtinPlugins = [
|
||||
// essentials package expanded to allow selectively disable Enter and ShiftEnter
|
||||
Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo,
|
||||
CKFinderUploadAdapter,
|
||||
Autoformat,
|
||||
Bold,
|
||||
Italic,
|
||||
Underline,
|
||||
Strikethrough,
|
||||
Code,
|
||||
Superscript,
|
||||
Subscript,
|
||||
BlockQuote,
|
||||
Heading,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
ImageResize,
|
||||
ImageInline,
|
||||
Link,
|
||||
AutoLink,
|
||||
List,
|
||||
// ListProperties, deactivated because it crashes the editor. Can be reproduced with ListProperties-repro-crash.html
|
||||
TodoList,
|
||||
Paragraph,
|
||||
PasteFromOffice,
|
||||
PictureEditing,
|
||||
Table,
|
||||
TableToolbar,
|
||||
TableProperties,
|
||||
TableCellProperties,
|
||||
TableSelection,
|
||||
TableCaption,
|
||||
TableColumnResize,
|
||||
Indent,
|
||||
IndentBlock,
|
||||
BlockToolbar,
|
||||
ParagraphButtonUI,
|
||||
HeadingButtonsUI,
|
||||
Uploadfileplugin,
|
||||
UploadimagePlugin,
|
||||
TextTransformation,
|
||||
Font,
|
||||
FontColor,
|
||||
FontBackgroundColor,
|
||||
CodeBlock,
|
||||
SelectAll,
|
||||
HorizontalLine,
|
||||
RemoveFormat,
|
||||
SpecialCharacters,
|
||||
SpecialCharactersEssentials,
|
||||
SpecialCharactersEmoji,
|
||||
FindAndReplace,
|
||||
Mention,
|
||||
InternalLinkPlugin,
|
||||
MarkdownImportPlugin,
|
||||
CuttonotePlugin,
|
||||
MentionCustomization,
|
||||
IncludeNote,
|
||||
ReferenceLink,
|
||||
indentBlockShortcutPlugin,
|
||||
removeFormatLinksPlugin,
|
||||
Math,
|
||||
AutoformatMath
|
||||
...COMMON_PLUGINS,
|
||||
BlockToolbar
|
||||
];
|
||||
|
||||
public static override defaultConfig = {
|
||||
|
||||
@ -5,144 +5,12 @@
|
||||
|
||||
// The editor creator to use.
|
||||
import { DecoupledEditor as DecoupledEditorBase } from '@ckeditor/ckeditor5-editor-decoupled';
|
||||
|
||||
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
|
||||
import { CKFinderUploadAdapter } from '@ckeditor/ckeditor5-adapter-ckfinder';
|
||||
import { Autoformat } from '@ckeditor/ckeditor5-autoformat';
|
||||
import { Bold } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Italic } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Superscript } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Subscript } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Underline } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Strikethrough } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Code } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
|
||||
import { Heading } from '@ckeditor/ckeditor5-heading';
|
||||
import { Image, ImageInline } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageCaption } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageStyle } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageToolbar } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageUpload } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageResize } from '@ckeditor/ckeditor5-image';
|
||||
import { Link } from '@ckeditor/ckeditor5-link';
|
||||
import { AutoLink } from '@ckeditor/ckeditor5-link';
|
||||
import { List } from '@ckeditor/ckeditor5-list';
|
||||
import { ListProperties } from '@ckeditor/ckeditor5-list';
|
||||
import { TodoList } from '@ckeditor/ckeditor5-list';
|
||||
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office';
|
||||
import { PictureEditing } from '@ckeditor/ckeditor5-image';
|
||||
import { Table } from '@ckeditor/ckeditor5-table';
|
||||
import { TableToolbar } from '@ckeditor/ckeditor5-table';
|
||||
import { TableProperties } from '@ckeditor/ckeditor5-table';
|
||||
import { TableCellProperties } from '@ckeditor/ckeditor5-table';
|
||||
import { TableCaption } from '@ckeditor/ckeditor5-table';
|
||||
import { TableSelection } from '@ckeditor/ckeditor5-table';
|
||||
import { TableColumnResize } from '@ckeditor/ckeditor5-table';
|
||||
import { HeadingButtonsUI } from '@ckeditor/ckeditor5-heading';
|
||||
import { ParagraphButtonUI } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { TextTransformation } from '@ckeditor/ckeditor5-typing';
|
||||
import { Font } from '@ckeditor/ckeditor5-font';
|
||||
import { FontColor } from '@ckeditor/ckeditor5-font';
|
||||
import { FontBackgroundColor } from '@ckeditor/ckeditor5-font';
|
||||
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
|
||||
import { Mention } from '@ckeditor/ckeditor5-mention';
|
||||
import { Indent } from '@ckeditor/ckeditor5-indent';
|
||||
import { IndentBlock } from '@ckeditor/ckeditor5-indent';
|
||||
import { SelectAll } from '@ckeditor/ckeditor5-select-all';
|
||||
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
|
||||
import { Clipboard } from '@ckeditor/ckeditor5-clipboard';
|
||||
import { Enter } from '@ckeditor/ckeditor5-enter';
|
||||
import { ShiftEnter } from '@ckeditor/ckeditor5-enter';
|
||||
import { Typing } from '@ckeditor/ckeditor5-typing';
|
||||
import { Undo } from '@ckeditor/ckeditor5-undo';
|
||||
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
|
||||
import { EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';
|
||||
import { SpecialCharacters, SpecialCharactersEssentials } from '@ckeditor/ckeditor5-special-characters';
|
||||
import Uploadfileplugin from "../../ckeditor5-file-upload/uploadfileplugin";
|
||||
|
||||
import Math from '@triliumnext/ckeditor5-math/src/math';
|
||||
import AutoformatMath from '@triliumnext/ckeditor5-math/src/autoformatmath';
|
||||
|
||||
import MentionCustomization from './mention_customization';
|
||||
import UploadimagePlugin from './uploadimage';
|
||||
import InternalLinkPlugin from './internallink';
|
||||
import MarkdownImportPlugin from './markdownimport';
|
||||
import CuttonotePlugin from './cuttonote';
|
||||
import IncludeNote from './includenote';
|
||||
import ReferenceLink from './referencelink';
|
||||
import indentBlockShortcutPlugin from './indent_block_shortcut';
|
||||
import removeFormatLinksPlugin from './remove_format_links';
|
||||
|
||||
import '../theme/theme.css';
|
||||
import {SpecialCharactersEmoji} from "./special_characters_emoji";
|
||||
import { COMMON_PLUGINS } from './config';
|
||||
|
||||
export default class DecoupledEditor extends DecoupledEditorBase {
|
||||
public static override builtinPlugins = [
|
||||
// essentials package expanded to allow selectively disable Enter and ShiftEnter
|
||||
Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo,
|
||||
CKFinderUploadAdapter,
|
||||
Autoformat,
|
||||
Bold,
|
||||
Italic,
|
||||
Underline,
|
||||
Strikethrough,
|
||||
Code,
|
||||
Superscript,
|
||||
Subscript,
|
||||
BlockQuote,
|
||||
Heading,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
ImageResize,
|
||||
ImageInline,
|
||||
Link,
|
||||
AutoLink,
|
||||
List,
|
||||
// ListProperties, deactivated because it crashes the editor. Can be reproduced with ListProperties-repro-crash.html
|
||||
TodoList,
|
||||
Paragraph,
|
||||
PasteFromOffice,
|
||||
PictureEditing,
|
||||
Table,
|
||||
TableToolbar,
|
||||
TableProperties,
|
||||
TableCellProperties,
|
||||
TableSelection,
|
||||
TableCaption,
|
||||
TableColumnResize,
|
||||
Indent,
|
||||
IndentBlock,
|
||||
ParagraphButtonUI,
|
||||
HeadingButtonsUI,
|
||||
Uploadfileplugin,
|
||||
UploadimagePlugin,
|
||||
TextTransformation,
|
||||
Font,
|
||||
FontColor,
|
||||
FontBackgroundColor,
|
||||
CodeBlock,
|
||||
SelectAll,
|
||||
HorizontalLine,
|
||||
RemoveFormat,
|
||||
SpecialCharacters,
|
||||
SpecialCharactersEssentials,
|
||||
SpecialCharactersEmoji,
|
||||
FindAndReplace,
|
||||
Mention,
|
||||
InternalLinkPlugin,
|
||||
MarkdownImportPlugin,
|
||||
CuttonotePlugin,
|
||||
MentionCustomization,
|
||||
IncludeNote,
|
||||
ReferenceLink,
|
||||
indentBlockShortcutPlugin,
|
||||
removeFormatLinksPlugin,
|
||||
Math,
|
||||
AutoformatMath
|
||||
...COMMON_PLUGINS,
|
||||
];
|
||||
|
||||
public static override defaultConfig = {
|
||||
|
||||
136
packages/ckeditor5-build-trilium/src/config.ts
Normal file
136
packages/ckeditor5-build-trilium/src/config.ts
Normal file
@ -0,0 +1,136 @@
|
||||
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
|
||||
import { CKFinderUploadAdapter } from '@ckeditor/ckeditor5-adapter-ckfinder';
|
||||
import { Autoformat } from '@ckeditor/ckeditor5-autoformat';
|
||||
import { Bold } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Italic } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Superscript } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Subscript } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Underline } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Strikethrough } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { Code } from '@ckeditor/ckeditor5-basic-styles';
|
||||
import { BlockQuote } from '@ckeditor/ckeditor5-block-quote';
|
||||
import { Heading } from '@ckeditor/ckeditor5-heading';
|
||||
import { Image, ImageInline } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageCaption } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageStyle } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageToolbar } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageUpload } from '@ckeditor/ckeditor5-image';
|
||||
import { ImageResize } from '@ckeditor/ckeditor5-image';
|
||||
import { Link } from '@ckeditor/ckeditor5-link';
|
||||
import { AutoLink } from '@ckeditor/ckeditor5-link';
|
||||
import { List } from '@ckeditor/ckeditor5-list';
|
||||
import { ListProperties } from '@ckeditor/ckeditor5-list';
|
||||
import { TodoList } from '@ckeditor/ckeditor5-list';
|
||||
import { Paragraph } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { PasteFromOffice } from '@ckeditor/ckeditor5-paste-from-office';
|
||||
import { PictureEditing } from '@ckeditor/ckeditor5-image';
|
||||
import { Table } from '@ckeditor/ckeditor5-table';
|
||||
import { TableToolbar } from '@ckeditor/ckeditor5-table';
|
||||
import { TableProperties } from '@ckeditor/ckeditor5-table';
|
||||
import { TableCellProperties } from '@ckeditor/ckeditor5-table';
|
||||
import { TableCaption } from '@ckeditor/ckeditor5-table';
|
||||
import { TableSelection } from '@ckeditor/ckeditor5-table';
|
||||
import { TableColumnResize } from '@ckeditor/ckeditor5-table';
|
||||
import { HeadingButtonsUI } from '@ckeditor/ckeditor5-heading';
|
||||
import { ParagraphButtonUI } from '@ckeditor/ckeditor5-paragraph';
|
||||
import { TextTransformation } from '@ckeditor/ckeditor5-typing';
|
||||
import { Font } from '@ckeditor/ckeditor5-font';
|
||||
import { FontColor } from '@ckeditor/ckeditor5-font';
|
||||
import { FontBackgroundColor } from '@ckeditor/ckeditor5-font';
|
||||
import { CodeBlock } from '@ckeditor/ckeditor5-code-block';
|
||||
import { Mention } from '@ckeditor/ckeditor5-mention';
|
||||
import { Indent } from '@ckeditor/ckeditor5-indent';
|
||||
import { IndentBlock } from '@ckeditor/ckeditor5-indent';
|
||||
import { SelectAll } from '@ckeditor/ckeditor5-select-all';
|
||||
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
|
||||
import { Clipboard } from '@ckeditor/ckeditor5-clipboard';
|
||||
import { Enter } from '@ckeditor/ckeditor5-enter';
|
||||
import { ShiftEnter } from '@ckeditor/ckeditor5-enter';
|
||||
import { Typing } from '@ckeditor/ckeditor5-typing';
|
||||
import { Undo } from '@ckeditor/ckeditor5-undo';
|
||||
import { RemoveFormat } from '@ckeditor/ckeditor5-remove-format';
|
||||
import { EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';
|
||||
import { SpecialCharacters, SpecialCharactersEssentials } from '@ckeditor/ckeditor5-special-characters';
|
||||
import Uploadfileplugin from "../../ckeditor5-file-upload/uploadfileplugin";
|
||||
|
||||
import Math from '@triliumnext/ckeditor5-math/src/math';
|
||||
import AutoformatMath from '@triliumnext/ckeditor5-math/src/autoformatmath';
|
||||
|
||||
import MentionCustomization from './mention_customization';
|
||||
import UploadimagePlugin from './uploadimage';
|
||||
import InternalLinkPlugin from './internallink';
|
||||
import MarkdownImportPlugin from './markdownimport';
|
||||
import CuttonotePlugin from './cuttonote';
|
||||
import IncludeNote from './includenote';
|
||||
import ReferenceLink from './referencelink';
|
||||
import indentBlockShortcutPlugin from './indent_block_shortcut';
|
||||
import removeFormatLinksPlugin from './remove_format_links';
|
||||
|
||||
import {SpecialCharactersEmoji} from "./special_characters_emoji";
|
||||
|
||||
export const COMMON_PLUGINS = [
|
||||
// essentials package expanded to allow selectively disable Enter and ShiftEnter
|
||||
Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo,
|
||||
CKFinderUploadAdapter,
|
||||
Autoformat,
|
||||
Bold,
|
||||
Italic,
|
||||
Underline,
|
||||
Strikethrough,
|
||||
Code,
|
||||
Superscript,
|
||||
Subscript,
|
||||
BlockQuote,
|
||||
Heading,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageUpload,
|
||||
ImageResize,
|
||||
ImageInline,
|
||||
Link,
|
||||
AutoLink,
|
||||
List,
|
||||
// ListProperties, deactivated because it crashes the editor. Can be reproduced with ListProperties-repro-crash.html
|
||||
TodoList,
|
||||
Paragraph,
|
||||
PasteFromOffice,
|
||||
PictureEditing,
|
||||
Table,
|
||||
TableToolbar,
|
||||
TableProperties,
|
||||
TableCellProperties,
|
||||
TableSelection,
|
||||
TableCaption,
|
||||
TableColumnResize,
|
||||
Indent,
|
||||
IndentBlock,
|
||||
ParagraphButtonUI,
|
||||
HeadingButtonsUI,
|
||||
Uploadfileplugin,
|
||||
UploadimagePlugin,
|
||||
TextTransformation,
|
||||
Font,
|
||||
FontColor,
|
||||
FontBackgroundColor,
|
||||
CodeBlock,
|
||||
SelectAll,
|
||||
HorizontalLine,
|
||||
RemoveFormat,
|
||||
SpecialCharacters,
|
||||
SpecialCharactersEssentials,
|
||||
SpecialCharactersEmoji,
|
||||
FindAndReplace,
|
||||
Mention,
|
||||
InternalLinkPlugin,
|
||||
MarkdownImportPlugin,
|
||||
CuttonotePlugin,
|
||||
MentionCustomization,
|
||||
IncludeNote,
|
||||
ReferenceLink,
|
||||
indentBlockShortcutPlugin,
|
||||
removeFormatLinksPlugin,
|
||||
Math,
|
||||
AutoformatMath
|
||||
];
|
||||
Loading…
x
Reference in New Issue
Block a user