@ant-design/agentic-ui 2.0.14 → 2.0.16
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/dist/BackTo/BackBottom.d.ts +56 -0
- package/dist/BackTo/BackTop.d.ts +39 -2
- package/dist/BackTo/index.d.ts +20 -0
- package/dist/Bubble/AIBubble.js +4 -1
- package/dist/Bubble/List/index.js +1 -1
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +3 -1
- package/dist/Bubble/UserBubble.js +1 -1
- package/dist/Bubble/index.d.ts +6 -0
- package/dist/Bubble/style.js +5 -2
- package/dist/ChatBootPage/CaseReply.js +1 -1
- package/dist/ChatBootPage/Title.js +1 -1
- package/dist/ChatBootPage/index.d.ts +6 -0
- package/dist/Components/ActionIconBox/index.js +1 -1
- package/dist/Components/ActionItemBox/ActionItemBox.js +1 -1
- package/dist/Components/ActionItemBox/index.d.ts +6 -0
- package/dist/Components/Button/index.d.ts +6 -0
- package/dist/History/components/HistoryItem.js +2 -2
- package/dist/History/components/NewChatComponent.js +1 -1
- package/dist/History/components/SearchComponent.d.ts +2 -0
- package/dist/History/components/SearchComponent.js +17 -3
- package/dist/History/index.d.ts +4 -0
- package/dist/History/index.js +17 -11
- package/dist/History/menu.d.ts +2 -0
- package/dist/History/menu.js +18 -5
- package/dist/History/style.js +1 -1
- package/dist/History/types/index.d.ts +6 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +1 -1
- package/dist/MarkdownEditor/editor/components/CommentList/index.js +1 -1
- package/dist/MarkdownEditor/editor/components/ContributorAvatar/index.js +1 -1
- package/dist/MarkdownEditor/editor/components/fntTag/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Comment/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition.js +1 -1
- package/dist/MarkdownEditor/editor/elements/FootnoteReference.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Head.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Image/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/LinkCard/index.js +2 -2
- package/dist/MarkdownEditor/editor/elements/List/List.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/style.js +2 -2
- package/dist/MarkdownEditor/editor/elements/Media.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Paragraph.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/SimpleTable.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +5 -3
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/index.js +3 -1
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/Td/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.d.ts +0 -22
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +176 -124
- package/dist/MarkdownEditor/editor/elements/index.js +1 -1
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +16 -12
- package/dist/MarkdownEditor/editor/style.js +6 -6
- package/dist/MarkdownEditor/editor/tools/DragHandle.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/ToolBar.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +9 -8
- package/dist/MarkdownInputField/AttachmentButton/index.d.ts +2 -0
- package/dist/MarkdownInputField/AttachmentButton/index.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/style.js +3 -3
- package/dist/MarkdownInputField/AttachmentButton/utils.d.ts +8 -0
- package/dist/MarkdownInputField/AttachmentButton/utils.js +10 -3
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +1 -1
- package/dist/MarkdownInputField/Enlargement/index.js +9 -29
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +30 -27
- package/dist/MarkdownInputField/FileMapView/index.d.ts +4 -4
- package/dist/MarkdownInputField/FileMapView/index.js +25 -15
- package/dist/MarkdownInputField/FileUploadManager/index.js +2 -2
- package/dist/MarkdownInputField/MarkdownInputField.d.ts +9 -19
- package/dist/MarkdownInputField/MarkdownInputField.js +155 -192
- package/dist/MarkdownInputField/QuickActions/index.js +4 -8
- package/dist/MarkdownInputField/RefinePromptButton/index.js +9 -54
- package/dist/MarkdownInputField/SendActions/index.js +1 -1
- package/dist/MarkdownInputField/SendButton/index.js +1 -1
- package/dist/MarkdownInputField/SkillModeBar/index.js +1 -1
- package/dist/MarkdownInputField/TopOperatingArea/index.js +1 -1
- package/dist/MarkdownInputField/VoiceInput/index.js +1 -1
- package/dist/MarkdownInputField/style.js +40 -45
- package/dist/Plugins/chart/AreaChart/index.d.ts +2 -2
- package/dist/Plugins/chart/AreaChart/index.js +9 -29
- package/dist/Plugins/chart/BarChart/index.d.ts +8 -8
- package/dist/Plugins/chart/BarChart/index.js +9 -8
- package/dist/Plugins/chart/DonutChart/constants.d.ts +0 -1
- package/dist/Plugins/chart/DonutChart/constants.js +0 -14
- package/dist/Plugins/chart/DonutChart/index.js +51 -16
- package/dist/Plugins/chart/DonutChart/style.js +7 -0
- package/dist/Plugins/chart/DonutChart/types.d.ts +2 -0
- package/dist/Plugins/chart/FunnelChart/index.d.ts +8 -8
- package/dist/Plugins/chart/FunnelChart/index.js +85 -66
- package/dist/Plugins/chart/FunnelChart/style.js +12 -0
- package/dist/Plugins/chart/LineChart/index.d.ts +2 -2
- package/dist/Plugins/chart/LineChart/index.js +16 -19
- package/dist/Plugins/chart/RadarChart/index.d.ts +11 -5
- package/dist/Plugins/chart/RadarChart/index.js +35 -50
- package/dist/Plugins/chart/RadarChart/style.js +8 -0
- package/dist/Plugins/chart/ScatterChart/index.d.ts +23 -6
- package/dist/Plugins/chart/ScatterChart/index.js +58 -57
- package/dist/Plugins/chart/ScatterChart/style.js +8 -0
- package/dist/Plugins/chart/components/ChartContainer/style.js +7 -1
- package/dist/Plugins/chart/hooks/useChartStatistic.d.ts +0 -6
- package/dist/Plugins/chart/hooks/useChartStatistic.js +0 -16
- package/dist/Plugins/chart/index.js +2 -2
- package/dist/Plugins/index.d.ts +6 -0
- package/dist/Plugins/mermaid/index.js +1 -1
- package/dist/Quote/index.js +1 -1
- package/dist/Schema/index.d.ts +6 -0
- package/dist/ThoughtChainList/DotAni/index.css +1 -1
- package/dist/ThoughtChainList/DotAni/index.js +2 -2
- package/dist/ToolUseBar/ToolUseBarThink.js +1 -1
- package/dist/ToolUseBar/index.js +1 -1
- package/dist/WelcomeMessage/index.d.ts +42 -0
- package/dist/WelcomeMessage/index.js +1 -1
- package/dist/Workspace/File/PreviewComponent.js +3 -2
- package/dist/Workspace/File/style.js +2 -1
- package/dist/Workspace/RealtimeFollow/style.js +2 -7
- package/dist/Workspace/Task/index.js +1 -1
- package/dist/Workspace/style.js +2 -1
- package/package.json +1 -1
- package/dist/MarkdownInputField/Enlargement/style.d.ts +0 -10
- package/dist/MarkdownInputField/Enlargement/style.js +0 -75
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ScrollVisibleButtonProps, ScrollVisibleButtonRef } from './ScrollVisibleButton';
|
|
3
|
+
/**
|
|
4
|
+
* BackBottom 组件属性接口
|
|
5
|
+
* @interface BackBottomProps
|
|
6
|
+
*/
|
|
3
7
|
export interface BackBottomProps extends ScrollVisibleButtonProps {
|
|
4
8
|
/**
|
|
5
9
|
* 滚动到底部的持续时间
|
|
@@ -7,4 +11,56 @@ export interface BackBottomProps extends ScrollVisibleButtonProps {
|
|
|
7
11
|
*/
|
|
8
12
|
duration?: number;
|
|
9
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* BackBottom 组件 - 返回底部按钮组件
|
|
16
|
+
*
|
|
17
|
+
* 该组件提供一个返回底部的浮动按钮,点击后平滑滚动到页面底部。
|
|
18
|
+
* 当距离底部超过指定阈值时自动显示,支持自定义滚动持续时间和显示条件。
|
|
19
|
+
*
|
|
20
|
+
* @component
|
|
21
|
+
* @description 返回底部按钮,点击后平滑滚动到页面底部
|
|
22
|
+
* @param {BackBottomProps} props - 组件属性
|
|
23
|
+
* @param {number} [props.duration=450] - 滚动到底部的持续时间(毫秒)
|
|
24
|
+
* @param {number | ((scrollTop: number, container: HTMLElement | Window) => boolean)} [props.shouldVisible=400] - 显示条件阈值或自定义函数
|
|
25
|
+
* @param {(e: React.MouseEvent, container: HTMLElement | Window) => void} [props.onClick] - 点击回调函数
|
|
26
|
+
* @param {string} [props.className] - 自定义CSS类名
|
|
27
|
+
* @param {React.CSSProperties} [props.style] - 自定义样式
|
|
28
|
+
* @param {HTMLElement | Window} [props.target] - 滚动容器,默认为 window
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* // 基本用法
|
|
33
|
+
* <BackBottom />
|
|
34
|
+
*
|
|
35
|
+
* // 自定义滚动持续时间
|
|
36
|
+
* <BackBottom duration={300} />
|
|
37
|
+
*
|
|
38
|
+
* // 自定义显示阈值
|
|
39
|
+
* <BackBottom shouldVisible={600} />
|
|
40
|
+
*
|
|
41
|
+
* // 自定义显示条件
|
|
42
|
+
* <BackBottom
|
|
43
|
+
* shouldVisible={(scrollTop, container) => {
|
|
44
|
+
* const scrollHeight = container instanceof Window
|
|
45
|
+
* ? document.documentElement.scrollHeight
|
|
46
|
+
* : container.scrollHeight;
|
|
47
|
+
* return scrollHeight - scrollTop >= 800;
|
|
48
|
+
* }}
|
|
49
|
+
* />
|
|
50
|
+
*
|
|
51
|
+
* // 指定滚动容器
|
|
52
|
+
* <BackBottom target={document.getElementById('container')} />
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @returns {React.ReactElement} 渲染的返回底部按钮组件
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* - 默认在距离底部超过 400px 时显示
|
|
59
|
+
* - 支持平滑滚动动画
|
|
60
|
+
* - 可自定义滚动持续时间
|
|
61
|
+
* - 支持自定义显示条件
|
|
62
|
+
* - 支持指定滚动容器
|
|
63
|
+
* - 使用 forwardRef 支持 ref 传递
|
|
64
|
+
* - 提供完整的无障碍支持
|
|
65
|
+
*/
|
|
10
66
|
export declare const BackBottom: React.ForwardRefExoticComponent<BackBottomProps & React.RefAttributes<ScrollVisibleButtonRef>>;
|
package/dist/BackTo/BackTop.d.ts
CHANGED
|
@@ -8,13 +8,50 @@ export interface BackTopProps extends ScrollVisibleButtonProps {
|
|
|
8
8
|
duration?: number;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* BackTop 组件
|
|
11
|
+
* BackTop 组件 - 返回顶部按钮组件
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* 该组件提供一个返回顶部的浮动按钮,点击后平滑滚动到页面顶部。
|
|
14
|
+
* 当滚动距离超过指定阈值时自动显示,支持自定义滚动持续时间和显示条件。
|
|
15
|
+
*
|
|
16
|
+
* @component
|
|
17
|
+
* @description 返回顶部按钮,点击后平滑滚动到页面顶部
|
|
18
|
+
* @param {BackTopProps} props - 组件属性
|
|
19
|
+
* @param {number} [props.duration=450] - 滚动到顶部的持续时间(毫秒)
|
|
20
|
+
* @param {number | ((scrollTop: number, container: HTMLElement | Window) => boolean)} [props.shouldVisible=400] - 显示条件阈值或自定义函数
|
|
21
|
+
* @param {(e: React.MouseEvent, container: HTMLElement | Window) => void} [props.onClick] - 点击回调函数
|
|
22
|
+
* @param {string} [props.className] - 自定义CSS类名
|
|
23
|
+
* @param {React.CSSProperties} [props.style] - 自定义样式
|
|
24
|
+
* @param {HTMLElement | Window} [props.target] - 滚动容器,默认为 window
|
|
14
25
|
*
|
|
15
26
|
* @example
|
|
16
27
|
* ```tsx
|
|
28
|
+
* // 基本用法
|
|
29
|
+
* <BackTop />
|
|
30
|
+
*
|
|
31
|
+
* // 自定义滚动持续时间
|
|
17
32
|
* <BackTop duration={300} />
|
|
33
|
+
*
|
|
34
|
+
* // 自定义显示阈值
|
|
35
|
+
* <BackTop shouldVisible={600} />
|
|
36
|
+
*
|
|
37
|
+
* // 自定义显示条件
|
|
38
|
+
* <BackTop
|
|
39
|
+
* shouldVisible={(scrollTop) => scrollTop > 500}
|
|
40
|
+
* />
|
|
41
|
+
*
|
|
42
|
+
* // 指定滚动容器
|
|
43
|
+
* <BackTop target={document.getElementById('container')} />
|
|
18
44
|
* ```
|
|
45
|
+
*
|
|
46
|
+
* @returns {React.ReactElement} 渲染的返回顶部按钮组件
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* - 默认在滚动距离超过 400px 时显示
|
|
50
|
+
* - 支持平滑滚动动画
|
|
51
|
+
* - 可自定义滚动持续时间
|
|
52
|
+
* - 支持自定义显示条件
|
|
53
|
+
* - 支持指定滚动容器
|
|
54
|
+
* - 使用 forwardRef 支持 ref 传递
|
|
55
|
+
* - 提供完整的无障碍支持
|
|
19
56
|
*/
|
|
20
57
|
export declare const BackTop: React.ForwardRefExoticComponent<BackTopProps & React.RefAttributes<ScrollVisibleButtonRef>>;
|
package/dist/BackTo/index.d.ts
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type { BackBottomProps } from './BackBottom';
|
|
3
3
|
export type { BackTopProps } from './BackTop';
|
|
4
|
+
/**
|
|
5
|
+
* BackTo 组件集合 - 页面滚动导航组件
|
|
6
|
+
*
|
|
7
|
+
* 该对象导出包含返回顶部和返回底部两个组件,提供便捷的页面滚动导航功能。
|
|
8
|
+
*
|
|
9
|
+
* @namespace BackTo
|
|
10
|
+
* @property {React.FC<BackTopProps>} Top - 返回顶部按钮组件
|
|
11
|
+
* @property {React.FC<BackBottomProps>} Bottom - 返回底部按钮组件
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { BackTo } from 'agentic-ui';
|
|
16
|
+
*
|
|
17
|
+
* // 使用返回顶部组件
|
|
18
|
+
* <BackTo.Top duration={300} />
|
|
19
|
+
*
|
|
20
|
+
* // 使用返回底部组件
|
|
21
|
+
* <BackTo.Bottom duration={300} />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
4
24
|
export declare const BackTo: {
|
|
5
25
|
Top: import("react").ForwardRefExoticComponent<import("./BackTop").BackTopProps & import("react").RefAttributes<import("./ScrollVisibleButton").ScrollVisibleButtonRef>>;
|
|
6
26
|
Bottom: import("react").ForwardRefExoticComponent<import("./BackBottom").BackBottomProps & import("react").RefAttributes<import("./ScrollVisibleButton").ScrollVisibleButtonRef>>;
|
package/dist/Bubble/AIBubble.js
CHANGED
|
@@ -94,7 +94,7 @@ var AIBubble = memo((props) => {
|
|
|
94
94
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
95
95
|
const context = useContext(BubbleConfigContext);
|
|
96
96
|
const { compact, standalone, locale } = context || {};
|
|
97
|
-
const prefixClass = getPrefixCls("
|
|
97
|
+
const prefixClass = getPrefixCls("agentic");
|
|
98
98
|
const { wrapSSR, hashId } = useStyle(prefixClass);
|
|
99
99
|
const typing = isTyping(originData);
|
|
100
100
|
const preMessageSameRole = isSameRoleAsPrevious(preMessage, originData);
|
|
@@ -253,6 +253,9 @@ var AIBubble = memo((props) => {
|
|
|
253
253
|
className: cx(
|
|
254
254
|
`${prefixClass}-bubble-container`,
|
|
255
255
|
`${prefixClass}-bubble-container-${placement}`,
|
|
256
|
+
{
|
|
257
|
+
[`${prefixClass}-bubble-container-pure`]: props.pure
|
|
258
|
+
},
|
|
256
259
|
hashId
|
|
257
260
|
)
|
|
258
261
|
},
|
|
@@ -46,7 +46,7 @@ var BubbleList = (props) => {
|
|
|
46
46
|
} = props;
|
|
47
47
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
48
48
|
const { compact } = useContext(BubbleConfigContext) || {};
|
|
49
|
-
const prefixClass = getPrefixCls("
|
|
49
|
+
const prefixClass = getPrefixCls("agentic-bubble-list");
|
|
50
50
|
const { wrapSSR, hashId } = useStyle(prefixClass);
|
|
51
51
|
const deps = useMemo(() => [props.style], [JSON.stringify(props.style)]);
|
|
52
52
|
const bubbleListDom = useMemo(() => {
|
|
@@ -102,7 +102,9 @@ var MarkdownPreview = (props) => {
|
|
|
102
102
|
background: " #FFFFFF",
|
|
103
103
|
color: token.colorError,
|
|
104
104
|
borderRadius: "16px 16px 2px 16px",
|
|
105
|
-
border: "1px solid " + token.colorErrorBorder
|
|
105
|
+
border: "1px solid " + token.colorErrorBorder,
|
|
106
|
+
marginLeft: props.placement === "right" ? 0 : 24,
|
|
107
|
+
marginRight: props.placement === "right" ? 24 : 0
|
|
106
108
|
}
|
|
107
109
|
},
|
|
108
110
|
(locale == null ? void 0 : locale["error.unexpected"]) || "出现点意外情况,请重新发送"
|
|
@@ -60,7 +60,7 @@ var UserBubble = memo((props) => {
|
|
|
60
60
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
61
61
|
const context = useContext(BubbleConfigContext);
|
|
62
62
|
const { compact, standalone, locale } = context || {};
|
|
63
|
-
const prefixClass = getPrefixCls("
|
|
63
|
+
const prefixClass = getPrefixCls("agentic");
|
|
64
64
|
const { wrapSSR, hashId } = useStyle(prefixClass, classNames);
|
|
65
65
|
const time = (originData == null ? void 0 : originData.createAt) || props.time;
|
|
66
66
|
const placement = USER_PLACEMENT;
|
package/dist/Bubble/index.d.ts
CHANGED
package/dist/Bubble/style.js
CHANGED
|
@@ -39,7 +39,7 @@ var genStyle = (token, classNames) => {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
-
".md-editor-code": {
|
|
42
|
+
".agentic-md-editor-code": {
|
|
43
43
|
borderRadius: "12px !important",
|
|
44
44
|
overflow: "auto",
|
|
45
45
|
padding: "var(--padding-3x)"
|
|
@@ -81,7 +81,10 @@ var genStyle = (token, classNames) => {
|
|
|
81
81
|
width: "100%",
|
|
82
82
|
display: "flex",
|
|
83
83
|
flexDirection: "column",
|
|
84
|
-
gap:
|
|
84
|
+
gap: 8,
|
|
85
|
+
"&-pure": {
|
|
86
|
+
gap: 4
|
|
87
|
+
},
|
|
85
88
|
"&-right": {
|
|
86
89
|
alignItems: "flex-end"
|
|
87
90
|
},
|
|
@@ -16,7 +16,7 @@ var CaseReply = ({
|
|
|
16
16
|
prefixCls: customPrefixCls
|
|
17
17
|
}) => {
|
|
18
18
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
19
|
-
const prefixCls = getPrefixCls("chatboot-case-reply", customPrefixCls);
|
|
19
|
+
const prefixCls = getPrefixCls("agentic-chatboot-case-reply", customPrefixCls);
|
|
20
20
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
21
21
|
const [isHovered, setIsHovered] = useState(false);
|
|
22
22
|
const containerCls = classNames(prefixCls, hashId, className);
|
|
@@ -11,7 +11,7 @@ var Title = ({
|
|
|
11
11
|
prefixCls: customPrefixCls
|
|
12
12
|
}) => {
|
|
13
13
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
14
|
-
const prefixCls = getPrefixCls("chatboot-title", customPrefixCls);
|
|
14
|
+
const prefixCls = getPrefixCls("agentic-chatboot-title", customPrefixCls);
|
|
15
15
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
16
16
|
if (!title && !subtitle) {
|
|
17
17
|
return null;
|
|
@@ -52,7 +52,7 @@ var ActionIconBox = (props) => {
|
|
|
52
52
|
onChange: props.onLoadingChange
|
|
53
53
|
});
|
|
54
54
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
55
|
-
const prefixCls = getPrefixCls("md-editor-action-icon-box");
|
|
55
|
+
const prefixCls = getPrefixCls("agentic-md-editor-action-icon-box");
|
|
56
56
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
57
57
|
useEffect(() => {
|
|
58
58
|
var _a2;
|
|
@@ -24,7 +24,7 @@ import { useStyle } from "./style";
|
|
|
24
24
|
var ActionItemBox = (props) => {
|
|
25
25
|
var _a, _b;
|
|
26
26
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
27
|
-
const basePrefixCls = getPrefixCls("
|
|
27
|
+
const basePrefixCls = getPrefixCls("agentic-chat-action-item-box");
|
|
28
28
|
const { wrapSSR, hashId } = useStyle(basePrefixCls);
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
var _a2;
|
|
@@ -107,7 +107,7 @@ var HistoryItemSingle = React.memo(
|
|
|
107
107
|
itemDateFormatter
|
|
108
108
|
}) => {
|
|
109
109
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
110
|
-
const prefixCls = getPrefixCls("
|
|
110
|
+
const prefixCls = getPrefixCls("agentic-chat-history-menu");
|
|
111
111
|
const { hashId } = useStyle(prefixCls);
|
|
112
112
|
const { textRef, isTextOverflow } = useTextOverflow(item.sessionTitle);
|
|
113
113
|
const isRunning = React.useMemo(
|
|
@@ -268,7 +268,7 @@ var HistoryItemMulti = React.memo(
|
|
|
268
268
|
itemDateFormatter
|
|
269
269
|
}) => {
|
|
270
270
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
271
|
-
const prefixCls = getPrefixCls("
|
|
271
|
+
const prefixCls = getPrefixCls("agentic-chat-history-menu");
|
|
272
272
|
const { hashId } = useStyle(prefixCls);
|
|
273
273
|
const { textRef, isTextOverflow } = useTextOverflow(item.sessionTitle);
|
|
274
274
|
const isTask = React.useMemo(() => type === "task", [type]);
|
|
@@ -30,7 +30,7 @@ var HistoryNewChat = ({
|
|
|
30
30
|
className
|
|
31
31
|
}) => {
|
|
32
32
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
33
|
-
const menuPrefixCls = getPrefixCls("
|
|
33
|
+
const menuPrefixCls = getPrefixCls("agentic-chat-history-menu");
|
|
34
34
|
const { wrapSSR, hashId } = useNewChatStyle(menuPrefixCls);
|
|
35
35
|
const { locale } = useContext(I18nContext);
|
|
36
36
|
const [loading, setLoading] = useState(false);
|
|
@@ -74,7 +74,9 @@ var HistorySearch = ({
|
|
|
74
74
|
const { locale } = useContext(I18nContext);
|
|
75
75
|
const [loading, setLoading] = useState(false);
|
|
76
76
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
77
|
+
const [inputValue, setInputValue] = useState("");
|
|
77
78
|
const ref = useRef(null);
|
|
79
|
+
const trigger = (searchOptions == null ? void 0 : searchOptions.trigger) || "change";
|
|
78
80
|
useClickAway(() => {
|
|
79
81
|
setIsExpanded(false);
|
|
80
82
|
}, ref);
|
|
@@ -97,6 +99,18 @@ var HistorySearch = ({
|
|
|
97
99
|
}),
|
|
98
100
|
360
|
|
99
101
|
);
|
|
102
|
+
const handleInputChange = (e) => {
|
|
103
|
+
const value = e.target.value;
|
|
104
|
+
setInputValue(value);
|
|
105
|
+
if (trigger === "change") {
|
|
106
|
+
handleSearchChange.run(e);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const handleKeyDown = (e) => {
|
|
110
|
+
if (trigger === "enter" && e.key === "Enter") {
|
|
111
|
+
handleSearchWithLoading(inputValue);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
100
114
|
return /* @__PURE__ */ React.createElement(
|
|
101
115
|
"div",
|
|
102
116
|
{
|
|
@@ -117,9 +131,9 @@ var HistorySearch = ({
|
|
|
117
131
|
{
|
|
118
132
|
placeholder: (_a = searchOptions == null ? void 0 : searchOptions.placeholder) != null ? _a : type === "task" ? (locale == null ? void 0 : locale["chat.task.search.placeholder"]) || "搜索任务" : (locale == null ? void 0 : locale["chat.history.search.placeholder"]) || "搜索话题",
|
|
119
133
|
prefix: loading ? /* @__PURE__ */ React.createElement(Spin, { size: "small" }) : /* @__PURE__ */ React.createElement(SearchIcon, null),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
value: inputValue,
|
|
135
|
+
onChange: handleInputChange,
|
|
136
|
+
onKeyDown: handleKeyDown,
|
|
123
137
|
style: {
|
|
124
138
|
width: "100%",
|
|
125
139
|
height: 32,
|
package/dist/History/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './utils';
|
|
|
19
19
|
* @param {Function} [props.onDeleteItem] - 删除历史记录项时的回调函数
|
|
20
20
|
* @param {Function} [props.customDateFormatter] - 日期格式化函数
|
|
21
21
|
* @param {boolean} [props.standalone] - 是否以独立模式显示,为true时直接显示菜单,否则显示为下拉菜单
|
|
22
|
+
* @param {Function} [props.emptyRender] - 空状态渲染函数,当历史记录为空时显示自定义内容
|
|
23
|
+
* @param {boolean} [props.loading] - 加载状态,显示在 GroupMenu 区域
|
|
22
24
|
*
|
|
23
25
|
* @returns {React.ReactElement|null} 返回历史记录组件或null(当没有历史记录时)
|
|
24
26
|
*
|
|
@@ -29,5 +31,7 @@ export * from './utils';
|
|
|
29
31
|
*
|
|
30
32
|
* 历史记录按日期分组显示,每组内按时间倒序排列。
|
|
31
33
|
* 支持查看历史会话和删除历史记录。
|
|
34
|
+
* 当历史记录为空时,可通过 emptyRender 自定义空状态显示。
|
|
35
|
+
* 通过 loading 属性可以在 GroupMenu 区域显示加载动画。
|
|
32
36
|
*/
|
|
33
37
|
export declare const History: React.FC<HistoryProps>;
|
package/dist/History/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
22
22
|
// src/History/index.tsx
|
|
23
23
|
import { History as HistoryIcon } from "@sofa-design/icons";
|
|
24
24
|
import { ConfigProvider, Popover } from "antd";
|
|
25
|
+
import classNames from "classnames";
|
|
25
26
|
import React, { useContext, useRef } from "react";
|
|
26
27
|
import useClickAway from "../Hooks/useClickAway";
|
|
27
28
|
import { ActionIconBox, BubbleConfigContext } from "../index";
|
|
@@ -42,7 +43,7 @@ export * from "./utils";
|
|
|
42
43
|
var History = (props) => {
|
|
43
44
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
44
45
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
45
|
-
const menuPrefixCls = getPrefixCls("
|
|
46
|
+
const menuPrefixCls = getPrefixCls("agentic-chat-history-menu");
|
|
46
47
|
const { locale } = useContext(BubbleConfigContext) || {};
|
|
47
48
|
const containerRef = useRef(null);
|
|
48
49
|
const { wrapSSR, hashId } = useStyle(menuPrefixCls);
|
|
@@ -111,23 +112,25 @@ var History = (props) => {
|
|
|
111
112
|
}
|
|
112
113
|
),
|
|
113
114
|
(_h = (_g = props.slots) == null ? void 0 : _g.beforeHistoryList) == null ? void 0 : _h.call(_g, filteredList),
|
|
114
|
-
/* @__PURE__ */ React.createElement(
|
|
115
|
+
(items == null ? void 0 : items.length) === 0 && !props.loading && (props == null ? void 0 : props.emptyRender) ? props.emptyRender() : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
115
116
|
GroupMenu,
|
|
116
117
|
{
|
|
117
118
|
selectedKeys: [props.sessionId],
|
|
118
119
|
inlineIndent: 20,
|
|
119
120
|
items,
|
|
120
|
-
className: menuPrefixCls
|
|
121
|
+
className: menuPrefixCls,
|
|
122
|
+
loading: props.loading
|
|
121
123
|
}
|
|
122
|
-
),
|
|
123
|
-
((_i = props.agent) == null ? void 0 : _i.enabled) && !!((_j = props.agent) == null ? void 0 : _j.onLoadMore) && /* @__PURE__ */ React.createElement(
|
|
124
|
+
), ((_i = props.agent) == null ? void 0 : _i.enabled) && !!((_j = props.agent) == null ? void 0 : _j.onLoadMore) && /* @__PURE__ */ React.createElement(
|
|
124
125
|
HistoryLoadMore,
|
|
125
126
|
{
|
|
126
127
|
onLoadMore: handleLoadMore,
|
|
127
128
|
type: props.type,
|
|
128
|
-
className: `${menuPrefixCls}-load-more
|
|
129
|
+
className: classNames(`${menuPrefixCls}-load-more`, hashId, {
|
|
130
|
+
chat: props.type !== "task"
|
|
131
|
+
})
|
|
129
132
|
}
|
|
130
|
-
)
|
|
133
|
+
))
|
|
131
134
|
)
|
|
132
135
|
);
|
|
133
136
|
}
|
|
@@ -146,20 +149,23 @@ var History = (props) => {
|
|
|
146
149
|
border: "1px solid var(--color-gray-border-light)"
|
|
147
150
|
},
|
|
148
151
|
getPopupContainer: (p) => p.parentElement || document.body,
|
|
149
|
-
content: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
152
|
+
content: /* @__PURE__ */ React.createElement(React.Fragment, null, (items == null ? void 0 : items.length) === 0 && !(props == null ? void 0 : props.loading) && (props == null ? void 0 : props.emptyRender) ? /* @__PURE__ */ React.createElement("div", { "data-testid": "empty-state-popover" }, props.emptyRender()) : /* @__PURE__ */ React.createElement(
|
|
150
153
|
GroupMenu,
|
|
151
154
|
{
|
|
152
155
|
selectedKeys: [props.sessionId],
|
|
153
156
|
inlineIndent: 20,
|
|
154
157
|
items,
|
|
155
|
-
className: menuPrefixCls
|
|
158
|
+
className: menuPrefixCls,
|
|
159
|
+
loading: props.loading
|
|
156
160
|
}
|
|
157
|
-
), ((_k = props.agent) == null ? void 0 : _k.enabled) && !!((_l = props.agent) == null ? void 0 : _l.onLoadMore) && /* @__PURE__ */ React.createElement(
|
|
161
|
+
), ((_k = props.agent) == null ? void 0 : _k.enabled) && !!((_l = props.agent) == null ? void 0 : _l.onLoadMore) && !props.loading && /* @__PURE__ */ React.createElement(
|
|
158
162
|
HistoryLoadMore,
|
|
159
163
|
{
|
|
160
164
|
onLoadMore: handleLoadMore,
|
|
161
165
|
type: props.type,
|
|
162
|
-
className: `${menuPrefixCls}-load-more
|
|
166
|
+
className: classNames(`${menuPrefixCls}-load-more`, hashId, {
|
|
167
|
+
chat: props.type !== "task"
|
|
168
|
+
})
|
|
163
169
|
}
|
|
164
170
|
))
|
|
165
171
|
},
|
package/dist/History/menu.d.ts
CHANGED
package/dist/History/menu.js
CHANGED
|
@@ -28,7 +28,7 @@ var __objRest = (source, exclude) => {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
// src/History/menu.tsx
|
|
31
|
-
import { ConfigProvider } from "antd";
|
|
31
|
+
import { ConfigProvider, Spin } from "antd";
|
|
32
32
|
import classNames from "classnames";
|
|
33
33
|
import React, { useCallback, useContext } from "react";
|
|
34
34
|
import { useStyle } from "./style";
|
|
@@ -158,7 +158,8 @@ var GroupMenu = (props) => {
|
|
|
158
158
|
inlineIndent = 20,
|
|
159
159
|
className,
|
|
160
160
|
classNames: propsClassNames = {},
|
|
161
|
-
style
|
|
161
|
+
style,
|
|
162
|
+
loading = false
|
|
162
163
|
} = _a, restProps = __objRest(_a, [
|
|
163
164
|
"items",
|
|
164
165
|
"selectedKeys",
|
|
@@ -166,10 +167,11 @@ var GroupMenu = (props) => {
|
|
|
166
167
|
"inlineIndent",
|
|
167
168
|
"className",
|
|
168
169
|
"classNames",
|
|
169
|
-
"style"
|
|
170
|
+
"style",
|
|
171
|
+
"loading"
|
|
170
172
|
]);
|
|
171
173
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
172
|
-
const prefixCls = getPrefixCls("
|
|
174
|
+
const prefixCls = getPrefixCls("agentic-chat-history-menu");
|
|
173
175
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
174
176
|
const currentSelectedKey = selectedKeys && selectedKeys[0];
|
|
175
177
|
const dataSource = items || [];
|
|
@@ -189,7 +191,18 @@ var GroupMenu = (props) => {
|
|
|
189
191
|
"aria-label": "菜单",
|
|
190
192
|
tabIndex: 0
|
|
191
193
|
}, restProps),
|
|
192
|
-
|
|
194
|
+
loading ? /* @__PURE__ */ React.createElement(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
style: {
|
|
198
|
+
display: "flex",
|
|
199
|
+
justifyContent: "center",
|
|
200
|
+
alignItems: "center",
|
|
201
|
+
height: "100%"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
/* @__PURE__ */ React.createElement(Spin, null)
|
|
205
|
+
) : dataSource.map((item) => /* @__PURE__ */ React.createElement(
|
|
193
206
|
MenuItem,
|
|
194
207
|
{
|
|
195
208
|
key: item.key,
|
package/dist/History/style.js
CHANGED
|
@@ -266,7 +266,7 @@ var genStyle = (token) => {
|
|
|
266
266
|
};
|
|
267
267
|
};
|
|
268
268
|
function useStyle(prefixCls) {
|
|
269
|
-
return useEditorStyleRegister("
|
|
269
|
+
return useEditorStyleRegister("history-group-menu", (token) => {
|
|
270
270
|
const groupMenuToken = __spreadProps(__spreadValues({}, token), {
|
|
271
271
|
componentCls: `.${prefixCls}`
|
|
272
272
|
});
|
|
@@ -51,12 +51,18 @@ export interface HistoryProps {
|
|
|
51
51
|
placeholder?: string;
|
|
52
52
|
/** 未展开时的默认文本 */
|
|
53
53
|
text?: string;
|
|
54
|
+
/** 搜索触发方式: 'change' - 实时搜索(默认), 'enter' - 回车触发 */
|
|
55
|
+
trigger?: 'change' | 'enter';
|
|
54
56
|
};
|
|
55
57
|
};
|
|
56
58
|
/** 插槽 */
|
|
57
59
|
slots?: {
|
|
58
60
|
beforeHistoryList?: (list: HistoryDataType[]) => React.ReactNode;
|
|
59
61
|
};
|
|
62
|
+
/** 空状态渲染函数,当历史记录为空时显示 */
|
|
63
|
+
emptyRender?: () => React.ReactNode;
|
|
64
|
+
/** 加载状态,显示在 GroupMenu 区域 */
|
|
65
|
+
loading?: boolean;
|
|
60
66
|
}
|
|
61
67
|
export interface HistoryActionsBoxProps {
|
|
62
68
|
/** 子组件,通常是时间显示或其他内容 */
|
|
@@ -218,7 +218,7 @@ var BaseMarkdownEditor = (props) => {
|
|
|
218
218
|
};
|
|
219
219
|
}, [instance, editorMountStatus]);
|
|
220
220
|
const context = useContext(ConfigProvider.ConfigContext);
|
|
221
|
-
const baseClassName = context == null ? void 0 : context.getPrefixCls(`md-editor`);
|
|
221
|
+
const baseClassName = context == null ? void 0 : context.getPrefixCls(`agentic-md-editor`);
|
|
222
222
|
const { wrapSSR, hashId } = useStyle(baseClassName);
|
|
223
223
|
const [showCommentList, setShowComment] = useState([]);
|
|
224
224
|
const [schema, setSchema] = useState(initSchemaValue);
|
|
@@ -63,7 +63,7 @@ var CommentList = (props) => {
|
|
|
63
63
|
const { markdownEditorRef } = useEditorStore();
|
|
64
64
|
const context = useContext(ConfigProvider.ConfigContext);
|
|
65
65
|
const { setShowComment } = useContext(EditorStoreContext) || {};
|
|
66
|
-
const baseCls = context == null ? void 0 : context.getPrefixCls("md-editor-comment-view");
|
|
66
|
+
const baseCls = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-comment-view");
|
|
67
67
|
const { wrapSSR, hashId } = useStyle(baseCls);
|
|
68
68
|
return wrapSSR(
|
|
69
69
|
/* @__PURE__ */ React.createElement(React.Fragment, null, !props.pure ? /* @__PURE__ */ React.createElement(
|
|
@@ -45,7 +45,7 @@ var ContributorAvatar = (props) => {
|
|
|
45
45
|
};
|
|
46
46
|
var AvatarList = ({ displayList, style }) => {
|
|
47
47
|
const context = React.useContext(ConfigProvider.ConfigContext);
|
|
48
|
-
const baseCls = context == null ? void 0 : context.getPrefixCls("md-editor-contributor-avatar-list");
|
|
48
|
+
const baseCls = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-contributor-avatar-list");
|
|
49
49
|
const { wrapSSR, hashId } = useStyle(baseCls);
|
|
50
50
|
return wrapSSR(
|
|
51
51
|
/* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
@@ -5,7 +5,7 @@ import React, { useContext } from "react";
|
|
|
5
5
|
import { useStyle } from "./style";
|
|
6
6
|
var TextStyleTag = (props) => {
|
|
7
7
|
const context = useContext(ConfigProvider.ConfigContext);
|
|
8
|
-
const baseCls = context == null ? void 0 : context.getPrefixCls("md-editor-text-style-tag");
|
|
8
|
+
const baseCls = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-text-style-tag");
|
|
9
9
|
const { wrapSSR, hashId } = useStyle(baseCls);
|
|
10
10
|
return wrapSSR(
|
|
11
11
|
/* @__PURE__ */ React.createElement("span", { className: classNames(baseCls, hashId) }, props.children)
|
|
@@ -6,7 +6,7 @@ var CommentView = (props) => {
|
|
|
6
6
|
var _a;
|
|
7
7
|
const { setShowComment } = props;
|
|
8
8
|
const context = useContext(ConfigProvider.ConfigContext);
|
|
9
|
-
const mdEditorBaseClass = context == null ? void 0 : context.getPrefixCls("md-editor-content");
|
|
9
|
+
const mdEditorBaseClass = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-content");
|
|
10
10
|
const thisComment = useMemo(() => {
|
|
11
11
|
var _a2, _b;
|
|
12
12
|
return (_b = (_a2 = props.commentItem) == null ? void 0 : _a2.find) == null ? void 0 : _b.call(
|
|
@@ -45,7 +45,7 @@ var FootnoteDefinition = (props) => {
|
|
|
45
45
|
gap: 4
|
|
46
46
|
},
|
|
47
47
|
"data-be": "footnoteDefinition",
|
|
48
|
-
className: !str ? "ant-md-editor-drag-el empty" : "ant-md-editor-drag-el",
|
|
48
|
+
className: !str ? "ant-agentic-md-editor-drag-el empty" : "ant-agentic-md-editor-drag-el",
|
|
49
49
|
onDragStart: (e) => store.dragStart(e, markdownContainerRef.current)
|
|
50
50
|
}),
|
|
51
51
|
/* @__PURE__ */ React.createElement(DragHandle, null),
|
|
@@ -34,7 +34,7 @@ var FootnoteReference = (props) => {
|
|
|
34
34
|
__spreadProps(__spreadValues({}, props.attributes), {
|
|
35
35
|
"data-be": "paragraph",
|
|
36
36
|
"data-testid": "footnote-reference",
|
|
37
|
-
className: !str ? "ant-md-editor-drag-el empty" : "ant-md-editor-drag-el",
|
|
37
|
+
className: !str ? "ant-agentic-md-editor-drag-el empty" : "ant-agentic-md-editor-drag-el",
|
|
38
38
|
onDragStart: (e) => store.dragStart(e, markdownContainerRef.current),
|
|
39
39
|
"data-empty": !str && selected ? "true" : void 0
|
|
40
40
|
}),
|