@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
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { type FC } from 'react';
2
2
  import type { FloatActionsCollapseProps } from '../type';
3
- declare const CollapsedActions: import("react").NamedExoticComponent<FloatActionsCollapseProps>;
3
+ declare const CollapsedActions: FC<FloatActionsCollapseProps>;
4
4
  export default CollapsedActions;
@@ -4,11 +4,10 @@ import { ActionIcon, Flexbox } from '@lobehub/ui';
4
4
  import { Popover } from 'antd';
5
5
  import { CircleChevronLeftIcon, CircleChevronRightIcon, CircleChevronUpIcon } from 'lucide-react';
6
6
  import { motion } from 'motion/react';
7
- import { memo } from 'react';
7
+ import { styles } from "../style";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- // Keep memo: Complex animation and state management with motion.div
11
- var CollapsedActions = /*#__PURE__*/memo(function (_ref) {
10
+ var CollapsedActions = function CollapsedActions(_ref) {
12
11
  var children = _ref.children,
13
12
  _ref$groupCollapse = _ref.groupCollapse,
14
13
  groupCollapse = _ref$groupCollapse === void 0 ? false : _ref$groupCollapse,
@@ -45,12 +44,10 @@ var CollapsedActions = /*#__PURE__*/memo(function (_ref) {
45
44
  horizontal: true,
46
45
  children: [/*#__PURE__*/_jsx(motion.div, {
47
46
  animate: groupCollapse ? 'closed' : 'open',
47
+ className: styles.collapsedContainer,
48
48
  initial: groupCollapse ? 'closed' : 'open',
49
49
  style: {
50
- alignItems: 'center',
51
- display: 'flex',
52
- gap: gap,
53
- overflow: 'hidden'
50
+ gap: gap
54
51
  },
55
52
  transition: {
56
53
  duration: 0.2
@@ -77,6 +74,6 @@ var CollapsedActions = /*#__PURE__*/memo(function (_ref) {
77
74
  }
78
75
  })]
79
76
  });
80
- });
77
+ };
81
78
  CollapsedActions.displayName = 'FloatActionsCollapse';
82
79
  export default CollapsedActions;
@@ -1,4 +1,5 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- container: import("antd-style").SerializedStyles;
3
- divider: import("antd-style").SerializedStyles;
4
- }>;
1
+ export declare const styles: {
2
+ collapsedContainer: string;
3
+ container: string;
4
+ divider: string;
5
+ };
@@ -1,10 +1,11 @@
1
- var _templateObject, _templateObject2;
1
+ var _templateObject, _templateObject2, _templateObject3;
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
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n "]))),
8
- divider: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-inline: 4px;\n "])))
7
+ collapsedContainer: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n align-items: center;\n "]))),
8
+ container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n "]))),
9
+ divider: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 20px;\n margin-inline: 4px;\n "])))
9
10
  };
10
11
  });
@@ -7,8 +7,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
7
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
8
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
9
  import { Block, Flexbox } from '@lobehub/ui';
10
+ import { cx } from 'antd-style';
10
11
  import { createPortal } from 'react-dom';
11
- import { useStyles } from "./style";
12
+ import { styles } from "./style";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  var FloatMenu = function FloatMenu(_ref) {
14
15
  var className = _ref.className,
@@ -20,9 +21,6 @@ var FloatMenu = function FloatMenu(_ref) {
20
21
  open = _ref.open,
21
22
  customStyles = _ref.styles,
22
23
  classNames = _ref.classNames;
23
- var _useStyles = useStyles(),
24
- cx = _useStyles.cx,
25
- styles = _useStyles.styles;
26
24
  var parent = getPopupContainer();
27
25
  if (!parent) return;
28
26
  if (!open) return;
@@ -1,4 +1,5 @@
1
- export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- container: import("antd-style").SerializedStyles;
3
- root: import("antd-style").SerializedStyles;
4
- }>;
1
+ export declare const styles: {
2
+ container: string;
3
+ containerWithMaxHeight: string;
4
+ root: string;
5
+ };
@@ -1,11 +1,12 @@
1
- var _templateObject, _templateObject2;
1
+ var _templateObject, _templateObject2, _templateObject3;
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;
6
+ cssVar = _ref.cssVar;
7
7
  return {
8
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden auto;\n background: ", ";\n "])), token.colorBgElevated),
9
- root: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: -8px;\n inset-inline-start: 0;\n transform: translateY(-100%);\n "])))
8
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden auto;\n background: ", ";\n "])), cssVar.colorBgElevated),
9
+ containerWithMaxHeight: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* maxHeight is set via inline style as it's dynamic */\n "]))),
10
+ root: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: -8px;\n inset-inline-start: 0;\n transform: translateY(-100%);\n "])))
10
11
  };
11
12
  });
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { type FC } from 'react';
2
2
  import type { SendButtonProps } from './type';
