@glodon-aiot/agent-cli-ui 3.3.7-beta.1 → 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 (46) 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 +26 -27
  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/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/style25.css +1 -1
  23. package/dist/es/src/style26.css +1 -1
  24. package/dist/es/src/style27.css +1 -1
  25. package/dist/es/src/style28.css +1 -1
  26. package/dist/es/src/style29.css +1 -1
  27. package/dist/es/src/style30.css +1 -1
  28. package/dist/es/src/style4.css +1 -1
  29. package/dist/es/src/style5.css +1 -1
  30. package/dist/es/src/style8.css +1 -1
  31. package/dist/es/src/style9.css +1 -1
  32. package/dist/lib/index.css +1 -1
  33. package/dist/lib/index.js +54 -54
  34. package/dist/src/AgentClientUI.d.ts +1 -1
  35. package/dist/src/Dialog/AgentChat/HistoryItem/SessionRefer/index.d.ts +0 -2
  36. package/dist/src/Dialog/index.d.ts +1 -1
  37. package/dist/src/Footer/index.d.ts +1 -2
  38. package/dist/src/components/Greeting/index.d.ts +1 -2
  39. package/dist/src/components/Header/index.d.ts +1 -2
  40. package/dist/src/components/Recommend/index.d.ts +0 -1
  41. package/dist/src/constant.d.ts +0 -4
  42. package/dist/src/index.d.ts +1 -5
  43. package/dist/src/types.d.ts +2 -3
  44. package/dist/src/utils/antdConfig.d.ts +7 -0
  45. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  46. package/package.json +10 -11
@@ -1,64 +1,54 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as X, useState as s, useRef as O, useImperativeHandle as Y, useEffect as d } from "react";
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 g } from "react";
3
3
  import { Popover as Z, Space as ee, Button as te } from "antd";
4
4
  import { useKeyPress as P } from "ahooks";
5
- import b from "classnames";
5
+ import T 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 p } from "../utils/index.mjs";
9
9
  import "react-quill/dist/quill.snow.css";
10
- /* empty css */const oe = X((z, F) => {
10
+ /* empty css */const ie = X((z, F) => {
11
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: h,
19
- clearAction: N,
20
- loading: p
21
- } = z, [C, w] = s(!0), [f, l] = s(), [E, L] = s(), [M, Q] = s(15), [S, U] = s(12), [k, A] = s(0), [I, v] = s(!1), V = O(null), n = O(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
25
  focus: x,
26
26
  update: W
27
- })), d(() => {
28
- l(T), n.current && (g(), x());
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
- 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
35
  }, x = () => {
46
- if (!n.current || C)
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(), x();
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
54
  const e = n.current.getEditor();
@@ -66,13 +56,13 @@ import "react-quill/dist/quill.snow.css";
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
62
  P("1", () => {
73
63
  var t;
74
64
  const e = (t = n.current) == null ? void 0 : t.getEditor();
75
- I && h && (e == null || e.blur(), setTimeout(() => R()));
65
+ I && a && (e == null || e.blur(), setTimeout(() => R()));
76
66
  }), P("2", () => {
77
67
  var t;
78
68
  const e = (t = n.current) == null ? void 0 : t.getEditor();
@@ -80,31 +70,31 @@ import "react-quill/dist/quill.snow.css";
80
70
  });
81
71
  const R = () => {
82
72
  var t;
83
- if (!h)
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);
101
- }), []), /* @__PURE__ */ i("div", {
102
- className: b({
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);
91
+ }), []), /* @__PURE__ */ s("div", {
92
+ className: T({
103
93
  "quill-editor": !0,
104
- "quill-editor__active": C
94
+ "quill-editor__active": b
105
95
  }),
106
- children: [/* @__PURE__ */ i("div", {
107
- className: b({
96
+ children: [/* @__PURE__ */ s("div", {
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/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
- const t = f == null ? void 0 : f.replace(/[\n\s]+$/, "");
124
- l(t), a && a(E);
112
+ const t = h == null ? void 0 : h.replace(/[\n\s]+$/, "");
113
+ l(t), d && d(v);
125
114
  }
126
115
  },
127
- value: f,
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/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
- content: /* @__PURE__ */ i("div", {
145
+ content: /* @__PURE__ */ s("div", {
157
146
  className: "shortcut-direct-pannel",
158
- children: [/* @__PURE__ */ i("div", {
159
- className: b({
160
- "shortcut-direct-item": h,
161
- "shortcut-direct-item__disabled": !h
147
+ children: [/* @__PURE__ */ s("div", {
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", {
@@ -168,7 +157,7 @@ import "react-quill/dist/quill.snow.css";
168
157
  className: "text",
169
158
  children: "快捷键1"
170
159
  })]
171
- }), /* @__PURE__ */ i("div", {
160
+ }), /* @__PURE__ */ s("div", {
172
161
  className: "shortcut-direct-item",
173
162
  onClick: _,
174
163
  children: [/* @__PURE__ */ r("span", {
@@ -182,20 +171,20 @@ import "react-quill/dist/quill.snow.css";
182
171
  })
183
172
  })
184
173
  })]
185
- }), /* @__PURE__ */ i("div", {
174
+ }), /* @__PURE__ */ s("div", {
186
175
  className: "quill-editor-send",
187
176
  children: [/* @__PURE__ */ r("div", {
188
177
  style: {
189
178
  height: 32
190
179
  },
191
- children: N || /* @__PURE__ */ r("span", {})
192
- }), /* @__PURE__ */ i("div", {
180
+ children: C || /* @__PURE__ */ r("span", {})
181
+ }), /* @__PURE__ */ s("div", {
193
182
  style: {
194
183
  height: 32,
195
184
  display: "flex",
196
185
  alignItems: "center"
197
186
  },
198
- children: [/* @__PURE__ */ i(ee, {
187
+ children: [/* @__PURE__ */ s(ee, {
199
188
  size: 2,
200
189
  style: {
201
190
  color: "#84868C"
@@ -210,8 +199,8 @@ import "react-quill/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/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,