@lobehub/ui 1.25.4 → 1.25.5
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.
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { PlusOutlined } from '@ant-design/icons';
|
|
3
2
|
import { Button, Select } from 'antd';
|
|
4
3
|
import isEqual from 'fast-deep-equal';
|
|
5
|
-
import {
|
|
4
|
+
import { Plus, Trash } from 'lucide-react';
|
|
6
5
|
import { memo, useEffect, useReducer } from 'react';
|
|
7
6
|
import { Flexbox } from 'react-layout-kit';
|
|
8
|
-
import IconAction from "../ActionIcon";
|
|
9
7
|
import { messagesReducer } from "../Chat";
|
|
10
8
|
import { ControlInput } from "../components/ControlInput";
|
|
9
|
+
import { ActionIcon, Icon } from "./..";
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
12
|
export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
@@ -45,13 +44,13 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
45
44
|
},
|
|
46
45
|
options: [{
|
|
47
46
|
value: 'system',
|
|
48
|
-
label: '
|
|
47
|
+
label: 'System'
|
|
49
48
|
}, {
|
|
50
49
|
value: 'user',
|
|
51
|
-
label: '
|
|
50
|
+
label: 'Input'
|
|
52
51
|
}, {
|
|
53
52
|
value: 'assistant',
|
|
54
|
-
label: '
|
|
53
|
+
label: 'Output'
|
|
55
54
|
}],
|
|
56
55
|
style: {
|
|
57
56
|
width: 120
|
|
@@ -68,8 +67,8 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
68
67
|
},
|
|
69
68
|
placeholder: item.role === 'user' ? '请填入输入的样例内容' : '请填入输出的样例',
|
|
70
69
|
value: item.content
|
|
71
|
-
}), /*#__PURE__*/_jsx(
|
|
72
|
-
icon:
|
|
70
|
+
}), /*#__PURE__*/_jsx(ActionIcon, {
|
|
71
|
+
icon: Trash,
|
|
73
72
|
onClick: function onClick() {
|
|
74
73
|
dispatch({
|
|
75
74
|
type: 'deleteMessage',
|
|
@@ -77,13 +76,18 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
77
76
|
});
|
|
78
77
|
},
|
|
79
78
|
placement: "right",
|
|
79
|
+
size: {
|
|
80
|
+
fontSize: 16
|
|
81
|
+
},
|
|
80
82
|
title: "Delete"
|
|
81
83
|
})]
|
|
82
84
|
}, "".concat(index, "-").concat(item.content));
|
|
83
85
|
}), /*#__PURE__*/_jsx(Button, {
|
|
84
86
|
block: true,
|
|
85
87
|
disabled: disabled,
|
|
86
|
-
icon: /*#__PURE__*/_jsx(
|
|
88
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
89
|
+
icon: Plus
|
|
90
|
+
}),
|
|
87
91
|
onClick: function onClick() {
|
|
88
92
|
var lastMeg = chatMessages.at(-1);
|
|
89
93
|
dispatch({
|
|
@@ -94,7 +98,7 @@ export var EditableMessageList = /*#__PURE__*/memo(function (_ref) {
|
|
|
94
98
|
}
|
|
95
99
|
});
|
|
96
100
|
},
|
|
97
|
-
children: "
|
|
101
|
+
children: "Add Props"
|
|
98
102
|
})]
|
|
99
103
|
});
|
|
100
104
|
}, isEqual);
|
package/es/Hero/index.js
CHANGED
|
@@ -33,21 +33,18 @@ var Hero = /*#__PURE__*/memo(function (_ref) {
|
|
|
33
33
|
rel: "noreferrer",
|
|
34
34
|
target: openExternal ? '_blank' : undefined,
|
|
35
35
|
children: type === 'primary' ? /*#__PURE__*/_jsx(GradientButton, {
|
|
36
|
+
icon: ButtonIcon && /*#__PURE__*/_jsx(Icon, {
|
|
37
|
+
icon: ButtonIcon
|
|
38
|
+
}),
|
|
36
39
|
size: "large",
|
|
37
40
|
children: text
|
|
38
41
|
}, index) : /*#__PURE__*/_jsx(Button, {
|
|
42
|
+
icon: ButtonIcon && /*#__PURE__*/_jsx(Icon, {
|
|
43
|
+
icon: ButtonIcon
|
|
44
|
+
}),
|
|
39
45
|
size: "large",
|
|
40
46
|
type: "primary",
|
|
41
|
-
children:
|
|
42
|
-
align: "center",
|
|
43
|
-
children: [ButtonIcon && /*#__PURE__*/_jsx(Icon, {
|
|
44
|
-
icon: ButtonIcon,
|
|
45
|
-
size: {
|
|
46
|
-
fontSize: 18,
|
|
47
|
-
strokeWidth: 2
|
|
48
|
-
}
|
|
49
|
-
}), text]
|
|
50
|
-
})
|
|
47
|
+
children: text
|
|
51
48
|
}, index)
|
|
52
49
|
}, text);
|
|
53
50
|
})
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { Loading3QuartersOutlined as Loading } from '@ant-design/icons';
|
|
3
2
|
import { useThemeMode } from 'antd-style';
|
|
3
|
+
import { Loader2 } from 'lucide-react';
|
|
4
4
|
import { memo, useEffect } from 'react';
|
|
5
5
|
import { Center } from 'react-layout-kit';
|
|
6
6
|
import { shallow } from 'zustand/shallow';
|
|
7
7
|
import { useHighlight } from "../../hooks/useHighlight";
|
|
8
|
+
import { Icon } from "../..";
|
|
8
9
|
import { useStyles } from "./style";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -13,8 +14,7 @@ var SyntaxHighlighter = /*#__PURE__*/memo(function (_ref) {
|
|
|
13
14
|
var children = _ref.children,
|
|
14
15
|
language = _ref.language;
|
|
15
16
|
var _useStyles = useStyles(),
|
|
16
|
-
styles = _useStyles.styles
|
|
17
|
-
theme = _useStyles.theme;
|
|
17
|
+
styles = _useStyles.styles;
|
|
18
18
|
var _useThemeMode = useThemeMode(),
|
|
19
19
|
isDarkMode = _useThemeMode.isDarkMode;
|
|
20
20
|
var _useHighlight = useHighlight(function (s) {
|
|
@@ -43,11 +43,9 @@ var SyntaxHighlighter = /*#__PURE__*/memo(function (_ref) {
|
|
|
43
43
|
className: styles.loading,
|
|
44
44
|
gap: 8,
|
|
45
45
|
horizontal: true,
|
|
46
|
-
children: [/*#__PURE__*/_jsx(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
color: theme.colorTextTertiary
|
|
50
|
-
}
|
|
46
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
47
|
+
icon: Loader2,
|
|
48
|
+
spin: true
|
|
51
49
|
}), "Highlighting..."]
|
|
52
50
|
})]
|
|
53
51
|
});
|
package/es/Icon/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["icon", "size", "
|
|
3
|
+
var _excluded = ["icon", "size", "className", "spin"];
|
|
4
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
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 { memo, useMemo } from 'react';
|
|
@@ -40,7 +40,6 @@ var calcSize = function calcSize(size) {
|
|
|
40
40
|
var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
41
41
|
var icon = _ref.icon,
|
|
42
42
|
size = _ref.size,
|
|
43
|
-
style = _ref.style,
|
|
44
43
|
className = _ref.className,
|
|
45
44
|
spin = _ref.spin,
|
|
46
45
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -53,16 +52,16 @@ var Icon = /*#__PURE__*/memo(function (_ref) {
|
|
|
53
52
|
}, [size]),
|
|
54
53
|
fontSize = _useMemo.fontSize,
|
|
55
54
|
strokeWidth = _useMemo.strokeWidth;
|
|
56
|
-
return /*#__PURE__*/_jsx("
|
|
57
|
-
className: cx(
|
|
58
|
-
|
|
59
|
-
width: fontSize,
|
|
60
|
-
height: fontSize
|
|
61
|
-
}, style)
|
|
55
|
+
return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({
|
|
56
|
+
className: cx('anticon', spin && styles.spin, className),
|
|
57
|
+
role: "img"
|
|
62
58
|
}, props), {}, {
|
|
63
59
|
children: /*#__PURE__*/_jsx(SvgIcon, {
|
|
60
|
+
focusable: false,
|
|
61
|
+
height: fontSize,
|
|
64
62
|
size: fontSize,
|
|
65
|
-
strokeWidth: strokeWidth
|
|
63
|
+
strokeWidth: strokeWidth,
|
|
64
|
+
width: fontSize
|
|
66
65
|
})
|
|
67
66
|
}));
|
|
68
67
|
});
|
package/es/Icon/style.d.ts
CHANGED
package/es/Icon/style.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
3
|
import { createStyles, keyframes } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css;
|
|
6
6
|
var spin = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "])));
|
|
7
7
|
return {
|
|
8
|
-
|
|
9
|
-
spin: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n animation: ", " 1s linear infinite;\n "])), spin)
|
|
8
|
+
spin: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n animation: ", " 1s linear infinite;\n "])), spin)
|
|
10
9
|
};
|
|
11
10
|
});
|
package/es/MessageModal/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { AimOutlined } from '@ant-design/icons';
|
|
3
2
|
import { Modal } from 'antd';
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
6
|
import useControlledState from 'use-merge-value';
|
|
7
|
-
import Markdown from "
|
|
8
|
-
import MessageInput from "../MessageInput";
|
|
7
|
+
import { Icon, Markdown, MessageInput } from "./..";
|
|
9
8
|
import { useStyles } from "./style";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
10
|
var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
13
11
|
var editing = _ref.editing,
|
|
14
12
|
open = _ref.open,
|
|
@@ -33,10 +31,13 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
33
31
|
expand = _useControlledState4[0],
|
|
34
32
|
setExpand = _useControlledState4[1];
|
|
35
33
|
return /*#__PURE__*/_jsx(Modal, {
|
|
36
|
-
cancelText: '
|
|
34
|
+
cancelText: 'Cancel',
|
|
37
35
|
className: styles.modal,
|
|
36
|
+
closeIcon: /*#__PURE__*/_jsx(Icon, {
|
|
37
|
+
icon: X
|
|
38
|
+
}),
|
|
38
39
|
footer: isEdit ? null : undefined,
|
|
39
|
-
okText: '
|
|
40
|
+
okText: 'Edit',
|
|
40
41
|
onCancel: function onCancel() {
|
|
41
42
|
return setExpand(false);
|
|
42
43
|
},
|
|
@@ -44,11 +45,11 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
44
45
|
setTyping(true);
|
|
45
46
|
},
|
|
46
47
|
open: expand,
|
|
47
|
-
title: /*#__PURE__*/
|
|
48
|
+
title: /*#__PURE__*/_jsx(Flexbox, {
|
|
48
49
|
align: 'center',
|
|
49
50
|
gap: 4,
|
|
50
51
|
horizontal: true,
|
|
51
|
-
children:
|
|
52
|
+
children: "Prompt"
|
|
52
53
|
}),
|
|
53
54
|
width: 800,
|
|
54
55
|
children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.5",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building chatbot web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"react-rnd": "^10",
|
|
99
99
|
"remark-gfm": "^3",
|
|
100
100
|
"shiki-es": "^0",
|
|
101
|
-
"styled-components": "
|
|
101
|
+
"styled-components": "latest",
|
|
102
102
|
"ts-md5": "^1",
|
|
103
103
|
"use-merge-value": "^1",
|
|
104
104
|
"zustand": "^4",
|