Lexical: Finished up core drawing insert/editing

Added new options that sits on the context, for things needed but not
for the core editor, which are defined out of the editor (drawio URL,
error message text, pageId etc...)
This commit is contained in:
Dan Brown
2024-07-19 12:09:41 +01:00
parent fb87fb5750
commit c7c0df0964
13 changed files with 128 additions and 30 deletions

View File

@ -3,17 +3,18 @@ import {EditorUIManager} from "./manager";
import {el} from "../../helpers";
export type EditorUiStateUpdate = {
editor: LexicalEditor,
selection: BaseSelection|null,
editor: LexicalEditor;
selection: BaseSelection|null;
};
export type EditorUiContext = {
editor: LexicalEditor,
editorDOM: HTMLElement,
containerDOM: HTMLElement,
translate: (text: string) => string,
manager: EditorUIManager,
lastSelection: BaseSelection|null,
editor: LexicalEditor; // Lexical editor instance
editorDOM: HTMLElement; // DOM element the editor is bound to
containerDOM: HTMLElement; // DOM element which contains all editor elements
translate: (text: string) => string; // Translate function
manager: EditorUIManager; // UI Manager instance for this editor
lastSelection: BaseSelection|null; // The last tracked selection made by the user
options: Record<string, any>; // General user options which may be used by sub elements
};
export abstract class EditorUiElement {