@ant-design/agentic-ui 2.30.10 → 2.30.11

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/ChatLayout/style.js +16 -13
  2. package/dist/Components/ActionIconBox/index.js +4 -0
  3. package/dist/Components/Button/IconButton/style.js +1 -1
  4. package/dist/Components/Button/ToggleButton/style.js +1 -1
  5. package/dist/History/style.js +2 -2
  6. package/dist/MarkdownEditor/BaseMarkdownEditor.js +2 -1
  7. package/dist/MarkdownEditor/editor/Editor.js +22 -6
  8. package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +27 -5
  9. package/dist/MarkdownEditor/editor/style.js +7 -3
  10. package/dist/MarkdownEditor/editor/tools/JinjaTemplatePanel/index.js +2 -2
  11. package/dist/MarkdownEditor/types.d.ts +10 -0
  12. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileIcon.js +1 -1
  13. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +3 -3
  14. package/dist/MarkdownInputField/FileMapView/style.js +3 -2
  15. package/dist/MarkdownInputField/SkillModeBar/style.js +1 -1
  16. package/dist/MarkdownInputField/style.js +1 -1
  17. package/dist/MarkdownRenderer/MarkdownRenderer.js +3 -2
  18. package/dist/MarkdownRenderer/index.d.ts +1 -1
  19. package/dist/MarkdownRenderer/markdownReactShared.d.ts +35 -28
  20. package/dist/MarkdownRenderer/markdownReactShared.js +179 -58
  21. package/dist/MarkdownRenderer/streaming/useStreamingMarkdownReact.js +3 -2
  22. package/dist/MarkdownRenderer/types.d.ts +21 -0
  23. package/dist/MarkdownRenderer/useStreaming.js +40 -13
  24. package/dist/ThoughtChainList/style.js +1 -1
  25. package/dist/ToolUseBarThink/style.js +1 -1
  26. package/dist/Workspace/Browser/index.d.ts +6 -0
  27. package/dist/Workspace/Browser/index.js +22 -13
  28. package/dist/Workspace/Browser/style.js +14 -15
  29. package/dist/Workspace/File/FileComponent.js +4 -4
  30. package/dist/Workspace/File/PreviewComponent.js +4 -4
  31. package/dist/Workspace/File/style.js +33 -39
  32. package/dist/Workspace/RealtimeFollow/style.js +78 -85
  33. package/dist/Workspace/style.js +41 -53
  34. package/package.json +1 -1
@@ -102,26 +102,53 @@ var STREAM_INCOMPLETE_REGEX = {
102
102
  ]
103
103
  };
104
104
  var STREAMING_LOADING_PLACEHOLDER = '...';
