@ant-design/agentic-ui 2.0.13 → 2.0.15
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/README.md +12 -12
- 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 -2
- package/dist/Bubble/List/index.js +1 -1
- package/dist/Bubble/UserBubble.js +1 -1
- package/dist/Bubble/index.d.ts +6 -0
- package/dist/Bubble/style.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTab.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroup.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroupStyle.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTabStyle.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/CaseReply.js +2 -2
- package/dist/{ChatBoot → ChatBootPage}/CaseReplyStyle.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/Title.js +2 -2
- package/dist/{ChatBoot → ChatBootPage}/index.d.ts +6 -0
- package/dist/{ChatBoot → ChatBootPage}/index.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/style.js +1 -1
- 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 +10 -9
- 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 +171 -122
- package/dist/MarkdownEditor/editor/elements/index.js +1 -1
- 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/MarkdownEditor/editor/utils/dom.d.ts +1 -1
- package/dist/MarkdownEditor/editor/utils/index.d.ts +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/index.js +1 -1
- 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 +1 -1
- package/dist/MarkdownInputField/FileMapView/index.js +5 -2
- package/dist/MarkdownInputField/MarkdownInputField.js +1 -1
- package/dist/MarkdownInputField/QuickActions/index.js +4 -8
- package/dist/MarkdownInputField/RefinePromptButton/index.js +1 -1
- 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/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 +59 -0
- package/dist/{Welcome → WelcomeMessage}/index.js +4 -4
- package/dist/{Welcome → WelcomeMessage}/style.js +1 -1
- package/dist/Workspace/RealtimeFollow/style.js +1 -1
- package/dist/Workspace/Task/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/Welcome/index.d.ts +0 -14
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTab.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroup.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroupStyle.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTabStyle.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/CaseReply.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/CaseReplyStyle.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/Title.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/style.d.ts +0 -0
- /package/dist/{Welcome → WelcomeMessage}/style.d.ts +0 -0
package/README.md
CHANGED
|
@@ -153,12 +153,12 @@ import { MarkdownEditor } from '@ant-design/agentic-ui';
|
|
|
153
153
|
|
|
154
154
|
### 📋 布局与容器组件
|
|
155
155
|
|
|
156
|
-
| 组件
|
|
157
|
-
|
|
|
158
|
-
| `ChatLayout`
|
|
159
|
-
| `History`
|
|
160
|
-
| `
|
|
161
|
-
| `Quote`
|
|
156
|
+
| 组件 | 描述 | 主要功能 |
|
|
157
|
+
| ---------------- | ------------ | ------------------------------------ |
|
|
158
|
+
| `ChatLayout` | 聊天布局容器 | 标准聊天界面布局,支持左右栏、全屏等 |
|
|
159
|
+
| `History` | 历史记录组件 | 会话历史管理,支持搜索、筛选、导出 |
|
|
160
|
+
| `WelcomeMessage` | 欢迎语组件 | 应用启动欢迎语,展示功能介绍 |
|
|
161
|
+
| `Quote` | 引用组件 | 引用消息或内容 |
|
|
162
162
|
|
|
163
163
|
### 🎯 交互与反馈组件
|
|
164
164
|
|
|
@@ -172,12 +172,12 @@ import { MarkdownEditor } from '@ant-design/agentic-ui';
|
|
|
172
172
|
|
|
173
173
|
### 🧠 智能体专属组件
|
|
174
174
|
|
|
175
|
-
| 组件 | 描述
|
|
176
|
-
| ---------------- |
|
|
177
|
-
| `
|
|
178
|
-
| `SchemaEditor` | Schema 编辑器
|
|
179
|
-
| `SchemaForm` | Schema 表单
|
|
180
|
-
| `SchemaRenderer` | Schema 渲染器
|
|
175
|
+
| 组件 | 描述 | 主要功能 |
|
|
176
|
+
| ---------------- | -------------- | ---------------------------- |
|
|
177
|
+
| `ChatBootPage` | 对话启动页组件 | 快速回复、案例推荐等引导功能 |
|
|
178
|
+
| `SchemaEditor` | Schema 编辑器 | 结构化数据编辑 |
|
|
179
|
+
| `SchemaForm` | Schema 表单 | 基于 Schema 自动生成表单 |
|
|
180
|
+
| `SchemaRenderer` | Schema 渲染器 | 渲染结构化数据 |
|
|
181
181
|
|
|
182
182
|
### 🔌 插件组件
|
|
183
183
|
|
|
@@ -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);
|
|
@@ -167,7 +167,9 @@ var AIBubble = memo((props) => {
|
|
|
167
167
|
{
|
|
168
168
|
style: __spreadValues({
|
|
169
169
|
minWidth: standalone ? "min(296px,100%)" : "0px",
|
|
170
|
-
paddingLeft: 12
|
|
170
|
+
paddingLeft: 12,
|
|
171
|
+
maxWidth: "100%",
|
|
172
|
+
width: "100%"
|
|
171
173
|
}, styles == null ? void 0 : styles.bubbleListItemExtraStyle),
|
|
172
174
|
className: cx(
|
|
173
175
|
`${prefixClass}-bubble-after`,
|
|
@@ -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(() => {
|
|
@@ -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
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
|
-
// src/
|
|
21
|
+
// src/ChatBootPage/ButtonTabGroupStyle.ts
|
|
22
22
|
import {
|
|
23
23
|
useEditorStyleRegister
|
|
24
24
|
} from "../Hooks/useStyle";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/ChatBootPage/CaseReply.tsx
|
|
2
2
|
import { ConfigProvider } from "antd";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import React, { useContext, useState } from "react";
|
|
@@ -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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/ChatBootPage/Title.tsx
|
|
2
2
|
import { ConfigProvider } from "antd";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import React, { useContext } from "react";
|
|
@@ -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
|
@@ -42,7 +42,7 @@ export * from "./utils";
|
|
|
42
42
|
var History = (props) => {
|
|
43
43
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
44
44
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
45
|
-
const menuPrefixCls = getPrefixCls("
|
|
45
|
+
const menuPrefixCls = getPrefixCls("agentic-chat-history-menu");
|
|
46
46
|
const { locale } = useContext(BubbleConfigContext) || {};
|
|
47
47
|
const containerRef = useRef(null);
|
|
48
48
|
const { wrapSSR, hashId } = useStyle(menuPrefixCls);
|
|
@@ -111,23 +111,23 @@ var History = (props) => {
|
|
|
111
111
|
}
|
|
112
112
|
),
|
|
113
113
|
(_h = (_g = props.slots) == null ? void 0 : _g.beforeHistoryList) == null ? void 0 : _h.call(_g, filteredList),
|
|
114
|
-
/* @__PURE__ */ React.createElement(
|
|
114
|
+
(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
115
|
GroupMenu,
|
|
116
116
|
{
|
|
117
117
|
selectedKeys: [props.sessionId],
|
|
118
118
|
inlineIndent: 20,
|
|
119
119
|
items,
|
|
120
|
-
className: menuPrefixCls
|
|
120
|
+
className: menuPrefixCls,
|
|
121
|
+
loading: props.loading
|
|
121
122
|
}
|
|
122
|
-
),
|
|
123
|
-
((_i = props.agent) == null ? void 0 : _i.enabled) && !!((_j = props.agent) == null ? void 0 : _j.onLoadMore) && /* @__PURE__ */ React.createElement(
|
|
123
|
+
), ((_i = props.agent) == null ? void 0 : _i.enabled) && !!((_j = props.agent) == null ? void 0 : _j.onLoadMore) && /* @__PURE__ */ React.createElement(
|
|
124
124
|
HistoryLoadMore,
|
|
125
125
|
{
|
|
126
126
|
onLoadMore: handleLoadMore,
|
|
127
127
|
type: props.type,
|
|
128
128
|
className: `${menuPrefixCls}-load-more ${props.type === "task" ? "" : "chat"} ${hashId}`
|
|
129
129
|
}
|
|
130
|
-
)
|
|
130
|
+
))
|
|
131
131
|
)
|
|
132
132
|
);
|
|
133
133
|
}
|
|
@@ -146,15 +146,16 @@ var History = (props) => {
|
|
|
146
146
|
border: "1px solid var(--color-gray-border-light)"
|
|
147
147
|
},
|
|
148
148
|
getPopupContainer: (p) => p.parentElement || document.body,
|
|
149
|
-
content: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
149
|
+
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
150
|
GroupMenu,
|
|
151
151
|
{
|
|
152
152
|
selectedKeys: [props.sessionId],
|
|
153
153
|
inlineIndent: 20,
|
|
154
154
|
items,
|
|
155
|
-
className: menuPrefixCls
|
|
155
|
+
className: menuPrefixCls,
|
|
156
|
+
loading: props.loading
|
|
156
157
|
}
|
|
157
|
-
), ((_k = props.agent) == null ? void 0 : _k.enabled) && !!((_l = props.agent) == null ? void 0 : _l.onLoadMore) && /* @__PURE__ */ React.createElement(
|
|
158
|
+
), ((_k = props.agent) == null ? void 0 : _k.enabled) && !!((_l = props.agent) == null ? void 0 : _l.onLoadMore) && !props.loading && /* @__PURE__ */ React.createElement(
|
|
158
159
|
HistoryLoadMore,
|
|
159
160
|
{
|
|
160
161
|
onLoadMore: handleLoadMore,
|
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
|
/** 子组件,通常是时间显示或其他内容 */
|