@glodon-aiot/agent-cli-ui 3.15.0-alpha.1 → 3.15.0-alpha.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.
@@ -1,4 +1,4 @@
1
- import { jsxs as g, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
2
  import { useContext as b, useState as x, useEffect as v } from "react";
3
3
  /* empty css */import { Typography as w, message as m } from "antd";
4
4
  import { getFileExtension as C, formatFileSize as y, isValidImageUrlWithAnyExtension as I } from "../../../../utils/index.mjs";
@@ -12,7 +12,7 @@ const K = (u) => {
12
12
  docViewerUrl: f
13
13
  } = u, {
14
14
  service: l,
15
- popupContainer: r
15
+ popupContainer: o
16
16
  } = b(E), [e, h] = x(), [t, p] = x("");
17
17
  v(() => {
18
18
  var n;
@@ -33,7 +33,7 @@ const K = (u) => {
33
33
  const F = (n) => {
34
34
  if (!(n != null && n.url)) {
35
35
  m.config({
36
- getContainer: () => (r == null ? void 0 : r.current) || document.body,
36
+ getContainer: () => (o == null ? void 0 : o.current) || document.body,
37
37
  prefixCls: "gbot-message"
38
38
  }), m.error("链接不存在"), m.config({
39
39
  getContainer: void 0,
@@ -43,7 +43,7 @@ const K = (u) => {
43
43
  }
44
44
  if (!I(n.url)) {
45
45
  m.config({
46
- getContainer: () => (r == null ? void 0 : r.current) || document.body,
46
+ getContainer: () => (o == null ? void 0 : o.current) || document.body,
47
47
  prefixCls: "gbot-message"
48
48
  }), m.error("链接格式不正确"), m.config({
49
49
  getContainer: void 0,
@@ -51,22 +51,22 @@ const K = (u) => {
51
51
  });
52
52
  return;
53
53
  }
54
- window.open(`${f}#/doc?url=${encodeURIComponent(n == null ? void 0 : n.url)}`);
54
+ window.open(`${f}?url=${encodeURIComponent(n == null ? void 0 : n.url)}`);
55
55
  };
56
56
  return /* @__PURE__ */ g("div", {
57
57
  className: "file-item",
58
58
  onClick: () => F(e),
59
- children: [/* @__PURE__ */ o("div", {
59
+ children: [/* @__PURE__ */ r("div", {
60
60
  className: "item-left",
61
- children: /* @__PURE__ */ o("img", {
61
+ children: /* @__PURE__ */ r("img", {
62
62
  className: "file-icon",
63
63
  src: U[t]
64
64
  })
65
65
  }), /* @__PURE__ */ g("div", {
66
66
  className: "item-main",
67
- children: [/* @__PURE__ */ o("div", {
67
+ children: [/* @__PURE__ */ r("div", {
68
68
  className: "file-name",
69
- children: /* @__PURE__ */ o(w.Paragraph, {
69
+ children: /* @__PURE__ */ r(w.Paragraph, {
70
70
  style: {
71
71
  margin: 0,
72
72
  width: "100%"
@@ -79,11 +79,11 @@ const K = (u) => {
79
79
  })
80
80
  }), /* @__PURE__ */ g("div", {
81
81
  className: "file-desc",
82
- children: [/* @__PURE__ */ o("span", {
82
+ children: [/* @__PURE__ */ r("span", {
83
83
  children: t == null ? void 0 : t.toUpperCase()
84
- }), /* @__PURE__ */ o("span", {
84
+ }), /* @__PURE__ */ r("span", {
85
85
  children: ","
86
- }), /* @__PURE__ */ o("span", {
86
+ }), /* @__PURE__ */ r("span", {
87
87
  children: y((e == null ? void 0 : e.size) || 0)
88
88
  })]
89
89
  })]
@@ -1,58 +1,58 @@
1
1
  var a = (p, e, i) => new Promise((l, n) => {
2
2
  var m = (o) => {
3
3
  try {
4
- r(i.next(o));
5
- } catch (c) {
6
- n(c);
4
+ s(i.next(o));
5
+ } catch (r) {
6
+ n(r);
7
7
  }
8
8
  }, k = (o) => {
9
9
  try {
10
- r(i.throw(o));
11
- } catch (c) {
12
- n(c);
10
+ s(i.throw(o));
11
+ } catch (r) {
12
+ n(r);
13
13
  }
14
- }, r = (o) => o.done ? l(o.value) : Promise.resolve(o.value).then(m, k);
15
- r((i = i.apply(p, e)).next());
14
+ }, s = (o) => o.done ? l(o.value) : Promise.resolve(o.value).then(m, k);
15
+ s((i = i.apply(p, e)).next());
16
16
  });
17
- import { jsxs as g, jsx as t } from "react/jsx-runtime";
18
- import { useContext as w } from "react";
17
+ import { jsxs as w, jsx as c } from "react/jsx-runtime";
18
+ import { useContext as g } from "react";
19
19
  import { Space as h, Tooltip as I, Button as y } from "antd";
20
20
  import { ISourceType as f, IversionInfo as b } from "@glodon-aiot/apis";
21
21
  import x from "../../../../../context.mjs";
22
22
  import C from "../../../../../components/WebLink/index.mjs";
23
23
  import d from "../../../../../components/Iconfont/index.mjs";
24
24
  const j = (p) => {
25
- var o, c;
25
+ var o, r;
26
26
  const {
27
27
  data: e,
28
28
  onClick: i,
29
29
  loadPage: l
30
30
  } = p, {
31
31
  transform: n
32
- } = w(x), m = () => a(void 0, null, function* () {
33
- return l ? yield l(e.knowledgeId, e.docId, e.textId) : 0;
34
- }), k = e.sourceType === f.WebLink && !!e.webLink, r = (
32
+ } = g(x), m = () => a(void 0, null, function* () {
33
+ return l ? yield l(e.knowledgeId, e.docId, e.textId).catch((t) => (console.warn("查询参考文件页码失败,即将打开首页", t), 0)) : 0;
34
+ }), k = e.sourceType === f.WebLink && !!e.webLink, s = (
35
35
  // data?.origin === IFileOrigin.AECPILOT ||
36
36
  e.sourceType === f.SourceFile && !!e.sourceFileName && // data.sourceFileName 标识参考文件存在与否,不能使用其他字段判断
37
37
  (e == null ? void 0 : e.versionInfo) !== b.ProtectUnauthorize
38
38
  );
39
- return /* @__PURE__ */ g(h, {
39
+ return /* @__PURE__ */ w(h, {
40
40
  className: "session-refer-panel",
41
- children: [/* @__PURE__ */ t("span", {
41
+ children: [/* @__PURE__ */ c("span", {
42
42
  className: "refer-panel-item",
43
43
  children: (e.knowledgeSourceName || "") + (e.knowledgeTitleName || "") || "-"
44
- }), k && ((o = n == null ? void 0 : n.reference) == null ? void 0 : o.iconVisible) && /* @__PURE__ */ t(I, {
44
+ }), k && ((o = n == null ? void 0 : n.reference) == null ? void 0 : o.iconVisible) && /* @__PURE__ */ c(I, {
45
45
  overlayStyle: {
46
46
  maxWidth: "90vw"
47
47
  },
48
- title: /* @__PURE__ */ t(C, {
48
+ title: /* @__PURE__ */ c(C, {
49
49
  href: e.webLink,
50
- onClick: (s) => {
51
- s.stopPropagation();
50
+ onClick: (t) => {
51
+ t.stopPropagation();
52
52
  }
53
53
  }),
54
- children: /* @__PURE__ */ t(y, {
55
- icon: /* @__PURE__ */ t(d, {
54
+ children: /* @__PURE__ */ c(y, {
55
+ icon: /* @__PURE__ */ c(d, {
56
56
  type: e.sourceType === f.WebLink ? "icon-lianjie" : "icon-doc-link",
57
57
  style: {
58
58
  fontSize: 16
@@ -60,12 +60,12 @@ const j = (p) => {
60
60
  }),
61
61
  type: "link",
62
62
  size: "small",
63
- onClick: (s) => a(void 0, null, function* () {
64
- s.stopPropagation(), i(e);
63
+ onClick: (t) => a(void 0, null, function* () {
64
+ t.stopPropagation(), i(e);
65
65
  })
66
66
  })
67
- }), r && ((c = n == null ? void 0 : n.reference) == null ? void 0 : c.iconVisible) && /* @__PURE__ */ t(y, {
68
- icon: /* @__PURE__ */ t(d, {
67
+ }), s && ((r = n == null ? void 0 : n.reference) == null ? void 0 : r.iconVisible) && /* @__PURE__ */ c(y, {
68
+ icon: /* @__PURE__ */ c(d, {
69
69
  type: "icon-doc-link",
70
70
  style: {
71
71
  fontSize: 16
@@ -73,8 +73,8 @@ const j = (p) => {
73
73
  }),
74
74
  type: "link",
75
75
  size: "small",
76
- onClick: (s) => a(void 0, null, function* () {
77
- s.stopPropagation();
76
+ onClick: (t) => a(void 0, null, function* () {
77
+ t.stopPropagation();
78
78
  const u = (yield m()) || 0;
79
79
  i(e, u);
80
80
  })
@@ -36,7 +36,7 @@ const {
36
36
  window.open(o.webLink);
37
37
  return;
38
38
  }
39
- o.sourceType === g.SourceFile && window.open(`${n}#/doc?url=${encodeURIComponent(o.sourceFileUrl)}&page=${i || 0}`);
39
+ o.sourceType === g.SourceFile && window.open(`${n}?page=${i || 0}&url=${encodeURIComponent(o.sourceFileUrl)}`);
40
40
  }
41
41
  };
42
42
  return /* @__PURE__ */ t("div", {
@@ -305,7 +305,7 @@ const j = 50, U = 10, ve = xe((M, P) => {
305
305
  y("error", "链接格式不正确");
306
306
  return;
307
307
  }
308
- window.open(`${Y}#/doc?url=${encodeURIComponent(e == null ? void 0 : e.url)}`);
308
+ window.open(`${Y}?url=${encodeURIComponent(e == null ? void 0 : e.url)}`);
309
309
  },
310
310
  remove: () => {
311
311
  de(e);