105
+ var parsePipeRowCells = function parsePipeRowCells(line) {
106
+ var trimmedLine = line.trim();
107
+ if (!trimmedLine.startsWith('|') || !trimmedLine.endsWith('|')) {
108
+ return null;
109
+ }
110
+ var cells = trimmedLine.split('|').slice(1, -1).map(function(cell) {
111
+ return cell.trim();
112
+ });
113
+ if (!cells.length) return null;
114
+ return cells;
115
+ };
116
+ var isTableSeparatorCell = function isTableSeparatorCell(cell) {
117
+ return /^:?-{3,}:?$/.test(cell);
118
+ };
105
119
  /**
106
120
  * 判断表格是否仍不完整。
107
- * 等待 header + separator + 至少一行数据(3 行)后提交。
121
+ * 等待 header + separator + 第一行数据完整闭合后提交。
108
122
  */ var isTableIncomplete = function isTableIncomplete(markdown) {
123
+ var _firstDataRowTrimmed_match;
109
124
  if (markdown.includes('\n\n')) return false;
110
- var lines = markdown.split('\n');
125
+ var lines = markdown.replace(/\r\n/g, '\n').split('\n');
111
126
  // 需要至少 3 行:header | separator | 第一行数据
112
127
  if (lines.length < 3) return true;
113
- var _lines = _sliced_to_array(lines, 2), header = _lines[0], separator = _lines[1];
114
- if (!/^\|.*\|$/.test(header.trim())) return false;
115
- var columns = separator.trim().split('|').map(function(c) {
116
- return c.trim();
117
- }).filter(Boolean);
118
- var isSeparatorValid = columns.every(function(col, i) {
119
- return i === columns.length - 1 ? col === ':' || /^:?-+:?$/.test(col) : /^:?-+:?$/.test(col);
120
- });
128
+ var _lines = _sliced_to_array(lines, 3), header = _lines[0], separator = _lines[1], firstDataRow = _lines[2];
129
+ var headerCells = parsePipeRowCells(header);
130
+ if (!headerCells) return false;
131
+ var separatorCells = parsePipeRowCells(separator);
132
+ if (!separatorCells || separatorCells.length !== headerCells.length) {
133
+ return false;
134
+ }
135
+ var isSeparatorValid = separatorCells.every(isTableSeparatorCell);
121
136
  if (!isSeparatorValid) return false;
122
- // separator 完整但还没有数据行
123
- if (lines.length <= 2) return true;
124
- // 有数据行了,不再缓存
137
+ var firstDataRowTrimmed = (firstDataRow === null || firstDataRow === void 0 ? void 0 : firstDataRow.trim()) || '';
138
+ // 第三行仍为空,说明首行数据尚未到达,继续缓存避免提前渲染 table header
139
+ if (!firstDataRowTrimmed) return true;
140
+ // 第三行不是表格行,视为当前表格 token 已完成(例如 header-only 表格后接普通文本)
141
+ if (!firstDataRowTrimmed.startsWith('|')) return false;
142
+ var minPipeDelimiterCount = headerCells.length + 1;
143
+ var currentPipeDelimiterCount = ((_firstDataRowTrimmed_match = firstDataRowTrimmed.match(/\|/g)) === null || _firstDataRowTrimmed_match === void 0 ? void 0 : _firstDataRowTrimmed_match.length) || 0;
144
+ // 管道分隔符数量不足,说明第一行数据还未输入完整
145
+ if (currentPipeDelimiterCount < minPipeDelimiterCount) return true;
146
+ // 第一行数据必须是闭合的管道行(以 | 结尾),否则继续缓存
147
+ if (!firstDataRowTrimmed.endsWith('|')) return true;
148
+ var firstDataRowCells = parsePipeRowCells(firstDataRow);
149
+ if (!firstDataRowCells || firstDataRowCells.length !== headerCells.length) {
150
+ return true;
151
+ }
125
152
  return false;
126
153
  };
127
154
  var _obj;
