@lobehub/editor 3.2.0 → 3.2.2

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 (132) hide show
  1. package/es/editor-kernel/react/useAnchor.js +4 -1
  2. package/es/plugins/auto-complete/react/ReactAutoCompletePlugin.js +2 -4
  3. package/es/plugins/auto-complete/react/style.d.ts +4 -4
  4. package/es/plugins/auto-complete/react/style.js +2 -2
  5. package/es/plugins/code/react/CodeReactPlugin.js +2 -4
  6. package/es/plugins/code/react/style.d.ts +3 -3
  7. package/es/plugins/code/react/style.js +4 -4
  8. package/es/plugins/codeblock/command/index.d.ts +2 -11
  9. package/es/plugins/codeblock/command/index.js +1 -37
  10. package/es/plugins/codeblock/plugin/CodeHighlighterShiki.d.ts +0 -6
  11. package/es/plugins/codeblock/plugin/CodeHighlighterShiki.js +4 -5
  12. package/es/plugins/codeblock/plugin/FacadeShiki.d.ts +2 -7
  13. package/es/plugins/codeblock/plugin/FacadeShiki.js +46 -103
  14. package/es/plugins/codeblock/plugin/index.d.ts +0 -5
  15. package/es/plugins/codeblock/plugin/index.js +3 -7
  16. package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +9 -26
  17. package/es/plugins/codeblock/react/style.d.ts +4 -6
  18. package/es/plugins/codeblock/react/style.js +5 -32
  19. package/es/plugins/common/react/Placeholder/index.js +1 -3
  20. package/es/plugins/common/react/Placeholder/style.d.ts +4 -4
  21. package/es/plugins/common/react/Placeholder/style.js +4 -4
  22. package/es/plugins/common/react/ReactPlainText.js +33 -21
  23. package/es/plugins/common/react/style.d.ts +22 -32
  24. package/es/plugins/common/react/style.js +27 -30
  25. package/es/plugins/file/react/ReactFilePlugin.js +1 -3
  26. package/es/plugins/file/react/style.d.ts +3 -3
  27. package/es/plugins/file/react/style.js +4 -4
  28. package/es/plugins/hr/react/components/HRNode.d.ts +2 -2
  29. package/es/plugins/hr/react/components/HRNode.js +5 -7
  30. package/es/plugins/hr/react/style.d.ts +1 -1
  31. package/es/plugins/hr/react/style.js +4 -4
  32. package/es/plugins/image/react/ReactImagePlugin.js +1 -3
  33. package/es/plugins/image/react/components/BrokenImage.js +3 -5
  34. package/es/plugins/image/react/components/Image.js +2 -4
  35. package/es/plugins/image/react/components/LazyImage.d.ts +9 -8
  36. package/es/plugins/image/react/components/LazyImage.js +6 -7
  37. package/es/plugins/image/react/components/ResizeHandle.d.ts +2 -2
  38. package/es/plugins/image/react/components/ResizeHandle.js +5 -7
  39. package/es/plugins/image/react/components/style.d.ts +9 -7
  40. package/es/plugins/image/react/components/style.js +11 -10
  41. package/es/plugins/image/react/style.d.ts +4 -4
  42. package/es/plugins/image/react/style.js +5 -5
  43. package/es/plugins/link/react/ReactLinkPlugin.js +1 -3
  44. package/es/plugins/link/react/components/LinkEdit.d.ts +2 -2
  45. package/es/plugins/link/react/components/LinkEdit.js +7 -9
  46. package/es/plugins/link/react/components/LinkToolbar.js +1 -3
  47. package/es/plugins/link/react/style.d.ts +4 -4
  48. package/es/plugins/link/react/style.js +7 -8
  49. package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.js +2 -4
  50. package/es/plugins/link-highlight/react/style.d.ts +3 -3
  51. package/es/plugins/link-highlight/react/style.js +2 -2
  52. package/es/plugins/list/react/ReactListPlugin.js +1 -3
  53. package/es/plugins/list/react/style.d.ts +1 -1
  54. package/es/plugins/list/react/style.js +4 -5
  55. package/es/plugins/litexml/react/DiffNodeToolbar/index.js +5 -4
  56. package/es/plugins/litexml/react/DiffNodeToolbar/style.d.ts +6 -5
  57. package/es/plugins/litexml/react/DiffNodeToolbar/style.js +7 -7
  58. package/es/plugins/litexml/react/index.js +1 -3
  59. package/es/plugins/litexml/react/style.d.ts +1 -1
  60. package/es/plugins/litexml/react/style.js +4 -4
  61. package/es/plugins/math/react/components/MathEditorContainer.js +1 -3
  62. package/es/plugins/math/react/components/MathEditorContent.js +3 -7
  63. package/es/plugins/math/react/components/MathInline.d.ts +2 -2
  64. package/es/plugins/math/react/components/MathInline.js +3 -3
  65. package/es/plugins/math/react/components/Placeholder.js +4 -6
  66. package/es/plugins/math/react/index.js +1 -3
  67. package/es/plugins/math/react/style.d.ts +6 -4
  68. package/es/plugins/math/react/style.js +10 -9
  69. package/es/plugins/mention/react/ReactMentionPlugin.js +1 -3
  70. package/es/plugins/mention/react/style.d.ts +3 -3
  71. package/es/plugins/mention/react/style.js +4 -4
  72. package/es/plugins/slash/react/components/DefaultSlashMenu.d.ts +2 -2
  73. package/es/plugins/slash/react/components/DefaultSlashMenu.js +24 -17
  74. package/es/plugins/slash/react/components/SlashMenu.d.ts +2 -2
  75. package/es/plugins/slash/react/components/SlashMenu.js +3 -4
  76. package/es/plugins/slash/react/style.d.ts +1 -1
  77. package/es/plugins/slash/react/style.js +4 -4
  78. package/es/plugins/table/react/TableActionMenu/index.js +3 -7
  79. package/es/plugins/table/react/TableActionMenu/style.d.ts +4 -1
  80. package/es/plugins/table/react/TableActionMenu/style.js +7 -4
  81. package/es/plugins/table/react/TableHoverActions/index.js +2 -4
  82. package/es/plugins/table/react/TableHoverActions/style.d.ts +4 -4
  83. package/es/plugins/table/react/TableHoverActions/style.js +2 -2
  84. package/es/plugins/table/react/TableResize/index.js +8 -8
  85. package/es/plugins/table/react/TableResize/style.d.ts +1 -1
  86. package/es/plugins/table/react/TableResize/style.js +4 -4
  87. package/es/plugins/table/react/index.js +2 -4
  88. package/es/plugins/table/react/style.d.ts +1 -1
  89. package/es/plugins/table/react/style.js +4 -4
  90. package/es/plugins/toolbar/react/index.js +6 -8
  91. package/es/plugins/toolbar/react/style.d.ts +5 -1
  92. package/es/plugins/toolbar/react/style.js +9 -6
  93. package/es/react/ChatInput/ChatInput.d.ts +2 -2
  94. package/es/react/ChatInput/ChatInput.js +16 -27
  95. package/es/react/ChatInput/style.d.ts +11 -6
  96. package/es/react/ChatInput/style.js +13 -9
  97. package/es/react/ChatInputActionBar/ChatInputActionBar.js +2 -4
  98. package/es/react/ChatInputActionBar/style.d.ts +3 -3
  99. package/es/react/ChatInputActionBar/style.js +2 -2
  100. package/es/react/ChatInputActions/ChatInputActions.js +25 -25
  101. package/es/react/ChatInputActions/components/ActionItem.d.ts +2 -2
  102. package/es/react/ChatInputActions/components/ActionItem.js +2 -4
  103. package/es/react/ChatInputActions/components/ActionRender.d.ts +2 -2
  104. package/es/react/ChatInputActions/components/ActionRender.js +5 -11
  105. package/es/react/ChatInputActions/components/CollapsedActions.d.ts +2 -2
  106. package/es/react/ChatInputActions/components/CollapsedActions.js +5 -8
  107. package/es/react/ChatInputActions/style.d.ts +5 -4
  108. package/es/react/ChatInputActions/style.js +6 -5
  109. package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +2 -2
  110. package/es/react/CodeLanguageSelect/CodeLanguageSelect.js +6 -9
  111. package/es/react/CodeLanguageSelect/style.d.ts +3 -3
  112. package/es/react/CodeLanguageSelect/style.js +2 -2
  113. package/es/react/FloatActions/FloatActions.d.ts +2 -2
  114. package/es/react/FloatActions/FloatActions.js +4 -8
  115. package/es/react/FloatActions/components/ActionItem.d.ts +2 -2
  116. package/es/react/FloatActions/components/ActionItem.js +2 -4
  117. package/es/react/FloatActions/components/ActionRender.d.ts +2 -2
  118. package/es/react/FloatActions/components/ActionRender.js +5 -11
  119. package/es/react/FloatActions/components/CollapsedActions.d.ts +2 -2
  120. package/es/react/FloatActions/components/CollapsedActions.js +5 -8
  121. package/es/react/FloatActions/style.d.ts +5 -4
  122. package/es/react/FloatActions/style.js +6 -5
  123. package/es/react/FloatMenu/FloatMenu.js +2 -4
  124. package/es/react/FloatMenu/style.d.ts +5 -4
  125. package/es/react/FloatMenu/style.js +7 -6
  126. package/es/react/SendButton/SendButton.d.ts +2 -2
  127. package/es/react/SendButton/SendButton.js +17 -15
  128. package/es/react/SendButton/components/SendIcon.js +15 -15
  129. package/es/react/SendButton/components/StopIcon.js +16 -18
  130. package/es/react/SendButton/style.d.ts +7 -7
  131. package/es/react/SendButton/style.js +9 -10
  132. package/package.json +3 -3
