@ant-design/agentic-ui 2.27.8 → 2.27.9

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.
@@ -2,6 +2,7 @@
2
2
  * @fileoverview 思考块组件
3
3
  * 只读模式下渲染思考类型的代码块
4
4
  */ import React, { useContext } from "react";
5
+ import { MessagesContext } from "../../../Bubble/MessagesContent/BubbleContext";
5
6
  import { I18nContext } from "../../../I18n";
6
7
  import { EditorStoreContext } from "../../../MarkdownEditor/editor/store";
7
8
  import { ToolUseBarThink } from "../../../ToolUseBarThink";
@@ -22,9 +23,13 @@ export function ThinkBlock(param) {
22
23
  var _editorProps_codeProps;
23
24
  var locale = useContext(I18nContext).locale;
24
25
  var editorProps = (useContext(EditorStoreContext) || {}).editorProps;
26
+ var message = useContext(MessagesContext).message;
25
27
  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() : '';
26
28
  // 恢复内容中被转义的代码块
27
29
  var content = restoreCodeBlocks(rawContent);
30
+ // 获取当前 Bubble 的 isFinished 状态
31
+ var bubbleIsFinished = message === null || message === void 0 ? void 0 : message.isFinished;
32
+ // 判断是否正在加载:内容以...结尾 或者 bubble 还未完成
28
33
  var isLoading = content.endsWith('...');
29
34
  var toolNameText = isLoading ? (locale === null || locale === void 0 ? void 0 : locale['think.deepThinkingInProgress']) || '深度思考...' : (locale === null || locale === void 0 ? void 0 : locale['think.deepThinking']) || '深度思考';
30
35
  return /*#__PURE__*/ React.createElement(ToolUseBarThink, {
@@ -32,10 +37,11 @@ export function ThinkBlock(param) {
32
37
  styles: {
33
38
  root: {
34
39
  boxSizing: 'border-box',
35
- maxWidth: '680px'
40
+ maxWidth: '680px',
41
+ marginTop: 16
36
42
  }
37
43
  },
38
- expanded: (editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.alwaysExpandedDeepThink) ? true : undefined,
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,
39
45
  toolName: toolNameText,
40
46
  thinkContent: content,
41
47
  status: isLoading ? 'loading' : 'success'
@@ -2,8 +2,8 @@ import { ConfigProvider } from "antd";
2
2
  import classNames from "classnames";
3
3
  import React, { useContext, useMemo, useRef } from "react";
4
4
  import { useIntersectionOnce } from "../../Hooks/useIntersectionOnce";
5
- import { useMermaidRender } from "./useMermaidRender";
6
5
  import { useStyle } from "./style";
6
+ import { useMermaidRender } from "./useMermaidRender";
7
7
  /**
8
8
  * Mermaid 渲染器组件实现
9
9
  * 负责实际的图表渲染逻辑
@@ -62,9 +62,9 @@ import classNames from "classnames";
62
62
  import { AnimatePresence, motion } from "framer-motion";
63
63
  import { useMergedState } from "rc-util";
64
64
  import React, { memo, useContext, useMemo } from "react";
65
- import { useRefFunction } from "../Hooks/useRefFunction";
66
65
  import { ActionIconBox } from "../Components/ActionIconBox";
67
66
  import { Loading } from "../Components/Loading";
67
+ import { useRefFunction } from "../Hooks/useRefFunction";
68
68
  import { I18nContext } from "../I18n";
69
69
  import { useStyle } from "./style";
70
70
  var LOADING_SIZE = 16;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.27.8",
3
+ "version": "2.27.9",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",