@ant-design/agentic-ui 2.28.0 → 2.28.2

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.
@@ -554,7 +554,7 @@ import { useStyle } from "./style";
554
554
  }
555
555
  },
556
556
  animation: {
557
- duration: isMobile ? 200 : 1000
557
+ duration: isMobile ? 200 : 400
558
558
  },
559
559
  interaction: {
560
560
  mode: 'point',
@@ -643,6 +643,9 @@ var FunnelChart = function(_param) {
643
643
  display: false
644
644
  }
645
645
  }
646
+ },
647
+ animation: {
648
+ duration: isMobile ? 200 : 400
646
649
  }
647
650
  };
648
651
  var handleDownload = function() {
@@ -334,6 +334,9 @@ var LineChart = function(_param) {
334
334
  line: {
335
335
  borderWidth: 3
336
336
  }
337
+ },
338
+ animation: {
339
+ duration: isMobile ? 200 : 400
337
340
  }
338
341
  };
339
342
  var handleDownload = function() {
@@ -525,6 +525,9 @@ var RadarChart = function(_param) {
525
525
  point: {
526
526
  hoverRadius: isMobile ? 4 : 6
527
527
  }
528
+ },
529
+ animation: {
530
+ duration: isMobile ? 200 : 400
528
531
  }
529
532
  };
530
533
  var handleDownload = function() {
@@ -576,6 +576,9 @@ var ScatterChart = function(_param) {
576
576
  point: {
577
577
  hoverRadius: isMobile ? 6 : 8
578
578
  }
579
+ },
580
+ animation: {
581
+ duration: isMobile ? 200 : 400
579
582
  }
580
583
  };
581
584
  var handleDownload = function() {
@@ -1,7 +1,54 @@
1
1
  /**
2
2
  * @fileoverview 思考块组件
3
3
  * 只读模式下渲染思考类型的代码块
4
- */ import React, { useContext } from "react";
4
+ */ function _array_like_to_array(arr, len) {
5
+ if (len == null || len > arr.length) len = arr.length;
6
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7
+ return arr2;
8
+ }
9
+ function _array_with_holes(arr) {
10
+ if (Array.isArray(arr)) return arr;
11
+ }
12
+ function _iterable_to_array_limit(arr, i) {
13
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
14
+ if (_i == null) return;
15
+ var _arr = [];
16
+ var _n = true;
17
+ var _d = false;
18
+ var _s, _e;
19
+ try {
20
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
21
+ _arr.push(_s.value);
22
+ if (i && _arr.length === i) break;
23
+ }
24
+ } catch (err) {
25
+ _d = true;
26
+ _e = err;
27
+ } finally{
28
+ try {
29
+ if (!_n && _i["return"] != null) _i["return"]();
30
+ } finally{
31
+ if (_d) throw _e;
32
+ }
33
+ }
34
+ return _arr;
35
+ }
36
+ function _non_iterable_rest() {
37
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
38
+ }
39
+ function _sliced_to_array(arr, i) {
40
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
41
+ }
42
+ function _unsupported_iterable_to_array(o, minLen) {
43
+ if (!o) return;
44
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
45
+ var n = Object.prototype.toString.call(o).slice(8, -1);
46
+ if (n === "Object" && o.constructor) n = o.constructor.name;
47
+ if (n === "Map" || n === "Set") return Array.from(n);
48
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
49
+ }
50
+ import { useMergedState } from "rc-util";
51
+ import React, { useContext, useEffect } from "react";
5
52
  import { MessagesContext } from "../../../Bubble/MessagesContent/BubbleContext";
6
53
  import { I18nContext } from "../../../I18n";
7
54
  import { EditorStoreContext } from "../../../MarkdownEditor/editor/store";
@@ -20,15 +67,28 @@ import { ToolUseBarThink } from "../../../ToolUseBarThink";
20
67
  };
21
68
  export function ThinkBlock(param) {
22
69
  var element = param.element;
23
- var _editorProps_codeProps;
70
+ var _editorProps_codeProps, _editorProps_codeProps1;
24
71
  var locale = useContext(I18nContext).locale;
25
72
  var editorProps = (useContext(EditorStoreContext) || {}).editorProps;
26
73
  var message = useContext(MessagesContext).message;
74
+ // 获取当前 Bubble 的 isFinished 状态
75
+ var bubbleIsFinished = message === null || message === void 0 ? void 0 : message.isFinished;
76
+ var _useMergedState = _sliced_to_array(useMergedState(function() {
77
+ return bubbleIsFinished ? undefined : false;
78
+ }, {
79
+ value: editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.alwaysExpandedDeepThink,
80
+ defaultValue: editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps1 = editorProps.codeProps) === null || _editorProps_codeProps1 === void 0 ? void 0 : _editorProps_codeProps1.alwaysExpandedDeepThink
81
+ }), 2), expanded = _useMergedState[0], setExpanded = _useMergedState[1];
82
+ useEffect(function() {
83
+ if (bubbleIsFinished) {
84
+ setExpanded(true);
85
+ }
86
+ }, [
87
+ bubbleIsFinished
88
+ ]);
27
89
  var rawContent = (element === null || element === void 0 ? void 0 : element.value) !== null && (element === null || element === void 0 ? void 0 : element.value) !== undefined ? String(element.value).trim() : '';
28
90
  // 恢复内容中被转义的代码块
29
91
  var content = restoreCodeBlocks(rawContent);
30
- // 获取当前 Bubble 的 isFinished 状态
31
- var bubbleIsFinished = message === null || message === void 0 ? void 0 : message.isFinished;
32
92
  // 判断是否正在加载:内容以...结尾 或者 bubble 还未完成
33
93
  var isLoading = content.endsWith('...');
34
94
  var toolNameText = isLoading ? (locale === null || locale === void 0 ? void 0 : locale['think.deepThinkingInProgress']) || '深度思考...' : (locale === null || locale === void 0 ? void 0 : locale['think.deepThinking']) || '深度思考';
@@ -41,7 +101,8 @@ export function ThinkBlock(param) {
41
101
  marginTop: 8
42
102
  }
43
103
  },
44
- expanded: (editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.alwaysExpandedDeepThink) ? true : bubbleIsFinished ? false : undefined,
104
+ expanded: expanded,
105
+ onExpandedChange: setExpanded,
45
106
  toolName: toolNameText,
46
107
  thinkContent: content,
47
108
  status: isLoading ? 'loading' : 'success'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.28.0",
3
+ "version": "2.28.2",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",