@@ -10,16 +10,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { memo, useEffect, useState } from 'react';
13
+ import { cx } from 'antd-style';
14
+ import { useEffect, useState } from 'react';
14
15
  import BrokenImage from "./BrokenImage";
16
+ import { styles } from "./style";
15
17
  import { useSuspenseImage } from "./useSupenseImage";
16
18
  import { jsx as _jsx } from "react/jsx-runtime";
17
19
  function isSVG(src) {
18
20
  return src.toLowerCase().endsWith('.svg');
19
21
  }
20
-
21
- // Keep memo: Lazy loading with dimension calculation and SVG handling
22
- var LazyImage = /*#__PURE__*/memo(function (_ref) {
22
+ var LazyImage = function LazyImage(_ref) {
23
23
  var className = _ref.className,
24
24
  node = _ref.node,
25
25
  newWidth = _ref.newWidth,
@@ -81,7 +81,7 @@ var LazyImage = /*#__PURE__*/memo(function (_ref) {
81
81
  var imageStyle = calculateDimensions();
82
82
  return /*#__PURE__*/_jsx("img", {
83
83
  alt: altText,
84
- className: className || undefined,
84
+ className: cx(styles.lazyImage, className || undefined),
85
85
  draggable: "false",
86
86
  onError: onError,
87
87
  onLoad: function onLoad(e) {
@@ -100,11 +100,10 @@ var LazyImage = /*#__PURE__*/memo(function (_ref) {
100
100
  },
101
101
  src: src,
102
102
  style: _objectSpread(_objectSpread({}, imageStyle), {}, {
103
- cursor: 'default',
104
103
  maxWidth: "calc(min(".concat(newWidth || imageStyle.maxWidth, "px, 100%))"),
105
104
  width: newWidth || imageStyle.width
106
105
  })
107
106
  });
108
- });
107
+ };
109
108
  LazyImage.displayName = 'LazyImage';
110
109
  export default LazyImage;
@@ -1,4 +1,4 @@
1
- import { type RefObject } from 'react';
1
+ import { type FC, type RefObject } from 'react';
2
2
  export interface ResizeHandleProps {
3
3
  imageRef: RefObject<HTMLDivElement | null>;
4
4
  isBlock: boolean;
@@ -7,4 +7,4 @@ export interface ResizeHandleProps {
7
7
  onResizeStart: (initialWidth: number) => void;
8
8
  position: 'left' | 'right';
9
9
  }
10
- export declare const ResizeHandle: import("react").NamedExoticComponent<ResizeHandleProps>;
10
+ export declare const ResizeHandle: FC<ResizeHandleProps>;
@@ -1,16 +1,14 @@
1
- import { memo, useCallback, useRef } from 'react';
2
- import { useStyles } from "./style";
1
+ import { cx } from 'antd-style';
2
+ import { useCallback, useRef } from 'react';
3
+ import { styles } from "./style";
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
- export var ResizeHandle = /*#__PURE__*/memo(function (_ref) {
5
+ export var ResizeHandle = function ResizeHandle(_ref) {
5
6
  var imageRef = _ref.imageRef,
6
7
  isBlock = _ref.isBlock,
7
8
  onResize = _ref.onResize,
8
9
  onResizeEnd = _ref.onResizeEnd,
9
10
  onResizeStart = _ref.onResizeStart,
10
11
  position = _ref.position;
11
- var _useStyles = useStyles(),
12
- styles = _useStyles.styles,
13
- cx = _useStyles.cx;
14
12
  var startWidthRef = useRef(0);
15
13
  var handleMouseDown = useCallback(function (e) {
16
14
  var _imageRef$current;
@@ -71,5 +69,5 @@ export var ResizeHandle = /*#__PURE__*/memo(function (_ref) {
71
69
  className: cx(styles.resizeHandle, position === 'left' ? styles.resizeHandleLeft : styles.resizeHandleRight),
72
70
  onMouseDown: handleMouseDown
73
71
  });
74
- });
72
+ };
75
73
  ResizeHandle.displayName = 'ResizeHandle';
@@ -1,7 +1,9 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- imageContainer: import("antd-style").SerializedStyles;
3
- resizeHandle: import("antd-style").SerializedStyles;
4
- resizeHandleLeft: import("antd-style").SerializedStyles;
5
- resizeHandleRight: import("antd-style").SerializedStyles;
6
- scaleInfo: import("antd-style").SerializedStyles;
7
- }>;
1
+ export declare const styles: {
2
+ brokenImage: string;
3
+ imageContainer: string;
4
+ lazyImage: string;
5
+ resizeHandle: string;
6
+ resizeHandleLeft: string;
7
+ resizeHandleRight: string;
8
+ scaleInfo: string;
9
+ };
@@ -1,15 +1,16 @@
1
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from 'antd-style';
4
- import { rgba } from 'polished';
5
- export var useStyles = createStyles(function (_ref) {
3
+ import { createStaticStyles } from 'antd-style';
4
+ export var styles = createStaticStyles(function (_ref) {
6
5
  var css = _ref.css,
7
- token = _ref.token;
6
+ cssVar = _ref.cssVar;
8
7
  return {
9
- imageContainer: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: default;\n user-select: none;\n\n position: relative;\n\n overflow: hidden;\n display: inline-block;\n\n width: auto;\n max-width: 100%;\n height: auto;\n border-radius: ", "px;\n\n transition: border-color 0.2s ease;\n\n &.selected {\n cursor: pointer;\n outline: none;\n\n &::after {\n pointer-events: none;\n content: '';\n\n position: absolute;\n z-index: 10;\n inset: 0;\n\n background-color: ", ";\n }\n }\n "])), token.borderRadiusSM, rgba(token.yellow, 0.1)),
10
- resizeHandle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pointer-events: auto;\n cursor: col-resize;\n\n position: absolute;\n z-index: 9999;\n inset-block-start: 0;\n\n width: 6px;\n height: 100%;\n\n &::after {\n pointer-events: none;\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 0;\n transform: translateY(-50%);\n\n width: 6px;\n height: min(80px, 80%);\n border: 1px solid rgba(255, 255, 255, 75%);\n border-radius: 3px;\n\n background-color: rgba(0, 0, 0, 50%);\n }\n "]))),
11
- resizeHandleLeft: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n inset-inline-start: 8px;\n "]))),
12
- resizeHandleRight: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n inset-inline-end: 8px;\n "]))),
13
- scaleInfo: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 11;\n inset-block-start: 2px;\n inset-inline-start: 2px;\n\n padding-block: 2px;\n padding-inline: 6px;\n border-radius: ", "px;\n\n font-size: 12px;\n color: white;\n\n background-color: rgba(0, 0, 0, 50%);\n "])), token.borderRadiusSM)
8
+ brokenImage: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 200px;\n height: auto;\n "]))),
9
+ imageContainer: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: default;\n user-select: none;\n\n position: relative;\n\n overflow: hidden;\n display: inline-block;\n\n width: auto;\n max-width: 100%;\n height: auto;\n border-radius: ", ";\n\n transition: border-color 0.2s ease;\n\n &.selected {\n cursor: pointer;\n outline: none;\n\n &::after {\n pointer-events: none;\n content: '';\n\n position: absolute;\n z-index: 10;\n inset: 0;\n\n background-color: color-mix(in srgb, ", " 10%, transparent);\n }\n }\n "])), cssVar.borderRadiusSM, cssVar.yellow),
10
+ lazyImage: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n cursor: default;\n "]))),
11
+ resizeHandle: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n pointer-events: auto;\n cursor: col-resize;\n\n position: absolute;\n z-index: 9999;\n inset-block-start: 0;\n\n width: 6px;\n height: 100%;\n\n &::after {\n pointer-events: none;\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 0;\n transform: translateY(-50%);\n\n width: 6px;\n height: min(80px, 80%);\n border: 1px solid color-mix(in srgb, rgb(255, 255, 255) 75%, transparent);\n border-radius: 3px;\n\n background-color: color-mix(in srgb, rgb(0, 0, 0) 50%, transparent);\n }\n "]))),
12
+ resizeHandleLeft: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n inset-inline-start: 8px;\n "]))),
13
+ resizeHandleRight: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n inset-inline-end: 8px;\n "]))),
14
+ scaleInfo: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 11;\n inset-block-start: 2px;\n inset-inline-start: 2px;\n\n padding-block: 2px;\n padding-inline: 6px;\n border-radius: ", ";\n\n font-size: 12px;\n color: white;\n\n background-color: color-mix(in srgb, rgb(0, 0, 0) 50%, transparent);\n "])), cssVar.borderRadiusSM)
14
15
  };
15
16
  });
@@ -1,5 +1,5 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- image: import("antd-style").SerializedStyles;
3
- blockImage: import("antd-style").SerializedStyles;
4
- }>;
1
+ export declare const styles: {
2
+ image: string;
3
+ blockImage: string;
4
+ };
5
5
  export declare const imageBroken = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA2NDAgNDAwIj48cGF0aCBmaWxsPSIjM0IzQjNCIiBkPSJNMCAwaDY0MHY0MDBIMHoiLz48cGF0aCBzdHJva2U9IiM2MjYyNjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxNSIgZD0iTTM3Mi41IDEzMi41aC0xMDVjLTguMjg0IDAtMTUgNi43MTYtMTUgMTV2MTA1YzAgOC4yODQgNi43MTYgMTUgMTUgMTVoMTA1YzguMjg0IDAgMTUtNi43MTYgMTUtMTV2LTEwNWMwLTguMjg0LTYuNzE2LTE1LTE1LTE1eiIvPjxwYXRoIHN0cm9rZT0iIzYyNjI2MiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjE1IiBkPSJNMjk3LjUgMTkyLjVjOC4yODQgMCAxNS02LjcxNiAxNS0xNSAwLTguMjg0LTYuNzE2LTE1LTE1LTE1LTguMjg0IDAtMTUgNi43MTYtMTUgMTUgMCA4LjI4NCA2LjcxNiAxNSAxNSAxNXpNMzg3LjUgMjIyLjUwMmwtMjMuMTQ1LTIzLjE0NWExNS4wMDEgMTUuMDAxIDAgMDAtMjEuMjEgMEwyNzUgMjY3LjUwMiIvPjwvc3ZnPg==";
@@ -1,13 +1,13 @@
1
1
  var _templateObject, _templateObject2;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  /* eslint-disable sort-keys-fix/sort-keys-fix */
4
- import { createStyles } from 'antd-style';
5
- export var useStyles = createStyles(function (_ref) {
4
+ import { createStaticStyles } from 'antd-style';
5
+ export var styles = createStaticStyles(function (_ref) {
6
6
  var css = _ref.css,
7
- token = _ref.token;
7
+ cssVar = _ref.cssVar;
8
8
  return {
9
- image: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: default;\n user-select: none;\n position: relative;\n display: inline-block;\n\n &.selected {\n background-color: ", ";\n }\n "])), token.colorPrimaryBg),
10
- blockImage: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: default;\n user-select: none;\n\n position: relative;\n\n display: block;\n\n text-align: center;\n\n &.selected {\n background-color: ", ";\n }\n "])), token.colorPrimaryBg)
9
+ image: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: default;\n user-select: none;\n position: relative;\n display: inline-block;\n\n &.selected {\n background-color: ", ";\n }\n "])), cssVar.colorPrimaryBg),
10
+ blockImage: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: default;\n user-select: none;\n\n position: relative;\n\n display: block;\n\n text-align: center;\n\n &.selected {\n background-color: ", ";\n }\n "])), cssVar.colorPrimaryBg)
11
11
  };
12
12
  });
13
13
  export var imageBroken = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA2NDAgNDAwIj48cGF0aCBmaWxsPSIjM0IzQjNCIiBkPSJNMCAwaDY0MHY0MDBIMHoiLz48cGF0aCBzdHJva2U9IiM2MjYyNjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxNSIgZD0iTTM3Mi41IDEzMi41aC0xMDVjLTguMjg0IDAtMTUgNi43MTYtMTUgMTV2MTA1YzAgOC4yODQgNi43MTYgMTUgMTUgMTVoMTA1YzguMjg0IDAgMTUtNi43MTYgMTUtMTV2LTEwNWMwLTguMjg0LTYuNzE2LTE1LTE1LTE1eiIvPjxwYXRoIHN0cm9rZT0iIzYyNjI2MiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjE1IiBkPSJNMjk3LjUgMTkyLjVjOC4yODQgMCAxNS02LjcxNiAxNS0xNSAwLTguMjg0LTYuNzE2LTE1LTE1LTE1LTguMjg0IDAtMTUgNi43MTYtMTUgMTUgMCA4LjI4NCA2LjcxNiAxNSAxNSAxNXpNMzg3LjUgMjIyLjUwMmwtMjMuMTQ1LTIzLjE0NWExNS4wMDEgMTUuMDAxIDAgMDAtMjEuMjEgMEwyNzUgMjY3LjUwMiIvPjwvc3ZnPg==';
@@ -15,7 +15,7 @@ import { LinkPlugin } from "../plugin";
15
15
  import { ILinkService } from "../service/i-link-service";
16
16
  import LinkEdit from "./components/LinkEdit";
17
17
  import LinkToolbar from "./components/LinkToolbar";
18
- import { useStyles } from "./style";
18
+ import { styles } from "./style";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
21
  export var ReactLinkPlugin = function ReactLinkPlugin(_ref) {
@@ -31,8 +31,6 @@ export var ReactLinkPlugin = function ReactLinkPlugin(_ref) {
31
31
  var _useLexicalComposerCo = useLexicalComposerContext(),
32
32
  _useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1),
33
33
  editor = _useLexicalComposerCo2[0];
34
- var _useStyles = useStyles(),
35
- styles = _useStyles.styles;
36
34
  useLayoutEffect(function () {
37
35
  editor.registerPlugin(MarkdownPlugin);
38
36
  editor.registerPlugin(LinkPlugin, {
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { LexicalEditor } from 'lexical';
2
+ import { type FC } from 'react';
3
3
  import { LinkNode } from '../../node/LinkNode';
4
4
  export declare const EDIT_LINK_COMMAND: import("lexical").LexicalCommand<{
5
5
  linkNode: LinkNode | null;
@@ -8,5 +8,5 @@ export declare const EDIT_LINK_COMMAND: import("lexical").LexicalCommand<{
8
8
  interface LinkEditProps {
9
9
  editor: LexicalEditor;
10
10
  }
11
- declare const LinkEdit: import("react").NamedExoticComponent<LinkEditProps>;
11
+ declare const LinkEdit: FC<LinkEditProps>;
12
12
  export default LinkEdit;
@@ -6,19 +6,20 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { mergeRegister } from '@lexical/utils';
8
8
  import { Block, Button, Flexbox, Hotkey, Icon, Input, Text } from '@lobehub/ui';
9
+ import { cssVar } from 'antd-style';
9
10
  import { COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_NORMAL, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, createCommand } from 'lexical';
10
11
  import { BaselineIcon, LinkIcon } from 'lucide-react';
11
- import { memo, useCallback, useEffect, useRef, useState } from 'react';
12
+ import { useCallback, useEffect, useRef, useState } from 'react';
12
13
  import { useLexicalEditor } from "../../../../editor-kernel/react";
13
14
  import { useEditable } from "../../../../editor-kernel/react/useEditable";
14
15
  import { useTranslation } from "../../../../editor-kernel/react/useTranslation";
15
16
  import { cleanPosition, updatePosition } from "../../../../utils/updatePosition";
16
17
  import { UPDATE_LINK_TEXT_COMMAND } from "../../command";
17
- import { useStyles } from "../style";
18
+ import { styles } from "../style";
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
21
  export var EDIT_LINK_COMMAND = createCommand();
21
- var LinkEdit = /*#__PURE__*/memo(function (_ref) {
22
+ var LinkEdit = function LinkEdit(_ref) {
22
23
  var editor = _ref.editor;
23
24
  var divRef = useRef(null);
24
25
  var linkNodeRef = useRef(null);
@@ -39,9 +40,6 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
39
40
  var _useEditable = useEditable(),
40
41
  editable = _useEditable.editable;
41
42
  var t = useTranslation();
42
- var _useStyles = useStyles(),
43
- styles = _useStyles.styles,
44
- theme = _useStyles.theme;
45
43
 
46
44
  // 取消编辑,不保存更改
47
45
  var handleCancel = useCallback(function () {
@@ -215,7 +213,7 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
215
213
  },
216
214
  onKeyDown: handleKeyDown,
217
215
  prefix: /*#__PURE__*/_jsx(Icon, {
218
- color: theme.colorTextDescription,
216
+ color: cssVar.colorTextDescription,
219
217
  icon: BaselineIcon
220
218
  }),
221
219
  ref: linkTextInputRef,
@@ -231,7 +229,7 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
231
229
  onKeyDown: handleKeyDown,
232
230
  placeholder: "https://enter-link-url",
233
231
  prefix: /*#__PURE__*/_jsx(Icon, {
234
- color: theme.colorTextDescription,
232
+ color: cssVar.colorTextDescription,
235
233
  icon: LinkIcon
236
234
  }),
237
235
  ref: linkInputRef,
@@ -259,6 +257,6 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
259
257
  })
260
258
  })]
261
259
  });
262
- });
260
+ };
263
261
  LinkEdit.displayName = 'LinkEdit';
264
262
  export default LinkEdit;
@@ -16,7 +16,7 @@ import { useTranslation } from "../../../../editor-kernel/react/useTranslation";
16
16
  import { getSelectedNode } from "../../utils";
17
17
  import { cleanPosition, updatePosition } from "../../../../utils/updatePosition";
18
18
  import { $isLinkNode, HOVER_LINK_COMMAND, HOVER_OUT_LINK_COMMAND, TOGGLE_LINK_COMMAND } from "../../node/LinkNode";
19
- import { useStyles } from "../style";
19
+ import { styles } from "../style";
20
20
  import { EDIT_LINK_COMMAND } from "./LinkEdit";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  var LinkToolbar = /*#__PURE__*/memo(function (_ref) {
@@ -24,8 +24,6 @@ var LinkToolbar = /*#__PURE__*/memo(function (_ref) {
24
24
  enable = _ref.enable;
25
25
  var divRef = useRef(null);
26
26
  var LinkRef = useRef(null);
27
- var _useStyles = useStyles(),
28
- styles = _useStyles.styles;
29
27
  var _useState = useState(null),
30
28
  _useState2 = _slicedToArray(_useState, 2),
31
29
  linkNode = _useState2[0],
@@ -1,6 +1,6 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- link: import("antd-style").SerializedStyles;
1
+ export declare const styles: {
2
+ link: string;
3
3
  linkEdit: string;
4
- linkEditFooter: import("antd-style").SerializedStyles;
4
+ linkEditFooter: string;
5
5
  linkToolbar: string;
6
- }>;
6
+ };
@@ -1,15 +1,14 @@
1
1
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from 'antd-style';
4
- export var useStyles = createStyles(function (_ref) {
5
- var cx = _ref.cx,
6
- css = _ref.css,
7
- token = _ref.token;
3
+ import { createStaticStyles, cx } from 'antd-style';
4
+ export var styles = createStaticStyles(function (_ref) {
5
+ var css = _ref.css,
6
+ cssVar = _ref.cssVar;
8
7
  var position = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 999;\n inset-block-start: -9999px;\n inset-inline-start: -9999px;\n "])));
9
8
  return {
10
9
  link: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n margin-block: 1em;\n margin-inline: 0;\n padding: 2px;\n border: none;\n "]))),
11
- linkEdit: cx(position, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-width: 320px;\n max-width: 100%;\n background: ", ";\n "])), token.colorBgElevated)),
12
- linkEditFooter: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-block-start: 1px solid ", ";\n background: ", ";\n "])), token.colorBorderSecondary, token.colorFillQuaternary),
13
- linkToolbar: cx(position, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorBgElevated))
10
+ linkEdit: cx(position, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-width: 320px;\n max-width: 100%;\n background: ", ";\n "])), cssVar.colorBgElevated)),
11
+ linkEditFooter: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-block-start: 1px solid ", ";\n background: ", ";\n "])), cssVar.colorBorderSecondary, cssVar.colorFillQuaternary),
12
+ linkToolbar: cx(position, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n "])), cssVar.colorBgElevated))
14
13
  };
15
14
  });
@@ -4,11 +4,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { cx } from 'antd-style';
7
8
  import { useLayoutEffect } from 'react';
8
9
  import { useLexicalComposerContext } from "../../../editor-kernel/react/react-context";
9
10
  import { MarkdownPlugin } from "../../markdown/plugin";
10
11
  import { LinkHighlightPlugin } from "../plugin";
11
- import { useStyles } from "./style";
12
+ import { styles } from "./style";
12
13
  var ReactLinkHighlightPlugin = function ReactLinkHighlightPlugin(_ref) {
13
14
  var className = _ref.className,
14
15
  _ref$enableHotkey = _ref.enableHotkey,
@@ -18,9 +19,6 @@ var ReactLinkHighlightPlugin = function ReactLinkHighlightPlugin(_ref) {
18
19
  var _useLexicalComposerCo = useLexicalComposerContext(),
19
20
  _useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1),
20
21
  editor = _useLexicalComposerCo2[0];
21
- var _useStyles = useStyles(),
22
- cx = _useStyles.cx,
23
- styles = _useStyles.styles;
24
22
  useLayoutEffect(function () {
25
23
  editor.registerPlugin(MarkdownPlugin);
26
24
  editor.registerPlugin(LinkHighlightPlugin, {
@@ -1,3 +1,3 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- linkHighlight: import("antd-style").SerializedStyles;
3
- }>;
1
+ export declare const styles: {
2
+ linkHighlight: string;
3
+ };
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from 'antd-style';
4
- export var useStyles = createStyles(function (_ref) {
3
+ import { createStaticStyles } from 'antd-style';
4
+ export var styles = createStaticStyles(function (_ref) {
5
5
  var css = _ref.css;
6
6
  return {
7
7
  linkHighlight: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: unset;\n\n margin-block: 1em;\n margin-inline: 0;\n padding: 2px;\n border: none;\n "])))
@@ -10,15 +10,13 @@ import { useLayoutEffect } from 'react';
10
10
  import { useLexicalComposerContext } from "../../../editor-kernel/react/react-context";
11
11
  import { MarkdownPlugin } from "../../markdown/plugin";
12
12
  import { ListPlugin } from "../plugin";
13
- import { useStyles } from "./style";
13
+ import { styles } from "./style";
14
14
  var ReactListPlugin = function ReactListPlugin(_ref) {
15
15
  var _ref$enableHotkey = _ref.enableHotkey,
16
16
  enableHotkey = _ref$enableHotkey === void 0 ? true : _ref$enableHotkey;
17
17
  var _useLexicalComposerCo = useLexicalComposerContext(),
18
18
  _useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1),
19
19
  editor = _useLexicalComposerCo2[0];
20
- var _useStyles = useStyles(),
21
- styles = _useStyles.styles;
22
20
  useLayoutEffect(function () {
23
21
  editor.registerPlugin(MarkdownPlugin);
24
22
  editor.registerPlugin(ListPlugin, {
@@ -1 +1 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
1
+ export declare const styles: string;
@@ -1,9 +1,8 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from 'antd-style';
4
- import { readableColor } from 'polished';
5
- export var useStyles = createStyles(function (_ref) {
3
+ import { createStaticStyles } from 'antd-style';
4
+ export var styles = createStaticStyles(function (_ref) {
6
5
  var css = _ref.css,
7
- token = _ref.token;
8
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .editor_listUnordered&,\n .editor_listOrdered& {\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n margin-inline-start: 1em;\n padding-inline-start: 0;\n list-style-position: outside;\n\n > .editor_listUnordered,\n > ol {\n margin-block: 0;\n }\n\n > .editor_listItem {\n margin-inline-start: 1em;\n }\n }\n\n .editor_listOrdered& {\n list-style: auto;\n }\n\n .editor_listUnordered& {\n list-style-type: none;\n\n > .editor_listItem:not(:has(ul)):not([role='checkbox']) {\n &::before {\n content: '-';\n display: inline-block;\n margin-inline: -1em 0.5em;\n opacity: 0.5;\n }\n }\n }\n\n .editor_listItem {\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.33em);\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n background-color: var(--listitem-marker-background-color);\n\n &::marker {\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n color: var(--listitem-marker-color);\n background-color: var(--listitem-marker-background-color);\n }\n\n p {\n display: inline;\n }\n\n .editor_listUnordered,\n .editor_listOrdered {\n margin: 0;\n }\n }\n\n [role='checkbox'] {\n position: relative;\n }\n\n .editor_listItemChecked::before,\n .editor_listItemUnchecked::before {\n border: 1px solid ", ";\n border-radius: 4px;\n }\n\n .editor_listItemChecked::before {\n background: ", ";\n }\n\n .editor_listItemChecked:not(:has(ul))::after {\n cursor: pointer;\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 0.2em;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n\n display: block;\n\n width: 0.3em;\n height: 0.6em;\n margin-inline: -1.35em 0.5em;\n border: 2px solid ", ";\n border-block-start: 0;\n border-inline-start: 0;\n\n background-size: cover;\n\n transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;\n }\n\n .editor_listItemUnchecked:not(:has(ul))::before,\n .editor_listItemChecked:not(:has(ul))::before {\n cursor: pointer;\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 0;\n transform: translateY(-50%);\n\n display: inline-block;\n display: block;\n\n width: 1em;\n height: 1em;\n margin-inline: -1.4em 0.5em;\n\n background-size: cover;\n }\n\n .editor_listItemNested {\n list-style-type: none;\n }\n "])), token.colorBorder, token.colorPrimary, readableColor(token.colorPrimary));
6
+ cssVar = _ref.cssVar;
7
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .editor_listUnordered&,\n .editor_listOrdered& {\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n margin-inline-start: 1em;\n padding-inline-start: 0;\n list-style-position: outside;\n\n > .editor_listUnordered,\n > ol {\n margin-block: 0;\n }\n\n > .editor_listItem {\n margin-inline-start: 1em;\n }\n }\n\n .editor_listOrdered& {\n list-style: auto;\n }\n\n .editor_listUnordered& {\n list-style-type: none;\n\n > .editor_listItem:not(:has(ul)):not([role='checkbox']) {\n &::before {\n content: '-';\n display: inline-block;\n margin-inline: -1em 0.5em;\n opacity: 0.5;\n }\n }\n }\n\n .editor_listItem {\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.33em);\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n background-color: var(--listitem-marker-background-color);\n\n &::marker {\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n color: var(--listitem-marker-color);\n background-color: var(--listitem-marker-background-color);\n }\n\n p {\n display: inline;\n }\n\n .editor_listUnordered,\n .editor_listOrdered {\n margin: 0;\n }\n }\n\n [role='checkbox'] {\n position: relative;\n }\n\n .editor_listItemChecked::before,\n .editor_listItemUnchecked::before {\n border: 1px solid ", ";\n border-radius: 4px;\n }\n\n .editor_listItemChecked::before {\n background: ", ";\n }\n\n .editor_listItemChecked:not(:has(ul))::after {\n cursor: pointer;\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 0.2em;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n\n display: block;\n\n width: 0.3em;\n height: 0.6em;\n margin-inline: -1.35em 0.5em;\n border: 2px solid ", ";\n border-block-start: 0;\n border-inline-start: 0;\n\n background-size: cover;\n\n transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;\n }\n\n .editor_listItemUnchecked:not(:has(ul))::before,\n .editor_listItemChecked:not(:has(ul))::before {\n cursor: pointer;\n content: '';\n\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 0;\n transform: translateY(-50%);\n\n display: inline-block;\n display: block;\n\n width: 1em;\n height: 1em;\n margin-inline: -1.4em 0.5em;\n\n background-size: cover;\n }\n\n .editor_listItemNested {\n list-style-type: none;\n }\n "])), cssVar.colorBorder, cssVar.colorPrimary, cssVar.colorTextLightSolid);
9
8
  });
@@ -1,22 +1,23 @@
1
1
  import { ActionIcon, Block } from '@lobehub/ui';
2
+ import { useThemeMode } from 'antd-style';
2
3
  import { Check, X } from 'lucide-react';
3
4
  import { LexicalPortalContainer } from "../../../../editor-kernel/react";
4
5
  import { useTranslation } from "../../../../editor-kernel/react/useTranslation";
5
6
  import { DiffAction, LITEXML_DIFFNODE_COMMAND } from "../../command/diffCommand";
6
- import { useStyles } from "./style";
7
+ import { styles } from "./style";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  var ReactDiffNodeToolbar = function ReactDiffNodeToolbar(_ref) {
10
11
  var editor = _ref.editor,
11
12
  node = _ref.node;
12
13
  var t = useTranslation();
13
- var _useStyles = useStyles(),
14
- styles = _useStyles.styles;
14
+ var _useThemeMode = useThemeMode(),
15
+ isDarkMode = _useThemeMode.isDarkMode;
15
16
  return /*#__PURE__*/_jsx(LexicalPortalContainer, {
16
17
  editor: editor,
17
18
  node: node,
18
19
  children: /*#__PURE__*/_jsxs(Block, {
19
- className: styles.toolbar,
20
+ className: isDarkMode ? styles.toolbarDark : styles.toolbarLight,
20
21
  gap: 2,
21
22
  horizontal: true,
22
23
  padding: 2,
@@ -1,5 +1,6 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- accept: import("antd-style").SerializedStyles;
3
- reject: import("antd-style").SerializedStyles;
4
- toolbar: import("antd-style").SerializedStyles;
5
- }>;
1
+ export declare const styles: {
2
+ accept: string;
3
+ reject: string;
4
+ toolbarDark: string;
5
+ toolbarLight: string;
6
+ };
@@ -1,13 +1,13 @@
1
- var _templateObject, _templateObject2, _templateObject3;
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from 'antd-style';
4
- export var useStyles = createStyles(function (_ref) {
3
+ import { createStaticStyles } from 'antd-style';
4
+ export var styles = createStaticStyles(function (_ref) {
5
5
  var css = _ref.css,
6
- token = _ref.token,
7
- isDarkMode = _ref.isDarkMode;
6
+ cssVar = _ref.cssVar;
8
7
  return {
9
- accept: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorSuccess),
8
+ accept: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), cssVar.colorSuccess),
10
9
  reject: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""]))),
11
- toolbar: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-color: ", ";\n background: ", ";\n box-shadow: ", ";\n "])), token.colorFillSecondary, token.colorBgElevated, isDarkMode ? '0px 14px 28px -6px #0003,0px 2px 4px -1px #0000001f' : '0 14px 28px -6px #0000001a, 0 2px 4px -1px #0000000f')
10
+ toolbarDark: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-color: ", ";\n background: ", ";\n box-shadow:\n 0 14px 28px -6px color-mix(in srgb, #000 18.75%, transparent),\n 0 2px 4px -1px color-mix(in srgb, #000 12.19%, transparent);\n "])), cssVar.colorFillSecondary, cssVar.colorBgElevated),
11
+ toolbarLight: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-color: ", ";\n background: ", ";\n box-shadow:\n 0 14px 28px -6px color-mix(in srgb, #000 10.2%, transparent),\n 0 2px 4px -1px color-mix(in srgb, #000 5.88%, transparent);\n "])), cssVar.colorFillSecondary, cssVar.colorBgElevated)
12
12
  };
13
13
  });
@@ -11,14 +11,12 @@ import { useLexicalComposerContext } from "../../../editor-kernel/react";
11
11
  import { INodePlugin } from "../../inode";
12
12
  import { LitexmlPlugin } from "../plugin";
13
13
  import ReactDiffNodeToolbar from "./DiffNodeToolbar";
14
- import { useStyles } from "./style";
14
+ import { styles } from "./style";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  export var ReactLiteXmlPlugin = function ReactLiteXmlPlugin() {
17
17
  var _useLexicalComposerCo = useLexicalComposerContext(),
18
18
  _useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1),
19
19
  editor = _useLexicalComposerCo2[0];
20
- var _useStyles = useStyles(),
21
- styles = _useStyles.styles;
22
20
  useLayoutEffect(function () {
23
21
  editor.registerPlugin(INodePlugin);
24
22
  editor.registerPlugin(LitexmlPlugin, {
@@ -1 +1 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
1
+ export declare const styles: string;
@@ -1,8 +1,8 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { createStyles } from 'antd-style';
4
- export var useStyles = createStyles(function (_ref) {
3
+ import { createStaticStyles } from 'antd-style';
4
+ export var styles = createStaticStyles(function (_ref) {
5
5
  var css = _ref.css,
6
- token = _ref.token;
7
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n .toolbar {\n position: absolute;\n z-index: 10;\n inset-block-end: 0;\n inset-inline-end: 8px;\n\n opacity: 0;\n }\n\n &:hover {\n .toolbar {\n opacity: 1;\n }\n }\n\n &[data-diff-type='add'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n }\n\n &[data-diff-type='remove'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n\n > *:first-child * {\n color: ", " !important;\n text-decoration: line-through !important;\n }\n }\n\n &[data-diff-type='listItemModify'] {\n display: inline-block;\n\n p {\n display: block !important;\n }\n }\n\n &[data-diff-type='listItemModify'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n\n /* first child: original (deleted) */\n\n /* > *:first-child {} */\n\n /* visually indicate deletion with strike-through for text nodes */\n > *:first-child * {\n color: ", " !important;\n text-decoration: line-through !important;\n }\n\n /* second child: modified/new - normal appearance */\n > *:nth-child(2) {\n color: inherit;\n opacity: 1;\n }\n }\n\n &[data-diff-type='modify'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n\n /* first child: original (deleted) */\n\n /* > *:first-child {} */\n\n /* visually indicate deletion with strike-through for text nodes */\n > *:first-child * {\n color: ", " !important;\n text-decoration: line-through !important;\n }\n\n /* second child: modified/new - normal appearance */\n > *:nth-child(2) {\n color: inherit;\n opacity: 1;\n }\n }\n "])), token.colorSuccess, token.colorError, token.colorTextQuaternary, token.colorWarning, token.colorTextQuaternary, token.colorWarning, token.colorTextQuaternary);
6
+ cssVar = _ref.cssVar;
7
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n .toolbar {\n position: absolute;\n z-index: 10;\n inset-block-end: 0;\n inset-inline-end: 8px;\n\n opacity: 0;\n }\n\n &:hover {\n .toolbar {\n opacity: 1;\n }\n }\n\n &[data-diff-type='add'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n }\n\n &[data-diff-type='remove'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n\n > *:first-child * {\n color: ", " !important;\n text-decoration: line-through !important;\n }\n }\n\n &[data-diff-type='listItemModify'] {\n display: inline-block;\n\n p {\n display: block !important;\n }\n }\n\n &[data-diff-type='listItemModify'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n\n /* first child: original (deleted) */\n\n /* > *:first-child {} */\n\n /* visually indicate deletion with strike-through for text nodes */\n > *:first-child * {\n color: ", " !important;\n text-decoration: line-through !important;\n }\n\n /* second child: modified/new - normal appearance */\n > *:nth-child(2) {\n color: inherit;\n opacity: 1;\n }\n }\n\n &[data-diff-type='modify'] .content {\n position: relative;\n margin-block-start: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n padding-inline-end: 4px;\n border-inline-end: 3px solid ", ";\n\n /* first child: original (deleted) */\n\n /* > *:first-child {} */\n\n /* visually indicate deletion with strike-through for text nodes */\n > *:first-child * {\n color: ", " !important;\n text-decoration: line-through !important;\n }\n\n /* second child: modified/new - normal appearance */\n > *:nth-child(2) {\n color: inherit;\n opacity: 1;\n }\n }\n "])), cssVar.colorSuccess, cssVar.colorError, cssVar.colorTextQuaternary, cssVar.colorWarning, cssVar.colorTextQuaternary, cssVar.colorWarning, cssVar.colorTextQuaternary);
8
8
  });
@@ -1,7 +1,7 @@
1
1
  import { Block } from '@lobehub/ui';
2
2
  import { memo, useEffect, useRef } from 'react';
3
3
  import { cleanPosition, updatePosition } from "../../../../utils/updatePosition";
4
- import { useStyles } from "../style";
4
+ import { styles } from "../style";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  var MathEditorContainer = /*#__PURE__*/memo(function (_ref) {
7
7
  var children = _ref.children,
@@ -10,8 +10,6 @@ var MathEditorContainer = /*#__PURE__*/memo(function (_ref) {
10
10
  onFocus = _ref.onFocus,
11
11
  prev = _ref.prev;
12
12
  var divRef = useRef(null);
13
- var _useStyles = useStyles(),
14
- styles = _useStyles.styles;
15
13
  var updateMathPosition = function updateMathPosition() {
16
14
  return updatePosition({
17
15
  callback: function callback() {
@@ -4,13 +4,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Button, Hotkey, Text, TextArea, Flexbox } from '@lobehub/ui';
7
+ import { Button, Flexbox, Hotkey, Text, TextArea } from '@lobehub/ui';
8
8
  import { renderToString } from 'katex';
9
9
  import { isModifierMatch } from 'lexical';
10
10
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
11
11
  import { CONTROL_OR_META } from "../../../../common/sys";
12
12
  import { useTranslation } from "../../../../editor-kernel/react/useTranslation";
13
- import { useStyles } from "../style";
13
+ import { styles } from "../style";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -31,8 +31,6 @@ var MathEditorContent = /*#__PURE__*/memo(function (_ref) {
31
31
  _useState2 = _slicedToArray(_useState, 2),
32
32
  latexError = _useState2[0],
33
33
  setLatexError = _useState2[1];
34
- var _useStyles = useStyles(),
35
- styles = _useStyles.styles;
36
34
 
37
35
  // 将 ref 暴露给父组件
38
36
  useEffect(function () {
@@ -115,6 +113,7 @@ var MathEditorContent = /*#__PURE__*/memo(function (_ref) {
115
113
  maxRows: 6,
116
114
  minRows: 1
117
115
  },
116
+ className: styles.mathEditorTextArea,
118
117
  onChange: function onChange(e) {
119
118
  onValueChange(e.target.value);
120
119
  },
@@ -122,9 +121,6 @@ var MathEditorContent = /*#__PURE__*/memo(function (_ref) {
122
121
  placeholder: "".concat(t('math.placeholder'), "..."),
123
122
  ref: textareaRef,
124
123
  resize: false,
125
- style: {
126
- marginBlock: 4
127
- },
128
124
  value: value,
129
125
  variant: 'borderless'
130
126
  }), latexError && /*#__PURE__*/_jsx(Flexbox, {
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { LexicalEditor } from 'lexical';
2
+ import { type FC } from 'react';
3
3
  import { MathBlockNode, MathInlineNode } from '../../node';
4
4
  export interface MathInlineProps {
5
5
  className?: string;
6
6
  editor: LexicalEditor;
7
7
  node: MathInlineNode | MathBlockNode;
8
8
  }
9
- declare const MathInline: import("react").NamedExoticComponent<MathInlineProps>;
9
+ declare const MathInline: FC<MathInlineProps>;
10
10
  export default MathInline;