@ant-design/agentic-ui 2.0.20 → 2.0.21

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.
@@ -64,9 +64,10 @@ var BubbleFileView = ({
64
64
  showMoreButton: config.showMoreButton,
65
65
  onPreview: createEventHandler(eventOverrides.onPreview),
66
66
  onDownload: createEventHandler(eventOverrides.onDownload),
67
- onViewAll: eventOverrides.onViewAll ? () => {
67
+ onViewAll: eventOverrides.onViewAll ? (files) => {
68
68
  var _a;
69
- return (_a = eventOverrides.onViewAll) == null ? void 0 : _a.call(eventOverrides, allFiles);
69
+ (_a = eventOverrides.onViewAll) == null ? void 0 : _a.call(eventOverrides, files);
70
+ return false;
70
71
  } : void 0,
71
72
  renderMoreAction: config.renderFileMoreAction ? (file) => renderMoreAction(config.renderFileMoreAction, file) : void 0,
72
73
  customSlot: config.customSlot,
@@ -124,7 +124,7 @@ var createDefaultDom = (domRef, baseCls, hashId, loading, selectedItems, childre
124
124
  onMouseEnter: () => handleMouseEnter(domRef),
125
125
  onMouseLeave: () => handleMouseLeave(domRef),
126
126
  title: placeholder,
127
- contentEditable: !hasItems
127
+ contentEditable: !hasItems ? void 0 : false
128
128
  },
129
129
  children,
130
130
  hasItems && /* @__PURE__ */ React.createElement(
@@ -1,3 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+
1
21
  // src/MarkdownEditor/editor/plugins/withMarkdown.ts
2
22
  import { Editor, Node, Path, Range, Transforms } from "slate";
3
23
  import { ReactEditor } from "slate-react";
@@ -206,6 +226,17 @@ var handleCodeTagOperation = (editor, operation, apply) => {
206
226
  });
207
227
  return true;
208
228
  }
229
+ if (currentNode.text === operation.text) {
230
+ Editor.withoutNormalizing(editor, () => {
231
+ Transforms.removeNodes(editor, { at: operation.path });
232
+ Transforms.insertNodes(
233
+ editor,
234
+ __spreadProps(__spreadValues({}, currentNode), { tag: true, code: true, text: " " }),
235
+ { at: operation.path, select: true }
236
+ );
237
+ });
238
+ return true;
239
+ }
209
240
  apply(operation);
210
241
  return true;
211
242
  }
@@ -219,6 +250,17 @@ var handleCodeTagOperation = (editor, operation, apply) => {
219
250
  return true;
220
251
  }
221
252
  }
253
+ if ((currentNode == null ? void 0 : currentNode.tag) && operation.text.trim().length > 0 && currentNode.text.trim().length === 0) {
254
+ Editor.withoutNormalizing(editor, () => {
255
+ Transforms.removeNodes(editor, { at: operation.path });
256
+ Transforms.insertNodes(
257
+ editor,
258
+ __spreadProps(__spreadValues({}, currentNode), { tag: true, code: true, text: operation.text }),
259
+ { at: operation.path, select: true }
260
+ );
261
+ });
262
+ return true;
263
+ }
222
264
  }
