@glodon-aiot/agent-cli-ui 3.2.10-beta.12 → 3.2.10-beta.2

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 (45) hide show
  1. package/dist/es/Dialog/AgentChat/index.mjs +418 -478
  2. package/dist/es/Dialog/HistoryItem/index.mjs +50 -52
  3. package/dist/es/Dialog/KnowledgeList/index.mjs +19 -19
  4. package/dist/es/Dialog/Recommend/RecommendItem.mjs +43 -52
  5. package/dist/es/Dialog/SearchReference/index.mjs +41 -68
  6. package/dist/es/Dialog/SessionAction/index.mjs +32 -34
  7. package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +69 -74
  8. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +164 -198
  9. package/dist/es/Dialog/index.mjs +56 -56
  10. package/dist/es/FileItem/index.mjs +50 -63
  11. package/dist/es/Iconfont/index.mjs +2 -2
  12. package/dist/es/constant.mjs +2 -8
  13. package/dist/es/index.mjs +48 -49
  14. package/dist/es/src/style11.css +1 -1
  15. package/dist/es/src/style12.css +1 -1
  16. package/dist/es/src/style13.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/style19.css +1 -1
  22. package/dist/es/src/style20.css +1 -1
  23. package/dist/es/src/style21.css +1 -0
  24. package/dist/es/src/style22.css +1 -1
  25. package/dist/es/src/style23.css +0 -1
  26. package/dist/es/src/style24.css +1 -1
  27. package/dist/es/src/style25.css +1 -1
  28. package/dist/es/src/style26.css +1 -1
  29. package/dist/es/src/style27.css +1 -1
  30. package/dist/es/src/style28.css +1 -1
  31. package/dist/es/src/style3.css +1 -1
  32. package/dist/es/src/style30.css +1 -1
  33. package/dist/es/src/style31.css +1 -1
  34. package/dist/es/src/style32.css +1 -1
  35. package/dist/es/src/style4.css +1 -1
  36. package/dist/es/src/style5.css +1 -1
  37. package/dist/es/src/style6.css +1 -1
  38. package/dist/es/src/style8.css +1 -1
  39. package/dist/es/src/style9.css +1 -1
  40. package/dist/lib/index.css +1 -1
  41. package/dist/lib/index.js +5 -5
  42. package/dist/src/Dialog/SearchReference/index.d.ts +1 -4
  43. package/dist/src/types.d.ts +1 -10
  44. package/package.json +3 -3
  45. package/dist/src/Iconfont/font_4108228_z72fskklg2.d.ts +0 -0
@@ -3,15 +3,15 @@ import { memo as d, useContext as re, useState as ae } from "react";
3
3
  import c from "../../InputProgress/index.mjs";
4
4
  import oe from "../SessionRefer/index.mjs";
5
5
  import de from "../SessionAction/index.mjs";
6
- import { IHistoryRole as q, IThinkingStatus as D } from "@glodon-aiot/apis";
6
+ import { IHistoryRole as H, IThinkingStatus as q } from "@glodon-aiot/apis";
7
7
  import ce from "../../FileItem/index.mjs";
8
- import { Popover as pe, Space as V, Button as W, Row as me, Col as ue, Collapse as G, Divider as he, message as y } from "antd";
8
+ import { Popover as pe, Space as D, Button as V, Row as me, Col as ue, Collapse as W, Divider as he, message as G } from "antd";
9
9
  import ge from "../SearchReference/index.mjs";
10
10
  /* empty css */import Ne from "../HistoryContent/index.mjs";
11
11
  import fe from "../../components/Markdown/index.mjs";
12
- import Ce from "classnames";
12
+ import ye from "classnames";
13
13
  import p from "../../Iconfont/index.mjs";
14
- import { CheckOutlined as K, CloseOutlined as X, LoadingOutlined as ye } from "@ant-design/icons";
14
+ import { CheckOutlined as K, CloseOutlined as X, LoadingOutlined as Ce } from "@ant-design/icons";
15
15
  import m from "../../components/JsonDisplay/index.mjs";