@@ -87,7 +87,7 @@ var genStyle = function genStyle(token) {
87
87
  zIndex: 1,
88
88
  backgroundSize: '150%',
89
89
  backgroundPosition: '0 0',
90
- backgroundImage: "conic-gradient(\n from var(--angle) at 50% 50%,\n rgba(46, 255, 127, 0.7) 0deg,\n rgba(120, 133, 255, 1) 90deg,\n rgba(255, 0, 153, 0.4) 180deg,\n rgba(0, 221, 255, 0.62) 270deg,\n rgba(46, 255, 127, 0.7) 360deg\n )",
90
+ backgroundImage: "conic-gradient(\n from var(--angle, 0deg) at 50% 50%,\n rgba(46, 255, 127, 0.7) 0deg,\n rgba(120, 133, 255, 1) 90deg,\n rgba(255, 0, 153, 0.4) 180deg,\n rgba(0, 221, 255, 0.62) 270deg,\n rgba(46, 255, 127, 0.7) 360deg\n )",
91
91
  animationName: 'spin',
92
92
  animationDuration: '2s',
93
93
  animationTimingFunction: 'linear',
@@ -186,7 +186,7 @@ var genStyle = function genStyle(token) {
186
186
  '&-light': {
187
187
  color: 'var(--color-gray-text-secondary)',
188
188
  '&:hover': {
189
- color: 'var(--color-gray-text)'
189
+ color: 'var(--color-gray-text, var(--color-gray-text-default))'
190
190
  }
191
191
  }
192
192
  },
@@ -20,6 +20,7 @@ export interface BrowserItemProps {
20
20
  itemStyle?: React.CSSProperties;
21
21
  className?: string;
22
22
  onLocate?: (item: BrowserItem) => void;
23
+ onOpen?: (item: BrowserItem) => void;
23
24
  }
24
25
  export declare const BrowserItemComponent: React.FC<BrowserItemProps>;
25
26
  export interface BrowserHeaderProps {
@@ -38,6 +39,7 @@ export interface BrowserListProps {
38
39
  loading?: boolean;
39
40
  loadingText?: string;
40
41
  onLocate?: (item: BrowserItem) => void;
42
+ onOpen?: (item: BrowserItem) => void;
41
43
  }
42
44
  export declare const BrowserList: React.FC<BrowserListProps>;
43
45
  export type BrowserProps = {
@@ -57,6 +59,10 @@ export type BrowserProps = {
57
59
  emptyText?: string;
58
60
  loadingText?: string;
59
61
  onLocate?: (item: BrowserItem) => void;
62
+ /**
63
+ * 点击链接时的回调,提供后将拦截默认的新标签页打开行为
64
+ */
65
+ onOpen?: (item: BrowserItem) => void;
60
66
  };
61
67
  declare const Browser: React.FC<BrowserProps>;
62
68
  export default Browser;
@@ -147,10 +147,15 @@ var useBrowserContext = function useBrowserContext() {
147
147
  };
148
148
  };
149
149
  export var BrowserItemComponent = function BrowserItemComponent(param) {
150
- var item = param.item, _param_itemStyle = param.itemStyle, itemStyle = _param_itemStyle === void 0 ? SUGGESTION_ITEM_STYLE : _param_itemStyle, className = param.className, onLocate = param.onLocate;
150
+ var item = param.item, _param_itemStyle = param.itemStyle, itemStyle = _param_itemStyle === void 0 ? SUGGESTION_ITEM_STYLE : _param_itemStyle, className = param.className, onLocate = param.onLocate, onOpen = param.onOpen;
151
151
  var _useBrowserContext = useBrowserContext(), prefixCls = _useBrowserContext.prefixCls, wrapSSR = _useBrowserContext.wrapSSR, hashId = _useBrowserContext.hashId;
152
152
  var locale = useContext(I18nContext).locale;
153
- var handleSiteClick = function handleSiteClick() {
153
+ var handleOpen = function handleOpen(e) {
154
+ if (onOpen) {
155
+ e.preventDefault();
156
+ onOpen(item);
157
+ return;
158
+ }
154
159
  window.open(item.url, '_blank', 'noopener,noreferrer');
155
160
  };
156
161
  var handleLocate = function handleLocate(e) {
@@ -185,12 +190,13 @@ export var BrowserItemComponent = function BrowserItemComponent(param) {
185
190
  rel: "noreferrer",
186
191
  style: {
187
192
  color: 'inherit'
188
- }
193
+ },
194
+ onClick: handleOpen
189
195
  }, /*#__PURE__*/ React.createElement("div", {
190
196
  className: classNames("".concat(prefixCls, "-result-item-title"), hashId)
191
197
  }, item.title)))), /*#__PURE__*/ React.createElement("div", {
192
198
  className: classNames("".concat(prefixCls, "-result-item-site"), hashId),
193
- onClick: handleSiteClick
199
+ onClick: handleOpen
194
200
  }, renderSiteAvatar(item.site, item.icon), /*#__PURE__*/ React.createElement(Tooltip, {
195
201
  title: item.site,
196
202
  mouseEnterDelay: 1
@@ -207,7 +213,7 @@ export var BrowserHeader = function BrowserHeader(param) {
207
213
  type: "text",
208
214
  icon: /*#__PURE__*/ React.createElement(ArrowLeft, {
209
215
  style: {
210
- color: 'var(--color-gray-text-quaternary)'
216
+ color: 'var(--color-gray-text-quaternary, var(--color-gray-text-light, #767e8b))'
211
217
  }
212
218
  }),
213
219
  onClick: onBack
@@ -219,7 +225,7 @@ export var BrowserHeader = function BrowserHeader(param) {
219
225
  }, activeLabel))));
220
226
  };
