@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.
Files changed (48) hide show
  1. package/dist/es/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -48
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +112 -94
  3. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +26 -24
  4. package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +65 -59
  5. package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +179 -161
  6. package/dist/es/Dialog/AgentChat/index.mjs +520 -465
  7. package/dist/es/QuillEditor/index.mjs +72 -65
  8. package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +182 -170
  9. package/dist/es/components/Recommend/RecommendItem.mjs +20 -18
  10. package/dist/es/index.mjs +223 -214
  11. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  12. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  13. package/dist/es/src/style.css +1 -1
  14. package/dist/es/src/style10.css +1 -1
  15. package/dist/es/src/style11.css +1 -1
  16. package/dist/es/src/style12.css +1 -1
  17. package/dist/es/src/style14.css +1 -1
  18. package/dist/es/src/style15.css +1 -1
  19. package/dist/es/src/style16.css +1 -1
  20. package/dist/es/src/style17.css +1 -1
  21. package/dist/es/src/style18.css +1 -1
  22. package/dist/es/src/style19.css +1 -1
  23. package/dist/es/src/style20.css +1 -1
  24. package/dist/es/src/style21.css +1 -1
  25. package/dist/es/src/style22.css +1 -1
  26. package/dist/es/src/style23.css +1 -1
  27. package/dist/es/src/style24.css +1 -1
  28. package/dist/es/src/style25.css +1 -1
  29. package/dist/es/src/style26.css +1 -1
  30. package/dist/es/src/style27.css +1 -1
  31. package/dist/es/src/style28.css +1 -1
  32. package/dist/es/src/style3.css +1 -1
  33. package/dist/es/src/style30.css +1 -1
  34. package/dist/es/src/style31.css +1 -1
  35. package/dist/es/src/style32.css +1 -1
  36. package/dist/es/src/style33.css +1 -1
  37. package/dist/es/src/style4.css +1 -1
  38. package/dist/es/src/style5.css +1 -1
  39. package/dist/es/src/style6.css +1 -1
  40. package/dist/es/src/style7.css +1 -1
  41. package/dist/es/src/style8.css +1 -1
  42. package/dist/es/src/style9.css +1 -1
  43. package/dist/es/utils/antdConfig.mjs +15 -0
  44. package/dist/lib/index.css +1 -1
  45. package/dist/lib/index.js +57 -57
  46. package/dist/src/utils/antdConfig.d.ts +7 -0
  47. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  48. package/package.json +3 -3
