@lobehub/editor 4.29.1 → 5.0.0-beta.1

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.
Files changed (149) hide show
  1. package/README.md +86 -0
  2. package/es/codemirror/components/CopyButton.js +1 -1
  3. package/es/codemirror/components/LanguageSelect.js +1 -3
  4. package/es/codemirror/components/MoreOptions.js +1 -2
  5. package/es/codemirror/components/Toolbar.js +1 -2
  6. package/es/codemirror/components/style.js +1 -1
  7. package/es/codemirror/style.js +1 -1
  8. package/es/codemirror/theme.js +1 -1
  9. package/es/editor-kernel/index.d.ts +2 -2
  10. package/es/editor-kernel/index.js +2 -2
  11. package/es/editor-kernel/react/useAnchor.js +1 -1
  12. package/es/headless/index.d.ts +5 -2
  13. package/es/headless/index.js +20 -22
  14. package/es/headless.d.ts +6 -507
  15. package/es/headless.js +903 -408
  16. package/es/i-node-identity-service-BBC_bg97.d.ts +522 -0
  17. package/es/index.d.ts +4 -2
  18. package/es/index.js +5 -2
  19. package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.js +1 -1
  20. package/es/plugins/auto-complete/react/style.js +1 -1
  21. package/es/plugins/block/react/ReactBlockPlugin.js +2 -7
  22. package/es/plugins/block/react/style.js +1 -1
  23. package/es/plugins/code/react/CodeReactPlugin.js +1 -1
  24. package/es/plugins/code/react/style.js +1 -1
  25. package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +1 -1
  26. package/es/plugins/codeblock/react/style.js +1 -1
  27. package/es/plugins/codemirror-block/react/CodemirrorNode.js +1 -3
  28. package/es/plugins/codemirror-block/react/MermaidPreview.js +1 -2
  29. package/es/plugins/collapsible/react/ReactCollapsiblePlugin.js +1 -1
  30. package/es/plugins/collapsible/react/style.js +74 -64
  31. package/es/plugins/common/data-source/json-data-source.js +33 -25
  32. package/es/plugins/common/data-source/text-data-source.js +6 -1
  33. package/es/plugins/common/index.d.ts +3 -1
  34. package/es/plugins/common/node/node-id.d.ts +7 -0
  35. package/es/plugins/common/node/node-id.js +484 -0
  36. package/es/plugins/common/node/node-identity-policy.d.ts +26 -0
  37. package/es/plugins/common/node/node-identity-policy.js +68 -0
  38. package/es/plugins/common/plugin/index.js +28 -2
  39. package/es/plugins/common/react/Placeholder/style.js +1 -1
  40. package/es/plugins/common/react/ReactPlainText.js +1 -1
  41. package/es/plugins/common/react/style.js +1 -1
  42. package/es/plugins/common/service/i-node-identity-service.d.ts +19 -0
  43. package/es/plugins/common/service/i-node-identity-service.js +4 -0
  44. package/es/plugins/common/service/node-identity-service.js +87 -0
  45. package/es/plugins/common/utils/index.js +3 -1
  46. package/es/plugins/file/react/components/ReactFile.js +1 -1
  47. package/es/plugins/file/react/style.js +1 -1
  48. package/es/plugins/hr/react/components/HRNode.js +1 -1
  49. package/es/plugins/hr/react/style.js +1 -1
  50. package/es/plugins/image/react/components/Image.js +1 -3
  51. package/es/plugins/image/react/components/ImageEditPopover.js +1 -3
  52. package/es/plugins/image/react/components/LazyImage.js +1 -1
  53. package/es/plugins/image/react/components/ResizeHandle.js +1 -1
  54. package/es/plugins/image/react/components/style.js +1 -1
  55. package/es/plugins/image/react/style.js +1 -1
  56. package/es/plugins/link/react/ReactLinkPlugin.js +1 -1
  57. package/es/plugins/link/react/components/LinkEdit.js +1 -3
  58. package/es/plugins/link/react/components/LinkToolbar.js +1 -1
  59. package/es/plugins/link/react/style.js +1 -1
  60. package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.js +1 -1
  61. package/es/plugins/link-highlight/react/style.js +1 -1
  62. package/es/plugins/list/plugin/index.js +7 -1
  63. package/es/plugins/list/react/style.js +1 -1
  64. package/es/plugins/litexml/command/index.d.ts +2 -2
  65. package/es/plugins/litexml/command/index.js +464 -292
  66. package/es/plugins/litexml/command/symbols.d.ts +18 -7
  67. package/es/plugins/litexml/command/symbols.js +2 -1
  68. package/es/plugins/litexml/data-source/litexml-data-source.js +34 -31
  69. package/es/plugins/litexml/diff-validation.js +68 -14
  70. package/es/plugins/litexml/index.d.ts +2 -2
  71. package/es/plugins/litexml/node/identity-policy.js +91 -0
  72. package/es/plugins/litexml/plugin/index.js +6 -0
  73. package/es/plugins/litexml/react/DiffNodeToolbar/index.js +1 -3
  74. package/es/plugins/litexml/react/DiffNodeToolbar/style.js +1 -1
  75. package/es/plugins/litexml/react/TableRowDiffToolbar.js +1 -3
  76. package/es/plugins/litexml/react/style.js +1 -1
  77. package/es/plugins/litexml/table-cell-diff.js +4 -0
  78. package/es/plugins/litexml/table-row-diff.js +4 -0
  79. package/es/plugins/litexml/utils/index.js +10 -23
  80. package/es/plugins/markdown/command/index.js +77 -4
  81. package/es/plugins/markdown/data-source/markdown-data-source.js +6 -1
  82. package/es/plugins/markdown/react/index.js +1 -1
  83. package/es/plugins/math/react/components/MathEditorContainer.js +1 -1
  84. package/es/plugins/math/react/components/MathEditorContent.js +1 -2
  85. package/es/plugins/math/react/components/Placeholder.js +1 -3
  86. package/es/plugins/math/react/style.js +1 -1
  87. package/es/plugins/mention/react/components/Mention.js +1 -1
  88. package/es/plugins/mention/react/style.js +1 -1
  89. package/es/plugins/slash/react/components/DefaultSlashMenu.js +1 -2
  90. package/es/plugins/slash/service/i-slash-service.d.ts +2 -2
  91. package/es/plugins/table/react/TableActionMenu/ActionMenu.js +1 -1
  92. package/es/plugins/table/react/TableActionMenu/index.js +1 -1
  93. package/es/plugins/table/react/TableActionMenu/style.js +1 -1
  94. package/es/plugins/table/react/TableColController.js +1 -1
  95. package/es/plugins/table/react/TableController/style.js +1 -1
  96. package/es/plugins/table/react/TableControllerButton.js +2 -2
  97. package/es/plugins/table/react/TableControllerMenu.js +2 -2
  98. package/es/plugins/table/react/TableHoverActions/index.js +1 -2
  99. package/es/plugins/table/react/TableHoverActions/style.js +1 -1
  100. package/es/plugins/table/react/TableResize/index.js +2 -2
  101. package/es/plugins/table/react/TableResize/style.js +1 -1
  102. package/es/plugins/table/react/TableRowController.js +1 -1
  103. package/es/plugins/table/react/index.js +1 -1
  104. package/es/plugins/table/react/style.js +1 -1
  105. package/es/plugins/toolbar/react/index.js +1 -2
  106. package/es/plugins/toolbar/react/style.js +1 -1
  107. package/es/plugins/yjs/plugin/index.js +5 -3
  108. package/es/plugins/yjs/plugin/utils/editor-state.js +8 -1
  109. package/es/plugins/yjs/plugin/utils/node-identity.js +106 -0
  110. package/es/plugins/yjs/service/index.js +38 -4
  111. package/es/react/ChatInput/ChatInput.js +1 -2
  112. package/es/react/ChatInput/style.js +1 -1
  113. package/es/react/ChatInput/type.d.ts +1 -1
  114. package/es/react/ChatInputActionBar/ChatInputActionBar.js +1 -2
  115. package/es/react/ChatInputActionBar/style.js +1 -1
  116. package/es/react/ChatInputActionBar/type.d.ts +1 -1
  117. package/es/react/ChatInputActions/ChatInputActions.js +1 -2
  118. package/es/react/ChatInputActions/components/ActionItem.js +1 -1
  119. package/es/react/ChatInputActions/components/ActionRender.js +1 -1
  120. package/es/react/ChatInputActions/components/CollapsedActions.js +1 -2
  121. package/es/react/ChatInputActions/style.js +1 -1
  122. package/es/react/ChatInputActions/type.d.ts +4 -4
  123. package/es/react/CodeLanguageSelect/CodeLanguageSelect.js +1 -3
  124. package/es/react/CodeLanguageSelect/style.js +1 -1
  125. package/es/react/CodeLanguageSelect/type.d.ts +1 -1
  126. package/es/react/FloatActions/FloatActions.js +1 -2
  127. package/es/react/FloatActions/components/ActionItem.js +1 -1
  128. package/es/react/FloatActions/components/ActionRender.js +1 -1
  129. package/es/react/FloatActions/components/CollapsedActions.js +1 -2
  130. package/es/react/FloatActions/style.js +1 -1
  131. package/es/react/FloatActions/type.d.ts +4 -4
  132. package/es/react/SendButton/SendButton.js +1 -2
  133. package/es/react/SendButton/components/SendIcon.js +1 -1
  134. package/es/react/SendButton/components/StopIcon.js +1 -1
  135. package/es/react/SendButton/style.js +1 -1
  136. package/es/react/SendButton/type.d.ts +1 -1
  137. package/es/renderer/LexicalDiff.js +1 -1
  138. package/es/renderer/LexicalRenderer.js +1 -1
  139. package/es/renderer/diff/compute.js +2 -2
  140. package/es/renderer/diff/style.js +1 -1
  141. package/es/renderer/engine/render-builtin-node.js +2 -2
  142. package/es/renderer/renderers/codeblock.js +1 -1
  143. package/es/renderer/renderers/horizontalrule.js +1 -1
  144. package/es/renderer/renderers/mermaid.js +1 -1
  145. package/es/renderer/style.js +1 -1
  146. package/es/{symbols-Do7jD4Tt.d.ts → symbols-Dyr9yyS0.d.ts} +18 -7
  147. package/package.json +6 -8
  148. package/scripts/postinstall-lexical-patch.cjs +0 -21
  149. package/patches/lexical@0.42.0.patch +0 -82
