@ant-design/agentic-ui 2.30.30 → 2.30.33

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 (95) hide show
  1. package/dist/AILabel/index.d.ts +2 -0
  2. package/dist/AILabel/index.js +4 -2
  3. package/dist/AgentRunBar/Robot.js +0 -1
  4. package/dist/AgentRunBar/index.js +1 -0
  5. package/dist/AgenticLayout/index.js +1 -0
  6. package/dist/AnswerAlert/index.js +1 -0
  7. package/dist/BackTo/ScrollVisibleButton.d.ts +2 -0
  8. package/dist/BackTo/ScrollVisibleButton.js +4 -2
  9. package/dist/Bubble/AIBubble.js +6 -3
  10. package/dist/Bubble/List/PureBubbleList.js +24 -1
  11. package/dist/Bubble/List/index.js +7 -5
  12. package/dist/Bubble/MessagesContent/BubbleExtra.js +4 -2
  13. package/dist/Bubble/style.js +0 -1
  14. package/dist/ChatBootPage/ButtonTab.js +1 -0
  15. package/dist/ChatBootPage/ButtonTabGroup.js +1 -0
  16. package/dist/ChatBootPage/CaseReply.js +1 -0
  17. package/dist/ChatBootPage/Title.js +1 -0
  18. package/dist/ChatLayout/index.js +1 -0
  19. package/dist/Components/ActionIconBox/index.js +8 -8
  20. package/dist/Components/ActionItemBox/ActionItemBox.js +1 -0
  21. package/dist/Components/Button/IconButton/index.js +1 -0
  22. package/dist/Components/Button/SwitchButton/index.js +1 -0
  23. package/dist/Components/Button/ToggleButton/index.js +1 -0
  24. package/dist/Components/GradientText/index.js +1 -0
  25. package/dist/Components/LayoutHeader/index.js +2 -1
  26. package/dist/Components/Loading/Loading.js +2 -0
  27. package/dist/Components/Robot/index.js +1 -0
  28. package/dist/Components/SuggestionList/index.js +1 -0
  29. package/dist/Components/TextAnimate/index.js +1 -0
  30. package/dist/Components/TypingAnimation/index.js +2 -1
  31. package/dist/Components/VisualList/index.js +3 -0
  32. package/dist/Components/lotties/ThreeThinkingLottie/index.d.ts +68 -0
  33. package/dist/Components/lotties/ThreeThinkingLottie/index.js +151 -0
  34. package/dist/Components/lotties/ThreeThinkingLottie/three-thinking.json +130 -0
  35. package/dist/Components/lotties/index.d.ts +1 -0
  36. package/dist/Components/lotties/index.js +1 -0
  37. package/dist/History/index.js +1 -0
  38. package/dist/Hooks/useLanguage.d.ts +1 -0
  39. package/dist/I18n/locales.d.ts +1 -0
  40. package/dist/I18n/locales.js +2 -0
  41. package/dist/MarkdownEditor/BaseMarkdownEditor.js +2 -0
  42. package/dist/MarkdownEditor/editor/parser/parse/parseHtml.js +15 -6
  43. package/dist/MarkdownEditor/style.js +0 -4
  44. package/dist/MarkdownInputField/SendButton/index.d.ts +2 -2
  45. package/dist/MarkdownInputField/SendButton/index.js +44 -26
  46. package/dist/MarkdownInputField/SendButton/sendButtonPalette.d.ts +36 -0
  47. package/dist/MarkdownInputField/SendButton/sendButtonPalette.js +247 -0
  48. package/dist/MarkdownInputField/SendButton/style.js +3 -3
  49. package/dist/MarkdownInputField/style.js +3 -1
  50. package/dist/MarkdownRenderer/AnimationText.js +1 -2
  51. package/dist/MarkdownRenderer/CharacterQueue.js +3 -0
  52. package/dist/MarkdownRenderer/MarkdownRenderer.js +6 -18
  53. package/dist/MarkdownRenderer/markdownReactShared.d.ts +2 -1
  54. package/dist/MarkdownRenderer/markdownReactShared.js +57 -19
  55. package/dist/MarkdownRenderer/streaming/MarkdownBlockPiece.js +14 -10
  56. package/dist/MarkdownRenderer/streaming/fenceTracker.d.ts +7 -0
  57. package/dist/MarkdownRenderer/streaming/fenceTracker.js +28 -0
  58. package/dist/MarkdownRenderer/streaming/lastBlockThrottle.js +3 -1
  59. package/dist/MarkdownRenderer/streaming/useShallowMemo.d.ts +1 -0
  60. package/dist/MarkdownRenderer/streaming/useShallowMemo.js +36 -0
  61. package/dist/MarkdownRenderer/streaming/useStreamingMarkdownReact.js +6 -3
  62. package/dist/MarkdownRenderer/useStreaming.js +43 -41
  63. package/dist/Plugins/chart/components/ChartContainer/ChartContainer.d.ts +13 -3
  64. package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +19 -4
  65. package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +2 -0
  66. package/dist/Plugins/chart/hooks/index.d.ts +2 -0
  67. package/dist/Plugins/chart/hooks/index.js +1 -0
  68. package/dist/Plugins/chart/hooks/useDetectTheme.d.ts +46 -0
  69. package/dist/Plugins/chart/hooks/useDetectTheme.js +222 -0
  70. package/dist/Schema/SchemaEditor/index.js +1 -0
  71. package/dist/Schema/SchemaForm/index.js +1 -0
  72. package/dist/TaskList/TaskList.js +45 -16
  73. package/dist/TaskList/components/TaskListItem.js +2 -1
  74. package/dist/TaskList/constants.d.ts +1 -1
  75. package/dist/TaskList/constants.js +9 -4
  76. package/dist/TaskList/style.js +30 -12
  77. package/dist/ThoughtChainList/index.js +1 -0
  78. package/dist/ToolUseBar/index.js +7 -6
  79. package/dist/ToolUseBarThink/index.d.ts +0 -23
  80. package/dist/ToolUseBarThink/index.js +178 -315
  81. package/dist/ToolUseBarThink/style.js +61 -52
  82. package/dist/Types/quicklink.d.ts +1 -1
  83. package/dist/WelcomeMessage/index.js +1 -0
  84. package/dist/Workspace/File/FileTree/FileTreeComponent.d.ts +4 -0
  85. package/dist/Workspace/File/FileTree/FileTreeComponent.js +283 -0
  86. package/dist/Workspace/File/FileTree/index.d.ts +2 -0
  87. package/dist/Workspace/File/FileTree/index.js +1 -0
  88. package/dist/Workspace/File/FileTree/style.d.ts +8 -0
  89. package/dist/Workspace/File/FileTree/style.js +80 -0
  90. package/dist/Workspace/File/index.d.ts +2 -1
  91. package/dist/Workspace/File/index.js +1 -0
  92. package/dist/Workspace/index.d.ts +4 -2
  93. package/dist/Workspace/index.js +73 -36
  94. package/dist/Workspace/types.d.ts +70 -2
  95. package/package.json +2 -1
