@glodon-aiot/agent-cli-ui 3.9.0-beta.10 → 3.11.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/es/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +12 -12
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +11 -11
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionRelated/index.mjs +2 -2
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +118 -133
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +1 -1
- package/dist/es/Dialog/AgentChat/index.mjs +573 -604
- package/dist/es/Dialog/SessionList/index.mjs +218 -271
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +53 -53
- package/dist/es/components/FilePreview/index.mjs +6 -6
- package/dist/es/components/Iconfont/index.mjs +3 -3
- package/dist/es/constant.mjs +4 -4
- package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/components/Markdown/Code/index.mjs +1 -1
- package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/components/Markdown/Image/index.mjs +3 -3
- package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/components/Markdown/index.mjs +25 -24
- package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/index.mjs +1 -1
- package/dist/es/node_modules/hast-util-from-parse5/lib/index.mjs +162 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/create.mjs +14 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/defined-info.mjs +36 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/info.mjs +28 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/merge.mjs +10 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/schema.mjs +21 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/vfile-location/lib/index.mjs +47 -0
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/node_modules/rehype-raw/lib/index.mjs +26 -0
- package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/decode-codepoint.mjs +38 -0
- package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/decode.mjs +251 -0
- package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/generated/decode-data-html.mjs +7 -0
- package/dist/es/node_modules/rehype-raw/node_modules/hast-util-raw/lib/index.mjs +249 -0
- package/dist/es/node_modules/rehype-raw/node_modules/hast-util-to-parse5/lib/index.mjs +125 -0
- package/dist/es/node_modules/rehype-raw/node_modules/html-void-elements/index.mjs +4 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/doctype.mjs +34 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/error-codes.mjs +7 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/foreign-content.mjs +103 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/html.mjs +44 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/token.mjs +14 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/unicode.mjs +38 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/formatting-element-list.mjs +91 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/index.mjs +2308 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/open-element-stack.mjs +220 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/serializer/index.mjs +2 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tokenizer/index.mjs +1948 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tokenizer/preprocessor.mjs +92 -0
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tree-adapters/default.mjs +173 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/create.mjs +17 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/defined-info.mjs +27 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/info.mjs +23 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/merge.mjs +11 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/schema.mjs +17 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/rehype-raw/node_modules/unist-util-visit/lib/index.mjs +16 -0
- package/dist/es/node_modules/rehype-raw/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/node_modules/zwitch/index.mjs +18 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- 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/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/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.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/style5.css +1 -1
- package/dist/es/src/style6.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 +68 -69
- package/dist/src/constant.d.ts +2 -2
- package/package.json +3 -3
- /package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/Iconfont/index.mjs +0 -0
- /package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/components/Copy/index.mjs +0 -0
- /package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/components/Markdown/ATag/index.mjs +0 -0
- /package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/components/Markdown/Video/index.mjs +0 -0
- /package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/utils/clipboard.mjs +0 -0
- /package/dist/es/{packages → node_modules/@glodon-aiot}/react-components/dist/es/utils/markdown/index.mjs +0 -0
|
@@ -26,18 +26,18 @@ var P = (n, i, l) => new Promise((f, v) => {
|
|
|
26
26
|
}, S = (g) => g.done ? f(g.value) : Promise.resolve(g.value).then(q, k);
|
|
27
27
|
S((l = l.apply(n, i)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsxs as p, jsx as
|
|
29
|
+
import { jsxs as p, jsx as a, Fragment as ve } from "react/jsx-runtime";
|
|
30
30
|
import { useState as h, useRef as ke, useContext as Se, useEffect as N } from "react";
|
|
31
|
-
import { Form as M, Collapse as ee, Input as K, Button as Ce, message as w, notification as
|
|
31
|
+
import { Form as M, Collapse as ee, Input as K, Button as Ce, message as w, notification as D } from "antd";
|
|
32
32
|
import { PromptVariableType as y } from "@glodon-aiot/apis";
|
|
33
33
|
import { v4 as Pe } from "uuid";
|
|
34
34
|
import pe from "../../../context.mjs";
|
|
35
35
|
import we from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
|
|
36
|
-
import "../../../
|
|
36
|
+
import "../../../node_modules/@glodon-aiot/react-components/dist/es/index.mjs";
|
|
37
37
|
import Ne from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
|
|
38
38
|
import Te from "../../../node_modules/moment/dist/moment.mjs";
|
|
39
39
|
/* empty css */import { fetchEventSource as Ae } from "../fetchEventSource/fetch.mjs";
|
|
40
|
-
import { Markdown as Ve } from "../../../
|
|
40
|
+
import { Markdown as Ve } from "../../../node_modules/@glodon-aiot/react-components/dist/es/components/Markdown/index.mjs";
|
|
41
41
|
const {
|
|
42
42
|
Panel: _
|
|
43
43
|
} = ee, Ee = ({
|
|
@@ -45,13 +45,13 @@ const {
|
|
|
45
45
|
sessionId: i,
|
|
46
46
|
docViewerUrl: l
|
|
47
47
|
}) => {
|
|
48
|
-
const f = n.id, [v, q] = h(""), [k, S] = h(""), [g, C] = h(), [L, T] = h(!1),
|
|
48
|
+
const f = n.id, [v, q] = h(""), [k, S] = h(""), [g, C] = h(), [L, T] = h(!1), H = ke(null), [O, te] = h([]), [A, Y] = h([]), [se, $] = h(0), [j, E] = h(), [c, R] = h(), [z] = M.useForm(), [U, re] = h({}), [B, ne] = h({}), [oe, ae] = h(0), {
|
|
49
49
|
service: u,
|
|
50
50
|
agentClient: I,
|
|
51
51
|
popupContainer: x,
|
|
52
52
|
token: ce,
|
|
53
53
|
apiUrl: le
|
|
54
|
-
} = Se(pe), ie = (e,
|
|
54
|
+
} = Se(pe), ie = (e, o, d, t) => {
|
|
55
55
|
const s = {
|
|
56
56
|
messageId: Pe(),
|
|
57
57
|
content: "",
|
|
@@ -64,7 +64,7 @@ const {
|
|
|
64
64
|
}, r = Z(V({}, d), {
|
|
65
65
|
stream: !0
|
|
66
66
|
});
|
|
67
|
-
Ae(`${le}/chat/v2/chat?applicationId=${e}&sessionId=${
|
|
67
|
+
Ae(`${le}/chat/v2/chat?applicationId=${e}&sessionId=${o}`, {
|
|
68
68
|
method: "POST",
|
|
69
69
|
headers: {
|
|
70
70
|
Authorization: `Bearer ${ce}`,
|
|
@@ -85,7 +85,7 @@ const {
|
|
|
85
85
|
role: 1,
|
|
86
86
|
reference: s.reference,
|
|
87
87
|
messageId: s.messageId,
|
|
88
|
-
sessionId:
|
|
88
|
+
sessionId: o,
|
|
89
89
|
messageTime: Te(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
90
90
|
searchReference: []
|
|
91
91
|
};
|
|
@@ -99,18 +99,18 @@ const {
|
|
|
99
99
|
role: 1,
|
|
100
100
|
reference: s.reference,
|
|
101
101
|
messageId: s.messageId,
|
|
102
|
-
sessionId:
|
|
102
|
+
sessionId: o,
|
|
103
103
|
messageTime: s.messageTime,
|
|
104
104
|
searchReference: []
|
|
105
105
|
};
|
|
106
106
|
t != null && t.onmessage && t.onmessage(F);
|
|
107
107
|
} else {
|
|
108
|
-
|
|
108
|
+
D.config({
|
|
109
109
|
getContainer: () => (x == null ? void 0 : x.current) || document.body,
|
|
110
110
|
prefixCls: "gbot-notification"
|
|
111
|
-
}),
|
|
111
|
+
}), D.error({
|
|
112
112
|
message: b.message
|
|
113
|
-
}),
|
|
113
|
+
}), D.config({
|
|
114
114
|
getContainer: void 0,
|
|
115
115
|
prefixCls: "gbot-notification"
|
|
116
116
|
});
|
|
@@ -128,7 +128,7 @@ const {
|
|
|
128
128
|
role: 1,
|
|
129
129
|
reference: s.reference,
|
|
130
130
|
messageId: s.messageId,
|
|
131
|
-
sessionId:
|
|
131
|
+
sessionId: o,
|
|
132
132
|
messageTime: s.messageTime,
|
|
133
133
|
comment: {
|
|
134
134
|
isAgree: 0
|
|
@@ -146,14 +146,14 @@ const {
|
|
|
146
146
|
if (!(e != null && e.length))
|
|
147
147
|
return;
|
|
148
148
|
const d = e[0].knowledges || [];
|
|
149
|
-
te(d),
|
|
149
|
+
te(d), $(d.length);
|
|
150
150
|
const t = d.map((s) => s.id);
|
|
151
|
-
|
|
151
|
+
Y(t);
|
|
152
152
|
}, [n]), N(() => {
|
|
153
153
|
if (!(n != null && n.id) || !I)
|
|
154
154
|
return;
|
|
155
155
|
const e = I.questionContextMaxLength || 4e3;
|
|
156
|
-
|
|
156
|
+
ae(e), de();
|
|
157
157
|
}, [n, I]);
|
|
158
158
|
const de = () => P(void 0, null, function* () {
|
|
159
159
|
if (!u || !f)
|
|
@@ -171,8 +171,8 @@ const {
|
|
|
171
171
|
}), u.getApplicationIdPromptVariables(f, {
|
|
172
172
|
type: y.System,
|
|
173
173
|
status: 1
|
|
174
|
-
})]).then(([e,
|
|
175
|
-
const s = [...e, ...
|
|
174
|
+
})]).then(([e, o]) => {
|
|
175
|
+
const s = [...e, ...o].filter((r) => !(r.type === y.User && r.key === "query") && !(r.type === y.System && r.key === "datetime")).map((r) => ({
|
|
176
176
|
id: r.id,
|
|
177
177
|
key: r.key,
|
|
178
178
|
name: r.name,
|
|
@@ -184,21 +184,21 @@ const {
|
|
|
184
184
|
}, [u, f]), N(() => {
|
|
185
185
|
if (!c)
|
|
186
186
|
return;
|
|
187
|
-
const e = c.filter((s) => s.type === y.User),
|
|
187
|
+
const e = c.filter((s) => s.type === y.User), o = c.filter((s) => s.type === y.System), d = {};
|
|
188
188
|
e == null || e.map((s) => {
|
|
189
189
|
s.key && (d[s.key] = s.value);
|
|
190
190
|
});
|
|
191
191
|
const t = {};
|
|
192
|
-
|
|
192
|
+
o == null || o.map((s) => {
|
|
193
193
|
s.key && (t[s.key] = s.value);
|
|
194
194
|
}), z.setFieldsValue({
|
|
195
195
|
userPrompts: d,
|
|
196
196
|
systemPrompts: t
|
|
197
197
|
}), re(d), ne(t);
|
|
198
198
|
}, [c]);
|
|
199
|
-
const me = (e,
|
|
199
|
+
const me = (e, o) => P(void 0, null, function* () {
|
|
200
200
|
!j || !f || !u || (yield u.patchApplicationIdSessionpromptVariablesId(f, j.id, e, {
|
|
201
|
-
value:
|
|
201
|
+
value: o
|
|
202
202
|
}));
|
|
203
203
|
}), fe = (e) => {
|
|
204
204
|
q(e.target.value);
|
|
@@ -227,7 +227,7 @@ const {
|
|
|
227
227
|
applicationId: f
|
|
228
228
|
});
|
|
229
229
|
E(e);
|
|
230
|
-
const
|
|
230
|
+
const o = A == null ? void 0 : A.map((t) => t.toString());
|
|
231
231
|
yield u.getApplicationIdSessionIdPromptVariables(f, e.id).then((t) => P(void 0, null, function* () {
|
|
232
232
|
if (!c)
|
|
233
233
|
return;
|
|
@@ -242,7 +242,7 @@ const {
|
|
|
242
242
|
const d = {
|
|
243
243
|
content: v,
|
|
244
244
|
chatMode: 1,
|
|
245
|
-
knowledges:
|
|
245
|
+
knowledges: o,
|
|
246
246
|
promptVariables: U,
|
|
247
247
|
systemPromptVariables: B
|
|
248
248
|
};
|
|
@@ -265,21 +265,21 @@ const {
|
|
|
265
265
|
N(() => {
|
|
266
266
|
if (!k)
|
|
267
267
|
return;
|
|
268
|
-
const e =
|
|
268
|
+
const e = H.current;
|
|
269
269
|
e && (e.scrollTop = e.scrollHeight);
|
|
270
270
|
}, [k]);
|
|
271
271
|
const ue = (e) => {
|
|
272
|
-
|
|
273
|
-
}, J = (e,
|
|
272
|
+
Y(e), $(e.length);
|
|
273
|
+
}, J = (e, o) => {
|
|
274
274
|
c && (c.map((d) => {
|
|
275
|
-
d.id === e && (d.value =
|
|
275
|
+
d.id === e && (d.value = o.target.value);
|
|
276
276
|
}), R([...c]));
|
|
277
277
|
}, W = (c == null ? void 0 : c.filter((e) => e.type === y.System)) || [], G = (c == null ? void 0 : c.filter((e) => e.type === y.User)) || [];
|
|
278
278
|
return /* @__PURE__ */ p("div", {
|
|
279
279
|
className: "text-main",
|
|
280
280
|
children: [/* @__PURE__ */ p("div", {
|
|
281
281
|
className: "text-left-sider",
|
|
282
|
-
children: [!!(c != null && c.length) && /* @__PURE__ */
|
|
282
|
+
children: [!!(c != null && c.length) && /* @__PURE__ */ a(M, {
|
|
283
283
|
autoComplete: "off",
|
|
284
284
|
form: z,
|
|
285
285
|
labelWrap: !0,
|
|
@@ -295,9 +295,9 @@ const {
|
|
|
295
295
|
ghost: !0,
|
|
296
296
|
className: "prompt-variables-collapse",
|
|
297
297
|
defaultActiveKey: [y.System, y.User],
|
|
298
|
-
children: [W.length && /* @__PURE__ */
|
|
298
|
+
children: [W.length && /* @__PURE__ */ a(_, {
|
|
299
299
|
header: "角色设定变量",
|
|
300
|
-
children: W.map((e) => /* @__PURE__ */
|
|
300
|
+
children: W.map((e) => /* @__PURE__ */ a(M.Item, {
|
|
301
301
|
label: e.name,
|
|
302
302
|
name: ["systemPrompts", e.key],
|
|
303
303
|
style: {
|
|
@@ -307,15 +307,15 @@ const {
|
|
|
307
307
|
required: !0,
|
|
308
308
|
message: "请输入"
|
|
309
309
|
}],
|
|
310
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ a(K, {
|
|
311
311
|
placeholder: "请输入",
|
|
312
312
|
maxLength: I == null ? void 0 : I.questionContextMaxLength,
|
|
313
|
-
onBlur: (
|
|
313
|
+
onBlur: (o) => J(e.id, o)
|
|
314
314
|
})
|
|
315
315
|
}, e.key))
|
|
316
|
-
}, y.System), G.length && /* @__PURE__ */
|
|
316
|
+
}, y.System), G.length && /* @__PURE__ */ a(_, {
|
|
317
317
|
header: "用户指令变量",
|
|
318
|
-
children: G.map((e) => /* @__PURE__ */
|
|
318
|
+
children: G.map((e) => /* @__PURE__ */ a(M.Item, {
|
|
319
319
|
label: e.name,
|
|
320
320
|
name: ["userPrompts", e.key],
|
|
321
321
|
style: {
|
|
@@ -325,43 +325,43 @@ const {
|
|
|
325
325
|
required: !0,
|
|
326
326
|
message: "请输入"
|
|
327
327
|
}],
|
|
328
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ a(K, {
|
|
329
329
|
placeholder: "请输入",
|
|
330
330
|
maxLength: I == null ? void 0 : I.questionContextMaxLength,
|
|
331
|
-
onBlur: (
|
|
331
|
+
onBlur: (o) => J(e.id, o)
|
|
332
332
|
})
|
|
333
333
|
}, e.key))
|
|
334
334
|
}, y.User)]
|
|
335
335
|
})
|
|
336
336
|
}), /* @__PURE__ */ p("div", {
|
|
337
337
|
className: "sider-header",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ a("span", {
|
|
339
339
|
className: "header-title",
|
|
340
340
|
children: "文本生成输入"
|
|
341
|
-
}),
|
|
341
|
+
}), O.length !== 0 && /* @__PURE__ */ a(we, {
|
|
342
342
|
checkedValues: A,
|
|
343
|
-
currKnowledgeList:
|
|
343
|
+
currKnowledgeList: O,
|
|
344
344
|
selectCount: se,
|
|
345
345
|
onSelectChange: ue,
|
|
346
346
|
disabled: !1
|
|
347
347
|
})]
|
|
348
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ a("div", {
|
|
349
349
|
className: "sider-main",
|
|
350
350
|
children: /* @__PURE__ */ p("div", {
|
|
351
351
|
className: "sider-text",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ a(K.TextArea, {
|
|
353
353
|
style: {
|
|
354
354
|
height: "100%",
|
|
355
355
|
resize: "none"
|
|
356
356
|
},
|
|
357
357
|
placeholder: "请输入你的问题,通过shift+enter换行",
|
|
358
|
-
maxLength:
|
|
358
|
+
maxLength: oe,
|
|
359
359
|
showCount: !0,
|
|
360
360
|
bordered: !1,
|
|
361
361
|
onChange: fe,
|
|
362
362
|
value: v,
|
|
363
363
|
className: "left-input"
|
|
364
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ a(Ce, {
|
|
365
365
|
type: "primary",
|
|
366
366
|
disabled: !v || L,
|
|
367
367
|
onClick: ge,
|
|
@@ -371,28 +371,28 @@ const {
|
|
|
371
371
|
})]
|
|
372
372
|
})
|
|
373
373
|
})]
|
|
374
|
-
}), /* @__PURE__ */
|
|
374
|
+
}), /* @__PURE__ */ a("div", {
|
|
375
375
|
className: "text-right-sider",
|
|
376
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ a("div", {
|
|
377
377
|
className: "sider-main",
|
|
378
|
-
children: /* @__PURE__ */
|
|
378
|
+
children: /* @__PURE__ */ a("div", {
|
|
379
379
|
className: "sider-text",
|
|
380
|
-
ref:
|
|
380
|
+
ref: H,
|
|
381
381
|
children: k ? /* @__PURE__ */ p(ve, {
|
|
382
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ a(Ve, {
|
|
383
383
|
children: k
|
|
384
|
-
}), g && (g == null ? void 0 : g.reference.length) !== 0 && /* @__PURE__ */
|
|
384
|
+
}), g && (g == null ? void 0 : g.reference.length) !== 0 && /* @__PURE__ */ a("div", {
|
|
385
385
|
style: {
|
|
386
386
|
marginTop: 16
|
|
387
387
|
},
|
|
388
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ a(Ne, {
|
|
389
389
|
history: g,
|
|
390
390
|
docViewerUrl: l
|
|
391
391
|
})
|
|
392
392
|
})]
|
|
393
|
-
}) : /* @__PURE__ */
|
|
393
|
+
}) : /* @__PURE__ */ a("div", {
|
|
394
394
|
className: "text-pannel",
|
|
395
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ a("span", {
|
|
396
396
|
children: "请在左侧输入需要 AI 生成的内容"
|
|
397
397
|
})
|
|
398
398
|
})
|
|
@@ -2,12 +2,12 @@ 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
3
|
import { Image as k, Spin as E, Tooltip as P, Button as j } from "antd";
|
|
4
4
|
import { LoadingOutlined as z } from "@ant-design/icons";
|
|
5
|
-
import { AecKnowledgeFileStatus as
|
|
5
|
+
import { AecKnowledgeFileStatus as F } from "@glodon-aiot/apis";
|
|
6
6
|
import B from "../Iconfont/index.mjs";
|
|
7
7
|
import { getBase64 as I } from "../../utils/index.mjs";
|
|
8
8
|
/* empty css */const D = (i) => {
|
|
9
9
|
const {
|
|
10
|
-
className:
|
|
10
|
+
className: N,
|
|
11
11
|
style: y,
|
|
12
12
|
id: r,
|
|
13
13
|
file: e,
|
|
@@ -35,9 +35,9 @@ import { getBase64 as I } from "../../utils/index.mjs";
|
|
|
35
35
|
p(e instanceof File || e == null ? void 0 : e.status);
|
|
36
36
|
}, [e]);
|
|
37
37
|
const C = () => {
|
|
38
|
-
r && c && a ===
|
|
38
|
+
r && c && a === F.Processing && c(r).then((t) => {
|
|
39
39
|
t !== a && (a !== void 0 && v && v(t), p(t));
|
|
40
|
-
}).catch((t) => p(
|
|
40
|
+
}).catch((t) => p(F.Failed));
|
|
41
41
|
};
|
|
42
42
|
return n(() => {
|
|
43
43
|
C();
|
|
@@ -46,7 +46,7 @@ import { getBase64 as I } from "../../utils/index.mjs";
|
|
|
46
46
|
d(t);
|
|
47
47
|
});
|
|
48
48
|
}, [e]), e ? /* @__PURE__ */ x("div", {
|
|
49
|
-
className: `file-preview ${
|
|
49
|
+
className: `file-preview ${N}`,
|
|
50
50
|
style: y,
|
|
51
51
|
children: [/* @__PURE__ */ o(k, {
|
|
52
52
|
src: m,
|
|
@@ -62,7 +62,7 @@ import { getBase64 as I } from "../../utils/index.mjs";
|
|
|
62
62
|
}), !f && g && /* @__PURE__ */ o(P, {
|
|
63
63
|
overlayClassName: "file-remove-tooltip",
|
|
64
64
|
title: "删除文件",
|
|
65
|
-
getPopupContainer: (t) => t.parentNode
|
|
65
|
+
getPopupContainer: (t) => t.parentNode,
|
|
66
66
|
children: /* @__PURE__ */ o(j, {
|
|
67
67
|
className: "file-action file-remove",
|
|
68
68
|
icon: /* @__PURE__ */ o(B, {
|