@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
@@ -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 loadingLottie from "./loading.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../useAsyncLottieData";
32
32
  /**
33
33
  * 加载动画组件
34
34
  *
@@ -67,6 +67,12 @@ import loadingLottie from "./loading.json";
67
67
  * @returns 渲染的加载动画组件
68
68
  */ export var LoadingLottie = function LoadingLottie(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("./loading.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 loadingLottie from "./loading.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: loadingLottie,
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 thinkingLottie from "./thinking.json";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../useAsyncLottieData";
32
32
  /**
33
33
  * ThinkingLottie 组件 - Lottie眨眼跑+追星星动画组件
34
34
  *
@@ -64,6 +64,12 @@ import thinkingLottie from "./thinking.json";
64
64
  * - 提供默认的加载动画
65
65
  */ export var ThinkingLottie = function ThinkingLottie(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("./thinking.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 thinkingLottie from "./thinking.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: thinkingLottie,
91
+ animationData: animationData,
79
92
  loop: loop,
80
93
  autoplay: autoplay
81
94
  });
@@ -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;
@@ -0,0 +1,103 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _object_spread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ import Lottie from "lottie-react";
30
+ import React, { useMemo } from "react";
31
+ import { useAsyncLottieData } from "../useAsyncLottieData";
32
+ /**
33
+ * ThreeThinkingLottie 组件 - 支持按需加载的思考动画组件
34
+ *
35
+ * 该组件使用动态 import 实现 lottie JSON 文件的按需加载,
36
+ * 避免将动画数据打包进主包,减少首屏加载体积。
37
+ *
38
+ * @component
39
+ * @description 支持按需加载的 Lottie 思考动画组件
40
+ * @param {ThreeThinkingLottieProps} props - 组件属性
41
+ * @param {boolean} [props.autoplay=true] - 是否自动播放动画
42
+ * @param {boolean} [props.loop=true] - 是否循环播放动画
43
+ * @param {string} [props.className] - 动画容器类名
44
+ * @param {React.CSSProperties} [props.style] - 动画容器样式
45
+ * @param {number} [props.size=32] - 动画尺寸
46
+ * @param {React.ReactNode} [props.fallback] - 加载占位符
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * // 基础用法
51
+ * <ThreeThinkingLottie />
52
+ *
53
+ * // 自定义尺寸
54
+ * <ThreeThinkingLottie size={48} />
55
+ *
56
+ * // 自定义加载占位符
57
+ * <ThreeThinkingLottie fallback={<Spin />} />
58
+ * ```
59
+ *
60
+ * @returns {React.ReactElement} 渲染的 Lottie 思考动画组件
61
+ *
62
+ * @remarks
63
+ * - 使用动态 import 按需加载 lottie JSON 文件
64
+ * - 减少首屏加载体积
65
+ * - 支持自定义加载占位符
66
+ * - 支持自定义尺寸和样式
67
+ */ export var ThreeThinkingLottie = function ThreeThinkingLottie(param) {
68
+ 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, fallback = param.fallback;
69
+ var loadJson = useMemo(function() {
70
+ return function() {
71
+ return import("./three-thinking.json");
72
+ };
73
+ }, []);
74
+ var animationData = useAsyncLottieData(loadJson);
75
+ var containerStyle = _object_spread({
76
+ width: size,
77
+ height: size,
78
+ display: 'flex',
79
+ justifyContent: 'center',
80
+ alignItems: 'center'
81
+ }, style);
82
+ // 默认占位符
83
+ var defaultFallback = /*#__PURE__*/ React.createElement("div", {
84
+ style: containerStyle,
85
+ className: className
86
+ }, /*#__PURE__*/ React.createElement("span", {
87
+ style: {
88
+ opacity: 0.3
89
+ }
90
+ }, "..."));
91
+ if (!animationData) {
92
+ return fallback !== undefined ? /*#__PURE__*/ React.createElement(React.Fragment, null, fallback) : defaultFallback;
93
+ }
94
+ return /*#__PURE__*/ React.createElement(Lottie, {
95
+ style: containerStyle,
96
+ className: className,
97
+ "aria-hidden": "true",
98
+ animationData: animationData,
99
+ loop: loop,
100
+ autoplay: autoplay
101
+ });
102
+ };
103
+ export default ThreeThinkingLottie;
@@ -0,0 +1,130 @@
1
+ {
2
+ "v": "5.7.4",
3
+ "fr": 30,
4
+ "ip": 0,
5
+ "op": 60,
6
+ "w": 32,
7
+ "h": 32,
8
+ "nm": "ThreeThinking",
9
+ "ddd": 0,
10
+ "assets": [],
11
+ "layers": [
12
+ {
13
+ "ddd": 0,
14
+ "ind": 1,
15
+ "ty": 4,
16
+ "nm": "Thinking Dot 1",
17
+ "sr": 1,
18
+ "ks": {
19
+ "o": { "a": 0, "k": 100 },
20
+ "r": { "a": 0, "k": 0 },
21
+ "p": { "a": 0, "k": [10, 16, 0] },
22
+ "a": { "a": 0, "k": [0, 0, 0] },
23
+ "s": {
24
+ "a": 1,
25
+ "k": [
26
+ { "t": 0, "s": [100, 100, 100], "e": [60, 60, 100] },
27
+ { "t": 15, "s": [60, 60, 100], "e": [100, 100, 100] },
28
+ { "t": 30, "s": [100, 100, 100] }
29
+ ]
30
+ }
31
+ },
32
+ "ao": 0,
33
+ "shapes": [
34
+ {
35
+ "ty": "el",
36
+ "d": 1,
37
+ "s": { "a": 0, "k": [6, 6] },
38
+ "p": { "a": 0, "k": [0, 0] }
39
+ },
40
+ {
41
+ "ty": "fl",
42
+ "c": { "a": 0, "k": [0.09, 0.47, 1, 1] },
43
+ "o": { "a": 0, "k": 100 }
44
+ }
45
+ ],
46
+ "ip": 0,
47
+ "op": 60,
48
+ "st": 0
49
+ },
50
+ {
51
+ "ddd": 0,
52
+ "ind": 2,
53
+ "ty": 4,
54
+ "nm": "Thinking Dot 2",
55
+ "sr": 1,
56
+ "ks": {
57
+ "o": { "a": 0, "k": 100 },
58
+ "r": { "a": 0, "k": 0 },
59
+ "p": { "a": 0, "k": [16, 16, 0] },
60
+ "a": { "a": 0, "k": [0, 0, 0] },
61
+ "s": {
62
+ "a": 1,
63
+ "k": [
64
+ { "t": 0, "s": [100, 100, 100], "e": [60, 60, 100] },
65
+ { "t": 10, "s": [60, 60, 100], "e": [100, 100, 100] },
66
+ { "t": 20, "s": [100, 100, 100], "e": [60, 60, 100] },
67
+ { "t": 30, "s": [60, 60, 100], "e": [100, 100, 100] },
68
+ { "t": 40, "s": [100, 100, 100] }
69
+ ]
70
+ }
71
+ },
72
+ "ao": 0,
73
+ "shapes": [
74
+ {
75
+ "ty": "el",
76
+ "d": 1,
77
+ "s": { "a": 0, "k": [6, 6] },
78
+ "p": { "a": 0, "k": [0, 0] }
79
+ },
80
+ {
81
+ "ty": "fl",
82
+ "c": { "a": 0, "k": [0.09, 0.47, 1, 1] },
83
+ "o": { "a": 0, "k": 100 }
84
+ }
85
+ ],
86
+ "ip": 0,
87
+ "op": 60,
88
+ "st": 0
89
+ },
90
+ {
91
+ "ddd": 0,
92
+ "ind": 3,
93
+ "ty": 4,
94
+ "nm": "Thinking Dot 3",
95
+ "sr": 1,
96
+ "ks": {
97
+ "o": { "a": 0, "k": 100 },
98
+ "r": { "a": 0, "k": 0 },
99
+ "p": { "a": 0, "k": [22, 16, 0] },
100
+ "a": { "a": 0, "k": [0, 0, 0] },
101
+ "s": {
102
+ "a": 1,
103
+ "k": [
104
+ { "t": 0, "s": [60, 60, 100], "e": [100, 100, 100] },
105
+ { "t": 15, "s": [100, 100, 100], "e": [60, 60, 100] },
106
+ { "t": 30, "s": [60, 60, 100] }
107
+ ]
108
+ }
109
+ },
110
+ "ao": 0,
111
+ "shapes": [
112
+ {
113
+ "ty": "el",
114
+ "d": 1,
115
+ "s": { "a": 0, "k": [6, 6] },
116
+ "p": { "a": 0, "k": [0, 0] }
117
+ },
118
+ {
119
+ "ty": "fl",
120
+ "c": { "a": 0, "k": [0.09, 0.47, 1, 1] },
121
+ "o": { "a": 0, "k": 100 }
122
+ }
123
+ ],
124
+ "ip": 0,
125
+ "op": 60,
126
+ "st": 0
127
+ }
128
+ ],
129
+ "markers": []
130
+ }
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import copyAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 复制操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import copyAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的复制操作动画组件
94
94
  */ export var CopyLottie = function CopyLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: copyAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default CopyLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import unlikeAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 取消点赞操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import unlikeAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的取消点赞操作动画组件
94
94
  */ export var DislikeLottie = function DislikeLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: unlikeAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default DislikeLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import likeAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 点赞操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import likeAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的点赞操作动画组件
94
94
  */ export var LikeLottie = function LikeLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: likeAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default LikeLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import moreAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 更多操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import moreAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的更多操作动画组件
94
94
  */ export var MoreLottie = function MoreLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: moreAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default MoreLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import playAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 播放操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import playAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的播放操作动画组件
94
94
  */ export var PlayLottie = function PlayLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: playAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default PlayLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import quoteAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 引用操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import quoteAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的引用操作动画组件
94
94
  */ export var QuoteLottie = function QuoteLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: quoteAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default QuoteLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import refreshAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 刷新操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import refreshAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的刷新操作动画组件
94
94
  */ export var RefreshLottie = function RefreshLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: refreshAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default RefreshLottie;
@@ -50,9 +50,9 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import React from "react";
53
+ import React, { useMemo } from "react";
54
54
  import AbstractLottie from "../Abstract";
55
- import shareAnimation from "./lottie.json";
55
+ import { useAsyncLottieData } from "../../useAsyncLottieData";
56
56
  /**
57
57
  * 分享操作动画组件
58
58
  *
@@ -92,8 +92,17 @@ import shareAnimation from "./lottie.json";
92
92
  * @param props.size - 动画尺寸(宽度和高度),默认为 '1em'
93
93
  * @returns 渲染的分享操作动画组件
94
94
  */ export var ShareLottie = function ShareLottie(props) {
95
+ var loadJson = useMemo(function() {
96
+ return function() {
97
+ return import("./lottie.json");
98
+ };
99
+ }, []);
100
+ var animationData = useAsyncLottieData(loadJson);
101
+ if (animationData === null) {
102
+ return null;
103
+ }
95
104
  return /*#__PURE__*/ React.createElement(AbstractLottie, _object_spread_props(_object_spread({}, props), {
96
- animationData: shareAnimation
105
+ animationData: animationData
97
106
  }));
98
107
  };
99
108
  export default ShareLottie;
@@ -1,6 +1,8 @@
1
1
  export * from './bubble-actions';
2
+ export * from './useAsyncLottieData';
2
3
  export * from './CreativeSparkLottie';
3
4
  export * from './DazingLottie';
4
5
  export * from './LoadingLottie';
5
6
  export * from './TextLoading';
6
7
  export * from './ThinkingLottie';
8
+ export * from './ThreeThinkingLottie';
@@ -1,6 +1,8 @@
1
1
  export * from "./bubble-actions";
2
+ export * from "./useAsyncLottieData";
2
3
  export * from "./CreativeSparkLottie";
3
4
  export * from "./DazingLottie";
4
5
  export * from "./LoadingLottie";
5
6
  export * from "./TextLoading";
6
7
  export * from "./ThinkingLottie";
8
+ export * from "./ThreeThinkingLottie";
@@ -0,0 +1,9 @@
1
+ type LottieJsonModule = {
2
+ default?: unknown;
3
+ } | unknown;
4
+ /**
5
+ * 通过动态 import 异步加载 Lottie JSON,避免与主包同步打包。
6
+ * @param load 稳定引用,例如 `useMemo(() => () => import('./x.json'), [])`
7
+ */
8
+ export declare const useAsyncLottieData: (load: () => Promise<LottieJsonModule>) => unknown | null;
9
+ export {};