@glodon-aiot/agent-cli-ui 3.3.7-beta.2 → 3.3.8-alpha.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 (52) hide show
  1. package/dist/es/AgentClientUI.mjs +107 -94
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +46 -59
  3. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +46 -47
  4. package/dist/es/Dialog/AgentChat/index.mjs +378 -376
  5. package/dist/es/Dialog/SessionList/index.mjs +115 -119
  6. package/dist/es/Dialog/index.mjs +26 -30
  7. package/dist/es/QuillEditor/index.mjs +59 -70
  8. package/dist/es/components/Recommend/index.mjs +34 -52
  9. package/dist/es/constant.mjs +3 -11
  10. package/dist/es/index.mjs +293 -285
  11. package/dist/es/packages/agent-cli-ui/package.json.mjs +23 -25
  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/style13.css +1 -1
  18. package/dist/es/src/style14.css +1 -1
  19. package/dist/es/src/style15.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/style22.css +1 -1
  25. package/dist/es/src/style23.css +1 -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/style4.css +1 -1
  32. package/dist/es/src/style5.css +1 -1
  33. package/dist/es/src/style6.css +1 -1
  34. package/dist/es/src/style7.css +1 -1
  35. package/dist/es/src/style8.css +1 -1
  36. package/dist/es/src/style9.css +1 -1
  37. package/dist/lib/index.css +1 -1
  38. package/dist/lib/index.js +54 -54
  39. package/dist/src/AgentClientUI.d.ts +1 -1
  40. package/dist/src/Dialog/AgentChat/HistoryItem/SessionRefer/index.d.ts +0 -2
  41. package/dist/src/Dialog/index.d.ts +1 -1
  42. package/dist/src/Footer/index.d.ts +1 -2
  43. package/dist/src/QuillEditor/index.d.ts +1 -1
  44. package/dist/src/components/Greeting/index.d.ts +1 -2
  45. package/dist/src/components/Header/index.d.ts +1 -2
  46. package/dist/src/components/Recommend/index.d.ts +0 -1
  47. package/dist/src/constant.d.ts +0 -4
  48. package/dist/src/index.d.ts +1 -5
  49. package/dist/src/types.d.ts +2 -3
  50. package/dist/src/utils/antdConfig.d.ts +7 -0
  51. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  52. package/package.json +11 -13
@@ -1,110 +1,100 @@
1
1
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as X, useState as i, useRef as P, useImperativeHandle as Y, useEffect as d } from "react";
2
+ import { forwardRef as X, useState as o, useRef as O, useImperativeHandle as Y, useEffect as g } from "react";
3
3
  import { Popover as Z, Space as ee, Button as te } from "antd";
4
- import { useKeyPress as z } from "ahooks";
5
- import x from "classnames";
6
- import ne from "react-quill-new";
4
+ import { useKeyPress as P } from "ahooks";
5
+ import T from "classnames";
6
+ import ne from "react-quill";
7
7
  import re from "../components/Iconfont/index.mjs";
