@glodon-aiot/agent-cli-ui 3.11.1-shapshot.1765331455 → 3.11.1-shapshot.1765331457
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/SessionRefer/ReferItem/index.mjs +28 -28
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +8 -8
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +132 -117
- package/dist/es/Dialog/AgentChat/index.mjs +604 -573
- package/dist/es/Dialog/SessionList/index.mjs +271 -218
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +51 -51
- package/dist/es/components/FilePreview/index.mjs +6 -6
- package/dist/es/components/Iconfont/index.mjs +3 -3
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/components/Markdown/index.mjs +22 -23
- 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/style16.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/style30.css +1 -1
- package/dist/es/src/style32.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 -68
- package/package.json +3 -3
- package/dist/es/node_modules/hast-util-from-parse5/lib/index.mjs +0 -162
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/index.mjs +0 -12
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/aria.mjs +0 -61
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/find.mjs +0 -33
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/html.mjs +0 -368
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/normalize.mjs +0 -6
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/svg.mjs +0 -566
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/case-insensitive-transform.mjs +0 -7
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/case-sensitive-transform.mjs +0 -6
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/create.mjs +0 -14
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/defined-info.mjs +0 -36
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/info.mjs +0 -28
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/merge.mjs +0 -10
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/schema.mjs +0 -21
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/util/types.mjs +0 -15
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xlink.mjs +0 -19
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xml.mjs +0 -15
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/property-information/lib/xmlns.mjs +0 -16
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/vfile-location/lib/index.mjs +0 -47
- package/dist/es/node_modules/hast-util-from-parse5/node_modules/web-namespaces/index.mjs +0 -11
- package/dist/es/node_modules/rehype-raw/lib/index.mjs +0 -26
- package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/decode-codepoint.mjs +0 -38
- package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/decode.mjs +0 -251
- package/dist/es/node_modules/rehype-raw/node_modules/entities/dist/esm/generated/decode-data-html.mjs +0 -7
- package/dist/es/node_modules/rehype-raw/node_modules/hast-util-raw/lib/index.mjs +0 -249
- package/dist/es/node_modules/rehype-raw/node_modules/hast-util-to-parse5/lib/index.mjs +0 -125
- package/dist/es/node_modules/rehype-raw/node_modules/html-void-elements/index.mjs +0 -4
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/doctype.mjs +0 -34
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/error-codes.mjs +0 -7
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/foreign-content.mjs +0 -103
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/html.mjs +0 -44
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/token.mjs +0 -14
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/common/unicode.mjs +0 -38
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/formatting-element-list.mjs +0 -91
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/index.mjs +0 -2308
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/parser/open-element-stack.mjs +0 -220
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/serializer/index.mjs +0 -2
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tokenizer/index.mjs +0 -1948
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tokenizer/preprocessor.mjs +0 -92
- package/dist/es/node_modules/rehype-raw/node_modules/parse5/dist/tree-adapters/default.mjs +0 -173
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/index.mjs +0 -12
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/aria.mjs +0 -61
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/find.mjs +0 -33
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/html.mjs +0 -368
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/normalize.mjs +0 -6
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/svg.mjs +0 -566
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/case-insensitive-transform.mjs +0 -7
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/case-sensitive-transform.mjs +0 -6
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/create.mjs +0 -17
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/defined-info.mjs +0 -27
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/info.mjs +0 -23
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/merge.mjs +0 -11
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/schema.mjs +0 -17
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/util/types.mjs +0 -15
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xlink.mjs +0 -19
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xml.mjs +0 -15
- package/dist/es/node_modules/rehype-raw/node_modules/property-information/lib/xmlns.mjs +0 -16
- package/dist/es/node_modules/rehype-raw/node_modules/unist-util-visit/lib/index.mjs +0 -16
- package/dist/es/node_modules/rehype-raw/node_modules/web-namespaces/index.mjs +0 -11
- package/dist/es/node_modules/zwitch/index.mjs +0 -18
|
@@ -26,9 +26,9 @@ 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 o, 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 $ } 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";
|
|
@@ -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), D = ke(null), [H, te] = h([]), [A, O] = h([]), [se, Y] = h(0), [j, E] = h(), [c, R] = h(), [z] = M.useForm(), [U, re] = h({}), [B, ne] = h({}), [ae, oe] = 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, a, 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=${a}`, {
|
|
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: a,
|
|
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: a,
|
|
103
103
|
messageTime: s.messageTime,
|
|
104
104
|
searchReference: []
|
|
105
105
|
};
|
|
106
106
|
t != null && t.onmessage && t.onmessage(F);
|
|
107
107
|
} else {
|
|
108
|
-
|
|
108
|
+
$.config({
|
|
109
109
|
getContainer: () => (x == null ? void 0 : x.current) || document.body,
|
|
110
110
|
prefixCls: "gbot-notification"
|
|
111
|
-
}),
|
|
111
|
+
}), $.error({
|
|
112
112
|
message: b.message
|
|
113
|
-
}),
|
|
113
|
+
}), $.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: a,
|
|
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), Y(d.length);
|
|
150
150
|
const t = d.map((s) => s.id);
|
|
151
|
-
|
|
151
|
+
O(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
|
+
oe(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, a]) => {
|
|
175
|
+
const s = [...e, ...a].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), a = 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
|
+
a == null || a.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, a) => P(void 0, null, function* () {
|
|
200
200
|
!j || !f || !u || (yield u.patchApplicationIdSessionpromptVariablesId(f, j.id, e, {
|
|
201
|
-
value:
|
|
201
|
+
value: a
|
|
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 a = 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: a,
|
|
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 = D.current;
|
|
269
269
|
e && (e.scrollTop = e.scrollHeight);
|
|
270
270
|
}, [k]);
|
|
271
271
|
const ue = (e) => {
|
|
272
|
-
|
|
273
|
-
}, J = (e,
|
|
272
|
+
O(e), Y(e.length);
|
|
273
|
+
}, J = (e, a) => {
|
|
274
274
|
c && (c.map((d) => {
|
|
275
|
-
d.id === e && (d.value =
|
|
275
|
+
d.id === e && (d.value = a.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__ */ o(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__ */ o(_, {
|
|
299
299
|
header: "角色设定变量",
|
|
300
|
-
children: W.map((e) => /* @__PURE__ */
|
|
300
|
+
children: W.map((e) => /* @__PURE__ */ o(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__ */ o(K, {
|
|
311
311
|
placeholder: "请输入",
|
|
312
312
|
maxLength: I == null ? void 0 : I.questionContextMaxLength,
|
|
313
|
-
onBlur: (
|
|
313
|
+
onBlur: (a) => J(e.id, a)
|
|
314
314
|
})
|
|
315
315
|
}, e.key))
|
|
316
|
-
}, y.System), G.length && /* @__PURE__ */
|
|
316
|
+
}, y.System), G.length && /* @__PURE__ */ o(_, {
|
|
317
317
|
header: "用户指令变量",
|
|
318
|
-
children: G.map((e) => /* @__PURE__ */
|
|
318
|
+
children: G.map((e) => /* @__PURE__ */ o(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__ */ o(K, {
|
|
329
329
|
placeholder: "请输入",
|
|
330
330
|
maxLength: I == null ? void 0 : I.questionContextMaxLength,
|
|
331
|
-
onBlur: (
|
|
331
|
+
onBlur: (a) => J(e.id, a)
|
|
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__ */ o("span", {
|
|
339
339
|
className: "header-title",
|
|
340
340
|
children: "文本生成输入"
|
|
341
|
-
}),
|
|
341
|
+
}), H.length !== 0 && /* @__PURE__ */ o(we, {
|
|
342
342
|
checkedValues: A,
|
|
343
|
-
currKnowledgeList:
|
|
343
|
+
currKnowledgeList: H,
|
|
344
344
|
selectCount: se,
|
|
345
345
|
onSelectChange: ue,
|
|
346
346
|
disabled: !1
|
|
347
347
|
})]
|
|
348
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ o("div", {
|
|
349
349
|
className: "sider-main",
|
|
350
350
|
children: /* @__PURE__ */ p("div", {
|
|
351
351
|
className: "sider-text",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ o(K.TextArea, {
|
|
353
353
|
style: {
|
|
354
354
|
height: "100%",
|
|
355
355
|
resize: "none"
|
|
356
356
|
},
|
|
357
357
|
placeholder: "请输入你的问题,通过shift+enter换行",
|
|
358
|
-
maxLength:
|
|
358
|
+
maxLength: ae,
|
|
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__ */ o(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__ */ o("div", {
|
|
375
375
|
className: "text-right-sider",
|
|
376
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ o("div", {
|
|
377
377
|
className: "sider-main",
|
|
378
|
-
children: /* @__PURE__ */
|
|
378
|
+
children: /* @__PURE__ */ o("div", {
|
|
379
379
|
className: "sider-text",
|
|
380
|
-
ref:
|
|
380
|
+
ref: D,
|
|
381
381
|
children: k ? /* @__PURE__ */ p(ve, {
|
|
382
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ o(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__ */ o("div", {
|
|
385
385
|
style: {
|
|
386
386
|
marginTop: 16
|
|
387
387
|
},
|
|
388
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ o(Ne, {
|
|
389
389
|
history: g,
|
|
390
390
|
docViewerUrl: l
|
|
391
391
|
})
|
|
392
392
|
})]
|
|
393
|
-
}) : /* @__PURE__ */
|
|
393
|
+
}) : /* @__PURE__ */ o("div", {
|
|
394
394
|
className: "text-pannel",
|
|
395
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ o("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 N } 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: F,
|
|
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 === N.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(N.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 ${F}`,
|
|
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.parentNode,
|
|
66
66
|
children: /* @__PURE__ */ o(j, {
|
|
67
67
|
className: "file-action file-remove",
|
|
68
68
|
icon: /* @__PURE__ */ o(B, {
|