@lobehub/ui 1.34.0 → 1.35.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/ActionIcon/style.js +1 -1
- package/es/ChatItem/index.d.ts +20 -19
- package/es/ChatItem/index.js +26 -24
- package/es/ChatItem/style.d.ts +3 -2
- package/es/ChatItem/style.js +9 -8
- package/es/ChatList/index.d.ts +6 -1
- package/es/ChatList/index.js +2 -2
- package/es/CodeEditor/style.js +1 -1
- package/es/ColorScales/style.js +1 -1
- package/es/DraggablePanel/index.js +10 -2
- package/es/GradientButton/style.js +1 -1
- package/es/Header/style.js +1 -1
- package/es/Input/style.js +1 -1
- package/es/SideNav/style.js +1 -1
- package/es/styles/algorithms/generateCustomStylish.js +1 -1
- package/package.json +8 -10
package/es/ActionIcon/style.js
CHANGED
|
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
9
9
|
var active = _ref2.active,
|
|
10
10
|
glass = _ref2.glass;
|
|
11
11
|
return {
|
|
12
|
-
block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition
|
|
12
|
+
block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition:\n color 600ms ", ",\n scale 400ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n scale: 0.8;\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
|
|
13
13
|
};
|
|
14
14
|
});
|
package/es/ChatItem/index.d.ts
CHANGED
|
@@ -2,43 +2,46 @@ import { type AlertProps } from 'antd';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { MetaData } from "../types/meta";
|
|
4
4
|
export interface ChatItemProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description Actions to be displayed in the chat item
|
|
7
|
+
*/
|
|
5
8
|
actions?: ReactNode;
|
|
6
9
|
/**
|
|
7
|
-
* @description
|
|
10
|
+
* @description Props for Alert component
|
|
8
11
|
*/
|
|
9
12
|
alert?: AlertProps;
|
|
10
13
|
/**
|
|
11
|
-
* @description
|
|
14
|
+
* @description Metadata for the avatar
|
|
12
15
|
*/
|
|
13
16
|
avatar: MetaData;
|
|
14
17
|
/**
|
|
15
|
-
* @description Whether to add spacing
|
|
16
|
-
|
|
18
|
+
* @description Whether to add border spacing
|
|
19
|
+
*/
|
|
20
|
+
borderSpacing?: number | string;
|
|
21
|
+
/**
|
|
22
|
+
* @description Custom CSS class name for the chat item
|
|
17
23
|
*/
|
|
18
|
-
borderSpacing?: boolean;
|
|
19
24
|
className?: string;
|
|
20
25
|
/**
|
|
21
|
-
* @
|
|
22
|
-
* @default false
|
|
26
|
+
* @description Whether the chat item is in editing mode
|
|
23
27
|
*/
|
|
24
28
|
editing?: boolean;
|
|
25
29
|
/**
|
|
26
|
-
* @description Whether
|
|
27
|
-
* @default false
|
|
30
|
+
* @description Whether the chat item is in loading state
|
|
28
31
|
*/
|
|
29
32
|
loading?: boolean;
|
|
30
33
|
/**
|
|
31
|
-
* @description The message
|
|
34
|
+
* @description The message content of the chat item
|
|
32
35
|
*/
|
|
33
36
|
message?: string;
|
|
34
37
|
/**
|
|
35
|
-
* @
|
|
36
|
-
* @param value - The new
|
|
38
|
+
* @description Callback when the message content changes
|
|
39
|
+
* @param value - The new message content
|
|
37
40
|
*/
|
|
38
41
|
onChange?: (value: string) => void;
|
|
39
42
|
/**
|
|
40
|
-
* @
|
|
41
|
-
* @param editing -
|
|
43
|
+
* @description Callback when the editing mode changes
|
|
44
|
+
* @param editing - The new editing mode
|
|
42
45
|
*/
|
|
43
46
|
onEditingChange?: (editing: boolean) => void;
|
|
44
47
|
/**
|
|
@@ -48,20 +51,18 @@ export interface ChatItemProps {
|
|
|
48
51
|
placement?: 'left' | 'right';
|
|
49
52
|
/**
|
|
50
53
|
* @description Whether the chat item is primary
|
|
51
|
-
* @default false
|
|
52
54
|
*/
|
|
53
55
|
primary?: boolean;
|
|
54
56
|
/**
|
|
55
|
-
* @description Whether to show
|
|
56
|
-
* @default false
|
|
57
|
+
* @description Whether to show the title of the chat item
|
|
57
58
|
*/
|
|
58
59
|
showTitle?: boolean;
|
|
59
60
|
/**
|
|
60
|
-
* @description
|
|
61
|
+
* @description The timestamp of the chat item
|
|
61
62
|
*/
|
|
62
63
|
time?: number;
|
|
63
64
|
/**
|
|
64
|
-
* @description The type of chat item
|
|
65
|
+
* @description The type of the chat item
|
|
65
66
|
* @default 'block'
|
|
66
67
|
*/
|
|
67
68
|
type?: 'block' | 'pure';
|
package/es/ChatItem/index.js
CHANGED
|
@@ -18,8 +18,7 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
18
18
|
var actions = _ref.actions,
|
|
19
19
|
className = _ref.className,
|
|
20
20
|
primary = _ref.primary,
|
|
21
|
-
|
|
22
|
-
borderSpacing = _ref$borderSpacing === void 0 ? true : _ref$borderSpacing,
|
|
21
|
+
borderSpacing = _ref.borderSpacing,
|
|
23
22
|
loading = _ref.loading,
|
|
24
23
|
message = _ref.message,
|
|
25
24
|
_ref$placement = _ref.placement,
|
|
@@ -36,7 +35,6 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
36
35
|
properties = _objectWithoutProperties(_ref, _excluded);
|
|
37
36
|
var _useStyles = useStyles({
|
|
38
37
|
avatarSize: AVATAR_SIZE,
|
|
39
|
-
borderSpacing: borderSpacing,
|
|
40
38
|
placement: placement,
|
|
41
39
|
primary: primary,
|
|
42
40
|
showTitle: showTitle,
|
|
@@ -68,33 +66,37 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
68
66
|
})]
|
|
69
67
|
}), /*#__PURE__*/_jsxs("div", {
|
|
70
68
|
className: styles.messageContainer,
|
|
71
|
-
children: [/*#__PURE__*/_jsxs("
|
|
72
|
-
className:
|
|
73
|
-
children: [showTitle ? avatar.title || 'untitled' : undefined, time && /*#__PURE__*/_jsx("
|
|
74
|
-
className: "chat-item-time",
|
|
69
|
+
children: [/*#__PURE__*/_jsxs("title", {
|
|
70
|
+
className: styles.name,
|
|
71
|
+
children: [showTitle ? avatar.title || 'untitled' : undefined, time && /*#__PURE__*/_jsx("time", {
|
|
75
72
|
children: formatTime(time)
|
|
76
73
|
})]
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
74
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
75
|
+
className: styles.messageContent,
|
|
76
|
+
children: [alert ? /*#__PURE__*/_jsx(Alert, _objectSpread({
|
|
77
|
+
className: styles.alert,
|
|
78
|
+
showIcon: true
|
|
79
|
+
}, alert)) : /*#__PURE__*/_jsx("div", {
|
|
80
|
+
className: styles.message,
|
|
81
|
+
style: editing ? {
|
|
82
|
+
padding: 12
|
|
83
|
+
} : {},
|
|
84
|
+
children: /*#__PURE__*/_jsx(EditableMessage, {
|
|
85
|
+
editing: editing,
|
|
86
|
+
onChange: onChange,
|
|
87
|
+
onEditingChange: onEditingChange,
|
|
88
|
+
value: String(message || '...')
|
|
89
|
+
})
|
|
90
|
+
}), !editing && /*#__PURE__*/_jsx("div", {
|
|
91
|
+
className: styles.actions,
|
|
92
|
+
role: "chat-item-actions",
|
|
93
|
+
children: actions
|
|
94
|
+
})]
|
|
93
95
|
})]
|
|
94
96
|
}), borderSpacing && /*#__PURE__*/_jsx("div", {
|
|
95
97
|
style: {
|
|
96
98
|
flex: 'none',
|
|
97
|
-
width:
|
|
99
|
+
width: borderSpacing
|
|
98
100
|
}
|
|
99
101
|
})]
|
|
100
102
|
}));
|
package/es/ChatItem/style.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export declare const useStyles: (props?: {
|
|
2
2
|
avatarSize: number;
|
|
3
|
-
borderSpacing: boolean;
|
|
4
3
|
placement?: "left" | "right" | undefined;
|
|
5
4
|
primary?: boolean | undefined;
|
|
6
5
|
showTitle?: boolean | undefined;
|
|
7
6
|
title?: string | undefined;
|
|
8
7
|
type?: "block" | "pure" | undefined;
|
|
9
8
|
} | undefined) => import("antd-style").ReturnStyles<{
|
|
10
|
-
actions:
|
|
9
|
+
actions: import("antd-style").SerializedStyles;
|
|
10
|
+
alert: import("antd-style").SerializedStyles;
|
|
11
11
|
avatarContainer: import("antd-style").SerializedStyles;
|
|
12
12
|
container: string;
|
|
13
13
|
loading: import("antd-style").SerializedStyles;
|
|
14
14
|
message: string;
|
|
15
15
|
messageContainer: import("antd-style").SerializedStyles;
|
|
16
|
+
messageContent: import("antd-style").SerializedStyles;
|
|
16
17
|
name: import("antd-style").SerializedStyles;
|
|
17
18
|
}>;
|
package/es/ChatItem/style.js
CHANGED
|
@@ -10,19 +10,20 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
10
10
|
title = _ref2.title,
|
|
11
11
|
primary = _ref2.primary,
|
|
12
12
|
avatarSize = _ref2.avatarSize,
|
|
13
|
-
showTitle = _ref2.showTitle
|
|
14
|
-
borderSpacing = _ref2.borderSpacing;
|
|
13
|
+
showTitle = _ref2.showTitle;
|
|
15
14
|
var blockStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 12px;\n background-color: ", ";\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n "])), primary ? token.colorFillSecondary : token.colorFillTertiary, token.borderRadiusLG, token.motionEaseOut);
|
|
16
15
|
var pureStylish = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: ", ";\n "])), title ? 0 : '6px');
|
|
17
16
|
var pureContainerStylish = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n transition: background-color 100ms ", ";\n "])), token.motionEaseOut);
|
|
18
17
|
var typeStylish = type === 'block' ? blockStylish : pureStylish;
|
|
19
18
|
return {
|
|
20
|
-
actions:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
actions: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n align-self: ", ";\n justify-content: ", ";\n "])), type === 'block' ? 'flex-end' : placement === 'left' ? 'flex-start' : 'flex-end', placement === 'left' ? 'flex-end' : 'flex-start'),
|
|
20
|
+
alert: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n span[role='img'] {\n align-self: flex-start;\n width: 16px;\n height: 16px;\n margin-top: 3px;\n }\n\n .ant-alert-description {\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n }\n\n &.ant-alert-with-description {\n padding-block: 12px;\n padding-inline: 12px;\n\n .ant-alert-message {\n font-size: 14px;\n font-weight: 600;\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n }\n }\n "]))),
|
|
21
|
+
avatarContainer: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
|
|
22
|
+
container: cx(type === 'pure' && pureContainerStylish, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='chat-item-actions'] {\n display: flex;\n }\n\n time,\n div[role='chat-item-actions'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='chat-item-actions'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse', token.motionEaseOut)),
|
|
23
|
+
loading: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
|
|
24
|
+
message: cx(typeStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
|
|
25
|
+
messageContainer: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: ", ";\n "])), placement === 'left' ? 'flex-start' : 'flex-end'),
|
|
26
|
+
messageContent: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n position: revert;\n\n display: flex;\n flex-direction: ", ";\n gap: 8px;\n align-items: ", ";\n "])), type === 'block' ? placement === 'left' ? 'row' : 'row-reverse' : 'column', placement === 'left' ? 'flex-start' : 'flex-end'),
|
|
26
27
|
name: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n right: ", ";\n left: ", ";\n\n display: flex;\n flex-direction: ", ";\n gap: 4px;\n\n margin-bottom: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), showTitle ? 'relative' : 'absolute', showTitle ? 'unset' : '-16px', placement === 'right' ? '0' : 'unset', placement === 'left' ? '0' : 'unset', placement === 'left' ? 'row' : 'row-reverse', token.colorTextDescription, placement === 'left' ? 'left' : 'right')
|
|
27
28
|
};
|
|
28
29
|
});
|
package/es/ChatList/index.d.ts
CHANGED
|
@@ -7,7 +7,12 @@ export interface ChatListProps extends DivProps {
|
|
|
7
7
|
* @description Data of chat messages to be displayed
|
|
8
8
|
*/
|
|
9
9
|
data: ChatMessage[];
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @description Callback function triggered when an action is clicked
|
|
12
|
+
* @param {string} actionKey - The key of the action
|
|
13
|
+
* @param {string} messageId - The id of the message
|
|
14
|
+
*/
|
|
15
|
+
onActionClick?: (actionKey: string, messageId: string) => void;
|
|
11
16
|
/**
|
|
12
17
|
* @description Whether to show name of the chat item
|
|
13
18
|
* @default false
|
package/es/ChatList/index.js
CHANGED
|
@@ -9,7 +9,8 @@ import ActionsBar from "./ActionsBar";
|
|
|
9
9
|
import { useStyles } from "./style";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
var ChatList = /*#__PURE__*/memo(function (_ref) {
|
|
12
|
-
var
|
|
12
|
+
var _ref$onActionClick = _ref.onActionClick,
|
|
13
|
+
_onActionClick = _ref$onActionClick === void 0 ? function () {} : _ref$onActionClick,
|
|
13
14
|
className = _ref.className,
|
|
14
15
|
data = _ref.data,
|
|
15
16
|
_ref$type = _ref.type,
|
|
@@ -31,7 +32,6 @@ var ChatList = /*#__PURE__*/memo(function (_ref) {
|
|
|
31
32
|
primary: item.role === 'user'
|
|
32
33
|
}),
|
|
33
34
|
avatar: item.meta,
|
|
34
|
-
borderSpacing: type === 'chat',
|
|
35
35
|
message: item.content,
|
|
36
36
|
placement: type === 'chat' ? item.role === 'user' ? 'right' : 'left' : 'left',
|
|
37
37
|
primary: item.role === 'user',
|
package/es/CodeEditor/style.js
CHANGED
|
@@ -8,7 +8,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
8
8
|
isDarkMode = _ref.isDarkMode;
|
|
9
9
|
var type = _ref2.type,
|
|
10
10
|
resize = _ref2.resize;
|
|
11
|
-
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition
|
|
11
|
+
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition:\n background-color 100ms ", ",\n border-color 200ms ", ";\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorderSecondary, token.borderRadius, token.motionEaseOut, token.motionEaseOut, type === 'block' ? token.colorFillSecondary : token.colorFillQuaternary, token.colorBorder);
|
|
12
12
|
return {
|
|
13
13
|
container: cx(type !== 'pure' && typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n height: fit-content;\n "])))),
|
|
14
14
|
editor: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n resize: ", ";\n height: fit-content;\n font-family: ", " !important;\n\n pre {\n word-wrap: break-word;\n white-space: pre-wrap;\n\n &.shiki {\n margin: 0;\n }\n }\n "])), resize ? 'vertical' : 'none', token.fontFamilyCode),
|
package/es/ColorScales/style.js
CHANGED
|
@@ -9,7 +9,7 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
9
9
|
var css = _ref.css,
|
|
10
10
|
token = _ref.token;
|
|
11
11
|
return {
|
|
12
|
-
scaleBox: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position
|
|
12
|
+
scaleBox: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position:\n 0 0,\n 0 8px,\n 8px -8px,\n -8px 0;\n background-size: 16px 16px;\n\n transition: scale 400ms ", ";\n\n &:active {\n scale: 0.8;\n }\n "])), token.motionEaseOut),
|
|
13
13
|
scaleItem: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
|
|
14
14
|
scaleRowTitle: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
|
|
15
15
|
text: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "]))),
|
|
@@ -70,6 +70,10 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
70
70
|
_useState2 = _slicedToArray(_useState, 2),
|
|
71
71
|
showExpand = _useState2[0],
|
|
72
72
|
setShowExpand = _useState2[1];
|
|
73
|
+
var _useState3 = useState(false),
|
|
74
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
75
|
+
isResizing = _useState4[0],
|
|
76
|
+
setIsResizing = _useState4[1];
|
|
73
77
|
var canResizing = resize !== false && isExpand;
|
|
74
78
|
var resizeHandleClassNames = useMemo(function () {
|
|
75
79
|
if (!canResizing) return {};
|
|
@@ -185,16 +189,20 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
185
189
|
});
|
|
186
190
|
},
|
|
187
191
|
onResizeStart: function onResizeStart() {
|
|
192
|
+
setIsResizing(true);
|
|
188
193
|
setShowExpand(false);
|
|
189
194
|
},
|
|
190
195
|
onResizeStop: function onResizeStop(e, direction, reference_, delta) {
|
|
196
|
+
setIsResizing(false);
|
|
191
197
|
setShowExpand(true);
|
|
192
198
|
onSizeChange === null || onSizeChange === void 0 ? void 0 : onSizeChange(delta, {
|
|
193
199
|
height: reference_.style.height,
|
|
194
200
|
width: reference_.style.width
|
|
195
201
|
});
|
|
196
202
|
},
|
|
197
|
-
style:
|
|
203
|
+
style: _objectSpread({
|
|
204
|
+
transition: isResizing ? 'unset' : undefined
|
|
205
|
+
}, style),
|
|
198
206
|
children: children
|
|
199
207
|
}));
|
|
200
208
|
if (fullscreen) return /*#__PURE__*/_jsx("div", {
|
|
@@ -206,7 +214,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
206
214
|
// @ts-ignore
|
|
207
215
|
styles[mode === 'fixed' ? 'fixed' : "".concat(placement, "Float")], className),
|
|
208
216
|
ref: reference,
|
|
209
|
-
style: _defineProperty({}, "border".concat(arrowPlacement, "Width"), 1),
|
|
217
|
+
style: isExpand ? _defineProperty({}, "border".concat(arrowPlacement, "Width"), 1) : {},
|
|
210
218
|
children: [expandable && showExpand && handler, destroyOnClose ? isExpand && inner : inner]
|
|
211
219
|
});
|
|
212
220
|
});
|
|
@@ -8,7 +8,7 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
8
8
|
stylish = _ref.stylish;
|
|
9
9
|
return {
|
|
10
10
|
bg: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n background: ", ";\n border-radius: inherit;\n "])), token.colorBgLayout),
|
|
11
|
-
button: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n background: ", ";\n border: none;\n\n &::before {\n ", "\n content: '';\n\n position: absolute;\n z-index: 0;\n inset: 0;\n\n overflow: hidden;\n\n padding: 1px;\n\n mask
|
|
11
|
+
button: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n background: ", ";\n border: none;\n\n &::before {\n ", "\n content: '';\n\n position: absolute;\n z-index: 0;\n inset: 0;\n\n overflow: hidden;\n\n padding: 1px;\n\n mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n\n mask-composite: xor;\n }\n\n > span {\n position: relative;\n z-index: 10;\n }\n\n &:hover {\n &::before {\n mask: unset;\n }\n }\n "])), token.colorBgLayout, stylish.gradientAnimation),
|
|
12
12
|
glow: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n position: absolute;\n z-index: -1;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n opacity: ", ";\n filter: blur(", "em);\n border-radius: inherit;\n "])), stylish.gradientAnimation, isDarkMode ? 0.5 : 0.3, isDarkMode ? 1.5 : 1)
|
|
13
13
|
};
|
|
14
14
|
});
|
package/es/Header/style.js
CHANGED
|
@@ -9,7 +9,7 @@ export var useStyles = createStyles(function (_ref) {
|
|
|
9
9
|
cx = _ref.cx;
|
|
10
10
|
return {
|
|
11
11
|
content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 64px;\n padding: 0 24px;\n background-color: ", ";\n border-bottom: 1px solid ", ";\n\n ", " {\n padding: 0 12px;\n }\n "])), rgba(token.colorBgLayout, 0.4), token.colorSplit, responsive.mobile),
|
|
12
|
-
header: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
12
|
+
header: cx(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n grid-area: head;\n align-self: stretch;\n width: 100%;\n "])))),
|
|
13
13
|
left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 10;\n "]))),
|
|
14
14
|
right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n z-index: 10;\n display: flex;\n flex: 1;\n justify-content: space-between;\n\n &-aside {\n display: flex;\n align-items: center;\n\n ", " {\n justify-content: center;\n margin: 8px 16px;\n padding-top: 24px;\n border-top: 1px solid ", ";\n }\n }\n "])), responsive.mobile, token.colorBorder)
|
|
15
15
|
};
|
package/es/Input/style.js
CHANGED
|
@@ -6,7 +6,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
6
6
|
css = _ref.css,
|
|
7
7
|
token = _ref.token;
|
|
8
8
|
var type = _ref2.type;
|
|
9
|
-
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n transition
|
|
9
|
+
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n transition:\n background-color 100ms ", ",\n border-color 200ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n\n &.ant-input-affix-wrapper-focused {\n border-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, token.motionEaseOut, token.motionEaseOut, token.colorFillTertiary, token.colorTextQuaternary, token.colorTextQuaternary);
|
|
10
10
|
return {
|
|
11
11
|
input: cx(type !== 'pure' && typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n height: ", ";\n padding: ", ";\n\n input {\n background: transparent;\n }\n "])), type === 'pure' ? 'unset' : '36px', type === 'pure' ? '0' : '0 12px')),
|
|
12
12
|
textarea: cx(type !== 'pure' && typeStylish, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n padding: ", ";\n\n textarea {\n background: transparent;\n }\n "])), type === 'pure' ? '0' : '8px 12px'))
|
package/es/SideNav/style.js
CHANGED
|
@@ -4,5 +4,5 @@ import { createStyles } from 'antd-style';
|
|
|
4
4
|
export var useStyles = createStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css,
|
|
6
6
|
token = _ref.token;
|
|
7
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
7
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n\n width: 64px;\n height: 100%;\n min-height: 640px;\n padding: 16px 0;\n\n background: ", ";\n border-right: 1px solid ", ";\n "])), token.colorBgContainer, token.colorBorder);
|
|
8
8
|
});
|
|
@@ -10,7 +10,7 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
|
10
10
|
blur: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
|
|
11
11
|
bottomScrollbar: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n transition: background-color 500ms ", ";\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n "])), token.colorFill, token.motionEaseOut),
|
|
12
12
|
gradientAnimation: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-image: linear-gradient(\n -45deg,\n ", ",\n ", ",\n ", ",\n ", "\n );\n background-size: 400% 400%;\n border-radius: inherit;\n animation: 5s ", " 5s ease infinite;\n "])), token.gold, token.magenta, token.geekblue, token.cyan, gradient),
|
|
13
|
-
markdown: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border: none;\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n li {\n line-height: 1.8;\n\n &::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, isDarkMode ? token.cyan9A : token.cyan10A, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
|
|
13
|
+
markdown: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-break: break-all;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border: none;\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n li {\n line-height: 1.8;\n\n &::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, isDarkMode ? token.cyan9A : token.cyan10A, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder),
|
|
14
14
|
noScrollbar: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),
|
|
15
15
|
resetLinkColor: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText)
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -28,17 +28,15 @@
|
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "father build",
|
|
31
|
-
"build:theme": "npm run build --prefix=packages/dumi-theme-lobehub",
|
|
32
31
|
"build:watch": "father dev",
|
|
33
32
|
"ci": "npm run lint && npm run type-check",
|
|
34
|
-
"clean": "rm -r es lib dist coverage .dumi/tmp .eslintcache node_modules/.cache
|
|
33
|
+
"clean": "rm -r es lib dist coverage .dumi/tmp .eslintcache node_modules/.cache",
|
|
35
34
|
"dev": "dumi dev",
|
|
36
|
-
"
|
|
37
|
-
"docs:build": "npm run build:theme && dumi build",
|
|
35
|
+
"docs:build": "dumi build",
|
|
38
36
|
"doctor": "father doctor",
|
|
39
|
-
"lint": "eslint \"{src,tests
|
|
37
|
+
"lint": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
40
38
|
"lint:md": "remark . --quiet --frail --output",
|
|
41
|
-
"lint:style": "stylelint \"{src,tests
|
|
39
|
+
"lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
42
40
|
"prepare": "husky install && npm run setup",
|
|
43
41
|
"prepublishOnly": "father doctor && npm run build",
|
|
44
42
|
"prettier": "prettier -c --write --no-error-on-unmatched-pattern \"**/**\"",
|
|
@@ -116,18 +114,18 @@
|
|
|
116
114
|
"@types/react-dom": "^18",
|
|
117
115
|
"@vitest/coverage-v8": "latest",
|
|
118
116
|
"antd-style": "^3",
|
|
117
|
+
"babel-plugin-antd-style": "latest",
|
|
119
118
|
"commitlint": "^17",
|
|
120
119
|
"concurrently": "^8",
|
|
121
120
|
"cross-env": "^7",
|
|
122
121
|
"dumi": "^2",
|
|
123
|
-
"dumi-
|
|
124
|
-
"dumi-theme-lobehub": "workspace:latest",
|
|
122
|
+
"dumi-theme-lobehub": "latest",
|
|
125
123
|
"eslint": "^8",
|
|
126
124
|
"father": "^4",
|
|
127
125
|
"husky": "^8",
|
|
128
126
|
"jsdom": "^22",
|
|
129
127
|
"lint-staged": "^13",
|
|
130
|
-
"prettier": "^
|
|
128
|
+
"prettier": "^3",
|
|
131
129
|
"react": "^18",
|
|
132
130
|
"react-dom": "^18",
|
|
133
131
|
"remark": "^14",
|