@ant-design/agentic-ui 2.0.14 → 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.
Files changed (84) hide show
  1. package/dist/BackTo/BackBottom.d.ts +56 -0
  2. package/dist/BackTo/BackTop.d.ts +39 -2
  3. package/dist/BackTo/index.d.ts +20 -0
  4. package/dist/Bubble/AIBubble.js +1 -1
  5. package/dist/Bubble/List/index.js +1 -1
  6. package/dist/Bubble/UserBubble.js +1 -1
  7. package/dist/Bubble/index.d.ts +6 -0
  8. package/dist/Bubble/style.js +1 -1
  9. package/dist/ChatBootPage/CaseReply.js +1 -1
  10. package/dist/ChatBootPage/Title.js +1 -1
  11. package/dist/ChatBootPage/index.d.ts +6 -0
  12. package/dist/Components/ActionIconBox/index.js +1 -1
  13. package/dist/Components/ActionItemBox/ActionItemBox.js +1 -1
  14. package/dist/Components/ActionItemBox/index.d.ts +6 -0
  15. package/dist/Components/Button/index.d.ts +6 -0
  16. package/dist/History/components/HistoryItem.js +2 -2
  17. package/dist/History/components/NewChatComponent.js +1 -1
  18. package/dist/History/components/SearchComponent.d.ts +2 -0
  19. package/dist/History/components/SearchComponent.js +17 -3
  20. package/dist/History/index.d.ts +4 -0
  21. package/dist/History/index.js +10 -9
  22. package/dist/History/menu.d.ts +2 -0
  23. package/dist/History/menu.js +18 -5
  24. package/dist/History/style.js +1 -1
  25. package/dist/History/types/index.d.ts +6 -0
  26. package/dist/MarkdownEditor/BaseMarkdownEditor.js +1 -1
  27. package/dist/MarkdownEditor/editor/components/CommentList/index.js +1 -1
  28. package/dist/MarkdownEditor/editor/components/ContributorAvatar/index.js +1 -1
  29. package/dist/MarkdownEditor/editor/components/fntTag/index.js +1 -1
  30. package/dist/MarkdownEditor/editor/elements/Comment/index.js +1 -1
  31. package/dist/MarkdownEditor/editor/elements/FootnoteDefinition.js +1 -1
  32. package/dist/MarkdownEditor/editor/elements/FootnoteReference.js +1 -1
  33. package/dist/MarkdownEditor/editor/elements/Head.js +1 -1
  34. package/dist/MarkdownEditor/editor/elements/Image/index.js +1 -1
  35. package/dist/MarkdownEditor/editor/elements/LinkCard/index.js +2 -2
  36. package/dist/MarkdownEditor/editor/elements/List/List.js +1 -1
  37. package/dist/MarkdownEditor/editor/elements/List/ListItem.js +1 -1
  38. package/dist/MarkdownEditor/editor/elements/List/style.js +2 -2
  39. package/dist/MarkdownEditor/editor/elements/Media.js +1 -1
  40. package/dist/MarkdownEditor/editor/elements/Paragraph.js +1 -1
  41. package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.js +1 -1
  42. package/dist/MarkdownEditor/editor/elements/Table/SimpleTable.js +1 -1
  43. package/dist/MarkdownEditor/editor/elements/Table/Table.js +5 -3
  44. package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/index.js +3 -1
  45. package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/index.js +1 -1
  46. package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/index.js +1 -1
  47. package/dist/MarkdownEditor/editor/elements/Table/Td/index.js +1 -1
  48. package/dist/MarkdownEditor/editor/elements/TagPopup/index.d.ts +0 -22
  49. package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +171 -122
  50. package/dist/MarkdownEditor/editor/elements/index.js +1 -1
  51. package/dist/MarkdownEditor/editor/style.js +6 -6
  52. package/dist/MarkdownEditor/editor/tools/DragHandle.js +2 -2
  53. package/dist/MarkdownEditor/editor/tools/ToolBar/ToolBar.js +1 -1
  54. package/dist/MarkdownEditor/editor/utils/dom.d.ts +1 -1
  55. package/dist/MarkdownEditor/editor/utils/index.d.ts +1 -1
  56. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.js +1 -1
  57. package/dist/MarkdownInputField/AttachmentButton/index.js +1 -1
  58. package/dist/MarkdownInputField/AttachmentButton/utils.d.ts +8 -0
  59. package/dist/MarkdownInputField/AttachmentButton/utils.js +10 -3
  60. package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +1 -1
  61. package/dist/MarkdownInputField/Enlargement/index.js +1 -1
  62. package/dist/MarkdownInputField/FileMapView/index.js +5 -2
  63. package/dist/MarkdownInputField/MarkdownInputField.js +1 -1
  64. package/dist/MarkdownInputField/QuickActions/index.js +4 -8
  65. package/dist/MarkdownInputField/RefinePromptButton/index.js +1 -1
  66. package/dist/MarkdownInputField/SendActions/index.js +1 -1
  67. package/dist/MarkdownInputField/SendButton/index.js +1 -1
  68. package/dist/MarkdownInputField/SkillModeBar/index.js +1 -1
  69. package/dist/MarkdownInputField/TopOperatingArea/index.js +1 -1
  70. package/dist/MarkdownInputField/VoiceInput/index.js +1 -1
  71. package/dist/Plugins/chart/index.js +2 -2
  72. package/dist/Plugins/index.d.ts +6 -0
  73. package/dist/Plugins/mermaid/index.js +1 -1
  74. package/dist/Quote/index.js +1 -1
  75. package/dist/Schema/index.d.ts +6 -0
  76. package/dist/ThoughtChainList/DotAni/index.css +1 -1
  77. package/dist/ThoughtChainList/DotAni/index.js +2 -2
  78. package/dist/ToolUseBar/ToolUseBarThink.js +1 -1
  79. package/dist/ToolUseBar/index.js +1 -1
  80. package/dist/WelcomeMessage/index.d.ts +42 -0
  81. package/dist/WelcomeMessage/index.js +1 -1
  82. package/dist/Workspace/RealtimeFollow/style.js +1 -1
  83. package/dist/Workspace/Task/index.js +1 -1
  84. package/package.json +1 -1
