@ant-design/agentic-ui 2.24.5 → 2.26.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 (37) hide show
  1. package/dist/Components/Loading/CreativeRecommendationLoading.d.ts +26 -0
  2. package/dist/Components/Loading/CreativeRecommendationLoading.js +77 -0
  3. package/dist/Components/Loading/CreativeSparkLoading.d.ts +27 -0
  4. package/dist/Components/Loading/CreativeSparkLoading.js +78 -0
  5. package/dist/Components/Loading/Loading.d.ts +26 -0
  6. package/dist/Components/Loading/Loading.js +57 -0
  7. package/dist/Components/Loading/index.d.ts +3 -26
  8. package/dist/Components/Loading/index.js +3 -57
  9. package/dist/Components/Robot/index.d.ts +0 -1
  10. package/dist/Components/Robot/index.js +0 -1
  11. package/dist/Components/effects/CreativeRecommendationEffect/creativeRecommendation.json +580 -0
  12. package/dist/Components/effects/CreativeRecommendationEffect/index.d.ts +41 -0
  13. package/dist/Components/effects/CreativeRecommendationEffect/index.js +52 -0
  14. package/dist/Components/effects/EffectPlayer.d.ts +28 -0
  15. package/dist/Components/effects/EffectPlayer.js +222 -0
  16. package/dist/Components/effects/LoadingEffect/index.d.ts +41 -0
  17. package/dist/Components/effects/LoadingEffect/index.js +51 -0
  18. package/dist/Components/effects/LoadingEffect/loading.json +922 -0
  19. package/dist/Components/effects/index.d.ts +3 -0
  20. package/dist/Components/effects/index.js +3 -0
  21. package/dist/Components/lotties/CreativeSparkLottie/creativeSpark.json +5576 -0
  22. package/dist/Components/lotties/CreativeSparkLottie/index.d.ts +65 -0
  23. package/dist/Components/lotties/CreativeSparkLottie/index.js +87 -0
  24. package/dist/Components/lotties/LoadingLottie/loading.json +4024 -1977
  25. package/dist/Components/lotties/index.d.ts +4 -0
  26. package/dist/Components/lotties/index.js +4 -0
  27. package/dist/MarkdownEditor/editor/Editor.js +2 -1
  28. package/dist/MarkdownEditor/editor/elements/index.d.ts +1 -0
  29. package/dist/MarkdownEditor/editor/elements/index.js +12 -2
  30. package/dist/MarkdownEditor/editor/store.js +6 -3
  31. package/dist/MarkdownEditor/editor/utils/docx/docxDeserializer.js +2 -2
  32. package/dist/MarkdownEditor/types.d.ts +6 -0
  33. package/dist/Workspace/File/FileComponent.js +3 -2
  34. package/dist/Workspace/Task/index.d.ts +3 -1
  35. package/dist/Workspace/Task/index.js +4 -3
  36. package/dist/Workspace/Task/style.js +2 -1
  37. package/package.json +2 -1
