@ant-design/agentic-ui 2.30.31 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) 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/List/PureBubbleList.js +2 -0
  10. package/dist/Bubble/style.js +0 -1
  11. package/dist/ChatBootPage/ButtonTab.js +1 -0
  12. package/dist/ChatBootPage/ButtonTabGroup.js +1 -0
  13. package/dist/ChatBootPage/CaseReply.js +1 -0
  14. package/dist/ChatBootPage/Title.js +1 -0
  15. package/dist/ChatLayout/index.js +1 -0
  16. package/dist/Components/ActionItemBox/ActionItemBox.js +1 -0
  17. package/dist/Components/Button/IconButton/index.js +1 -0
  18. package/dist/Components/Button/SwitchButton/index.js +1 -0
  19. package/dist/Components/Button/ToggleButton/index.js +1 -0
  20. package/dist/Components/GradientText/index.js +1 -0
  21. package/dist/Components/LayoutHeader/index.js +2 -1
  22. package/dist/Components/Loading/Loading.js +2 -0
  23. package/dist/Components/Robot/index.js +1 -0
  24. package/dist/Components/Robot/lotties/BlowingWindLottie/index.js +16 -3
  25. package/dist/Components/Robot/lotties/BouncingLottie/index.js +16 -3
  26. package/dist/Components/Robot/lotties/DazingLottie/index.js +16 -3
  27. package/dist/Components/Robot/lotties/PeekLottie/index.js +16 -3
  28. package/dist/Components/Robot/lotties/ThinkingLottie/index.js +16 -3
  29. package/dist/Components/SuggestionList/index.js +1 -0
  30. package/dist/Components/TextAnimate/index.js +1 -0
  31. package/dist/Components/TypingAnimation/index.js +2 -1
  32. package/dist/Components/VisualList/index.js +3 -0
  33. package/dist/Components/lotties/CreativeSparkLottie/index.js +16 -3
  34. package/dist/Components/lotties/DazingLottie/index.js +16 -3
  35. package/dist/Components/lotties/LoadingLottie/index.js +16 -3
  36. package/dist/Components/lotties/ThinkingLottie/index.js +16 -3
  37. package/dist/Components/lotties/ThreeThinkingLottie/index.d.ts +68 -0
  38. package/dist/Components/lotties/ThreeThinkingLottie/index.js +103 -0
  39. package/dist/Components/lotties/ThreeThinkingLottie/three-thinking.json +130 -0
  40. package/dist/Components/lotties/bubble-actions/Copy/index.js +12 -3
  41. package/dist/Components/lotties/bubble-actions/Dislike/index.js +12 -3
  42. package/dist/Components/lotties/bubble-actions/Like/index.js +12 -3
  43. package/dist/Components/lotties/bubble-actions/More/index.js +12 -3
  44. package/dist/Components/lotties/bubble-actions/Play/index.js +12 -3
  45. package/dist/Components/lotties/bubble-actions/Quote/index.js +12 -3
  46. package/dist/Components/lotties/bubble-actions/Refresh/index.js +12 -3
  47. package/dist/Components/lotties/bubble-actions/Share/index.js +12 -3
  48. package/dist/Components/lotties/index.d.ts +2 -0
  49. package/dist/Components/lotties/index.js +2 -0
  50. package/dist/Components/lotties/useAsyncLottieData.d.ts +9 -0
  51. package/dist/Components/lotties/useAsyncLottieData.js +83 -0
  52. package/dist/History/index.js +1 -0
  53. package/dist/Hooks/useLanguage.d.ts +1 -0
  54. package/dist/I18n/locales.d.ts +1 -0
  55. package/dist/I18n/locales.js +2 -0
  56. package/dist/Icons/animated/VoicePlayLottie/index.js +16 -3
  57. package/dist/Icons/animated/VoicingLottie/index.js +16 -3
  58. package/dist/MarkdownEditor/BaseMarkdownEditor.js +2 -0
  59. package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +10 -10
  60. package/dist/MarkdownInputField/BorderBeamAnimation.d.ts +1 -1
  61. package/dist/MarkdownInputField/BorderBeamAnimation.js +6 -3
  62. package/dist/MarkdownRenderer/MarkdownRenderer.js +1 -0
  63. package/dist/Plugins/chart/AreaChart/index.js +10 -8
  64. package/dist/Plugins/chart/BarChart/index.js +10 -8
  65. package/dist/Plugins/chart/BoxPlotChart/index.d.ts +1 -1
  66. package/dist/Plugins/chart/BoxPlotChart/index.js +11 -8
  67. package/dist/Plugins/chart/DonutChart/index.js +14 -12
  68. package/dist/Plugins/chart/FunnelChart/index.js +10 -8
  69. package/dist/Plugins/chart/HistogramChart/index.d.ts +1 -1
  70. package/dist/Plugins/chart/HistogramChart/index.js +11 -8
  71. package/dist/Plugins/chart/LineChart/index.js +10 -8
  72. package/dist/Plugins/chart/RadarChart/index.js +14 -12
  73. package/dist/Plugins/chart/ScatterChart/index.js +14 -12
  74. package/dist/Plugins/chart/components/ChartContainer/ChartContainer.d.ts +13 -3
  75. package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +21 -4
  76. package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +2 -0
  77. package/dist/Plugins/chart/hooks/index.d.ts +2 -0
  78. package/dist/Plugins/chart/hooks/index.js +1 -0
  79. package/dist/Plugins/chart/hooks/useChartTheme.d.ts +1 -1
  80. package/dist/Plugins/chart/hooks/useChartTheme.js +1 -1
  81. package/dist/Plugins/chart/hooks/useDetectTheme.d.ts +45 -0
  82. package/dist/Plugins/chart/hooks/useDetectTheme.js +249 -0
  83. package/dist/Schema/SchemaEditor/index.js +1 -0
  84. package/dist/Schema/SchemaForm/index.js +1 -0
  85. package/dist/TaskList/TaskList.js +21 -4
  86. package/dist/TaskList/components/TaskListItem.js +2 -1
  87. package/dist/TaskList/style.js +1 -1
  88. package/dist/ThoughtChainList/index.js +1 -0
  89. package/dist/ThoughtChainList/style.js +14 -3
  90. package/dist/ToolUseBar/index.js +7 -6
  91. package/dist/ToolUseBarThink/style.js +0 -7
  92. package/dist/WelcomeMessage/index.js +1 -0
  93. package/dist/Workspace/File/FileComponent.js +15 -9
  94. package/dist/Workspace/File/FileTree/FileTreeComponent.js +6 -1
  95. package/dist/Workspace/File/PreviewComponent.js +23 -6
  96. package/package.json +3 -3