221
227
  export var BrowserList = function BrowserList(param) {
222
- var items = param.items, activeLabel = param.activeLabel, onBack = param.onBack, customHeader = param.customHeader, _param_showHeader = param.showHeader, showHeader = _param_showHeader === void 0 ? true : _param_showHeader, countFormatter = param.countFormatter, emptyText = param.emptyText, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, loadingText = param.loadingText, onLocate = param.onLocate;
228
+ var items = param.items, activeLabel = param.activeLabel, onBack = param.onBack, customHeader = param.customHeader, _param_showHeader = param.showHeader, showHeader = _param_showHeader === void 0 ? true : _param_showHeader, countFormatter = param.countFormatter, emptyText = param.emptyText, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, loadingText = param.loadingText, onLocate = param.onLocate, onOpen = param.onOpen;
223
229
  var _useBrowserContext = useBrowserContext(), prefixCls = _useBrowserContext.prefixCls, wrapSSR = _useBrowserContext.wrapSSR, hashId = _useBrowserContext.hashId;
224
230
  var locale = useContext(I18nContext).locale;
225
231
  var safeItems = Array.isArray(items) ? items : [];
@@ -266,17 +272,19 @@ export var BrowserList = function BrowserList(param) {
266
272
  item: item,
267
273
  className: classNames("".concat(prefixCls, "-result-item"), hashId),
268
274
  itemStyle: SUGGESTION_ITEM_STYLE,
269
- onLocate: onLocate
275
+ onLocate: onLocate,
276
+ onOpen: onOpen
270
277
  });
271
278
  },
272
279
  footer: null
273
280
  })));
274
281
  };
275
282
  var Browser = function Browser(param) {
276
- var suggestions = param.suggestions, request = param.request, suggestionIcon = param.suggestionIcon, countFormatter = param.countFormatter, emptyText = param.emptyText, loadingText = param.loadingText, onLocate = param.onLocate;
277
- var _useState = _sliced_to_array(useState('suggestions'), 2), currentView = _useState[0], setCurrentView = _useState[1];
278
- var _useState1 = _sliced_to_array(useState(null), 2), activeSuggestion = _useState1[0], setActiveSuggestion = _useState1[1];
279
- var _useState2 = _sliced_to_array(useState(''), 2), activeLabel = _useState2[0], setActiveLabel = _useState2[1];
283
+ var suggestions = param.suggestions, request = param.request, suggestionIcon = param.suggestionIcon, countFormatter = param.countFormatter, emptyText = param.emptyText, loadingText = param.loadingText, onLocate = param.onLocate, onOpen = param.onOpen;
284
+ var isSingleSuggestion = suggestions.length === 1;
285
+ var _useState = _sliced_to_array(useState(isSingleSuggestion ? 'results' : 'suggestions'), 2), currentView = _useState[0], setCurrentView = _useState[1];
286
+ var _useState1 = _sliced_to_array(useState(isSingleSuggestion ? suggestions[0] : null), 2), activeSuggestion = _useState1[0], setActiveSuggestion = _useState1[1];
287
+ var _useState2 = _sliced_to_array(useState(isSingleSuggestion ? suggestions[0].label : ''), 2), activeLabel = _useState2[0], setActiveLabel = _useState2[1];
280
288
  var locale = useContext(I18nContext).locale;
281
289
  var _useBrowserContext = useBrowserContext(), prefixCls = _useBrowserContext.prefixCls, wrapSSR = _useBrowserContext.wrapSSR, hashId = _useBrowserContext.hashId;
282
290
  var _useMemo = useMemo(function() {
@@ -336,14 +344,15 @@ var Browser = function Browser(param) {
336
344
  })), currentView === 'results' && /*#__PURE__*/ React.createElement(BrowserList, {
337
345
  items: results,
338
346
  activeLabel: activeLabel,
339
- onBack: function onBack() {
347
+ onBack: isSingleSuggestion ? undefined : function() {
340
348
  return setCurrentView('suggestions');
341
349
  },
342
350
  countFormatter: countFormatter,
343
351
  emptyText: emptyText,
344
352
  loading: loading,
345
353
  loadingText: loadingText,
346
- onLocate: onLocate
354
+ onLocate: onLocate,
355
+ onOpen: onOpen
347
356
  })));
348
357
  };
349
358
  export default Browser;
@@ -64,7 +64,7 @@ var fadeInUp = new Keyframes('fadeInUp', {
64
64
  });
65
65
  var genStyle = function genStyle(token) {
66
66
  var componentCls = token.componentCls;
67
- var _obj, _obj1, _obj2;
67
+ var _obj, _obj1, _obj2, _obj3;
68
68
  return _define_property({}, componentCls, {
69
69
  '&-suggestion': (_obj1 = {
70
70
  '&:hover': {
@@ -94,21 +94,20 @@ var genStyle = function genStyle(token) {
94
94
  font: 'var(--font-text-body-sm)',
95
95
  letterSpacing: 'var(--letter-spacing-body-sm, normal)',
96
96
  color: 'var(--color-gray-text-secondary)'
97
- }), _obj)), _define_property(_obj1, '.ant-tag', {
97
+ }), _obj)), _define_property(_obj1, "".concat(token.antCls, "-tag"), {
98
98
  marginInlineEnd: '0'
99
99
  }), _obj1),
