@ant-design/agentic-ui 2.30.30 → 2.30.33
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.
- package/dist/AILabel/index.d.ts +2 -0
- package/dist/AILabel/index.js +4 -2
- package/dist/AgentRunBar/Robot.js +0 -1
- package/dist/AgentRunBar/index.js +1 -0
- package/dist/AgenticLayout/index.js +1 -0
- package/dist/AnswerAlert/index.js +1 -0
- package/dist/BackTo/ScrollVisibleButton.d.ts +2 -0
- package/dist/BackTo/ScrollVisibleButton.js +4 -2
- package/dist/Bubble/AIBubble.js +6 -3
- package/dist/Bubble/List/PureBubbleList.js +24 -1
- package/dist/Bubble/List/index.js +7 -5
- package/dist/Bubble/MessagesContent/BubbleExtra.js +4 -2
- package/dist/Bubble/style.js +0 -1
- package/dist/ChatBootPage/ButtonTab.js +1 -0
- package/dist/ChatBootPage/ButtonTabGroup.js +1 -0
- package/dist/ChatBootPage/CaseReply.js +1 -0
- package/dist/ChatBootPage/Title.js +1 -0
- package/dist/ChatLayout/index.js +1 -0
- package/dist/Components/ActionIconBox/index.js +8 -8
- package/dist/Components/ActionItemBox/ActionItemBox.js +1 -0
- package/dist/Components/Button/IconButton/index.js +1 -0
- package/dist/Components/Button/SwitchButton/index.js +1 -0
- package/dist/Components/Button/ToggleButton/index.js +1 -0
- package/dist/Components/GradientText/index.js +1 -0
- package/dist/Components/LayoutHeader/index.js +2 -1
- package/dist/Components/Loading/Loading.js +2 -0
- package/dist/Components/Robot/index.js +1 -0
- package/dist/Components/SuggestionList/index.js +1 -0
- package/dist/Components/TextAnimate/index.js +1 -0
- package/dist/Components/TypingAnimation/index.js +2 -1
- package/dist/Components/VisualList/index.js +3 -0
- package/dist/Components/lotties/ThreeThinkingLottie/index.d.ts +68 -0
- package/dist/Components/lotties/ThreeThinkingLottie/index.js +151 -0
- package/dist/Components/lotties/ThreeThinkingLottie/three-thinking.json +130 -0
- package/dist/Components/lotties/index.d.ts +1 -0
- package/dist/Components/lotties/index.js +1 -0
- package/dist/History/index.js +1 -0
- package/dist/Hooks/useLanguage.d.ts +1 -0
- package/dist/I18n/locales.d.ts +1 -0
- package/dist/I18n/locales.js +2 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +2 -0
- package/dist/MarkdownEditor/editor/parser/parse/parseHtml.js +15 -6
- package/dist/MarkdownEditor/style.js +0 -4
- package/dist/MarkdownInputField/SendButton/index.d.ts +2 -2
- package/dist/MarkdownInputField/SendButton/index.js +44 -26
- package/dist/MarkdownInputField/SendButton/sendButtonPalette.d.ts +36 -0
- package/dist/MarkdownInputField/SendButton/sendButtonPalette.js +247 -0
- package/dist/MarkdownInputField/SendButton/style.js +3 -3
- package/dist/MarkdownInputField/style.js +3 -1
- package/dist/MarkdownRenderer/AnimationText.js +1 -2
- package/dist/MarkdownRenderer/CharacterQueue.js +3 -0
- package/dist/MarkdownRenderer/MarkdownRenderer.js +6 -18
- package/dist/MarkdownRenderer/markdownReactShared.d.ts +2 -1
- package/dist/MarkdownRenderer/markdownReactShared.js +57 -19
- package/dist/MarkdownRenderer/streaming/MarkdownBlockPiece.js +14 -10
- package/dist/MarkdownRenderer/streaming/fenceTracker.d.ts +7 -0
- package/dist/MarkdownRenderer/streaming/fenceTracker.js +28 -0
- package/dist/MarkdownRenderer/streaming/lastBlockThrottle.js +3 -1
- package/dist/MarkdownRenderer/streaming/useShallowMemo.d.ts +1 -0
- package/dist/MarkdownRenderer/streaming/useShallowMemo.js +36 -0
- package/dist/MarkdownRenderer/streaming/useStreamingMarkdownReact.js +6 -3
- package/dist/MarkdownRenderer/useStreaming.js +43 -41
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.d.ts +13 -3
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +19 -4
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +2 -0
- package/dist/Plugins/chart/hooks/index.d.ts +2 -0
- package/dist/Plugins/chart/hooks/index.js +1 -0
- package/dist/Plugins/chart/hooks/useDetectTheme.d.ts +46 -0
- package/dist/Plugins/chart/hooks/useDetectTheme.js +222 -0
- package/dist/Schema/SchemaEditor/index.js +1 -0
- package/dist/Schema/SchemaForm/index.js +1 -0
- package/dist/TaskList/TaskList.js +45 -16
- package/dist/TaskList/components/TaskListItem.js +2 -1
- package/dist/TaskList/constants.d.ts +1 -1
- package/dist/TaskList/constants.js +9 -4
- package/dist/TaskList/style.js +30 -12
- package/dist/ThoughtChainList/index.js +1 -0
- package/dist/ToolUseBar/index.js +7 -6
- package/dist/ToolUseBarThink/index.d.ts +0 -23
- package/dist/ToolUseBarThink/index.js +178 -315
- package/dist/ToolUseBarThink/style.js +61 -52
- package/dist/Types/quicklink.d.ts +1 -1
- package/dist/WelcomeMessage/index.js +1 -0
- package/dist/Workspace/File/FileTree/FileTreeComponent.d.ts +4 -0
- package/dist/Workspace/File/FileTree/FileTreeComponent.js +283 -0
- package/dist/Workspace/File/FileTree/index.d.ts +2 -0
- package/dist/Workspace/File/FileTree/index.js +1 -0
- package/dist/Workspace/File/FileTree/style.d.ts +8 -0
- package/dist/Workspace/File/FileTree/style.js +80 -0
- package/dist/Workspace/File/index.d.ts +2 -1
- package/dist/Workspace/File/index.js +1 -0
- package/dist/Workspace/index.d.ts +4 -2
- package/dist/Workspace/index.js +73 -36
- package/dist/Workspace/types.d.ts +70 -2
- package/package.json +2 -1
|
@@ -9,6 +9,19 @@ function _array_with_holes(arr) {
|
|
|
9
9
|
function _array_without_holes(arr) {
|
|
10
10
|
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
11
11
|
}
|
|
12
|
+
function _define_property(obj, key, value) {
|
|
13
|
+
if (key in obj) {
|
|
14
|
+
Object.defineProperty(obj, key, {
|
|
15
|
+
value: value,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
12
25
|
function _iterable_to_array(iter) {
|
|
13
26
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
14
27
|
}
|
|
@@ -60,7 +73,7 @@ import { ChevronUp } from "@sofa-design/icons";
|
|
|
60
73
|
import { ConfigProvider } from "antd";
|
|
61
74
|
import classNames from "clsx";
|
|
62
75
|
import { useMergedState } from "rc-util";
|
|
63
|
-
import React, { memo, useContext, useMemo } from "react";
|
|
76
|
+
import React, { memo, useContext, useEffect, useMemo, useState } from "react";
|
|
64
77
|
import { ActionIconBox } from "../Components/ActionIconBox";
|
|
65
78
|
import { useRefFunction } from "../Hooks/useRefFunction";
|
|
66
79
|
import { I18nContext } from "../I18n";
|
|
@@ -68,6 +81,7 @@ import { StatusIcon } from "./components/StatusIcon";
|
|
|
68
81
|
import { TaskListItem } from "./components/TaskListItem";
|
|
69
82
|
import { getArrowRotation } from "./constants";
|
|
70
83
|
import { useStyle } from "./style";
|
|
84
|
+
var SIMPLE_COLLAPSE_DURATION_MS = 350;
|
|
71
85
|
var getDefaultExpandedKeys = function getDefaultExpandedKeys(items, isControlled) {
|
|
72
86
|
return isControlled ? [] : items.map(function(item) {
|
|
73
87
|
return item.key;
|
|
@@ -99,11 +113,26 @@ export var TaskList = /*#__PURE__*/ memo(function(param) {
|
|
|
99
113
|
return onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(val);
|
|
100
114
|
}
|
|
101
115
|
}), 2), simpleExpanded = _useMergedState1[0], setSimpleExpanded = _useMergedState1[1];
|
|
116
|
+
var _useState = _sliced_to_array(useState(true), 2), shouldRenderContent = _useState[0], setShouldRenderContent = _useState[1];
|
|
102
117
|
var handleSimpleToggle = useRefFunction(function() {
|
|
103
118
|
setSimpleExpanded(function(prev) {
|
|
104
119
|
return !prev;
|
|
105
120
|
});
|
|
106
121
|
});
|
|
122
|
+
useEffect(function() {
|
|
123
|
+
if (simpleExpanded) {
|
|
124
|
+
setShouldRenderContent(true);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
var timer = window.setTimeout(function() {
|
|
128
|
+
setShouldRenderContent(false);
|
|
129
|
+
}, SIMPLE_COLLAPSE_DURATION_MS);
|
|
130
|
+
return function() {
|
|
131
|
+
window.clearTimeout(timer);
|
|
132
|
+
};
|
|
133
|
+
}, [
|
|
134
|
+
simpleExpanded
|
|
135
|
+
]);
|
|
107
136
|
var _useMemo = useMemo(function() {
|
|
108
137
|
var completedCount = items.filter(function(i) {
|
|
109
138
|
return i.status === 'success';
|
|
@@ -133,17 +162,14 @@ export var TaskList = /*#__PURE__*/ memo(function(param) {
|
|
|
133
162
|
return {
|
|
134
163
|
summaryStatus: status,
|
|
135
164
|
summaryText: text,
|
|
136
|
-
|
|
165
|
+
isCancelled: hasError,
|
|
166
|
+
lastItem: items[items.length - 1]
|
|
137
167
|
};
|
|
138
168
|
}, [
|
|
139
169
|
items,
|
|
140
170
|
locale
|
|
141
|
-
]), summaryStatus = _useMemo.summaryStatus, summaryText = _useMemo.summaryText,
|
|
142
|
-
var
|
|
143
|
-
return i.status === 'error';
|
|
144
|
-
});
|
|
145
|
-
var renderItems = function renderItems() {
|
|
146
|
-
var visibleItems = isCancelled ? items.slice(-1) : items;
|
|
171
|
+
]), summaryStatus = _useMemo.summaryStatus, summaryText = _useMemo.summaryText, isCancelled = _useMemo.isCancelled, lastItem = _useMemo.lastItem;
|
|
172
|
+
var renderItems = function renderItems(visibleItems) {
|
|
147
173
|
return visibleItems.map(function(item, index) {
|
|
148
174
|
return /*#__PURE__*/ React.createElement(TaskListItem, {
|
|
149
175
|
key: item.key,
|
|
@@ -158,11 +184,15 @@ export var TaskList = /*#__PURE__*/ memo(function(param) {
|
|
|
158
184
|
};
|
|
159
185
|
if (variant !== 'simple') {
|
|
160
186
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
161
|
-
className: className
|
|
162
|
-
|
|
187
|
+
className: className,
|
|
188
|
+
"data-testid": prefixCls
|
|
189
|
+
}, renderItems(items)));
|
|
163
190
|
}
|
|
164
191
|
var simpleCls = "".concat(prefixCls, "-simple");
|
|
165
192
|
var simpleArrowTitle = simpleExpanded ? (locale === null || locale === void 0 ? void 0 : locale['taskList.collapse']) || '收起' : (locale === null || locale === void 0 ? void 0 : locale['taskList.expand']) || '展开';
|
|
193
|
+
var visibleItems = simpleExpanded ? isCancelled ? items.slice(-1) : items : lastItem ? [
|
|
194
|
+
lastItem
|
|
195
|
+
] : [];
|
|
166
196
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
167
197
|
className: classNames("".concat(simpleCls, "-wrapper"), hashId, className),
|
|
168
198
|
"data-testid": "task-list-simple-wrapper"
|
|
@@ -181,10 +211,9 @@ export var TaskList = /*#__PURE__*/ memo(function(param) {
|
|
|
181
211
|
prefixCls: prefixCls,
|
|
182
212
|
hashId: hashId
|
|
183
213
|
})), /*#__PURE__*/ React.createElement("div", {
|
|
214
|
+
key: summaryText,
|
|
184
215
|
className: classNames("".concat(simpleCls, "-text"), hashId)
|
|
185
216
|
}, summaryText), /*#__PURE__*/ React.createElement("div", {
|
|
186
|
-
className: classNames("".concat(simpleCls, "-progress"), hashId)
|
|
187
|
-
}, progressText), /*#__PURE__*/ React.createElement("div", {
|
|
188
217
|
className: classNames("".concat(simpleCls, "-arrow"), hashId)
|
|
189
218
|
}, /*#__PURE__*/ React.createElement(ActionIconBox, {
|
|
190
219
|
title: simpleArrowTitle,
|
|
@@ -196,10 +225,10 @@ export var TaskList = /*#__PURE__*/ memo(function(param) {
|
|
|
196
225
|
}
|
|
197
226
|
}, /*#__PURE__*/ React.createElement(ChevronUp, {
|
|
198
227
|
"data-testid": "task-list-simple-arrow"
|
|
199
|
-
})))),
|
|
200
|
-
className: classNames("".concat(simpleCls, "-content"), hashId)
|
|
201
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
228
|
+
})))), /*#__PURE__*/ React.createElement("div", {
|
|
229
|
+
className: classNames("".concat(simpleCls, "-content"), hashId, _define_property({}, "".concat(simpleCls, "-content-expanded"), simpleExpanded))
|
|
230
|
+
}, shouldRenderContent ? /*#__PURE__*/ React.createElement("div", {
|
|
202
231
|
className: classNames("".concat(simpleCls, "-list"), hashId)
|
|
203
|
-
}, renderItems()))));
|
|
232
|
+
}, renderItems(visibleItems)) : null)));
|
|
204
233
|
});
|
|
205
234
|
TaskList.displayName = 'TaskList';
|
|
@@ -35,7 +35,8 @@ export var TaskListItem = /*#__PURE__*/ memo(function(param) {
|
|
|
35
35
|
className: classNames("".concat(prefixCls, "-dash-line"), hashId),
|
|
36
36
|
"data-testid": "task-list-dash-line"
|
|
37
37
|
}))), /*#__PURE__*/ React.createElement("div", {
|
|
38
|
-
className: classNames("".concat(prefixCls, "-right"), hashId)
|
|
38
|
+
className: classNames("".concat(prefixCls, "-right"), hashId),
|
|
39
|
+
"data-testid": "task-list-right"
|
|
39
40
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
40
41
|
className: classNames("".concat(prefixCls, "-top"), hashId),
|
|
41
42
|
onClick: handleToggle
|
|
@@ -11,7 +11,7 @@ export var COLLAPSE_VARIANTS = {
|
|
|
11
11
|
};
|
|
12
12
|
export var COLLAPSE_TRANSITION = {
|
|
13
13
|
height: {
|
|
14
|
-
duration: 0.
|
|
14
|
+
duration: 0.35,
|
|
15
15
|
ease: [
|
|
16
16
|
0.4,
|
|
17
17
|
0,
|
|
@@ -20,14 +20,19 @@ export var COLLAPSE_TRANSITION = {
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
opacity: {
|
|
23
|
-
duration: 0.
|
|
24
|
-
ease:
|
|
23
|
+
duration: 0.25,
|
|
24
|
+
ease: [
|
|
25
|
+
0.4,
|
|
26
|
+
0,
|
|
27
|
+
0.2,
|
|
28
|
+
1
|
|
29
|
+
]
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
32
|
export var getArrowRotation = function getArrowRotation(collapsed) {
|
|
28
33
|
return {
|
|
29
34
|
transform: collapsed ? 'rotate(0deg)' : 'rotate(180deg)',
|
|
30
|
-
transition: 'transform 0.
|
|
35
|
+
transition: 'transform 0.35s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
31
36
|
};
|
|
32
37
|
};
|
|
33
38
|
export var hasTaskContent = function hasTaskContent(content) {
|
package/dist/TaskList/style.js
CHANGED
|
@@ -130,7 +130,7 @@ var genStyle = function genStyle(token) {
|
|
|
130
130
|
flexShrink: 0,
|
|
131
131
|
width: 16,
|
|
132
132
|
height: 16,
|
|
133
|
-
transition: 'all 0.
|
|
133
|
+
transition: 'all 0.35s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
134
134
|
}), _obj),
|
|
135
135
|
'&-body': _define_property({
|
|
136
136
|
display: 'flex'
|
|
@@ -146,8 +146,6 @@ var genStyle = function genStyle(token) {
|
|
|
146
146
|
// Simple variant - wrapper
|
|
147
147
|
'&-simple-wrapper': {
|
|
148
148
|
borderRadius: 'var(--radius-control-base, 8px)',
|
|
149
|
-
background: 'var(--color-gray-bg-page-dark, #f5f5f5)',
|
|
150
|
-
boxShadow: 'var(--shadow-control-base, none)',
|
|
151
149
|
overflow: 'hidden'
|
|
152
150
|
},
|
|
153
151
|
// Simple variant - bar
|
|
@@ -155,11 +153,12 @@ var genStyle = function genStyle(token) {
|
|
|
155
153
|
display: 'flex',
|
|
156
154
|
alignItems: 'center',
|
|
157
155
|
height: 36,
|
|
158
|
-
padding: '0
|
|
156
|
+
padding: '0 4px',
|
|
159
157
|
gap: 8,
|
|
160
158
|
cursor: 'pointer',
|
|
161
159
|
userSelect: 'none',
|
|
162
|
-
|
|
160
|
+
borderRadius: 'var(--radius-control-base, 8px)',
|
|
161
|
+
transition: 'background 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
163
162
|
'&:hover': {
|
|
164
163
|
background: 'var(--color-gray-control-fill-active, rgba(0,0,0,0.04))'
|
|
165
164
|
}
|
|
@@ -181,23 +180,42 @@ var genStyle = function genStyle(token) {
|
|
|
181
180
|
color: 'var(--color-gray-text-default, rgba(0,3,9,0.85))',
|
|
182
181
|
overflow: 'hidden',
|
|
183
182
|
textOverflow: 'ellipsis',
|
|
184
|
-
whiteSpace: 'nowrap'
|
|
185
|
-
|
|
186
|
-
flexShrink: 0,
|
|
187
|
-
font: 'var(--font-text-paragraph-sm, 12px)',
|
|
188
|
-
color: 'var(--color-gray-text-secondary, rgba(0,3,9,0.45))'
|
|
183
|
+
whiteSpace: 'nowrap',
|
|
184
|
+
animation: 'taskTextFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
189
185
|
}), _define_property(_obj1, "".concat(componentCls, "-simple-arrow"), {
|
|
190
186
|
flexShrink: 0,
|
|
191
187
|
display: 'flex',
|
|
192
188
|
alignItems: 'center',
|
|
193
189
|
justifyContent: 'center'
|
|
194
190
|
}), _obj1),
|
|
195
|
-
// Simple variant -
|
|
191
|
+
// Simple variant - content area
|
|
196
192
|
'&-simple-content': {
|
|
197
|
-
|
|
193
|
+
display: 'grid',
|
|
194
|
+
gridTemplateRows: '0fr',
|
|
195
|
+
opacity: 0,
|
|
196
|
+
transition: 'grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
197
|
+
'& > *': {
|
|
198
|
+
overflow: 'hidden'
|
|
199
|
+
},
|
|
200
|
+
'&-expanded': {
|
|
201
|
+
gridTemplateRows: '1fr',
|
|
202
|
+
opacity: 1
|
|
203
|
+
}
|
|
198
204
|
},
|
|
199
205
|
'&-simple-list': {
|
|
200
206
|
padding: '4px 12px 8px'
|
|
207
|
+
},
|
|
208
|
+
'@keyframes taskTextFadeIn': {
|
|
209
|
+
'0%': {
|
|
210
|
+
opacity: 0,
|
|
211
|
+
filter: 'blur(4px)',
|
|
212
|
+
transform: 'translateY(2px)'
|
|
213
|
+
},
|
|
214
|
+
'100%': {
|
|
215
|
+
opacity: 1,
|
|
216
|
+
filter: 'blur(0)',
|
|
217
|
+
transform: 'translateY(0)'
|
|
218
|
+
}
|
|
201
219
|
}
|
|
202
220
|
});
|
|
203
221
|
};
|
|
@@ -486,6 +486,7 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
|
|
|
486
486
|
locale: locale
|
|
487
487
|
}), /*#__PURE__*/ React.createElement("div", {
|
|
488
488
|
className: classNames("".concat(prefixCls), hashId),
|
|
489
|
+
"data-testid": prefixCls,
|
|
489
490
|
style: restStyle
|
|
490
491
|
}, /*#__PURE__*/ React.createElement(motion.div, {
|
|
491
492
|
className: classNames("".concat(prefixCls, "-container"), hashId, _define_property({}, "".concat(prefixCls, "-container-loading"), !(bubble === null || bubble === void 0 ? void 0 : bubble.isFinished)))
|
package/dist/ToolUseBar/index.js
CHANGED
|
@@ -155,13 +155,14 @@ export * from "./BarItem";
|
|
|
155
155
|
* - 提供加载状态显示
|
|
156
156
|
* - 支持错误状态处理
|
|
157
157
|
*/ var ToolUseBarComponent = function ToolUseBarComponent(_0) {
|
|
158
|
-
var tools = _0.tools, onActiveKeysChange = _0.onActiveKeysChange, onExpandedKeysChange = _0.onExpandedKeysChange, _0_light = _0.light, light = _0_light === void 0 ? false : _0_light, _0_disableAnimation = _0.disableAnimation, disableAnimation = _0_disableAnimation === void 0 ? false : _0_disableAnimation, style = _0.style, props = _object_without_properties(_0, [
|
|
158
|
+
var tools = _0.tools, onActiveKeysChange = _0.onActiveKeysChange, onExpandedKeysChange = _0.onExpandedKeysChange, _0_light = _0.light, light = _0_light === void 0 ? false : _0_light, _0_disableAnimation = _0.disableAnimation, disableAnimation = _0_disableAnimation === void 0 ? false : _0_disableAnimation, style = _0.style, testId = _0.testId, props = _object_without_properties(_0, [
|
|
159
159
|
"tools",
|
|
160
160
|
"onActiveKeysChange",
|
|
161
161
|
"onExpandedKeysChange",
|
|
162
162
|
"light",
|
|
163
163
|
"disableAnimation",
|
|
164
|
-
"style"
|
|
164
|
+
"style",
|
|
165
|
+
"testId"
|
|
165
166
|
]);
|
|
166
167
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
167
168
|
var prefixCls = getPrefixCls('agentic-tool-use-bar');
|
|
@@ -246,13 +247,13 @@ export * from "./BarItem";
|
|
|
246
247
|
]);
|
|
247
248
|
if (!(tools === null || tools === void 0 ? void 0 : tools.length)) return /*#__PURE__*/ React.createElement("div", {
|
|
248
249
|
className: containerClassName,
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
"data-testid": testId !== null && testId !== void 0 ? testId : 'ToolUse',
|
|
251
|
+
style: style
|
|
251
252
|
});
|
|
252
253
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
253
254
|
className: containerClassName,
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
"data-testid": testId !== null && testId !== void 0 ? testId : 'ToolUse',
|
|
256
|
+
style: style
|
|
256
257
|
}, toolItems));
|
|
257
258
|
};
|
|
258
259
|
// 使用 memo 优化组件,避免不必要的重新渲染
|
|
@@ -1,44 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* ToolUseBarThink 组件属性
|
|
4
|
-
*/
|
|
5
2
|
export interface ToolUseBarThinkProps {
|
|
6
|
-
/** 工具名称 */
|
|
7
3
|
toolName: React.ReactNode;
|
|
8
|
-
/** 工具目标 */
|
|
9
4
|
toolTarget?: React.ReactNode;
|
|
10
|
-
/** 时间显示 */
|
|
11
5
|
time?: React.ReactNode;
|
|
12
|
-
/** 自定义图标 */
|
|
13
6
|
icon?: React.ReactNode;
|
|
14
|
-
/** 思考内容 */
|
|
15
7
|
thinkContent?: React.ReactNode;
|
|
16
|
-
/** 测试ID */
|
|
17
8
|
testId?: string;
|
|
18
|
-
/** 状态 */
|
|
19
9
|
status?: 'loading' | 'success' | 'error';
|
|
20
|
-
/** 是否展开 */
|
|
21
10
|
expanded?: boolean;
|
|
22
|
-
/** 轻量模式 */
|
|
23
11
|
light?: boolean;
|
|
24
|
-
/** 默认展开状态 */
|
|
25
12
|
defaultExpanded?: boolean;
|
|
26
|
-
/** 展开状态变更回调 */
|
|
27
13
|
onExpandedChange?: (expanded: boolean) => void;
|
|
28
|
-
/** 浮动展开状态 */
|
|
29
14
|
floatingExpanded?: boolean;
|
|
30
|
-
/** 默认浮动展开状态 */
|
|
31
15
|
defaultFloatingExpanded?: boolean;
|
|
32
|
-
/** 浮动展开状态变更回调 */
|
|
33
16
|
onFloatingExpandedChange?: (floatingExpanded: boolean) => void;
|
|
34
|
-
/** 自定义类名 */
|
|
35
17
|
classNames?: {
|
|
36
18
|
root?: string;
|
|
37
19
|
bar?: string;
|
|
38
20
|
header?: string;
|
|
39
|
-
headerLeft?: string;
|
|
40
21
|
imageWrapper?: string;
|
|
41
|
-
image?: string;
|
|
42
22
|
name?: string;
|
|
43
23
|
target?: string;
|
|
44
24
|
time?: string;
|
|
@@ -47,14 +27,11 @@ export interface ToolUseBarThinkProps {
|
|
|
47
27
|
content?: string;
|
|
48
28
|
floatingExpand?: string;
|
|
49
29
|
};
|
|
50
|
-
/** 自定义样式 */
|
|
51
30
|
styles?: {
|
|
52
31
|
root?: React.CSSProperties;
|
|
53
32
|
bar?: React.CSSProperties;
|
|
54
33
|
header?: React.CSSProperties;
|
|
55
|
-
headerLeft?: React.CSSProperties;
|
|
56
34
|
imageWrapper?: React.CSSProperties;
|
|
57
|
-
image?: React.CSSProperties;
|
|
58
35
|
name?: React.CSSProperties;
|
|
59
36
|
target?: React.CSSProperties;
|
|
60
37
|
time?: React.CSSProperties;
|