@lobehub/ui 1.26.0 → 1.26.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 (138) hide show
  1. package/es/ActionIcon/index.d.ts +1 -1
  2. package/es/ActionIcon/index.js +30 -18
  3. package/es/Avatar/index.js +11 -11
  4. package/es/Chat/store/initialState.d.ts +3 -3
  5. package/es/Chat/store/initialState.js +4 -4
  6. package/es/Chat/store/messageReducer.js +71 -49
  7. package/es/Chat/store/selectors.d.ts +3 -3
  8. package/es/Chat/store/selectors.js +3 -3
  9. package/es/Chat/store/store.d.ts +1 -1
  10. package/es/Chat/store/store.js +110 -110
  11. package/es/Chat/types.d.ts +1 -1
  12. package/es/Chat/utils/fetch.d.ts +1 -1
  13. package/es/Chat/utils/fetch.js +4 -4
  14. package/es/ChatInputArea/index.js +2 -1
  15. package/es/ChatInputArea/style.d.ts +3 -3
  16. package/es/ChatInputArea/style.js +5 -5
  17. package/es/ChatItem/index.js +12 -10
  18. package/es/ChatItem/style.d.ts +3 -3
  19. package/es/ChatItem/style.js +7 -7
  20. package/es/ChatList/ActionsBar.d.ts +1 -1
  21. package/es/ChatList/ActionsBar.js +12 -11
  22. package/es/ChatList/index.d.ts +1 -1
  23. package/es/ChatList/index.js +1 -1
  24. package/es/ColorScales/ScaleRow.js +20 -14
  25. package/es/ColorScales/index.js +6 -4
  26. package/es/ColorScales/style.d.ts +2 -2
  27. package/es/ColorScales/style.js +7 -7
  28. package/es/ContextMenu/MenuItem/index.js +14 -14
  29. package/es/ContextMenu/MenuItem/style.d.ts +2 -2
  30. package/es/ContextMenu/MenuItem/style.js +5 -5
  31. package/es/ContextMenu/index.js +42 -42
  32. package/es/ContextMenu/style.d.ts +1 -1
  33. package/es/ContextMenu/style.js +2 -2
  34. package/es/Conversation/App.js +2 -2
  35. package/es/Conversation/ChatList/MessageItem/Content.js +15 -15
  36. package/es/Conversation/ChatList/MessageItem/Toolbar.js +3 -3
  37. package/es/Conversation/ChatList/MessageItem/index.js +14 -14
  38. package/es/Conversation/ChatList/index.js +5 -5
  39. package/es/Conversation/InputArea/ActionBar.d.ts +2 -2
  40. package/es/Conversation/InputArea/ActionBar.js +2 -2
  41. package/es/Conversation/InputArea/index.d.ts +2 -2
  42. package/es/Conversation/InputArea/index.js +10 -12
  43. package/es/Conversation/StoreUpdater.js +1 -1
  44. package/es/Conversation/index.js +2 -2
  45. package/es/CopyButton/index.d.ts +4 -2
  46. package/es/CopyButton/index.js +4 -3
  47. package/es/DraggablePanel/index.d.ts +2 -2
  48. package/es/DraggablePanel/index.js +50 -42
  49. package/es/DraggablePanel/style.d.ts +9 -9
  50. package/es/DraggablePanel/style.js +17 -17
  51. package/es/DraggablePanel/utils.js +12 -4
  52. package/es/EditableMessage/index.js +4 -4
  53. package/es/EditableMessageList/index.js +20 -19
  54. package/es/EditableText/index.js +1 -1
  55. package/es/Features/Item.js +5 -5
  56. package/es/Features/Item.style.d.ts +2 -2
  57. package/es/Features/Item.style.js +4 -4
  58. package/es/Features/index.js +3 -3
  59. package/es/Features/style.js +2 -2
  60. package/es/FontLoader/index.d.ts +6 -0
  61. package/es/FontLoader/index.js +16 -0
  62. package/es/Footer/index.js +2 -2
  63. package/es/GradientButton/style.d.ts +1 -1
  64. package/es/GradientButton/style.js +2 -2
  65. package/es/Header/index.js +2 -2
  66. package/es/Header/style.d.ts +1 -1
  67. package/es/Header/style.js +2 -2
  68. package/es/Hero/style.d.ts +3 -3
  69. package/es/Hero/style.js +14 -13
  70. package/es/Highlighter/SyntaxHighlighter/Prism.js +7 -7
  71. package/es/Highlighter/SyntaxHighlighter/index.js +1 -1
  72. package/es/Highlighter/SyntaxHighlighter/style.d.ts +2 -2
  73. package/es/Highlighter/SyntaxHighlighter/style.js +2 -2
  74. package/es/Highlighter/index.d.ts +1 -2
  75. package/es/Highlighter/index.js +4 -3
  76. package/es/Highlighter/style.d.ts +1 -1
  77. package/es/Highlighter/style.js +2 -2
  78. package/es/Highlighter/theme.js +22 -22
  79. package/es/Icon/index.js +24 -16
  80. package/es/Input/index.js +4 -4
  81. package/es/Layout/index.js +1 -1
  82. package/es/Layout/style.d.ts +5 -5
  83. package/es/Layout/style.js +7 -7
  84. package/es/List/ListItem/index.d.ts +1 -1
  85. package/es/List/ListItem/index.js +21 -42
  86. package/es/List/ListItem/style.d.ts +9 -0
  87. package/es/List/ListItem/style.js +21 -0
  88. package/es/List/index.d.ts +1 -1
  89. package/es/Logo/index.d.ts +2 -2
  90. package/es/Logo/index.js +48 -38
  91. package/es/Logo/style.d.ts +1 -1
  92. package/es/Logo/style.js +2 -2
  93. package/es/Markdown/CodeBlock.d.ts +1 -1
  94. package/es/Markdown/CodeBlock.js +7 -7
  95. package/es/Markdown/index.js +3 -3
  96. package/es/Markdown/style.d.ts +1 -1
  97. package/es/Markdown/style.js +2 -2
  98. package/es/MessageInput/index.d.ts +1 -1
  99. package/es/MessageInput/index.js +5 -5
  100. package/es/MessageModal/index.js +8 -6
  101. package/es/MessageModal/style.d.ts +1 -1
  102. package/es/MessageModal/style.js +2 -2
  103. package/es/SearchBar/index.d.ts +1 -1
  104. package/es/SearchBar/index.js +13 -11
  105. package/es/SearchBar/style.d.ts +2 -2
  106. package/es/SearchBar/style.js +3 -3
  107. package/es/Snippet/index.js +5 -3
  108. package/es/Spotlight/index.js +13 -13
  109. package/es/Spotlight/style.js +1 -1
  110. package/es/StroyBook/index.d.ts +1 -2
  111. package/es/StroyBook/index.js +3 -3
  112. package/es/StroyBook/style.d.ts +1 -1
  113. package/es/StroyBook/style.js +2 -2
  114. package/es/Swatches/index.d.ts +1 -1
  115. package/es/Swatches/index.js +9 -9
  116. package/es/ThemeProvider/index.d.ts +2 -2
  117. package/es/ThemeProvider/index.js +3 -4
  118. package/es/ThemeSwitch/index.js +8 -8
  119. package/es/Toc/TocMobile.d.ts +4 -4
  120. package/es/Toc/TocMobile.js +15 -15
  121. package/es/Toc/style.d.ts +2 -2
  122. package/es/Toc/style.js +3 -3
  123. package/es/TokenTag/style.js +12 -7
  124. package/es/components/ControlInput.d.ts +1 -1
  125. package/es/components/ControlInput.js +7 -6
  126. package/es/hooks/useHighlight.js +14 -14
  127. package/es/index.d.ts +1 -0
  128. package/es/index.js +1 -0
  129. package/es/styles/algorithms/generateColorPalette.js +10 -10
  130. package/es/styles/algorithms/generateCustomStylish.js +5 -5
  131. package/es/styles/algorithms/generateCustomToken.js +42 -17
  132. package/es/styles/algorithms/generateTheme.js +4 -4
  133. package/es/styles/colors.js +65 -65
  134. package/es/styles/theme/base.js +2 -2
  135. package/es/styles/theme/dark.js +16 -16
  136. package/es/styles/theme/light.js +16 -16
  137. package/es/types/llm.d.ts +1 -1
  138. package/package.json +3 -3
