1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-12-23 23:02:08 +03:00

Lexical: Added common events support

This commit is contained in:
Dan Brown
2024-07-23 15:35:18 +01:00
parent 2cab778f19
commit 76b0d2d5d8
5 changed files with 116 additions and 16 deletions

View File

@@ -8,6 +8,7 @@ import {getEditorContentAsHtml, setEditorContentFromHtml} from "./actions";
import {registerTableResizer} from "./ui/framework/helpers/table-resizer";
import {el} from "./helpers";
import {EditorUiContext} from "./ui/framework/core";
import {listen as listenToCommonEvents} from "./common-events";
export function createPageEditorInstance(container: HTMLElement, htmlContent: string, options: Record<string, any> = {}): SimpleWysiwygEditorInterface {
const config: CreateEditorArgs = {
@@ -47,6 +48,8 @@ export function createPageEditorInstance(container: HTMLElement, htmlContent: st
registerTableResizer(editor, editWrap),
);
listenToCommonEvents(editor);
setEditorContentFromHtml(editor, htmlContent);
const debugView = document.getElementById('lexical-debug');