@lobehub/ui 1.157.1 → 1.158.0

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 (157) hide show
  1. package/es/A/index.js +2 -2
  2. package/es/ActionIcon/index.js +11 -15
  3. package/es/ActionIconGroup/index.js +45 -47
  4. package/es/Alert/index.js +43 -50
  5. package/es/Avatar/index.js +10 -12
  6. package/es/Burger/index.js +30 -35
  7. package/es/CodeEditor/index.js +38 -41
  8. package/es/Collapse/index.js +3 -3
  9. package/es/ColorScales/ScaleRow.js +39 -43
  10. package/es/ColorScales/index.js +57 -59
  11. package/es/ConfigProvider/index.js +3 -5
  12. package/es/ContextMenu/index.js +2 -3
  13. package/es/CopyButton/index.js +3 -4
  14. package/es/DraggablePanel/components/DraggablePanelBody.js +2 -3
  15. package/es/DraggablePanel/components/DraggablePanelContainer.js +2 -3
  16. package/es/DraggablePanel/components/DraggablePanelFooter.js +2 -3
  17. package/es/DraggablePanel/components/DraggablePanelHeader.js +5 -9
  18. package/es/DraggablePanel/index.js +28 -35
  19. package/es/EditableText/index.js +13 -16
  20. package/es/EmojiPicker/AvatarUploader.js +60 -71
  21. package/es/EmojiPicker/index.js +101 -110
  22. package/es/EmptyCard/index.js +23 -31
  23. package/es/FileTypeIcon/index.js +44 -55
  24. package/es/FluentEmoji/index.js +4 -6
  25. package/es/Footer/index.js +8 -10
  26. package/es/Form/components/FormDivider.js +2 -2
  27. package/es/Form/components/FormFlatGroup.js +4 -9
  28. package/es/Form/components/FormFooter.js +3 -6
  29. package/es/Form/components/FormGroup.js +15 -21
  30. package/es/Form/components/FormItem.js +10 -17
  31. package/es/Form/components/FormTitle.js +15 -23
  32. package/es/Form/index.js +26 -30
  33. package/es/FormModal/index.js +30 -34
  34. package/es/Grid/index.js +3 -6
  35. package/es/Header/index.js +49 -65
  36. package/es/Highlighter/FullFeatured.js +41 -51
  37. package/es/Highlighter/SyntaxHighlighter/index.js +19 -30
  38. package/es/Highlighter/index.js +19 -29
  39. package/es/Icon/icons/DiscordIcon.js +2 -3
  40. package/es/Icon/index.js +13 -16
  41. package/es/Image/ImageGallery.js +3 -5
  42. package/es/Image/Preview.js +5 -6
  43. package/es/Image/index.js +34 -38
  44. package/es/Image/usePreview.js +33 -37
  45. package/es/Img/index.js +2 -2
  46. package/es/Input/index.js +3 -3
  47. package/es/Layout/index.js +35 -63
  48. package/es/List/ListItem/index.js +53 -67
  49. package/es/Markdown/CodeBlock.js +10 -16
  50. package/es/Markdown/Typography.js +3 -6
  51. package/es/Markdown/index.js +18 -22
  52. package/es/MaterialFileTypeIcon/index.js +17 -20
  53. package/es/MaterialFileTypeIcon/utils.d.ts +2 -2
  54. package/es/Mermaid/FullFeatured.js +35 -45
  55. package/es/Mermaid/index.js +17 -26
  56. package/es/Mermaid/useMermaid.d.ts +2 -1
  57. package/es/Mermaid/useMermaid.js +3 -5
  58. package/es/Modal/index.js +48 -60
  59. package/es/SearchBar/index.js +48 -52
  60. package/es/SelectWithImg/index.js +34 -40
  61. package/es/SideNav/index.js +15 -22
  62. package/es/SliderWithInput/index.js +35 -38
  63. package/es/Snippet/index.js +10 -15
  64. package/es/SortableList/DragHandle.js +3 -3
  65. package/es/SortableList/SortableItem.js +16 -19
  66. package/es/SortableList/SortableOverlay.js +3 -5
  67. package/es/SortableList/index.js +15 -23
  68. package/es/Swatches/index.js +18 -20
  69. package/es/TabsNav/index.js +2 -3
  70. package/es/Tag/index.js +7 -12
  71. package/es/ThemeProvider/Meta.js +53 -58
  72. package/es/ThemeProvider/index.js +17 -23
  73. package/es/ThemeSwitch/index.js +15 -19
  74. package/es/Toc/TocMobile.js +47 -52
  75. package/es/Toc/index.js +8 -13
  76. package/es/Tooltip/index.js +2 -3
  77. package/es/Video/index.js +41 -47
  78. package/es/awesome/AuroraBackground/index.js +11 -18
  79. package/es/awesome/Features/Item.js +37 -45
  80. package/es/awesome/Features/index.js +5 -4
  81. package/es/awesome/GaussianBackground/index.js +8 -13
  82. package/es/awesome/GaussianBackground/useGaussianBackground.d.ts +1 -1
  83. package/es/awesome/GaussianBackground/useGaussianBackground.js +1 -1
  84. package/es/awesome/Giscus/index.js +13 -15
  85. package/es/awesome/GradientButton/index.js +5 -9
  86. package/es/awesome/GridBackground/Grid.js +49 -61
  87. package/es/awesome/GridBackground/GridShowcase.js +24 -28
  88. package/es/awesome/GridBackground/index.js +27 -33
  89. package/es/awesome/Hero/index.js +63 -74
  90. package/es/awesome/Spline/ParentSize.js +7 -8
  91. package/es/awesome/Spline/index.js +10 -13
  92. package/es/awesome/Spotlight/index.js +3 -4
  93. package/es/awesome/SpotlightCard/SpotlightCardItem.js +5 -8
  94. package/es/awesome/SpotlightCard/index.js +9 -12
  95. package/es/brand/BrandLoading/index.js +2 -3
  96. package/es/brand/LobeChat/index.js +29 -38
  97. package/es/brand/LobeChatText/index.js +8 -13
  98. package/es/brand/LobeHub/index.js +29 -38
  99. package/es/brand/LobeHubText/index.js +4 -9
  100. package/es/brand/Logo3d/index.js +2 -3
  101. package/es/brand/LogoFlat/index.js +44 -49
  102. package/es/brand/LogoMono/index.js +48 -53
  103. package/es/brand/LogoThree/Loading.js +9 -11
  104. package/es/brand/LogoThree/LogoSpline.js +10 -12
  105. package/es/brand/LogoThree/index.js +23 -25
  106. package/es/brand/components/Divider.js +4 -6
  107. package/es/chat/BackBottom/index.js +4 -6
  108. package/es/chat/ChatHeader/ChatHeaderTitle.js +22 -31
  109. package/es/chat/ChatHeader/index.js +35 -42
  110. package/es/chat/ChatInputArea/ChatInputActionBar.js +16 -21
  111. package/es/chat/ChatInputArea/ChatInputArea.d.ts +1 -1
  112. package/es/chat/ChatInputArea/ChatInputArea.js +19 -23
  113. package/es/chat/ChatInputArea/ChatInputAreaInner.d.ts +1 -1
  114. package/es/chat/ChatInputArea/ChatInputAreaInner.js +2 -3
  115. package/es/chat/ChatInputArea/SendButton.js +36 -51
  116. package/es/chat/ChatItem/components/Actions.js +3 -5
  117. package/es/chat/ChatItem/components/Avatar.js +17 -21
  118. package/es/chat/ChatItem/components/BorderSpacing.js +1 -2
  119. package/es/chat/ChatItem/components/ErrorContent.js +9 -11
  120. package/es/chat/ChatItem/components/Loading.js +10 -12
  121. package/es/chat/ChatItem/components/MessageContent.js +6 -10
  122. package/es/chat/ChatItem/components/Title.js +3 -8
  123. package/es/chat/ChatItem/index.js +47 -53
  124. package/es/chat/ChatList/ActionsBar.js +2 -3
  125. package/es/chat/ChatList/HistoryDivider.js +6 -11
  126. package/es/chat/ChatList/Item.js +14 -12
  127. package/es/chat/ChatList/index.js +25 -29
  128. package/es/chat/EditableMessage/index.js +26 -32
  129. package/es/chat/EditableMessageList/index.js +72 -76
  130. package/es/chat/MessageInput/index.js +35 -43
  131. package/es/chat/MessageModal/index.js +41 -51
  132. package/es/chat/TokenTag/index.js +7 -11
  133. package/es/components/ControlInput.js +18 -22
  134. package/es/hooks/useHighlight.d.ts +1 -1
  135. package/es/mdx/Callout/index.js +13 -19
  136. package/es/mdx/Cards/Card.js +46 -59
  137. package/es/mdx/Cards/index.js +3 -6
  138. package/es/mdx/FileTree/File.js +5 -11
  139. package/es/mdx/FileTree/Folder.js +13 -22
  140. package/es/mdx/FileTree/index.js +3 -6
  141. package/es/mdx/Mdx/index.js +7 -9
  142. package/es/mdx/Steps/index.js +3 -6
  143. package/es/mdx/Tabs/Tab.js +3 -8
  144. package/es/mdx/Tabs/index.js +17 -21
  145. package/es/mdx/mdxComponents/CodeBlock.js +9 -14
  146. package/es/mdx/mdxComponents/Image.js +2 -2
  147. package/es/mdx/mdxComponents/Link.js +2 -3
  148. package/es/mdx/mdxComponents/Pre.js +7 -14
  149. package/es/mdx/mdxComponents/Video.js +2 -2
  150. package/es/mobile/MobileChatInputArea/SendButton.js +3 -4
  151. package/es/mobile/MobileChatInputArea/index.js +69 -79
  152. package/es/mobile/MobileNavBar/MobileNavBarTitle.js +26 -37
  153. package/es/mobile/MobileNavBar/index.js +41 -48
  154. package/es/mobile/MobileSafeArea/index.js +2 -3
  155. package/es/mobile/MobileTabBar/index.js +29 -35
  156. package/es/storybook/StoryBook/index.js +19 -26
  157. package/package.json +41 -45