@@ -0,0 +1,222 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_with_holes(arr) {
7
+ if (Array.isArray(arr)) return arr;
8
+ }
9
+ function _define_property(obj, key, value) {
10
+ if (key in obj) {
11
+ Object.defineProperty(obj, key, {
12
+ value: value,
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true
16
+ });
17
+ } else {
18
+ obj[key] = value;
19
+ }
20
+ return obj;
21
+ }
22
+ function _iterable_to_array_limit(arr, i) {
23
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
24
+ if (_i == null) return;
25
+ var _arr = [];
26
+ var _n = true;
27
+ var _d = false;
28
+ var _s, _e;
29
+ try {
30
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
31
+ _arr.push(_s.value);
32
+ if (i && _arr.length === i) break;
33
+ }
34
+ } catch (err) {
35
+ _d = true;
36
+ _e = err;
37
+ } finally{
38
+ try {
39
+ if (!_n && _i["return"] != null) _i["return"]();
40
+ } finally{
41
+ if (_d) throw _e;
42
+ }
43
+ }
44
+ return _arr;
45
+ }
46
+ function _non_iterable_rest() {
47
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
48
+ }
49
+ function _object_spread(target) {
50
+ for(var i = 1; i < arguments.length; i++){
51
+ var source = arguments[i] != null ? arguments[i] : {};
52
+ var ownKeys = Object.keys(source);
53
+ if (typeof Object.getOwnPropertySymbols === "function") {
54
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
55
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
56
+ }));
57
+ }
58
+ ownKeys.forEach(function(key) {
59
+ _define_property(target, key, source[key]);
60
+ });
61
+ }
62
+ return target;
63
+ }
64
+ function ownKeys(object, enumerableOnly) {
65
+ var keys = Object.keys(object);
66
+ if (Object.getOwnPropertySymbols) {
67
+ var symbols = Object.getOwnPropertySymbols(object);
68
+ if (enumerableOnly) {
69
+ symbols = symbols.filter(function(sym) {
70
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
71
+ });
72
+ }
73
+ keys.push.apply(keys, symbols);
74
+ }
75
+ return keys;
76
+ }
77
+ function _object_spread_props(target, source) {
78
+ source = source != null ? source : {};
79
+ if (Object.getOwnPropertyDescriptors) {
80
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
81
+ } else {
82
+ ownKeys(Object(source)).forEach(function(key) {
83
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
84
+ });
85
+ }
86
+ return target;
87
+ }
88
+ function _object_without_properties(source, excluded) {
89
+ if (source == null) return {};
90
+ var target = _object_without_properties_loose(source, excluded);
91
+ var key, i;
92
+ if (Object.getOwnPropertySymbols) {
93
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
94
+ for(i = 0; i < sourceSymbolKeys.length; i++){
95
+ key = sourceSymbolKeys[i];
96
+ if (excluded.indexOf(key) >= 0) continue;
97
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
98
+ target[key] = source[key];
99
+ }
100
+ }
101
+ return target;
102
+ }
103
+ function _object_without_properties_loose(source, excluded) {
104
+ if (source == null) return {};
105
+ var target = {};
106
+ var sourceKeys = Object.keys(source);
107
+ var key, i;
108
+ for(i = 0; i < sourceKeys.length; i++){
109
+ key = sourceKeys[i];
110
+ if (excluded.indexOf(key) >= 0) continue;
111
+ target[key] = source[key];
112
+ }
113
+ return target;
114
+ }
115
+ function _sliced_to_array(arr, i) {
116
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
117
+ }
118
+ function _unsupported_iterable_to_array(o, minLen) {
119
+ if (!o) return;
120
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
121
+ var n = Object.prototype.toString.call(o).slice(8, -1);
122
+ if (n === "Object" && o.constructor) n = o.constructor.name;
123
+ if (n === "Map" || n === "Set") return Array.from(n);
124
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
125
+ }
126
+ import { Player } from "@galacean/effects";
127
+ import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
128
+ import { useLatest } from "react-use";
129
+ function EffectPlayer(_param) {
130
+ var sceneUrl = _param.sceneUrl, downgradeImage = _param.downgradeImage, _param_autoplay = _param.autoplay, autoplay = _param_autoplay === void 0 ? true : _param_autoplay, _param_size = _param.// TODO: 添加禁止循环播放功能
131
+ // loop = true,
132
+ size, size = _param_size === void 0 ? '1em' : _param_size, style = _param.style, attrs = _object_without_properties(_param, [
133
+ "sceneUrl",
134
+ "downgradeImage",
135
+ "autoplay",
136
+ "size",
137
+ "style"
138
+ ]);
139
+ var containerStyle = _object_spread({
140
+ position: 'relative',
141
+ width: size,
142
+ height: size,
143
+ display: 'flex',
144
+ justifyContent: 'center',
145
+ alignItems: 'center'
146
+ }, style);
147
+ var containerRef = useRef(null);
148
+ var playerRef = useRef(null);
149
+ // ==================== Downgrade Image ====================
150
+ var downgradeImageRef = useLatest(downgradeImage);
151
+ var _useState = _sliced_to_array(useState(), 2), fallbackImage = _useState[0], setFallbackImage = _useState[1];
152
+ var onError = useCallback(function() {
153
+ setFallbackImage(downgradeImageRef.current);
154
+ }, [
155
+ downgradeImageRef
156
+ ]);
157
+ // ==================== Create Player ====================
158
+ useLayoutEffect(function() {
159
+ // create player
160
+ var container = containerRef.current;
161
+ if (container) {
162
+ playerRef.current = new Player({
163
+ container: container,
164
+ onError: onError
165
+ });
166
+ playerRef.current.loadScene(sceneUrl, {
167
+ autoplay: autoplay
168
+ });
169
+ }
170
+ // dispose player
171
+ return function() {
172
+ if (playerRef.current) {
173
+ playerRef.current.dispose();
174
+ playerRef.current = null;
175
+ }
176
+ };
177
+ }, []);
178
+ // ==================== State Effects ====================
179
+ useEffect(function() {
180
+ if (playerRef.current) {
181
+ setFallbackImage(undefined);
182
+ playerRef.current.loadScene(sceneUrl, {
183
+ autoplay: autoplay
184
+ });
185
+ }
186
+ }, [
187
+ sceneUrl
188
+ ]);
189
+ useEffect(function() {
190
+ if (playerRef.current) {
191
+ if (autoplay) {
192
+ playerRef.current.resume();
193
+ } else {
194
+ playerRef.current.pause();
195
+ }
196
+ }
197
+ }, [
198
+ autoplay
199
+ ]);
200
+ useEffect(function() {
201
+ if (playerRef.current) {
202
+ playerRef.current.resize();
203
+ }
204
+ }, [
205
+ size
206
+ ]);
207
+ return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({}, attrs), {
208
+ ref: containerRef,
209
+ style: containerStyle
210
+ }), fallbackImage && /*#__PURE__*/ React.createElement("img", {
211
+ src: fallbackImage,
212
+ alt: "fallback",
213
+ style: {
214
+ position: 'absolute',
215
+ top: 0,
216
+ left: 0,
217
+ width: '100%',
218
+ height: '100%'
219
+ }
220
+ }));
221
+ }
222
+ export default EffectPlayer;
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { EffectPlayerProps } from '../EffectPlayer';
3
+ /**
4
+ * 加载动画组件
5
+ *
6
+ * 使用 Lottie 动画展示加载动画的组件,支持自定义尺寸、样式和播放行为。
7
+ *
8
+ * @component
9
+ * @example
10
+ * // 基础用法
11
+ * <LoadingEffect />
12
+ *
13
+ * @example
14
+ * // 自定义尺寸
15
+ * <LoadingEffect size={64} />
16
+ *
17
+ * @example
18
+ * // 自定义样式
19
+ * <LoadingEffect
20
+ * size={80}
21
+ * style={{ margin: '20px' }}
22
+ * className="custom-loading"
23
+ * />
24
+ *
25
+ * @example
26
+ * // 控制播放行为
27
+ * <LoadingEffect
28
+ * autoplay={false}
29
+ * loop={false}
30
+ * />
31
+ *
32
+ * @param props - 组件属性
33
+ * @param props.autoplay - 是否自动播放动画,默认为 true
34
+ * @param props.loop - 是否循环播放动画,默认为 true
35
+ * @param props.className - 动画容器类名
36
+ * @param props.style - 动画容器自定义样式
37
+ * @param props.size - 动画尺寸(宽度和高度)
38
+ * @returns 渲染的加载动画组件
39
+ */
40
+ export declare const LoadingEffect: React.FC<Omit<EffectPlayerProps, 'sceneUrl'>>;
41
+ export default LoadingEffect;
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import EffectPlayer from "../EffectPlayer";
3
+ import loadingEffect from "./loading.json";
4
+ /**
5
+ * 加载动画组件
6
+ *
7
+ * 使用 Lottie 动画展示加载动画的组件,支持自定义尺寸、样式和播放行为。
8
+ *
9
+ * @component
10
+ * @example
11
+ * // 基础用法
12
+ * <LoadingEffect />
13
+ *
14
+ * @example
15
+ * // 自定义尺寸
16
+ * <LoadingEffect size={64} />
17
+ *
18
+ * @example
19
+ * // 自定义样式
20
+ * <LoadingEffect
21
+ * size={80}
22
+ * style={{ margin: '20px' }}
23
+ * className="custom-loading"
24
+ * />
25
+ *
26
+ * @example
27
+ * // 控制播放行为
28
+ * <LoadingEffect
29
+ * autoplay={false}
30
+ * loop={false}
31
+ * />
32
+ *
33
+ * @param props - 组件属性
34
+ * @param props.autoplay - 是否自动播放动画,默认为 true
35
+ * @param props.loop - 是否循环播放动画,默认为 true
36
+ * @param props.className - 动画容器类名
37
+ * @param props.style - 动画容器自定义样式
38
+ * @param props.size - 动画尺寸(宽度和高度)
39
+ * @returns 渲染的加载动画组件
40
+ */ export var LoadingEffect = function(param) {
41
+ 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;
42
+ return /*#__PURE__*/ React.createElement(EffectPlayer, {
43
+ sceneUrl: loadingEffect,
44
+ size: size,
45
+ style: style,
46
+ autoplay: autoplay,
47
+ loop: loop,
48
+ className: className
49
+ });
50
+ };
51
+ export default LoadingEffect;