100
- '&-header': _define_property({
100
+ '&-header': (_obj2 = {
101
101
  display: 'flex',
102
102
  alignItems: 'center',
103
103
  justifyContent: 'space-between',
104
104
  height: '48px',
105
105
  width: 'calc(100% - 20px)',
106
106
  padding: '8px',
107
- margin: '4px',
108
- '.ant-tag': {
109
- marginInlineEnd: '0'
110
- }
111
- }, "".concat(componentCls, "-header-left"), _define_property({
107
+ margin: '4px'
108
+ }, _define_property(_obj2, "".concat(token.antCls, "-tag"), {
109
+ marginInlineEnd: '0'
110
+ }), _define_property(_obj2, "".concat(componentCls, "-header-left"), _define_property({
112
111
  display: 'flex',
113
112
  alignItems: 'center',
114
113
  gap: '4px',
@@ -125,12 +124,12 @@ var genStyle = function genStyle(token) {
125
124
  textOverflow: 'ellipsis',
126
125
  whiteSpace: 'nowrap',
127
126
  color: 'var(--color-gray-text-default)'
128
- })),
127
+ })), _obj2),
129
128
  '&-header-wrapper': {
130
129
  marginLeft: '-12px',
131
130
  marginRight: '-12px'
132
131
  },
133
- '&-result-item': (_obj2 = {
132
+ '&-result-item': (_obj3 = {
134
133
  width: '100%',
135
134
  overflow: 'hidden',
136
135
  padding: '4px',
@@ -142,7 +141,7 @@ var genStyle = function genStyle(token) {
142
141
  borderRadius: '12px',
143
142
  background: 'var(--color-gray-control-fill-hover)'
144
143
  }
145
- }, _define_property(_obj2, "".concat(componentCls, "-result-item-title"), {
144
+ }, _define_property(_obj3, "".concat(componentCls, "-result-item-title"), {
146
145
  fontSize: '12px',
147
146
  color: 'var(--color-gray-text-default)',
148
147
  display: 'block',
@@ -150,17 +149,17 @@ var genStyle = function genStyle(token) {
150
149
  overflow: 'hidden',
151
150
  textOverflow: 'ellipsis',
152
151
  whiteSpace: 'nowrap'
153
- }), _define_property(_obj2, "".concat(componentCls, "-result-item-title-wrapper"), {
152
+ }), _define_property(_obj3, "".concat(componentCls, "-result-item-title-wrapper"), {
154
153
  overflow: 'hidden',
155
154
  textOverflow: 'ellipsis',
156
155
  whiteSpace: 'nowrap',
157
156
  fontSize: '14px',
158
157
  color: 'var(--color-gray-text-default)'
159
- }), _define_property(_obj2, "".concat(componentCls, "-result-item-site-text"), {
158
+ }), _define_property(_obj3, "".concat(componentCls, "-result-item-site-text"), {
160
159
  font: 'var(--font-text-paragraph-sm)',
161
160
  letterSpacing: 'var(--letter-spacing-paragraph-sm, normal)',
162
161
  color: 'var(--color-gray-text-light)'
163
- }), _define_property(_obj2, "".concat(componentCls, "-result-item-site"), {
162
+ }), _define_property(_obj3, "".concat(componentCls, "-result-item-site"), {
164
163
  display: 'flex',
165
164
  alignItems: 'center',
166
165
  gap: '4px',
@@ -169,7 +168,7 @@ var genStyle = function genStyle(token) {
169
168
  whiteSpace: 'nowrap',
170
169
  fontSize: '12px',
171
170
  cursor: 'pointer'
172
- }), _obj2)
171
+ }), _obj3)
173
172
  });
174
173
  };