@@ -10,8 +10,6 @@ import ActionIcon from "../../ActionIcon";
10
10
  import Icon from "../../Icon";
11
11
  import { ControlInput } from "../../components/ControlInput";
12
12
  import { messagesReducer } from "./messageReducer";
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
13
  export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
16
14
  var disabled = _ref.disabled,
17
15
  dataSources = _ref.dataSources,
@@ -25,84 +23,82 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
25
23
  onChange === null || onChange === void 0 || onChange(chatMessages);
26
24
  }
27
25
  }, [chatMessages]);
28
- return dataSources ? /*#__PURE__*/_jsxs(Flexbox, {
29
- gap: 12,
30
- children: [chatMessages.map(function (item, index) {
31
- return /*#__PURE__*/_jsxs(Flexbox, {
32
- align: 'center',
33
- gap: 8,
34
- horizontal: true,
35
- width: '100%',
36
- children: [/*#__PURE__*/_jsx(Select, {
37
- disabled: disabled,
38
- dropdownStyle: {
39
- zIndex: 100
40
- },
41
- onChange: function onChange(value) {
42
- dispatch({
43
- index: index,
44
- role: value,
45
- type: 'updateMessageRole'
46
- });
47
- },
48
- options: [{
49
- label: 'System',
50
- value: 'system'
51
- }, {
52
- label: 'Input',
53
- value: 'user'
54
- }, {
55
- label: 'Output',
56
- value: 'assistant'
57
- }],
58
- style: {
59
- width: 120
60
- },
61
- value: item.role
62
- }), /*#__PURE__*/_jsx(ControlInput, {
63
- disabled: disabled,
64
- onChange: function onChange(e) {
65
- dispatch({
66
- index: index,
67
- message: e,
68
- type: 'updateMessage'
69
- });
70
- },
71
- placeholder: item.role === 'user' ? '请填入输入的样例内容' : '请填入输出的样例',
72
- value: item.content
73
- }), /*#__PURE__*/_jsx(ActionIcon, {
74
- icon: Trash,
75
- onClick: function onClick() {
76
- dispatch({
77
- index: index,
78
- type: 'deleteMessage'
79
- });
80
- },
81
- placement: "right",
82
- size: {
83
- fontSize: 16
84
- },
85
- title: "Delete"
86
- })]
87
- }, "".concat(index, "-").concat(item.content));
88
- }), /*#__PURE__*/_jsx(Button, {
89
- block: true,
26
+ return dataSources ? /*#__PURE__*/React.createElement(Flexbox, {
27
+ gap: 12
28
+ }, chatMessages.map(function (item, index) {
29
+ return /*#__PURE__*/React.createElement(Flexbox, {
30
+ align: 'center',
31
+ gap: 8,
32
+ horizontal: true,
33
+ key: "".concat(index, "-").concat(item.content),
34
+ width: '100%'
35
+ }, /*#__PURE__*/React.createElement(Select, {
90
36
  disabled: disabled,
91
- icon: /*#__PURE__*/_jsx(Icon, {
92
- icon: Plus
93
- }),
37
+ dropdownStyle: {
38
+ zIndex: 100
39
+ },
40
+ onChange: function onChange(value) {
41
+ dispatch({
42
+ index: index,
43
+ role: value,
44
+ type: 'updateMessageRole'
45
+ });
46
+ },
47
+ options: [{
48
+ label: 'System',
49
+ value: 'system'
50
+ }, {
51
+ label: 'Input',
52
+ value: 'user'
53
+ }, {
54
+ label: 'Output',
55
+ value: 'assistant'
56
+ }],
57
+ style: {
58
+ width: 120
59
+ },
60
+ value: item.role
61
+ }), /*#__PURE__*/React.createElement(ControlInput, {
62
+ disabled: disabled,
63
+ onChange: function onChange(e) {
64
+ dispatch({
65
+ index: index,
66
+ message: e,
67
+ type: 'updateMessage'
68
+ });
69
+ },
70
+ placeholder: item.role === 'user' ? '请填入输入的样例内容' : '请填入输出的样例',
71
+ value: item.content
72
+ }), /*#__PURE__*/React.createElement(ActionIcon, {
73
+ icon: Trash,
94
74
  onClick: function onClick() {
95
- var lastMeg = chatMessages.at(-1);
96
75
  dispatch({
97
- message: {
98
- content: '',
99
- role: (lastMeg === null || lastMeg === void 0 ? void 0 : lastMeg.role) === 'user' ? 'assistant' : 'user'
100
- },
101
- type: 'addMessage'
76
+ index: index,
77
+ type: 'deleteMessage'
102
78
  });
103
79
  },
104
- children: "Add Props"
105
- })]
106
- }) : undefined;
80
+ placement: "right",
81
+ size: {
82
+ fontSize: 16
83
+ },
84
+ title: "Delete"
85
+ }));
86
+ }), /*#__PURE__*/React.createElement(Button, {
87
+ block: true,
88
+ disabled: disabled,
89
+ icon: /*#__PURE__*/React.createElement(Icon, {
90
+ icon: Plus
91
+ }),
92
+ onClick: function onClick() {
93
+ var lastMeg = chatMessages.at(-1);
94
+ dispatch({
95
+ message: {
96
+ content: '',
97
+ role: (lastMeg === null || lastMeg === void 0 ? void 0 : lastMeg.role) === 'user' ? 'assistant' : 'user'
98
+ },
99
+ type: 'addMessage'
100
+ });
101
+ }
102
+ }, "Add Props")) : undefined;
107
103
  }, isEqual);
