@ant-design/agentic-ui 2.1.0 → 2.3.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/History/components/HistoryEmpty.d.ts +17 -0
- package/dist/History/components/HistoryEmpty.js +50 -0
- package/dist/History/components/HistoryEmptyIcon.d.ts +5 -0
- package/dist/History/components/HistoryEmptyIcon.js +1214 -0
- package/dist/History/components/HistoryList.d.ts +1 -0
- package/dist/History/components/HistoryList.js +6 -0
- package/dist/History/components/SearchComponent.js +10 -4
- package/dist/History/components/index.d.ts +1 -0
- package/dist/History/components/index.js +2 -0
- package/dist/History/index.js +39 -27
- package/dist/History/style.js +12 -0
- package/dist/History/types/index.d.ts +2 -2
- package/dist/Hooks/useIntersectionOnce.d.ts +5 -0
- package/dist/Hooks/useIntersectionOnce.js +79 -0
- package/dist/Hooks/useLanguage.d.ts +2 -0
- package/dist/I18n/locales.d.ts +2 -0
- package/dist/I18n/locales.js +4 -0
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +31 -3
- package/dist/MarkdownEditor/editor/parser/remarkParse.js +2 -2
- package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +4 -4
- package/dist/MarkdownInputField/MarkdownInputField.js +24 -20
- 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 +183 -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/katex/InlineKatex.js +3 -2
- package/dist/Plugins/mermaid/Mermaid.d.ts +5 -2
- package/dist/Plugins/mermaid/Mermaid.js +130 -38
- package/dist/Plugins/mermaid/index.js +1 -1
- package/dist/TaskList/index.js +2 -8
- package/dist/TaskList/style.js +1 -7
- package/package.json +3 -3
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "../components";
|
|
53
53
|
import { defaultColorList } from "../const";
|
|
54
54
|
import { useStyle } from "./style";
|
|
55
|
-
|
|
55
|
+
var scatterChartComponentsRegistered = false;
|
|
56
56
|
var ScatterChart = (_a) => {
|
|
57
57
|
var _b = _a, {
|
|
58
58
|
data,
|
|
@@ -97,6 +97,17 @@ var ScatterChart = (_a) => {
|
|
|
97
97
|
"statistic",
|
|
98
98
|
"textMaxWidth"
|
|
99
99
|
]);
|
|
100
|
+
useMemo(() => {
|
|
101
|
+
if (scatterChartComponentsRegistered) {
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
if (typeof window === "undefined") {
|
|
105
|
+
return void 0;
|
|
106
|
+
}
|
|
107
|
+
ChartJS.register(LinearScale, PointElement, LineElement, Tooltip, Legend);
|
|
108
|
+
scatterChartComponentsRegistered = true;
|
|
109
|
+
return void 0;
|
|
110
|
+
}, []);
|
|
100
111
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
101
112
|
const prefixCls = getPrefixCls("scatter-chart");
|
|
102
113
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type AreaChartComponent = typeof import('./AreaChart').default;
|
|
2
|
+
type BarChartComponent = typeof import('./BarChart').default;
|
|
3
|
+
type DonutChartComponent = typeof import('./DonutChart').default;
|
|
4
|
+
type FunnelChartComponent = typeof import('./FunnelChart').default;
|
|
5
|
+
type LineChartComponent = typeof import('./LineChart').default;
|
|
6
|
+
type RadarChartComponent = typeof import('./RadarChart').default;
|
|
7
|
+
type ScatterChartComponent = typeof import('./ScatterChart').default;
|
|
8
|
+
export interface ChartRuntime {
|
|
9
|
+
AreaChart: AreaChartComponent;
|
|
10
|
+
BarChart: BarChartComponent;
|
|
11
|
+
DonutChart: DonutChartComponent;
|
|
12
|
+
FunnelChart: FunnelChartComponent;
|
|
13
|
+
LineChart: LineChartComponent;
|
|
14
|
+
RadarChart: RadarChartComponent;
|
|
15
|
+
ScatterChart: ScatterChartComponent;
|
|
16
|
+
}
|
|
17
|
+
export declare const loadChartRuntime: () => Promise<ChartRuntime>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
));
|
|
30
|
+
var __async = (__this, __arguments, generator) => {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
var fulfilled = (value) => {
|
|
33
|
+
try {
|
|
34
|
+
step(generator.next(value));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
reject(e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var rejected = (value) => {
|
|
40
|
+
try {
|
|
41
|
+
step(generator.throw(value));
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
47
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// src/Plugins/chart/loadChartRuntime.ts
|
|
52
|
+
var runtimeLoader = null;
|
|
53
|
+
var loadChartRuntime = () => __async(void 0, null, function* () {
|
|
54
|
+
if (typeof window === "undefined") {
|
|
55
|
+
throw new Error("图表运行时仅在浏览器环境中可用");
|
|
56
|
+
}
|
|
57
|
+
if (!runtimeLoader) {
|
|
58
|
+
runtimeLoader = Promise.all([
|
|
59
|
+
Promise.resolve().then(() => __toESM(__require("./AreaChart"))),
|
|
60
|
+
Promise.resolve().then(() => __toESM(__require("./BarChart"))),
|
|
61
|
+
Promise.resolve().then(() => __toESM(__require("./DonutChart"))),
|
|
62
|
+
Promise.resolve().then(() => __toESM(__require("./FunnelChart"))),
|
|
63
|
+
Promise.resolve().then(() => __toESM(__require("./LineChart"))),
|
|
64
|
+
Promise.resolve().then(() => __toESM(__require("./RadarChart"))),
|
|
65
|
+
Promise.resolve().then(() => __toESM(__require("./ScatterChart")))
|
|
66
|
+
]).then(([
|
|
67
|
+
areaModule,
|
|
68
|
+
barModule,
|
|
69
|
+
donutModule,
|
|
70
|
+
funnelModule,
|
|
71
|
+
lineModule,
|
|
72
|
+
radarModule,
|
|
73
|
+
scatterModule
|
|
74
|
+
]) => ({
|
|
75
|
+
AreaChart: areaModule.default,
|
|
76
|
+
BarChart: barModule.default,
|
|
77
|
+
DonutChart: donutModule.default,
|
|
78
|
+
FunnelChart: funnelModule.default,
|
|
79
|
+
LineChart: lineModule.default,
|
|
80
|
+
RadarChart: radarModule.default,
|
|
81
|
+
ScatterChart: scatterModule.default
|
|
82
|
+
})).catch((error) => {
|
|
83
|
+
runtimeLoader = null;
|
|
84
|
+
throw error;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return runtimeLoader;
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
loadChartRuntime
|
|
91
|
+
};
|
|
@@ -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
|
}
|
|
@@ -38,7 +38,7 @@ var InlineKatex = ({
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
if (!selected) {
|
|
40
40
|
const value = Node.string(element);
|
|
41
|
-
katex.render(value
|
|
41
|
+
katex.render(`${value}`, renderEl.current, {
|
|
42
42
|
strict: false,
|
|
43
43
|
output: "html",
|
|
44
44
|
throwOnError: false,
|
|
@@ -55,6 +55,7 @@ var InlineKatex = ({
|
|
|
55
55
|
return /* @__PURE__ */ React.createElement(
|
|
56
56
|
"span",
|
|
57
57
|
__spreadProps(__spreadValues({}, attributes), {
|
|
58
|
+
className: "katex",
|
|
58
59
|
"data-be": "inline-katex",
|
|
59
60
|
style: {
|
|
60
61
|
position: "relative"
|
|
@@ -97,6 +98,7 @@ var InlineKatex = ({
|
|
|
97
98
|
/* @__PURE__ */ React.createElement(
|
|
98
99
|
"span",
|
|
99
100
|
{
|
|
101
|
+
className: "katex",
|
|
100
102
|
contentEditable: false,
|
|
101
103
|
ref: renderEl,
|
|
102
104
|
onClick: () => {
|
|
@@ -108,7 +110,6 @@ var InlineKatex = ({
|
|
|
108
110
|
style: {
|
|
109
111
|
margin: "0 0.25rem",
|
|
110
112
|
userSelect: "none",
|
|
111
|
-
fontSize: 0,
|
|
112
113
|
visibility: selected ? "hidden" : "visible",
|
|
113
114
|
width: selected ? "0" : "auto",
|
|
114
115
|
height: selected ? "0" : "auto",
|
|
@@ -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,123 @@ 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
|
+
const nextCode = props.element.value || "";
|
|
95
|
+
const currentState = state();
|
|
96
|
+
if (!isVisible) {
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
if (currentState.code === nextCode && currentState.error === "") {
|
|
100
|
+
return void 0;
|
|
101
|
+
}
|
|
102
|
+
if (timer.current !== null) {
|
|
103
|
+
window.clearTimeout(timer.current);
|
|
104
|
+
timer.current = null;
|
|
105
|
+
}
|
|
106
|
+
if (!nextCode) {
|
|
107
|
+
timer.current = window.setTimeout(() => {
|
|
108
|
+
setState({ code: "", error: "" });
|
|
109
|
+
if (divRef.current) {
|
|
110
|
+
divRef.current.innerHTML = "";
|
|
111
|
+
}
|
|
112
|
+
timer.current = null;
|
|
113
|
+
}, 0);
|
|
114
|
+
return () => {
|
|
115
|
+
if (timer.current !== null) {
|
|
116
|
+
window.clearTimeout(timer.current);
|
|
117
|
+
timer.current = null;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
65
120
|
}
|
|
66
|
-
|
|
67
|
-
|
|
121
|
+
const delay = currentState.code ? 300 : 0;
|
|
122
|
+
timer.current = window.setTimeout(() => __async(void 0, null, function* () {
|
|
123
|
+
var _a2, _b;
|
|
124
|
+
try {
|
|
125
|
+
const api = (_a2 = mermaidRef.current) != null ? _a2 : yield loadMermaid();
|
|
126
|
+
mermaidRef.current = api;
|
|
127
|
+
const { svg } = yield api.render(id, nextCode);
|
|
128
|
+
if (divRef.current) {
|
|
129
|
+
divRef.current.innerHTML = svg;
|
|
130
|
+
}
|
|
131
|
+
setState({ code: nextCode, error: "" });
|
|
132
|
+
} catch (error) {
|
|
133
|
+
const api = mermaidRef.current;
|
|
134
|
+
if (api) {
|
|
135
|
+
try {
|
|
136
|
+
yield api.parse(nextCode);
|
|
137
|
+
} catch (parseError) {
|
|
138
|
+
setState({ error: String(parseError), code: "" });
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
setState({ error: String(error), code: "" });
|
|
143
|
+
} finally {
|
|
144
|
+
(_b = document.querySelector("#d" + id)) == null ? void 0 : _b.classList.add("hidden");
|
|
145
|
+
}
|
|
146
|
+
timer.current = null;
|
|
147
|
+
}), delay);
|
|
148
|
+
return () => {
|
|
149
|
+
if (timer.current !== null) {
|
|
150
|
+
window.clearTimeout(timer.current);
|
|
151
|
+
timer.current = null;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}, [isBrowser, (_a = props == null ? void 0 : props.element) == null ? void 0 : _a.value, id, isVisible, setState, state]);
|
|
155
|
+
if (!isBrowser) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
const snapshot = state();
|
|
68
159
|
return /* @__PURE__ */ React.createElement(
|
|
69
160
|
"div",
|
|
70
161
|
{
|
|
162
|
+
ref: containerRef,
|
|
71
163
|
style: {
|
|
72
164
|
marginBottom: "0.75em",
|
|
73
165
|
cursor: "default",
|
|
74
166
|
userSelect: "none",
|
|
75
167
|
padding: "0.75rem 0",
|
|
76
|
-
|
|
77
|
-
borderRadius: "0.25em",
|
|
168
|
+
borderRadius: "1em",
|
|
78
169
|
display: "flex",
|
|
79
170
|
justifyContent: "center"
|
|
80
171
|
},
|
|
@@ -89,14 +180,15 @@ var Mermaid = (props) => {
|
|
|
89
180
|
width: "100%",
|
|
90
181
|
display: "flex",
|
|
91
182
|
justifyContent: "center",
|
|
92
|
-
visibility:
|
|
183
|
+
visibility: snapshot.code && !snapshot.error ? "visible" : "hidden"
|
|
93
184
|
}
|
|
94
185
|
}
|
|
95
186
|
),
|
|
96
|
-
|
|
97
|
-
!
|
|
187
|
+
snapshot.error && /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", color: "rgba(239, 68, 68, 0.8)" } }, snapshot.error),
|
|
188
|
+
!snapshot.code && !snapshot.error && /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center", color: "#6B7280" } }, "Empty")
|
|
98
189
|
);
|
|
99
190
|
};
|
|
100
191
|
export {
|
|
101
|
-
Mermaid
|
|
192
|
+
Mermaid,
|
|
193
|
+
loadMermaid
|
|
102
194
|
};
|
|
@@ -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": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/agentic-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.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}\"",
|
|
@@ -27,8 +28,7 @@
|
|
|
27
28
|
"start": "npm run dev",
|
|
28
29
|
"test": "vitest --run",
|
|
29
30
|
"test:coverage": "vitest --run --coverage",
|
|
30
|
-
"tsc": "tsc --noEmit"
|
|
31
|
-
"version": "node scripts/bumpVersion.js"
|
|
31
|
+
"tsc": "tsc --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"lint-staged": {
|
|
34
34
|
"*.{js,jsx,ts,tsx}": [
|