@ant-design/agentic-ui 2.30.15 → 2.30.19

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 (34) hide show
  1. package/dist/Bubble/AIBubble.js +3 -2
  2. package/dist/Bubble/ContentFilemapView.d.ts +2 -0
  3. package/dist/Bubble/ContentFilemapView.js +9 -6
  4. package/dist/Bubble/MessagesContent/index.js +7 -7
  5. package/dist/Bubble/UserBubble.js +2 -1
  6. package/dist/Hooks/useLanguage.d.ts +28 -1
  7. package/dist/I18n/locales.d.ts +28 -1
  8. package/dist/I18n/locales.js +64 -4
  9. package/dist/MarkdownEditor/editor/elements/Code/index.js +12 -0
  10. package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/enter.js +5 -0
  11. package/dist/MarkdownInputField/AttachmentButton/index.js +55 -5
  12. package/dist/MarkdownInputField/FileMapView/index.js +1 -7
  13. package/dist/MarkdownInputField/FileMapView/style.js +1 -2
  14. package/dist/MarkdownInputField/MarkdownInputField.js +16 -5
  15. package/dist/MarkdownInputField/SendActions/index.js +2 -2
  16. package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.js +1 -0
  17. package/dist/MarkdownInputField/style.js +24 -1
  18. package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +3 -3
  19. package/dist/MarkdownInputField/types/MarkdownInputFieldProps.js +1 -1
  20. package/dist/Plugins/chart/ChartRender.js +3 -1
  21. package/dist/Plugins/chart/DonutChart/index.js +1 -1
  22. package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +56 -2
  23. package/dist/Plugins/code/components/CodeToolbar.js +1 -1
  24. package/dist/Schema/SchemaForm/index.js +18 -9
  25. package/dist/Workspace/File/FileComponent.js +178 -103
  26. package/dist/Workspace/File/FileTypeProcessor.js +1 -4
  27. package/dist/Workspace/File/PreviewComponent.js +6 -6
  28. package/dist/Workspace/File/index.d.ts +1 -0
  29. package/dist/Workspace/File/index.js +1 -0
  30. package/dist/Workspace/File/style.js +20 -0
  31. package/dist/Workspace/File/utils.js +4 -2
  32. package/dist/Workspace/types.d.ts +8 -1
  33. package/dist/Workspace/types.js +74 -35
  34. package/package.json +1 -2
@@ -57,7 +57,7 @@ function _unsupported_iterable_to_array(o, minLen) {
57
57
  if (n === "Map" || n === "Set") return Array.from(n);
58
58
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
59
59
  }
60
- import { FileOther as DefaultFileIcon, FileAudio, FileCsv, FileDoc, FileFolders, FileMarkdown, FileOther, FilePdf, FilePic, FileVideo, FileXlsx, FileXml, FileZip } from "@sofa-design/icons";
60
+ import { FileOther as DefaultFileIcon, FileAudio, FileCsv, FileDoc, FileFolders, FileMarkdown, FileOther, FilePdf, FilePic, FilePpt, FileVideo, FileXlsx, FileXml, FileZip } from "@sofa-design/icons";
61
61
  import React from "react";
62
62
  import { FILE_TYPES, FileCategory, getFileCategory } from "../types";
63
63
  // 文件扩展名到图标的映射
