Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(client): reintroduce attribute editor
Elian Doran307c322165d2
diff --git a/apps/client/src/widgets/attribute_widgets/attribute_editor.ts b/apps/client/src/widgets/attribute_widgets/attribute_editor.tsindex 572f5d12bf..8029b8d4c7 100644--- a/apps/client/src/widgets/attribute_widgets/attribute_editor.ts+++ b/apps/client/src/widgets/attribute_widgets/attribute_editor.ts@@ -131,58 +131,6 @@ const mentionSetup: MentionConfig = {};const editorConfig = {- ...buildConfig(),- removePlugins: [- "Heading",- "Link",- "Autoformat",- "Bold",- "Italic",- "Underline",- "Strikethrough",- "Code",- "Superscript",- "Subscript",- "BlockQuote",- "Image",- "ImageCaption",- "ImageStyle",- "ImageToolbar",- "ImageUpload",- "ImageResize",- "List",- "TodoList",- "PasteFromOffice",- "Table",- "TableToolbar",- "TableProperties",- "TableCellProperties",- "Indent",- "IndentBlock",- "BlockToolbar",- "ParagraphButtonUI",- "HeadingButtonsUI",- "UploadimagePlugin",- "InternalLinkPlugin",- "MarkdownImportPlugin",- "CuttonotePlugin",- "TextTransformation",- "Font",- "FontColor",- "FontBackgroundColor",- "CodeBlock",- "SelectAll",- "IncludeNote",- "CutToNote",- "Math",- "AutoformatMath",- "indentBlockShortcutPlugin",- "removeFormatLinksPlugin",- "Footnotes",- "Mermaid",- "Kbd",- "Admonition"- ],toolbar: {items: []},@@ -213,7 +161,7 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget implemthis.$widget = $(TPL);this.$editor = this.$widget.find(".attribute-list-editor");- // this.initialized = this.initEditor();+ this.initialized = this.initEditor();this.$editor.on("keydown", async (e) => {if (e.which === 13) {diff --git a/packages/ckeditor5/src/index.ts b/packages/ckeditor5/src/index.tsindex 2edbae35a9..8c4d887c15 100644--- a/packages/ckeditor5/src/index.ts+++ b/packages/ckeditor5/src/index.ts@@ -1,5 +1,5 @@import "ckeditor5/ckeditor5.css";-import { COMMON_PLUGINS, POPUP_EDITOR_PLUGINS } from "./plugins";+import { COMMON_PLUGINS, CORE_PLUGINS, POPUP_EDITOR_PLUGINS } from "./plugins";import { BalloonEditor, DecoupledEditor } from "ckeditor5";export { EditorWatchdog } from "ckeditor5";@@ -14,7 +14,7 @@ export type CKTextEditor = ClassicEditor | PopupEditor;*/export class AttributeEditor extends BalloonEditor {static override get builtinPlugins() {- return [];+ return CORE_PLUGINS;}}diff --git a/packages/ckeditor5/src/plugins.ts b/packages/ckeditor5/src/plugins.tsindex 3e0b09f8bb..70e4691d92 100644--- a/packages/ckeditor5/src/plugins.ts+++ b/packages/ckeditor5/src/plugins.ts@@ -49,12 +49,17 @@ const EXTERNAL_PLUGINS: typeof Plugin[] = [AutoformatMath];+export const CORE_PLUGINS: typeof Plugin[] = [+ Clipboard, Enter, SelectAll,+ ShiftEnter, Typing, Undo,+ Paragraph+];+export const COMMON_PLUGINS: typeof Plugin[] = [+ ...CORE_PLUGINS,...TRILIUM_PLUGINS,...EXTERNAL_PLUGINS,- // essentials package expanded to allow selectively disable Enter and ShiftEnter- Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo,CKFinderUploadAdapter,Autoformat,Bold,@@ -78,7 +83,6 @@ export const COMMON_PLUGINS: typeof Plugin[] = [List,ListProperties,TodoList,- Paragraph,PasteFromOffice,PictureEditing,Table,@@ -107,7 +111,7 @@ export const COMMON_PLUGINS: typeof Plugin[] = [PageBreak,GeneralHtmlSupport,TextPartLanguage,- Style+ Style];export const POPUP_EDITOR_PLUGINS: typeof Plugin[] = [