@lobehub/editor 4.9.2 → 4.9.4
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-Dn5VWUzS.js → ReactSlashPlugin-BZ0TZ1oy.js} +12 -5
- package/es/headless.js +26 -4
- package/es/index.js +3 -3
- package/es/react.js +2 -2
- package/es/renderer.js +2 -2
- package/es/{style-DAKdXzC4.js → style-CLtp6okE.js} +43 -0
- package/es/{style-CcDKrOoJ.js → style-D-dIPHv5.js} +1 -1
- package/package.json +13 -13
|
@@ -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-CLtp6okE.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";
|
|
@@ -123,13 +123,21 @@ function registerCommands(editor) {
|
|
|
123
123
|
}
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region src/plugins/litexml/utils/index.ts
|
|
126
|
+
const getNumericId = (id) => {
|
|
127
|
+
if (typeof id !== "number" && typeof id !== "string") return null;
|
|
128
|
+
const numericId = Number(id);
|
|
129
|
+
return Number.isInteger(numericId) && numericId >= 0 ? numericId : null;
|
|
130
|
+
};
|
|
126
131
|
function $parseSerializedNodeImpl(serializedNode, editor, keepId = false, state = null) {
|
|
127
132
|
const type = serializedNode.type;
|
|
128
133
|
const registeredNode = editor._nodes.get(type);
|
|
129
134
|
if (registeredNode === void 0) throw new Error(`parseEditorState: type "${type}" not found`);
|
|
130
135
|
const nodeClass = registeredNode.klass;
|
|
131
136
|
if (serializedNode.type !== nodeClass.getType()) throw new Error(`LexicalNode: Node ${nodeClass.name} does not implement .importJSON().`);
|
|
132
|
-
if (keepId
|
|
137
|
+
if (keepId) {
|
|
138
|
+
const id = getNumericId(serializedNode.id);
|
|
139
|
+
if (id !== null) resetRandomKey(id);
|
|
140
|
+
}
|
|
133
141
|
const node = nodeClass.importJSON(serializedNode);
|
|
134
142
|
const children = serializedNode.children;
|
|
135
143
|
if ($isElementNode(node) && Array.isArray(children)) {
|
|
@@ -2594,7 +2602,6 @@ function previous$2(code) {
|
|
|
2594
2602
|
* @type {Tokenizer}
|
|
2595
2603
|
*/
|
|
2596
2604
|
function tokenizeCodeText(effects, ok, nok) {
|
|
2597
|
-
this;
|
|
2598
2605
|
let sizeOpen = 0;
|
|
2599
2606
|
/** @type {number} */
|
|
2600
2607
|
let size;
|
|
@@ -18299,7 +18306,6 @@ function mathText(options) {
|
|
|
18299
18306
|
* @type {Tokenizer}
|
|
18300
18307
|
*/
|
|
18301
18308
|
function tokenizeMathText(effects, ok, nok) {
|
|
18302
|
-
this;
|
|
18303
18309
|
let sizeOpen = 0;
|
|
18304
18310
|
/** @type {number} */
|
|
18305
18311
|
let size;
|
|
@@ -19862,7 +19868,8 @@ var JSONDataSource = class extends DataSource {
|
|
|
19862
19868
|
let maxId = -1;
|
|
19863
19869
|
Array.from(state._nodeMap.keys()).forEach((key) => {
|
|
19864
19870
|
if (key === "root") return;
|
|
19865
|
-
|
|
19871
|
+
const numericKey = Number(key);
|
|
19872
|
+
if (Number.isInteger(numericKey) && numericKey >= 0) maxId = Math.max(maxId, numericKey);
|
|
19866
19873
|
});
|
|
19867
19874
|
resetRandomKey(maxId + 1);
|
|
19868
19875
|
state._nodeMap.set(root.getKey(), root);
|
package/es/headless.js
CHANGED
|
@@ -325,10 +325,25 @@ var DebugLogger = class {
|
|
|
325
325
|
}
|
|
326
326
|
};
|
|
327
327
|
return {
|
|
328
|
+
/**
|
|
329
|
+
* General debug logging
|
|
330
|
+
*/
|
|
328
331
|
debug,
|
|
332
|
+
/**
|
|
333
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
334
|
+
*/
|
|
329
335
|
error,
|
|
336
|
+
/**
|
|
337
|
+
* Info level logging
|
|
338
|
+
*/
|
|
330
339
|
info,
|
|
340
|
+
/**
|
|
341
|
+
* Log function - alias for debug for compatibility
|
|
342
|
+
*/
|
|
331
343
|
log: debug,
|
|
344
|
+
/**
|
|
345
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
346
|
+
*/
|
|
332
347
|
warn
|
|
333
348
|
};
|
|
334
349
|
}
|
|
@@ -1637,13 +1652,21 @@ function $createDiffNode(diffType = "unchanged") {
|
|
|
1637
1652
|
}
|
|
1638
1653
|
//#endregion
|
|
1639
1654
|
//#region src/plugins/litexml/utils/index.ts
|
|
1655
|
+
const getNumericId$1 = (id) => {
|
|
1656
|
+
if (typeof id !== "number" && typeof id !== "string") return null;
|
|
1657
|
+
const numericId = Number(id);
|
|
1658
|
+
return Number.isInteger(numericId) && numericId >= 0 ? numericId : null;
|
|
1659
|
+
};
|
|
1640
1660
|
function $parseSerializedNodeImpl(serializedNode, editor, keepId = false, state = null) {
|
|
1641
1661
|
const type = serializedNode.type;
|
|
1642
1662
|
const registeredNode = editor._nodes.get(type);
|
|
1643
1663
|
if (registeredNode === void 0) throw new Error(`parseEditorState: type "${type}" not found`);
|
|
1644
1664
|
const nodeClass = registeredNode.klass;
|
|
1645
1665
|
if (serializedNode.type !== nodeClass.getType()) throw new Error(`LexicalNode: Node ${nodeClass.name} does not implement .importJSON().`);
|
|
1646
|
-
if (keepId
|
|
1666
|
+
if (keepId) {
|
|
1667
|
+
const id = getNumericId$1(serializedNode.id);
|
|
1668
|
+
if (id !== null) resetRandomKey(id);
|
|
1669
|
+
}
|
|
1647
1670
|
const node = nodeClass.importJSON(serializedNode);
|
|
1648
1671
|
const children = serializedNode.children;
|
|
1649
1672
|
if ($isElementNode(node) && Array.isArray(children)) {
|
|
@@ -6899,7 +6922,6 @@ function previous$2(code) {
|
|
|
6899
6922
|
* @type {Tokenizer}
|
|
6900
6923
|
*/
|
|
6901
6924
|
function tokenizeCodeText(effects, ok, nok) {
|
|
6902
|
-
this;
|
|
6903
6925
|
let sizeOpen = 0;
|
|
6904
6926
|
/** @type {number} */
|
|
6905
6927
|
let size;
|
|
@@ -22313,7 +22335,6 @@ function mathText(options) {
|
|
|
22313
22335
|
* @type {Tokenizer}
|
|
22314
22336
|
*/
|
|
22315
22337
|
function tokenizeMathText(effects, ok, nok) {
|
|
22316
|
-
this;
|
|
22317
22338
|
let sizeOpen = 0;
|
|
22318
22339
|
/** @type {number} */
|
|
22319
22340
|
let size;
|
|
@@ -23925,7 +23946,8 @@ var JSONDataSource = class extends DataSource {
|
|
|
23925
23946
|
let maxId = -1;
|
|
23926
23947
|
Array.from(state._nodeMap.keys()).forEach((key) => {
|
|
23927
23948
|
if (key === "root") return;
|
|
23928
|
-
|
|
23949
|
+
const numericKey = Number(key);
|
|
23950
|
+
if (Number.isInteger(numericKey) && numericKey >= 0) maxId = Math.max(maxId, numericKey);
|
|
23929
23951
|
});
|
|
23930
23952
|
resetRandomKey(maxId + 1);
|
|
23931
23953
|
state._nodeMap.set(root.getKey(), root);
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as DOM_TEXT_TYPE, A as $createCodeMirrorNode, At as createDebugLogger, B as Editor, C as $createCodeNode$1, Ct as CONTROL_OR_META, Dt as KeyEnum, E as CodeNode$1, Et as HotkeyScopeEnum, F as $isCursorNode, Ft as init_debug, G as kernel_exports, Gt as INodeHelper, H as DataSource, I as CardLikeElementNode, It as prodSafeLogger, J as $getNearestNodeFromDOMNode, K as $closest, Kt as init_helper, M as CodeMirrorNode, Mt as debugLoggers, N as $createCursorNode, Nt as debug_exports, Ot as init_hotkey, P as $isCardLikeElementNode, Pt as devConsole, Q as DOM_ELEMENT_TYPE, R as cursorNodeSerialized, S as formatUrl, St as init_registerHotkey, Tt as HotkeyEnum, U as Kernel, V as resetRandomKey, W as init_kernel, X as DOM_DOCUMENT_FRAGMENT_TYPE, Y as $getNodeFromDOMNode, Yt as __toCommonJS, Z as DOM_DOCUMENT_TYPE, _ as AutoLinkNode, _t as unregisterEditorKernel, a as $createMathBlockNode, at as generateEditorId, b as LinkNode, bt as HOVER_COMMAND, c as MathBlockNode, ct as getNodeKeyFromDOMNode, dt as isDOMNode, et as EDITOR_THEME_KEY, f as LinkHighlightNode, ft as isDocumentFragment, g as $toggleLink, gt as registerEditorKernel, h as $isLinkNode, ht as reconcileDecorator, it as genServiceId, j as $isCodeMirrorNode, jt as debugLogger, kt as browserDebug, l as MathInlineNode, lt as getParentElement, m as $createLinkNode, mt as noop, nt as compareNodeOrder, o as $createMathInlineNode, ot as getKernelFromEditor, pt as moment, q as $closestNodeType, rt as createEmptyEditorState, s as $isMathNode, st as getKernelFromEditorConfig, tt as assert, u as $createLinkHighlightNode, ut as init_utils, v as HOVER_LINK_COMMAND, vt as KernelPlugin, wt as init_sys, x as TOGGLE_LINK_COMMAND, xt as getHotkeyById, y as HOVER_OUT_LINK_COMMAND, yt as init_plugin } from "./style-
|
|
2
|
-
import { A as detectLanguage, B as INodePlugin, C as ReactPlainText, D as useTranslation, E as ReactMarkdownPlugin, F as GET_MARKDOWN_SELECTION_COMMAND, G as idToChar, H as $cloneNode, I as INSERT_MARKDOWN_COMMAND, J as useLexicalEditor, K as INSERT_HEADING_COMMAND, L as isPunctuationChar, M as MARKDOWN_READER_LEVEL_HIGH, N as MARKDOWN_READER_LEVEL_NORMAL, O as MarkdownPlugin, P as MARKDOWN_WRITER_LEVEL_MAX, R as ILitexmlService, S as registerCodeInlineCommand, T as CommonPlugin, U as $parseSerializedNodeImpl, V as INodeService, W as charToId, X as useLexicalComposerContext, Y as ReactEditor, Z as LexicalErrorBoundary, _ as UPDATE_CODEBLOCK_LANG, a as ReactMentionPlugin, b as registerCheckList, c as INSERT_LINK_HIGHLIGHT_COMMAND, d as getSelectedNode, f as sanitizeUrl, g as CodeblockPlugin, h as bundledLanguagesInfo, i as SlashPlugin, j as IMarkdownShortCutService, k as detectCodeLanguage, l as registerLinkHighlightCommand, m as useLexicalNodeSelection, n as ReactSlashOption, o as MentionPlugin, q as INSERT_QUOTE_COMMAND, r as SlashMenu, s as INSERT_MENTION_COMMAND, t as ReactSlashPlugin, u as extractUrlFromText, v as getCodeLanguageByInput, w as ReactEditorContent, x as INSERT_CODEINLINE_COMMAND, y as INSERT_CHECK_LIST_COMMAND, z as LitexmlService } from "./ReactSlashPlugin-
|
|
3
|
-
import { S as DiffNode, _ as PlaceholderNode, a as styles$16, b as HorizontalRuleNode, c as ImageNode, d as BlockImageNode, f as styles$15, g as PlaceholderBlockNode, h as FileNode, i as imageBroken, l as $createBlockImageNode, m as $isFileNode, n as styles$18, o as $createImageNode, p as $createFileNode, r as styles$17, s as $isImageNode, t as styles$19, u as $isBlockImageNode, v as $createHorizontalRuleNode, x as $createDiffNode, y as $isHorizontalRuleNode } from "./style-
|
|
1
|
+
import { $ as DOM_TEXT_TYPE, A as $createCodeMirrorNode, At as createDebugLogger, B as Editor, C as $createCodeNode$1, Ct as CONTROL_OR_META, Dt as KeyEnum, E as CodeNode$1, Et as HotkeyScopeEnum, F as $isCursorNode, Ft as init_debug, G as kernel_exports, Gt as INodeHelper, H as DataSource, I as CardLikeElementNode, It as prodSafeLogger, J as $getNearestNodeFromDOMNode, K as $closest, Kt as init_helper, M as CodeMirrorNode, Mt as debugLoggers, N as $createCursorNode, Nt as debug_exports, Ot as init_hotkey, P as $isCardLikeElementNode, Pt as devConsole, Q as DOM_ELEMENT_TYPE, R as cursorNodeSerialized, S as formatUrl, St as init_registerHotkey, Tt as HotkeyEnum, U as Kernel, V as resetRandomKey, W as init_kernel, X as DOM_DOCUMENT_FRAGMENT_TYPE, Y as $getNodeFromDOMNode, Yt as __toCommonJS, Z as DOM_DOCUMENT_TYPE, _ as AutoLinkNode, _t as unregisterEditorKernel, a as $createMathBlockNode, at as generateEditorId, b as LinkNode, bt as HOVER_COMMAND, c as MathBlockNode, ct as getNodeKeyFromDOMNode, dt as isDOMNode, et as EDITOR_THEME_KEY, f as LinkHighlightNode, ft as isDocumentFragment, g as $toggleLink, gt as registerEditorKernel, h as $isLinkNode, ht as reconcileDecorator, it as genServiceId, j as $isCodeMirrorNode, jt as debugLogger, kt as browserDebug, l as MathInlineNode, lt as getParentElement, m as $createLinkNode, mt as noop, nt as compareNodeOrder, o as $createMathInlineNode, ot as getKernelFromEditor, pt as moment, q as $closestNodeType, rt as createEmptyEditorState, s as $isMathNode, st as getKernelFromEditorConfig, tt as assert, u as $createLinkHighlightNode, ut as init_utils, v as HOVER_LINK_COMMAND, vt as KernelPlugin, wt as init_sys, x as TOGGLE_LINK_COMMAND, xt as getHotkeyById, y as HOVER_OUT_LINK_COMMAND, yt as init_plugin } from "./style-CLtp6okE.js";
|
|
2
|
+
import { A as detectLanguage, B as INodePlugin, C as ReactPlainText, D as useTranslation, E as ReactMarkdownPlugin, F as GET_MARKDOWN_SELECTION_COMMAND, G as idToChar, H as $cloneNode, I as INSERT_MARKDOWN_COMMAND, J as useLexicalEditor, K as INSERT_HEADING_COMMAND, L as isPunctuationChar, M as MARKDOWN_READER_LEVEL_HIGH, N as MARKDOWN_READER_LEVEL_NORMAL, O as MarkdownPlugin, P as MARKDOWN_WRITER_LEVEL_MAX, R as ILitexmlService, S as registerCodeInlineCommand, T as CommonPlugin, U as $parseSerializedNodeImpl, V as INodeService, W as charToId, X as useLexicalComposerContext, Y as ReactEditor, Z as LexicalErrorBoundary, _ as UPDATE_CODEBLOCK_LANG, a as ReactMentionPlugin, b as registerCheckList, c as INSERT_LINK_HIGHLIGHT_COMMAND, d as getSelectedNode, f as sanitizeUrl, g as CodeblockPlugin, h as bundledLanguagesInfo, i as SlashPlugin, j as IMarkdownShortCutService, k as detectCodeLanguage, l as registerLinkHighlightCommand, m as useLexicalNodeSelection, n as ReactSlashOption, o as MentionPlugin, q as INSERT_QUOTE_COMMAND, r as SlashMenu, s as INSERT_MENTION_COMMAND, t as ReactSlashPlugin, u as extractUrlFromText, v as getCodeLanguageByInput, w as ReactEditorContent, x as INSERT_CODEINLINE_COMMAND, y as INSERT_CHECK_LIST_COMMAND, z as LitexmlService } from "./ReactSlashPlugin-BZ0TZ1oy.js";
|
|
3
|
+
import { S as DiffNode, _ as PlaceholderNode, a as styles$16, b as HorizontalRuleNode, c as ImageNode, d as BlockImageNode, f as styles$15, g as PlaceholderBlockNode, h as FileNode, i as imageBroken, l as $createBlockImageNode, m as $isFileNode, n as styles$18, o as $createImageNode, p as $createFileNode, r as styles$17, s as $isImageNode, t as styles$19, u as $isBlockImageNode, v as $createHorizontalRuleNode, x as $createDiffNode, y as $isHorizontalRuleNode } from "./style-D-dIPHv5.js";
|
|
4
4
|
import { $computeTableMapSkipCellCheck, $createTableNodeWithDimensions, $createTableSelection, $deleteTableColumnAtSelection, $deleteTableRowAtSelection, $findTableNode, $getElementForTableNode, $getNodeTriplet, $getTableAndElementByKey, $getTableCellNodeFromLexicalNode, $getTableColumnIndexFromTableCellNode, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $insertTableColumnAtSelection, $insertTableRowAtSelection, $isTableCellNode, $isTableNode, $isTableRowNode, $isTableSelection, $mergeCells, $unmergeCell, TableCellHeaderStates, TableCellNode, TableNode, TableNode as TableNode$1, TableRowNode, getDOMCellFromTarget, getTableElement, getTableObserverFromTableElement, registerTableCellUnmergeTransform, registerTablePlugin, registerTableSelectionObserver, setScrollableTablesActive } from "@lexical/table";
|
|
5
5
|
import { debounce } from "es-toolkit/compat";
|
|
6
6
|
import EventEmitter from "eventemitter3";
|
package/es/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as $createCodeMirrorNode, B as Editor$2, Bt as $isRootTextContentEmpty, S as formatUrl, T as $isSelectionInCodeInline, Ut as init_utils, a as $createMathBlockNode, d as $isLinkHighlightNode, h as $isLinkNode, j as $isCodeMirrorNode, mt as noop, o as $createMathInlineNode, x as TOGGLE_LINK_COMMAND } from "./style-
|
|
2
|
-
import { C as ReactPlainText, E as ReactMarkdownPlugin, Y as ReactEditor, _ as UPDATE_CODEBLOCK_LANG, a as ReactMentionPlugin, c as INSERT_LINK_HIGHLIGHT_COMMAND, f as sanitizeUrl, n as ReactSlashOption, p as validateUrl, t as ReactSlashPlugin, u as extractUrlFromText, w as ReactEditorContent, x as INSERT_CODEINLINE_COMMAND, y as INSERT_CHECK_LIST_COMMAND } from "./ReactSlashPlugin-
|
|
1
|
+
import { A as $createCodeMirrorNode, B as Editor$2, Bt as $isRootTextContentEmpty, S as formatUrl, T as $isSelectionInCodeInline, Ut as init_utils, a as $createMathBlockNode, d as $isLinkHighlightNode, h as $isLinkNode, j as $isCodeMirrorNode, mt as noop, o as $createMathInlineNode, x as TOGGLE_LINK_COMMAND } from "./style-CLtp6okE.js";
|
|
2
|
+
import { C as ReactPlainText, E as ReactMarkdownPlugin, Y as ReactEditor, _ as UPDATE_CODEBLOCK_LANG, a as ReactMentionPlugin, c as INSERT_LINK_HIGHLIGHT_COMMAND, f as sanitizeUrl, n as ReactSlashOption, p as validateUrl, t as ReactSlashPlugin, u as extractUrlFromText, w as ReactEditorContent, x as INSERT_CODEINLINE_COMMAND, y as INSERT_CHECK_LIST_COMMAND } from "./ReactSlashPlugin-BZ0TZ1oy.js";
|
|
3
3
|
import { $createNodeSelection, $createParagraphNode, $getSelection, $isParagraphNode, $isRangeSelection, $isRootOrShadowRoot, $setSelection, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_LOW, FORMAT_TEXT_COMMAND, REDO_COMMAND, SELECTION_CHANGE_COMMAND, UNDO_COMMAND } from "lexical";
|
|
4
4
|
import { $createQuoteNode, $isHeadingNode, $isQuoteNode } from "@lexical/rich-text";
|
|
5
5
|
import { $findMatchingParent, $getNearestNodeOfType, mergeRegister } from "@lexical/utils";
|
package/es/renderer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as CodeNode, L as CursorNode, M as CodeMirrorNode, O as styles, _ as AutoLinkNode, b as LinkNode, c as MathBlockNode, f as LinkHighlightNode, i as MentionNode, l as MathInlineNode, t as styles$1 } from "./style-
|
|
2
|
-
import { S as DiffNode, _ as PlaceholderNode, a as styles$5, b as HorizontalRuleNode, c as ImageNode, d as BlockImageNode, f as styles$6, g as PlaceholderBlockNode, h as FileNode, n as styles$4, r as styles$2, t as styles$3 } from "./style-
|
|
1
|
+
import { E as CodeNode, L as CursorNode, M as CodeMirrorNode, O as styles, _ as AutoLinkNode, b as LinkNode, c as MathBlockNode, f as LinkHighlightNode, i as MentionNode, l as MathInlineNode, t as styles$1 } from "./style-CLtp6okE.js";
|
|
2
|
+
import { S as DiffNode, _ as PlaceholderNode, a as styles$5, b as HorizontalRuleNode, c as ImageNode, d as BlockImageNode, f as styles$6, g as PlaceholderBlockNode, h as FileNode, n as styles$4, r as styles$2, t as styles$3 } from "./style-D-dIPHv5.js";
|
|
3
3
|
import { createHeadlessEditor } from "@lexical/headless";
|
|
4
4
|
import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
|
|
5
5
|
import { $getRoot, $isElementNode, $isTextNode } from "lexical";
|
|
@@ -375,10 +375,25 @@ var init_debug = __esmMin((() => {
|
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
377
|
return {
|
|
378
|
+
/**
|
|
379
|
+
* General debug logging
|
|
380
|
+
*/
|
|
378
381
|
debug,
|
|
382
|
+
/**
|
|
383
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
384
|
+
*/
|
|
379
385
|
error,
|
|
386
|
+
/**
|
|
387
|
+
* Info level logging
|
|
388
|
+
*/
|
|
380
389
|
info,
|
|
390
|
+
/**
|
|
391
|
+
* Log function - alias for debug for compatibility
|
|
392
|
+
*/
|
|
381
393
|
log: debug,
|
|
394
|
+
/**
|
|
395
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
396
|
+
*/
|
|
382
397
|
warn
|
|
383
398
|
};
|
|
384
399
|
}
|
|
@@ -434,16 +449,31 @@ var init_debug = __esmMin((() => {
|
|
|
434
449
|
}
|
|
435
450
|
};
|
|
436
451
|
prodSafeLogger = {
|
|
452
|
+
/**
|
|
453
|
+
* Debug info - only shown when debug is enabled
|
|
454
|
+
*/
|
|
437
455
|
debug: debugLoggers.kernel.debug,
|
|
456
|
+
/**
|
|
457
|
+
* Log critical errors that should always be visible (uses console.error)
|
|
458
|
+
*/
|
|
438
459
|
error: (...args) => {
|
|
439
460
|
console.error(...args);
|
|
440
461
|
},
|
|
462
|
+
/**
|
|
463
|
+
* Info logging - only shown when debug is enabled
|
|
464
|
+
*/
|
|
441
465
|
info: debugLoggers.kernel.info,
|
|
466
|
+
/**
|
|
467
|
+
* Log warnings that should always be visible (uses console.warn)
|
|
468
|
+
*/
|
|
442
469
|
warn: (...args) => {
|
|
443
470
|
console.warn(...args);
|
|
444
471
|
}
|
|
445
472
|
};
|
|
446
473
|
browserDebug = {
|
|
474
|
+
/**
|
|
475
|
+
* Disable debug logging in browser environment
|
|
476
|
+
*/
|
|
447
477
|
disable: () => {
|
|
448
478
|
if (typeof window !== "undefined") {
|
|
449
479
|
localStorage.removeItem("debug");
|
|
@@ -451,6 +481,10 @@ var init_debug = __esmMin((() => {
|
|
|
451
481
|
console.info("Debug disabled.");
|
|
452
482
|
}
|
|
453
483
|
},
|
|
484
|
+
/**
|
|
485
|
+
* Enable debug logging in browser environment
|
|
486
|
+
* @param namespaces - Debug namespaces to enable (e.g., 'lobe-editor:*')
|
|
487
|
+
*/
|
|
454
488
|
enable: (namespaces = "lobe-editor:*") => {
|
|
455
489
|
if (typeof window !== "undefined") {
|
|
456
490
|
localStorage.debug = namespaces;
|
|
@@ -459,6 +493,9 @@ var init_debug = __esmMin((() => {
|
|
|
459
493
|
console.info("Refresh the page to see debug logs from initialization.");
|
|
460
494
|
}
|
|
461
495
|
},
|
|
496
|
+
/**
|
|
497
|
+
* Get current debug configuration
|
|
498
|
+
*/
|
|
462
499
|
getConfig: () => {
|
|
463
500
|
if (typeof window !== "undefined") {
|
|
464
501
|
const envDebug = typeof process !== "undefined" ? process.env.DEBUG : void 0;
|
|
@@ -481,6 +518,9 @@ var init_debug = __esmMin((() => {
|
|
|
481
518
|
source: "server-side"
|
|
482
519
|
};
|
|
483
520
|
},
|
|
521
|
+
/**
|
|
522
|
+
* Show available debug categories
|
|
523
|
+
*/
|
|
484
524
|
showCategories: () => {
|
|
485
525
|
console.group("Available debug categories:");
|
|
486
526
|
console.log("� lobe-editor:kernel - Core editor functionality");
|
|
@@ -492,6 +532,9 @@ var init_debug = __esmMin((() => {
|
|
|
492
532
|
console.groupEnd();
|
|
493
533
|
console.info("Usage: browserDebug.enable(\"lobe-editor:kernel,lobe-editor:plugin:*\")");
|
|
494
534
|
},
|
|
535
|
+
/**
|
|
536
|
+
* Show current debug status and configuration
|
|
537
|
+
*/
|
|
495
538
|
showStatus: () => {
|
|
496
539
|
const config = browserDebug.getConfig();
|
|
497
540
|
console.group("� LobeHub Editor Debug Status");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as CardLikeElementNode, ht as reconcileDecorator, ot as getKernelFromEditor, st as getKernelFromEditorConfig, ut as init_utils } from "./style-
|
|
1
|
+
import { I as CardLikeElementNode, ht as reconcileDecorator, ot as getKernelFromEditor, st as getKernelFromEditorConfig, ut as init_utils } from "./style-CLtp6okE.js";
|
|
2
2
|
import { $applyNodeReplacement, DecoratorNode, ElementNode } from "lexical";
|
|
3
3
|
import { addClassNamesToElement } from "@lexical/utils";
|
|
4
4
|
import { createStaticStyles, cx } from "antd-style";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/editor",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.4",
|
|
4
4
|
"description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@floating-ui/dom": "^1.7.4",
|
|
80
80
|
"@floating-ui/react": "^0.27.16",
|
|
81
|
-
"@lexical/clipboard": "
|
|
82
|
-
"@lexical/code-core": "
|
|
83
|
-
"@lexical/dragon": "
|
|
84
|
-
"@lexical/headless": "
|
|
85
|
-
"@lexical/history": "
|
|
86
|
-
"@lexical/link": "
|
|
87
|
-
"@lexical/list": "
|
|
88
|
-
"@lexical/rich-text": "
|
|
89
|
-
"@lexical/selection": "
|
|
90
|
-
"@lexical/table": "
|
|
91
|
-
"@lexical/utils": "
|
|
81
|
+
"@lexical/clipboard": "0.42.0",
|
|
82
|
+
"@lexical/code-core": "0.42.0",
|
|
83
|
+
"@lexical/dragon": "0.42.0",
|
|
84
|
+
"@lexical/headless": "0.42.0",
|
|
85
|
+
"@lexical/history": "0.42.0",
|
|
86
|
+
"@lexical/link": "0.42.0",
|
|
87
|
+
"@lexical/list": "0.42.0",
|
|
88
|
+
"@lexical/rich-text": "0.42.0",
|
|
89
|
+
"@lexical/selection": "0.42.0",
|
|
90
|
+
"@lexical/table": "0.42.0",
|
|
91
|
+
"@lexical/utils": "0.42.0",
|
|
92
92
|
"@shikijs/core": "^3.20.0",
|
|
93
93
|
"@shikijs/engine-javascript": "^3.20.0",
|
|
94
94
|
"@xmldom/xmldom": "^0.8.11",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"eventemitter3": "^5.0.1",
|
|
100
100
|
"fuse.js": "^7.1.0",
|
|
101
101
|
"katex": "^0.16.27",
|
|
102
|
-
"lexical": "
|
|
102
|
+
"lexical": "0.42.0",
|
|
103
103
|
"lucide-react": "^0.562.0",
|
|
104
104
|
"mermaid": "^11.13.0",
|
|
105
105
|
"polished": "^4.3.1",
|