@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
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _define_property(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
function _iterable_to_array_limit(arr, i) {
|
|
23
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
24
|
+
if (_i == null) return;
|
|
25
|
+
var _arr = [];
|
|
26
|
+
var _n = true;
|
|
27
|
+
var _d = false;
|
|
28
|
+
var _s, _e;
|
|
29
|
+
try {
|
|
30
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
31
|
+
_arr.push(_s.value);
|
|
32
|
+
if (i && _arr.length === i) break;
|
|
33
|
+
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
_d = true;
|
|
36
|
+
_e = err;
|
|
37
|
+
} finally{
|
|
38
|
+
try {
|
|
39
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
40
|
+
} finally{
|
|
41
|
+
if (_d) throw _e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return _arr;
|
|
45
|
+
}
|
|
46
|
+
function _non_iterable_rest() {
|
|
47
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
48
|
+
}
|
|
49
|
+
function _object_spread(target) {
|
|
50
|
+
for(var i = 1; i < arguments.length; i++){
|
|
51
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
52
|
+
var ownKeys = Object.keys(source);
|
|
53
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
54
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
ownKeys.forEach(function(key) {
|
|
59
|
+
_define_property(target, key, source[key]);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return target;
|
|
63
|
+
}
|
|
64
|
+
function _sliced_to_array(arr, i) {
|
|
65
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
66
|
+
}
|
|
67
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
68
|
+
if (!o) return;
|
|
69
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
70
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
71
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
72
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
73
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
74
|
+
}
|
|
75
|
+
import Lottie from "lottie-react";
|
|
76
|
+
import React, { useEffect, useState } from "react";
|
|
77
|
+
/**
|
|
78
|
+
* ThreeThinkingLottie 组件 - 支持按需加载的思考动画组件
|
|
79
|
+
*
|
|
80
|
+
* 该组件使用动态 import 实现 lottie JSON 文件的按需加载,
|
|
81
|
+
* 避免将动画数据打包进主包,减少首屏加载体积。
|
|
82
|
+
*
|
|
83
|
+
* @component
|
|
84
|
+
* @description 支持按需加载的 Lottie 思考动画组件
|
|
85
|
+
* @param {ThreeThinkingLottieProps} props - 组件属性
|
|
86
|
+
* @param {boolean} [props.autoplay=true] - 是否自动播放动画
|
|
87
|
+
* @param {boolean} [props.loop=true] - 是否循环播放动画
|
|
88
|
+
* @param {string} [props.className] - 动画容器类名
|
|
89
|
+
* @param {React.CSSProperties} [props.style] - 动画容器样式
|
|
90
|
+
* @param {number} [props.size=32] - 动画尺寸
|
|
91
|
+
* @param {React.ReactNode} [props.fallback] - 加载占位符
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```tsx
|
|
95
|
+
* // 基础用法
|
|
96
|
+
* <ThreeThinkingLottie />
|
|
97
|
+
*
|
|
98
|
+
* // 自定义尺寸
|
|
99
|
+
* <ThreeThinkingLottie size={48} />
|
|
100
|
+
*
|
|
101
|
+
* // 自定义加载占位符
|
|
102
|
+
* <ThreeThinkingLottie fallback={<Spin />} />
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @returns {React.ReactElement} 渲染的 Lottie 思考动画组件
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* - 使用动态 import 按需加载 lottie JSON 文件
|
|
109
|
+
* - 减少首屏加载体积
|
|
110
|
+
* - 支持自定义加载占位符
|
|
111
|
+
* - 支持自定义尺寸和样式
|
|
112
|
+
*/ export var ThreeThinkingLottie = function ThreeThinkingLottie(param) {
|
|
113
|
+
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, _param_size = param.size, size = _param_size === void 0 ? 32 : _param_size, fallback = param.fallback;
|
|
114
|
+
var _useState = _sliced_to_array(useState(null), 2), animationData = _useState[0], setAnimationData = _useState[1];
|
|
115
|
+
useEffect(function() {
|
|
116
|
+
// 动态加载 lottie JSON 文件
|
|
117
|
+
import("./three-thinking.json").then(function(data) {
|
|
118
|
+
setAnimationData(data.default || data);
|
|
119
|
+
}).catch(function(error) {
|
|
120
|
+
console.error('Failed to load ThreeThinkingLottie animation:', error);
|
|
121
|
+
});
|
|
122
|
+
}, []);
|
|
123
|
+
var containerStyle = _object_spread({
|
|
124
|
+
width: size,
|
|
125
|
+
height: size,
|
|
126
|
+
display: 'flex',
|
|
127
|
+
justifyContent: 'center',
|
|
128
|
+
alignItems: 'center'
|
|
129
|
+
}, style);
|
|
130
|
+
// 默认占位符
|
|
131
|
+
var defaultFallback = /*#__PURE__*/ React.createElement("div", {
|
|
132
|
+
style: containerStyle,
|
|
133
|
+
className: className
|
|
134
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
135
|
+
style: {
|
|
136
|
+
opacity: 0.3
|
|
137
|
+
}
|
|
138
|
+
}, "..."));
|
|
139
|
+
if (!animationData) {
|
|
140
|
+
return fallback !== undefined ? /*#__PURE__*/ React.createElement(React.Fragment, null, fallback) : defaultFallback;
|
|
141
|
+
}
|
|
142
|
+
return /*#__PURE__*/ React.createElement(Lottie, {
|
|
143
|
+
style: containerStyle,
|
|
144
|
+
className: className,
|
|
145
|
+
"aria-hidden": "true",
|
|
146
|
+
animationData: animationData,
|
|
147
|
+
loop: loop,
|
|
148
|
+
autoplay: autoplay
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
export default ThreeThinkingLottie;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": "5.7.4",
|
|
3
|
+
"fr": 30,
|
|
4
|
+
"ip": 0,
|
|
5
|
+
"op": 60,
|
|
6
|
+
"w": 32,
|
|
7
|
+
"h": 32,
|
|
8
|
+
"nm": "ThreeThinking",
|
|
9
|
+
"ddd": 0,
|
|
10
|
+
"assets": [],
|
|
11
|
+
"layers": [
|
|
12
|
+
{
|
|
13
|
+
"ddd": 0,
|
|
14
|
+
"ind": 1,
|
|
15
|
+
"ty": 4,
|
|
16
|
+
"nm": "Thinking Dot 1",
|
|
17
|
+
"sr": 1,
|
|
18
|
+
"ks": {
|
|
19
|
+
"o": { "a": 0, "k": 100 },
|
|
20
|
+
"r": { "a": 0, "k": 0 },
|
|
21
|
+
"p": { "a": 0, "k": [10, 16, 0] },
|
|
22
|
+
"a": { "a": 0, "k": [0, 0, 0] },
|
|
23
|
+
"s": {
|
|
24
|
+
"a": 1,
|
|
25
|
+
"k": [
|
|
26
|
+
{ "t": 0, "s": [100, 100, 100], "e": [60, 60, 100] },
|
|
27
|
+
{ "t": 15, "s": [60, 60, 100], "e": [100, 100, 100] },
|
|
28
|
+
{ "t": 30, "s": [100, 100, 100] }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"ao": 0,
|
|
33
|
+
"shapes": [
|
|
34
|
+
{
|
|
35
|
+
"ty": "el",
|
|
36
|
+
"d": 1,
|
|
37
|
+
"s": { "a": 0, "k": [6, 6] },
|
|
38
|
+
"p": { "a": 0, "k": [0, 0] }
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"ty": "fl",
|
|
42
|
+
"c": { "a": 0, "k": [0.09, 0.47, 1, 1] },
|
|
43
|
+
"o": { "a": 0, "k": 100 }
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"ip": 0,
|
|
47
|
+
"op": 60,
|
|
48
|
+
"st": 0
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"ddd": 0,
|
|
52
|
+
"ind": 2,
|
|
53
|
+
"ty": 4,
|
|
54
|
+
"nm": "Thinking Dot 2",
|
|
55
|
+
"sr": 1,
|
|
56
|
+
"ks": {
|
|
57
|
+
"o": { "a": 0, "k": 100 },
|
|
58
|
+
"r": { "a": 0, "k": 0 },
|
|
59
|
+
"p": { "a": 0, "k": [16, 16, 0] },
|
|
60
|
+
"a": { "a": 0, "k": [0, 0, 0] },
|
|
61
|
+
"s": {
|
|
62
|
+
"a": 1,
|
|
63
|
+
"k": [
|
|
64
|
+
{ "t": 0, "s": [100, 100, 100], "e": [60, 60, 100] },
|
|
65
|
+
{ "t": 10, "s": [60, 60, 100], "e": [100, 100, 100] },
|
|
66
|
+
{ "t": 20, "s": [100, 100, 100], "e": [60, 60, 100] },
|
|
67
|
+
{ "t": 30, "s": [60, 60, 100], "e": [100, 100, 100] },
|
|
68
|
+
{ "t": 40, "s": [100, 100, 100] }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"ao": 0,
|
|
73
|
+
"shapes": [
|
|
74
|
+
{
|
|
75
|
+
"ty": "el",
|
|
76
|
+
"d": 1,
|
|
77
|
+
"s": { "a": 0, "k": [6, 6] },
|
|
78
|
+
"p": { "a": 0, "k": [0, 0] }
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"ty": "fl",
|
|
82
|
+
"c": { "a": 0, "k": [0.09, 0.47, 1, 1] },
|
|
83
|
+
"o": { "a": 0, "k": 100 }
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"ip": 0,
|
|
87
|
+
"op": 60,
|
|
88
|
+
"st": 0
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"ddd": 0,
|
|
92
|
+
"ind": 3,
|
|
93
|
+
"ty": 4,
|
|
94
|
+
"nm": "Thinking Dot 3",
|
|
95
|
+
"sr": 1,
|
|
96
|
+
"ks": {
|
|
97
|
+
"o": { "a": 0, "k": 100 },
|
|
98
|
+
"r": { "a": 0, "k": 0 },
|
|
99
|
+
"p": { "a": 0, "k": [22, 16, 0] },
|
|
100
|
+
"a": { "a": 0, "k": [0, 0, 0] },
|
|
101
|
+
"s": {
|
|
102
|
+
"a": 1,
|
|
103
|
+
"k": [
|
|
104
|
+
{ "t": 0, "s": [60, 60, 100], "e": [100, 100, 100] },
|
|
105
|
+
{ "t": 15, "s": [100, 100, 100], "e": [60, 60, 100] },
|
|
106
|
+
{ "t": 30, "s": [60, 60, 100] }
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"ao": 0,
|
|
111
|
+
"shapes": [
|
|
112
|
+
{
|
|
113
|
+
"ty": "el",
|
|
114
|
+
"d": 1,
|
|
115
|
+
"s": { "a": 0, "k": [6, 6] },
|
|
116
|
+
"p": { "a": 0, "k": [0, 0] }
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"ty": "fl",
|
|
120
|
+
"c": { "a": 0, "k": [0.09, 0.47, 1, 1] },
|
|
121
|
+
"o": { "a": 0, "k": 100 }
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"ip": 0,
|
|
125
|
+
"op": 60,
|
|
126
|
+
"st": 0
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"markers": []
|
|
130
|
+
}
|
package/dist/History/index.js
CHANGED
|
@@ -274,6 +274,7 @@ export * from "./utils";
|
|
|
274
274
|
if (props.standalone) {
|
|
275
275
|
var _props_agent3, _props_agent4, _props_agent5, _props_agent6, _props_agent7, _props_slots_beforeHistoryList, _props_slots;
|
|
276
276
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
277
|
+
"data-testid": "history-standalone",
|
|
277
278
|
style: {
|
|
278
279
|
display: 'flex',
|
|
279
280
|
flexDirection: 'column',
|
|
@@ -289,6 +289,7 @@ export declare function useLanguage(): {
|
|
|
289
289
|
'workspace.browser': string;
|
|
290
290
|
'workspace.task': string;
|
|
291
291
|
'workspace.file': string;
|
|
292
|
+
'workspace.fileTree': string;
|
|
292
293
|
'workspace.custom': string;
|
|
293
294
|
'workspace.terminalExecution': string;
|
|
294
295
|
'workspace.createHtmlFile': string;
|
package/dist/I18n/locales.d.ts
CHANGED
|
@@ -251,6 +251,7 @@ export declare const cnLabels: {
|
|
|
251
251
|
'workspace.browser': string;
|
|
252
252
|
'workspace.task': string;
|
|
253
253
|
'workspace.file': string;
|
|
254
|
+
'workspace.fileTree': string;
|
|
254
255
|
'workspace.custom': string;
|
|
255
256
|
'workspace.terminalExecution': string;
|
|
256
257
|
'workspace.createHtmlFile': string;
|
package/dist/I18n/locales.js
CHANGED
|
@@ -262,6 +262,7 @@
|
|
|
262
262
|
'workspace.browser': '浏览器',
|
|
263
263
|
'workspace.task': '任务',
|
|
264
264
|
'workspace.file': '文件',
|
|
265
|
+
'workspace.fileTree': '文件树',
|
|
265
266
|
'workspace.custom': '自定义',
|
|
266
267
|
'workspace.terminalExecution': '终端执行',
|
|
267
268
|
'workspace.createHtmlFile': '创建 HTML 文件',
|
|
@@ -722,6 +723,7 @@
|
|
|
722
723
|
'workspace.browser': 'Browser',
|
|
723
724
|
'workspace.task': 'Task',
|
|
724
725
|
'workspace.file': 'File',
|
|
726
|
+
'workspace.fileTree': 'File tree',
|
|
725
727
|
'workspace.custom': 'Custom',
|
|
726
728
|
'workspace.terminalExecution': 'Terminal execution',
|
|
727
729
|
'workspace.createHtmlFile': 'Create HTML file',
|
|
@@ -394,6 +394,7 @@ var I18nBoundary = function I18nBoundary(param) {
|
|
|
394
394
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
395
395
|
id: props.id ? String(props.id) || undefined : undefined,
|
|
396
396
|
className: classNames(baseClassName, 'markdown-editor', hashId, props.className, (_obj = {}, _define_property(_obj, "".concat(baseClassName, "-readonly"), true), _define_property(_obj, "".concat(baseClassName, "-report"), props.reportMode), _define_property(_obj, "".concat(baseClassName, "-slide"), props.slideMode), _obj)),
|
|
397
|
+
"data-testid": "markdown-editor",
|
|
397
398
|
style: _object_spread({
|
|
398
399
|
width: width || '100%',
|
|
399
400
|
height: height || 'auto'
|
|
@@ -453,6 +454,7 @@ var I18nBoundary = function I18nBoundary(param) {
|
|
|
453
454
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
454
455
|
id: props.id ? String(props.id) || undefined : undefined,
|
|
455
456
|
className: classNames(baseClassName, 'markdown-editor', hashId, props.className, (_obj1 = {}, _define_property(_obj1, "".concat(baseClassName, "-readonly"), readonly), _define_property(_obj1, "".concat(baseClassName, "-edit"), !readonly), _define_property(_obj1, "".concat(baseClassName, "-report"), props.reportMode), _define_property(_obj1, "".concat(baseClassName, "-slide"), props.slideMode), _obj1)),
|
|
457
|
+
"data-testid": "markdown-editor",
|
|
456
458
|
style: _object_spread({
|
|
457
459
|
width: width || '100%',
|
|
458
460
|
height: height || 'auto'
|
|
@@ -123,22 +123,31 @@ import partialJsonParse from "../json-parse";
|
|
|
123
123
|
var THINK_TAG_CANONICAL_CLOSE = '</think>';
|
|
124
124
|
/** 部分模型输出的外壳别名;拼接避免与规范标签在源码中混淆 */ var REDACTED_THINKING_ALIAS_OPEN = '<' + 'redacted_' + 'thinking' + '>';
|
|
125
125
|
var REDACTED_THINKING_ALIAS_CLOSE = '</' + 'redacted_' + 'thinking' + '>';
|
|
126
|
+
var THINKING_ALIAS_OPEN = '<' + 'thinking' + '>';
|
|
127
|
+
var THINKING_ALIAS_CLOSE = '</' + 'thinking' + '>';
|
|
126
128
|
var escapeRegExp = function escapeRegExp(value) {
|
|
127
129
|
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
128
130
|
};
|
|
129
131
|
/** 仅替换「成对」别名标签,避免正文里偶然出现的孤立字面量被误换 */ var REDACTED_THINKING_ALIAS_PAIR_REGEX = new RegExp("".concat(escapeRegExp(REDACTED_THINKING_ALIAS_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(REDACTED_THINKING_ALIAS_CLOSE)), 'gi');
|
|
132
|
+
var THINKING_ALIAS_PAIR_REGEX = new RegExp("".concat(escapeRegExp(THINKING_ALIAS_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(THINKING_ALIAS_CLOSE)), 'gi');
|
|
130
133
|
var FIND_THINK_CANONICAL_BLOCK_RE = new RegExp("^\\s*".concat(escapeRegExp(THINK_TAG_CANONICAL_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(THINK_TAG_CANONICAL_CLOSE), "\\s*$"), 'i');
|
|
131
|
-
var FIND_THINK_ALIAS_BLOCK_RE = new RegExp("^\\s*".concat(escapeRegExp(REDACTED_THINKING_ALIAS_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(REDACTED_THINKING_ALIAS_CLOSE), "\\s*$"), 'i');
|
|
134
|
+
var FIND_THINK_ALIAS_BLOCK_RE = new RegExp("^\\s*(?:".concat(escapeRegExp(REDACTED_THINKING_ALIAS_OPEN), "|").concat(escapeRegExp(THINKING_ALIAS_OPEN), ")([\\s\\S]*?)(?:").concat(escapeRegExp(REDACTED_THINKING_ALIAS_CLOSE), "|").concat(escapeRegExp(THINKING_ALIAS_CLOSE), ")\\s*$"), 'i');
|
|
132
135
|
/**
|
|
133
136
|
* 将成对的别名标签 `<think>`…`</think>` 归一为与 `preprocessSpecialTags(..., 'think')` 契约一致的规范标签。
|
|
134
137
|
* 否则 `preprocessThinkTags` 无法把思考区内的 ``` 围栏换成 【CODE_BLOCK】,内层 JSON 会变成顶层独立 code 节点。
|
|
135
138
|
*/ export function normalizeThinkTagAliases(markdown) {
|
|
136
|
-
if (!markdown
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
return markdown.replace(REDACTED_THINKING_ALIAS_PAIR_REGEX, function(_match, inner) {
|
|
139
|
+
if (!markdown) return markdown;
|
|
140
|
+
var replaceToCanonical = function replaceToCanonical(_match, inner) {
|
|
140
141
|
return "".concat(THINK_TAG_CANONICAL_OPEN).concat(inner).concat(THINK_TAG_CANONICAL_CLOSE);
|
|
141
|
-
}
|
|
142
|
+
};
|
|
143
|
+
var result = markdown;
|
|
144
|
+
if (result.indexOf(REDACTED_THINKING_ALIAS_OPEN) !== -1) {
|
|
145
|
+
result = result.replace(REDACTED_THINKING_ALIAS_PAIR_REGEX, replaceToCanonical);
|
|
146
|
+
}
|
|
147
|
+
if (result.indexOf(THINKING_ALIAS_OPEN) !== -1) {
|
|
148
|
+
result = result.replace(THINKING_ALIAS_PAIR_REGEX, replaceToCanonical);
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
142
151
|
}
|
|
143
152
|
/**
|
|
144
153
|
* 解码 URI 组件,处理错误情况
|
|
@@ -367,10 +367,6 @@ var genStyle = function genStyle(token) {
|
|
|
367
367
|
}, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
|
|
368
368
|
padding: 'var(--agentic-ui-content-padding, 4px 4px)'
|
|
369
369
|
}),
|
|
370
|
-
'&-content': {
|
|
371
|
-
'--margin-4x': 'var(--agentic-ui-editor-margin-4x, 6px)',
|
|
372
|
-
'--margin-2x': 'var(--agentic-ui-editor-margin-2x, 4px)'
|
|
373
|
-
},
|
|
374
370
|
'&-focus': {
|
|
375
371
|
height: 64
|
|
376
372
|
}
|
|
@@ -83,7 +83,7 @@ type SendButtonProps = {
|
|
|
83
83
|
* @component
|
|
84
84
|
* @description 发送按钮组件,支持多种状态和动画效果
|
|
85
85
|
* @param {SendButtonProps} props - 组件属性
|
|
86
|
-
* @param {boolean} props.
|
|
86
|
+
* @param {boolean} props.isSendable - 是否处于可发送状态
|
|
87
87
|
* @param {boolean} props.disabled - 指示按钮是否禁用
|
|
88
88
|
* @param {boolean} props.typing - 指示是否处于输入状态
|
|
89
89
|
* @param {() => void} props.onClick - 点击按钮时的回调函数
|
|
@@ -95,7 +95,7 @@ type SendButtonProps = {
|
|
|
95
95
|
* @example
|
|
96
96
|
* ```tsx
|
|
97
97
|
* <SendButton
|
|
98
|
-
*
|
|
98
|
+
* isSendable
|
|
99
99
|
* disabled={false}
|
|
100
100
|
* typing={false}
|
|
101
101
|
* onClick={() => console.log('发送消息')}
|
|
@@ -86,13 +86,14 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
86
86
|
}
|
|
87
87
|
return target;
|
|
88
88
|
}
|
|
89
|
-
import { ConfigProvider, Tooltip } from "antd";
|
|
89
|
+
import { ConfigProvider, Tooltip, theme as antdTheme } from "antd";
|
|
90
90
|
import classNames from "clsx";
|
|
91
91
|
import { motion } from "framer-motion";
|
|
92
|
-
import React, { useContext, useEffect } from "react";
|
|
92
|
+
import React, { useContext, useEffect, useMemo } from "react";
|
|
93
93
|
import { ErrorBoundary } from "react-error-boundary";
|
|
94
94
|
import { STOP_ICON_DISK_FILL, STOP_ICON_HALO_FILL, StopIcon } from "../../AgentRunBar/icons";
|
|
95
95
|
import { I18nContext } from "../../I18n";
|
|
96
|
+
import { getSendButtonPalette, resolveSendButtonDisplayColors } from "./sendButtonPalette";
|
|
96
97
|
import { useStyle } from "./style";
|
|
97
98
|
/**
|
|
98
99
|
* 解析发送按钮的最终禁用状态:用户显式传入优先,否则按上传状态判断
|
|
@@ -100,18 +101,12 @@ import { useStyle } from "./style";
|
|
|
100
101
|
var _ref;
|
|
101
102
|
return (_ref = sendButtonProps === null || sendButtonProps === void 0 ? void 0 : sendButtonProps.disabled) !== null && _ref !== void 0 ? _ref : fileUploadStatus === 'uploading';
|
|
102
103
|
}
|
|
103
|
-
/** 未传入 `colors` 时使用 CSS 语义变量(与原先全局 SVG 覆盖一致) */ var SEND_BUTTON_THEME_COLORS = {
|
|
104
|
-
icon: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
105
|
-
iconHover: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
106
|
-
background: 'var(--color-primary-control-fill-primary, #1677ff)',
|
|
107
|
-
backgroundHover: 'var(--color-primary-control-fill-primary, #1677ff)'
|
|
108
|
-
};
|
|
109
104
|
function SendIcon(props) {
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
"
|
|
105
|
+
var isActive = props.isActive, disabled = props.disabled, typing = props.typing, displayColors = props.displayColors, rest = _object_without_properties(props, [
|
|
106
|
+
"isActive",
|
|
107
|
+
"disabled",
|
|
113
108
|
"typing",
|
|
114
|
-
"
|
|
109
|
+
"displayColors"
|
|
115
110
|
]);
|
|
116
111
|
if (typing) {
|
|
117
112
|
return /*#__PURE__*/ React.createElement(StopIcon, _object_spread_props(_object_spread({}, rest), {
|
|
@@ -119,12 +114,9 @@ function SendIcon(props) {
|
|
|
119
114
|
haloFill: STOP_ICON_HALO_FILL
|
|
120
115
|
}));
|
|
121
116
|
}
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
background: (_ref2 = colors === null || colors === void 0 ? void 0 : colors.background) !== null && _ref2 !== void 0 ? _ref2 : SEND_BUTTON_THEME_COLORS.background,
|
|
126
|
-
backgroundHover: (_ref3 = colors === null || colors === void 0 ? void 0 : colors.backgroundHover) !== null && _ref3 !== void 0 ? _ref3 : SEND_BUTTON_THEME_COLORS.backgroundHover
|
|
127
|
-
};
|
|
117
|
+
var useActive = isActive && !disabled;
|
|
118
|
+
var circleFill = useActive ? displayColors.backgroundActive : displayColors.backgroundMuted;
|
|
119
|
+
var arrowFill = useActive ? displayColors.iconActive : displayColors.iconMuted;
|
|
128
120
|
return /*#__PURE__*/ React.createElement("svg", _object_spread({
|
|
129
121
|
xmlns: "http://www.w3.org/2000/svg",
|
|
130
122
|
fill: "none",
|
|
@@ -137,8 +129,8 @@ function SendIcon(props) {
|
|
|
137
129
|
r: "0.5em",
|
|
138
130
|
initial: false,
|
|
139
131
|
animate: {
|
|
140
|
-
fill:
|
|
141
|
-
fillOpacity:
|
|
132
|
+
fill: circleFill,
|
|
133
|
+
fillOpacity: 1
|
|
142
134
|
},
|
|
143
135
|
transition: {
|
|
144
136
|
duration: 0.6,
|
|
@@ -149,8 +141,8 @@ function SendIcon(props) {
|
|
|
149
141
|
fillRule: "evenodd",
|
|
150
142
|
initial: false,
|
|
151
143
|
animate: {
|
|
152
|
-
fill:
|
|
153
|
-
fillOpacity:
|
|
144
|
+
fill: arrowFill,
|
|
145
|
+
fillOpacity: 1
|
|
154
146
|
},
|
|
155
147
|
transition: {
|
|
156
148
|
duration: 0.2,
|
|
@@ -167,7 +159,7 @@ function SendIcon(props) {
|
|
|
167
159
|
* @component
|
|
168
160
|
* @description 发送按钮组件,支持多种状态和动画效果
|
|
169
161
|
* @param {SendButtonProps} props - 组件属性
|
|
170
|
-
* @param {boolean} props.
|
|
162
|
+
* @param {boolean} props.isSendable - 是否处于可发送状态
|
|
171
163
|
* @param {boolean} props.disabled - 指示按钮是否禁用
|
|
172
164
|
* @param {boolean} props.typing - 指示是否处于输入状态
|
|
173
165
|
* @param {() => void} props.onClick - 点击按钮时的回调函数
|
|
@@ -179,7 +171,7 @@ function SendIcon(props) {
|
|
|
179
171
|
* @example
|
|
180
172
|
* ```tsx
|
|
181
173
|
* <SendButton
|
|
182
|
-
*
|
|
174
|
+
* isSendable
|
|
183
175
|
* disabled={false}
|
|
184
176
|
* typing={false}
|
|
185
177
|
* onClick={() => console.log('发送消息')}
|
|
@@ -210,10 +202,36 @@ function SendIcon(props) {
|
|
|
210
202
|
// 仅在挂载时触发一次,避免引用变化导致重复打点
|
|
211
203
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- onInit intentionally once on mount
|
|
212
204
|
}, []);
|
|
205
|
+
var token = antdTheme.useToken().token;
|
|
213
206
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
214
207
|
var locale = useContext(I18nContext).locale;
|
|
215
208
|
var baseCls = getPrefixCls('agentic-md-input-field-send-button');
|
|
216
209
|
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
210
|
+
var displayColors = useMemo(function() {
|
|
211
|
+
return resolveSendButtonDisplayColors(getSendButtonPalette({
|
|
212
|
+
colorPrimary: token.colorPrimary,
|
|
213
|
+
colorBgContainer: token.colorBgContainer,
|
|
214
|
+
colorTextLightSolid: token.colorTextLightSolid,
|
|
215
|
+
colorTextTertiary: token.colorTextTertiary,
|
|
216
|
+
colorFillTertiary: token.colorFillTertiary,
|
|
217
|
+
colorText: token.colorText
|
|
218
|
+
}), colors, {
|
|
219
|
+
colorPrimary: token.colorPrimary,
|
|
220
|
+
colorBgContainer: token.colorBgContainer,
|
|
221
|
+
colorTextLightSolid: token.colorTextLightSolid,
|
|
222
|
+
colorTextTertiary: token.colorTextTertiary,
|
|
223
|
+
colorFillTertiary: token.colorFillTertiary,
|
|
224
|
+
colorText: token.colorText
|
|
225
|
+
});
|
|
226
|
+
}, [
|
|
227
|
+
colors,
|
|
228
|
+
token.colorBgContainer,
|
|
229
|
+
token.colorFillTertiary,
|
|
230
|
+
token.colorPrimary,
|
|
231
|
+
token.colorText,
|
|
232
|
+
token.colorTextLightSolid,
|
|
233
|
+
token.colorTextTertiary
|
|
234
|
+
]);
|
|
217
235
|
if (typeof window === 'undefined' || typeof document === 'undefined' || !window.document) {
|
|
218
236
|
// SSR 环境下不渲染
|
|
219
237
|
return null;
|
|
@@ -257,9 +275,9 @@ function SendIcon(props) {
|
|
|
257
275
|
}, /*#__PURE__*/ React.createElement(ErrorBoundary, {
|
|
258
276
|
fallback: /*#__PURE__*/ React.createElement("div", null)
|
|
259
277
|
}, /*#__PURE__*/ React.createElement(SendIcon, {
|
|
260
|
-
|
|
278
|
+
isActive: isSendable,
|
|
261
279
|
disabled: disabled,
|
|
262
280
|
typing: typing,
|
|
263
|
-
|
|
281
|
+
displayColors: displayColors
|
|
264
282
|
})))));
|
|
265
283
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 发送按钮默认色板:用 Ant Design token 的实色保证相对 colorBgContainer 的对比度,
|
|
3
|
+
* 随亮色 / 暗色主题切换。半透明 token 先与 colorBgContainer 叠算再比对比度、再混合。
|
|
4
|
+
*/
|
|
5
|
+
export interface SendButtonPaletteToken {
|
|
6
|
+
colorPrimary: string;
|
|
7
|
+
colorBgContainer: string;
|
|
8
|
+
colorTextLightSolid: string;
|
|
9
|
+
colorTextTertiary: string;
|
|
10
|
+
colorFillTertiary: string;
|
|
11
|
+
colorText?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 基于当前主题 token 生成默认可发送 / 未激活填充与图标色
|
|
15
|
+
*/
|
|
16
|
+
export declare function getSendButtonPalette(token: SendButtonPaletteToken): {
|
|
17
|
+
readonly backgroundActive: string;
|
|
18
|
+
readonly backgroundMuted: string;
|
|
19
|
+
readonly iconActive: string;
|
|
20
|
+
readonly iconMuted: string;
|
|
21
|
+
};
|
|
22
|
+
export type SendButtonResolvedColors = {
|
|
23
|
+
backgroundActive: string;
|
|
24
|
+
backgroundMuted: string;
|
|
25
|
+
iconActive: string;
|
|
26
|
+
iconMuted: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 合并默认色板与用户 `colors`;与原先 background/backgroundHover、icon/iconHover 语义一致
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSendButtonDisplayColors(basePalette: SendButtonResolvedColors, colors: {
|
|
32
|
+
icon?: string;
|
|
33
|
+
iconHover?: string;
|
|
34
|
+
background?: string;
|
|
35
|
+
backgroundHover?: string;
|
|
36
|
+
} | undefined, token: SendButtonPaletteToken): SendButtonResolvedColors;
|