@lobehub/ui 1.16.0 → 1.16.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 (107) hide show
  1. package/es/ActionIcon/index.d.ts +15 -15
  2. package/es/ActionIcon/index.js +7 -5
  3. package/es/ActionIcon/style.d.ts +1 -1
  4. package/es/ActionIcon/style.js +5 -3
  5. package/es/Avatar/index.d.ts +9 -9
  6. package/es/Avatar/index.js +3 -3
  7. package/es/Chat/store/initialState.d.ts +12 -12
  8. package/es/Chat/store/messageReducer.d.ts +12 -12
  9. package/es/Chat/store/store.d.ts +12 -12
  10. package/es/Chat/store/store.js +11 -9
  11. package/es/Chat/types.d.ts +14 -14
  12. package/es/Chat/utils/fetch.d.ts +1 -1
  13. package/es/Chat/utils/fetch.js +3 -3
  14. package/es/ColorScales/ScaleRow.d.ts +1 -1
  15. package/es/ColorScales/ScaleRow.js +3 -3
  16. package/es/ColorScales/index.d.ts +1 -1
  17. package/es/ColorScales/index.js +8 -8
  18. package/es/ContextMenu/MenuItem/icons.js +23 -23
  19. package/es/ContextMenu/MenuItem/index.d.ts +4 -4
  20. package/es/ContextMenu/MenuItem/index.js +6 -5
  21. package/es/ContextMenu/index.d.ts +4 -4
  22. package/es/ContextMenu/index.js +11 -17
  23. package/es/ContextMenu/types/menuItem.d.ts +3 -3
  24. package/es/Conversation/App.d.ts +5 -5
  25. package/es/Conversation/App.js +5 -5
  26. package/es/Conversation/ChatList/MessageItem/Content.js +13 -13
  27. package/es/Conversation/ChatList/MessageItem/Toolbar.d.ts +3 -3
  28. package/es/Conversation/ChatList/MessageItem/Toolbar.js +20 -23
  29. package/es/Conversation/ChatList/MessageItem/index.js +15 -15
  30. package/es/Conversation/ChatList/index.d.ts +4 -4
  31. package/es/Conversation/ChatList/index.js +8 -6
  32. package/es/Conversation/InputArea/ActionBar.js +7 -7
  33. package/es/Conversation/InputArea/index.js +17 -17
  34. package/es/Conversation/StoreUpdater.d.ts +1 -1
  35. package/es/Conversation/index.js +4 -2
  36. package/es/CopyButton/index.d.ts +10 -10
  37. package/es/CopyButton/index.js +10 -8
  38. package/es/DraggablePanel/index.d.ts +45 -44
  39. package/es/DraggablePanel/index.js +11 -10
  40. package/es/EditableMessage/index.d.ts +23 -23
  41. package/es/EditableMessage/index.js +15 -15
  42. package/es/EditableMessageList/index.d.ts +5 -5
  43. package/es/EditableMessageList/index.js +16 -16
  44. package/es/EditableText/index.js +9 -9
  45. package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +1 -1
  46. package/es/Highlighter/SyntaxHighlighter/Prism.js +4 -2
  47. package/es/Highlighter/SyntaxHighlighter/index.js +8 -8
  48. package/es/Highlighter/SyntaxHighlighter/style.d.ts +1 -1
  49. package/es/Highlighter/SyntaxHighlighter/style.js +3 -2
  50. package/es/Highlighter/index.d.ts +5 -5
  51. package/es/Highlighter/index.js +5 -5
  52. package/es/Icon/index.d.ts +6 -6
  53. package/es/Icon/index.js +3 -1
  54. package/es/Input/index.js +7 -5
  55. package/es/List/ListItem/index.d.ts +21 -21
  56. package/es/List/ListItem/index.js +13 -11
  57. package/es/List/ListItem/time.js +1 -1
  58. package/es/Logo/Divider.js +4 -2
  59. package/es/Logo/Logo3D.js +3 -1
  60. package/es/Logo/LogoFlat.js +46 -44
  61. package/es/Logo/LogoHighContrast.js +7 -5
  62. package/es/Logo/LogoText.js +6 -4
  63. package/es/Logo/index.d.ts +5 -5
  64. package/es/Logo/index.js +3 -1
  65. package/es/Markdown/Code.js +1 -1
  66. package/es/Markdown/CodeBlock.js +4 -4
  67. package/es/MessageInput/index.d.ts +10 -10
  68. package/es/MessageInput/index.js +12 -10
  69. package/es/MessageModal/index.d.ts +11 -11
  70. package/es/MessageModal/index.js +15 -15
  71. package/es/SearchBar/index.d.ts +5 -5
  72. package/es/SearchBar/index.js +19 -17
  73. package/es/SideNav/index.d.ts +5 -5
  74. package/es/SideNav/index.js +9 -7
  75. package/es/Snippet/index.d.ts +5 -5
  76. package/es/Snippet/index.js +5 -3
  77. package/es/StroyBook/index.d.ts +2 -2
  78. package/es/StroyBook/index.js +7 -5
  79. package/es/StroyBook/style.d.ts +1 -1
  80. package/es/Swatches/index.d.ts +4 -4
  81. package/es/Swatches/index.js +7 -7
  82. package/es/TabsNav/index.d.ts +6 -6
  83. package/es/TabsNav/index.js +3 -1
  84. package/es/ThemeProvider/GlobalStyle.js +5 -2
  85. package/es/ThemeProvider/index.d.ts +6 -6
  86. package/es/ThemeProvider/index.js +3 -3
  87. package/es/ThemeSwitch/index.d.ts +5 -5
  88. package/es/ThemeSwitch/index.js +11 -9
  89. package/es/Tooltip/index.js +5 -3
  90. package/es/components/ControlInput.d.ts +1 -1
  91. package/es/components/ControlInput.js +20 -18
  92. package/es/hooks/useHighlight.d.ts +8 -8
  93. package/es/hooks/useHighlight.js +4 -4
  94. package/es/styles/algorithms/generateColorPalette.d.ts +4 -4
  95. package/es/styles/algorithms/generateCustomStylish.d.ts +1 -1
  96. package/es/styles/algorithms/generateCustomStylish.js +1 -1
  97. package/es/styles/algorithms/generateCustomToken.d.ts +1 -1
  98. package/es/styles/algorithms/generateCustomToken.js +3 -2
  99. package/es/styles/algorithms/generateTheme.js +3 -1
  100. package/es/styles/colors.d.ts +13 -13
  101. package/es/styles/colors.js +1 -1
  102. package/es/styles/theme/dark.js +3 -1
  103. package/es/styles/theme/light.js +3 -1
  104. package/es/types/customStylish.d.ts +4 -4
  105. package/es/types/customToken.d.ts +5 -5
  106. package/es/types/global.d.ts +2 -0
  107. package/package.json +71 -68
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import { LucideIcon } from 'lucide-react';
2
3
  import { TooltipProps } from "../index";