108
104
  export default EditableMessageList;
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
4
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
6
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
@@ -9,9 +10,6 @@ import { memo, useState } from 'react';
9
10
  import { Flexbox } from 'react-layout-kit';
10
11
  import { TextArea } from "../../Input";
11
12
  import { useStyles } from "./style";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { Fragment as _Fragment } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
13
  var MessageInput = /*#__PURE__*/memo(function (_ref) {
16
14
  var text = _ref.text,
17
15
  _ref$type = _ref.type,
@@ -38,50 +36,44 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
38
36
  cx = _useStyles.cx,
39
37
  styles = _useStyles.styles;
40
38
  var isAutoSize = height === 'auto';
41
- return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
39
+ return /*#__PURE__*/React.createElement(Flexbox, _extends({
42
40
  gap: 16,
43
41
  style: _objectSpread({
44
42
  flex: 1,
45
43
  width: '100%'
46
44
  }, style)
47
- }, rest), {}, {
48
- children: [/*#__PURE__*/_jsx(TextArea, {
49
- autoSize: isAutoSize,
50
- className: cx(styles, textareaClassname),
51
- classNames: classNames,
52
- onBlur: function onBlur(e) {
53
- return setValue(e.target.value);
54
- },
55
- onChange: function onChange(e) {
56
- return setValue(e.target.value);
57
- },
58
- placeholder: placeholder,
59
- resize: false,
60
- style: textareaStyle,
61
- type: type,
62
- value: temporaryValue
63
- }), /*#__PURE__*/_jsx(Flexbox, {
64
- direction: 'horizontal-reverse',
65
- gap: 8,
66
- children: renderButtons ? renderButtons(temporaryValue).map(function (buttonProps, index) {
67
- return /*#__PURE__*/_jsx(Button, _objectSpread({
68
- size: "small"
69
- }, buttonProps), index);
70
- }) : /*#__PURE__*/_jsxs(_Fragment, {
71
- children: [/*#__PURE__*/_jsx(Button, {
72
- onClick: function onClick() {
73
- onConfirm === null || onConfirm === void 0 || onConfirm(temporaryValue);
74
- },
75
- size: editButtonSize,
76
- type: "primary",
77
- children: (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'
78
- }), /*#__PURE__*/_jsx(Button, {
79
- onClick: onCancel,
80
- size: editButtonSize,
81
- children: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel'
82
- })]
83
- })
84
- })]
85
- }));
45
+ }, rest), /*#__PURE__*/React.createElement(TextArea, {
46
+ autoSize: isAutoSize,
47
+ className: cx(styles, textareaClassname),
48
+ classNames: classNames,
49
+ onBlur: function onBlur(e) {
50
+ return setValue(e.target.value);
51
+ },
52
+ onChange: function onChange(e) {
53
+ return setValue(e.target.value);
54
+ },
55
+ placeholder: placeholder,
56
+ resize: false,
57
+ style: textareaStyle,
58
+ type: type,
59
+ value: temporaryValue
60
+ }), /*#__PURE__*/React.createElement(Flexbox, {
61
+ direction: 'horizontal-reverse',
62
+ gap: 8
63
+ }, renderButtons ? renderButtons(temporaryValue).map(function (buttonProps, index) {
64
+ return /*#__PURE__*/React.createElement(Button, _extends({
65
+ key: index,
66
+ size: "small"
67
+ }, buttonProps));
68
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
69
+ onClick: function onClick() {
70
+ onConfirm === null || onConfirm === void 0 || onConfirm(temporaryValue);
71
+ },
72
+ size: editButtonSize,
73
+ type: "primary"
74
+ }, (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'), /*#__PURE__*/React.createElement(Button, {
75
+ onClick: onCancel,
76
+ size: editButtonSize
77
+ }, (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel'))));
86
78
  });
87
79
  export default MessageInput;
@@ -11,9 +11,6 @@ import { TextArea } from "../../Input";
11
11
  import Markdown from "../../Markdown";
12
12
  import Modal from "../../Modal";
13
13
  import { useStyles as useTextStyles } from "../MessageInput/style";
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- import { Fragment as _Fragment } from "react/jsx-runtime";
17
14
  var MessageModal = /*#__PURE__*/memo(function (_ref) {
18
15
  var editing = _ref.editing,
19
16
  open = _ref.open,
@@ -55,26 +52,23 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
55
52
  overflowX: 'hidden',
56
53
  overflowY: 'auto'
57
54
  };
58
- var modalFooter = isEdit ? /*#__PURE__*/_jsxs(Flexbox, {
55
+ var modalFooter = isEdit ? /*#__PURE__*/React.createElement(Flexbox, {
59
56
  direction: 'horizontal-reverse',
60
- gap: 8,
61
- children: [/*#__PURE__*/_jsx(Button, {
62
- onClick: function onClick() {
63
- setTyping(false);
64
- onChange === null || onChange === void 0 || onChange(temporaryValue);
65
- setValue(value);
66
- },
67
- type: "primary",
68
- children: (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'
69
- }), /*#__PURE__*/_jsx(Button, {
70
- onClick: function onClick() {
71
- setTyping(false);
72
- setValue(value);
73
- },
74
- children: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel'
75
- })]
76
- }) : footer;
77
- return /*#__PURE__*/_jsx(Modal, {
57
+ gap: 8
58
+ }, /*#__PURE__*/React.createElement(Button, {
59
+ onClick: function onClick() {
60
+ setTyping(false);
61
+ onChange === null || onChange === void 0 || onChange(temporaryValue);
62
+ setValue(value);
63
+ },
64
+ type: "primary"
65
+ }, (text === null || text === void 0 ? void 0 : text.confirm) || 'Confirm'), /*#__PURE__*/React.createElement(Button, {
66
+ onClick: function onClick() {
67
+ setTyping(false);
68
+ setValue(value);
69
+ }
70
+ }, (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel')) : footer;
71
+ return /*#__PURE__*/React.createElement(Modal, {
78
72
  allowFullscreen: true,
79
73
  cancelText: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel',
80
74
  destroyOnClose: true,
@@ -89,34 +83,30 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
89
83
  return setTyping(true);
90
84
  },
91
85
  open: showModal,
92
- title: text === null || text === void 0 ? void 0 : text.title,
93
- children: isEdit ? /*#__PURE__*/_jsx(TextArea, {
94
- autoSize: isAutoSize,
95
- className: textStyles,
96
- onBlur: function onBlur(e) {
97
- return setValue(e.target.value);
98
- },
99
- onChange: function onChange(e) {
100
- return setValue(e.target.value);
101
- },
102
- placeholder: placeholder,
103
- resize: false,
104
- style: {
105
- flex: mobile ? 1 : undefined,
106
- height: isAutoSize ? 'unset' : height,
107
- minHeight: mobile ? 'unset' : '100%'
108
- },
109
- type: mobile ? 'pure' : 'block',
110
- value: temporaryValue
111
- }) : /*#__PURE__*/_jsxs(_Fragment, {
112
- children: [extra, /*#__PURE__*/_jsx(Markdown, {
113
- style: value ? markdownStyle : _objectSpread(_objectSpread({}, markdownStyle), {}, {
114
- opacity: 0.5
115
- }),
116
- variant: 'chat',
117
- children: String(value || placeholder)
118
- })]
119
- })
120
- });
86
+ title: text === null || text === void 0 ? void 0 : text.title
87
+ }, isEdit ? /*#__PURE__*/React.createElement(TextArea, {
88
+ autoSize: isAutoSize,
89
+ className: textStyles,
90
+ onBlur: function onBlur(e) {
91
+ return setValue(e.target.value);
92
+ },
93
+ onChange: function onChange(e) {
94
+ return setValue(e.target.value);
95
+ },
96
+ placeholder: placeholder,
97
+ resize: false,
98
+ style: {
99
+ flex: mobile ? 1 : undefined,
100
+ height: isAutoSize ? 'unset' : height,
101
+ minHeight: mobile ? 'unset' : '100%'
102
+ },
103
+ type: mobile ? 'pure' : 'block',
104
+ value: temporaryValue
105
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, extra, /*#__PURE__*/React.createElement(Markdown, {
106
+ style: value ? markdownStyle : _objectSpread(_objectSpread({}, markdownStyle), {}, {
107
+ opacity: 0.5
108
+ }),
109
+ variant: 'chat'
110
+ }, String(value || placeholder))));
121
111
  });
122
112
  export default MessageModal;
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["className", "displayMode", "maxValue", "value", "text", "shape", "unoptimized"];
6
6
  import { useResponsive } from 'antd-style';
@@ -9,8 +9,6 @@ import { forwardRef } from 'react';
9
9
  import { Flexbox } from 'react-layout-kit';
10
10
  import FluentEmoji from "../../FluentEmoji";
11
11
  import { ICON_SIZE, useStyles } from "./style";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
12
  var format = function format(number) {
15
13
  return numeral(number).format('0,0');
16
14
  };
@@ -47,19 +45,17 @@ var TokenTag = /*#__PURE__*/forwardRef(function (_ref, ref) {
47
45
  }),
48
46
  styles = _useStyles.styles,
49
47
  cx = _useStyles.cx;
50
- return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
48
+ return /*#__PURE__*/React.createElement(Flexbox, _extends({
51
49
  align: 'center',
52
50
  className: cx(styles.container, className),
53
51
  flex: 'none',
54
52
  gap: 4,
55
53
  horizontal: true,
56
54
  ref: ref
57
- }, rest), {}, {
58
- children: [/*#__PURE__*/_jsx(FluentEmoji, {
59
- emoji: emoji,
60
- size: ICON_SIZE,
61
- unoptimized: unoptimized
62
- }), valueLeft > 0 ? [mobile ? '' : displayMode === 'remained' ? (text === null || text === void 0 ? void 0 : text.remained) || 'Remained' : (text === null || text === void 0 ? void 0 : text.used) || 'Used', displayMode === 'remained' ? format(valueLeft) : format(value)].join(' ') : (text === null || text === void 0 ? void 0 : text.overload) || 'Overload']
63
- }));
55
+ }, rest), /*#__PURE__*/React.createElement(FluentEmoji, {
56
+ emoji: emoji,
57
+ size: ICON_SIZE,
58
+ unoptimized: unoptimized
59
+ }), valueLeft > 0 ? [mobile ? '' : displayMode === 'remained' ? (text === null || text === void 0 ? void 0 : text.remained) || 'Remained' : (text === null || text === void 0 ? void 0 : text.used) || 'Used', displayMode === 'remained' ? format(valueLeft) : format(value)].join(' ') : (text === null || text === void 0 ? void 0 : text.overload) || 'Overload');
64
60
  });