@@ -6,9 +6,9 @@ import { CommonPlugin } from "../plugin/index.js";
6
6
  import { useDecorators } from "../../../editor-kernel/react/useDecorators.js";
7
7
  import Placeholder from "./Placeholder/index.js";
8
8
  import { styles, themeStyles } from "./style.js";
9
+ import { cx } from "@lobehub/ui";
9
10
  import { Children, memo, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
10
11
  import { jsx, jsxs } from "react/jsx-runtime";
11
- import { cx } from "antd-style";
12
12
  import { COMMAND_PRIORITY_EDITOR, KEY_DOWN_COMMAND } from "lexical";
13
13
  //#region src/plugins/common/react/ReactPlainText.tsx
14
14
  const ReactPlainText = memo(({ style, children, theme = {}, onChange, editable, className, variant, enableHotkey = true, enablePasteMarkdown = true, autoFormatMarkdown = true, markdownOption = true, pasteAsPlainText = false, pasteMarkdownAutoConvertThreshold, pasteVSCodeAsCodeBlock = true, onKeyDown, onFocus, onBlur, autoFocus, onPressEnter, onCompositionStart, onCompositionEnd, onContextMenu, onTextChange }) => {
@@ -1,4 +1,4 @@
1
- import { createStaticStyles, cx, keyframes } from "antd-style";
1
+ import { createStaticStyles, cx, keyframes } from "@lobehub/ui";
2
2
  //#region src/plugins/common/react/style.ts
3
3
  const cursorBlink = keyframes`
4
4
  to {
@@ -0,0 +1,19 @@
1
+ import { IServiceID } from "../../../types/kernel.js";
2
+ import "../../../types/index.js";
3
+ //#region src/plugins/common/service/i-node-identity-service.d.ts
4
+ /** A detached, immutable description of the currently active logical node. */
5
+ interface NodeIdentitySnapshot {
6
+ readonly id: string;
7
+ /** Native Lexical text; a review container can include both pending sides. */
8
+ readonly textContent: string;
9
+ readonly type: string;
10
+ }
11
+ interface INodeIdentityService {
12
+ /** Read the last committed editor state without retaining a LexicalNode. */
13
+ getNodeById(nodeId: string): Readonly<NodeIdentitySnapshot> | null;
14
+ /** Subscribe to committed updates; query the service in the callback. */
15
+ subscribe(listener: () => void): () => void;
16
+ }
17
+ declare const INodeIdentityService: IServiceID<INodeIdentityService>;
18
+ //#endregion
19
+ export { INodeIdentityService, NodeIdentitySnapshot };
@@ -0,0 +1,4 @@
1
+ //#region src/plugins/common/service/i-node-identity-service.ts
2
+ const INodeIdentityService = { __serviceId: "NodeIdentityService" };
3
+ //#endregion
4
+ export { INodeIdentityService };
@@ -0,0 +1,87 @@
1
+ import { createDebugLogger, init_debug } from "../../../utils/debug.js";
2
+ import { getNodeIdentityPolicyRevision, init_node_identity_policy, subscribeNodeIdentityPolicy } from "../node/node-identity-policy.js";
3
+ import { $getActiveNodeIdKeys, $getNodeId, init_node_id } from "../node/node-id.js";
4
+ import { $getNodeByKey } from "lexical";
5
+ //#region src/plugins/common/service/node-identity-service.ts
6
+ init_node_id();
7
+ init_node_identity_policy();
8
+ init_debug();
9
+ const logger = createDebugLogger("service", "node-identity");
10
+ /** Implementation owned by CommonPlugin; external callers use INodeIdentityService. */
11
+ var NodeIdentityService = class {
12
+ constructor() {
13
+ this.editor = null;
14
+ this.indexes = /* @__PURE__ */ new WeakMap();
15
+ this.listeners = /* @__PURE__ */ new Set();
16
+ this.bindingToken = null;
17
+ this.unregisterBinding = null;
18
+ }
19
+ bindEditor(editor) {
20
+ this.unregisterBinding?.();
21
+ const bindingToken = {};
22
+ this.bindingToken = bindingToken;
23
+ this.indexes = /* @__PURE__ */ new WeakMap();
24
+ this.editor = editor;
25
+ const unregisterUpdate = editor.registerUpdateListener(({ editorState, prevEditorState }) => {
26
+ if (editorState !== prevEditorState) this.notify();
27
+ });
28
+ const unregisterPolicy = subscribeNodeIdentityPolicy(editor, () => this.notify());
29
+ let active = true;
30
+ const unregister = () => {
31
+ if (!active) return;
32
+ active = false;
33
+ unregisterUpdate();
34
+ unregisterPolicy();
35
+ };
36
+ this.unregisterBinding = unregister;
37
+ return () => {
38
+ unregister();
39
+ if (this.bindingToken !== bindingToken) return;
40
+ this.bindingToken = null;
41
+ this.unregisterBinding = null;
42
+ this.editor = null;
43
+ this.indexes = /* @__PURE__ */ new WeakMap();
44
+ this.listeners.clear();
45
+ };
46
+ }
47
+ getNodeById(nodeId) {
48
+ if (typeof nodeId !== "string" || !nodeId.trim()) return null;
49
+ const editor = this.editor;
50
+ if (!editor) return null;
51
+ const editorState = editor.getEditorState();
52
+ const revision = getNodeIdentityPolicyRevision(editor);
53
+ let index = this.indexes.get(editorState);
54
+ if (!index || index.revision !== revision) {
55
+ index = {
56
+ keys: editorState.read(() => $getActiveNodeIdKeys(), { editor }),
57
+ revision
58
+ };
59
+ this.indexes.set(editorState, index);
60
+ }
61
+ const key = index.keys.get(nodeId);
62
+ if (!key) return null;
63
+ return editorState.read(() => {
64
+ const node = $getNodeByKey(key);
65
+ const id = node && $getNodeId(node);
66
+ return node && id === nodeId ? Object.freeze({
67
+ id,
68
+ textContent: node.getTextContent(),
69
+ type: node.getType()
70
+ }) : null;
71
+ }, { editor });
72
+ }
73
+ subscribe(listener) {
74
+ this.listeners.add(listener);
75
+ return () => this.listeners.delete(listener);
76
+ }
77
+ notify() {
78
+ const listeners = Array.from(this.listeners);
79
+ for (const listener of listeners) try {
80
+ listener();
81
+ } catch (error) {
82
+ logger.error("Node identity subscriber failed:", error);
83
+ }
84
+ }
85
+ };
86
+ //#endregion
87
+ export { NodeIdentityService };
@@ -1,5 +1,6 @@
1
1
  import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
2
2
  import { INodeHelper, init_helper } from "../../../editor-kernel/inode/helper.js";
3
+ import { $getNodeId, init_node_id } from "../node/node-id.js";
3
4
  import { $isTableCellNode, $isTableNode } from "@lexical/table";
4
5
  import { $getRoot, $isDecoratorNode, $isElementNode, $isParagraphNode, $isRangeSelection, $isTextNode } from "lexical";
5
6
  import { $isQuoteNode } from "@lexical/rich-text";
@@ -99,7 +100,7 @@ function $isCursorInQuote(selection) {
99
100
  function exportNodeToJSON(node) {
100
101
  const serializedNode = node.exportJSON();
101
102
  const nodeClass = node.constructor;
102
- serializedNode.id = node.getKey();
103
+ serializedNode.id = $getNodeId(node);
103
104
  if (serializedNode.type !== nodeClass.getType()) throw new Error(`LexicalNode: Node ${nodeClass.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);
104
105
  if ($isElementNode(node)) {
105
106
  const serializedChildren = serializedNode.children;
@@ -115,6 +116,7 @@ function exportNodeToJSON(node) {
115
116
  var sampleReader, createBlockNode;
116
117
  var init_utils = __esmMin((() => {
117
118
  init_helper();
119
+ init_node_id();
118
120
  sampleReader = (format, xmlElement, children) => {
119
121
  children.forEach((child) => {
120
122
  if (INodeHelper.isTextNode(child)) child.format = (child.format || 0) | format;
@@ -1,8 +1,8 @@
1
1
  import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
2
2
  import { useLexicalNodeSelection } from "../../../../editor-kernel/react/useLexicalNodeSelection.js";
3
+ import { Center, MaterialFileTypeIcon } from "@lobehub/ui";
3
4
  import { useCallback, useEffect, useRef } from "react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import { Center, MaterialFileTypeIcon } from "@lobehub/ui";
6
6
  import { CLICK_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
7
7
  //#region src/plugins/file/react/components/ReactFile.tsx
8
8
  const ReactFile = ({ className, editor, node }) => {
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/plugins/file/react/style.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => ({ file: css`
4
4
  user-select: none;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { useLexicalNodeSelection } from "../../../../editor-kernel/react/useLexicalNodeSelection.js";
3
3
  import { styles } from "../style.js";
4
+ import { cx } from "@lobehub/ui";
4
5
  import { useEffect } from "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
- import { cx } from "antd-style";
7
7
  import { CLICK_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
8
8
  import { mergeRegister } from "@lexical/utils";
9
9
  //#region src/plugins/hr/react/components/HRNode.tsx
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/plugins/hr/react/style.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => css`
4
4
  cursor: pointer;
@@ -7,12 +7,10 @@ import BrokenImage from "./BrokenImage.js";
7
7
  import ImageEditPopover from "./ImageEditPopover.js";
8
8
  import LazyImage from "./LazyImage.js";
9
9
  import { ResizeHandle } from "./ResizeHandle.js";
10
- import { ActionIcon } from "@lobehub/ui/base-ui";
10
+ import { ActionIcon, Icon, cx, useImagePreview } from "@lobehub/ui";
11
11
  import { LoaderCircleIcon, ZoomInIcon } from "lucide-react";
12
12
  import { Suspense, memo, useCallback, useMemo, useRef, useState } from "react";
13
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
- import { Icon, useImagePreview } from "@lobehub/ui";
15
- import { cx } from "antd-style";
16
14
  import { COMMAND_PRIORITY_LOW, SELECTION_CHANGE_COMMAND } from "lexical";
17
15
  //#region src/plugins/image/react/components/Image.tsx
18
16
  function getResizedImageWidth(startWidth, deltaX, maxWidth) {
@@ -1,12 +1,10 @@
1
1
  import { useLexicalEditor } from "../../../../editor-kernel/react/useLexicalEditor.js";
2
2
  import { useTranslation } from "../../../../editor-kernel/react/useTranslation.js";
3
3
  import { useEditable } from "../../../../editor-kernel/react/useEditable.js";
4
- import { Button, Input } from "@lobehub/ui/base-ui";
4
+ import { Button, Flexbox, Icon, Input, Popover, cssVar } from "@lobehub/ui";
5
5
  import { LinkIcon, UploadIcon } from "lucide-react";
6
6
  import { memo, useCallback, useRef, useState } from "react";
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { Flexbox, Icon, Popover } from "@lobehub/ui";
9
- import { cssVar } from "antd-style";
10
8
  //#region src/plugins/image/react/components/ImageEditPopover.tsx
11
9
  const ImageEditPopover = memo(({ children, node, handleUpload, onPickFile }) => {
12
10
  const [open, setOpen] = useState(false);
@@ -1,9 +1,9 @@
1
1
  import { styles } from "./style.js";
2
2
  import BrokenImage from "./BrokenImage.js";
3
3
  import { useSuspenseImage } from "./useSupenseImage.js";
4
+ import { cx } from "@lobehub/ui";
4
5
  import { useEffect, useState } from "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
- import { cx } from "antd-style";
7
7
  //#region src/plugins/image/react/components/LazyImage.tsx
8
8
  function isSVG(src) {
9
9
  return src.toLowerCase().endsWith(".svg");
@@ -1,7 +1,7 @@
1
1
  import { styles } from "./style.js";
2
+ import { cx } from "@lobehub/ui";
2
3
  import { useCallback, useRef } from "react";
3
4
  import { jsx } from "react/jsx-runtime";
4
- import { cx } from "antd-style";
5
5
  //#region src/plugins/image/react/components/ResizeHandle.tsx
6
6
  const ResizeHandle = ({ imageRef, isBlock, onResize, onResizeEnd, onResizeStart, position }) => {
7
7
  const startWidthRef = useRef(0);
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/plugins/image/react/components/style.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => ({
4
4
  brokenImage: css`
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/plugins/image/react/style.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => ({
4
4
  image: css`
@@ -15,7 +15,7 @@ import LinkIframe from "./components/LinkIframe.js";
15
15
  import LinkToolbar from "./components/LinkToolbar.js";
16
16
  import SchemaLink from "./components/SchemaLink.js";
17
17
  import { LinkReactRendererRegistry, splitReactSchemaRules } from "./renderer-registry.js";
18
- import { toast } from "@lobehub/ui/base-ui";
18
+ import { toast } from "@lobehub/ui";
19
19
  import { useLayoutEffect, useMemo, useRef, useState } from "react";
20
20
  import { jsx, jsxs } from "react/jsx-runtime";
21
21
  //#region src/plugins/link/react/ReactLinkPlugin.tsx
@@ -4,12 +4,10 @@ import { UPDATE_LINK_TEXT_COMMAND } from "../../command/index.js";
4
4
  import { EDIT_LINK_CARD_COMMAND } from "../../node/LinkCardNode.js";
5
5
  import { cleanPosition, updatePosition } from "../../../../utils/updatePosition.js";
6
6
  import { styles } from "../style.js";
7
- import { Button, Input, Text } from "@lobehub/ui/base-ui";
7
+ import { Block, Button, Flexbox, Hotkey, Icon, Input, Text, cssVar } from "@lobehub/ui";
8
8
  import { BaselineIcon, LinkIcon } from "lucide-react";
9
9
  import { useCallback, useEffect, useRef, useState } from "react";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { Block, Flexbox, Hotkey, Icon } from "@lobehub/ui";
12
- import { cssVar } from "antd-style";
13
11
  import { COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_NORMAL, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, createCommand } from "lexical";
14
12
  import { mergeRegister } from "@lexical/utils";
15
13
  //#region src/plugins/link/react/components/LinkEdit.tsx
@@ -8,10 +8,10 @@ import { useEditable } from "../../../../editor-kernel/react/useEditable.js";
8
8
  import { cleanPosition, updatePosition } from "../../../../utils/updatePosition.js";
9
9
  import { styles } from "../style.js";
10
10
  import { $isLinkToolbarNode, convertLinkNodeByKeyToSchema, convertLinkToolbarNodeByKeyToLink, getLinkToolbarCapabilities, replaceNodeByKeyWithBlockCardNode, replaceNodeByKeyWithCardNode, replaceNodeByKeyWithIframeNode } from "../../conversion/index.js";
11
+ import { Flexbox, Icon } from "@lobehub/ui";
11
12
  import { CopyIcon, EditIcon, ExternalLinkIcon, GalleryHorizontalEndIcon, LinkIcon, PanelTopOpenIcon, PanelsTopLeftIcon, UnlinkIcon } from "lucide-react";
12
13
  import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
13
14
  import { jsx } from "react/jsx-runtime";
14
- import { Flexbox, Icon } from "@lobehub/ui";
15
15
  import { $getNodeByKey, $getSelection, $isRangeSelection, COMMAND_PRIORITY_NORMAL } from "lexical";
16
16
  import { mergeRegister } from "@lexical/utils";
17
17
  //#region src/plugins/link/react/components/LinkToolbar.tsx
@@ -1,4 +1,4 @@
1
- import { createStaticStyles, cx } from "antd-style";
1
+ import { createStaticStyles, cx } from "@lobehub/ui";
2
2
  //#region src/plugins/link/react/style.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => {
4
4
  const position = css`
@@ -2,8 +2,8 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react/react-co
2
2
  import { MarkdownPlugin } from "../../markdown/plugin/index.js";
3
3
  import { LinkHighlightPlugin } from "../plugin/index.js";
4
4
  import { styles } from "./style.js";
5
+ import { cx } from "@lobehub/ui";
5
6
  import { useLayoutEffect } from "react";
6
- import { cx } from "antd-style";
7
7
  //#region src/plugins/link-highlight/react/ReactLinkHighlightPlugin.tsx
8
8
  const ReactLinkHighlightPlugin = ({ className, enableHotkey = true, enablePasteAutoHighlight = true }) => {
9
9
  const [editor] = useLexicalComposerContext();
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/plugins/link-highlight/react/style.ts
3
3
  const styles = createStaticStyles(({ css }) => {
4
4
  return { linkHighlight: css`
@@ -62,7 +62,11 @@ const ListPlugin = class extends KernelPlugin {
62
62
  return false;
63
63
  });
64
64
  litexmlService.registerXMLWriter(ListItemNode.getType(), (node, ctx) => {
65
- if ($isListItemNode(node)) return ctx.createXmlNode("li");
65
+ if ($isListItemNode(node)) {
66
+ const child = node.getFirstChild();
67
+ if (child?.getType() === "diff" && "diffType" in child && child.diffType === "listItemRemove") return { lines: [] };
68
+ return ctx.createXmlNode("li");
69
+ }
66
70
  return false;
67
71
  });
68
72
  litexmlService.registerXMLReader("ol", (xmlNode, children) => {
@@ -136,6 +140,8 @@ const ListPlugin = class extends KernelPlugin {
136
140
  markdownService.registerMarkdownWriter(ListItemNode.getType(), (ctx, node) => {
137
141
  const parent = node.getParent();
138
142
  if ($isListItemNode(node) && $isListNode(parent)) {
143
+ const child = node.getFirstChild();
144
+ if (child?.getType() === "diff" && "diffType" in child && child.diffType === "listItemRemove") return true;
139
145
  if ($isListNode(node.getFirstChild())) return;
140
146
  const level = getLevel(parent);
141
147
  const prefix = " ".repeat(level);
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/plugins/list/react/style.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => css`
4
4
  .editor_listUnordered&,
@@ -1,4 +1,4 @@
1
1
  import "../data-source/litexml-data-source.js";
2
- import { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND } from "./symbols.js";
2
+ import { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_MODIFY_WITH_RESULTS_COMMAND, LITEXML_REMOVE_COMMAND, LiteXmlModifyOperation, LiteXmlOperationResult } from "./symbols.js";
3
3
  import { LexicalEditor } from "lexical";
4
- export { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_REMOVE_COMMAND };
4
+ export { LITEXML_APPLY_COMMAND, LITEXML_INSERT_COMMAND, LITEXML_MODIFY_COMMAND, LITEXML_MODIFY_WITH_RESULTS_COMMAND, LITEXML_REMOVE_COMMAND, type LiteXmlModifyOperation, type LiteXmlOperationResult };