3
4
  import { DivProps } from "../types";
4
- import { LucideIcon } from 'lucide-react';
5
5
  export declare type ActionIconSize = 'large' | 'normal' | 'small' | 'site' | {
6
6
  blockSize?: number;
7
+ borderRadius?: number;
7
8
  fontSize?: number;
8
9
  strokeWidth?: number;
9
- borderRadius?: number;
10
10
  };
11
11
  export interface ActionIconProps extends DivProps {
12
12
  /**
@@ -15,24 +15,20 @@ export interface ActionIconProps extends DivProps {
15
15
  */
16
16
  active?: boolean;
17
17
  /**
18
- * @description Size of the icon
19
- * @default 'normal'
20
- */
21
- size?: ActionIconSize;
22
- /**
23
- * @description The icon element to be rendered
24
- * @type LucideIcon
18
+ * @description Change arrow's visible state and change whether the arrow is pointed at the center of target.
19
+ * @default false
25
20
  */
26
- icon: LucideIcon;
21
+ arrow?: boolean;
27
22
  /**
28
23
  * @description Glass blur style
29
24
  * @default 'false'
30
25
  */
31
26
  glass?: boolean;
32
27
  /**
33
- * @description The text shown in the tooltip
28
+ * @description The icon element to be rendered
29
+ * @type LucideIcon
34
30
  */
35
- title?: string;
31
+ icon: LucideIcon;
36
32
  /**
37
33
  * @description The position of the tooltip relative to the target
38
34
  * @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
@@ -40,10 +36,14 @@ export interface ActionIconProps extends DivProps {
40
36
  */
41
37
  placement?: TooltipProps['placement'];
42
38
  /**
43
- * @description Change arrow's visible state and change whether the arrow is pointed at the center of target.
44
- * @default false
39
+ * @description Size of the icon
40
+ * @default 'normal'
45
41
  */
46
- arrow?: boolean;
42
+ size?: ActionIconSize;
43
+ /**
44
+ * @description The text shown in the tooltip
45
+ */
46
+ title?: string;
47
47
  }