8
- import { shortCutEnum as m } from "../utils/index.mjs";
9
- import "react-quill-new/dist/quill.snow.css";
10
- /* empty css */const oe = X((B, F) => {
11
- var D, q, O;
8
+ import { shortCutEnum as p } from "../utils/index.mjs";
9
+ import "react-quill/dist/quill.snow.css";
10
+ /* empty css */const ie = X((z, F) => {
11
+ var D, q, B;
12
12
  const {
13
- text: T,
14
- onTextSend: a,
13
+ text: N,
14
+ onTextSend: d,
15
15
  disabled: j,
16
16
  maxLength: c = 0,
17
17
  onChange: y,
18
- networkStatus: f,
19
- clearAction: N,
20
- loading: p
21
- } = B, [C, w] = i(!0), [h, l] = i(), [E, L] = i(), [M, Q] = i(15), [S, U] = i(12), [k, A] = i(0), [I, v] = i(!1), V = P(null), n = P(null);
18
+ networkStatus: a,
19
+ clearAction: C,
20
+ loading: m
21
+ } = z, [b, L] = o(!0), [h, l] = o(), [v, w] = o(), [M, Q] = o(15), [S, U] = o(12), [k, A] = o(0), [I, E] = o(!1), V = O(null), n = O(null);
22
22
  Y(F, () => ({
23
23
  clear: $,
24
24
  prevent: H,
25
- focus: b,
25
+ focus: x,
26
26
  update: W
27
- })), d(() => {
28
- l(T), n.current && (g(), b());
29
- }, [T]), d(() => {
30
- if (!n.current)
31
- return;
32
- const e = n.current.getEditor();
33
- if (e && e.bounds !== document.body)
34
- try {
35
- console.log("设置 bounds"), e.bounds = document.body;
36
- } catch (t) {
37
- console.warn("设置 bounds 失败:", t);
38
- }
39
- }, [n.current]);
27
+ })), g(() => {
28
+ l(N), n.current && (f(), x());
29
+ }, [N]);
40
30
  const W = (e) => {
41
31
  l(e);
42
32
  }, $ = () => {
43
- l(void 0), L(void 0);
33
+ l(void 0), w(void 0);
44
34
  }, H = () => {
45
- }, b = () => {
46
- if (!n.current || C)
35
+ }, x = () => {
36
+ if (!n.current || b)
47
37
  return;
48
38
  const e = n.current.getEditor();
49
39
  e.focus(), setTimeout(() => {
50
40
  e.getLength() > 0 && e.setSelection(e.getLength(), e.getLength());
51
41
  });
52
42
  };
