@lobehub/editor 4.10.3 → 4.11.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.
- package/es/{ReactSlashPlugin-CBLFF1e6.js → ReactSlashPlugin-DkEXwDgH.js} +105 -6
- package/es/headless.d.ts +24 -0
- package/es/headless.js +75 -6
- package/es/{index-BXj6uAM3.d.ts → index-DJq7pYS0.d.ts} +25 -1
- package/es/index.d.ts +83 -2
- package/es/index.js +1215 -88
- package/es/react.d.ts +1 -1
- package/es/react.js +3 -3
- package/es/renderer.js +2 -2
- package/es/{style-D-dIPHv5.js → style-DejqW6OX.js} +1 -1
- package/es/{style-CLtp6okE.js → style-DjwW7ClE.js} +75 -6
- package/package.json +1 -1
|
@@ -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-
|
|
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";
|
|
@@ -73,10 +73,12 @@ const ReactEditor = ({ editor: editorProp, children, config, onInit }) => {
|
|
|
73
73
|
const composerContext = useMemo(() => {
|
|
74
74
|
return [editorProp || Editor.createEditor(), createLexicalComposerContext(null, null)];
|
|
75
75
|
}, [editorProp]);
|
|
76
|
+
const onInitRef = useRef(onInit);
|
|
77
|
+
onInitRef.current = onInit;
|
|
76
78
|
useEffect(() => {
|
|
77
79
|
const editor = composerContext[0];
|
|
78
|
-
|
|
79
|
-
}, [composerContext
|
|
80
|
+
onInitRef.current?.(editor);
|
|
81
|
+
}, [composerContext]);
|
|
80
82
|
return /* @__PURE__ */ jsxs(LexicalComposerContext, {
|
|
81
83
|
value: composerContext,
|
|
82
84
|
children: [/* @__PURE__ */ jsx(ConfigInjector, { config }), children]
|
|
@@ -21286,6 +21288,47 @@ function getCodeLanguageByInput(input) {
|
|
|
21286
21288
|
return bundledLanguagesInfo.find((lang) => lang.id === inputLang || lang.aliases?.includes(inputLang))?.id || "plaintext";
|
|
21287
21289
|
}
|
|
21288
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
|
|
21289
21332
|
//#region src/plugins/codeblock/plugin/FacadeShiki.ts
|
|
21290
21333
|
init_helper();
|
|
21291
21334
|
const shiki = createHighlighterCoreSync({
|
|
@@ -22486,10 +22529,12 @@ const SlashPlugin = class extends KernelPlugin {
|
|
|
22486
22529
|
}
|
|
22487
22530
|
constructor(kernel, config) {
|
|
22488
22531
|
super();
|
|
22532
|
+
this.kernel = kernel;
|
|
22489
22533
|
this.config = config;
|
|
22490
22534
|
this.service = null;
|
|
22491
22535
|
this.currentSlashTrigger = null;
|
|
22492
22536
|
this.currentSlashTriggerIndex = -1;
|
|
22537
|
+
this.manualOpen = false;
|
|
22493
22538
|
this.suppressOpen = false;
|
|
22494
22539
|
this.service = new SlashService(kernel);
|
|
22495
22540
|
kernel.registerService(ISlashService, this.service);
|
|
@@ -22501,13 +22546,66 @@ const SlashPlugin = class extends KernelPlugin {
|
|
|
22501
22546
|
this.config?.triggerClose?.();
|
|
22502
22547
|
this.currentSlashTrigger = null;
|
|
22503
22548
|
this.currentSlashTriggerIndex = -1;
|
|
22549
|
+
this.manualOpen = false;
|
|
22504
22550
|
this.suppressOpen = true;
|
|
22505
22551
|
}
|
|
22506
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
|
+
}
|
|
22507
22602
|
this.register(editor.registerCommand(KEY_DOWN_COMMAND, (event) => {
|
|
22508
22603
|
if (event.isComposing) return false;
|
|
22509
22604
|
const key = event.key;
|
|
22510
|
-
if (key.length === 1 || key === "Backspace" || key === "Delete")
|
|
22605
|
+
if (key.length === 1 || key === "Backspace" || key === "Delete") {
|
|
22606
|
+
this.suppressOpen = false;
|
|
22607
|
+
this.manualOpen = false;
|
|
22608
|
+
}
|
|
22511
22609
|
return false;
|
|
22512
22610
|
}, COMMAND_PRIORITY_CRITICAL));
|
|
22513
22611
|
this.register(editor.registerUpdateListener(() => {
|
|
@@ -22516,6 +22614,7 @@ const SlashPlugin = class extends KernelPlugin {
|
|
|
22516
22614
|
this.triggerClose();
|
|
22517
22615
|
return;
|
|
22518
22616
|
}
|
|
22617
|
+
if (this.manualOpen) return;
|
|
22519
22618
|
if (editor.isComposing()) return;
|
|
22520
22619
|
const editorWindow = editor._window || window;
|
|
22521
22620
|
if (editorWindow === void 0 || !editorWindow.document) return;
|
|
@@ -22969,4 +23068,4 @@ const ReactSlashPlugin = ({ children, anchorClassName, getPopupContainer, placem
|
|
|
22969
23068
|
};
|
|
22970
23069
|
ReactSlashPlugin.displayName = "ReactSlashPlugin";
|
|
22971
23070
|
//#endregion
|
|
22972
|
-
export {
|
|
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.
|
|
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:
|
|
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.
|
|
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:
|
|
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.
|
|
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:
|
|
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 {
|
|
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
|
|
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";
|
|
@@ -373,6 +373,78 @@ interface ReactAutoCompletePluginProps {
|
|
|
373
373
|
//#region src/plugins/auto-complete/react/ReactAutoCompletePlugin.d.ts
|
|
374
374
|
declare const ReactAutoCompletePlugin: FC<ReactAutoCompletePluginProps>;
|
|
375
375
|
//#endregion
|
|
376
|
+
//#region src/plugins/block/command/index.d.ts
|
|
377
|
+
interface BlockMovePayload {
|
|
378
|
+
placement: 'after' | 'before';
|
|
379
|
+
sourceBlockId: string;
|
|
380
|
+
targetBlockId: string;
|
|
381
|
+
}
|
|
382
|
+
declare const MOVE_BLOCK_COMMAND: _$lexical.LexicalCommand<BlockMovePayload>;
|
|
383
|
+
declare function registerBlockMoveCommand(editor: LexicalEditor): () => void;
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region src/plugins/block/plugin/index.d.ts
|
|
386
|
+
interface BlockPluginOptions {
|
|
387
|
+
attributeName?: string;
|
|
388
|
+
className?: string;
|
|
389
|
+
}
|
|
390
|
+
declare const BlockPlugin: IEditorPluginConstructor<BlockPluginOptions>;
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/plugins/block/react/core/types.d.ts
|
|
393
|
+
type BlockDragTarget = BlockMovePayload;
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/plugins/block/service/i-block-menu-service.d.ts
|
|
396
|
+
interface IBlockMenuRenderContext {
|
|
397
|
+
blockElement: HTMLElement;
|
|
398
|
+
blockId: string;
|
|
399
|
+
editor: IEditor;
|
|
400
|
+
}
|
|
401
|
+
interface IBlockMenuItem {
|
|
402
|
+
key: string;
|
|
403
|
+
label: string | ((context: IBlockMenuRenderContext) => string);
|
|
404
|
+
onClick: (context: IBlockMenuRenderContext) => void;
|
|
405
|
+
order?: number;
|
|
406
|
+
when?: (context: IBlockMenuRenderContext) => boolean;
|
|
407
|
+
}
|
|
408
|
+
type IBlockActionButtonIcon = 'plus';
|
|
409
|
+
interface IBlockActionButton {
|
|
410
|
+
icon?: IBlockActionButtonIcon;
|
|
411
|
+
key: string;
|
|
412
|
+
onClick: (context: IBlockMenuRenderContext) => void;
|
|
413
|
+
order?: number;
|
|
414
|
+
title: string | ((context: IBlockMenuRenderContext) => string);
|
|
415
|
+
when?: (context: IBlockMenuRenderContext) => boolean;
|
|
416
|
+
}
|
|
417
|
+
interface IBlockMenuService {
|
|
418
|
+
getActionButtons(context: IBlockMenuRenderContext): IBlockActionButton[];
|
|
419
|
+
getMenus(context: IBlockMenuRenderContext): IBlockMenuItem[];
|
|
420
|
+
registerActionButton(item: IBlockActionButton): () => void;
|
|
421
|
+
registerMenu(item: IBlockMenuItem): () => void;
|
|
422
|
+
subscribe(listener: () => void): () => void;
|
|
423
|
+
}
|
|
424
|
+
declare const IBlockMenuService: IServiceID<IBlockMenuService>;
|
|
425
|
+
declare class BlockMenuService implements IBlockMenuService {
|
|
426
|
+
private actionButtons;
|
|
427
|
+
private items;
|
|
428
|
+
private listeners;
|
|
429
|
+
getActionButtons(context: IBlockMenuRenderContext): IBlockActionButton[];
|
|
430
|
+
getMenus(context: IBlockMenuRenderContext): IBlockMenuItem[];
|
|
431
|
+
registerActionButton(item: IBlockActionButton): () => void;
|
|
432
|
+
registerMenu(item: IBlockMenuItem): () => void;
|
|
433
|
+
subscribe(listener: () => void): () => void;
|
|
434
|
+
private notify;
|
|
435
|
+
}
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/plugins/block/react/ReactBlockPlugin.d.ts
|
|
438
|
+
interface ReactBlockPluginProps extends Omit<BlockPluginOptions, 'className'> {
|
|
439
|
+
className?: string;
|
|
440
|
+
locale?: Partial<Record<keyof ILocaleKeys, string>>;
|
|
441
|
+
onDragTargetChange?: (target: BlockDragTarget | null) => void;
|
|
442
|
+
onDragTargetResolve?: (target: BlockDragTarget | null) => void;
|
|
443
|
+
onHoverBlockChange?: (context: IBlockMenuRenderContext | null) => void;
|
|
444
|
+
rootClassName?: string;
|
|
445
|
+
}
|
|
446
|
+
declare const ReactBlockPlugin: FC<ReactBlockPluginProps>;
|
|
447
|
+
//#endregion
|
|
376
448
|
//#region src/plugins/code/command/index.d.ts
|
|
377
449
|
declare const INSERT_CODEINLINE_COMMAND: _$lexical.LexicalCommand<undefined>;
|
|
378
450
|
//#endregion
|
|
@@ -2781,6 +2853,9 @@ declare class Kernel extends EventEmitter implements IEditorKernel {
|
|
|
2781
2853
|
private plugins;
|
|
2782
2854
|
private pluginsConfig;
|
|
2783
2855
|
private pluginsInstances;
|
|
2856
|
+
private beforeEditorInitHooks;
|
|
2857
|
+
private nodeTransforms;
|
|
2858
|
+
private rootClassNames;
|
|
2784
2859
|
private nodes;
|
|
2785
2860
|
private themes;
|
|
2786
2861
|
private decorators;
|
|
@@ -2842,6 +2917,12 @@ declare class Kernel extends EventEmitter implements IEditorKernel {
|
|
|
2842
2917
|
registerPlugin<T>(plugin: IEditorPluginConstructor<T>, config?: T): IEditor;
|
|
2843
2918
|
registerPlugins(plugins: Array<IPlugin>): IEditor;
|
|
2844
2919
|
registerNodes(nodes: Array<LexicalNodeConfig>): void;
|
|
2920
|
+
registerNodeTransform(transform: INodeRegistrationTransform): () => void;
|
|
2921
|
+
registerBeforeEditorInit(hook: IBeforeEditorInitLifecycle): () => void;
|
|
2922
|
+
registerRootClassName(className: string): () => void;
|
|
2923
|
+
private runBeforeEditorInitLifecycle;
|
|
2924
|
+
private applyRootClassNames;
|
|
2925
|
+
private resolveNodesForInitialization;
|
|
2845
2926
|
registerService<T>(serviceId: IServiceID<T>, service: T): void;
|
|
2846
2927
|
/**
|
|
2847
2928
|
* Register service with hot reload support - allows overriding existing services
|
|
@@ -2895,4 +2976,4 @@ declare function enableHotReload(): void;
|
|
|
2895
2976
|
*/
|
|
2896
2977
|
declare function disableHotReload(): void;
|
|
2897
2978
|
//#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 };
|
|
2979
|
+
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 };
|