@lobehub/ui 1.74.0 → 1.76.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.
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { Icon } from "../..";
|
|
7
7
|
import { Collapse } from 'antd';
|
|
8
|
+
import { ChevronDown } from 'lucide-react';
|
|
8
9
|
import { memo } from 'react';
|
|
9
10
|
import { useStyles } from "./style";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,6 +23,19 @@ var FormGroup = /*#__PURE__*/memo(function (_ref) {
|
|
|
22
23
|
return /*#__PURE__*/_jsx(Collapse, _objectSpread({
|
|
23
24
|
className: cx(styles.group, className),
|
|
24
25
|
defaultActiveKey: [1],
|
|
26
|
+
expandIcon: function expandIcon(_ref2) {
|
|
27
|
+
var isActive = _ref2.isActive;
|
|
28
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
29
|
+
className: styles.icon,
|
|
30
|
+
icon: ChevronDown,
|
|
31
|
+
size: {
|
|
32
|
+
fontSize: 16
|
|
33
|
+
},
|
|
34
|
+
style: isActive ? {} : {
|
|
35
|
+
rotate: '-90deg'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
},
|
|
25
39
|
items: [{
|
|
26
40
|
children: children,
|
|
27
41
|
extra: extra,
|
|
@@ -2,6 +2,7 @@ export declare const useStyles: (props?: string | number | undefined) => import(
|
|
|
2
2
|
footer: import("antd-style").SerializedStyles;
|
|
3
3
|
formTitle: import("antd-style").SerializedStyles;
|
|
4
4
|
group: string;
|
|
5
|
+
icon: import("antd-style").SerializedStyles;
|
|
5
6
|
item: import("antd-style").SerializedStyles;
|
|
6
7
|
title: import("antd-style").SerializedStyles;
|
|
7
8
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { isNumber } from 'lodash-es';
|
|
5
5
|
export var useStyles = createStyles(function (_ref, itemMinWidth) {
|
|
@@ -10,8 +10,9 @@ export var useStyles = createStyles(function (_ref, itemMinWidth) {
|
|
|
10
10
|
return {
|
|
11
11
|
footer: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n "]))),
|
|
12
12
|
formTitle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 6px;\n\n text-align: left;\n\n > div {\n font-weight: 500;\n line-height: 1;\n }\n\n > small {\n display: block;\n\n line-height: 1;\n color: ", ";\n word-wrap: break-word;\n white-space: pre-wrap;\n }\n\n .ant-tag {\n font-family: ", ";\n }\n "])), token.colorTextDescription, token.fontFamilyCode),
|
|
13
|
-
group: cx(isDarkMode && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-collapse-content {\n background: transparent;\n }\n\n .ant-collapse-header {\n background: ", ";\n }\n "])), token.colorFillTertiary), css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .ant-collapse-header {\n border-radius: 0 !important;\n }\n\n .ant-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .ant-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])))),
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
group: cx(isDarkMode && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-collapse-content {\n background: transparent;\n }\n\n .ant-collapse-header {\n background: ", ";\n }\n "])), token.colorFillTertiary), css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .ant-collapse-header {\n align-items: center !important;\n border-radius: 0 !important;\n }\n\n .ant-collapse-content-box {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n\n .ant-form-item-label {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n "])))),
|
|
14
|
+
icon: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n transition: all 100ms ", ";\n "])), token.motionEaseOut),
|
|
15
|
+
item: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding: 8px 0;\n\n .ant-row {\n justify-content: space-between;\n\n > div {\n flex: unset !important;\n flex-grow: unset !important;\n }\n }\n\n ", "\n "])), itemMinWidth && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .ant-form-item-control {\n width: ", ";\n }\n "])), isNumber(itemMinWidth) ? "".concat(itemMinWidth, "px") : itemMinWidth)),
|
|
16
|
+
title: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n gap: 8px;\n align-items: center;\n\n font-size: 16px;\n font-weight: 600;\n\n .anticon {\n color: ", ";\n }\n "])), token.colorPrimary)
|
|
16
17
|
};
|
|
17
18
|
});
|
package/es/LogoThree/index.js
CHANGED
|
@@ -3,6 +3,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { Canvas } from '@react-three/fiber';
|
|
5
5
|
import { Suspense, memo } from 'react';
|
|
6
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
7
|
+
import LobeHubLogo from "../Logo";
|
|
6
8
|
import Loading from "./Loading";
|
|
7
9
|
import Logo from "./Logo";
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -11,24 +13,30 @@ var LogoThree = /*#__PURE__*/memo(function (_ref) {
|
|
|
11
13
|
size = _ref$size === void 0 ? 320 : _ref$size,
|
|
12
14
|
style = _ref.style,
|
|
13
15
|
className = _ref.className;
|
|
14
|
-
return /*#__PURE__*/_jsx(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
17
|
+
fallback: /*#__PURE__*/_jsx(LobeHubLogo, {
|
|
18
|
+
size: size,
|
|
19
|
+
type: "3d"
|
|
20
|
+
}),
|
|
21
|
+
children: /*#__PURE__*/_jsx(Canvas, {
|
|
22
|
+
camera: {
|
|
23
|
+
fov: 16,
|
|
24
|
+
position: [10, 1, 0]
|
|
25
|
+
},
|
|
26
|
+
className: className,
|
|
27
|
+
style: size ? _objectSpread({
|
|
28
|
+
height: size,
|
|
29
|
+
maxHeight: size,
|
|
30
|
+
maxWidth: size,
|
|
31
|
+
width: size
|
|
32
|
+
}, style) : style,
|
|
33
|
+
children: /*#__PURE__*/_jsx(Suspense, {
|
|
34
|
+
fallback: /*#__PURE__*/_jsx(Loading, {
|
|
35
|
+
size: size / 2 > 48 ? 48 : size / 2
|
|
36
|
+
}),
|
|
37
|
+
children: /*#__PURE__*/_jsx(Logo, {
|
|
38
|
+
rotation: [0, 1.5, 0]
|
|
39
|
+
})
|
|
32
40
|
})
|
|
33
41
|
})
|
|
34
42
|
});
|
package/es/Markdown/index.js
CHANGED
|
@@ -5,7 +5,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import { Collapse, Divider, Typography } from 'antd';
|
|
7
7
|
import { memo } from 'react';
|
|
8
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
8
9
|
import ReactMarkdown from 'react-markdown';
|
|
10
|
+
import rehypeRaw from 'rehype-raw';
|
|
9
11
|
import remarkGfm from 'remark-gfm';
|
|
10
12
|
import Code from "./Code";
|
|
11
13
|
import CodeBlock from "./CodeBlock";
|
|
@@ -35,13 +37,23 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
35
37
|
return /*#__PURE__*/_jsx(Typography, {
|
|
36
38
|
className: className,
|
|
37
39
|
style: style,
|
|
38
|
-
children: /*#__PURE__*/_jsx(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
children: /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
41
|
+
fallback: /*#__PURE__*/_jsx(ReactMarkdown, _objectSpread(_objectSpread({
|
|
42
|
+
className: styles.markdown,
|
|
43
|
+
components: components,
|
|
44
|
+
remarkPlugins: [remarkGfm]
|
|
45
|
+
}, props), {}, {
|
|
46
|
+
children: children
|
|
47
|
+
})),
|
|
48
|
+
children: /*#__PURE__*/_jsx(ReactMarkdown, _objectSpread(_objectSpread({
|
|
49
|
+
className: styles.markdown,
|
|
50
|
+
components: components,
|
|
51
|
+
rehypePlugins: [rehypeRaw],
|
|
52
|
+
remarkPlugins: [remarkGfm]
|
|
53
|
+
}, props), {}, {
|
|
54
|
+
children: children
|
|
55
|
+
}))
|
|
56
|
+
})
|
|
45
57
|
});
|
|
46
58
|
});
|
|
47
59
|
export default Markdown;
|
package/es/TokenTag/style.js
CHANGED
|
@@ -6,7 +6,8 @@ export var ICON_SIZE = 20;
|
|
|
6
6
|
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
7
7
|
var cx = _ref.cx,
|
|
8
8
|
css = _ref.css,
|
|
9
|
-
token = _ref.token
|
|
9
|
+
token = _ref.token,
|
|
10
|
+
isDarkMode = _ref.isDarkMode;
|
|
10
11
|
var type = _ref2.type,
|
|
11
12
|
shape = _ref2.shape;
|
|
12
13
|
var percentStyle;
|
|
@@ -27,7 +28,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
27
28
|
break;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
var roundStylish = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px 0 ", "px;\n background: ", ";\n border-radius: ", "px;\n "])), (HEIGHT - ICON_SIZE) * 1.2, (HEIGHT - ICON_SIZE) / 2, token.colorFillSecondary, HEIGHT / 2);
|
|
31
|
+
var roundStylish = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px 0 ", "px;\n background: ", ";\n border-radius: ", "px;\n "])), (HEIGHT - ICON_SIZE) * 1.2, (HEIGHT - ICON_SIZE) / 2, isDarkMode ? token.colorFillSecondary : token.colorFillTertiary, HEIGHT / 2);
|
|
31
32
|
var squareStylish = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n "])), token.borderRadiusSM);
|
|
32
33
|
return {
|
|
33
34
|
container: cx(percentStyle, shape === 'round' ? roundStylish : squareStylish, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n user-select: none;\n\n overflow: hidden;\n display: flex;\n flex: 0;\n gap: 4px;\n align-items: center;\n\n min-width: fit-content;\n height: ", "px;\n\n font-family: ", ";\n font-size: 13px;\n line-height: 1;\n "])), HEIGHT, token.fontFamilyCode))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -95,10 +95,12 @@
|
|
|
95
95
|
"prism-react-renderer": "^2",
|
|
96
96
|
"rc-footer": "^0",
|
|
97
97
|
"re-resizable": "^6",
|
|
98
|
+
"react-error-boundary": "^4",
|
|
98
99
|
"react-layout-kit": "^1.7.1",
|
|
99
100
|
"react-markdown": "^8",
|
|
100
101
|
"react-rnd": "^10",
|
|
101
102
|
"react-simple-code-editor": "^0",
|
|
103
|
+
"rehype-raw": "^6",
|
|
102
104
|
"remark-gfm": "^3",
|
|
103
105
|
"shiki-es": "^0",
|
|
104
106
|
"styled-components": "^6",
|