@@ -73,6 +73,8 @@ var EXTENSION_ICON_MAP = {
73
73
  html: /*#__PURE__*/ React.createElement(FileXml, null),
74
74
  md: /*#__PURE__*/ React.createElement(FileMarkdown, null),
75
75
  markdown: /*#__PURE__*/ React.createElement(FileMarkdown, null),
76
+ ppt: /*#__PURE__*/ React.createElement(FilePpt, null),
77
+ pptx: /*#__PURE__*/ React.createElement(FilePpt, null),
76
78
  zip: /*#__PURE__*/ React.createElement(FileZip, null),
77
79
  rar: /*#__PURE__*/ React.createElement(FileZip, null),
78
80
  '7z': /*#__PURE__*/ React.createElement(FileZip, null),
@@ -82,7 +84,7 @@ var EXTENSION_ICON_MAP = {
82
84
  };
83
85
  var _obj;
84
86
  // 文件类型到默认图标的映射
85
- var TYPE_ICON_MAP = (_obj = {}, _define_property(_obj, FileCategory.Text, /*#__PURE__*/ React.createElement(FileMarkdown, null)), _define_property(_obj, FileCategory.Code, /*#__PURE__*/ React.createElement(FileXml, null)), _define_property(_obj, FileCategory.PDF, /*#__PURE__*/ React.createElement(FilePdf, null)), _define_property(_obj, FileCategory.Word, /*#__PURE__*/ React.createElement(FileDoc, null)), _define_property(_obj, FileCategory.Excel, /*#__PURE__*/ React.createElement(FileXlsx, null)), _define_property(_obj, FileCategory.Image, /*#__PURE__*/ React.createElement(FilePic, null)), _define_property(_obj, FileCategory.Video, /*#__PURE__*/ React.createElement(FileVideo, null)), _define_property(_obj, FileCategory.Audio, /*#__PURE__*/ React.createElement(FileAudio, null)), _define_property(_obj, FileCategory.Archive, /*#__PURE__*/ React.createElement(FileZip, null)), _define_property(_obj, FileCategory.Other, /*#__PURE__*/ React.createElement(FileOther, null)), _obj);
87
+ var TYPE_ICON_MAP = (_obj = {}, _define_property(_obj, FileCategory.Text, /*#__PURE__*/ React.createElement(FileMarkdown, null)), _define_property(_obj, FileCategory.Code, /*#__PURE__*/ React.createElement(FileXml, null)), _define_property(_obj, FileCategory.PDF, /*#__PURE__*/ React.createElement(FilePdf, null)), _define_property(_obj, FileCategory.Word, /*#__PURE__*/ React.createElement(FileDoc, null)), _define_property(_obj, FileCategory.Excel, /*#__PURE__*/ React.createElement(FileXlsx, null)), _define_property(_obj, FileCategory.Presentation, /*#__PURE__*/ React.createElement(FilePpt, null)), _define_property(_obj, FileCategory.Image, /*#__PURE__*/ React.createElement(FilePic, null)), _define_property(_obj, FileCategory.Video, /*#__PURE__*/ React.createElement(FileVideo, null)), _define_property(_obj, FileCategory.Audio, /*#__PURE__*/ React.createElement(FileAudio, null)), _define_property(_obj, FileCategory.Archive, /*#__PURE__*/ React.createElement(FileZip, null)), _define_property(_obj, FileCategory.Other, /*#__PURE__*/ React.createElement(FileOther, null)), _obj);
86
88
  /**
87
89
  * 获取文件类型图标
88
90
  */ export var getFileTypeIcon = function getFileTypeIcon(type, customIcon, fileName) {
@@ -53,6 +53,7 @@ export declare enum FileCategory {
53
53
  PDF = "pdf",
54
54
  Word = "word",
55
55
  Excel = "excel",
56
+ Presentation = "presentation",
56
57
  Archive = "archive",
57
58
  Other = "other"
58
59
  }
@@ -60,7 +61,8 @@ export interface FileTypeDefinition {
60
61
  category: FileCategory;
61
62
  extensions: string[];
62
63
  mimeTypes: string[];
63
- name: string;
64
+ /** Locale key for the file type display name (e.g. 'fileType.plainText') */
65
+ nameKey: string;
64
66
  }
65
67
  export declare const FILE_TYPES: Record<string, FileTypeDefinition>;
66
68
  export type FileType = keyof typeof FILE_TYPES;
@@ -238,3 +240,8 @@ export interface CustomProps extends BaseChildProps {
238
240
  export declare const getFileType: (filename: string) => FileType;
239
241
  export declare const getMimeType: (fileType: FileType) => string;
240
242
  export declare const getFileCategory: (fileType: FileType) => FileCategory;
243
+ /**
244
+ * Get the localized display name for a file type.
245
+ * Falls back to the nameKey itself when no locale is provided.
246
+ */
247
+ export declare const getFileTypeName: (fileType: FileType, locale?: Record<string, string>) => string;
@@ -44,7 +44,6 @@ function _unsupported_iterable_to_array(o, minLen) {
44
44
  if (n === "Map" || n === "Set") return Array.from(n);
45
45
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
46
46
  }
47
- // ... (rest of the file content unchanged)
48
47
  // 文件类型分类
49
48
  export var FileCategory = /*#__PURE__*/ function(FileCategory) {
50
49
  FileCategory["Text"] = "text";
@@ -55,6 +54,7 @@ export var FileCategory = /*#__PURE__*/ function(FileCategory) {
55
54
  FileCategory["PDF"] = "pdf";
56
55
  FileCategory["Word"] = "word";
57
56
  FileCategory["Excel"] = "excel";
57
+ FileCategory["Presentation"] = "presentation";
58
58
  FileCategory["Archive"] = "archive";
59
59
  FileCategory["Other"] = "other";
60
60
  return FileCategory;
@@ -69,7 +69,7 @@ export var FILE_TYPES = {
69
69
  mimeTypes: [
70
70
  'text/plain'
71
71
  ],
72
- name: '文本文件'
72
+ nameKey: 'fileType.plainText'
73
73
  },
74
74
  markdown: {
75
75
  category: "text",
@@ -80,7 +80,7 @@ export var FILE_TYPES = {
80
80
  mimeTypes: [
81
81
  'text/markdown'
82
82
  ],
83
- name: 'Markdown'
83
+ nameKey: 'markdown'
84
84
  },
85
85
  image: {
86
86
  category: "image",
@@ -101,21 +101,33 @@ export var FILE_TYPES = {
101
101
  'image/webp',
102
102
  'image/svg+xml'
103
103
  ],
104
- name: '图片'
104
+ nameKey: 'fileType.image'
105
105
  },
106
106
  video: {
107
107
  category: "video",
108
108
  extensions: [
109
109
  'mp4',
110
110
  'webm',
111
- 'ogg'
111
+ 'ogv',
112
+ 'mov',
113
+ 'avi',
114
+ 'mkv',
115
+ 'flv',
116
+ '3gp',
117
+ 'm4v'
112
118
  ],
113
119
  mimeTypes: [
114
120
  'video/mp4',
115
121
  'video/webm',
116
- 'video/ogg'
117
- ],
118
- name: '视频'
122
+ 'video/ogg',
123
+ 'video/quicktime',
124
+ 'video/x-msvideo',
125
+ 'video/x-matroska',
126
+ 'video/x-flv',
127
+ 'video/3gpp',
128
+ 'video/x-m4v'
129
+ ],
130
+ nameKey: 'fileType.video'
119
131
  },
120
132
  audio: {
121
133
  category: "audio",
@@ -124,16 +136,22 @@ export var FILE_TYPES = {
124
136
  'wav',
125
137
  'ogg',
126
138
  'aac',
127
- 'm4a'
139
+ 'm4a',
140
+ 'flac',
141
+ 'wma',
142
+ 'opus'
128
143
  ],
129
144
  mimeTypes: [
130
145
  'audio/mpeg',
131
146
  'audio/wav',
132
147
  'audio/ogg',
133
148
  'audio/aac',
134
- 'audio/mp4'
149
+ 'audio/mp4',
150
+ 'audio/flac',
151
+ 'audio/x-ms-wma',
152
+ 'audio/opus'
135
153
  ],
136
- name: '音频'
154
+ nameKey: 'fileType.audio'
137
155
  },
138
156
  pdf: {
139
157
  category: "pdf",
@@ -143,7 +161,7 @@ export var FILE_TYPES = {
143
161
  mimeTypes: [
144
162
  'application/pdf'
145
163
  ],
146
- name: 'PDF文档'
164
+ nameKey: 'fileType.pdf'
147
165
  },
148
166
  word: {
149
167
  category: "word",
@@ -155,7 +173,7 @@ export var FILE_TYPES = {
155
173
  'application/msword',
156
174
  'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
157
175
  ],
158
- name: 'Word文档'
176
+ nameKey: 'fileType.word'
159
177
  },
160
178
  excel: {
161
179
  category: "excel",
@@ -167,7 +185,7 @@ export var FILE_TYPES = {
167
185
  'application/vnd.ms-excel',
168
186
  'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
169
187
  ],
170
- name: 'Excel表格'
188
+ nameKey: 'fileType.excel'
171
189
  },
172
190
  csv: {
173
191
  category: "excel",
@@ -179,7 +197,19 @@ export var FILE_TYPES = {
179
197
  'application/csv',
180
198
  'application/vnd.ms-excel'
181
199
  ],
182
- name: 'CSV文件'
200
+ nameKey: 'fileType.csv'
201
+ },
202
+ powerpoint: {
203
+ category: "presentation",
204
+ extensions: [
205
+ 'ppt',
206
+ 'pptx'
207
+ ],
208
+ mimeTypes: [
209
+ 'application/vnd.ms-powerpoint',
210
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
211
+ ],
212
+ nameKey: 'fileType.powerpoint'
183
213
  },
184
214
  archive: {
185
215
  category: "archive",
@@ -199,7 +229,7 @@ export var FILE_TYPES = {
199
229
  'application/gzip',
200
230
  'application/x-bzip2'
201
231
  ],
202
- name: '压缩文件'
232
+ nameKey: 'fileType.archive'
203
233
  },
204
234
  // 代码文件类型
205
235
  javascript: {
@@ -213,7 +243,7 @@ export var FILE_TYPES = {
213
243
  'text/javascript',
214
244
  'application/javascript'
215
245
  ],
216
- name: 'JavaScript'
246
+ nameKey: 'javascript'
217
247
  },
218
248
  typescript: {
219
249
  category: "code",
@@ -224,7 +254,7 @@ export var FILE_TYPES = {
224
254
  'text/typescript',
225
255
  'application/typescript'
226
256
  ],
227
- name: 'TypeScript'
257
+ nameKey: 'typescript'
228
258
  },
229
259
  react: {
230
260
  category: "code",
@@ -236,7 +266,7 @@ export var FILE_TYPES = {
236
266
  'text/jsx',
237
267
  'text/tsx'
238
268
  ],
239
- name: 'React'
269
+ nameKey: 'react'
240
270
  },
241
271
  python: {
242
272
  category: "code",
@@ -249,7 +279,7 @@ export var FILE_TYPES = {
249
279
  'text/x-python',
250
280
  'application/x-python-code'
251
281
  ],
252
- name: 'Python'
282
+ nameKey: 'python'
253
283
  },
254
284
  java: {
255
285
  category: "code",
@@ -259,7 +289,7 @@ export var FILE_TYPES = {
259
289
  mimeTypes: [
260
290
  'text/x-java-source'
261
291
  ],
262
- name: 'Java'
292
+ nameKey: 'java'
263
293
  },
264
294
  cpp: {
265
295
  category: "code",
@@ -276,7 +306,7 @@ export var FILE_TYPES = {
276
306
  'text/x-c++src',
277
307
  'text/x-c++hdr'
278
308
  ],
279
- name: 'C++'
309
+ nameKey: 'c++'
280
310
  },
281
311
  c: {
282
312
  category: "code",
@@ -288,7 +318,7 @@ export var FILE_TYPES = {
288
318
  'text/x-csrc',
289
319
  'text/x-chdr'
290
320
  ],
291
- name: 'C'
321
+ nameKey: 'c'
292
322
  },
293
323
  csharp: {
294
324
  category: "code",
@@ -298,7 +328,7 @@ export var FILE_TYPES = {
298
328
  mimeTypes: [
299
329
  'text/x-csharp'
300
330
  ],
301
- name: 'C#'
331
+ nameKey: 'c#'
302
332
  },
303
333
  go: {
304
334
  category: "code",
@@ -308,7 +338,7 @@ export var FILE_TYPES = {
308
338
  mimeTypes: [
309
339
  'text/x-go'
310
340
  ],
311
- name: 'Go'
341
+ nameKey: 'go'
312
342
  },
313
343
  rust: {
314
344
  category: "code",
@@ -318,7 +348,7 @@ export var FILE_TYPES = {
318
348
  mimeTypes: [
319
349
  'text/x-rust'
320
350
  ],
321
- name: 'Rust'
351
+ nameKey: 'rust'
322
352
  },
323
353
  php: {
324
354
  category: "code",
@@ -333,7 +363,7 @@ export var FILE_TYPES = {
333
363
  'text/x-php',
334
364
  'application/x-httpd-php'
335
365
  ],
336
- name: 'PHP'
366
+ nameKey: 'php'
337
367
  },
338
368
  ruby: {
339
369
  category: "code",
@@ -344,7 +374,7 @@ export var FILE_TYPES = {
344
374
  mimeTypes: [
345
375
  'text/x-ruby'
346
376
  ],
347
- name: 'Ruby'
377
+ nameKey: 'ruby'
348
378
  },
349
379
  shell: {
350
380
  category: "code",
@@ -358,7 +388,7 @@ export var FILE_TYPES = {
358
388
  'text/x-shellscript',
359
389
  'application/x-sh'
360
390
  ],
361
- name: 'Shell脚本'
391
+ nameKey: 'fileType.shell'
362
392
  },
363
393
  powershell: {
364
394
  category: "code",
@@ -370,7 +400,7 @@ export var FILE_TYPES = {
370
400
  mimeTypes: [
371
401
  'text/x-powershell'
372
402
  ],
373
- name: 'PowerShell'
403
+ nameKey: 'powershell'
374
404
  },
375
405
  sql: {
376
406
  category: "code",
@@ -381,7 +411,7 @@ export var FILE_TYPES = {
381
411
  'text/x-sql',
382
412
  'application/sql'
383
413
  ],
384
- name: 'SQL'
414
+ nameKey: 'sql'
385
415
  },
386
416
  lua: {
387
417
  category: "code",
@@ -391,7 +421,7 @@ export var FILE_TYPES = {
391
421
  mimeTypes: [
392
422
  'text/x-lua'
393
423
  ],
394
- name: 'Lua'
424
+ nameKey: 'lua'
395
425
  },
396
426
  perl: {
397
427
  category: "code",
@@ -403,7 +433,7 @@ export var FILE_TYPES = {
403
433
  mimeTypes: [
404
434
  'text/x-perl'
405
435
  ],
406
- name: 'Perl'
436
+ nameKey: 'perl'
407
437
  },
408
438
  scala: {
409
439
  category: "code",
@@ -414,7 +444,7 @@ export var FILE_TYPES = {
414
444
  mimeTypes: [
415
445
  'text/x-scala'
416
446
  ],
417
- name: 'Scala'
447
+ nameKey: 'scala'
418
448
  },
419
449
  config: {
420
450
  category: "code",
@@ -436,7 +466,7 @@ export var FILE_TYPES = {
436
466
  'text/plain',
437
467
  'application/x-wine-extension-ini'
438
468
  ],
439
- name: '配置文件'
469
+ nameKey: 'fileType.config'
440
470
  }
441
471
  };
442
472
  // 工具函数
@@ -474,3 +504,12 @@ export var getFileCategory = function getFileCategory(fileType) {
474
504
  var _FILE_TYPES_fileType;
475
505
  return FILE_TYPES === null || FILE_TYPES === void 0 ? void 0 : (_FILE_TYPES_fileType = FILE_TYPES[fileType]) === null || _FILE_TYPES_fileType === void 0 ? void 0 : _FILE_TYPES_fileType.category;
476
506
  };
507
+ /**
508
+ * Get the localized display name for a file type.
509
+ * Falls back to the nameKey itself when no locale is provided.
510
+ */ export var getFileTypeName = function getFileTypeName(fileType, locale) {
511
+ var _ref;
512
+ var definition = FILE_TYPES[fileType];
513
+ if (!definition) return fileType;
514
+ return (_ref = locale === null || locale === void 0 ? void 0 : locale[definition.nameKey]) !== null && _ref !== void 0 ? _ref : definition.nameKey;
515
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.30.15",
3
+ "version": "2.30.19",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",
@@ -24,7 +24,6 @@
24
24
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
25
25
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
26
26
  "prepare": "husky install && dumi setup",
27
- "prepublishOnly": "npm run build && npm run test",
28
27
  "prettier": "prettier --write \"{src,docs,test}/**/*.{js,jsx,ts,tsx,css,less,json,md}\"",
29
28
  "preview": "pnpm dumi preview",
30
29
  "report:demo": "node scripts/generateDemoReport.js",