223
265
  if (operation.type === "split_node") {
224
266
  const node = Node.get(editor, operation.path);
@@ -372,7 +372,7 @@ var ActionItemContainer = (props) => {
372
372
  trigger: "click",
373
373
  placement: "topRight",
374
374
  arrow: false,
375
- overlayInnerStyle: POPOVER_OVERLAY_STYLE,
375
+ styles: { body: POPOVER_OVERLAY_STYLE },
376
376
  overlayClassName: classNames(
377
377
  `${basePrefixCls}-overflow-popover`,
378
378
  hashId
@@ -9,8 +9,8 @@ export type FileMapViewProps = {
9
9
  onPreview?: (file: AttachmentFile) => void;
10
10
  /** 下载文件回调 */
11
11
  onDownload?: (file: AttachmentFile) => void;
12
- /** 点击"查看所有文件"回调,携带当前所有文件列表 */
13
- onViewAll?: (files: AttachmentFile[]) => void;
12
+ /** 点击"查看所有文件"回调,携带当前所有文件列表。返回 true 时组件内部展开所有文件,返回 false 时由外部处理 */
13
+ onViewAll?: (files: AttachmentFile[]) => boolean | Promise<boolean>;
14
14
  /** 自定义更多操作 DOM(优先于 onMore,传入则展示该 DOM,不传则不展示更多按钮) */
15
15
  renderMoreAction?: (file: AttachmentFile) => React.ReactNode;
16
16
  /** 自定义悬浮动作区 slot(传入则覆盖默认『预览/下载/更多』动作区) */
@@ -1,18 +1,40 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+
1
22
  // src/MarkdownInputField/FileMapView/index.tsx
2
23
  import { FileSearch } from "@sofa-design/icons";
3
24
  import { ConfigProvider, Image } from "antd";
4
25
  import classNames from "classnames";
5
26
  import { motion } from "framer-motion";
6
- import React, { useContext, useMemo } from "react";
27
+ import React, { useContext, useMemo, useState } from "react";
7
28
  import { isImageFile } from "../AttachmentButton/utils";
8
29
  import { FileMapViewItem } from "./FileMapViewItem";
9
30
  import { useStyle } from "./style";
10
31
  var FileMapView = (props) => {
11
32
  var _a;
12
- const { placement = "left", showMoreButton = true } = props;
33
+ const { placement = "left" } = props;
13
34
  const context = useContext(ConfigProvider.ConfigContext);
14
35
  const prefix = context == null ? void 0 : context.getPrefixCls("agentic-md-editor-file-view-list");
15
36
  const { wrapSSR, hashId } = useStyle(prefix);
37
+ const [showAllFiles, setShowAllFiles] = useState(false);
16
38
  const fileList = useMemo(() => {
17
39
  var _a2;
18
40
  if (!props.fileMap) {
@@ -27,11 +49,21 @@ var FileMapView = (props) => {
27
49
  return fileList.filter((file) => !isImageFile(file));
28
50
  }, [fileList]);
29
51
  const noImageFileList = useMemo(() => {
30
- if (props.maxDisplayCount === void 0) {
52
+ if (showAllFiles || props.maxDisplayCount === void 0) {
31
53
  return allNoImageFiles;
32
54
  }
33
55
  return allNoImageFiles.slice(0, Math.max(0, props.maxDisplayCount));
34
- }, [allNoImageFiles, props.maxDisplayCount]);
56
+ }, [allNoImageFiles, props.maxDisplayCount, showAllFiles]);
57
+ const handleViewAllClick = () => __async(void 0, null, function* () {
58
+ if (props.onViewAll) {
59
+ const shouldExpand = yield props.onViewAll(fileList);
60
+ if (shouldExpand) {
61
+ setShowAllFiles(true);
62
+ }
63
+ } else {
64
+ setShowAllFiles(true);
65
+ }
66
+ });
35
67
  return wrapSSR(
36
68
  /* @__PURE__ */ React.createElement(
37
69
  "div",
@@ -118,9 +150,7 @@ var FileMapView = (props) => {
118
150
  hashId,
119
151
  props.className,
120
152
  `${prefix}-${placement}`,
121
- {
122
- [`${prefix}-vertical`]: placement === "left"
123
- }
153
+ `${prefix}-vertical`
124
154
  ),
125
155
  style: props.style
126
156
  },
@@ -148,15 +178,12 @@ var FileMapView = (props) => {
148
178
  }
149
179
  );
150
180
  }),
151
- showMoreButton && props.maxDisplayCount !== void 0 && allNoImageFiles.length > props.maxDisplayCount ? /* @__PURE__ */ React.createElement(
181
+ props.maxDisplayCount !== void 0 && allNoImageFiles.length > props.maxDisplayCount && !showAllFiles ? /* @__PURE__ */ React.createElement(
152
182
  "div",
153
183
  {
154
184
  style: { width: (_a = props.style) == null ? void 0 : _a.width },
155
185
  className: classNames(hashId, `${prefix}-more-file-container`),
156
- onClick: () => {
157
- var _a2;
158
- return (_a2 = props.onViewAll) == null ? void 0 : _a2.call(props, fileList);
159
- }
186
+ onClick: handleViewAllClick
160
187
  },
161
188
  /* @__PURE__ */ React.createElement(FileSearch, { color: "var(--color-gray-text-secondary)" }),
162
189
  /* @__PURE__ */ React.createElement("div", { className: classNames(hashId, `${prefix}-more-file-name`) }, /* @__PURE__ */ React.createElement("span", { style: { whiteSpace: "nowrap" } }, "查看此任务中的所有文件"))
@@ -45,9 +45,12 @@ var genStyle = (token) => {
45
45
  },
46
46
  "&-vertical": {
47
47
  display: "flex",
48
- flexDirection: "column",
48
+ flexDirection: "row",
49
+ flexWrap: "wrap",
49
50
  alignItems: "flex-start",
50
- gap: 4
51
+ gap: 4,
52
+ maxWidth: "calc(285px * 3 + 4px * 2)"
53
+ // 3列:每列285px,间距4px
51
54
  },
52
55
  "&::-webkit-scrollbar": {
53
56
  width: 6
@@ -116,7 +119,7 @@ var genStyle = (token) => {
116
119
  borderRadius: "var(--radius-card-base)"
117
120
  },
118
121
  "&-more-file-container": {
119
- width: "294px",
122
+ width: "285px",
120
123
  height: "56px",
121
124
  borderRadius: "var(--radius-card-base)",
122
125
  background: "var(--color-gray-bg-card-white)",
@@ -140,7 +143,7 @@ var genStyle = (token) => {
140
143
  color: "var(--color-gray-text-secondary)"
141
144
  },
142
145
  "&-item": {
143
- width: "294px",
146
+ width: "285px",
144
147
  height: "56px",
145
148
  borderRadius: "var(--radius-card-base)",
146
149
  opacity: 1,
@@ -230,7 +233,7 @@ var genStyle = (token) => {
230
233
  "&-file-name": {
231
234
  color: "var(--color-gray-text-default)",
232
235
  fontSize: "var(--font-text-h6-base)",
233
- width: "160px",
236
+ width: "150px",
234
237
  alignItems: "center",
235
238
  lineHeight: "18px",
236
239
  fontFamily: token.fontFamily,
@@ -238,7 +241,7 @@ var genStyle = (token) => {
238
241
  display: "flex",
239
242
  overflow: "hidden",
240
243
  "&-text": {
241
- maxWidth: "160px",
244
+ maxWidth: "150px",
242
245
  whiteSpace: "nowrap !important",
243
246
  wordWrap: "normal",
244
247
  wordBreak: "keep-all",
@@ -149,6 +149,23 @@ var MarkdownInputField = (_a) => {
149
149
  props == null ? void 0 : props.actionsRender,
150
150
  props == null ? void 0 : props.toolsRender
151
151
  ]);
152
+ const computedMinHeight = useMemo(() => {
153
+ var _a3, _b3, _c2;
154
+ if (isEnlarged)
155
+ return "auto";
156
+ if (((_a3 = props == null ? void 0 : props.enlargeable) == null ? void 0 : _a3.enable) && ((_b3 = props == null ? void 0 : props.refinePrompt) == null ? void 0 : _b3.enable)) {
157
+ return 160;
158
+ }
159
+ if (isMultiRowLayout)
160
+ return 106;
161
+ return ((_c2 = props.style) == null ? void 0 : _c2.minHeight) || 0;
162
+ }, [
163
+ isEnlarged,
164
+ (_h = props == null ? void 0 : props.enlargeable) == null ? void 0 : _h.enable,
165
+ (_i = props == null ? void 0 : props.refinePrompt) == null ? void 0 : _i.enable,
166
+ isMultiRowLayout,
167
+ (_j = props.style) == null ? void 0 : _j.minHeight
168
+ ]);
152
169
  const {
153
170
  fileUploadDone,
154
171
  supportedFormat,
@@ -284,7 +301,7 @@ var MarkdownInputField = (_a) => {
284
301
  );
285
302
  }, [
286
303
  fileMap,
287
- (_h = props.attachment) == null ? void 0 : _h.enable,
304
+ (_k = props.attachment) == null ? void 0 : _k.enable,
288
305
  handleFileRemoval,
289
306
  handleFileRetry,
290
307
  updateAttachmentFiles
@@ -323,7 +340,7 @@ var MarkdownInputField = (_a) => {
323
340
  supportedFormat,
324
341
  fileMap,
325
342
  onFileMapChange: setFileMap,
326
- upload: ((_i = props.attachment) == null ? void 0 : _i.upload) ? (file) => props.attachment.upload(file, 0) : void 0
343
+ upload: ((_l = props.attachment) == null ? void 0 : _l.upload) ? (file) => props.attachment.upload(file, 0) : void 0
327
344
  }),
328
345
  voiceRecognizer: props.voiceRecognizer,
329
346
  value,
@@ -378,8 +395,11 @@ var MarkdownInputField = (_a) => {
378
395
  [`${baseCls}-enlarged`]: isEnlarged
379
396
  }),
380
397
  style: __spreadProps(__spreadValues(__spreadValues({}, props.style), enlargedStyle), {
381
- height: isEnlarged ? `${(_k = (_j = props.enlargeable) == null ? void 0 : _j.height) != null ? _k : 980}px` : `min(${collapsedHeightPx}px,100%)`,
398
+ height: isEnlarged ? `${(_n = (_m = props.enlargeable) == null ? void 0 : _m.height) != null ? _n : 980}px` : `min(${collapsedHeightPx}px,100%)`,
382
399
  borderRadius: borderRadius || 16,
400
+ minHeight: computedMinHeight,
401
+ cursor: isLoading || props.disabled ? "not-allowed" : "auto",
402
+ opacity: props.disabled ? 0.5 : 1,
383
403
  maxHeight: isEnlarged ? "none" : `min(${collapsedHeightPx}px,100%)`,
384
404
  transition: "height, max-height 0.3s,border-radius 0.3s,box-shadow 0.3s,transform 0.3s,opacity 0.3s,background 0.3s"
385
405
  }),
@@ -391,196 +411,153 @@ var MarkdownInputField = (_a) => {
391
411
  /* @__PURE__ */ React.createElement(
392
412
  "div",
393
413
  {
394
- className: classNames(`${baseCls}-background`, hashId, {
395
- [`${baseCls}-hover`]: isHover
396
- }),
397
414
  style: {
398
- minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : ((_l = props.style) == null ? void 0 : _l.minHeight) || 0,
399
- height: "100%",
400
- width: "100%"
415
+ display: "flex",
416
+ flexDirection: "column",
417
+ borderTopLeftRadius: "inherit",
418
+ borderTopRightRadius: "inherit",
419
+ maxHeight: isEnlarged ? "none" : (() => {
420
+ var _a3, _b3;
421
+ const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
422
+ const base = typeof mh === "number" ? mh : mh ? parseFloat(String(mh)) || 400 : 400;
423
+ const extra = ((_b3 = props.attachment) == null ? void 0 : _b3.enable) ? 90 : 0;
424
+ return `min(${base + extra}px)`;
425
+ })(),
426
+ height: isEnlarged ? "100%" : "auto",
427
+ flex: 1
428
+ },
429
+ className: classNames(`${baseCls}-editor`, hashId, {
430
+ [`${baseCls}-editor-hover`]: isHover,
431
+ [`${baseCls}-editor-disabled`]: props.disabled
432
+ })
433
+ },
434
+ /* @__PURE__ */ React.createElement(
435
+ SkillModeBar,
436
+ {
437
+ skillMode: props.skillMode,
438
+ onSkillModeOpenChange: props.onSkillModeOpenChange
401
439
  }
402
- }
440
+ ),
441
+ /* @__PURE__ */ React.createElement("div", { className: classNames(`${baseCls}-editor-content`, hashId) }, attachmentList, /* @__PURE__ */ React.createElement(
442
+ BaseMarkdownEditor,
443
+ __spreadValues({
444
+ editorRef: markdownEditorRef,
445
+ leafRender: props.leafRender,
446
+ style: {
447
+ width: "100%",
448
+ flex: 1,
449
+ padding: 0,
450
+ paddingRight: computedRightPadding
451
+ },
452
+ toolBar: {
453
+ enable: false
454
+ },
455
+ floatBar: {
456
+ enable: false
457
+ },
458
+ readonly: isLoading,
459
+ contentStyle: {
460
+ padding: "var(--padding-3x)"
461
+ },
462
+ textAreaProps: {
463
+ enable: true,
464
+ placeholder: props.placeholder,
465
+ triggerSendKey: props.triggerSendKey || "Enter"
466
+ },
467
+ tagInputProps: __spreadValues({
468
+ enable: true,
469
+ type: "dropdown"
470
+ }, tagInputProps),
471
+ initValue: props.value,
472
+ onChange: (value2) => {
473
+ var _a3;
474
+ setValue(value2);
475
+ (_a3 = props.onChange) == null ? void 0 : _a3.call(props, value2);
476
+ },
477
+ onFocus: (value2, schema, e) => {
478
+ onFocus == null ? void 0 : onFocus(value2, schema, e);
479
+ activeInput(true);
480
+ },
481
+ onBlur: (value2, schema, e) => {
482
+ onBlur == null ? void 0 : onBlur(value2, schema, e);
483
+ activeInput(false);
484
+ },
485
+ onPaste: (e) => {
486
+ handlePaste(e);
487
+ },
488
+ titlePlaceholderContent: props.placeholder,
489
+ toc: false,
490
+ pasteConfig: props.pasteConfig
491
+ }, markdownProps)
492
+ ))
403
493
  ),
404
- /* @__PURE__ */ React.createElement(
494
+ props.toolsRender ? /* @__PURE__ */ React.createElement(
405
495
  "div",
406
496
  {
407
- className: classNames(`${baseCls}-border-wrapper`, hashId),
408
497
  style: {
409
- height: isEnlarged ? "100%" : "100%",
410
- maxHeight: isEnlarged ? "100%" : "100%",
411
- borderRadius: (borderRadius || 16) - 2 || 10,
412
- cursor: isLoading || props.disabled ? "not-allowed" : "auto",
413
- opacity: props.disabled ? 0.5 : 1,
414
- minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : ((_m = props.style) == null ? void 0 : _m.minHeight) || 0
498
+ backgroundColor: "#fff",
499
+ display: "flex",
500
+ boxSizing: "border-box",
501
+ borderRadius: "inherit",
502
+ flexDirection: "row",
503
+ alignItems: "center",
504
+ justifyContent: "space-between",
505
+ gap: 8,
506
+ width: "100%",
507
+ paddingRight: "var(--padding-3x)",
508
+ paddingLeft: "var(--padding-3x)",
509
+ paddingBottom: "var(--padding-3x)"
415
510
  }
416
511
  },
417
512
  /* @__PURE__ */ React.createElement(
418
513
  "div",
419
514
  {
420
- className: classNames(`${baseCls}-content-wrapper`, hashId),
421
- style: {
422
- minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : ((_n = props.style) == null ? void 0 : _n.minHeight) || 0
423
- }
515
+ ref: actionsRef,
516
+ contentEditable: false,
517
+ className: classNames(`${baseCls}-send-tools`, hashId)
424
518
  },
425
- /* @__PURE__ */ React.createElement(
426
- "div",
427
- {
428
- style: {
429
- display: "flex",
430
- flexDirection: "column",
431
- borderTopLeftRadius: (borderRadius || 16) - 2 || 10,
432
- borderTopRightRadius: (borderRadius || 16) - 2 || 10,
433
- maxHeight: isEnlarged ? "none" : (() => {
434
- var _a3, _b3;
435
- const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
436
- const base = typeof mh === "number" ? mh : mh ? parseFloat(String(mh)) || 400 : 400;
437
- const extra = ((_b3 = props.attachment) == null ? void 0 : _b3.enable) ? 90 : 0;
438
- return `min(${base + extra}px)`;
439
- })(),
440
- height: isEnlarged ? "100%" : "auto",
441
- flex: 1
442
- },
443
- className: classNames(`${baseCls}-editor`, hashId, {
444
- [`${baseCls}-editor-hover`]: isHover,
445
- [`${baseCls}-editor-disabled`]: props.disabled
446
- })
447
- },
448
- /* @__PURE__ */ React.createElement(
449
- SkillModeBar,
450
- {
451
- skillMode: props.skillMode,
452
- onSkillModeOpenChange: props.onSkillModeOpenChange
453
- }
454
- ),
455
- /* @__PURE__ */ React.createElement(
456
- "div",
457
- {
458
- className: classNames(`${baseCls}-editor-content`, hashId)
459
- },
460
- attachmentList,
461
- /* @__PURE__ */ React.createElement(
462
- BaseMarkdownEditor,
463
- __spreadValues({
464
- editorRef: markdownEditorRef,
465
- leafRender: props.leafRender,
466
- style: {
467
- width: "100%",
468
- flex: 1,
469
- padding: 0,
470
- paddingRight: computedRightPadding
471
- },
472
- toolBar: {
473
- enable: false
474
- },
475
- floatBar: {
476
- enable: false
477
- },
478
- readonly: isLoading,
479
- contentStyle: {
480
- padding: "var(--padding-3x)"
481
- },
482
- textAreaProps: {
483
- enable: true,
484
- placeholder: props.placeholder,
485
- triggerSendKey: props.triggerSendKey || "Enter"
486
- },
487
- tagInputProps: __spreadValues({
488
- enable: true,
489
- type: "dropdown"
490
- }, tagInputProps),
491
- initValue: props.value,
492
- onChange: (value2) => {
493
- var _a3;
494
- setValue(value2);
495
- (_a3 = props.onChange) == null ? void 0 : _a3.call(props, value2);
496
- },
497
- onFocus: (value2, schema, e) => {
498
- onFocus == null ? void 0 : onFocus(value2, schema, e);
499
- activeInput(true);
500
- },
501
- onBlur: (value2, schema, e) => {
502
- onBlur == null ? void 0 : onBlur(value2, schema, e);
503
- activeInput(false);
504
- },
505
- onPaste: (e) => {
506
- handlePaste(e);
507
- },
508
- titlePlaceholderContent: props.placeholder,
509
- toc: false,
510
- pasteConfig: props.pasteConfig
511
- }, markdownProps)
512
- )
513
- )
514
- ),
515
- props.toolsRender ? /* @__PURE__ */ React.createElement(
516
- "div",
517
- {
518
- style: {
519
- backgroundColor: "#fff",
520
- display: "flex",
521
- boxSizing: "border-box",
522
- borderRadius: "inherit",
523
- flexDirection: "row",
524
- alignItems: "center",
525
- justifyContent: "space-between",
526
- gap: 8,
527
- width: "100%",
528
- paddingRight: "var(--padding-3x)",
529
- paddingLeft: "var(--padding-3x)",
530
- paddingBottom: "var(--padding-3x)"
531
- }
532
- },
533
- /* @__PURE__ */ React.createElement(
534
- "div",
535
- {
536
- ref: actionsRef,
537
- contentEditable: false,
538
- className: classNames(`${baseCls}-send-tools`, hashId)
539
- },
540
- props.toolsRender(__spreadProps(__spreadValues({
541
- value,
542
- fileMap,
543
- onFileMapChange: setFileMap
544
- }, props), {
545
- isHover,
546
- isLoading,
547
- fileUploadStatus: fileUploadDone ? "done" : "uploading"
548
- }))
549
- ),
550
- sendActionsNode
551
- ) : sendActionsNode,
552
- (props == null ? void 0 : props.quickActionRender) || ((_o = props.refinePrompt) == null ? void 0 : _o.enable) ? /* @__PURE__ */ React.createElement(
553
- QuickActions,
554
- {
555
- ref: quickActionsRef,
556
- value,
557
- fileMap,
558
- onFileMapChange: setFileMap,
559
- isHover,
560
- isLoading,
561
- disabled: props.disabled,
562
- fileUploadStatus: fileUploadDone ? "done" : "uploading",
563
- refinePrompt: props.refinePrompt,
564
- editorRef: markdownEditorRef,
565
- onValueChange: (text) => {
566
- var _a3;
567
- setValue(text);
568
- (_a3 = props.onChange) == null ? void 0 : _a3.call(props, text);
569
- },
570
- quickActionRender: props.quickActionRender,
571
- prefixCls: baseCls,
572
- hashId,
573
- enlargeable: !!((_p = props.enlargeable) == null ? void 0 : _p.enable),
574
- isEnlarged,
575
- onEnlargeClick: handleEnlargeClick,
576
- onResize: (width, rightOffset) => {
577
- setTopRightPadding(width);
578
- setQuickRightOffset(rightOffset);
579
- }
580
- }
581
- ) : null
582
- )
583
- )
519
+ props.toolsRender(__spreadProps(__spreadValues({
520
+ value,
521
+ fileMap,
522
+ onFileMapChange: setFileMap
523
+ }, props), {
524
+ isHover,
525
+ isLoading,
526
+ fileUploadStatus: fileUploadDone ? "done" : "uploading"
527
+ }))
528
+ ),
529
+ sendActionsNode
530
+ ) : sendActionsNode,
531
+ (props == null ? void 0 : props.quickActionRender) || ((_o = props.refinePrompt) == null ? void 0 : _o.enable) ? /* @__PURE__ */ React.createElement(
532
+ QuickActions,
533
+ {
534
+ ref: quickActionsRef,
535
+ value,
536
+ fileMap,
537
+ onFileMapChange: setFileMap,
538
+ isHover,
539
+ isLoading,
540
+ disabled: props.disabled,
541
+ fileUploadStatus: fileUploadDone ? "done" : "uploading",
542
+ refinePrompt: props.refinePrompt,
543
+ editorRef: markdownEditorRef,
544
+ onValueChange: (text) => {
545
+ var _a3;
546
+ setValue(text);
547
+ (_a3 = props.onChange) == null ? void 0 : _a3.call(props, text);
548
+ },
549
+ quickActionRender: props.quickActionRender,
550
+ prefixCls: baseCls,
551
+ hashId,
552
+ enlargeable: !!((_p = props.enlargeable) == null ? void 0 : _p.enable),
553
+ isEnlarged,
554
+ onEnlargeClick: handleEnlargeClick,
555
+ onResize: (width, rightOffset) => {
556
+ setTopRightPadding(width);
557
+ setQuickRightOffset(rightOffset);
558
+ }
559
+ }
560
+ ) : null
584
561
  )
585
562
  ))
586
563
  );
@@ -65,24 +65,8 @@ var stopIconRotate = new Keyframes("stopIconRotate", {
65
65
  transform: "rotate(360deg)"
66
66
  }
67
67
  });
68
- var rotateFadeOnce = new Keyframes("rotateFadeOnce", {
69
- "0%": {
70
- "--mif-angle": "42deg",
71
- opacity: 1
72
- },
73
- "100%": {
74
- "--mif-angle": "calc(42deg + 1turn)",
75
- opacity: 0
76
- }
77
- });
78
68
  var genStyle = (token) => {
79
69
  return {
80
- // 声明 CSS 自定义属性 --mif-angle,使其可动画(需浏览器支持 @property)
81
- "@property --mif-angle": {
82
- syntax: '"<angle>"',
83
- "initial-value": "0deg",
84
- inherits: false
85
- },
86
70
  [token.componentCls]: {
87
71
  width: "100%",
88
72
  height: "100%",
@@ -101,16 +85,7 @@ var genStyle = (token) => {
101
85
  boxSizing: "border-box"
102
86
  },
103
87
  "&:active,&.active": {
104
- [`${token.componentCls}-background`]: {
105
- opacity: 0,
106
- height: "100%",
107
- backgroundImage: "radial-gradient(127% 127% at 0% 0%, rgba(255, 255, 255, 0) 57%, #EEF0F5 84%),linear-gradient(var(--mif-angle), #D7B9FF 14%, #9BA0FF 57%, #09B1FF 98%)",
108
- // 单一动画:一次性旋转并淡出
109
- animationName: rotateFadeOnce,
110
- animationDuration: "2.5s",
111
- animationTimingFunction: "ease-in-out",
112
- animationIterationCount: "1"
113
- }
88
+ outline: "1px solid transparent"
114
89
  },
115
90
  "&-enlarged": {
116
91
  "> div:last-child": {
@@ -134,28 +109,8 @@ var genStyle = (token) => {
134
109
  maxHeight: "none",
135
110
  overflow: "auto",
136
111
  width: "100%"
137
- },
138
- [`${token.componentCls}-background`]: {
139
- // 放大时保持和普通状态相同的背景效果
140
- opacity: 1
141
112
  }
142
113
  },
143
- "&-background": {
144
- boxSizing: "border-box",
145
- position: "absolute",
146
- width: "calc(100% - 4px)",
147
- height: "calc(100% - 4px)",
148
- zIndex: 2,
149
- backgroundColor: "transparent",
150
- pointerEvents: "none",
151
- borderRadius: "inherit",
152
- // 自定义属性控制线性渐变角度,默认与原始设计保持一致 42deg
153
- "--mif-angle": "42deg",
154
- // 提示浏览器该节点将频繁重绘背景图像
155
- willChange: "background-image",
156
- // 限定绘制范围,降低重绘影响
157
- contain: "paint"
158
- },
159
114
  "&-border-wrapper": {
160
115
  width: "100%",
161
116
  zIndex: 9,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.0.20",
3
+ "version": "2.0.21",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",