@ant-design/agentic-ui 2.30.0 → 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 +4 -0
- package/dist/Bubble/List/index.js +8 -5
- package/dist/Bubble/MessagesContent/EXCEPTION.js +11 -2
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +13 -7
- package/dist/Bubble/MessagesContent/index.js +39 -10
- package/dist/Bubble/MessagesContent/style.js +55 -22
- package/dist/Bubble/type.d.ts +4 -0
- package/dist/I18n/locales.js +2 -2
- 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/style.js +109 -7
- package/dist/MarkdownEditor/types.d.ts +5 -0
- 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/utils/renderHelpers.d.ts +8 -1
- package/dist/MarkdownInputField/utils/renderHelpers.js +5 -1
- package/dist/MarkdownRenderer/AnimationText.d.ts +4 -7
- package/dist/MarkdownRenderer/AnimationText.js +117 -15
- package/dist/MarkdownRenderer/MarkdownRenderer.js +15 -1
- package/dist/MarkdownRenderer/index.d.ts +2 -2
- package/dist/MarkdownRenderer/index.js +1 -1
- 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/style.js +7 -6
- package/dist/MarkdownRenderer/useMarkdownToReact.js +5 -4
- package/dist/MarkdownRenderer/useStreaming.js +8 -1
- package/dist/Plugins/chart/ChartRender.js +1 -0
- package/dist/Plugins/chart/index.js +3 -1
- package/package.json +2 -1
|
@@ -29,17 +29,18 @@ export var useRendererVarStyle = function useRendererVarStyle(prefixCls) {
|
|
|
29
29
|
'--padding-2x': '8px',
|
|
30
30
|
'--padding-4x': '16px',
|
|
31
31
|
'--padding-5x': '20px'
|
|
32
|
-
}), //
|
|
33
|
-
|
|
32
|
+
}), // 流式文字淡入动画(opacity + translateY,GPU 硬件加速,清爽流派)
|
|
33
|
+
// 仅使用 opacity 和 transform,避免 blur 带来的重绘开销
|
|
34
|
+
_define_property(_obj, '@keyframes markdownRendererSlideFadeIn', {
|
|
34
35
|
from: {
|
|
35
36
|
opacity: 0,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
transform: 'translateY(2px)',
|
|
38
|
+
filter: 'blur(1px)'
|
|
38
39
|
},
|
|
39
40
|
to: {
|
|
40
41
|
opacity: 1,
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
transform: 'translateY(0)',
|
|
43
|
+
filter: 'blur(0px)'
|
|
43
44
|
}
|
|
44
45
|
}), _obj;
|
|
45
46
|
});
|
|
@@ -124,7 +124,6 @@ import { Checkbox, Image } from "antd";
|
|
|
124
124
|
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
|
|
125
125
|
import React, { useMemo, useRef } from "react";
|
|
126
126
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
127
|
-
import AnimationText from "./AnimationText";
|
|
128
127
|
import rehypeKatex from "rehype-katex";
|
|
129
128
|
import rehypeRaw from "rehype-raw";
|
|
130
129
|
import remarkDirective from "remark-directive";
|
|
@@ -140,6 +139,7 @@ import { remarkDirectiveContainer } from "../MarkdownEditor/editor/parser/remark
|
|
|
140
139
|
import { convertParagraphToImage, fixStrongWithSpecialChars, protectJinjaDollarInText } from "../MarkdownEditor/editor/parser/remarkParse";
|
|
141
140
|
import { REMARK_REHYPE_DIRECTIVE_HANDLERS } from "../MarkdownEditor/editor/utils/markdownToHtml";
|
|
142
141
|
import { ToolUseBarThink } from "../ToolUseBarThink";
|
|
142
|
+
import AnimationText from "./AnimationText";
|
|
143
143
|
var INLINE_MATH_WITH_SINGLE_DOLLAR = {
|
|
144
144
|
singleDollarTextMath: true
|
|
145
145
|
};
|
|
@@ -1120,8 +1120,9 @@ var _BLOCK_CACHE_KEY = Symbol('blockCache');
|
|
|
1120
1120
|
* 流式场景下,最后一个块每个字符都变化,但大部分变化只是尾部追加。
|
|
1121
1121
|
* 对最后一个块做节流:只在新增了换行、块级标记、或超过一定字符数时才重新解析。
|
|
1122
1122
|
*/ var LAST_BLOCK_THROTTLE_CHARS = 20;
|
|
1123
|
-
var BLOCK_BOUNDARY_TRIGGERS = /[\n
|
|
1124
|
-
var shouldReparseLastBlock = function shouldReparseLastBlock(prevSource, newSource) {
|
|
1123
|
+
var BLOCK_BOUNDARY_TRIGGERS = /[\n`|#>*\-!$[\]]/;
|
|
1124
|
+
var shouldReparseLastBlock = function shouldReparseLastBlock(prevSource, newSource, streaming) {
|
|
1125
|
+
if (!streaming) return true;
|
|
1125
1126
|
if (!prevSource) return true;
|
|
1126
1127
|
if (newSource.length < prevSource.length) return true;
|
|
1127
1128
|
if (!newSource.startsWith(prevSource)) return true;
|
|
@@ -1179,7 +1180,7 @@ export var useMarkdownToReact = function useMarkdownToReact(content, options) {
|
|
|
1179
1180
|
}
|
|
1180
1181
|
// 最后一个块:节流——仅在有意义的变化时重新解析
|
|
1181
1182
|
if (isLast && lastBlockRef.current) {
|
|
1182
|
-
if (!shouldReparseLastBlock(lastBlockRef.current.source, block)) {
|
|
1183
|
+
if (!shouldReparseLastBlock(lastBlockRef.current.source, block, options === null || options === void 0 ? void 0 : options.streaming)) {
|
|
1183
1184
|
newCache.set(block, {
|
|
1184
1185
|
source: lastBlockRef.current.source,
|
|
1185
1186
|
element: lastBlockRef.current.element
|
|
@@ -100,6 +100,7 @@ var STREAM_INCOMPLETE_REGEX = {
|
|
|
100
100
|
/^`[^`\r\n]{0,300}$/
|
|
101
101
|
]
|
|
102
102
|
};
|
|
103
|
+
var STREAMING_LOADING_PLACEHOLDER = '...';
|
|
103
104
|
/**
|
|
104
105
|
* 判断表格是否仍不完整。
|
|
105
106
|
* 等待 header + separator + 至少一行数据(3 行)后提交。
|
|
@@ -239,6 +240,11 @@ var getInitialCache = function getInitialCache() {
|
|
|
239
240
|
completeMarkdown: ''
|
|
240
241
|
};
|
|
241
242
|
};
|
|
243
|
+
var getStreamingOutput = function getStreamingOutput(cache) {
|
|
244
|
+
if (cache.completeMarkdown) return cache.completeMarkdown;
|
|
245
|
+
if (cache.pending) return STREAMING_LOADING_PLACEHOLDER;
|
|
246
|
+
return '';
|
|
247
|
+
};
|
|
242
248
|
var isInCodeBlock = function isInCodeBlock(text) {
|
|
243
249
|
var isFinalChunk = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
244
250
|
var lines = text.split('\n');
|
|
@@ -371,11 +377,12 @@ var isInCodeBlock = function isInCodeBlock(text) {
|
|
|
371
377
|
}
|
|
372
378
|
}
|
|
373
379
|
}
|
|
374
|
-
setOutput(cache
|
|
380
|
+
setOutput(getStreamingOutput(cache));
|
|
375
381
|
}, []);
|
|
376
382
|
useEffect(function() {
|
|
377
383
|
if (typeof input !== 'string') {
|
|
378
384
|
setOutput('');
|
|
385
|
+
cacheRef.current = getInitialCache();
|
|
379
386
|
return;
|
|
380
387
|
}
|
|
381
388
|
if (enabled) {
|
|
@@ -1195,6 +1195,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
|
|
|
1195
1195
|
config === null || config === void 0 ? void 0 : config.y,
|
|
1196
1196
|
config === null || config === void 0 ? void 0 : config.height,
|
|
1197
1197
|
config === null || config === void 0 ? void 0 : config.index,
|
|
1198
|
+
renderKey,
|
|
1198
1199
|
toolBar,
|
|
1199
1200
|
convertDonutData,
|
|
1200
1201
|
convertFlatData,
|
|
@@ -448,7 +448,7 @@ export { ChartFilter, ChartToolBar, downloadChart } from "./components";
|
|
|
448
448
|
left: 0,
|
|
449
449
|
right: 0,
|
|
450
450
|
bottom: 0,
|
|
451
|
-
zIndex:
|
|
451
|
+
zIndex: 0,
|
|
452
452
|
width: '100%',
|
|
453
453
|
opacity: 0,
|
|
454
454
|
height: '100%',
|
|
@@ -457,6 +457,8 @@ export { ChartFilter, ChartToolBar, downloadChart } from "./components";
|
|
|
457
457
|
}
|
|
458
458
|
}, children), /*#__PURE__*/ React.createElement("div", {
|
|
459
459
|
style: {
|
|
460
|
+
position: 'relative',
|
|
461
|
+
zIndex: 1,
|
|
460
462
|
display: 'flex',
|
|
461
463
|
flexWrap: 'wrap',
|
|
462
464
|
flexDirection: minWidth < 400 ? 'column' : 'row',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.30.
|
|
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",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
25
25
|
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
26
26
|
"prepare": "husky install && dumi setup",
|
|
27
|
+
"prepublishOnly": "npm run build && npm run test",
|
|
27
28
|
"prettier": "prettier --write \"{src,docs,test}/**/*.{js,jsx,ts,tsx,css,less,json,md}\"",
|
|
28
29
|
"preview": "pnpm dumi preview",
|
|
29
30
|
"report:demo": "node scripts/generateDemoReport.js",
|