@@ -45,15 +45,15 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
45
45
  hanlderStyle = _ref.hanlderStyle,
46
46
  _ref$classNames = _ref.classNames,
47
47
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames;
48
- var ref = useRef(null);
49
- var isHovering = useHover(ref);
48
+ var reference = useRef();
49
+ var isHovering = useHover(reference);
50
50
  var isVertical = placement === 'top' || placement === 'bottom';
51
51
  var _useStyles = useStyles(),
52
52
  styles = _useStyles.styles,
53
53
  cx = _useStyles.cx;
54
54
  var _useControlledState = useControlledState(defaultExpand, {
55
- value: expand,
56
- onChange: onExpandChange
55
+ onChange: onExpandChange,
56
+ value: expand
57
57
  }),
58
58
  _useControlledState2 = _slicedToArray(_useControlledState, 2),
59
59
  isExpand = _useControlledState2[0],
@@ -76,31 +76,31 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
76
76
  return _defineProperty({}, revesePlacement(placement), styles["".concat(revesePlacement(placement), "Handle")]);
77
77
  }, [canResizing, placement]);
78
78
  var resizing = _objectSpread(_defineProperty({
79
- top: false,
80
79
  bottom: false,
81
- right: false,
82
- left: false,
83
- topRight: false,
84
- bottomRight: false,
85
80
  bottomLeft: false,
86
- topLeft: false
81
+ bottomRight: false,
82
+ left: false,
83
+ right: false,
84
+ top: false,
85
+ topLeft: false,
86
+ topRight: false
87
87
  }, revesePlacement(placement), true), resize);