48
48
  declare const ActionIcon: import("react").NamedExoticComponent<ActionIconProps>;
49
49
  export default ActionIcon;
@@ -1,8 +1,10 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  var _excluded = ["className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow"];
4
- import { Icon, Tooltip } from "./..";
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
+ 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; }
5
6
  import { memo } from 'react';
7
+ import { Icon, Tooltip } from "./..";
6
8
  import { useStyles } from "./style";
7
9
  import { jsx as _jsx } from "react/jsx-runtime";
8
10
  var ActionIcon = /*#__PURE__*/memo(function (_ref) {
@@ -57,15 +59,15 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
57
59
  }, style)
58
60
  }, props), {}, {
59
61
  children: /*#__PURE__*/_jsx(Icon, {
60
- size: size === 'site' ? 'normal' : size,
61
- icon: icon
62
+ icon: icon,
63
+ size: size === 'site' ? 'normal' : size
62
64
  })
63
65
  }));
64
66
  if (!title) return actionIconBlock;
65
67
  return /*#__PURE__*/_jsx(Tooltip, {
66
68
  arrow: arrow,
67
- title: title,
68
69
  placement: placement,
70
+ title: title,
69
71
  children: actionIconBlock
70
72
  });
71
73
  });
@@ -2,5 +2,5 @@ export declare const useStyles: (props?: {
2
2
  active: boolean;
3
3
  glass: boolean;
4
4
  } | undefined) => import("antd-style").ReturnStyles<{
5
- block: import("antd-style").SerializedStyles;
5
+ block: string;
6
6
  }>;
@@ -1,12 +1,14 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
2
+ var _templateObject;
3
3
  import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref, _ref2) {
5
5
  var css = _ref.css,
6
- token = _ref.token;
6
+ token = _ref.token,
7
+ stylish = _ref.stylish,
8
+ cx = _ref.cx;
7
9
  var active = _ref2.active,
8
10
  glass = _ref2.glass;
9
11
  return {
10
- block: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ",\n background-color 100ms ", ";\n\n ", "\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, glass && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))), token.colorText, token.colorFillSecondary, token.colorText, token.colorFill)
12
+ block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
11
13
  };
12
14
  });
@@ -5,23 +5,23 @@ export interface AvatarProps {
5
5
  */
6
6
  avatar?: string;
7
7
  /**
8
- * @description The title text to display if avatar is not provided
9
- */
10
- title?: string;
11
- /**
12
- * @description The size of the avatar in pixels
13
- * @default 40
8
+ * @description The background color of the avatar
14
9
  */
15
- size?: number;
10
+ background?: string;
16
11
  /**
17
12
  * @description The shape of the avatar
18
13
  * @default 'circle'
19
14
  */
20
15
  shape?: 'circle' | 'square';
21
16
  /**
22
- * @description The background color of the avatar
17
+ * @description The size of the avatar in pixels
18
+ * @default 40
23
19
  */
24
- background?: string;
20
+ size?: number;
21
+ /**
22
+ * @description The title text to display if avatar is not provided
23
+ */
24
+ title?: string;
25
25
  }
