@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.
- package/dist/es/AgentClientUI.mjs +97 -110
- package/dist/es/Dialog/AgentChat/index.mjs +516 -467
- package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
- package/dist/es/Dialog/FileCard/index.mjs +48 -55
- package/dist/es/Dialog/FilePreview/index.mjs +35 -42
- package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
- package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
- package/dist/es/Dialog/PromptManager/index.mjs +29 -36
- package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
- package/dist/es/Dialog/SessionAction/index.mjs +92 -91
- package/dist/es/Dialog/SessionList/index.mjs +135 -121
- package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
- package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
- package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
- package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
- package/dist/es/Dialog/index.mjs +125 -93
- package/dist/es/QuillEditor/index.mjs +91 -86
- package/dist/es/_virtual/index.mjs +2 -2
- package/dist/es/components/Markdown/Image/index.mjs +20 -20
- package/dist/es/components/Markdown/index.mjs +27 -22
- package/dist/es/constant.mjs +8 -5
- package/dist/es/index.mjs +178 -152
- package/dist/es/node_modules/classnames/index.mjs +1 -1
- package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
- package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
- package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
- package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
- package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
- package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
- package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
- package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
- package/dist/es/node_modules/longest-streak/index.mjs +12 -0
- package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
- package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
- package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
- package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
- package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
- package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
- package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
- package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
- package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
- package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/utils/index.mjs +44 -27
- package/dist/lib/index.js +278 -138
- package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
- package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
- package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
- package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
- package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
- package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +5 -4
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/dist/src/components/Markdown/Text/index.d.ts +8 -0
- package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
- package/dist/src/components/MathJaxRender/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/contexts/MathJaxContext.d.ts +12 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/types.d.ts +26 -6
- package/dist/src/utils/index.d.ts +15 -0
- package/package.json +18 -17
- package/dist/es/_virtual/index2.mjs +0 -4
- package/dist/es/_virtual/index3.mjs +0 -4
- package/dist/es/_virtual/index4.mjs +0 -4
- package/dist/es/_virtual/minio-zj.mjs +0 -4
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
- package/dist/es/node_modules/base64-js/index.mjs +0 -47
- package/dist/es/node_modules/buffer/index.mjs +0 -927
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
- package/dist/es/node_modules/ieee754/index.mjs +0 -28
- package/dist/es/node_modules/js-base64/base64.mjs +0 -31
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
- package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
- package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
- package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
- package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
- package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
- package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
- package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
- package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
- package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
- package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
- package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
- package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
package/dist/es/Dialog/index.mjs
CHANGED
|
@@ -1,121 +1,153 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var q = Object.defineProperty, z = Object.defineProperties;
|
|
2
|
+
var B = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var L = Object.getOwnPropertySymbols;
|
|
4
|
+
var F = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var x = (t, n, s) => n in t ? q(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s, j = (t, n) => {
|
|
6
|
+
for (var s in n || (n = {}))
|
|
7
|
+
F.call(n, s) && x(t, s, n[s]);
|
|
8
|
+
if (L)
|
|
9
|
+
for (var s of L(n))
|
|
10
|
+
G.call(n, s) && x(t, s, n[s]);
|
|
11
|
+
return t;
|
|
12
|
+
}, A = (t, n) => z(t, B(n));
|
|
13
|
+
var p = (t, n, s) => new Promise((I, N) => {
|
|
14
|
+
var e = (r) => {
|
|
3
15
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
16
|
+
u(s.next(r));
|
|
17
|
+
} catch (h) {
|
|
18
|
+
N(h);
|
|
7
19
|
}
|
|
8
|
-
},
|
|
20
|
+
}, a = (r) => {
|
|
9
21
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
22
|
+
u(s.throw(r));
|
|
23
|
+
} catch (h) {
|
|
24
|
+
N(h);
|
|
13
25
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
26
|
+
}, u = (r) => r.done ? I(r.value) : Promise.resolve(r.value).then(e, a);
|
|
27
|
+
u((s = s.apply(t, n)).next());
|
|
16
28
|
});
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { useState as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
29
|
+
import { jsx as c, jsxs as R } from "../_virtual/jsx-runtime.mjs";
|
|
30
|
+
import { useState as v, useContext as J, useRef as M, useEffect as y } from "react";
|
|
31
|
+
import P from "../context.mjs";
|
|
32
|
+
import Q from "./AgentChat/index.mjs";
|
|
33
|
+
import T from "./KnowledgeList/index.mjs";
|
|
34
|
+
import W from "./SessionList/index.mjs";
|
|
23
35
|
import "./style.less.mjs";
|
|
24
|
-
const
|
|
36
|
+
const re = (t) => {
|
|
25
37
|
const {
|
|
26
|
-
sessionId:
|
|
27
|
-
appId:
|
|
28
|
-
docViewerUrl:
|
|
29
|
-
bodyStyle:
|
|
30
|
-
} =
|
|
31
|
-
service:
|
|
32
|
-
mode:
|
|
33
|
-
showHeader:
|
|
34
|
-
token:
|
|
35
|
-
agentClient:
|
|
36
|
-
sider:
|
|
37
|
-
onSessionLoad:
|
|
38
|
-
onSessionUnload:
|
|
39
|
-
footer:
|
|
40
|
-
transform:
|
|
41
|
-
depId:
|
|
42
|
-
|
|
43
|
-
v(()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
sessionId: n,
|
|
39
|
+
appId: s,
|
|
40
|
+
docViewerUrl: I,
|
|
41
|
+
bodyStyle: N
|
|
42
|
+
} = t, [e, a] = v(), {
|
|
43
|
+
service: u,
|
|
44
|
+
mode: r,
|
|
45
|
+
showHeader: h,
|
|
46
|
+
token: X,
|
|
47
|
+
agentClient: o,
|
|
48
|
+
sider: H,
|
|
49
|
+
onSessionLoad: f,
|
|
50
|
+
onSessionUnload: Y,
|
|
51
|
+
footer: Z,
|
|
52
|
+
transform: _,
|
|
53
|
+
depId: $,
|
|
54
|
+
features: l
|
|
55
|
+
} = J(P), [m, K] = v(), w = M(null), [U, D] = v(""), [k, b] = v(), [E, S] = v(!1);
|
|
56
|
+
y(() => {
|
|
57
|
+
var i;
|
|
58
|
+
S(e ? !!((i = e.data) != null && i.netOpen) : typeof (l == null ? void 0 : l.connectNetwork) == "object" && typeof (l == null ? void 0 : l.connectNetwork.default) == "boolean" ? l.connectNetwork.default : !1);
|
|
59
|
+
}, [e]), y(() => {
|
|
60
|
+
const i = () => p(void 0, null, function* () {
|
|
61
|
+
const d = o == null ? void 0 : o.application;
|
|
62
|
+
if (!(d != null && d.id))
|
|
50
63
|
return;
|
|
51
|
-
const g =
|
|
64
|
+
const g = d == null ? void 0 : d.arrange;
|
|
52
65
|
if (!(g != null && g.length))
|
|
53
66
|
return;
|
|
54
|
-
const
|
|
55
|
-
|
|
67
|
+
const V = g[0].embeddingService;
|
|
68
|
+
D(V), K(d);
|
|
56
69
|
});
|
|
57
|
-
return
|
|
58
|
-
|
|
70
|
+
return o == null || o.addEventListener("ready", () => i()), () => {
|
|
71
|
+
o == null || o.removeEventListener("ready", i);
|
|
59
72
|
};
|
|
60
|
-
}, []),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}))
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
}, []), y(() => {
|
|
74
|
+
o && n && (o.ready ? o == null || o.getSessions().then((i) => p(void 0, null, function* () {
|
|
75
|
+
a == null || a(i.find((d) => d.id === n));
|
|
76
|
+
})) : o.addEventListener("ready", () => p(void 0, null, function* () {
|
|
77
|
+
o == null || o.getSessions().then((i) => p(void 0, null, function* () {
|
|
78
|
+
a == null || a(i.find((d) => d.id === n));
|
|
66
79
|
}));
|
|
67
80
|
}), !0));
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
}, [o, n]), y(() => {
|
|
82
|
+
if (!e) {
|
|
83
|
+
f && f({
|
|
84
|
+
applicationId: s,
|
|
85
|
+
sessionId: "",
|
|
86
|
+
session: null,
|
|
87
|
+
sessionInstance: null
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
e.data && f && f({
|
|
92
|
+
applicationId: s,
|
|
93
|
+
sessionId: e.data.id,
|
|
94
|
+
session: e.data,
|
|
95
|
+
sessionInstance: e
|
|
96
|
+
}), e.addEventListener("data:loaded", () => {
|
|
97
|
+
e != null && e.data && f && f({
|
|
98
|
+
applicationId: s,
|
|
99
|
+
sessionId: e.data.id,
|
|
100
|
+
session: e.data,
|
|
101
|
+
sessionInstance: e
|
|
102
|
+
});
|
|
103
|
+
}, !0);
|
|
104
|
+
}, [e]);
|
|
105
|
+
const O = (i) => {
|
|
106
|
+
var d;
|
|
107
|
+
return (d = w.current) == null ? void 0 : d.create(A(j({}, i), {
|
|
108
|
+
knowledges: k
|
|
109
|
+
}));
|
|
78
110
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ c("div", {
|
|
80
112
|
className: "dialog",
|
|
81
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ R("div", {
|
|
82
114
|
className: "dialog-pannel",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ c("div", {
|
|
84
116
|
className: "dialog-sider",
|
|
85
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ c(W, {
|
|
86
118
|
ref: w,
|
|
87
|
-
sider:
|
|
88
|
-
appId:
|
|
89
|
-
networkStatus:
|
|
90
|
-
currentSession:
|
|
91
|
-
application:
|
|
92
|
-
setCurrentSession:
|
|
93
|
-
checkKnowledges:
|
|
94
|
-
setCheckKnowledges:
|
|
119
|
+
sider: H,
|
|
120
|
+
appId: s,
|
|
121
|
+
networkStatus: E,
|
|
122
|
+
currentSession: e,
|
|
123
|
+
application: m,
|
|
124
|
+
setCurrentSession: a,
|
|
125
|
+
checkKnowledges: k,
|
|
126
|
+
setCheckKnowledges: b
|
|
95
127
|
})
|
|
96
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ c("div", {
|
|
97
129
|
className: "dialog-content",
|
|
98
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ R("div", {
|
|
99
131
|
className: "dialog-chat",
|
|
100
|
-
children: [
|
|
132
|
+
children: [h && /* @__PURE__ */ c("div", {
|
|
101
133
|
className: "dialog-chat-header",
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
-
setCheckKnowledges:
|
|
104
|
-
application:
|
|
105
|
-
currentSession:
|
|
106
|
-
setCurrentSession:
|
|
134
|
+
children: /* @__PURE__ */ c(T, {
|
|
135
|
+
setCheckKnowledges: b,
|
|
136
|
+
application: m,
|
|
137
|
+
currentSession: e,
|
|
138
|
+
setCurrentSession: a
|
|
107
139
|
})
|
|
108
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ c("div", {
|
|
109
141
|
className: "dialog-chat-content",
|
|
110
|
-
children: (
|
|
142
|
+
children: (m == null ? void 0 : m.id) && /* @__PURE__ */ c(Q, {
|
|
111
143
|
setNetworkStatus: S,
|
|
112
|
-
networkStatus:
|
|
113
|
-
application:
|
|
114
|
-
currentSession:
|
|
115
|
-
onCreateSession:
|
|
116
|
-
docViewerUrl:
|
|
117
|
-
embeddingService:
|
|
118
|
-
setCurrentSession:
|
|
144
|
+
networkStatus: E,
|
|
145
|
+
application: m,
|
|
146
|
+
currentSession: e,
|
|
147
|
+
onCreateSession: O,
|
|
148
|
+
docViewerUrl: I,
|
|
149
|
+
embeddingService: U,
|
|
150
|
+
setCurrentSession: a
|
|
119
151
|
})
|
|
120
152
|
})]
|
|
121
153
|
})
|
|
@@ -124,5 +156,5 @@ const $ = (y) => {
|
|
|
124
156
|
});
|
|
125
157
|
};
|
|
126
158
|
export {
|
|
127
|
-
|
|
159
|
+
re as default
|
|
128
160
|
};
|
|
@@ -1,153 +1,157 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { Popover as
|
|
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 f } from "react";
|
|
3
|
+
import Z from "react-quill";
|
|
4
|
+
import T from "../node_modules/classnames/index.mjs";
|
|
5
|
+
import ee from "../Iconfont/index.mjs";
|
|
6
|
+
import { Popover as te, Space as ne, Button as re } from "antd";
|
|
7
7
|
import "../node_modules/react-quill/dist/quill.snow.css.mjs";
|
|
8
8
|
import "./style.less.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { shortCutEnum as
|
|
11
|
-
const
|
|
12
|
-
var
|
|
9
|
+
import P from "../node_modules/ahooks/es/useKeyPress/index.mjs";
|
|
10
|
+
import { shortCutEnum as p } from "../utils/index.mjs";
|
|
11
|
+
const ie = X((z, F) => {
|
|
12
|
+
var D, q, B;
|
|
13
13
|
const {
|
|
14
|
-
text:
|
|
14
|
+
text: N,
|
|
15
15
|
onTextSend: d,
|
|
16
|
-
disabled:
|
|
16
|
+
disabled: j,
|
|
17
17
|
maxLength: c = 0,
|
|
18
|
-
onChange:
|
|
18
|
+
onChange: y,
|
|
19
19
|
networkStatus: a,
|
|
20
|
-
clearAction:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
clearAction: C,
|
|
21
|
+
loading: m
|
|
22
|
+
} = 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);
|
|
23
|
+
Y(F, () => ({
|
|
24
|
+
clear: $,
|
|
25
|
+
prevent: H,
|
|
26
|
+
focus: x,
|
|
27
|
+
update: W
|
|
28
|
+
})), f(() => {
|
|
29
|
+
l(N), n.current && (g(), x());
|
|
30
|
+
}, [N]);
|
|
31
|
+
const W = (e) => {
|
|
31
32
|
l(e);
|
|
32
|
-
}, V = () => {
|
|
33
|
-
l(void 0), C(void 0);
|
|
34
|
-
}, W = () => {
|
|
35
|
-
console.log("prevent");
|
|
36
33
|
}, $ = () => {
|
|
37
|
-
|
|
34
|
+
l(void 0), w(void 0);
|
|
35
|
+
}, H = () => {
|
|
36
|
+
console.log("prevent");
|
|
37
|
+
}, x = () => {
|
|
38
|
+
if (!n.current || b)
|
|
38
39
|
return;
|
|
39
40
|
const e = n.current.getEditor();
|
|
40
41
|
e.focus(), setTimeout(() => {
|
|
41
42
|
e.getLength() > 0 && e.setSelection(e.getLength(), e.getLength());
|
|
42
43
|
});
|
|
43
44
|
};
|
|
44
|
-
|
|
45
|
+
f(() => {
|
|
45
46
|
if (!n.current)
|
|
46
47
|
return;
|
|
47
48
|
const e = n.current.getEditor();
|
|
48
49
|
c && (e.on("text-change", () => {
|
|
49
|
-
e.getLength() > c && e.deleteText(c, e.getLength()),
|
|
50
|
-
}), e.on("selection-change",
|
|
50
|
+
e.getLength() > c && e.deleteText(c, e.getLength()), g(), K(), x();
|
|
51
|
+
}), e.on("selection-change", K));
|
|
51
52
|
}, [n, c]);
|
|
52
|
-
const
|
|
53
|
+
const g = () => {
|
|
53
54
|
if (!n.current)
|
|
54
55
|
return;
|
|
55
56
|
const e = n.current.getEditor();
|
|
56
|
-
|
|
57
|
-
},
|
|
57
|
+
Q(e.getBounds(e.getLength() - 1, e.getLength()).left), U(e.getBounds(e.getLength() - 1, e.getLength()).top);
|
|
58
|
+
}, K = (e) => {
|
|
58
59
|
if (!n.current)
|
|
59
60
|
return;
|
|
60
|
-
const t = n.current.getEditor(),
|
|
61
|
-
(
|
|
61
|
+
const t = n.current.getEditor(), i = e || t.getSelection();
|
|
62
|
+
(i == null ? void 0 : i.index) !== void 0 && A(i == null ? void 0 : i.index);
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
+
P("1", () => {
|
|
64
65
|
var t;
|
|
65
66
|
const e = (t = n.current) == null ? void 0 : t.getEditor();
|
|
66
|
-
|
|
67
|
-
}),
|
|
67
|
+
I && a && (e == null || e.blur(), setTimeout(() => R()));
|
|
68
|
+
}), P("2", () => {
|
|
68
69
|
var t;
|
|
69
70
|
const e = (t = n.current) == null ? void 0 : t.getEditor();
|
|
70
|
-
|
|
71
|
+
I && (e == null || e.blur(), setTimeout(() => _()));
|
|
71
72
|
});
|
|
72
|
-
const
|
|
73
|
+
const R = () => {
|
|
73
74
|
var t;
|
|
74
75
|
if (!a)
|
|
75
76
|
return;
|
|
76
77
|
const e = (t = n.current) == null ? void 0 : t.getEditor();
|
|
77
|
-
e == null || e.focus(),
|
|
78
|
-
},
|
|
78
|
+
e == null || e.focus(), E(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, p.NETWORK));
|
|
79
|
+
}, _ = () => {
|
|
79
80
|
var t;
|
|
80
81
|
const e = (t = n.current) == null ? void 0 : t.getEditor();
|
|
81
|
-
e == null || e.focus(),
|
|
82
|
-
},
|
|
83
|
-
var t,
|
|
82
|
+
e == null || e.focus(), E(!1), setTimeout(() => e == null ? void 0 : e.insertText(k, p.DOCUMENT));
|
|
83
|
+
}, G = () => {
|
|
84
|
+
var t, i, u;
|
|
84
85
|
const e = (t = n.current) == null ? void 0 : t.getEditor();
|
|
85
|
-
return e && (e == null ? void 0 : e.getLength()) > 2 && !((
|
|
86
|
+
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));
|
|
86
87
|
};
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return f(() => {
|
|
89
|
+
var e, t;
|
|
90
|
+
m ? (e = n.current) == null || e.getEditor().disable() : (t = n.current) == null || t.getEditor().enable();
|
|
91
|
+
}, [m]), f(() => (window.addEventListener("resize", g), () => {
|
|
92
|
+
window.removeEventListener("resize", g);
|
|
93
|
+
}), []), /* @__PURE__ */ s("div", {
|
|
94
|
+
className: T({
|
|
91
95
|
"quill-editor": !0,
|
|
92
|
-
"quill-editor__active":
|
|
96
|
+
"quill-editor__active": b
|
|
93
97
|
}),
|
|
94
|
-
children: [/* @__PURE__ */
|
|
95
|
-
className:
|
|
98
|
+
children: [/* @__PURE__ */ s("div", {
|
|
99
|
+
className: T({
|
|
96
100
|
"quill-editor-wrapper": !0,
|
|
97
|
-
"quill-editor-wrapper__scroll":
|
|
101
|
+
"quill-editor-wrapper__scroll": S >= 200
|
|
98
102
|
}),
|
|
99
103
|
onKeyDownCapture: (e) => {
|
|
100
104
|
!e.shiftKey && e.code === "Enter" && e.preventDefault();
|
|
101
105
|
},
|
|
102
|
-
children: [/* @__PURE__ */ r(
|
|
106
|
+
children: [/* @__PURE__ */ r(Z, {
|
|
103
107
|
theme: "snow",
|
|
104
108
|
placeholder: "输入你想问的,shift+enter 换行。",
|
|
105
109
|
ref: n,
|
|
106
|
-
onFocus: () =>
|
|
107
|
-
onBlur: () =>
|
|
110
|
+
onFocus: () => L(!0),
|
|
111
|
+
onBlur: () => L(!1),
|
|
108
112
|
onKeyDown: (e) => {
|
|
109
113
|
if (!e.shiftKey && e.keyCode == 13) {
|
|
110
114
|
const t = h == null ? void 0 : h.replace(/[\n\s]+$/, "");
|
|
111
|
-
l(t), d && d(
|
|
115
|
+
l(t), d && d(v);
|
|
112
116
|
}
|
|
113
117
|
},
|
|
114
118
|
value: h,
|
|
115
119
|
modules: {
|
|
116
120
|
toolbar: !1
|
|
117
121
|
},
|
|
118
|
-
onChange: (e, t,
|
|
122
|
+
onChange: (e, t, i, u) => {
|
|
119
123
|
if (!t)
|
|
120
124
|
return;
|
|
121
125
|
l(e);
|
|
122
|
-
const
|
|
123
|
-
|
|
126
|
+
const J = u.getText().replace(/[\n\s]+$/, "");
|
|
127
|
+
w(J), y && y(e, u);
|
|
124
128
|
}
|
|
125
129
|
}), /* @__PURE__ */ r("div", {
|
|
126
130
|
className: "shortcut-direct",
|
|
127
|
-
ref:
|
|
131
|
+
ref: V,
|
|
128
132
|
style: {
|
|
129
133
|
position: "absolute",
|
|
130
|
-
left:
|
|
131
|
-
top:
|
|
134
|
+
left: M + 4,
|
|
135
|
+
top: S,
|
|
132
136
|
cursor: "pointer",
|
|
133
|
-
visibility:
|
|
137
|
+
visibility: G() ? "visible" : "hidden"
|
|
134
138
|
},
|
|
135
|
-
children: /* @__PURE__ */ r(
|
|
139
|
+
children: /* @__PURE__ */ r(te, {
|
|
136
140
|
autoAdjustOverflow: !0,
|
|
137
141
|
placement: "top",
|
|
138
142
|
trigger: "hover",
|
|
139
143
|
getPopupContainer: (e) => e.parentNode,
|
|
140
144
|
onVisibleChange: (e) => {
|
|
141
|
-
|
|
145
|
+
E(e);
|
|
142
146
|
},
|
|
143
|
-
content: /* @__PURE__ */
|
|
147
|
+
content: /* @__PURE__ */ s("div", {
|
|
144
148
|
className: "shortcut-direct-pannel",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
146
|
-
className:
|
|
149
|
+
children: [/* @__PURE__ */ s("div", {
|
|
150
|
+
className: T({
|
|
147
151
|
"shortcut-direct-item": a,
|
|
148
152
|
"shortcut-direct-item__disabled": !a
|
|
149
153
|
}),
|
|
150
|
-
onClick:
|
|
154
|
+
onClick: R,
|
|
151
155
|
children: [/* @__PURE__ */ r("span", {
|
|
152
156
|
className: "title",
|
|
153
157
|
children: "指定联网回答"
|
|
@@ -155,9 +159,9 @@ const re = J((B, O) => {
|
|
|
155
159
|
className: "text",
|
|
156
160
|
children: "快捷键1"
|
|
157
161
|
})]
|
|
158
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ s("div", {
|
|
159
163
|
className: "shortcut-direct-item",
|
|
160
|
-
onClick:
|
|
164
|
+
onClick: _,
|
|
161
165
|
children: [/* @__PURE__ */ r("span", {
|
|
162
166
|
className: "title",
|
|
163
167
|
children: "指定文档回答"
|
|
@@ -169,36 +173,37 @@ const re = J((B, O) => {
|
|
|
169
173
|
})
|
|
170
174
|
})
|
|
171
175
|
})]
|
|
172
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ s("div", {
|
|
173
177
|
className: "quill-editor-send",
|
|
174
178
|
children: [/* @__PURE__ */ r("div", {
|
|
175
179
|
style: {
|
|
176
180
|
height: 32
|
|
177
181
|
},
|
|
178
|
-
children:
|
|
179
|
-
}), /* @__PURE__ */
|
|
182
|
+
children: C || /* @__PURE__ */ r("span", {})
|
|
183
|
+
}), /* @__PURE__ */ s("div", {
|
|
180
184
|
style: {
|
|
181
185
|
height: 32,
|
|
182
186
|
display: "flex",
|
|
183
187
|
alignItems: "center"
|
|
184
188
|
},
|
|
185
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ s(ne, {
|
|
186
190
|
size: 2,
|
|
187
191
|
style: {
|
|
188
192
|
color: "#84868C"
|
|
189
193
|
},
|
|
190
194
|
children: [/* @__PURE__ */ r("span", {
|
|
191
|
-
children: ((
|
|
195
|
+
children: ((D = n.current) == null ? void 0 : D.getEditor()) && ((B = (q = n.current) == null ? void 0 : q.getEditor()) == null ? void 0 : B.getLength()) - 1
|
|
192
196
|
}), /* @__PURE__ */ r("span", {
|
|
193
197
|
children: "/"
|
|
194
198
|
}), /* @__PURE__ */ r("span", {
|
|
195
199
|
children: c
|
|
196
200
|
})]
|
|
197
|
-
}), /* @__PURE__ */ r(
|
|
201
|
+
}), /* @__PURE__ */ r(re, {
|
|
198
202
|
type: "link",
|
|
199
203
|
ghost: !0,
|
|
200
|
-
disabled:
|
|
201
|
-
|
|
204
|
+
disabled: j || !v,
|
|
205
|
+
loading: m,
|
|
206
|
+
icon: /* @__PURE__ */ r(ee, {
|
|
202
207
|
className: "icon-sendMsg",
|
|
203
208
|
style: {
|
|
204
209
|
fontSize: 24
|
|
@@ -206,14 +211,14 @@ const re = J((B, O) => {
|
|
|
206
211
|
type: "icon-fasong"
|
|
207
212
|
}),
|
|
208
213
|
onClick: () => {
|
|
209
|
-
d && d(
|
|
214
|
+
d && d(v);
|
|
210
215
|
}
|
|
211
216
|
})]
|
|
212
217
|
})]
|
|
213
218
|
})]
|
|
214
219
|
});
|
|
215
220
|
});
|
|
216
|
-
|
|
221
|
+
ie.displayName = "QuillEditor";
|
|
217
222
|
export {
|
|
218
|
-
|
|
223
|
+
ie as default
|
|
219
224
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { Image as
|
|
15
|
-
const C = (
|
|
16
|
-
onClick: (
|
|
17
|
-
var
|
|
18
|
-
return (
|
|
1
|
+
var c = Object.defineProperty, i = Object.defineProperties;
|
|
2
|
+
var l = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var a = Object.getOwnPropertySymbols;
|
|
4
|
+
var f = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var e = (n, o, r) => o in n ? c(n, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[o] = r, m = (n, o) => {
|
|
6
|
+
for (var r in o || (o = {}))
|
|
7
|
+
f.call(o, r) && e(n, r, o[r]);
|
|
8
|
+
if (a)
|
|
9
|
+
for (var r of a(o))
|
|
10
|
+
k.call(o, r) && e(n, r, o[r]);
|
|
11
|
+
return n;
|
|
12
|
+
}, t = (n, o) => i(n, l(o));
|
|
13
|
+
import { jsx as d } from "../../../_virtual/jsx-runtime.mjs";
|
|
14
|
+
import { Image as g } from "antd";
|
|
15
|
+
const C = (n) => /* @__PURE__ */ d(g, t(m({}, n), {
|
|
16
|
+
onClick: (o) => {
|
|
17
|
+
var r;
|
|
18
|
+
return (r = n.onClick) == null ? void 0 : r.call(n, o);
|
|
19
19
|
},
|
|
20
20
|
onError: () => {
|
|
21
|
-
console.
|
|
21
|
+
console.warn("图片加载失败");
|
|
22
22
|
}
|
|
23
|
-
}))
|
|
23
|
+
}));
|
|
24
24
|
export {
|
|
25
25
|
C as default
|
|
26
26
|
};
|