@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
@@ -23,7 +23,7 @@ var codeMessage = {
23
23
  * @param options
24
24
  */
25
25
  export var fetchSSE = /*#__PURE__*/function () {
26
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fetchFn) {
26
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(fetchFunction) {
27
27
  var options,
28
28
  response,
29
29
  _options$onErrorHandl,
@@ -44,7 +44,7 @@ export var fetchSSE = /*#__PURE__*/function () {
44
44
  case 0:
45
45
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
46
46
  _context.next = 3;
47
- return fetchFn();
47
+ return fetchFunction();
48
48
  case 3:
49
49
  response = _context.sent;
50
50
  if (response.ok) {
@@ -52,9 +52,9 @@ export var fetchSSE = /*#__PURE__*/function () {
52
52
  break;
53
53
  }
54
54
  chatMessageError = {
55
- type: 'chatbot',
56
55
  message: codeMessage[response.status],
57
- status: response.status
56
+ status: response.status,
57
+ type: 'chatbot'
58
58
  };
59
59
  (_options$onErrorHandl = options.onErrorHandle) === null || _options$onErrorHandl === void 0 ? void 0 : _options$onErrorHandl.call(options, chatMessageError);
60
60
  return _context.abrupt("return");
@@ -7,7 +7,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { Button } from 'antd';
8
8
  import { Maximize2, Minimize2 } from 'lucide-react';
9
9
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
10
- import { ActionIcon, TextArea } from "./..";
10
+ import ActionIcon from "../ActionIcon";
11
+ import { TextArea } from "../Input";
11
12
  import { useStyles } from "./style";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- container: import("antd-style").SerializedStyles;
3
- actionsBar: import("antd-style").SerializedStyles;
4
2
  actionLeft: import("antd-style").SerializedStyles;
3
+ actionsBar: import("antd-style").SerializedStyles;
5
4
  actionsRight: import("antd-style").SerializedStyles;
6
- textarea: import("antd-style").SerializedStyles;
5
+ container: import("antd-style").SerializedStyles;
7
6
  footerBar: import("antd-style").SerializedStyles;
7
+ textarea: import("antd-style").SerializedStyles;
8
8
  }>;
@@ -4,11 +4,11 @@ import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css;
6
6
  return {
7
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n height: 100%;\n padding: 12px 0 16px;\n "]))),
7
+ actionLeft: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n gap: 4px;\n align-items: center;\n justify-content: flex-start;\n "]))),
8
8
  actionsBar: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n align-items: center;\n justify-content: space-between;\n\n padding: 0 16px;\n "]))),
9
- actionLeft: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n gap: 4px;\n align-items: center;\n justify-content: flex-start;\n "]))),
10
- actionsRight: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex: 0;\n gap: 4px;\n align-items: center;\n justify-content: flex-end;\n "]))),
11
- textarea: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: 1;\n padding: 0 24px;\n "]))),
12
- footerBar: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n justify-content: flex-end;\n\n padding: 0 24px;\n "])))
9
+ actionsRight: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 0;\n gap: 4px;\n align-items: center;\n justify-content: flex-end;\n "]))),
10
+ container: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n height: 100%;\n padding: 12px 0 16px;\n "]))),
11
+ footerBar: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n justify-content: flex-end;\n\n padding: 0 24px;\n "]))),
12
+ textarea: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 1;\n padding: 0 24px;\n "])))
13
13
  };
14
14
  });
@@ -6,7 +6,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
  import { Alert } from 'antd';
7
7
  import { Loader2 } from 'lucide-react';
8
8
  import { memo } from 'react';
9
- import { Avatar, Icon, Markdown } from "./..";
9
+ import Avatar from "../Avatar";
10
+ import Icon from "../Icon";
11
+ import Markdown from "../Markdown";
10
12
  import { formatTime } from "../utils/formatTime";
11
13
  import { useStyles } from "./style";
12
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -29,21 +31,21 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
29
31
  alert = _ref.alert,
30
32
  showTitle = _ref.showTitle,
31
33
  time = _ref.time,
32
- props = _objectWithoutProperties(_ref, _excluded);
34
+ properties = _objectWithoutProperties(_ref, _excluded);
33
35
  var _useStyles = useStyles({
36
+ avatarSize: AVATAR_SIZE,
37
+ borderSpacing: borderSpacing,
34
38
  placement: placement,
35
- type: type,
36
- title: title,
37
39
  primary: primary,
38
- avatarSize: AVATAR_SIZE,
39
40
  showTitle: showTitle,
40
- borderSpacing: borderSpacing
41
+ title: title,
42
+ type: type
41
43
  }),
42
44
  cx = _useStyles.cx,
43
45
  styles = _useStyles.styles;
44
46
  return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
45
47
  className: cx(styles.container, className)
46
- }, props), {}, {
48
+ }, properties), {}, {
47
49
  children: [/*#__PURE__*/_jsxs("div", {
48
50
  className: styles.avatarContainer,
49
51
  children: [/*#__PURE__*/_jsx(Avatar, {
@@ -66,7 +68,7 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
66
68
  className: styles.messageContainer,
67
69
  children: [/*#__PURE__*/_jsxs("div", {
68
70
  className: cx(styles.name, 'chat-item-name'),
69
- children: [showTitle ? avatar.title || 'untitled' : null, time && /*#__PURE__*/_jsx("span", {
71
+ children: [showTitle ? avatar.title || 'untitled' : undefined, time && /*#__PURE__*/_jsx("span", {
70
72
  className: "chat-item-time",
71
73
  children: formatTime(time)
72
74
  })]
@@ -83,8 +85,8 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
83
85
  })]
84
86
  }), borderSpacing && /*#__PURE__*/_jsx("div", {
85
87
  style: {
86
- width: AVATAR_SIZE,
87
- flex: 'none'
88
+ flex: 'none',
89
+ width: AVATAR_SIZE
88
90
  }
89
91
  })]
90
92
  }));
@@ -7,11 +7,11 @@ export declare const useStyles: (props?: {
7
7
  title?: string | undefined;
8
8
  type?: "block" | "pure" | undefined;
9
9
  } | undefined) => import("antd-style").ReturnStyles<{
10
+ actions: string;
11
+ avatarContainer: import("antd-style").SerializedStyles;
10
12
  container: string;
11
13
  loading: import("antd-style").SerializedStyles;
12
- avatarContainer: import("antd-style").SerializedStyles;
14
+ message: string;
13
15
  messageContainer: import("antd-style").SerializedStyles;
14
16
  name: import("antd-style").SerializedStyles;
15
- message: string;
16
- actions: string;
17
17
  }>;
@@ -17,12 +17,12 @@ export var useStyles = createStyles(function (_ref, _ref2) {
17
17
  var pureContainerStylish = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n transition: background-color 100ms ", ";\n "])), token.motionEaseOut);
18
18
  var typeStylish = type === 'block' ? blockStylish : pureStylish;
19
19
  return {
20
- container: cx(type === 'pure' && pureContainerStylish, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px;\n\n .chat-item-time,\n .chat-item-actions {\n display: none;\n }\n\n &:hover {\n .chat-item-time {\n display: inline-block;\n }\n\n .chat-item-actions {\n display: flex;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse')),
21
- loading: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
22
- avatarContainer: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
23
- messageContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n\n .ant-alert-with-description {\n padding-block: 12px;\n padding-inline: 12px;\n }\n "]))),
24
- name: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n right: ", ";\n left: ", ";\n\n display: flex;\n flex-direction: ", ";\n gap: 4px;\n\n margin-bottom: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), showTitle ? 'relative' : 'absolute', showTitle ? 'unset' : '-16px', placement === 'right' ? '0' : 'unset', placement === 'left' ? '0' : 'unset', placement === 'left' ? 'row' : 'row-reverse', token.colorTextDescription, placement === 'left' ? 'left' : 'right'),
25
- message: cx(typeStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
26
- actions: cx(css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n align-items: flex-start;\n justify-content: ", ";\n "])), placement === 'left' ? 'flex-end' : 'flex-start'), type === 'block' && borderSpacing ? css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: ", ";\n bottom: 0;\n left: ", ";\n transform: translateX(", ");\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', placement === 'left' ? '100%' : '-100%') : css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n right: ", ";\n bottom: ", ";\n left: ", ";\n "])), placement === 'left' ? '0' : 'unset', type === 'block' ? '-40px' : '-32px', placement === 'right' ? '0' : 'unset'))
20
+ actions: cx(css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n align-items: flex-start;\n justify-content: ", ";\n "])), placement === 'left' ? 'flex-end' : 'flex-start'), type === 'block' && borderSpacing ? css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n right: ", ";\n bottom: 0;\n left: ", ";\n transform: translateX(", ");\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', placement === 'left' ? '100%' : '-100%') : css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n right: ", ";\n bottom: ", ";\n left: ", ";\n "])), placement === 'left' ? '0' : 'unset', type === 'block' ? '-40px' : '-32px', placement === 'right' ? '0' : 'unset')),
21
+ avatarContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
22
+ container: cx(type === 'pure' && pureContainerStylish, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px;\n\n .chat-item-time,\n .chat-item-actions {\n display: none;\n }\n\n &:hover {\n .chat-item-time {\n display: inline-block;\n }\n\n .chat-item-actions {\n display: flex;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse')),
23
+ loading: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
24
+ message: cx(typeStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
25
+ messageContainer: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n position: relative;\n\n .ant-alert-with-description {\n padding-block: 12px;\n padding-inline: 12px;\n }\n "]))),
26
+ name: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n right: ", ";\n left: ", ";\n\n display: flex;\n flex-direction: ", ";\n gap: 4px;\n\n margin-bottom: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), showTitle ? 'relative' : 'absolute', showTitle ? 'unset' : '-16px', placement === 'right' ? '0' : 'unset', placement === 'left' ? '0' : 'unset', placement === 'left' ? 'row' : 'row-reverse', token.colorTextDescription, placement === 'left' ? 'left' : 'right')
27
27
  };
28
28
  });
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { type ActionIconGroupProps } from "../index";
2
+ import { type ActionIconGroupProps } from "../ActionIconGroup";
3
3
  export interface ActionsBarProps extends ActionIconGroupProps {
4
4
  primary?: boolean;
5
5
  }