16
16
  import Le from "../../context.mjs";
17
17
  import ve from "../SessionRelated/index.mjs";
@@ -27,7 +27,7 @@ const ke = (o) => {
27
27
  } catch (l) {
28
28
  return o;
29
29
  }
30
- }, Te = d(ge), Y = d(oe), L = d(fe);
30
+ }, Te = d(ge), Y = d(oe), C = d(fe);
31
31
  d(Ne);
32
32
  const Ae = d(ce);
33
33
  d(Re);
@@ -45,7 +45,7 @@ const u = (o) => {
45
45
  const l = JSON.parse(JSON.stringify(o)) || [], a = (n = l == null ? void 0 : l.pop()) == null ? void 0 : n.pop();
46
46
  return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
47
47
  }, Ze = (o) => {
48
- var b, E, k, T, A, O, x, F, _, I;
48
+ var S, b, E, k, T, A, O, x, F, _;
49
49
  const {
50
50
  application: l,
51
51
  currentSession: a,
@@ -58,25 +58,23 @@ const u = (o) => {
58
58
  onEditClick: N,
59
59
  actions: ne = !0
60
60
  } = o, {
61
- debug: v,
61
+ debug: L,
62
62
  transform: i,
63
63
  popupContainer: f
64
- } = re(Le), R = n.role === q.User, S = n.role === q.Robot, {
64
+ } = re(Le), v = n.role === H.User, R = n.role === H.Robot, {
65
65
  Panel: te
66
- } = G, [C, ie] = ae(!0), le = () => {
67
- y.config({
66
+ } = W, [y, ie] = ae(!0), le = () => {
67
+ G.config({
68
68
  getContainer: () => (f == null ? void 0 : f.current) || document.body
69
- }), Se(n.content), y.success("复制成功"), y.config({
70
- getContainer: void 0
71
- });
69
+ }), Se(n.content), G.success("复制成功");
72
70
  };
73
71
  return /* @__PURE__ */ r("div", {
74
- className: Ce({
72
+ className: ye({
75
73
  "history-item": !0,
76
- "history-item__user": R,
77
- "history-item__bot": S
74
+ "history-item__user": v,
75
+ "history-item__bot": R
78
76
  }),
79
- children: [R && /* @__PURE__ */ r("div", {
77
+ children: [v && /* @__PURE__ */ r("div", {
80
78
  className: "history-item-user",
81
79
  children: [/* @__PURE__ */ e("div", {
82
80
  className: "item-user-panel",
@@ -87,13 +85,13 @@ const u = (o) => {
87
85
  },
88
86
  overlayClassName: "session-item-overlay-popover",
89
87
  getPopupContainer: (t) => t.parentNode,
90
- content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ r(V, {
88
+ content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ r(D, {
91
89
  className: "item-user-popover",
92
90
  size: 4,
93
91
  children: [(i == null ? void 0 : i.userEdit) && /* @__PURE__ */ e("div", {
94
92
  className: "user-pannel-item",
95
93
  onClick: () => N == null ? void 0 : N(n.content),
96
- children: /* @__PURE__ */ e(W, {
94
+ children: /* @__PURE__ */ e(V, {
97
95
  type: "link",
98
96
  size: "small",
99
97
  icon: /* @__PURE__ */ e(p, {
@@ -103,7 +101,7 @@ const u = (o) => {
103
101
  }), (i == null ? void 0 : i.userCopy) && /* @__PURE__ */ e("div", {
104
102
  className: "user-pannel-item",
105
103
  onClick: le,
106
- children: /* @__PURE__ */ e(W, {
104
+ children: /* @__PURE__ */ e(V, {
107
105
  type: "link",
108
106
  size: "small",
109
107
  icon: /* @__PURE__ */ e(p, {
@@ -119,7 +117,7 @@ const u = (o) => {
119
117
  className: "user-panel-main",
120
118
  children: /* @__PURE__ */ e("span", {
121
119
  className: "item-user-content",
122
- children: /* @__PURE__ */ e(L, {
120
+ children: /* @__PURE__ */ e(C, {
123
121
  showLatex: !1,
124
122
  children: Ee(n.content)
125
123
  })
@@ -132,7 +130,7 @@ const u = (o) => {
132
130
  gutter: [12, 12],
133
131
  justify: "end",
134
132
  wrap: !0,
135
- children: (b = n.files) == null ? void 0 : b.map((t) => /* @__PURE__ */ e(ue, {
133
+ children: (S = n.files) == null ? void 0 : S.map((t) => /* @__PURE__ */ e(ue, {
136
134
  className: "user-file-col",
137
135
  children: /* @__PURE__ */ e(Ae, {
138
136
  docViewerUrl: g,
@@ -142,53 +140,53 @@ const u = (o) => {
142
140
  }, t.id))
143
141
  })
144
142
  })]
145
- }), S && /* @__PURE__ */ e("div", {
143
+ }), R && /* @__PURE__ */ e("div", {
146
144
  className: "history-item-bot",
147
145
  children: /* @__PURE__ */ r("div", {
148
146
  className: "bot-content-wrapper",
149
147
  children: [l.type === 2 && /* @__PURE__ */ r("div", {
150
148
  className: "item-bot-plugin",
151
- children: [/* @__PURE__ */ e(G, {
149
+ children: [/* @__PURE__ */ e(W, {
152
150
  ghost: !0,
153
151
  expandIconPosition: "right",
154
- children: (E = n.actions) == null ? void 0 : E.map((t, se) => {
155
- var U, z, j, B, w, M, J, P, Q, H;
152
+ children: (b = n.actions) == null ? void 0 : b.map((t, se) => {
153
+ var I, U, z, j, B, w, M, J, P, Q;
156
154
  return /* @__PURE__ */ r(te, {
157
- collapsible: v ? "header" : "icon",
158
- showArrow: v,
159
- header: /* @__PURE__ */ r(V, {
155
+ collapsible: L ? "header" : "icon",
156
+ showArrow: L,
157
+ header: /* @__PURE__ */ r(D, {
160
158
  size: 8,
161
159
  style: {
162
160
  width: "100%"
163
161
  },
164
162
  children: [/* @__PURE__ */ r("span", {
165
163
  className: "bot-plugin-status",
166
- children: [(t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((U = t.find((s) => s.type === "RESULT")) == null ? void 0 : U.data.result) && /* @__PURE__ */ e("span", {
164
+ children: [(t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((I = t.find((s) => s.type === "RESULT")) == null ? void 0 : I.data.result) && /* @__PURE__ */ e("span", {
167
165
  className: "plugin-status-success",
168
166
  children: /* @__PURE__ */ e(K, {})
169
167
  }), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
170
168
  className: "plugin-status-error",
171
169
  children: /* @__PURE__ */ e(X, {})
172
- }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((z = t.find((s) => s.type === "RESULT")) == null ? void 0 : z.data.result) && /* @__PURE__ */ e("span", {
170
+ }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((U = t.find((s) => s.type === "RESULT")) == null ? void 0 : U.data.result) && /* @__PURE__ */ e("span", {
173
171
  className: "plugin-status-error",
174
172
  children: /* @__PURE__ */ e(X, {})
175
173
  }), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
176
174
  className: "plugin-status-loading",
177
- children: /* @__PURE__ */ e(ye, {})
175
+ children: /* @__PURE__ */ e(Ce, {})
178
176
  })]
179
177
  }), /* @__PURE__ */ e("span", {
180
178
  className: "bot-plugin-title",
181
- children: (j = t[t.length - 1].data) == null ? void 0 : j.pluginName
179
+ children: (z = t[t.length - 1].data) == null ? void 0 : z.pluginName
182
180
  }), /* @__PURE__ */ e("span", {
183
181
  className: "bot-plugin-action",
184
- children: (B = t[t.length - 1].data) == null ? void 0 : B.funcName
182
+ children: (j = t[t.length - 1].data) == null ? void 0 : j.funcName
185
183
  }), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
186
184
  className: "bot-plugin-result",
187
185
  children: "执行中"
188
- }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((w = t.find((s) => s.type === "RESULT")) == null ? void 0 : w.data.result) && /* @__PURE__ */ e("span", {
186
+ }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && u((B = t.find((s) => s.type === "RESULT")) == null ? void 0 : B.data.result) && /* @__PURE__ */ e("span", {
189
187
  className: "bot-plugin-result",
190
188
  children: "执行成功"
191
- }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((M = t.find((s) => s.type === "RESULT")) == null ? void 0 : M.data.result) && /* @__PURE__ */ e("span", {
189
+ }), (t[t.length - 1].type === "RESULT" || t[t.length - 1].type === "AFTER_CALL") && !u((w = t.find((s) => s.type === "RESULT")) == null ? void 0 : w.data.result) && /* @__PURE__ */ e("span", {
192
190
  className: "bot-plugin-result",
193
191
  children: "执行失败"
194
192
  }), t[t.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
@@ -202,7 +200,7 @@ const u = (o) => {
202
200
  }), /* @__PURE__ */ e("div", {
203
201
  className: "bot-plugin-json",
204
202
  children: /* @__PURE__ */ e(m, {
205
- josn: (J = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : J.data.thought
203
+ josn: (M = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : M.data.thought
206
204
  })
207
205
  }), /* @__PURE__ */ e("div", {
208
206
  className: "bot-plugin-content",
@@ -210,7 +208,7 @@ const u = (o) => {
210
208
  }), /* @__PURE__ */ e("div", {
211
209
  className: "bot-plugin-json",
212
210
  children: /* @__PURE__ */ e(m, {
213
- josn: (P = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : P.data.parameters
211
+ josn: (J = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : J.data.parameters
214
212
  })
215
213
  }), /* @__PURE__ */ e("div", {
216
214
  className: "bot-plugin-content",
@@ -218,7 +216,7 @@ const u = (o) => {
218
216
  }), /* @__PURE__ */ e("div", {
219
217
  className: "bot-plugin-json",
220
218
  children: /* @__PURE__ */ e(m, {
221
- josn: (Q = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : Q.data.requestBody
219
+ josn: (P = t.find((s) => s.type === "BEFORE_CALL")) == null ? void 0 : P.data.requestBody
222
220
  })
223
221
  }), /* @__PURE__ */ e("div", {
224
222
  className: "bot-plugin-content",
@@ -226,7 +224,7 @@ const u = (o) => {
226
224
  }), /* @__PURE__ */ e("div", {
227
225
  className: "bot-plugin-json",
228
226
  children: /* @__PURE__ */ e(m, {
229
- josn: ke((H = t.find((s) => s.type === "RESULT")) == null ? void 0 : H.data.result)
227
+ josn: ke((Q = t.find((s) => s.type === "RESULT")) == null ? void 0 : Q.data.result)
230
228
  })
231
229
  })]
232
230
  }, se);
@@ -241,12 +239,12 @@ const u = (o) => {
241
239
  text: "思考中"
242
240
  })
243
241
  })]
244
- }), !!((k = n.searchReference) != null && k.length) && /* @__PURE__ */ e("div", {
242
+ }), !!((E = n.searchReference) != null && E.length) && /* @__PURE__ */ e("div", {
245
243
  className: "item-bot-net",
246
244
  children: /* @__PURE__ */ e(Te, {
247
245
  history: n
248
246
  })
249
- }), (T = n == null ? void 0 : n.reference) != null && T.length && ((A = i == null ? void 0 : i.reference) != null && A.referenceFirst) ? /* @__PURE__ */ e(Y, {
247
+ }), (k = n == null ? void 0 : n.reference) != null && k.length && ((T = i == null ? void 0 : i.reference) != null && T.referenceFirst) ? /* @__PURE__ */ e(Y, {
250
248
  history: n,
251
249
  docViewerUrl: g
252
250
  }) : null, /* @__PURE__ */ r("div", {
@@ -256,7 +254,7 @@ const u = (o) => {
256
254
  children: [(n == null ? void 0 : n.reasoningContent) && /* @__PURE__ */ r("div", {
257
255
  className: "think-top",
258
256
  onClick: () => {
259
- ie(!C);
257
+ ie(!y);
260
258
  },
261
259
  children: [/* @__PURE__ */ e("img", {
262
260
  src: be,
@@ -267,7 +265,7 @@ const u = (o) => {
267
265
  children: ["已完成推理(用时 ", (n == null ? void 0 : n.thinkingSecs) || 0, " 秒)"]
268
266
  }), /* @__PURE__ */ e("span", {
269
267
  className: "think-action",
270
- children: C ? /* @__PURE__ */ e(p, {
268
+ children: y ? /* @__PURE__ */ e(p, {
271
269
  type: "icon-zhankai",
272
270
  style: {
273
271
  fontSize: 16
@@ -279,27 +277,27 @@ const u = (o) => {
279
277
  }
280
278
  })
281
279
  })]
282
- }), !!((O = n == null ? void 0 : n.reasoningContent) != null && O.trim()) && C && /* @__PURE__ */ r("div", {
280
+ }), !!((A = n == null ? void 0 : n.reasoningContent) != null && A.trim()) && y && /* @__PURE__ */ r("div", {
283
281
  className: "think-bottom",
284
282
  children: [/* @__PURE__ */ r("div", {
285
283
  className: "bottom-left",
286
- children: [(n == null ? void 0 : n.thinkingStatus) === D.Start && /* @__PURE__ */ e("div", {
284
+ children: [(n == null ? void 0 : n.thinkingStatus) === q.Start && /* @__PURE__ */ e("div", {
287
285
  className: "thinking"
288
- }), (n == null ? void 0 : n.thinkingStatus) === D.End && /* @__PURE__ */ e("div", {
286
+ }), (n == null ? void 0 : n.thinkingStatus) === q.End && /* @__PURE__ */ e("div", {
289
287
  className: "thinked",
290
288
  children: /* @__PURE__ */ e(K, {})
291
289
  })]
292
290
  }), /* @__PURE__ */ e("div", {
293
291
  className: "bottom-right",
294
- children: /* @__PURE__ */ e(L, {
292
+ children: /* @__PURE__ */ e(C, {
295
293
  children: (n == null ? void 0 : n.reasoningContent) || ""
296
294
  })
297
295
  })]
298
296
  })]
299
- }), /* @__PURE__ */ e(L, {
297
+ }), /* @__PURE__ */ e(C, {
300
298
  children: n.content
301
299
  })]
302
- }), (x = n == null ? void 0 : n.reference) != null && x.length && !((F = i == null ? void 0 : i.reference) != null && F.referenceFirst) ? /* @__PURE__ */ e(Y, {
300
+ }), (O = n == null ? void 0 : n.reference) != null && O.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(Y, {
303
301
  history: n,
304
302
  docViewerUrl: g
305
303
  }) : null, n.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
@@ -318,13 +316,13 @@ const u = (o) => {
318
316
  size: 4,
319
317
  text: "思考中"
320
318
  })
321
- }), l.arrange[0].recommendQuestionOpen && (i == null ? void 0 : i.relate) && h && !!((_ = n.relatedQuesion) != null && _.length) && /* @__PURE__ */ e(ve, {
319
+ }), l.arrange[0].recommendQuestionOpen && (i == null ? void 0 : i.relate) && h && !!((F = n.relatedQuesion) != null && F.length) && /* @__PURE__ */ e(ve, {
322
320
  relatedQuesion: n.relatedQuesion,
323
321
  onRelatedClick: $
324
322
  }), ne && !n.isSensitive && !!n.messageId && /* @__PURE__ */ e(de, {
325
323
  appId: l.id,
326
324
  history: n,
327
- sessionId: (I = a == null ? void 0 : a.data) == null ? void 0 : I.id,
325
+ sessionId: (_ = a == null ? void 0 : a.data) == null ? void 0 : _.id,
328
326
  onAgainClick: ee,
329
327
  isLastHistory: h,
330
328
  currentSession: a
@@ -1,46 +1,46 @@
1
1
  import { jsxs as x, jsx as A } from "react/jsx-runtime";
2
- import { useContext as H, useState as i, useEffect as v } from "react";
2
+ import { useContext as H, useState as i, useEffect as y } from "react";
3
3
  /* empty css */import K from "../../context.mjs";
4
4
  import { Space as q } from "antd";
5
5
  import z from "./KnowledgeSelect/index.mjs";
6
- const P = (y) => {
6
+ const P = (v) => {
7
7
  var j, u;
8
8
  const {
9
9
  currentSession: t,
10
- application: o,
10
+ application: n,
11
11
  setCurrentSession: B,
12
12
  reload: D,
13
13
  setCheckKnowledges: g
14
- } = y, {
14
+ } = v, {
15
15
  mode: C,
16
16
  transform: w,
17
- features: n
18
- } = H(K), [d, k] = i([]), [r, p] = i(typeof (n == null ? void 0 : n.knowledges) == "object" ? ((j = n.knowledges.default) == null ? void 0 : j.map((e) => e.id)) || [] : []), [E, c] = i(0), [h, b] = i(!1);
19
- v(() => {
20
- if (!(o != null && o.id))
17
+ features: o
18
+ } = H(K), [d, k] = i([]), [r, c] = i(typeof (o == null ? void 0 : o.knowledges) == "object" ? ((j = o.knowledges.default) == null ? void 0 : j.map((e) => e.id)) || [] : []), [E, p] = i(0), [h, b] = i(!1);
19
+ y(() => {
20
+ if (!(n != null && n.id))
21
21
  return;
22
- const e = o.arrange;
22
+ const e = n.arrange;
23
23
  if (!(e != null && e.length))
24
24
  return;
25
25
  const s = e[0].knowledges || [];
26
26
  k(s);
27
- const l = typeof (n == null ? void 0 : n.knowledges) == "object" && n.knowledges.default || s;
27
+ const l = typeof (o == null ? void 0 : o.knowledges) == "object" && o.knowledges.default || s;
28
28
  if (!t) {
29
- p(l.map((f) => f.id)), c(l.length), g == null || g(l);
29
+ c(l.map((f) => f.id)), p(l.length), g == null || g(l);
30
30
  return;
31
31
  }
32
32
  const a = () => {
33
33
  const f = t.knowledges || l;
34
- c(f.length);
34
+ p(f.length);
35
35
  const F = f.map((N) => N.id);
36
- p(F);
36
+ c(F);
37
37
  };
38
38
  return a(), t.addEventListener("data:updated", a), () => {
39
39
  t == null || t.removeEventListener("data:updated", a);
40
40
  };
41
- }, [o, t]), v(() => {
41
+ }, [n, t]), y(() => {
42
42
  var m;
43
- if (!h || (b(!1), !(o != null && o.id)))
43
+ if (!h || (b(!1), !(n != null && n.id)))
44
44
  return;
45
45
  const e = [];
46
46
  r == null || r.map((s) => {
@@ -49,20 +49,20 @@ const P = (y) => {
49
49
  }), (m = t == null ? void 0 : t.data) != null && m.id && t.setKnowledges(e);
50
50
  }, [h]);
51
51
  const S = (e) => {
52
- b(!0), p(e);
52
+ b(!0), c(e);
53
53
  const m = [];
54
54
  e == null || e.map((s) => {
55
55
  const l = d == null ? void 0 : d.find((a) => a.id === s);
56
56
  m.push(l);
57
- }), g == null || g(m), c(e.length);
57
+ }), g == null || g(m), p(e.length);
58
58
  };
59
59
  return /* @__PURE__ */ x("div", {
60
60
  className: "chat-header",
61
61
  children: [/* @__PURE__ */ x(q, {
62
62
  className: "header-title",
63
- children: [C === "inlay" && ((u = t == null ? void 0 : t.data) == null ? void 0 : u.name), C === "float" && (o == null ? void 0 : o.name)]
63
+ children: [C === "inlay" && ((u = t == null ? void 0 : t.data) == null ? void 0 : u.name), C === "float" && (n == null ? void 0 : n.name)]
64
64
  }), (w == null ? void 0 : w.knowledges) && d.length !== 0 && /* @__PURE__ */ A(z, {
65
- disabled: typeof (n == null ? void 0 : n.knowledges) == "object" && (n == null ? void 0 : n.knowledges.diabled) || !1,
65
+ disabled: (n == null ? void 0 : n.type) === 2 || typeof (o == null ? void 0 : o.knowledges) == "object" && (o == null ? void 0 : o.knowledges.diabled) || !1,
66
66
  checkedValues: r,
67
67
  currKnowledgeList: d,
68
68
  selectCount: E,
@@ -1,63 +1,54 @@
1
- import { jsxs as u, jsx as i } from "react/jsx-runtime";
2
- import { useState as h, useContext as v, useEffect as y } from "react";
3
- /* empty css */import { Space as N, message as a, Typography as p } from "antd";
4
- import q from "../FileCard/doc-icons/pdf.svg.mjs";
5
- import x from "../FileCard/doc-icons/doc.svg.mjs";
6
- import w from "../FileCard/doc-icons/docx.svg.mjs";
1
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as h } from "react";
3
+ /* empty css */import { Space as v, message as g, Typography as p } from "antd";
4
+ import y from "../FileCard/doc-icons/pdf.svg.mjs";
5
+ import N from "../FileCard/doc-icons/doc.svg.mjs";
6
+ import q from "../FileCard/doc-icons/docx.svg.mjs";
7
7
  import r from "classnames";
8
- import { getFileExtension as C } from "../../utils/index.mjs";
9
- import I from "../../context.mjs";
10
- const P = {
11
- doc: x,
12
- docx: w,
13
- pdf: q
14
- }, T = (f) => {
15
- var d;
8
+ import { getFileExtension as x } from "../../utils/index.mjs";
9
+ const w = {
10
+ doc: N,
11
+ docx: q,
12
+ pdf: y
13
+ }, z = (d) => {
14
+ var c;
16
15
  const {
17
16
  item: e,
18
- isRecommendClearing: g,
19
- isOnlyQuestion: o,
20
- question: t,
21
- setQuestion: c,
22
- onItemClick: n
23
- } = f, [s, m] = h(!1), {
24
- popupContainer: l
25
- } = v(I);
26
- return y(() => {
27
- e && (!e.icon && !e.file.url && !e.name ? m(!0) : m(!1));
28
- }, [e]), /* @__PURE__ */ u(N, {
17
+ isRecommendClearing: u,
18
+ isOnlyQuestion: i,
19
+ question: s,
20
+ setQuestion: l,
21
+ onItemClick: t
22
+ } = d, [n, a] = f(!1);
23
+ return h(() => {
24
+ e && (!e.icon && !e.file.url && !e.name ? a(!0) : a(!1));
25
+ }, [e]), /* @__PURE__ */ m(v, {
29
26
  direction: "vertical",
30
- size: o || !o && s ? 0 : 4,
27
+ size: i || !i && n ? 0 : 4,
31
28
  className: r({
32
29
  "question-pannel": !0,
33
- "question-pannel__active": (t == null ? void 0 : t.id) === e.id,
34
- "multiline-question-pannel": !o && s
30
+ "question-pannel__active": (s == null ? void 0 : s.id) === e.id,
31
+ "multiline-question-pannel": !i && n
35
32
  }),
36
33
  onClick: () => {
37
- if (g) {
38
- a.config({
39
- getContainer: () => (l == null ? void 0 : l.current) || document.body
40
- }), a.error("请稍后"), a.config({
41
- getContainer: void 0
42
- });
43
- return;
44
- }
45
- (t == null ? void 0 : t.id) === e.id ? (c(void 0), n == null || n(void 0)) : (c(e), n == null || n(e));
34
+ if (u)
35
+ return g.error("请稍后");
36
+ (s == null ? void 0 : s.id) === e.id ? (l(void 0), t == null || t(void 0)) : (l(e), t == null || t(e));
46
37
  },
47
- children: [/* @__PURE__ */ u("div", {
38
+ children: [/* @__PURE__ */ m("div", {
48
39
  className: r({
49
40
  "question-top": !0,
50
- "not-have-top": o || !o && s
41
+ "not-have-top": i || !i && n
51
42
  }),
52
- children: [!!(e != null && e.icon) && /* @__PURE__ */ i("div", {
43
+ children: [!!(e != null && e.icon) && /* @__PURE__ */ o("div", {
53
44
  className: "question-top-tip",
54
- children: /* @__PURE__ */ i("img", {
45
+ children: /* @__PURE__ */ o("img", {
55
46
  src: e.icon,
56
47
  alt: ""
57
48
  })
58
- }), /* @__PURE__ */ i("div", {
49
+ }), /* @__PURE__ */ o("div", {
59
50
  className: "question-top-title",
60
- children: /* @__PURE__ */ i(p.Paragraph, {
51
+ children: /* @__PURE__ */ o(p.Paragraph, {
61
52
  style: {
62
53
  margin: 0,
63
54
  width: "100%"
@@ -68,28 +59,28 @@ const P = {
68
59
  },
69
60
  children: e.name
70
61
  })
71
- }), /* @__PURE__ */ i("div", {
62
+ }), /* @__PURE__ */ o("div", {
72
63
  className: r({
73
64
  "question-top-type": !0,
74
- "question-only-plus-file": !o && !e.icon && !e.name
65
+ "question-only-plus-file": !i && !e.icon && !e.name
75
66
  }),
76
- children: !!((d = e.file) != null && d.url) && /* @__PURE__ */ i("img", {
67
+ children: !!((c = e.file) != null && c.url) && /* @__PURE__ */ o("img", {
77
68
  className: "file-icon",
78
- src: P[C(e.file.url) || ""]
69
+ src: w[x(e.file.url) || ""]
79
70
  })
80
71
  })]
81
- }), /* @__PURE__ */ i("div", {
72
+ }), /* @__PURE__ */ o("div", {
82
73
  className: r({
83
74
  "question-bottom": !0,
84
- "multiline-question": !o && s
75
+ "multiline-question": !i && n
85
76
  }),
86
- children: /* @__PURE__ */ i(p.Paragraph, {
77
+ children: /* @__PURE__ */ o(p.Paragraph, {
87
78
  style: {
88
79
  margin: 0,
89
80
  width: "100%"
90
81
  },
91
82
  ellipsis: {
92
- rows: !o && s ? 3 : 1,
83
+ rows: !i && n ? 3 : 1,
93
84
  tooltip: {
94
85
  overlayClassName: "recommend-tooltip-overlay"
95
86
  }
@@ -100,5 +91,5 @@ const P = {
100
91
  });
101
92
  };
102
93
  export {
103
- T as default
94
+ z as default
104
95
  };