3
- declare const SendButton: import("react").NamedExoticComponent<SendButtonProps>;
3
+ declare const SendButton: FC<SendButtonProps>;
4
4
  export default SendButton;
@@ -11,15 +11,15 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
11
11
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
12
  import { Button, Icon } from '@lobehub/ui';
13
13
  import { Dropdown, Space } from 'antd';
14
+ import { cx } from 'antd-style';
14
15
  import { ChevronDownIcon } from 'lucide-react';
15
- import { memo } from 'react';
16
+ import { useMemo } from 'react';
16
17
  import SendIcon from "./components/SendIcon";
17
18
  import StopIcon from "./components/StopIcon";
18
- import { useStyles } from "./style";
19
+ import { styles } from "./style";
19
20
  import { jsx as _jsx } from "react/jsx-runtime";
20
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
- // Keep memo: Multiple state transitions and conditional rendering logic
22
- var SendButton = /*#__PURE__*/memo(function (_ref) {
22
+ var SendButton = function SendButton(_ref) {
23
23
  var _ref$type = _ref.type,
24
24
  type = _ref$type === void 0 ? 'primary' : _ref$type,
25
25
  menu = _ref.menu,
@@ -35,9 +35,11 @@ var SendButton = /*#__PURE__*/memo(function (_ref) {
35
35
  disabled = _ref.disabled,
36
36
  _onClick = _ref.onClick,
37
37
  rest = _objectWithoutProperties(_ref, _excluded);
38
- var _useStyles = useStyles(size),
39
- cx = _useStyles.cx,
40
- styles = _useStyles.styles;
38
+ var cssVariables = useMemo(function () {
39
+ return {
40
+ '--send-button-size': "".concat(size, "px")
41
+ };
42
+ }, [size]);
41
43
  if (generating) return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
42
44
  className: cx(styles.loadingButton, className),
43
45
  onClick: function onClick(e) {
@@ -47,7 +49,7 @@ var SendButton = /*#__PURE__*/memo(function (_ref) {
47
49
  if (_onClick) _onClick(e);
48
50
  },
49
51
  shape: shape,
50
- style: _objectSpread(_objectSpread({}, style), {}, {
52
+ style: _objectSpread(_objectSpread(_objectSpread({}, cssVariables), style), {}, {
51
53
  width: menu ? size * 2 : size
52
54
  })
53
55
  }, rest), {}, {
@@ -60,7 +62,7 @@ var SendButton = /*#__PURE__*/memo(function (_ref) {
60
62
  disabled: true,
61
63
  loading: loading,
62
64
  shape: shape,
63
- style: _objectSpread(_objectSpread({}, style), {}, {
65
+ style: _objectSpread(_objectSpread(_objectSpread({}, cssVariables), style), {}, {
64
66
  width: menu ? size * 2 : size
65
67
  }),
66
68
  type: type
@@ -76,12 +78,12 @@ var SendButton = /*#__PURE__*/memo(function (_ref) {
76
78
  if (_onClick) _onClick(e);
77
79
  },
78
80
  shape: shape,
79
- style: style,
81
+ style: _objectSpread(_objectSpread({}, cssVariables), style),
80
82
  type: type
81
83
  }, rest));
82
84
  return /*#__PURE__*/_jsxs(Space.Compact, _objectSpread(_objectSpread({
83
85
  className: cx(styles.dropdownButton, disabled && styles.disabled, shape === 'round' && styles.dropdownButtonRound, className),
84
- style: style
86
+ style: _objectSpread(_objectSpread({}, cssVariables), style)
85
87
  }, rest), {}, {
86
88
  children: [/*#__PURE__*/_jsx(Button, _objectSpread({
87
89
  className: cx(styles.button, disabled && styles.disabled, className),
@@ -94,7 +96,7 @@ var SendButton = /*#__PURE__*/memo(function (_ref) {
94
96
  if (_onClick) _onClick(e);
95
97
  },
96
98
  shape: shape,
97
- style: style,
99
+ style: _objectSpread(_objectSpread({}, cssVariables), style),
98
100
  type: type
99
101
  }, rest)), /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({
100
102
  menu: menu,
@@ -107,13 +109,13 @@ var SendButton = /*#__PURE__*/memo(function (_ref) {
107
109
  icon: ChevronDownIcon
108
110
  }),
109
111
  shape: shape,
110
- style: {
112
+ style: _objectSpread(_objectSpread({}, cssVariables), {}, {
111
113
  cursor: 'pointer'
112
- },
114
+ }),
113
115
  type: type
114
116
  })
115
117
  }))]
116
118
  }));
117
- });
119
+ };
118
120
  SendButton.displayName = 'SendButton';
119
121
  export default SendButton;
@@ -1,25 +1,25 @@
1
1
  'use client';
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ var _templateObject;
4
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
5
+ import { createStaticStyles, cx } from 'antd-style';
4
6
  import { jsx as _jsx } from "react/jsx-runtime";
5
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- var SendIcon = function SendIcon(_ref) {
11
- var _ref$size = _ref.size,
12
- size = _ref$size === void 0 ? '1em' : _ref$size,
13
- style = _ref.style;
7
+ var styles = createStaticStyles(function (_ref) {
8
+ var css = _ref.css;
9
+ return {
10
+ icon: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: none;\n line-height: 1;\n "])))
11
+ };
12
+ });
13
+ var SendIcon = function SendIcon(_ref2) {
14
+ var _ref2$size = _ref2.size,
15
+ size = _ref2$size === void 0 ? '1em' : _ref2$size,
16
+ style = _ref2.style;
14
17
  return /*#__PURE__*/_jsx("svg", {
15
- className: 'anticon',
18
+ className: cx('anticon', styles.icon),
16
19
  fill: "currentColor",
17
20
  fillRule: "evenodd",
18
21
  height: size,
19
- style: _objectSpread({
20
- flex: 'none',
21
- lineHeight: 1
22
- }, style),
22
+ style: style,
23
23
  viewBox: "0 0 14 14",
24
24
  width: size,
25
25
  xmlns: "http://www.w3.org/2000/svg",
@@ -1,25 +1,23 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { useTheme } from 'antd-style';
1
+ var _templateObject;
2
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
+ import { createStaticStyles, cssVar, cx } from 'antd-style';
8
4
  import { jsx as _jsx } from "react/jsx-runtime";
9
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- var StopIcon = function StopIcon(_ref) {
11
- var _ref$size = _ref.size,
12
- size = _ref$size === void 0 ? '1.5em' : _ref$size,
13
- style = _ref.style;
14
- var theme = useTheme();
6
+ var styles = createStaticStyles(function (_ref) {
7
+ var css = _ref.css;
8
+ return {
9
+ icon: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: none;\n line-height: 1;\n "])))
10
+ };
11
+ });
12
+ var StopIcon = function StopIcon(_ref2) {
13
+ var _ref2$size = _ref2.size,
14
+ size = _ref2$size === void 0 ? '1.5em' : _ref2$size,
15
+ style = _ref2.style;
15
16
  return /*#__PURE__*/_jsx("svg", {
16
- className: 'anticon',
17
+ className: cx('anticon', styles.icon),
17
18
  color: "currentColor",
18
19
  height: size,
19
- style: _objectSpread({
20
- flex: 'none',
21
- lineHeight: 1
22
- }, style),
20
+ style: style,
23
21
  viewBox: "0 0 1024 1024",
24
22
  width: size,
25
23
  xmlns: "http://www.w3.org/2000/svg",
@@ -30,7 +28,7 @@ var StopIcon = function StopIcon(_ref) {
30
28
  cy: "512",
31
29
  fill: "none",
32
30
  r: "426",
33
- stroke: theme.colorBorder,
31
+ stroke: cssVar.colorBorder,
34
32
  strokeWidth: "72"
35
33
  }), /*#__PURE__*/_jsx("rect", {
36
34
  fill: "currentColor",
@@ -1,7 +1,7 @@
1
- export declare const useStyles: (props?: number | undefined) => import("antd-style").ReturnStyles<{
2
- button: import("antd-style").SerializedStyles;
3
- disabled: import("antd-style").SerializedStyles;
4
- dropdownButton: import("antd-style").SerializedStyles;
5
- dropdownButtonRound: import("antd-style").SerializedStyles;
6
- loadingButton: import("antd-style").SerializedStyles;
7
- }>;
1
+ export declare const styles: {
2
+ button: string;
3
+ disabled: string;
4
+ dropdownButton: string;
5
+ dropdownButtonRound: string;
6
+ loadingButton: string;
7
+ };
@@ -1,16 +1,15 @@
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
- import { rgba } from 'polished';
5
- export var useStyles = createStyles(function (_ref, size) {
3
+ import { createStaticStyles } from 'antd-style';
4
+ var prefixCls = 'ant';
5
+ export var styles = createStaticStyles(function (_ref) {
6
6
  var css = _ref.css,
7
- token = _ref.token,
8
- prefixCls = _ref.prefixCls;
7
+ cssVar = _ref.cssVar;
9
8
  return {
10
- button: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", "-btn {\n flex: none;\n width: ", "px !important;\n height: ", "px;\n padding-inline: 0 !important;\n }\n "])), prefixCls, size, size),
11
- disabled: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", "-btn {\n cursor: default;\n border-color: ", ";\n background: transparent;\n }\n\n .", "-btn-compact-first-item {\n cursor: default;\n border-color: ", ";\n background: transparent;\n }\n .", "-dropdown-trigger {\n cursor: default;\n border-color: ", ";\n border-inline-start-color: transparent;\n background: transparent;\n }\n "])), prefixCls, token.colorBorderSecondary, prefixCls, token.colorBorderSecondary, prefixCls, token.colorBorderSecondary),
12
- dropdownButton: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: none;\n width: fit-content;\n .", "-btn {\n width: ", "px;\n height: ", "px;\n }\n .", "-dropdown-trigger {\n width: ", "px;\n &.", "-btn-primary {\n &::before {\n background-color: ", " !important;\n }\n }\n }\n "])), prefixCls, size * 1.2, size, prefixCls, size * 0.8, prefixCls, rgba(token.colorBgLayout, 0.1)),
13
- dropdownButtonRound: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", "-btn-compact-first-item {\n border-start-start-radius: ", "px;\n border-end-start-radius: ", "px;\n }\n .", "-dropdown-trigger {\n width: ", "px;\n border-start-end-radius: ", "px;\n border-end-end-radius: ", "px;\n }\n "])), prefixCls, size / 2, size / 2, prefixCls, size, size / 2, size / 2),
14
- loadingButton: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &.", "-btn {\n flex: none;\n height: ", "px;\n padding-inline: 0 !important;\n }\n "])), prefixCls, size)
9
+ button: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", "-btn {\n flex: none;\n width: var(--send-button-size, 32px) !important;\n height: var(--send-button-size, 32px);\n padding-inline: 0 !important;\n }\n "])), prefixCls),
10
+ disabled: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", "-btn {\n cursor: default;\n border-color: ", ";\n background: transparent;\n }\n\n .", "-btn-compact-first-item {\n cursor: default;\n border-color: ", ";\n background: transparent;\n }\n .", "-dropdown-trigger {\n cursor: default;\n border-color: ", ";\n border-inline-start-color: transparent;\n background: transparent;\n }\n "])), prefixCls, cssVar.colorBorderSecondary, prefixCls, cssVar.colorBorderSecondary, prefixCls, cssVar.colorBorderSecondary),
11
+ dropdownButton: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: none;\n width: fit-content;\n .", "-btn {\n width: calc(var(--send-button-size, 32px) * 1.2);\n height: var(--send-button-size, 32px);\n }\n .", "-dropdown-trigger {\n width: calc(var(--send-button-size, 32px) * 0.8);\n &.", "-btn-primary {\n &::before {\n background-color: color-mix(in srgb, ", " 10%, transparent) !important;\n }\n }\n }\n "])), prefixCls, prefixCls, prefixCls, cssVar.colorBgLayout),
12
+ dropdownButtonRound: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", "-btn-compact-first-item {\n border-start-start-radius: calc(var(--send-button-size, 32px) / 2);\n border-end-start-radius: calc(var(--send-button-size, 32px) / 2);\n }\n .", "-dropdown-trigger {\n width: var(--send-button-size, 32px);\n border-start-end-radius: calc(var(--send-button-size, 32px) / 2);\n border-end-end-radius: calc(var(--send-button-size, 32px) / 2);\n }\n "])), prefixCls, prefixCls),
13
+ loadingButton: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &.", "-btn {\n flex: none;\n height: var(--send-button-size, 32px);\n padding-inline: 0 !important;\n }\n "])), prefixCls)
15
14
  };
16
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
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",
@@ -45,7 +45,7 @@
45
45
  "@shikijs/engine-javascript": "^3.20.0",
46
46
  "@xmldom/xmldom": "^0.8.11",
47
47
  "ahooks": "^3.9.6",
48
- "antd-style": "^4.0.0",
48
+ "antd-style": "^4.1.0",
49
49
  "debug": "^4.4.3",
50
50
  "es-toolkit": "^1.43.0",
51
51
  "eventemitter3": "^5.0.1",
@@ -64,7 +64,7 @@
64
64
  "use-merge-value": "^1.2.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@lobehub/ui": "^4.0.0",
67
+ "@lobehub/ui": "^4.3.4",
68
68
  "antd": "^6.1.1",
69
69
  "motion": "^12.0.0",
70
70
  "react": "^19.0.0",