175
174
  export function useBrowserStyle(prefixCls) {
@@ -505,18 +505,18 @@ var FileItemComponent = function FileItemComponent(param) {
505
505
  ellipsis: {
506
506
  tooltip: fileWithId.name
507
507
  }
508
- }, fileWithId.name)), /*#__PURE__*/ React.createElement("div", {
508
+ }, fileWithId.name)), (fileWithId.renderDetails || fileTypeInfo.displayType || fileWithId.size || fileWithId.lastModified) && /*#__PURE__*/ React.createElement("div", {
509
509
  className: classNames("".concat(finalPrefixCls, "-item-details"), hashId)
510
510
  }, fileWithId.renderDetails ? fileWithId.renderDetails(renderContext) : /*#__PURE__*/ React.createElement(Typography.Text, {
511
511
  type: "secondary",
512
512
  ellipsis: true
513
- }, /*#__PURE__*/ React.createElement("span", {
513
+ }, fileTypeInfo.displayType && /*#__PURE__*/ React.createElement("span", {
514
514
  className: classNames("".concat(finalPrefixCls, "-item-type"), hashId)
515
- }, fileTypeInfo.displayType || fileTypeInfo.fileType), fileWithId.size && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
515
+ }, fileTypeInfo.displayType), fileWithId.size && /*#__PURE__*/ React.createElement(React.Fragment, null, fileTypeInfo.displayType && /*#__PURE__*/ React.createElement("span", {
516
516
  className: classNames("".concat(finalPrefixCls, "-item-separator"), hashId)
517
517
  }, "|"), /*#__PURE__*/ React.createElement("span", {
518
518
  className: classNames("".concat(finalPrefixCls, "-item-size"), hashId)
519
- }, formatFileSize(fileWithId.size))), fileWithId.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
519
+ }, formatFileSize(fileWithId.size))), fileWithId.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, (fileTypeInfo.displayType || fileWithId.size) && /*#__PURE__*/ React.createElement("span", {
520
520
  className: classNames("".concat(finalPrefixCls, "-item-separator"), hashId)
521
521
  }, "|"), /*#__PURE__*/ React.createElement("span", {
522
522
  className: classNames("".concat(finalPrefixCls, "-item-time"), hashId)
@@ -309,18 +309,18 @@ var PlaceholderContent = function PlaceholderContent(param) {
309
309
  font: 'var(--font-text-h6-base)',
310
310
  color: 'var(--color-gray-text-default)'
311
311
  }
312
- }, file.name)), /*#__PURE__*/ React.createElement("div", {
312
+ }, file.name)), (fileTypeProcessor.inferFileType(file).displayType || file.size || file.lastModified) && /*#__PURE__*/ React.createElement("div", {
313
313
  className: classNames("".concat(filePrefixCls, "-item-details"), hashId)
314
314
  }, /*#__PURE__*/ React.createElement(Typography.Text, {
315
315
  type: "secondary",
316
316
  ellipsis: true
317
- }, /*#__PURE__*/ React.createElement("span", {
317
+ }, fileTypeProcessor.inferFileType(file).displayType && /*#__PURE__*/ React.createElement("span", {
318
318
  className: classNames("".concat(filePrefixCls, "-item-type"), hashId)
319
- }, fileTypeProcessor.inferFileType(file).displayType || fileTypeProcessor.inferFileType(file).fileType), file.size && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
319
+ }, fileTypeProcessor.inferFileType(file).displayType), file.size && /*#__PURE__*/ React.createElement(React.Fragment, null, fileTypeProcessor.inferFileType(file).displayType && /*#__PURE__*/ React.createElement("span", {
320
320
  className: classNames("".concat(filePrefixCls, "-item-separator"), hashId)
321
321
  }, "|"), /*#__PURE__*/ React.createElement("span", {
322
322
  className: classNames("".concat(filePrefixCls, "-item-size"), hashId)
323
- }, formatFileSize(file.size))), file.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
323
+ }, formatFileSize(file.size))), file.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, (fileTypeProcessor.inferFileType(file).displayType || file.size) && /*#__PURE__*/ React.createElement("span", {
324
324
  className: classNames("".concat(filePrefixCls, "-item-separator"), hashId)
325
325
  }, "|"), /*#__PURE__*/ React.createElement("span", {
326
326
  className: classNames("".concat(filePrefixCls, "-item-time"), hashId)
@@ -52,8 +52,8 @@ function _object_spread_props(target, source) {
52
52
  }
53
53
  import { useEditorStyleRegister } from "../../Hooks/useStyle";
54
54
  var genStyle = function genStyle(token) {
55
- var _obj, _obj1, _obj2, _obj3, _obj4, _obj5, _obj6;
56
- return _obj6 = {
55
+ var _obj, _obj1, _obj2, _obj3, _obj4, _obj5, _obj6, _obj7;
56
+ return _obj7 = {
57
57
  // 定位高亮动画关键帧
58
58
  '@keyframes flash-shadow': {
59
59
  '0%,100%': {
@@ -64,7 +64,7 @@ var genStyle = function genStyle(token) {
64
64
  }
65
65
  }
66
66
  }, // 文件组件样式
67
- _define_property(_obj6, "".concat(token.componentCls, "-container"), // 分组展示模式
67
+ _define_property(_obj7, "".concat(token.componentCls, "-container"), // 分组展示模式
68
68
  _define_property({
69
69
  height: '100%',
70
70
  display: 'flex',
@@ -126,7 +126,7 @@ var genStyle = function genStyle(token) {
126
126
  }), // 分组内容区域
127
127
  _define_property(_obj, "&-content", {
128
128
  paddingLeft: '12px'
129
- }), _obj)))), _define_property(_obj6, "".concat(token.componentCls, "-item"), (_obj3 = {
129
+ }), _obj)))), _define_property(_obj7, "".concat(token.componentCls, "-item"), (_obj3 = {
130
130
  display: 'flex',
131
131
  alignItems: 'center',
132
132
  gap: '4px',
@@ -212,16 +212,16 @@ var genStyle = function genStyle(token) {
212
212
  pointerEvents: 'none',
213
213
  transition: 'opacity 0.2s ease, visibility 0.2s ease'
214
214
  }, // 保持图标按钮颜色一致
215
- _define_property(_obj1, ".ant-btn, .ant-btn .anticon", {
215
+ _define_property(_obj1, "".concat(token.antCls, "-btn, ").concat(token.antCls, "-btn .anticon"), {
216
216
  color: 'var(--color-gray-text-light)'
217
- }), _define_property(_obj1, ".ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn:hover .anticon, .ant-btn:focus .anticon, .ant-btn:active .anticon", {
217
+ }), _define_property(_obj1, "".concat(token.antCls, "-btn:hover, ").concat(token.antCls, "-btn:focus, ").concat(token.antCls, "-btn:active, ").concat(token.antCls, "-btn:hover .anticon, ").concat(token.antCls, "-btn:focus .anticon, ").concat(token.antCls, "-btn:active .anticon"), {
218
218
  color: 'var(--color-gray-text-light)'
219
219
  }), _obj1)), _define_property(_obj3, "&-action-btn", (_obj2 = {}, _define_property(_obj2, ".anticon", {
220
220
  color: 'var(--color-gray-text-light)'
221
221
  }), _define_property(_obj2, '&:hover .anticon, &:focus .anticon, &:active .anticon', {
222
222
  color: 'var(--color-gray-text-light)'
223
223
  }), _obj2)), _obj3)), // 空状态
224
- _define_property(_obj6, "".concat(token.componentCls, "-empty"), {
224
+ _define_property(_obj7, "".concat(token.componentCls, "-empty"), {
225
225
  display: 'flex',
226
226
  alignItems: 'center',
227
227
  justifyContent: 'center',
@@ -229,7 +229,7 @@ var genStyle = function genStyle(token) {
229
229
  padding: 24,
230
230
  minHeight: 200,
231
231
  flex: 1
232
- }), _define_property(_obj6, "".concat(token.componentCls, "-preview"), (_obj5 = {
232
+ }), _define_property(_obj7, "".concat(token.componentCls, "-preview"), (_obj5 = {
233
233
  display: 'flex',
234
234
  flexDirection: 'column',
235
235
  height: '100%',
@@ -301,9 +301,9 @@ var genStyle = function genStyle(token) {
301
301
  alignItems: 'center',
302
302
  gap: '8px'
303
303
  }, // 保持预览头部操作按钮的图标颜色一致
304
- _define_property(_obj4, ".ant-btn, .ant-btn .anticon", {
304
+ _define_property(_obj4, "".concat(token.antCls, "-btn, ").concat(token.antCls, "-btn .anticon"), {
305
305
  color: '#767E8B'
306
- }), _define_property(_obj4, ".ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn:hover .anticon, .ant-btn:focus .anticon, .ant-btn:active .anticon", {
306
+ }), _define_property(_obj4, "".concat(token.antCls, "-btn:hover, ").concat(token.antCls, "-btn:focus, ").concat(token.antCls, "-btn:active, ").concat(token.antCls, "-btn:hover .anticon, ").concat(token.antCls, "-btn:focus .anticon, ").concat(token.antCls, "-btn:active .anticon"), {
307
307
  color: '#767E8B'
308
308
  }), _obj4)), // 预览内容区域
309
309
  _define_property(_obj5, "&-content", {
@@ -414,45 +414,39 @@ var genStyle = function genStyle(token) {
414
414
  }), // 不可预览说明文案
415
415
  _define_property(_obj5, "&-unsupported-text", {
416
416
  font: 'var(--font-text-body-sm)',
417
- color: 'var(--color-text-secondary)'
418
- }), _obj5)), // 搜索框样式
419
- _define_property(_obj6, "".concat(token.componentCls, "-search"), {
420
- '.ant-input-outlined': {
421
- borderRadius: 'var(--radius-control-base)',
422
- borderColor: 'transparent',
423
- background: 'var(--color-gray-bg-card-light)',
424
- boxShadow: 'var(--shadow-border-base)',
425
- marginBottom: 8
426
- },
427
- '.ant-input-outlined:hover, .ant-input-outlined:focus-within': {
428
- borderColor: 'var(--color-primary-control-fill-primary-active)'
429
- },
430
- '.ant-input-affix-wrapper >input.ant-input': {
431
- color: 'var(--color-gray-text-default)',
432
- font: 'var(--font-text-body-base)',
433
- letterSpacing: 'var(--letter-spacing-body-base, normal)'
434
- },
435
- // 搜索图标样式
436
- '.anticon': {
437
- color: 'var(--color-gray-text-secondary)',
438
- fontSize: 16
439
- }
440
- }), // 成功消息图标样式
441
- _define_property(_obj6, "".concat(token.componentCls, "-success-icon"), {
417
+ color: 'var(--color-text-secondary, var(--color-gray-text-secondary))'
418
+ }), _obj5)), _define_property(_obj7, "".concat(token.componentCls, "-search"), (_obj6 = {}, _define_property(_obj6, "".concat(token.antCls, "-input-outlined"), {
419
+ borderRadius: 'var(--radius-control-base)',
420
+ borderColor: 'transparent',
421
+ background: 'var(--color-gray-bg-card-light)',
422
+ boxShadow: 'var(--shadow-border-base)',
423
+ marginBottom: 8
424
+ }), _define_property(_obj6, "".concat(token.antCls, "-input-outlined:hover, ").concat(token.antCls, "-input-outlined:focus-within"), {
425
+ borderColor: 'var(--color-primary-control-fill-primary-active)'
426
+ }), _define_property(_obj6, "".concat(token.antCls, "-input-affix-wrapper >input").concat(token.antCls, "-input"), {
427
+ color: 'var(--color-gray-text-default)',
428
+ font: 'var(--font-text-body-base)',
429
+ letterSpacing: 'var(--letter-spacing-body-base, normal)'
430
+ }), // 搜索图标样式
431
+ _define_property(_obj6, '.anticon', {
432
+ color: 'var(--color-gray-text-secondary)',
433
+ fontSize: 16
434
+ }), _obj6)), // 成功消息图标样式
435
+ _define_property(_obj7, "".concat(token.componentCls, "-success-icon"), {
442
436
  fontSize: 16,
443
437
  marginRight: 8,
444
438
  color: 'var(--color-green-control-fill-primary)'
445
439
  }), // 成功消息文本样式
446
- _define_property(_obj6, "".concat(token.componentCls, "-message-text"), {
440
+ _define_property(_obj7, "".concat(token.componentCls, "-message-text"), {
447
441
  font: 'var(--font-text-body-emphasized-base)',
448
442
  color: 'var(--color-gray-text-default)'
449
443
  }), // 分组内容容器(用于motion.div)
450
- _define_property(_obj6, "".concat(token.componentCls, "-group-content"), {
444
+ _define_property(_obj7, "".concat(token.componentCls, "-group-content"), {
451
445
  overflow: 'hidden'
452
446
  }), // 隐藏的图片预览组件
453
- _define_property(_obj6, "".concat(token.componentCls, "-hidden-image"), {
447
+ _define_property(_obj7, "".concat(token.componentCls, "-hidden-image"), {
454
448
  display: 'none'
455
- }), _obj6;
449
+ }), _obj7;
456
450
  };
457
451
  export function useFileStyle(prefixCls) {
458
452
  return useEditorStyleRegister('WorkspaceFile', function(token) {