@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,86 +1,90 @@
|
|
|
1
|
-
import { jsxs as g, jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
/* empty css */import { Typography as
|
|
4
|
-
import { getFileExtension as
|
|
5
|
-
import
|
|
6
|
-
import { FILE_ICONS as
|
|
7
|
-
const K = (
|
|
1
|
+
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as b, useState as x, useEffect as v } from "react";
|
|
3
|
+
/* empty css */import { Typography as w, message as m } from "antd";
|
|
4
|
+
import { getFileExtension as C, formatFileSize as y, isValidImageUrlWithAnyExtension as I } from "../../../../utils/index.mjs";
|
|
5
|
+
import E from "../../../../context.mjs";
|
|
6
|
+
import { FILE_ICONS as U } from "../../../../constant.mjs";
|
|
7
|
+
const K = (u) => {
|
|
8
8
|
const {
|
|
9
|
-
currentSession:
|
|
9
|
+
currentSession: c,
|
|
10
10
|
fileId: d,
|
|
11
|
-
file:
|
|
12
|
-
docViewerUrl:
|
|
13
|
-
} =
|
|
11
|
+
file: s,
|
|
12
|
+
docViewerUrl: f
|
|
13
|
+
} = u, {
|
|
14
14
|
service: l,
|
|
15
|
-
popupContainer:
|
|
16
|
-
} =
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
h(
|
|
21
|
-
const
|
|
22
|
-
|
|
15
|
+
popupContainer: r
|
|
16
|
+
} = b(E), [e, h] = x(), [t, p] = x("");
|
|
17
|
+
v(() => {
|
|
18
|
+
var n;
|
|
19
|
+
if (s != null && s.id) {
|
|
20
|
+
h(s);
|
|
21
|
+
const i = C(s == null ? void 0 : s.name) || "";
|
|
22
|
+
p(i);
|
|
23
23
|
} else {
|
|
24
|
-
if (!d || !((
|
|
24
|
+
if (!d || !((n = c == null ? void 0 : c.data) != null && n.id))
|
|
25
25
|
return;
|
|
26
|
-
l == null || l.getSessionKnowledgeFile(
|
|
27
|
-
h(
|
|
28
|
-
const
|
|
29
|
-
|
|
26
|
+
l == null || l.getSessionKnowledgeFile(c.data.id, d).then((i) => {
|
|
27
|
+
h(i);
|
|
28
|
+
const N = C(i == null ? void 0 : i.name) || "";
|
|
29
|
+
p(N);
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}, []);
|
|
33
|
-
const
|
|
34
|
-
if (!(
|
|
35
|
-
|
|
36
|
-
getContainer: () => (
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const F = (n) => {
|
|
34
|
+
if (!(n != null && n.url)) {
|
|
35
|
+
m.config({
|
|
36
|
+
getContainer: () => (r == null ? void 0 : r.current) || document.body,
|
|
37
|
+
prefixCls: "gbot-message"
|
|
38
|
+
}), m.error("链接不存在"), m.config({
|
|
39
|
+
getContainer: void 0,
|
|
40
|
+
prefixCls: "gbot-message"
|
|
39
41
|
});
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
42
|
-
if (!
|
|
43
|
-
|
|
44
|
-
getContainer: () => (
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (!I(n.url)) {
|
|
45
|
+
m.config({
|
|
46
|
+
getContainer: () => (r == null ? void 0 : r.current) || document.body,
|
|
47
|
+
prefixCls: "gbot-message"
|
|
48
|
+
}), m.error("链接格式不正确"), m.config({
|
|
49
|
+
getContainer: void 0,
|
|
50
|
+
prefixCls: "gbot-message"
|
|
47
51
|
});
|
|
48
52
|
return;
|
|
49
53
|
}
|
|
50
|
-
window.open(`${
|
|
54
|
+
window.open(`${f}#/doc?url=${encodeURIComponent(n == null ? void 0 : n.url)}`);
|
|
51
55
|
};
|
|
52
56
|
return /* @__PURE__ */ g("div", {
|
|
53
57
|
className: "file-item",
|
|
54
|
-
onClick: () =>
|
|
55
|
-
children: [/* @__PURE__ */
|
|
58
|
+
onClick: () => F(e),
|
|
59
|
+
children: [/* @__PURE__ */ o("div", {
|
|
56
60
|
className: "item-left",
|
|
57
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ o("img", {
|
|
58
62
|
className: "file-icon",
|
|
59
|
-
src:
|
|
63
|
+
src: U[t]
|
|
60
64
|
})
|
|
61
65
|
}), /* @__PURE__ */ g("div", {
|
|
62
66
|
className: "item-main",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
67
|
+
children: [/* @__PURE__ */ o("div", {
|
|
64
68
|
className: "file-name",
|
|
65
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ o(w.Paragraph, {
|
|
66
70
|
style: {
|
|
67
71
|
margin: 0,
|
|
68
72
|
width: "100%"
|
|
69
73
|
},
|
|
70
74
|
ellipsis: {
|
|
71
75
|
rows: 1,
|
|
72
|
-
tooltip:
|
|
76
|
+
tooltip: e == null ? void 0 : e.name
|
|
73
77
|
},
|
|
74
|
-
children:
|
|
78
|
+
children: e == null ? void 0 : e.name
|
|
75
79
|
})
|
|
76
80
|
}), /* @__PURE__ */ g("div", {
|
|
77
81
|
className: "file-desc",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ o("span", {
|
|
79
83
|
children: t == null ? void 0 : t.toUpperCase()
|
|
80
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ o("span", {
|
|
81
85
|
children: ","
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
children:
|
|
86
|
+
}), /* @__PURE__ */ o("span", {
|
|
87
|
+
children: y((e == null ? void 0 : e.size) || 0)
|
|
84
88
|
})]
|
|
85
89
|
})]
|
|
86
90
|
})]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Space as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
/* empty css */import
|
|
8
|
-
const
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useContext as F, useEffect as w } from "react";
|
|
3
|
+
import { Space as P, Popover as L, Popconfirm as $, Input as q, message as k, notification as g, Button as Q } from "antd";
|
|
4
|
+
import r from "../../../../components/Iconfont/index.mjs";
|
|
5
|
+
import G from "copy-to-clipboard";
|
|
6
|
+
import J from "classnames";
|
|
7
|
+
/* empty css */import K from "../../../../context.mjs";
|
|
8
|
+
const U = [{
|
|
9
9
|
id: 1,
|
|
10
10
|
name: "展示信息不正确"
|
|
11
11
|
}, {
|
|
@@ -17,138 +17,152 @@ const J = [{
|
|
|
17
17
|
}, {
|
|
18
18
|
id: 4,
|
|
19
19
|
name: "其他原因"
|
|
20
|
-
}],
|
|
20
|
+
}], ie = (y) => {
|
|
21
21
|
var z;
|
|
22
22
|
const {
|
|
23
|
-
appId:
|
|
24
|
-
history:
|
|
25
|
-
isLastHistory:
|
|
23
|
+
appId: v,
|
|
24
|
+
history: n,
|
|
25
|
+
isLastHistory: H = !1,
|
|
26
26
|
sessionId: d,
|
|
27
|
-
currentSession:
|
|
27
|
+
currentSession: c,
|
|
28
28
|
onAgainClick: u
|
|
29
|
-
} =
|
|
30
|
-
service:
|
|
29
|
+
} = y, [i, h] = m([]), [C, I] = m(), [T, b] = m(!1), [M, A] = m(!1), {
|
|
30
|
+
service: V,
|
|
31
31
|
popupContainer: o,
|
|
32
32
|
transform: N,
|
|
33
33
|
onComment: p
|
|
34
|
-
} =
|
|
34
|
+
} = F(K), [f, x] = m(() => {
|
|
35
35
|
var e;
|
|
36
|
-
return (e =
|
|
37
|
-
});
|
|
38
|
-
|
|
36
|
+
return (e = n == null ? void 0 : n.comment) == null ? void 0 : e.isAgree;
|
|
37
|
+
}), [S, _] = m(400);
|
|
38
|
+
w(() => {
|
|
39
39
|
var e;
|
|
40
|
-
|
|
41
|
-
}, [(z =
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
x((e = n == null ? void 0 : n.comment) == null ? void 0 : e.isAgree);
|
|
41
|
+
}, [(z = n == null ? void 0 : n.comment) == null ? void 0 : z.isAgree]);
|
|
42
|
+
const E = () => {
|
|
43
|
+
k.config({
|
|
44
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body,
|
|
45
|
+
prefixCls: "gbot-message"
|
|
46
|
+
}), G(n.content), k.success("复制成功"), k.config({
|
|
47
|
+
getContainer: void 0,
|
|
48
|
+
prefixCls: "gbot-message"
|
|
47
49
|
});
|
|
48
|
-
},
|
|
49
|
-
if (!d || !(
|
|
50
|
+
}, R = (e) => {
|
|
51
|
+
if (!d || !(n != null && n.messageId))
|
|
50
52
|
return;
|
|
51
|
-
const
|
|
52
|
-
messageId:
|
|
53
|
+
const a = {
|
|
54
|
+
messageId: n.messageId,
|
|
53
55
|
isAgree: e
|
|
54
56
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
c == null || c.postMessageComment(a).then(() => {
|
|
58
|
+
x(e), n != null && n.comment && (n.comment.isAgree = e), !(e <= 0) && (A(!0), setTimeout(() => {
|
|
57
59
|
A(!1);
|
|
58
60
|
}, 2e3));
|
|
59
61
|
}), p && p({
|
|
60
|
-
applicationId:
|
|
62
|
+
applicationId: v,
|
|
61
63
|
sessionId: d,
|
|
62
|
-
comment:
|
|
64
|
+
comment: a
|
|
63
65
|
});
|
|
64
|
-
}, j = (e) => {
|
|
65
|
-
if (a.some((c) => c.id === e.id)) {
|
|
66
|
-
const c = a.filter((i) => i.id !== e.id);
|
|
67
|
-
h([...c]);
|
|
68
|
-
} else
|
|
69
|
-
h([...a, e]);
|
|
70
66
|
}, B = (e) => {
|
|
67
|
+
if (i.some((a) => a.id === e.id)) {
|
|
68
|
+
const a = i.filter((s) => s.id !== e.id);
|
|
69
|
+
h([...a]);
|
|
70
|
+
} else
|
|
71
|
+
h([...i, e]);
|
|
72
|
+
}, j = (e) => {
|
|
71
73
|
I(e.target.value);
|
|
72
|
-
},
|
|
74
|
+
}, O = () => {
|
|
73
75
|
if (!d)
|
|
74
76
|
return;
|
|
75
|
-
if (!(
|
|
77
|
+
if (!(i != null && i.length))
|
|
76
78
|
return b(!0), Promise.reject();
|
|
77
79
|
let e = [];
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
messageId:
|
|
80
|
+
i != null && i.length && (e = [...e, ...i.map((s) => s.name)]), C && (e = [...e, C]);
|
|
81
|
+
const a = {
|
|
82
|
+
messageId: n.messageId,
|
|
81
83
|
isAgree: -1,
|
|
82
84
|
againstReason: e
|
|
83
85
|
};
|
|
84
86
|
g.config({
|
|
85
|
-
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body,
|
|
88
|
+
prefixCls: "gbot-notification"
|
|
89
|
+
}), c == null || c.postMessageComment(a).then(() => {
|
|
90
|
+
x(-1), n != null && n.comment && (n.comment.isAgree = -1);
|
|
91
|
+
const s = `open${Date.now()}`;
|
|
89
92
|
g.success({
|
|
90
93
|
message: "提交反馈成功",
|
|
91
94
|
description: "感谢您的参与,我们会认真评估每一条建议!",
|
|
92
95
|
duration: 2,
|
|
93
|
-
btn: /* @__PURE__ */
|
|
96
|
+
btn: /* @__PURE__ */ t(Q, {
|
|
94
97
|
type: "primary",
|
|
95
|
-
onClick: () => g.close(
|
|
98
|
+
onClick: () => g.close(s),
|
|
96
99
|
children: "我知道了"
|
|
97
100
|
}),
|
|
98
|
-
key:
|
|
99
|
-
onClose: () => g.close(
|
|
101
|
+
key: s,
|
|
102
|
+
onClose: () => g.close(s)
|
|
100
103
|
});
|
|
101
104
|
}), p && p({
|
|
102
|
-
applicationId:
|
|
105
|
+
applicationId: v,
|
|
103
106
|
sessionId: d,
|
|
104
|
-
comment:
|
|
107
|
+
comment: a
|
|
105
108
|
});
|
|
106
109
|
};
|
|
107
|
-
return
|
|
110
|
+
return w(() => {
|
|
111
|
+
let e = null;
|
|
112
|
+
return e = requestAnimationFrame(() => {
|
|
113
|
+
const s = document.getElementById("chat-main");
|
|
114
|
+
if (s) {
|
|
115
|
+
const D = s.offsetHeight;
|
|
116
|
+
_(D * 0.8);
|
|
117
|
+
}
|
|
118
|
+
}), () => {
|
|
119
|
+
e && cancelAnimationFrame(e);
|
|
120
|
+
};
|
|
121
|
+
}, [n]), /* @__PURE__ */ l("div", {
|
|
108
122
|
className: "session-action",
|
|
109
|
-
children: [N != null && N.again &&
|
|
123
|
+
children: [N != null && N.again && H ? /* @__PURE__ */ l(P, {
|
|
110
124
|
className: "session-action-again",
|
|
111
125
|
onClick: () => u == null ? void 0 : u(),
|
|
112
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ t(r, {
|
|
113
127
|
type: "icon-zaicihuida"
|
|
114
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ t("span", {
|
|
115
129
|
style: {
|
|
116
130
|
fontSize: 12
|
|
117
131
|
},
|
|
118
132
|
children: "重新生成"
|
|
119
133
|
})]
|
|
120
|
-
}) : /* @__PURE__ */
|
|
134
|
+
}) : /* @__PURE__ */ t("span", {}), /* @__PURE__ */ t("div", {
|
|
121
135
|
className: "session-action-comment",
|
|
122
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ l(P, {
|
|
123
137
|
size: 8,
|
|
124
138
|
className: "action-comment-feedback",
|
|
125
|
-
children: [!
|
|
139
|
+
children: [!n.isSuspend && /* @__PURE__ */ t("span", {
|
|
126
140
|
className: "comment-feedback-item comment-feedback-copy",
|
|
127
|
-
onClick:
|
|
128
|
-
children: /* @__PURE__ */
|
|
141
|
+
onClick: E,
|
|
142
|
+
children: /* @__PURE__ */ t(r, {
|
|
129
143
|
type: "icon-fuzhi"
|
|
130
144
|
})
|
|
131
|
-
}), f === 0 && !
|
|
145
|
+
}), f === 0 && !n.isSuspend && /* @__PURE__ */ t("span", {
|
|
132
146
|
className: "comment-feedback-item",
|
|
133
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ t(r, {
|
|
134
148
|
type: "icon-zan",
|
|
135
|
-
onClick: () =>
|
|
149
|
+
onClick: () => R(1)
|
|
136
150
|
})
|
|
137
|
-
}), f === 1 && /* @__PURE__ */
|
|
138
|
-
open:
|
|
151
|
+
}), f === 1 && /* @__PURE__ */ t(L, {
|
|
152
|
+
open: M,
|
|
139
153
|
getPopupContainer: (e) => e.parentNode,
|
|
140
|
-
content: /* @__PURE__ */
|
|
154
|
+
content: /* @__PURE__ */ t("div", {
|
|
141
155
|
className: "zan-text",
|
|
142
156
|
children: "感谢您的认可"
|
|
143
157
|
}),
|
|
144
158
|
trigger: "click",
|
|
145
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ t("span", {
|
|
146
160
|
className: "comment-feedback-item comment-feedback-item__active",
|
|
147
|
-
children: /* @__PURE__ */
|
|
161
|
+
children: /* @__PURE__ */ t(r, {
|
|
148
162
|
type: "icon-zan"
|
|
149
163
|
})
|
|
150
164
|
})
|
|
151
|
-
}), f === 0 && !
|
|
165
|
+
}), f === 0 && !n.isSuspend && /* @__PURE__ */ t($, {
|
|
152
166
|
showArrow: !1,
|
|
153
167
|
arrowPointAtCenter: !0,
|
|
154
168
|
okText: "确定",
|
|
@@ -158,41 +172,41 @@ const J = [{
|
|
|
158
172
|
e && (h([]), I(""), b(!1));
|
|
159
173
|
},
|
|
160
174
|
icon: !1,
|
|
161
|
-
title: /* @__PURE__ */
|
|
175
|
+
title: /* @__PURE__ */ l("div", {
|
|
162
176
|
className: "cai-pannel",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ l("div", {
|
|
164
178
|
className: "cai-title",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ t("span", {
|
|
166
180
|
className: "cai-require",
|
|
167
181
|
children: "*"
|
|
168
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ t("span", {
|
|
169
183
|
className: "cai-question",
|
|
170
184
|
children: "你认为此答案存在哪方面的问题?"
|
|
171
185
|
})]
|
|
172
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ t("div", {
|
|
173
187
|
className: "cai-list",
|
|
174
|
-
children:
|
|
175
|
-
className:
|
|
188
|
+
children: U.map((e) => /* @__PURE__ */ t("span", {
|
|
189
|
+
className: J({
|
|
176
190
|
"cai-item": !0,
|
|
177
|
-
"cai-item__active":
|
|
191
|
+
"cai-item__active": i.some((a) => a.id === e.id)
|
|
178
192
|
}),
|
|
179
|
-
onClick: () =>
|
|
193
|
+
onClick: () => B(e),
|
|
180
194
|
children: e.name
|
|
181
195
|
}, e.id))
|
|
182
|
-
}),
|
|
196
|
+
}), T && /* @__PURE__ */ t("div", {
|
|
183
197
|
className: "cai-error",
|
|
184
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ t("span", {
|
|
185
199
|
className: "cai-error-text",
|
|
186
200
|
children: "请选择您不满意的原因"
|
|
187
201
|
})
|
|
188
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ t("div", {
|
|
189
203
|
className: "cai-title",
|
|
190
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ t("span", {
|
|
191
205
|
className: "cai-question",
|
|
192
206
|
children: "您还有哪些建议?"
|
|
193
207
|
})
|
|
194
|
-
}), /* @__PURE__ */
|
|
195
|
-
onChange:
|
|
208
|
+
}), /* @__PURE__ */ t(q.TextArea, {
|
|
209
|
+
onChange: j,
|
|
196
210
|
value: C,
|
|
197
211
|
autoSize: {
|
|
198
212
|
minRows: 3,
|
|
@@ -205,22 +219,26 @@ const J = [{
|
|
|
205
219
|
maxLength: 300
|
|
206
220
|
})]
|
|
207
221
|
}),
|
|
208
|
-
onConfirm: () =>
|
|
222
|
+
onConfirm: () => O(),
|
|
209
223
|
cancelButtonProps: {
|
|
210
224
|
size: "middle"
|
|
211
225
|
},
|
|
212
226
|
okButtonProps: {
|
|
213
227
|
size: "middle"
|
|
214
228
|
},
|
|
215
|
-
|
|
229
|
+
overlayStyle: {
|
|
230
|
+
maxHeight: `${S}px`,
|
|
231
|
+
overflow: "auto"
|
|
232
|
+
},
|
|
233
|
+
children: /* @__PURE__ */ t("span", {
|
|
216
234
|
className: "comment-feedback-item",
|
|
217
|
-
children: /* @__PURE__ */
|
|
235
|
+
children: /* @__PURE__ */ t(r, {
|
|
218
236
|
type: "icon-cai"
|
|
219
237
|
})
|
|
220
238
|
})
|
|
221
|
-
}), f === -1 && /* @__PURE__ */
|
|
239
|
+
}), f === -1 && /* @__PURE__ */ t("span", {
|
|
222
240
|
className: "comment-feedback-item comment-feedback-item__active",
|
|
223
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ t(r, {
|
|
224
242
|
type: "icon-cai"
|
|
225
243
|
})
|
|
226
244
|
})]
|
|
@@ -229,5 +247,5 @@ const J = [{
|
|
|
229
247
|
});
|
|
230
248
|
};
|
|
231
249
|
export {
|
|
232
|
-
|
|
250
|
+
ie as default
|
|
233
251
|
};
|
|
@@ -17,14 +17,14 @@ import ye from "./SessionRefer/index.mjs";
|
|
|
17
17
|
import ve from "./SessionAction/index.mjs";
|
|
18
18
|
import { IHistoryRole as Y, IThinkingStatus as Z } from "@glodon-aiot/apis";
|
|
19
19
|
import Re from "./FileItem/index.mjs";
|
|
20
|
-
import { Popover as
|
|
21
|
-
import
|
|
20
|
+
import { Popover as be, Space as $, Button as ee, Row as Se, Col as Ee, Collapse as ne, Divider as ke, message as R } from "antd";
|
|
21
|
+
import xe from "./SearchReference/index.mjs";
|
|
22
22
|
/* empty css */import "../../../packages/react-components/dist/es/index.mjs";
|
|
23
|
-
import
|
|
23
|
+
import Te from "classnames";
|
|
24
24
|
import p from "../../../components/Iconfont/index.mjs";
|
|
25
|
-
import { CheckOutlined as te, CloseOutlined as le, LoadingOutlined as
|
|
25
|
+
import { CheckOutlined as te, CloseOutlined as le, LoadingOutlined as Ae } from "@ant-design/icons";
|
|
26
26
|
import m from "../../../components/JsonDisplay/index.mjs";
|
|
27
|
-
import
|
|
27
|
+
import Oe from "../../../context.mjs";
|
|
28
28
|
import Fe from "./SessionRelated/index.mjs";
|
|
29
29
|
import _e from "copy-to-clipboard";
|
|
30
30
|
import { escapeSlash as Ie } from "../../../utils/index.mjs";
|
|
@@ -38,7 +38,7 @@ const je = (s) => {
|
|
|
38
38
|
} catch (l) {
|
|
39
39
|
return s;
|
|
40
40
|
}
|
|
41
|
-
}, Be = h(
|
|
41
|
+
}, Be = h(xe), ie = h(ye), b = h(ze), we = h(Re), u = (s) => {
|
|
42
42
|
if (!s)
|
|
43
43
|
return !1;
|
|
44
44
|
try {
|
|
@@ -52,7 +52,7 @@ const je = (s) => {
|
|
|
52
52
|
const l = JSON.parse(JSON.stringify(s)) || [], i = (n = l == null ? void 0 : l.pop()) == null ? void 0 : n.pop();
|
|
53
53
|
return i ? (i == null ? void 0 : i.type) === "BEFORE_CALL" || (i == null ? void 0 : i.type) === "FUNCTION_CALL" : !1;
|
|
54
54
|
}, dn = (s) => {
|
|
55
|
-
var T, A, O,
|
|
55
|
+
var x, T, A, O, F, _, I, U, z, j;
|
|
56
56
|
const {
|
|
57
57
|
application: l,
|
|
58
58
|
currentSession: i,
|
|
@@ -66,20 +66,22 @@ const je = (s) => {
|
|
|
66
66
|
actions: oe = !0,
|
|
67
67
|
markdown: d
|
|
68
68
|
} = s, {
|
|
69
|
-
debug:
|
|
69
|
+
debug: S,
|
|
70
70
|
transform: r,
|
|
71
71
|
popupContainer: C
|
|
72
|
-
} = Ce(
|
|
72
|
+
} = Ce(Oe), E = n.role === Y.User, k = n.role === Y.Robot, {
|
|
73
73
|
Panel: de
|
|
74
74
|
} = ne, [L, ce] = Le(!0), pe = () => {
|
|
75
75
|
R.config({
|
|
76
|
-
getContainer: () => (C == null ? void 0 : C.current) || document.body
|
|
76
|
+
getContainer: () => (C == null ? void 0 : C.current) || document.body,
|
|
77
|
+
prefixCls: "gbot-message"
|
|
77
78
|
}), _e(n.content), R.success("复制成功"), R.config({
|
|
78
|
-
getContainer: void 0
|
|
79
|
+
getContainer: void 0,
|
|
80
|
+
prefixCls: "gbot-message"
|
|
79
81
|
});
|
|
80
82
|
};
|
|
81
83
|
return /* @__PURE__ */ o("div", {
|
|
82
|
-
className:
|
|
84
|
+
className: Te({
|
|
83
85
|
"history-item": !0,
|
|
84
86
|
"history-item__user": E,
|
|
85
87
|
"history-item__bot": k
|
|
@@ -88,7 +90,7 @@ const je = (s) => {
|
|
|
88
90
|
className: "history-item-user",
|
|
89
91
|
children: [/* @__PURE__ */ e("div", {
|
|
90
92
|
className: "item-user-panel",
|
|
91
|
-
children: /* @__PURE__ */ e(
|
|
93
|
+
children: /* @__PURE__ */ e(be, {
|
|
92
94
|
placement: "topLeft",
|
|
93
95
|
overlayStyle: {
|
|
94
96
|
padding: 4
|
|
@@ -127,7 +129,7 @@ const je = (s) => {
|
|
|
127
129
|
className: "user-panel-main",
|
|
128
130
|
children: /* @__PURE__ */ e("span", {
|
|
129
131
|
className: "item-user-content",
|
|
130
|
-
children: /* @__PURE__ */ e(
|
|
132
|
+
children: /* @__PURE__ */ e(b, {
|
|
131
133
|
showLatex: !1,
|
|
132
134
|
children: Ie(n.content)
|
|
133
135
|
})
|
|
@@ -136,11 +138,11 @@ const je = (s) => {
|
|
|
136
138
|
})
|
|
137
139
|
}), /* @__PURE__ */ e("div", {
|
|
138
140
|
className: "item-user-file",
|
|
139
|
-
children: /* @__PURE__ */ e(
|
|
141
|
+
children: /* @__PURE__ */ e(Se, {
|
|
140
142
|
gutter: [12, 12],
|
|
141
143
|
justify: "end",
|
|
142
144
|
wrap: !0,
|
|
143
|
-
children: (
|
|
145
|
+
children: (x = n.files) == null ? void 0 : x.map((t) => /* @__PURE__ */ e(Ee, {
|
|
144
146
|
className: "user-file-col",
|
|
145
147
|
children: /* @__PURE__ */ e(we, {
|
|
146
148
|
docViewerUrl: N,
|
|
@@ -159,11 +161,11 @@ const je = (s) => {
|
|
|
159
161
|
children: [/* @__PURE__ */ e(ne, {
|
|
160
162
|
ghost: !0,
|
|
161
163
|
expandIconPosition: "right",
|
|
162
|
-
children: (
|
|
164
|
+
children: (T = n.actions) == null ? void 0 : T.map((t, me) => {
|
|
163
165
|
var B, w, M, J, P, Q, q, H, D, V, W, G;
|
|
164
166
|
return /* @__PURE__ */ o(de, {
|
|
165
|
-
collapsible:
|
|
166
|
-
showArrow:
|
|
167
|
+
collapsible: S ? "header" : "icon",
|
|
168
|
+
showArrow: S,
|
|
167
169
|
header: /* @__PURE__ */ o($, {
|
|
168
170
|
size: 8,
|
|
169
171
|
style: {
|
|
@@ -182,7 +184,7 @@ const je = (s) => {
|
|
|
182
184
|
children: /* @__PURE__ */ e(le, {})
|
|
183
185
|
}), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
184
186
|
className: "plugin-status-loading",
|
|
185
|
-
children: /* @__PURE__ */ e(
|
|
187
|
+
children: /* @__PURE__ */ e(Ae, {})
|
|
186
188
|
})]
|
|
187
189
|
}), /* @__PURE__ */ e("span", {
|
|
188
190
|
className: "bot-plugin-title",
|
|
@@ -249,12 +251,12 @@ const je = (s) => {
|
|
|
249
251
|
text: "思考中"
|
|
250
252
|
})
|
|
251
253
|
})]
|
|
252
|
-
}), !!((
|
|
254
|
+
}), !!((A = n.searchReference) != null && A.length) && /* @__PURE__ */ e("div", {
|
|
253
255
|
className: "item-bot-net",
|
|
254
256
|
children: /* @__PURE__ */ e(Be, {
|
|
255
257
|
history: n
|
|
256
258
|
})
|
|
257
|
-
}), (
|
|
259
|
+
}), (O = n == null ? void 0 : n.reference) != null && O.length && ((F = r == null ? void 0 : r.reference) != null && F.referenceFirst) ? /* @__PURE__ */ e(ie, {
|
|
258
260
|
history: n,
|
|
259
261
|
docViewerUrl: N,
|
|
260
262
|
markdown: d
|
|
@@ -300,12 +302,12 @@ const je = (s) => {
|
|
|
300
302
|
})]
|
|
301
303
|
}), /* @__PURE__ */ e("div", {
|
|
302
304
|
className: "bottom-right",
|
|
303
|
-
children: /* @__PURE__ */ e(
|
|
305
|
+
children: /* @__PURE__ */ e(b, v(y({}, d), {
|
|
304
306
|
children: (n == null ? void 0 : n.reasoningContent) || ""
|
|
305
307
|
}))
|
|
306
308
|
})]
|
|
307
309
|
})]
|
|
308
|
-
}), /* @__PURE__ */ e(
|
|
310
|
+
}), /* @__PURE__ */ e(b, v(y({}, d), {
|
|
309
311
|
children: n.content
|
|
310
312
|
}))]
|
|
311
313
|
}), (I = n == null ? void 0 : n.reference) != null && I.length && !((U = r == null ? void 0 : r.reference) != null && U.referenceFirst) ? /* @__PURE__ */ e(ie, {
|