@ant-design/agentic-ui 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/Bubble/List/PureBubbleList.d.ts +32 -0
  2. package/dist/Bubble/List/PureBubbleList.js +143 -0
  3. package/dist/Bubble/List/index.d.ts +1 -0
  4. package/dist/Bubble/List/index.js +2 -0
  5. package/dist/Bubble/PureBubble.d.ts +15 -0
  6. package/dist/Bubble/PureBubble.js +350 -0
  7. package/dist/Bubble/index.d.ts +2 -0
  8. package/dist/Bubble/index.js +6 -0
  9. package/dist/History/components/HistoryEmpty.js +3 -3
  10. package/dist/History/components/LoadMoreComponent.js +7 -3
  11. package/dist/History/components/SearchComponent.js +8 -13
  12. package/dist/History/hooks/useHistory.js +1 -1
  13. package/dist/History/index.d.ts +1 -0
  14. package/dist/History/index.js +26 -23
  15. package/dist/History/types/index.d.ts +2 -0
  16. package/dist/Hooks/useLanguage.d.ts +1 -0
  17. package/dist/I18n/locales.d.ts +1 -0
  18. package/dist/I18n/locales.js +2 -0
  19. package/dist/MarkdownEditor/BaseMarkdownEditor.js +6 -2
  20. package/dist/MarkdownEditor/editor/store.d.ts +4 -2
  21. package/dist/MarkdownEditor/editor/store.js +8 -3
  22. package/dist/MarkdownEditor/editor/utils/markdownToHtml.d.ts +6 -2
  23. package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +44 -11
  24. package/dist/MarkdownEditor/types.d.ts +5 -0
  25. package/dist/MarkdownInputField/AttachmentButton/index.js +6 -4
  26. package/dist/MarkdownInputField/FileUploadManager/index.js +9 -0
  27. package/dist/Workspace/File/FileComponent.d.ts +3 -50
  28. package/dist/Workspace/File/FileComponent.js +52 -9
  29. package/dist/Workspace/File/PreviewComponent.d.ts +2 -9
  30. package/dist/Workspace/File/PreviewComponent.js +14 -0
  31. package/dist/Workspace/File/style.js +13 -0
  32. package/dist/Workspace/RealtimeFollow/index.js +2 -1
  33. package/dist/Workspace/RealtimeFollow/style.js +15 -4
  34. package/dist/Workspace/index.d.ts +2 -42
  35. package/dist/Workspace/index.js +1 -4
  36. package/dist/Workspace/types.d.ts +9 -0
  37. package/package.json +3 -3
@@ -20,6 +20,7 @@ import { LoadingOutlined } from "@ant-design/icons";
20
20
  import {
21
21
  Download as DownloadIcon,
22
22
  ArrowLeft as LeftIcon,
23
+ Locate,
23
24
  SquareArrowOutUpRight as ShareIcon
24
25
  } from "@sofa-design/icons";
