@ant-design/agentic-ui 2.29.49 → 2.29.53

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 (45) hide show
  1. package/dist/Bubble/List/PureBubbleList.d.ts +1 -1
  2. package/dist/Bubble/List/PureBubbleList.js +9 -6
  3. package/dist/Bubble/MessagesContent/index.js +2 -2
  4. package/dist/Constants/mobile.d.ts +1 -1
  5. package/dist/Constants/mobile.js +1 -1
  6. package/dist/MarkdownEditor/BaseMarkdownEditor.js +1 -1
  7. package/dist/MarkdownEditor/editor/Editor.js +22 -0
  8. package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.js +20 -4
  9. package/dist/MarkdownEditor/editor/elements/Table/Table.js +5 -4
  10. package/dist/MarkdownEditor/editor/plugins/withLinkAndMediaPlugin.js +28 -0
  11. package/dist/MarkdownEditor/editor/style.js +12 -12
  12. package/dist/MarkdownEditor/editor/utils/dom.js +9 -1
  13. package/dist/MarkdownEditor/editor/utils/media.js +17 -7
  14. package/dist/MarkdownEditor/style.js +35 -36
  15. package/dist/MarkdownEditor/types.d.ts +29 -0
  16. package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +4 -1
  17. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileIcon.d.ts +6 -0
  18. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileIcon.js +56 -2
  19. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.d.ts +4 -4
  20. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +27 -6
  21. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.js +4 -24
  22. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +12 -5
  23. package/dist/MarkdownInputField/AttachmentButton/types.d.ts +1 -0
  24. package/dist/MarkdownInputField/AttachmentButton/utils.d.ts +8 -0
  25. package/dist/MarkdownInputField/AttachmentButton/utils.js +7 -1
  26. package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +22 -3
  27. package/dist/MarkdownInputField/FileMapView/index.js +13 -0
  28. package/dist/MarkdownInputField/FileMapView/style.js +22 -14
  29. package/dist/MarkdownInputField/MarkdownInputField.js +20 -9
  30. package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.js +6 -4
  31. package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +14 -1
  32. package/dist/Plugins/chart/ChartStatistic/index.d.ts +32 -5
  33. package/dist/Plugins/chart/ChartStatistic/index.js +35 -74
  34. package/dist/Plugins/chart/ChartStatistic/style.js +20 -2
  35. package/dist/Plugins/chart/index.d.ts +1 -1
  36. package/dist/ThoughtChainList/index.js +17 -17
  37. package/dist/ToolUseBar/style.js +3 -0
  38. package/dist/ToolUseBarThink/index.js +6 -3
  39. package/dist/ToolUseBarThink/style.js +1 -0
  40. package/dist/Workspace/RealtimeFollow/index.d.ts +4 -0
  41. package/dist/Workspace/RealtimeFollow/index.js +2 -2
  42. package/dist/Workspace/index.js +5 -1
  43. package/dist/index.d.ts +0 -1
  44. package/dist/index.js +1 -1
  45. package/package.json +1 -2
@@ -1,6 +1,33 @@
1
1
  import React from 'react';
