@lobehub/editor 4.10.6 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { A as $createCodeMirrorNode, At as createDebugLogger, B as Editor, C as $createCodeNode$1, D as getCodeInlineNode, Ft as init_debug, Gt as INodeHelper, H as DataSource, Ht as exportNodeToJSON$1, Jt as __exportAll, K as $closest, Kt as init_helper, L as CursorNode, Lt as $canShowPlaceholderCurry, N as $createCursorNode, O as styles$2, Ot as init_hotkey, R as cursorNodeSerialized, Rt as $isCursorInQuote, Tt as HotkeyEnum, Ut as init_utils$1, Vt as createBlockNode, Wt as sampleReader, Xt as __toESM, Y as $getNodeFromDOMNode, d as $isLinkHighlightNode, i as MentionNode, it as genServiceId, k as themeStyles, mt as noop, n as $createMentionNode, p as getLinkHighlightNode, q as $closestNodeType, qt as __commonJSMin, r as $isMentionNode, t as styles$3, tt as assert, u as $createLinkHighlightNode, ut as init_utils, vt as KernelPlugin, w as $isCodeInlineNode, yt as init_plugin, z as registerCursorNode, zt as $isCursorInTable } from "./style-CLtp6okE.js";
1
+ import { A as $createCodeMirrorNode, At as createDebugLogger, B as Editor, C as $createCodeNode$1, D as getCodeInlineNode, Ft as init_debug, Gt as INodeHelper, H as DataSource, Ht as exportNodeToJSON$1, Jt as __exportAll, K as $closest, Kt as init_helper, L as CursorNode, Lt as $canShowPlaceholderCurry, N as $createCursorNode, O as styles$2, Ot as init_hotkey, R as cursorNodeSerialized, Rt as $isCursorInQuote, Tt as HotkeyEnum, Ut as init_utils$1, Vt as createBlockNode, Wt as sampleReader, Xt as __toESM, Y as $getNodeFromDOMNode, d as $isLinkHighlightNode, i as MentionNode, it as genServiceId, k as themeStyles, mt as noop, n as $createMentionNode, p as getLinkHighlightNode, q as $closestNodeType, qt as __commonJSMin, r as $isMentionNode, t as styles$3, tt as assert, u as $createLinkHighlightNode, ut as init_utils, vt as KernelPlugin, w as $isCodeInlineNode, yt as init_plugin, z as registerCursorNode, zt as $isCursorInTable } from "./style-DjwW7ClE.js";
2
2
  import { registerHistory } from "@lexical/history";
3
3
  import { $isTableSelection } from "@lexical/table";
4
4
  import { $caretFromPoint, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createTabNode, $createTextNode, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getNearestNodeFromDOMNode, $getNodeByKey, $getRoot, $getSelection, $getSiblingCaret, $getTextPointCaret, $insertNodes, $isBlockElementNode, $isDecoratorNode, $isElementNode, $isLineBreakNode, $isNodeSelection, $isRangeSelection, $isRootOrShadowRoot, $isTabNode, $isTextNode, $isTextPointCaret, $normalizeCaret, $parseSerializedNode, $setSelection, $setSelectionFromCaretRange, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, IS_BOLD, IS_CODE, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, MOVE_TO_END, MOVE_TO_START, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, ParagraphNode, REDO_COMMAND, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, createCommand, getDOMSelection, getNearestEditorFromDOMNode, resetRandomKey } from "lexical";
