-import {$getNearestBlockElementAncestorOrThrow, mergeRegister} from '@lexical/utils';
-import {$generateNodesFromDOM} from '@lexical/html';
-import {$setBlocksType} from '@lexical/selection';
-import {getNodesForPageEditor} from './nodes';
-import {$createCalloutNode, $isCalloutNode, CalloutCategory} from './nodes/callout';
-
-export function createPageEditorInstance(editArea: HTMLElement) {
- const config: CreateEditorArgs = {
+import {mergeRegister} from '@lexical/utils';
+import {getNodesForBasicEditor, getNodesForPageEditor, registerCommonNodeMutationListeners} from './nodes';
+import {buildEditorUI} from "./ui";
+import {focusEditor, getEditorContentAsHtml, setEditorContentFromHtml} from "./utils/actions";
+import {registerTableResizer} from "./ui/framework/helpers/table-resizer";
+import {EditorUiContext} from "./ui/framework/core";
+import {listen as listenToCommonEvents} from "./services/common-events";
+import {registerDropPasteHandling} from "./services/drop-paste-handling";
+import {registerTaskListHandler} from "./ui/framework/helpers/task-list-handler";
+import {registerTableSelectionHandler} from "./ui/framework/helpers/table-selection-handler";
+import {registerShortcuts} from "./services/shortcuts";
+import {registerNodeResizer} from "./ui/framework/helpers/node-resizer";
+import {registerKeyboardHandling} from "./services/keyboard-handling";
+import {registerAutoLinks} from "./services/auto-links";
+import {contextToolbars, getBasicEditorToolbar, getMainEditorFullToolbar} from "./ui/defaults/toolbars";
+import {modals} from "./ui/defaults/modals";
+import {CodeBlockDecorator} from "./ui/decorators/code-block";
+import {DiagramDecorator} from "./ui/decorators/diagram";
+
+const theme = {
+ text: {
+ bold: 'editor-theme-bold',
+ code: 'editor-theme-code',
+ italic: 'editor-theme-italic',
+ strikethrough: 'editor-theme-strikethrough',
+ subscript: 'editor-theme-subscript',
+ superscript: 'editor-theme-superscript',
+ underline: 'editor-theme-underline',
+ underlineStrikethrough: 'editor-theme-underline-strikethrough',
+ }
+};
+
+export function createPageEditorInstance(container: HTMLElement, htmlContent: string, options: Record<string, any> = {}): SimpleWysiwygEditorInterface {
+ const editor = createEditor({