2
+ /** 各子区域类名,用于 Semantic 样式定制 */
3
+ export interface ChartStatisticClassNames {
4
+ root?: string;
5
+ header?: string;
6
+ headerLeft?: string;
7
+ title?: React.ReactNode;
8
+ subtitle?: React.ReactNode;
9
+ questionIcon?: string;
10
+ value?: string;
11
+ valuePrefix?: string;
12
+ valueSuffix?: string;
13
+ extra?: string;
14
+ }
15
+ /** 各子区域内联样式,用于 Semantic 样式定制 */
16
+ export interface ChartStatisticStyles {
17
+ root?: React.CSSProperties;
18
+ header?: React.CSSProperties;
19
+ headerLeft?: React.CSSProperties;
20
+ title?: React.CSSProperties;
21
+ subtitle?: React.CSSProperties;
22
+ questionIcon?: React.CSSProperties;
23
+ value?: React.CSSProperties;
24
+ valuePrefix?: React.CSSProperties;
25
+ valueSuffix?: React.CSSProperties;
26
+ extra?: React.CSSProperties;
27
+ }
2
28
  export interface ChartStatisticProps {
3
- title?: string;
29
+ title?: React.ReactNode;
30
+ subtitle?: React.ReactNode;
4
31
  tooltip?: string;
5
32
  value?: number | string | null | undefined;
6
33
  precision?: number;
@@ -9,15 +36,15 @@ export interface ChartStatisticProps {
9
36
  suffix?: React.ReactNode;
10
37
  formatter?: (value: number | string | null | undefined) => React.ReactNode;
11
38
  className?: string;
12
- /** 自定义CSS类名(支持多个类名) */
13
- classNames?: string | string[] | Record<string, boolean | undefined>;
39
+ /** 各子区域类名(Semantic 样式) */
40
+ classNames?: ChartStatisticClassNames;
14
41
  style?: React.CSSProperties;
42
+ /** 各子区域内联样式(Semantic 样式) */
43
+ styles?: ChartStatisticStyles;
15
44
  theme?: 'light' | 'dark';
16
45
  size?: 'small' | 'default' | 'large';
17
46
  block?: boolean;
18
47
  extra?: React.ReactNode;
19
- /** 自定义样式对象(支持多个样式对象) */
20
- styles?: React.CSSProperties | React.CSSProperties[];
21
48
  }
22
49
  declare const ChartStatistic: React.FC<ChartStatisticProps>;
23
50
  export default ChartStatistic;
@@ -1,11 +1,3 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
- return arr2;
5
- }
6
- function _array_without_holes(arr) {
7
- if (Array.isArray(arr)) return _array_like_to_array(arr);
8
- }
9
1
  function _define_property(obj, key, value) {
10
2
  if (key in obj) {
11
3
  Object.defineProperty(obj, key, {
@@ -19,12 +11,6 @@ function _define_property(obj, key, value) {
19
11
  }
20
12
  return obj;
21
13
  }
22
- function _iterable_to_array(iter) {
23
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
24
- }
25
- function _non_iterable_spread() {
26
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
27
- }
28
14
  function _object_spread(target) {
29
15
  for(var i = 1; i < arguments.length; i++){
30
16
  var source = arguments[i] != null ? arguments[i] : {};
@@ -40,25 +26,14 @@ function _object_spread(target) {
40
26
  }
41
27
  return target;
42
28
  }
43
- function _to_consumable_array(arr) {
44
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
45
- }
46
- function _unsupported_iterable_to_array(o, minLen) {
47
- if (!o) return;
48
- if (typeof o === "string") return _array_like_to_array(o, minLen);
49
- var n = Object.prototype.toString.call(o).slice(8, -1);
50
- if (n === "Object" && o.constructor) n = o.constructor.name;
51
- if (n === "Map" || n === "Set") return Array.from(n);
52
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
53
- }
54
29
  import { QuestionCircleOutlined } from "@ant-design/icons";
55
30
  import { ConfigProvider, Tooltip } from "antd";
31
+ import clsx from "clsx";
56
32
  import React, { useContext } from "react";
57
33
  import { useStyle } from "./style";
58
34
  import { formatNumber } from "./utils";
59
35
  var ChartStatistic = function ChartStatistic(param) {
60
- var title = param.title, tooltip = param.tooltip, value = param.value, precision = param.precision, _param_groupSeparator = param.groupSeparator, groupSeparator = _param_groupSeparator === void 0 ? ',' : _param_groupSeparator, _param_prefix = param.prefix, prefix = _param_prefix === void 0 ? '' : _param_prefix, _param_suffix = param.suffix, suffix = _param_suffix === void 0 ? '' : _param_suffix, formatter = param.formatter, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, classNames = param.classNames, style = param.style, styles = param.styles, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, _param_size = param.size, size = _param_size === void 0 ? 'default' : _param_size, _param_block = param.block, block = _param_block === void 0 ? false : _param_block, extra = param.extra;
61
- var _Object;
36
+ var title = param.title, subtitle = param.subtitle, tooltip = param.tooltip, value = param.value, precision = param.precision, _param_groupSeparator = param.groupSeparator, groupSeparator = _param_groupSeparator === void 0 ? ',' : _param_groupSeparator, _param_prefix = param.prefix, prefix = _param_prefix === void 0 ? '' : _param_prefix, _param_suffix = param.suffix, suffix = _param_suffix === void 0 ? '' : _param_suffix, formatter = param.formatter, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, classNames = param.classNames, style = param.style, styles = param.styles, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, _param_size = param.size, size = _param_size === void 0 ? 'default' : _param_size, _param_block = param.block, block = _param_block === void 0 ? false : _param_block, extra = param.extra;
62
37
  var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
63
38
  var prefixCls = getPrefixCls('chart-statistic');
64
39
  var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
@@ -75,68 +50,54 @@ var ChartStatistic = function ChartStatistic(param) {
75
50
  };
76
51
  return formatNumber(value, formatOptions);
77
52
  };
78
- // 渲染标题和问号图标
53
+ // 渲染标题、副标题和问号图标
79
54
  var renderHeader = function renderHeader() {
80
- if (!title && !extra) return null;
55
+ if (!title && !subtitle && !extra) return null;
81
56
  var titleElement = title ? /*#__PURE__*/ React.createElement("span", {
82
- className: [
83
- "".concat(prefixCls, "-title"),
84
- hashId
85
- ].filter(Boolean).join(' ')
57
+ className: clsx("".concat(prefixCls, "-title"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.title),
58
+ style: styles === null || styles === void 0 ? void 0 : styles.title
86
59
  }, title) : null;
60
+ var subtitleElement = subtitle ? /*#__PURE__*/ React.createElement("span", {
61
+ className: clsx("".concat(prefixCls, "-subtitle"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.subtitle),
62
+ style: styles === null || styles === void 0 ? void 0 : styles.subtitle
63
+ }, subtitle) : null;
87
64
  var questionIcon = tooltip ? /*#__PURE__*/ React.createElement(Tooltip, {
88
65
  mouseEnterDelay: 0.3,
89
66
  title: tooltip,
90
67
  placement: "top"
91
68
  }, /*#__PURE__*/ React.createElement(QuestionCircleOutlined, {
92
- className: [
93
- "".concat(prefixCls, "-question-icon"),
94
- hashId
95
- ].filter(Boolean).join(' ')
69
+ className: clsx("".concat(prefixCls, "-question-icon"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.questionIcon),
70
+ style: styles === null || styles === void 0 ? void 0 : styles.questionIcon
96
71
  })) : null;
97
- var extraElement = extra ? /*#__PURE__*/ React.createElement("div", null, extra) : null;
72
+ var extraElement = extra ? /*#__PURE__*/ React.createElement("div", {
73
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.extra,
74
+ style: styles === null || styles === void 0 ? void 0 : styles.extra
75
+ }, extra) : null;
76
+ var hasHeaderLeft = titleElement || subtitleElement || questionIcon;
98
77
  return /*#__PURE__*/ React.createElement("div", {
99
- className: [
100
- "".concat(prefixCls, "-header"),
101
- hashId
102
- ].filter(Boolean).join(' ')
103
- }, /*#__PURE__*/ React.createElement("div", {
104
- className: [
105
- "".concat(prefixCls, "-header-left"),
106
- hashId
107
- ].filter(Boolean).join(' ')
108
- }, titleElement, questionIcon), extraElement);
78
+ className: clsx("".concat(prefixCls, "-header"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.header),
79
+ style: styles === null || styles === void 0 ? void 0 : styles.header
80
+ }, hasHeaderLeft && /*#__PURE__*/ React.createElement("div", {
81
+ className: clsx("".concat(prefixCls, "-header-left"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.headerLeft),
82
+ style: styles === null || styles === void 0 ? void 0 : styles.headerLeft
83
+ }, (titleElement || questionIcon) && /*#__PURE__*/ React.createElement("div", {
84
+ className: clsx("".concat(prefixCls, "-header-row"), hashId)
85
+ }, titleElement, questionIcon), subtitleElement), extraElement);
109
86
  };
110
- var mergedClassName = [
111
- prefixCls,
112
- "".concat(prefixCls, "-").concat(theme),
113
- size !== 'default' && "".concat(prefixCls, "-").concat(size),
114
- block && "".concat(prefixCls, "-block"),
115
- hashId,
116
- className,
117
- classNames
118
- ].filter(Boolean).join(' ');
119
- var mergedStyle = _object_spread({}, style, Array.isArray(styles) ? (_Object = Object).assign.apply(_Object, [
120
- {}
121
- ].concat(_to_consumable_array(styles))) : styles || {});
87
+ var rootClassName = clsx(prefixCls, "".concat(prefixCls, "-").concat(theme), size !== 'default' && "".concat(prefixCls, "-").concat(size), block && "".concat(prefixCls, "-block"), hashId, className, classNames === null || classNames === void 0 ? void 0 : classNames.root);
88
+ var rootStyle = _object_spread({}, style, styles === null || styles === void 0 ? void 0 : styles.root);
122
89
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
123
- className: mergedClassName,
124
- style: mergedStyle
90
+ className: rootClassName,
91
+ style: rootStyle
125
92
  }, renderHeader(), /*#__PURE__*/ React.createElement("div", {
126
- className: [
127
- "".concat(prefixCls, "-value"),
128
- hashId
129
- ].filter(Boolean).join(' ')
93
+ className: clsx("".concat(prefixCls, "-value"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.value),
94
+ style: styles === null || styles === void 0 ? void 0 : styles.value
130
95
  }, prefix && /*#__PURE__*/ React.createElement("span", {
131
- className: [
132
- "".concat(prefixCls, "-value-prefix"),
133
- hashId
134
- ].filter(Boolean).join(' ')
96
+ className: clsx("".concat(prefixCls, "-value-prefix"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.valuePrefix),
97
+ style: styles === null || styles === void 0 ? void 0 : styles.valuePrefix
135
98
  }, prefix), renderValue(), suffix && /*#__PURE__*/ React.createElement("span", {
136
- className: [
137
- "".concat(prefixCls, "-value-suffix"),
138
- hashId
139
- ].filter(Boolean).join(' ')
99
+ className: clsx("".concat(prefixCls, "-value-suffix"), hashId, classNames === null || classNames === void 0 ? void 0 : classNames.valueSuffix),
100
+ style: styles === null || styles === void 0 ? void 0 : styles.valueSuffix
140
101
  }, suffix))));
141
102
  };
142
103
  export default ChartStatistic;
@@ -64,15 +64,27 @@ var genStyle = function genStyle(token) {
64
64
  justifyContent: 'space-between'
65
65
  }, _define_property(_obj, "".concat(token.componentCls, "-header-left"), {
66
66
  display: 'flex',
67
- alignItems: 'center',
68
- gap: '4px',
67
+ flexDirection: 'column',
68
+ alignItems: 'flex-start',
69
+ gap: '2px',
69
70
  flex: 1
71
+ }), _define_property(_obj, "".concat(token.componentCls, "-header-row"), {
72
+ display: 'flex',
73
+ alignItems: 'center',
74
+ gap: '4px'
70
75
  }), _define_property(_obj, "".concat(token.componentCls, "-title"), {
71
76
  fontFamily: 'PingFang SC',
72
77
  fontSize: '13px',
73
78
  fontWeight: 500,
74
79
  color: '#2C3E5D',
75
80
  margin: 0
81
+ }), _define_property(_obj, "".concat(token.componentCls, "-subtitle"), {
82
+ fontFamily: 'PingFang SC',
83
+ fontSize: '12px',
84
+ fontWeight: 400,
85
+ color: '#8C8C8C',
86
+ margin: 0,
87
+ lineHeight: 1.4
76
88
  }), _define_property(_obj, "".concat(token.componentCls, "-question-icon"), {
77
89
  fontSize: '14px',
78
90
  color: '#B3B9C4',
@@ -98,6 +110,8 @@ var genStyle = function genStyle(token) {
98
110
  }), _obj1)), _define_property(_obj10, // Dark theme styles
99
111
  '&-dark', (_obj4 = {}, _define_property(_obj4, "".concat(token.componentCls, "-header"), (_obj2 = {}, _define_property(_obj2, "".concat(token.componentCls, "-title"), {
100
112
  color: 'rgba(255, 255, 255, 0.65)'
113
+ }), _define_property(_obj2, "".concat(token.componentCls, "-subtitle"), {
114
+ color: 'rgba(255, 255, 255, 0.45)'
101
115
  }), _define_property(_obj2, "".concat(token.componentCls, "-question-icon"), {
102
116
  color: 'rgba(255, 255, 255, 0.45)',
103
117
  '&:hover': {
@@ -112,6 +126,8 @@ var genStyle = function genStyle(token) {
112
126
  }), _obj3)), _obj4)), _define_property(_obj10, // Size variants
113
127
  '&-small', (_obj6 = {}, _define_property(_obj6, "".concat(token.componentCls, "-header"), (_obj5 = {}, _define_property(_obj5, "".concat(token.componentCls, "-title"), {
114
128
  fontSize: '12px'
129
+ }), _define_property(_obj5, "".concat(token.componentCls, "-subtitle"), {
130
+ fontSize: '11px'
115
131
  }), _define_property(_obj5, "".concat(token.componentCls, "-question-icon"), {
116
132
  fontSize: '14px'
117
133
  }), _obj5)), _define_property(_obj6, "".concat(token.componentCls, "-value"), {
@@ -120,6 +136,8 @@ var genStyle = function genStyle(token) {
120
136
  gap: '12px'
121
137
  }, _define_property(_obj8, "".concat(token.componentCls, "-header"), (_obj7 = {}, _define_property(_obj7, "".concat(token.componentCls, "-title"), {
122
138
  fontSize: '13px'
139
+ }), _define_property(_obj7, "".concat(token.componentCls, "-subtitle"), {
140
+ fontSize: '13px'
123
141
  }), _define_property(_obj7, "".concat(token.componentCls, "-question-icon"), {
124
142
  fontSize: '14px'
125
143
  }), _obj7)), _define_property(_obj8, "".concat(token.componentCls, "-value"), {
@@ -27,7 +27,7 @@ export { default as RadarChart } from './RadarChart';
27
27
  export { default as ScatterChart } from './ScatterChart';
28
28
  export type { AreaChartConfigItem, AreaChartDataItem, AreaChartProps, } from './AreaChart';
29
29
  export type { BarChartConfigItem, BarChartDataItem, BarChartProps, } from './BarChart';
30
- export type { ChartStatisticProps } from './ChartStatistic';
30
+ export type { ChartStatisticClassNames, ChartStatisticProps, ChartStatisticStyles, } from './ChartStatistic';
31
31
  export type { DonutChartConfig, DonutChartData, DonutChartProps, } from './DonutChart';
32
32
  export type { FunnelChartDataItem, FunnelChartProps } from './FunnelChart';
33
33
  export type { LineChartConfigItem, LineChartDataItem, LineChartProps, } from './LineChart';
@@ -290,6 +290,17 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
290
290
  bubble === null || bubble === void 0 ? void 0 : bubble.isFinished,
291
291
  collapse
292
292
  ]);
293
+ var mergedMarkdownProps = useMemo(function() {
294
+ return merge(markdownRenderProps || {}, {
295
+ codeProps: {
296
+ showLineNumbers: false,
297
+ showGutter: false,
298
+ fontSize: 12
299
+ }
300
+ });
301
+ }, [
302
+ markdownRenderProps
303
+ ]);
293
304
  var _obj;
294
305
  return /*#__PURE__*/ React.createElement(motion.div, {
295
306
  className: classNames("".concat(prefixCls, "-content"), (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-content-collapse"), collapse), _define_property(_obj, "".concat(prefixCls, "-content-compact"), compact), _obj), hashId),
@@ -328,13 +339,7 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
328
339
  key: "".concat(instanceId, "-").concat(item.runId || 'no-runid', "-").concat(index)
329
340
  }, /*#__PURE__*/ React.createElement(ThoughtChainListItem, {
330
341
  index: index,
331
- markdownRenderProps: merge(markdownRenderProps, {
332
- codeProps: {
333
- showLineNumbers: false,
334
- showGutter: false,
335
- fontSize: 12
336
- }
337
- }),
342
+ markdownRenderProps: mergedMarkdownProps,
338
343
  bubble: bubble,
339
344
  thoughtChainListItem: item,
340
345
  hashId: hashId,
@@ -415,10 +420,10 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
415
420
  ]);
416
421
  // memo 化的回调函数
417
422
  var handleCollapseToggle = React.useCallback(function() {
418
- setCollapse(!collapse);
419
- }, [
420
- collapse
421
- ]);
423
+ setCollapse(function(prev) {
424
+ return !prev;
425
+ });
426
+ }, []);
422
427
  var handleDocMetaClose = React.useCallback(function() {
423
428
  setDocMeta(null);
424
429
  onDocMetaClick === null || onDocMetaClick === void 0 ? void 0 : onDocMetaClick(null);
@@ -442,12 +447,7 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
442
447
  }
443
448
  if (!loading && (bubble === null || bubble === void 0 ? void 0 : bubble.isFinished)) {
444
449
  if (time > 0) {
445
- if (bubble === null || bubble === void 0 ? void 0 : bubble.isFinished) {
446
- return "".concat(locale === null || locale === void 0 ? void 0 : locale.taskComplete, ", ").concat(locale === null || locale === void 0 ? void 0 : locale.totalTimeUsed, " ").concat(time.toFixed(2), "s");
447
- }
448
- return /*#__PURE__*/ React.createElement(FlipText, {
449
- word: "".concat(locale === null || locale === void 0 ? void 0 : locale.taskComplete, ", ").concat(locale === null || locale === void 0 ? void 0 : locale.totalTimeUsed, " ").concat(time.toFixed(2), "s")
450
- });
450
+ return "".concat(locale === null || locale === void 0 ? void 0 : locale.taskComplete, ", ").concat(locale === null || locale === void 0 ? void 0 : locale.totalTimeUsed, " ").concat(time.toFixed(2), "s");
451
451
  }
452
452
  return /*#__PURE__*/ React.createElement(FlipText, {
453
453
  word: locale === null || locale === void 0 ? void 0 : locale.taskComplete
@@ -53,6 +53,7 @@ function _object_spread_props(target, source) {
53
53
  import { useEditorStyleRegister } from "../Hooks/useStyle";
54
54
  var genStyle = function genStyle(token) {
55
55
  return _define_property({}, token.componentCls, {
56
+ maxWidth: '100%',
56
57
  '&-no-animation': {
57
58
  '& *': {
58
59
  transition: 'none !important'
@@ -262,6 +263,8 @@ var genStyle = function genStyle(token) {
262
263
  fontWeight: 'normal',
263
264
  lineHeight: '20px',
264
265
  flex: 1,
266
+ minWidth: 0,
267
+ maxWidth: 320,
265
268
  display: '-webkit-box',
266
269
  WebkitLineClamp: 1,
267
270
  WebkitBoxOrient: 'vertical',
@@ -90,6 +90,7 @@ import classNames from "clsx";
90
90
  import { AnimatePresence, motion } from "framer-motion";
91
91
  import { useMergedState } from "rc-util";
92
92
  import React, { memo, useContext, useCallback, useEffect, useMemo, useRef, useState } from "react";
93
+ import { useLocale } from "../I18n";
93
94
  import { useRefFunction } from "../Hooks/useRefFunction";
94
95
  import { useStyle } from "./style";
95
96
  var getChevronStyle = function getChevronStyle(expanded) {
@@ -197,6 +198,7 @@ var ExpandButton = function ExpandButton(param) {
197
198
  };
198
199
  var ThinkContainer = function ThinkContainer(param) {
199
200
  var thinkContent = param.thinkContent, expandedState = param.expandedState, floatingExpandedState = param.floatingExpandedState, status = param.status, light = param.light, prefixCls = param.prefixCls, hashId = param.hashId, customClassNames = param.classNames, styles = param.styles, onToggleFloatingExpand = param.onToggleFloatingExpand;
201
+ var locale = useLocale();
200
202
  var contentInnerRef = useRef(null);
201
203
  var _useState = _sliced_to_array(useState(false), 2), isContentOverflowing = _useState[0], setIsContentOverflowing = _useState[1];
202
204
  var _useState1 = _sliced_to_array(useState(false), 2), contentExpanded = _useState1[0], setContentExpanded = _useState1[1];
@@ -210,7 +212,7 @@ var ThinkContainer = function ThinkContainer(param) {
210
212
  }) : /*#__PURE__*/ React.createElement(ChevronsUpDown, {
211
213
  style: FLOATING_ICON_STYLE
212
214
  });
213
- var floatingText = floatingExpandedState ? '收起' : '展开';
215
+ var floatingText = floatingExpandedState ? locale.collapse : locale.expand;
214
216
  var showFloatingExpand = status === 'loading' && !light;
215
217
  var checkOverflow = useCallback(function() {
216
218
  var el = contentInnerRef.current;
@@ -253,7 +255,7 @@ var ThinkContainer = function ThinkContainer(param) {
253
255
  var contentExpandButton = useMemo(function() {
254
256
  if (!showContentExpand) return null;
255
257
  var icon = contentExpanded ? /*#__PURE__*/ React.createElement(ChevronsDownUp, null) : /*#__PURE__*/ React.createElement(ChevronsUpDown, null);
256
- var text = contentExpanded ? '收起' : '展开';
258
+ var text = contentExpanded ? locale.collapse : locale.expand;
257
259
  return /*#__PURE__*/ React.createElement("div", {
258
260
  className: contentExpandClassName,
259
261
  onClick: handleContentExpandToggle,
@@ -271,7 +273,8 @@ var ThinkContainer = function ThinkContainer(param) {
271
273
  showContentExpand,
272
274
  contentExpanded,
273
275
  contentExpandClassName,
274
- handleContentExpandToggle
276
+ handleContentExpandToggle,
277
+ locale
275
278
  ]);
276
279
  // 缓存容器元素
277
280
  var contentVariants = useMemo(function() {
@@ -249,6 +249,7 @@ var genStyle = function genStyle(token) {
249
249
  width: '100%',
250
250
  padding: 8,
251
251
  display: 'flex',
252
+ flexDirection: 'column',
252
253
  maxHeight: 700,
253
254
  overflow: 'hidden',
254
255
  overflowY: 'auto',
@@ -36,6 +36,10 @@ export interface RealtimeFollowData {
36
36
  }>;
37
37
  segmentedExtra?: React.ReactNode;
38
38
  }
39
+ /** 供测试覆盖使用:根据 type 将 content 转为编辑器所需字符串 */
40
+ export declare const getContentForEditor: (type: RealtimeFollowMode, content: string | DiffContent | undefined) => string;
41
+ /** 供测试覆盖使用:决定是否根据 type/htmlViewMode 更新编辑器内容 */
42
+ export declare const shouldUpdateEditor: (type: RealtimeFollowMode, htmlViewMode: 'preview' | 'code') => boolean;
39
43
  /**
40
44
  * RealtimeFollow 组件
41
45
  *
@@ -244,14 +244,14 @@ var Overlay = function Overlay(param) {
244
244
  className: classNames("".concat(finalPrefixCls, "-overlay"), (_obj = {}, _define_property(_obj, "".concat(finalPrefixCls, "-overlay--loading"), status === 'loading'), _define_property(_obj, "".concat(finalPrefixCls, "-overlay--error"), status === 'error'), _obj), hashId)
245
245
  }, content);
246
246
  };
247
- var getContentForEditor = function getContentForEditor(type, content) {
247
+ /** 供测试覆盖使用:根据 type 将 content 转为编辑器所需字符串 */ export var getContentForEditor = function getContentForEditor(type, content) {
248
248
  if (type === 'html') {
249
249
  var html = typeof content === 'string' ? content : '';
250
250
  return "```html\n".concat(html, "\n```");
251
251
  }
252
252
  return String(content);
253
253
  };
254
- var shouldUpdateEditor = function shouldUpdateEditor(type, htmlViewMode) {
254
+ /** 供测试覆盖使用:决定是否根据 type/htmlViewMode 更新编辑器内容 */ export var shouldUpdateEditor = function shouldUpdateEditor(type, htmlViewMode) {
255
255
  if (type === 'shell') return true;
256
256
  if (type === 'markdown' || type === 'md') return true;
257
257
  if (type === 'html' && htmlViewMode === 'code') return true;
@@ -189,7 +189,11 @@ var COMPONENT_MAP = new Map([
189
189
  var _useState = _sliced_to_array(useState(0), 2), segmentedKey = _useState[0], setSegmentedKey = _useState[1];
190
190
  var _useState1 = _sliced_to_array(useState(0), 2), resetKey = _useState1[0], setResetKey = _useState1[1];
191
191
  var displayTitle = title !== null && title !== void 0 ? title : (locale === null || locale === void 0 ? void 0 : locale['workspace.title']) || 'Workspace';
192
- var defaultConfig = DEFAULT_CONFIG(locale);
192
+ var defaultConfig = useMemo(function() {
193
+ return DEFAULT_CONFIG(locale);
194
+ }, [
195
+ locale
196
+ ]);
193
197
  var _useState2 = _sliced_to_array(useState(''), 2), internalActiveTab = _useState2[0], setInternalActiveTab = _useState2[1];
194
198
  var availableTabs = useMemo(function() {
195
199
  var tabs = [];
package/dist/index.d.ts CHANGED
@@ -7,7 +7,6 @@
7
7
  * 3. 第三方类型不直接 re-export,使用自定义类型包装
8
8
  * 4. 按功能分区,便于维护
9
9
  */
10
- import './root.css';
11
10
  export type { RenderElementProps } from 'slate-react';
12
11
  export * from './Types';
13
12
  export * from './AgenticLayout';
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * 2. 需要向外暴露的内部工具 / 类型,先在各组件 index 中 re-export,再由此处统一引用
7
7
  * 3. 第三方类型不直接 re-export,使用自定义类型包装
8
8
  * 4. 按功能分区,便于维护
9
- */ import "./root.css";
9
+ */ // ─── Slate 类型 re-export(唯一的第三方类型例外) ───────────────────────────
10
10
  // ─── 通用类型 ────────────────────────────────────────────────────────────────
11
11
  export * from "./Types";
12
12
  // ─── 布局组件 ────────────────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.29.49",
3
+ "version": "2.29.53",
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",