fix(client): reintroduce attribute editor

This commit is contained in:
Elian Doran 2025-05-05 22:42:00 +03:00
parent b2ff0739d5
commit 307c322165
No known key found for this signature in database
3 changed files with 11 additions and 59 deletions

View File

@ -131,58 +131,6 @@ const mentionSetup: MentionConfig = {
}; };
const editorConfig = { 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: { toolbar: {
items: [] items: []
}, },
@ -213,7 +161,7 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget implem
this.$widget = $(TPL); this.$widget = $(TPL);
this.$editor = this.$widget.find(".attribute-list-editor"); this.$editor = this.$widget.find(".attribute-list-editor");
// this.initialized = this.initEditor(); this.initialized = this.initEditor();
this.$editor.on("keydown", async (e) => { this.$editor.on("keydown", async (e) => {
if (e.which === 13) { if (e.which === 13) {

View File

@ -1,5 +1,5 @@
import "ckeditor5/ckeditor5.css"; 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"; import { BalloonEditor, DecoupledEditor } from "ckeditor5";
export { EditorWatchdog } from "ckeditor5"; export { EditorWatchdog } from "ckeditor5";
@ -14,7 +14,7 @@ export type CKTextEditor = ClassicEditor | PopupEditor;
*/ */
export class AttributeEditor extends BalloonEditor { export class AttributeEditor extends BalloonEditor {
static override get builtinPlugins() { static override get builtinPlugins() {
return []; return CORE_PLUGINS;
} }
} }

View File

@ -49,12 +49,17 @@ const EXTERNAL_PLUGINS: typeof Plugin[] = [
AutoformatMath AutoformatMath
]; ];
export const CORE_PLUGINS: typeof Plugin[] = [
Clipboard, Enter, SelectAll,
ShiftEnter, Typing, Undo,
Paragraph
];
export const COMMON_PLUGINS: typeof Plugin[] = [ export const COMMON_PLUGINS: typeof Plugin[] = [
...CORE_PLUGINS,
...TRILIUM_PLUGINS, ...TRILIUM_PLUGINS,
...EXTERNAL_PLUGINS, ...EXTERNAL_PLUGINS,
// essentials package expanded to allow selectively disable Enter and ShiftEnter
Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo,
CKFinderUploadAdapter, CKFinderUploadAdapter,
Autoformat, Autoformat,
Bold, Bold,
@ -78,7 +83,6 @@ export const COMMON_PLUGINS: typeof Plugin[] = [
List, List,
ListProperties, ListProperties,
TodoList, TodoList,
Paragraph,
PasteFromOffice, PasteFromOffice,
PictureEditing, PictureEditing,
Table, Table,
@ -107,7 +111,7 @@ export const COMMON_PLUGINS: typeof Plugin[] = [
PageBreak, PageBreak,
GeneralHtmlSupport, GeneralHtmlSupport,
TextPartLanguage, TextPartLanguage,
Style Style
]; ];
export const POPUP_EDITOR_PLUGINS: typeof Plugin[] = [ export const POPUP_EDITOR_PLUGINS: typeof Plugin[] = [