@ant-design/agentic-ui 2.0.18 → 2.0.20
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 +1 -1
- 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/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/FileMapView/FileMapViewItem.d.ts +2 -2
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +166 -152
- package/dist/MarkdownInputField/FileMapView/index.d.ts +3 -3
- package/dist/MarkdownInputField/FileMapView/index.js +12 -26
- package/dist/MarkdownInputField/FileMapView/style.js +8 -3
- package/dist/MarkdownInputField/MarkdownInputField.js +5 -32
- package/dist/MarkdownInputField/QuickActions/index.js +6 -0
- package/dist/MarkdownInputField/VoiceInput/index.js +2 -1
- package/dist/MarkdownInputField/style.js +3 -9
- 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
|
@@ -63,8 +63,6 @@ import React, {
|
|
|
63
63
|
useRef,
|
|
64
64
|
useState
|
|
65
65
|
} from "react";
|
|
66
|
-
import { Editor, Transforms } from "slate";
|
|
67
|
-
import { ReactEditor } from "slate-react";
|
|
68
66
|
import { useRefFunction } from "../Hooks/useRefFunction";
|
|
69
67
|
import {
|
|
70
68
|
BaseMarkdownEditor
|
|
@@ -318,30 +316,6 @@ var MarkdownInputField = (_a) => {
|
|
|
318
316
|
}
|
|
319
317
|
}
|
|
320
318
|
);
|
|
321
|
-
const handleContainerClick = useRefFunction(
|
|
322
|
-
(e) => {
|
|
323
|
-
var _a3, _b3, _c2, _d2;
|
|
324
|
-
if ((_a3 = markdownEditorRef == null ? void 0 : markdownEditorRef.current) == null ? void 0 : _a3.store.inputComposition)
|
|
325
|
-
return;
|
|
326
|
-
if (props.disabled)
|
|
327
|
-
return;
|
|
328
|
-
if ((_b3 = actionsRef.current) == null ? void 0 : _b3.contains(e.target))
|
|
329
|
-
return;
|
|
330
|
-
if ((_c2 = quickActionsRef.current) == null ? void 0 : _c2.contains(e.target))
|
|
331
|
-
return;
|
|
332
|
-
const editor = (_d2 = markdownEditorRef.current) == null ? void 0 : _d2.markdownEditorRef.current;
|
|
333
|
-
if (!editor)
|
|
334
|
-
return;
|
|
335
|
-
if (ReactEditor.isFocused(editor))
|
|
336
|
-
return;
|
|
337
|
-
ReactEditor.focus(editor);
|
|
338
|
-
Transforms.move(editor, { distance: 1, unit: "offset" });
|
|
339
|
-
Transforms.select(editor, {
|
|
340
|
-
anchor: Editor.end(editor, []),
|
|
341
|
-
focus: Editor.end(editor, [])
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
319
|
const sendActionsNode = /* @__PURE__ */ React.createElement(
|
|
346
320
|
SendActions,
|
|
347
321
|
{
|
|
@@ -412,8 +386,7 @@ var MarkdownInputField = (_a) => {
|
|
|
412
386
|
tabIndex: 1,
|
|
413
387
|
onMouseEnter: () => setHover(true),
|
|
414
388
|
onMouseLeave: () => setHover(false),
|
|
415
|
-
onKeyDown: handleKeyDown
|
|
416
|
-
onClick: handleContainerClick
|
|
389
|
+
onKeyDown: handleKeyDown
|
|
417
390
|
},
|
|
418
391
|
/* @__PURE__ */ React.createElement(
|
|
419
392
|
"div",
|
|
@@ -504,7 +477,7 @@ var MarkdownInputField = (_a) => {
|
|
|
504
477
|
},
|
|
505
478
|
readonly: isLoading,
|
|
506
479
|
contentStyle: {
|
|
507
|
-
padding: "var(--padding-
|
|
480
|
+
padding: "var(--padding-3x)"
|
|
508
481
|
},
|
|
509
482
|
textAreaProps: {
|
|
510
483
|
enable: true,
|
|
@@ -552,9 +525,9 @@ var MarkdownInputField = (_a) => {
|
|
|
552
525
|
justifyContent: "space-between",
|
|
553
526
|
gap: 8,
|
|
554
527
|
width: "100%",
|
|
555
|
-
paddingRight: "var(--padding-
|
|
556
|
-
paddingLeft: "var(--padding-
|
|
557
|
-
paddingBottom: "var(--padding-
|
|
528
|
+
paddingRight: "var(--padding-3x)",
|
|
529
|
+
paddingLeft: "var(--padding-3x)",
|
|
530
|
+
paddingBottom: "var(--padding-3x)"
|
|
558
531
|
}
|
|
559
532
|
},
|
|
560
533
|
/* @__PURE__ */ React.createElement(
|
|
@@ -60,7 +60,8 @@ var VoiceInputButton = (props) => {
|
|
|
60
60
|
/* @__PURE__ */ React.createElement(
|
|
61
61
|
Tooltip,
|
|
62
62
|
{
|
|
63
|
-
mouseEnterDelay:
|
|
63
|
+
mouseEnterDelay: 2,
|
|
64
|
+
arrow: false,
|
|
64
65
|
title: recording ? (locale == null ? void 0 : locale["input.voiceInputting"]) || "语音输入中,点击可停止。" : (locale == null ? void 0 : locale["input.voiceInput"]) || "语音输入"
|
|
65
66
|
},
|
|
66
67
|
/* @__PURE__ */ React.createElement(
|
|
@@ -156,15 +156,8 @@ var genStyle = (token) => {
|
|
|
156
156
|
// 限定绘制范围,降低重绘影响
|
|
157
157
|
contain: "paint"
|
|
158
158
|
},
|
|
159
|
-
"&:focus": {
|
|
160
|
-
boxShadow: "none",
|
|
161
|
-
[`${token.componentCls}-background`]: {
|
|
162
|
-
opacity: 1
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
159
|
"&-border-wrapper": {
|
|
166
160
|
width: "100%",
|
|
167
|
-
border: "2px solid transparent",
|
|
168
161
|
zIndex: 9,
|
|
169
162
|
height: "100%",
|
|
170
163
|
boxSizing: "border-box"
|
|
@@ -200,6 +193,7 @@ var genStyle = (token) => {
|
|
|
200
193
|
"&-editor-content": {
|
|
201
194
|
overflowY: "auto",
|
|
202
195
|
maxHeight: "inherit",
|
|
196
|
+
borderRadius: "inherit",
|
|
203
197
|
scrollbarColor: "var(--color-gray-text-tertiary) transparent",
|
|
204
198
|
scrollbarWidth: "thin"
|
|
205
199
|
},
|
|
@@ -219,10 +213,10 @@ var genStyle = (token) => {
|
|
|
219
213
|
"&-send-actions": {
|
|
220
214
|
position: "absolute",
|
|
221
215
|
userSelect: "none",
|
|
222
|
-
right:
|
|
216
|
+
right: 12,
|
|
223
217
|
boxSizing: "border-box",
|
|
224
218
|
zIndex: 99,
|
|
225
|
-
bottom:
|
|
219
|
+
bottom: 12,
|
|
226
220
|
display: "flex",
|
|
227
221
|
gap: "8px",
|
|
228
222
|
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.20",
|
|
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",
|