@ant-design/agentic-ui 2.24.5 → 2.26.0
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/Components/Loading/CreativeRecommendationLoading.d.ts +26 -0
- package/dist/Components/Loading/CreativeRecommendationLoading.js +77 -0
- package/dist/Components/Loading/CreativeSparkLoading.d.ts +27 -0
- package/dist/Components/Loading/CreativeSparkLoading.js +78 -0
- package/dist/Components/Loading/Loading.d.ts +26 -0
- package/dist/Components/Loading/Loading.js +57 -0
- package/dist/Components/Loading/index.d.ts +3 -26
- package/dist/Components/Loading/index.js +3 -57
- package/dist/Components/Robot/index.d.ts +0 -1
- package/dist/Components/Robot/index.js +0 -1
- package/dist/Components/effects/CreativeRecommendationEffect/creativeRecommendation.json +580 -0
- package/dist/Components/effects/CreativeRecommendationEffect/index.d.ts +41 -0
- package/dist/Components/effects/CreativeRecommendationEffect/index.js +52 -0
- package/dist/Components/effects/EffectPlayer.d.ts +28 -0
- package/dist/Components/effects/EffectPlayer.js +222 -0
- package/dist/Components/effects/LoadingEffect/index.d.ts +41 -0
- package/dist/Components/effects/LoadingEffect/index.js +51 -0
- package/dist/Components/effects/LoadingEffect/loading.json +922 -0
- package/dist/Components/effects/index.d.ts +3 -0
- package/dist/Components/effects/index.js +3 -0
- package/dist/Components/lotties/CreativeSparkLottie/creativeSpark.json +5576 -0
- package/dist/Components/lotties/CreativeSparkLottie/index.d.ts +65 -0
- package/dist/Components/lotties/CreativeSparkLottie/index.js +87 -0
- package/dist/Components/lotties/LoadingLottie/loading.json +4024 -1977
- package/dist/Components/lotties/index.d.ts +4 -0
- package/dist/Components/lotties/index.js +4 -0
- package/dist/MarkdownEditor/editor/Editor.js +2 -1
- package/dist/MarkdownEditor/editor/elements/index.d.ts +1 -0
- package/dist/MarkdownEditor/editor/elements/index.js +12 -2
- package/dist/MarkdownEditor/editor/store.js +6 -3
- package/dist/MarkdownEditor/editor/utils/docx/docxDeserializer.js +2 -2
- package/dist/MarkdownEditor/types.d.ts +6 -0
- package/dist/Workspace/File/FileComponent.js +3 -2
- package/dist/Workspace/Task/index.d.ts +3 -1
- package/dist/Workspace/Task/index.js +4 -3
- package/dist/Workspace/Task/style.js +2 -1
- package/package.json +2 -1
|
@@ -1058,7 +1058,8 @@ var defaultAllowedTypes = [
|
|
|
1058
1058
|
comment: props === null || props === void 0 ? void 0 : props.comment,
|
|
1059
1059
|
children: leafComponentProps.children,
|
|
1060
1060
|
hashId: hashId,
|
|
1061
|
-
tagInputProps: props.tagInputProps
|
|
1061
|
+
tagInputProps: props.tagInputProps,
|
|
1062
|
+
linkConfig: props.linkConfig
|
|
1062
1063
|
}));
|
|
1063
1064
|
if (!props.leafRender) return defaultDom;
|
|
1064
1065
|
return props.leafRender(_object_spread_props(_object_spread({}, leafComponentProps), {
|
|
@@ -21,5 +21,6 @@ export declare const MLeaf: React.MemoExoticComponent<(props: RenderLeafProps &
|
|
|
21
21
|
comment: MarkdownEditorProps['comment'];
|
|
22
22
|
fncProps: MarkdownEditorProps['fncProps'];
|
|
23
23
|
tagInputProps: MarkdownEditorProps['tagInputProps'];
|
|
24
|
+
linkConfig: MarkdownEditorProps['linkConfig'];
|
|
24
25
|
}) => React.JSX.Element>;
|
|
25
26
|
export { Blockquote, Break, Code, Head, Hr, InlineKatex, Katex, List, ListItem, Media, Mermaid, Paragraph, Schema, };
|
|
@@ -455,7 +455,7 @@ var MLeafComponent = function(props) {
|
|
|
455
455
|
draggable: false,
|
|
456
456
|
onDragStart: dragStart,
|
|
457
457
|
onClick: function(e) {
|
|
458
|
-
var _props_fncProps;
|
|
458
|
+
var _props_fncProps, _props_linkConfig, _props_linkConfig1, _props_linkConfig2;
|
|
459
459
|
// 在手机上,如果是 fnc,阻止点击事件(使用长按代替)
|
|
460
460
|
if (isMobile && hasFnc) {
|
|
461
461
|
e.preventDefault();
|
|
@@ -467,9 +467,19 @@ var MLeafComponent = function(props) {
|
|
|
467
467
|
if ((_props_fncProps = props.fncProps) === null || _props_fncProps === void 0 ? void 0 : _props_fncProps.onOriginUrlClick) {
|
|
468
468
|
props.fncProps.onOriginUrlClick(leaf === null || leaf === void 0 ? void 0 : leaf.identifier);
|
|
469
469
|
}
|
|
470
|
-
if (
|
|
470
|
+
if ((_props_linkConfig = props.linkConfig) === null || _props_linkConfig === void 0 ? void 0 : _props_linkConfig.onClick) {
|
|
471
|
+
var _props_linkConfig3;
|
|
472
|
+
var res = (_props_linkConfig3 = props.linkConfig) === null || _props_linkConfig3 === void 0 ? void 0 : _props_linkConfig3.onClick(leaf.url);
|
|
473
|
+
if (res === false) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (leaf.url && ((_props_linkConfig1 = props.linkConfig) === null || _props_linkConfig1 === void 0 ? void 0 : _props_linkConfig1.openInNewTab) !== false) {
|
|
471
478
|
window.open(leaf.url, '_blank');
|
|
472
479
|
}
|
|
480
|
+
if (leaf.url && ((_props_linkConfig2 = props.linkConfig) === null || _props_linkConfig2 === void 0 ? void 0 : _props_linkConfig2.openInNewTab) === false) {
|
|
481
|
+
window.location.href = leaf.url;
|
|
482
|
+
}
|
|
473
483
|
},
|
|
474
484
|
onTouchStart: hasFnc ? handleTouchStart : undefined,
|
|
475
485
|
onTouchEnd: hasFnc ? handleTouchEnd : undefined,
|
|
@@ -1381,7 +1381,8 @@ export var EditorStoreContext = createContext(null);
|
|
|
1381
1381
|
value: /**
|
|
1382
1382
|
* 判断是否是简单文本单元格
|
|
1383
1383
|
*/ function isSimpleTextCell(newChildren, oldChildren) {
|
|
1384
|
-
|
|
1384
|
+
var _newChildren_, _oldChildren_;
|
|
1385
|
+
return newChildren.length === 1 && oldChildren.length === 1 && typeof (newChildren === null || newChildren === void 0 ? void 0 : (_newChildren_ = newChildren[0]) === null || _newChildren_ === void 0 ? void 0 : _newChildren_.text) === 'string' && typeof (oldChildren === null || oldChildren === void 0 ? void 0 : (_oldChildren_ = oldChildren[0]) === null || _oldChildren_ === void 0 ? void 0 : _oldChildren_.text) === 'string';
|
|
1385
1386
|
}
|
|
1386
1387
|
},
|
|
1387
1388
|
{
|
|
@@ -1389,14 +1390,16 @@ export var EditorStoreContext = createContext(null);
|
|
|
1389
1390
|
value: /**
|
|
1390
1391
|
* 比较简单文本单元格
|
|
1391
1392
|
*/ function compareSimpleTextCell(newChildren, oldChildren, path, operations) {
|
|
1393
|
+
var _newChildren_, _oldChildren_;
|
|
1392
1394
|
// 只有文本内容变化
|
|
1393
|
-
if (newChildren[0].text !== oldChildren[0].text) {
|
|
1395
|
+
if ((newChildren === null || newChildren === void 0 ? void 0 : (_newChildren_ = newChildren[0]) === null || _newChildren_ === void 0 ? void 0 : _newChildren_.text) !== (oldChildren === null || oldChildren === void 0 ? void 0 : (_oldChildren_ = oldChildren[0]) === null || _oldChildren_ === void 0 ? void 0 : _oldChildren_.text)) {
|
|
1396
|
+
var _newChildren_1;
|
|
1394
1397
|
operations.push({
|
|
1395
1398
|
type: 'text',
|
|
1396
1399
|
path: _to_consumable_array(path).concat([
|
|
1397
1400
|
0
|
|
1398
1401
|
]),
|
|
1399
|
-
text: newChildren[0].text,
|
|
1402
|
+
text: (newChildren === null || newChildren === void 0 ? void 0 : (_newChildren_1 = newChildren[0]) === null || _newChildren_1 === void 0 ? void 0 : _newChildren_1.text) || '',
|
|
1400
1403
|
priority: 8
|
|
1401
1404
|
});
|
|
1402
1405
|
}
|
|
@@ -31,8 +31,8 @@ export var docxDeserializer = function(rtf, html) {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
if (fragment.type === 'head') {
|
|
34
|
-
var _fragment_children;
|
|
35
|
-
if ((fragment === null || fragment === void 0 ? void 0 : (_fragment_children = fragment.children) === null || _fragment_children === void 0 ? void 0 : _fragment_children.at(0).text) && isMarkdownLink(fragment.children.at(0).text)) {
|
|
34
|
+
var _fragment_children_at, _fragment_children;
|
|
35
|
+
if ((fragment === null || fragment === void 0 ? void 0 : (_fragment_children = fragment.children) === null || _fragment_children === void 0 ? void 0 : (_fragment_children_at = _fragment_children.at(0)) === null || _fragment_children_at === void 0 ? void 0 : _fragment_children_at.text) && isMarkdownLink(fragment.children.at(0).text)) {
|
|
36
36
|
var linkText = fragment.children.at(0).text;
|
|
37
37
|
fragment.children[0] = {
|
|
38
38
|
text: linkText === null || linkText === void 0 ? void 0 : linkText.replace(/\[([^\]]+)\]\(([^)]+)\)/, '$1'),
|
|
@@ -302,6 +302,12 @@ export type MarkdownEditorProps = {
|
|
|
302
302
|
* 自定义 markdown 转 HTML 的 remark 插件配置,格式类似 Babel 插件数组
|
|
303
303
|
*/
|
|
304
304
|
markdownToHtmlOptions?: MarkdownToHtmlOptions;
|
|
305
|
+
linkConfig?: {
|
|
306
|
+
/** 是否在新标签页打开链接 */
|
|
307
|
+
openInNewTab?: boolean;
|
|
308
|
+
/** 自定义链接渲染函数 */
|
|
309
|
+
onClick?: (url?: string) => boolean | void;
|
|
310
|
+
};
|
|
305
311
|
/**
|
|
306
312
|
* 其他属性
|
|
307
313
|
*/
|
|
@@ -825,9 +825,7 @@ export var FileComponent = function(param) {
|
|
|
825
825
|
3,
|
|
826
826
|
4
|
|
827
827
|
];
|
|
828
|
-
// 立刻进入预览页并展示 loading
|
|
829
828
|
currentCallId = ++previewRequestIdRef.current;
|
|
830
|
-
setPreviewFile(file);
|
|
831
829
|
_state.label = 1;
|
|
832
830
|
case 1:
|
|
833
831
|
_state.trys.push([
|
|
@@ -854,9 +852,11 @@ export var FileComponent = function(param) {
|
|
|
854
852
|
2
|
|
855
853
|
];
|
|
856
854
|
}
|
|
855
|
+
// 只有当返回结果不是 false 时,才设置预览文件并处理预览数据
|
|
857
856
|
if (previewData) {
|
|
858
857
|
// 区分返回类型:ReactNode -> 自定义内容;FileNode -> 新文件预览
|
|
859
858
|
if (/*#__PURE__*/ React.isValidElement(previewData) || typeof previewData === 'string' || typeof previewData === 'number' || typeof previewData === 'boolean') {
|
|
859
|
+
setPreviewFile(file);
|
|
860
860
|
content = /*#__PURE__*/ React.isValidElement(previewData) ? /*#__PURE__*/ React.cloneElement(previewData, {
|
|
861
861
|
setPreviewHeader: function(header) {
|
|
862
862
|
return setCustomPreviewHeader(header);
|
|
@@ -889,6 +889,7 @@ export var FileComponent = function(param) {
|
|
|
889
889
|
2
|
|
890
890
|
];
|
|
891
891
|
}
|
|
892
|
+
// previewData 为 undefined 或 null,使用默认预览
|
|
892
893
|
setCustomPreviewContent(null);
|
|
893
894
|
setPreviewFile(file);
|
|
894
895
|
return [
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { type FC } from 'react';
|
|
2
|
+
type TaskStatus = 'success' | 'pending' | 'loading' | 'error';
|
|
2
3
|
export interface TaskItem {
|
|
3
4
|
key: string;
|
|
4
5
|
title?: string;
|
|
5
6
|
content?: React.ReactNode | React.ReactNode[];
|
|
6
|
-
status:
|
|
7
|
+
status: TaskStatus;
|
|
7
8
|
}
|
|
8
9
|
export interface TaskItemInput {
|
|
9
10
|
items: TaskItem[];
|
|
@@ -15,3 +16,4 @@ export interface TaskListProps {
|
|
|
15
16
|
onItemClick?: (item: TaskItem) => void;
|
|
16
17
|
}
|
|
17
18
|
export declare const TaskList: FC<TaskListProps>;
|
|
19
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { Check, CircleDashed, OctagonX } from "@sofa-design/icons";
|
|
|
2
2
|
import { ConfigProvider } from "antd";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import React, { useContext } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { LoadingEffect } from "../../Components/effects";
|
|
6
6
|
import { useTaskStyle } from "./style";
|
|
7
7
|
var StatusIcon = function(param) {
|
|
8
8
|
var status = param.status;
|
|
@@ -20,9 +20,10 @@ var StatusIcon = function(param) {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
case 'loading':
|
|
23
|
-
return /*#__PURE__*/ React.createElement(
|
|
23
|
+
return /*#__PURE__*/ React.createElement(LoadingEffect, {
|
|
24
24
|
style: {
|
|
25
|
-
color: 'var(--color-gray-text-disabled)'
|
|
25
|
+
color: 'var(--color-gray-text-disabled)',
|
|
26
|
+
transform: 'scale(1.1)'
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
case 'pending':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
|
|
5
5
|
"repository": "git@github.com:ant-design/agentic-ui.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@better-scroll/mouse-wheel": "^2.5.1",
|
|
52
52
|
"@better-scroll/observe-dom": "^2.5.1",
|
|
53
53
|
"@better-scroll/scroll-bar": "^2.5.1",
|
|
54
|
+
"@galacean/effects": "^2.6.5",
|
|
54
55
|
"@juggle/resize-observer": "^3.4.0",
|
|
55
56
|
"@sofa-design/icons": "^1.6.1",
|
|
56
57
|
"ace-builds": "^1.43.4",
|