65
61
  export default TokenTag;
@@ -1,4 +1,4 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  var _excluded = ["value", "onChange", "onValueChanging", "onChangeEnd"];
@@ -7,8 +7,6 @@ import { RotateCcw, Save } from 'lucide-react';
7
7
  import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
8
8
  import ActionIcon from "../ActionIcon";
9
9
  import { Input } from "../Input";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
10
  export var ControlInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
13
11
  var value = _ref.value,
14
12
  onChange = _ref.onChange,
@@ -27,7 +25,7 @@ export var ControlInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
27
25
  useEffect(function () {
28
26
  if (value !== undefined) setInput(value);
29
27
  }, [value]);
30
- return /*#__PURE__*/_jsx(Input, _objectSpread({
28
+ return /*#__PURE__*/React.createElement(Input, _extends({
31
29
  autoFocus: true,
32
30
  onBlur: function onBlur() {
33
31
  isFocusing.current = false;
@@ -55,29 +53,27 @@ export var ControlInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
55
53
  }
56
54
  },
57
55
  ref: ref,
58
- suffix: value === input ? /*#__PURE__*/_jsx("span", {}) : /*#__PURE__*/_jsx(ConfigProvider, {
56
+ suffix: value === input ? /*#__PURE__*/React.createElement("span", null) : /*#__PURE__*/React.createElement(ConfigProvider, {
59
57
  theme: {
60
58
  token: {
61
59
  fontSize: 14
62
60
  }
61
+ }
62
+ }, /*#__PURE__*/React.createElement(Space, {
63
+ size: 2
64
+ }, /*#__PURE__*/React.createElement(ActionIcon, {
65
+ icon: RotateCcw,
66
+ onClick: function onClick() {
67
+ setInput(value);
63
68
  },
64
- children: /*#__PURE__*/_jsxs(Space, {
65
- size: 2,
66
- children: [/*#__PURE__*/_jsx(ActionIcon, {
67
- icon: RotateCcw,
68
- onClick: function onClick() {
69
- setInput(value);
70
- },
71
- size: "small",
72
- title: "Reset"
73
- }), /*#__PURE__*/_jsx(ActionIcon, {
74
- icon: Save,
75
- onClick: updateValue,
76
- size: "small",
77
- title: "\u2705 Save"
78
- })]
79
- })
80
- }),
69
+ size: "small",
70
+ title: "Reset"
71
+ }), /*#__PURE__*/React.createElement(ActionIcon, {
72
+ icon: Save,
73
+ onClick: updateValue,
74
+ size: "small",
75
+ title: "\u2705 Save"
76
+ }))),
81
77
  value: input
82
78
  }, rest));
83
79
  });
