@glodon-aiot/agent-cli-ui 3.4.2-beta.2 → 3.4.3-beta.1

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 (43) 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/style14.css +1 -1
  17. package/dist/es/src/style15.css +1 -1
  18. package/dist/es/src/style16.css +1 -1
  19. package/dist/es/src/style17.css +1 -1
  20. package/dist/es/src/style18.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 -1
  24. package/dist/es/src/style22.css +1 -1
  25. package/dist/es/src/style23.css +1 -1
  26. package/dist/es/src/style28.css +1 -1
  27. package/dist/es/src/style3.css +1 -1
  28. package/dist/es/src/style30.css +1 -1
  29. package/dist/es/src/style31.css +1 -1
  30. package/dist/es/src/style32.css +1 -1
  31. package/dist/es/src/style33.css +1 -1
  32. package/dist/es/src/style4.css +1 -1
  33. package/dist/es/src/style5.css +1 -1
  34. package/dist/es/src/style6.css +1 -1
  35. package/dist/es/src/style7.css +1 -1
  36. package/dist/es/src/style8.css +1 -1
  37. package/dist/es/src/style9.css +1 -1
  38. package/dist/es/utils/antdConfig.mjs +15 -0
  39. package/dist/lib/index.css +1 -1
  40. package/dist/lib/index.js +56 -56
  41. package/dist/src/utils/antdConfig.d.ts +7 -0
  42. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  43. package/package.json +3 -3
@@ -1,40 +1,47 @@
1
1
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as X, useState as o, useRef as O, useImperativeHandle as Y, useEffect as p } from "react";
2
+ import { forwardRef as X, useState as o, useRef as B, useImperativeHandle as Y, useEffect as v } from "react";
3
3
  import { Popover as Z, Space as ee, Button as te } from "antd";
4
- import { useKeyPress as P } from "ahooks";
5
- import T from "classnames";
4
+ import { useKeyPress as O } from "ahooks";
5
+ import C from "classnames";
6
6
  import ne from "react-quill";
7
7
  import re from "../components/Iconfont/index.mjs";
8
- import { shortCutEnum as m } from "../utils/index.mjs";
8
+ import { shortCutEnum as x } from "../utils/index.mjs";
9
9
  import "react-quill/dist/quill.snow.css";
10
10
  /* empty css */const ie = X((z, F) => {
11
- var D, q, B;
11
+ var _, P, q;
12
12
  const {
13
- text: N,
14
- onTextSend: d,
15
- disabled: j,
13
+ text: d,
14
+ onTextSend: a,
15
+ disabled: M,
16
16
  maxLength: c = 0,
17
17
  onChange: y,
18
- networkStatus: a,
19
- clearAction: C,
20
- loading: v
21
- } = z, [b, L] = o(!0), [h, l] = o(), [g, w] = o(), [M, Q] = o(15), [S, U] = o(12), [k, A] = o(0), [I, E] = o(!1), V = O(null), n = O(null);
18
+ networkStatus: h,
19
+ clearAction: L,
20
+ loading: E
21
+ } = z, [b, w] = o(!0), [f, l] = o(), [g, p] = o(), [j, Q] = o(15), [S, U] = o(12), [k, $] = o(0), [D, T] = o(!1), A = B(null), n = B(null);
22
22
  Y(F, () => ({
23
- clear: $,
24
- prevent: H,
25
- focus: x,
26
- update: W,
23
+ clear: V,
24
+ prevent: W,
25
+ focus: N,
26
+ update: H,
27
27
  // 新增:获取当前输入框内容
28
28
  getCurrentText: () => g
29
- })), p(() => {
30
- l(N), n.current && (f(), x());
31
- }, [N]);
32
- const W = (e) => {
29
+ })), v(() => {
30
+ if (l(d), d) {
31
+ const e = document.createElement("div");
32
+ e.innerHTML = d;
33
+ const t = e.textContent || e.innerText || "";
34
+ p(t.replace(/[\n\s]+$/, ""));
35
+ } else
36
+ p(void 0);
37
+ n.current && (m(), N());
38
+ }, [d]);
39
+ const H = (e) => {
33
40
  l(e);
34
- }, $ = () => {
35
- l(void 0), w(void 0);
36
- }, H = () => {
37
- }, x = () => {
41
+ }, V = () => {
42
+ l(void 0), p(void 0);
43
+ }, W = () => {
44
+ }, N = () => {
38
45
  if (!n.current || b)
39
46
  return;
40
47
  const e = n.current.getEditor();
@@ -42,61 +49,61 @@ import "react-quill/dist/quill.snow.css";
42
49
  e.getLength() > 0 && e.setSelection(e.getLength(), e.getLength());
43
50
  });