53
- d(() => {
43
+ g(() => {
54
44
  if (!n.current)
55
45
  return;
56
46
  const e = n.current.getEditor();
57
47
  c && (e.on("text-change", () => {
58
- e.getLength() > c && e.deleteText(c, e.getLength()), g(), K(), b();
48
+ e.getLength() > c && e.deleteText(c, e.getLength()), f(), K(), x();
59
49
  }), e.on("selection-change", K));
60
50
  }, [n, c]);
61
- const g = () => {
51
+ const f = () => {
62
52
  if (!n.current)
63
53
  return;
64
- const e = n.current.getEditor(), t = e.getBounds(e.getLength() - 1, e.getLength());
65
- t && (Q(t.left), U(t.top));
54
+ const e = n.current.getEditor();
55
+ Q(e.getBounds(e.getLength() - 1, e.getLength()).left), U(e.getBounds(e.getLength() - 1, e.getLength()).top);
66
56
  }, K = (e) => {
67
57
  if (!n.current)
68
58
  return;
69
- const t = n.current.getEditor(), o = e || t.getSelection();
70
- (o == null ? void 0 : o.index) !== void 0 && A(o == null ? void 0 : o.index);
59
+ const t = n.current.getEditor(), i = e || t.getSelection();
60
+ (i == null ? void 0 : i.index) !== void 0 && A(i == null ? void 0 : i.index);
71
61
  };
72
- z("1", () => {
62
+ P("1", () => {
73
63
  var t;
74
64
  const e = (t = n.current) == null ? void 0 : t.getEditor();
75
- I && f && (e == null || e.blur(), setTimeout(() => R()));
76
- }), z("2", () => {
65
+ I && a && (e == null || e.blur(), setTimeout(() => R()));
66
+ }), P("2", () => {
77
67
  var t;
78
68
  const e = (t = n.current) == null ? void 0 : t.getEditor();
79
69
  I && (e == null || e.blur(), setTimeout(() => _()));
80
70
  });
81
71
  const R = () => {
82
72
  var t;
83
- if (!f)
73
+ if (!a)
84
74
  return;
85
75
  const e = (t = n.current) == null ? void 0 : t.getEditor();
86
- e == null || e.focus(), v(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, m.NETWORK));
76
+ e == null || e.focus(), E(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, p.NETWORK));
87
77
  }, _ = () => {
88
78
  var t;
89
79
  const e = (t = n.current) == null ? void 0 : t.getEditor();
90
- e == null || e.focus(), v(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, m.DOCUMENT));
80
+ e == null || e.focus(), E(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, p.DOCUMENT));
91
81
  }, G = () => {
92
- var t, o, u;
82
+ var t, i, u;
93
83
  const e = (t = n.current) == null ? void 0 : t.getEditor();
94
- return e && (e == null ? void 0 : e.getLength()) > 2 && !((o = e.getText()) != null && o.includes(m.NETWORK)) && !((u = e.getText()) != null && u.includes(m.DOCUMENT));
84
+ return e && (e == null ? void 0 : e.getLength()) > 2 && !((i = e.getText()) != null && i.includes(p.NETWORK)) && !((u = e.getText()) != null && u.includes(p.DOCUMENT));
95
85
  };
96
- return d(() => {
86
+ return g(() => {
97
87
  var e, t;
98
- p ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
99
- }, [p]), d(() => (window.addEventListener("resize", g), () => {
100
- window.removeEventListener("resize", g);
88
+ m ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
89
+ }, [m]), g(() => (window.addEventListener("resize", f), () => {
90
+ window.removeEventListener("resize", f);
101
91
  }), []), /* @__PURE__ */ s("div", {
102
- className: x({
92
+ className: T({
103
93
  "quill-editor": !0,
104
- "quill-editor__active": C
94
+ "quill-editor__active": b
105
95
  }),
106
96
  children: [/* @__PURE__ */ s("div", {
107
- className: x({
97
+ className: T({
108
98
  "quill-editor-wrapper": !0,
109
99
  "quill-editor-wrapper__scroll": S >= 200
110
100
  }),
@@ -115,25 +105,24 @@ import "react-quill-new/dist/quill.snow.css";
115
105
  theme: "snow",
116
106
  placeholder: "输入你想问的,shift+enter 换行。",
117
107
  ref: n,
118
- bounds: document.body,
119
- onFocus: () => w(!0),
120
- onBlur: () => w(!1),
108
+ onFocus: () => L(!0),
109
+ onBlur: () => L(!1),
121
110
  onKeyDown: (e) => {
122
111
  if (!e.shiftKey && e.keyCode == 13) {
123
112
  const t = h == null ? void 0 : h.replace(/[\n\s]+$/, "");
124
- l(t), a && a(E);
113
+ l(t), d && d(v);
125
114
  }
126
115
  },
127
116
  value: h,
128
117
  modules: {
129
118
  toolbar: !1
130
119
  },
131
- onChange: (e, t, o, u) => {
120
+ onChange: (e, t, i, u) => {
132
121
  if (!t)
133
122
  return;
134
123
  l(e);
135
124
  const J = u.getText().replace(/[\n\s]+$/, "");
136
- L(J), y && y(e, u);
125
+ w(J), y && y(e, u);
137
126
  }
138
127
  }), /* @__PURE__ */ r("div", {
139
128
  className: "shortcut-direct",
@@ -151,14 +140,14 @@ import "react-quill-new/dist/quill.snow.css";
151
140
  trigger: "hover",
152
141
  getPopupContainer: (e) => e.parentNode,
153
142
  onVisibleChange: (e) => {
154
- v(e);
143
+ E(e);
155
144
  },
156
145
  content: /* @__PURE__ */ s("div", {
157
146
  className: "shortcut-direct-pannel",
158
147
  children: [/* @__PURE__ */ s("div", {
159
- className: x({
160
- "shortcut-direct-item": f,
161
- "shortcut-direct-item__disabled": !f
148
+ className: T({
149
+ "shortcut-direct-item": a,
150
+ "shortcut-direct-item__disabled": !a
162
151
  }),
163
152
  onClick: R,
164
153
  children: [/* @__PURE__ */ r("span", {
@@ -188,7 +177,7 @@ import "react-quill-new/dist/quill.snow.css";
188
177
  style: {
189
178
  height: 32
190
179
  },
191
- children: N || /* @__PURE__ */ r("span", {})
180
+ children: C || /* @__PURE__ */ r("span", {})
192
181
  }), /* @__PURE__ */ s("div", {
193
182
  style: {
194
183
  height: 32,
@@ -201,7 +190,7 @@ import "react-quill-new/dist/quill.snow.css";
201
190
  color: "#84868C"
202
191
  },
203
192
  children: [/* @__PURE__ */ r("span", {
204
- children: ((D = n.current) == null ? void 0 : D.getEditor()) && ((O = (q = n.current) == null ? void 0 : q.getEditor()) == null ? void 0 : O.getLength()) - 1
193
+ children: ((D = n.current) == null ? void 0 : D.getEditor()) && ((B = (q = n.current) == null ? void 0 : q.getEditor()) == null ? void 0 : B.getLength()) - 1
205
194
  }), /* @__PURE__ */ r("span", {
206
195
  children: "/"
207
196
  }), /* @__PURE__ */ r("span", {
@@ -210,8 +199,8 @@ import "react-quill-new/dist/quill.snow.css";
210
199
  }), /* @__PURE__ */ r(te, {
211
200
  type: "link",
212
201
  ghost: !0,
213
- disabled: j || !E,
214
- loading: p,
202
+ disabled: j || !v,
203
+ loading: m,
215
204
  icon: /* @__PURE__ */ r(re, {
216
205
  className: "icon-sendMsg",
217
206
  style: {
@@ -220,14 +209,14 @@ import "react-quill-new/dist/quill.snow.css";
220
209
  type: "icon-fasong"
221
210
  }),
222
211
  onClick: () => {
223
- a && a(E);
212
+ d && d(v);
224
213
  }
225
214
  })]
226
215
  })]
227
216
  })]
228
217
  });
229
218
  });
230
- oe.displayName = "QuillEditor";
219
+ ie.displayName = "QuillEditor";
231
220
  export {
232
- oe as default
221
+ ie as default
233
222
  };
@@ -1,76 +1,58 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as N, useState as l, useImperativeHandle as q, useEffect as m } from "react";
3
- /* empty css */import { Space as O, Row as b, Col as j } from "antd";
4
- import k from "./tip.svg.mjs";
5
- import B from "./RecommendItem.mjs";
6
- const L = N((g, R) => {
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as I, useState as r, useImperativeHandle as Q, useEffect as l } from "react";
3
+ /* empty css */import { Space as g, Row as w, Col as N } from "antd";
4
+ import q from "./tip.svg.mjs";
5
+ import v from "./RecommendItem.mjs";
6
+ const x = I((a, u) => {
7
7
  const {
8
- onItemClick: v,
8
+ onItemClick: f,
9
9
  data: s,
10
- isRecommendClearing: I,
11
- layoutBreakpoints: a = [450]
12
- // 默认临界值
13
- } = g, [t, C] = l(), [x, u] = l(), [y, f] = l(!1), [z, Q] = l(2);
14
- return q(R, () => ({
10
+ isRecommendClearing: p
11
+ } = a, [e, d] = r(), [h, i] = r(), [R, m] = r(!1);
12
+ return Q(u, () => ({
15
13
  clear() {
16
- u(void 0);
14
+ i(void 0);
17
15
  }
18
- })), m(() => {
19
- const e = document.getElementById("dialog-modal");
20
- if (!e)
21
- return;
22
- const n = (c) => {
23
- const p = [...a].sort((d, E) => d - E), w = p.findIndex((d) => c < d);
24
- return w === -1 ? p.length + 1 : w + 1;
25
- }, i = () => {
26
- const c = e.clientWidth;
27
- Q(n(c));
28
- };
29
- i();
30
- let o = null;
31
- return window.ResizeObserver ? (o = new ResizeObserver(i), o.observe(e)) : window.addEventListener("resize", i), () => {
32
- o == null || o.disconnect(), window.removeEventListener("resize", i);
33
- };
34
- }, [a]), m(() => {
16
+ })), l(() => {
35
17
  if (s != null && s.length) {
36
- C(s);
18
+ d(s);
37
19
  return;
38
20
  }
39
- }, [s]), m(() => {
40
- if (!t)
21
+ }, [s]), l(() => {
22
+ if (!e)
41
23
  return;
42
- const e = t.find((n) => n.file.url || n.icon || n.name);
43
- f(!e);
44
- }, [t]), /* @__PURE__ */ h("div", {
24
+ const o = e.find((n) => n.file.url || n.icon || n.name);
25
+ m(!o);
26
+ }, [e]), /* @__PURE__ */ c("div", {
45
27
  className: "questions",
46
- children: [/* @__PURE__ */ h(O, {
28
+ children: [/* @__PURE__ */ c(g, {
47
29
  size: 8,
48
30
  className: "question-tip",
49
- children: [/* @__PURE__ */ r("img", {
50
- src: k,
31
+ children: [/* @__PURE__ */ t("img", {
32
+ src: q,
51
33
  alt: ""
52
- }), /* @__PURE__ */ r("span", {
34
+ }), /* @__PURE__ */ t("span", {
53
35
  children: "请试试这样提问:"
54
36
  })]
55
- }), /* @__PURE__ */ r(b, {
37
+ }), /* @__PURE__ */ t(w, {
56
38
  gutter: [12, 12],
57
39
  wrap: !0,
58
40
  className: "question-row",
59
- children: t == null ? void 0 : t.map((e, n) => /* @__PURE__ */ r(j, {
60
- span: 24 / z,
61
- children: /* @__PURE__ */ r(B, {
62
- item: e,
63
- isRecommendClearing: I,
64
- isOnlyQuestion: y,
65
- question: x,
66
- setQuestion: u,
67
- onItemClick: v
41
+ children: e == null ? void 0 : e.map((o, n) => /* @__PURE__ */ t(N, {
42
+ span: 12,
43
+ children: /* @__PURE__ */ t(v, {
44
+ item: o,
45
+ isRecommendClearing: p,
46
+ isOnlyQuestion: R,
47
+ question: h,
48
+ setQuestion: i,
49
+ onItemClick: f
68
50
  })
69
51
  }, n))
70
52
  })]
71
53
  });
72
54
  });
73
- L.displayName = "Recommend";
55
+ x.displayName = "Recommend";
74
56
  export {
75
- L as default
57
+ x as default
76
58
  };
@@ -2,7 +2,7 @@ import e from "./assets/icon.svg.mjs";
2
2
  import t from "./assets/brand.svg.mjs";
3
3
  import o from "./assets/doc-icons/pdf.svg.mjs";
4
4
  import r from "./assets/doc-icons/doc.svg.mjs";
5
- import s from "./assets/doc-icons/docx.svg.mjs";
5
+ import n from "./assets/doc-icons/docx.svg.mjs";
6
6
  const u = {
7
7
  triggerButton: {
8
8
  visible: !0
@@ -52,11 +52,7 @@ const u = {
52
52
  promptVariables: !0
53
53
  },
54
54
  features: {
55
- greeting: {
56
- questions: !0,
57
- layoutBreakpoints: [450]
58
- // 默认临界值
59
- },
55
+ greeting: !0,
60
56
  sessionList: !0,
61
57
  newSession: !0,
62
58
  fileUpload: !0,
@@ -101,18 +97,14 @@ const u = {
101
97
  }
102
98
  }, c = "https://copilot.glodon.com/api/cvforcepd", f = "https://copilot.glodon.com/portal/_/aecpilot/fe/", m = 1024, d = 1024 * 1024, g = 1024 * 1024 * 1024, h = {
103
99
  doc: r,
104
- docx: s,
100
+ docx: n,
105
101
  pdf: o
106
- }, b = {
107
- OPEN: 1,
108
- CLOSE: 2
109
102
  };
110
103
  export {
111
104
  h as FILE_ICONS,
112
105
  g as GB,
113
106
  m as KB,
114
107
  d as MB,
115
- b as NET_OPEN_STATUS,
116
108
  t as brand,
117
109
  c as defaultApiUrl,
118
110
  f as defaultDovViewerUrl,