@lobehub/ui 1.158.1 → 1.160.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.
- package/es/A/index.js +2 -2
- package/es/ActionIcon/index.js +15 -11
- package/es/ActionIconGroup/index.js +47 -45
- package/es/Alert/index.js +50 -43
- package/es/Avatar/index.js +12 -10
- package/es/Burger/index.js +35 -30
- package/es/CodeEditor/index.js +43 -38
- package/es/Collapse/index.js +3 -3
- package/es/ColorScales/ScaleRow.js +43 -39
- package/es/ColorScales/index.js +59 -57
- package/es/ConfigProvider/index.js +5 -3
- package/es/ContextMenu/index.js +3 -2
- package/es/CopyButton/index.js +4 -3
- package/es/DraggablePanel/components/DraggablePanelBody.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.js +9 -5
- package/es/DraggablePanel/index.js +32 -25
- package/es/EditableText/index.js +16 -13
- package/es/EmojiPicker/AvatarUploader.js +71 -60
- package/es/EmojiPicker/index.js +110 -101
- package/es/EmptyCard/index.js +31 -23
- package/es/FileTypeIcon/index.js +55 -44
- package/es/FluentEmoji/index.js +6 -4
- package/es/Footer/index.js +10 -8
- package/es/Form/components/FormDivider.js +2 -2
- package/es/Form/components/FormFlatGroup.js +9 -4
- package/es/Form/components/FormFooter.js +6 -3
- package/es/Form/components/FormGroup.js +21 -15
- package/es/Form/components/FormItem.js +17 -10
- package/es/Form/components/FormTitle.js +23 -15
- package/es/Form/index.js +30 -26
- package/es/FormModal/index.js +34 -30
- package/es/Grid/index.js +6 -3
- package/es/Header/index.js +65 -49
- package/es/Highlighter/FullFeatured.js +51 -41
- package/es/Highlighter/SyntaxHighlighter/index.js +30 -19
- package/es/Highlighter/index.js +29 -19
- package/es/Icon/icons/DiscordIcon.js +3 -2
- package/es/Icon/index.js +16 -13
- package/es/Image/ImageGallery.js +5 -3
- package/es/Image/Preview.js +5 -3
- package/es/Image/index.js +38 -34
- package/es/Image/usePreview.js +37 -33
- package/es/Img/index.js +2 -2
- package/es/Input/index.js +3 -3
- package/es/Layout/index.js +63 -35
- package/es/List/ListItem/index.js +67 -53
- package/es/Markdown/CodeBlock.js +16 -10
- package/es/Markdown/Typography.js +6 -3
- package/es/Markdown/index.js +22 -18
- package/es/MaterialFileTypeIcon/index.js +20 -17
- package/es/MaterialFileTypeIcon/utils.d.ts +2 -2
- package/es/Mermaid/FullFeatured.js +45 -35
- package/es/Mermaid/index.js +26 -17
- package/es/Mermaid/useMermaid.d.ts +1 -2
- package/es/Mermaid/useMermaid.js +5 -3
- package/es/Modal/index.js +60 -48
- package/es/SearchBar/index.js +51 -47
- package/es/SelectWithImg/index.js +40 -34
- package/es/SideNav/index.js +22 -15
- package/es/SliderWithInput/index.js +38 -35
- package/es/Snippet/index.js +15 -10
- package/es/SortableList/DragHandle.js +3 -3
- package/es/SortableList/SortableItem.js +19 -16
- package/es/SortableList/SortableOverlay.js +5 -3
- package/es/SortableList/index.js +23 -15
- package/es/Swatches/index.js +20 -18
- package/es/TabsNav/index.js +3 -2
- package/es/Tag/index.js +12 -7
- package/es/ThemeProvider/Meta.js +58 -53
- package/es/ThemeProvider/index.js +23 -17
- package/es/ThemeSwitch/index.js +19 -15
- package/es/Toc/TocMobile.js +52 -47
- package/es/Toc/index.js +13 -8
- package/es/Tooltip/index.js +3 -2
- package/es/Video/index.js +47 -41
- package/es/awesome/AuroraBackground/index.js +18 -11
- package/es/awesome/Features/Item.js +45 -37
- package/es/awesome/Features/index.js +4 -5
- package/es/awesome/GaussianBackground/index.js +13 -8
- package/es/awesome/Giscus/index.js +15 -13
- package/es/awesome/GradientButton/index.js +9 -5
- package/es/awesome/GridBackground/Grid.js +61 -49
- package/es/awesome/GridBackground/GridShowcase.js +28 -24
- package/es/awesome/GridBackground/index.js +33 -27
- package/es/awesome/Hero/index.js +74 -63
- package/es/awesome/Spline/ParentSize.js +8 -7
- package/es/awesome/Spline/index.js +13 -10
- package/es/awesome/Spotlight/index.js +3 -2
- package/es/awesome/SpotlightCard/SpotlightCardItem.js +8 -5
- package/es/awesome/SpotlightCard/index.js +12 -9
- package/es/brand/BrandLoading/index.js +3 -2
- package/es/brand/LobeChat/index.js +38 -29
- package/es/brand/LobeChatText/index.js +13 -8
- package/es/brand/LobeHub/index.js +38 -29
- package/es/brand/LobeHubText/index.js +9 -4
- package/es/brand/Logo3d/index.js +3 -2
- package/es/brand/LogoFlat/index.js +49 -44
- package/es/brand/LogoMono/index.js +53 -48
- package/es/brand/LogoThree/Loading.js +11 -9
- package/es/brand/LogoThree/LogoSpline.js +12 -10
- package/es/brand/LogoThree/index.js +25 -23
- package/es/brand/components/Divider.js +6 -4
- package/es/chat/BackBottom/index.js +6 -4
- package/es/chat/ChatHeader/ChatHeaderTitle.js +31 -22
- package/es/chat/ChatHeader/index.js +42 -35
- package/es/chat/ChatInputArea/ChatInputActionBar.js +21 -16
- package/es/chat/ChatInputArea/ChatInputArea.js +23 -19
- package/es/chat/ChatInputArea/ChatInputAreaInner.js +3 -2
- package/es/chat/ChatInputArea/SendButton.js +51 -36
- package/es/chat/ChatItem/components/Actions.js +5 -3
- package/es/chat/ChatItem/components/Avatar.js +21 -17
- package/es/chat/ChatItem/components/BorderSpacing.js +2 -1
- package/es/chat/ChatItem/components/ErrorContent.js +11 -9
- package/es/chat/ChatItem/components/Loading.js +12 -10
- package/es/chat/ChatItem/components/MessageContent.js +10 -6
- package/es/chat/ChatItem/components/Title.js +8 -3
- package/es/chat/ChatItem/index.js +53 -47
- package/es/chat/ChatList/ActionsBar.js +3 -2
- package/es/chat/ChatList/HistoryDivider.js +11 -6
- package/es/chat/ChatList/Item.js +12 -14
- package/es/chat/ChatList/index.js +29 -25
- package/es/chat/EditableMessage/index.js +32 -26
- package/es/chat/EditableMessageList/index.js +76 -72
- package/es/chat/MessageInput/index.js +43 -35
- package/es/chat/MessageModal/index.js +51 -41
- package/es/chat/TokenTag/index.js +11 -7
- package/es/components/ControlInput.js +22 -18
- package/es/hooks/useHighlight.d.ts +1 -1
- package/es/mdx/Callout/index.js +19 -13
- package/es/mdx/Cards/Card.js +59 -46
- package/es/mdx/Cards/index.js +6 -3
- package/es/mdx/FileTree/File.js +11 -5
- package/es/mdx/FileTree/Folder.js +22 -13
- package/es/mdx/FileTree/index.js +6 -3
- package/es/mdx/Mdx/index.js +9 -7
- package/es/mdx/Steps/index.js +6 -3
- package/es/mdx/Tabs/Tab.js +8 -3
- package/es/mdx/Tabs/index.js +21 -17
- package/es/mdx/mdxComponents/CodeBlock.js +14 -9
- package/es/mdx/mdxComponents/Image.js +2 -2
- package/es/mdx/mdxComponents/Link.js +3 -2
- package/es/mdx/mdxComponents/Pre.js +14 -7
- package/es/mdx/mdxComponents/Video.js +2 -2
- package/es/mobile/MobileChatInputArea/SendButton.js +4 -3
- package/es/mobile/MobileChatInputArea/index.js +79 -69
- package/es/mobile/MobileNavBar/MobileNavBarTitle.js +37 -26
- package/es/mobile/MobileNavBar/index.js +48 -41
- package/es/mobile/MobileSafeArea/index.js +3 -2
- package/es/mobile/MobileTabBar/index.js +35 -29
- package/es/storybook/StoryBook/index.js +26 -19
- package/package.json +1 -90
|
@@ -6,6 +6,8 @@ import AvatarEditor from 'react-avatar-editor';
|
|
|
6
6
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
7
7
|
import Icon from "../Icon";
|
|
8
8
|
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
11
|
var Dragger = Upload.Dragger;
|
|
10
12
|
var createUploadImageHandler = function createUploadImageHandler(onUploadImage) {
|
|
11
13
|
return function (file) {
|
|
@@ -50,69 +52,78 @@ var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
|
50
52
|
});
|
|
51
53
|
onUpload === null || onUpload === void 0 || onUpload(file);
|
|
52
54
|
};
|
|
53
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
54
56
|
padding: 10,
|
|
55
57
|
style: {
|
|
56
58
|
position: 'relative'
|
|
57
59
|
},
|
|
58
|
-
width: '100%'
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
60
|
+
width: '100%',
|
|
61
|
+
children: [!previewImage && /*#__PURE__*/_jsx(Dragger, {
|
|
62
|
+
accept: 'image',
|
|
63
|
+
beforeUpload: beforeUpload,
|
|
64
|
+
itemRender: function itemRender() {
|
|
65
|
+
return void 0;
|
|
66
|
+
},
|
|
67
|
+
maxCount: 1,
|
|
68
|
+
multiple: false,
|
|
69
|
+
children: /*#__PURE__*/_jsxs(Center, {
|
|
70
|
+
gap: 16,
|
|
71
|
+
height: compressSize,
|
|
72
|
+
width: compressSize,
|
|
73
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
74
|
+
icon: ImageUpIcon,
|
|
75
|
+
size: {
|
|
76
|
+
fontSize: 48,
|
|
77
|
+
strokeWidth: 1.5
|
|
78
|
+
}
|
|
79
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
80
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.draggerDesc) || 'Click or Drag image to this area to upload'
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
}), previewImage && /*#__PURE__*/_jsxs(Center, {
|
|
84
|
+
gap: 8,
|
|
85
|
+
style: {
|
|
86
|
+
position: 'relative'
|
|
87
|
+
},
|
|
88
|
+
width: '100%',
|
|
89
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
90
|
+
className: styles.editor,
|
|
91
|
+
children: /*#__PURE__*/_jsx(AvatarEditor, {
|
|
92
|
+
border: 0,
|
|
93
|
+
borderRadius: compressSize / 2,
|
|
94
|
+
height: compressSize,
|
|
95
|
+
image: previewImage,
|
|
96
|
+
ref: editor,
|
|
97
|
+
width: compressSize
|
|
98
|
+
})
|
|
99
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
100
|
+
gap: 8,
|
|
101
|
+
horizontal: true,
|
|
102
|
+
style: {
|
|
103
|
+
position: 'relative'
|
|
104
|
+
},
|
|
105
|
+
width: '100%',
|
|
106
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
107
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
108
|
+
icon: ChevronLeftIcon
|
|
109
|
+
}),
|
|
110
|
+
onClick: function onClick() {
|
|
111
|
+
return setPreviewImage('');
|
|
112
|
+
},
|
|
113
|
+
style: {
|
|
114
|
+
flex: 'none'
|
|
115
|
+
}
|
|
116
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
117
|
+
onClick: handleUpload,
|
|
118
|
+
style: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
fontWeight: 500
|
|
121
|
+
},
|
|
122
|
+
type: 'primary',
|
|
123
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.uploadBtn) || 'Crop and Upload'
|
|
124
|
+
})]
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
117
128
|
});
|
|
118
129
|
export default AvatarUploader;
|
package/es/EmojiPicker/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
4
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
5
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
@@ -23,6 +22,8 @@ import TabsNav from "../TabsNav";
|
|
|
23
22
|
import Tooltip from "../Tooltip";
|
|
24
23
|
import AvatarUploader from "./AvatarUploader";
|
|
25
24
|
import { useStyles } from "./style";
|
|
25
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
27
|
var DEFAULT_AVATAR = '🤖';
|
|
27
28
|
var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
28
29
|
var value = _ref.value,
|
|
@@ -111,26 +112,28 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
111
112
|
}, [active, open]);
|
|
112
113
|
var items = [{
|
|
113
114
|
key: 'emoji',
|
|
114
|
-
label: /*#__PURE__*/
|
|
115
|
-
title: (texts === null || texts === void 0 ? void 0 : texts.emoji) || 'Emoji'
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
label: /*#__PURE__*/_jsx(Tooltip, {
|
|
116
|
+
title: (texts === null || texts === void 0 ? void 0 : texts.emoji) || 'Emoji',
|
|
117
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
118
|
+
icon: SmileIcon,
|
|
119
|
+
size: {
|
|
120
|
+
fontSize: 20,
|
|
121
|
+
strokeWidth: 2.5
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
})
|
|
123
125
|
}, allowUpload && {
|
|
124
126
|
key: 'upload',
|
|
125
|
-
label: /*#__PURE__*/
|
|
126
|
-
title: (texts === null || texts === void 0 ? void 0 : texts.upload) || 'Upload'
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
label: /*#__PURE__*/_jsx(Tooltip, {
|
|
128
|
+
title: (texts === null || texts === void 0 ? void 0 : texts.upload) || 'Upload',
|
|
129
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
130
|
+
icon: UploadIcon,
|
|
131
|
+
size: {
|
|
132
|
+
fontSize: 20,
|
|
133
|
+
strokeWidth: 2.5
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
})
|
|
134
137
|
}].concat(_toConsumableArray(customTabs.map(function (tab) {
|
|
135
138
|
return {
|
|
136
139
|
key: tab.value,
|
|
@@ -138,9 +141,9 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
138
141
|
};
|
|
139
142
|
}))).filter(Boolean);
|
|
140
143
|
var showTabs = items && items.length > 1;
|
|
141
|
-
return /*#__PURE__*/
|
|
144
|
+
return /*#__PURE__*/_jsx(Popover, {
|
|
142
145
|
arrow: false,
|
|
143
|
-
content: /*#__PURE__*/
|
|
146
|
+
content: /*#__PURE__*/_jsxs(Flexbox, {
|
|
144
147
|
className: cx(styles.picker, popupClassName),
|
|
145
148
|
onMouseEnter: function onMouseEnter() {
|
|
146
149
|
return setActive(true);
|
|
@@ -152,89 +155,95 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
152
155
|
style: _objectSpread({
|
|
153
156
|
minWidth: 310,
|
|
154
157
|
paddingTop: showTabs ? 4 : 0
|
|
155
|
-
}, popupStyle)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
158
|
+
}, popupStyle),
|
|
159
|
+
children: [showTabs && /*#__PURE__*/_jsxs(Flexbox, {
|
|
160
|
+
align: 'center',
|
|
161
|
+
horizontal: true,
|
|
162
|
+
justify: 'space-between',
|
|
163
|
+
paddingInline: 10,
|
|
164
|
+
children: [/*#__PURE__*/_jsx(TabsNav, {
|
|
165
|
+
activeKey: tab,
|
|
166
|
+
items: items,
|
|
167
|
+
onChange: function onChange(key) {
|
|
168
|
+
return setTab(key);
|
|
169
|
+
},
|
|
170
|
+
variant: 'compact'
|
|
171
|
+
}), allowDelete && /*#__PURE__*/_jsx(ActionIcon, {
|
|
172
|
+
icon: TrashIcon,
|
|
173
|
+
onClick: function onClick() {
|
|
174
|
+
handleAvatarChange(defaultAvatar);
|
|
175
|
+
onDelete === null || onDelete === void 0 || onDelete();
|
|
176
|
+
},
|
|
177
|
+
size: {
|
|
178
|
+
fontSize: 20,
|
|
179
|
+
strokeWidth: 2.5
|
|
180
|
+
},
|
|
181
|
+
title: (texts === null || texts === void 0 ? void 0 : texts.delete) || 'Delete'
|
|
182
|
+
})]
|
|
183
|
+
}), tab === 'emoji' && /*#__PURE__*/_jsx(Picker, {
|
|
184
|
+
custom: customEmojis,
|
|
185
|
+
data: data,
|
|
186
|
+
i18n: i18n,
|
|
187
|
+
icons: 'outline',
|
|
188
|
+
locale: locale.split('-')[0],
|
|
189
|
+
navPosition: showTabs ? 'bottom' : 'top',
|
|
190
|
+
onEmojiSelect: function onEmojiSelect(e) {
|
|
191
|
+
return handleAvatarChange(e.src || e.native);
|
|
192
|
+
},
|
|
193
|
+
previewPosition: 'none',
|
|
194
|
+
skinTonePosition: 'none',
|
|
195
|
+
theme: theme.isDarkMode ? 'dark' : 'light'
|
|
196
|
+
}), tab === 'upload' && /*#__PURE__*/_jsx(AvatarUploader, {
|
|
197
|
+
compressSize: compressSize,
|
|
198
|
+
onChange: handleAvatarChange,
|
|
199
|
+
onUpload: onUpload,
|
|
200
|
+
texts: texts
|
|
201
|
+
}), customTabs.map(function (item) {
|
|
202
|
+
return tab === item.value && /*#__PURE__*/_jsx(Flexbox, {
|
|
203
|
+
padding: 10,
|
|
204
|
+
children: item.render(handleAvatarChange)
|
|
205
|
+
}, item.value);
|
|
206
|
+
})]
|
|
207
|
+
}),
|
|
203
208
|
destroyTooltipOnHide: true,
|
|
204
209
|
open: open,
|
|
205
210
|
placement: 'bottomLeft',
|
|
206
211
|
rootClassName: styles.popover,
|
|
207
|
-
trigger: ['click']
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
212
|
+
trigger: ['click'],
|
|
213
|
+
children: /*#__PURE__*/_jsxs(Center, _objectSpread(_objectSpread({
|
|
214
|
+
className: cx(styles.avatar, className),
|
|
215
|
+
flex: 'none',
|
|
216
|
+
height: size,
|
|
217
|
+
onClick: function onClick(e) {
|
|
218
|
+
if (loading) return;
|
|
219
|
+
setOpen(!open);
|
|
220
|
+
_onClick === null || _onClick === void 0 || _onClick(e);
|
|
221
|
+
},
|
|
222
|
+
onMouseEnter: function onMouseEnter() {
|
|
223
|
+
return setActive(true);
|
|
224
|
+
},
|
|
225
|
+
onMouseLeave: function onMouseLeave() {
|
|
226
|
+
return setActive(false);
|
|
227
|
+
},
|
|
228
|
+
width: size
|
|
229
|
+
}, rest), {}, {
|
|
230
|
+
children: [loading && /*#__PURE__*/_jsx(Center, {
|
|
231
|
+
className: styles.loading,
|
|
232
|
+
height: '100%',
|
|
233
|
+
width: '100%',
|
|
234
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
235
|
+
icon: Loader2Icon,
|
|
236
|
+
size: {
|
|
237
|
+
fontSize: size / 2
|
|
238
|
+
},
|
|
239
|
+
spin: true
|
|
240
|
+
})
|
|
241
|
+
}), /*#__PURE__*/_jsx(Avatar, {
|
|
242
|
+
avatar: ava,
|
|
243
|
+
background: backgroundColor,
|
|
244
|
+
size: size
|
|
245
|
+
})]
|
|
246
|
+
}))
|
|
247
|
+
});
|
|
239
248
|
});
|
|
240
249
|
export default EmojiPicker;
|
package/es/EmptyCard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
6
|
var _excluded = ["cover", "visible", "defaultVisible", "onVisibleChange", "alt", "title", "desc", "width", "height", "imageProps"];
|
|
@@ -11,6 +11,8 @@ import useMergeState from 'use-merge-value';
|
|
|
11
11
|
import ActionIcon from "../ActionIcon";
|
|
12
12
|
import Img from "../Img";
|
|
13
13
|
import { useStyles } from "./style";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
var EmptyCard = /*#__PURE__*/memo(function (_ref) {
|
|
15
17
|
var cover = _ref.cover,
|
|
16
18
|
visible = _ref.visible,
|
|
@@ -34,28 +36,34 @@ var EmptyCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
34
36
|
var _useStyles = useStyles(),
|
|
35
37
|
styles = _useStyles.styles;
|
|
36
38
|
if (!value) return null;
|
|
37
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
38
40
|
className: styles.container
|
|
39
|
-
}, rest),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
}, rest), {}, {
|
|
42
|
+
children: [/*#__PURE__*/_jsx(ActionIcon, {
|
|
43
|
+
className: styles.close,
|
|
44
|
+
icon: X,
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
return setValue(false);
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
blockSize: 24,
|
|
50
|
+
fontSize: 16
|
|
51
|
+
}
|
|
52
|
+
}), cover && /*#__PURE__*/_jsx(Img, _objectSpread({
|
|
53
|
+
alt: alt,
|
|
54
|
+
className: styles.image,
|
|
55
|
+
height: height,
|
|
56
|
+
src: cover,
|
|
57
|
+
width: width
|
|
58
|
+
}, imageProps)), /*#__PURE__*/_jsxs("div", {
|
|
59
|
+
className: styles.content,
|
|
60
|
+
children: [title && /*#__PURE__*/_jsx("h3", {
|
|
61
|
+
children: title
|
|
62
|
+
}), desc && /*#__PURE__*/_jsx("p", {
|
|
63
|
+
className: styles.desc,
|
|
64
|
+
children: desc
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
}));
|
|
60
68
|
});
|
|
61
69
|
export default EmptyCard;
|
package/es/FileTypeIcon/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
6
6
|
var _excluded = ["icon", "color", "filetype", "type", "size", "style", "variant", "className"];
|
|
@@ -8,6 +8,8 @@ var _templateObject, _templateObject2;
|
|
|
8
8
|
import { createStyles } from 'antd-style';
|
|
9
9
|
import { memo, useMemo } from 'react';
|
|
10
10
|
import { Center } from 'react-layout-kit';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
var useStyles = createStyles(function (_ref) {
|
|
12
14
|
var css = _ref.css;
|
|
13
15
|
return {
|
|
@@ -41,66 +43,75 @@ var FileTypeIcon = /*#__PURE__*/memo(function (_ref2) {
|
|
|
41
43
|
var isMono = variant === 'mono';
|
|
42
44
|
var iconColor = isMono ? theme.isDarkMode ? theme.colorFill : theme.colorBgContainer : color || theme.geekblue;
|
|
43
45
|
var content;
|
|
44
|
-
content = type === 'file' ? /*#__PURE__*/
|
|
46
|
+
content = type === 'file' ? /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
|
|
45
47
|
className: cx(styles.icon, !icon && className),
|
|
46
48
|
height: size,
|
|
47
49
|
style: icon ? undefined : style,
|
|
48
50
|
viewBox: "0 0 24 24",
|
|
49
51
|
width: size,
|
|
50
52
|
xmlns: "http://www.w3.org/2000/svg"
|
|
51
|
-
}, rest),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
}, rest), {}, {
|
|
54
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
55
|
+
d: "M6 2a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6H6z",
|
|
56
|
+
fill: iconColor
|
|
57
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
58
|
+
d: "M14 2l6 6h-4a2 2 0 01-2-2V2z",
|
|
59
|
+
fill: isMono ? theme.colorFill : '#fff',
|
|
60
|
+
fillOpacity: ".5"
|
|
61
|
+
}), filetypeShort && /*#__PURE__*/_jsx("text", {
|
|
62
|
+
fill: isMono ? theme.colorTextSecondary : '#fff',
|
|
63
|
+
fontSize: fontSize,
|
|
64
|
+
fontWeight: "bold",
|
|
65
|
+
textAnchor: "middle",
|
|
66
|
+
x: "50%",
|
|
67
|
+
y: "70%",
|
|
68
|
+
children: filetypeShort.toUpperCase()
|
|
69
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
70
|
+
d: "M6 2a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6H6z",
|
|
71
|
+
fill: 'transparent',
|
|
72
|
+
stroke: theme.colorFillSecondary,
|
|
73
|
+
strokeWidth: 0.5
|
|
74
|
+
})]
|
|
75
|
+
})) : /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
|
|
71
76
|
className: cx(styles.icon, !icon && className),
|
|
72
77
|
height: size,
|
|
73
78
|
style: icon ? undefined : style,
|
|
74
79
|
viewBox: "0 0 24 24",
|
|
75
80
|
width: size,
|
|
76
81
|
xmlns: "http://www.w3.org/2000/svg"
|
|
77
|
-
}, rest),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
}, rest), {}, {
|
|
83
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
84
|
+
d: "M10.46 5.076l-.92-.752A1.446 1.446 0 008.626 4H3.429c-.38 0-.743.147-1.01.41A1.386 1.386 0 002 5.4v13.2c0 .371.15.727.418.99.268.262.632.41 1.01.41h17.143c.38 0 .743-.148 1.01-.41.268-.263.419-.619.419-.99V6.8c0-.371-.15-.727-.418-.99a1.444 1.444 0 00-1.01-.41h-9.198c-.334 0-.657-.115-.914-.324z",
|
|
85
|
+
fill: iconColor,
|
|
86
|
+
stroke: theme.colorFillSecondary,
|
|
87
|
+
strokeWidth: 0.5
|
|
88
|
+
}), !icon && filetype && /*#__PURE__*/_jsx("text", {
|
|
89
|
+
fill: isMono ? theme.colorTextSecondary : '#fff',
|
|
90
|
+
fontSize: fontSize,
|
|
91
|
+
fontWeight: "bold",
|
|
92
|
+
textAnchor: "middle",
|
|
93
|
+
x: '50%',
|
|
94
|
+
y: "70%",
|
|
95
|
+
children: filetype.toUpperCase()
|
|
96
|
+
})]
|
|
97
|
+
}));
|
|
90
98
|
if (!icon) return content;
|
|
91
|
-
return /*#__PURE__*/
|
|
99
|
+
return /*#__PURE__*/_jsxs(Center, _objectSpread(_objectSpread({
|
|
92
100
|
className: cx(styles.container, className),
|
|
93
101
|
flex: 'none',
|
|
94
102
|
height: size,
|
|
95
103
|
style: style,
|
|
96
104
|
width: size
|
|
97
|
-
}, rest),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
}, rest), {}, {
|
|
106
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
107
|
+
style: {
|
|
108
|
+
fontSize: size / 2.4,
|
|
109
|
+
position: 'absolute',
|
|
110
|
+
top: type === 'file' ? '20%' : '16%',
|
|
111
|
+
zIndex: 1
|
|
112
|
+
},
|
|
113
|
+
children: icon
|
|
114
|
+
}), content]
|
|
115
|
+
}));
|
|
105
116
|
});
|
|
106
117
|
export default FileTypeIcon;
|
package/es/FluentEmoji/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { useCdnFn } from "../ConfigProvider";
|
|
|
8
8
|
import Img from "../Img";
|
|
9
9
|
import { useStyles } from "./style";
|
|
10
10
|
import { genEmojiUrl } from "./utils";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
|
|
12
13
|
var emoji = _ref.emoji,
|
|
13
14
|
className = _ref.className,
|
|
@@ -28,16 +29,17 @@ var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
|
|
|
28
29
|
var emojiUrl = useMemo(function () {
|
|
29
30
|
return genEmojiUrl(emoji, type);
|
|
30
31
|
}, [type, emoji]);
|
|
31
|
-
if (type === 'pure' || !emojiUrl || loadingFail) return /*#__PURE__*/
|
|
32
|
+
if (type === 'pure' || !emojiUrl || loadingFail) return /*#__PURE__*/_jsx(Center, {
|
|
32
33
|
className: cx(styles.container, className),
|
|
33
34
|
flex: 'none',
|
|
34
35
|
height: size,
|
|
35
36
|
style: _objectSpread({
|
|
36
37
|
fontSize: size * 0.9
|
|
37
38
|
}, style),
|
|
38
|
-
width: size
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
width: size,
|
|
40
|
+
children: emoji
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/_jsx(Img, {
|
|
41
43
|
alt: emoji,
|
|
42
44
|
className: className,
|
|
43
45
|
height: size,
|