44
51
  };
45
- p(() => {
52
+ v(() => {
46
53
  if (!n.current)
47
54
  return;
48
55
  const e = n.current.getEditor();
49
56
  c && (e.on("text-change", () => {
50
- e.getLength() > c && e.deleteText(c, e.getLength()), f(), K(), x();
51
- }), e.on("selection-change", K));
57
+ e.getLength() > c && e.deleteText(c, e.getLength()), m(), I(), N();
58
+ }), e.on("selection-change", I));
52
59
  }, [n, c]);
53
- const f = () => {
60
+ const m = () => {
54
61
  if (!n.current)
55
62
  return;
56
63
  const e = n.current.getEditor();
57
64
  Q(e.getBounds(e.getLength() - 1, e.getLength()).left), U(e.getBounds(e.getLength() - 1, e.getLength()).top);
58
- }, K = (e) => {
65
+ }, I = (e) => {
59
66
  if (!n.current)
60
67
  return;
61
68
  const t = n.current.getEditor(), i = e || t.getSelection();
62
- (i == null ? void 0 : i.index) !== void 0 && A(i == null ? void 0 : i.index);
69
+ (i == null ? void 0 : i.index) !== void 0 && $(i == null ? void 0 : i.index);
63
70
  };
64
- P("1", () => {
71
+ O("1", () => {
65
72
  var t;
66
73
  const e = (t = n.current) == null ? void 0 : t.getEditor();
67
- I && a && (e == null || e.blur(), setTimeout(() => R()));
68
- }), P("2", () => {
74
+ D && h && (e == null || e.blur(), setTimeout(() => K()));
75
+ }), O("2", () => {
69
76
  var t;
70
77
  const e = (t = n.current) == null ? void 0 : t.getEditor();
71
- I && (e == null || e.blur(), setTimeout(() => _()));
78
+ D && (e == null || e.blur(), setTimeout(() => R()));
72
79
  });
73
- const R = () => {
80
+ const K = () => {
74
81
  var t;
75
- if (!a)
82
+ if (!h)
76
83
  return;
77
84
  const e = (t = n.current) == null ? void 0 : t.getEditor();
78
- e == null || e.focus(), E(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, m.NETWORK));
79
- }, _ = () => {
85
+ e == null || e.focus(), T(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, x.NETWORK));
86
+ }, R = () => {
80
87
  var t;
81
88
  const e = (t = n.current) == null ? void 0 : t.getEditor();
82
- e == null || e.focus(), E(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, m.DOCUMENT));
89
+ e == null || e.focus(), T(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, x.DOCUMENT));
83
90
  }, G = () => {
84
91
  var t, i, u;
85
92
  const e = (t = n.current) == null ? void 0 : t.getEditor();
86
- return e && (e == null ? void 0 : e.getLength()) > 2 && !((i = e.getText()) != null && i.includes(m.NETWORK)) && !((u = e.getText()) != null && u.includes(m.DOCUMENT));
93
+ return e && (e == null ? void 0 : e.getLength()) > 2 && !((i = e.getText()) != null && i.includes(x.NETWORK)) && !((u = e.getText()) != null && u.includes(x.DOCUMENT));
87
94
  };
