@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
package/es/Layout/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
6
|
var _excluded = ["headerHeight", "children", "className", "style"],
|
|
@@ -14,6 +13,9 @@ import { useResponsive } from 'antd-style';
|
|
|
14
13
|
import { memo, useEffect, useState } from 'react';
|
|
15
14
|
import DraggablePanel from "../DraggablePanel";
|
|
16
15
|
import { useStyles } from "./style";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
19
|
export var LayoutHeader = /*#__PURE__*/memo(function (_ref) {
|
|
18
20
|
var headerHeight = _ref.headerHeight,
|
|
19
21
|
children = _ref.children,
|
|
@@ -23,14 +25,16 @@ export var LayoutHeader = /*#__PURE__*/memo(function (_ref) {
|
|
|
23
25
|
var _useStyles = useStyles(headerHeight),
|
|
24
26
|
cx = _useStyles.cx,
|
|
25
27
|
styles = _useStyles.styles;
|
|
26
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/_jsxs("header", _objectSpread(_objectSpread({
|
|
27
29
|
className: cx(styles.header, className),
|
|
28
30
|
style: _objectSpread({
|
|
29
31
|
height: headerHeight
|
|
30
32
|
}, style)
|
|
31
|
-
}, rest),
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
}, rest), {}, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
35
|
+
className: styles.glass
|
|
36
|
+
}), children]
|
|
37
|
+
}));
|
|
34
38
|
});
|
|
35
39
|
export var LayoutMain = /*#__PURE__*/memo(function (_ref2) {
|
|
36
40
|
var children = _ref2.children,
|
|
@@ -39,9 +43,11 @@ export var LayoutMain = /*#__PURE__*/memo(function (_ref2) {
|
|
|
39
43
|
var _useStyles2 = useStyles(),
|
|
40
44
|
cx = _useStyles2.cx,
|
|
41
45
|
styles = _useStyles2.styles;
|
|
42
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/_jsx("main", _objectSpread(_objectSpread({
|
|
43
47
|
className: cx(styles.main, className)
|
|
44
|
-
}, rest),
|
|
48
|
+
}, rest), {}, {
|
|
49
|
+
children: children
|
|
50
|
+
}));
|
|
45
51
|
});
|
|
46
52
|
export var LayoutSidebar = /*#__PURE__*/memo(function (_ref3) {
|
|
47
53
|
var headerHeight = _ref3.headerHeight,
|
|
@@ -52,12 +58,14 @@ export var LayoutSidebar = /*#__PURE__*/memo(function (_ref3) {
|
|
|
52
58
|
var _useStyles3 = useStyles(headerHeight),
|
|
53
59
|
cx = _useStyles3.cx,
|
|
54
60
|
styles = _useStyles3.styles;
|
|
55
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/_jsx("aside", _objectSpread(_objectSpread({
|
|
56
62
|
className: cx(styles.aside, className),
|
|
57
63
|
style: _objectSpread({
|
|
58
64
|
top: headerHeight
|
|
59
65
|
}, style)
|
|
60
|
-
}, rest),
|
|
66
|
+
}, rest), {}, {
|
|
67
|
+
children: children
|
|
68
|
+
}));
|
|
61
69
|
});
|
|
62
70
|
export var LayoutSidebarInner = /*#__PURE__*/memo(function (_ref4) {
|
|
63
71
|
var headerHeight = _ref4.headerHeight,
|
|
@@ -67,9 +75,11 @@ export var LayoutSidebarInner = /*#__PURE__*/memo(function (_ref4) {
|
|
|
67
75
|
var _useStyles4 = useStyles(headerHeight),
|
|
68
76
|
cx = _useStyles4.cx,
|
|
69
77
|
styles = _useStyles4.styles;
|
|
70
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
71
79
|
className: cx(styles.asideInner, className)
|
|
72
|
-
}, rest),
|
|
80
|
+
}, rest), {}, {
|
|
81
|
+
children: children
|
|
82
|
+
}));
|
|
73
83
|
});
|
|
74
84
|
export var LayoutToc = /*#__PURE__*/memo(function (_ref5) {
|
|
75
85
|
var tocWidth = _ref5.tocWidth,
|
|
@@ -80,12 +90,14 @@ export var LayoutToc = /*#__PURE__*/memo(function (_ref5) {
|
|
|
80
90
|
var _useStyles5 = useStyles(),
|
|
81
91
|
cx = _useStyles5.cx,
|
|
82
92
|
styles = _useStyles5.styles;
|
|
83
|
-
return /*#__PURE__*/
|
|
93
|
+
return /*#__PURE__*/_jsx("nav", _objectSpread(_objectSpread({
|
|
84
94
|
className: cx(styles.toc, className),
|
|
85
95
|
style: tocWidth ? _objectSpread({
|
|
86
96
|
width: tocWidth
|
|
87
97
|
}, style) : style
|
|
88
|
-
}, rest),
|
|
98
|
+
}, rest), {}, {
|
|
99
|
+
children: children
|
|
100
|
+
}));
|
|
89
101
|
});
|
|
90
102
|
export var LayoutFooter = /*#__PURE__*/memo(function (_ref6) {
|
|
91
103
|
var children = _ref6.children,
|
|
@@ -94,9 +106,11 @@ export var LayoutFooter = /*#__PURE__*/memo(function (_ref6) {
|
|
|
94
106
|
var _useStyles6 = useStyles(),
|
|
95
107
|
cx = _useStyles6.cx,
|
|
96
108
|
styles = _useStyles6.styles;
|
|
97
|
-
return /*#__PURE__*/
|
|
109
|
+
return /*#__PURE__*/_jsx("footer", _objectSpread(_objectSpread({
|
|
98
110
|
className: cx(styles.footer, className)
|
|
99
|
-
}, rest),
|
|
111
|
+
}, rest), {}, {
|
|
112
|
+
children: children
|
|
113
|
+
}));
|
|
100
114
|
});
|
|
101
115
|
var Layout = /*#__PURE__*/memo(function (_ref7) {
|
|
102
116
|
var helmet = _ref7.helmet,
|
|
@@ -121,25 +135,39 @@ var Layout = /*#__PURE__*/memo(function (_ref7) {
|
|
|
121
135
|
useEffect(function () {
|
|
122
136
|
setExpand(Boolean(laptop));
|
|
123
137
|
}, [laptop]);
|
|
124
|
-
return /*#__PURE__*/
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
139
|
+
children: [helmet, header && /*#__PURE__*/_jsxs(LayoutHeader, {
|
|
140
|
+
headerHeight: headerHeight,
|
|
141
|
+
children: [header, mobile && toc && /*#__PURE__*/_jsx(LayoutToc, {
|
|
142
|
+
children: toc
|
|
143
|
+
})]
|
|
144
|
+
}), /*#__PURE__*/_jsxs(LayoutMain, {
|
|
145
|
+
children: [!mobile && !sidebar && /*#__PURE__*/_jsx("nav", {
|
|
146
|
+
style: {
|
|
147
|
+
width: tocWidth
|
|
148
|
+
}
|
|
149
|
+
}), !mobile && sidebar && /*#__PURE__*/_jsx(LayoutSidebar, {
|
|
150
|
+
headerHeight: headerHeight,
|
|
151
|
+
children: /*#__PURE__*/_jsx(DraggablePanel, {
|
|
152
|
+
expand: expand,
|
|
153
|
+
maxWidth: asideWidth,
|
|
154
|
+
onExpandChange: setExpand,
|
|
155
|
+
placement: "left",
|
|
156
|
+
children: /*#__PURE__*/_jsx(LayoutSidebarInner, {
|
|
157
|
+
headerHeight: headerHeight,
|
|
158
|
+
children: sidebar
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
}), /*#__PURE__*/_jsx("section", {
|
|
162
|
+
className: styles.content,
|
|
163
|
+
children: children
|
|
164
|
+
}), !mobile && toc && /*#__PURE__*/_jsx(LayoutToc, {
|
|
165
|
+
tocWidth: tocWidth,
|
|
166
|
+
children: toc
|
|
167
|
+
})]
|
|
168
|
+
}), footer && /*#__PURE__*/_jsx(LayoutFooter, {
|
|
169
|
+
children: footer
|
|
170
|
+
})]
|
|
171
|
+
});
|
|
144
172
|
});
|
|
145
173
|
export default Layout;
|
|
@@ -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 = ["active", "avatar", "loading", "description", "date", "title", "onHoverChange", "actions", "className", "style", "showAction", "children", "classNames", "addon", "pin"];
|
|
6
6
|
import { Typography } from 'antd';
|
|
@@ -10,6 +10,9 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
10
10
|
import Icon from "../../Icon";
|
|
11
11
|
import { useStyles } from "./style";
|
|
12
12
|
import { getChatItemTime } from "./time";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
16
|
var Title = Typography.Title,
|
|
14
17
|
Paragraph = Typography.Paragraph;
|
|
15
18
|
var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -32,7 +35,7 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
32
35
|
var _useStyles = useStyles(),
|
|
33
36
|
styles = _useStyles.styles,
|
|
34
37
|
cx = _useStyles.cx;
|
|
35
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
36
39
|
align: 'flex-start',
|
|
37
40
|
className: cx(styles.container, active && styles.active, className),
|
|
38
41
|
distribution: 'space-between',
|
|
@@ -47,56 +50,67 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
47
50
|
padding: 12,
|
|
48
51
|
ref: ref,
|
|
49
52
|
style: style
|
|
50
|
-
}, rest),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
53
|
+
}, rest), {}, {
|
|
54
|
+
children: [pin && /*#__PURE__*/_jsx("div", {
|
|
55
|
+
className: styles.pin,
|
|
56
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
57
|
+
className: styles.triangle
|
|
58
|
+
})
|
|
59
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
60
|
+
align: 'flex-start',
|
|
61
|
+
flex: 1,
|
|
62
|
+
gap: 8,
|
|
63
|
+
horizontal: true,
|
|
64
|
+
style: {
|
|
65
|
+
overflow: 'hidden'
|
|
66
|
+
},
|
|
67
|
+
children: [avatar !== null && avatar !== void 0 ? avatar : /*#__PURE__*/_jsx(Icon, {
|
|
68
|
+
icon: MessageSquare,
|
|
69
|
+
style: {
|
|
70
|
+
marginTop: 4
|
|
71
|
+
}
|
|
72
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
73
|
+
className: styles.content,
|
|
74
|
+
gap: 4,
|
|
75
|
+
children: [/*#__PURE__*/_jsx(Title, {
|
|
76
|
+
className: styles.title,
|
|
77
|
+
ellipsis: {
|
|
78
|
+
rows: 1
|
|
79
|
+
},
|
|
80
|
+
level: 3,
|
|
81
|
+
children: title
|
|
82
|
+
}), description && /*#__PURE__*/_jsx(Paragraph, {
|
|
83
|
+
className: styles.desc,
|
|
84
|
+
ellipsis: {
|
|
85
|
+
rows: 1
|
|
86
|
+
},
|
|
87
|
+
children: description
|
|
88
|
+
}), addon]
|
|
89
|
+
})]
|
|
90
|
+
}), loading ? /*#__PURE__*/_jsx(Icon, {
|
|
91
|
+
icon: Loader2,
|
|
92
|
+
spin: true
|
|
93
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
94
|
+
children: [showAction && /*#__PURE__*/_jsx(Flexbox, {
|
|
95
|
+
className: styles.actions,
|
|
96
|
+
gap: 4,
|
|
97
|
+
horizontal: true,
|
|
98
|
+
onClick: function onClick(e) {
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
e.stopPropagation();
|
|
101
|
+
},
|
|
102
|
+
style: {
|
|
103
|
+
display: showAction ? undefined : 'none'
|
|
104
|
+
},
|
|
105
|
+
children: actions
|
|
106
|
+
}), date && /*#__PURE__*/_jsx("div", {
|
|
107
|
+
className: cx(styles.time, classNames === null || classNames === void 0 ? void 0 : classNames.time),
|
|
108
|
+
style: showAction ? {
|
|
109
|
+
opacity: 0
|
|
110
|
+
} : {},
|
|
111
|
+
children: getChatItemTime(date)
|
|
112
|
+
})]
|
|
113
|
+
}), children]
|
|
114
|
+
}));
|
|
101
115
|
});
|
|
102
116
|
export default ListItem;
|
package/es/Markdown/CodeBlock.js
CHANGED
|
@@ -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 = ["fullFeatured", "enableMermaid", "highlight", "mermaid"];
|
|
4
4
|
import Pre, { PreMermaid, PreSingleLine } from "../mdx/mdxComponents/Pre";
|
|
5
5
|
import { FALLBACK_LANG } from "../hooks/useHighlight";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
var countLines = function countLines(str) {
|
|
7
8
|
var regex = /\n/g;
|
|
8
9
|
var matches = str.match(regex);
|
|
@@ -32,22 +33,27 @@ var CodeBlock = function CodeBlock(_ref) {
|
|
|
32
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
34
|
var code = useCode(rest === null || rest === void 0 || (_rest$children = rest.children) === null || _rest$children === void 0 ? void 0 : _rest$children[0]);
|
|
34
35
|
if (!code) return;
|
|
35
|
-
if (enableMermaid && code.lang === 'mermaid') return /*#__PURE__*/
|
|
36
|
+
if (enableMermaid && code.lang === 'mermaid') return /*#__PURE__*/_jsx(PreMermaid, _objectSpread(_objectSpread({
|
|
36
37
|
fullFeatured: fullFeatured
|
|
37
|
-
}, mermaid),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}, mermaid), {}, {
|
|
39
|
+
children: code.content
|
|
40
|
+
}));
|
|
41
|
+
if (!highlight && code.isSingleLine) return /*#__PURE__*/_jsx(PreSingleLine, {
|
|
42
|
+
language: code.lang,
|
|
43
|
+
children: code.content
|
|
44
|
+
});
|
|
45
|
+
return /*#__PURE__*/_jsx(Pre, _objectSpread(_objectSpread(_objectSpread({
|
|
42
46
|
fullFeatured: fullFeatured,
|
|
43
47
|
language: code.lang
|
|
44
|
-
}, highlight, rest),
|
|
48
|
+
}, highlight), rest), {}, {
|
|
49
|
+
children: code.content
|
|
50
|
+
}));
|
|
45
51
|
};
|
|
46
52
|
export var CodeLite = function CodeLite(props) {
|
|
47
|
-
return /*#__PURE__*/
|
|
53
|
+
return /*#__PURE__*/_jsx(CodeBlock, _objectSpread({}, props));
|
|
48
54
|
};
|
|
49
55
|
export var CodeFullFeatured = function CodeFullFeatured(props) {
|
|
50
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/_jsx(CodeBlock, _objectSpread({
|
|
51
57
|
fullFeatured: true
|
|
52
58
|
}, props));
|
|
53
59
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
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 = ["children", "className", "fontSize", "headerMultiple", "marginMultiple", "lineHeight"];
|
|
6
6
|
import { useStyles } from "./markdown.style";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export var Typography = function Typography(_ref) {
|
|
8
9
|
var children = _ref.children,
|
|
9
10
|
className = _ref.className,
|
|
@@ -20,7 +21,9 @@ export var Typography = function Typography(_ref) {
|
|
|
20
21
|
}),
|
|
21
22
|
cx = _useStyles.cx,
|
|
22
23
|
styles = _useStyles.styles;
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/_jsx("article", _objectSpread(_objectSpread({
|
|
24
25
|
className: cx(styles.__root, styles.a, styles.blockquote, styles.code, styles.details, styles.header, styles.hr, styles.img, styles.kbd, styles.list, styles.p, styles.pre, styles.strong, styles.table, styles.video, className)
|
|
25
|
-
}, rest),
|
|
26
|
+
}, rest), {}, {
|
|
27
|
+
children: children
|
|
28
|
+
}));
|
|
26
29
|
};
|
package/es/Markdown/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
6
|
var _excluded = ["children", "className", "style", "fullFeaturedCodeBlock", "onDoubleClick", "enableLatex", "enableMermaid", "enableImageGallery", "componentProps", "allowHtml", "fontSize", "headerMultiple", "marginMultiple", "variant", "lineHeight", "rehypePlugins", "remarkPlugins", "components", "customRender"];
|
|
@@ -20,6 +19,7 @@ import { CodeFullFeatured, CodeLite } from "./CodeBlock";
|
|
|
20
19
|
import { useStyles as useMarkdownStyles } from "./markdown.style";
|
|
21
20
|
import { useStyles } from "./style";
|
|
22
21
|
import { escapeBrackets, escapeMhchem, fixMarkdownBold } from "./utils";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
23
|
var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
24
24
|
var children = _ref.children,
|
|
25
25
|
className = _ref.className,
|
|
@@ -68,11 +68,11 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
68
68
|
var memoComponents = useMemo(function () {
|
|
69
69
|
return _objectSpread({
|
|
70
70
|
a: function a(props) {
|
|
71
|
-
return /*#__PURE__*/
|
|
71
|
+
return /*#__PURE__*/_jsx(Link, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.a));
|
|
72
72
|
},
|
|
73
73
|
img: enableImageGallery ? function (props) {
|
|
74
74
|
var _componentProps$img, _componentProps$img2;
|
|
75
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/_jsx(Image, _objectSpread(_objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.img), {}, {
|
|
76
76
|
style: isChatMode ? _objectSpread({
|
|
77
77
|
height: 'auto',
|
|
78
78
|
maxWidth: 640
|
|
@@ -80,18 +80,18 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
80
80
|
}));
|
|
81
81
|
} : undefined,
|
|
82
82
|
pre: function pre(props) {
|
|
83
|
-
return fullFeaturedCodeBlock ? /*#__PURE__*/
|
|
83
|
+
return fullFeaturedCodeBlock ? /*#__PURE__*/_jsx(CodeFullFeatured, _objectSpread(_objectSpread({
|
|
84
84
|
enableMermaid: enableMermaid,
|
|
85
85
|
highlight: componentProps === null || componentProps === void 0 ? void 0 : componentProps.highlight,
|
|
86
86
|
mermaid: componentProps === null || componentProps === void 0 ? void 0 : componentProps.mermaid
|
|
87
|
-
}, props, componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre)) : /*#__PURE__*/
|
|
87
|
+
}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre)) : /*#__PURE__*/_jsx(CodeLite, _objectSpread(_objectSpread({
|
|
88
88
|
enableMermaid: enableMermaid,
|
|
89
89
|
highlight: componentProps === null || componentProps === void 0 ? void 0 : componentProps.highlight,
|
|
90
90
|
mermaid: componentProps === null || componentProps === void 0 ? void 0 : componentProps.mermaid
|
|
91
|
-
}, props, componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre));
|
|
91
|
+
}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre));
|
|
92
92
|
},
|
|
93
93
|
video: function video(props) {
|
|
94
|
-
return /*#__PURE__*/
|
|
94
|
+
return /*#__PURE__*/_jsx(Video, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.video));
|
|
95
95
|
}
|
|
96
96
|
}, components);
|
|
97
97
|
}, [].concat(_toConsumableArray(Object.values(components || {})), _toConsumableArray(Object.values(componentProps || {})), [enableImageGallery, enableMermaid, fullFeaturedCodeBlock]));
|
|
@@ -103,22 +103,26 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
103
103
|
var memoRemarkPlugins = useMemo(function () {
|
|
104
104
|
return [remarkGfm, enableLatex && remarkMath, isChatMode && remarkBreaks].concat(_toConsumableArray(innerRemarkPlugins)).filter(Boolean);
|
|
105
105
|
}, [isChatMode, enableLatex].concat(_toConsumableArray(innerRemarkPlugins)));
|
|
106
|
-
var defaultDOM = /*#__PURE__*/
|
|
107
|
-
enable: enableImageGallery
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
var defaultDOM = /*#__PURE__*/_jsx(ImageGallery, {
|
|
107
|
+
enable: enableImageGallery,
|
|
108
|
+
children: /*#__PURE__*/_jsx(ReactMarkdown, _objectSpread(_objectSpread({
|
|
109
|
+
className: cx(mdStyles.__root, mdStyles.a, mdStyles.blockquote, mdStyles.code, mdStyles.details, mdStyles.header, mdStyles.hr, mdStyles.img, mdStyles.kbd, mdStyles.list, mdStyles.p, mdStyles.pre, mdStyles.strong, mdStyles.table, mdStyles.video, enableLatex && styles.latex, isChatMode && styles.chat),
|
|
110
|
+
components: memoComponents,
|
|
111
|
+
rehypePlugins: memoRehypePlugins,
|
|
112
|
+
remarkPlugins: memoRemarkPlugins
|
|
113
|
+
}, rest), {}, {
|
|
114
|
+
children: escapedContent
|
|
115
|
+
}))
|
|
116
|
+
});
|
|
114
117
|
var markdownContent = customRender ? customRender(defaultDOM, {
|
|
115
118
|
text: escapedContent
|
|
116
119
|
}) : defaultDOM;
|
|
117
|
-
return /*#__PURE__*/
|
|
120
|
+
return /*#__PURE__*/_jsx("article", {
|
|
118
121
|
className: cx(styles.root, className),
|
|
119
122
|
"data-code-type": "markdown",
|
|
120
123
|
onDoubleClick: onDoubleClick,
|
|
121
|
-
style: style
|
|
122
|
-
|
|
124
|
+
style: style,
|
|
125
|
+
children: markdownContent
|
|
126
|
+
});
|
|
123
127
|
});
|
|
124
128
|
export default Markdown;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
5
|
var _excluded = ["fallbackUnknownType", "filename", "size", "variant", "type", "style", "open"];
|
|
7
6
|
import { memo, useMemo } from 'react';
|
|
@@ -10,6 +9,8 @@ import { useCdnFn } from "../ConfigProvider";
|
|
|
10
9
|
import FileTypeIcon from "../FileTypeIcon";
|
|
11
10
|
import Img from "../Img";
|
|
12
11
|
import { getIconUrlForDirectoryPath, getIconUrlForFilePath } from "./utils";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
var MaterialFileTypeIcon = /*#__PURE__*/memo(function (_ref) {
|
|
14
15
|
var _ref$fallbackUnknownT = _ref.fallbackUnknownType,
|
|
15
16
|
fallbackUnknownType = _ref$fallbackUnknownT === void 0 ? true : _ref$fallbackUnknownT,
|
|
@@ -40,37 +41,39 @@ var MaterialFileTypeIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
40
41
|
path: filename
|
|
41
42
|
});
|
|
42
43
|
}, [ICONS_URL, type, filename, open]);
|
|
43
|
-
if (!iconUrl) return /*#__PURE__*/
|
|
44
|
+
if (!iconUrl) return /*#__PURE__*/_jsx(FileTypeIcon, {
|
|
44
45
|
filetype: filename.split('.')[1],
|
|
45
46
|
size: size,
|
|
46
47
|
type: type,
|
|
47
48
|
variant: 'mono'
|
|
48
49
|
});
|
|
49
|
-
if (variant === 'pure') return /*#__PURE__*/
|
|
50
|
+
if (variant === 'pure') return /*#__PURE__*/_jsx(Img, _objectSpread({
|
|
50
51
|
height: size,
|
|
51
52
|
src: iconUrl,
|
|
52
53
|
style: style,
|
|
53
54
|
width: size
|
|
54
55
|
}, rest));
|
|
55
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/_jsxs(Center, _objectSpread(_objectSpread({
|
|
56
57
|
flex: 'none',
|
|
57
58
|
height: size,
|
|
58
59
|
style: _objectSpread({
|
|
59
60
|
position: 'relative'
|
|
60
61
|
}, style),
|
|
61
62
|
width: size
|
|
62
|
-
}, rest),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
}, rest), {}, {
|
|
64
|
+
children: [/*#__PURE__*/_jsx(FileTypeIcon, {
|
|
65
|
+
size: size,
|
|
66
|
+
type: variant,
|
|
67
|
+
variant: 'mono'
|
|
68
|
+
}), /*#__PURE__*/_jsx(Img, _objectSpread({
|
|
69
|
+
height: size / 2,
|
|
70
|
+
src: iconUrl,
|
|
71
|
+
style: {
|
|
72
|
+
position: 'absolute',
|
|
73
|
+
top: size / 3
|
|
74
|
+
},
|
|
75
|
+
width: size / 2
|
|
76
|
+
}, rest))]
|
|
77
|
+
}));
|
|
75
78
|
});
|
|
76
79
|
export default MaterialFileTypeIcon;
|