feat(text): set up slash commands

This commit is contained in:
Elian Doran 2025-06-16 19:07:11 +03:00
parent 507fc17701
commit 9ff4be8871
No known key found for this signature in database
3 changed files with 1729 additions and 6 deletions

View File

@ -23,17 +23,20 @@
"name": "ckeditor5", "name": "ckeditor5",
"targets": { "targets": {
"typecheck": { "typecheck": {
"dependsOn": [ "^build" ] "dependsOn": [
"^build"
]
} }
} }
}, },
"dependencies": { "dependencies": {
"ckeditor5": "45.2.0",
"@triliumnext/ckeditor5-keyboard-marker": "workspace:*",
"@triliumnext/ckeditor5-mermaid": "workspace:*",
"@triliumnext/ckeditor5-admonition": "workspace:*", "@triliumnext/ckeditor5-admonition": "workspace:*",
"@triliumnext/ckeditor5-footnotes": "workspace:*", "@triliumnext/ckeditor5-footnotes": "workspace:*",
"@triliumnext/ckeditor5-math": "workspace:*" "@triliumnext/ckeditor5-keyboard-marker": "workspace:*",
"@triliumnext/ckeditor5-math": "workspace:*",
"@triliumnext/ckeditor5-mermaid": "workspace:*",
"ckeditor5": "45.2.0",
"ckeditor5-premium-features": "45.2.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jquery": "3.5.32" "@types/jquery": "3.5.32"

View File

@ -1,4 +1,5 @@
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, Alignment, 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"; 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, Alignment, 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";
import { SlashCommand } from "ckeditor5-premium-features";
import type { Plugin } from "ckeditor5"; import type { Plugin } from "ckeditor5";
import CutToNotePlugin from "./plugins/cuttonote.js"; import CutToNotePlugin from "./plugins/cuttonote.js";
import UploadimagePlugin from "./plugins/uploadimage.js"; import UploadimagePlugin from "./plugins/uploadimage.js";
@ -77,6 +78,13 @@ export const CORE_PLUGINS: typeof Plugin[] = [
ReferenceLink ReferenceLink
]; ];
/**
* Plugins that require a premium CKEditor license key to work.
*/
export const PREMIUM_PLUGINS: typeof Plugin[] = [
SlashCommand
];
/** /**
* The set of plugins that are required for the editor to work. This is used in normal text editors (floating or fixed toolbar) but not in the attribute editor. * The set of plugins that are required for the editor to work. This is used in normal text editors (floating or fixed toolbar) but not in the attribute editor.
*/ */
@ -139,7 +147,8 @@ export const COMMON_PLUGINS: typeof Plugin[] = [
Emoji, Emoji,
...TRILIUM_PLUGINS, ...TRILIUM_PLUGINS,
...EXTERNAL_PLUGINS ...EXTERNAL_PLUGINS,
...PREMIUM_PLUGINS
]; ];
/** /**

1711
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff