@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.4

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 (150) hide show
  1. package/dist/es/AgentClientUI.mjs +97 -110
  2. package/dist/es/Dialog/AgentChat/index.mjs +516 -467
  3. package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
  4. package/dist/es/Dialog/FileCard/index.mjs +48 -55
  5. package/dist/es/Dialog/FilePreview/index.mjs +35 -42
  6. package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
  7. package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
  8. package/dist/es/Dialog/PromptManager/index.mjs +29 -36
  9. package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
  10. package/dist/es/Dialog/SessionAction/index.mjs +92 -91
  11. package/dist/es/Dialog/SessionList/index.mjs +135 -121
  12. package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
  13. package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
  14. package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
  15. package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
  16. package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
  17. package/dist/es/Dialog/index.mjs +125 -93
  18. package/dist/es/QuillEditor/index.mjs +91 -86
  19. package/dist/es/_virtual/index.mjs +2 -2
  20. package/dist/es/components/Markdown/Image/index.mjs +20 -20
  21. package/dist/es/components/Markdown/index.mjs +27 -22
  22. package/dist/es/constant.mjs +8 -5
  23. package/dist/es/index.mjs +178 -152
  24. package/dist/es/node_modules/classnames/index.mjs +1 -1
  25. package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
  26. package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
  27. package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
  28. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
  29. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
  30. package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
  31. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
  32. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
  33. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
  34. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
  35. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
  36. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
  37. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
  38. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
  39. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
  40. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
  41. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
  42. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
  43. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
  44. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
  45. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
  46. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
  47. package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
  48. package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
  49. package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
  50. package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
  51. package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
  52. package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
  53. package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
  54. package/dist/es/node_modules/longest-streak/index.mjs +12 -0
  55. package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
  56. package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
  57. package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
  58. package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
  59. package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
  60. package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
  61. package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
  62. package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
  63. package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
  64. package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
  65. package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
  66. package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
  67. package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
  68. package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
  69. package/dist/es/utils/index.mjs +44 -27
  70. package/dist/lib/index.js +278 -138
  71. package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
  72. package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
  73. package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
  74. package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
  75. package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
  76. package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
  77. package/dist/src/Dialog/SessionList/index.d.ts +5 -4
  78. package/dist/src/QuillEditor/index.d.ts +1 -0
  79. package/dist/src/components/Markdown/Text/index.d.ts +8 -0
  80. package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
  81. package/dist/src/components/MathJaxRender/index.d.ts +6 -0
  82. package/dist/src/constant.d.ts +1 -1
  83. package/dist/src/contexts/MathJaxContext.d.ts +12 -0
  84. package/dist/src/index.d.ts +4 -1
  85. package/dist/src/types.d.ts +26 -6
  86. package/dist/src/utils/index.d.ts +15 -0
  87. package/package.json +18 -17
  88. package/dist/es/_virtual/index2.mjs +0 -4
  89. package/dist/es/_virtual/index3.mjs +0 -4
  90. package/dist/es/_virtual/index4.mjs +0 -4
  91. package/dist/es/_virtual/minio-zj.mjs +0 -4
  92. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
  93. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
  94. package/dist/es/node_modules/base64-js/index.mjs +0 -47
  95. package/dist/es/node_modules/buffer/index.mjs +0 -927
  96. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
  97. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
  98. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
  99. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
  100. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
  101. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
  102. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
  103. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
  104. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
  105. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
  106. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
  107. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
  108. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
  109. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
  110. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
  111. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
  112. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
  113. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
  114. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
  115. package/dist/es/node_modules/ieee754/index.mjs +0 -28
  116. package/dist/es/node_modules/js-base64/base64.mjs +0 -31
  117. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
  118. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
  119. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
  120. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
  121. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
  122. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
  123. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
  124. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
  125. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
  126. package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
  127. package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
  128. package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
  129. package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
  130. package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
  131. package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
  132. package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
  133. package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
  134. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
  135. package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
  136. package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
  137. package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
  138. package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
  139. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
  140. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
  141. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
  142. package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
  143. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
  144. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
  145. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
  146. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
  147. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
  148. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
  149. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
  150. package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
@@ -1,36 +1,37 @@
1
- import { jsx as e, Fragment as g, jsxs as r } from "../../_virtual/jsx-runtime.mjs";
2
- import { useState as l, useEffect as c } from "react";
1
+ import { jsx as e, Fragment as g, jsxs as c } from "../../_virtual/jsx-runtime.mjs";
2
+ import { useState as l, useEffect as d } from "react";
3
3
  import "./style.less.mjs";
4
4
  import { Button as k } from "antd";
5
5
  import { CloseOutlined as v } from "@ant-design/icons";
6
- import d from "../../Iconfont/index.mjs";
7
- const E = (f) => {
6
+ import f from "../../Iconfont/index.mjs";
7
+ const F = (p) => {
8
8
  const {
9
9
  sessionId: u,
10
10
  netStatus: s,
11
11
  enable: t,
12
- onNetStatusChange: p
13
- } = f, [m, i] = l(!1), [o, a] = l(!1), [h, n] = l(
12
+ disabledTip: a = "上传文件后,该会话自动停止网络访问",
13
+ onNetStatusChange: m
14
+ } = p, [h, i] = l(!1), [o, r] = l(!1), [C, n] = l(
14
15
  "#070C14"
15
16
  /* default */
16
17
  );
17
- c(() => {
18
- a(!t), t || n(
18
+ d(() => {
19
+ r(!t), t || n(
19
20
  "#070C14"
20
21
  /* default */
21
22
  );
22
23
  }, [u, t]);
23
- const C = () => {
24
- a(!1);
24
+ const S = () => {
25
+ r(!1);
25
26
  };
26
- c(() => {
27
+ d(() => {
27
28
  i(o);
28
29
  }, [o]);
29
- const S = (y) => {
30
- p(y);
30
+ const y = (b) => {
31
+ m(b);
31
32
  };
32
33
  return /* @__PURE__ */ e(g, {
33
- children: /* @__PURE__ */ r("div", {
34
+ children: /* @__PURE__ */ c("div", {
34
35
  className: "connect",
35
36
  onMouseEnter: () => {
36
37
  i(!0);
@@ -40,17 +41,17 @@ const E = (f) => {
40
41
  },
41
42
  children: [/* @__PURE__ */ e(k, {
42
43
  type: "link",
43
- icon: s ? /* @__PURE__ */ e(d, {
44
+ icon: s ? /* @__PURE__ */ e(f, {
44
45
  className: "link-btn",
45
46
  type: "icon-yilianwang",
46
47
  style: {
47
48
  fontSize: 22
48
49
  }
49
- }) : /* @__PURE__ */ e(d, {
50
+ }) : /* @__PURE__ */ e(f, {
50
51
  className: "link-not-btn",
51
52
  type: "icon-lianwangguanbi",
52
53
  style: {
53
- color: h,
54
+ color: C,
54
55
  fontSize: 22
55
56
  },
56
57
  onMouseEnter: () => {
@@ -66,27 +67,27 @@ const E = (f) => {
66
67
  }),
67
68
  disabled: !t,
68
69
  onClick: () => {
69
- S(!s);
70
+ y(!s);
70
71
  }
71
- }), m && /* @__PURE__ */ e("div", {
72
+ }), h && /* @__PURE__ */ e("div", {
72
73
  className: "net-tip",
73
- children: t ? s ? "网络访问已开启" : "网络访问已关闭" : o ? /* @__PURE__ */ r("div", {
74
+ children: t ? s ? "网络访问已开启" : "网络访问已关闭" : o ? /* @__PURE__ */ c("div", {
74
75
  style: {
75
76
  display: "flex",
76
77
  gap: 6
77
78
  },
78
79
  children: [/* @__PURE__ */ e("span", {
79
- children: "上传文件后,该会话自动停止网络访问"
80
+ children: a
80
81
  }), /* @__PURE__ */ e("div", {
81
82
  children: /* @__PURE__ */ e(v, {
82
- onClick: C
83
+ onClick: S
83
84
  })
84
85
  })]
85
- }) : "上传文件后,该会话自动停止网络访问"
86
+ }) : a
86
87
  })]
87
88
  })
88
89
  });
89
90
  };
90
91
  export {
91
- E as default
92
+ F as default
92
93
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as c, jsx as e, Fragment as U } from "../../_virtual/jsx-runtime.mjs";
1
+ import { jsxs as r, jsx as i, Fragment as U } from "../../_virtual/jsx-runtime.mjs";
2
2
  import { useState as d, useEffect as a } from "react";
3
3
  import "./style.less.mjs";
4
4
  import z from "./doc-icons/pdf.svg.mjs";
@@ -6,137 +6,130 @@ import j from "./doc-icons/doc.svg.mjs";
6
6
  import O from "./doc-icons/docx.svg.mjs";
7
7
  import { Typography as P, Spin as T } from "antd";
8
8
  import { LoadingOutlined as K, CloseCircleFilled as L, CloseOutlined as N } from "@ant-design/icons";
9
- import "axios";
10
- import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
11
- import "dayjs";
12
- import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
13
- import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
14
- import "../../packages/apis/dist/es/agentcliui/index.mjs";
15
- import "../../packages/apis/dist/es/aecpilotui/index.mjs";
16
- import { KnowledgeFileStatus as F } from "../../packages/apis/dist/es/cvforce/model.mjs";
9
+ import { KnowledgeFileStatus as F } from "@glodon-aiot/apis";
17
10
  import $ from "../../Iconfont/index.mjs";
18
11
  import { getFileExtension as b } from "../../utils/index.mjs";
19
12
  const q = {
20
13
  doc: j,
21
14
  docx: O,
22
15
  pdf: z
23
- }, ni = (o) => {
16
+ }, Y = (n) => {
24
17
  const {
25
18
  className: k,
26
19
  style: S,
27
- id: n,
28
- file: i,
20
+ id: o,
21
+ file: e,
29
22
  actions: {
30
23
  upload: m,
31
24
  remove: l,
32
- download: h,
25
+ download: p,
33
26
  checkStatus: f,
34
27
  preview: u
35
28
  } = {},
36
29
  onUrlChange: g,
37
30
  onStatusChange: v
38
- } = o, y = b((i == null ? void 0 : i.name) || ""), [w, s] = d(o.uploading), [A, E] = d(!1);
31
+ } = n, y = b((e == null ? void 0 : e.name) || ""), [w, s] = d(n.uploading), [A, E] = d(!1);
39
32
  a(() => {
40
- s(o.uploading);
41
- }, [o.uploading]);
42
- const [x, C] = d(o.url);
33
+ s(n.uploading);
34
+ }, [n.uploading]);
35
+ const [x, C] = d(n.url);
43
36
  a(() => {
44
- C(o.url);
45
- }, [o.url]), a(() => {
46
- m && i instanceof File && (x || (s(!0), setTimeout(() => {
37
+ C(n.url);
38
+ }, [n.url]), a(() => {
39
+ m && e instanceof File && (x || (s(!0), setTimeout(() => {
47
40
  s(!1);
48
- }, 2e3), m(i).then((t) => {
41
+ }, 2e3), m(e).then((t) => {
49
42
  C(t), g && g(t);
50
43
  }).catch((t) => E(t)).finally(() => {
51
44
  s(!1);
52
45
  })));
53
- }, [m, x, i]);
54
- const [r, p] = d(i instanceof File || i == null ? void 0 : i.status);
46
+ }, [m, x, e]);
47
+ const [c, h] = d(e instanceof File || e == null ? void 0 : e.status);
55
48
  a(() => {
56
- p(i instanceof File || i == null ? void 0 : i.status);
57
- }, [i]);
49
+ h(e instanceof File || e == null ? void 0 : e.status);
50
+ }, [e]);
58
51
  const I = () => {
59
- n && f && r === F.Processing && f(n).then((t) => {
60
- t !== r && (r !== void 0 && v && v(t), p(t));
61
- }).catch((t) => p(F.Failed));
52
+ o && f && c === F.Processing && f(o).then((t) => {
53
+ t !== c && (c !== void 0 && v && v(t), h(t));
54
+ }).catch((t) => h(F.Failed));
62
55
  };
63
56
  return a(() => {
64
57
  I();
65
- }, [n, f, r]), i ? /* @__PURE__ */ c("div", {
58
+ }, [o, f, c]), e ? /* @__PURE__ */ r("div", {
66
59
  className: `file-card ${k}`,
67
60
  style: S,
68
- children: [y && /* @__PURE__ */ e("img", {
61
+ children: [y && /* @__PURE__ */ i("img", {
69
62
  className: "file-icon",
70
63
  src: q[y]
71
- }), /* @__PURE__ */ e("div", {
64
+ }), /* @__PURE__ */ i("div", {
72
65
  className: "file-desc",
73
- children: /* @__PURE__ */ e("div", {
66
+ children: /* @__PURE__ */ i("div", {
74
67
  className: "file-desc-name",
75
- onClick: () => u == null ? void 0 : u(i),
76
- children: /* @__PURE__ */ e(P.Paragraph, {
68
+ onClick: () => u == null ? void 0 : u(e),
69
+ children: /* @__PURE__ */ i(P.Paragraph, {
77
70
  style: {
78
71
  margin: 0
79
72
  },
80
73
  ellipsis: {
81
74
  rows: 1,
82
- tooltip: i.name
75
+ tooltip: e.name
83
76
  },
84
- children: i.name
77
+ children: e.name
85
78
  })
86
79
  })
87
- }), (i == null ? void 0 : i.status) === 1 ? /* @__PURE__ */ c("div", {
80
+ }), (e == null ? void 0 : e.status) === 1 ? /* @__PURE__ */ r("div", {
88
81
  className: "analysis",
89
- children: [/* @__PURE__ */ e(T, {
90
- indicator: /* @__PURE__ */ e(K, {
82
+ children: [/* @__PURE__ */ i(T, {
83
+ indicator: /* @__PURE__ */ i(K, {
91
84
  style: {
92
85
  fontSize: 16
93
86
  },
94
87
  spin: !0
95
88
  })
96
- }), /* @__PURE__ */ e("span", {
89
+ }), /* @__PURE__ */ i("span", {
97
90
  children: "解析中"
98
91
  })]
99
- }) : (i == null ? void 0 : i.status) === 3 ? l && /* @__PURE__ */ c("div", {
92
+ }) : (e == null ? void 0 : e.status) === 3 ? l && /* @__PURE__ */ r("div", {
100
93
  style: {
101
94
  display: "flex",
102
95
  gap: 6
103
96
  },
104
- children: [/* @__PURE__ */ e("div", {
97
+ children: [/* @__PURE__ */ i("div", {
105
98
  className: "file-action file-failed",
106
- children: /* @__PURE__ */ e(L, {})
107
- }), /* @__PURE__ */ e("div", {
99
+ children: /* @__PURE__ */ i(L, {})
100
+ }), /* @__PURE__ */ i("div", {
108
101
  className: "file-action file-remove",
109
102
  onClick: () => {
110
- l(i, n);
103
+ l(e, o);
111
104
  },
112
- children: /* @__PURE__ */ e(N, {})
105
+ children: /* @__PURE__ */ i(N, {})
113
106
  })]
114
- }) : l && h && /* @__PURE__ */ c("div", {
107
+ }) : l && p && /* @__PURE__ */ r("div", {
115
108
  style: {
116
109
  display: "flex",
117
110
  gap: 6
118
111
  },
119
- children: [/* @__PURE__ */ e("div", {
112
+ children: [/* @__PURE__ */ i("div", {
120
113
  className: "file-action file-remove",
121
114
  onClick: () => {
122
- h(i, n);
115
+ p(e, o);
123
116
  },
124
- children: /* @__PURE__ */ e($, {
117
+ children: /* @__PURE__ */ i($, {
125
118
  type: "icon-xiazai",
126
119
  style: {
127
120
  fontSize: 16
128
121
  }
129
122
  })
130
- }), /* @__PURE__ */ e("div", {
123
+ }), /* @__PURE__ */ i("div", {
131
124
  className: "file-action file-remove",
132
125
  onClick: () => {
133
- l(i, n);
126
+ l(e, o);
134
127
  },
135
- children: /* @__PURE__ */ e(N, {})
128
+ children: /* @__PURE__ */ i(N, {})
136
129
  })]
137
130
  })]
138
- }) : /* @__PURE__ */ e(U, {});
131
+ }) : /* @__PURE__ */ i(U, {});
139
132
  };
140
133
  export {
141
- ni as default
134
+ Y as default
142
135
  };
@@ -1,63 +1,56 @@
1
1
  import { jsxs as x, jsx as o, Fragment as U } from "../../_virtual/jsx-runtime.mjs";
2
- import { useState as c, useEffect as r } from "react";
2
+ import { useState as s, useEffect as n } from "react";
3
3
  import "./style.less.mjs";
4
4
  import { Image as k, Spin as E, Tooltip as j, Button as z } from "antd";
5
5
  import { LoadingOutlined as B } from "@ant-design/icons";
6
6
  import I from "../../Iconfont/index.mjs";
7
- import "axios";
8
- import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
9
- import { AecKnowledgeFileStatus as F } from "../../packages/apis/dist/es/aecpilot/model.mjs";
10
- import "dayjs";
11
- import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
12
- import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
13
- import "../../packages/apis/dist/es/agentcliui/index.mjs";
14
- import "../../packages/apis/dist/es/aecpilotui/index.mjs";
15
- import { getBase64 as b } from "../../utils/index.mjs";
16
- const V = (i) => {
7
+ import { AecKnowledgeFileStatus as F } from "@glodon-aiot/apis";
8
+ import { getBase64 as A } from "../../utils/index.mjs";
9
+ const D = (i) => {
17
10
  const {
18
11
  className: y,
19
12
  style: N,
20
- id: n,
21
- file: t,
13
+ id: a,
14
+ file: e,
22
15
  actions: {
23
- upload: a,
24
- remove: g,
25
- checkStatus: m
16
+ upload: l,
17
+ remove: h,
18
+ checkStatus: c
26
19
  } = {},
27
- onUrlChange: h,
20
+ onUrlChange: p,
28
21
  onStatusChange: v
29
- } = i, [f, u] = c(i.uploading), [A, S] = c(!1);
30
- r(() => {
22
+ } = i, [f, u] = s(i.uploading), [K, S] = s(!1);
23
+ n(() => {
31
24
  u(i.uploading);
32
25
  }, [i.uploading]);
33
- const [s, d] = c(i.url);
34
- r(() => {
26
+ const [m, d] = s(i.url);
27
+ n(() => {
35
28
  d(i.url);
36
- }, [i.url]), r(() => {
37
- a && t instanceof File && (s || (console.log(a, s, t, "====="), !f && (u(!0), a(t).then((e) => {
38
- d(e), h && h(e);
39
- }).catch((e) => S(e)).finally(() => u(!1)))));
40
- }, [a, s, t]);
41
- const [l, p] = c(t instanceof File || t == null ? void 0 : t.status);
42
- r(() => {
43
- p(t instanceof File || t == null ? void 0 : t.status);
44
- }, [t]);
29
+ }, [i.url]), n(() => {
30
+ l && e instanceof File && (m || f || (u(!0), l(e).then((t) => {
31
+ d(t), p && p(t);
32
+ }).catch((t) => S(t)).finally(() => u(!1))));
33
+ }, [l, m, e]);
34
+ const [r, g] = s(e instanceof File || e == null ? void 0 : e.status);
35
+ n(() => {
36
+ g(e instanceof File || e == null ? void 0 : e.status);
37
+ }, [e]);
45
38
  const C = () => {
46
- n && m && l === F.Processing && m(n).then((e) => {
47
- e !== l && (l !== void 0 && v && v(e), p(e));
48
- }).catch((e) => p(F.Failed));
39
+ a && c && r === F.Processing && c(a).then((t) => {
40
+ t !== r && (r !== void 0 && v && v(t), g(t));
41
+ }).catch((t) => g(F.Failed));
49
42
  };
50
- return r(() => {
43
+ return n(() => {
51
44
  C();
52
- }, [n, m, l]), r(() => {
53
- b(t).then((e) => {
54
- d(e);
45
+ }, [a, c, r]), n(() => {
46
+ A(e).then((t) => {
47
+ d(t);
55
48
  });
56
- }, [t]), t ? /* @__PURE__ */ x("div", {
49
+ }, [e]), e ? /* @__PURE__ */ x("div", {
57
50
  className: `file-preview ${y}`,
58
51
  style: N,
59
52
  children: [/* @__PURE__ */ o(k, {
60
- src: s,
53
+ src: m,
61
54
  className: "file-icon"
62
55
  }), f && /* @__PURE__ */ o(E, {
63
56
  className: "file-action file-process",
@@ -67,7 +60,7 @@ const V = (i) => {
67
60
  },
68
61
  spin: !0
69
62
  })
70
- }), !f && g && /* @__PURE__ */ o(j, {
63
+ }), !f && h && /* @__PURE__ */ o(j, {
71
64
  overlayClassName: "file-remove-tooltip",
72
65
  title: "删除文件",
73
66
  children: /* @__PURE__ */ o(z, {
@@ -79,12 +72,12 @@ const V = (i) => {
79
72
  type: "icon-shanchu"
80
73
  }),
81
74
  onClick: () => {
82
- g(t, n);
75
+ h(e, a);
83
76
  }
84
77
  })
85
78
  })]
86
79
  }) : /* @__PURE__ */ o(U, {});
87
80
  };
88
81
  export {
89
- V as default
82
+ D as default
90
83
  };