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