@@ -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>>;
@@ -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>>;
@@ -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>>;
@@ -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("agent");
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);
@@ -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("agent-bubble-list");
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("agent");
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;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file Bubble 组件模块导出
3
+ *
4
+ * 该文件导出聊天气泡相关组件,包括 AI 消息气泡、用户消息气泡和通用气泡容器。
5
+ * 所有组件的详细文档请参考各自的组件定义文件。
6
+ */
1
7
  export { AIBubble, runRender } from './AIBubble';
2
8
  export { Bubble } from './Bubble';
3
9
  export * from './BubbleConfigProvide';
@@ -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)"
@@ -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;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file ChatBootPage 组件模块导出
3
+ *
4
+ * 该文件导出聊天启动页面相关组件。
5
+ * 所有组件的详细文档请参考各自的组件定义文件。
6
+ */
1
7
  export { default as Title } from './Title';
2
8
  export type { TitleProps } from './Title';
3
9
  export { default as CaseReply } from './CaseReply';
@@ -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("agent-chat-action-item-box");
27
+ const basePrefixCls = getPrefixCls("agentic-chat-action-item-box");
28
28
  const { wrapSSR, hashId } = useStyle(basePrefixCls);
29
29
  useEffect(() => {
30
30
  var _a2;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file ActionItemBox 组件模块导出
3
+ *
4
+ * 该文件导出操作项盒子组件。
5
+ * 组件的详细文档请参考 ActionItemBox 组件定义文件。
6
+ */
1
7
  export { ActionItemBox } from './ActionItemBox';
2
8
  export type { ActionItemBoxProps } from './ActionItemBox';
3
9
  export { useStyle } from './style';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @file Button 组件模块导出
3
+ *
4
+ * 该文件导出多种类型的按钮组件。
5
+ * 所有组件的详细文档请参考各自的组件定义文件。
6
+ */
1
7
  export * from './IconButton';
2
8
  export * from './SwitchButton';
3
9
  export * from './ToggleButton';
@@ -107,7 +107,7 @@ var HistoryItemSingle = React.memo(
107
107
  itemDateFormatter
108
108
  }) => {
109
109
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
110
- const prefixCls = getPrefixCls("agent-chat-history-menu");
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("agent-chat-history-menu");
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("agent-chat-history-menu");
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);
@@ -15,6 +15,8 @@ interface HistorySearchProps {
15
15
  placeholder?: string;
16
16
  /** 未展开时的默认文本 */
17
17
  text?: string;
18
+ /** 搜索触发方式: 'change' - 实时搜索(默认), 'enter' - 回车触发 */
19
+ trigger?: 'change' | 'enter';
18
20
  };
19
21
  }
