@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
|
@@ -6,8 +6,6 @@ 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";
|
|
11
9
|
var Dragger = Upload.Dragger;
|
|
12
10
|
var createUploadImageHandler = function createUploadImageHandler(onUploadImage) {
|
|
13
11
|
return function (file) {
|
|
@@ -52,78 +50,69 @@ var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
|
52
50
|
});
|
|
53
51
|
onUpload === null || onUpload === void 0 || onUpload(file);
|
|
54
52
|
};
|
|
55
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/React.createElement(Flexbox, {
|
|
56
54
|
padding: 10,
|
|
57
55
|
style: {
|
|
58
56
|
position: 'relative'
|
|
59
57
|
},
|
|
60
|
-
width: '100%'
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
});
|
|
58
|
+
width: '100%'
|
|
59
|
+
}, !previewImage && /*#__PURE__*/React.createElement(Dragger, {
|
|
60
|
+
accept: 'image',
|
|
61
|
+
beforeUpload: beforeUpload,
|
|
62
|
+
itemRender: function itemRender() {
|
|
63
|
+
return void 0;
|
|
64
|
+
},
|
|
65
|
+
maxCount: 1,
|
|
66
|
+
multiple: false
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Center, {
|
|
68
|
+
gap: 16,
|
|
69
|
+
height: compressSize,
|
|
70
|
+
width: compressSize
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
72
|
+
icon: ImageUpIcon,
|
|
73
|
+
size: {
|
|
74
|
+
fontSize: 48,
|
|
75
|
+
strokeWidth: 1.5
|
|
76
|
+
}
|
|
77
|
+
}), /*#__PURE__*/React.createElement("div", null, (texts === null || texts === void 0 ? void 0 : texts.draggerDesc) || 'Click or Drag image to this area to upload'))), previewImage && /*#__PURE__*/React.createElement(Center, {
|
|
78
|
+
gap: 8,
|
|
79
|
+
style: {
|
|
80
|
+
position: 'relative'
|
|
81
|
+
},
|
|
82
|
+
width: '100%'
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Flexbox, {
|
|
84
|
+
className: styles.editor
|
|
85
|
+
}, /*#__PURE__*/React.createElement(AvatarEditor, {
|
|
86
|
+
border: 0,
|
|
87
|
+
borderRadius: compressSize / 2,
|
|
88
|
+
height: compressSize,
|
|
89
|
+
image: previewImage,
|
|
90
|
+
ref: editor,
|
|
91
|
+
width: compressSize
|
|
92
|
+
})), /*#__PURE__*/React.createElement(Flexbox, {
|
|
93
|
+
gap: 8,
|
|
94
|
+
horizontal: true,
|
|
95
|
+
style: {
|
|
96
|
+
position: 'relative'
|
|
97
|
+
},
|
|
98
|
+
width: '100%'
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
100
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
+
icon: ChevronLeftIcon
|
|
102
|
+
}),
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
return setPreviewImage('');
|
|
105
|
+
},
|
|
106
|
+
style: {
|
|
107
|
+
flex: 'none'
|
|
108
|
+
}
|
|
109
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
110
|
+
onClick: handleUpload,
|
|
111
|
+
style: {
|
|
112
|
+
flex: 1,
|
|
113
|
+
fontWeight: 500
|
|
114
|
+
},
|
|
115
|
+
type: 'primary'
|
|
116
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.uploadBtn) || 'Crop and Upload'))));
|
|
128
117
|
});
|
|
129
118
|
export default AvatarUploader;
|
package/es/EmojiPicker/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 _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
6
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
@@ -22,8 +23,6 @@ import TabsNav from "../TabsNav";
|
|
|
22
23
|
import Tooltip from "../Tooltip";
|
|
23
24
|
import AvatarUploader from "./AvatarUploader";
|
|
24
25
|
import { useStyles } from "./style";
|
|
25
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
26
|
var DEFAULT_AVATAR = '🤖';
|
|
28
27
|
var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
29
28
|
var value = _ref.value,
|
|
@@ -112,28 +111,26 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
112
111
|
}, [active, open]);
|
|
113
112
|
var items = [{
|
|
114
113
|
key: 'emoji',
|
|
115
|
-
label: /*#__PURE__*/
|
|
116
|
-
title: (texts === null || texts === void 0 ? void 0 : texts.emoji) || 'Emoji'
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
})
|
|
114
|
+
label: /*#__PURE__*/React.createElement(Tooltip, {
|
|
115
|
+
title: (texts === null || texts === void 0 ? void 0 : texts.emoji) || 'Emoji'
|
|
116
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
117
|
+
icon: SmileIcon,
|
|
118
|
+
size: {
|
|
119
|
+
fontSize: 20,
|
|
120
|
+
strokeWidth: 2.5
|
|
121
|
+
}
|
|
122
|
+
}))
|
|
125
123
|
}, allowUpload && {
|
|
126
124
|
key: 'upload',
|
|
127
|
-
label: /*#__PURE__*/
|
|
128
|
-
title: (texts === null || texts === void 0 ? void 0 : texts.upload) || 'Upload'
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})
|
|
125
|
+
label: /*#__PURE__*/React.createElement(Tooltip, {
|
|
126
|
+
title: (texts === null || texts === void 0 ? void 0 : texts.upload) || 'Upload'
|
|
127
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
128
|
+
icon: UploadIcon,
|
|
129
|
+
size: {
|
|
130
|
+
fontSize: 20,
|
|
131
|
+
strokeWidth: 2.5
|
|
132
|
+
}
|
|
133
|
+
}))
|
|
137
134
|
}].concat(_toConsumableArray(customTabs.map(function (tab) {
|
|
138
135
|
return {
|
|
139
136
|
key: tab.value,
|
|
@@ -141,9 +138,9 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
141
138
|
};
|
|
142
139
|
}))).filter(Boolean);
|
|
143
140
|
var showTabs = items && items.length > 1;
|
|
144
|
-
return /*#__PURE__*/
|
|
141
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
145
142
|
arrow: false,
|
|
146
|
-
content: /*#__PURE__*/
|
|
143
|
+
content: /*#__PURE__*/React.createElement(Flexbox, {
|
|
147
144
|
className: cx(styles.picker, popupClassName),
|
|
148
145
|
onMouseEnter: function onMouseEnter() {
|
|
149
146
|
return setActive(true);
|
|
@@ -155,95 +152,89 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
155
152
|
style: _objectSpread({
|
|
156
153
|
minWidth: 310,
|
|
157
154
|
paddingTop: showTabs ? 4 : 0
|
|
158
|
-
}, popupStyle)
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
})]
|
|
207
|
-
}),
|
|
155
|
+
}, popupStyle)
|
|
156
|
+
}, showTabs && /*#__PURE__*/React.createElement(Flexbox, {
|
|
157
|
+
align: 'center',
|
|
158
|
+
horizontal: true,
|
|
159
|
+
justify: 'space-between',
|
|
160
|
+
paddingInline: 10
|
|
161
|
+
}, /*#__PURE__*/React.createElement(TabsNav, {
|
|
162
|
+
activeKey: tab,
|
|
163
|
+
items: items,
|
|
164
|
+
onChange: function onChange(key) {
|
|
165
|
+
return setTab(key);
|
|
166
|
+
},
|
|
167
|
+
variant: 'compact'
|
|
168
|
+
}), allowDelete && /*#__PURE__*/React.createElement(ActionIcon, {
|
|
169
|
+
icon: TrashIcon,
|
|
170
|
+
onClick: function onClick() {
|
|
171
|
+
handleAvatarChange(defaultAvatar);
|
|
172
|
+
onDelete === null || onDelete === void 0 || onDelete();
|
|
173
|
+
},
|
|
174
|
+
size: {
|
|
175
|
+
fontSize: 20,
|
|
176
|
+
strokeWidth: 2.5
|
|
177
|
+
},
|
|
178
|
+
title: (texts === null || texts === void 0 ? void 0 : texts.delete) || 'Delete'
|
|
179
|
+
})), tab === 'emoji' && /*#__PURE__*/React.createElement(Picker, {
|
|
180
|
+
custom: customEmojis,
|
|
181
|
+
data: data,
|
|
182
|
+
i18n: i18n,
|
|
183
|
+
icons: 'outline',
|
|
184
|
+
locale: locale.split('-')[0],
|
|
185
|
+
navPosition: showTabs ? 'bottom' : 'top',
|
|
186
|
+
onEmojiSelect: function onEmojiSelect(e) {
|
|
187
|
+
return handleAvatarChange(e.src || e.native);
|
|
188
|
+
},
|
|
189
|
+
previewPosition: 'none',
|
|
190
|
+
skinTonePosition: 'none',
|
|
191
|
+
theme: theme.isDarkMode ? 'dark' : 'light'
|
|
192
|
+
}), tab === 'upload' && /*#__PURE__*/React.createElement(AvatarUploader, {
|
|
193
|
+
compressSize: compressSize,
|
|
194
|
+
onChange: handleAvatarChange,
|
|
195
|
+
onUpload: onUpload,
|
|
196
|
+
texts: texts
|
|
197
|
+
}), customTabs.map(function (item) {
|
|
198
|
+
return tab === item.value && /*#__PURE__*/React.createElement(Flexbox, {
|
|
199
|
+
key: item.value,
|
|
200
|
+
padding: 10
|
|
201
|
+
}, item.render(handleAvatarChange));
|
|
202
|
+
})),
|
|
208
203
|
destroyTooltipOnHide: true,
|
|
209
204
|
open: open,
|
|
210
205
|
placement: 'bottomLeft',
|
|
211
206
|
rootClassName: styles.popover,
|
|
212
|
-
trigger: ['click']
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
size: size
|
|
245
|
-
})]
|
|
246
|
-
}))
|
|
247
|
-
});
|
|
207
|
+
trigger: ['click']
|
|
208
|
+
}, /*#__PURE__*/React.createElement(Center, _extends({
|
|
209
|
+
className: cx(styles.avatar, className),
|
|
210
|
+
flex: 'none',
|
|
211
|
+
height: size,
|
|
212
|
+
onClick: function onClick(e) {
|
|
213
|
+
if (loading) return;
|
|
214
|
+
setOpen(!open);
|
|
215
|
+
_onClick === null || _onClick === void 0 || _onClick(e);
|
|
216
|
+
},
|
|
217
|
+
onMouseEnter: function onMouseEnter() {
|
|
218
|
+
return setActive(true);
|
|
219
|
+
},
|
|
220
|
+
onMouseLeave: function onMouseLeave() {
|
|
221
|
+
return setActive(false);
|
|
222
|
+
},
|
|
223
|
+
width: size
|
|
224
|
+
}, rest), loading && /*#__PURE__*/React.createElement(Center, {
|
|
225
|
+
className: styles.loading,
|
|
226
|
+
height: '100%',
|
|
227
|
+
width: '100%'
|
|
228
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
229
|
+
icon: Loader2Icon,
|
|
230
|
+
size: {
|
|
231
|
+
fontSize: size / 2
|
|
232
|
+
},
|
|
233
|
+
spin: true
|
|
234
|
+
})), /*#__PURE__*/React.createElement(Avatar, {
|
|
235
|
+
avatar: ava,
|
|
236
|
+
background: backgroundColor,
|
|
237
|
+
size: size
|
|
238
|
+
})));
|
|
248
239
|
});
|
|
249
240
|
export default EmojiPicker;
|
package/es/EmptyCard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
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,8 +11,6 @@ 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";
|
|
16
14
|
var EmptyCard = /*#__PURE__*/memo(function (_ref) {
|
|
17
15
|
var cover = _ref.cover,
|
|
18
16
|
visible = _ref.visible,
|
|
@@ -36,34 +34,28 @@ var EmptyCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
36
34
|
var _useStyles = useStyles(),
|
|
37
35
|
styles = _useStyles.styles;
|
|
38
36
|
if (!value) return null;
|
|
39
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React.createElement(Flexbox, _extends({
|
|
40
38
|
className: styles.container
|
|
41
|
-
}, rest),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}), desc && /*#__PURE__*/_jsx("p", {
|
|
63
|
-
className: styles.desc,
|
|
64
|
-
children: desc
|
|
65
|
-
})]
|
|
66
|
-
})]
|
|
67
|
-
}));
|
|
39
|
+
}, rest), /*#__PURE__*/React.createElement(ActionIcon, {
|
|
40
|
+
className: styles.close,
|
|
41
|
+
icon: X,
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
return setValue(false);
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
blockSize: 24,
|
|
47
|
+
fontSize: 16
|
|
48
|
+
}
|
|
49
|
+
}), cover && /*#__PURE__*/React.createElement(Img, _extends({
|
|
50
|
+
alt: alt,
|
|
51
|
+
className: styles.image,
|
|
52
|
+
height: height,
|
|
53
|
+
src: cover,
|
|
54
|
+
width: width
|
|
55
|
+
}, imageProps)), /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: styles.content
|
|
57
|
+
}, title && /*#__PURE__*/React.createElement("h3", null, title), desc && /*#__PURE__*/React.createElement("p", {
|
|
58
|
+
className: styles.desc
|
|
59
|
+
}, desc)));
|
|
68
60
|
});
|
|
69
61
|
export default EmptyCard;
|
package/es/FileTypeIcon/index.js
CHANGED
|
@@ -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
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
6
6
|
var _excluded = ["icon", "color", "filetype", "type", "size", "style", "variant", "className"];
|
|
@@ -8,8 +8,6 @@ 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";
|
|
13
11
|
var useStyles = createStyles(function (_ref) {
|
|
14
12
|
var css = _ref.css;
|
|
15
13
|
return {
|
|
@@ -43,75 +41,66 @@ var FileTypeIcon = /*#__PURE__*/memo(function (_ref2) {
|
|
|
43
41
|
var isMono = variant === 'mono';
|
|
44
42
|
var iconColor = isMono ? theme.isDarkMode ? theme.colorFill : theme.colorBgContainer : color || theme.geekblue;
|
|
45
43
|
var content;
|
|
46
|
-
content = type === 'file' ? /*#__PURE__*/
|
|
44
|
+
content = type === 'file' ? /*#__PURE__*/React.createElement("svg", _extends({
|
|
47
45
|
className: cx(styles.icon, !icon && className),
|
|
48
46
|
height: size,
|
|
49
47
|
style: icon ? undefined : style,
|
|
50
48
|
viewBox: "0 0 24 24",
|
|
51
49
|
width: size,
|
|
52
50
|
xmlns: "http://www.w3.org/2000/svg"
|
|
53
|
-
}, rest),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
strokeWidth: 0.5
|
|
74
|
-
})]
|
|
75
|
-
})) : /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
|
|
51
|
+
}, rest), /*#__PURE__*/React.createElement("path", {
|
|
52
|
+
d: "M6 2a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6H6z",
|
|
53
|
+
fill: iconColor
|
|
54
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
55
|
+
d: "M14 2l6 6h-4a2 2 0 01-2-2V2z",
|
|
56
|
+
fill: isMono ? theme.colorFill : '#fff',
|
|
57
|
+
fillOpacity: ".5"
|
|
58
|
+
}), filetypeShort && /*#__PURE__*/React.createElement("text", {
|
|
59
|
+
fill: isMono ? theme.colorTextSecondary : '#fff',
|
|
60
|
+
fontSize: fontSize,
|
|
61
|
+
fontWeight: "bold",
|
|
62
|
+
textAnchor: "middle",
|
|
63
|
+
x: "50%",
|
|
64
|
+
y: "70%"
|
|
65
|
+
}, filetypeShort.toUpperCase()), /*#__PURE__*/React.createElement("path", {
|
|
66
|
+
d: "M6 2a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6H6z",
|
|
67
|
+
fill: 'transparent',
|
|
68
|
+
stroke: theme.colorFillSecondary,
|
|
69
|
+
strokeWidth: 0.5
|
|
70
|
+
})) : /*#__PURE__*/React.createElement("svg", _extends({
|
|
76
71
|
className: cx(styles.icon, !icon && className),
|
|
77
72
|
height: size,
|
|
78
73
|
style: icon ? undefined : style,
|
|
79
74
|
viewBox: "0 0 24 24",
|
|
80
75
|
width: size,
|
|
81
76
|
xmlns: "http://www.w3.org/2000/svg"
|
|
82
|
-
}, rest),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
children: filetype.toUpperCase()
|
|
96
|
-
})]
|
|
97
|
-
}));
|
|
77
|
+
}, rest), /*#__PURE__*/React.createElement("path", {
|
|
78
|
+
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",
|
|
79
|
+
fill: iconColor,
|
|
80
|
+
stroke: theme.colorFillSecondary,
|
|
81
|
+
strokeWidth: 0.5
|
|
82
|
+
}), !icon && filetype && /*#__PURE__*/React.createElement("text", {
|
|
83
|
+
fill: isMono ? theme.colorTextSecondary : '#fff',
|
|
84
|
+
fontSize: fontSize,
|
|
85
|
+
fontWeight: "bold",
|
|
86
|
+
textAnchor: "middle",
|
|
87
|
+
x: '50%',
|
|
88
|
+
y: "70%"
|
|
89
|
+
}, filetype.toUpperCase()));
|
|
98
90
|
if (!icon) return content;
|
|
99
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/React.createElement(Center, _extends({
|
|
100
92
|
className: cx(styles.container, className),
|
|
101
93
|
flex: 'none',
|
|
102
94
|
height: size,
|
|
103
95
|
style: style,
|
|
104
96
|
width: size
|
|
105
|
-
}, rest),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
children: icon
|
|
114
|
-
}), content]
|
|
115
|
-
}));
|
|
97
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
style: {
|
|
99
|
+
fontSize: size / 2.4,
|
|
100
|
+
position: 'absolute',
|
|
101
|
+
top: type === 'file' ? '20%' : '16%',
|
|
102
|
+
zIndex: 1
|
|
103
|
+
}
|
|
104
|
+
}, icon), content);
|
|
116
105
|
});
|
|
117
106
|
export default FileTypeIcon;
|
package/es/FluentEmoji/index.js
CHANGED
|
@@ -8,7 +8,6 @@ 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";
|
|
12
11
|
var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
|
|
13
12
|
var emoji = _ref.emoji,
|
|
14
13
|
className = _ref.className,
|
|
@@ -29,17 +28,16 @@ var FluentEmoji = /*#__PURE__*/memo(function (_ref) {
|
|
|
29
28
|
var emojiUrl = useMemo(function () {
|
|
30
29
|
return genEmojiUrl(emoji, type);
|
|
31
30
|
}, [type, emoji]);
|
|
32
|
-
if (type === 'pure' || !emojiUrl || loadingFail) return /*#__PURE__*/
|
|
31
|
+
if (type === 'pure' || !emojiUrl || loadingFail) return /*#__PURE__*/React.createElement(Center, {
|
|
33
32
|
className: cx(styles.container, className),
|
|
34
33
|
flex: 'none',
|
|
35
34
|
height: size,
|
|
36
35
|
style: _objectSpread({
|
|
37
36
|
fontSize: size * 0.9
|
|
38
37
|
}, style),
|
|
39
|
-
width: size
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return /*#__PURE__*/_jsx(Img, {
|
|
38
|
+
width: size
|
|
39
|
+
}, emoji);
|
|
40
|
+
return /*#__PURE__*/React.createElement(Img, {
|
|
43
41
|
alt: emoji,
|
|
44
42
|
className: className,
|
|
45
43
|
height: size,
|