@@ -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
@@ -203,6 +203,7 @@ export var PureBubbleList = /*#__PURE__*/ React.memo(function(props) {
203
203
  if (isLoading) {
204
204
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
205
205
  className: clsx(prefixClass, "".concat(prefixClass, "-loading"), className, hashId),
206
+ "data-testid": prefixClass,
206
207
  ref: bubbleListRef,
207
208
  style: {
208
209
  padding: 24
@@ -213,6 +214,7 @@ export var PureBubbleList = /*#__PURE__*/ React.memo(function(props) {
213
214
  return wrapSSR(/*#__PURE__*/ React.createElement("div", {
214
215
  className: clsx("".concat(prefixClass), className, hashId, (_obj = {}, _define_property(_obj, "".concat(prefixClass, "-readonly"), props.readonly), _define_property(_obj, "".concat(prefixClass, "-compact"), compact), _obj)),
215
216
  "data-chat-list": bubbleList.length,
217
+ "data-testid": prefixClass,
216
218
  style: style,
217
219
  ref: bubbleListRef,
218
220
  onScroll: onScroll,
@@ -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,
@@ -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',
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import lottieData from "./lottie.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../../../lotties/useAsyncLottieData";
32
32
  /**
33
33
  * BlowingWindLottie 组件 - Lottie清风拂面动画组件
34
34
  *
@@ -63,6 +63,12 @@ import lottieData from "./lottie.json";
63
63
  * - 支持自定义样式
64
64
  */ export var BlowingWindLottie = function BlowingWindLottie(param) {
65
65
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size;
66
+ var loadJson = useMemo(function() {
67
+ return function() {
68
+ return import("./lottie.json");
69
+ };
70
+ }, []);
71
+ var animationData = useAsyncLottieData(loadJson);
66
72
  var containerStyle = _object_spread({
67
73
  width: size,
68
74
  height: size,
@@ -70,11 +76,18 @@ import lottieData from "./lottie.json";
70
76
  justifyContent: 'center',
71
77
  alignItems: 'center'
72
78
  }, style);
79
+ if (animationData === null) {
80
+ return /*#__PURE__*/ React.createElement("div", {
81
+ style: containerStyle,
82
+ className: className,
83
+ "aria-hidden": true
84
+ });
85
+ }
73
86
  return /*#__PURE__*/ React.createElement(Lottie, {
74
87
  style: containerStyle,
75
88
  className: className,
76
89
  "aria-hidden": "true",
77
- animationData: lottieData,
90
+ animationData: animationData,
78
91
  loop: loop,
79
92
  autoplay: autoplay
80
93
  });
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import lottieData from "./lottie.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../../../lotties/useAsyncLottieData";
32
32
  /**
33
33
  * BouncingLottie 组件 - Lottie弹跳动画组件
34
34
  *
@@ -63,6 +63,12 @@ import lottieData from "./lottie.json";
63
63
  * - 支持自定义样式
64
64
  */ export var BouncingLottie = function BouncingLottie(param) {
65
65
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size;
66
+ var loadJson = useMemo(function() {
67
+ return function() {
68
+ return import("./lottie.json");
69
+ };
70
+ }, []);
71
+ var animationData = useAsyncLottieData(loadJson);
66
72
  var containerStyle = _object_spread({
67
73
  width: size,
68
74
  height: size,
@@ -70,11 +76,18 @@ import lottieData from "./lottie.json";
70
76
  justifyContent: 'center',
71
77
  alignItems: 'center'
72
78
  }, style);
79
+ if (animationData === null) {
80
+ return /*#__PURE__*/ React.createElement("div", {
81
+ style: containerStyle,
82
+ className: className,
83
+ "aria-hidden": true
84
+ });
85
+ }
73
86
  return /*#__PURE__*/ React.createElement(Lottie, {
74
87
  style: containerStyle,
75
88
  className: className,
76
89
  "aria-hidden": "true",
77
- animationData: lottieData,
90
+ animationData: animationData,
78
91
  loop: loop,
79
92
  autoplay: autoplay
80
93
  });
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import dazingLottie from "./dazing.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../../../lotties/useAsyncLottieData";
32
32
  /**
33
33
  * DazingLottie 组件 - Lottie呼吸+眨眼睛动画组件
34
34
  *
@@ -63,6 +63,12 @@ import dazingLottie from "./dazing.json";
63
63
  * - 支持自定义样式
64
64
  */ export var DazingLottie = function DazingLottie(param) {
65
65
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size;
66
+ var loadJson = useMemo(function() {
67
+ return function() {
68
+ return import("./dazing.json");
69
+ };
70
+ }, []);
71
+ var animationData = useAsyncLottieData(loadJson);
66
72
  var containerStyle = _object_spread({
67
73
  width: size,
68
74
  height: size,
@@ -70,11 +76,18 @@ import dazingLottie from "./dazing.json";
70
76
  justifyContent: 'center',
71
77
  alignItems: 'center'
72
78
  }, style);
79
+ if (animationData === null) {
80
+ return /*#__PURE__*/ React.createElement("div", {
81
+ style: containerStyle,
82
+ className: className,
83
+ "aria-hidden": true
84
+ });
85
+ }
73
86
  return /*#__PURE__*/ React.createElement(Lottie, {
74
87
  style: containerStyle,
75
88
  className: className,
76
89
  "aria-hidden": "true",
77
- animationData: dazingLottie,
90
+ animationData: animationData,
78
91
  loop: loop,
79
92
  autoplay: autoplay
80
93
  });
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import lottieData from "./lottie.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../../../lotties/useAsyncLottieData";
32
32
  /**
33
33
  * PeekLottie 组件 - Lottie探头动画组件
34
34
  *
@@ -63,6 +63,12 @@ import lottieData from "./lottie.json";
63
63
  * - 支持自定义样式
64
64
  */ export var PeekLottie = function PeekLottie(param) {
65
65
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size;
66
+ var loadJson = useMemo(function() {
67
+ return function() {
68
+ return import("./lottie.json");
69
+ };
70
+ }, []);
71
+ var animationData = useAsyncLottieData(loadJson);
66
72
  var containerStyle = _object_spread({
67
73
  width: size,
68
74
  height: size,
@@ -70,11 +76,18 @@ import lottieData from "./lottie.json";
70
76
  justifyContent: 'center',
71
77
  alignItems: 'center'
72
78
  }, style);
79
+ if (animationData === null) {
80
+ return /*#__PURE__*/ React.createElement("div", {
81
+ style: containerStyle,
82
+ className: className,
83
+ "aria-hidden": true
84
+ });
85
+ }
73
86
  return /*#__PURE__*/ React.createElement(Lottie, {
74
87
  style: containerStyle,
75
88
  className: className,
76
89
  "aria-hidden": "true",
77
- animationData: lottieData,
90
+ animationData: animationData,
78
91
  loop: loop,
79
92
  autoplay: autoplay
80
93
  });
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import thinkingLottie from "./thinking.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../../../lotties/useAsyncLottieData";
32
32
  /**
33
33
  * ThinkingLottie 组件 - Lottie眨眼跑+追星星动画组件
34
34
  *
@@ -63,6 +63,12 @@ import thinkingLottie from "./thinking.json";
63
63
  * - 支持自定义样式
64
64
  */ export var ThinkingLottie = function ThinkingLottie(param) {
65
65
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size;
66
+ var loadJson = useMemo(function() {
67
+ return function() {
68
+ return import("./thinking.json");
69
+ };
70
+ }, []);
71
+ var animationData = useAsyncLottieData(loadJson);
66
72
  var containerStyle = _object_spread({
67
73
  width: size,
68
74
  height: size,
@@ -70,11 +76,18 @@ import thinkingLottie from "./thinking.json";
70
76
  justifyContent: 'center',
71
77
  alignItems: 'center'
72
78
  }, style);
79
+ if (animationData === null) {
80
+ return /*#__PURE__*/ React.createElement("div", {
81
+ style: containerStyle,
82
+ className: className,
83
+ "aria-hidden": true
84
+ });
85
+ }
73
86
  return /*#__PURE__*/ React.createElement(Lottie, {
74
87
  style: containerStyle,
75
88
  className: className,
76
89
  "aria-hidden": "true",
77
- animationData: thinkingLottie,
90
+ animationData: animationData,
78
91
  loop: loop,
79
92
  autoplay: autoplay
80
93
  });
@@ -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)
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import creativeSpark from "./creativeSpark.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../useAsyncLottieData";
32
32
  /**
33
33
  * 创意生成中火花组件
34
34
  *
@@ -67,6 +67,12 @@ import creativeSpark from "./creativeSpark.json";
67
67
  * @returns 渲染的创意生成中火花组件
68
68
  */ export var CreativeSparkLottie = function CreativeSparkLottie(param) {
69
69
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, size = param.size;
70
+ var loadJson = useMemo(function() {
71
+ return function() {
72
+ return import("./creativeSpark.json");
73
+ };
74
+ }, []);
75
+ var animationData = useAsyncLottieData(loadJson);
70
76
  var containerStyle = _object_spread({
71
77
  width: size,
72
78
  height: size,
@@ -74,12 +80,19 @@ import creativeSpark from "./creativeSpark.json";
74
80
  justifyContent: 'center',
75
81
  alignItems: 'center'
76
82
  }, style);
83
+ if (animationData === null) {
84
+ return /*#__PURE__*/ React.createElement("div", {
85
+ style: containerStyle,
86
+ className: className,
87
+ "aria-hidden": true
88
+ });
89
+ }
77
90
  return /*#__PURE__*/ React.createElement(Lottie, {
78
91
  style: containerStyle,
79
92
  className: className,
80
93
  "data-testid": "lottie-animation",
81
94
  "aria-hidden": "true",
82
- animationData: creativeSpark,
95
+ animationData: animationData,
83
96
  loop: loop,
84
97
  autoplay: autoplay
85
98
  });
@@ -27,8 +27,8 @@ function _object_spread(target) {
27
27
  return target;
28
28
  }
29
29
  import Lottie from "lottie-react";
30
- import React from "react";
31
- import dazingLottie from "./dazing.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../useAsyncLottieData";
32
32
  /**
33
33
  * DazingLottie 组件 - Lottie呼吸+眨眼睛动画组件
34
34
  *
@@ -64,6 +64,12 @@ import dazingLottie from "./dazing.json";
64
64
  * - 提供默认的加载动画
65
65
  */ export var DazingLottie = function DazingLottie(param) {
66
66
  var _param_autoplay = param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_loop = param.loop, loop = _param_loop === void 0 ? true : _param_loop, className = param.className, style = param.style, size = param.size;
67
+ var loadJson = useMemo(function() {
68
+ return function() {
69
+ return import("./dazing.json");
70
+ };
71
+ }, []);
72
+ var animationData = useAsyncLottieData(loadJson);
67
73
  var containerStyle = _object_spread({
68
74
  width: size,
69
75
  height: size,
@@ -71,11 +77,18 @@ import dazingLottie from "./dazing.json";
71
77
  justifyContent: 'center',
72
78
  alignItems: 'center'
73
79
  }, style);
80
+ if (animationData === null) {
81
+ return /*#__PURE__*/ React.createElement("div", {
82
+ style: containerStyle,
83
+ className: className,
84
+ "aria-hidden": true
85
+ });
86
+ }
74
87
  return /*#__PURE__*/ React.createElement(Lottie, {
75
88
  style: containerStyle,
76
89
  className: className,
77
90
  "aria-hidden": "true",
78
- animationData: dazingLottie,
91
+ animationData: animationData,
79
92
  loop: loop,
80
93
  autoplay: autoplay
81
94
  });