@glodon-aiot/agent-cli-ui 3.5.0-alpha.3 → 3.5.0-alpha.4
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/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -48
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +112 -94
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +26 -24
- package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +65 -59
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +179 -161
- package/dist/es/Dialog/AgentChat/index.mjs +520 -465
- package/dist/es/QuillEditor/index.mjs +72 -65
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +182 -170
- package/dist/es/components/Recommend/RecommendItem.mjs +20 -18
- package/dist/es/index.mjs +223 -214
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- 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/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/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/style3.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style33.css +1 -1
- 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/es/utils/antdConfig.mjs +15 -0
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +57 -57
- package/dist/src/utils/antdConfig.d.ts +7 -0
- package/dist/src/utils/testAntdPrefix.d.ts +3 -0
- package/package.json +3 -3
|
@@ -1,120 +1,126 @@
|
|
|
1
|
-
var
|
|
1
|
+
var b = (C, a, n) => new Promise((x, e) => {
|
|
2
2
|
var r = (i) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
4
|
+
m(n.next(i));
|
|
5
5
|
} catch (f) {
|
|
6
6
|
e(f);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, h = (i) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
10
|
+
m(n.throw(i));
|
|
11
11
|
} catch (f) {
|
|
12
12
|
e(f);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, m = (i) => i.done ? x(i.value) : Promise.resolve(i.value).then(r, h);
|
|
15
|
+
m((n = n.apply(C, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { useContext as D, useState as
|
|
17
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
18
|
+
import { useContext as D, useState as I, useRef as N, useEffect as E } from "react";
|
|
19
19
|
import { Drawer as O, Spin as R, message as d } from "antd";
|
|
20
20
|
/* empty css */import { LoadingOutlined as j } from "@ant-design/icons";
|
|
21
21
|
import B from "./SessionItem.mjs";
|
|
22
22
|
import H from "../../../../../context.mjs";
|
|
23
|
-
const K = (
|
|
23
|
+
const K = (C) => {
|
|
24
24
|
const {
|
|
25
25
|
currentSessionId: a,
|
|
26
|
-
onSessionChange:
|
|
27
|
-
onClose:
|
|
28
|
-
} =
|
|
26
|
+
onSessionChange: n,
|
|
27
|
+
onClose: x
|
|
28
|
+
} = C, {
|
|
29
29
|
agentClient: e,
|
|
30
30
|
popupContainer: r
|
|
31
|
-
} = D(H), [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
} = D(H), [h, m] = I(!1), [i, f] = I(!1), [L, v] = I(""), [g, l] = I([]), o = N(g);
|
|
32
|
+
E(() => {
|
|
33
|
+
o.current = [], l(o.current), m(!0), e == null || e.getSessions().then((t) => b(void 0, null, function* () {
|
|
34
|
+
m(!1), o.current = [...t], l(o.current);
|
|
35
35
|
}));
|
|
36
|
-
}, []),
|
|
36
|
+
}, []), E(() => {
|
|
37
37
|
g.length && a && setTimeout(() => {
|
|
38
38
|
var t;
|
|
39
39
|
(t = document.getElementById(a)) == null || t.scrollIntoView(!0);
|
|
40
40
|
}, 100);
|
|
41
41
|
}, [g]);
|
|
42
|
-
const
|
|
43
|
-
e == null || e.removeSession(t, !0).then(() =>
|
|
44
|
-
const c = g.filter((
|
|
42
|
+
const w = (t, s) => {
|
|
43
|
+
e == null || e.removeSession(t, !0).then(() => b(void 0, null, function* () {
|
|
44
|
+
const c = g.filter((u) => {
|
|
45
45
|
var S, y;
|
|
46
|
-
return ((S =
|
|
46
|
+
return ((S = u.data) == null ? void 0 : S.id) !== ((y = t.data) == null ? void 0 : y.id);
|
|
47
47
|
});
|
|
48
|
-
t.data.id === a &&
|
|
49
|
-
getContainer: () => (r == null ? void 0 : r.current) || document.body
|
|
48
|
+
t.data.id === a && n && n(""), d.config({
|
|
49
|
+
getContainer: () => (r == null ? void 0 : r.current) || document.body,
|
|
50
|
+
prefixCls: "gbot-message"
|
|
50
51
|
}), d.success("删除成功"), d.config({
|
|
51
|
-
getContainer: void 0
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
getContainer: void 0,
|
|
53
|
+
prefixCls: "gbot-message"
|
|
54
|
+
}), o.current = [...c], l(o.current);
|
|
55
|
+
})), s == null || s.stopPropagation();
|
|
56
|
+
}, T = (t) => {
|
|
57
|
+
t && (n && n(t.sessionId, t), x());
|
|
58
|
+
}, _ = (t, s) => b(void 0, null, function* () {
|
|
57
59
|
try {
|
|
58
|
-
yield e == null ? void 0 : e.setTop(t.data.id,
|
|
59
|
-
getContainer: () => (r == null ? void 0 : r.current) || document.body
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
yield e == null ? void 0 : e.setTop(t.data.id, s), d.config({
|
|
61
|
+
getContainer: () => (r == null ? void 0 : r.current) || document.body,
|
|
62
|
+
prefixCls: "gbot-message"
|
|
63
|
+
}), d.success(`${s ? "" : "取消"}置顶成功`), d.config({
|
|
64
|
+
getContainer: void 0,
|
|
65
|
+
prefixCls: "gbot-message"
|
|
62
66
|
});
|
|
63
67
|
} catch (c) {
|
|
64
68
|
d.config({
|
|
65
|
-
getContainer: () => (r == null ? void 0 : r.current) || document.body
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
getContainer: () => (r == null ? void 0 : r.current) || document.body,
|
|
70
|
+
prefixCls: "gbot-message"
|
|
71
|
+
}), d.error(`${s ? "" : "取消"}置顶失败`), d.config({
|
|
72
|
+
getContainer: void 0,
|
|
73
|
+
prefixCls: "gbot-message"
|
|
68
74
|
});
|
|
69
75
|
}
|
|
70
76
|
e == null || e.getSessions({
|
|
71
77
|
order: "top_time desc, sort_status desc, updated_at desc"
|
|
72
|
-
}).then((c) =>
|
|
73
|
-
|
|
78
|
+
}).then((c) => b(void 0, null, function* () {
|
|
79
|
+
o.current = [...c], l(o.current);
|
|
74
80
|
}));
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
const c =
|
|
81
|
+
}), $ = (t, s) => {
|
|
82
|
+
s && (t.rename(s), t == null || t.addEventListener("data:updated", () => {
|
|
83
|
+
const c = o.current.map((u) => {
|
|
78
84
|
var S, y;
|
|
79
|
-
return ((S =
|
|
85
|
+
return ((S = u.data) == null ? void 0 : S.id) === ((y = u.data) == null ? void 0 : y.id), u;
|
|
80
86
|
});
|
|
81
|
-
|
|
87
|
+
o.current = [...c], l(o.current);
|
|
82
88
|
}));
|
|
83
|
-
},
|
|
84
|
-
f(
|
|
89
|
+
}, z = (t, s) => {
|
|
90
|
+
f(s), v(t);
|
|
85
91
|
};
|
|
86
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ p(O, {
|
|
87
93
|
title: "会话历史记录",
|
|
88
94
|
open: !0,
|
|
89
95
|
placement: "bottom",
|
|
90
|
-
onClose:
|
|
91
|
-
className: `session-list-drawer ${
|
|
96
|
+
onClose: x,
|
|
97
|
+
className: `session-list-drawer ${h ? "loading-panel" : ""}`,
|
|
92
98
|
size: "large",
|
|
93
99
|
getContainer: () => (r == null ? void 0 : r.current) || document.body,
|
|
94
100
|
destroyOnClose: !0,
|
|
95
101
|
style: {
|
|
96
102
|
position: "absolute"
|
|
97
103
|
},
|
|
98
|
-
children:
|
|
99
|
-
indicator: /* @__PURE__ */
|
|
104
|
+
children: h ? /* @__PURE__ */ p(R, {
|
|
105
|
+
indicator: /* @__PURE__ */ p(j, {
|
|
100
106
|
style: {
|
|
101
107
|
fontSize: 24
|
|
102
108
|
},
|
|
103
109
|
spin: !0
|
|
104
110
|
})
|
|
105
|
-
}) : g.map((t,
|
|
111
|
+
}) : g.map((t, s) => {
|
|
106
112
|
var c;
|
|
107
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ p(B, {
|
|
108
114
|
session: t,
|
|
109
|
-
index:
|
|
115
|
+
index: s,
|
|
110
116
|
currentSessionId: a,
|
|
111
|
-
onChangeSession:
|
|
112
|
-
onDelSession:
|
|
113
|
-
onTopSession:
|
|
114
|
-
onEditNameConfirm:
|
|
115
|
-
editSessionId:
|
|
117
|
+
onChangeSession: T,
|
|
118
|
+
onDelSession: w,
|
|
119
|
+
onTopSession: _,
|
|
120
|
+
onEditNameConfirm: $,
|
|
121
|
+
editSessionId: L,
|
|
116
122
|
isEdit: i,
|
|
117
|
-
onChangeEditStatus:
|
|
123
|
+
onChangeEditStatus: z
|
|
118
124
|
}, (c = t.data) == null ? void 0 : c.id);
|
|
119
125
|
})
|
|
120
126
|
});
|