@glodon-aiot/agent-cli-ui 3.3.3 → 3.3.4-beta.2
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/es/AgentClientUI.mjs +121 -109
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +156 -142
- package/dist/es/Dialog/AgentChat/PromptSetting/index.mjs +83 -98
- package/dist/es/Dialog/AgentChat/index.mjs +331 -314
- package/dist/es/Dialog/SessionList/index.mjs +35 -34
- package/dist/es/Dialog/index.mjs +101 -94
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +394 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/fetch.mjs +112 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/parse.mjs +97 -0
- package/dist/es/ReactTextGenerationUI/index.mjs +81 -0
- package/dist/es/components/FilePreview/index.mjs +26 -25
- package/dist/es/index.mjs +402 -217
- package/dist/es/node_modules/moment/dist/moment.mjs +2301 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +162 -0
- package/dist/es/packages/react-components/dist/es/components/Markdown/ATag/index.mjs +27 -25
- package/dist/es/packages/react-components/dist/es/components/Markdown/Image/index.mjs +29 -27
- package/dist/es/packages/react-components/dist/es/components/Markdown/index.mjs +58 -48
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style.css +1 -1
- package/dist/es/src/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style2.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -0
- package/dist/es/src/style31.css +1 -0
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +69 -58
- package/dist/src/AgentClientUI.d.ts +10 -2
- package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +1 -0
- package/dist/src/Dialog/index.d.ts +9 -1
- package/dist/src/index.d.ts +11 -2
- package/dist/src/types.d.ts +8 -3
- package/package.json +3 -3
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as x, jsx as o, Fragment as U } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s, useEffect as n } from "react";
|
|
3
|
-
import { Image as k, Spin as E, Tooltip as
|
|
4
|
-
import { LoadingOutlined as
|
|
3
|
+
import { Image as k, Spin as E, Tooltip as P, Button as j } from "antd";
|
|
4
|
+
import { LoadingOutlined as z } from "@ant-design/icons";
|
|
5
5
|
import { AecKnowledgeFileStatus as F } from "@glodon-aiot/apis";
|
|
6
|
-
import
|
|
7
|
-
import { getBase64 as
|
|
6
|
+
import B from "../Iconfont/index.mjs";
|
|
7
|
+
import { getBase64 as I } from "../../utils/index.mjs";
|
|
8
8
|
/* empty css */const D = (i) => {
|
|
9
9
|
const {
|
|
10
|
-
className:
|
|
11
|
-
style:
|
|
10
|
+
className: N,
|
|
11
|
+
style: y,
|
|
12
12
|
id: r,
|
|
13
13
|
file: e,
|
|
14
14
|
actions: {
|
|
15
15
|
upload: l,
|
|
16
|
-
remove:
|
|
16
|
+
remove: g,
|
|
17
17
|
checkStatus: c
|
|
18
18
|
} = {},
|
|
19
|
-
onUrlChange:
|
|
19
|
+
onUrlChange: h,
|
|
20
20
|
onStatusChange: v
|
|
21
21
|
} = i, [f, u] = s(i.uploading), [w, S] = s(!1);
|
|
22
22
|
n(() => {
|
|
@@ -27,51 +27,52 @@ import { getBase64 as P } from "../../utils/index.mjs";
|
|
|
27
27
|
d(i.url);
|
|
28
28
|
}, [i.url]), n(() => {
|
|
29
29
|
l && e instanceof File && (m || f || (u(!0), l(e).then((t) => {
|
|
30
|
-
d(t),
|
|
30
|
+
d(t), h && h(t);
|
|
31
31
|
}).catch((t) => S(t)).finally(() => u(!1))));
|
|
32
32
|
}, [l, m, e]);
|
|
33
|
-
const [a,
|
|
33
|
+
const [a, p] = s(e instanceof File || e == null ? void 0 : e.status);
|
|
34
34
|
n(() => {
|
|
35
|
-
|
|
35
|
+
p(e instanceof File || e == null ? void 0 : e.status);
|
|
36
36
|
}, [e]);
|
|
37
|
-
const
|
|
37
|
+
const C = () => {
|
|
38
38
|
r && c && a === F.Processing && c(r).then((t) => {
|
|
39
|
-
t !== a && (a !== void 0 && v && v(t),
|
|
40
|
-
}).catch((t) =>
|
|
39
|
+
t !== a && (a !== void 0 && v && v(t), p(t));
|
|
40
|
+
}).catch((t) => p(F.Failed));
|
|
41
41
|
};
|
|
42
42
|
return n(() => {
|
|
43
|
-
|
|
43
|
+
C();
|
|
44
44
|
}, [r, c, a]), n(() => {
|
|
45
|
-
|
|
45
|
+
I(e).then((t) => {
|
|
46
46
|
d(t);
|
|
47
47
|
});
|
|
48
|
-
}, [e]), e ? /* @__PURE__ */
|
|
49
|
-
className: `file-preview ${
|
|
50
|
-
style:
|
|
48
|
+
}, [e]), e ? /* @__PURE__ */ x("div", {
|
|
49
|
+
className: `file-preview ${N}`,
|
|
50
|
+
style: y,
|
|
51
51
|
children: [/* @__PURE__ */ o(k, {
|
|
52
52
|
src: m,
|
|
53
53
|
className: "file-icon"
|
|
54
54
|
}), f && /* @__PURE__ */ o(E, {
|
|
55
55
|
className: "file-action file-process",
|
|
56
|
-
indicator: /* @__PURE__ */ o(
|
|
56
|
+
indicator: /* @__PURE__ */ o(z, {
|
|
57
57
|
style: {
|
|
58
58
|
fontSize: 16
|
|
59
59
|
},
|
|
60
60
|
spin: !0
|
|
61
61
|
})
|
|
62
|
-
}), !f &&
|
|
62
|
+
}), !f && g && /* @__PURE__ */ o(P, {
|
|
63
63
|
overlayClassName: "file-remove-tooltip",
|
|
64
64
|
title: "删除文件",
|
|
65
|
-
|
|
65
|
+
getPopupContainer: (t) => t.parentNode,
|
|
66
|
+
children: /* @__PURE__ */ o(j, {
|
|
66
67
|
className: "file-action file-remove",
|
|
67
|
-
icon: /* @__PURE__ */ o(
|
|
68
|
+
icon: /* @__PURE__ */ o(B, {
|
|
68
69
|
style: {
|
|
69
70
|
fontSize: "10px"
|
|
70
71
|
},
|
|
71
72
|
type: "icon-shanchu"
|
|
72
73
|
}),
|
|
73
74
|
onClick: () => {
|
|
74
|
-
|
|
75
|
+
g(e, r);
|
|
75
76
|
}
|
|
76
77
|
})
|
|
77
78
|
})]
|