@@ -16,6 +16,8 @@ export type AILabelStatus = 'default' | 'watermark' | 'emphasis';
16
16
  * @extends React.HTMLAttributes<HTMLSpanElement>
17
17
  */
18
18
  export interface AILabelProps extends React.HTMLAttributes<HTMLSpanElement> {
19
+ /** 自动化测试用根节点标识,未设置时默认与主题前缀一致 */
20
+ 'data-testid'?: string;
19
21
  /**
20
22
  * 标签状态
21
23
  * @description 控制标签的视觉样式,支持默认、水印和强调三种状态
@@ -185,14 +185,15 @@ import { prefixCls, useStyle } from "./style";
185
185
  * - 使用 framer-motion 提供平滑的动画效果
186
186
  * - 水印状态下,当 Tooltip 未打开时显示禁用图标
187
187
  */ var AILabelComponent = /*#__PURE__*/ React.forwardRef(function(props, ref) {
188
- var status = props.status, offset = props.offset, tooltip = props.tooltip, className = props.className, style = props.style, rootStyle = props.rootStyle, children = props.children, restProps = _object_without_properties(props, [
188
+ var status = props.status, offset = props.offset, tooltip = props.tooltip, className = props.className, style = props.style, rootStyle = props.rootStyle, children = props.children, dataTestId = props['data-testid'], restProps = _object_without_properties(props, [
189
189
  "status",
190
190
  "offset",
191
191
  "tooltip",
192
192
  "className",
193
193
  "style",
194
194
  "rootStyle",
195
- "children"
195
+ "children",
196
+ 'data-testid'
196
197
  ]);
197
198
  var context = useContext(ConfigProvider.ConfigContext);
198
199
  var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls(prefixCls);
@@ -234,6 +235,7 @@ import { prefixCls, useStyle } from "./style";
234
235
  ref: ref
235
236
  }, restProps), {
236
237
  className: badgeClassName,
238
+ "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : baseCls,
237
239
  style: rootStyle
238
240
  }), children, /*#__PURE__*/ React.createElement(Tooltip, _object_spread_props(_object_spread({}, tooltip), {
239
241
  onOpenChange: handleTooltipOpenChange
@@ -69,7 +69,6 @@ import RobotIcon from "../Components/Robot";
69
69
  var icon = param.icon, _param_size = param.size, size = _param_size === void 0 ? 42 : _param_size, status = param.status, className = param.className, style = param.style;
70
70
  return /*#__PURE__*/ React.createElement("div", {
71
71
  className: classNames(className),
72
- "data-testid": "robot",
73
72
  style: /*#__PURE__*/ React.isValidElement(icon) ? _object_spread({
74
73
  display: 'flex',
75
74
  flexDirection: 'column',
@@ -282,6 +282,7 @@ export * from "./Robot";
282
282
  var _obj;
283
283
  return wrapSSR(/*#__PURE__*/ React.createElement(motion.div, {
284
284
  className: classNames(baseCls, hashId, className, "".concat(baseCls, "-").concat(variant), (_obj = {}, _define_property(_obj, "".concat(baseCls, "-with-description"), description), _define_property(_obj, "".concat(baseCls, "-status-").concat(robotStatus), robotStatus), _obj)),
285
+ "data-testid": baseCls,
285
286
  layout: "size",
286
287
  transition: {
287
288
  duration: 0.25,
@@ -245,6 +245,7 @@ var AgenticLayoutComponent = function AgenticLayoutComponent(param) {
245
245
  ]);
246
246
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
247
247
  className: classNames(prefixCls, className, hashId),
248
+ "data-testid": prefixCls,
248
249
  style: style
249
250
  }, /*#__PURE__*/ React.createElement("div", {
250
251
  className: "".concat(prefixCls, "-body ").concat(hashId),
@@ -159,6 +159,7 @@ IconNode.displayName = 'IconNode';
159
159
  var alertCls = classNames(prefixCls, className, (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-").concat(type), !!type), _define_property(_obj, "".concat(prefixCls, "-with-description"), !!description), _obj), hashId);
160
160
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
161
161
  className: alertCls,
162
+ "data-testid": prefixCls,
162
163
  style: style
163
164
  }, /*#__PURE__*/ React.createElement("div", {
164
165
  className: classNames("".concat(prefixCls, "-content"), hashId)
@@ -5,6 +5,8 @@ import { UseScrollVisibleProps } from './hooks/useScrollVisible';
5
5
  * ScrollVisibleButton 组件属性
6
6
  */
7
7
  export interface ScrollVisibleButtonProps extends Omit<React.DOMAttributes<HTMLButtonElement>, 'onClick'> {
8
+ /** 自动化测试用按钮标识,未设置时默认与主题前缀一致 */
9
+ 'data-testid'?: string;
8
10
  /** 自定义类名 */
9
11
  className?: string;
10
12
  /** 自定义样式 */
@@ -163,14 +163,15 @@ var EXIT_ANIMATION = {
163
163
  var _ref = [
164
164
  _0,
165
165
  _1
166
- ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, style = _ref2.style, tmp = _ref2.shouldVisible, propsShouldVisible = tmp === void 0 ? DEFAULT_VISIBLE_THRESHOLD : tmp, target = _ref2.target, onClick = _ref2.onClick, tooltip = _ref2.tooltip, children = _ref2.children, rest = _object_without_properties(_ref2, [
166
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, style = _ref2.style, tmp = _ref2.shouldVisible, propsShouldVisible = tmp === void 0 ? DEFAULT_VISIBLE_THRESHOLD : tmp, target = _ref2.target, onClick = _ref2.onClick, tooltip = _ref2.tooltip, children = _ref2.children, dataTestId = _ref2['data-testid'], rest = _object_without_properties(_ref2, [
167
167
  "className",
168
168
  "style",
169
169
  "shouldVisible",
170
170
  "target",
171
171
  "onClick",
172
172
  "tooltip",
173
- "children"
173
+ "children",
174
+ 'data-testid'
174
175
  ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
175
176
  var context = useContext(ConfigProvider.ConfigContext);
176
177
  var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls(prefixCls);
@@ -193,6 +194,7 @@ var EXIT_ANIMATION = {
193
194
  var button = /*#__PURE__*/ React.createElement("button", _object_spread({
194
195
  ref: internalRef,
195
196
  className: classNames(baseCls, className, hashId),
197
+ "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : baseCls,
196
198
  style: style,
197
199
  type: "button",
198
200
  onClick: handleClick
@@ -272,14 +272,14 @@ var getTaskList = function getTaskList(originData) {
272
272
  * </AIBubble>
273
273
  * ```
274
274
  */ export var AIBubble = /*#__PURE__*/ memo(function(props) {
275
- var _ref, _messageDisplayKeyRef_current, _props_readonly;
275
+ var _messageDisplayKeyRef_current, _props_readonly;
276
276
  var _props_originData, _props_originData1, _props_originData2, _props_originData3, _props_originData4, _props_originData5, _props_bubbleRenderConfig, _props_originData_fileMap, _props_originData6, _props_markdownRenderConfig, _props_bubbleRenderConfig1, _props_styles, _props_bubbleRenderConfig2, _bubbleRenderConfig_render;
277
277
  var onAvatarClick = props.onAvatarClick, className = props.className, style = props.style, bubbleRenderConfig = props.bubbleRenderConfig, classNames = props.classNames, styles = props.styles, originData = props.originData, preMessage = props.preMessage;
278
278
  var _React_useState = _sliced_to_array(React.useState(false), 2), hidePadding = _React_useState[0], setHidePadding = _React_useState[1];
279
279
  var messageDisplayKeyRef = useRef(null);
280
280
  var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
281
281
  var context = useContext(BubbleConfigContext);
282
- var _ref1 = context || {}, compact = _ref1.compact, standalone = _ref1.standalone, extraShowOnHover = _ref1.extraShowOnHover;
282
+ var _ref = context || {}, compact = _ref.compact, standalone = _ref.standalone, extraShowOnHover = _ref.extraShowOnHover;
283
283
  var prefixClass = getPrefixCls('agentic');
284
284
  var _useStyle = useStyle(prefixClass), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
285
285
  var preMessageSameRole = isSameRoleAsPrevious(preMessage, originData);
@@ -310,7 +310,10 @@ var getTaskList = function getTaskList(originData) {
310
310
  messageDisplayKeyRef.current = nanoid();
311
311
  }
312
312
  }
313
- var messageDisplayKey = (_ref = (_messageDisplayKeyRef_current = messageDisplayKeyRef.current) !== null && _messageDisplayKeyRef_current !== void 0 ? _messageDisplayKeyRef_current : id) !== null && _ref !== void 0 ? _ref : nanoid();
313
+ if (!messageDisplayKeyRef.current && !id) {
314
+ messageDisplayKeyRef.current = nanoid();
315
+ }
316
+ var messageDisplayKey = (_messageDisplayKeyRef_current = messageDisplayKeyRef.current) !== null && _messageDisplayKeyRef_current !== void 0 ? _messageDisplayKeyRef_current : id;
314
317
  var rawContent = props === null || props === void 0 ? void 0 : (_props_originData1 = props.originData) === null || _props_originData1 === void 0 ? void 0 : _props_originData1.content;
315
318
  var _useMemo = useMemo(function() {
316
319
  return extractFilemapBlocks(typeof rawContent === 'string' ? rawContent : '');
@@ -177,11 +177,33 @@ export var PureBubbleList = /*#__PURE__*/ React.memo(function(props) {
177
177
  }, [
178
178
  bubbleList,
179
179
  props.style,
180
- props.lazy
180
+ props.lazy,
181
+ bubbleListRef,
182
+ bubbleRenderConfig,
183
+ classNames,
184
+ props.bubbleRef,
185
+ markdownRenderConfig,
186
+ docListProps,
187
+ styles,
188
+ props.readonly,
189
+ onReply,
190
+ onDislike,
191
+ onDisLike,
192
+ onLike,
193
+ onLikeCancel,
194
+ onCancelLike,
195
+ onAvatarClick,
196
+ onDoubleClick,
197
+ shouldShowCopy,
198
+ shouldShowVoice,
199
+ userMeta,
200
+ assistantMeta,
201
+ deps
181
202
  ]);
182
203
  if (isLoading) {
183
204
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
184
205
  className: clsx(prefixClass, "".concat(prefixClass, "-loading"), className, hashId),
206
+ "data-testid": prefixClass,
185
207
  ref: bubbleListRef,
186
208
  style: {
187
209
  padding: 24
@@ -192,6 +214,7 @@ export var PureBubbleList = /*#__PURE__*/ React.memo(function(props) {
192
214
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
193
215
  className: clsx("".concat(prefixClass), className, hashId, (_obj = {}, _define_property(_obj, "".concat(prefixClass, "-readonly"), props.readonly), _define_property(_obj, "".concat(prefixClass, "-compact"), compact), _obj)),
194
216
  "data-chat-list": bubbleList.length,
217
+ "data-testid": prefixClass,
195
218
  style: style,
196
219
  ref: bubbleListRef,
197
220
  onScroll: onScroll,
@@ -154,12 +154,16 @@ import { useStyle } from "./style";
154
154
  ]);
155
155
  var prefixClass = getPrefixCls('agentic-bubble-list');
156
156
  var _useStyle = useStyle(prefixClass), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
157
+ var prevStyleRef = useRef(props.style);
158
+ if (props.style !== prevStyleRef.current && !shallowEqualRecord(props.style || {}, prevStyleRef.current || {})) {
159
+ prevStyleRef.current = props.style;
160
+ }
157
161
  var deps = useMemo(function() {
158
162
  return [
159
- props.style
163
+ prevStyleRef.current
160
164
  ];
161
165
  }, [
162
- JSON.stringify(props.style)
166
+ prevStyleRef.current
163
167
  ]);
164
168
  // 为 loading 项生成唯一的 key,使用 ref 缓存以确保稳定性
165
169
  var loadingKeysRef = useRef(new Map());
@@ -224,11 +228,9 @@ import { useStyle } from "./style";
224
228
  var useLazyWrapper = !!isLazyEnabled && ((_ref = (_props_lazy = props.lazy) === null || _props_lazy === void 0 ? void 0 : (_props_lazy_shouldLazyLoad = _props_lazy.shouldLazyLoad) === null || _props_lazy_shouldLazyLoad === void 0 ? void 0 : _props_lazy_shouldLazyLoad.call(_props_lazy, index, totalCount)) !== null && _ref !== void 0 ? _ref : true);
225
229
  var bubbleElement = /*#__PURE__*/ React.createElement("div", {
226
230
  key: itemKey,
227
- style: useLazyWrapper ? {
231
+ style: {
228
232
  minWidth: 0,
229
233
  width: '100%'
230
- } : {
231
- display: 'contents'
232
234
  },
233
235
  "data-bubble-list-item": true,
234
236
  "data-is-last": isLast ? 'true' : 'false'
@@ -448,7 +448,8 @@ import { VoiceButton } from "./VoiceButton";
448
448
  originalData === null || originalData === void 0 ? void 0 : originalData.isFinished,
449
449
  typing,
450
450
  feedbackLoading,
451
- props.onLikeCancel || props.onCancelLike
451
+ props.onLikeCancel,
452
+ props.onCancelLike
452
453
  ]);
453
454
  var disLike = useMemo(function() {
454
455
  return shouldShowDisLike && !typing ? /*#__PURE__*/ React.createElement(ActionIconBox, {
@@ -698,7 +699,8 @@ import { VoiceButton } from "./VoiceButton";
698
699
  var _props_onRenderExtraNull;
699
700
  (_props_onRenderExtraNull = props.onRenderExtraNull) === null || _props_onRenderExtraNull === void 0 ? void 0 : _props_onRenderExtraNull.call(props, !dom && !reSend);
700
701
  }, [
701
- dom
702
+ dom,
703
+ reSend
702
704
  ]);
703
705
  // 检查是否有任何内容需要渲染
704
706
  var hasLeftContent = typing && originalData.content !== '...' || reSend;
@@ -212,7 +212,6 @@ var genStyle = function genStyle(token, classNames) {
212
212
  }), _obj1),
213
213
  // 用户消息特定样式
214
214
  '&-bubble-user': {
215
- marginBlockStart: -20,
216
215
  '&-avatar-title-user': {
217
216
  flexDirection: 'row-reverse',
218
217
  justifyContent: 'flex-end'
@@ -42,6 +42,7 @@ var ButtonTabComponent = function ButtonTabComponent(param) {
42
42
  return wrapSSR(/*#__PURE__*/ React.createElement("button", {
43
43
  type: "button",
44
44
  className: buttonClassName,
45
+ "data-testid": prefixCls,
45
46
  onClick: handleClick,
46
47
  onKeyDown: handleKeyDown,
47
48
  tabIndex: 0
@@ -66,6 +66,7 @@ var ButtonTabGroupComponent = function ButtonTabGroupComponent(param) {
66
66
  ]);
67
67
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
68
68
  className: "".concat(prefixCls, " ").concat(className || '', " ").concat(hashId),
69
+ "data-testid": prefixCls,
69
70
  role: "group",
70
71
  "aria-label": "Tab group"
71
72
  }, items.map(function(item) {
@@ -74,6 +74,7 @@ var CaseReplyComponent = function CaseReplyComponent(param) {
74
74
  }, []);
75
75
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
76
76
  className: containerCls,
77
+ "data-testid": prefixCls,
77
78
  style: style,
78
79
  onClick: onClick,
79
80
  onMouseEnter: handleMouseEnter,
@@ -15,6 +15,7 @@ var TitleComponent = function TitleComponent(param) {
15
15
  var subtitleCls = classNames("".concat(prefixCls, "-subtitle"), hashId);
16
16
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
17
17
  className: classNames(prefixCls, hashId, className),
18
+ "data-testid": prefixCls,
18
19
  style: style
19
20
  }, title && /*#__PURE__*/ React.createElement("div", {
20
21
  className: mainCls
@@ -132,6 +132,7 @@ import { useStyle } from "./style";
132
132
  var footerBackgroundClassName = clsx("".concat(prefixCls, "-footer-background"), classNames === null || classNames === void 0 ? void 0 : classNames.footerBackground, hashId);
133
133
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
134
134
  className: rootClassName,
135
+ "data-testid": prefixCls,
135
136
  style: _object_spread({}, styles === null || styles === void 0 ? void 0 : styles.root, style)
136
137
  }, header && /*#__PURE__*/ React.createElement(LayoutHeader, header), /*#__PURE__*/ React.createElement("div", {
137
138
  className: contentClassName,
@@ -356,11 +356,11 @@ import { useStyle } from "./style";
356
356
  return _ts_generator(this, function(_state) {
357
357
  switch(_state.label){
358
358
  case 0:
359
- e.preventDefault();
360
- e.stopPropagation();
361
359
  if (!props.onClick) return [
362
360
  2
363
361
  ];
362
+ e.preventDefault();
363
+ e.stopPropagation();
364
364
  if (loading) return [
365
365
  2
366
366
  ];
@@ -413,11 +413,11 @@ import { useStyle } from "./style";
413
413
  3,
414
414
  5
415
415
  ];
416
- e.preventDefault();
417
- e.stopPropagation();
418
416
  if (!props.onClick) return [
419
417
  2
420
418
  ];
419
+ e.preventDefault();
420
+ e.stopPropagation();
421
421
  if (loading) return [
422
422
  2
423
423
  ];
@@ -482,11 +482,11 @@ import { useStyle } from "./style";
482
482
  return _ts_generator(this, function(_state) {
483
483
  switch(_state.label){
484
484
  case 0:
485
- e.preventDefault();
486
- e.stopPropagation();
487
485
  if (!props.onClick) return [
488
486
  2
489
487
  ];
488
+ e.preventDefault();
489
+ e.stopPropagation();
490
490
  if (loading) return [
491
491
  2
492
492
  ];
@@ -539,11 +539,11 @@ import { useStyle } from "./style";
539
539
  3,
540
540
  5
541
541
  ];
542
- e.preventDefault();
543
- e.stopPropagation();
544
542
  if (!props.onClick) return [
545
543
  2
546
544
  ];
545
+ e.preventDefault();
546
+ e.stopPropagation();
547
547
  if (loading) return [
548
548
  2
549
549
  ];
@@ -42,6 +42,7 @@ export var ActionItemBox = function ActionItemBox(props) {
42
42
  }, []);
43
43
  var _obj, _obj1;
44
44
  return wrapSSR(/*#__PURE__*/ React.createElement(motion.div, {
45
+ "data-testid": basePrefixCls,
45
46
  initial: "hidden",
46
47
  animate: "visible",
47
48
  style: _object_spread({
@@ -26,6 +26,7 @@ export var IconButton = function IconButton(param) {
26
26
  var _obj;
27
27
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
28
28
  className: rootCls,
29
+ "data-testid": prefixCls,
29
30
  style: style
30
31
  }, /*#__PURE__*/ React.createElement(Tooltip, {
31
32
  title: tooltip
@@ -240,6 +240,7 @@ export var SwitchButton = function SwitchButton(param) {
240
240
  };
241
241
  return wrapSSR(/*#__PURE__*/ React.createElement(Button, {
242
242
  disabled: disabled,
243
+ "data-testid": prefixCls,
243
244
  onClick: handleClick,
244
245
  className: rootCls,
245
246
  style: style,
@@ -24,6 +24,7 @@ export var ToggleButton = function ToggleButton(param) {
24
24
  var _obj;
25
25
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
26
26
  className: classNames(rootCls, (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-active"), active), _define_property(_obj, "".concat(prefixCls, "-disabled"), disabled), _obj)),
27
+ "data-testid": prefixCls,
27
28
  style: style
28
29
  }, /*#__PURE__*/ React.createElement(ConfigProvider, {
29
30
  wave: {
@@ -19,6 +19,7 @@ export function GradientText(param) {
19
19
  };
20
20
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
21
21
  className: classNames(prefixCls, hashId, className),
22
+ "data-testid": prefixCls,
22
23
  style: style
23
24
  }, /*#__PURE__*/ React.createElement("div", {
24
25
  className: classNames("".concat(prefixCls, "-text-content"), hashId),
@@ -131,7 +131,8 @@ import { useLayoutHeaderStyle } from "./style";
131
131
  onShare === null || onShare === void 0 ? void 0 : onShare();
132
132
  };
133
133
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
134
- className: classNames(prefixCls, hashId, className)
134
+ className: classNames(prefixCls, hashId, className),
135
+ "data-testid": prefixCls
135
136
  }, /*#__PURE__*/ React.createElement("div", {
136
137
  className: classNames("".concat(prefixCls, "-left"), hashId)
137
138
  }, leftCollapsible && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ActionIconBox, {
@@ -82,6 +82,7 @@ import { prefixCls, useStyle } from "./style";
82
82
  var _obj;
83
83
  var loadingElement = /*#__PURE__*/ React.createElement("div", {
84
84
  className: classNames(baseCls, hashId, className, (_obj = {}, _define_property(_obj, "".concat(baseCls, "-with-tip"), !!tip), _define_property(_obj, "".concat(baseCls, "-with-children"), isNestedPattern), _obj)),
85
+ "data-testid": baseCls,
85
86
  style: _object_spread({
86
87
  fontSize: mergedSize
87
88
  }, styles === null || styles === void 0 ? void 0 : styles.root, style)
@@ -94,6 +95,7 @@ import { prefixCls, useStyle } from "./style";
94
95
  if (isNestedPattern) {
95
96
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
96
97
  className: classNames("".concat(baseCls, "-nested-pattern"), hashId, wrapperClassName, spinning && "".concat(baseCls, "-spinning")),
98
+ "data-testid": "".concat(baseCls, "-nested-pattern"),
97
99
  style: styles === null || styles === void 0 ? void 0 : styles.wrapper
98
100
  }, spinning ? loadingElement : null, /*#__PURE__*/ React.createElement("div", {
99
101
  className: classNames("".concat(baseCls, "-container"), hashId)
@@ -72,6 +72,7 @@ export * from "./lotties/PeekLottie";
72
72
  var icon = param.icon, _param_size = param.size, size = _param_size === void 0 ? 42 : _param_size, status = param.status, className = param.className, style = param.style;
73
73
  return /*#__PURE__*/ React.createElement("div", {
74
74
  className: classNames(className),
75
+ "data-testid": "robot",
75
76
  style: /*#__PURE__*/ React.isValidElement(icon) ? _object_spread({
76
77
  display: 'flex',
77
78
  flexDirection: 'column',
@@ -260,6 +260,7 @@ export var SuggestionList = function SuggestionList(param) {
260
260
  var rootCls = classNames(prefixCls, className, hashId, "".concat(prefixCls, "-").concat(layout), "".concat(prefixCls, "-").concat(type));
261
261
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
262
262
  className: rootCls,
263
+ "data-testid": prefixCls,
263
264
  style: style,
264
265
  role: "group",
265
266
  "aria-label": (locale === null || locale === void 0 ? void 0 : locale['suggestion.area']) || '追问区域'
@@ -523,6 +523,7 @@ var TextAnimateBase = function TextAnimateBase(_0) {
523
523
  animate: startOnView ? undefined : 'show',
524
524
  exit: "exit",
525
525
  className: classNames(prefixCls, hashId, className),
526
+ "data-testid": prefixCls,
526
527
  viewport: {
527
528
  once: once
528
529
  },
@@ -229,7 +229,8 @@ var TypingAnimationBase = function TypingAnimationBase(_0) {
229
229
  };
230
230
  return wrapSSR(/*#__PURE__*/ React.createElement(MotionComponent, _object_spread({
231
231
  ref: elementRef,
232
- className: classNames(prefixCls, hashId, className)
232
+ className: classNames(prefixCls, hashId, className),
233
+ "data-testid": prefixCls
233
234
  }, props), displayedText, shouldShowCursor && /*#__PURE__*/ React.createElement("span", {
234
235
  className: classNames("".concat(prefixCls, "-cursor"), hashId, blinkCursor && "".concat(prefixCls, "-cursor-blinking"))
235
236
  }, getCursorChar())));
@@ -250,6 +250,7 @@ import { useStyle } from "./style";
250
250
  if (loading) {
251
251
  return wrapSSR(/*#__PURE__*/ React.createElement("ul", {
252
252
  className: classNames(prefixCls, "".concat(prefixCls, "-loading"), hashId, className),
253
+ "data-testid": "".concat(prefixCls, "-loading"),
253
254
  style: style
254
255
  }, loadingRender ? loadingRender() : /*#__PURE__*/ React.createElement("span", null, "加载中...")));
255
256
  }
@@ -257,11 +258,13 @@ import { useStyle } from "./style";
257
258
  if (displayList.length === 0) {
258
259
  return wrapSSR(/*#__PURE__*/ React.createElement("ul", {
259
260
  className: classNames(prefixCls, "".concat(prefixCls, "-empty"), hashId, className),
261
+ "data-testid": "".concat(prefixCls, "-empty"),
260
262
  style: style
261
263
  }, emptyRender ? emptyRender() : /*#__PURE__*/ React.createElement("span", null, "暂无数据")));
262
264
  }
263
265
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
264
266
  className: containerClassName,
267
+ "data-testid": prefixCls,
265
268
  style: style
266
269
  }, /*#__PURE__*/ React.createElement("ul", {
267
270
  className: classNames(prefixCls, hashId)
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ export interface ThreeThinkingLottieProps {
3
+ /**
4
+ * 是否自动播放动画
5
+ * @default true
6
+ */
7
+ autoplay?: boolean;
8
+ /**
9
+ * 是否循环播放动画
10
+ * @default true
11
+ */
12
+ loop?: boolean;
13
+ /**
14
+ * 动画容器类名
15
+ */
16
+ className?: string;
17
+ /**
18
+ * 动画容器样式
19
+ */
20
+ style?: React.CSSProperties;
21
+ /**
22
+ * 动画尺寸
23
+ * @default 32
24
+ */
25
+ size?: number;
26
+ /**
27
+ * 加载占位符
28
+ */
29
+ fallback?: React.ReactNode;
30
+ }
31
+ /**
32
+ * ThreeThinkingLottie 组件 - 支持按需加载的思考动画组件
33
+ *
34
+ * 该组件使用动态 import 实现 lottie JSON 文件的按需加载,
35
+ * 避免将动画数据打包进主包,减少首屏加载体积。
36
+ *
37
+ * @component
38
+ * @description 支持按需加载的 Lottie 思考动画组件
39
+ * @param {ThreeThinkingLottieProps} props - 组件属性
40
+ * @param {boolean} [props.autoplay=true] - 是否自动播放动画
41
+ * @param {boolean} [props.loop=true] - 是否循环播放动画
42
+ * @param {string} [props.className] - 动画容器类名
43
+ * @param {React.CSSProperties} [props.style] - 动画容器样式
44
+ * @param {number} [props.size=32] - 动画尺寸
45
+ * @param {React.ReactNode} [props.fallback] - 加载占位符
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * // 基础用法
50
+ * <ThreeThinkingLottie />
51
+ *
52
+ * // 自定义尺寸
53
+ * <ThreeThinkingLottie size={48} />
54
+ *
55
+ * // 自定义加载占位符
56
+ * <ThreeThinkingLottie fallback={<Spin />} />
57
+ * ```
58
+ *
59
+ * @returns {React.ReactElement} 渲染的 Lottie 思考动画组件
60
+ *
61
+ * @remarks
62
+ * - 使用动态 import 按需加载 lottie JSON 文件
63
+ * - 减少首屏加载体积
64
+ * - 支持自定义加载占位符
65
+ * - 支持自定义尺寸和样式
66
+ */
67
+ export declare const ThreeThinkingLottie: React.FC<ThreeThinkingLottieProps>;
68
+ export default ThreeThinkingLottie;