@glodon-aiot/agent-cli-ui 3.19.0-alpha.20 → 3.19.0-alpha.22
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 -59
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +67 -70
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +100 -103
- package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +76 -87
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +121 -124
- package/dist/es/Dialog/AgentChat/index.mjs +393 -382
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +150 -157
- package/dist/es/components/Recommend/RecommendItem.mjs +33 -36
- 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/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/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.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/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/es/utils/scopedMessage.mjs +29 -0
- package/dist/lib/index.js +53 -53
- package/dist/src/utils/scopedMessage.d.ts +7 -0
- package/package.json +3 -3
|
@@ -1,95 +1,88 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
/* empty css */import { Typography as
|
|
4
|
-
import { getFileExtension as C, formatFileSize as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as v, useState as u, useEffect as y } from "react";
|
|
3
|
+
/* empty css */import { Typography as E, message as d } from "antd";
|
|
4
|
+
import { getFileExtension as C, formatFileSize as U, isValidImageUrlWithAnyExtension as S } from "../../../../utils/index.mjs";
|
|
5
|
+
import f from "../../../../context.mjs";
|
|
6
|
+
import { withAgentCliMessage as x } from "../../../../utils/scopedMessage.mjs";
|
|
7
|
+
import { FILE_ICONS as j } from "../../../../constant.mjs";
|
|
8
|
+
const P = (F) => {
|
|
8
9
|
const {
|
|
9
|
-
currentSession:
|
|
10
|
-
fileId:
|
|
11
|
-
file:
|
|
12
|
-
docViewerUrl:
|
|
13
|
-
} =
|
|
14
|
-
service:
|
|
15
|
-
popupContainer:
|
|
16
|
-
} =
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
h(
|
|
21
|
-
const
|
|
22
|
-
|
|
10
|
+
currentSession: s,
|
|
11
|
+
fileId: p,
|
|
12
|
+
file: r,
|
|
13
|
+
docViewerUrl: w
|
|
14
|
+
} = F, {
|
|
15
|
+
service: c,
|
|
16
|
+
popupContainer: t
|
|
17
|
+
} = v(f), [n, h] = u(), [m, g] = u("");
|
|
18
|
+
y(() => {
|
|
19
|
+
var e;
|
|
20
|
+
if (r != null && r.id) {
|
|
21
|
+
h(r);
|
|
22
|
+
const o = C(r == null ? void 0 : r.name) || "";
|
|
23
|
+
g(o);
|
|
23
24
|
} else {
|
|
24
|
-
if (!
|
|
25
|
+
if (!p || !((e = s == null ? void 0 : s.data) != null && e.id))
|
|
25
26
|
return;
|
|
26
|
-
|
|
27
|
-
h(
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
c == null || c.getSessionKnowledgeFile(s.data.id, p).then((o) => {
|
|
28
|
+
h(o);
|
|
29
|
+
const I = C(o == null ? void 0 : o.name) || "";
|
|
30
|
+
g(I);
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
}, []);
|
|
33
|
-
const
|
|
34
|
-
if (!(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
prefixCls: "gbot-message"
|
|
38
|
-
}), m.error("链接不存在"), m.config({
|
|
39
|
-
getContainer: void 0,
|
|
40
|
-
prefixCls: "gbot-message"
|
|
34
|
+
const N = (e) => {
|
|
35
|
+
if (!(e != null && e.url)) {
|
|
36
|
+
x(t, () => {
|
|
37
|
+
d.error("链接不存在");
|
|
41
38
|
});
|
|
42
39
|
return;
|
|
43
40
|
}
|
|
44
|
-
if (!
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
prefixCls: "gbot-message"
|
|
48
|
-
}), m.error("链接格式不正确"), m.config({
|
|
49
|
-
getContainer: void 0,
|
|
50
|
-
prefixCls: "gbot-message"
|
|
41
|
+
if (!S(e.url)) {
|
|
42
|
+
x(t, () => {
|
|
43
|
+
d.error("链接格式不正确");
|
|
51
44
|
});
|
|
52
45
|
return;
|
|
53
46
|
}
|
|
54
|
-
window.open(`${
|
|
47
|
+
window.open(`${w}?url=${encodeURIComponent(e == null ? void 0 : e.url)}`);
|
|
55
48
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ l("div", {
|
|
57
50
|
className: "file-item",
|
|
58
|
-
onClick: () =>
|
|
59
|
-
children: [/* @__PURE__ */
|
|
51
|
+
onClick: () => N(n),
|
|
52
|
+
children: [/* @__PURE__ */ i("div", {
|
|
60
53
|
className: "item-left",
|
|
61
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ i("img", {
|
|
62
55
|
className: "file-icon",
|
|
63
|
-
src:
|
|
56
|
+
src: j[m]
|
|
64
57
|
})
|
|
65
|
-
}), /* @__PURE__ */
|
|
58
|
+
}), /* @__PURE__ */ l("div", {
|
|
66
59
|
className: "item-main",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ i("div", {
|
|
68
61
|
className: "file-name",
|
|
69
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ i(E.Paragraph, {
|
|
70
63
|
style: {
|
|
71
64
|
margin: 0,
|
|
72
65
|
width: "100%"
|
|
73
66
|
},
|
|
74
67
|
ellipsis: {
|
|
75
68
|
rows: 1,
|
|
76
|
-
tooltip:
|
|
69
|
+
tooltip: n == null ? void 0 : n.name
|
|
77
70
|
},
|
|
78
|
-
children:
|
|
71
|
+
children: n == null ? void 0 : n.name
|
|
79
72
|
})
|
|
80
|
-
}), /* @__PURE__ */
|
|
73
|
+
}), /* @__PURE__ */ l("div", {
|
|
81
74
|
className: "file-desc",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
83
|
-
children:
|
|
84
|
-
}), /* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ i("span", {
|
|
76
|
+
children: m == null ? void 0 : m.toUpperCase()
|
|
77
|
+
}), /* @__PURE__ */ i("span", {
|
|
85
78
|
children: ","
|
|
86
|
-
}), /* @__PURE__ */
|
|
87
|
-
children:
|
|
79
|
+
}), /* @__PURE__ */ i("span", {
|
|
80
|
+
children: U((n == null ? void 0 : n.size) || 0)
|
|
88
81
|
})]
|
|
89
82
|
})]
|
|
90
83
|
})]
|
|
91
84
|
});
|
|
92
85
|
};
|
|
93
86
|
export {
|
|
94
|
-
|
|
87
|
+
P as default
|
|
95
88
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Space as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as o, useContext as D, useEffect as w } from "react";
|
|
3
|
+
import { Space as z, Popover as F, Popconfirm as L, Input as $, message as q, notification as u, Button as Q } from "antd";
|
|
4
|
+
import m from "../../../../components/Iconfont/index.mjs";
|
|
5
5
|
import G from "copy-to-clipboard";
|
|
6
6
|
import J from "classnames";
|
|
7
7
|
/* empty css */import K from "../../../../context.mjs";
|
|
8
|
-
|
|
8
|
+
import { withAgentCliMessage as U } from "../../../../utils/scopedMessage.mjs";
|
|
9
|
+
const V = [{
|
|
9
10
|
id: 1,
|
|
10
11
|
name: "展示信息不正确"
|
|
11
12
|
}, {
|
|
@@ -17,65 +18,61 @@ const U = [{
|
|
|
17
18
|
}, {
|
|
18
19
|
id: 4,
|
|
19
20
|
name: "其他原因"
|
|
20
|
-
}],
|
|
21
|
-
var
|
|
21
|
+
}], ce = (P) => {
|
|
22
|
+
var b;
|
|
22
23
|
const {
|
|
23
|
-
appId:
|
|
24
|
+
appId: x,
|
|
24
25
|
history: n,
|
|
25
26
|
isLastHistory: H = !1,
|
|
26
|
-
sessionId:
|
|
27
|
+
sessionId: l,
|
|
27
28
|
currentSession: c,
|
|
28
|
-
onAgainClick:
|
|
29
|
-
} =
|
|
30
|
-
service:
|
|
31
|
-
popupContainer:
|
|
29
|
+
onAgainClick: g
|
|
30
|
+
} = P, [i, h] = o([]), [C, v] = o(), [y, I] = o(!1), [M, A] = o(!1), {
|
|
31
|
+
service: W,
|
|
32
|
+
popupContainer: d,
|
|
32
33
|
transform: N,
|
|
33
34
|
onComment: p
|
|
34
|
-
} =
|
|
35
|
+
} = D(K), [f, k] = o(() => {
|
|
35
36
|
var e;
|
|
36
37
|
return (e = n == null ? void 0 : n.comment) == null ? void 0 : e.isAgree;
|
|
37
|
-
}), [
|
|
38
|
+
}), [T, S] = o(400);
|
|
38
39
|
w(() => {
|
|
39
40
|
var e;
|
|
40
|
-
|
|
41
|
-
}, [(
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
prefixCls: "gbot-message"
|
|
46
|
-
}), G(n.content), k.success("复制成功"), k.config({
|
|
47
|
-
getContainer: void 0,
|
|
48
|
-
prefixCls: "gbot-message"
|
|
41
|
+
k((e = n == null ? void 0 : n.comment) == null ? void 0 : e.isAgree);
|
|
42
|
+
}, [(b = n == null ? void 0 : n.comment) == null ? void 0 : b.isAgree]);
|
|
43
|
+
const _ = () => {
|
|
44
|
+
U(d, () => {
|
|
45
|
+
G(n.content), q.success("复制成功");
|
|
49
46
|
});
|
|
50
|
-
},
|
|
51
|
-
if (!
|
|
47
|
+
}, E = (e) => {
|
|
48
|
+
if (!l || !(n != null && n.messageId))
|
|
52
49
|
return;
|
|
53
50
|
const a = {
|
|
54
51
|
messageId: n.messageId,
|
|
55
52
|
isAgree: e
|
|
56
53
|
};
|
|
57
54
|
c == null || c.postMessageComment(a).then(() => {
|
|
58
|
-
|
|
55
|
+
k(e), n != null && n.comment && (n.comment.isAgree = e), !(e <= 0) && (A(!0), setTimeout(() => {
|
|
59
56
|
A(!1);
|
|
60
57
|
}, 2e3));
|
|
61
58
|
}), p && p({
|
|
62
|
-
applicationId:
|
|
63
|
-
sessionId:
|
|
59
|
+
applicationId: x,
|
|
60
|
+
sessionId: l,
|
|
64
61
|
comment: a
|
|
65
62
|
});
|
|
66
|
-
},
|
|
63
|
+
}, R = (e) => {
|
|
67
64
|
if (i.some((a) => a.id === e.id)) {
|
|
68
65
|
const a = i.filter((s) => s.id !== e.id);
|
|
69
66
|
h([...a]);
|
|
70
67
|
} else
|
|
71
68
|
h([...i, e]);
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
if (!
|
|
69
|
+
}, B = (e) => {
|
|
70
|
+
v(e.target.value);
|
|
71
|
+
}, j = () => {
|
|
72
|
+
if (!l)
|
|
76
73
|
return;
|
|
77
74
|
if (!(i != null && i.length))
|
|
78
|
-
return
|
|
75
|
+
return I(!0), Promise.reject();
|
|
79
76
|
let e = [];
|
|
80
77
|
i != null && i.length && (e = [...e, ...i.map((s) => s.name)]), C && (e = [...e, C]);
|
|
81
78
|
const a = {
|
|
@@ -83,27 +80,27 @@ const U = [{
|
|
|
83
80
|
isAgree: -1,
|
|
84
81
|
againstReason: e
|
|
85
82
|
};
|
|
86
|
-
|
|
87
|
-
getContainer: () => (
|
|
83
|
+
u.config({
|
|
84
|
+
getContainer: () => (d == null ? void 0 : d.current) || document.body,
|
|
88
85
|
prefixCls: "gbot-notification"
|
|
89
86
|
}), c == null || c.postMessageComment(a).then(() => {
|
|
90
|
-
|
|
87
|
+
k(-1), n != null && n.comment && (n.comment.isAgree = -1);
|
|
91
88
|
const s = `open${Date.now()}`;
|
|
92
|
-
|
|
89
|
+
u.success({
|
|
93
90
|
message: "提交反馈成功",
|
|
94
91
|
description: "感谢您的参与,我们会认真评估每一条建议!",
|
|
95
92
|
duration: 2,
|
|
96
93
|
btn: /* @__PURE__ */ t(Q, {
|
|
97
94
|
type: "primary",
|
|
98
|
-
onClick: () =>
|
|
95
|
+
onClick: () => u.close(s),
|
|
99
96
|
children: "我知道了"
|
|
100
97
|
}),
|
|
101
98
|
key: s,
|
|
102
|
-
onClose: () =>
|
|
99
|
+
onClose: () => u.close(s)
|
|
103
100
|
});
|
|
104
101
|
}), p && p({
|
|
105
|
-
applicationId:
|
|
106
|
-
sessionId:
|
|
102
|
+
applicationId: x,
|
|
103
|
+
sessionId: l,
|
|
107
104
|
comment: a
|
|
108
105
|
});
|
|
109
106
|
};
|
|
@@ -112,18 +109,18 @@ const U = [{
|
|
|
112
109
|
return e = requestAnimationFrame(() => {
|
|
113
110
|
const s = document.getElementById("chat-main");
|
|
114
111
|
if (s) {
|
|
115
|
-
const
|
|
116
|
-
|
|
112
|
+
const O = s.offsetHeight;
|
|
113
|
+
S(O * 0.8);
|
|
117
114
|
}
|
|
118
115
|
}), () => {
|
|
119
116
|
e && cancelAnimationFrame(e);
|
|
120
117
|
};
|
|
121
|
-
}, [n]), /* @__PURE__ */
|
|
118
|
+
}, [n]), /* @__PURE__ */ r("div", {
|
|
122
119
|
className: "session-action",
|
|
123
|
-
children: [N != null && N.again && H ? /* @__PURE__ */
|
|
120
|
+
children: [N != null && N.again && H ? /* @__PURE__ */ r(z, {
|
|
124
121
|
className: "session-action-again",
|
|
125
|
-
onClick: () =>
|
|
126
|
-
children: [/* @__PURE__ */ t(
|
|
122
|
+
onClick: () => g == null ? void 0 : g(),
|
|
123
|
+
children: [/* @__PURE__ */ t(m, {
|
|
127
124
|
type: "icon-zaicihuida"
|
|
128
125
|
}), /* @__PURE__ */ t("span", {
|
|
129
126
|
style: {
|
|
@@ -133,22 +130,22 @@ const U = [{
|
|
|
133
130
|
})]
|
|
134
131
|
}) : /* @__PURE__ */ t("span", {}), /* @__PURE__ */ t("div", {
|
|
135
132
|
className: "session-action-comment",
|
|
136
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ r(z, {
|
|
137
134
|
size: 8,
|
|
138
135
|
className: "action-comment-feedback",
|
|
139
136
|
children: [!n.isSuspend && /* @__PURE__ */ t("span", {
|
|
140
137
|
className: "comment-feedback-item comment-feedback-copy",
|
|
141
|
-
onClick:
|
|
142
|
-
children: /* @__PURE__ */ t(
|
|
138
|
+
onClick: _,
|
|
139
|
+
children: /* @__PURE__ */ t(m, {
|
|
143
140
|
type: "icon-fuzhi"
|
|
144
141
|
})
|
|
145
142
|
}), f === 0 && !n.isSuspend && /* @__PURE__ */ t("span", {
|
|
146
143
|
className: "comment-feedback-item",
|
|
147
|
-
children: /* @__PURE__ */ t(
|
|
144
|
+
children: /* @__PURE__ */ t(m, {
|
|
148
145
|
type: "icon-zan",
|
|
149
|
-
onClick: () =>
|
|
146
|
+
onClick: () => E(1)
|
|
150
147
|
})
|
|
151
|
-
}), f === 1 && /* @__PURE__ */ t(
|
|
148
|
+
}), f === 1 && /* @__PURE__ */ t(F, {
|
|
152
149
|
open: M,
|
|
153
150
|
getPopupContainer: (e) => e.parentNode,
|
|
154
151
|
content: /* @__PURE__ */ t("div", {
|
|
@@ -158,23 +155,23 @@ const U = [{
|
|
|
158
155
|
trigger: "click",
|
|
159
156
|
children: /* @__PURE__ */ t("span", {
|
|
160
157
|
className: "comment-feedback-item comment-feedback-item__active",
|
|
161
|
-
children: /* @__PURE__ */ t(
|
|
158
|
+
children: /* @__PURE__ */ t(m, {
|
|
162
159
|
type: "icon-zan"
|
|
163
160
|
})
|
|
164
161
|
})
|
|
165
|
-
}), f === 0 && !n.isSuspend && /* @__PURE__ */ t(
|
|
162
|
+
}), f === 0 && !n.isSuspend && /* @__PURE__ */ t(L, {
|
|
166
163
|
showArrow: !1,
|
|
167
164
|
arrowPointAtCenter: !0,
|
|
168
165
|
okText: "确定",
|
|
169
166
|
cancelText: "取消",
|
|
170
167
|
getPopupContainer: (e) => e.parentNode,
|
|
171
168
|
onOpenChange: (e) => {
|
|
172
|
-
e && (h([]),
|
|
169
|
+
e && (h([]), v(""), I(!1));
|
|
173
170
|
},
|
|
174
171
|
icon: !1,
|
|
175
|
-
title: /* @__PURE__ */
|
|
172
|
+
title: /* @__PURE__ */ r("div", {
|
|
176
173
|
className: "cai-pannel",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ r("div", {
|
|
178
175
|
className: "cai-title",
|
|
179
176
|
children: [/* @__PURE__ */ t("span", {
|
|
180
177
|
className: "cai-require",
|
|
@@ -185,15 +182,15 @@ const U = [{
|
|
|
185
182
|
})]
|
|
186
183
|
}), /* @__PURE__ */ t("div", {
|
|
187
184
|
className: "cai-list",
|
|
188
|
-
children:
|
|
185
|
+
children: V.map((e) => /* @__PURE__ */ t("span", {
|
|
189
186
|
className: J({
|
|
190
187
|
"cai-item": !0,
|
|
191
188
|
"cai-item__active": i.some((a) => a.id === e.id)
|
|
192
189
|
}),
|
|
193
|
-
onClick: () =>
|
|
190
|
+
onClick: () => R(e),
|
|
194
191
|
children: e.name
|
|
195
192
|
}, e.id))
|
|
196
|
-
}),
|
|
193
|
+
}), y && /* @__PURE__ */ t("div", {
|
|
197
194
|
className: "cai-error",
|
|
198
195
|
children: /* @__PURE__ */ t("span", {
|
|
199
196
|
className: "cai-error-text",
|
|
@@ -205,8 +202,8 @@ const U = [{
|
|
|
205
202
|
className: "cai-question",
|
|
206
203
|
children: "您还有哪些建议?"
|
|
207
204
|
})
|
|
208
|
-
}), /* @__PURE__ */ t(
|
|
209
|
-
onChange:
|
|
205
|
+
}), /* @__PURE__ */ t($.TextArea, {
|
|
206
|
+
onChange: B,
|
|
210
207
|
value: C,
|
|
211
208
|
autoSize: {
|
|
212
209
|
minRows: 3,
|
|
@@ -219,7 +216,7 @@ const U = [{
|
|
|
219
216
|
maxLength: 300
|
|
220
217
|
})]
|
|
221
218
|
}),
|
|
222
|
-
onConfirm: () =>
|
|
219
|
+
onConfirm: () => j(),
|
|
223
220
|
cancelButtonProps: {
|
|
224
221
|
size: "middle"
|
|
225
222
|
},
|
|
@@ -227,18 +224,18 @@ const U = [{
|
|
|
227
224
|
size: "middle"
|
|
228
225
|
},
|
|
229
226
|
overlayStyle: {
|
|
230
|
-
maxHeight: `${
|
|
227
|
+
maxHeight: `${T}px`,
|
|
231
228
|
overflow: "auto"
|
|
232
229
|
},
|
|
233
230
|
children: /* @__PURE__ */ t("span", {
|
|
234
231
|
className: "comment-feedback-item",
|
|
235
|
-
children: /* @__PURE__ */ t(
|
|
232
|
+
children: /* @__PURE__ */ t(m, {
|
|
236
233
|
type: "icon-cai"
|
|
237
234
|
})
|
|
238
235
|
})
|
|
239
236
|
}), f === -1 && /* @__PURE__ */ t("span", {
|
|
240
237
|
className: "comment-feedback-item comment-feedback-item__active",
|
|
241
|
-
children: /* @__PURE__ */ t(
|
|
238
|
+
children: /* @__PURE__ */ t(m, {
|
|
242
239
|
type: "icon-cai"
|
|
243
240
|
})
|
|
244
241
|
})]
|
|
@@ -247,5 +244,5 @@ const U = [{
|
|
|
247
244
|
});
|
|
248
245
|
};
|
|
249
246
|
export {
|
|
250
|
-
|
|
247
|
+
ce as default
|
|
251
248
|
};
|