@glodon-aiot/agent-cli-ui 3.4.2-beta.2 → 3.4.3-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/HistoryItem/FileItem/index.mjs +52 -48
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +26 -23
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +26 -24
- package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +65 -59
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +179 -161
- package/dist/es/Dialog/AgentChat/index.mjs +183 -159
- package/dist/es/QuillEditor/index.mjs +72 -65
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +129 -125
- package/dist/es/components/Recommend/RecommendItem.mjs +20 -18
- package/dist/es/index.mjs +223 -214
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/es/utils/antdConfig.mjs +15 -0
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +56 -56
- package/dist/src/utils/antdConfig.d.ts +7 -0
- package/dist/src/utils/testAntdPrefix.d.ts +3 -0
- package/package.json +3 -3
package/dist/es/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
1
|
+
var P = Object.defineProperty, j = Object.defineProperties;
|
|
2
2
|
var F = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var V = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var W = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var H = (m, s, n) => s in m ? P(m, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[s] = n, a = (m, s) => {
|
|
6
6
|
for (var n in s || (s = {}))
|
|
7
|
-
|
|
7
|
+
W.call(s, n) && H(m, n, s[n]);
|
|
8
8
|
if (V)
|
|
9
9
|
for (var n of V(s))
|
|
10
|
-
|
|
10
|
+
O.call(s, n) && H(m, n, s[n]);
|
|
11
11
|
return m;
|
|
12
12
|
}, C = (m, s) => j(m, F(s));
|
|
13
|
-
var c = (m, s, n) => (
|
|
13
|
+
var c = (m, s, n) => (H(m, typeof s != "symbol" ? s + "" : s, n), n);
|
|
14
14
|
var B = (m, s, n) => new Promise((e, u) => {
|
|
15
15
|
var l = (h) => {
|
|
16
16
|
try {
|
|
@@ -27,23 +27,24 @@ var B = (m, s, n) => new Promise((e, u) => {
|
|
|
27
27
|
}, d = (h) => h.done ? e(h.value) : Promise.resolve(h.value).then(l, g);
|
|
28
28
|
d((n = n.apply(m, s)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as
|
|
31
|
-
import
|
|
30
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
31
|
+
import $ from "react";
|
|
32
32
|
import v from "lodash/merge";
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import { notification as
|
|
36
|
-
import
|
|
37
|
-
import { v4 as
|
|
38
|
-
import
|
|
39
|
-
import { defaultUIConfig as
|
|
40
|
-
import { ApiUrl as
|
|
41
|
-
/* empty css */import { BotClientApi as
|
|
42
|
-
import { JWT as
|
|
43
|
-
import { configuration as
|
|
44
|
-
import
|
|
33
|
+
import T from "react-dom";
|
|
34
|
+
import K from "./AgentClientUI.mjs";
|
|
35
|
+
import { notification as A } from "antd";
|
|
36
|
+
import J from "axios";
|
|
37
|
+
import { v4 as Q } from "uuid";
|
|
38
|
+
import G from "./packages/agent-cli-ui/package.json.mjs";
|
|
39
|
+
import { defaultUIConfig as z, defaultApiUrl as X, defaultDovViewerUrl as Y } from "./constant.mjs";
|
|
40
|
+
import { ApiUrl as Z } from "./types.mjs";
|
|
41
|
+
/* empty css */import { BotClientApi as q, ApplicationTypes as N } from "@glodon-aiot/apis";
|
|
42
|
+
import { JWT as ee, isExpired as ie } from "./utils/index.mjs";
|
|
43
|
+
import { configuration as te, configure as R, BotClient as se } from "@glodon-aiot/bot-client-sdk";
|
|
44
|
+
import oe from "./ReactTextGenerationUI/index.mjs";
|
|
45
|
+
import { AntdConfigWrapper as D } from "./utils/antdConfig.mjs";
|
|
45
46
|
const E = {};
|
|
46
|
-
class
|
|
47
|
+
class ye {
|
|
47
48
|
constructor(s) {
|
|
48
49
|
c(this, "_token");
|
|
49
50
|
c(this, "_activeSession", null);
|
|
@@ -51,22 +52,22 @@ class we {
|
|
|
51
52
|
c(this, "_defaultInputText", "");
|
|
52
53
|
c(this, "_inputDisabled", !1);
|
|
53
54
|
c(this, "_defatulSessionId", "");
|
|
54
|
-
c(this, "_agentClientRef",
|
|
55
|
+
c(this, "_agentClientRef", $.createRef());
|
|
55
56
|
c(this, "_config");
|
|
56
57
|
c(this, "_uuid", "");
|
|
57
58
|
c(this, "apiUrl");
|
|
58
59
|
c(this, "docViewerUrl");
|
|
59
60
|
c(this, "env", "prod");
|
|
60
|
-
c(this, "stream",
|
|
61
|
+
c(this, "stream", te.stream);
|
|
61
62
|
c(this, "service");
|
|
62
63
|
c(this, "rId", 0);
|
|
63
64
|
c(this, "_mode", "float");
|
|
64
|
-
c(this, "uiConfig",
|
|
65
|
+
c(this, "uiConfig", z);
|
|
65
66
|
c(this, "errorHandlers", {});
|
|
66
67
|
c(this, "wrapper", document.createElement("div"));
|
|
67
68
|
c(this, "botClient", null);
|
|
68
69
|
var _, w, I, y, S;
|
|
69
|
-
this._uuid =
|
|
70
|
+
this._uuid = Q();
|
|
70
71
|
const {
|
|
71
72
|
env: n,
|
|
72
73
|
token: e,
|
|
@@ -96,7 +97,7 @@ class we {
|
|
|
96
97
|
};
|
|
97
98
|
this.updateUIConfig(k, b), this.env = n || "prod", this.stream = p, R({
|
|
98
99
|
stream: this.stream
|
|
99
|
-
}), this._applicationId =
|
|
100
|
+
}), this._applicationId = ee(e).rid, this.apiUrl = d || Z[this.env] || X, this.docViewerUrl = h || Y, this.service = this.setService(), this._initWrapper(), this.createBotClientSDK().then(() => {
|
|
100
101
|
this.mode = u;
|
|
101
102
|
});
|
|
102
103
|
}
|
|
@@ -174,7 +175,7 @@ class we {
|
|
|
174
175
|
this.updateUIConfig(d, e);
|
|
175
176
|
} else {
|
|
176
177
|
const d = {
|
|
177
|
-
size: a(a(a({}, this.uiConfig.size),
|
|
178
|
+
size: a(a(a({}, this.uiConfig.size), z.size), this._config.size),
|
|
178
179
|
theme: v(this.uiConfig.theme, E)
|
|
179
180
|
};
|
|
180
181
|
this.updateUIConfig(d, e);
|
|
@@ -193,7 +194,7 @@ class we {
|
|
|
193
194
|
const f = this.token;
|
|
194
195
|
if (!f)
|
|
195
196
|
return h;
|
|
196
|
-
if (
|
|
197
|
+
if (ie(f)) {
|
|
197
198
|
const i = "token is timeout";
|
|
198
199
|
this.errorHandlers.token ? typeof this.errorHandlers.token == "function" ? this.errorHandlers.token(
|
|
199
200
|
// @ts-ignore
|
|
@@ -210,7 +211,7 @@ class we {
|
|
|
210
211
|
}), h;
|
|
211
212
|
};
|
|
212
213
|
function e(h, f = !0) {
|
|
213
|
-
const t = `${s}${h}`, i =
|
|
214
|
+
const t = `${s}${h}`, i = J.create({
|
|
214
215
|
baseURL: t
|
|
215
216
|
});
|
|
216
217
|
return f && i.interceptors.request.use(n), i;
|
|
@@ -229,15 +230,17 @@ class we {
|
|
|
229
230
|
) : console.error("errorHandlers.token is not a function") : console.error(t);
|
|
230
231
|
}
|
|
231
232
|
}, l = (h, f, t) => {
|
|
232
|
-
h !== 10001 && h !== 10215 && (t || (
|
|
233
|
-
getContainer: this.uiConfig.getContainer
|
|
234
|
-
|
|
233
|
+
h !== 10001 && h !== 10215 && (t || (A.config({
|
|
234
|
+
getContainer: this.uiConfig.getContainer,
|
|
235
|
+
prefixCls: "gbot-notification"
|
|
236
|
+
}), A.error({
|
|
235
237
|
message: f
|
|
236
|
-
}),
|
|
237
|
-
getContainer: void 0
|
|
238
|
+
}), A.config({
|
|
239
|
+
getContainer: void 0,
|
|
240
|
+
prefixCls: "gbot-notification"
|
|
238
241
|
})));
|
|
239
242
|
}, g = e("");
|
|
240
|
-
return new
|
|
243
|
+
return new q(g, () => this.token, {
|
|
241
244
|
onHttpStatusError: u,
|
|
242
245
|
onAppStatusError: l
|
|
243
246
|
});
|
|
@@ -293,7 +296,7 @@ class we {
|
|
|
293
296
|
debug: this.uiConfig.debug,
|
|
294
297
|
env: this.uiConfig.env,
|
|
295
298
|
apiRoot: this.apiUrl
|
|
296
|
-
}), this.botClient = new
|
|
299
|
+
}), this.botClient = new se(this.token, {
|
|
297
300
|
plugins: this.uiConfig.plugins,
|
|
298
301
|
mcp: this.uiConfig.mcp,
|
|
299
302
|
stream: this.uiConfig.stream
|
|
@@ -304,7 +307,7 @@ class we {
|
|
|
304
307
|
// 这里记录应用的名称和版本,以便后期数据分析
|
|
305
308
|
ui: {
|
|
306
309
|
name: "bot-client-ui",
|
|
307
|
-
version:
|
|
310
|
+
version: G.version
|
|
308
311
|
}
|
|
309
312
|
}), this.botClient.ready ? s(this.botClient) : this.botClient.addEventListener("ready", () => B(this, null, function* () {
|
|
310
313
|
var e;
|
|
@@ -320,206 +323,212 @@ class we {
|
|
|
320
323
|
var s, n, e, u, l, g, d, h, f;
|
|
321
324
|
if (this.wrapper.style.height = "100%", !((s = this.botClient) != null && s.application))
|
|
322
325
|
throw Error("application is required");
|
|
323
|
-
this.botClient.application.type === N.Text ?
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
} catch (r) {
|
|
360
|
-
console.error(r);
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
agentClient: this.botClient,
|
|
364
|
-
onMessage: (t) => {
|
|
365
|
-
var i, o;
|
|
366
|
-
if (t.message.messageId)
|
|
326
|
+
this.botClient.application.type === N.Text ? T.render(/* @__PURE__ */ L(D, {
|
|
327
|
+
getPopupContainer: () => this.uiConfig.getContainer(),
|
|
328
|
+
children: /* @__PURE__ */ L(oe, {
|
|
329
|
+
rId: this.rId,
|
|
330
|
+
application: this.botClient.application,
|
|
331
|
+
sessionId: this._defatulSessionId,
|
|
332
|
+
showHeader: this.uiConfig.showHeader,
|
|
333
|
+
apiUrl: this.apiUrl,
|
|
334
|
+
env: this.uiConfig.env,
|
|
335
|
+
debug: this.uiConfig.debug,
|
|
336
|
+
mode: this.mode,
|
|
337
|
+
token: this.token,
|
|
338
|
+
className: this.mode,
|
|
339
|
+
open: this.uiConfig.open,
|
|
340
|
+
logo: this.uiConfig.logo,
|
|
341
|
+
icon: this.uiConfig.icon,
|
|
342
|
+
theme: this.uiConfig.theme,
|
|
343
|
+
greeting: this.uiConfig.greeting,
|
|
344
|
+
size: this.uiConfig.size,
|
|
345
|
+
triggerButton: a({
|
|
346
|
+
visible: !0
|
|
347
|
+
}, this.uiConfig.triggerButton),
|
|
348
|
+
history: this.uiConfig.history,
|
|
349
|
+
service: this.service,
|
|
350
|
+
docViewerUrl: this.docViewerUrl,
|
|
351
|
+
plugins: this.uiConfig.plugins,
|
|
352
|
+
mcp: this.uiConfig.mcp,
|
|
353
|
+
transform: C(a({}, this.uiConfig.transform), {
|
|
354
|
+
knowledges: ((n = this.uiConfig.features) == null ? void 0 : n.knowledges) === !0 || typeof ((e = this.uiConfig.features) == null ? void 0 : e.knowledges) == "object" && ((l = (u = this.uiConfig.features) == null ? void 0 : u.knowledges) == null ? void 0 : l.visible) !== !1
|
|
355
|
+
}),
|
|
356
|
+
features: this.uiConfig.features,
|
|
357
|
+
disabled: this._inputDisabled,
|
|
358
|
+
sider: this.uiConfig.sider,
|
|
359
|
+
footer: this.uiConfig.footer,
|
|
360
|
+
onComment: (t) => {
|
|
361
|
+
var i, o;
|
|
367
362
|
try {
|
|
368
|
-
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.
|
|
363
|
+
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.comment) == null || o.call(i, t);
|
|
369
364
|
} catch (r) {
|
|
370
365
|
console.error(r);
|
|
371
366
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
|
|
388
|
-
} catch (r) {
|
|
389
|
-
console.error(r);
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
onSessionLoad: (t) => {
|
|
393
|
-
var i, o, r;
|
|
394
|
-
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
395
|
-
this._activeSession = t.session;
|
|
396
|
-
else {
|
|
397
|
-
this._activeSession = t.session;
|
|
367
|
+
},
|
|
368
|
+
agentClient: this.botClient,
|
|
369
|
+
onMessage: (t) => {
|
|
370
|
+
var i, o;
|
|
371
|
+
if (t.message.messageId)
|
|
372
|
+
try {
|
|
373
|
+
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.message) == null || o.call(i, t);
|
|
374
|
+
} catch (r) {
|
|
375
|
+
console.error(r);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
beforeMessageSend: (t) => {
|
|
379
|
+
var i, o, r;
|
|
380
|
+
if (!((i = this.uiConfig.eventListeners) != null && i.beforemessagesend))
|
|
381
|
+
return !0;
|
|
398
382
|
try {
|
|
399
|
-
(r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.
|
|
383
|
+
return ((r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.beforemessagesend) == null ? void 0 : r.call(o, t)) || !1;
|
|
400
384
|
} catch (p) {
|
|
401
|
-
console.error(p);
|
|
385
|
+
return console.error(p), !1;
|
|
402
386
|
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
387
|
+
},
|
|
388
|
+
onSessionUnload: (t) => {
|
|
389
|
+
var i, o;
|
|
390
|
+
this._activeSession = null;
|
|
408
391
|
try {
|
|
409
|
-
(
|
|
410
|
-
} catch (
|
|
411
|
-
console.error(
|
|
392
|
+
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
|
|
393
|
+
} catch (r) {
|
|
394
|
+
console.error(r);
|
|
412
395
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
396
|
+
},
|
|
397
|
+
onSessionLoad: (t) => {
|
|
398
|
+
var i, o, r;
|
|
399
|
+
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
400
|
+
this._activeSession = t.session;
|
|
401
|
+
else {
|
|
402
|
+
this._activeSession = t.session;
|
|
403
|
+
try {
|
|
404
|
+
(r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.sessionload) == null || r.call(o, t);
|
|
405
|
+
} catch (p) {
|
|
406
|
+
console.error(p);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
onHistoryLoad: (t) => {
|
|
411
|
+
var i, o, r;
|
|
412
|
+
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
413
|
+
try {
|
|
414
|
+
(r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.historyload) == null || r.call(o, t);
|
|
415
|
+
} catch (p) {
|
|
416
|
+
console.error(p);
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
defaultInput: this._defaultInputText !== void 0 ? {
|
|
420
|
+
text: this._defaultInputText
|
|
421
|
+
} : void 0,
|
|
422
|
+
bodyStyle: this.uiConfig.bodyStyle,
|
|
423
|
+
stream: this.stream
|
|
424
|
+
})
|
|
425
|
+
}), this.wrapper) : T.render(/* @__PURE__ */ L(D, {
|
|
426
|
+
getPopupContainer: () => this.uiConfig.getContainer(),
|
|
427
|
+
children: /* @__PURE__ */ L(K, {
|
|
428
|
+
ref: this._agentClientRef,
|
|
429
|
+
rId: this.rId,
|
|
430
|
+
application: this.botClient.application,
|
|
431
|
+
agentClient: this.botClient,
|
|
432
|
+
sessionId: this._defatulSessionId,
|
|
433
|
+
showHeader: this.uiConfig.showHeader,
|
|
434
|
+
apiUrl: this.apiUrl,
|
|
435
|
+
env: this.uiConfig.env,
|
|
436
|
+
debug: this.uiConfig.debug,
|
|
437
|
+
mode: this.mode,
|
|
438
|
+
token: this.token,
|
|
439
|
+
className: this.mode,
|
|
440
|
+
open: this.uiConfig.open,
|
|
441
|
+
logo: this.uiConfig.logo,
|
|
442
|
+
icon: this.uiConfig.icon,
|
|
443
|
+
theme: this.uiConfig.theme,
|
|
444
|
+
greeting: this.uiConfig.greeting,
|
|
445
|
+
size: this.uiConfig.size,
|
|
446
|
+
triggerButton: a({
|
|
447
|
+
visible: !0
|
|
448
|
+
}, this.uiConfig.triggerButton),
|
|
449
|
+
history: this.uiConfig.history,
|
|
450
|
+
service: this.service,
|
|
451
|
+
docViewerUrl: this.docViewerUrl,
|
|
452
|
+
plugins: this.uiConfig.plugins,
|
|
453
|
+
mcp: this.uiConfig.mcp,
|
|
454
|
+
transform: C(a({}, this.uiConfig.transform), {
|
|
455
|
+
knowledges: ((g = this.uiConfig.features) == null ? void 0 : g.knowledges) === !0 || typeof ((d = this.uiConfig.features) == null ? void 0 : d.knowledges) == "object" && ((f = (h = this.uiConfig.features) == null ? void 0 : h.knowledges) == null ? void 0 : f.visible) !== !1
|
|
456
|
+
}),
|
|
457
|
+
features: this.uiConfig.features,
|
|
458
|
+
disabled: this._inputDisabled,
|
|
459
|
+
sider: this.uiConfig.sider,
|
|
460
|
+
footer: this.uiConfig.footer,
|
|
461
|
+
onComment: (t) => {
|
|
462
|
+
var i, o;
|
|
464
463
|
try {
|
|
465
|
-
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.
|
|
464
|
+
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.comment) == null || o.call(i, t);
|
|
466
465
|
} catch (r) {
|
|
467
466
|
console.error(r);
|
|
468
467
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
try {
|
|
484
|
-
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
|
|
485
|
-
} catch (r) {
|
|
486
|
-
console.error(r);
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
onSessionLoad: (t) => {
|
|
490
|
-
var i, o, r;
|
|
491
|
-
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
492
|
-
this._activeSession = t.session;
|
|
493
|
-
else {
|
|
494
|
-
this._activeSession = t.session;
|
|
468
|
+
},
|
|
469
|
+
onMessage: (t) => {
|
|
470
|
+
var i, o;
|
|
471
|
+
if (t.message.messageId)
|
|
472
|
+
try {
|
|
473
|
+
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.message) == null || o.call(i, t);
|
|
474
|
+
} catch (r) {
|
|
475
|
+
console.error(r);
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
beforeMessageSend: (t) => {
|
|
479
|
+
var i, o, r;
|
|
480
|
+
if (!((i = this.uiConfig.eventListeners) != null && i.beforemessagesend))
|
|
481
|
+
return !0;
|
|
495
482
|
try {
|
|
496
|
-
(r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.
|
|
483
|
+
return ((r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.beforemessagesend) == null ? void 0 : r.call(o, t)) || !1;
|
|
497
484
|
} catch (p) {
|
|
498
|
-
console.error(p);
|
|
485
|
+
return console.error(p), !1;
|
|
499
486
|
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
487
|
+
},
|
|
488
|
+
onSessionUnload: (t) => {
|
|
489
|
+
var i, o;
|
|
490
|
+
this._activeSession = null;
|
|
505
491
|
try {
|
|
506
|
-
(
|
|
507
|
-
} catch (
|
|
508
|
-
console.error(
|
|
492
|
+
(o = (i = this.uiConfig.eventListeners) == null ? void 0 : i.sessionunload) == null || o.call(i, t);
|
|
493
|
+
} catch (r) {
|
|
494
|
+
console.error(r);
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
onSessionLoad: (t) => {
|
|
498
|
+
var i, o, r;
|
|
499
|
+
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
500
|
+
this._activeSession = t.session;
|
|
501
|
+
else {
|
|
502
|
+
this._activeSession = t.session;
|
|
503
|
+
try {
|
|
504
|
+
(r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.sessionload) == null || r.call(o, t);
|
|
505
|
+
} catch (p) {
|
|
506
|
+
console.error(p);
|
|
507
|
+
}
|
|
509
508
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
509
|
+
},
|
|
510
|
+
onHistoryLoad: (t) => {
|
|
511
|
+
var i, o, r;
|
|
512
|
+
if (((i = this._activeSession) == null ? void 0 : i.id) === t.sessionId)
|
|
513
|
+
try {
|
|
514
|
+
(r = (o = this.uiConfig.eventListeners) == null ? void 0 : o.historyload) == null || r.call(o, t);
|
|
515
|
+
} catch (p) {
|
|
516
|
+
console.error(p);
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
defaultInput: this._defaultInputText !== void 0 ? {
|
|
520
|
+
text: this._defaultInputText
|
|
521
|
+
} : void 0,
|
|
522
|
+
bodyStyle: this.uiConfig.bodyStyle,
|
|
523
|
+
stream: this.stream
|
|
524
|
+
})
|
|
516
525
|
}), this.wrapper), this._defaultInputText = "";
|
|
517
526
|
});
|
|
518
527
|
}
|
|
519
528
|
destroy(s) {
|
|
520
|
-
|
|
529
|
+
T.unmountComponentAtNode(this.wrapper), this.wrapper && this.wrapper.remove(), s == null || s();
|
|
521
530
|
}
|
|
522
531
|
}
|
|
523
532
|
export {
|
|
524
|
-
|
|
533
|
+
ye as default
|
|
525
534
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.4.
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.4.3-beta.1", s = "./dist/es/index.mjs", o = "./dist/lib/index.js", i = "./dist/src/index.d.ts", n = {
|
|
2
2
|
import: "./dist/es/index.mjs",
|
|
3
3
|
require: "./dist/lib/index.js",
|
|
4
4
|
types: "./dist/src/index.d.ts"
|
|
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.4.2-beta.2", s = "./dist/es/index.
|
|
|
25
25
|
webpack: "*"
|
|
26
26
|
}, p = {
|
|
27
27
|
"@ant-design/icons": "^5.3.4",
|
|
28
|
-
"@glodon-aiot/apis": "^3.4.
|
|
29
|
-
"@glodon-aiot/bot-client-sdk": "^3.4.
|
|
28
|
+
"@glodon-aiot/apis": "^3.4.3-beta.1",
|
|
29
|
+
"@glodon-aiot/bot-client-sdk": "^3.4.3-beta.1",
|
|
30
30
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
31
31
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
32
32
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|