2025-05-07 18:27:37 +03:00
|
|
|
import { Autoformat, AutoLink, BlockQuote, BlockToolbar, 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, Bookmark, Emoji } from "ckeditor5";
|
2025-05-03 15:05:00 +03:00
|
|
|
import type { Plugin } from "ckeditor5";
|
|
|
|
import CutToNotePlugin from "./plugins/cuttonote.js";
|
2025-05-03 16:40:32 +03:00
|
|
|
import UploadimagePlugin from "./plugins/uploadimage.js";
|
2025-05-03 16:45:42 +03:00
|
|
|
import ItalicAsEmPlugin from "./plugins/italic_as_em.js";
|
|
|
|
import StrikethroughAsDel from "./plugins/strikethrough_as_del.js";
|
2025-05-03 16:51:17 +03:00
|
|
|
import InternalLinkPlugin from "./plugins/internallink.js";
|
2025-05-03 17:00:24 +03:00
|
|
|
import ReferenceLink from "./plugins/referencelink.js";
|
2025-05-03 17:05:50 +03:00
|
|
|
import RemoveFormatLinksPlugin from "./plugins/remove_format_links.js";
|
2025-05-03 17:20:14 +03:00
|
|
|
import IndentBlockShortcutPlugin from "./plugins/indent_block_shortcut.js";
|
2025-05-03 17:22:49 +03:00
|
|
|
import MarkdownImportPlugin from "./plugins/markdownimport.js";
|
2025-05-03 17:48:22 +03:00
|
|
|
import MentionCustomization from "./plugins/mention_customization.js";
|
2025-05-03 18:04:29 +03:00
|
|
|
import IncludeNote from "./plugins/includenote.js";
|
2025-05-03 23:39:30 +03:00
|
|
|
import Uploadfileplugin from "./plugins/file_upload/uploadfileplugin.js";
|
2025-05-08 14:56:02 +03:00
|
|
|
import SyntaxHighlighting from "./plugins/syntax_highlighting/index.js";
|
2025-05-04 14:47:59 +03:00
|
|
|
import { Kbd } from "@triliumnext/ckeditor5-keyboard-marker";
|
2025-05-04 17:25:30 +03:00
|
|
|
import { Mermaid } from "@triliumnext/ckeditor5-mermaid";
|
2025-05-04 19:06:23 +03:00
|
|
|
import { Admonition } from "@triliumnext/ckeditor5-admonition";
|
2025-05-04 21:10:06 +03:00
|
|
|
import { Footnotes } from "@triliumnext/ckeditor5-footnotes";
|
2025-05-04 23:03:29 +03:00
|
|
|
import { Math, AutoformatMath } from "@triliumnext/ckeditor5-math";
|
2025-05-03 12:14:45 +03:00
|
|
|
|
2025-05-04 18:12:04 +03:00
|
|
|
import "@triliumnext/ckeditor5-mermaid/index.css";
|
2025-05-04 19:06:23 +03:00
|
|
|
import "@triliumnext/ckeditor5-admonition/index.css";
|
2025-05-04 21:10:06 +03:00
|
|
|
import "@triliumnext/ckeditor5-footnotes/index.css";
|
2025-05-04 23:03:29 +03:00
|
|
|
import "@triliumnext/ckeditor5-math/index.css";
|
2025-05-04 18:12:04 +03:00
|
|
|
|
2025-05-03 15:05:00 +03:00
|
|
|
const TRILIUM_PLUGINS: typeof Plugin[] = [
|
2025-05-03 16:40:32 +03:00
|
|
|
CutToNotePlugin,
|
2025-05-03 16:45:42 +03:00
|
|
|
ItalicAsEmPlugin,
|
|
|
|
StrikethroughAsDel,
|
2025-05-03 17:00:24 +03:00
|
|
|
ReferenceLink,
|
2025-05-03 16:51:17 +03:00
|
|
|
UploadimagePlugin,
|
2025-05-03 17:05:50 +03:00
|
|
|
InternalLinkPlugin,
|
2025-05-03 17:14:18 +03:00
|
|
|
RemoveFormatLinksPlugin,
|
2025-05-03 17:22:49 +03:00
|
|
|
IndentBlockShortcutPlugin,
|
2025-05-03 17:48:22 +03:00
|
|
|
MarkdownImportPlugin,
|
2025-05-03 18:04:29 +03:00
|
|
|
MentionCustomization,
|
2025-05-03 23:39:30 +03:00
|
|
|
IncludeNote,
|
2025-05-08 14:56:02 +03:00
|
|
|
Uploadfileplugin,
|
|
|
|
SyntaxHighlighting
|
2025-05-03 15:05:00 +03:00
|
|
|
];
|
|
|
|
|
2025-05-04 14:47:59 +03:00
|
|
|
const EXTERNAL_PLUGINS: typeof Plugin[] = [
|
2025-05-04 17:25:30 +03:00
|
|
|
Kbd,
|
2025-05-04 19:06:23 +03:00
|
|
|
Mermaid,
|
2025-05-04 21:10:06 +03:00
|
|
|
Admonition,
|
2025-05-04 23:03:29 +03:00
|
|
|
Footnotes,
|
|
|
|
Math,
|
|
|
|
AutoformatMath
|
2025-05-04 14:47:59 +03:00
|
|
|
];
|
|
|
|
|
2025-05-05 22:42:00 +03:00
|
|
|
export const CORE_PLUGINS: typeof Plugin[] = [
|
|
|
|
Clipboard, Enter, SelectAll,
|
|
|
|
ShiftEnter, Typing, Undo,
|
2025-05-06 19:42:32 +03:00
|
|
|
Paragraph,
|
|
|
|
Mention
|
2025-05-05 22:42:00 +03:00
|
|
|
];
|
|
|
|
|
2025-05-03 15:05:00 +03:00
|
|
|
export const COMMON_PLUGINS: typeof Plugin[] = [
|
2025-05-05 22:42:00 +03:00
|
|
|
...CORE_PLUGINS,
|
2025-05-03 17:14:18 +03:00
|
|
|
...TRILIUM_PLUGINS,
|
2025-05-04 14:47:59 +03:00
|
|
|
...EXTERNAL_PLUGINS,
|
2025-05-03 17:14:18 +03:00
|
|
|
|
2025-05-03 12:14:45 +03:00
|
|
|
CKFinderUploadAdapter,
|
|
|
|
Autoformat,
|
|
|
|
Bold,
|
|
|
|
Italic,
|
|
|
|
Underline,
|
|
|
|
Strikethrough,
|
|
|
|
Code,
|
|
|
|
Superscript,
|
|
|
|
Subscript,
|
|
|
|
BlockQuote,
|
|
|
|
Heading,
|
|
|
|
Image,
|
|
|
|
ImageCaption,
|
|
|
|
ImageStyle,
|
|
|
|
ImageToolbar,
|
|
|
|
ImageUpload,
|
|
|
|
ImageResize,
|
|
|
|
ImageInline,
|
|
|
|
Link,
|
|
|
|
AutoLink,
|
|
|
|
List,
|
|
|
|
ListProperties,
|
|
|
|
TodoList,
|
|
|
|
PasteFromOffice,
|
|
|
|
PictureEditing,
|
|
|
|
Table,
|
|
|
|
TableToolbar,
|
|
|
|
TableProperties,
|
|
|
|
TableCellProperties,
|
|
|
|
TableSelection,
|
|
|
|
TableCaption,
|
|
|
|
TableColumnResize,
|
|
|
|
Indent,
|
|
|
|
IndentBlock,
|
|
|
|
ParagraphButtonUI,
|
|
|
|
HeadingButtonsUI,
|
|
|
|
TextTransformation,
|
|
|
|
Font,
|
|
|
|
FontColor,
|
|
|
|
FontBackgroundColor,
|
|
|
|
CodeBlock,
|
|
|
|
SelectAll,
|
|
|
|
HorizontalLine,
|
|
|
|
RemoveFormat,
|
|
|
|
SpecialCharacters,
|
|
|
|
SpecialCharactersEssentials,
|
|
|
|
FindAndReplace,
|
|
|
|
PageBreak,
|
|
|
|
GeneralHtmlSupport,
|
|
|
|
TextPartLanguage,
|
2025-05-07 16:08:33 +03:00
|
|
|
Style,
|
2025-05-07 18:27:37 +03:00
|
|
|
Bookmark,
|
|
|
|
Emoji
|
2025-05-03 12:14:45 +03:00
|
|
|
];
|
|
|
|
|
2025-05-05 15:43:14 +03:00
|
|
|
export const POPUP_EDITOR_PLUGINS: typeof Plugin[] = [
|
|
|
|
...COMMON_PLUGINS,
|
|
|
|
BlockToolbar
|
|
|
|
];
|
|
|
|
|
2025-05-03 12:14:45 +03:00
|
|
|
export const COMMON_SETTINGS = { };
|