@@ -6,7 +6,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  import { Copy, Edit, RotateCw, Trash } from 'lucide-react';
8
8
  import { memo, useMemo } from 'react';
9
- import { ActionIconGroup, Icon } from "./..";
9
+ import ActionIconGroup from "../ActionIconGroup";
10
+ import Icon from "../Icon";
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  var ActionsBar = /*#__PURE__*/memo(function (_ref) {
12
13
  var primary = _ref.primary,
@@ -18,50 +19,50 @@ var ActionsBar = /*#__PURE__*/memo(function (_ref) {
18
19
  var groupItems = useMemo(function () {
19
20
  return [primary ? {
20
21
  icon: Edit,
21
- title: 'Edit',
22
22
  onClick: function onClick() {
23
23
  return console.log('click Edit');
24
- }
24
+ },
25
+ title: 'Edit'
25
26
  } : {
26
27
  icon: RotateCw,
27
- title: 'Regenerate',
28
28
  onClick: function onClick() {
29
29
  return console.log('click Regenerate');
30
- }
30
+ },
31
+ title: 'Regenerate'
31
32
  }].concat(_toConsumableArray(items)).filter(Boolean);
32
33
  }, [primary, items]);
33
34
  var groupDropdownMenu = useMemo(function () {
34
- return dropdownMenu.concat([{
35
- key: 'Edit',
35
+ return [].concat(_toConsumableArray(dropdownMenu), [{
36
36
  icon: /*#__PURE__*/_jsx(Icon, {
37
37
  icon: Edit,
38
38
  size: "small"
39
39
  }),
40
+ key: 'Edit',
40
41
  label: 'Edit'
41
42
  }, {
42
- key: 'Copy',
43
43
  icon: /*#__PURE__*/_jsx(Icon, {
44
44
  icon: Copy,
45
45
  size: "small"
46
46
  }),
47
+ key: 'Copy',
47
48
  label: 'Copy'
48
49
  }, {
49
- key: 'Regenerate',
50
50
  icon: /*#__PURE__*/_jsx(Icon, {
51
51
  icon: RotateCw,
52
52
  size: "small"
53
53
  }),
54
+ key: 'Regenerate',
54
55
  label: 'Regenerate'
55
56
  }, {
56
57
  type: 'divider'
57
58
  }, {
58
- key: 'Delete',
59
59
  icon: /*#__PURE__*/_jsx(Icon, {
60
60
  icon: Trash,
61
61
  size: "small"
62
62
  }),
63
+ key: 'Delete',
63
64
  label: 'Delete'
64
- }]).filter(Boolean);
65
+ }]);
65
66
  }, [primary, dropdownMenu]);
66
67
  return /*#__PURE__*/_jsx(ActionIconGroup, _objectSpread({
67
68
  dropdownMenu: groupDropdownMenu,
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ChatItemProps } from "../index";
2
+ import { ChatItemProps } from "../ChatItem";
3
3
  import type { DivProps } from "../types";
4
4
  import { ChatMessage } from "../types/chatMessage";
5
5
  export interface ChatListProps extends DivProps {
@@ -4,7 +4,7 @@ var _excluded = ["className", "data", "type", "showTitle"];
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
  import { memo } from 'react';
7
- import { ChatItem } from "./..";
7
+ import ChatItem from "../ChatItem";
8
8
  import ActionsBar from "./ActionsBar";
9
9
  import { useStyles } from "./style";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -14,21 +14,27 @@ var ScaleRow = /*#__PURE__*/memo(function (_ref) {
14
14
  var isAlpha = false;
15
15
  switch (title) {
16
16
  case 'lightA':
17
- style = {
18
- backgroundColor: '#fff',
19
- background: alphaBg.light
20
- };
21
- isAlpha = true;
22
- break;
17
+ {
18
+ style = {
19
+ background: alphaBg.light,
20
+ backgroundColor: '#fff'
21
+ };
22
+ isAlpha = true;
23
+ break;
24
+ }
23
25
  case 'darkA':
24
- style = {
25
- backgroundColor: '#000',
26
- background: alphaBg.dark
27
- };
28
- isAlpha = true;
29
- break;
26
+ {
27
+ style = {
28
+ background: alphaBg.dark,
29
+ backgroundColor: '#000'
30
+ };
31
+ isAlpha = true;
32
+ break;
33
+ }
30
34
  default:
31
- break;
35
+ {
36
+ break;
37
+ }
32
38
  }
33
39
  return /*#__PURE__*/_jsxs(Space, {
34
40
  size: 2,
@@ -39,7 +45,7 @@ var ScaleRow = /*#__PURE__*/memo(function (_ref) {
39
45
  children: title
40
46
  })
41
47
  }, title), scale.map(function (color, index) {
42
- if (index === 0 || index === 12) return null;
48
+ if (index === 0 || index === 12) return false;
43
49
  return /*#__PURE__*/_jsx("div", {
44
50
  className: styles.scaleBox,
45
51
  onClick: function onClick() {
@@ -23,8 +23,10 @@ var ColorScales = /*#__PURE__*/memo(function (_ref) {
23
23
  size: 2,
24
24
  children: [/*#__PURE__*/_jsx("div", {
25
25
  className: styles.scaleRowTitle
26
- }, "scale-num"), new Array(scale.light.length).fill('').map(function (_, index) {
27
- if (index === 0 || index === 12) return null;
26
+ }, "scale-num"), Array.from({
27
+ length: scale.light.length
28
+ }).fill('').map(function (_, index) {
29
+ if (index === 0 || index === 12) return false;
28
30
  var isMidHighlight = midHighLight === index;
29
31
  return /*#__PURE__*/_jsx("div", {
30
32
  className: styles.scaleBox,
@@ -33,8 +35,8 @@ var ColorScales = /*#__PURE__*/memo(function (_ref) {
33
35
  children: /*#__PURE__*/_jsx("div", {
34
36
  className: styles.scaleItem,
35
37
  style: {
36
- opacity: 0.5,
37
- fontWeight: isMidHighlight ? 700 : 400
38
+ fontWeight: isMidHighlight ? 700 : 400,
39
+ opacity: 0.5
38
40
  },
39
41
  children: index
40
42
  })
@@ -1,11 +1,11 @@
1
1
  export declare const alphaBg: {
2
- light: string;
3
2
  dark: string;
3
+ light: string;
4
4
  };
5
5
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
6
- view: import("antd-style").SerializedStyles;
7
6
  scaleBox: import("antd-style").SerializedStyles;
8
7
  scaleItem: import("antd-style").SerializedStyles;
9
8
  scaleRowTitle: import("antd-style").SerializedStyles;
10
9
  text: import("antd-style").SerializedStyles;
10
+ view: import("antd-style").SerializedStyles;
11
11
  }>;
@@ -2,16 +2,16 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLit
2
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
3
3
  import { createStyles } from 'antd-style';
4
4
  export var alphaBg = {
5
- light: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAFpJREFUWAntljEKADAIA23p6v//qQ+wfUEcCu1yriEgp0FHRJSJcnehmmWm1Dv/lO4HIg1AAAKjTqm03ea88zMCCEDgO4HV5bS757f+7wRoAAIQ4B9gByAAgQ3pfiDmXmAeEwAAAABJRU5ErkJggg==) 0% 0% / 26px',
6
- dark: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACPTkDJAAAAZUlEQVRIDe2VMQoAMAgDa9/g/1/oIzrpZBCh2dLFkkoDF0Fz99OdiOjks+2/7S8fRRmMMIVoRGSoYzvvqF8ZIMKlC1GhQBc6IkPzq32QmdAzkEGihpWOSPsAss8HegYySNSw0hE9WQ4StafZFqkAAAAASUVORK5CYII=) 0% 0% / 26px'
5
+ dark: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACPTkDJAAAAZUlEQVRIDe2VMQoAMAgDa9/g/1/oIzrpZBCh2dLFkkoDF0Fz99OdiOjks+2/7S8fRRmMMIVoRGSoYzvvqF8ZIMKlC1GhQBc6IkPzq32QmdAzkEGihpWOSPsAss8HegYySNSw0hE9WQ4StafZFqkAAAAASUVORK5CYII=) 0% 0% / 26px',
6
+ light: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAFpJREFUWAntljEKADAIA23p6v//qQ+wfUEcCu1yriEgp0FHRJSJcnehmmWm1Dv/lO4HIg1AAAKjTqm03ea88zMCCEDgO4HV5bS757f+7wRoAAIQ4B9gByAAgQ3pfiDmXmAeEwAAAABJRU5ErkJggg==) 0% 0% / 26px'
7
7
  };
8
8
  export var useStyles = createStyles(function (_ref) {
9
9
  var css = _ref.css;
10
10
  return {
11
- view: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n "]))),
12
- scaleBox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n\n &:active {\n transform: scale(0.95);\n }\n "]))),
13
- scaleItem: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
14
- scaleRowTitle: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
15
- text: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "])))
11
+ scaleBox: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n\n &:active {\n transform: scale(0.95);\n }\n "]))),
12
+ scaleItem: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
13
+ scaleRowTitle: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
14
+ text: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "]))),
15
+ view: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n "])))
16
16
  };
17
17
  });
@@ -11,22 +11,22 @@ import { useStyles } from "./style";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
13
  var KEYBOARD_ICON_MAP = {
14
- meta: /*#__PURE__*/_jsx(CommandIcon, {}),
15
- control: /*#__PURE__*/_jsx(ControlIcon, {}),
16
- shift: /*#__PURE__*/_jsx(ShiftIcon, {}),
17
14
  alt: /*#__PURE__*/_jsx(AltIcon, {}),
18
- enter: '↵'
15
+ control: /*#__PURE__*/_jsx(ControlIcon, {}),
16
+ enter: '↵',
17
+ meta: /*#__PURE__*/_jsx(CommandIcon, {}),
18
+ shift: /*#__PURE__*/_jsx(ShiftIcon, {})
19
19
  };
20
20
  var CODE_MAP = {
21
- meta: 'meta',
22
- command: 'meta',
21
+ alt: 'alt',
23
22
  cmd: 'meta',
24
- ctl: 'control',
23
+ command: 'meta',
25
24
  control: 'control',
26
- shift: 'shift',
27
- alt: 'alt'
25
+ ctl: 'control',
26
+ meta: 'meta',
27
+ shift: 'shift'
28
28
  };
29
- var MenuItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
29
+ var MenuItem = /*#__PURE__*/forwardRef(function (_ref, reference) {
30
30
  var _cx;
31
31
  var label = _ref.label,
32
32
  icon = _ref.icon,
@@ -35,16 +35,16 @@ var MenuItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
35
35
  shortcut = _ref.shortcut,
36
36
  active = _ref.active,
37
37
  selected = _ref.selected,
38
- props = _objectWithoutProperties(_ref, _excluded);
38
+ properties = _objectWithoutProperties(_ref, _excluded);
39
39
  var _useStyles = useStyles(),
40
40
  styles = _useStyles.styles,
41
41
  cx = _useStyles.cx;
42
42
  return /*#__PURE__*/_jsxs("button", _objectSpread(_objectSpread({
43
43
  type: 'button'
44
- }, props), {}, {
44
+ }, properties), {}, {
45
45
  className: cx(styles.item, (_cx = {}, _defineProperty(_cx, styles.selected, selected), _defineProperty(_cx, styles.active, active), _cx)),
46
46
  disabled: disabled,
47
- ref: ref,
47
+ ref: reference,
48
48
  role: "menuitem",
49
49
  children: [/*#__PURE__*/_jsxs(Flexbox, {
50
50
  gap: 8,
@@ -67,7 +67,7 @@ var MenuItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
67
67
  children: code ? KEYBOARD_ICON_MAP[code] : c.toUpperCase()
68
68
  }, c);
69
69
  })
70
- }) : null]
70
+ }) : undefined]
71
71
  }));
72
72
  });
73
73
  export default MenuItem;
@@ -1,7 +1,7 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- item: string;
3
- selected: string;
4
2
  active: string;
5
3
  arrow: import("antd-style").SerializedStyles;
4
+ item: string;
6
5
  kbd: import("antd-style").SerializedStyles;
6
+ selected: string;
7
7
  }>;
@@ -7,10 +7,10 @@ export var useStyles = createStyles(function (_ref, prefixCls) {
7
7
  token = _ref.token;
8
8
  var selected = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n background: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.colorPrimaryText, token.colorPrimaryBg, token.colorPrimaryTextHover, token.colorPrimaryBgHover);
9
9
  return {
10
- item: cx("".concat(prefixCls, "-item"), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n all: unset;\n\n user-select: none;\n scroll-margin: 50px;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n box-sizing: inherit;\n width: 100%;\n padding: 12px 10px;\n\n font-family: ", ";\n font-weight: normal;\n line-height: 1;\n color: ", ";\n\n background: transparent;\n border-radius: 5px;\n\n &:hover {\n background: ", ";\n }\n "])), token.fontFamily, token.colorText, token.colorFillTertiary)),
11
- selected: cx("".concat(prefixCls, "-item-selected"), selected),
12
- active: cx("".concat(prefixCls, "-item-active"), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorFillTertiary)),
13
- arrow: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextTertiary),
14
- kbd: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 18px;\n height: 20px;\n\n font-family: ", ";\n font-size: 14px;\n color: ", ";\n\n border-radius: 2px;\n "])), token.fontFamily, token.colorTextQuaternary)
10
+ active: cx("".concat(prefixCls, "-item-active"), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorFillTertiary)),
11
+ arrow: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextTertiary),
12
+ item: cx("".concat(prefixCls, "-item"), css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n all: unset;\n\n user-select: none;\n scroll-margin: 50px;\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n box-sizing: inherit;\n width: 100%;\n padding: 12px 10px;\n\n font-family: ", ";\n font-weight: normal;\n line-height: 1;\n color: ", ";\n\n background: transparent;\n border-radius: 5px;\n\n &:hover {\n background: ", ";\n }\n "])), token.fontFamily, token.colorText, token.colorFillTertiary)),
13
+ kbd: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 18px;\n height: 20px;\n\n font-family: ", ";\n font-size: 14px;\n color: ", ";\n\n border-radius: 2px;\n "])), token.fontFamily, token.colorTextQuaternary),
14
+ selected: cx("".concat(prefixCls, "-item-selected"), selected)
15
15
  };
16
16
  });