@ant-design/agentic-ui 2.0.18 → 2.0.21
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/FileView.js +4 -3
- package/dist/Bubble/type.d.ts +2 -2
- package/dist/ChatBootPage/ButtonTabStyle.js +2 -2
- package/dist/ChatBootPage/CaseReply.d.ts +10 -2
- package/dist/ChatBootPage/CaseReply.js +20 -2
- package/dist/ChatBootPage/CaseReplyStyle.js +51 -9
- package/dist/Components/ActionIconBox/index.js +102 -46
- package/dist/Components/Button/ToggleButton/index.js +3 -3
- package/dist/Components/Button/ToggleButton/style.js +1 -1
- package/dist/Components/GradientText/index.d.ts +8 -0
- package/dist/Components/GradientText/index.js +32 -0
- package/dist/Components/GradientText/style.d.ts +5 -0
- package/dist/Components/GradientText/style.js +76 -0
- package/dist/Components/TextAnimate/index.d.ts +56 -0
- package/dist/Components/TextAnimate/index.js +388 -0
- package/dist/Components/TextAnimate/style.d.ts +5 -0
- package/dist/Components/TextAnimate/style.js +53 -0
- package/dist/Components/TypingAnimation/index.d.ts +19 -0
- package/dist/Components/TypingAnimation/index.js +182 -0
- package/dist/Components/TypingAnimation/style.d.ts +5 -0
- package/dist/Components/TypingAnimation/style.js +59 -0
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +1 -1
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.js +42 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +6 -32
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/index.js +5 -3
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +1 -1
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.d.ts +2 -2
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +166 -152
- package/dist/MarkdownInputField/FileMapView/index.d.ts +5 -5
- package/dist/MarkdownInputField/FileMapView/index.js +48 -35
- package/dist/MarkdownInputField/FileMapView/style.js +17 -9
- package/dist/MarkdownInputField/MarkdownInputField.js +159 -209
- package/dist/MarkdownInputField/QuickActions/index.js +6 -0
- package/dist/MarkdownInputField/VoiceInput/index.js +2 -1
- package/dist/MarkdownInputField/style.js +4 -55
- package/dist/WelcomeMessage/index.d.ts +12 -2
- package/dist/WelcomeMessage/index.js +40 -4
- package/dist/WelcomeMessage/style.js +1 -0
- package/dist/Workspace/File/FileComponent.js +23 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/package.json +4 -4
|
@@ -65,24 +65,8 @@ var stopIconRotate = new Keyframes("stopIconRotate", {
|
|
|
65
65
|
transform: "rotate(360deg)"
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
var rotateFadeOnce = new Keyframes("rotateFadeOnce", {
|
|
69
|
-
"0%": {
|
|
70
|
-
"--mif-angle": "42deg",
|
|
71
|
-
opacity: 1
|
|
72
|
-
},
|
|
73
|
-
"100%": {
|
|
74
|
-
"--mif-angle": "calc(42deg + 1turn)",
|
|
75
|
-
opacity: 0
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
68
|
var genStyle = (token) => {
|
|
79
69
|
return {
|
|
80
|
-
// 声明 CSS 自定义属性 --mif-angle,使其可动画(需浏览器支持 @property)
|
|
81
|
-
"@property --mif-angle": {
|
|
82
|
-
syntax: '"<angle>"',
|
|
83
|
-
"initial-value": "0deg",
|
|
84
|
-
inherits: false
|
|
85
|
-
},
|
|
86
70
|
[token.componentCls]: {
|
|
87
71
|
width: "100%",
|
|
88
72
|
height: "100%",
|
|
@@ -101,16 +85,7 @@ var genStyle = (token) => {
|
|
|
101
85
|
boxSizing: "border-box"
|
|
102
86
|
},
|
|
103
87
|
"&:active,&.active": {
|
|
104
|
-
|
|
105
|
-
opacity: 0,
|
|
106
|
-
height: "100%",
|
|
107
|
-
backgroundImage: "radial-gradient(127% 127% at 0% 0%, rgba(255, 255, 255, 0) 57%, #EEF0F5 84%),linear-gradient(var(--mif-angle), #D7B9FF 14%, #9BA0FF 57%, #09B1FF 98%)",
|
|
108
|
-
// 单一动画:一次性旋转并淡出
|
|
109
|
-
animationName: rotateFadeOnce,
|
|
110
|
-
animationDuration: "2.5s",
|
|
111
|
-
animationTimingFunction: "ease-in-out",
|
|
112
|
-
animationIterationCount: "1"
|
|
113
|
-
}
|
|
88
|
+
outline: "1px solid transparent"
|
|
114
89
|
},
|
|
115
90
|
"&-enlarged": {
|
|
116
91
|
"> div:last-child": {
|
|
@@ -134,37 +109,10 @@ var genStyle = (token) => {
|
|
|
134
109
|
maxHeight: "none",
|
|
135
110
|
overflow: "auto",
|
|
136
111
|
width: "100%"
|
|
137
|
-
},
|
|
138
|
-
[`${token.componentCls}-background`]: {
|
|
139
|
-
// 放大时保持和普通状态相同的背景效果
|
|
140
|
-
opacity: 1
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
"&-background": {
|
|
144
|
-
boxSizing: "border-box",
|
|
145
|
-
position: "absolute",
|
|
146
|
-
width: "calc(100% - 4px)",
|
|
147
|
-
height: "calc(100% - 4px)",
|
|
148
|
-
zIndex: 2,
|
|
149
|
-
backgroundColor: "transparent",
|
|
150
|
-
pointerEvents: "none",
|
|
151
|
-
borderRadius: "inherit",
|
|
152
|
-
// 自定义属性控制线性渐变角度,默认与原始设计保持一致 42deg
|
|
153
|
-
"--mif-angle": "42deg",
|
|
154
|
-
// 提示浏览器该节点将频繁重绘背景图像
|
|
155
|
-
willChange: "background-image",
|
|
156
|
-
// 限定绘制范围,降低重绘影响
|
|
157
|
-
contain: "paint"
|
|
158
|
-
},
|
|
159
|
-
"&:focus": {
|
|
160
|
-
boxShadow: "none",
|
|
161
|
-
[`${token.componentCls}-background`]: {
|
|
162
|
-
opacity: 1
|
|
163
112
|
}
|
|
164
113
|
},
|
|
165
114
|
"&-border-wrapper": {
|
|
166
115
|
width: "100%",
|
|
167
|
-
border: "2px solid transparent",
|
|
168
116
|
zIndex: 9,
|
|
169
117
|
height: "100%",
|
|
170
118
|
boxSizing: "border-box"
|
|
@@ -200,6 +148,7 @@ var genStyle = (token) => {
|
|
|
200
148
|
"&-editor-content": {
|
|
201
149
|
overflowY: "auto",
|
|
202
150
|
maxHeight: "inherit",
|
|
151
|
+
borderRadius: "inherit",
|
|
203
152
|
scrollbarColor: "var(--color-gray-text-tertiary) transparent",
|
|
204
153
|
scrollbarWidth: "thin"
|
|
205
154
|
},
|
|
@@ -219,10 +168,10 @@ var genStyle = (token) => {
|
|
|
219
168
|
"&-send-actions": {
|
|
220
169
|
position: "absolute",
|
|
221
170
|
userSelect: "none",
|
|
222
|
-
right:
|
|
171
|
+
right: 12,
|
|
223
172
|
boxSizing: "border-box",
|
|
224
173
|
zIndex: 99,
|
|
225
|
-
bottom:
|
|
174
|
+
bottom: 12,
|
|
226
175
|
display: "flex",
|
|
227
176
|
gap: "8px",
|
|
228
177
|
alignItems: "center",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TextAnimateProps } from '../Components/TextAnimate';
|
|
3
|
+
import { TypingAnimationProps } from '../Components/TypingAnimation';
|
|
4
|
+
export type WelcomeMessageTitleAnimateProps = Pick<TextAnimateProps, 'delay' | 'duration' | 'variants' | 'by' | 'startOnView' | 'once' | 'animation'>;
|
|
5
|
+
export type WelcomeMessageDescriptionAnimateProps = Pick<TypingAnimationProps, 'duration' | 'typeSpeed' | 'deleteSpeed' | 'delay' | 'pauseDelay' | 'loop' | 'startOnView' | 'showCursor' | 'blinkCursor' | 'cursorStyle'>;
|
|
2
6
|
/**
|
|
3
7
|
* WelcomeMessage 组件的属性接口
|
|
4
8
|
* @interface WelcomeMessageProps
|
|
@@ -7,12 +11,16 @@ export interface WelcomeMessageProps {
|
|
|
7
11
|
/** 标题 */
|
|
8
12
|
title?: React.ReactNode;
|
|
9
13
|
/** 描述 */
|
|
10
|
-
description?:
|
|
14
|
+
description?: string;
|
|
11
15
|
/** 自定义样式类名,用于各个提示项的不同部分 */
|
|
12
16
|
classNames?: {
|
|
13
17
|
title?: string;
|
|
14
18
|
description?: string;
|
|
15
19
|
};
|
|
20
|
+
/** 标题动画属性 */
|
|
21
|
+
titleAnimateProps?: WelcomeMessageTitleAnimateProps;
|
|
22
|
+
/** 描述动画属性 */
|
|
23
|
+
descriptionAnimateProps?: WelcomeMessageDescriptionAnimateProps;
|
|
16
24
|
/** 自定义样式 */
|
|
17
25
|
style?: React.CSSProperties;
|
|
18
26
|
/** 自定义根节点样式类名 */
|
|
@@ -28,10 +36,12 @@ export interface WelcomeMessageProps {
|
|
|
28
36
|
* @description 欢迎消息组件,用于显示聊天开始时的欢迎信息
|
|
29
37
|
* @param {WelcomeMessageProps} props - 组件属性
|
|
30
38
|
* @param {React.ReactNode} [props.title] - 欢迎标题
|
|
31
|
-
* @param {
|
|
39
|
+
* @param {string} [props.description] - 欢迎描述
|
|
32
40
|
* @param {Object} [props.classNames] - 自定义样式类名
|
|
33
41
|
* @param {string} [props.classNames.title] - 标题样式类名
|
|
34
42
|
* @param {string} [props.classNames.description] - 描述样式类名
|
|
43
|
+
* @param {WelcomeMessageTitleAnimateProps} [props.titleAnimateProps] - 标题动画属性
|
|
44
|
+
* @param {WelcomeMessageDescriptionAnimateProps} [props.descriptionAnimateProps] - 描述动画属性
|
|
35
45
|
* @param {React.CSSProperties} [props.style] - 自定义样式
|
|
36
46
|
* @param {string} [props.rootClassName] - 根节点样式类名
|
|
37
47
|
*
|
|
@@ -1,12 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
1
21
|
// src/WelcomeMessage/index.tsx
|
|
2
22
|
import { ConfigProvider } from "antd";
|
|
3
23
|
import classnames from "classnames";
|
|
4
24
|
import React, { useContext } from "react";
|
|
25
|
+
import { TextAnimate } from "../Components/TextAnimate";
|
|
26
|
+
import {
|
|
27
|
+
TypingAnimation
|
|
28
|
+
} from "../Components/TypingAnimation";
|
|
5
29
|
import { useStyle } from "./style";
|
|
6
30
|
var WelcomeMessage = ({
|
|
7
31
|
title,
|
|
8
32
|
description,
|
|
9
33
|
classNames,
|
|
34
|
+
titleAnimateProps,
|
|
35
|
+
descriptionAnimateProps,
|
|
10
36
|
style,
|
|
11
37
|
rootClassName
|
|
12
38
|
}) => {
|
|
@@ -14,14 +40,24 @@ var WelcomeMessage = ({
|
|
|
14
40
|
const prefixCls = getPrefixCls("agentic-welcome");
|
|
15
41
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
16
42
|
return wrapSSR(
|
|
17
|
-
/* @__PURE__ */ React.createElement("div", { className: classnames(prefixCls, hashId, rootClassName), style }, title && /* @__PURE__ */ React.createElement(
|
|
18
|
-
|
|
19
|
-
{
|
|
43
|
+
/* @__PURE__ */ React.createElement("div", { className: classnames(prefixCls, hashId, rootClassName), style }, title && /* @__PURE__ */ React.createElement(
|
|
44
|
+
TextAnimate,
|
|
45
|
+
__spreadProps(__spreadValues({
|
|
46
|
+
once: true
|
|
47
|
+
}, titleAnimateProps), {
|
|
48
|
+
as: "div",
|
|
49
|
+
className: classnames(`${prefixCls}-title`, classNames == null ? void 0 : classNames.title)
|
|
50
|
+
}),
|
|
51
|
+
title
|
|
52
|
+
), description && /* @__PURE__ */ React.createElement(
|
|
53
|
+
TypingAnimation,
|
|
54
|
+
__spreadProps(__spreadValues({}, descriptionAnimateProps), {
|
|
55
|
+
as: "div",
|
|
20
56
|
className: classnames(
|
|
21
57
|
`${prefixCls}-description`,
|
|
22
58
|
classNames == null ? void 0 : classNames.description
|
|
23
59
|
)
|
|
24
|
-
},
|
|
60
|
+
}),
|
|
25
61
|
description
|
|
26
62
|
))
|
|
27
63
|
);
|
|
@@ -493,6 +493,7 @@ var FileComponent = ({
|
|
|
493
493
|
const nodeIdCacheRef = useRef(
|
|
494
494
|
/* @__PURE__ */ new WeakMap()
|
|
495
495
|
);
|
|
496
|
+
const safeNodes = nodes || [];
|
|
496
497
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
497
498
|
const { locale } = useContext(I18nContext);
|
|
498
499
|
const prefixCls = getPrefixCls("workspace-file");
|
|
@@ -521,6 +522,28 @@ var FileComponent = ({
|
|
|
521
522
|
handleBackToList();
|
|
522
523
|
}
|
|
523
524
|
}, [resetKey]);
|
|
525
|
+
useEffect(() => {
|
|
526
|
+
if (!previewFile)
|
|
527
|
+
return;
|
|
528
|
+
const findUpdatedFile = (nodesList) => {
|
|
529
|
+
for (const node of nodesList) {
|
|
530
|
+
if ("children" in node) {
|
|
531
|
+
const found = findUpdatedFile(node.children);
|
|
532
|
+
if (found)
|
|
533
|
+
return found;
|
|
534
|
+
} else {
|
|
535
|
+
if (node.id && node.id === previewFile.id || node.name === previewFile.name && node.type === previewFile.type) {
|
|
536
|
+
return node;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return null;
|
|
541
|
+
};
|
|
542
|
+
const updatedFile = findUpdatedFile(safeNodes);
|
|
543
|
+
if (updatedFile) {
|
|
544
|
+
setPreviewFile(updatedFile);
|
|
545
|
+
}
|
|
546
|
+
}, [nodes]);
|
|
524
547
|
const handleToggleGroup = (groupId, type, collapsed) => {
|
|
525
548
|
setCollapsedGroups((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
526
549
|
[groupId]: collapsed
|
|
@@ -627,7 +650,6 @@ var FileComponent = ({
|
|
|
627
650
|
actionRef.current = null;
|
|
628
651
|
};
|
|
629
652
|
}, [actionRef, handlePreview, handleBackToList]);
|
|
630
|
-
const safeNodes = nodes || [];
|
|
631
653
|
const hasKeyword = Boolean((keyword != null ? keyword : "").trim());
|
|
632
654
|
const renderSearchInput = () => {
|
|
633
655
|
if (!showSearch)
|
package/dist/index.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ export * from './Components/ActionIconBox';
|
|
|
10
10
|
export * from './Components/Button';
|
|
11
11
|
export * from './Components/LayoutHeader';
|
|
12
12
|
export * from './Components/Loading';
|
|
13
|
+
export * from './Components/lotties';
|
|
13
14
|
export * from './Components/SuggestionList';
|
|
14
15
|
export * from './Components/VisualList';
|
|
15
|
-
export * from './Components/lotties';
|
|
16
16
|
export * from './Hooks/useAutoScroll';
|
|
17
17
|
export { useLanguage } from './Hooks/useLanguage';
|
|
18
18
|
export * from './Hooks/useRefFunction';
|
|
@@ -77,6 +77,9 @@ export * from './MarkdownInputField/VoiceInput';
|
|
|
77
77
|
export * from './Schema/SchemaRenderer/templateEngine';
|
|
78
78
|
export * from './Schema/validator';
|
|
79
79
|
export * from './Utils/proxySandbox';
|
|
80
|
+
export * from './Components/GradientText';
|
|
81
|
+
export * from './Components/TextAnimate';
|
|
82
|
+
export * from './Components/TypingAnimation';
|
|
80
83
|
export * from './MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem';
|
|
81
84
|
export * from './MarkdownInputField/AttachmentButton/AttachmentFileList';
|
|
82
85
|
export * from './MarkdownInputField/AttachmentButton/utils';
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,9 @@ export * from "./Components/ActionIconBox";
|
|
|
10
10
|
export * from "./Components/Button";
|
|
11
11
|
export * from "./Components/LayoutHeader";
|
|
12
12
|
export * from "./Components/Loading";
|
|
13
|
+
export * from "./Components/lotties";
|
|
13
14
|
export * from "./Components/SuggestionList";
|
|
14
15
|
export * from "./Components/VisualList";
|
|
15
|
-
export * from "./Components/lotties";
|
|
16
16
|
export * from "./Hooks/useAutoScroll";
|
|
17
17
|
import { useLanguage } from "./Hooks/useLanguage";
|
|
18
18
|
export * from "./Hooks/useRefFunction";
|
|
@@ -75,6 +75,9 @@ export * from "./MarkdownInputField/VoiceInput";
|
|
|
75
75
|
export * from "./Schema/SchemaRenderer/templateEngine";
|
|
76
76
|
export * from "./Schema/validator";
|
|
77
77
|
export * from "./Utils/proxySandbox";
|
|
78
|
+
export * from "./Components/GradientText";
|
|
79
|
+
export * from "./Components/TextAnimate";
|
|
80
|
+
export * from "./Components/TypingAnimation";
|
|
78
81
|
export * from "./MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem";
|
|
79
82
|
export * from "./MarkdownInputField/AttachmentButton/AttachmentFileList";
|
|
80
83
|
export * from "./MarkdownInputField/AttachmentButton/utils";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.21",
|
|
4
4
|
"description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
|
|
5
5
|
"repository": "git@github.com:ant-design/agentic-ui.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@ant-design/cssinjs": "^1.24.0",
|
|
45
45
|
"@ant-design/icons": "^5.6.1",
|
|
46
46
|
"@ant-design/pro-components": "^2.8.10",
|
|
47
|
-
"@ant-design/theme-token": "^0.0.
|
|
47
|
+
"@ant-design/theme-token": "^0.0.20",
|
|
48
48
|
"@babel/runtime": "^7.28.4",
|
|
49
49
|
"@better-scroll/core": "^2.5.1",
|
|
50
50
|
"@better-scroll/mouse-wheel": "^2.5.1",
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
"ace-builds": "^1.43.4",
|
|
56
56
|
"ajv": "^8.17.1",
|
|
57
57
|
"ajv-formats": "^3.0.1",
|
|
58
|
-
"antd": "^5.
|
|
58
|
+
"antd": "^5.28.0",
|
|
59
59
|
"blob-util": "^2.0.2",
|
|
60
60
|
"chart.js": "^4.5.1",
|
|
61
61
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
62
62
|
"classnames": "^2.5.1",
|
|
63
63
|
"copy-to-clipboard": "^3.3.3",
|
|
64
|
-
"dayjs": "^1.11.
|
|
64
|
+
"dayjs": "^1.11.19",
|
|
65
65
|
"diacritics": "^1.3.0",
|
|
66
66
|
"direction": "^1.0.4",
|
|
67
67
|
"dompurify": "^3.3.0",
|