88
88
  var defaultSize = useMemo(function () {
89
89
  if (isVertical) return _objectSpread({
90
- width: '100%',
91
- height: DEFAULT_HEIGHT
90
+ height: DEFAULT_HEIGHT,
91
+ width: '100%'
92
92
  }, customizeDefaultSize);
93
93
  return _objectSpread({
94
- width: DEFAULT_WIDTH,
95
- height: '100%'
94
+ height: '100%',
95
+ width: DEFAULT_WIDTH
96
96
  }, customizeDefaultSize);
97
97
  }, [isVertical]);
98
98
  var sizeProps = isExpand ? {
99
- minWidth: typeof minWidth === 'number' ? Math.max(minWidth, 0) : minWidth,
100
- minHeight: typeof minHeight === 'number' ? Math.max(minHeight, 0) : minHeight,
101
- maxWidth: typeof maxWidth === 'number' ? Math.max(maxWidth, 0) : maxWidth,
102
- maxHeight: typeof maxHeight === 'number' ? Math.max(maxHeight, 0) : maxHeight,
103
99
  defaultSize: defaultSize,
100
+ maxHeight: typeof maxHeight === 'number' ? Math.max(maxHeight, 0) : maxHeight,
101
+ maxWidth: typeof maxWidth === 'number' ? Math.max(maxWidth, 0) : maxWidth,
102
+ minHeight: typeof minHeight === 'number' ? Math.max(minHeight, 0) : minHeight,
103
+ minWidth: typeof minWidth === 'number' ? Math.max(minWidth, 0) : minWidth,
104
104
  size: size
105
105
  } : isVertical ? {
106
106
  minHeight: 0,
@@ -116,25 +116,33 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
116
116
  var _useMemo = useMemo(function () {
117
117
  switch (placement) {
118
118
  case 'top':
119
- return {
120
- className: 'Bottom',
121
- Arrow: ChevronDown
122
- };
119
+ {
120
+ return {
121
+ Arrow: ChevronDown,
122
+ className: 'Bottom'
123
+ };
124
+ }
123
125
  case 'bottom':
124
- return {
125
- className: 'Top',
126
- Arrow: ChevronUp
127
- };
126
+ {
127
+ return {
128
+ Arrow: ChevronUp,
129
+ className: 'Top'
130
+ };
131
+ }
128
132
  case 'right':
129
- return {
130
- className: 'Left',
131
- Arrow: ChevronLeft
132
- };
133
+ {
134
+ return {
135
+ Arrow: ChevronLeft,
136
+ className: 'Left'
137
+ };
138
+ }
133
139
  case 'left':
134
- return {
135
- className: 'Right',
136
- Arrow: ChevronRight
137
- };
140
+ {
141
+ return {
142
+ Arrow: ChevronRight,
143
+ className: 'Right'
144
+ };
145
+ }
138
146
  }
139
147
  }, [styles, placement]),
140
148
  Arrow = _useMemo.Arrow,
@@ -144,7 +152,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
144
152
  , {
145
153
  className: cx(styles["toggle".concat(arrowPlacement)], classNames.handle),
146
154
  style: {
147
- opacity: isExpand ? !pin ? 0 : undefined : showHandlerWhenUnexpand ? 1 : 0
155
+ opacity: isExpand ? pin ? undefined : 0 : showHandlerWhenUnexpand ? 1 : 0
148
156
  },
149
157
  children: /*#__PURE__*/_jsx(Center, {
150
158
  onClick: function onClick() {
@@ -170,20 +178,20 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
170
178
  className: cx(styles.panel, classNames.content),
171
179
  enable: canResizing ? resizing : undefined,
172
180
  handleClasses: resizeHandleClassNames,
173
- onResize: function onResize(_, direction, ref, delta) {
181
+ onResize: function onResize(_, direction, reference_, delta) {
174
182
  onSizeDragging === null || onSizeDragging === void 0 ? void 0 : onSizeDragging(delta, {
175
- width: ref.style.width,
176
- height: ref.style.height
183
+ height: reference_.style.height,
184
+ width: reference_.style.width
177
185
  });
178
186
  },
179
187
  onResizeStart: function onResizeStart() {
180
188
  setShowExpand(false);
181
189
  },
182
- onResizeStop: function onResizeStop(e, direction, ref, delta) {
190
+ onResizeStop: function onResizeStop(e, direction, reference_, delta) {
183
191
  setShowExpand(true);
184
192
  onSizeChange === null || onSizeChange === void 0 ? void 0 : onSizeChange(delta, {
185
- width: ref.style.width,
186
- height: ref.style.height
193
+ height: reference_.style.height,
194
+ width: reference_.style.width
187
195
  });
188
196
  },
189
197
  style: style,
@@ -197,7 +205,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
197
205
  className: cx(styles.container,
198
206
  // @ts-ignore
199
207
  styles[mode === 'fixed' ? 'fixed' : "".concat(placement, "Float")], className),
200
- ref: ref,
208
+ ref: reference,
201
209
  style: _defineProperty({}, "border".concat(arrowPlacement, "Width"), 1),
202
210
  children: [expandable && showExpand && handler, destroyOnClose ? isExpand && inner : inner]
203
211
  });
@@ -1,19 +1,19 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ bottomFloat: string;
3
+ bottomHandle: string;
2
4
  container: string;
3
5
  fixed: import("antd-style").SerializedStyles;
6
+ fullscreen: import("antd-style").SerializedStyles;
7
+ handlerIcon: import("antd-style").SerializedStyles;
4
8
  leftFloat: string;
9
+ leftHandle: string;
10
+ panel: string;
5
11
  rightFloat: string;
6
- topFloat: string;
7
- bottomFloat: string;
12
+ rightHandle: string;
13
+ toggleBottom: string;
8
14
  toggleLeft: string;
9
15
  toggleRight: string;
10
16
  toggleTop: string;
11
- toggleBottom: string;
12
- panel: string;
13
- handlerIcon: import("antd-style").SerializedStyles;
14
- leftHandle: string;
15
- rightHandle: string;
17
+ topFloat: string;
16
18
  topHandle: string;
17
- bottomHandle: string;
18
- fullscreen: import("antd-style").SerializedStyles;
19
19
  }>;
@@ -11,22 +11,22 @@ export var useStyles = createStyles(function (_ref) {
11
11
  var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 101;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
12
12
  var float = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 200;\n "])));
13
13
  return {
14
- container: cx(prefix, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n border: 0 solid ", ";\n\n &:hover {\n .", "-toggle {\n opacity: 1;\n }\n }\n "])), token.colorBorderSecondary, prefix)),
15
- fixed: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n "]))),
16
- leftFloat: cx(float, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n top: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n "])))),
17
- rightFloat: cx(float, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n "])))),
18
- topFloat: cx(float, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n "])))),
19
- bottomFloat: cx(float, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n "])))),
20
- toggleLeft: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
21
- toggleRight: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
22
- toggleTop: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-top"), commonToggle, css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n top: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-left: -20px;\n\n border-radius: 4px 4px 0 0;\n }\n "])), offset, toggleShort, toggleLength, toggleShort)),
23
- toggleBottom: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-bottom"), commonToggle, css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n bottom: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: 16px;\n margin-left: -20px;\n\n border-radius: 0 0 4px 4px;\n }\n "])), offset, toggleShort, toggleLength)),
24
- panel: cx("".concat(prefix, "-fixed"), css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n overflow: hidden;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut)),
25
- handlerIcon: css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut),
26
- leftHandle: cx(css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n left: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-left-handle")),
27
- rightHandle: cx(css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n ", ";\n &::before {\n right: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-right-handle")),
28
- topHandle: cx("".concat(prefix, "-top-handle"), css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n top: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle)),
29
- bottomHandle: cx("".concat(prefix, "-bottom-handle"), css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n bottom: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle)),
30
- fullscreen: css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n "])))
14
+ bottomFloat: cx(float, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n "])))),
15
+ bottomHandle: cx("".concat(prefix, "-bottom-handle"), css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n bottom: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle)),
16
+ container: cx(prefix, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n border: 0 solid ", ";\n\n &:hover {\n .", "-toggle {\n opacity: 1;\n }\n }\n "])), token.colorBorderSecondary, prefix)),
17
+ fixed: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n "]))),
18
+ fullscreen: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n "]))),
19
+ handlerIcon: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut),
20
+ leftFloat: cx(float, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n top: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n "])))),
21
+ leftHandle: cx(css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n left: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-left-handle")),
22
+ panel: cx("".concat(prefix, "-fixed"), css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n overflow: hidden;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut)),
23
+ rightFloat: cx(float, css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n "])))),
24
+ rightHandle: cx(css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n ", ";\n &::before {\n right: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-right-handle")),
25
+ toggleBottom: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-bottom"), commonToggle, css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n bottom: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: 16px;\n margin-left: -20px;\n\n border-radius: 0 0 4px 4px;\n }\n "])), offset, toggleShort, toggleLength)),
26
+ toggleLeft: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
27
+ toggleRight: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
28
+ toggleTop: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-top"), commonToggle, css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n top: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-left: -20px;\n\n border-radius: 4px 4px 0 0;\n }\n "])), offset, toggleShort, toggleLength, toggleShort)),
29
+ topFloat: cx(float, css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n "])))),
30
+ topHandle: cx("".concat(prefix, "-top-handle"), css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n top: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle))
31
31
  };
