@lobehub/ui 2.24.2 → 2.25.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/Accordion/Accordion.js +1 -1
- package/es/Accordion/AccordionItem.js +2 -2
- package/es/Accordion/type.d.ts +1 -1
- package/es/ActionIcon/ActionIcon.js +3 -3
- package/es/Collapse/Collapse.js +0 -1
- package/es/DraggableSideNav/style.js +1 -1
- package/es/Drawer/Drawer.js +4 -4
- package/es/EmojiPicker/AvatarUploader.d.ts +1 -10
- package/es/EmojiPicker/AvatarUploader.js +34 -13
- package/es/EmojiPicker/EmojiPicker.js +5 -2
- package/es/EmojiPicker/style.d.ts +0 -1
- package/es/EmojiPicker/style.js +5 -6
- package/es/EmojiPicker/type.d.ts +11 -1
- package/es/Form/components/FormSubmitFooter.js +1 -1
- package/es/FormModal/FormModal.js +8 -6
- package/es/FormModal/type.d.ts +5 -5
- package/es/Highlighter/LangSelect.d.ts +1 -1
- package/es/Image/Image.js +8 -6
- package/es/Image/components/usePreviewGroup.d.ts +2 -2
- package/es/Image/components/usePreviewGroup.js +15 -22
- package/es/Image/type.d.ts +5 -4
- package/es/Modal/Modal.js +9 -13
- package/es/Modal/style.js +2 -2
- package/es/Tag/Tag.js +2 -2
- package/es/Tag/type.d.ts +1 -1
- package/es/Toc/TocMobile.js +0 -1
- package/es/awesome/TypewriterEffect/TypewriterEffect.js +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.js +7 -3
- package/package.json +20 -20
|
@@ -20,7 +20,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
20
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
21
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
22
|
import { Divider } from 'antd';
|
|
23
|
-
import { LayoutGroup } from '
|
|
23
|
+
import { LayoutGroup } from 'motion/react';
|
|
24
24
|
import { Children, Fragment, forwardRef, isValidElement, memo, useCallback } from 'react';
|
|
25
25
|
import useMergeState from 'use-merge-value';
|
|
26
26
|
import { AccordionContext } from "./context";
|
|
@@ -6,7 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
import { LazyMotion, m } from '
|
|
9
|
+
import { LazyMotion, m } from 'motion/react';
|
|
10
10
|
import { memo, useCallback, useMemo } from 'react';
|
|
11
11
|
import { Flexbox } from 'react-layout-kit';
|
|
12
12
|
import Block from "../Block";
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
20
|
var loadFeatures = function loadFeatures() {
|
|
21
|
-
return import('
|
|
21
|
+
return import('motion/react').then(function (res) {
|
|
22
22
|
return res.domAnimation;
|
|
23
23
|
});
|
|
24
24
|
};
|
package/es/Accordion/type.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
|
|
|
111
111
|
*/
|
|
112
112
|
keepContentMounted?: boolean;
|
|
113
113
|
/**
|
|
114
|
-
* Motion props for
|
|
114
|
+
* Motion props for motion animation
|
|
115
115
|
*/
|
|
116
116
|
motionProps?: any;
|
|
117
117
|
/**
|
|
@@ -149,10 +149,10 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
149
149
|
return /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
150
150
|
title: title
|
|
151
151
|
}, tooltipProps), {}, {
|
|
152
|
-
styles: _objectSpread(_objectSpread({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.styles), {}, {
|
|
153
|
-
|
|
152
|
+
styles: typeof (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.styles) === 'function' ? tooltipProps.styles : _objectSpread(_objectSpread({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.styles), {}, {
|
|
153
|
+
container: _objectSpread({
|
|
154
154
|
pointerEvents: 'none'
|
|
155
|
-
}, tooltipProps === null || tooltipProps === void 0 || (_tooltipProps$styles = tooltipProps.styles) === null || _tooltipProps$styles === void 0 ? void 0 : _tooltipProps$styles.
|
|
155
|
+
}, tooltipProps === null || tooltipProps === void 0 || (_tooltipProps$styles = tooltipProps.styles) === null || _tooltipProps$styles === void 0 ? void 0 : _tooltipProps$styles.container)
|
|
156
156
|
}),
|
|
157
157
|
children: node
|
|
158
158
|
}));
|
package/es/Collapse/Collapse.js
CHANGED
|
@@ -19,7 +19,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
19
19
|
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* Width transition controlled by inline style */\n\n /* Ensure smooth animations */\n will-change: width;\n\n position: relative;\n\n display: flex;\n flex-direction: column;\n\n height: 100%;\n "]))),
|
|
20
20
|
contentContainer: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n height: 100%;\n border-inline-end: ", " solid ", ";\n\n background: ", ";\n "])), showBorder ? '1px' : '0', token.colorBorderSecondary, backgroundColor || token.colorBgLayout),
|
|
21
21
|
footer: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n "]))),
|
|
22
|
-
handlerIcon: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /* Icon transitions are now handled by
|
|
22
|
+
handlerIcon: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n /* Icon transitions are now handled by motion */\n display: flex;\n align-items: center;\n justify-content: center;\n "]))),
|
|
23
23
|
header: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n "]))),
|
|
24
24
|
menuOverride: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .", "-menu {\n .", "-menu-item {\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n\n height: unset;\n min-height: 36px;\n padding-block: 4px;\n padding-inline: 8px !important;\n }\n\n .", "-menu-item-group-title {\n overflow: hidden;\n padding-inline: 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .", "-menu-item-icon {\n position: absolute;\n inset-inline-start: 0;\n\n display: flex !important;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: 36px;\n height: 36px;\n }\n\n .", "-menu-title-content {\n overflow: hidden;\n flex: 1;\n\n margin: 0 !important;\n padding-inline-start: 36px;\n\n line-height: 1.5;\n }\n\n &.", "-menu-inline-collapsed {\n .ant-menu-title-content {\n display: none;\n width: 0;\n opacity: 0;\n }\n\n .", "-menu-item {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 36px !important;\n height: 36px !important;\n }\n }\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls, prefixCls),
|
|
25
25
|
resizeHandle: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: col-resize;\n\n position: absolute;\n inset-block: 0 0;\n\n width: 8px;\n\n transition: background-color 0.2s ease;\n\n &::after {\n content: '';\n\n position: absolute;\n inset-block: 0;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n\n width: 2px;\n\n background: transparent;\n\n transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);\n }\n "]))),
|
package/es/Drawer/Drawer.js
CHANGED
|
@@ -126,20 +126,20 @@ var Drawer = /*#__PURE__*/memo(function (_ref) {
|
|
|
126
126
|
onClose: onClose,
|
|
127
127
|
panelRef: ref,
|
|
128
128
|
placement: placement,
|
|
129
|
-
styles: _objectSpread(_objectSpread({}, styles), {}, {
|
|
129
|
+
styles: typeof styles === 'function' ? styles : _objectSpread(_objectSpread({}, styles), {}, {
|
|
130
130
|
body: _objectSpread({
|
|
131
131
|
background: 'transparent',
|
|
132
132
|
paddingBlock: sidebar ? 0 : 12,
|
|
133
133
|
paddingInline: sidebar ? 0 : 16
|
|
134
134
|
}, styles === null || styles === void 0 ? void 0 : styles.body),
|
|
135
|
-
content: _objectSpread({
|
|
136
|
-
background: sidebar ? "linear-gradient(to right, ".concat(theme.colorBgLayout, " 49.9%, ").concat(theme.colorBgContainer, " 50%)") : theme.colorBgContainer
|
|
137
|
-
}, styles === null || styles === void 0 ? void 0 : styles.content),
|
|
138
135
|
header: _objectSpread({
|
|
139
136
|
background: 'transparent',
|
|
140
137
|
display: noHeader ? 'none' : undefined,
|
|
141
138
|
padding: 4
|
|
142
139
|
}, styles === null || styles === void 0 ? void 0 : styles.header),
|
|
140
|
+
section: _objectSpread({
|
|
141
|
+
background: sidebar ? "linear-gradient(to right, ".concat(theme.colorBgLayout, " 49.9%, ").concat(theme.colorBgContainer, " 50%)") : theme.colorBgContainer
|
|
142
|
+
}, styles === null || styles === void 0 ? void 0 : styles.section),
|
|
143
143
|
wrapper: _objectSpread(_objectSpread({
|
|
144
144
|
background: theme.colorBgContainer
|
|
145
145
|
}, headerBorder), styles === null || styles === void 0 ? void 0 : styles.wrapper)
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
compressSize?: number;
|
|
4
|
-
onChange: (avatar: string) => void;
|
|
5
|
-
onUpload?: (file: File) => void;
|
|
6
|
-
texts?: {
|
|
7
|
-
draggerDesc?: string;
|
|
8
|
-
fileTypeError?: string;
|
|
9
|
-
uploadBtn?: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
2
|
+
import { AvatarUploaderProps } from './type';
|
|
12
3
|
declare const AvatarUploader: import("react").NamedExoticComponent<AvatarUploaderProps>;
|
|
13
4
|
export default AvatarUploader;
|
|
@@ -7,13 +7,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7
7
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
9
|
import { Upload, message } from 'antd';
|
|
10
|
+
import { useTheme } from 'antd-style';
|
|
10
11
|
import { ChevronLeftIcon, ImageUpIcon } from 'lucide-react';
|
|
11
12
|
import { memo, useCallback, useRef, useState } from 'react';
|
|
12
13
|
import AvatarEditor from 'react-avatar-editor';
|
|
13
14
|
import { Center, Flexbox } from 'react-layout-kit';
|
|
14
15
|
import Button from "../Button";
|
|
15
16
|
import Icon from "../Icon";
|
|
16
|
-
import
|
|
17
|
+
import Tag from "../Tag";
|
|
18
|
+
import Text from "../Text";
|
|
17
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
21
|
var Dragger = Upload.Dragger;
|
|
@@ -27,7 +29,8 @@ var createUploadImageHandler = function createUploadImageHandler(onUploadImage)
|
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
30
|
-
var
|
|
32
|
+
var shape = _ref.shape,
|
|
33
|
+
onChange = _ref.onChange,
|
|
31
34
|
texts = _ref.texts,
|
|
32
35
|
_ref$compressSize = _ref.compressSize,
|
|
33
36
|
compressSize = _ref$compressSize === void 0 ? 256 : _ref$compressSize,
|
|
@@ -37,12 +40,11 @@ var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
|
37
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
41
|
previewImage = _useState2[0],
|
|
39
42
|
setPreviewImage = _useState2[1];
|
|
40
|
-
var
|
|
41
|
-
styles = _useStyles.styles;
|
|
43
|
+
var theme = useTheme();
|
|
42
44
|
var beforeUpload = useCallback(function (file) {
|
|
43
|
-
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
45
|
+
var isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/webp';
|
|
44
46
|
if (!isJpgOrPng) {
|
|
45
|
-
message.error((texts === null || texts === void 0 ? void 0 : texts.fileTypeError) || 'You can only upload
|
|
47
|
+
message.error((texts === null || texts === void 0 ? void 0 : texts.fileTypeError) || 'You can only upload image file!');
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
50
|
return createUploadImageHandler(function (avatar) {
|
|
@@ -55,10 +57,16 @@ var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
|
55
57
|
var dataUrl = canvasScaled.toDataURL();
|
|
56
58
|
onChange(dataUrl);
|
|
57
59
|
if (!onUpload) return;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
|
|
61
|
+
// 使用 toBlob 直接获取 Blob,然后创建 File 对象
|
|
62
|
+
canvasScaled.toBlob(function (blob) {
|
|
63
|
+
if (blob) {
|
|
64
|
+
var file = new File([blob], 'avatar.webp', {
|
|
65
|
+
type: 'image/webp'
|
|
66
|
+
});
|
|
67
|
+
onUpload(file);
|
|
68
|
+
}
|
|
69
|
+
}, 'image/webp', 0.95); // 0.95 是图片质量
|
|
62
70
|
};
|
|
63
71
|
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
64
72
|
padding: 10,
|
|
@@ -79,10 +87,24 @@ var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
|
79
87
|
height: compressSize,
|
|
80
88
|
width: compressSize,
|
|
81
89
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
90
|
+
color: theme.colorTextDescription,
|
|
82
91
|
icon: ImageUpIcon,
|
|
83
92
|
size: 48
|
|
84
|
-
}), /*#__PURE__*/_jsx(
|
|
93
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
94
|
+
color: theme.colorTextSecondary,
|
|
85
95
|
children: (texts === null || texts === void 0 ? void 0 : texts.draggerDesc) || 'Click or Drag image to this area to upload'
|
|
96
|
+
}), /*#__PURE__*/_jsxs(Center, {
|
|
97
|
+
gap: 4,
|
|
98
|
+
horizontal: true,
|
|
99
|
+
children: [/*#__PURE__*/_jsx(Tag, {
|
|
100
|
+
children: "JPG"
|
|
101
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
102
|
+
children: "PNG"
|
|
103
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
104
|
+
children: "GIF"
|
|
105
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
106
|
+
children: "WEBP"
|
|
107
|
+
})]
|
|
86
108
|
})]
|
|
87
109
|
})
|
|
88
110
|
}), previewImage && /*#__PURE__*/_jsxs(Center, {
|
|
@@ -93,8 +115,7 @@ var AvatarUploader = /*#__PURE__*/memo(function (_ref) {
|
|
|
93
115
|
width: '100%',
|
|
94
116
|
children: [/*#__PURE__*/_jsx(AvatarEditor, {
|
|
95
117
|
border: 0,
|
|
96
|
-
borderRadius: compressSize / 2,
|
|
97
|
-
className: styles.editor,
|
|
118
|
+
borderRadius: shape === 'square' ? undefined : compressSize / 2,
|
|
98
119
|
height: compressSize,
|
|
99
120
|
image: previewImage,
|
|
100
121
|
ref: editor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _excluded = ["value", "defaultAvatar", "onChange", "locale", "allowUpload", "allowDelete", "texts", "onDelete", "compressSize", "customEmojis", "className", "loading", "onUpload", "customTabs", "popupClassName", "popupStyle", "customRender", "open", "defaultOpen", "onOpenChange", "popupProps"];
|
|
4
|
+
var _excluded = ["value", "defaultAvatar", "onChange", "locale", "allowUpload", "allowDelete", "texts", "onDelete", "compressSize", "customEmojis", "className", "loading", "onUpload", "customTabs", "popupClassName", "popupStyle", "customRender", "open", "defaultOpen", "onOpenChange", "popupProps", "shape"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -67,6 +67,7 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
67
67
|
defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
|
|
68
68
|
onOpenChange = _ref.onOpenChange,
|
|
69
69
|
popupProps = _ref.popupProps,
|
|
70
|
+
shape = _ref.shape,
|
|
70
71
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
71
72
|
var ref = useRef(null);
|
|
72
73
|
var _useMergeState = useMergeState(defaultOpen, {
|
|
@@ -196,6 +197,7 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
196
197
|
compressSize: compressSize,
|
|
197
198
|
onChange: handleAvatarChange,
|
|
198
199
|
onUpload: onUpload,
|
|
200
|
+
shape: shape,
|
|
199
201
|
texts: texts
|
|
200
202
|
}), customTabs.map(function (item) {
|
|
201
203
|
return tab === item.value && /*#__PURE__*/_jsx(Flexbox, {
|
|
@@ -220,7 +222,8 @@ var EmojiPicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
220
222
|
children: customRender ? customRender(ava) : /*#__PURE__*/_jsx(Avatar, _objectSpread({
|
|
221
223
|
avatar: ava,
|
|
222
224
|
className: cx(styles.root, className),
|
|
223
|
-
loading: loading
|
|
225
|
+
loading: loading,
|
|
226
|
+
shape: shape
|
|
224
227
|
}, rest))
|
|
225
228
|
}));
|
|
226
229
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
-
editor: import("antd-style").SerializedStyles;
|
|
3
2
|
picker: import("antd-style").SerializedStyles;
|
|
4
3
|
popover: import("antd-style").SerializedStyles;
|
|
5
4
|
root: import("antd-style").SerializedStyles;
|
package/es/EmojiPicker/style.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import chroma from 'chroma-js';
|
|
@@ -7,10 +7,9 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
7
7
|
token = _ref.token,
|
|
8
8
|
prefixCls = _ref.prefixCls;
|
|
9
9
|
return {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
tabs: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-block-end: 1px solid ", ";\n\n .ant-tabs-tab {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 32px;\n height: 32px;\n padding: 0 !important;\n }\n "])), token.colorBorderSecondary)
|
|
10
|
+
picker: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n em-emoji-picker {\n --rgb-accent: ", ";\n --shadow: none;\n --rgb-background: ", ";\n --border-radius: 0;\n }\n "])), chroma(token.colorPrimary).rgb().join(','), chroma(token.colorBgElevated).rgb().join(',')),
|
|
11
|
+
popover: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-popover-container {\n overflow: hidden;\n padding: 0;\n }\n "])), prefixCls),
|
|
12
|
+
root: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n transition: background 150ms ", ";\n\n &:hover {\n background: ", ";\n }\n "])), token.motionEaseOut, token.colorFillSecondary),
|
|
13
|
+
tabs: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-block-end: 1px solid ", ";\n\n .ant-tabs-tab {\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 32px;\n height: 32px;\n padding: 0 !important;\n }\n "])), token.colorBorderSecondary)
|
|
15
14
|
};
|
|
16
15
|
});
|
package/es/EmojiPicker/type.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { PopoverProps } from 'antd';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import type { AvatarProps } from "../Avatar/type";
|
|
4
|
-
|
|
4
|
+
export interface AvatarUploaderProps {
|
|
5
|
+
compressSize?: number;
|
|
6
|
+
onChange: (avatar: string) => void;
|
|
7
|
+
onUpload?: (file: File) => void;
|
|
8
|
+
shape?: 'circle' | 'square';
|
|
9
|
+
texts?: {
|
|
10
|
+
draggerDesc?: string;
|
|
11
|
+
fileTypeError?: string;
|
|
12
|
+
uploadBtn?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
5
15
|
export interface EmojiPickerCustomEmoji {
|
|
6
16
|
emojis: [
|
|
7
17
|
{
|
|
@@ -17,8 +17,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
18
|
import { Form } from 'antd';
|
|
19
19
|
import isEqual from 'fast-deep-equal';
|
|
20
|
-
import { motion } from 'framer-motion';
|
|
21
20
|
import { InfoIcon } from 'lucide-react';
|
|
21
|
+
import { motion } from 'motion/react';
|
|
22
22
|
import { memo, useEffect, useMemo, useState } from 'react';
|
|
23
23
|
import { Flexbox } from 'react-layout-kit';
|
|
24
24
|
import Button from "../../Button";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
var _excluded = ["classNames", "className", "style", "closable", "styles", "allowFullscreen", "title", "afterOpenChange", "width", "onCancel", "centered", "open", "afterClose", "destroyOnHidden", "closeIcon", "paddings", "height", "enableResponsive", "zIndex", "mask", "getContainer", "keyboard", "focusTriggerAfterClose", "forceRender", "loading", "footer", "submitButtonProps", "submitLoading", "onFinish", "submitText", "variant", "gap", "onSubmit", "children", "ref"],
|
|
5
|
-
_excluded2 = ["form"
|
|
5
|
+
_excluded2 = ["form"],
|
|
6
6
|
_excluded3 = ["form"];
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -65,10 +65,12 @@ var FormModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
65
65
|
cx = _useStyles.cx,
|
|
66
66
|
s = _useStyles.styles;
|
|
67
67
|
var formClassName = classNames.form,
|
|
68
|
-
footerClassName = classNames.footer,
|
|
69
68
|
modalClassNames = _objectWithoutProperties(classNames, _excluded2);
|
|
70
|
-
var
|
|
71
|
-
|
|
69
|
+
var _ref2 = typeof styles === 'function' ? {
|
|
70
|
+
form: undefined
|
|
71
|
+
} : styles,
|
|
72
|
+
formStyle = _ref2.form,
|
|
73
|
+
modalStyles = _objectWithoutProperties(_ref2, _excluded3);
|
|
72
74
|
return /*#__PURE__*/_jsx(Modal, {
|
|
73
75
|
afterClose: afterClose,
|
|
74
76
|
afterOpenChange: afterOpenChange,
|
|
@@ -93,7 +95,7 @@ var FormModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
93
95
|
open: open,
|
|
94
96
|
paddings: paddings,
|
|
95
97
|
style: style,
|
|
96
|
-
styles: _objectSpread(_objectSpread({}, modalStyles), {}, {
|
|
98
|
+
styles: typeof styles === 'function' ? styles : _objectSpread(_objectSpread({}, modalStyles), {}, {
|
|
97
99
|
body: _objectSpread({
|
|
98
100
|
paddingTop: mobile ? 0 : undefined
|
|
99
101
|
}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
|
|
@@ -106,7 +108,7 @@ var FormModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
106
108
|
clearOnDestroy: destroyOnHidden,
|
|
107
109
|
footer: /*#__PURE__*/_jsx(Flexbox, {
|
|
108
110
|
align: 'center',
|
|
109
|
-
className: cx(s.footer
|
|
111
|
+
className: cx(s.footer),
|
|
110
112
|
gap: 8,
|
|
111
113
|
horizontal: true,
|
|
112
114
|
children: footer || /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
package/es/FormModal/type.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ import type { ButtonProps } from "../Button";
|
|
|
3
3
|
import type { FormInstance, FormProps } from "../Form";
|
|
4
4
|
import type { ModalProps } from "../Modal";
|
|
5
5
|
type PickModalProps = Pick<ModalProps, 'style' | 'className' | 'allowFullscreen' | 'title' | 'width' | 'onCancel' | 'open' | 'centered' | 'destroyOnHidden' | 'paddings' | 'height' | 'enableResponsive' | 'afterClose' | 'afterOpenChange' | 'zIndex' | 'mask' | 'getContainer' | 'keyboard' | 'forceRender' | 'focusTriggerAfterClose' | 'closable' | 'loading' | 'closeIcon'>;
|
|
6
|
-
type PickFormProps = Omit<FormProps, 'className' | 'style' | 'title'>;
|
|
6
|
+
type PickFormProps = Omit<FormProps, 'className' | 'style' | 'title' | 'styles' | 'classNames'>;
|
|
7
7
|
export interface FormModalProps extends PickModalProps, PickFormProps {
|
|
8
|
-
classNames?: {
|
|
8
|
+
classNames?: ModalProps['classNames'] & {
|
|
9
9
|
form?: FormProps['className'];
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
onSubmit?: ModalProps['onOk'];
|
|
12
12
|
ref?: Ref<FormInstance>;
|
|
13
|
-
styles?: {
|
|
13
|
+
styles?: ModalProps['styles'] & {
|
|
14
14
|
form?: FormProps['style'];
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
submitButtonProps?: ButtonProps;
|
|
17
17
|
submitLoading?: ModalProps['confirmLoading'];
|
|
18
18
|
submitText?: ModalProps['okText'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type SelectProps } from 'antd';
|
|
3
|
-
export declare const LangSelect: import("react").NamedExoticComponent<Omit<SelectProps<any, import("
|
|
3
|
+
export declare const LangSelect: import("react").NamedExoticComponent<Omit<SelectProps<any, import("antd/es/select").DefaultOptionType>, "options">>;
|
|
4
4
|
export default LangSelect;
|
package/es/Image/Image.js
CHANGED
|
@@ -90,13 +90,14 @@ var Image = /*#__PURE__*/memo(function (_ref) {
|
|
|
90
90
|
children: actions
|
|
91
91
|
}), /*#__PURE__*/_jsx(AntImage, _objectSpread({
|
|
92
92
|
className: cx(styles.image, classNames === null || classNames === void 0 ? void 0 : classNames.image),
|
|
93
|
+
classNames: {
|
|
94
|
+
root: cx(styles.wrapper, classNames === null || classNames === void 0 ? void 0 : classNames.wrapper)
|
|
95
|
+
},
|
|
93
96
|
fallback: theme.isDarkMode ? FALLBACK_DARK : FALLBACK_LIGHT,
|
|
94
97
|
height: height,
|
|
95
98
|
loading: 'lazy',
|
|
96
99
|
onClick: onClick,
|
|
97
|
-
preview: preview === false ? false :
|
|
98
|
-
mask: false
|
|
99
|
-
}, mergePreivew),
|
|
100
|
+
preview: preview === false ? false : mergePreivew,
|
|
100
101
|
style: _objectSpread({
|
|
101
102
|
maxHeight: maxHeight,
|
|
102
103
|
maxWidth: maxWidth,
|
|
@@ -104,9 +105,10 @@ var Image = /*#__PURE__*/memo(function (_ref) {
|
|
|
104
105
|
minWidth: minWidth,
|
|
105
106
|
objectFit: objectFit || 'cover'
|
|
106
107
|
}, customStyles === null || customStyles === void 0 ? void 0 : customStyles.image),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
styles: {
|
|
109
|
+
root: customStyles === null || customStyles === void 0 ? void 0 : customStyles.wrapper
|
|
110
|
+
},
|
|
111
|
+
width: width
|
|
110
112
|
}, rest))]
|
|
111
113
|
});
|
|
112
114
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GroupPreviewConfig } from 'antd/es/image/PreviewGroup';
|
|
2
2
|
import type { PreviewGroupPreviewOptions } from '../type';
|
|
3
|
-
export declare const usePreview: (props: PreviewGroupPreviewOptions | boolean | undefined) =>
|
|
3
|
+
export declare const usePreview: (props: PreviewGroupPreviewOptions | boolean | undefined) => GroupPreviewConfig | boolean;
|
|
4
4
|
export default usePreview;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["onVisibleChange", "
|
|
2
|
+
var _excluded = ["onVisibleChange", "minScale", "maxScale", "toolbarAddon", "rootClassName", "imageRender", "toolbarRender"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -27,13 +27,11 @@ export var usePreview = function usePreview(props) {
|
|
|
27
27
|
setVisible = _useState2[1];
|
|
28
28
|
var _useStyles = useStyles(),
|
|
29
29
|
cx = _useStyles.cx,
|
|
30
|
-
|
|
30
|
+
componentStyles = _useStyles.styles;
|
|
31
31
|
return useMemo(function () {
|
|
32
32
|
if (props === false) return props;
|
|
33
33
|
var _ref = props === true ? {} : props || {},
|
|
34
34
|
_onVisibleChange = _ref.onVisibleChange,
|
|
35
|
-
_ref$styles = _ref.styles,
|
|
36
|
-
previewStyle = _ref$styles === void 0 ? {} : _ref$styles,
|
|
37
35
|
_ref$minScale = _ref.minScale,
|
|
38
36
|
minScale = _ref$minScale === void 0 ? 0.32 : _ref$minScale,
|
|
39
37
|
_ref$maxScale = _ref.maxScale,
|
|
@@ -41,9 +39,19 @@ export var usePreview = function usePreview(props) {
|
|
|
41
39
|
toolbarAddon = _ref.toolbarAddon,
|
|
42
40
|
rootClassName = _ref.rootClassName,
|
|
43
41
|
_imageRender = _ref.imageRender,
|
|
44
|
-
|
|
42
|
+
toolbarRender = _ref.toolbarRender,
|
|
45
43
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
44
|
return _objectSpread({
|
|
45
|
+
actionsRender: function actionsRender(_, info) {
|
|
46
|
+
var originalNode = /*#__PURE__*/_jsx(Toolbar, {
|
|
47
|
+
info: info,
|
|
48
|
+
maxScale: maxScale,
|
|
49
|
+
minScale: minScale,
|
|
50
|
+
children: toolbarAddon
|
|
51
|
+
});
|
|
52
|
+
if (toolbarRender) return toolbarRender(originalNode, info);
|
|
53
|
+
return originalNode;
|
|
54
|
+
},
|
|
47
55
|
closeIcon: /*#__PURE__*/_jsx(Icon, {
|
|
48
56
|
color: '#fff',
|
|
49
57
|
icon: X
|
|
@@ -62,23 +70,8 @@ export var usePreview = function usePreview(props) {
|
|
|
62
70
|
setVisible(visible);
|
|
63
71
|
_onVisibleChange === null || _onVisibleChange === void 0 || _onVisibleChange(visible, prevVisible, current);
|
|
64
72
|
},
|
|
65
|
-
rootClassName: cx(
|
|
66
|
-
styles: _objectSpread({
|
|
67
|
-
mask: {
|
|
68
|
-
backdropFilter: 'blur(8px)'
|
|
69
|
-
}
|
|
70
|
-
}, previewStyle),
|
|
71
|
-
toolbarRender: function toolbarRender(_, info) {
|
|
72
|
-
var originalNode = /*#__PURE__*/_jsx(Toolbar, {
|
|
73
|
-
info: info,
|
|
74
|
-
maxScale: maxScale,
|
|
75
|
-
minScale: minScale,
|
|
76
|
-
children: toolbarAddon
|
|
77
|
-
});
|
|
78
|
-
if (_toolbarRender) return _toolbarRender(originalNode, info);
|
|
79
|
-
return originalNode;
|
|
80
|
-
}
|
|
73
|
+
rootClassName: cx(componentStyles.preview, rootClassName)
|
|
81
74
|
}, rest);
|
|
82
|
-
}, [props, visible,
|
|
75
|
+
}, [props, visible, componentStyles]);
|
|
83
76
|
};
|
|
84
77
|
export default usePreview;
|
package/es/Image/type.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { ImageProps as AntdImageProps } from 'antd';
|
|
2
|
+
import type { GroupPreviewConfig } from 'antd/es/image/PreviewGroup';
|
|
2
3
|
import type { ImagePreviewType } from 'rc-image';
|
|
3
|
-
import type { GroupConsumerProps as AntdPreviewGroupProps, PreviewGroupPreview } from 'rc-image/lib/PreviewGroup';
|
|
4
4
|
import type { CSSProperties, ReactNode, Ref } from 'react';
|
|
5
|
-
export interface PreviewGroupPreviewOptions extends
|
|
5
|
+
export interface PreviewGroupPreviewOptions extends GroupPreviewConfig {
|
|
6
6
|
toolbarAddon?: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export interface PreviewGroupProps
|
|
8
|
+
export interface PreviewGroupProps {
|
|
9
|
+
children?: ReactNode;
|
|
9
10
|
enable?: boolean;
|
|
10
11
|
items?: string[];
|
|
11
|
-
preview?: PreviewGroupPreviewOptions;
|
|
12
|
+
preview?: boolean | PreviewGroupPreviewOptions;
|
|
12
13
|
}
|
|
13
14
|
export interface ImagePreviewOptions extends ImagePreviewType {
|
|
14
15
|
toolbarAddon?: ReactNode;
|
package/es/Modal/Modal.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
var _excluded = ["panelRef", "allowFullscreen", "children", "title", "className", "classNames", "width", "onCancel", "open", "destroyOnHidden", "paddings", "height", "enableResponsive", "footer", "styles", "okText", "onOk", "cancelText", "okButtonProps", "cancelButtonProps", "confirmLoading"]
|
|
5
|
-
_excluded2 = ["body"];
|
|
4
|
+
var _excluded = ["panelRef", "allowFullscreen", "children", "title", "className", "classNames", "width", "onCancel", "open", "destroyOnHidden", "paddings", "height", "enableResponsive", "footer", "styles", "okText", "onOk", "cancelText", "okButtonProps", "cancelButtonProps", "confirmLoading"];
|
|
6
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -64,9 +63,6 @@ var Modal = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
63
|
styles = _useStyles.styles,
|
|
65
64
|
cx = _useStyles.cx,
|
|
66
65
|
theme = _useStyles.theme;
|
|
67
|
-
var _ref2 = customStyles || {},
|
|
68
|
-
body = _ref2.body,
|
|
69
|
-
restStyles = _objectWithoutProperties(_ref2, _excluded2);
|
|
70
66
|
var hideFooter = footer === false || footer === null;
|
|
71
67
|
if (enableResponsive && mobile) return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
72
68
|
theme: {
|
|
@@ -76,7 +72,7 @@ var Modal = /*#__PURE__*/memo(function (_ref) {
|
|
|
76
72
|
},
|
|
77
73
|
children: /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
|
78
74
|
className: cx(styles.drawerContent, className),
|
|
79
|
-
classNames: _objectSpread(_objectSpread({}, classNames), {}, {
|
|
75
|
+
classNames: typeof classNames === 'function' ? classNames : _objectSpread(_objectSpread({}, classNames), {}, {
|
|
80
76
|
wrapper: cx(styles.wrap, classNames === null || classNames === void 0 ? void 0 : classNames.wrapper)
|
|
81
77
|
}),
|
|
82
78
|
closeIcon: /*#__PURE__*/_jsx(ActionIcon, {
|
|
@@ -112,12 +108,12 @@ var Modal = /*#__PURE__*/memo(function (_ref) {
|
|
|
112
108
|
open: open,
|
|
113
109
|
panelRef: panelRef,
|
|
114
110
|
placement: 'bottom',
|
|
115
|
-
styles: _objectSpread({
|
|
111
|
+
styles: typeof customStyles === 'function' ? customStyles : _objectSpread(_objectSpread({}, customStyles), {}, {
|
|
116
112
|
body: _objectSpread({
|
|
117
113
|
paddingBlock: "16px ".concat(footer ? 0 : '16px'),
|
|
118
114
|
paddingInline: (_paddings$desktop = paddings === null || paddings === void 0 ? void 0 : paddings.desktop) !== null && _paddings$desktop !== void 0 ? _paddings$desktop : 16
|
|
119
|
-
}, body)
|
|
120
|
-
}
|
|
115
|
+
}, customStyles === null || customStyles === void 0 ? void 0 : customStyles.body)
|
|
116
|
+
}),
|
|
121
117
|
title: title
|
|
122
118
|
}, rest), {}, {
|
|
123
119
|
children: children
|
|
@@ -136,7 +132,7 @@ var Modal = /*#__PURE__*/memo(function (_ref) {
|
|
|
136
132
|
}, cancelButtonProps),
|
|
137
133
|
cancelText: cancelText,
|
|
138
134
|
className: cx(styles.content, className),
|
|
139
|
-
classNames: _objectSpread(_objectSpread({}, classNames), {}, {
|
|
135
|
+
classNames: typeof classNames === 'function' ? classNames : _objectSpread(_objectSpread({}, classNames), {}, {
|
|
140
136
|
wrapper: cx(styles.wrap, classNames === null || classNames === void 0 ? void 0 : classNames.wrapper)
|
|
141
137
|
}),
|
|
142
138
|
closable: true,
|
|
@@ -154,14 +150,14 @@ var Modal = /*#__PURE__*/memo(function (_ref) {
|
|
|
154
150
|
onOk: onOk,
|
|
155
151
|
open: open,
|
|
156
152
|
panelRef: panelRef,
|
|
157
|
-
styles: _objectSpread({
|
|
153
|
+
styles: typeof customStyles === 'function' ? customStyles : _objectSpread(_objectSpread({}, customStyles), {}, {
|
|
158
154
|
body: _objectSpread({
|
|
159
155
|
maxHeight: height,
|
|
160
156
|
overflow: 'hidden auto',
|
|
161
157
|
paddingBlock: "0 ".concat(footer === null ? '16px' : 0),
|
|
162
158
|
paddingInline: (_paddings$desktop2 = paddings === null || paddings === void 0 ? void 0 : paddings.desktop) !== null && _paddings$desktop2 !== void 0 ? _paddings$desktop2 : 16
|
|
163
|
-
}, body)
|
|
164
|
-
}
|
|
159
|
+
}, customStyles === null || customStyles === void 0 ? void 0 : customStyles.body)
|
|
160
|
+
}),
|
|
165
161
|
title: title,
|
|
166
162
|
width: width
|
|
167
163
|
}, rest), {}, {
|
package/es/Modal/style.js
CHANGED
|
@@ -8,8 +8,8 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
8
8
|
token = _ref.token,
|
|
9
9
|
prefixCls = _ref.prefixCls;
|
|
10
10
|
return {
|
|
11
|
-
content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-footer {\n margin: 0;\n padding: 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n height: 56px;\n margin-block-end: 0;\n padding: 16px;\n }\n .", "-modal-
|
|
12
|
-
drawerContent: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-drawer-close {\n padding: 0;\n }\n\n .", "-drawer-header {\n flex: none;\n height: ", "px !important;\n padding-block: 0;\n padding-inline: 16px;\n }\n\n .", "-drawer-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n padding: 16px;\n
|
|
11
|
+
content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-footer {\n margin: 0;\n padding: 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n height: 56px;\n margin-block-end: 0;\n padding: 16px;\n }\n .", "-modal-container {\n overflow: hidden;\n padding: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n "])), prefixCls, prefixCls, prefixCls, token.colorSplit, token.borderRadiusLG),
|
|
12
|
+
drawerContent: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-drawer-close {\n padding: 0;\n }\n\n .", "-drawer-header {\n flex: none;\n height: ", "px !important;\n padding-block: 0;\n padding-inline: 16px;\n }\n\n .", "-drawer-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n padding: 16px;\n border: none;\n }\n "])), prefixCls, prefixCls, HEADER_HEIGHT, prefixCls),
|
|
13
13
|
wrap: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n "])))
|
|
14
14
|
};
|
|
15
15
|
});
|
package/es/Tag/Tag.js
CHANGED
|
@@ -83,7 +83,6 @@ var Tag = /*#__PURE__*/memo(function (_ref) {
|
|
|
83
83
|
};
|
|
84
84
|
}, [color, theme, variant]);
|
|
85
85
|
return /*#__PURE__*/_jsx(AntTag, _objectSpread(_objectSpread({
|
|
86
|
-
bordered: false,
|
|
87
86
|
className: cx(variants({
|
|
88
87
|
size: size,
|
|
89
88
|
variant: variant
|
|
@@ -96,7 +95,8 @@ var Tag = /*#__PURE__*/memo(function (_ref) {
|
|
|
96
95
|
borderColor: colors === null || colors === void 0 ? void 0 : colors.borderColor,
|
|
97
96
|
color: colors === null || colors === void 0 ? void 0 : colors.textColor,
|
|
98
97
|
cursor: onClick ? 'pointer' : undefined
|
|
99
|
-
}, style)
|
|
98
|
+
}, style),
|
|
99
|
+
variant: variant === 'borderless' ? 'outlined' : variant
|
|
100
100
|
}, rest), {}, {
|
|
101
101
|
children: children
|
|
102
102
|
}));
|
package/es/Tag/type.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TagProps as AntTagProps } from 'antd';
|
|
2
2
|
import type { Ref } from 'react';
|
|
3
|
-
export interface TagProps extends Omit<AntTagProps, 'color'> {
|
|
3
|
+
export interface TagProps extends Omit<AntTagProps, 'color' | 'variant'> {
|
|
4
4
|
color?: AntTagProps['color'] | 'info';
|
|
5
5
|
ref?: Ref<HTMLDivElement>;
|
|
6
6
|
size?: 'small' | 'middle' | 'large';
|
package/es/Toc/TocMobile.js
CHANGED
|
@@ -51,7 +51,6 @@ var TocMobile = /*#__PURE__*/memo(function (_ref) {
|
|
|
51
51
|
children: /*#__PURE__*/_jsx("section", {
|
|
52
52
|
className: styles.mobileCtn,
|
|
53
53
|
children: /*#__PURE__*/_jsx(Collapse, {
|
|
54
|
-
bordered: false,
|
|
55
54
|
className: styles.expand,
|
|
56
55
|
expandIcon: function expandIcon(_ref2) {
|
|
57
56
|
var isActive = _ref2.isActive;
|
|
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
-
import { motion } from '
|
|
18
|
+
import { motion } from 'motion/react';
|
|
19
19
|
import { createElement, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
20
|
import { useStyles } from "./style";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -40,9 +40,6 @@ var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
40
40
|
width: '100%',
|
|
41
41
|
children: [/*#__PURE__*/_jsx(Select, {
|
|
42
42
|
disabled: disabled,
|
|
43
|
-
dropdownStyle: {
|
|
44
|
-
zIndex: 100
|
|
45
|
-
},
|
|
46
43
|
onChange: function onChange(value) {
|
|
47
44
|
dispatch({
|
|
48
45
|
index: index,
|
|
@@ -63,6 +60,13 @@ var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
63
60
|
style: {
|
|
64
61
|
width: 120
|
|
65
62
|
},
|
|
63
|
+
styles: {
|
|
64
|
+
popup: {
|
|
65
|
+
root: {
|
|
66
|
+
zIndex: 100
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
66
70
|
value: item.role
|
|
67
71
|
}), /*#__PURE__*/_jsx(ControlInput, {
|
|
68
72
|
disabled: disabled,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"icons.js"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ant-design/cssinjs": "^
|
|
48
|
+
"@ant-design/cssinjs": "^2.0.1",
|
|
49
49
|
"@dnd-kit/core": "^6.3.1",
|
|
50
50
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
51
51
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -55,28 +55,28 @@
|
|
|
55
55
|
"@floating-ui/react": "^0.27.16",
|
|
56
56
|
"@giscus/react": "^3.1.0",
|
|
57
57
|
"@lobehub/fluent-emoji": "^2.0.0",
|
|
58
|
-
"@lobehub/icons": "^2.
|
|
58
|
+
"@lobehub/icons": "^2.48.0",
|
|
59
59
|
"@mdx-js/mdx": "^3.1.1",
|
|
60
60
|
"@mdx-js/react": "^3.1.1",
|
|
61
61
|
"@radix-ui/react-slot": "^1.2.4",
|
|
62
|
-
"@shikijs/core": "^3.
|
|
63
|
-
"@shikijs/transformers": "^3.
|
|
62
|
+
"@shikijs/core": "^3.20.0",
|
|
63
|
+
"@shikijs/transformers": "^3.20.0",
|
|
64
64
|
"@splinetool/runtime": "0.9.526",
|
|
65
65
|
"ahooks": "^3.9.6",
|
|
66
66
|
"antd-style": "^3.7.1",
|
|
67
|
-
"chroma-js": "^3.
|
|
67
|
+
"chroma-js": "^3.2.0",
|
|
68
68
|
"class-variance-authority": "^0.7.1",
|
|
69
69
|
"dayjs": "^1.11.19",
|
|
70
70
|
"emoji-mart": "^5.6.0",
|
|
71
71
|
"fast-deep-equal": "^3.1.3",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"katex": "^0.16.25",
|
|
72
|
+
"immer": "^11.0.1",
|
|
73
|
+
"katex": "^0.16.27",
|
|
75
74
|
"leva": "^0.10.1",
|
|
76
|
-
"lodash-es": "^4.17.
|
|
77
|
-
"lucide-react": "^0.
|
|
78
|
-
"marked": "^17.0.
|
|
79
|
-
"mermaid": "^11.12.
|
|
75
|
+
"lodash-es": "^4.17.22",
|
|
76
|
+
"lucide-react": "^0.562.0",
|
|
77
|
+
"marked": "^17.0.1",
|
|
78
|
+
"mermaid": "^11.12.2",
|
|
79
|
+
"motion": "^12.23.26",
|
|
80
80
|
"numeral": "^2.0.6",
|
|
81
81
|
"polished": "^4.3.1",
|
|
82
82
|
"query-string": "^9.3.1",
|
|
@@ -86,15 +86,15 @@
|
|
|
86
86
|
"rc-input-number": "^9.5.0",
|
|
87
87
|
"rc-menu": "^9.16.1",
|
|
88
88
|
"re-resizable": "^6.11.2",
|
|
89
|
-
"react-avatar-editor": "^
|
|
89
|
+
"react-avatar-editor": "^14.0.0",
|
|
90
90
|
"react-error-boundary": "^6.0.0",
|
|
91
91
|
"react-hotkeys-hook": "^5.2.1",
|
|
92
|
-
"react-layout-kit": "^2.0.
|
|
92
|
+
"react-layout-kit": "^2.0.1",
|
|
93
93
|
"react-markdown": "^10.1.0",
|
|
94
94
|
"react-merge-refs": "^3.0.2",
|
|
95
95
|
"react-rnd": "^10.5.2",
|
|
96
96
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
97
|
-
"rehype-github-alerts": "^4.
|
|
97
|
+
"rehype-github-alerts": "^4.2.0",
|
|
98
98
|
"rehype-katex": "^7.0.1",
|
|
99
99
|
"rehype-raw": "^7.0.0",
|
|
100
100
|
"remark-breaks": "^4.0.0",
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"remark-gfm": "^4.0.1",
|
|
103
103
|
"remark-github": "^12.0.0",
|
|
104
104
|
"remark-math": "^6.0.0",
|
|
105
|
-
"shiki": "^3.
|
|
105
|
+
"shiki": "^3.20.0",
|
|
106
106
|
"shiki-stream": "^0.1.3",
|
|
107
|
-
"swr": "^2.3.
|
|
107
|
+
"swr": "^2.3.8",
|
|
108
108
|
"ts-md5": "^2.0.1",
|
|
109
109
|
"unified": "^11.0.5",
|
|
110
110
|
"url-join": "^5.0.0",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"uuid": "^13.0.0"
|
|
113
113
|
},
|
|
114
114
|
"peerDependencies": {
|
|
115
|
-
"antd": "^
|
|
116
|
-
"
|
|
115
|
+
"antd": "^6.1.1",
|
|
116
|
+
"motion": "^12.0.0",
|
|
117
117
|
"react": "^19.0.0",
|
|
118
118
|
"react-dom": "^19.0.0"
|
|
119
119
|
}
|