@@ -1,59 +1,59 @@
1
- var ge = Object.defineProperty, he = Object.defineProperties;
2
- var ye = Object.getOwnPropertyDescriptors;
3
- var G = Object.getOwnPropertySymbols;
4
- var Ie = Object.prototype.hasOwnProperty, ke = Object.prototype.propertyIsEnumerable;
5
- var Q = (n, d, l) => d in n ? ge(n, d, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[d] = l, V = (n, d) => {
6
- for (var l in d || (d = {}))
7
- Ie.call(d, l) && Q(n, l, d[l]);
8
- if (G)
9
- for (var l of G(d))
10
- ke.call(d, l) && Q(n, l, d[l]);
1
+ var he = Object.defineProperty, ye = Object.defineProperties;
2
+ var Ie = Object.getOwnPropertyDescriptors;
3
+ var Q = Object.getOwnPropertySymbols;
4
+ var be = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable;
5
+ var X = (n, i, l) => i in n ? he(n, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[i] = l, V = (n, i) => {
6
+ for (var l in i || (i = {}))
7
+ be.call(i, l) && X(n, l, i[l]);
8
+ if (Q)
9
+ for (var l of Q(i))
10
+ xe.call(i, l) && X(n, l, i[l]);
11
11
  return n;
12
- }, X = (n, d) => he(n, ye(d));
13
- var p = (n, d, l) => new Promise((u, v) => {
14
- var q = (f) => {
12
+ }, Z = (n, i) => ye(n, Ie(i));
13
+ var P = (n, i, l) => new Promise((f, v) => {
14
+ var q = (g) => {
15
15
  try {
16
- x(l.next(f));
17
- } catch (b) {
18
- v(b);
16
+ S(l.next(g));
17
+ } catch (C) {
18
+ v(C);
19
19
  }
20
- }, S = (f) => {
20
+ }, k = (g) => {
21
21
  try {
22
- x(l.throw(f));
23
- } catch (b) {
24
- v(b);
22
+ S(l.throw(g));
23
+ } catch (C) {
24
+ v(C);
25
25
  }
26
- }, x = (f) => f.done ? u(f.value) : Promise.resolve(f.value).then(q, S);
27
- x((l = l.apply(n, d)).next());
26
+ }, S = (g) => g.done ? f(g.value) : Promise.resolve(g.value).then(q, k);
27
+ S((l = l.apply(n, i)).next());
28
28
  });
29
- import { jsxs as w, jsx as o, Fragment as ve } from "react/jsx-runtime";
30
- import { useState as h, useRef as Se, useContext as xe, useEffect as N } from "react";
31
- import { Form as M, Collapse as _, Input as K, Button as be, message as C, notification as Pe } from "antd";
29
+ import { jsxs as p, jsx as a, Fragment as ve } from "react/jsx-runtime";
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 D } from "antd";
32
32
  import { PromptVariableType as y } from "@glodon-aiot/apis";
33
- import { v4 as pe } from "uuid";
34
- import we from "../../../context.mjs";
35
- import Ce from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
33
+ import { v4 as Pe } from "uuid";
34
+ import pe from "../../../context.mjs";
35
+ import we from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
36
36
  import "../../../packages/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
40
  import { Markdown as Ve } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
41
41
  const {
42
- Panel: Z
43
- } = _, Ee = ({
42
+ Panel: _
43
+ } = ee, Ee = ({
44
44
  application: n,
45
- sessionId: d,
45
+ sessionId: i,
46
46
  docViewerUrl: l
47
47
  }) => {
48
- const u = n.id, [v, q] = h(""), [S, x] = h(""), [f, b] = h(), [L, T] = h(!1), D = Se(null), [H, ee] = h([]), [A, O] = h([]), [te, Y] = h(0), [$, j] = h(), [c, R] = h(), [E] = M.useForm(), [U, re] = h({}), [B, se] = h({}), [ne, ae] = h(0), {
49
- service: g,
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
+ service: u,
50
50
  agentClient: I,
51
- popupContainer: P,
52
- token: oe,
53
- apiUrl: ce
54
- } = xe(we), le = (e, a, i, t) => {
55
- const r = {
56
- messageId: pe(),
51
+ popupContainer: x,
52
+ token: ce,
53
+ apiUrl: le
54
+ } = Se(pe), ie = (e, o, d, t) => {
55
+ const s = {
56
+ messageId: Pe(),
57
57
  content: "",
58
58
  role: 1,
59
59
  sessionId: "",
@@ -61,16 +61,16 @@ const {
61
61
  messageTime: "",
62
62
  llmModel: "",
63
63
  searchReference: []
64
- }, s = X(V({}, i), {
64
+ }, r = Z(V({}, d), {
65
65
  stream: !0
66
66
  });
67
- Ae(`${ce}/chat/v2/chat?applicationId=${e}&sessionId=${a}`, {
67
+ Ae(`${le}/chat/v2/chat?applicationId=${e}&sessionId=${o}`, {
68
68
  method: "POST",
69
69
  headers: {
70
- Authorization: `Bearer ${oe}`,
70
+ Authorization: `Bearer ${ce}`,
71
71
  "Content-Type": "application/json"
72
72
  },
73
- body: JSON.stringify(s),
73
+ body: JSON.stringify(r),
74
74
  openWhenHidden: !0,
75
75
  onopen(m) {
76
76
  return console.log("onopen"), m.ok && t != null && t.onopen && t.onopen(), Promise.resolve();
@@ -79,35 +79,43 @@ const {
79
79
  if (!m.id && !m.data && !m.event && !m.retry)
80
80
  return;
81
81
  if (!m.data.includes('{"code": ')) {
82
- r.content = r.content + m.data;
82
+ s.content = s.content + m.data;
83
83
  const F = {
84
- content: r.content,
84
+ content: s.content,
85
85
  role: 1,
86
- reference: r.reference,
87
- messageId: r.messageId,
88
- sessionId: a,
86
+ reference: s.reference,
87
+ messageId: s.messageId,
88
+ sessionId: o,
89
89
  messageTime: Te(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
90
90
  searchReference: []
91
91
  };
92
92
  return (t == null ? void 0 : t.onmessage) && t.onmessage(F);
93
93
  }
94
- const k = JSON.parse(m.data);
95
- if (r.reference = k.data.reference, r.messageTime = k.data.messageTime, r.messageId = k.data.messageId, r.llmModel = k.data.llmModel, r.content = k.data.content, r.code = k.code, k.code === 200) {
94
+ const b = JSON.parse(m.data);
95
+ if (s.reference = b.data.reference, s.messageTime = b.data.messageTime, s.messageId = b.data.messageId, s.llmModel = b.data.llmModel, s.content = b.data.content, s.code = b.code, b.code === 200) {
96
96
  const F = {
97
- code: r.code,
98
- content: r.content,
97
+ code: s.code,
98
+ content: s.content,
99
99
  role: 1,
100
- reference: r.reference,
101
- messageId: r.messageId,
102
- sessionId: a,
103
- messageTime: r.messageTime,
100
+ reference: s.reference,
101
+ messageId: s.messageId,
102
+ sessionId: o,
103
+ messageTime: s.messageTime,
104
104
  searchReference: []
105
105
  };
106
106
  t != null && t.onmessage && t.onmessage(F);
107
- } else
108
- return Pe.error({
109
- message: k.message
107
+ } else {
108
+ D.config({
109
+ getContainer: () => (x == null ? void 0 : x.current) || document.body,
110
+ prefixCls: "gbot-notification"
111
+ }), D.error({
112
+ message: b.message
113
+ }), D.config({
114
+ getContainer: void 0,
115
+ prefixCls: "gbot-notification"
110
116
  });
117
+ return;
118
+ }
111
119
  },
112
120
  onerror() {
113
121
  t != null && t.onerror && t.onerror();
@@ -115,13 +123,13 @@ const {
115
123
  onclose() {
116
124
  console.log("onclose");
117
125
  const m = {
118
- code: r.code,
119
- content: r.content,
126
+ code: s.code,
127
+ content: s.content,
120
128
  role: 1,
121
- reference: r.reference,
122
- messageId: r.messageId,
123
- sessionId: a,
124
- messageTime: r.messageTime,
129
+ reference: s.reference,
130
+ messageId: s.messageId,
131
+ sessionId: o,
132
+ messageTime: s.messageTime,
125
133
  comment: {
126
134
  isAgree: 0
127
135
  },
@@ -137,112 +145,116 @@ const {
137
145
  const e = n.arrange;
138
146
  if (!(e != null && e.length))
139
147
  return;
140
- const i = e[0].knowledges || [];
141
- ee(i), Y(i.length);
142
- const t = i.map((r) => r.id);
143
- O(t);
148
+ const d = e[0].knowledges || [];
149
+ te(d), $(d.length);
150
+ const t = d.map((s) => s.id);
151
+ Y(t);
144
152
  }, [n]), N(() => {
145
153
  if (!(n != null && n.id) || !I)
146
154
  return;
147
155
  const e = I.questionContextMaxLength || 4e3;
148
156
  ae(e), de();
149
157
  }, [n, I]);
150
- const de = () => p(void 0, null, function* () {
151
- if (!g || !u)
158
+ const de = () => P(void 0, null, function* () {
159
+ if (!u || !f)
152
160
  return;
153
- const e = yield g.postApplicationIdSession({
161
+ const e = yield u.postApplicationIdSession({
154
162
  name: "AI 会话",
155
- applicationId: u
163
+ applicationId: f
156
164
  });
157
- j(e);
165
+ E(e);
158
166
  });
159
167
  N(() => {
160
- !u || !g || Promise.all([g.getApplicationIdPromptVariables(u, {
168
+ !f || !u || Promise.all([u.getApplicationIdPromptVariables(f, {
161
169
  type: y.User,
162
170
  status: 1
163
- }), g.getApplicationIdPromptVariables(u, {
171
+ }), u.getApplicationIdPromptVariables(f, {
164
172
  type: y.System,
165
173
  status: 1
166
- })]).then(([e, a]) => {
167
- const r = [...e, ...a].filter((s) => !(s.type === y.User && s.key === "query") && !(s.type === y.System && s.key === "datetime")).map((s) => ({
168
- id: s.id,
169
- key: s.key,
170
- name: s.name,
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
+ id: r.id,
177
+ key: r.key,
178
+ name: r.name,
171
179
  value: "",
172
- type: s.type
180
+ type: r.type
173
181
  }));
174
- R(r);
182
+ R(s);
175
183
  });
176
- }, [g, u]), N(() => {
184
+ }, [u, f]), N(() => {
177
185
  if (!c)
178
186
  return;
179
- const e = c.filter((r) => r.type === y.User), a = c.filter((r) => r.type === y.System), i = {};
180
- e == null || e.map((r) => {
181
- r.key && (i[r.key] = r.value);
187
+ const e = c.filter((s) => s.type === y.User), o = c.filter((s) => s.type === y.System), d = {};
188
+ e == null || e.map((s) => {
189
+ s.key && (d[s.key] = s.value);
182
190
  });
183
191
  const t = {};
184
- a == null || a.map((r) => {
185
- r.key && (t[r.key] = r.value);
186
- }), E.setFieldsValue({
187
- userPrompts: i,
192
+ o == null || o.map((s) => {
193
+ s.key && (t[s.key] = s.value);
194
+ }), z.setFieldsValue({
195
+ userPrompts: d,
188
196
  systemPrompts: t
189
- }), re(i), se(t);
197
+ }), re(d), ne(t);
190
198
  }, [c]);
191
- const ie = (e, a) => p(void 0, null, function* () {
192
- !$ || !u || !g || (yield g.patchApplicationIdSessionpromptVariablesId(u, $.id, e, {
193
- value: a
199
+ const me = (e, o) => P(void 0, null, function* () {
200
+ !j || !f || !u || (yield u.patchApplicationIdSessionpromptVariablesId(f, j.id, e, {
201
+ value: o
194
202
  }));
195
- }), me = (e) => {
203
+ }), fe = (e) => {
196
204
  q(e.target.value);
197
- }, ue = () => p(void 0, null, function* () {
198
- if (!u || !g || !I)
205
+ }, ge = () => P(void 0, null, function* () {
206
+ if (!f || !u || !I)
199
207
  return;
200
208
  T(!0);
201
209
  for (const t in U)
202
- U[t] || (C.config({
203
- getContainer: () => (P == null ? void 0 : P.current) || document.body
204
- }), C.error("变量值不能为空"), C.config({
205
- getContainer: void 0
210
+ U[t] || (w.config({
211
+ getContainer: () => (x == null ? void 0 : x.current) || document.body,
212
+ prefixCls: "gbot-message"
213
+ }), w.error("变量值不能为空"), w.config({
214
+ getContainer: void 0,
215
+ prefixCls: "gbot-message"
206
216
  }));
207
217
  for (const t in B)
208
- B[t] || (C.config({
209
- getContainer: () => (P == null ? void 0 : P.current) || document.body
210
- }), C.error("变量值不能为空"), C.config({
211
- getContainer: void 0
218
+ B[t] || (w.config({
219
+ getContainer: () => (x == null ? void 0 : x.current) || document.body,
220
+ prefixCls: "gbot-message"
221
+ }), w.error("变量值不能为空"), w.config({
222
+ getContainer: void 0,
223
+ prefixCls: "gbot-message"
212
224
  }));
213
- const e = yield g.postApplicationIdSession({
225
+ const e = yield u.postApplicationIdSession({
214
226
  name: "AI 会话",
215
- applicationId: u
227
+ applicationId: f
216
228
  });
217
- j(e);
218
- const a = A == null ? void 0 : A.map((t) => t.toString());
219
- yield g.getApplicationIdSessionIdPromptVariables(u, e.id).then((t) => p(void 0, null, function* () {
229
+ E(e);
230
+ const o = A == null ? void 0 : A.map((t) => t.toString());
231
+ yield u.getApplicationIdSessionIdPromptVariables(f, e.id).then((t) => P(void 0, null, function* () {
220
232
  if (!c)
221
233
  return;
222
- const r = t.filter((s) => s.key !== "query").map((s) => {
223
- const m = c.filter((k) => k.key === s.key);
224
- return s.value = m[0].value, s;
234
+ const s = t.filter((r) => r.key !== "query").map((r) => {
235
+ const m = c.filter((b) => b.key === r.key);
236
+ return r.value = m[0].value, r;
225
237
  });
226
- yield Promise.all(r.map((s) => ie(s.id, s.value))), R(r);
238
+ yield Promise.all(s.map((r) => me(r.id, r.value))), R(s);
227
239
  })).catch((t) => {
228
240
  console.log(t), T(!1);
229
241
  });
230
- const i = {
242
+ const d = {
231
243
  content: v,
232
244
  chatMode: 1,
233
- knowledges: a,
245
+ knowledges: o,
234
246
  promptVariables: U,
235
247
  systemPromptVariables: B
236
248
  };
237
- le(u, e.id, i, {
249
+ ie(f, e.id, d, {
238
250
  onmessage: (t) => {
239
- b(void 0), x(t.content);
251
+ C(void 0), S(t.content);
240
252
  },
241
- onclose: (t) => p(void 0, null, function* () {
253
+ onclose: (t) => P(void 0, null, function* () {
242
254
  if (T(!1), t.code == 200) {
243
- x(t.content);
244
- const r = yield Promise.all(t.reference.map((s) => g.getKnowledgeIdFileId(s.knowledgeId, s.docId)));
245
- t.reference = t.reference.map((s, m) => V(V({}, s), r[m])), b(t);
255
+ S(t.content);
256
+ const s = yield Promise.all(t.reference.map((r) => u.getKnowledgeIdFileId(r.knowledgeId, r.docId)));
257
+ t.reference = t.reference.map((r, m) => V(V({}, r), s[m])), C(t);
246
258
  }
247
259
  }),
248
260
  onerror: () => {
@@ -251,25 +263,25 @@ const {
251
263
  });
252
264
  });
253
265
  N(() => {
254
- if (!S)
266
+ if (!k)
255
267
  return;
256
- const e = D.current;
268
+ const e = H.current;
257
269
  e && (e.scrollTop = e.scrollHeight);
258
- }, [S]);
259
- const fe = (e) => {
260
- O(e), Y(e.length);
261
- }, z = (e, a) => {
262
- c && (c.map((i) => {
263
- i.id === e && (i.value = a.target.value);
270
+ }, [k]);
271
+ const ue = (e) => {
272
+ Y(e), $(e.length);
273
+ }, J = (e, o) => {
274
+ c && (c.map((d) => {
275
+ d.id === e && (d.value = o.target.value);
264
276
  }), R([...c]));
265
- }, J = (c == null ? void 0 : c.filter((e) => e.type === y.System)) || [], W = (c == null ? void 0 : c.filter((e) => e.type === y.User)) || [];
266
- return /* @__PURE__ */ w("div", {
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
+ return /* @__PURE__ */ p("div", {
267
279
  className: "text-main",
268
- children: [/* @__PURE__ */ w("div", {
280
+ children: [/* @__PURE__ */ p("div", {
269
281
  className: "text-left-sider",
270
- children: [!!(c != null && c.length) && /* @__PURE__ */ o(M, {
282
+ children: [!!(c != null && c.length) && /* @__PURE__ */ a(M, {
271
283
  autoComplete: "off",
272
- form: E,
284
+ form: z,
273
285
  labelWrap: !0,
274
286
  labelAlign: "left",
275
287
  labelCol: {
@@ -278,14 +290,14 @@ const {
278
290
  }
279
291
  },
280
292
  className: "prompt-form",
281
- children: /* @__PURE__ */ w(_, {
293
+ children: /* @__PURE__ */ p(ee, {
282
294
  bordered: !1,
283
295
  ghost: !0,
284
296
  className: "prompt-variables-collapse",
285
297
  defaultActiveKey: [y.System, y.User],
286
- children: [J.length && /* @__PURE__ */ o(Z, {
298
+ children: [W.length && /* @__PURE__ */ a(_, {
287
299
  header: "角色设定变量",
288
- children: J.map((e) => /* @__PURE__ */ o(M.Item, {
300
+ children: W.map((e) => /* @__PURE__ */ a(M.Item, {
289
301
  label: e.name,
290
302
  name: ["systemPrompts", e.key],
291
303
  style: {
@@ -295,15 +307,15 @@ const {
295
307
  required: !0,
296
308
  message: "请输入"
297
309
  }],
298
- children: /* @__PURE__ */ o(K, {
310
+ children: /* @__PURE__ */ a(K, {
299
311
  placeholder: "请输入",
300
312
  maxLength: I == null ? void 0 : I.questionContextMaxLength,
301
- onBlur: (a) => z(e.id, a)
313
+ onBlur: (o) => J(e.id, o)
302
314
  })
303
315
  }, e.key))
304
- }, y.System), W.length && /* @__PURE__ */ o(Z, {
316
+ }, y.System), G.length && /* @__PURE__ */ a(_, {
305
317
  header: "用户指令变量",
306
- children: W.map((e) => /* @__PURE__ */ o(M.Item, {
318
+ children: G.map((e) => /* @__PURE__ */ a(M.Item, {
307
319
  label: e.name,
308
320
  name: ["userPrompts", e.key],
309
321
  style: {
@@ -313,74 +325,74 @@ const {
313
325
  required: !0,
314
326
  message: "请输入"
315
327
  }],
316
- children: /* @__PURE__ */ o(K, {
328
+ children: /* @__PURE__ */ a(K, {
317
329
  placeholder: "请输入",
318
330
  maxLength: I == null ? void 0 : I.questionContextMaxLength,
319
- onBlur: (a) => z(e.id, a)
331
+ onBlur: (o) => J(e.id, o)
320
332
  })
321
333
  }, e.key))
322
334
  }, y.User)]
323
335
  })
324
- }), /* @__PURE__ */ w("div", {
336
+ }), /* @__PURE__ */ p("div", {
325
337
  className: "sider-header",
326
- children: [/* @__PURE__ */ o("span", {
338
+ children: [/* @__PURE__ */ a("span", {
327
339
  className: "header-title",
328
340
  children: "文本生成输入"
329
- }), H.length !== 0 && /* @__PURE__ */ o(Ce, {
341
+ }), O.length !== 0 && /* @__PURE__ */ a(we, {
330
342
  checkedValues: A,
331
- currKnowledgeList: H,
332
- selectCount: te,
333
- onSelectChange: fe,
343
+ currKnowledgeList: O,
344
+ selectCount: se,
345
+ onSelectChange: ue,
334
346
  disabled: !1
335
347
  })]
336
- }), /* @__PURE__ */ o("div", {
348
+ }), /* @__PURE__ */ a("div", {
337
349
  className: "sider-main",
338
- children: /* @__PURE__ */ w("div", {
350
+ children: /* @__PURE__ */ p("div", {
339
351
  className: "sider-text",
340
- children: [/* @__PURE__ */ o(K.TextArea, {
352
+ children: [/* @__PURE__ */ a(K.TextArea, {
341
353
  style: {
342
354
  height: "100%",
343
355
  resize: "none"
344
356
  },
345
357
  placeholder: "请输入你的问题,通过shift+enter换行",
346
- maxLength: ne,
358
+ maxLength: oe,
347
359
  showCount: !0,
348
360
  bordered: !1,
349
- onChange: me,
361
+ onChange: fe,
350
362
  value: v,
351
363
  className: "left-input"
352
- }), /* @__PURE__ */ o(be, {
364
+ }), /* @__PURE__ */ a(Ce, {
353
365
  type: "primary",
354
366
  disabled: !v || L,
355
- onClick: ue,
367
+ onClick: ge,
356
368
  className: "sider-btn",
357
369
  loading: L,
358
370
  children: L ? "生成中" : "确认生成"
359
371
  })]
360
372
  })
361
373
  })]
362
- }), /* @__PURE__ */ o("div", {
374
+ }), /* @__PURE__ */ a("div", {
363
375
  className: "text-right-sider",
364
- children: /* @__PURE__ */ o("div", {
376
+ children: /* @__PURE__ */ a("div", {
365
377
  className: "sider-main",
366
- children: /* @__PURE__ */ o("div", {
378
+ children: /* @__PURE__ */ a("div", {
367
379
  className: "sider-text",
368
- ref: D,
369
- children: S ? /* @__PURE__ */ w(ve, {
370
- children: [/* @__PURE__ */ o(Ve, {
371
- children: S
372
- }), f && (f == null ? void 0 : f.reference.length) !== 0 && /* @__PURE__ */ o("div", {
380
+ ref: H,
381
+ children: k ? /* @__PURE__ */ p(ve, {
382
+ children: [/* @__PURE__ */ a(Ve, {
383
+ children: k
384
+ }), g && (g == null ? void 0 : g.reference.length) !== 0 && /* @__PURE__ */ a("div", {
373
385
  style: {
374
386
  marginTop: 16
375
387
  },
376
- children: /* @__PURE__ */ o(Ne, {
377
- history: f,
388
+ children: /* @__PURE__ */ a(Ne, {
389
+ history: g,
378
390
  docViewerUrl: l
379
391
  })
380
392
  })]
381
- }) : /* @__PURE__ */ o("div", {
393
+ }) : /* @__PURE__ */ a("div", {
382
394
  className: "text-pannel",
383
- children: /* @__PURE__ */ o("span", {
395
+ children: /* @__PURE__ */ a("span", {
384
396
  children: "请在左侧输入需要 AI 生成的内容"
385
397
  })
386
398
  })
@@ -1,4 +1,4 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as s } from "react/jsx-runtime";
2
2
  import { useState as h, useContext as v, useEffect as y } from "react";
3
3
  /* empty css */import { Space as N, message as a, Typography as p } from "antd";
4
4
  import r from "classnames";
@@ -11,47 +11,49 @@ const j = (f) => {
11
11
  item: e,
12
12
  isRecommendClearing: g,
13
13
  isOnlyQuestion: i,
14
- question: o,
15
- setQuestion: c,
16
- onItemClick: s
17
- } = f, [n, m] = h(!1), {
14
+ question: t,
15
+ setQuestion: m,
16
+ onItemClick: o
17
+ } = f, [n, c] = h(!1), {
18
18
  popupContainer: l
19
19
  } = v(x);
20
20
  return y(() => {
21
- e && (!e.icon && !e.file.url && !e.name ? m(!0) : m(!1));
21
+ e && (!e.icon && !e.file.url && !e.name ? c(!0) : c(!1));
22
22
  }, [e]), /* @__PURE__ */ d(N, {
23
23
  direction: "vertical",
24
24
  size: i || !i && n ? 0 : 4,
25
25
  className: r({
26
26
  "question-pannel": !0,
27
- "question-pannel__active": (o == null ? void 0 : o.id) === e.id,
27
+ "question-pannel__active": (t == null ? void 0 : t.id) === e.id,
28
28
  "multiline-question-pannel": !i && n
29
29
  }),
30
30
  onClick: () => {
31
31
  if (g) {
32
32
  a.config({
33
- getContainer: () => (l == null ? void 0 : l.current) || document.body
33
+ getContainer: () => (l == null ? void 0 : l.current) || document.body,
34
+ prefixCls: "gbot-message"
34
35
  }), a.error("请稍后"), a.config({
35
- getContainer: void 0
36
+ getContainer: void 0,
37
+ prefixCls: "gbot-message"
36
38
  });
37
39
  return;
38
40
  }
39
- (o == null ? void 0 : o.id) === e.id ? (c(void 0), s == null || s(void 0)) : (c(e), s == null || s(e));
41
+ (t == null ? void 0 : t.id) === e.id ? (m(void 0), o == null || o(void 0)) : (m(e), o == null || o(e));
40
42
  },
41
43
  children: [/* @__PURE__ */ d("div", {
42
44
  className: r({
43
45
  "question-top": !0,
44
46
  "not-have-top": i || !i && n
45
47
  }),
46
- children: [!!(e != null && e.icon) && /* @__PURE__ */ t("div", {
48
+ children: [!!(e != null && e.icon) && /* @__PURE__ */ s("div", {
47
49
  className: "question-top-tip",
48
- children: /* @__PURE__ */ t("img", {
50
+ children: /* @__PURE__ */ s("img", {
49
51
  src: e.icon,
50
52
  alt: ""
51
53
  })
52
- }), /* @__PURE__ */ t("div", {
54
+ }), /* @__PURE__ */ s("div", {
53
55
  className: "question-top-title",
54
- children: /* @__PURE__ */ t(p.Paragraph, {
56
+ children: /* @__PURE__ */ s(p.Paragraph, {
55
57
  style: {
56
58
  margin: 0,
57
59
  width: "100%"
@@ -62,22 +64,22 @@ const j = (f) => {
62
64
  },
63
65
  children: e.name
64
66
  })
65
- }), /* @__PURE__ */ t("div", {
67
+ }), /* @__PURE__ */ s("div", {
66
68
  className: r({
67
69
  "question-top-type": !0,
68
70
  "question-only-plus-file": !i && !e.icon && !e.name
69
71
  }),
70
- children: !!((u = e.file) != null && u.url) && /* @__PURE__ */ t("img", {
72
+ children: !!((u = e.file) != null && u.url) && /* @__PURE__ */ s("img", {
71
73
  className: "file-icon",
72
74
  src: C[q(e.file.url) || ""]
73
75
  })
74
76
  })]
75
- }), /* @__PURE__ */ t("div", {
77
+ }), /* @__PURE__ */ s("div", {
76
78
  className: r({
77
79
  "question-bottom": !0,
78
80
  "multiline-question": !i && n
79
81
  }),
80
- children: /* @__PURE__ */ t(p.Paragraph, {
82
+ children: /* @__PURE__ */ s(p.Paragraph, {
81
83
  style: {
82
84
  margin: 0,
83
85
  width: "100%"