@lobehub/editor 4.8.1 → 4.8.3

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-Ub1LiKko.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-D-9k-451.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";
@@ -22,6 +22,10 @@ import { bundledLanguagesInfo, bundledLanguagesInfo as bundledLanguagesInfo$1, b
22
22
  import Fuse from "fuse.js";
23
23
  import { flip, offset, shift, useFloating } from "@floating-ui/react";
24
24
  //#region src/editor-kernel/react/LexicalErrorBoundary.tsx
25
+ init_helper();
26
+ init_debug();
27
+ init_plugin();
28
+ init_utils();
25
29
  function LexicalErrorBoundary({ children, onError }) {
26
30
  return /* @__PURE__ */ jsx(ErrorBoundary, {
27
31
  fallback: /* @__PURE__ */ jsx("div", {
@@ -38,7 +42,6 @@ function LexicalErrorBoundary({ children, onError }) {
38
42
  }
39
43
  //#endregion
40
44
  //#region src/editor-kernel/react/react-context.ts
41
- init_utils();
42
45
  const LexicalComposerContext = createContext(null);
43
46
  function createLexicalComposerContext(parent, theme) {
44
47
  let parentContext = null;
@@ -8739,6 +8742,7 @@ function configure(base, extension) {
8739
8742
  if (extension.extensions) while (++index < extension.extensions.length) configure(base, extension.extensions[index]);
8740
8743
  for (key in extension) if (own$1.call(extension, key)) switch (key) {
8741
8744
  case "extensions": break;
8745
+ /* c8 ignore next 4 */
8742
8746
  case "unsafe":
8743
8747
  list$1(base[key], extension[key]);
8744
8748
  break;
@@ -11449,8 +11453,8 @@ function bail(error) {
11449
11453
  if (error) throw error;
11450
11454
  }
11451
11455
  //#endregion
11452
- //#region node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js
11453
- var require_extend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11456
+ //#region node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.js
11457
+ var import_extend = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
11454
11458
  var hasOwn = Object.prototype.hasOwnProperty;
11455
11459
  var toStr = Object.prototype.toString;
11456
11460
  var defineProperty = Object.defineProperty;
@@ -11520,7 +11524,7 @@ var require_extend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11520
11524
  }
11521
11525
  return target;
11522
11526
  };
11523
- }));
11527
+ })))(), 1);
11524
11528
  //#endregion
11525
11529
  //#region node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