32
32
  });
@@ -1,12 +1,20 @@
1
1
  export var revesePlacement = function revesePlacement(placement) {
2
2
  switch (placement) {
3
3
  case 'bottom':
4
- return 'top';
4
+ {
5
+ return 'top';
6
+ }
5
7
  case 'top':
6
- return 'bottom';
8
+ {
9
+ return 'bottom';
10
+ }
7
11
  case 'right':
8
- return 'left';
12
+ {
13
+ return 'left';
14
+ }
9
15
  case 'left':
10
- return 'right';
16
+ {
17
+ return 'right';
18
+ }
11
19
  }
12
20
  };
@@ -19,15 +19,15 @@ var EditableMessage = /*#__PURE__*/memo(function (_ref) {
19
19
  _ref$showEditWhenEmpt = _ref.showEditWhenEmpty,
20
20
  showEditWhenEmpty = _ref$showEditWhenEmpt === void 0 ? false : _ref$showEditWhenEmpt;
21
21
  var _useControlledState = useControlledState(false, {
22
- value: editing,
23
- onChange: onEditingChange
22
+ onChange: onEditingChange,
23
+ value: editing
24
24
  }),
25
25
  _useControlledState2 = _slicedToArray(_useControlledState, 2),
26
26
  isEdit = _useControlledState2[0],
27
27
  setTyping = _useControlledState2[1];
28
28
  var _useControlledState3 = useControlledState(false, {
29
- value: openModal,
30
- onChange: onOpenChange
29
+ onChange: onOpenChange,
30
+ value: openModal
31
31
  }),
32
32
  _useControlledState4 = _slicedToArray(_useControlledState3, 2),
33
33
  expand = _useControlledState4[0],
@@ -4,9 +4,10 @@ import isEqual from 'fast-deep-equal';
4
4
  import { Plus, Trash } from 'lucide-react';
5
5
  import { memo, useEffect, useReducer } from 'react';
6
6
  import { Flexbox } from 'react-layout-kit';
7
+ import ActionIcon from "../ActionIcon";
7
8
  import { messagesReducer } from "../Chat";
9
+ import Icon from "../Icon";
8
10
  import { ControlInput } from "../components/ControlInput";
9
- import { ActionIcon, Icon } from "./..";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
@@ -22,7 +23,7 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
22
23
  onChange === null || onChange === void 0 ? void 0 : onChange(chatMessages);
23
24
  }
24
25
  }, [chatMessages]);
