@glodon-aiot/agent-cli-ui 3.4.2 → 3.4.3

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/HistoryItem/FileItem/index.mjs +52 -48
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +26 -23
  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 +183 -159
  7. package/dist/es/QuillEditor/index.mjs +72 -65
  8. package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +129 -125
  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/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/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/style27.css +1 -1
  29. package/dist/es/src/style28.css +1 -1
  30. package/dist/es/src/style3.css +1 -1
  31. package/dist/es/src/style30.css +1 -1
  32. package/dist/es/src/style31.css +1 -1
  33. package/dist/es/src/style33.css +1 -1
  34. package/dist/es/src/style4.css +1 -1
  35. package/dist/es/src/style5.css +1 -1
  36. package/dist/es/src/style6.css +1 -1
  37. package/dist/es/src/style7.css +1 -1
  38. package/dist/es/src/style8.css +1 -1
  39. package/dist/es/src/style9.css +1 -1
  40. package/dist/es/utils/antdConfig.mjs +15 -0
  41. package/dist/lib/index.css +1 -1
  42. package/dist/lib/index.js +56 -56
  43. package/dist/src/utils/antdConfig.d.ts +7 -0
  44. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  45. package/package.json +3 -3
@@ -1,86 +1,90 @@
1
- import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
- import { useContext as w, useState as p, useEffect as y } from "react";
3
- /* empty css */import { Typography as I, message as c } from "antd";
4
- import { getFileExtension as x, formatFileSize as f, isValidImageUrlWithAnyExtension as E } from "../../../../utils/index.mjs";
5
- import U from "../../../../context.mjs";
6
- import { FILE_ICONS as S } from "../../../../constant.mjs";
7
- const K = (C) => {
1
+ import { jsxs as g, jsx as o } from "react/jsx-runtime";
2
+ import { useContext as b, useState as x, useEffect as v } from "react";
3
+ /* empty css */import { Typography as w, message as m } from "antd";
4
+ import { getFileExtension as C, formatFileSize as y, isValidImageUrlWithAnyExtension as I } from "../../../../utils/index.mjs";
5
+ import E from "../../../../context.mjs";
6
+ import { FILE_ICONS as U } from "../../../../constant.mjs";
7
+ const K = (u) => {
8
8
  const {
9
- currentSession: m,
9
+ currentSession: c,
10
10
  fileId: d,
11
- file: o,
12
- docViewerUrl: F
13
- } = C, {
11
+ file: s,
12
+ docViewerUrl: f
13
+ } = u, {
14
14
  service: l,
15
- popupContainer: i
16
- } = w(U), [n, h] = p(), [t, u] = p("");
17
- y(() => {
18
- var e;
19
- if (o != null && o.id) {
20
- h(o);
21
- const s = x(o == null ? void 0 : o.name) || "";
22
- u(s);
15
+ popupContainer: r
16
+ } = b(E), [e, h] = x(), [t, p] = x("");
17
+ v(() => {
18
+ var n;
19
+ if (s != null && s.id) {
20
+ h(s);
21
+ const i = C(s == null ? void 0 : s.name) || "";
22
+ p(i);
23
23
  } else {
24
- if (!d || !((e = m == null ? void 0 : m.data) != null && e.id))
24
+ if (!d || !((n = c == null ? void 0 : c.data) != null && n.id))
25
25
  return;
26
- l == null || l.getSessionKnowledgeFile(m.data.id, d).then((s) => {
27
- h(s);
28
- const v = x(s == null ? void 0 : s.name) || "";
29
- u(v);
26
+ l == null || l.getSessionKnowledgeFile(c.data.id, d).then((i) => {
27
+ h(i);
28
+ const N = C(i == null ? void 0 : i.name) || "";
29
+ p(N);
30
30
  });
31
31
  }
32
32
  }, []);
33
- const N = (e) => {
34
- if (!(e != null && e.url)) {
35
- c.config({
36
- getContainer: () => (i == null ? void 0 : i.current) || document.body
37
- }), c.error("链接不存在"), c.config({
38
- getContainer: void 0
33
+ const F = (n) => {
34
+ if (!(n != null && n.url)) {
35
+ m.config({
36
+ getContainer: () => (r == null ? void 0 : r.current) || document.body,
37
+ prefixCls: "gbot-message"
38
+ }), m.error("链接不存在"), m.config({
39
+ getContainer: void 0,
40
+ prefixCls: "gbot-message"
39
41
  });
40
42
  return;
41
43
  }
42
- if (!E(e.url)) {
43
- c.config({
44
- getContainer: () => (i == null ? void 0 : i.current) || document.body
45
- }), c.error("链接格式不正确"), c.config({
46
- getContainer: void 0
44
+ if (!I(n.url)) {
45
+ m.config({
46
+ getContainer: () => (r == null ? void 0 : r.current) || document.body,
47
+ prefixCls: "gbot-message"
48
+ }), m.error("链接格式不正确"), m.config({
49
+ getContainer: void 0,
50
+ prefixCls: "gbot-message"
47
51
  });
48
52
  return;
49
53
  }
50
- window.open(`${F}#/doc?url=${encodeURIComponent(e == null ? void 0 : e.url)}`);
54
+ window.open(`${f}#/doc?url=${encodeURIComponent(n == null ? void 0 : n.url)}`);
51
55
  };
52
56
  return /* @__PURE__ */ g("div", {
53
57
  className: "file-item",
54
- onClick: () => N(n),
55
- children: [/* @__PURE__ */ r("div", {
58
+ onClick: () => F(e),
59
+ children: [/* @__PURE__ */ o("div", {
56
60
  className: "item-left",
57
- children: /* @__PURE__ */ r("img", {
61
+ children: /* @__PURE__ */ o("img", {
58
62
  className: "file-icon",
59
- src: S[t]
63
+ src: U[t]
60
64
  })
61
65
  }), /* @__PURE__ */ g("div", {
62
66
  className: "item-main",
63
- children: [/* @__PURE__ */ r("div", {
67
+ children: [/* @__PURE__ */ o("div", {
64
68
  className: "file-name",
65
- children: /* @__PURE__ */ r(I.Paragraph, {
69
+ children: /* @__PURE__ */ o(w.Paragraph, {
66
70
  style: {
67
71
  margin: 0,
68
72
  width: "100%"
69
73
  },
70
74
  ellipsis: {
71
75
  rows: 1,
72
- tooltip: n == null ? void 0 : n.name
76
+ tooltip: e == null ? void 0 : e.name
73
77
  },
74
- children: n == null ? void 0 : n.name
78
+ children: e == null ? void 0 : e.name
75
79
  })
76
80
  }), /* @__PURE__ */ g("div", {
77
81
  className: "file-desc",
78
- children: [/* @__PURE__ */ r("span", {
82
+ children: [/* @__PURE__ */ o("span", {
79
83
  children: t == null ? void 0 : t.toUpperCase()
80
- }), /* @__PURE__ */ r("span", {
84
+ }), /* @__PURE__ */ o("span", {
81
85
  children: ","
82
- }), /* @__PURE__ */ r("span", {
83
- children: f((n == null ? void 0 : n.size) || 0)
86
+ }), /* @__PURE__ */ o("span", {
87
+ children: y((e == null ? void 0 : e.size) || 0)
84
88
  })]
85
89
  })]
86
90
  })]
@@ -24,9 +24,9 @@ const J = [{
24
24
  history: t,
25
25
  isLastHistory: T = !1,
26
26
  sessionId: d,
27
- currentSession: s,
27
+ currentSession: c,
28
28
  onAgainClick: u
29
- } = P, [a, h] = l([]), [C, I] = l(), [_, b] = l(!1), [y, A] = l(!1), {
29
+ } = P, [a, h] = l([]), [C, b] = l(), [_, I] = l(!1), [y, A] = l(!1), {
30
30
  service: K,
31
31
  popupContainer: o,
32
32
  transform: N,
@@ -41,67 +41,70 @@ const J = [{
41
41
  }, [(z = t == null ? void 0 : t.comment) == null ? void 0 : z.isAgree]);
42
42
  const R = () => {
43
43
  v.config({
44
- getContainer: () => (o == null ? void 0 : o.current) || document.body
44
+ getContainer: () => (o == null ? void 0 : o.current) || document.body,
45
+ prefixCls: "gbot-message"
45
46
  }), $(t.content), v.success("复制成功"), v.config({
46
- getContainer: void 0
47
+ getContainer: void 0,
48
+ prefixCls: "gbot-message"
47
49
  });
48
50
  }, S = (e) => {
49
51
  if (!d || !(t != null && t.messageId))
50
52
  return;
51
- const c = {
53
+ const i = {
52
54
  messageId: t.messageId,
53
55
  isAgree: e
54
56
  };
55
- s == null || s.postMessageComment(c).then(() => {
57
+ c == null || c.postMessageComment(i).then(() => {
56
58
  k(e), t != null && t.comment && (t.comment.isAgree = e), !(e <= 0) && (A(!0), setTimeout(() => {
57
59
  A(!1);
58
60
  }, 2e3));
59
61
  }), p && p({
60
62
  applicationId: x,
61
63
  sessionId: d,
62
- comment: c
64
+ comment: i
63
65
  });
64
66
  }, j = (e) => {
65
- if (a.some((c) => c.id === e.id)) {
66
- const c = a.filter((i) => i.id !== e.id);
67
- h([...c]);
67
+ if (a.some((i) => i.id === e.id)) {
68
+ const i = a.filter((s) => s.id !== e.id);
69
+ h([...i]);
68
70
  } else
69
71
  h([...a, e]);
70
72
  }, B = (e) => {
71
- I(e.target.value);
73
+ b(e.target.value);
72
74
  }, E = () => {
73
75
  if (!d)
74
76
  return;
75
77
  if (!(a != null && a.length))
76
- return b(!0), Promise.reject();
78
+ return I(!0), Promise.reject();
77
79
  let e = [];
78
- a != null && a.length && (e = [...e, ...a.map((i) => i.name)]), C && (e = [...e, C]);
79
- const c = {
80
+ a != null && a.length && (e = [...e, ...a.map((s) => s.name)]), C && (e = [...e, C]);
81
+ const i = {
80
82
  messageId: t.messageId,
81
83
  isAgree: -1,
82
84
  againstReason: e
83
85
  };
84
86
  g.config({
85
- getContainer: () => (o == null ? void 0 : o.current) || document.body
86
- }), s == null || s.postMessageComment(c).then(() => {
87
+ getContainer: () => (o == null ? void 0 : o.current) || document.body,
88
+ prefixCls: "gbot-notification"
89
+ }), c == null || c.postMessageComment(i).then(() => {
87
90
  k(-1), t != null && t.comment && (t.comment.isAgree = -1);
88
- const i = `open${Date.now()}`;
91
+ const s = `open${Date.now()}`;
89
92
  g.success({
90
93
  message: "提交反馈成功",
91
94
  description: "感谢您的参与,我们会认真评估每一条建议!",
92
95
  duration: 2,
93
96
  btn: /* @__PURE__ */ n(Q, {
94
97
  type: "primary",
95
- onClick: () => g.close(i),
98
+ onClick: () => g.close(s),
96
99
  children: "我知道了"
97
100
  }),
98
- key: i,
99
- onClose: () => g.close(i)
101
+ key: s,
102
+ onClose: () => g.close(s)
100
103
  });
101
104
  }), p && p({
102
105
  applicationId: x,
103
106
  sessionId: d,
104
- comment: c
107
+ comment: i
105
108
  });
106
109
  };
107
110
  return /* @__PURE__ */ r("div", {
@@ -155,7 +158,7 @@ const J = [{
155
158
  cancelText: "取消",
156
159
  getPopupContainer: (e) => e.parentNode,
157
160
  onOpenChange: (e) => {
158
- e && (h([]), I(""), b(!1));
161
+ e && (h([]), b(""), I(!1));
159
162
  },
160
163
  icon: !1,
161
164
  title: /* @__PURE__ */ r("div", {
@@ -174,7 +177,7 @@ const J = [{
174
177
  children: J.map((e) => /* @__PURE__ */ n("span", {
175
178
  className: F({
176
179
  "cai-item": !0,
177
- "cai-item__active": a.some((c) => c.id === e.id)
180
+ "cai-item__active": a.some((i) => i.id === e.id)
178
181
  }),
179
182
  onClick: () => j(e),
180
183
  children: e.name
@@ -17,14 +17,14 @@ import ye from "./SessionRefer/index.mjs";
17
17
  import ve from "./SessionAction/index.mjs";
18
18
  import { IHistoryRole as Y, IThinkingStatus as Z } from "@glodon-aiot/apis";
19
19
  import Re from "./FileItem/index.mjs";
20
- import { Popover as Se, Space as $, Button as ee, Row as be, Col as Ee, Collapse as ne, Divider as ke, message as R } from "antd";
21
- import Te from "./SearchReference/index.mjs";
20
+ import { Popover as be, Space as $, Button as ee, Row as Se, Col as Ee, Collapse as ne, Divider as ke, message as R } from "antd";
21
+ import xe from "./SearchReference/index.mjs";
22
22
  /* empty css */import "../../../packages/react-components/dist/es/index.mjs";
23
- import Ae from "classnames";
23
+ import Te from "classnames";
24
24
  import p from "../../../components/Iconfont/index.mjs";
25
- import { CheckOutlined as te, CloseOutlined as le, LoadingOutlined as Oe } from "@ant-design/icons";
25
+ import { CheckOutlined as te, CloseOutlined as le, LoadingOutlined as Ae } from "@ant-design/icons";
26
26
  import m from "../../../components/JsonDisplay/index.mjs";
27
- import xe from "../../../context.mjs";
27
+ import Oe from "../../../context.mjs";
28
28
  import Fe from "./SessionRelated/index.mjs";
29
29
  import _e from "copy-to-clipboard";
30
30
  import { escapeSlash as Ie } from "../../../utils/index.mjs";
@@ -38,7 +38,7 @@ const je = (s) => {
38
38
  } catch (l) {
39
39
  return s;
40
40
  }
41
- }, Be = h(Te), ie = h(ye), S = h(ze), we = h(Re), u = (s) => {
41
+ }, Be = h(xe), ie = h(ye), b = h(ze), we = h(Re), u = (s) => {
42
42
  if (!s)
43
43
  return !1;
44
44
  try {
@@ -52,7 +52,7 @@ const je = (s) => {
52
52
  const l = JSON.parse(JSON.stringify(s)) || [], i = (n = l == null ? void 0 : l.pop()) == null ? void 0 : n.pop();
53
53
  return i ? (i == null ? void 0 : i.type) === "BEFORE_CALL" || (i == null ? void 0 : i.type) === "FUNCTION_CALL" : !1;
54
54
  }, dn = (s) => {
55
- var T, A, O, x, F, _, I, U, z, j;
55
+ var x, T, A, O, F, _, I, U, z, j;
56
56
  const {
57
57
  application: l,
58
58
  currentSession: i,
@@ -66,20 +66,22 @@ const je = (s) => {
66
66
  actions: oe = !0,
67
67
  markdown: d
68
68
  } = s, {
69
- debug: b,
69
+ debug: S,
70
70
  transform: r,
71
71
  popupContainer: C
72
- } = Ce(xe), E = n.role === Y.User, k = n.role === Y.Robot, {
72
+ } = Ce(Oe), E = n.role === Y.User, k = n.role === Y.Robot, {
73
73
  Panel: de
74
74
  } = ne, [L, ce] = Le(!0), pe = () => {
75
75
  R.config({
76
- getContainer: () => (C == null ? void 0 : C.current) || document.body
76
+ getContainer: () => (C == null ? void 0 : C.current) || document.body,
77
+ prefixCls: "gbot-message"
77
78
  }), _e(n.content), R.success("复制成功"), R.config({
78
- getContainer: void 0
79
+ getContainer: void 0,
80
+ prefixCls: "gbot-message"
79
81
  });
80
82
  };
81
83
  return /* @__PURE__ */ o("div", {
82
- className: Ae({
84
+ className: Te({
83
85
  "history-item": !0,
84
86
  "history-item__user": E,
85
87
  "history-item__bot": k
@@ -88,7 +90,7 @@ const je = (s) => {
88
90
  className: "history-item-user",
89
91
  children: [/* @__PURE__ */ e("div", {
90
92
  className: "item-user-panel",
91
- children: /* @__PURE__ */ e(Se, {
93
+ children: /* @__PURE__ */ e(be, {
92
94
  placement: "topLeft",
93
95
  overlayStyle: {
94
96
  padding: 4
@@ -127,7 +129,7 @@ const je = (s) => {
127
129
  className: "user-panel-main",
128
130
  children: /* @__PURE__ */ e("span", {
129
131
  className: "item-user-content",
130
- children: /* @__PURE__ */ e(S, {
132
+ children: /* @__PURE__ */ e(b, {
131
133
  showLatex: !1,
132
134
  children: Ie(n.content)
133
135
  })
@@ -136,11 +138,11 @@ const je = (s) => {
136
138
  })
137
139
  }), /* @__PURE__ */ e("div", {
138
140
  className: "item-user-file",
139
- children: /* @__PURE__ */ e(be, {
141
+ children: /* @__PURE__ */ e(Se, {
140
142
  gutter: [12, 12],
141
143
  justify: "end",
142
144
  wrap: !0,
143
- children: (T = n.files) == null ? void 0 : T.map((t) => /* @__PURE__ */ e(Ee, {
145
+ children: (x = n.files) == null ? void 0 : x.map((t) => /* @__PURE__ */ e(Ee, {
144
146
  className: "user-file-col",
145
147
  children: /* @__PURE__ */ e(we, {
146
148
  docViewerUrl: N,
@@ -159,11 +161,11 @@ const je = (s) => {
159
161
  children: [/* @__PURE__ */ e(ne, {
160
162
  ghost: !0,
161
163
  expandIconPosition: "right",
162
- children: (A = n.actions) == null ? void 0 : A.map((t, me) => {
164
+ children: (T = n.actions) == null ? void 0 : T.map((t, me) => {
163
165
  var B, w, M, J, P, Q, q, H, D, V, W, G;
164
166
  return /* @__PURE__ */ o(de, {
165
- collapsible: b ? "header" : "icon",
166
- showArrow: b,
167
+ collapsible: S ? "header" : "icon",
168
+ showArrow: S,
167
169
  header: /* @__PURE__ */ o($, {
168
170
  size: 8,
169
171
  style: {
@@ -182,7 +184,7 @@ const je = (s) => {
182
184
  children: /* @__PURE__ */ e(le, {})
183
185
  }), (t[t.length - 1].type === "BEFORE_CALL" || t[t.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
184
186
  className: "plugin-status-loading",
185
- children: /* @__PURE__ */ e(Oe, {})
187
+ children: /* @__PURE__ */ e(Ae, {})
186
188
  })]
187
189
  }), /* @__PURE__ */ e("span", {
188
190
  className: "bot-plugin-title",
@@ -249,12 +251,12 @@ const je = (s) => {
249
251
  text: "思考中"
250
252
  })
251
253
  })]
252
- }), !!((O = n.searchReference) != null && O.length) && /* @__PURE__ */ e("div", {
254
+ }), !!((A = n.searchReference) != null && A.length) && /* @__PURE__ */ e("div", {
253
255
  className: "item-bot-net",
254
256
  children: /* @__PURE__ */ e(Be, {
255
257
  history: n
256
258
  })
257
- }), (x = n == null ? void 0 : n.reference) != null && x.length && ((F = r == null ? void 0 : r.reference) != null && F.referenceFirst) ? /* @__PURE__ */ e(ie, {
259
+ }), (O = n == null ? void 0 : n.reference) != null && O.length && ((F = r == null ? void 0 : r.reference) != null && F.referenceFirst) ? /* @__PURE__ */ e(ie, {
258
260
  history: n,
259
261
  docViewerUrl: N,
260
262
  markdown: d
@@ -300,12 +302,12 @@ const je = (s) => {
300
302
  })]
301
303
  }), /* @__PURE__ */ e("div", {
302
304
  className: "bottom-right",
303
- children: /* @__PURE__ */ e(S, v(y({}, d), {
305
+ children: /* @__PURE__ */ e(b, v(y({}, d), {
304
306
  children: (n == null ? void 0 : n.reasoningContent) || ""
305
307
  }))
306
308
  })]
307
309
  })]
308
- }), /* @__PURE__ */ e(S, v(y({}, d), {
310
+ }), /* @__PURE__ */ e(b, v(y({}, d), {
309
311
  children: n.content
310
312
  }))]
311
313
  }), (I = n == null ? void 0 : n.reference) != null && I.length && !((U = r == null ? void 0 : r.reference) != null && U.referenceFirst) ? /* @__PURE__ */ e(ie, {
@@ -1,120 +1,126 @@
1
- var h = (v, a, s) => new Promise((I, e) => {
1
+ var b = (C, a, n) => new Promise((x, e) => {
2
2
  var r = (i) => {
3
3
  try {
4
- u(s.next(i));
4
+ m(n.next(i));
5
5
  } catch (f) {
6
6
  e(f);
7
7
  }
8
- }, E = (i) => {
8
+ }, h = (i) => {
9
9
  try {
10
- u(s.throw(i));
10
+ m(n.throw(i));
11
11
  } catch (f) {
12
12
  e(f);
13
13
  }
14
- }, u = (i) => i.done ? I(i.value) : Promise.resolve(i.value).then(r, E);
15
- u((s = s.apply(v, a)).next());
14
+ }, m = (i) => i.done ? x(i.value) : Promise.resolve(i.value).then(r, h);
15
+ m((n = n.apply(C, a)).next());
16
16
  });
17
- import { jsx as L } from "react/jsx-runtime";
18
- import { useContext as D, useState as b, useRef as N, useEffect as w } from "react";
17
+ import { jsx as p } from "react/jsx-runtime";
18
+ import { useContext as D, useState as I, useRef as N, useEffect as E } from "react";
19
19
  import { Drawer as O, Spin as R, message as d } from "antd";
20
20
  /* empty css */import { LoadingOutlined as j } from "@ant-design/icons";
21
21
  import B from "./SessionItem.mjs";
22
22
  import H from "../../../../../context.mjs";
23
- const K = (v) => {
23
+ const K = (C) => {
24
24
  const {
25
25
  currentSessionId: a,
26
- onSessionChange: s,
27
- onClose: I
28
- } = v, {
26
+ onSessionChange: n,
27
+ onClose: x
28
+ } = C, {
29
29
  agentClient: e,
30
30
  popupContainer: r
31
- } = D(H), [E, u] = b(!1), [i, f] = b(!1), [x, p] = b(""), [g, l] = b([]), n = N(g);
32
- w(() => {
33
- n.current = [], l(n.current), u(!0), e == null || e.getSessions().then((t) => h(void 0, null, function* () {
34
- u(!1), n.current = [...t], l(n.current);
31
+ } = D(H), [h, m] = I(!1), [i, f] = I(!1), [L, v] = I(""), [g, l] = I([]), o = N(g);
32
+ E(() => {
33
+ o.current = [], l(o.current), m(!0), e == null || e.getSessions().then((t) => b(void 0, null, function* () {
34
+ m(!1), o.current = [...t], l(o.current);
35
35
  }));
36
- }, []), w(() => {
36
+ }, []), E(() => {
37
37
  g.length && a && setTimeout(() => {
38
38
  var t;
39
39
  (t = document.getElementById(a)) == null || t.scrollIntoView(!0);
40
40
  }, 100);
41
41
  }, [g]);
42
- const T = (t, o) => {
43
- e == null || e.removeSession(t, !0).then(() => h(void 0, null, function* () {
44
- const c = g.filter((m) => {
42
+ const w = (t, s) => {
43
+ e == null || e.removeSession(t, !0).then(() => b(void 0, null, function* () {
44
+ const c = g.filter((u) => {
45
45
  var S, y;
46
- return ((S = m.data) == null ? void 0 : S.id) !== ((y = t.data) == null ? void 0 : y.id);
46
+ return ((S = u.data) == null ? void 0 : S.id) !== ((y = t.data) == null ? void 0 : y.id);
47
47
  });
48
- t.data.id === a && s && s(""), d.config({
49
- getContainer: () => (r == null ? void 0 : r.current) || document.body
48
+ t.data.id === a && n && n(""), d.config({
49
+ getContainer: () => (r == null ? void 0 : r.current) || document.body,
50
+ prefixCls: "gbot-message"
50
51
  }), d.success("删除成功"), d.config({
51
- getContainer: void 0
52
- }), n.current = [...c], l(n.current);
53
- })), o == null || o.stopPropagation();
54
- }, _ = (t) => {
55
- t && (s && s(t.sessionId, t), I());
56
- }, $ = (t, o) => h(void 0, null, function* () {
52
+ getContainer: void 0,
53
+ prefixCls: "gbot-message"
54
+ }), o.current = [...c], l(o.current);
55
+ })), s == null || s.stopPropagation();
56
+ }, T = (t) => {
57
+ t && (n && n(t.sessionId, t), x());
58
+ }, _ = (t, s) => b(void 0, null, function* () {
57
59
  try {
58
- yield e == null ? void 0 : e.setTop(t.data.id, o), d.config({
59
- getContainer: () => (r == null ? void 0 : r.current) || document.body
60
- }), d.success(`${o ? "" : "取消"}置顶成功`), d.config({
61
- getContainer: void 0
60
+ yield e == null ? void 0 : e.setTop(t.data.id, s), d.config({
61
+ getContainer: () => (r == null ? void 0 : r.current) || document.body,
62
+ prefixCls: "gbot-message"
63
+ }), d.success(`${s ? "" : "取消"}置顶成功`), d.config({
64
+ getContainer: void 0,
65
+ prefixCls: "gbot-message"
62
66
  });
63
67
  } catch (c) {
64
68
  d.config({
65
- getContainer: () => (r == null ? void 0 : r.current) || document.body
66
- }), d.error(`${o ? "" : "取消"}置顶失败`), d.config({
67
- getContainer: void 0
69
+ getContainer: () => (r == null ? void 0 : r.current) || document.body,
70
+ prefixCls: "gbot-message"
71
+ }), d.error(`${s ? "" : "取消"}置顶失败`), d.config({
72
+ getContainer: void 0,
73
+ prefixCls: "gbot-message"
68
74
  });
69
75
  }
70
76
  e == null || e.getSessions({
71
77
  order: "top_time desc, sort_status desc, updated_at desc"
72
- }).then((c) => h(void 0, null, function* () {
73
- n.current = [...c], l(n.current);
78
+ }).then((c) => b(void 0, null, function* () {
79
+ o.current = [...c], l(o.current);
74
80
  }));
75
- }), z = (t, o) => {
76
- o && (t.rename(o), t == null || t.addEventListener("data:updated", () => {
77
- const c = n.current.map((m) => {
81
+ }), $ = (t, s) => {
82
+ s && (t.rename(s), t == null || t.addEventListener("data:updated", () => {
83
+ const c = o.current.map((u) => {
78
84
  var S, y;
79
- return ((S = m.data) == null ? void 0 : S.id) === ((y = m.data) == null ? void 0 : y.id), m;
85
+ return ((S = u.data) == null ? void 0 : S.id) === ((y = u.data) == null ? void 0 : y.id), u;
80
86
  });
81
- n.current = [...c], l(n.current);
87
+ o.current = [...c], l(o.current);
82
88
  }));
83
- }, C = (t, o) => {
84
- f(o), p(t);
89
+ }, z = (t, s) => {
90
+ f(s), v(t);
85
91
  };
86
- return /* @__PURE__ */ L(O, {
92
+ return /* @__PURE__ */ p(O, {
87
93
  title: "会话历史记录",
88
94
  open: !0,
89
95
  placement: "bottom",
90
- onClose: I,
91
- className: `session-list-drawer ${E ? "loading-panel" : ""}`,
96
+ onClose: x,
97
+ className: `session-list-drawer ${h ? "loading-panel" : ""}`,
92
98
  size: "large",
93
99
  getContainer: () => (r == null ? void 0 : r.current) || document.body,
94
100
  destroyOnClose: !0,
95
101
  style: {
96
102
  position: "absolute"
97
103
  },
98
- children: E ? /* @__PURE__ */ L(R, {
99
- indicator: /* @__PURE__ */ L(j, {
104
+ children: h ? /* @__PURE__ */ p(R, {
105
+ indicator: /* @__PURE__ */ p(j, {
100
106
  style: {
101
107
  fontSize: 24
102
108
  },
103
109
  spin: !0
104
110
  })
105
- }) : g.map((t, o) => {
111
+ }) : g.map((t, s) => {
106
112
  var c;
107
- return /* @__PURE__ */ L(B, {
113
+ return /* @__PURE__ */ p(B, {
108
114
  session: t,
109
- index: o,
115
+ index: s,
110
116
  currentSessionId: a,
111
- onChangeSession: _,
112
- onDelSession: T,
113
- onTopSession: $,
114
- onEditNameConfirm: z,
115
- editSessionId: x,
117
+ onChangeSession: T,
118
+ onDelSession: w,
119
+ onTopSession: _,
120
+ onEditNameConfirm: $,
121
+ editSessionId: L,
116
122
  isEdit: i,
117
- onChangeEditStatus: C
123
+ onChangeEditStatus: z
118
124
  }, (c = t.data) == null ? void 0 : c.id);
119
125
  })
120
126
  });