@@ -9,7 +9,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { Children, Suspense, createContext, memo, use, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
10
10
  import { $isAtNodeEnd, $setBlocksType } from "@lexical/selection";
11
11
  import { registerDragonSupport } from "@lexical/dragon";
12
- import { $insertList, $isListItemNode, $isListNode } from "@lexical/list";
12
+ import { $createListItemNode, $insertList, $isListItemNode, $isListNode } from "@lexical/list";
13
13
  import remarkCjkFriendly from "remark-cjk-friendly";
14
14
  import { $getClipboardDataFromSelection, setLexicalClipboardDataTransfer } from "@lexical/clipboard";
15
15
  import { $createCodeHighlightNode, $createCodeNode, $getEndOfCodeInLine, $getFirstCodeNodeOfLine, $getLastCodeNodeOfLine, $getStartOfCodeInLine, $isCodeHighlightNode, $isCodeNode, CodeHighlightNode, CodeNode, DEFAULT_CODE_LANGUAGE } from "@lexical/code-core";
@@ -21288,6 +21288,47 @@ function getCodeLanguageByInput(input) {
21288
21288
  return bundledLanguagesInfo.find((lang) => lang.id === inputLang || lang.aliases?.includes(inputLang))?.id || "plaintext";
21289
21289
  }
21290
21290
  //#endregion
21291
+ //#region src/plugins/block/service/i-block-menu-service.ts
21292
+ const IBlockMenuService = genServiceId("BlockMenuService");
21293
+ var BlockMenuService = class {
21294
+ constructor() {
21295
+ this.actionButtons = /* @__PURE__ */ new Map();
21296
+ this.items = /* @__PURE__ */ new Map();
21297
+ this.listeners = /* @__PURE__ */ new Set();
21298
+ }
21299
+ getActionButtons(context) {
21300
+ return Array.from(this.actionButtons.values()).filter((item) => item.when ? item.when(context) : true).sort((a, b) => (a.order || 0) - (b.order || 0));
21301
+ }
21302
+ getMenus(context) {
21303
+ return Array.from(this.items.values()).filter((item) => item.when ? item.when(context) : true).sort((a, b) => (a.order || 0) - (b.order || 0));
21304
+ }
21305
+ registerActionButton(item) {
21306
+ this.actionButtons.set(item.key, item);
21307
+ this.notify();
21308
+ return () => {
21309
+ this.actionButtons.delete(item.key);
21310
+ this.notify();
21311
+ };
21312
+ }
21313
+ registerMenu(item) {
21314
+ this.items.set(item.key, item);
21315
+ this.notify();
21316
+ return () => {
21317
+ this.items.delete(item.key);
21318
+ this.notify();
21319
+ };
21320
+ }
21321
+ subscribe(listener) {
21322
+ this.listeners.add(listener);
21323
+ return () => {
21324
+ this.listeners.delete(listener);
21325
+ };
21326
+ }
21327
+ notify() {
21328
+ for (const listener of this.listeners) listener();
21329
+ }
21330
+ };
21331
+ //#endregion
21291
21332
  //#region src/plugins/codeblock/plugin/FacadeShiki.ts
21292
21333
  init_helper();
21293
21334
  const shiki = createHighlighterCoreSync({
@@ -22488,10 +22529,12 @@ const SlashPlugin = class extends KernelPlugin {
22488
22529
  }
22489
22530
  constructor(kernel, config) {
22490
22531
  super();
22532
+ this.kernel = kernel;
22491
22533
  this.config = config;
22492
22534
  this.service = null;
22493
22535
  this.currentSlashTrigger = null;
22494
22536
  this.currentSlashTriggerIndex = -1;
22537
+ this.manualOpen = false;
22495
22538
  this.suppressOpen = false;
22496
22539
  this.service = new SlashService(kernel);
22497
22540
  kernel.registerService(ISlashService, this.service);
@@ -22503,13 +22546,66 @@ const SlashPlugin = class extends KernelPlugin {
22503
22546
  this.config?.triggerClose?.();
22504
22547
  this.currentSlashTrigger = null;
22505
22548
  this.currentSlashTriggerIndex = -1;
22549
+ this.manualOpen = false;
22506
22550
  this.suppressOpen = true;
22507
22551
  }
22508
22552
  onInit(editor) {
22553
+ const blockMenuService = this.kernel.requireService(IBlockMenuService);
22554
+ if (blockMenuService) {
22555
+ const unregisterAddBlockButton = blockMenuService.registerActionButton({
22556
+ icon: "plus",
22557
+ key: "__slash_add_below",
22558
+ onClick: (context) => {
22559
+ const lexicalEditor = context.editor.getLexicalEditor();
22560
+ if (!lexicalEditor) return;
22561
+ const slashOptions = this.service?.getSlashOptions("/") || this.config?.slashOptions?.[0];
22562
+ if (!slashOptions) return;
22563
+ let nextParagraphBlockId = null;
22564
+ lexicalEditor.focus();
22565
+ lexicalEditor.update(() => {
22566
+ const targetNode = $getNodeByKey(context.blockId);
22567
+ if (!targetNode) return;
22568
+ let nextNode;
22569
+ if ($isListItemNode(targetNode)) {
22570
+ nextNode = $createListItemNode();
22571
+ targetNode.insertAfter(nextNode);
22572
+ } else {
22573
+ nextNode = $createParagraphNode();
22574
+ targetNode.insertAfter(nextNode);
22575
+ }
22576
+ nextNode.selectStart();
22577
+ nextParagraphBlockId = nextNode.getKey();
22578
+ });
22579
+ const fallbackRect = context.blockElement.getBoundingClientRect();
22580
+ this.manualOpen = true;
22581
+ this.currentSlashTrigger = slashOptions.trigger;
22582
+ this.currentSlashTriggerIndex = -1;
22583
+ this.config?.triggerOpen({
22584
+ getRect: () => {
22585
+ if (nextParagraphBlockId) {
22586
+ const paragraphElement = lexicalEditor.getRootElement()?.querySelector(`[data-block-id="${nextParagraphBlockId}"]`);
22587
+ if (paragraphElement) return paragraphElement.getBoundingClientRect();
22588
+ }
22589
+ return fallbackRect;
22590
+ },
22591
+ items: slashOptions.items,
22592
+ lastIndex: -1,
22593
+ match: null,
22594
+ trigger: slashOptions.trigger
22595
+ });
22596
+ },
22597
+ order: -100,
22598
+ title: "Add block below"
22599
+ });
22600
+ this.register(unregisterAddBlockButton);
22601
+ }
22509
22602
  this.register(editor.registerCommand(KEY_DOWN_COMMAND, (event) => {
22510
22603
  if (event.isComposing) return false;
22511
22604
  const key = event.key;
22512
- if (key.length === 1 || key === "Backspace" || key === "Delete") this.suppressOpen = false;
22605
+ if (key.length === 1 || key === "Backspace" || key === "Delete") {
22606
+ this.suppressOpen = false;
22607
+ this.manualOpen = false;
22608
+ }
22513
22609
  return false;
22514
22610
  }, COMMAND_PRIORITY_CRITICAL));
22515
22611
  this.register(editor.registerUpdateListener(() => {
@@ -22518,6 +22614,7 @@ const SlashPlugin = class extends KernelPlugin {
22518
22614
  this.triggerClose();
22519
22615
  return;
22520
22616
  }
22617
+ if (this.manualOpen) return;
22521
22618
  if (editor.isComposing()) return;
22522
22619
  const editorWindow = editor._window || window;
22523
22620
  if (editorWindow === void 0 || !editorWindow.document) return;
@@ -22971,4 +23068,4 @@ const ReactSlashPlugin = ({ children, anchorClassName, getPopupContainer, placem
22971
23068
  };
22972
23069
  ReactSlashPlugin.displayName = "ReactSlashPlugin";
22973
23070
  //#endregion
22974
- export { detectLanguage as A, INodePlugin as B, ReactPlainText as C, useTranslation as D, ReactMarkdownPlugin as E, GET_MARKDOWN_SELECTION_COMMAND as F, idToChar as G, $cloneNode as H, INSERT_MARKDOWN_COMMAND as I, useLexicalEditor as J, INSERT_HEADING_COMMAND as K, isPunctuationChar as L, MARKDOWN_READER_LEVEL_HIGH as M, MARKDOWN_READER_LEVEL_NORMAL as N, MarkdownPlugin as O, MARKDOWN_WRITER_LEVEL_MAX as P, ILitexmlService as R, registerCodeInlineCommand as S, CommonPlugin as T, $parseSerializedNodeImpl as U, INodeService as V, charToId as W, useLexicalComposerContext as X, ReactEditor as Y, LexicalErrorBoundary as Z, extractUrlFromText as _, ReactMentionPlugin as a, validateUrl as b, INSERT_LINK_HIGHLIGHT_COMMAND as c, bundledLanguagesInfo$1 as d, CodeblockPlugin as f, registerCheckList as g, INSERT_CHECK_LIST_COMMAND as h, SlashPlugin as i, IMarkdownShortCutService as j, detectCodeLanguage as k, registerLinkHighlightCommand as l, getCodeLanguageByInput as m, ReactSlashOption as n, MentionPlugin as o, UPDATE_CODEBLOCK_LANG as p, INSERT_QUOTE_COMMAND as q, SlashMenu as r, INSERT_MENTION_COMMAND as s, ReactSlashPlugin as t, useLexicalNodeSelection as u, getSelectedNode as v, ReactEditorContent as w, INSERT_CODEINLINE_COMMAND as x, sanitizeUrl as y, LitexmlService as z };
23071
+ export { LexicalErrorBoundary as $, MarkdownPlugin as A, ILitexmlService as B, INSERT_CODEINLINE_COMMAND as C, CommonPlugin as D, ReactEditorContent as E, MARKDOWN_READER_LEVEL_NORMAL as F, $parseSerializedNodeImpl as G, INodePlugin as H, MARKDOWN_WRITER_LEVEL_MAX as I, INSERT_HEADING_COMMAND as J, charToId as K, GET_MARKDOWN_SELECTION_COMMAND as L, detectLanguage as M, IMarkdownShortCutService as N, ReactMarkdownPlugin as O, MARKDOWN_READER_LEVEL_HIGH as P, useLexicalComposerContext as Q, INSERT_MARKDOWN_COMMAND as R, validateUrl as S, ReactPlainText as T, INodeService as U, LitexmlService as V, $cloneNode as W, useLexicalEditor as X, INSERT_QUOTE_COMMAND as Y, ReactEditor as Z, INSERT_CHECK_LIST_COMMAND as _, ReactMentionPlugin as a, getSelectedNode as b, INSERT_LINK_HIGHLIGHT_COMMAND as c, bundledLanguagesInfo$1 as d, CodeblockPlugin as f, getCodeLanguageByInput as g, IBlockMenuService as h, SlashPlugin as i, detectCodeLanguage as j, useTranslation as k, registerLinkHighlightCommand as l, BlockMenuService as m, ReactSlashOption as n, MentionPlugin as o, UPDATE_CODEBLOCK_LANG as p, idToChar as q, SlashMenu as r, INSERT_MENTION_COMMAND as s, ReactSlashPlugin as t, useLexicalNodeSelection as u, registerCheckList as v, registerCodeInlineCommand as w, sanitizeUrl as x, extractUrlFromText as y, isPunctuationChar as z };
package/es/headless.d.ts CHANGED
@@ -54,6 +54,9 @@ type HotkeyOptions = {
54
54
  //#endregion
55
55
  //#region src/locale/index.d.ts
56
56
  declare const _default: {
57
+ block: {
58
+ delete: string;
59
+ };
57
60
  cancel: string;
58
61
  codemirror: {
59
62
  copyFailed: string;
@@ -120,6 +123,8 @@ type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
120
123
  //#endregion
121
124
  //#region src/types/kernel.d.ts
122
125
  type IDecoratorFunc = (_node: LexicalNode, _editor: LexicalEditor) => any;
126
+ type INodeRegistrationTransform = (node: LexicalNodeConfig, index: number) => LexicalNodeConfig | null | undefined;
127
+ type IBeforeEditorInitLifecycle = () => void;
123
128
  type IDecorator = {
124
129
  queryDOM: (_element: HTMLElement) => HTMLElement;
125
130
  render: IDecoratorFunc;
@@ -380,6 +385,12 @@ interface IEditorKernel extends IEditor {
380
385
  * Check if hot reload mode is enabled
381
386
  */
382
387
  isHotReloadMode(): boolean;
388
+ /**
389
+ * Register a lifecycle hook that runs right before editor initialization.
390
+ * @param hook
391
+ * @returns unregister function
392
+ */
393
+ registerBeforeEditorInit(hook: IBeforeEditorInitLifecycle): () => void;
383
394
  /**
384
395
  * Register data source for multi-format data conversion
385
396
  * @param dataSource
@@ -391,11 +402,24 @@ interface IEditorKernel extends IEditor {
391
402
  * @param decorator
392
403
  */
393
404
  registerDecorator(name: string, decorator: IDecorator): void;
405
+ /**
406
+ * Register a transform hook that runs before editor initialization
407
+ * to rewrite registered nodes before createEditor/createHeadlessEditor is called.
408
+ * @param transform
409
+ * @returns unregister function
410
+ */
411
+ registerNodeTransform(transform: INodeRegistrationTransform): () => void;
394
412
  /**
395
413
  * Register Lexical Node
396
414
  * @param nodes
397
415
  */
398
416
  registerNodes(nodes: Array<LexicalNodeConfig>): void;
417
+ /**
418
+ * Register className(s) to the contenteditable root element.
419
+ * @param className One or more class names separated by spaces
420
+ * @returns unregister function
421
+ */
422
+ registerRootClassName(className: string): () => void;
399
423
  /**
400
424
  * Register service
401
425
  * @param serviceId
package/es/headless.js CHANGED
@@ -52,6 +52,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
52
52
  //#endregion
53
53
  //#region src/locale/index.ts
54
54
  var locale_default = {
55
+ block: { delete: "Delete block" },
55
56
  cancel: "Cancel",
56
57
  codemirror: {
57
58
  copyFailed: "Copy failed",
@@ -667,6 +668,18 @@ var KernelPlugin = class extends EventEmitter {
667
668
  clears.forEach((clear) => this.register(clear));
668
669
  }
669
670
  /**
671
+ * Register a node transform and automatically clean it up on plugin destroy
672
+ */
673
+ registerNodeTransform(kernel, transform) {
674
+ this.register(kernel.registerNodeTransform(transform));
675
+ }
676
+ /**
677
+ * Register className(s) on contenteditable root and auto cleanup
678
+ */
679
+ registerRootClassName(kernel, className) {
680
+ this.register(kernel.registerRootClassName(className));
681
+ }
682
+ /**
670
683
  * Register a decorator and track it for cleanup
671
684
  */
672
685
  registerDecorator(kernel, name, decorator) {
@@ -773,6 +786,9 @@ var Kernel = class Kernel extends EventEmitter {
773
786
  this.plugins = [];
774
787
  this.pluginsConfig = /* @__PURE__ */ new Map();
775
788
  this.pluginsInstances = [];
789
+ this.beforeEditorInitHooks = [];
790
+ this.nodeTransforms = [];
791
+ this.rootClassNames = /* @__PURE__ */ new Set();
776
792
  this.nodes = [];
777
793
  this.themes = { [EDITOR_THEME_KEY]: generateEditorId() };
778
794
  this.decorators = {};
@@ -844,6 +860,9 @@ var Kernel = class Kernel extends EventEmitter {
844
860
  if (plugin.destroy) plugin.destroy();
845
861
  });
846
862
  this.pluginsInstances = [];
863
+ this.beforeEditorInitHooks = [];
864
+ this.nodeTransforms = [];
865
+ this.rootClassNames.clear();
847
866
  this.serviceMap.clear();
848
867
  this.decorators = {};
849
868
  this.themes = {};
@@ -859,6 +878,7 @@ var Kernel = class Kernel extends EventEmitter {
859
878
  if (this.headlessEditor) throw new Error("Headless editor cannot be attached to a root element.");
860
879
  this.logger.warn("[Editor] Editor is already initialized, updating root element only");
861
880
  this.editor.setRootElement(dom);
881
+ this.applyRootClassNames(dom);
862
882
  return this.editor;
863
883
  }
864
884
  if (this.pluginsInstances.length === 0) {
@@ -868,13 +888,15 @@ var Kernel = class Kernel extends EventEmitter {
868
888
  this.pluginsInstances.push(instance);
869
889
  }
870
890
  }
871
- this.logger.info(`📝 Creating editor with ${this.nodes.length} nodes`);
891
+ this.runBeforeEditorInitLifecycle();
892
+ const resolvedNodes = this.resolveNodesForInitialization();
893
+ this.logger.info(`📝 Creating editor with ${resolvedNodes.length} nodes`);
872
894
  registerEditorKernel(this.themes[EDITOR_THEME_KEY], this);
873
895
  const editor = this.editor = createEditor({
874
896
  __kernel: this,
875
897
  editable,
876
898
  namespace: "lobehub",
877
- nodes: this.nodes,
899
+ nodes: resolvedNodes,
878
900
  onError: (error) => {
879
901
  this.logger.error("❌ Lexical editor error:", error);
880
902
  this.emit("error", error);
@@ -883,6 +905,7 @@ var Kernel = class Kernel extends EventEmitter {
883
905
  });
884
906
  this.headlessEditor = false;
885
907
  this.editor.setRootElement(dom);
908
+ this.applyRootClassNames(dom);
886
909
  registerEvent(editor, dom);
887
910
  this.pluginsInstances.forEach((plugin) => {
888
911
  plugin.onInit?.(editor);
@@ -909,11 +932,13 @@ var Kernel = class Kernel extends EventEmitter {
909
932
  this.pluginsInstances.push(instance);
910
933
  }
911
934
  }
912
- this.logger.info(`📝 Creating editor with ${this.nodes.length} nodes`);
935
+ this.runBeforeEditorInitLifecycle();
936
+ const resolvedNodes = this.resolveNodesForInitialization();
937
+ this.logger.info(`📝 Creating editor with ${resolvedNodes.length} nodes`);
913
938
  const editor = this.editor = createEditor({
914
939
  __kernel: this,
915
940
  namespace: "lobehub",
916
- nodes: this.nodes,
941
+ nodes: resolvedNodes,
917
942
  onError: (error) => {
918
943
  this.logger.error("❌ Lexical editor error:", error);
919
944
  this.emit("error", error);
@@ -937,11 +962,13 @@ var Kernel = class Kernel extends EventEmitter {
937
962
  this.pluginsInstances.push(instance);
938
963
  }
939
964
  }
940
- this.logger.info(`📝 Creating headless editor with ${this.nodes.length} nodes`);
965
+ this.runBeforeEditorInitLifecycle();
966
+ const resolvedNodes = this.resolveNodesForInitialization();
967
+ this.logger.info(`📝 Creating headless editor with ${resolvedNodes.length} nodes`);
941
968
  const editor = this.editor = createHeadlessEditor$1({
942
969
  __kernel: this,
943
970
  namespace: "lobehub-headless",
944
- nodes: this.nodes,
971
+ nodes: resolvedNodes,
945
972
  onError: (error) => {
946
973
  this.logger.error("❌ Lexical headless editor error:", error);
947
974
  this.emit("error", error);
@@ -1208,6 +1235,48 @@ var Kernel = class Kernel extends EventEmitter {
1208
1235
  if (nodeTypes.length > 3) this.logger.debug(`🧩 Nodes: ${nodeTypes.length} types`);
1209
1236
  else this.logger.debug(`🧩 Nodes: ${nodeTypes.join(", ")}`);
1210
1237
  }
1238
+ registerNodeTransform(transform) {
1239
+ this.nodeTransforms.push(transform);
1240
+ return () => {
1241
+ this.nodeTransforms = this.nodeTransforms.filter((item) => item !== transform);
1242
+ };
1243
+ }
1244
+ registerBeforeEditorInit(hook) {
1245
+ this.beforeEditorInitHooks.push(hook);
1246
+ return () => {
1247
+ this.beforeEditorInitHooks = this.beforeEditorInitHooks.filter((item) => item !== hook);
1248
+ };
1249
+ }
1250
+ registerRootClassName(className) {
1251
+ const classNames = className.split(/\s+/).filter(Boolean);
1252
+ for (const item of classNames) this.rootClassNames.add(item);
1253
+ const rootElement = this.editor?.getRootElement();
1254
+ if (rootElement) rootElement.classList.add(...classNames);
1255
+ return () => {
1256
+ for (const item of classNames) this.rootClassNames.delete(item);
1257
+ const currentRootElement = this.editor?.getRootElement();
1258
+ if (currentRootElement) currentRootElement.classList.remove(...classNames);
1259
+ };
1260
+ }
1261
+ runBeforeEditorInitLifecycle() {
1262
+ for (const hook of this.beforeEditorInitHooks) hook();
1263
+ }
1264
+ applyRootClassNames(dom) {
1265
+ if (this.rootClassNames.size === 0) return;
1266
+ dom.classList.add(...Array.from(this.rootClassNames));
1267
+ }
1268
+ resolveNodesForInitialization() {
1269
+ const resolvedNodes = this.nodes.flatMap((node, index) => {
1270
+ let transformedNode = node;
1271
+ for (const transform of this.nodeTransforms) {
1272
+ transformedNode = transform(transformedNode, index);
1273
+ if (!transformedNode) return [];
1274
+ }
1275
+ return [transformedNode];
1276
+ });
1277
+ if (resolvedNodes.length !== this.nodes.length) this.logger.debug(`🧩 Node transform filtered ${this.nodes.length - resolvedNodes.length} nodes before editor initialization`);
1278
+ return resolvedNodes;
1279
+ }
1211
1280
  registerService(serviceId, service) {
1212
1281
  const serviceIdString = serviceId.__serviceId;
1213
1282
  if (this.serviceMap.has(serviceIdString)) if (this.hotReloadMode) {
@@ -109,6 +109,9 @@ declare const getHotkeyById: (id: HotkeyId) => HotkeyItem;
109
109
  //#endregion
110
110
  //#region src/locale/index.d.ts
111
111
  declare const _default: {
112
+ block: {
113
+ delete: string;
114
+ };
112
115
  cancel: string;
113
116
  codemirror: {
114
117
  copyFailed: string;
@@ -175,6 +178,8 @@ type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
175
178
  //#endregion
176
179
  //#region src/types/kernel.d.ts
177
180
  type IDecoratorFunc = (_node: LexicalNode, _editor: LexicalEditor) => any;
181
+ type INodeRegistrationTransform = (node: LexicalNodeConfig, index: number) => LexicalNodeConfig | null | undefined;
182
+ type IBeforeEditorInitLifecycle = () => void;
178
183
  type IDecorator = {
179
184
  queryDOM: (_element: HTMLElement) => HTMLElement;
180
185
  render: IDecoratorFunc;
@@ -435,6 +440,12 @@ interface IEditorKernel extends IEditor {
435
440
  * Check if hot reload mode is enabled
436
441
  */
437
442
  isHotReloadMode(): boolean;
443
+ /**
444
+ * Register a lifecycle hook that runs right before editor initialization.
445
+ * @param hook
446
+ * @returns unregister function
447
+ */
448
+ registerBeforeEditorInit(hook: IBeforeEditorInitLifecycle): () => void;
438
449
  /**
439
450
  * Register data source for multi-format data conversion
440
451
  * @param dataSource
@@ -446,11 +457,24 @@ interface IEditorKernel extends IEditor {
446
457
  * @param decorator
447
458
  */
448
459
  registerDecorator(name: string, decorator: IDecorator): void;
460
+ /**
461
+ * Register a transform hook that runs before editor initialization
462
+ * to rewrite registered nodes before createEditor/createHeadlessEditor is called.
463
+ * @param transform
464
+ * @returns unregister function
465
+ */
466
+ registerNodeTransform(transform: INodeRegistrationTransform): () => void;
449
467
  /**
450
468
  * Register Lexical Node
451
469
  * @param nodes
452
470
  */
453
471
  registerNodes(nodes: Array<LexicalNodeConfig>): void;
472
+ /**
473
+ * Register className(s) to the contenteditable root element.
474
+ * @param className One or more class names separated by spaces
475
+ * @returns unregister function
476
+ */
477
+ registerRootClassName(className: string): () => void;
454
478
  /**
455
479
  * Register service
456
480
  * @param serviceId
@@ -890,4 +914,4 @@ declare const ReactSlashOption: FC<ReactSlashOptionProps>;
890
914
  //#region src/plugins/slash/react/ReactSlashPlugin.d.ts
891
915
  declare const ReactSlashPlugin: FC<ReactSlashPluginProps>;
892
916
  //#endregion
893
- export { IWriteOptions as $, INSERT_HEADING_COMMAND as A, ILocaleKeys as B, CommonPlugin as C, $isCursorNode as D, $isCardLikeElementNode as E, IEditorKernel as F, HotkeyEnum as G, HotkeyOptions as H, IEditorPluginConstructor as I, HotkeyScopeEnum as J, HotkeyId as K, IPlugin as L, IDecorator as M, IDocumentOptions as N, CardLikeElementNode as O, IEditor as P, DataSource as Q, ISelectionObject as R, ReactPlainTextProps as S, $createCursorNode as T, HotkeysEvent as U, _default as V, getHotkeyById as W, KeyEnum as X, HotkeyScopeId as Y, ModifierCombination as Z, MentionNode as _, ReactSlashOptionProps as a, ReactEditorContent as b, ITriggerContext as c, ISlashMenuOption as d, ISlashOption as f, ReactMentionPluginProps as g, ReactMentionPlugin as h, MenuRenderProps as i, INSERT_QUOTE_COMMAND as j, cursorNodeSerialized as k, SlashPlugin as l, SlashOptions as m, ReactSlashOption as n, ReactSlashPluginProps as o, ISlashService as p, HotkeyItem as q, SlashMenu as r, SlashMenuProps as s, ReactSlashPlugin as t, SlashPluginOptions as u, SerializedMentionNode as v, CommonPluginOptions as w, ReactEditorContentProps as x, ReactPlainText as y, IServiceID as z };
917
+ export { ModifierCombination as $, INSERT_HEADING_COMMAND as A, ISelectionObject as B, CommonPlugin as C, $isCursorNode as D, $isCardLikeElementNode as E, IEditor as F, HotkeysEvent as G, ILocaleKeys as H, IEditorKernel as I, HotkeyId as J, getHotkeyById as K, IEditorPluginConstructor as L, IBeforeEditorInitLifecycle as M, IDecorator as N, CardLikeElementNode as O, IDocumentOptions as P, KeyEnum as Q, INodeRegistrationTransform as R, ReactPlainTextProps as S, $createCursorNode as T, _default as U, IServiceID as V, HotkeyOptions as W, HotkeyScopeEnum as X, HotkeyItem as Y, HotkeyScopeId as Z, MentionNode as _, ReactSlashOptionProps as a, ReactEditorContent as b, ITriggerContext as c, ISlashMenuOption as d, DataSource as et, ISlashOption as f, ReactMentionPluginProps as g, ReactMentionPlugin as h, MenuRenderProps as i, INSERT_QUOTE_COMMAND as j, cursorNodeSerialized as k, SlashPlugin as l, SlashOptions as m, ReactSlashOption as n, ReactSlashPluginProps as o, ISlashService as p, HotkeyEnum as q, SlashMenu as r, SlashMenuProps as s, ReactSlashPlugin as t, IWriteOptions as tt, SlashPluginOptions as u, SerializedMentionNode as v, CommonPluginOptions as w, ReactEditorContentProps as x, ReactPlainText as y, IPlugin as z };
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as IWriteOptions, A as INSERT_HEADING_COMMAND, B as ILocaleKeys, C as CommonPlugin, D as $isCursorNode, E as $isCardLikeElementNode, F as IEditorKernel, G as HotkeyEnum, H as HotkeyOptions, I as IEditorPluginConstructor, J as HotkeyScopeEnum, K as HotkeyId, L as IPlugin, M as IDecorator, N as IDocumentOptions, O as CardLikeElementNode, P as IEditor, Q as DataSource, R as ISelectionObject, S as ReactPlainTextProps, T as $createCursorNode, U as HotkeysEvent, W as getHotkeyById, X as KeyEnum, Y as HotkeyScopeId, Z as ModifierCombination, _ as MentionNode, a as ReactSlashOptionProps, b as ReactEditorContent, c as ITriggerContext, d as ISlashMenuOption, f as ISlashOption, g as ReactMentionPluginProps, h as ReactMentionPlugin, i as MenuRenderProps, j as INSERT_QUOTE_COMMAND, k as cursorNodeSerialized, l as SlashPlugin, m as SlashOptions, n as ReactSlashOption, o as ReactSlashPluginProps, p as ISlashService, q as HotkeyItem, r as SlashMenu, s as SlashMenuProps, t as ReactSlashPlugin, u as SlashPluginOptions, v as SerializedMentionNode, w as CommonPluginOptions, x as ReactEditorContentProps, y as ReactPlainText, z as IServiceID } from "./index-BXj6uAM3.js";
1
+ import { $ as ModifierCombination, A as INSERT_HEADING_COMMAND, B as ISelectionObject, C as CommonPlugin, D as $isCursorNode, E as $isCardLikeElementNode, F as IEditor, G as HotkeysEvent, H as ILocaleKeys, I as IEditorKernel, J as HotkeyId, K as getHotkeyById, L as IEditorPluginConstructor, M as IBeforeEditorInitLifecycle, N as IDecorator, O as CardLikeElementNode, P as IDocumentOptions, Q as KeyEnum, R as INodeRegistrationTransform, S as ReactPlainTextProps, T as $createCursorNode, V as IServiceID, W as HotkeyOptions, X as HotkeyScopeEnum, Y as HotkeyItem, Z as HotkeyScopeId, _ as MentionNode, a as ReactSlashOptionProps, b as ReactEditorContent, c as ITriggerContext, d as ISlashMenuOption, et as DataSource, f as ISlashOption, g as ReactMentionPluginProps, h as ReactMentionPlugin, i as MenuRenderProps, j as INSERT_QUOTE_COMMAND, k as cursorNodeSerialized, l as SlashPlugin, m as SlashOptions, n as ReactSlashOption, o as ReactSlashPluginProps, p as ISlashService, q as HotkeyEnum, r as SlashMenu, s as SlashMenuProps, t as ReactSlashPlugin, tt as IWriteOptions, u as SlashPluginOptions, v as SerializedMentionNode, w as CommonPluginOptions, x as ReactEditorContentProps, y as ReactPlainText, z as IPlugin } from "./index-DJq7pYS0.js";
2
2
  import { HistoryState, HistoryStateEntry } from "@lexical/history";
3
3
  import { InsertTableCommandPayloadHeaders } from "@lexical/table";
4
4
  import EventEmitter from "eventemitter3";
@@ -350,7 +350,18 @@ interface AutoCompletePluginOptions {
350
350
  editor: IEditor;
351
351
  input: string;
352
352
  selectionType: string;
353
+ suggestionId?: string;
353
354
  }) => Promise<string | null>;
355
+ onSuggestionAccepted?: (info: {
356
+ acceptedText: string;
357
+ suggestionId: string;
358
+ visibleMs: number;
359
+ }) => void;
360
+ onSuggestionRejected?: (info: {
361
+ reason: 'cursor-move' | 'typing' | 'esc' | 'blur' | 'other';
362
+ suggestionId: string;
363
+ visibleMs: number;
364
+ }) => void;
354
365
  theme?: {
355
366
  placeholderBlock?: string;
356
367
  placeholderInline?: string;
@@ -367,12 +378,95 @@ interface ReactAutoCompletePluginProps {
367
378
  editor: IEditor;
368
379
  input: string;
369
380
  selectionType: string;
381
+ suggestionId?: string;
370
382
  }) => Promise<string | null>;
383
+ onSuggestionAccepted?: (info: {
384
+ acceptedText: string;
385
+ suggestionId: string;
386
+ visibleMs: number;
387
+ }) => void;
388
+ onSuggestionRejected?: (info: {
389
+ reason: 'cursor-move' | 'typing' | 'esc' | 'blur' | 'other';
390
+ suggestionId: string;
391
+ visibleMs: number;
392
+ }) => void;
371
393
  }
372
394
  //#endregion
373
395
  //#region src/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts
374
396
  declare const ReactAutoCompletePlugin: FC<ReactAutoCompletePluginProps>;
375
397
  //#endregion
398
+ //#region src/plugins/block/command/index.d.ts
399
+ interface BlockMovePayload {
400
+ placement: 'after' | 'before';
401
+ sourceBlockId: string;
402
+ targetBlockId: string;
403
+ }
404
+ declare const MOVE_BLOCK_COMMAND: _$lexical.LexicalCommand<BlockMovePayload>;
405
+ declare function registerBlockMoveCommand(editor: LexicalEditor): () => void;
406
+ //#endregion
407
+ //#region src/plugins/block/plugin/index.d.ts
408
+ interface BlockPluginOptions {
409
+ attributeName?: string;
410
+ className?: string;
411
+ }
412
+ declare const BlockPlugin: IEditorPluginConstructor<BlockPluginOptions>;
413
+ //#endregion
414
+ //#region src/plugins/block/react/core/types.d.ts
415
+ type BlockDragTarget = BlockMovePayload;
416
+ //#endregion
417
+ //#region src/plugins/block/service/i-block-menu-service.d.ts
418
+ interface IBlockMenuRenderContext {
419
+ blockElement: HTMLElement;
420
+ blockId: string;
421
+ editor: IEditor;
422
+ }
423
+ interface IBlockMenuItem {
424
+ key: string;
425
+ label: string | ((context: IBlockMenuRenderContext) => string);
426
+ onClick: (context: IBlockMenuRenderContext) => void;
427
+ order?: number;
428
+ when?: (context: IBlockMenuRenderContext) => boolean;
429
+ }
430
+ type IBlockActionButtonIcon = 'plus';
431
+ interface IBlockActionButton {
432
+ icon?: IBlockActionButtonIcon;
433
+ key: string;
434
+ onClick: (context: IBlockMenuRenderContext) => void;
435
+ order?: number;
436
+ title: string | ((context: IBlockMenuRenderContext) => string);
437
+ when?: (context: IBlockMenuRenderContext) => boolean;
438
+ }
439
+ interface IBlockMenuService {
440
+ getActionButtons(context: IBlockMenuRenderContext): IBlockActionButton[];
441
+ getMenus(context: IBlockMenuRenderContext): IBlockMenuItem[];
442
+ registerActionButton(item: IBlockActionButton): () => void;
443
+ registerMenu(item: IBlockMenuItem): () => void;
444
+ subscribe(listener: () => void): () => void;
445
+ }
446
+ declare const IBlockMenuService: IServiceID<IBlockMenuService>;
447
+ declare class BlockMenuService implements IBlockMenuService {
448
+ private actionButtons;
449
+ private items;
450
+ private listeners;
451
+ getActionButtons(context: IBlockMenuRenderContext): IBlockActionButton[];
452
+ getMenus(context: IBlockMenuRenderContext): IBlockMenuItem[];
453
+ registerActionButton(item: IBlockActionButton): () => void;
454
+ registerMenu(item: IBlockMenuItem): () => void;
455
+ subscribe(listener: () => void): () => void;
456
+ private notify;
457
+ }
458
+ //#endregion
459
+ //#region src/plugins/block/react/ReactBlockPlugin.d.ts
460
+ interface ReactBlockPluginProps extends Omit<BlockPluginOptions, 'className'> {
461
+ className?: string;
462
+ locale?: Partial<Record<keyof ILocaleKeys, string>>;
463
+ onDragTargetChange?: (target: BlockDragTarget | null) => void;
464
+ onDragTargetResolve?: (target: BlockDragTarget | null) => void;
465
+ onHoverBlockChange?: (context: IBlockMenuRenderContext | null) => void;
466
+ rootClassName?: string;
467
+ }
468
+ declare const ReactBlockPlugin: FC<ReactBlockPluginProps>;
469
+ //#endregion
376
470
  //#region src/plugins/code/command/index.d.ts
377
471
  declare const INSERT_CODEINLINE_COMMAND: _$lexical.LexicalCommand<undefined>;
378
472
  //#endregion
@@ -2781,6 +2875,9 @@ declare class Kernel extends EventEmitter implements IEditorKernel {
2781
2875
  private plugins;
2782
2876
  private pluginsConfig;
2783
2877
  private pluginsInstances;
2878
+ private beforeEditorInitHooks;
2879
+ private nodeTransforms;
2880
+ private rootClassNames;
2784
2881
  private nodes;
2785
2882
  private themes;
2786
2883
  private decorators;
@@ -2842,6 +2939,12 @@ declare class Kernel extends EventEmitter implements IEditorKernel {
2842
2939
  registerPlugin<T>(plugin: IEditorPluginConstructor<T>, config?: T): IEditor;
2843
2940
  registerPlugins(plugins: Array<IPlugin>): IEditor;
2844
2941
  registerNodes(nodes: Array<LexicalNodeConfig>): void;
2942
+ registerNodeTransform(transform: INodeRegistrationTransform): () => void;
2943
+ registerBeforeEditorInit(hook: IBeforeEditorInitLifecycle): () => void;
2944
+ registerRootClassName(className: string): () => void;
2945
+ private runBeforeEditorInitLifecycle;
2946
+ private applyRootClassNames;
2947
+ private resolveNodesForInitialization;
2845
2948
  registerService<T>(serviceId: IServiceID<T>, service: T): void;
2846
2949
  /**
2847
2950
  * Register service with hot reload support - allows overriding existing services
@@ -2895,4 +2998,4 @@ declare function enableHotReload(): void;
2895
2998
  */
2896
2999
  declare function disableHotReload(): void;
2897
3000
  //#endregion
2898
- export { $closest, $closestNodeType, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeFromDOMNode, $isCardLikeElementNode, $isCursorNode, AutoCompletePlugin, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodeblockPluginOptions, CodemirrorPlugin, CodemirrorPluginOptions, CommonPlugin, CommonPluginOptions, DEFAULT_HEADLESS_EDITOR_PLUGINS, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, DiffAction, EDITOR_THEME_KEY, FilePlugin, FilePluginOptions, GET_MARKDOWN_SELECTION_COMMAND, HIDE_TOOLBAR_COMMAND, HOVER_COMMAND, HRPlugin, HRPluginOptions, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, HotkeyEnum, HotkeyId, HotkeyItem, HotkeyScopeEnum, HotkeyScopeId, type IEditor, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_COMMAND, INSERT_FILE_COMMAND, INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_IMAGE_COMMAND, INSERT_LINK_COMMAND, INSERT_LINK_HIGHLIGHT_COMMAND, INSERT_MARKDOWN_COMMAND, INSERT_MATH_COMMAND, INSERT_MENTION_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_QUOTE_COMMAND, INSERT_TABLE_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INodePlugin, INodePluginOptions, INodeService, ISlashMenuOption, ISlashOption, ISlashService, ITriggerContext, IUploadService, ImagePlugin, ImagePluginOptions, Kernel, KeyEnum, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND, LexicalErrorBoundary, LexicalPortalContainer, LinkHighlightPlugin, LinkHighlightPluginOptions, LinkPlugin, LinkPluginOptions, ListPlugin, ListPluginOptions, LitexmlDataSource, LitexmlPlugin, type LitexmlPluginOptions, LitexmlService, type MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MarkdownPlugin, MathPlugin, MentionPlugin, MentionPluginOptions, MenuRenderProps, ModifierCombination, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactCodePlugin, ReactCodeblockPlugin, ReactCodeblockPluginProps, ReactCodemirrorPlugin, ReactEditor, ReactEditorContent, ReactEditorContentProps, ReactFilePlugin, ReactFilePluginProps, ReactHRPlugin, ReactHRPluginProps, ReactImagePlugin, ReactImagePluginProps, ReactLinkHighlightPlugin, ReactLinkPlugin, ReactLinkPluginProps, ReactListPlugin, ReactListPluginProps, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, ReactMentionPluginProps, ReactNodePlugin, ReactPlainText, ReactPlainTextProps, ReactSlashOption, ReactSlashOptionProps, ReactSlashPlugin, ReactSlashPluginProps, ReactTablePlugin, ReactToolbarPlugin, ReactVirtualBlockPlugin, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, type SerializedMentionNode, SlashMenu, SlashMenuProps, SlashOptions, SlashPlugin, SlashPluginOptions, TablePlugin, TablePluginOptions, ToolbarCommandOptions, UPDATE_CODEBLOCK_LANG, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, UploadPluginOptions, VirtualBlockPlugin, VirtualBlockPluginOptions, type XMLReaderFunc, type XMLReaderRecord, type XMLWriterFunc, type XMLWriterRecord, assert, browserDebug, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isValidUrl, moment, noop, prodSafeLogger, reconcileDecorator, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, scrollIntoView, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor };
3001
+ export { $closest, $closestNodeType, $createCursorNode, $getNearestNodeFromDOMNode, $getNodeFromDOMNode, $isCardLikeElementNode, $isCursorNode, AutoCompletePlugin, type BlockDragTarget, BlockMenuService, BlockMovePayload, BlockPlugin, BlockPluginOptions, CardLikeElementNode, CodePlugin, CodeblockPlugin, CodeblockPluginOptions, CodemirrorPlugin, CodemirrorPluginOptions, CommonPlugin, CommonPluginOptions, DEFAULT_HEADLESS_EDITOR_PLUGINS, DOM_DOCUMENT_FRAGMENT_TYPE, DOM_DOCUMENT_TYPE, DOM_ELEMENT_TYPE, DOM_TEXT_TYPE, DataSource, DiffAction, EDITOR_THEME_KEY, FilePlugin, FilePluginOptions, GET_MARKDOWN_SELECTION_COMMAND, HIDE_TOOLBAR_COMMAND, HOVER_COMMAND, HRPlugin, HRPluginOptions, HeadlessDocumentType, HeadlessEditor, HeadlessEditorExport, HeadlessEditorExportOptions, HeadlessEditorHydrationInput, HeadlessEditorOptions, HeadlessLiteXMLBatchOperation, HeadlessLiteXMLInsertOperation, HeadlessLiteXMLOperation, HeadlessLiteXMLRemoveOperation, HeadlessLiteXMLReplaceOperation, HotkeyEnum, HotkeyId, HotkeyItem, HotkeyScopeEnum, HotkeyScopeId, IBlockActionButton, IBlockActionButtonIcon, IBlockMenuItem, IBlockMenuRenderContext, IBlockMenuService, type IEditor, ILinkService, ILitexmlService, IMarkdownShortCutService, INSERT_CHECK_LIST_COMMAND, INSERT_CODEINLINE_COMMAND, INSERT_CODEMIRROR_COMMAND, INSERT_FILE_COMMAND, INSERT_HEADING_COMMAND, INSERT_HORIZONTAL_RULE_COMMAND, INSERT_IMAGE_COMMAND, INSERT_LINK_COMMAND, INSERT_LINK_HIGHLIGHT_COMMAND, INSERT_MARKDOWN_COMMAND, INSERT_MATH_COMMAND, INSERT_MENTION_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_QUOTE_COMMAND, INSERT_TABLE_COMMAND, INSERT_UNORDERED_LIST_COMMAND, INodePlugin, INodePluginOptions, INodeService, ISlashMenuOption, ISlashOption, ISlashService, ITriggerContext, IUploadService, ImagePlugin, ImagePluginOptions, Kernel, KeyEnum, LITEXML_APPLY_COMMAND, LITEXML_DIFFNODE_ALL_COMMAND, LITEXML_DIFFNODE_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND, LexicalErrorBoundary, LexicalPortalContainer, LinkHighlightPlugin, LinkHighlightPluginOptions, LinkPlugin, LinkPluginOptions, ListPlugin, ListPluginOptions, LitexmlDataSource, LitexmlPlugin, type LitexmlPluginOptions, LitexmlService, type MARKDOWN_READER_LEVEL, MARKDOWN_READER_LEVEL_HIGH, MARKDOWN_READER_LEVEL_NORMAL, MARKDOWN_WRITER_LEVEL_MAX, MOVE_BLOCK_COMMAND, MarkdownPlugin, MathPlugin, MentionPlugin, MentionPluginOptions, MenuRenderProps, ModifierCombination, REMOVE_LIST_COMMAND, ReactAutoCompletePlugin, ReactBlockPlugin, type ReactBlockPluginProps, ReactCodePlugin, ReactCodeblockPlugin, ReactCodeblockPluginProps, ReactCodemirrorPlugin, ReactEditor, ReactEditorContent, ReactEditorContentProps, ReactFilePlugin, ReactFilePluginProps, ReactHRPlugin, ReactHRPluginProps, ReactImagePlugin, ReactImagePluginProps, ReactLinkHighlightPlugin, ReactLinkPlugin, ReactLinkPluginProps, ReactListPlugin, ReactListPluginProps, ReactLiteXmlPlugin, ReactMarkdownPlugin, ReactMathPlugin, ReactMentionPlugin, ReactMentionPluginProps, ReactNodePlugin, ReactPlainText, ReactPlainTextProps, ReactSlashOption, ReactSlashOptionProps, ReactSlashPlugin, ReactSlashPluginProps, ReactTablePlugin, ReactToolbarPlugin, ReactVirtualBlockPlugin, SELECT_AFTER_CODEMIRROR_COMMAND, SELECT_BEFORE_CODEMIRROR_COMMAND, SELECT_TABLE_COMMAND, SHOW_TOOLBAR_COMMAND, type SerializedMentionNode, SlashMenu, SlashMenuProps, SlashOptions, SlashPlugin, SlashPluginOptions, TablePlugin, TablePluginOptions, ToolbarCommandOptions, UPDATE_CODEBLOCK_LANG, UPDATE_LIST_START_COMMAND, UPLOAD_PRIORITY_HIGH, UPLOAD_PRIORITY_LOW, UPLOAD_PRIORITY_MEDIUM, UploadPlugin, UploadPluginOptions, VirtualBlockPlugin, VirtualBlockPluginOptions, type XMLReaderFunc, type XMLReaderRecord, type XMLWriterFunc, type XMLWriterRecord, assert, browserDebug, bundledLanguagesInfo, compareNodeOrder, createDebugLogger, createEmptyEditorState, createHeadlessEditor, cursorNodeSerialized, debugLogger, debugLoggers, detectCodeLanguage, detectLanguage, devConsole, disableHotReload, enableHotReload, genServiceId, generateEditorId, getHotkeyById, getKernelFromEditor, getKernelFromEditorConfig, getNodeKeyFromDOMNode, getParentElement, isDOMNode, isDocumentFragment, isPunctuationChar, isPureUrl, isValidUrl, moment, noop, prodSafeLogger, reconcileDecorator, registerBlockMoveCommand, registerEditorKernel, registerLinkHighlightCommand, registerToolbarCommand, resetRandomKey, scrollIntoView, unregisterEditorKernel, useHasDiffNode, useLexicalComposerContext, useLexicalEditor };