@lobehub/ui 1.25.4 → 1.26.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/ChatInputArea/index.d.ts +17 -0
- package/es/ChatInputArea/index.js +106 -0
- package/es/ChatInputArea/style.d.ts +8 -0
- package/es/ChatInputArea/style.js +14 -0
- package/es/DraggablePanel/index.d.ts +2 -0
- package/es/DraggablePanel/index.js +12 -5
- package/es/DraggablePanel/style.d.ts +2 -1
- package/es/DraggablePanel/style.js +5 -3
- package/es/EditableMessageList/index.js +14 -10
- package/es/Hero/index.js +7 -10
- package/es/Highlighter/SyntaxHighlighter/index.js +6 -8
- package/es/Icon/index.js +8 -9
- package/es/Icon/style.d.ts +0 -1
- package/es/Icon/style.js +2 -3
- package/es/Input/index.d.ts +3 -2
- package/es/Input/index.js +10 -2
- package/es/Input/style.d.ts +1 -1
- package/es/Input/style.js +3 -3
- package/es/MessageModal/index.js +9 -8
- package/es/TokenTag/index.d.ts +8 -0
- package/es/TokenTag/index.js +41 -0
- package/es/TokenTag/style.d.ts +4 -0
- package/es/TokenTag/style.js +27 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { DivProps } from "../types";
|
|
3
|
+
export interface ChatInputAreaProps extends DivProps {
|
|
4
|
+
actions?: ReactNode;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
expand?: boolean;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
minHeight?: number;
|
|
11
|
+
onExpandChange?: (expand: boolean) => void;
|
|
12
|
+
onInputChange?: (value: string) => void;
|
|
13
|
+
onSend?: (value: string) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const ChatInputArea: import("react").NamedExoticComponent<ChatInputAreaProps>;
|
|
17
|
+
export default ChatInputArea;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["minHeight", "className", "actions", "footer", "expand", "placeholder", "onExpandChange", "onSend", "defaultValue", "loading", "style", "disabled", "onInputChange"];
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
import { Button } from 'antd';
|
|
8
|
+
import { Maximize2, Minimize2 } from 'lucide-react';
|
|
9
|
+
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
|
+
import { ActionIcon, TextArea } from "./..";
|
|
11
|
+
import { useStyles } from "./style";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var ChatInputArea = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var _ref$minHeight = _ref.minHeight,
|
|
16
|
+
minHeight = _ref$minHeight === void 0 ? 200 : _ref$minHeight,
|
|
17
|
+
className = _ref.className,
|
|
18
|
+
actions = _ref.actions,
|
|
19
|
+
footer = _ref.footer,
|
|
20
|
+
expand = _ref.expand,
|
|
21
|
+
_ref$placeholder = _ref.placeholder,
|
|
22
|
+
placeholder = _ref$placeholder === void 0 ? 'Type something to chat...' : _ref$placeholder,
|
|
23
|
+
onExpandChange = _ref.onExpandChange,
|
|
24
|
+
onSend = _ref.onSend,
|
|
25
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
26
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
27
|
+
loading = _ref.loading,
|
|
28
|
+
style = _ref.style,
|
|
29
|
+
disabled = _ref.disabled,
|
|
30
|
+
onInputChange = _ref.onInputChange,
|
|
31
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
var isChineseInput = useRef(false);
|
|
33
|
+
var _useState = useState(defaultValue),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
value = _useState2[0],
|
|
36
|
+
setValue = _useState2[1];
|
|
37
|
+
var _useStyles = useStyles(),
|
|
38
|
+
cx = _useStyles.cx,
|
|
39
|
+
styles = _useStyles.styles;
|
|
40
|
+
var handleExpandClick = useCallback(function () {
|
|
41
|
+
if (onExpandChange) onExpandChange(!expand);
|
|
42
|
+
}, [expand]);
|
|
43
|
+
var handleSend = useCallback(function () {
|
|
44
|
+
if (disabled) return;
|
|
45
|
+
if (onSend) onSend(value);
|
|
46
|
+
setValue('');
|
|
47
|
+
}, [disabled, value]);
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
if (onInputChange) onInputChange(value);
|
|
50
|
+
}, [value]);
|
|
51
|
+
return /*#__PURE__*/_jsxs("section", _objectSpread(_objectSpread({
|
|
52
|
+
className: cx(styles.container, className),
|
|
53
|
+
style: _objectSpread({
|
|
54
|
+
minHeight: minHeight
|
|
55
|
+
}, style)
|
|
56
|
+
}, props), {}, {
|
|
57
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
58
|
+
className: styles.actionsBar,
|
|
59
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
60
|
+
className: styles.actionLeft,
|
|
61
|
+
children: actions
|
|
62
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
63
|
+
className: styles.actionsRight,
|
|
64
|
+
children: /*#__PURE__*/_jsx(ActionIcon, {
|
|
65
|
+
icon: expand ? Minimize2 : Maximize2,
|
|
66
|
+
onClick: handleExpandClick
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
}), /*#__PURE__*/_jsx(TextArea, {
|
|
70
|
+
className: styles.textarea,
|
|
71
|
+
defaultValue: defaultValue,
|
|
72
|
+
onBlur: function onBlur(e) {
|
|
73
|
+
return setValue(e.target.value);
|
|
74
|
+
},
|
|
75
|
+
onChange: function onChange(e) {
|
|
76
|
+
return setValue(e.target.value);
|
|
77
|
+
},
|
|
78
|
+
onCompositionEnd: function onCompositionEnd() {
|
|
79
|
+
isChineseInput.current = false;
|
|
80
|
+
},
|
|
81
|
+
onCompositionStart: function onCompositionStart() {
|
|
82
|
+
isChineseInput.current = true;
|
|
83
|
+
},
|
|
84
|
+
onPressEnter: function onPressEnter(e) {
|
|
85
|
+
if (!loading && !e.shiftKey && !isChineseInput.current) {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
handleSend();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
placeholder: placeholder,
|
|
91
|
+
resize: false,
|
|
92
|
+
type: "pure",
|
|
93
|
+
value: value
|
|
94
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
95
|
+
className: styles.footerBar,
|
|
96
|
+
children: [footer, /*#__PURE__*/_jsx(Button, {
|
|
97
|
+
disabled: disabled,
|
|
98
|
+
loading: loading,
|
|
99
|
+
onClick: handleSend,
|
|
100
|
+
type: "primary",
|
|
101
|
+
children: "Send"
|
|
102
|
+
})]
|
|
103
|
+
})]
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
export default ChatInputArea;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
container: import("antd-style").SerializedStyles;
|
|
3
|
+
actionsBar: import("antd-style").SerializedStyles;
|
|
4
|
+
actionLeft: import("antd-style").SerializedStyles;
|
|
5
|
+
actionsRight: import("antd-style").SerializedStyles;
|
|
6
|
+
textarea: import("antd-style").SerializedStyles;
|
|
7
|
+
footerBar: import("antd-style").SerializedStyles;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css;
|
|
6
|
+
return {
|
|
7
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n height: 100%;\n padding: 12px 0 16px;\n "]))),
|
|
8
|
+
actionsBar: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n align-items: center;\n justify-content: space-between;\n\n padding: 0 16px;\n "]))),
|
|
9
|
+
actionLeft: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n gap: 4px;\n align-items: center;\n justify-content: flex-start;\n "]))),
|
|
10
|
+
actionsRight: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex: 0;\n gap: 4px;\n align-items: center;\n justify-content: flex-end;\n "]))),
|
|
11
|
+
textarea: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex: 1;\n padding: 0 24px;\n "]))),
|
|
12
|
+
footerBar: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n gap: 8px;\n align-items: center;\n justify-content: flex-end;\n\n padding: 0 24px;\n "])))
|
|
13
|
+
};
|
|
14
|
+
});
|
|
@@ -34,11 +34,13 @@ export interface DraggablePanelProps extends DivProps {
|
|
|
34
34
|
* @default true
|
|
35
35
|
*/
|
|
36
36
|
expandable?: boolean;
|
|
37
|
+
fullscreen?: boolean;
|
|
37
38
|
/**
|
|
38
39
|
* @description The style of the panel handler
|
|
39
40
|
* @type CSSProperties
|
|
40
41
|
*/
|
|
41
42
|
hanlderStyle?: React.CSSProperties;
|
|
43
|
+
maxHeight?: number;
|
|
42
44
|
maxWidth?: number;
|
|
43
45
|
/**
|
|
44
46
|
* @description The minimum height of the panel
|
|
@@ -15,7 +15,9 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
var DEFAULT_HEIGHT = 180;
|
|
16
16
|
var DEFAULT_WIDTH = 280;
|
|
17
17
|
var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
18
|
-
var
|
|
18
|
+
var fullscreen = _ref.fullscreen,
|
|
19
|
+
maxHeight = _ref.maxHeight,
|
|
20
|
+
_ref$pin = _ref.pin,
|
|
19
21
|
pin = _ref$pin === void 0 ? 'true' : _ref$pin,
|
|
20
22
|
_ref$mode = _ref.mode,
|
|
21
23
|
mode = _ref$mode === void 0 ? 'fixed' : _ref$mode,
|
|
@@ -46,7 +48,7 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
48
|
var ref = useRef(null);
|
|
47
49
|
var isHovering = useHover(ref);
|
|
48
50
|
var isVertical = placement === 'top' || placement === 'bottom';
|
|
49
|
-
var _useStyles = useStyles(
|
|
51
|
+
var _useStyles = useStyles(),
|
|
50
52
|
styles = _useStyles.styles,
|
|
51
53
|
cx = _useStyles.cx;
|
|
52
54
|
var _useControlledState = useControlledState(defaultExpand, {
|
|
@@ -94,9 +96,10 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
94
96
|
}, customizeDefaultSize);
|
|
95
97
|
}, [isVertical]);
|
|
96
98
|
var sizeProps = isExpand ? {
|
|
97
|
-
minWidth: typeof minWidth === 'number' ? Math.max(minWidth, 0) :
|
|
98
|
-
minHeight: typeof minHeight === 'number' ? Math.max(minHeight, 0) :
|
|
99
|
-
maxWidth: typeof maxWidth === 'number' ? Math.max(maxWidth, 0) :
|
|
99
|
+
minWidth: typeof minWidth === 'number' ? Math.max(minWidth, 0) : minWidth,
|
|
100
|
+
minHeight: typeof minHeight === 'number' ? Math.max(minHeight, 0) : minHeight,
|
|
101
|
+
maxWidth: typeof maxWidth === 'number' ? Math.max(maxWidth, 0) : maxWidth,
|
|
102
|
+
maxHeight: typeof maxHeight === 'number' ? Math.max(maxHeight, 0) : maxHeight,
|
|
100
103
|
defaultSize: defaultSize,
|
|
101
104
|
size: size
|
|
102
105
|
} : isVertical ? {
|
|
@@ -186,6 +189,10 @@ var DraggablePanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
186
189
|
style: style,
|
|
187
190
|
children: children
|
|
188
191
|
}));
|
|
192
|
+
if (fullscreen) return /*#__PURE__*/_jsx("div", {
|
|
193
|
+
className: cx(styles.fullscreen, className),
|
|
194
|
+
children: children
|
|
195
|
+
});
|
|
189
196
|
return /*#__PURE__*/_jsxs("aside", {
|
|
190
197
|
className: cx(styles.container,
|
|
191
198
|
// @ts-ignore
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useStyles: (props?:
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
2
|
container: string;
|
|
3
3
|
fixed: import("antd-style").SerializedStyles;
|
|
4
4
|
leftFloat: string;
|
|
@@ -15,4 +15,5 @@ export declare const useStyles: (props?: string | undefined) => import("antd-sty
|
|
|
15
15
|
rightHandle: string;
|
|
16
16
|
topHandle: string;
|
|
17
17
|
bottomHandle: string;
|
|
18
|
+
fullscreen: import("antd-style").SerializedStyles;
|
|
18
19
|
}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
|
|
3
3
|
import { createStyles, css, cx } from 'antd-style';
|
|
4
4
|
var offset = 16;
|
|
5
5
|
var toggleLength = 40;
|
|
6
6
|
var toggleShort = 16;
|
|
7
|
-
|
|
7
|
+
var prefix = 'draggable-panel';
|
|
8
|
+
export var useStyles = createStyles(function (_ref) {
|
|
8
9
|
var token = _ref.token;
|
|
9
10
|
var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
|
|
10
11
|
var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 101;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
|
|
@@ -25,6 +26,7 @@ export var useStyles = createStyles(function (_ref, prefix) {
|
|
|
25
26
|
leftHandle: cx(css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n left: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-left-handle")),
|
|
26
27
|
rightHandle: cx(css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n ", ";\n &::before {\n right: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-right-handle")),
|
|
27
28
|
topHandle: cx("".concat(prefix, "-top-handle"), css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n top: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle)),
|
|
28
|
-
bottomHandle: cx("".concat(prefix, "-bottom-handle"), css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n bottom: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle))
|
|
29
|
+
bottomHandle: cx("".concat(prefix, "-bottom-handle"), css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n ", ";\n\n &::before {\n bottom: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle)),
|
|
30
|
+
fullscreen: css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n "])))
|
|
29
31
|
};
|
|
30
32
|
});
|
|
@@ -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/Input/index.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { InputProps as AntdInputProps } from 'antd';
|
|
|
3
3
|
import { TextAreaProps as AntdTextAreaProps } from 'antd/es/input/TextArea';
|
|
4
4
|
export interface InputProps extends AntdInputProps {
|
|
5
5
|
ref?: any;
|
|
6
|
-
type?: 'ghost' | 'block';
|
|
6
|
+
type?: 'ghost' | 'block' | 'pure';
|
|
7
7
|
}
|
|
8
8
|
export declare const Input: import("react").NamedExoticComponent<InputProps>;
|
|
9
9
|
export interface TextAreaProps extends AntdTextAreaProps {
|
|
10
10
|
ref?: any;
|
|
11
|
-
|
|
11
|
+
resize?: boolean;
|
|
12
|
+
type?: 'ghost' | 'block' | 'pure';
|
|
12
13
|
}
|
|
13
14
|
export declare const TextArea: import("react").NamedExoticComponent<TextAreaProps>;
|
package/es/Input/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className", "type"],
|
|
4
|
-
_excluded2 = ["className", "type"];
|
|
4
|
+
_excluded2 = ["className", "type", "resize", "style"];
|
|
5
5
|
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; }
|
|
6
6
|
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; }
|
|
7
7
|
import { Input as AntInput } from 'antd';
|
|
@@ -19,6 +19,7 @@ export var Input = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, re
|
|
|
19
19
|
styles = _useStyles.styles,
|
|
20
20
|
cx = _useStyles.cx;
|
|
21
21
|
return /*#__PURE__*/_jsx(AntInput, _objectSpread({
|
|
22
|
+
bordered: type !== 'pure',
|
|
22
23
|
className: cx(styles.input, className),
|
|
23
24
|
ref: ref
|
|
24
25
|
}, props));
|
|
@@ -27,6 +28,9 @@ export var TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2
|
|
|
27
28
|
var className = _ref2.className,
|
|
28
29
|
_ref2$type = _ref2.type,
|
|
29
30
|
type = _ref2$type === void 0 ? 'ghost' : _ref2$type,
|
|
31
|
+
_ref2$resize = _ref2.resize,
|
|
32
|
+
resize = _ref2$resize === void 0 ? true : _ref2$resize,
|
|
33
|
+
style = _ref2.style,
|
|
30
34
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
31
35
|
var _useStyles2 = useStyles({
|
|
32
36
|
type: type
|
|
@@ -34,7 +38,11 @@ export var TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2
|
|
|
34
38
|
styles = _useStyles2.styles,
|
|
35
39
|
cx = _useStyles2.cx;
|
|
36
40
|
return /*#__PURE__*/_jsx(AntInput.TextArea, _objectSpread({
|
|
41
|
+
bordered: type !== 'pure',
|
|
37
42
|
className: cx(styles.textarea, className),
|
|
38
|
-
ref: ref
|
|
43
|
+
ref: ref,
|
|
44
|
+
style: resize ? style : _objectSpread({
|
|
45
|
+
resize: 'none'
|
|
46
|
+
}, style)
|
|
39
47
|
}, props));
|
|
40
48
|
}));
|
package/es/Input/style.d.ts
CHANGED
package/es/Input/style.js
CHANGED
|
@@ -6,9 +6,9 @@ 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 "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder);
|
|
9
|
+
var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n transition: 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
|
-
input: cx(typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n
|
|
12
|
-
textarea: cx(typeStylish, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n padding:
|
|
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
|
+
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'))
|
|
13
13
|
};
|
|
14
14
|
});
|
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, {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DivProps } from "../types";
|
|
3
|
+
export interface TokenTagProps extends DivProps {
|
|
4
|
+
maxValue: number;
|
|
5
|
+
value: number;
|
|
6
|
+
}
|
|
7
|
+
declare const TokenTag: import("react").NamedExoticComponent<TokenTagProps>;
|
|
8
|
+
export default TokenTag;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "maxValue", "value"];
|
|
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
|
+
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
|
+
import { memo } from 'react';
|
|
7
|
+
import { useStyles } from "./style";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
var TokenTag = /*#__PURE__*/memo(function (_ref) {
|
|
11
|
+
var className = _ref.className,
|
|
12
|
+
maxValue = _ref.maxValue,
|
|
13
|
+
value = _ref.value,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var valueLeft = maxValue - value;
|
|
16
|
+
var percent = valueLeft / maxValue;
|
|
17
|
+
var type;
|
|
18
|
+
var emoji;
|
|
19
|
+
if (percent > 0.3) {
|
|
20
|
+
type = 'normal';
|
|
21
|
+
emoji = '😀';
|
|
22
|
+
} else if (percent > 0) {
|
|
23
|
+
type = 'low';
|
|
24
|
+
emoji = '😅';
|
|
25
|
+
} else {
|
|
26
|
+
type = 'overload';
|
|
27
|
+
emoji = '🤯';
|
|
28
|
+
}
|
|
29
|
+
var _useStyles = useStyles(type),
|
|
30
|
+
styles = _useStyles.styles,
|
|
31
|
+
cx = _useStyles.cx;
|
|
32
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
33
|
+
className: cx(styles.container, className)
|
|
34
|
+
}, props), {}, {
|
|
35
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
36
|
+
className: styles.emoji,
|
|
37
|
+
children: emoji
|
|
38
|
+
}), valueLeft > 0 ? "Tokens ".concat(valueLeft) : "Overload"]
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
export default TokenTag;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
var HEIGHT = 28;
|
|
5
|
+
var ICON_SIZE = 20;
|
|
6
|
+
export var useStyles = createStyles(function (_ref, type) {
|
|
7
|
+
var cx = _ref.cx,
|
|
8
|
+
css = _ref.css,
|
|
9
|
+
token = _ref.token;
|
|
10
|
+
var percentStyle;
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 'normal':
|
|
13
|
+
percentStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorSuccessText);
|
|
14
|
+
break;
|
|
15
|
+
case 'low':
|
|
16
|
+
percentStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorWarningText);
|
|
17
|
+
break;
|
|
18
|
+
case 'overload':
|
|
19
|
+
default:
|
|
20
|
+
percentStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorErrorText);
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
container: cx(percentStyle, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n gap: 4px;\n align-items: center;\n\n height: ", "px;\n padding: 0 ", "px 0 ", "px;\n\n background: ", ";\n border-radius: ", "px;\n "])), HEIGHT, HEIGHT - ICON_SIZE, (HEIGHT - ICON_SIZE) / 2, token.colorFillSecondary, HEIGHT / 2)),
|
|
25
|
+
emoji: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: ", "px;\n "])), ICON_SIZE)
|
|
26
|
+
};
|
|
27
|
+
});
|
package/es/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from
|
|
|
2
2
|
export { default as ActionIconGroup, type ActionIconGroupProps } from './ActionIconGroup';
|
|
3
3
|
export { default as Avatar, type AvatarProps } from './Avatar';
|
|
4
4
|
export type { ChatMessage, MessageRoleType } from './Chat';
|
|
5
|
+
export { default as ChatInputArea, type ChatInputAreaProps } from './ChatInputArea';
|
|
5
6
|
export { default as ChatItem, type ChatItemProps } from './ChatItem';
|
|
6
7
|
export { default as ChatList, type ChatListProps } from './ChatList';
|
|
7
8
|
export { default as ColorScales, type ColorScalesProps } from './ColorScales';
|
|
@@ -37,6 +38,7 @@ export { default as TabsNav, type TabsNavProps } from './TabsNav';
|
|
|
37
38
|
export { default as ThemeProvider } from './ThemeProvider';
|
|
38
39
|
export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
|
|
39
40
|
export { default as Toc, type TocProps } from './Toc';
|
|
41
|
+
export { default as TokenTag, type TokenTagProps } from './TokenTag';
|
|
40
42
|
export { default as Tooltip, type TooltipProps } from './Tooltip';
|
|
41
43
|
export { type LobeCustomStylish } from './types/customStylish';
|
|
42
44
|
export { type LobeCustomToken } from './types/customToken';
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as ActionIcon } from "./ActionIcon";
|
|
2
2
|
export { default as ActionIconGroup } from "./ActionIconGroup";
|
|
3
3
|
export { default as Avatar } from "./Avatar";
|
|
4
|
+
export { default as ChatInputArea } from "./ChatInputArea";
|
|
4
5
|
export { default as ChatItem } from "./ChatItem";
|
|
5
6
|
export { default as ChatList } from "./ChatList";
|
|
6
7
|
export { default as ColorScales } from "./ColorScales";
|
|
@@ -36,4 +37,5 @@ export { default as TabsNav } from "./TabsNav";
|
|
|
36
37
|
export { default as ThemeProvider } from "./ThemeProvider";
|
|
37
38
|
export { default as ThemeSwitch } from "./ThemeSwitch";
|
|
38
39
|
export { default as Toc } from "./Toc";
|
|
40
|
+
export { default as TokenTag } from "./TokenTag";
|
|
39
41
|
export { default as Tooltip } from "./Tooltip";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
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",
|