20
22
  /**
@@ -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
- onChange: (e) => {
121
- handleSearchChange.run(e);
122
- },
134
+ value: inputValue,
135
+ onChange: handleInputChange,
136
+ onKeyDown: handleKeyDown,
123
137
  style: {
124
138
  width: "100%",
125
139
  height: 32,
@@ -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>;
@@ -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("agent-chat-history-menu");
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,
@@ -42,6 +42,8 @@ export interface GroupMenuProps {
42
42
  inlineIndent?: number;
43
43
  /** 菜单模式 - 兼容 Antd Menu */
44
44
  mode?: 'vertical' | 'horizontal' | 'inline';
45
+ /** 加载状态 */
46
+ loading?: boolean;
45
47
  }
46
48
  /**
47
49
  * GroupMenu 组件 - 兼容 Antd Menu API 的自定义菜单组件
@@ -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("agent-chat-history-menu");
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
- dataSource.map((item) => /* @__PURE__ */ React.createElement(
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,
@@ -266,7 +266,7 @@ var genStyle = (token) => {
266
266
  };
267
267
  };
268
268
  function useStyle(prefixCls) {
269
- return useEditorStyleRegister("GroupMenu", (token) => {
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
  }),
@@ -63,7 +63,7 @@ function Head({
63
63
  onDragStart: (e) => store.dragStart(e, markdownContainerRef.current),
64
64
  ["data-empty"]: !str && selected ? "true" : void 0,
65
65
  ["data-align"]: element.align,
66
- className: classNames("ant-md-editor-drag-el", {
66
+ className: classNames("ant-agentic-md-editor-drag-el", {
67
67
  empty: !str,
68
68
  typewriter: isLast && typewriter
69
69
  })
@@ -425,7 +425,7 @@ function EditorImage({
425
425
  return /* @__PURE__ */ React.createElement(
426
426
  "div",
427
427
  __spreadProps(__spreadValues({}, attributes), {
428
- className: "ant-md-editor-drag-el",
428
+ className: "ant-agentic-md-editor-drag-el",
429
429
  "data-be": "image",
430
430
  "data-testid": "image-container",
431
431
  style: {
@@ -29,14 +29,14 @@ function LinkCard({
29
29
  }) {
30
30
  var _a, _b, _c, _d;
31
31
  const context = useContext(ConfigProvider.ConfigContext);
32
- const baseCls = context == null ? void 0 : context.getPrefixCls("md-editor-link-card");
32
+ const baseCls = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-link-card");
33
33
  const { wrapSSR, hashId } = useStyle(baseCls);
34
34
  const htmlRef = React.useRef(null);
35
35
  return wrapSSR(
36
36
  /* @__PURE__ */ React.createElement("div", __spreadValues({}, attributes), /* @__PURE__ */ React.createElement(
37
37
  "div",
38
38
  {
39
- className: classNames(baseCls, "ant-md-editor-drag-el", hashId),
39
+ className: classNames(baseCls, "ant-agentic-md-editor-drag-el", hashId),
40
40
  "data-be": "link-card",
41
41
  draggable: false,
42
42
  onContextMenu: (e) => {
@@ -32,7 +32,7 @@ var List = ({
32
32
  }) => {
33
33
  const { store, markdownContainerRef } = useEditorStore();
34
34
  const context = useContext(ConfigProvider.ConfigContext);
35
- const baseCls = context.getPrefixCls("md-editor-list");
35
+ const baseCls = context.getPrefixCls("agentic-md-editor-list");
36
36
  const { wrapSSR, hashId } = useStyle(baseCls);
37
37
  return React.useMemo(() => {
38
38
  const tag = element.order ? "ol" : "ul";