25
- return !dataSources ? null : /*#__PURE__*/_jsxs(Flexbox, {
26
+ return dataSources ? /*#__PURE__*/_jsxs(Flexbox, {
26
27
  gap: 12,
27
28
  children: [chatMessages.map(function (item, index) {
28
29
  return /*#__PURE__*/_jsxs(Flexbox, {
@@ -37,20 +38,20 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
37
38
  },
38
39
  onChange: function onChange(value) {
39
40
  dispatch({
40
- type: 'updateMessageRole',
41
41
  index: index,
42
- role: value
42
+ role: value,
43
+ type: 'updateMessageRole'
43
44
  });
44
45
  },
45
46
  options: [{
46
- value: 'system',
47
- label: 'System'
47
+ label: 'System',
48
+ value: 'system'
48
49
  }, {
49
- value: 'user',
50
- label: 'Input'
50
+ label: 'Input',
51
+ value: 'user'
51
52
  }, {
52
- value: 'assistant',
53
- label: 'Output'
53
+ label: 'Output',
54
+ value: 'assistant'
54
55
  }],
55
56
  style: {
56
57
  width: 120
@@ -60,9 +61,9 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
60
61
  disabled: disabled,
61
62
  onChange: function onChange(e) {
62
63
  dispatch({
63
- type: 'updateMessage',
64
64
  index: index,
65
- message: e
65
+ message: e,
66
+ type: 'updateMessage'
66
67
  });
67
68
  },
68
69
  placeholder: item.role === 'user' ? '请填入输入的样例内容' : '请填入输出的样例',
@@ -71,8 +72,8 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
71
72
  icon: Trash,
72
73
  onClick: function onClick() {
73
74
  dispatch({
74
- type: 'deleteMessage',
75
- index: index
75
+ index: index,
76
+ type: 'deleteMessage'
76
77
  });
77
78
  },
78
79
  placement: "right",
@@ -91,15 +92,15 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
91
92
  onClick: function onClick() {
92
93
  var lastMeg = chatMessages.at(-1);
93
94
  dispatch({
94
- type: 'addMessage',
95
95
  message: {
96
- role: (lastMeg === null || lastMeg === void 0 ? void 0 : lastMeg.role) === 'user' ? 'assistant' : 'user',
97
- content: ''
98
- }
96
+ content: '',
97
+ role: (lastMeg === null || lastMeg === void 0 ? void 0 : lastMeg.role) === 'user' ? 'assistant' : 'user'
98
+ },
99
+ type: 'addMessage'
99
100
  });
100
101
  },
101
102
  children: "Add Props"
102
103
  })]
103
- });
104
+ }) : undefined;
104
105
  }, isEqual);
