@ant-design/agentic-ui 2.29.17 → 2.29.19

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.
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ export interface FooterBackgroundProps {
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ }
6
+ /**
7
+ * FooterBackgroundLottie 组件 - Lottie底部背景动画组件
8
+ *
9
+ * 该组件使用Lottie动画库提供流畅的底部背景动画效果,支持播放控制等。
10
+ *
11
+ * @component
12
+ * @description FooterBackground 组件 - 底部背景组件,提供流畅的底部背景动画效果
13
+ * @param {FooterBackgroundProps} props - 组件属性
14
+ * @param {string} [props.className] - 背景容器类名
15
+ * @param {React.CSSProperties} [props.style] - 背景容器样式
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <FooterBackground
20
+ * className="custom-footer-background"
21
+ * />
22
+ * ```
23
+ *
24
+ * @returns {React.ReactElement} 渲染的底部背景组件
25
+ *
26
+ * @remarks
27
+ * - 使用背景图片
28
+ * - 提供流畅的背景效果
29
+ * - 支持自定义样式
30
+ */
31
+ export declare const FooterBackground: React.FC<FooterBackgroundProps>;
32
+ export default FooterBackground;
@@ -0,0 +1,89 @@
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
+ function ownKeys(object, enumerableOnly) {
30
+ var keys = Object.keys(object);
31
+ if (Object.getOwnPropertySymbols) {
32
+ var symbols = Object.getOwnPropertySymbols(object);
33
+ if (enumerableOnly) {
34
+ symbols = symbols.filter(function(sym) {
35
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
36
+ });
37
+ }
38
+ keys.push.apply(keys, symbols);
39
+ }
40
+ return keys;
41
+ }
42
+ function _object_spread_props(target, source) {
43
+ source = source != null ? source : {};
44
+ if (Object.getOwnPropertyDescriptors) {
45
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
46
+ } else {
47
+ ownKeys(Object(source)).forEach(function(key) {
48
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
49
+ });
50
+ }
51
+ return target;
52
+ }
53
+ import React from "react";
54
+ import bg from "./images/bg.png";
55
+ /**
56
+ * FooterBackgroundLottie 组件 - Lottie底部背景动画组件
57
+ *
58
+ * 该组件使用Lottie动画库提供流畅的底部背景动画效果,支持播放控制等。
59
+ *
60
+ * @component
61
+ * @description FooterBackground 组件 - 底部背景组件,提供流畅的底部背景动画效果
62
+ * @param {FooterBackgroundProps} props - 组件属性
63
+ * @param {string} [props.className] - 背景容器类名
64
+ * @param {React.CSSProperties} [props.style] - 背景容器样式
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * <FooterBackground
69
+ * className="custom-footer-background"
70
+ * />
71
+ * ```
72
+ *
73
+ * @returns {React.ReactElement} 渲染的底部背景组件
74
+ *
75
+ * @remarks
76
+ * - 使用背景图片
77
+ * - 提供流畅的背景效果
78
+ * - 支持自定义样式
79
+ */ export var FooterBackground = function(param) {
80
+ var className = param.className, style = param.style;
81
+ return /*#__PURE__*/ React.createElement("div", {
82
+ className: className,
83
+ style: _object_spread_props(_object_spread({}, style), {
84
+ backgroundImage: "url(".concat(bg, ")")
85
+ }),
86
+ "aria-hidden": "true"
87
+ });
88
+ };
89
+ export default FooterBackground;
@@ -32,7 +32,7 @@ import React, { forwardRef, memo, useContext, useImperativeHandle, useRef } from
32
32
  import { LayoutHeader } from "../Components/LayoutHeader";
33
33
  import useAutoScroll from "../Hooks/useAutoScroll";
34
34
  import { useElementSize } from "../Hooks/useElementSize";
35
- import FooterBackgroundLottie from "./components/FooterBackgroundLottie";
35
+ import FooterBackground from "./components/FooterBackground";
36
36
  import { useStyle } from "./style";
37
37
  /**
38
38
  * ChatLayout 组件 - 聊天布局组件
@@ -138,15 +138,15 @@ import { useStyle } from "./style";
138
138
  width: '100%'
139
139
  },
140
140
  "aria-hidden": "true"
141
- }))), footer && /*#__PURE__*/ React.createElement("div", {
141
+ }))), showFooterBackground && /*#__PURE__*/ React.createElement(FooterBackground, {
142
+ className: footerBackgroundClassName
143
+ }), footer && /*#__PURE__*/ React.createElement("div", {
142
144
  ref: footerRef,
143
145
  className: footerClassName,
144
146
  style: _object_spread({
145
147
  minHeight: footerHeight
146
148
  }, styles === null || styles === void 0 ? void 0 : styles.footer)
147
- }, showFooterBackground && /*#__PURE__*/ React.createElement(FooterBackgroundLottie, {
148
- className: footerBackgroundClassName
149
- }), footer)));
149
+ }, footer)));
150
150
  });
