@lobehub/ui 1.157.1 → 1.158.1
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.
- package/es/A/index.js +2 -2
- package/es/ActionIcon/index.js +11 -15
- package/es/ActionIconGroup/index.js +45 -47
- package/es/Alert/index.js +43 -50
- package/es/Avatar/index.js +10 -12
- package/es/Burger/index.js +30 -35
- package/es/CodeEditor/index.js +38 -41
- package/es/Collapse/index.js +3 -3
- package/es/ColorScales/ScaleRow.js +39 -43
- package/es/ColorScales/index.js +57 -59
- package/es/ConfigProvider/index.js +3 -5
- package/es/ContextMenu/index.js +2 -3
- package/es/CopyButton/index.js +3 -4
- package/es/DraggablePanel/components/DraggablePanelBody.js +2 -3
- package/es/DraggablePanel/components/DraggablePanelContainer.js +2 -3
- package/es/DraggablePanel/components/DraggablePanelFooter.js +2 -3
- package/es/DraggablePanel/components/DraggablePanelHeader.js +5 -9
- package/es/DraggablePanel/index.js +28 -35
- package/es/EditableText/index.js +13 -16
- package/es/EmojiPicker/AvatarUploader.js +60 -71
- package/es/EmojiPicker/index.js +101 -110
- package/es/EmptyCard/index.js +23 -31
- package/es/FileTypeIcon/index.js +44 -55
- package/es/FluentEmoji/index.js +4 -6
- package/es/Footer/index.js +8 -10
- package/es/Form/components/FormDivider.js +2 -2
- package/es/Form/components/FormFlatGroup.js +4 -9
- package/es/Form/components/FormFooter.js +3 -6
- package/es/Form/components/FormGroup.js +15 -21
- package/es/Form/components/FormItem.js +10 -17
- package/es/Form/components/FormTitle.js +15 -23
- package/es/Form/index.js +26 -30
- package/es/FormModal/index.js +30 -34
- package/es/Grid/index.js +3 -6
- package/es/Header/index.js +49 -65
- package/es/Highlighter/FullFeatured.js +41 -51
- package/es/Highlighter/SyntaxHighlighter/index.js +19 -30
- package/es/Highlighter/index.js +19 -29
- package/es/Icon/icons/DiscordIcon.js +2 -3
- package/es/Icon/index.js +13 -16
- package/es/Image/ImageGallery.js +3 -5
- package/es/Image/Preview.js +5 -6
- package/es/Image/index.js +34 -38
- package/es/Image/usePreview.js +33 -37
- package/es/Img/index.js +2 -2
- package/es/Input/index.js +3 -3
- package/es/Layout/index.js +35 -63
- package/es/List/ListItem/index.js +53 -67
- package/es/Markdown/CodeBlock.js +10 -16
- package/es/Markdown/Typography.js +3 -6
- package/es/Markdown/index.js +18 -22
- package/es/MaterialFileTypeIcon/index.js +17 -20
- package/es/MaterialFileTypeIcon/utils.d.ts +2 -2
- package/es/Mermaid/FullFeatured.js +35 -45
- package/es/Mermaid/index.js +17 -26
- package/es/Mermaid/useMermaid.d.ts +2 -1
- package/es/Mermaid/useMermaid.js +3 -5
- package/es/Modal/index.js +48 -60
- package/es/SearchBar/index.js +48 -52
- package/es/SelectWithImg/index.js +34 -40
- package/es/SideNav/index.js +15 -22
- package/es/SliderWithInput/index.js +35 -38
- package/es/Snippet/index.js +10 -15
- package/es/SortableList/DragHandle.js +3 -3
- package/es/SortableList/SortableItem.js +16 -19
- package/es/SortableList/SortableOverlay.js +3 -5
- package/es/SortableList/index.js +15 -23
- package/es/Swatches/index.js +18 -20
- package/es/TabsNav/index.js +2 -3
- package/es/Tag/index.js +7 -12
- package/es/ThemeProvider/Meta.js +53 -58
- package/es/ThemeProvider/index.js +17 -23
- package/es/ThemeSwitch/index.js +15 -19
- package/es/Toc/TocMobile.js +47 -52
- package/es/Toc/index.js +8 -13
- package/es/Tooltip/index.js +2 -3
- package/es/Video/index.js +41 -47
- package/es/awesome/AuroraBackground/index.js +11 -18
- package/es/awesome/Features/Item.js +37 -45
- package/es/awesome/Features/index.js +5 -4
- package/es/awesome/GaussianBackground/index.js +8 -13
- package/es/awesome/GaussianBackground/useGaussianBackground.d.ts +1 -1
- package/es/awesome/GaussianBackground/useGaussianBackground.js +1 -1
- package/es/awesome/Giscus/index.js +13 -15
- package/es/awesome/GradientButton/index.js +5 -9
- package/es/awesome/GridBackground/Grid.js +49 -61
- package/es/awesome/GridBackground/GridShowcase.js +24 -28
- package/es/awesome/GridBackground/index.js +27 -33
- package/es/awesome/Hero/index.js +63 -74
- package/es/awesome/Spline/ParentSize.js +7 -8
- package/es/awesome/Spline/index.js +10 -13
- package/es/awesome/Spotlight/index.js +3 -4
- package/es/awesome/SpotlightCard/SpotlightCardItem.js +5 -8
- package/es/awesome/SpotlightCard/index.js +9 -12
- package/es/brand/BrandLoading/index.js +2 -3
- package/es/brand/LobeChat/index.js +29 -38
- package/es/brand/LobeChatText/index.js +8 -13
- package/es/brand/LobeHub/index.js +29 -38
- package/es/brand/LobeHubText/index.js +4 -9
- package/es/brand/Logo3d/index.js +2 -3
- package/es/brand/LogoFlat/index.js +44 -49
- package/es/brand/LogoMono/index.js +48 -53
- package/es/brand/LogoThree/Loading.js +9 -11
- package/es/brand/LogoThree/LogoSpline.js +10 -12
- package/es/brand/LogoThree/index.js +23 -25
- package/es/brand/components/Divider.js +4 -6
- package/es/chat/BackBottom/index.js +4 -6
- package/es/chat/ChatHeader/ChatHeaderTitle.js +22 -31
- package/es/chat/ChatHeader/index.js +35 -42
- package/es/chat/ChatInputArea/ChatInputActionBar.js +16 -21
- package/es/chat/ChatInputArea/ChatInputArea.d.ts +1 -1
- package/es/chat/ChatInputArea/ChatInputArea.js +19 -23
- package/es/chat/ChatInputArea/ChatInputAreaInner.d.ts +1 -1
- package/es/chat/ChatInputArea/ChatInputAreaInner.js +2 -3
- package/es/chat/ChatInputArea/SendButton.js +36 -51
- package/es/chat/ChatItem/components/Actions.js +3 -5
- package/es/chat/ChatItem/components/Avatar.js +17 -21
- package/es/chat/ChatItem/components/BorderSpacing.js +1 -2
- package/es/chat/ChatItem/components/ErrorContent.js +9 -11
- package/es/chat/ChatItem/components/Loading.js +10 -12
- package/es/chat/ChatItem/components/MessageContent.js +6 -10
- package/es/chat/ChatItem/components/Title.js +3 -8
- package/es/chat/ChatItem/index.js +47 -53
- package/es/chat/ChatList/ActionsBar.js +2 -3
- package/es/chat/ChatList/HistoryDivider.js +6 -11
- package/es/chat/ChatList/Item.js +14 -12
- package/es/chat/ChatList/index.js +25 -29
- package/es/chat/EditableMessage/index.js +26 -32
- package/es/chat/EditableMessageList/index.js +72 -76
- package/es/chat/MessageInput/index.js +35 -43
- package/es/chat/MessageModal/index.js +41 -51
- package/es/chat/TokenTag/index.js +7 -11
- package/es/components/ControlInput.js +18 -22
- package/es/hooks/useHighlight.d.ts +1 -1
- package/es/hooks/useHighlight.js +1 -1
- package/es/mdx/Callout/index.js +13 -19
- package/es/mdx/Cards/Card.js +46 -59
- package/es/mdx/Cards/index.js +3 -6
- package/es/mdx/FileTree/File.js +5 -11
- package/es/mdx/FileTree/Folder.js +13 -22
- package/es/mdx/FileTree/index.js +3 -6
- package/es/mdx/Mdx/index.js +7 -9
- package/es/mdx/Steps/index.js +3 -6
- package/es/mdx/Tabs/Tab.js +3 -8
- package/es/mdx/Tabs/index.js +17 -21
- package/es/mdx/mdxComponents/CodeBlock.js +9 -14
- package/es/mdx/mdxComponents/Image.js +2 -2
- package/es/mdx/mdxComponents/Link.js +2 -3
- package/es/mdx/mdxComponents/Pre.js +7 -14
- package/es/mdx/mdxComponents/Video.js +2 -2
- package/es/mobile/MobileChatInputArea/SendButton.js +3 -4
- package/es/mobile/MobileChatInputArea/index.js +69 -79
- package/es/mobile/MobileNavBar/MobileNavBarTitle.js +26 -37
- package/es/mobile/MobileNavBar/index.js +41 -48
- package/es/mobile/MobileSafeArea/index.js +2 -3
- package/es/mobile/MobileTabBar/index.js +29 -35
- package/es/storybook/StoryBook/index.js +19 -26
- package/package.json +43 -46
|
@@ -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__*/
|
|
29
|
-
gap: 12
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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
|
-
|
|
98
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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__*/
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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__*/
|
|
55
|
+
var modalFooter = isEdit ? /*#__PURE__*/React.createElement(Flexbox, {
|
|
59
56
|
direction: 'horizontal-reverse',
|
|
60
|
-
gap: 8
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
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__*/
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
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__*/
|
|
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__*/
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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/
|
|
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';
|
package/es/hooks/useHighlight.js
CHANGED
|
@@ -23,7 +23,7 @@ export var useHighlight = function useHighlight(text, lang, isDarkMode) {
|
|
|
23
23
|
case 5:
|
|
24
24
|
_context.prev = 5;
|
|
25
25
|
_context.t0 = _context["catch"](0);
|
|
26
|
-
console.error(
|
|
26
|
+
console.error('shiki Highlight error:', _context.t0);
|
|
27
27
|
return _context.abrupt("return", text);
|
|
28
28
|
case 9:
|
|
29
29
|
case "end":
|
package/es/mdx/Callout/index.js
CHANGED
|
@@ -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__*/
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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;
|