@glodon-aiot/agent-cli-ui 3.0.4 → 3.0.5-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.
- package/dist/es/Dialog/AgentChat/index.mjs +1 -1
- package/dist/es/Dialog/HistoryItem/index.mjs +4 -3
- package/dist/es/Dialog/UploadingPrompt/index.mjs +10 -12
- package/dist/es/QuillEditor/index.mjs +9 -10
- package/dist/es/components/Markdown/index.mjs +53 -37
- package/dist/es/index.mjs +2 -2
- package/dist/es/utils/index.mjs +36 -36
- package/dist/lib/index.js +15 -15
- package/dist/src/components/Markdown/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -288,7 +288,7 @@ ${t}` : t, r = new _(i, l, W.User, n);
|
|
|
288
288
|
if (!t)
|
|
289
289
|
return;
|
|
290
290
|
const n = (i) => {
|
|
291
|
-
if (i.sessionId && i.sessionId !== Ne.current || i.role === W.User)
|
|
291
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Ne.current || i.role === W.User)
|
|
292
292
|
return;
|
|
293
293
|
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (H(!1), M(!1), h.current = h.current.filter((a) => !a.isWaiting), I([...h.current]), h.current = [...h.current], i.content))
|
|
294
294
|
return Qt.error({
|
|
@@ -46,7 +46,7 @@ const u = (o) => {
|
|
|
46
46
|
const r = JSON.parse(JSON.stringify(o)) || [], a = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
|
|
47
47
|
return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
|
|
48
48
|
}, Ke = (o) => {
|
|
49
|
-
var S, b, E, k, T, A,
|
|
49
|
+
var S, b, E, k, T, A, x, O, F;
|
|
50
50
|
const {
|
|
51
51
|
application: r,
|
|
52
52
|
currentSession: a,
|
|
@@ -118,6 +118,7 @@ const u = (o) => {
|
|
|
118
118
|
children: /* @__PURE__ */ e("span", {
|
|
119
119
|
className: "item-user-content",
|
|
120
120
|
children: /* @__PURE__ */ e(C, {
|
|
121
|
+
showLatex: !1,
|
|
121
122
|
children: Se(t.content)
|
|
122
123
|
})
|
|
123
124
|
})
|
|
@@ -296,7 +297,7 @@ const u = (o) => {
|
|
|
296
297
|
}), /* @__PURE__ */ e(C, {
|
|
297
298
|
children: t.content
|
|
298
299
|
})]
|
|
299
|
-
}), (A = t == null ? void 0 : t.reference) != null && A.length && !((
|
|
300
|
+
}), (A = t == null ? void 0 : t.reference) != null && A.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(K, {
|
|
300
301
|
history: t,
|
|
301
302
|
docViewerUrl: g
|
|
302
303
|
}) : null, t.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
|
|
@@ -315,7 +316,7 @@ const u = (o) => {
|
|
|
315
316
|
size: 4,
|
|
316
317
|
text: "思考中"
|
|
317
318
|
})
|
|
318
|
-
}), (i == null ? void 0 : i.relate) && h && !!((
|
|
319
|
+
}), (i == null ? void 0 : i.relate) && h && !!((O = t.relatedQuesion) != null && O.length) && /* @__PURE__ */ e(Ce, {
|
|
319
320
|
relatedQuesion: t.relatedQuesion,
|
|
320
321
|
onRelatedClick: Y
|
|
321
322
|
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(ae, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as p } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { ExclamationCircleFilled as f } from "@ant-design/icons";
|
|
3
3
|
import { Modal as u, Button as s } from "antd";
|
|
4
4
|
import { useContext as h } from "react";
|
|
@@ -14,28 +14,26 @@ const E = (r) => {
|
|
|
14
14
|
service: n
|
|
15
15
|
} = h(C), d = /* @__PURE__ */ p("div", {
|
|
16
16
|
className: "title",
|
|
17
|
-
children: [/* @__PURE__ */
|
|
17
|
+
children: [/* @__PURE__ */ e(f, {
|
|
18
18
|
style: {
|
|
19
19
|
color: "#FF9326",
|
|
20
20
|
fontSize: 20
|
|
21
21
|
}
|
|
22
|
-
}), /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ e("span", {
|
|
23
23
|
children: "文件任务正在处理"
|
|
24
24
|
})]
|
|
25
25
|
}), m = () => {
|
|
26
26
|
if (!l)
|
|
27
27
|
return;
|
|
28
28
|
const i = [];
|
|
29
|
-
a.filter((
|
|
30
|
-
id:
|
|
31
|
-
status:
|
|
29
|
+
a.filter((o) => o.id).forEach((o) => i.push({
|
|
30
|
+
id: o.id,
|
|
31
|
+
status: o.status
|
|
32
32
|
})), n == null || n.deleteSessionKnowledgeFiles(l, {
|
|
33
33
|
files: i
|
|
34
|
-
}).then((e) => {
|
|
35
|
-
console.log(e);
|
|
36
34
|
}), t("abandon");
|
|
37
35
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ e(u, {
|
|
39
37
|
className: "prompt-modal",
|
|
40
38
|
width: 340,
|
|
41
39
|
open: c,
|
|
@@ -44,19 +42,19 @@ const E = (r) => {
|
|
|
44
42
|
maskClosable: !1,
|
|
45
43
|
onCancel: () => t("close"),
|
|
46
44
|
getContainer: document.getElementById("dialog-modal") || !1,
|
|
47
|
-
footer: [/* @__PURE__ */
|
|
45
|
+
footer: [/* @__PURE__ */ e(s, {
|
|
48
46
|
onClick: () => {
|
|
49
47
|
m();
|
|
50
48
|
},
|
|
51
49
|
children: "放弃文件"
|
|
52
|
-
}, "cancel"), /* @__PURE__ */
|
|
50
|
+
}, "cancel"), /* @__PURE__ */ e(s, {
|
|
53
51
|
type: "primary",
|
|
54
52
|
onClick: () => {
|
|
55
53
|
t("continue");
|
|
56
54
|
},
|
|
57
55
|
children: "继续上传"
|
|
58
56
|
}, "confirm")],
|
|
59
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ e("div", {
|
|
60
58
|
className: "content",
|
|
61
59
|
children: "你可以选择后台继续上传,也可以直接离开放弃上传中的文件。"
|
|
62
60
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as s, jsx as r } from "../_virtual/jsx-runtime.mjs";
|
|
2
|
-
import { forwardRef as X, useState as o, useRef as O, useImperativeHandle as Y, useEffect as
|
|
2
|
+
import { forwardRef as X, useState as o, useRef as O, useImperativeHandle as Y, useEffect as g } from "react";
|
|
3
3
|
import Z from "react-quill";
|
|
4
4
|
import T from "../node_modules/classnames/index.mjs";
|
|
5
5
|
import ee from "../Iconfont/index.mjs";
|
|
@@ -25,15 +25,14 @@ const ie = X((z, F) => {
|
|
|
25
25
|
prevent: H,
|
|
26
26
|
focus: x,
|
|
27
27
|
update: W
|
|
28
|
-
})),
|
|
29
|
-
l(N), n.current && (
|
|
28
|
+
})), g(() => {
|
|
29
|
+
l(N), n.current && (f(), x());
|
|
30
30
|
}, [N]);
|
|
31
31
|
const W = (e) => {
|
|
32
32
|
l(e);
|
|
33
33
|
}, $ = () => {
|
|
34
34
|
l(void 0), w(void 0);
|
|
35
35
|
}, H = () => {
|
|
36
|
-
console.log("prevent");
|
|
37
36
|
}, x = () => {
|
|
38
37
|
if (!n.current || b)
|
|
39
38
|
return;
|
|
@@ -42,15 +41,15 @@ const ie = X((z, F) => {
|
|
|
42
41
|
e.getLength() > 0 && e.setSelection(e.getLength(), e.getLength());
|
|
43
42
|
});
|
|
44
43
|
};
|
|
45
|
-
|
|
44
|
+
g(() => {
|
|
46
45
|
if (!n.current)
|
|
47
46
|
return;
|
|
48
47
|
const e = n.current.getEditor();
|
|
49
48
|
c && (e.on("text-change", () => {
|
|
50
|
-
e.getLength() > c && e.deleteText(c, e.getLength()),
|
|
49
|
+
e.getLength() > c && e.deleteText(c, e.getLength()), f(), K(), x();
|
|
51
50
|
}), e.on("selection-change", K));
|
|
52
51
|
}, [n, c]);
|
|
53
|
-
const
|
|
52
|
+
const f = () => {
|
|
54
53
|
if (!n.current)
|
|
55
54
|
return;
|
|
56
55
|
const e = n.current.getEditor();
|
|
@@ -85,11 +84,11 @@ const ie = X((z, F) => {
|
|
|
85
84
|
const e = (t = n.current) == null ? void 0 : t.getEditor();
|
|
86
85
|
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));
|
|
87
86
|
};
|
|
88
|
-
return
|
|
87
|
+
return g(() => {
|
|
89
88
|
var e, t;
|
|
90
89
|
m ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
|
|
91
|
-
}, [m]),
|
|
92
|
-
window.removeEventListener("resize",
|
|
90
|
+
}, [m]), g(() => (window.addEventListener("resize", f), () => {
|
|
91
|
+
window.removeEventListener("resize", f);
|
|
93
92
|
}), []), /* @__PURE__ */ s("div", {
|
|
94
93
|
className: T({
|
|
95
94
|
"quill-editor": !0,
|
|
@@ -1,53 +1,69 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var o in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
var c = Object.defineProperty, g = Object.defineProperties;
|
|
2
|
+
var h = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var t = Object.getOwnPropertySymbols;
|
|
4
|
+
var l = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (r, e, o) => e in r ? c(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, a = (r, e) => {
|
|
6
|
+
for (var o in e || (e = {}))
|
|
7
|
+
l.call(e, o) && f(r, o, e[o]);
|
|
8
|
+
if (t)
|
|
9
|
+
for (var o of t(e))
|
|
10
|
+
s.call(e, o) && f(r, o, e[o]);
|
|
11
|
+
return r;
|
|
12
|
+
}, d = (r, e) => g(r, h(e));
|
|
13
|
+
var k = (r, e) => {
|
|
14
|
+
var o = {};
|
|
15
|
+
for (var m in r)
|
|
16
|
+
l.call(r, m) && e.indexOf(m) < 0 && (o[m] = r[m]);
|
|
17
|
+
if (r != null && t)
|
|
18
|
+
for (var m of t(r))
|
|
19
|
+
e.indexOf(m) < 0 && s.call(r, m) && (o[m] = r[m]);
|
|
20
|
+
return o;
|
|
21
|
+
};
|
|
22
|
+
import { jsx as i } from "../../_virtual/jsx-runtime.mjs";
|
|
23
|
+
import { useRef as w } from "react";
|
|
24
|
+
import x from "react-markdown";
|
|
25
|
+
import M from "remark-gfm";
|
|
26
|
+
import y from "rehype-raw";
|
|
27
|
+
import R from "rehype-external-links";
|
|
19
28
|
import "../../node_modules/katex/dist/katex.min.css.mjs";
|
|
20
29
|
import "./style.less.mjs";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { replaceLatexDelimiters as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
import L from "./Image/index.mjs";
|
|
31
|
+
import P from "./Code/index.mjs";
|
|
32
|
+
import { replaceLatexDelimiters as b } from "../../utils/index.mjs";
|
|
33
|
+
import j from "../../node_modules/rehype-katex/lib/index.mjs";
|
|
34
|
+
import v from "../../node_modules/remark-math/lib/index.mjs";
|
|
35
|
+
const H = (m) => {
|
|
36
|
+
var p = m, {
|
|
37
|
+
showLatex: r = !0,
|
|
38
|
+
children: e
|
|
39
|
+
} = p, o = k(p, [
|
|
40
|
+
"showLatex",
|
|
41
|
+
"children"
|
|
42
|
+
]);
|
|
43
|
+
const u = w(null);
|
|
44
|
+
return /* @__PURE__ */ i("div", {
|
|
45
|
+
ref: u,
|
|
46
|
+
children: /* @__PURE__ */ i(x, d(a({
|
|
31
47
|
className: "markdown",
|
|
32
|
-
rehypePlugins: [
|
|
48
|
+
rehypePlugins: [j, y, [R, {
|
|
33
49
|
target: "_blank"
|
|
34
50
|
}]],
|
|
35
|
-
remarkPlugins: [
|
|
51
|
+
remarkPlugins: [v, [M, {
|
|
36
52
|
singleTilde: !1
|
|
37
53
|
}]]
|
|
38
|
-
},
|
|
39
|
-
children:
|
|
54
|
+
}, o), {
|
|
55
|
+
children: r ? b(e) : e,
|
|
40
56
|
components: {
|
|
41
|
-
img(
|
|
42
|
-
return /* @__PURE__ */
|
|
57
|
+
img(n) {
|
|
58
|
+
return /* @__PURE__ */ i(L, a({}, n));
|
|
43
59
|
},
|
|
44
|
-
code(
|
|
45
|
-
return /* @__PURE__ */
|
|
60
|
+
code(n) {
|
|
61
|
+
return /* @__PURE__ */ i(P, a({}, n));
|
|
46
62
|
}
|
|
47
63
|
}
|
|
48
64
|
}))
|
|
49
65
|
});
|
|
50
66
|
};
|
|
51
67
|
export {
|
|
52
|
-
|
|
68
|
+
H as default
|
|
53
69
|
};
|