151
151
  ChatLayoutComponent.displayName = 'ChatLayout';
152
152
  // 使用 React.memo 优化性能,避免不必要的重新渲染
@@ -156,13 +156,14 @@ var genStyle = function(token) {
156
156
  }
157
157
  },
158
158
  '&-content': {
159
+ position: 'relative',
160
+ zIndex: 1,
159
161
  width: '100%',
160
162
  paddingBottom: 'var(--radius-xl)',
161
163
  flex: 1,
162
164
  overflow: 'hidden',
163
165
  display: 'flex',
164
166
  flexDirection: 'column',
165
- position: 'relative',
166
167
  '&-scrollable': {
167
168
  flex: 1,
168
169
  overflowY: 'auto',
@@ -194,7 +195,6 @@ var genStyle = function(token) {
194
195
  flexDirection: 'column',
195
196
  alignItems: 'center',
196
197
  justifyContent: 'center',
197
- background: 'linear-gradient(to bottom, #fff0 20%, var(--color-gray-bg-card-white) 70%)',
198
198
  width: '100%',
199
199
  paddingTop: 8,
200
200
  paddingBottom: 24,
@@ -207,11 +207,13 @@ var genStyle = function(token) {
207
207
  },
208
208
  '&-footer-background': {
209
209
  position: 'absolute',
210
- top: 0,
211
210
  left: 0,
212
211
  right: 0,
213
212
  bottom: 0,
214
- pointerEvents: 'none'
213
+ width: '100%',
214
+ height: 146,
215
+ pointerEvents: 'none',
216
+ overflow: 'hidden'
215
217
  }
216
218
  }, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
217
219
  '&-header': {
@@ -764,7 +764,7 @@ var defaultAllowedTypes = [
764
764
  * 实际的粘贴处理逻辑
765
765
  */ var handlePasteEvent = function(event) {
766
766
  return _async_to_generator(function() {
767
- var _props_onPaste, _event_clipboardData, pasteConfig, currentTextSelection, nodeList, curNode, types, allowedTypes, _event_clipboardData_getData, _event_clipboardData_getData1, _event_clipboardData1, text, _event_clipboardData_getData2, _event_clipboardData_getData3, _event_clipboardData2, text1, selection, e;
767
+ var _props_onPaste, _event_clipboardData, pasteConfig, currentTextSelection, nodeList, curNode, result, types, allowedTypes, result1, _event_clipboardData_getData, _event_clipboardData_getData1, _event_clipboardData1, text, _event_clipboardData_getData2, _event_clipboardData_getData3, _event_clipboardData2, text1, selection, e;
768
768
  return _ts_generator(this, function(_state) {
769
769
  switch(_state.label){
770
770
  case 0:
@@ -793,7 +793,12 @@ var defaultAllowedTypes = [
793
793
  ];
794
794
  }
795
795
  }
796
- (_props_onPaste = props.onPaste) === null || _props_onPaste === void 0 ? void 0 : _props_onPaste.call(props, event);
796
+ result = (_props_onPaste = props.onPaste) === null || _props_onPaste === void 0 ? void 0 : _props_onPaste.call(props, event);
797
+ if (result === false) {
798
+ return [
799
+ 2
800
+ ];
801
+ }
797
802
  types = ((_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.types) || [
798
803
  'text/plain'
799
804
  ];
@@ -816,7 +821,8 @@ var defaultAllowedTypes = [
816
821
  handleHtmlPaste(markdownEditorRef.current, event.clipboardData, props)
817
822
  ];
818
823
  case 1:
819
- if (_state.sent()) {
824
+ result1 = _state.sent();
825
+ if (result1 === false) {
820
826
  return [
821
827
  2
822
828
  ];
@@ -1064,14 +1070,11 @@ var defaultAllowedTypes = [
1064
1070
  }), defaultDom);
1065
1071
  });
1066
1072
  var decorateFn = function(e) {
1067
- var _props_comment_commentList, _props_comment, _props_comment1;
1068
- // 只读且无评论时,跳过 decorate(useHighlight + comment)以提升性能
1069
- if (readonly && !(props === null || props === void 0 ? void 0 : (_props_comment = props.comment) === null || _props_comment === void 0 ? void 0 : (_props_comment_commentList = _props_comment.commentList) === null || _props_comment_commentList === void 0 ? void 0 : _props_comment_commentList.length)) {
1070
- return [];
1071
- }
1073
+ var _props_comment;
1074
+ // 始终运行 useHighlight,以支持 fnc(脚注)、链接等基础展示
1072
1075
  var decorateList = high(e) || [];
1073
1076
  if (!(props === null || props === void 0 ? void 0 : props.comment)) return decorateList;
1074
- if ((props === null || props === void 0 ? void 0 : (_props_comment1 = props.comment) === null || _props_comment1 === void 0 ? void 0 : _props_comment1.enable) === false) return decorateList;
1077
+ if ((props === null || props === void 0 ? void 0 : (_props_comment = props.comment) === null || _props_comment === void 0 ? void 0 : _props_comment.enable) === false) return decorateList;
1075
1078
  if (commentMap.size === 0) return decorateList;
1076
1079
  try {
1077
1080
  var ranges = [];
@@ -240,13 +240,32 @@ function _ts_generator(thisArg, body) {
240
240
  import { Editor, Element, Node, Path, Range, Transforms } from "slate";
241
241
  import { jsx } from "slate-hyperscript";
242
242
  import { debugInfo } from "../../../Utils/debugUtils";
243
- import { debugLog, EditorUtils } from "../utils";
243
+ import { EditorUtils } from "../utils";
244
244
  import { docxDeserializer } from "../utils/docx/docxDeserializer";
245
245
  import { BackspaceKey } from "./hotKeyCommands/backspace";
246
246
  // 性能优化常量
247
247
  var BATCH_SIZE = 10; // 每批处理的节点数量
248
248
  var BATCH_DELAY = 16; // 每批之间的延迟时间(ms),约60fps
249
249
  var MAX_SYNC_SIZE = 1000; // 同步处理的最大字符数
250
+ /** 文件上传时排除的片段类型 */ var UPLOAD_EXCLUDED_FRAGMENT_TYPES = [
251
+ 'media',
252
+ 'image'
253
+ ];
254
+ /** card 的第二个子节点为 media/image 时排除上传 */ var CARD_CONTENT_EXCLUDED_TYPES = [
255
+ 'media',
256
+ 'image'
257
+ ];
258
+ var shouldExcludeFromUpload = function(fragment) {
259
+ if (UPLOAD_EXCLUDED_FRAGMENT_TYPES.includes(fragment === null || fragment === void 0 ? void 0 : fragment.type)) {
260
+ return true;
261
+ }
262
+ if ((fragment === null || fragment === void 0 ? void 0 : fragment.type) === 'card') {
263
+ var _fragment_children;
264
+ var secondNode = fragment === null || fragment === void 0 ? void 0 : (_fragment_children = fragment.children) === null || _fragment_children === void 0 ? void 0 : _fragment_children[1];
265
+ return CARD_CONTENT_EXCLUDED_TYPES.includes(secondNode === null || secondNode === void 0 ? void 0 : secondNode.type);
266
+ }
267
+ return false;
268
+ };
250
269
  var findElementByNode = function(node) {
251
270
  var index = Array.prototype.indexOf.call(node.parentNode.childNodes, node);
252
271
  return node.parentElement.children[index];
@@ -1002,7 +1021,7 @@ var blobToFile = function(blobUrl, fileName) {
1002
1021
  };
1003
1022
  export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1004
1023
  return _async_to_generator(function() {
1005
- var hideLoading, fragmentList, _Editor_nodes, node, selection, processedNodes, back, _Editor_nodes1, specialNode, parsed, inner, hasCodeTags, textContent, children, _Editor_nodes2, p, parent, nextPath, texts, text, processedNodes1, error;
1024
+ var fragmentList, fragmentsToUpload, _Editor_nodes, node, selection, processedNodes, back, _Editor_nodes1, specialNode, parsed, inner, hasCodeTags, textContent, children, _Editor_nodes2, p, parent, nextPath, texts, text, processedNodes1, error;
1006
1025
  return _ts_generator(this, function(_state) {
1007
1026
  switch(_state.label){
1008
1027
  case 0:
@@ -1020,8 +1039,6 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1020
1039
  false
1021
1040
  ];
1022
1041
  }
1023
- // 2. 显示解析提示
1024
- hideLoading = message.loading('parsing...', 0);
1025
1042
  _state.label = 1;
1026
1043
  case 1:
1027
1044
  _state.trys.push([
@@ -1030,39 +1047,28 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1030
1047
  ,
1031
1048
  18
1032
1049
  ]);
1033
- // 3. 异步解析 HTML
1034
- debugInfo('insertParsedHtmlNodes - 开始解析 HTML');
1035
1050
  return [
1036
1051
  4,
1037
1052
  parseHtmlOptimized(html, rtl)
1038
1053
  ];
1039
1054
  case 2:
1040
1055
  fragmentList = _state.sent();
1041
- debugInfo('insertParsedHtmlNodes - HTML 解析完成', {
1042
- fragmentListLength: fragmentList === null || fragmentList === void 0 ? void 0 : fragmentList.length,
1043
- fragmentTypes: fragmentList === null || fragmentList === void 0 ? void 0 : fragmentList.map(function(f) {
1044
- return f === null || f === void 0 ? void 0 : f.type;
1045
- })
1046
- });
1047
1056
  if (!(fragmentList === null || fragmentList === void 0 ? void 0 : fragmentList.length)) {
1048
- debugInfo('insertParsedHtmlNodes - 解析结果为空');
1049
- hideLoading();
1050
1057
  return [
1051
1058
  2,
1052
1059
  false
1053
1060
  ];
1054
1061
  }
1055
- // 4. 异步处理文件上传
1056
- debugInfo('insertParsedHtmlNodes - 开始处理文件上传');
1062
+ // 4. 异步处理文件上传(排除 media、image;card 需判断第二个节点类型)
1063
+ fragmentsToUpload = fragmentList.filter(function(f) {
1064
+ return !shouldExcludeFromUpload(f);
1065
+ });
1057
1066
  return [
1058
1067
  4,
1059
- upLoadFileBatch(fragmentList, editorProps)
1068
+ upLoadFileBatch(fragmentsToUpload, editorProps)
1060
1069
  ];
1061
1070
  case 3:
1062
1071
  _state.sent();
1063
- debugInfo('insertParsedHtmlNodes - 文件上传完成');
1064
- debugLog('wordFragmentList', fragmentList);
1065
- hideLoading();
1066
1072
  // 5. 获取当前节点
1067
1073
  _Editor_nodes = _sliced_to_array(Editor.nodes(editor, {
1068
1074
  match: function(n) {
@@ -1075,7 +1081,7 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1075
1081
  5
1076
1082
  ];
1077
1083
  debugInfo('insertParsedHtmlNodes - 无有效选区,直接插入');
1078
- processedNodes = fragmentList === null || fragmentList === void 0 ? void 0 : fragmentList.map(function(item) {
1084
+ processedNodes = fragmentsToUpload === null || fragmentsToUpload === void 0 ? void 0 : fragmentsToUpload.map(function(item) {
1079
1085
  if (!item.type) {
1080
1086
  return {
1081
1087
  type: 'paragraph',
@@ -1189,15 +1195,15 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1189
1195
  true
1190
1196
  ];
1191
1197
  }
1192
- if (!((node === null || node === void 0 ? void 0 : node[0].type) === 'list-item' && (fragmentList[0].type === 'list' || fragmentList[0].type === 'bulleted-list' || fragmentList[0].type === 'numbered-list'))) return [
1198
+ if (!((node === null || node === void 0 ? void 0 : node[0].type) === 'list-item' && (fragmentsToUpload[0].type === 'list' || fragmentsToUpload[0].type === 'bulleted-list' || fragmentsToUpload[0].type === 'numbered-list'))) return [
1193
1199
  3,
1194
1200
  12
1195
1201
  ];
1196
1202
  debugInfo('insertParsedHtmlNodes - 处理列表项', {
1197
1203
  currentNodeType: node[0].type,
1198
- fragmentListType: fragmentList[0].type
1204
+ fragmentListType: fragmentsToUpload[0].type
1199
1205
  });
1200
- children = fragmentList[0].children || [];
1206
+ children = fragmentsToUpload[0].children || [];
1201
1207
  debugInfo('insertParsedHtmlNodes - 列表项子节点', {
1202
1208
  childrenCount: children.length
1203
1209
  });
@@ -1269,13 +1275,13 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1269
1275
  _state.sent();
1270
1276
  _state.label = 9;
1271
1277
  case 9:
1272
- if (!(fragmentList.length > 1)) return [
1278
+ if (!(fragmentsToUpload.length > 1)) return [
1273
1279
  3,
1274
1280
  11
1275
1281
  ];
1276
1282
  return [
1277
1283
  4,
1278
- insertNodesBatch(editor, fragmentList.slice(1), selection.anchor.path, {
1284
+ insertNodesBatch(editor, fragmentsToUpload.slice(1), selection.anchor.path, {
1279
1285
  select: true
1280
1286
  })
1281
1287
  ];
@@ -1290,7 +1296,7 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1290
1296
  case 12:
1291
1297
  // 11. 处理表格单元格
1292
1298
  if ((node === null || node === void 0 ? void 0 : node[0].type) === 'table-cell') {
1293
- Transforms.insertFragment(editor, getTextsNode(fragmentList), {
1299
+ Transforms.insertFragment(editor, getTextsNode(fragmentsToUpload), {
1294
1300
  at: selection
1295
1301
  });
1296
1302
  return [
@@ -1302,8 +1308,8 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1302
1308
  3,
1303
1309
  15
1304
1310
  ];
1305
- if (fragmentList[0].type) {
1306
- if (fragmentList[0].type !== 'paragraph') {
1311
+ if (fragmentsToUpload[0].type) {
1312
+ if (fragmentsToUpload[0].type !== 'paragraph') {
1307
1313
  Transforms.insertNodes(editor, {
1308
1314
  type: 'paragraph',
1309
1315
  children: [
@@ -1325,7 +1331,7 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1325
1331
  false
1326
1332
  ];
1327
1333
  }
1328
- texts = fragmentList.filter(function(c) {
1334
+ texts = fragmentsToUpload.filter(function(c) {
1329
1335
  return c.text;
1330
1336
  });
1331
1337
  if (!texts.length) return [
@@ -1349,8 +1355,8 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1349
1355
  ];
1350
1356
  case 15:
1351
1357
  // 13. 处理单个段落的特殊情况
1352
- if (fragmentList.length === 1 && (fragmentList[0].type === 'paragraph' || !fragmentList[0].type) && node) {
1353
- text = Node.string(fragmentList[0]);
1358
+ if (fragmentsToUpload.length === 1 && (fragmentsToUpload[0].type === 'paragraph' || !fragmentsToUpload[0].type) && node) {
1359
+ text = Node.string(fragmentsToUpload[0]);
1354
1360
  if (text) {
1355
1361
  Transforms.insertText(editor, text, {
1356
1362
  at: selection
@@ -1363,7 +1369,7 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1363
1369
  }
1364
1370
  // 14. 默认情况:替换选中节点
1365
1371
  debugInfo('insertParsedHtmlNodes - 使用默认处理方式');
1366
- processedNodes1 = fragmentList === null || fragmentList === void 0 ? void 0 : fragmentList.map(function(item) {
1372
+ processedNodes1 = fragmentsToUpload === null || fragmentsToUpload === void 0 ? void 0 : fragmentsToUpload.map(function(item) {
1367
1373
  if (!item.type) {
1368
1374
  return {
1369
1375
  type: 'paragraph',
@@ -1401,7 +1407,6 @@ export var insertParsedHtmlNodes = function(editor, html, editorProps, rtl) {
1401
1407
  case 17:
1402
1408
  error = _state.sent();
1403
1409
  console.error('插入HTML节点失败:', error);
1404
- hideLoading();
1405
1410
  message.error('Content parsing failed, please try again');
1406
1411
  return [
1407
1412
  2,
@@ -430,7 +430,7 @@ export var EditorStoreContext = createContext(null);
430
430
  this.cancelSetMDContent();
431
431
  var chunkSize = (_ref = options === null || options === void 0 ? void 0 : options.chunkSize) !== null && _ref !== void 0 ? _ref : 5000;
432
432
  var separator = (_ref1 = options === null || options === void 0 ? void 0 : options.separator) !== null && _ref1 !== void 0 ? _ref1 : /\n\n/;
433
- var useRAF = (_ref2 = options === null || options === void 0 ? void 0 : options.useRAF) !== null && _ref2 !== void 0 ? _ref2 : true;
433
+ var useRAF = (_ref2 = options === null || options === void 0 ? void 0 : options.useRAF) !== null && _ref2 !== void 0 ? _ref2 : false;
434
434
  var batchSize = (_ref3 = options === null || options === void 0 ? void 0 : options.batchSize) !== null && _ref3 !== void 0 ? _ref3 : 50;
435
435
  var targetPlugins = plugins || this.plugins;
436
436
  if (md.length <= chunkSize) {
@@ -395,7 +395,7 @@ export type MarkdownEditorProps = {
395
395
  };
396
396
  onFocus?: (value: string, schema: Elements[], e: React.FocusEvent<HTMLDivElement, Element>) => void;
397
397
  onBlur?: (value: string, schema: Elements[], e: React.MouseEvent<HTMLDivElement, Element>) => void;
398
- onPaste?: (e: React.ClipboardEvent<HTMLDivElement>) => void;
398
+ onPaste?: (e: React.ClipboardEvent<HTMLDivElement>) => boolean | void;
399
399
  /**
400
400
  * 自定义 markdown 转 HTML 的 remark 插件配置,格式类似 Babel 插件数组
401
401
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.29.17",
3
+ "version": "2.29.19",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "guidelines"
13
13
  ],
14
14
  "scripts": {
15
+ "bench:parsemd": "vitest --run tests/editor/parseMd.benchmark.test.ts",
15
16
  "build": "father build",
16
17
  "build:watch": "father dev",
17
18
  "check:demo": "node scripts/checkDemoFiles.js",
@@ -23,7 +24,6 @@
23
24
  "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
24
25
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
25
26
  "prepare": "husky install && dumi setup",
26
- "prepublishOnly": "father doctor && pnpm run test && pnpm run build",
27
27
  "prettier": "prettier --write \"{src,docs,test}/**/*.{js,jsx,ts,tsx,css,less,json,md}\"",
28
28
  "preview": "pnpm dumi preview",
29
29
  "report:demo": "node scripts/generateDemoReport.js",
@@ -34,7 +34,6 @@
34
34
  "test:e2e:debug": "playwright test --debug",
35
35
  "test:e2e:skip-server": "cross-env SKIP_WEBSERVER=1 playwright test",
36
36
  "test:e2e:ui": "playwright test --ui",
37
- "bench:parsemd": "vitest --run tests/editor/parseMd.benchmark.test.ts",
38
37
  "tsc": "tsc --noEmit"
39
38
  },
40
39
  "lint-staged": {
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- export interface FooterBackgroundLottieProps {
3
- /**
4
- * 是否自动播放动画
5
- */
6
- autoplay?: boolean;
7
- /**
8
- * 是否循环播放动画
9
- */
10
- loop?: boolean;
11
- /**
12
- * 动画容器类名
13
- */
14
- className?: string;
15
- /**
16
- * 动画容器样式
17
- */
18
- style?: React.CSSProperties;
19
- }
20
- /**
21
- * FooterBackgroundLottie 组件 - Lottie底部背景动画组件
22
- *
23
- * 该组件使用Lottie动画库提供流畅的底部背景动画效果,支持播放控制等。
24
- *
25
- * @component
26
- * @description FooterBackgroundLottie 组件 - Lottie底部背景动画组件,提供流畅的底部背景动画效果
27
- * @param {FooterBackgroundLottieProps} props - 组件属性
28
- * @param {boolean} [props.autoplay=true] - 是否自动播放动画
29
- * @param {boolean} [props.loop=true] - 是否循环播放动画
30
- * @param {string} [props.className] - 动画容器类名
31
- * @param {React.CSSProperties} [props.style] - 动画容器样式
32
- *
33
- * @example
34
- * ```tsx
35
- * <FooterBackgroundLottie
36
- * autoplay={true}
37
- * loop={true}
38
- * className="custom-loading"
39
- * />
40
- * ```
41
- *
42
- * @returns {React.ReactElement} 渲染的Lottie底部背景动画组件
43
- *
44
- * @remarks
45
- * - 使用Lottie动画库
46
- * - 提供流畅的动画效果
47
- * - 支持播放控制
48
- * - 支持自定义样式
49
- */
50
- export declare const FooterBackgroundLottie: React.FC<FooterBackgroundLottieProps>;
51
- export default FooterBackgroundLottie;
@@ -1,45 +0,0 @@
1
- import Lottie from "lottie-react";
2
- import React from "react";
3
- import lottieData from "./lottie";
4
- /**
5
- * FooterBackgroundLottie 组件 - Lottie底部背景动画组件
6
- *
7
- * 该组件使用Lottie动画库提供流畅的底部背景动画效果,支持播放控制等。
8
- *
9
- * @component
10
- * @description FooterBackgroundLottie 组件 - Lottie底部背景动画组件,提供流畅的底部背景动画效果
11
- * @param {FooterBackgroundLottieProps} props - 组件属性
12
- * @param {boolean} [props.autoplay=true] - 是否自动播放动画
13
- * @param {boolean} [props.loop=true] - 是否循环播放动画
14
- * @param {string} [props.className] - 动画容器类名
15
- * @param {React.CSSProperties} [props.style] - 动画容器样式
16
- *
17
- * @example
18
- * ```tsx
19
- * <FooterBackgroundLottie
20
- * autoplay={true}
21
- * loop={true}
22
- * className="custom-loading"
23
- * />
24
- * ```
25
- *
26
- * @returns {React.ReactElement} 渲染的Lottie底部背景动画组件
27
- *
28
- * @remarks
29
- * - 使用Lottie动画库
30
- * - 提供流畅的动画效果
31
- * - 支持播放控制
32
- * - 支持自定义样式
33
- */ export var FooterBackgroundLottie = function(param) {
34
- 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;
35
- return /*#__PURE__*/ React.createElement(Lottie, {
36
- className: className,
37
- style: style,
38
- renderer: "svg",
39
- "aria-hidden": "true",
40
- animationData: lottieData,
41
- loop: loop,
42
- autoplay: autoplay
43
- });
44
- };
45
- export default FooterBackgroundLottie;
@@ -1,85 +0,0 @@
1
- declare const _default: {
2
- v: string;
3
- fr: number;
4
- ip: number;
5
- op: number;
6
- w: number;
7
- h: number;
8
- nm: string;
9
- ddd: number;
10
- assets: {
11
- id: string;
12
- w: number;
13
- h: number;
14
- u: string;
15
- p: string;
16
- e: number;
17
- }[];
18
- layers: {
19
- ddd: number;
20
- ind: number;
21
- ty: number;
22
- nm: string;
23
- cl: string;
24
- refId: string;
25
- sr: number;
26
- ks: {
27
- o: {
28
- a: number;
29
- k: number;
30
- ix: number;
31
- };
32
- r: {
33
- a: number;
34
- k: number;
35
- ix: number;
36
- };
37
- p: {
38
- a: number;
39
- k: ({
40
- i: {
41
- x: number;
42
- y: number;
43
- };
44
- o: {
45
- x: number;
46
- y: number;
47
- };
48
- t: number;
49
- s: number[];
50
- to: number[];
51
- ti: number[];
52
- } | {
53
- t: number;
54
- s: number[];
55
- i?: undefined;
56
- o?: undefined;
57
- to?: undefined;
58
- ti?: undefined;
59
- })[];
60
- ix: number;
61
- l: number;
62
- };
63
- a: {
64
- a: number;
65
- k: number[];
66
- ix: number;
67
- l: number;
68
- };
69
- s: {
70
- a: number;
71
- k: number[];
72
- ix: number;
73
- l: number;
74
- };
75
- };
76
- ao: number;
77
- ip: number;
78
- op: number;
79
- st: number;
80
- bm: number;
81
- }[];
82
- markers: never[];
83
- props: {};
84
- };
85
- export default _default;
@@ -1,382 +0,0 @@
1
- import img_0 from "./images/img_0.png";
2
- import img_1 from "./images/img_1.png";
3
- import img_2 from "./images/img_2.png";
4
- export default {
5
- v: '5.12.2',
6
- fr: 25,
7
- ip: 0,
8
- op: 250,
9
- w: 2880,
10
- h: 600,
11
- nm: '合成 3',
12
- ddd: 0,
13
- assets: [
14
- {
15
- id: 'image_0',
16
- w: 2880,
17
- h: 600,
18
- u: '',
19
- p: img_0,
20
- e: 0
21
- },
22
- {
23
- id: 'image_1',
24
- w: 2880,
25
- h: 600,
26
- u: '',
27
- p: img_1,
28
- e: 0
29
- },
30
- {
31
- id: 'image_2',
32
- w: 2880,
33
- h: 600,
34
- u: '',
35
- p: img_2,
36
- e: 0
37
- }
38
- ],
39
- layers: [
40
- {
41
- ddd: 0,
42
- ind: 1,
43
- ty: 2,
44
- nm: '预合成 3 (0-00-00-00).png',
45
- cl: 'png',
46
- refId: 'image_0',
47
- sr: 1,
48
- ks: {
49
- o: {
50
- a: 0,
51
- k: 100,
52
- ix: 11
53
- },
54
- r: {
55
- a: 0,
56
- k: 0,
57
- ix: 10
58
- },
59
- p: {
60
- a: 1,
61
- k: [
62
- {
63
- i: {
64
- x: 0.667,
65
- y: 1
66
- },
67
- o: {
68
- x: 0.333,
69
- y: 0
70
- },
71
- t: 0,
72
- s: [
73
- 1440,
74
- 294.735,
75
- 0
76
- ],
77
- to: [
78
- 0,
79
- 0,
80
- 0
81
- ],
82
- ti: [
83
- 0,
84
- 0,
85
- 0
86
- ]
87
- },
88
- {
89
- i: {
90
- x: 0.667,
91
- y: 1
92
- },
93
- o: {
94
- x: 0.333,
95
- y: 0
96
- },
97
- t: 125,
98
- s: [
99
- 995.751,
100
- 287.009,
101
- 0
102
- ],
103
- to: [
104
- 0,
105
- 0,
106
- 0
107
- ],
108
- ti: [
109
- 0,
110
- 0,
111
- 0
112
- ]
113
- },
114
- {
115
- t: 249,
116
- s: [
117
- 1440,
118
- 294.735,
119
- 0
120
- ]
121
- }
122
- ],
123
- ix: 2,
124
- l: 2
125
- },
126
- a: {
127
- a: 0,
128
- k: [
129
- 1440,
130
- 300,
131
- 0
132
- ],
133
- ix: 1,
134
- l: 2
135
- },
136
- s: {
137
- a: 0,
138
- k: [
139
- 100,
140
- 100,
141
- 100
142
- ],
143
- ix: 6,
144
- l: 2
145
- }
146
- },
147
- ao: 0,
148
- ip: 0,
149
- op: 250,
150
- st: 0,
151
- bm: 0
152
- },
153
- {
154
- ddd: 0,
155
- ind: 2,
156
- ty: 2,
157
- nm: '预合成 2 (0-00-00-00).png',
158
- cl: 'png',
159
- refId: 'image_1',
160
- sr: 1,
161
- ks: {
162
- o: {
163
- a: 0,
164
- k: 100,
165
- ix: 11
166
- },
167
- r: {
168
- a: 0,
169
- k: 0,
170
- ix: 10
171
- },
172
- p: {
173
- a: 1,
174
- k: [
175
- {
176
- i: {
177
- x: 0.667,
178
- y: 1
179
- },
180
- o: {
181
- x: 0.333,
182
- y: 0
183
- },
184
- t: 0,
185
- s: [
186
- 1440,
187
- 294.735,
188
- 0
189
- ],
190
- to: [
191
- 0,
192
- 0,
193
- 0
194
- ],
195
- ti: [
196
- 0,
197
- 0,
198
- 0
199
- ]
200
- },
201
- {
202
- i: {
203
- x: 0.667,
204
- y: 1
205
- },
206
- o: {
207
- x: 0.333,
208
- y: 0
209
- },
210
- t: 125,
211
- s: [
212
- 1737.454,
213
- 294.735,
214
- 0
215
- ],
216
- to: [
217
- 0,
218
- 0,
219
- 0
220
- ],
221
- ti: [
222
- 0,
223
- 0,
224
- 0
225
- ]
226
- },
227
- {
228
- t: 249,
229
- s: [
230
- 1440,
231
- 294.735,
232
- 0
233
- ]
234
- }
235
- ],
236
- ix: 2,
237
- l: 2
238
- },
239
- a: {
240
- a: 0,
241
- k: [
242
- 1440,
243
- 300,
244
- 0
245
- ],
246
- ix: 1,
247
- l: 2
248
- },
249
- s: {
250
- a: 0,
251
- k: [
252
- 100,
253
- 100,
254
- 100
255
- ],
256
- ix: 6,
257
- l: 2
258
- }
259
- },
260
- ao: 0,
261
- ip: 0,
262
- op: 250,
263
- st: 0,
264
- bm: 0
265
- },
266
- {
267
- ddd: 0,
268
- ind: 3,
269
- ty: 2,
270
- nm: '预合成 1 (0-00-00-00).png',
271
- cl: 'png',
272
- refId: 'image_2',
273
- sr: 1,
274
- ks: {
275
- o: {
276
- a: 0,
277
- k: 100,
278
- ix: 11
279
- },
280
- r: {
281
- a: 0,
282
- k: 0,
283
- ix: 10
284
- },
285
- p: {
286
- a: 1,
287
- k: [
288
- {
289
- i: {
290
- x: 0.667,
291
- y: 1
292
- },
293
- o: {
294
- x: 0.333,
295
- y: 0
296
- },
297
- t: 0,
298
- s: [
299
- 1440,
300
- 294.735,
301
- 0
302
- ],
303
- to: [
304
- 0,
305
- 0,
306
- 0
307
- ],
308
- ti: [
309
- 0,
310
- 0,
311
- 0
312
- ]
313
- },
314
- {
315
- i: {
316
- x: 0.667,
317
- y: 1
318
- },
319
- o: {
320
- x: 0.333,
321
- y: 0
322
- },
323
- t: 125,
324
- s: [
325
- 864.407,
326
- 294.735,
327
- 0
328
- ],
329
- to: [
330
- 0,
331
- 0,
332
- 0
333
- ],
334
- ti: [
335
- 0,
336
- 0,
337
- 0
338
- ]
339
- },
340
- {
341
- t: 249,
342
- s: [
343
- 1440,
344
- 294.735,
345
- 0
346
- ]
347
- }
348
- ],
349
- ix: 2,
350
- l: 2
351
- },
352
- a: {
353
- a: 0,
354
- k: [
355
- 1440,
356
- 300,
357
- 0
358
- ],
359
- ix: 1,
360
- l: 2
361
- },
362
- s: {
363
- a: 0,
364
- k: [
365
- 100,
366
- 100,
367
- 100
368
- ],
369
- ix: 6,
370
- l: 2
371
- }
372
- },
373
- ao: 0,
374
- ip: 0,
375
- op: 250,
376
- st: 0,
377
- bm: 0
378
- }
379
- ],
380
- markers: [],
381
- props: {}
382
- };