@ant-design/agentic-ui 2.0.28 → 2.2.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/Hooks/useIntersectionOnce.d.ts +5 -0
- package/dist/Hooks/useIntersectionOnce.js +79 -0
- package/dist/MarkdownEditor/editor/store.d.ts +4 -0
- package/dist/MarkdownEditor/editor/store.js +110 -1
- package/dist/Plugins/chart/AreaChart/index.js +20 -9
- package/dist/Plugins/chart/BarChart/index.js +12 -1
- package/dist/Plugins/chart/ChartMark/Area.js +21 -10
- package/dist/Plugins/chart/ChartMark/Bar.js +19 -8
- package/dist/Plugins/chart/ChartMark/Column.js +19 -8
- package/dist/Plugins/chart/ChartMark/Line.js +20 -9
- package/dist/Plugins/chart/ChartMark/Pie.js +12 -1
- package/dist/Plugins/chart/ChartRender.js +182 -48
- package/dist/Plugins/chart/DonutChart/index.js +12 -1
- package/dist/Plugins/chart/FunnelChart/index.d.ts +2 -0
- package/dist/Plugins/chart/FunnelChart/index.js +69 -18
- package/dist/Plugins/chart/LineChart/index.js +20 -9
- package/dist/Plugins/chart/RadarChart/index.js +19 -8
- package/dist/Plugins/chart/ScatterChart/index.js +12 -1
- package/dist/Plugins/chart/loadChartRuntime.d.ts +18 -0
- package/dist/Plugins/chart/loadChartRuntime.js +91 -0
- package/dist/Plugins/defaultPlugins.d.ts +3 -0
- package/dist/Plugins/defaultPlugins.js +2 -0
- package/dist/Plugins/mermaid/Mermaid.d.ts +5 -2
- package/dist/Plugins/mermaid/Mermaid.js +131 -38
- package/dist/Plugins/mermaid/index.js +1 -1
- package/dist/TaskList/index.js +2 -8
- package/dist/TaskList/style.js +1 -7
- package/dist/ToolUseBar/ToolUseBarItem.js +43 -30
- package/dist/ToolUseBar/ToolUseBarItemComponents.js +53 -8
- package/dist/ToolUseBar/style.js +3 -1
- package/dist/ToolUseBar/thinkStyle.js +9 -1
- package/package.json +2 -1
|
@@ -6,6 +6,9 @@ export declare const standardPlugins: {
|
|
|
6
6
|
code: typeof CodeElement;
|
|
7
7
|
chart: (props: import("slate-react").RenderElementProps) => import("react").JSX.Element;
|
|
8
8
|
katex: typeof KatexElement;
|
|
9
|
+
mermaid: (props: {
|
|
10
|
+
element: import("..").CodeNode;
|
|
11
|
+
}) => import("react").JSX.Element | null;
|
|
9
12
|
'inline-katex': ({ children, element, attributes, style, }: import("..").ElementProps<import("..").InlineKatexNode> & {
|
|
10
13
|
style?: import("react").CSSProperties | undefined;
|
|
11
14
|
}) => import("react").JSX.Element;
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { ChartElement } from "./chart";
|
|
3
3
|
import { CodeElement } from "./code";
|
|
4
4
|
import { InlineKatex, KatexElement } from "./katex";
|
|
5
|
+
import { Mermaid } from "./mermaid/Mermaid";
|
|
5
6
|
var standardPlugins = [
|
|
6
7
|
{
|
|
7
8
|
elements: {
|
|
8
9
|
code: CodeElement,
|
|
9
10
|
chart: ChartElement,
|
|
10
11
|
katex: KatexElement,
|
|
12
|
+
mermaid: Mermaid,
|
|
11
13
|
"inline-katex": InlineKatex
|
|
12
14
|
}
|
|
13
15
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CodeNode } from '../../MarkdownEditor/el';
|
|
3
|
+
type MermaidApi = typeof import('mermaid').default;
|
|
4
|
+
export declare const loadMermaid: () => Promise<MermaidApi>;
|
|
3
5
|
/**
|
|
4
6
|
* Mermaid 组件 - Mermaid图表渲染组件
|
|
5
7
|
*
|
|
@@ -36,5 +38,6 @@ import { CodeNode } from '../../MarkdownEditor/el';
|
|
|
36
38
|
* - 自动生成唯一ID
|
|
37
39
|
*/
|
|
38
40
|
export declare const Mermaid: (props: {
|
|
39
|
-
|
|
40
|
-
}) => React.JSX.Element;
|
|
41
|
+
element: CodeNode;
|
|
42
|
+
}) => React.JSX.Element | null;
|
|
43
|
+
export {};
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined")
|
|
11
|
+
return require.apply(this, arguments);
|
|
12
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
1
30
|
var __async = (__this, __arguments, generator) => {
|
|
2
31
|
return new Promise((resolve, reject) => {
|
|
3
32
|
var fulfilled = (value) => {
|
|
@@ -20,61 +49,124 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20
49
|
};
|
|
21
50
|
|
|
22
51
|
// src/Plugins/mermaid/Mermaid.tsx
|
|
23
|
-
import
|
|
24
|
-
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
52
|
+
import React, { useEffect, useMemo, useRef } from "react";
|
|
25
53
|
import { useGetSetState } from "react-use";
|
|
54
|
+
import { useIntersectionOnce } from "../../Hooks/useIntersectionOnce";
|
|
55
|
+
var mermaidLoader = null;
|
|
56
|
+
var loadMermaid = () => __async(void 0, null, function* () {
|
|
57
|
+
if (typeof window === "undefined") {
|
|
58
|
+
throw new Error("Mermaid 仅在浏览器环境中可用");
|
|
59
|
+
}
|
|
60
|
+
if (!mermaidLoader) {
|
|
61
|
+
mermaidLoader = Promise.resolve().then(() => __toESM(__require("mermaid"))).then((module) => {
|
|
62
|
+
const api = module.default;
|
|
63
|
+
if (api == null ? void 0 : api.initialize) {
|
|
64
|
+
api.initialize({ startOnLoad: false });
|
|
65
|
+
}
|
|
66
|
+
return api;
|
|
67
|
+
}).catch((error) => {
|
|
68
|
+
mermaidLoader = null;
|
|
69
|
+
throw error;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return mermaidLoader;
|
|
73
|
+
});
|
|
26
74
|
var Mermaid = (props) => {
|
|
75
|
+
var _a;
|
|
76
|
+
const isBrowser = typeof window !== "undefined";
|
|
27
77
|
const [state, setState] = useGetSetState({
|
|
28
78
|
code: "",
|
|
29
79
|
error: ""
|
|
30
80
|
});
|
|
81
|
+
const containerRef = useRef(null);
|
|
31
82
|
const divRef = useRef(null);
|
|
32
|
-
const timer = useRef(
|
|
83
|
+
const timer = useRef(null);
|
|
84
|
+
const mermaidRef = useRef(null);
|
|
33
85
|
const id = useMemo(
|
|
34
86
|
() => "m" + (Date.now() + Math.ceil(Math.random() * 1e3)),
|
|
35
87
|
[]
|
|
36
88
|
);
|
|
37
|
-
const
|
|
38
|
-
mermaid.render(id, state().code).then((res) => {
|
|
39
|
-
setState({ error: "" });
|
|
40
|
-
divRef.current.innerHTML = res.svg;
|
|
41
|
-
}).catch(() => {
|
|
42
|
-
mermaid.parse(state().code).catch((e) => {
|
|
43
|
-
setState({ error: e.toString(), code: "" });
|
|
44
|
-
});
|
|
45
|
-
}).finally(() => {
|
|
46
|
-
var _a;
|
|
47
|
-
(_a = document.querySelector("#d" + id)) == null ? void 0 : _a.classList.add("hidden");
|
|
48
|
-
});
|
|
49
|
-
}), []);
|
|
89
|
+
const isVisible = useIntersectionOnce(containerRef);
|
|
50
90
|
useEffect(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
91
|
+
if (!isBrowser) {
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
console.log("props---", props);
|
|
95
|
+
const nextCode = props.element.value || "";
|
|
96
|
+
const currentState = state();
|
|
97
|
+
if (!isVisible) {
|
|
98
|
+
return void 0;
|
|
99
|
+
}
|
|
100
|
+
if (currentState.code === nextCode && currentState.error === "") {
|
|
101
|
+
return void 0;
|
|
102
|
+
}
|
|
103
|
+
if (timer.current !== null) {
|
|
104
|
+
window.clearTimeout(timer.current);
|
|
105
|
+
timer.current = null;
|
|
106
|
+
}
|
|
107
|
+
if (!nextCode) {
|
|
108
|
+
timer.current = window.setTimeout(() => {
|
|
109
|
+
setState({ code: "", error: "" });
|
|
110
|
+
if (divRef.current) {
|
|
111
|
+
divRef.current.innerHTML = "";
|
|
112
|
+
}
|
|
113
|
+
timer.current = null;
|
|
114
|
+
}, 0);
|
|
115
|
+
return () => {
|
|
116
|
+
if (timer.current !== null) {
|
|
117
|
+
window.clearTimeout(timer.current);
|
|
118
|
+
timer.current = null;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
65
121
|
}
|
|
66
|
-
|
|
67
|
-
|
|
122
|
+
const delay = currentState.code ? 300 : 0;
|
|
123
|
+
timer.current = window.setTimeout(() => __async(void 0, null, function* () {
|
|
124
|
+
var _a2, _b;
|
|
125
|
+
try {
|
|
126
|
+
const api = (_a2 = mermaidRef.current) != null ? _a2 : yield loadMermaid();
|
|
127
|
+
mermaidRef.current = api;
|
|
128
|
+
const { svg } = yield api.render(id, nextCode);
|
|
129
|
+
if (divRef.current) {
|
|
130
|
+
divRef.current.innerHTML = svg;
|
|
131
|
+
}
|
|
132
|
+
setState({ code: nextCode, error: "" });
|
|
133
|
+
} catch (error) {
|
|
134
|
+
const api = mermaidRef.current;
|
|
135
|
+
if (api) {
|
|
136
|
+
try {
|
|
137
|
+
yield api.parse(nextCode);
|
|
138
|
+
} catch (parseError) {
|
|
139
|
+
setState({ error: String(parseError), code: "" });
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
setState({ error: String(error), code: "" });
|
|
144
|
+
} finally {
|
|
145
|
+
(_b = document.querySelector("#d" + id)) == null ? void 0 : _b.classList.add("hidden");
|
|
146
|
+
}
|
|
147
|
+
timer.current = null;
|
|
148
|
+
}), delay);
|
|
149
|
+
return () => {
|
|
150
|
+
if (timer.current !== null) {
|
|
151
|
+
window.clearTimeout(timer.current);
|
|
152
|
+
timer.current = null;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}, [isBrowser, (_a = props == null ? void 0 : props.element) == null ? void 0 : _a.value, id, isVisible, setState, state]);
|
|
156
|
+
if (!isBrowser) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
const snapshot = state();
|
|
68
160
|
return /* @__PURE__ */ React.createElement(
|
|
69
161
|
"div",
|
|
70
162
|
{
|
|
163
|
+
ref: containerRef,
|
|
71
164
|
style: {
|
|
72
165
|
marginBottom: "0.75em",
|
|
73
166
|
cursor: "default",
|
|
74
167
|
userSelect: "none",
|
|
75
168
|
padding: "0.75rem 0",
|
|
76
|
-
|
|
77
|
-
borderRadius: "0.25em",
|
|
169
|
+
borderRadius: "1em",
|
|
78
170
|
display: "flex",
|
|
79
171
|
justifyContent: "center"
|
|
80
172
|
},
|
|
@@ -89,14 +181,15 @@ var Mermaid = (props) => {
|
|
|
89
181
|
width: "100%",
|
|
90
182
|
display: "flex",
|
|
91
183
|
justifyContent: "center",
|
|
92
|
-
visibility:
|
|
184
|
+
visibility: snapshot.code && !snapshot.error ? "visible" : "hidden"
|
|
93
185
|
}
|
|
94
186
|
}
|
|
95
187
|
),
|
|
96
|
-
|
|
97
|
-
!
|
|
188
|
+
snapshot.error && /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", color: "rgba(239, 68, 68, 0.8)" } }, snapshot.error),
|
|
189
|
+
!snapshot.code && !snapshot.error && /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", color: "#6B7280" } }, "Empty")
|
|
98
190
|
);
|
|
99
191
|
};
|
|
100
192
|
export {
|
|
101
|
-
Mermaid
|
|
193
|
+
Mermaid,
|
|
194
|
+
loadMermaid
|
|
102
195
|
};
|
|
@@ -157,7 +157,7 @@ function MermaidElement(props) {
|
|
|
157
157
|
),
|
|
158
158
|
/* @__PURE__ */ React.createElement("div", { className: "ant-agentic-md-editor-hidden" }, props.children)
|
|
159
159
|
),
|
|
160
|
-
/* @__PURE__ */ React.createElement(Mermaid, {
|
|
160
|
+
/* @__PURE__ */ React.createElement(Mermaid, { element: props.element })
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
export {
|
package/dist/TaskList/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import classNames from "classnames";
|
|
|
5
5
|
import { useMergedState } from "rc-util";
|
|
6
6
|
import React, { memo, useCallback, useContext } from "react";
|
|
7
7
|
import { ActionIconBox } from "../Components/ActionIconBox";
|
|
8
|
-
import { I18nContext } from "../I18n";
|
|
9
8
|
import { Loading } from "../Components/Loading";
|
|
9
|
+
import { I18nContext } from "../I18n";
|
|
10
10
|
import { useStyle } from "./style";
|
|
11
11
|
var LOADING_SIZE = 16;
|
|
12
12
|
var buildClassName = (...args) => classNames(...args);
|
|
@@ -104,13 +104,7 @@ var TaskListItem = ({
|
|
|
104
104
|
loading: false,
|
|
105
105
|
onClick: handleToggle
|
|
106
106
|
},
|
|
107
|
-
/* @__PURE__ */ React.createElement(
|
|
108
|
-
ChevronUp,
|
|
109
|
-
{
|
|
110
|
-
className: buildClassName(`${prefixCls}-arrow`, hashId),
|
|
111
|
-
"data-testid": "task-list-arrow"
|
|
112
|
-
}
|
|
113
|
-
)
|
|
107
|
+
/* @__PURE__ */ React.createElement(ChevronUp, { "data-testid": "task-list-arrow" })
|
|
114
108
|
)
|
|
115
109
|
)
|
|
116
110
|
), !isCollapsed && /* @__PURE__ */ React.createElement("div", { className: buildClassName(`${prefixCls}-body`, hashId) }, /* @__PURE__ */ React.createElement("div", { className: buildClassName(`${prefixCls}-content`, hashId) }, item.content)))
|
package/dist/TaskList/style.js
CHANGED
|
@@ -101,13 +101,7 @@ var genStyle = (token) => {
|
|
|
101
101
|
flexShrink: 0,
|
|
102
102
|
width: 16,
|
|
103
103
|
height: 16,
|
|
104
|
-
|
|
105
|
-
cursor: "pointer",
|
|
106
|
-
transition: "all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)",
|
|
107
|
-
"&:hover": {
|
|
108
|
-
backgroundColor: "var(--color-gray-control-fill-hover)",
|
|
109
|
-
borderRadius: "var(--radius-control-sm)"
|
|
110
|
-
}
|
|
104
|
+
transition: "all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)"
|
|
111
105
|
}
|
|
112
106
|
},
|
|
113
107
|
"&-body": {
|
|
@@ -83,52 +83,65 @@ var ToolUseBarItemComponent = ({
|
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
|
-
return /* @__PURE__ */ React.createElement(
|
|
86
|
+
return /* @__PURE__ */ React.createElement(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
|
|
90
|
-
"data-testid": "
|
|
91
|
-
|
|
89
|
+
key: tool.id,
|
|
90
|
+
"data-testid": "ToolUserItem",
|
|
91
|
+
className: classnames(toolClassName, {
|
|
92
|
+
[`${prefixCls}-tool-collapsed`]: !showContent
|
|
93
|
+
})
|
|
92
94
|
},
|
|
93
95
|
/* @__PURE__ */ React.createElement(
|
|
94
96
|
"div",
|
|
95
97
|
{
|
|
96
|
-
className:
|
|
97
|
-
|
|
98
|
+
className: classnames(toolBarClassName, {
|
|
99
|
+
[`${prefixCls}-tool-bar-collapsed`]: !showContent
|
|
100
|
+
}),
|
|
101
|
+
"data-testid": "tool-user-item-tool-bar",
|
|
102
|
+
onClick: handleClick
|
|
98
103
|
},
|
|
99
|
-
/* @__PURE__ */ React.createElement(
|
|
104
|
+
/* @__PURE__ */ React.createElement(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: toolHeaderClassName,
|
|
108
|
+
"data-testid": "tool-user-item-tool-header"
|
|
109
|
+
},
|
|
110
|
+
/* @__PURE__ */ React.createElement(ToolImage, { tool, prefixCls, hashId })
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ React.createElement(
|
|
113
|
+
ToolHeaderRight,
|
|
114
|
+
{
|
|
115
|
+
tool,
|
|
116
|
+
prefixCls,
|
|
117
|
+
hashId,
|
|
118
|
+
light
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ React.createElement(ToolTime, { tool, prefixCls, hashId }),
|
|
122
|
+
/* @__PURE__ */ React.createElement(
|
|
123
|
+
ToolExpand,
|
|
124
|
+
{
|
|
125
|
+
showContent,
|
|
126
|
+
expanded,
|
|
127
|
+
prefixCls,
|
|
128
|
+
hashId,
|
|
129
|
+
onExpandClick: handleExpandClick
|
|
130
|
+
}
|
|
131
|
+
)
|
|
100
132
|
),
|
|
101
133
|
/* @__PURE__ */ React.createElement(
|
|
102
|
-
|
|
134
|
+
ToolContent,
|
|
103
135
|
{
|
|
104
136
|
tool,
|
|
105
137
|
prefixCls,
|
|
106
138
|
hashId,
|
|
107
|
-
light
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
/* @__PURE__ */ React.createElement(ToolTime, { tool, prefixCls, hashId }),
|
|
111
|
-
/* @__PURE__ */ React.createElement(
|
|
112
|
-
ToolExpand,
|
|
113
|
-
{
|
|
139
|
+
light,
|
|
114
140
|
showContent,
|
|
115
|
-
expanded
|
|
116
|
-
prefixCls,
|
|
117
|
-
hashId,
|
|
118
|
-
onExpandClick: handleExpandClick
|
|
141
|
+
expanded
|
|
119
142
|
}
|
|
120
143
|
)
|
|
121
|
-
)
|
|
122
|
-
ToolContent,
|
|
123
|
-
{
|
|
124
|
-
tool,
|
|
125
|
-
prefixCls,
|
|
126
|
-
hashId,
|
|
127
|
-
light,
|
|
128
|
-
showContent,
|
|
129
|
-
expanded
|
|
130
|
-
}
|
|
131
|
-
));
|
|
144
|
+
);
|
|
132
145
|
};
|
|
133
146
|
var ToolUseBarItem = memo(ToolUseBarItemComponent);
|
|
134
147
|
export {
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
// src/ToolUseBar/ToolUseBarItemComponents.tsx
|
|
19
19
|
import { Api, ChevronUp, X } from "@sofa-design/icons";
|
|
20
20
|
import classnames from "classnames";
|
|
21
|
-
import { motion } from "framer-motion";
|
|
21
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
22
22
|
import React, { memo, useCallback, useMemo } from "react";
|
|
23
23
|
var ToolImageComponent = ({
|
|
24
24
|
tool,
|
|
@@ -217,20 +217,65 @@ var ToolContentComponent = ({
|
|
|
217
217
|
const contentDom = useMemo(() => {
|
|
218
218
|
return tool.content ? /* @__PURE__ */ React.createElement("div", { className: contentClassName }, tool.content) : null;
|
|
219
219
|
}, [tool.content, contentClassName]);
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
const contentVariants = useMemo(
|
|
221
|
+
() => ({
|
|
222
|
+
expanded: {
|
|
223
|
+
height: "auto",
|
|
224
|
+
opacity: 1
|
|
225
|
+
},
|
|
226
|
+
collapsed: {
|
|
227
|
+
height: 0,
|
|
228
|
+
opacity: 0
|
|
229
|
+
}
|
|
230
|
+
}),
|
|
231
|
+
[]
|
|
232
|
+
);
|
|
233
|
+
const contentTransition = useMemo(
|
|
234
|
+
() => ({
|
|
235
|
+
height: {
|
|
236
|
+
duration: 0.26,
|
|
237
|
+
ease: [0.4, 0, 0.2, 1]
|
|
238
|
+
},
|
|
239
|
+
opacity: {
|
|
240
|
+
duration: 0.26,
|
|
241
|
+
ease: [0.4, 0, 0.2, 1]
|
|
242
|
+
}
|
|
243
|
+
}),
|
|
244
|
+
[]
|
|
245
|
+
);
|
|
246
|
+
if (!showContent || !expanded) {
|
|
223
247
|
return /* @__PURE__ */ React.createElement(
|
|
224
248
|
"div",
|
|
225
249
|
{
|
|
226
|
-
|
|
227
|
-
|
|
250
|
+
style: {
|
|
251
|
+
overflow: "hidden",
|
|
252
|
+
height: 1,
|
|
253
|
+
opacity: 0,
|
|
254
|
+
visibility: "hidden"
|
|
255
|
+
},
|
|
256
|
+
role: "presentation",
|
|
257
|
+
"aria-hidden": "true"
|
|
228
258
|
},
|
|
229
259
|
contentDom,
|
|
230
260
|
errorDom
|
|
231
261
|
);
|
|
232
|
-
}
|
|
233
|
-
return
|
|
262
|
+
}
|
|
263
|
+
return /* @__PURE__ */ React.createElement(AnimatePresence, { initial: false, mode: "sync" }, expanded ? /* @__PURE__ */ React.createElement(
|
|
264
|
+
motion.div,
|
|
265
|
+
{
|
|
266
|
+
key: "tool-content",
|
|
267
|
+
className: toolContainerClassName,
|
|
268
|
+
"data-testid": "tool-user-item-tool-container",
|
|
269
|
+
variants: contentVariants,
|
|
270
|
+
initial: "collapsed",
|
|
271
|
+
animate: "expanded",
|
|
272
|
+
exit: "collapsed",
|
|
273
|
+
transition: contentTransition,
|
|
274
|
+
style: { overflow: "hidden" }
|
|
275
|
+
},
|
|
276
|
+
contentDom,
|
|
277
|
+
errorDom
|
|
278
|
+
) : null);
|
|
234
279
|
};
|
|
235
280
|
var ToolContent = memo(ToolContentComponent);
|
|
236
281
|
export {
|
package/dist/ToolUseBar/style.js
CHANGED
|
@@ -40,12 +40,13 @@ var genStyle = (token) => {
|
|
|
40
40
|
border: "var(--color-gray-border-light)",
|
|
41
41
|
boxShadow: "var(--shadow-border-base)",
|
|
42
42
|
minHeight: "20px",
|
|
43
|
+
backdropFilter: "blur(8px)",
|
|
43
44
|
width: "max-content",
|
|
44
45
|
transition: "padding 0.2s ease",
|
|
45
46
|
display: "flex",
|
|
46
47
|
alignItems: "center",
|
|
47
48
|
flexDirection: "column",
|
|
48
|
-
gap:
|
|
49
|
+
gap: 0,
|
|
49
50
|
zIndex: 1,
|
|
50
51
|
maxWidth: "min(800px,100%)",
|
|
51
52
|
padding: "2px",
|
|
@@ -64,6 +65,7 @@ var genStyle = (token) => {
|
|
|
64
65
|
"&-expanded": {
|
|
65
66
|
borderRadius: "14px",
|
|
66
67
|
padding: 4,
|
|
68
|
+
gap: 8,
|
|
67
69
|
outline: "none",
|
|
68
70
|
"&:hover": {
|
|
69
71
|
background: "var(--color-gray-bg-card-light)",
|
|
@@ -22,6 +22,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
22
22
|
import {
|
|
23
23
|
useEditorStyleRegister
|
|
24
24
|
} from "../Hooks/useStyle";
|
|
25
|
+
var LIGHT_MODE_BACKGROUND = "rgba(255, 255, 255, 0.65)";
|
|
26
|
+
var LIGHT_MODE_BACKDROP_FILTER = "blur(12px)";
|
|
25
27
|
var genStyle = (token) => {
|
|
26
28
|
return {
|
|
27
29
|
[token.componentCls]: {
|
|
@@ -69,6 +71,9 @@ var genStyle = (token) => {
|
|
|
69
71
|
border: "none",
|
|
70
72
|
borderRadius: "14px",
|
|
71
73
|
padding: 4,
|
|
74
|
+
background: LIGHT_MODE_BACKGROUND,
|
|
75
|
+
backdropFilter: LIGHT_MODE_BACKDROP_FILTER,
|
|
76
|
+
WebkitBackdropFilter: LIGHT_MODE_BACKDROP_FILTER,
|
|
72
77
|
"&:hover": {
|
|
73
78
|
background: "none",
|
|
74
79
|
boxShadow: "none",
|
|
@@ -226,7 +231,10 @@ var genStyle = (token) => {
|
|
|
226
231
|
borderLeft: "1px solid var(--color-gray-border-light)",
|
|
227
232
|
paddingLeft: 12,
|
|
228
233
|
marginLeft: 16,
|
|
229
|
-
marginTop: -10
|
|
234
|
+
marginTop: -10,
|
|
235
|
+
background: LIGHT_MODE_BACKGROUND,
|
|
236
|
+
backdropFilter: LIGHT_MODE_BACKDROP_FILTER,
|
|
237
|
+
WebkitBackdropFilter: LIGHT_MODE_BACKDROP_FILTER
|
|
230
238
|
}
|
|
231
239
|
},
|
|
232
240
|
"&-container-loading": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
|
|
5
5
|
"repository": "git@github.com:ant-design/agentic-ui.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"dev": "dumi dev",
|
|
18
18
|
"docs:build": "dumi build",
|
|
19
19
|
"doctor": "father doctor",
|
|
20
|
+
"generate:version": "node scripts/bumpVersion.js",
|
|
20
21
|
"lint": "npm run lint:es && npm run lint:css",
|
|
21
22
|
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
22
23
|
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|