@lobehub/ui 1.159.0 → 1.161.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/A/index.js +2 -2
- package/es/ActionIcon/index.d.ts +5 -2
- package/es/ActionIcon/index.js +25 -19
- package/es/ActionIconGroup/index.js +47 -45
- package/es/Alert/index.js +50 -43
- package/es/Avatar/index.js +12 -10
- package/es/Burger/index.js +35 -30
- package/es/CodeEditor/index.js +43 -38
- package/es/Collapse/index.js +3 -3
- package/es/ColorScales/ScaleRow.js +43 -39
- package/es/ColorScales/index.js +59 -57
- package/es/ConfigProvider/index.js +5 -3
- package/es/ContextMenu/index.js +3 -2
- package/es/CopyButton/index.js +4 -3
- package/es/DraggablePanel/components/DraggablePanelBody.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.js +9 -5
- package/es/DraggablePanel/index.js +32 -25
- package/es/EditableText/index.js +16 -13
- package/es/EmojiPicker/AvatarUploader.js +71 -60
- package/es/EmojiPicker/index.js +110 -101
- package/es/EmptyCard/index.js +31 -23
- package/es/FileTypeIcon/index.js +55 -44
- package/es/FluentEmoji/index.js +6 -4
- package/es/Footer/index.js +10 -8
- package/es/Form/components/FormDivider.js +2 -2
- package/es/Form/components/FormFlatGroup.js +9 -4
- package/es/Form/components/FormFooter.js +6 -3
- package/es/Form/components/FormGroup.js +21 -15
- package/es/Form/components/FormItem.js +17 -10
- package/es/Form/components/FormTitle.js +23 -15
- package/es/Form/index.js +30 -26
- package/es/FormModal/index.js +34 -30
- package/es/Grid/index.js +6 -3
- package/es/Header/index.js +65 -49
- package/es/Highlighter/FullFeatured.js +51 -41
- package/es/Highlighter/SyntaxHighlighter/index.js +30 -19
- package/es/Highlighter/index.js +29 -19
- package/es/Icon/icons/DiscordIcon.js +3 -2
- package/es/Icon/index.js +16 -13
- package/es/Image/ImageGallery.js +5 -3
- package/es/Image/Preview.js +5 -3
- package/es/Image/index.js +38 -34
- package/es/Image/usePreview.js +37 -33
- package/es/Img/index.js +2 -2
- package/es/Input/index.js +3 -3
- package/es/Layout/index.js +63 -35
- package/es/List/ListItem/index.js +67 -53
- package/es/Markdown/CodeBlock.js +16 -10
- package/es/Markdown/Typography.js +6 -3
- package/es/Markdown/index.js +22 -18
- package/es/MaterialFileTypeIcon/index.js +20 -17
- package/es/MaterialFileTypeIcon/utils.d.ts +2 -2
- package/es/Mermaid/FullFeatured.js +45 -35
- package/es/Mermaid/index.js +26 -17
- package/es/Mermaid/useMermaid.d.ts +1 -2
- package/es/Mermaid/useMermaid.js +5 -3
- package/es/Modal/index.js +60 -48
- package/es/SearchBar/index.js +51 -47
- package/es/SelectWithImg/index.js +40 -34
- package/es/SideNav/index.js +22 -15
- package/es/SliderWithInput/index.js +38 -35
- package/es/Snippet/index.js +15 -10
- package/es/SortableList/DragHandle.js +3 -3
- package/es/SortableList/SortableItem.js +19 -16
- package/es/SortableList/SortableOverlay.js +5 -3
- package/es/SortableList/index.js +23 -15
- package/es/Swatches/index.js +20 -18
- package/es/TabsNav/index.js +3 -2
- package/es/Tag/index.js +12 -7
- package/es/ThemeProvider/Meta.js +58 -53
- package/es/ThemeProvider/index.js +23 -17
- package/es/ThemeSwitch/index.js +19 -15
- package/es/Toc/TocMobile.js +52 -47
- package/es/Toc/index.js +13 -8
- package/es/Tooltip/index.js +6 -3
- package/es/Video/index.js +47 -41
- package/es/awesome/AuroraBackground/index.js +18 -11
- package/es/awesome/Features/Item.js +45 -37
- package/es/awesome/Features/index.js +4 -5
- package/es/awesome/GaussianBackground/index.js +13 -8
- package/es/awesome/Giscus/index.js +15 -13
- package/es/awesome/GradientButton/index.js +9 -5
- package/es/awesome/GridBackground/Grid.js +61 -49
- package/es/awesome/GridBackground/GridShowcase.js +28 -24
- package/es/awesome/GridBackground/index.js +33 -27
- package/es/awesome/Hero/index.js +74 -63
- package/es/awesome/Spline/ParentSize.js +8 -7
- package/es/awesome/Spline/index.js +13 -10
- package/es/awesome/Spotlight/index.js +3 -2
- package/es/awesome/SpotlightCard/SpotlightCardItem.js +8 -5
- package/es/awesome/SpotlightCard/index.js +12 -9
- package/es/brand/BrandLoading/index.js +3 -2
- package/es/brand/LobeChat/index.js +38 -29
- package/es/brand/LobeChatText/index.js +13 -8
- package/es/brand/LobeHub/index.js +38 -29
- package/es/brand/LobeHubText/index.js +9 -4
- package/es/brand/Logo3d/index.js +3 -2
- package/es/brand/LogoFlat/index.js +49 -44
- package/es/brand/LogoMono/index.js +53 -48
- package/es/brand/LogoThree/Loading.js +11 -9
- package/es/brand/LogoThree/LogoSpline.js +12 -10
- package/es/brand/LogoThree/index.js +25 -23
- package/es/brand/components/Divider.js +6 -4
- package/es/chat/BackBottom/index.js +6 -4
- package/es/chat/ChatHeader/ChatHeaderTitle.js +31 -22
- package/es/chat/ChatHeader/index.js +42 -35
- package/es/chat/ChatInputArea/ChatInputActionBar.js +21 -16
- package/es/chat/ChatInputArea/ChatInputArea.js +23 -19
- package/es/chat/ChatInputArea/ChatInputAreaInner.js +3 -2
- package/es/chat/ChatInputArea/SendButton.js +51 -36
- package/es/chat/ChatItem/components/Actions.js +5 -3
- package/es/chat/ChatItem/components/Avatar.js +21 -17
- package/es/chat/ChatItem/components/BorderSpacing.js +2 -1
- package/es/chat/ChatItem/components/ErrorContent.js +11 -9
- package/es/chat/ChatItem/components/Loading.js +12 -10
- package/es/chat/ChatItem/components/MessageContent.js +10 -6
- package/es/chat/ChatItem/components/Title.js +8 -3
- package/es/chat/ChatItem/index.js +53 -47
- package/es/chat/ChatList/ActionsBar.js +3 -2
- package/es/chat/ChatList/HistoryDivider.js +11 -6
- package/es/chat/ChatList/Item.js +12 -14
- package/es/chat/ChatList/index.js +29 -25
- package/es/chat/EditableMessage/index.js +32 -26
- package/es/chat/EditableMessageList/index.js +76 -72
- package/es/chat/MessageInput/index.js +43 -35
- package/es/chat/MessageModal/index.js +51 -41
- package/es/chat/TokenTag/index.js +11 -7
- package/es/components/ControlInput.js +22 -18
- package/es/hooks/useHighlight.d.ts +1 -1
- package/es/mdx/Callout/index.js +19 -13
- package/es/mdx/Cards/Card.js +59 -46
- package/es/mdx/Cards/index.js +6 -3
- package/es/mdx/FileTree/File.js +11 -5
- package/es/mdx/FileTree/Folder.js +22 -13
- package/es/mdx/FileTree/index.js +6 -3
- package/es/mdx/Mdx/index.js +9 -7
- package/es/mdx/Steps/index.js +6 -3
- package/es/mdx/Tabs/Tab.js +8 -3
- package/es/mdx/Tabs/index.js +21 -17
- package/es/mdx/mdxComponents/CodeBlock.js +14 -9
- package/es/mdx/mdxComponents/Image.js +2 -2
- package/es/mdx/mdxComponents/Link.js +3 -2
- package/es/mdx/mdxComponents/Pre.js +14 -7
- package/es/mdx/mdxComponents/Video.js +2 -2
- package/es/mobile/MobileChatInputArea/SendButton.js +4 -3
- package/es/mobile/MobileChatInputArea/index.js +79 -69
- package/es/mobile/MobileNavBar/MobileNavBarTitle.js +37 -26
- package/es/mobile/MobileNavBar/index.js +48 -41
- package/es/mobile/MobileSafeArea/index.js +3 -2
- package/es/mobile/MobileTabBar/index.js +35 -29
- package/es/storybook/StoryBook/index.js +26 -19
- package/package.json +21 -22
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
3
|
var _excluded = ["size", "style"];
|
|
5
4
|
import { memo } from 'react';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
var Divider = /*#__PURE__*/memo(function (_ref) {
|
|
7
7
|
var _ref$size = _ref.size,
|
|
8
8
|
size = _ref$size === void 0 ? '1em' : _ref$size,
|
|
9
9
|
style = _ref.style,
|
|
10
10
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
-
return /*#__PURE__*/
|
|
11
|
+
return /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({
|
|
12
12
|
fill: "none",
|
|
13
13
|
height: size,
|
|
14
14
|
shapeRendering: "geometricPrecision",
|
|
@@ -21,8 +21,10 @@ var Divider = /*#__PURE__*/memo(function (_ref) {
|
|
|
21
21
|
}, style),
|
|
22
22
|
viewBox: "0 0 24 24",
|
|
23
23
|
width: size
|
|
24
|
-
}, rest),
|
|
25
|
-
|
|
24
|
+
}, rest), {}, {
|
|
25
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
26
|
+
d: "M16.88 3.549L7.12 20.451"
|
|
27
|
+
})
|
|
26
28
|
}));
|
|
27
29
|
});
|
|
28
30
|
export default Divider;
|
|
@@ -7,6 +7,7 @@ import { ListEnd } from 'lucide-react';
|
|
|
7
7
|
import { memo, useEffect, useRef, useState } from 'react';
|
|
8
8
|
import Icon from "../../Icon";
|
|
9
9
|
import { useStyles } from "./style";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
var BackBottom = /*#__PURE__*/memo(function (_ref) {
|
|
11
12
|
var _ref$visibilityHeight = _ref.visibilityHeight,
|
|
12
13
|
visibilityHeight = _ref$visibilityHeight === void 0 ? 240 : _ref$visibilityHeight,
|
|
@@ -41,15 +42,16 @@ var BackBottom = /*#__PURE__*/memo(function (_ref) {
|
|
|
41
42
|
});
|
|
42
43
|
onClick === null || onClick === void 0 || onClick(e);
|
|
43
44
|
};
|
|
44
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
45
46
|
className: cx(styles, className),
|
|
46
|
-
icon: /*#__PURE__*/
|
|
47
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
47
48
|
icon: ListEnd
|
|
48
49
|
}),
|
|
49
50
|
onClick: scrollToBottom,
|
|
50
51
|
ref: ref,
|
|
51
52
|
size: 'small',
|
|
52
|
-
style: style
|
|
53
|
-
|
|
53
|
+
style: style,
|
|
54
|
+
children: text || 'Back to bottom'
|
|
55
|
+
});
|
|
54
56
|
});
|
|
55
57
|
export default BackBottom;
|
|
@@ -3,6 +3,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
8
|
var useStyles = createStyles(function (_ref) {
|
|
7
9
|
var css = _ref.css,
|
|
8
10
|
token = _ref.token;
|
|
@@ -21,33 +23,40 @@ var ChatHeaderTitle = /*#__PURE__*/memo(function (_ref2) {
|
|
|
21
23
|
tag = _ref2.tag;
|
|
22
24
|
var _useStyles = useStyles(),
|
|
23
25
|
styles = _useStyles.styles;
|
|
24
|
-
var tagContent = tag && /*#__PURE__*/
|
|
26
|
+
var tagContent = tag && /*#__PURE__*/_jsx(Flexbox, {
|
|
25
27
|
align: 'center',
|
|
26
28
|
className: styles.tag,
|
|
27
|
-
horizontal: true
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
horizontal: true,
|
|
30
|
+
children: tag
|
|
31
|
+
});
|
|
32
|
+
if (desc) return /*#__PURE__*/_jsxs(Flexbox, {
|
|
30
33
|
className: styles.container,
|
|
31
|
-
gap: 4
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
gap: 4,
|
|
35
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
36
|
+
align: 'center',
|
|
37
|
+
className: styles.titleContainer,
|
|
38
|
+
gap: 8,
|
|
39
|
+
horizontal: true,
|
|
40
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
41
|
+
className: styles.titleWithDesc,
|
|
42
|
+
children: title
|
|
43
|
+
}), tagContent]
|
|
44
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
45
|
+
align: 'center',
|
|
46
|
+
className: styles.desc,
|
|
47
|
+
horizontal: true,
|
|
48
|
+
children: desc
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
45
52
|
align: 'center',
|
|
46
53
|
className: styles.container,
|
|
47
54
|
gap: 8,
|
|
48
|
-
horizontal: true
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
horizontal: true,
|
|
56
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
57
|
+
className: styles.title,
|
|
58
|
+
children: title
|
|
59
|
+
}), tagContent]
|
|
60
|
+
});
|
|
52
61
|
});
|
|
53
62
|
export default ChatHeaderTitle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["left", "right", "className", "styles", "gaps", "classNames", "showBackButton", "onBackClick", "children", "gap"];
|
|
6
6
|
import { ChevronLeft } from 'lucide-react';
|
|
@@ -8,6 +8,8 @@ import { memo } from 'react';
|
|
|
8
8
|
import { Flexbox } from 'react-layout-kit';
|
|
9
9
|
import ActionIcon from "../../ActionIcon";
|
|
10
10
|
import { useStyles } from "./style";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
var ChatHeader = /*#__PURE__*/memo(function (_ref) {
|
|
12
14
|
var left = _ref.left,
|
|
13
15
|
right = _ref.right,
|
|
@@ -24,45 +26,50 @@ var ChatHeader = /*#__PURE__*/memo(function (_ref) {
|
|
|
24
26
|
var _useStyles = useStyles(),
|
|
25
27
|
cx = _useStyles.cx,
|
|
26
28
|
styles = _useStyles.styles;
|
|
27
|
-
return /*#__PURE__*/
|
|
29
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
28
30
|
align: 'center',
|
|
29
31
|
className: cx(styles.container, className),
|
|
30
32
|
distribution: 'space-between',
|
|
31
33
|
gap: gap,
|
|
32
34
|
horizontal: true,
|
|
33
35
|
paddingInline: 16
|
|
34
|
-
}, rest),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
}, rest), {}, {
|
|
37
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
38
|
+
align: 'center',
|
|
39
|
+
className: cx(styles.left, classNames === null || classNames === void 0 ? void 0 : classNames.left),
|
|
40
|
+
gap: (gaps === null || gaps === void 0 ? void 0 : gaps.left) || 12,
|
|
41
|
+
horizontal: true,
|
|
42
|
+
justify: 'flex-start',
|
|
43
|
+
style: contentStyles === null || contentStyles === void 0 ? void 0 : contentStyles.left,
|
|
44
|
+
children: [showBackButton && /*#__PURE__*/_jsx(ActionIcon, {
|
|
45
|
+
icon: ChevronLeft,
|
|
46
|
+
onClick: function onClick() {
|
|
47
|
+
return onBackClick === null || onBackClick === void 0 ? void 0 : onBackClick();
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
fontSize: 24
|
|
51
|
+
},
|
|
52
|
+
style: {
|
|
53
|
+
marginRight: gaps !== null && gaps !== void 0 && gaps.left ? -gaps.left / 2 : -6
|
|
54
|
+
}
|
|
55
|
+
}), left]
|
|
56
|
+
}), children && /*#__PURE__*/_jsx(Flexbox, {
|
|
57
|
+
align: 'center',
|
|
58
|
+
className: cx(styles.center, classNames === null || classNames === void 0 ? void 0 : classNames.center),
|
|
59
|
+
gap: (gaps === null || gaps === void 0 ? void 0 : gaps.center) || 8,
|
|
60
|
+
horizontal: true,
|
|
61
|
+
justify: 'center',
|
|
62
|
+
style: contentStyles === null || contentStyles === void 0 ? void 0 : contentStyles.center,
|
|
63
|
+
children: children
|
|
64
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
65
|
+
align: 'center',
|
|
66
|
+
className: cx(styles.right, classNames === null || classNames === void 0 ? void 0 : classNames.right),
|
|
67
|
+
gap: (gaps === null || gaps === void 0 ? void 0 : gaps.right) || 8,
|
|
68
|
+
horizontal: true,
|
|
69
|
+
justify: 'flex-end',
|
|
70
|
+
style: contentStyles === null || contentStyles === void 0 ? void 0 : contentStyles.right,
|
|
71
|
+
children: right
|
|
72
|
+
})]
|
|
73
|
+
}));
|
|
67
74
|
});
|
|
68
75
|
export default ChatHeader;
|
|
@@ -3,6 +3,8 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
3
3
|
import { createStyles, useResponsive } from 'antd-style';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
8
|
var useStyles = createStyles(function (_ref) {
|
|
7
9
|
var css = _ref.css,
|
|
8
10
|
cx = _ref.cx,
|
|
@@ -22,26 +24,29 @@ var ChatInputActionBar = /*#__PURE__*/memo(function (_ref2) {
|
|
|
22
24
|
mobile = _useResponsive.mobile;
|
|
23
25
|
var _useStyles = useStyles(),
|
|
24
26
|
styles = _useStyles.styles;
|
|
25
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
26
28
|
align: 'center',
|
|
27
29
|
className: styles.container,
|
|
28
30
|
flex: 'none',
|
|
29
31
|
horizontal: true,
|
|
30
32
|
justify: 'space-between',
|
|
31
|
-
padding: padding
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
padding: padding,
|
|
34
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
35
|
+
align: 'center',
|
|
36
|
+
className: styles.left,
|
|
37
|
+
flex: 1,
|
|
38
|
+
gap: mobile ? 0 : 4,
|
|
39
|
+
horizontal: true,
|
|
40
|
+
children: leftAddons
|
|
41
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
42
|
+
align: 'center',
|
|
43
|
+
className: styles.right,
|
|
44
|
+
flex: 0,
|
|
45
|
+
gap: mobile ? 0 : 4,
|
|
46
|
+
horizontal: true,
|
|
47
|
+
justify: 'flex-end',
|
|
48
|
+
children: rightAddons
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
46
51
|
});
|
|
47
52
|
export default ChatInputActionBar;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
@@ -8,6 +7,8 @@ import { createStyles } from 'antd-style';
|
|
|
8
7
|
import { forwardRef, memo } from 'react';
|
|
9
8
|
import DraggablePanel from "../../DraggablePanel";
|
|
10
9
|
import ChatInputAreaInner from "./ChatInputAreaInner";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
var useStyles = createStyles(function (_ref) {
|
|
12
13
|
var css = _ref.css;
|
|
13
14
|
return {
|
|
@@ -31,7 +32,7 @@ var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
31
32
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
32
33
|
var _useStyles = useStyles(),
|
|
33
34
|
styles = _useStyles.styles;
|
|
34
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/_jsx(DraggablePanel, {
|
|
35
36
|
className: className,
|
|
36
37
|
classNames: classNames,
|
|
37
38
|
fullscreen: expand,
|
|
@@ -46,22 +47,25 @@ var ChatInputArea = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
46
47
|
},
|
|
47
48
|
style: _objectSpread({
|
|
48
49
|
zIndex: 10
|
|
49
|
-
}, style)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
50
|
+
}, style),
|
|
51
|
+
children: /*#__PURE__*/_jsxs("section", {
|
|
52
|
+
className: styles.container,
|
|
53
|
+
style: {
|
|
54
|
+
minHeight: heights === null || heights === void 0 ? void 0 : heights.minHeight
|
|
55
|
+
},
|
|
56
|
+
children: [topAddons, /*#__PURE__*/_jsx("div", {
|
|
57
|
+
className: styles.textareaContainer,
|
|
58
|
+
children: /*#__PURE__*/_jsx(ChatInputAreaInner, _objectSpread({
|
|
59
|
+
className: styles.textarea,
|
|
60
|
+
onSend: function onSend() {
|
|
61
|
+
_onSend === null || _onSend === void 0 || _onSend();
|
|
62
|
+
setExpand === null || setExpand === void 0 || setExpand(false);
|
|
63
|
+
},
|
|
64
|
+
ref: ref,
|
|
65
|
+
type: 'pure'
|
|
66
|
+
}, rest))
|
|
67
|
+
}), bottomAddons]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
66
70
|
});
|
|
67
71
|
export default /*#__PURE__*/memo(ChatInputArea);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["resize", "onCompositionEnd", "onPressEnter", "onCompositionStart", "className", "onInput", "loading", "onSend", "onBlur", "onChange"];
|
|
4
4
|
import { forwardRef, memo, useRef } from 'react';
|
|
5
5
|
import { TextArea } from "../../Input";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
var ChatInputAreaInner = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
7
8
|
var _ref$resize = _ref.resize,
|
|
8
9
|
resize = _ref$resize === void 0 ? false : _ref$resize,
|
|
@@ -17,7 +18,7 @@ var ChatInputAreaInner = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
17
18
|
_onChange = _ref.onChange,
|
|
18
19
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
20
|
var isChineseInput = useRef(false);
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/_jsx(TextArea, _objectSpread({
|
|
21
22
|
className: className,
|
|
22
23
|
onBlur: function onBlur(e) {
|
|
23
24
|
onInput === null || onInput === void 0 || onInput(e.target.value);
|
|
@@ -4,6 +4,8 @@ import { ArrowBigUp, CornerDownLeft, Loader2 } from 'lucide-react';
|
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
6
|
import Icon from "../../Icon";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
9
|
var ChatSendButton = /*#__PURE__*/memo(function (_ref) {
|
|
8
10
|
var className = _ref.className,
|
|
9
11
|
style = _ref.style,
|
|
@@ -14,7 +16,7 @@ var ChatSendButton = /*#__PURE__*/memo(function (_ref) {
|
|
|
14
16
|
loading = _ref.loading,
|
|
15
17
|
onStop = _ref.onStop;
|
|
16
18
|
var theme = useTheme();
|
|
17
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
18
20
|
align: 'end',
|
|
19
21
|
className: className,
|
|
20
22
|
distribution: 'space-between',
|
|
@@ -22,40 +24,53 @@ var ChatSendButton = /*#__PURE__*/memo(function (_ref) {
|
|
|
22
24
|
gap: 8,
|
|
23
25
|
horizontal: true,
|
|
24
26
|
padding: '0 24px',
|
|
25
|
-
style: style
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
27
|
+
style: style,
|
|
28
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
29
|
+
align: 'center',
|
|
30
|
+
gap: 8,
|
|
31
|
+
horizontal: true,
|
|
32
|
+
children: leftAddons
|
|
33
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
34
|
+
align: 'center',
|
|
35
|
+
gap: 8,
|
|
36
|
+
horizontal: true,
|
|
37
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
38
|
+
gap: 4,
|
|
39
|
+
horizontal: true,
|
|
40
|
+
style: {
|
|
41
|
+
color: theme.colorTextDescription,
|
|
42
|
+
fontSize: 12,
|
|
43
|
+
marginRight: 12
|
|
44
|
+
},
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
46
|
+
icon: CornerDownLeft
|
|
47
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
48
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.send) || 'Send'
|
|
49
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
50
|
+
children: "/"
|
|
51
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
52
|
+
horizontal: true,
|
|
53
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
54
|
+
icon: ArrowBigUp
|
|
55
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
56
|
+
icon: CornerDownLeft
|
|
57
|
+
})]
|
|
58
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
59
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.warp) || 'Warp'
|
|
60
|
+
})]
|
|
61
|
+
}), rightAddons, loading ? /*#__PURE__*/_jsx(Button, {
|
|
62
|
+
icon: loading && /*#__PURE__*/_jsx(Icon, {
|
|
63
|
+
icon: Loader2,
|
|
64
|
+
spin: true
|
|
65
|
+
}),
|
|
66
|
+
onClick: onStop,
|
|
67
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.stop) || 'Stop'
|
|
68
|
+
}) : /*#__PURE__*/_jsx(Button, {
|
|
69
|
+
onClick: onSend,
|
|
70
|
+
type: 'primary',
|
|
71
|
+
children: (texts === null || texts === void 0 ? void 0 : texts.send) || 'Send'
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
60
75
|
});
|
|
61
76
|
export default ChatSendButton;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
2
|
import { Flexbox } from 'react-layout-kit';
|
|
3
3
|
import { useStyles } from "../style";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
var Actions = /*#__PURE__*/memo(function (_ref) {
|
|
5
6
|
var actions = _ref.actions,
|
|
6
7
|
placement = _ref.placement,
|
|
@@ -12,10 +13,11 @@ var Actions = /*#__PURE__*/memo(function (_ref) {
|
|
|
12
13
|
type: type
|
|
13
14
|
}),
|
|
14
15
|
styles = _useStyles.styles;
|
|
15
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
16
17
|
align: 'flex-start',
|
|
17
18
|
className: styles.actions,
|
|
18
|
-
role: "menubar"
|
|
19
|
-
|
|
19
|
+
role: "menubar",
|
|
20
|
+
children: actions
|
|
21
|
+
});
|
|
20
22
|
});
|
|
21
23
|
export default Actions;
|
|
@@ -3,6 +3,8 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
3
3
|
import A from "../../../Avatar";
|
|
4
4
|
import { useStyles } from "../style";
|
|
5
5
|
import Loading from "./Loading";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
8
|
var Avatar = /*#__PURE__*/memo(function (_ref) {
|
|
7
9
|
var loading = _ref.loading,
|
|
8
10
|
avatar = _ref.avatar,
|
|
@@ -16,25 +18,27 @@ var Avatar = /*#__PURE__*/memo(function (_ref) {
|
|
|
16
18
|
avatarSize: size
|
|
17
19
|
}),
|
|
18
20
|
styles = _useStyles.styles;
|
|
19
|
-
var avatarContent = /*#__PURE__*/
|
|
20
|
-
className: styles.avatarContainer
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
var avatarContent = /*#__PURE__*/_jsxs("div", {
|
|
22
|
+
className: styles.avatarContainer,
|
|
23
|
+
children: [/*#__PURE__*/_jsx(A, {
|
|
24
|
+
animation: loading,
|
|
25
|
+
avatar: avatar.avatar,
|
|
26
|
+
background: avatar.backgroundColor,
|
|
27
|
+
onClick: onClick,
|
|
28
|
+
size: size,
|
|
29
|
+
title: avatar.title,
|
|
30
|
+
unoptimized: unoptimized
|
|
31
|
+
}), /*#__PURE__*/_jsx(Loading, {
|
|
32
|
+
loading: loading,
|
|
33
|
+
placement: placement
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
33
36
|
if (!addon) return avatarContent;
|
|
34
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
35
38
|
align: 'center',
|
|
36
39
|
className: styles.avatarGroupContainer,
|
|
37
|
-
gap: 8
|
|
38
|
-
|
|
40
|
+
gap: 8,
|
|
41
|
+
children: [avatarContent, addon]
|
|
42
|
+
});
|
|
39
43
|
});
|
|
40
44
|
export default Avatar;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
var BorderSpacing = /*#__PURE__*/memo(function (_ref) {
|
|
3
4
|
var borderSpacing = _ref.borderSpacing;
|
|
4
5
|
if (!borderSpacing) return null;
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
+
return /*#__PURE__*/_jsx("div", {
|
|
6
7
|
style: {
|
|
7
8
|
flex: 'none',
|
|
8
9
|
width: borderSpacing
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { Flexbox } from 'react-layout-kit';
|
|
4
4
|
import Alert from "../../../Alert";
|
|
5
5
|
import { useStyles } from "../style";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
var ErrorContent = /*#__PURE__*/memo(function (_ref) {
|
|
7
8
|
var message = _ref.message,
|
|
8
9
|
error = _ref.error,
|
|
@@ -11,13 +12,14 @@ var ErrorContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
11
12
|
placement: placement
|
|
12
13
|
}),
|
|
13
14
|
styles = _useStyles.styles;
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
-
className: styles.errorContainer
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
16
|
+
className: styles.errorContainer,
|
|
17
|
+
children: /*#__PURE__*/_jsx(Alert, _objectSpread({
|
|
18
|
+
closable: false,
|
|
19
|
+
extra: message,
|
|
20
|
+
showIcon: true,
|
|
21
|
+
type: 'error'
|
|
22
|
+
}, error))
|
|
23
|
+
});
|
|
22
24
|
});
|
|
23
25
|
export default ErrorContent;
|
|
@@ -3,6 +3,7 @@ import { memo } from 'react';
|
|
|
3
3
|
import { Flexbox } from 'react-layout-kit';
|
|
4
4
|
import Icon from "../../../Icon";
|
|
5
5
|
import { useStyles } from "../style";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
var Loading = /*#__PURE__*/memo(function (_ref) {
|
|
7
8
|
var loading = _ref.loading,
|
|
8
9
|
placement = _ref.placement;
|
|
@@ -11,17 +12,18 @@ var Loading = /*#__PURE__*/memo(function (_ref) {
|
|
|
11
12
|
}),
|
|
12
13
|
styles = _useStyles.styles;
|
|
13
14
|
if (!loading) return null;
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
15
16
|
align: 'center',
|
|
16
17
|
className: styles.loading,
|
|
17
|
-
justify: 'center'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
justify: 'center',
|
|
19
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
20
|
+
icon: Loader2,
|
|
21
|
+
size: {
|
|
22
|
+
fontSize: 12,
|
|
23
|
+
strokeWidth: 3
|
|
24
|
+
},
|
|
25
|
+
spin: true
|
|
26
|
+
})
|
|
27
|
+
});
|
|
26
28
|
});
|
|
27
29
|
export default Loading;
|