88
- return p(() => {
95
+ return v(() => {
89
96
  var e, t;
90
- v ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
91
- }, [v]), p(() => (window.addEventListener("resize", f), () => {
92
- window.removeEventListener("resize", f);
97
+ E ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
98
+ }, [E]), v(() => (window.addEventListener("resize", m), () => {
99
+ window.removeEventListener("resize", m);
93
100
  }), []), /* @__PURE__ */ s("div", {
94
- className: T({
101
+ className: C({
95
102
  "quill-editor": !0,
96
103
  "quill-editor__active": b
97
104
  }),
98
105
  children: [/* @__PURE__ */ s("div", {
99
- className: T({
106
+ className: C({
100
107
  "quill-editor-wrapper": !0,
101
108
  "quill-editor-wrapper__scroll": S >= 200
102
109
  }),
@@ -107,15 +114,15 @@ import "react-quill/dist/quill.snow.css";
107
114
  theme: "snow",
108
115
  placeholder: "输入你想问的,shift+enter 换行。",
109
116
  ref: n,
110
- onFocus: () => L(!0),
111
- onBlur: () => L(!1),
117
+ onFocus: () => w(!0),
118
+ onBlur: () => w(!1),
112
119
  onKeyDown: (e) => {
113
120
  if (!e.shiftKey && e.keyCode == 13) {
114
- const t = h == null ? void 0 : h.replace(/[\n\s]+$/, "");
115
- l(t), d && d(g);
121
+ const t = f == null ? void 0 : f.replace(/[\n\s]+$/, "");
122
+ l(t), a && a(g);
116
123
  }
117
124
  },
118
- value: h,
125
+ value: f,
119
126
  modules: {
120
127
  toolbar: !1
121
128
  },
@@ -124,14 +131,14 @@ import "react-quill/dist/quill.snow.css";
124
131
  return;
125
132
  l(e);
126
133
  const J = u.getText().replace(/[\n\s]+$/, "");
127
- w(J), y && y(e, u);
134
+ p(J), y && y(e, u);
128
135
  }
129
136
  }), /* @__PURE__ */ r("div", {
130
137
  className: "shortcut-direct",
131
- ref: V,
138
+ ref: A,
132
139
  style: {
133
140
  position: "absolute",
134
- left: M + 4,
141
+ left: j + 4,
135
142
  top: S,
136
143
  cursor: "pointer",
137
144
  visibility: G() ? "visible" : "hidden"
@@ -142,16 +149,16 @@ import "react-quill/dist/quill.snow.css";
142
149
  trigger: "hover",
143
150
  getPopupContainer: (e) => e.parentNode,
144
151
  onVisibleChange: (e) => {
145
- E(e);
152
+ T(e);
146
153
  },
147
154
  content: /* @__PURE__ */ s("div", {
148
155
  className: "shortcut-direct-pannel",
149
156
  children: [/* @__PURE__ */ s("div", {
150
- className: T({
151
- "shortcut-direct-item": a,
152
- "shortcut-direct-item__disabled": !a
157
+ className: C({
158
+ "shortcut-direct-item": h,
159
+ "shortcut-direct-item__disabled": !h
153
160
  }),
154
- onClick: R,
161
+ onClick: K,
155
162
  children: [/* @__PURE__ */ r("span", {
156
163
  className: "title",
157
164
  children: "指定联网回答"
@@ -161,7 +168,7 @@ import "react-quill/dist/quill.snow.css";
161
168
  })]
162
169
  }), /* @__PURE__ */ s("div", {
163
170
  className: "shortcut-direct-item",
164
- onClick: _,
171
+ onClick: R,
165
172
  children: [/* @__PURE__ */ r("span", {
166
173
  className: "title",
167
174
  children: "指定文档回答"
@@ -179,7 +186,7 @@ import "react-quill/dist/quill.snow.css";
179
186
  style: {
180
187
  height: 32
181
188
  },
182
- children: C || /* @__PURE__ */ r("span", {})
189
+ children: L || /* @__PURE__ */ r("span", {})
183
190
  }), /* @__PURE__ */ s("div", {
184
191
  style: {
185
192
  height: 32,
@@ -192,7 +199,7 @@ import "react-quill/dist/quill.snow.css";
192
199
  color: "#84868C"
193
200
  },
194
201
  children: [/* @__PURE__ */ r("span", {
195
- children: ((D = n.current) == null ? void 0 : D.getEditor()) && ((B = (q = n.current) == null ? void 0 : q.getEditor()) == null ? void 0 : B.getLength()) - 1
202
+ children: ((_ = n.current) == null ? void 0 : _.getEditor()) && ((q = (P = n.current) == null ? void 0 : P.getEditor()) == null ? void 0 : q.getLength()) - 1
196
203
  }), /* @__PURE__ */ r("span", {
197
204
  children: "/"
198
205
  }), /* @__PURE__ */ r("span", {
@@ -201,8 +208,8 @@ import "react-quill/dist/quill.snow.css";
201
208
  }), /* @__PURE__ */ r(te, {
202
209
  type: "link",
203
210
  ghost: !0,
204
- disabled: j || !g,
205
- loading: v,
211
+ disabled: M || !g,
212
+ loading: E,
206
213
  icon: /* @__PURE__ */ r(re, {
207
214
  className: "icon-sendMsg",
208
215
  style: {
@@ -211,7 +218,7 @@ import "react-quill/dist/quill.snow.css";
211
218
  type: "icon-fasong"
212
219
  }),
213
220
  onClick: () => {
214
- d && d(g);
221
+ a && a(g);
215
222
  }
216
223
  })]
217
224
  })]