26
26
  declare const Avatar: FC<AvatarProps>;
27
27
  export default Avatar;
@@ -18,6 +18,7 @@ var Avatar = function Avatar(_ref) {
18
18
  return avatar.startsWith(i);
19
19
  });
20
20
  return /*#__PURE__*/_jsx(Center, {
21
+ className: styles.container,
21
22
  style: {
22
23
  width: size,
23
24
  height: size,
@@ -25,16 +26,15 @@ var Avatar = function Avatar(_ref) {
25
26
  backgroundColor: backgroundColor,
26
27
  borderWidth: isImage ? 1 : 0
27
28
  },
28
- className: styles.container,
29
29
  children: !avatar ? /*#__PURE__*/_jsx(A, {
30
30
  shape: shape,
31
31
  size: size,
32
32
  children: title === null || title === void 0 ? void 0 : title.slice(0, 2)
33
33
  }) : isImage ? /*#__PURE__*/_jsx(A, {
34
+ className: styles.border,
34
35
  shape: shape,
35
36
  size: size,
36
- src: avatar,
37
- className: styles.border
37
+ src: avatar
38
38
  }) : /*#__PURE__*/_jsx(Center, {
39
39
  className: styles.border,
40
40
  style: {
@@ -1,15 +1,5 @@
1
1
  import { ChatMessage, InternalChatContext, OpenAIRequestParams } from '../types';
2
2
  export interface ChatState extends InternalChatContext {
3
- /**
4
- * @title 消息
5
- * @type {string}
6
- */
7
- message: string;
8
- /**
9
- * @title 加载状态
10
- * @type {boolean}
11
- */
12
- loading: boolean;
13
3
  /**
14
4
  * @title 改变系统角色状态
15
5
  * @type {boolean}
@@ -19,10 +9,20 @@ export interface ChatState extends InternalChatContext {
19
9
  * 编辑中的消息 id
20
10
  */
21
11
  editingMessageId?: number | null;
12
+ /**
13
+ * @title 加载状态
14
+ * @type {boolean}
15
+ */
16
+ loading: boolean;
17
+ /**
18
+ * @title 消息
19
+ * @type {string}
20
+ */
21
+ message: string;
22
+ onAgentChange?: (agent: any, type: 'update' | 'remove') => void;
22
23
  onMessagesChange?: (messages: ChatMessage[]) => void;
23
- onResponseStart?: (messages: ChatMessage[]) => Promise<void>;
24
24
  onResponseFinished?: (session: any) => void;
25
- onAgentChange?: (agent: any, type: 'update' | 'remove') => void;
25
+ onResponseStart?: (messages: ChatMessage[]) => Promise<void>;
26
26
  request?: (params: OpenAIRequestParams) => Promise<Response>;
27
27
  }
28
28
  export declare const initialState: ChatState;
@@ -1,37 +1,37 @@
1
1
  import { ChatMessage, ChatMessageError, MessageRoleType } from '../types';
2
2
  export declare type MessageDispatch = {
3
- type: 'addMessage';
4
3
  message: ChatMessage;
4
+ type: 'addMessage';
5
5
  } | {
6
- type: 'insertMessage';
7
- message: ChatMessage;
8
6
  index: number;
7
+ message: ChatMessage;
8
+ type: 'insertMessage';
9
9
  } | {
10
- type: 'deleteMessage';
11
10
  index: number;
11
+ type: 'deleteMessage';
12
12
  } | {
13
13
  type: 'resetMessages';
14
14
  } | {
15
- type: 'updateMessage';
16
15
  index: number;
17
16
  message: string;
17
+ type: 'updateMessage';
18
18
  } | {
19
- type: 'updateMessageRole';
20
19
  index: number;
21
20
  role: MessageRoleType;
21
+ type: 'updateMessageRole';
22
22
  } | {
23
- type: 'addUserMessage';
24
23
  message: string;
24
+ type: 'addUserMessage';
25
25
  } | {
26
- type: 'updateLatestBotMessage';
27
26
  responseStream: string[];
27
+ type: 'updateLatestBotMessage';
28
28
  } | {
29
- type: 'updateMessageChoice';
30
- message: string;
31
29
  index: number;
30
+ message: string;
31
+ type: 'updateMessageChoice';
32
32
  } | {
33
- type: 'setErrorMessage';
34
- index: number;
35
33
  error: ChatMessageError | undefined;
34
+ index: number;
35
+ type: 'setErrorMessage';
36
36
  };
37
37
  export declare const messagesReducer: (state: ChatMessage[], payload: MessageDispatch) => ChatMessage[];
@@ -4,30 +4,30 @@ import { FetchSSEOptions } from '../utils/fetch';
4
4
  import { ChatState } from './initialState';
5
5
  import { MessageDispatch } from './messageReducer';
6
6
  interface ChatAction {
7
- /**
8
- * @title 发送消息
9
- * @returns Promise<void>
10
- */
11
- sendMessage: () => Promise<void>;
12
- /**
13
- * @title 重发消息
14
- * @param index - 消息索引
15
- * @returns Promise<void>
16
- */
17
- resendMessage: (index: number) => Promise<void>;
18
- generateMessage: (message: string, messages: ChatMessage[], options: FetchSSEOptions) => Promise<void>;
19
7
  /**
20
8
  * @title 派发消息
21
9
  * @param payload - 消息分发
22
10
  * @returns void
23
11
  */
24
12
  dispatchMessage: (payload: MessageDispatch) => void;
13
+ generateMessage: (message: string, messages: ChatMessage[], options: FetchSSEOptions) => Promise<void>;
25
14
  /**
26
15
  * @title 处理消息编辑
27
16
  * @param index - 消息索引或空
28
17
  * @returns void
29
18
  */
30
19
  handleMessageEditing: (index?: number | null) => void;
20
+ /**
21
+ * @title 重发消息
22
+ * @param index - 消息索引
23
+ * @returns Promise<void>
24
+ */
25
+ resendMessage: (index: number) => Promise<void>;
26
+ /**
27
+ * @title 发送消息
28
+ * @returns Promise<void>
29
+ */
30
+ sendMessage: () => Promise<void>;
31
31
  }
32
32
  export declare type ChatStore = ChatAction & ChatState;
33
33
  export declare const createStore: StateCreator<ChatStore, [['zustand/devtools', never]]>;
@@ -1,11 +1,13 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
- import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
5
  var _excluded = ["type"];
7
- import { fetchSSE } from "../utils/fetch";
6
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
+ 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; }
8
+ 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; }
8
9
  import { LOADING_FLAT } from "../const";
10
+ import { fetchSSE } from "../utils/fetch";
9
11
  import { initialState } from "./initialState";
10
12
  import { messagesReducer } from "./messageReducer";
11
13
  export var createStore = function createStore(set, get) {
@@ -29,9 +31,9 @@ export var createStore = function createStore(set, get) {
29
31
  });
30
32
  },
31
33
  generateMessage: function () {
32
- var _generateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(message, messages, options) {
34
+ var _generateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(message, messages, options) {
33
35
  var _get2, onResponseStart, request, onResponseFinished, fetcher;
34
- return _regeneratorRuntime().wrap(function _callee$(_context) {
36
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
35
37
  while (1) switch (_context.prev = _context.next) {
36
38
  case 0:
37
39
  _get2 = get(), onResponseStart = _get2.onResponseStart, request = _get2.request, onResponseFinished = _get2.onResponseFinished;
@@ -73,9 +75,9 @@ export var createStore = function createStore(set, get) {
73
75
  return generateMessage;
74
76
  }(),
75
77
  sendMessage: function () {
76
- var _sendMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
78
+ var _sendMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
77
79
  var _get3, message, dispatchMessage, generateMessage, messages, currentResponse;
78
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
80
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
79
81
  while (1) switch (_context2.prev = _context2.next) {
80
82
  case 0:
81
83
  _get3 = get(), message = _get3.message, dispatchMessage = _get3.dispatchMessage, generateMessage = _get3.generateMessage, messages = _get3.messages;
@@ -138,10 +140,10 @@ export var createStore = function createStore(set, get) {
138
140
  return sendMessage;
139
141
  }(),
140
142
  resendMessage: function () {
141
- var _resendMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(index) {
143
+ var _resendMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(index) {
142
144
  var _contextMessages$at;
143
145
  var _get4, dispatchMessage, sendMessage, generateMessage, messages, lastMessage, contextMessages, userMessage, targetMsg, botPrevMsg, currentResponse;
144
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
146
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
145
147
  while (1) switch (_context3.prev = _context3.next) {
146
148
  case 0:
147
149
  _get4 = get(), dispatchMessage = _get4.dispatchMessage, sendMessage = _get4.sendMessage, generateMessage = _get4.generateMessage, messages = _get4.messages;
@@ -25,44 +25,44 @@ export interface ChatMessageError {
25
25
  */
26
26
  export interface ChatMessage {
27
27
  /**
28
- * @title 角色
29
- * @description 消息发送者的角色
30
- * @enum {MessageRoleType} ChatGPTAgent
28
+ * 其余生成项
31
29
  */
32
- role: MessageRoleType;
30
+ choices?: string[];
33
31
  /**
34
32
  * @title 内容
35
33
  * @description 消息内容
36
34
  */
37
35
  content: string;
38
- /**
39
- * 其余生成项
40
- */
41
- choices?: string[];
42
36
  /**
43
37
  * 如果存在错误消息
44
38
  */
45
39
  error?: ChatMessageError;
46
- }
47
- export interface ChatContext {
48
- id: string;
49
40
  /**
50
- * @title 会话标题
41
+ * @title 角色
42
+ * @description 消息发送者的角色
43
+ * @enum {MessageRoleType} ChatGPTAgent
51
44
  */
52
- title?: string;
45
+ role: MessageRoleType;
46
+ }
47
+ export interface ChatContext {
48
+ createAt: number;
53
49
  /**
54
50
  * @title 会话描述
55
51
  * @description 用户设置的会话描述
56
52
  * @type {string}
57
53
  */
58
54
  description?: string;
55
+ id: string;
59
56
  /**
60
57
  * @title 消息列表
61
58
  * @description 聊天室中的所有消息
62
59
  * @type {ChatMessage[]}
63
60
  */
64
61
  messages: ChatMessage[];
65
- createAt: number;
62
+ /**
63
+ * @title 会话标题
64
+ */
65
+ title?: string;
66
66
  updateAt: number;
67
67
  }
68
68
  export declare type ChatContextMap = Record<string, Omit<ChatContext, 'systemRole'>>;
@@ -1,7 +1,7 @@
1
1
  import { ChatMessageError } from '../types';
2
2
  export interface FetchSSEOptions {
3
- onMessageHandle?: (text: string) => void;
4
3
  onErrorHandle?: (error: ChatMessageError) => void;
4
+ onMessageHandle?: (text: string) => void;
5
5
  }
6
6
  /**
7
7
  * 使用流式方法获取数据
@@ -1,5 +1,5 @@
1
- import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  var codeMessage = {
4
4
  200: '成功获取数据,服务已响应',
5
5
  201: '操作成功,数据已保存',
@@ -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(fetchFn) {
27
27
  var options,
28
28
  response,
29
29
  _options$onErrorHandl,
@@ -39,7 +39,7 @@ export var fetchSSE = /*#__PURE__*/function () {
39
39
  doneReading,
40
40
  chunkValue,
41
41
  _args = arguments;
42
- return _regeneratorRuntime().wrap(function _callee$(_context) {
42
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
43
43
  while (1) switch (_context.prev = _context.next) {
44
44
  case 0:
45
45
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  export interface IScaleRow {
3
3
  name: string;
4
- title: 'light' | 'lightA' | 'dark' | 'darkA';
5
4
  scale: string[];
5
+ title: 'light' | 'lightA' | 'dark' | 'darkA';
6
6
  }
7
7
  declare const ScaleRow: import("react").NamedExoticComponent<IScaleRow>;
8
8
  export default ScaleRow;
@@ -1,4 +1,4 @@
1
- import { Space, message } from 'antd';
1
+ import { message, Space } from 'antd';
2
2
  import copy from 'copy-to-clipboard';
3
3
  import { memo } from 'react';
4
4
  import { alphaBg, useStyles } from "./style";
@@ -42,13 +42,13 @@ var ScaleRow = /*#__PURE__*/memo(function (_ref) {
42
42
  if (index === 0 || index === 12) return null;
43
43
  return /*#__PURE__*/_jsx("div", {
44
44
  className: styles.scaleBox,
45
- title: color,
46
- style: style,
47
45
  onClick: function onClick() {
48
46
  var content = "token.".concat(name).concat(index).concat(isAlpha ? 'A' : '', " /* ").concat(color, " */");
49
47
  copy(content);
50
48
  message.success(content);
51
49
  },
50
+ style: style,
51
+ title: color,
52
52
  children: /*#__PURE__*/_jsx("div", {
53
53
  className: styles.scaleItem,
54
54
  style: {
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ColorScaleItem } from "../styles/colors";
3
3
  export interface ColorScalesProps {
4
+ midHighLight: number;
4
5
  name: string;
5
6
  scale: ColorScaleItem;
6
- midHighLight: number;
7
7
  }
8
8
  declare const ColorScales: import("react").NamedExoticComponent<ColorScalesProps>;
9
9
  export default ColorScales;
@@ -43,20 +43,20 @@ var ColorScales = /*#__PURE__*/memo(function (_ref) {
43
43
  })]
44
44
  }, "scale-title"), /*#__PURE__*/_jsx(ScaleRow, {
45
45
  name: name,
46
- title: "light",
47
- scale: scale.light
46
+ scale: scale.light,
47
+ title: "light"
48
48
  }, "light"), /*#__PURE__*/_jsx(ScaleRow, {
49
49
  name: name,
50
- title: "lightA",
51
- scale: scale.lightA
50
+ scale: scale.lightA,
51
+ title: "lightA"
52
52
  }, "lightA"), /*#__PURE__*/_jsx(ScaleRow, {
53
53
  name: name,
54
- title: "dark",
55
- scale: scale.dark
54
+ scale: scale.dark,
55
+ title: "dark"
56
56
  }, "dark"), /*#__PURE__*/_jsx(ScaleRow, {
57
57
  name: name,
58
- title: "darkA",
59
- scale: scale.darkA
58
+ scale: scale.darkA,
59
+ title: "darkA"
60
60
  }, "darkA")]
61
61
  })
62
62
  })
@@ -4,15 +4,15 @@ var strokeWidth = 2.2;
4
4
  var iconSize = '13px';
5
5
  export var CommandIcon = function CommandIcon() {
6
6
  return /*#__PURE__*/_jsx("svg", {
7
- xmlns: "http://www.w3.org/2000/svg",
8
- width: iconSize,
9
- height: iconSize,
10
- viewBox: "0 0 24 24",
11
7
  fill: "none",
8
+ height: iconSize,
12
9
  stroke: "currentColor",
13
- strokeWidth: strokeWidth,
14
10
  strokeLinecap: "round",
15
11
  strokeLinejoin: "round",
12
+ strokeWidth: strokeWidth,
13
+ viewBox: "0 0 24 24",
14
+ width: iconSize,
15
+ xmlns: "http://www.w3.org/2000/svg",
16
16
  children: /*#__PURE__*/_jsx("path", {
17
17
  d: "M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"
18
18
  })
@@ -20,16 +20,16 @@ export var CommandIcon = function CommandIcon() {
20
20
  };
21
21
  export var ControlIcon = function ControlIcon() {
22
22
  return /*#__PURE__*/_jsx("svg", {
23
- xmlns: "http://www.w3.org/2000/svg",
24
- width: iconSize,
25
- height: iconSize,
26
- viewBox: "0 0 24 24",
23
+ className: "lucide lucide-chevron-up",
27
24
  fill: "none",
25
+ height: iconSize,
28
26
  stroke: "currentColor",
29
- strokeWidth: strokeWidth,
30
27
  strokeLinecap: "round",
31
28
  strokeLinejoin: "round",
32
- className: "lucide lucide-chevron-up",
29
+ strokeWidth: strokeWidth,
30
+ viewBox: "0 0 24 24",
31
+ width: iconSize,
32
+ xmlns: "http://www.w3.org/2000/svg",
33
33
  children: /*#__PURE__*/_jsx("polyline", {
34
34
  points: "18 15 12 9 6 15"
35
35
  })
@@ -37,16 +37,16 @@ export var ControlIcon = function ControlIcon() {
37
37
  };
38
38
  export var ShiftIcon = function ShiftIcon() {
39
39
  return /*#__PURE__*/_jsx("svg", {
40
- xmlns: "http://www.w3.org/2000/svg",
41
- width: iconSize,
42
- height: iconSize,
43
- viewBox: "0 0 24 24",
40
+ className: "lucide lucide-chevron-up",
44
41
  fill: "none",
42
+ height: iconSize,
45
43
  stroke: "currentColor",
46
- strokeWidth: strokeWidth,
47
44
  strokeLinecap: "round",
48
45
  strokeLinejoin: "round",
49
- className: "lucide lucide-chevron-up",
46
+ strokeWidth: strokeWidth,
47
+ viewBox: "0 0 24 24",
48
+ width: iconSize,
49
+ xmlns: "http://www.w3.org/2000/svg",
50
50
  children: /*#__PURE__*/_jsx("path", {
51
51
  d: "M9 18v-6H5l7-7 7 7h-4v6H9z"
52
52
  })
@@ -54,16 +54,16 @@ export var ShiftIcon = function ShiftIcon() {
54
54
  };
55
55
  export var AltIcon = function AltIcon() {
56
56
  return /*#__PURE__*/_jsxs("svg", {
57
- xmlns: "http://www.w3.org/2000/svg",
58
- width: iconSize,
59
- height: iconSize,
60
- viewBox: "0 0 24 24",
57
+ className: "lucide lucide-chevron-up",
61
58
  fill: "none",
59
+ height: iconSize,
62
60
  stroke: "currentColor",
63
- strokeWidth: strokeWidth,
64
61
  strokeLinecap: "round",
65
62
  strokeLinejoin: "round",
66
- className: "lucide lucide-chevron-up",
63
+ strokeWidth: strokeWidth,
64
+ viewBox: "0 0 24 24",
65
+ width: iconSize,
66
+ xmlns: "http://www.w3.org/2000/svg",
67
67
  children: [/*#__PURE__*/_jsx("path", {
68
68
  d: "M3 3h6l6 18h6"
69
69
  }), /*#__PURE__*/_jsx("path", {
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  interface MenuItemProps {
3
- label: ReactNode;
4
- disabled?: boolean;
5
3
  active?: boolean;
6
- selected?: boolean;
7
- nested?: boolean;
4
+ disabled?: boolean;
8
5
  icon?: ReactNode;
6
+ label: ReactNode;
7
+ nested?: boolean;
8
+ selected?: boolean;
9
9
  shortcut?: string[];
10
10
  }
11
11
  declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLButtonElement>>;