11526
11530
  function isPlainObject(value) {
@@ -13108,7 +13112,6 @@ const CallableInstance = (function(property) {
13108
13112
  * If a result that is not acceptable on a `VFile` is used, that will
13109
13113
  * be stored on the `result` field of {@linkcode VFile}.
13110
13114
  */
13111
- var import_extend = /* @__PURE__ */ __toESM(require_extend(), 1);
13112
13115
  const own = {}.hasOwnProperty;
13113
13116
  /**
13114
13117
  * Create a new processor.
@@ -18359,11 +18362,9 @@ function remarkMath(options) {
18359
18362
  }
18360
18363
  //#endregion
18361
18364
  //#region src/plugins/markdown/utils/logger.ts
18362
- init_debug();
18363
18365
  const logger$2 = createDebugLogger("plugin", "markdown");
18364
18366
  //#endregion
18365
18367
  //#region src/plugins/markdown/data-source/markdown/parse.ts
18366
- init_helper();
18367
18368
  const selfClosingHtmlTags = new Set([
18368
18369
  "area",
18369
18370
  "base",
@@ -18758,7 +18759,6 @@ var NodeService = class {
18758
18759
  };
18759
18760
  //#endregion
18760
18761
  //#region src/plugins/inode/plugin/index.ts
18761
- init_plugin();
18762
18762
  /**
18763
18763
  * LitexmlPlugin - A plugin that provides XML-based data source support
18764
18764
  * Allows converting between Lexical editor state and XML format
package/es/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as DOM_TEXT_TYPE, A as $createCodeMirrorNode, At as createDebugLogger, 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-Ub1LiKko.js";
2
- import { A as idToChar, B as MARKDOWN_READER_LEVEL_NORMAL, C as ReactEditorContent, D as $cloneNode, E as LitexmlService, F as MarkdownPlugin, G as INSERT_MARKDOWN_COMMAND, H as INodePlugin, I as detectCodeLanguage, J as ReactEditor, K as isPunctuationChar, L as detectLanguage, M as INSERT_QUOTE_COMMAND, N as ReactMarkdownPlugin, O as $parseSerializedNodeImpl, P as useTranslation, R as IMarkdownShortCutService, S as ReactPlainText, T as ILitexmlService, U as INodeService, V as MARKDOWN_WRITER_LEVEL_MAX, W as GET_MARKDOWN_SELECTION_COMMAND, X as LexicalErrorBoundary, Y as useLexicalComposerContext, _ as bundledLanguagesInfo, a as ReactMentionPlugin, b as INSERT_CODEINLINE_COMMAND, c as INSERT_CHECK_LIST_COMMAND, d as registerLinkHighlightCommand, f as extractUrlFromText, g as useLexicalNodeSelection, i as SlashPlugin, j as INSERT_HEADING_COMMAND, k as charToId, l as registerCheckList, m as sanitizeUrl, n as ReactSlashOption, o as MentionPlugin, p as getSelectedNode, q as useLexicalEditor, r as SlashMenu, s as INSERT_MENTION_COMMAND, t as ReactSlashPlugin, u as INSERT_LINK_HIGHLIGHT_COMMAND, v as CodeblockPlugin, w as CommonPlugin, x as registerCodeInlineCommand, y as UPDATE_CODEBLOCK_LANG, z as MARKDOWN_READER_LEVEL_HIGH } from "./ReactSlashPlugin-Dp1bUEGK.js";
3
- import { S as PlaceholderNode, _ as $isFileNode, a as styles$16, b as DiffNode, c as ImageNode, d as BlockImageNode, f as $createHorizontalRuleNode, g as $createFileNode, h as styles$15, i as imageBroken, l as $createBlockImageNode, m as HorizontalRuleNode, n as styles$18, o as $createImageNode, p as $isHorizontalRuleNode, r as styles$17, s as $isImageNode, t as styles$19, u as $isBlockImageNode, v as FileNode, x as PlaceholderBlockNode, y as $createDiffNode } from "./style-CFkese2R.js";
1
+ import { $ as DOM_TEXT_TYPE, A as $createCodeMirrorNode, At as createDebugLogger, 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-D-9k-451.js";
2
+ import { A as idToChar, B as MARKDOWN_READER_LEVEL_NORMAL, C as ReactEditorContent, D as $cloneNode, E as LitexmlService, F as MarkdownPlugin, G as INSERT_MARKDOWN_COMMAND, H as INodePlugin, I as detectCodeLanguage, J as ReactEditor, K as isPunctuationChar, L as detectLanguage, M as INSERT_QUOTE_COMMAND, N as ReactMarkdownPlugin, O as $parseSerializedNodeImpl, P as useTranslation, R as IMarkdownShortCutService, S as ReactPlainText, T as ILitexmlService, U as INodeService, V as MARKDOWN_WRITER_LEVEL_MAX, W as GET_MARKDOWN_SELECTION_COMMAND, X as LexicalErrorBoundary, Y as useLexicalComposerContext, _ as bundledLanguagesInfo, a as ReactMentionPlugin, b as INSERT_CODEINLINE_COMMAND, c as INSERT_CHECK_LIST_COMMAND, d as registerLinkHighlightCommand, f as extractUrlFromText, g as useLexicalNodeSelection, i as SlashPlugin, j as INSERT_HEADING_COMMAND, k as charToId, l as registerCheckList, m as sanitizeUrl, n as ReactSlashOption, o as MentionPlugin, p as getSelectedNode, q as useLexicalEditor, r as SlashMenu, s as INSERT_MENTION_COMMAND, t as ReactSlashPlugin, u as INSERT_LINK_HIGHLIGHT_COMMAND, v as CodeblockPlugin, w as CommonPlugin, x as registerCodeInlineCommand, y as UPDATE_CODEBLOCK_LANG, z as MARKDOWN_READER_LEVEL_HIGH } from "./ReactSlashPlugin-B-UVEkP7.js";
3
+ import { S as PlaceholderNode, _ as $isFileNode, a as styles$16, b as DiffNode, c as ImageNode, d as BlockImageNode, f as $createHorizontalRuleNode, g as $createFileNode, h as styles$15, i as imageBroken, l as $createBlockImageNode, m as HorizontalRuleNode, n as styles$18, o as $createImageNode, p as $isHorizontalRuleNode, r as styles$17, s as $isImageNode, t as styles$19, u as $isBlockImageNode, v as FileNode, x as PlaceholderBlockNode, y as $createDiffNode } from "./style-DPKmYLEF.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";
7
- import { $createNodeSelection, $createParagraphNode, $createRangeSelection, $createTextNode, $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode$1, $getNodeByKey, $getPreviousSelection, $getRoot, $getSelection, $insertNodes, $isBlockElementNode, $isDecoratorNode, $isElementNode, $isNodeSelection, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isTextNode, $normalizeSelection__EXPERIMENTAL, $setSelection, CLICK_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, DROP_COMMAND, HISTORY_MERGE_TAG, INDENT_CONTENT_COMMAND, INSERT_TAB_COMMAND, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DOWN_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, ParagraphNode, SELECTION_CHANGE_COMMAND, SKIP_SCROLL_INTO_VIEW_TAG, TextNode, createCommand, getDOMSelection, getDOMSelectionFromTarget, isHTMLElement, isModifierMatch } from "lexical";
7
+ import { $createNodeSelection, $createParagraphNode, $createRangeSelection, $createTextNode, $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode$1, $getNodeByKey, $getPreviousSelection, $getRoot, $getSelection, $insertNodes, $isBlockElementNode, $isDecoratorNode, $isElementNode, $isNodeSelection, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isTextNode, $nodesOfType, $normalizeSelection__EXPERIMENTAL, $setSelection, CLICK_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, DROP_COMMAND, HISTORY_MERGE_TAG, INDENT_CONTENT_COMMAND, INSERT_TAB_COMMAND, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DOWN_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, ParagraphNode, SELECTION_CHANGE_COMMAND, SKIP_SCROLL_INTO_VIEW_TAG, TextNode, createCommand, getDOMSelection, getDOMSelectionFromTarget, isHTMLElement, isModifierMatch } from "lexical";
8
8
  import { DRAG_DROP_PASTE } from "@lexical/rich-text";
9
9
  import { $filter, $findMatchingParent, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, $insertNodeToNearestRoot, $wrapNodeInElement, addClassNamesToElement, calculateZoomLevel, mergeRegister, removeClassNamesFromElement } from "@lexical/utils";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1101,6 +1101,16 @@ const LitexmlPlugin = class extends KernelPlugin {
1101
1101
  onInit(editor) {
1102
1102
  this.register(registerLiteXMLCommand(editor, this.datasource));
1103
1103
  this.register(registerLiteXMLDiffCommand(editor));
1104
+ this.register(editor.registerNodeTransform(DiffNode, (node) => {
1105
+ if (node.diffType === "modify" && node.getChildrenSize() === 1) node.setDiffType("remove");
1106
+ }));
1107
+ this.register(editor.registerUpdateListener(({ editorState, prevEditorState }) => {
1108
+ if (editorState === prevEditorState) return;
1109
+ editor.update(() => {
1110
+ const diffNodes = $nodesOfType(DiffNode);
1111
+ for (const node of diffNodes) if (node.diffType === "modify" && node.getChildrenSize() === 1) node.setDiffType("remove");
1112
+ });
1113
+ }));
1104
1114
  this.registerLiteXml();
1105
1115
  this.registerMarkdown();
1106
1116
  }
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-Ub1LiKko.js";
2
- import { C as ReactEditorContent, J as ReactEditor, N as ReactMarkdownPlugin, S as ReactPlainText, a as ReactMentionPlugin, b as INSERT_CODEINLINE_COMMAND, c as INSERT_CHECK_LIST_COMMAND, f as extractUrlFromText, h as validateUrl, m as sanitizeUrl, n as ReactSlashOption, t as ReactSlashPlugin, u as INSERT_LINK_HIGHLIGHT_COMMAND, y as UPDATE_CODEBLOCK_LANG } from "./ReactSlashPlugin-Dp1bUEGK.js";
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-D-9k-451.js";
2
+ import { C as ReactEditorContent, J as ReactEditor, N as ReactMarkdownPlugin, S as ReactPlainText, a as ReactMentionPlugin, b as INSERT_CODEINLINE_COMMAND, c as INSERT_CHECK_LIST_COMMAND, f as extractUrlFromText, h as validateUrl, m as sanitizeUrl, n as ReactSlashOption, t as ReactSlashPlugin, u as INSERT_LINK_HIGHLIGHT_COMMAND, y as UPDATE_CODEBLOCK_LANG } from "./ReactSlashPlugin-B-UVEkP7.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-Ub1LiKko.js";
2
- import { S as PlaceholderNode, a as styles$5, b as DiffNode, c as ImageNode, d as BlockImageNode, h as styles$6, m as HorizontalRuleNode, n as styles$4, r as styles$2, t as styles$3, v as FileNode, x as PlaceholderBlockNode } from "./style-CFkese2R.js";
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-D-9k-451.js";
2
+ import { S as PlaceholderNode, a as styles$5, b as DiffNode, c as ImageNode, d as BlockImageNode, h as styles$6, m as HorizontalRuleNode, n as styles$4, r as styles$2, t as styles$3, v as FileNode, x as PlaceholderBlockNode } from "./style-DPKmYLEF.js";
3
3
  import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
4
4
  import { $getRoot, $isElementNode, $isTextNode } from "lexical";
5
5
  import { HeadingNode, QuoteNode } from "@lexical/rich-text";
@@ -909,8 +909,11 @@ const base = createStaticStyles(({ css, cssVar }) => ({
909
909
  `,
910
910
  cell: css`
911
911
  overflow: auto;
912
+
912
913
  min-width: 0;
913
914
  min-height: 24px;
915
+ padding-block: 8px;
916
+ padding-inline: 16px;
914
917
 
915
918
  > div {
916
919
  width: 100%;
@@ -932,7 +935,6 @@ const base = createStaticStyles(({ css, cssVar }) => ({
932
935
  `
933
936
  }));
934
937
  const defaultOverrides = createStaticStyles(({ css, cssVar }) => ({
935
- cellOld: css``,
936
938
  header: css`
937
939
  display: grid;
938
940
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
@@ -969,11 +971,9 @@ const borderlessOverrides = createStaticStyles(({ css, cssVar }) => ({
969
971
  background: ${cssVar.colorFillQuaternary};
970
972
  }
971
973
  `,
972
- cellOld: css``,
973
974
  header: css`
974
975
  display: grid;
975
976
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
976
- column-gap: 12px;
977
977
  `,
978
978
  headerCell: css`
979
979
  padding-block: 8px;
@@ -985,14 +985,10 @@ const borderlessOverrides = createStaticStyles(({ css, cssVar }) => ({
985
985
  text-transform: uppercase;
986
986
  letter-spacing: 0.05em;
987
987
  `,
988
- headerOld: css``,
989
988
  root: css`
990
989
  overflow: hidden;
991
990
  font-size: 14px;
992
991
  background: ${cssVar.colorBgContainer};
993
- `,
994
- row: css`
995
- column-gap: 12px;
996
992
  `
997
993
  }));
998
994
  function merge(baseSet, overrides) {
@@ -1068,7 +1064,7 @@ function LexicalDiff({ oldValue, newValue, variant = "default", appearance = "de
1068
1064
  return /* @__PURE__ */ jsxs("div", {
1069
1065
  className: styles.row,
1070
1066
  children: [/* @__PURE__ */ jsx(RowCell, {
1071
- className: cx(styles.cell, styles.cellOld, !row.oldCell && styles.emptyCell, row.kind === "delete" && styles.deleteCell),
1067
+ className: cx(styles.cell, !row.oldCell && styles.emptyCell, row.kind === "delete" && styles.deleteCell),
1072
1068
  content: oldContent
1073
1069
  }), /* @__PURE__ */ jsx(RowCell, {
1074
1070
  className: cx(styles.cell, !row.newCell && styles.emptyCell, row.kind === "insert" && styles.insertCell),
@@ -1,4 +1,4 @@
1
- import { I as CardLikeElementNode, ht as reconcileDecorator, ot as getKernelFromEditor, st as getKernelFromEditorConfig, ut as init_utils } from "./style-Ub1LiKko.js";
1
+ import { I as CardLikeElementNode, ht as reconcileDecorator, ot as getKernelFromEditor, st as getKernelFromEditorConfig, ut as init_utils } from "./style-D-9k-451.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.8.1",
3
+ "version": "4.8.3",
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",
@@ -1511,6 +1511,7 @@ var init_kernel = __esmMin((() => {
1511
1511
  }));
1512
1512
  //#endregion
1513
1513
  //#region src/editor-kernel/data-source.ts
1514
+ init_kernel();
1514
1515
  var DataSource = class {
1515
1516
  constructor(dataType) {
1516
1517
  this.dataType = dataType;
@@ -1525,7 +1526,6 @@ var DataSource = class {
1525
1526
  };
1526
1527
  //#endregion
1527
1528
  //#region src/editor-kernel/index.ts
1528
- init_kernel();
1529
1529
  init_utils();
1530
1530
  init_event();
1531
1531
  /**