@ant-design/agentic-ui 2.29.59 → 2.30.1
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/Bubble/List/index.d.ts +11 -0
- package/dist/Bubble/List/index.js +13 -1
- package/dist/Bubble/MessagesContent/EXCEPTION.js +11 -2
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +34 -4
- package/dist/Bubble/MessagesContent/index.js +39 -10
- package/dist/Bubble/MessagesContent/style.js +55 -22
- package/dist/Bubble/UserBubble.js +3 -1
- package/dist/Bubble/type.d.ts +11 -0
- package/dist/Hooks/useLanguage.d.ts +1 -0
- package/dist/I18n/locales.d.ts +1 -0
- package/dist/I18n/locales.js +5 -3
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +37 -5
- package/dist/MarkdownEditor/editor/elements/AgenticUiBlocks/AgenticUiTaskBlock.d.ts +4 -0
- package/dist/MarkdownEditor/editor/elements/AgenticUiBlocks/AgenticUiTaskBlock.js +74 -0
- package/dist/MarkdownEditor/editor/elements/AgenticUiBlocks/AgenticUiToolUseBarBlock.d.ts +4 -0
- package/dist/MarkdownEditor/editor/elements/AgenticUiBlocks/AgenticUiToolUseBarBlock.js +114 -0
- package/dist/MarkdownEditor/editor/elements/AgenticUiBlocks/agenticUiEmbedUtils.d.ts +20 -0
- package/dist/MarkdownEditor/editor/elements/AgenticUiBlocks/agenticUiEmbedUtils.js +169 -0
- package/dist/MarkdownEditor/editor/elements/Table/EditableTable.d.ts +11 -0
- package/dist/MarkdownEditor/editor/elements/Table/EditableTable.js +207 -0
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +10 -276
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/index.js +7 -227
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/index.js +20 -229
- package/dist/MarkdownEditor/editor/elements/Table/commands/tableCommands.d.ts +9 -0
- package/dist/MarkdownEditor/editor/elements/Table/commands/tableCommands.js +242 -0
- package/dist/MarkdownEditor/editor/elements/Table/utils/editableTableWidth.d.ts +20 -0
- package/dist/MarkdownEditor/editor/elements/Table/utils/editableTableWidth.js +60 -0
- package/dist/MarkdownEditor/editor/elements/Table/utils/useEditableTableColWidths.d.ts +6 -0
- package/dist/MarkdownEditor/editor/elements/Table/utils/useEditableTableColWidths.js +20 -0
- package/dist/MarkdownEditor/editor/elements/Table/utils/useEditableTableContentWidth.d.ts +10 -0
- package/dist/MarkdownEditor/editor/elements/Table/utils/useEditableTableContentWidth.js +103 -0
- package/dist/MarkdownEditor/editor/elements/index.js +7 -0
- package/dist/MarkdownEditor/editor/parser/parse/parseCode.js +33 -2
- package/dist/MarkdownEditor/editor/parser/parserSlateNodeToMarkdown.js +3 -0
- package/dist/MarkdownEditor/editor/plugins/handlePaste.js +4 -1
- package/dist/MarkdownEditor/plugin.d.ts +15 -0
- package/dist/MarkdownEditor/style.js +258 -326
- package/dist/MarkdownEditor/types.d.ts +14 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileIcon.js +2 -2
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +11 -8
- package/dist/MarkdownInputField/AttachmentButton/index.js +7 -2
- package/dist/MarkdownInputField/AttachmentButton/types.d.ts +5 -1
- package/dist/MarkdownInputField/AttachmentButton/utils.d.ts +7 -0
- package/dist/MarkdownInputField/AttachmentButton/utils.js +9 -1
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +10 -5
- package/dist/MarkdownInputField/FileUploadManager/index.d.ts +9 -0
- package/dist/MarkdownInputField/FileUploadManager/index.js +20 -4
- package/dist/MarkdownInputField/MarkdownInputField.js +5 -3
- package/dist/MarkdownInputField/SendActions/index.d.ts +9 -0
- package/dist/MarkdownInputField/SendActions/index.js +3 -2
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldRefs.js +10 -3
- package/dist/MarkdownInputField/utils/renderHelpers.d.ts +8 -1
- package/dist/MarkdownInputField/utils/renderHelpers.js +5 -1
- package/dist/MarkdownRenderer/AnimationText.d.ts +19 -0
- package/dist/MarkdownRenderer/AnimationText.js +226 -0
- package/dist/MarkdownRenderer/CharacterQueue.d.ts +36 -0
- package/dist/MarkdownRenderer/CharacterQueue.js +188 -0
- package/dist/MarkdownRenderer/MarkdownRenderer.d.ts +13 -0
- package/dist/MarkdownRenderer/MarkdownRenderer.js +362 -0
- package/dist/MarkdownRenderer/index.d.ts +11 -0
- package/dist/MarkdownRenderer/index.js +9 -0
- package/dist/MarkdownRenderer/renderers/AgenticUiTaskBlockRenderer.d.ts +6 -0
- package/dist/MarkdownRenderer/renderers/AgenticUiTaskBlockRenderer.js +66 -0
- package/dist/MarkdownRenderer/renderers/AgenticUiToolUseBarBlockRenderer.d.ts +6 -0
- package/dist/MarkdownRenderer/renderers/AgenticUiToolUseBarBlockRenderer.js +134 -0
- package/dist/MarkdownRenderer/renderers/ChartRenderer.d.ts +12 -0
- package/dist/MarkdownRenderer/renderers/ChartRenderer.js +395 -0
- package/dist/MarkdownRenderer/renderers/CodeRenderer.d.ts +7 -0
- package/dist/MarkdownRenderer/renderers/CodeRenderer.js +218 -0
- package/dist/MarkdownRenderer/renderers/MermaidRenderer.d.ts +7 -0
- package/dist/MarkdownRenderer/renderers/MermaidRenderer.js +43 -0
- package/dist/MarkdownRenderer/renderers/SchemaRenderer.d.ts +15 -0
- package/dist/MarkdownRenderer/renderers/SchemaRenderer.js +115 -0
- package/dist/MarkdownRenderer/renderers/index.d.ts +4 -0
- package/dist/MarkdownRenderer/renderers/index.js +4 -0
- package/dist/MarkdownRenderer/style.d.ts +16 -0
- package/dist/MarkdownRenderer/style.js +47 -0
- package/dist/MarkdownRenderer/types.d.ts +74 -0
- package/dist/MarkdownRenderer/types.js +1 -0
- package/dist/MarkdownRenderer/useMarkdownToReact.d.ts +23 -0
- package/dist/MarkdownRenderer/useMarkdownToReact.js +1241 -0
- package/dist/MarkdownRenderer/useStreaming.d.ts +29 -0
- package/dist/MarkdownRenderer/useStreaming.js +399 -0
- package/dist/Plugins/chart/AreaChart/index.js +4 -2
- package/dist/Plugins/chart/ChartRender.js +1 -0
- package/dist/Plugins/chart/LineChart/index.js +4 -2
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +8 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.js +31 -6
- package/dist/Plugins/chart/index.js +3 -1
- package/dist/Plugins/mermaid/style.js +0 -3
- package/dist/TaskList/TaskList.js +3 -12
- package/dist/TaskList/components/TaskListItem.js +3 -12
- package/dist/ThoughtChainList/ThoughtChainListItem.js +2 -4
- package/dist/ThoughtChainList/index.js +4 -21
- package/dist/ToolUseBarThink/index.js +20 -59
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/package.json +2 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ChevronUp } from "@sofa-design/icons";
|
|
2
2
|
import classNames from "clsx";
|
|
3
|
-
import { AnimatePresence, motion } from "framer-motion";
|
|
4
3
|
import React, { memo, useCallback, useContext } from "react";
|
|
5
4
|
import { ActionIconBox } from "../../Components/ActionIconBox";
|
|
6
5
|
import { I18nContext } from "../../I18n";
|
|
7
|
-
import {
|
|
6
|
+
import { getArrowRotation, hasTaskContent } from "../constants";
|
|
8
7
|
import { StatusIcon } from "./StatusIcon";
|
|
9
8
|
export var TaskListItem = /*#__PURE__*/ memo(function(param) {
|
|
10
9
|
var item = param.item, isLast = param.isLast, prefixCls = param.prefixCls, hashId = param.hashId, expandedKeys = param.expandedKeys, onToggle = param.onToggle;
|
|
@@ -51,18 +50,10 @@ export var TaskListItem = /*#__PURE__*/ memo(function(param) {
|
|
|
51
50
|
loading: false
|
|
52
51
|
}, /*#__PURE__*/ React.createElement(ChevronUp, {
|
|
53
52
|
"data-testid": "task-list-arrow"
|
|
54
|
-
})))), /*#__PURE__*/ React.createElement(
|
|
55
|
-
initial: false
|
|
56
|
-
}, !isCollapsed && /*#__PURE__*/ React.createElement(motion.div, {
|
|
57
|
-
key: "task-content",
|
|
58
|
-
variants: COLLAPSE_VARIANTS,
|
|
59
|
-
initial: "collapsed",
|
|
60
|
-
animate: "expanded",
|
|
61
|
-
exit: "collapsed",
|
|
62
|
-
transition: COLLAPSE_TRANSITION,
|
|
53
|
+
})))), !isCollapsed && /*#__PURE__*/ React.createElement("div", {
|
|
63
54
|
className: classNames("".concat(prefixCls, "-body"), hashId)
|
|
64
55
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
65
56
|
className: classNames("".concat(prefixCls, "-content"), hashId)
|
|
66
|
-
}, item.content))))
|
|
57
|
+
}, item.content))));
|
|
67
58
|
});
|
|
68
59
|
TaskListItem.displayName = 'TaskListItem';
|
|
@@ -399,9 +399,7 @@ var ThoughtChainItemMotion = /*#__PURE__*/ React.memo(function(param) {
|
|
|
399
399
|
flexDirection: 'column',
|
|
400
400
|
height: !collapse ? 'auto' : '0px',
|
|
401
401
|
overflow: 'hidden',
|
|
402
|
-
gap: 8
|
|
403
|
-
transition: 'height 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
404
|
-
transitionBehavior: 'allow-discrete'
|
|
402
|
+
gap: 8
|
|
405
403
|
}
|
|
406
|
-
}, props.contentRender ? props.contentRender(thoughtChainListItem, content) : content)));
|
|
404
|
+
}, !collapse ? props.contentRender ? props.contentRender(thoughtChainListItem, content) : content : null)));
|
|
407
405
|
});
|
|
@@ -308,24 +308,10 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
|
|
|
308
308
|
}, /*#__PURE__*/ React.createElement(motion.div, {
|
|
309
309
|
role: "list",
|
|
310
310
|
className: classNames("".concat(prefixCls, "-content-list"), hashId),
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
when: 'afterChildren'
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
visible: {
|
|
319
|
-
opacity: 1,
|
|
320
|
-
transition: {
|
|
321
|
-
staggerChildren: 0.3,
|
|
322
|
-
when: 'beforeChildren'
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
whileInView: "visible",
|
|
327
|
-
initial: "hidden",
|
|
328
|
-
animate: "visible"
|
|
311
|
+
initial: false,
|
|
312
|
+
animate: {
|
|
313
|
+
opacity: 1
|
|
314
|
+
}
|
|
329
315
|
}, processedItems.map(function(item, index) {
|
|
330
316
|
var _item_info;
|
|
331
317
|
var info = (_item_info = item.info) === null || _item_info === void 0 ? void 0 : _item_info.split(/(\$\{\w+\})/);
|
|
@@ -482,9 +468,6 @@ var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
|
|
|
482
468
|
className: classNames("".concat(prefixCls), hashId),
|
|
483
469
|
style: restStyle
|
|
484
470
|
}, /*#__PURE__*/ React.createElement(motion.div, {
|
|
485
|
-
transition: {
|
|
486
|
-
duration: 0.3
|
|
487
|
-
},
|
|
488
471
|
className: classNames("".concat(prefixCls, "-container"), hashId, _define_property({}, "".concat(prefixCls, "-container-loading"), !(bubble === null || bubble === void 0 ? void 0 : bubble.isFinished)))
|
|
489
472
|
}, /*#__PURE__*/ React.createElement(ThoughtChainTitle, {
|
|
490
473
|
prefixCls: prefixCls,
|
|
@@ -87,7 +87,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
87
87
|
import { Brain, ChevronDown, ChevronsDownUp, ChevronsUpDown } from "@sofa-design/icons";
|
|
88
88
|
import { ConfigProvider } from "antd";
|
|
89
89
|
import classNames from "clsx";
|
|
90
|
-
import {
|
|
90
|
+
import { motion } from "framer-motion";
|
|
91
91
|
import { useMergedState } from "rc-util";
|
|
92
92
|
import React, { memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
93
93
|
import { useRefFunction } from "../Hooks/useRefFunction";
|
|
@@ -276,36 +276,6 @@ var ThinkContainer = function ThinkContainer(param) {
|
|
|
276
276
|
handleContentExpandToggle,
|
|
277
277
|
locale
|
|
278
278
|
]);
|
|
279
|
-
// 缓存容器元素
|
|
280
|
-
var contentVariants = useMemo(function() {
|
|
281
|
-
return {
|
|
282
|
-
expanded: {
|
|
283
|
-
height: 'auto',
|
|
284
|
-
opacity: 1
|
|
285
|
-
},
|
|
286
|
-
collapsed: {
|
|
287
|
-
height: 0,
|
|
288
|
-
opacity: 0
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
}, []);
|
|
292
|
-
var contentTransition = useMemo(function() {
|
|
293
|
-
return {
|
|
294
|
-
height: {
|
|
295
|
-
duration: 0.26,
|
|
296
|
-
ease: [
|
|
297
|
-
0.4,
|
|
298
|
-
0,
|
|
299
|
-
0.2,
|
|
300
|
-
1
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
opacity: {
|
|
304
|
-
duration: 0.2,
|
|
305
|
-
ease: 'linear'
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
}, []);
|
|
309
279
|
var innerContent = /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
|
|
310
280
|
ref: contentInnerRef,
|
|
311
281
|
style: contentInnerStyle
|
|
@@ -318,34 +288,25 @@ var ThinkContainer = function ThinkContainer(param) {
|
|
|
318
288
|
"data-testid": "tool-use-bar-think-floating-expand",
|
|
319
289
|
style: styles === null || styles === void 0 ? void 0 : styles.floatingExpand
|
|
320
290
|
}, floatingIcon, floatingText) : null);
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
"
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
341
|
-
className: contentClassName,
|
|
342
|
-
style: styles === null || styles === void 0 ? void 0 : styles.content
|
|
343
|
-
}, thinkContent), showFloatingExpand ? /*#__PURE__*/ React.createElement("div", {
|
|
344
|
-
className: floatingExpandClassName,
|
|
345
|
-
onClick: onToggleFloatingExpand,
|
|
346
|
-
"data-testid": "tool-use-bar-think-floating-expand",
|
|
347
|
-
style: styles === null || styles === void 0 ? void 0 : styles.floatingExpand
|
|
348
|
-
}, floatingIcon, floatingText) : null) : null);
|
|
291
|
+
// 收起时不渲染 thinkContent,无动画避免展开/收起卡顿
|
|
292
|
+
if (expandedState) {
|
|
293
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
294
|
+
className: containerClassName,
|
|
295
|
+
"data-testid": "tool-use-bar-think-container",
|
|
296
|
+
style: {
|
|
297
|
+
overflow: 'hidden'
|
|
298
|
+
}
|
|
299
|
+
}, innerContent);
|
|
300
|
+
}
|
|
301
|
+
if (showFloatingExpand) {
|
|
302
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
303
|
+
className: floatingExpandClassName,
|
|
304
|
+
onClick: onToggleFloatingExpand,
|
|
305
|
+
"data-testid": "tool-use-bar-think-floating-expand",
|
|
306
|
+
style: styles === null || styles === void 0 ? void 0 : styles.floatingExpand
|
|
307
|
+
}, floatingIcon, floatingText);
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
349
310
|
};
|
|
350
311
|
/**
|
|
351
312
|
* ToolUseBarThink 组件
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from './History';
|
|
|
30
30
|
export * from './History/types';
|
|
31
31
|
export * from './History/types/HistoryData';
|
|
32
32
|
export * from './History/types/HistoryList';
|
|
33
|
+
export * from './MarkdownRenderer';
|
|
33
34
|
export * from './MarkdownEditor';
|
|
34
35
|
export * from './MarkdownEditor/el';
|
|
35
36
|
export { useSelStatus } from './MarkdownEditor/hooks/editor';
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,8 @@ export * from "./History";
|
|
|
36
36
|
export * from "./History/types";
|
|
37
37
|
export * from "./History/types/HistoryData";
|
|
38
38
|
export * from "./History/types/HistoryList";
|
|
39
|
+
// ─── Markdown 渲染器(流式/只读轻量渲染,无 Slate 依赖) ─────────────────────
|
|
40
|
+
export * from "./MarkdownRenderer";
|
|
39
41
|
// ─── Markdown 编辑器 ─────────────────────────────────────────────────────────
|
|
40
42
|
export * from "./MarkdownEditor";
|
|
41
43
|
export * from "./MarkdownEditor/el";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.1",
|
|
4
4
|
"description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
|
|
5
5
|
"repository": "git@github.com:ant-design/agentic-ui.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"dompurify": "^3.3.1",
|
|
83
83
|
"flubber": "^0.4.2",
|
|
84
84
|
"framer-motion": "^11.18.2",
|
|
85
|
+
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
85
86
|
"is-hotkey": "^0.2.0",
|
|
86
87
|
"json5": "^2.2.3",
|
|
87
88
|
"katex": "^0.16.28",
|