@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.
- package/dist/MarkdownEditor/editor/elements/CommentLeaf/index.d.ts +11 -0
- package/dist/MarkdownEditor/editor/elements/CommentLeaf/index.js +69 -0
- package/dist/MarkdownEditor/editor/elements/FncLeaf/index.d.ts +15 -0
- package/dist/MarkdownEditor/editor/elements/FncLeaf/index.js +208 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +2 -2
- package/dist/MarkdownEditor/editor/elements/Table/SimpleTable.js +43 -88
- package/dist/MarkdownEditor/editor/elements/index.d.ts +12 -0
- package/dist/MarkdownEditor/editor/elements/index.js +44 -102
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +9 -2
- package/dist/MarkdownEditor/editor/plugins/useHighlight.js +160 -186
- package/dist/Plugins/chart/AreaChart/index.js +3 -0
- package/dist/Plugins/chart/BarChart/index.js +3 -0
- package/dist/Plugins/chart/DonutChart/index.js +1 -1
- package/dist/Plugins/chart/FunnelChart/index.js +3 -0
- package/dist/Plugins/chart/LineChart/index.js +3 -0
- package/dist/Plugins/chart/RadarChart/index.js +3 -0
- package/dist/Plugins/chart/ScatterChart/index.js +3 -0
- package/dist/Plugins/code/components/ThinkBlock.js +66 -5
- package/package.json +1 -1
|
@@ -1,7 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview 思考块组件
|
|
3
3
|
* 只读模式下渲染思考类型的代码块
|
|
4
|
-
*/
|
|
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:
|
|
104
|
+
expanded: expanded,
|
|
105
|
+
onExpandedChange: setExpanded,
|
|
45
106
|
toolName: toolNameText,
|
|
46
107
|
thinkContent: content,
|
|
47
108
|
status: isLoading ? 'loading' : 'success'
|