Skip to content

Build your personal knowledge base with Trilium Notes

chore(ckeditor5): integrate building of ballon & decoupled

Elian Doranba6781210161
diff --git a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor.ts b/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor.ts
deleted file mode 100644
index d237c9f115..0000000000
--- a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { EditorWatchdog } from "@ckeditor/ckeditor5-watchdog";
-import BalloonEditor from "./ckeditor_balloon";
-import DecoupledEditor from "./ckeditor_decoupled";
-
-export default {
- BalloonEditor,
- DecoupledEditor,
- EditorWatchdog
-}
diff --git a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/config.ts b/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/config.ts
deleted file mode 100644
index f385f81f6e..0000000000
--- a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/config.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-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 { SpecialCharacters, SpecialCharactersEssentials } from '@ckeditor/ckeditor5-special-characters';
-import { GeneralHtmlSupport } from "@ckeditor/ckeditor5-html-support";
-import Uploadfileplugin from "../../ckeditor5-file-upload/uploadfileplugin";
-import { PageBreak } from '@ckeditor/ckeditor5-page-break';
-import { TextPartLanguage } from "@ckeditor/ckeditor5-language";
-import { Style } from "../../ckeditor5-style";
-
-import MentionCustomization from './mention_customization';
-import UploadimagePlugin from './uploadimage';
-import InternalLinkPlugin from './internallink';
-import ItalicAsEmPlugin from './italic_as_em';
-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";
-
-// External plugins
-import { Math, AutoformatMath } from '../../ckeditor5-math/src/index';
-
-import { Mermaid } from "../../ckeditor5-mermaid/src/index";
-
-import '../../ckeditor5-footnotes/src/footnote.css';
-import { Footnotes } from '../../ckeditor5-footnotes';
-import Kbd from "../../ckeditor5-keyboard-marker/src/Kbd";
-import { Admonition } from "../../ckeditor5-admonition";
-import StrikethroughAsDel from './strikethrough_as_del';
-
-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,
- 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,
- ItalicAsEmPlugin,
- StrikethroughAsDel,
- MarkdownImportPlugin,
- CuttonotePlugin,
- MentionCustomization,
- IncludeNote,
- ReferenceLink,
- indentBlockShortcutPlugin,
- removeFormatLinksPlugin,
- PageBreak,
- GeneralHtmlSupport,
- TextPartLanguage,
- Style,
-
- // External plugins
- Math,
- AutoformatMath,
- Footnotes,
- Mermaid,
- Kbd,
- Admonition
-];
-
-export const COMMON_SETTINGS = { };
diff --git a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor_balloon.ts b/packages/ckeditor5/src/ckeditor_balloon.ts
similarity index 59%
rename from _regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor_balloon.ts
rename to packages/ckeditor5/src/ckeditor_balloon.ts
index 0866ddbfe0..091a375d65 100644
--- a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor_balloon.ts
+++ b/packages/ckeditor5/src/ckeditor_balloon.ts
@@ -4,12 +4,11 @@
*/
// The editor creator to use.
-import { BalloonEditor as BalloonEditorBase } from '@ckeditor/ckeditor5-editor-balloon';
-import { BlockToolbar } from '@ckeditor/ckeditor5-ui';
-import '../theme/theme.css';
-import { COMMON_PLUGINS, COMMON_SETTINGS } from './config';
+import { BalloonEditor as BalloonEditorBase } from "ckeditor5";
+import { BlockToolbar } from "ckeditor5";
+import './theme/theme.css';
+import { COMMON_PLUGINS } from './config.js';
-//@ts-ignore
export default class BalloonEditor extends BalloonEditorBase {
public static override builtinPlugins = [
...COMMON_PLUGINS,
diff --git a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor_decoupled.ts b/packages/ckeditor5/src/ckeditor_decoupled.ts
similarity index 63%
rename from _regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor_decoupled.ts
rename to packages/ckeditor5/src/ckeditor_decoupled.ts
index 1439803a55..e74b3e9509 100644
--- a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/src/ckeditor_decoupled.ts
+++ b/packages/ckeditor5/src/ckeditor_decoupled.ts
@@ -4,11 +4,10 @@
*/
// The editor creator to use.
-import { DecoupledEditor as DecoupledEditorBase } from '@ckeditor/ckeditor5-editor-decoupled';
-import '../theme/theme.css';
-import { COMMON_PLUGINS, COMMON_SETTINGS } from './config';
+import { DecoupledEditor as DecoupledEditorBase } from "ckeditor5";
+import './theme/theme.css';
+import { COMMON_PLUGINS } from './config.js';
-//@ts-ignore
export default class DecoupledEditor extends DecoupledEditorBase {
public static override builtinPlugins = [
...COMMON_PLUGINS,
diff --git a/packages/ckeditor5/src/config.ts b/packages/ckeditor5/src/config.ts
new file mode 100644
index 0000000000..4dd3e01b24
--- /dev/null
+++ b/packages/ckeditor5/src/config.ts
@@ -0,0 +1,82 @@
+import { Autoformat, AutoLink, BlockQuote, Bold, CKFinderUploadAdapter, Clipboard, Code, CodeBlock, Enter, FindAndReplace, Font, FontBackgroundColor, FontColor, GeneralHtmlSupport, Heading, HeadingButtonsUI, HorizontalLine, Image, ImageCaption, ImageInline, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, Link, List, ListProperties, Mention, PageBreak, Paragraph, ParagraphButtonUI, PasteFromOffice, PictureEditing, RemoveFormat, SelectAll, ShiftEnter, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableSelection, TableToolbar, TextPartLanguage, TextTransformation, TodoList, Typing, Underline, Undo } from "ckeditor5";
+
+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,
+ 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,
+ // ItalicAsEmPlugin,
+ // StrikethroughAsDel,
+ // MarkdownImportPlugin,
+ // CuttonotePlugin,
+ // MentionCustomization,
+ // IncludeNote,
+ // ReferenceLink,
+ // indentBlockShortcutPlugin,
+ // removeFormatLinksPlugin,
+ PageBreak,
+ GeneralHtmlSupport,
+ TextPartLanguage,
+ Style,
+
+ // External plugins
+ // Math,
+ // AutoformatMath,
+ // Footnotes,
+ // Mermaid,
+ // Kbd,
+ // Admonition
+];
+
+export const COMMON_SETTINGS = { };
diff --git a/packages/ckeditor5/src/index.ts b/packages/ckeditor5/src/index.ts
index 0a3d596050..c43c91ac1f 100644
--- a/packages/ckeditor5/src/index.ts
+++ b/packages/ckeditor5/src/index.ts
@@ -1 +1,9 @@
-export * from './lib/ckeditor5.js';
+import { EditorWatchdog } from "ckeditor5";
+import BalloonEditor from "./ckeditor_balloon.js";
+import DecoupledEditor from "./ckeditor_decoupled.js";
+
+export default {
+ BalloonEditor,
+ DecoupledEditor,
+ EditorWatchdog
+}
diff --git a/packages/ckeditor5/src/lib/ckeditor5.ts b/packages/ckeditor5/src/lib/ckeditor5.ts
deleted file mode 100644
index 4fc670ed3b..0000000000
--- a/packages/ckeditor5/src/lib/ckeditor5.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export function ckeditor5(): string {
- return 'ckeditor5';
-}
diff --git a/_regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/theme/theme.css b/packages/ckeditor5/src/theme/theme.css
similarity index 100%
rename from _regroup/ckeditor5-build-trilium/packages/ckeditor5-build-trilium/theme/theme.css
rename to packages/ckeditor5/src/theme/theme.css