105
106
  export default EditableMessageList;
@@ -2,8 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import { Edit3 } from 'lucide-react';
3
3
  import { memo, useState } from 'react';
4
4
  import { Flexbox } from 'react-layout-kit';
5
+ import ActionIcon from "../ActionIcon";
5
6
  import { ControlInput } from "../components/ControlInput";
6
- import { ActionIcon } from "./..";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  var EditableText = /*#__PURE__*/memo(function (_ref) {
@@ -36,10 +36,10 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
36
36
  imageStyle = _ref2.imageStyle,
37
37
  openExternal = _ref2.openExternal,
38
38
  props = _objectWithoutProperties(_ref2, _excluded);
39
- var rowNum = row || 7;
39
+ var rowNumber = row || 7;
40
40
  var _useStyles = useStyles({
41
- rowNum: rowNum,
42
- hasLink: Boolean(link)
41
+ hasLink: Boolean(link),
42
+ rowNum: rowNumber
43
43
  }),
44
44
  styles = _useStyles.styles,
45
45
  cx = _useStyles.cx;
@@ -49,8 +49,8 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
49
49
  return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
50
50
  className: cx(styles.container, className),
51
51
  style: _objectSpread({
52
- gridRow: "span ".concat(rowNum),
53
- gridColumn: "span ".concat(column || 1)
52
+ gridColumn: "span ".concat(column || 1),
53
+ gridRow: "span ".concat(rowNumber)
54
54
  }, style)
55
55
  }, props), {}, {
56
56
  children: /*#__PURE__*/_jsxs("div", {
@@ -4,9 +4,9 @@ export declare const useStyles: (props?: {
4
4
  } | undefined) => import("antd-style").ReturnStyles<{
5
5
  cell: import("antd-style").SerializedStyles;
6
6
  container: import("antd-style").SerializedStyles;
7
- title: string;
8
7
  desc: string;
9
- imgContainer: string;
10
8
  img: string;
9
+ imgContainer: string;
11
10
  link: import("antd-style").SerializedStyles;
11
+ title: string;
12
12
  }>;
@@ -21,10 +21,10 @@ export var useStyles = createStyles(function (_ref, _ref2) {
21
21
  return {
22
22
  cell: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n "]))),
23
23
  container: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n position: relative;\n z-index: 1;\n\n padding: 24px;\n\n background: ", ";\n border-radius: ", "px;\n\n p {\n font-size: 16px;\n line-height: 1.2;\n text-align: justify;\n word-wrap: break-word;\n }\n\n &:hover {\n .", " {\n width: 100%;\n height: ", "px;\n padding: 0;\n background: ", ";\n }\n\n .", " {\n ", ";\n }\n\n .", " {\n position: absolute;\n visibility: hidden;\n opacity: 0;\n }\n\n .", " {\n font-size: ", "px;\n }\n }\n "])), withTransition, token.colorBgContainer, token.borderRadiusLG, coverCls, scaleUnit * rowNum, token.colorFillContent, imgCls, genSize(100), descCls, titleCls, hasLink ? 14 : 20),
24
- title: cx(titleCls, withTransition, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n margin: 16px 0;\n\n font-size: 20px;\n line-height: ", ";\n color: ", ";\n "])), token.lineHeightHeading3, token.colorText)),
25
- desc: cx(descCls, withTransition, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n pointer-events: none;\n color: ", ";\n\n quotient {\n position: relative;\n\n display: block;\n\n margin: 12px 0;\n padding-left: 12px;\n\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorTextDescription)),
24
+ desc: cx(descCls, withTransition, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n pointer-events: none;\n color: ", ";\n\n quotient {\n position: relative;\n\n display: block;\n\n margin: 12px 0;\n padding-left: 12px;\n\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorTextDescription)),
25
+ img: cx(imgCls, withTransition, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", ";\n color: ", ";\n "])), genSize(20), token.colorText)),
26
26
  imgContainer: cx(coverCls, withTransition, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n ", ";\n padding: 4px;\n opacity: 0.8;\n border-radius: ", "px;\n "])), genSize(24), token.borderRadius)),
27
- img: cx(imgCls, withTransition, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", ";\n color: ", ";\n "])), genSize(20), token.colorText)),
28
- link: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", ";\n margin-top: 24px;\n "])), withTransition)
27
+ link: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", ";\n margin-top: 24px;\n "])), withTransition),
28
+ title: cx(titleCls, withTransition, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n margin: 16px 0;\n\n font-size: 20px;\n line-height: ", ";\n color: ", ";\n "])), token.lineHeightHeading3, token.colorText))
29
29
  };
30
30
  });
@@ -14,14 +14,14 @@ var Features = /*#__PURE__*/memo(function (_ref) {
14
14
  className = _ref.className,
15
15
  itemClassName = _ref.itemClassName,
16
16
  itemStyle = _ref.itemStyle,
17
- props = _objectWithoutProperties(_ref, _excluded);
17
+ properties = _objectWithoutProperties(_ref, _excluded);
18
18
  var _useStyles = useStyles(contentMaxWidth),
19
19
  cx = _useStyles.cx,
20
20
  styles = _useStyles.styles;
21
- if (!(items !== null && items !== void 0 && items.length)) return null;
21
+ if (!(items !== null && items !== void 0 && items.length)) return;
22
22
  return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
23
23
  className: cx(styles.container, className)
24
- }, props), {}, {
24
+ }, properties), {}, {
25
25
  children: items.map(function (item) {
26
26
  return /*#__PURE__*/_jsx(Item, _objectSpread({
27
27
  className: itemClassName,
@@ -9,10 +9,10 @@ export var useStyles = createStyles(function (_ref, contentMaxWidth) {
9
9
  var prefix = "".concat(prefixCls, "-features");
10
10
  return {
11
11
  container: cx(prefix, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: grid;\n grid-auto-flow: row dense;\n grid-auto-rows: 18px;\n grid-template-columns: repeat(3, 1fr);\n gap: 16px;\n\n max-width: ", "px;\n\n ", "\n "])), contentMaxWidth, responsive({
12
- mobile: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n "]))),
13
12
  laptop: {
14
13
  gridTemplateColumns: 'repeat(2, 1fr)'
15
- }
14
+ },
15
+ mobile: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n "])))
16
16
  })))
17
17
  };
18
18
  });
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface FontLoaderProps {
3
+ url: string;
4
+ }
5
+ declare const FontLoader: import("react").NamedExoticComponent<FontLoaderProps>;
6
+ export default FontLoader;
@@ -0,0 +1,16 @@
1
+ import { memo, useEffect } from 'react';
2
+ var createElement = function createElement(url) {
3
+ var element = document.createElement('link');
4
+ element.rel = 'stylesheet';
5
+ element.href = url;
6
+ return element;
7
+ };
8
+ var FontLoader = /*#__PURE__*/memo(function (_ref) {
9
+ var url = _ref.url;
10
+ useEffect(function () {
11
+ var element = createElement(url);
12
+ document.head.append(element);
13
+ }, []);
14
+ return false;
15
+ });
16
+ export default FontLoader;
@@ -10,8 +10,8 @@ var Footer = /*#__PURE__*/memo(function (_ref) {
10
10
  contentMaxWidth = _ref$contentMaxWidth === void 0 ? 960 : _ref$contentMaxWidth;
11
11
  var isEmpty = !columns || (columns === null || columns === void 0 ? void 0 : columns.length) === 0;
12
12
  var _useStyles = useStyles({
13
- isEmpty: isEmpty,
14
- contentMaxWidth: contentMaxWidth
13
+ contentMaxWidth: contentMaxWidth,
14
+ isEmpty: isEmpty
15
15
  }),
16
16
  styles = _useStyles.styles;
17
17
  return /*#__PURE__*/_jsx("section", {
@@ -1,5 +1,5 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- button: import("antd-style").SerializedStyles;
3
2
  bg: import("antd-style").SerializedStyles;
3
+ button: import("antd-style").SerializedStyles;
4
4
  glow: import("antd-style").SerializedStyles;
5
5
  }>;
@@ -7,8 +7,8 @@ export var useStyles = createStyles(function (_ref) {
7
7
  isDarkMode = _ref.isDarkMode,
8
8
  stylish = _ref.stylish;
9
9
  return {
10
- button: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n background: ", ";\n border: none;\n\n &::before {\n ", "\n content: '';\n\n position: absolute;\n z-index: 0;\n inset: 0;\n\n overflow: hidden;\n\n padding: 1px;\n\n mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);\n\n mask-composite: xor;\n }\n\n > span {\n position: relative;\n z-index: 10;\n }\n\n &:hover {\n &::before {\n mask: unset;\n }\n }\n "])), token.colorBgLayout, stylish.gradientAnimation),
11
- bg: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n background: ", ";\n border-radius: inherit;\n "])), token.colorBgLayout),
10
+ bg: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n background: ", ";\n border-radius: inherit;\n "])), token.colorBgLayout),
11
+ button: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n background: ", ";\n border: none;\n\n &::before {\n ", "\n content: '';\n\n position: absolute;\n z-index: 0;\n inset: 0;\n\n overflow: hidden;\n\n padding: 1px;\n\n mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);\n\n mask-composite: xor;\n }\n\n > span {\n position: relative;\n z-index: 10;\n }\n\n &:hover {\n &::before {\n mask: unset;\n }\n }\n "])), token.colorBgLayout, stylish.gradientAnimation),
12
12
  glow: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n opacity: ", ";\n filter: blur(", "em);\n border-radius: inherit;\n "])), stylish.gradientAnimation, isDarkMode ? 0.5 : 0.3, isDarkMode ? 1.5 : 1)
13
13
  };
14
14
  });
@@ -38,8 +38,8 @@ var Header = /*#__PURE__*/memo(function (_ref) {
38
38
  children: logo
39
39
  }), /*#__PURE__*/_jsx(Flexbox, {
40
40
  style: {
41
- marginLeft: 48,
42
- alignSelf: 'end'
41
+ alignSelf: 'end',
42
+ marginLeft: 48
43
43
  },
44
44
  children: nav
45
45
  }), /*#__PURE__*/_jsxs("section", {
@@ -1,6 +1,6 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- header: string;
3
2
  content: import("antd-style").SerializedStyles;
3
+ header: string;
4
4
  left: import("antd-style").SerializedStyles;
5
5
  right: import("antd-style").SerializedStyles;
6
6
  }>;
@@ -8,8 +8,8 @@ export var useStyles = createStyles(function (_ref) {
8
8
  token = _ref.token,
9
9
  cx = _ref.cx;
10
10
  return {
11
- header: cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n grid-area: head;\n align-self: stretch;\n width: 100%;\n "])))),
12
- content: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 64px;\n padding: 0 24px;\n background-color: ", ";\n border-bottom: 1px solid ", ";\n\n ", " {\n padding: 0 12px;\n }\n "])), rgba(token.colorBgLayout, 0.4), token.colorSplit, responsive.mobile),
11
+ content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 64px;\n padding: 0 24px;\n background-color: ", ";\n border-bottom: 1px solid ", ";\n\n ", " {\n padding: 0 12px;\n }\n "])), rgba(token.colorBgLayout, 0.4), token.colorSplit, responsive.mobile),
12
+ header: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n grid-area: head;\n align-self: stretch;\n width: 100%;\n "])))),
13
13
  left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 10;\n "]))),
14
14
  right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n z-index: 10;\n display: flex;\n flex: 1;\n justify-content: space-between;\n\n &-aside {\n display: flex;\n align-items: center;\n\n ", " {\n justify-content: center;\n margin: 8px 16px;\n padding-top: 24px;\n border-top: 1px solid ", ";\n }\n }\n "])), responsive.mobile, token.colorBorder)
15
15
  };
@@ -1,7 +1,7 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ actions: import("antd-style").SerializedStyles;
3
+ canvas: string;
2
4
  container: import("antd-style").SerializedStyles;
3
- title: import("antd-style").SerializedStyles;
4
5
  desc: import("antd-style").SerializedStyles;
5
- actions: import("antd-style").SerializedStyles;
6
- canvas: import("antd-style").SerializedStyles;
6
+ title: import("antd-style").SerializedStyles;
7
7
  }>;