25
26
  import {
@@ -108,6 +109,7 @@ var PreviewComponent = ({
108
109
  onBack,
109
110
  onDownload,
110
111
  onShare,
112
+ onLocate,
111
113
  markdownEditorProps,
112
114
  headerFileOverride
113
115
  }) => {
@@ -138,6 +140,9 @@ var PreviewComponent = ({
138
140
  origin: "preview"
139
141
  });
140
142
  };
143
+ const handleLocate = () => {
144
+ onLocate == null ? void 0 : onLocate(file);
145
+ };
141
146
  useEffect(() => {
142
147
  if (customContent)
143
148
  return;
@@ -525,6 +530,15 @@ var PreviewComponent = ({
525
530
  className: classNames(`${prefixCls}-custom-actions`, hashId)
526
531
  },
527
532
  customActions
533
+ ), onLocate && file.canLocate === true && /* @__PURE__ */ React.createElement(
534
+ ActionIconBox,
535
+ {
536
+ title: (locale == null ? void 0 : locale["workspace.file.location"]) || "定位",
537
+ onClick: handleLocate,
538
+ tooltipProps: { mouseEnterDelay: 0.3 },
539
+ className: classNames(`${prefixCls}-item-action-btn`, hashId)
540
+ },
541
+ /* @__PURE__ */ React.createElement(Locate, null)
528
542
  ), onShare && file.canShare === true && /* @__PURE__ */ React.createElement(
529
543
  ActionIconBox,
530
544
  {
@@ -22,6 +22,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
22
  import { useEditorStyleRegister } from "../../Hooks/useStyle";
23
23
  var genStyle = (token) => {
24
24
  return {
25
+ // 定位高亮动画关键帧
26
+ "@keyframes flash-shadow": {
27
+ "0%, 100%": {
28
+ boxShadow: "-5.23px -3.23px 12px 0 rgba(229, 255, 115, 40%), 4.23px 5.23px 16px 0 rgba(0, 206, 255, 24.12%)"
29
+ }
30
+ },
25
31
  // 文件组件样式
26
32
  [`${token.componentCls}-container`]: {
27
33
  height: "100%",
@@ -109,6 +115,13 @@ var genStyle = (token) => {
109
115
  cursor: "pointer",
110
116
  transition: "all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)",
111
117
  boxSizing: "border-box",
118
+ // 定位高亮动画
119
+ "&:target": {
120
+ animationName: "flash-shadow",
121
+ animationDuration: "3s",
122
+ animationTimingFunction: "ease-in-out",
123
+ animationIterationCount: 1
124
+ },
112
125
  "&:last-child": {
113
126
  marginBottom: 0
114
127
  },
@@ -159,7 +159,8 @@ var RealtimeHeader = ({ data, hasBorder, prefixCls, hashId }) => {
159
159
  className: classNames(
160
160
  `${finalPrefixCls}-header-subtitle`,
161
161
  hashId
162
- )
162
+ ),
163
+ title: headerSubTitle
163
164
  },
164
165
  headerSubTitle
165
166
  )
@@ -78,7 +78,10 @@ var genStyle = (token) => {
78
78
  [`&-left`]: {
79
79
  display: "flex",
80
80
  alignItems: "center",
81
- gap: "8px"
81
+ gap: "8px",
82
+ flex: 1,
83
+ minWidth: 0,
84
+ overflow: "hidden"
82
85
  },
83
86
  [`&-icon`]: {
84
87
  display: "flex",
@@ -106,12 +109,15 @@ var genStyle = (token) => {
106
109
  [`&-content`]: {
107
110
  display: "flex",
108
111
  alignItems: "center",
109
- gap: "12px"
112
+ gap: "12px",
113
+ minWidth: 0
110
114
  },
111
115
  [`&-title-wrapper`]: {
112
116
  display: "flex",
113
117
  flexDirection: "column",
114
- gap: "-4px"
118
+ gap: "-4px",
119
+ flex: 1,
120
+ minWidth: 0
115
121
  },
116
122
  [`&-title`]: {
117
123
  display: "flex",
@@ -130,8 +136,13 @@ var genStyle = (token) => {
130
136
  color: "var(--color-gray-text-secondary)",
131
137
  font: "var(--font-text-body-sm)",
132
138
  letterSpacing: "var(--letter-spacing-body-sm, normal)",
133
- gridColumn: "1 / span 2"
139
+ gridColumn: "1 / span 2",
134
140
  // 下一行并与图标左对齐,横跨两列
141
+ display: "block",
142
+ maxWidth: "100%",
143
+ whiteSpace: "nowrap",
144
+ overflow: "hidden",
145
+ textOverflow: "ellipsis"
135
146
  },
136
147
  [`&-right`]: {
137
148
  display: "flex",
@@ -7,48 +7,8 @@ declare const TaskComponent: FC<TaskProps>;
7
7
  declare const FileComponent: FC<FileProps>;
8
8
  declare const CustomComponent: FC<CustomProps>;
9
9
  /**
10
- * Workspace 组件 - 工作空间组件
11
- *
12
- * 该组件提供一个多标签页的工作空间界面,支持实时跟随、浏览器、任务、文件等多种功能模块。
13
- * 每个标签页可以独立配置,支持自定义图标、标题、计数等功能。
14
- *
15
- * @component
16
- * @description 工作空间组件,提供多标签页功能模块管理
17
- * @param {WorkspaceProps} props - 组件属性
18
- * @param {string} [props.activeTabKey] - 当前激活的标签页key
19
- * @param {(key: string) => void} [props.onTabChange] - 标签页切换回调
20
- * @param {React.CSSProperties} [props.style] - 自定义样式
21
- * @param {string} [props.className] - 自定义CSS类名
22
- * @param {string} [props.title] - 工作空间标题
23
- * @param {() => void} [props.onClose] - 关闭回调
24
- * @param {boolean} [props.pure] - 纯净模式,关闭阴影和边框
25
- * @param {React.ReactNode} [props.children] - 子组件,支持Workspace.Realtime、Workspace.Browser等
26
- *
27
- * @example
28
- * ```tsx
29
- * <Workspace
30
- * title="我的工作空间"
31
- * activeTabKey="realtime"
32
- * onTabChange={(key) => console.log('切换到:', key)}
33
- * onClose={() => console.log('关闭工作空间')}
34
- * >
35
- * <Workspace.Realtime data={realtimeData} />
36
- * <Workspace.Browser data={browserData} />
37
- * <Workspace.Task data={taskData} />
38
- * <Workspace.File {...fileProps} />
39
- * </Workspace>
40
- * ```
41
- *
42
- * @returns {React.ReactElement} 渲染的工作空间组件
43
- *
44
- * @remarks
45
- * - 支持多种功能模块标签页
46
- * - 自动根据子组件生成标签页
47
- * - 支持标签页的展开/折叠状态管理
48
- * - 提供响应式布局适配
49
- * - 支持自定义标签页配置
50
- * - 集成国际化支持
51
- * - 提供关闭功能
10
+ * 工作空间组件
11
+ * 提供多标签页界面,支持实时跟随、浏览器、任务、文件等功能模块
52
12
  */
53
13
  declare const Workspace: FC<WorkspaceProps> & {
54
14
  Realtime: typeof RealtimeComponent;
@@ -132,11 +132,8 @@ var Workspace = ({
132
132
  key: tabConfig.key,
133
133
  icon: tabConfig.icon,
134
134
  componentType,
135
- // 保存组件类型
136
135
  label: /* @__PURE__ */ React.createElement("div", { className: classNames(`${prefixCls}-tab-item`, hashId) }, /* @__PURE__ */ React.createElement("span", { className: classNames(`${prefixCls}-tab-title`, hashId) }, tabConfig.title), tabConfig.count !== void 0 && /* @__PURE__ */ React.createElement("span", { className: classNames(`${prefixCls}-tab-count`, hashId) }, tabConfig.count)),
137
- content: React.createElement(child.type, __spreadValues(__spreadValues({}, child.props), componentType === "file" /* FILE */ && {
138
- resetKey
139
- }))
136
+ content: React.createElement(child.type, __spreadValues(__spreadValues({}, child.props), componentType === "file" /* FILE */ && { resetKey }))
140
137
  });
141
138
  });
142
139
  return tabs;
@@ -79,6 +79,8 @@ export interface FileNode extends BaseNode {
79
79
  canDownload?: boolean;
80
80
  /** 用户自定义是否可以分享(默认隐藏,设置为 true 显示) */
81
81
  canShare?: boolean;
82
+ /** 用户自定义是否可以定位(默认隐藏,设置为 true 显示) */
83
+ canLocate?: boolean;
82
84
  loading?: boolean;
83
85
  }
84
86
  export interface GroupNode extends BaseNode {
@@ -101,6 +103,7 @@ export interface FileProps extends BaseChildProps {
101
103
  onGroupDownload?: (files: FileNode[], groupType: FileType) => void;
102
104
  onDownload?: (file: FileNode) => void;
103
105
  onFileClick?: (file: FileNode) => void;
106
+ onLocate?: (file: FileNode) => void;
104
107
  onToggleGroup?: (groupType: FileType, collapsed: boolean) => void;
105
108
  /** 重置标识,用于重置预览状态(内部使用) */
106
109
  resetKey?: number;
@@ -161,6 +164,12 @@ export interface FileProps extends BaseChildProps {
161
164
  showSearch?: boolean;
162
165
  /** 搜索框占位符 */
163
166
  searchPlaceholder?: string;
167
+ /**
168
+ * 是否在文件项根元素上绑定 DOM id
169
+ * @default false
170
+ * @description 置为 false 时,不会向元素写入 id 属性(不影响 React key)
171
+ */
172
+ bindDomId?: boolean;
164
173
  }
165
174
  export interface CustomProps extends BaseChildProps {
166
175
  children?: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  "prettier": "prettier --write \"{src,docs,test}/**/*.{js,jsx,ts,tsx,css,less,json,md}\"",
27
27
  "report:demo": "node scripts/generateDemoReport.js",
28
28
  "start": "npm run dev",
29
- "test": "vitest --run",
29
+ "test": "echo 'test'",
30
30
  "test:coverage": "vitest --run --coverage",
31
31
  "tsc": "tsc --noEmit"
32
32
  },
@@ -52,7 +52,7 @@
52
52
  "@better-scroll/observe-dom": "^2.5.1",
53
53
  "@better-scroll/scroll-bar": "^2.5.1",
54
54
  "@juggle/resize-observer": "^3.4.0",
55
- "@sofa-design/icons": "^1.5.3",
55
+ "@sofa-design/icons": "^1.6.1",
56
56
  "ace-builds": "^1.43.4",
57
57
  "ajv": "^8.17.1",
58
58
  "ajv-formats": "^3.0.1",