@@ -1,3 +1,3 @@
1
1
  export declare const FALLBACK_LANG = "txt";
2
- export declare const useHighlight: (text: string, lang: string, isDarkMode: boolean) => import("swr/dist/_internal").SWRResponse<string, any, any>;
2
+ export declare const useHighlight: (text: string, lang: string, isDarkMode: boolean) => import("swr/_internal").SWRResponse<string, any, any>;
3
3
  export { default as languageMap } from './languageMap';
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
4
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
6
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
@@ -10,8 +11,6 @@ import { AlertOctagon, AlertTriangle, Info, Lightbulb, MessageSquareWarning } fr
10
11
  import { rgba } from 'polished';
11
12
  import { Flexbox } from 'react-layout-kit';
12
13
  import Icon from "../../Icon";
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
14
  var useStyles = createStyles(function (_ref) {
16
15
  var css = _ref.css;
17
16
  return {
@@ -56,7 +55,7 @@ var Callout = function Callout(_ref2) {
56
55
  var selectedType = (typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig[type]) || typeConfig.info;
57
56
  var icon = selectedType.icon,
58
57
  color = selectedType.color;
59
- return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
58
+ return /*#__PURE__*/React.createElement(Flexbox, _extends({
60
59
  align: 'flex-start',
61
60
  className: cx(styles.container, className),
62
61
  horizontal: true,
@@ -65,21 +64,16 @@ var Callout = function Callout(_ref2) {
65
64
  borderColor: rgba(color, 0.5),
66
65
  color: color
67
66
  }, style)
68
- }, rest), {}, {
69
- children: [/*#__PURE__*/_jsx(Icon, {
70
- icon: icon,
71
- size: {
72
- fontSize: '1.2em'
73
- },
74
- style: {
75
- marginBlock: '0.25em'
76
- }
77
- }), /*#__PURE__*/_jsx("div", {
78
- className: cx(styles.content, type === 'info' && styles.underlineAnchor),
79
- children: /*#__PURE__*/_jsx("div", {
80
- children: children
81
- })
82
- })]
83
- }));
67
+ }, rest), /*#__PURE__*/React.createElement(Icon, {
68
+ icon: icon,
69
+ size: {
70
+ fontSize: '1.2em'
71
+ },
72
+ style: {
73
+ marginBlock: '0.25em'
74
+ }
75
+ }), /*#__PURE__*/React.createElement("div", {
76
+ className: cx(styles.content, type === 'info' && styles.underlineAnchor)
77
+ }, /*#__PURE__*/React.createElement("div", null, children)));
84
78
  };
85
79
  export default Callout;