@zero-library/chat-agent 2.1.10 → 2.1.12
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/index.cjs.js +209 -118
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +36 -28
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +279 -14
- package/dist/index.d.ts +279 -14
- package/dist/index.esm.js +209 -118
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -5,16 +5,16 @@ var antd = require('antd');
|
|
|
5
5
|
var dayjs = require('dayjs');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var react = require('react');
|
|
8
|
+
var valtio = require('valtio');
|
|
8
9
|
var icons = require('@ant-design/icons');
|
|
9
10
|
var x = require('@ant-design/x');
|
|
10
|
-
var
|
|
11
|
-
var valtio = require('valtio');
|
|
11
|
+
var classNames9 = require('classnames');
|
|
12
12
|
var InfiniteScroll = require('react-infinite-scroll-component');
|
|
13
13
|
|
|
14
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
|
|
16
16
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
17
|
-
var
|
|
17
|
+
var classNames9__default = /*#__PURE__*/_interopDefault(classNames9);
|
|
18
18
|
var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
|
|
19
19
|
|
|
20
20
|
var __defProp = Object.defineProperty;
|
|
@@ -26,19 +26,6 @@ var __export = (target, all) => {
|
|
|
26
26
|
for (var name in all)
|
|
27
27
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
28
|
};
|
|
29
|
-
var docQuery, fileCreate;
|
|
30
|
-
var init_file = __esm({
|
|
31
|
-
"src/services/file.ts"() {
|
|
32
|
-
docQuery = (paramsStr) => {
|
|
33
|
-
return common.request.get(`/uc/doc?${paramsStr}`);
|
|
34
|
-
};
|
|
35
|
-
fileCreate = async (fileContent, fileName, targetFormat = "docx") => {
|
|
36
|
-
const blob = await common.request.post(`/uc/doc/convert`, { fileContent, fileName, targetFormat }, { responseType: "blob" });
|
|
37
|
-
const url = URL.createObjectURL(blob);
|
|
38
|
-
common.downloadFile(url, fileName);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
29
|
function transform(source, fieldMap) {
|
|
43
30
|
const result = {};
|
|
44
31
|
for (const [targetKey, mapping] of Object.entries(fieldMap)) {
|
|
@@ -154,14 +141,16 @@ var init_FileView = __esm({
|
|
|
154
141
|
var DocDrawer_default;
|
|
155
142
|
var init_DocDrawer = __esm({
|
|
156
143
|
"src/ui/common/markdownAlert/components/DocDrawer.tsx"() {
|
|
157
|
-
|
|
144
|
+
init_Context();
|
|
158
145
|
DocDrawer_default = ({ title, open, onClose, fileUrl }) => {
|
|
146
|
+
const chatStore = useChatStore();
|
|
147
|
+
const configState = valtio.useSnapshot(chatStore.config);
|
|
159
148
|
const [content, setContent] = react.useState("");
|
|
160
149
|
const [loading, setLoading] = react.useState(false);
|
|
161
150
|
const getContent = async () => {
|
|
162
151
|
try {
|
|
163
152
|
setLoading(true);
|
|
164
|
-
const res = await docQuery(fileUrl);
|
|
153
|
+
const res = await configState.services.request.docQuery(fileUrl);
|
|
165
154
|
setContent(res.data?.content);
|
|
166
155
|
} finally {
|
|
167
156
|
setLoading(false);
|
|
@@ -308,52 +297,95 @@ var init_QuoteList = __esm({
|
|
|
308
297
|
}
|
|
309
298
|
});
|
|
310
299
|
|
|
311
|
-
// src/ui/layouts/index.tsx
|
|
312
|
-
init_file();
|
|
313
|
-
|
|
314
300
|
// src/stores/index.ts
|
|
315
301
|
init_utils();
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
|
|
302
|
+
|
|
303
|
+
// src/services/index.ts
|
|
304
|
+
var createChatService = (request) => {
|
|
305
|
+
const conversationsQuery = (params) => {
|
|
306
|
+
return request.get("/lolr/conversation", params);
|
|
307
|
+
};
|
|
308
|
+
const conversationCreate = (params) => {
|
|
309
|
+
return request.post("/lolr/conversation", params);
|
|
310
|
+
};
|
|
311
|
+
const conversationDelete = (conversationId) => {
|
|
312
|
+
return request.delete("/lolr/conversation", { conversationId });
|
|
313
|
+
};
|
|
314
|
+
const conversationRecentUpdate = (params) => {
|
|
315
|
+
return request.put("/lolr/conversation/recent", params);
|
|
316
|
+
};
|
|
317
|
+
const conversationRecentQuery = (params) => {
|
|
318
|
+
return request.get("/lolr/conversation/recent", params);
|
|
319
|
+
};
|
|
320
|
+
const conversationMessagesQuery = (params) => {
|
|
321
|
+
return request.get("/lolr/conversation/message", params);
|
|
322
|
+
};
|
|
323
|
+
const conversationMessageRead = (conversationId) => {
|
|
324
|
+
return request.put("/lolr/conversation/message/read", { conversationId });
|
|
325
|
+
};
|
|
326
|
+
const feedbackUpdate = (params) => {
|
|
327
|
+
return request.put("/lolr/conversation/message/feedback", params);
|
|
328
|
+
};
|
|
329
|
+
const messageSuggestedQuery = (msgId, maxCount = 3) => {
|
|
330
|
+
return request.get("/lolr/conversation/suggest", { msgId, maxCount });
|
|
331
|
+
};
|
|
332
|
+
const conversationMemberQuery = (conversationId) => {
|
|
333
|
+
return request.get("/lolr/conversation/member", { conversationId });
|
|
334
|
+
};
|
|
335
|
+
const conversationStateUpdate = (conversationId, state) => {
|
|
336
|
+
return request.put("/lolr/conversation/state", { conversationId, state });
|
|
337
|
+
};
|
|
338
|
+
const conversationMessageSend = (params) => {
|
|
339
|
+
return request.post("/lolr/conversation/send", params);
|
|
340
|
+
};
|
|
341
|
+
const conversationStop = (conversationId) => {
|
|
342
|
+
return request.post("/lolr/conversation/stop", { conversationId });
|
|
343
|
+
};
|
|
344
|
+
const agentInfoQuery = (agentId) => {
|
|
345
|
+
return request.get("/lolr/agent/detail", { agentId });
|
|
346
|
+
};
|
|
347
|
+
const agentCharacterQuery = (agentId) => {
|
|
348
|
+
return request.get("/lolr/character", { agentId });
|
|
349
|
+
};
|
|
350
|
+
const agentCharacterSelect = (agentId, characterId) => {
|
|
351
|
+
return request.post("/lolr/character/user", { agentId, characterId });
|
|
352
|
+
};
|
|
353
|
+
const fileUpload = (formData) => {
|
|
354
|
+
return request.post("/lolr/storage/upload", formData, { timeout: 5 * 60 * 1e3 });
|
|
355
|
+
};
|
|
356
|
+
return {
|
|
357
|
+
conversationsQuery,
|
|
358
|
+
conversationCreate,
|
|
359
|
+
conversationDelete,
|
|
360
|
+
conversationRecentUpdate,
|
|
361
|
+
conversationRecentQuery,
|
|
362
|
+
conversationMessagesQuery,
|
|
363
|
+
conversationMessageRead,
|
|
364
|
+
feedbackUpdate,
|
|
365
|
+
messageSuggestedQuery,
|
|
366
|
+
conversationMemberQuery,
|
|
367
|
+
conversationStateUpdate,
|
|
368
|
+
conversationMessageSend,
|
|
369
|
+
conversationStop,
|
|
370
|
+
agentInfoQuery,
|
|
371
|
+
agentCharacterQuery,
|
|
372
|
+
agentCharacterSelect,
|
|
373
|
+
fileUpload
|
|
374
|
+
};
|
|
354
375
|
};
|
|
355
|
-
var
|
|
356
|
-
|
|
376
|
+
var createFileService = (request) => {
|
|
377
|
+
const docQuery = (paramsStr) => {
|
|
378
|
+
return request.get(`/uc/doc?${paramsStr}`);
|
|
379
|
+
};
|
|
380
|
+
const fileCreate = async (fileContent, fileName, targetFormat = "docx") => {
|
|
381
|
+
const blob = await request.post(`/uc/doc/convert`, { fileContent, fileName, targetFormat }, { responseType: "blob" });
|
|
382
|
+
const url = URL.createObjectURL(blob);
|
|
383
|
+
common.downloadFile(url, fileName);
|
|
384
|
+
};
|
|
385
|
+
return {
|
|
386
|
+
docQuery,
|
|
387
|
+
fileCreate
|
|
388
|
+
};
|
|
357
389
|
};
|
|
358
390
|
|
|
359
391
|
// src/stores/index.ts
|
|
@@ -397,6 +429,9 @@ var defaultExpertLayout = {
|
|
|
397
429
|
};
|
|
398
430
|
function createChatStore() {
|
|
399
431
|
const config = valtio.proxy({
|
|
432
|
+
services: {
|
|
433
|
+
websocketBaseUrls: []
|
|
434
|
+
},
|
|
400
435
|
hooks: {},
|
|
401
436
|
layout: {},
|
|
402
437
|
preview: {
|
|
@@ -409,6 +444,14 @@ function createChatStore() {
|
|
|
409
444
|
userInfo: {},
|
|
410
445
|
params: {}
|
|
411
446
|
});
|
|
447
|
+
const setServices = ({ baseUrl = "/api" } = {}) => {
|
|
448
|
+
config.services.baseUrl = baseUrl;
|
|
449
|
+
if (!config.services.websocketBaseUrls?.includes(baseUrl)) {
|
|
450
|
+
config.services.websocketBaseUrls = [...config.services.websocketBaseUrls, baseUrl];
|
|
451
|
+
}
|
|
452
|
+
const request = common.createRequest(baseUrl);
|
|
453
|
+
config.services.request = { ...createChatService(request), ...createFileService(request) };
|
|
454
|
+
};
|
|
412
455
|
const setPreview = (file = {}, isEdit = false) => {
|
|
413
456
|
if (common.shouldRender(config.layout.preview)) {
|
|
414
457
|
config.preview = {
|
|
@@ -464,7 +507,7 @@ function createChatStore() {
|
|
|
464
507
|
}
|
|
465
508
|
try {
|
|
466
509
|
receiver.loading = true;
|
|
467
|
-
const { data } = await agentInfoQuery(agentId);
|
|
510
|
+
const { data } = await config.services.request.agentInfoQuery(agentId);
|
|
468
511
|
receiver.active = transform(data, {
|
|
469
512
|
name: "agentName",
|
|
470
513
|
logo: "logo",
|
|
@@ -515,7 +558,7 @@ function createChatStore() {
|
|
|
515
558
|
const getCharacters = async (agentId) => {
|
|
516
559
|
try {
|
|
517
560
|
character.loading = true;
|
|
518
|
-
const { data } = await agentCharacterQuery(agentId);
|
|
561
|
+
const { data } = await config.services.request.agentCharacterQuery(agentId);
|
|
519
562
|
if (receiver.active.id !== agentId) return;
|
|
520
563
|
character.list = data;
|
|
521
564
|
const active = data.find((item) => item.selected);
|
|
@@ -536,7 +579,7 @@ function createChatStore() {
|
|
|
536
579
|
if (!c.id) return;
|
|
537
580
|
try {
|
|
538
581
|
character.switchLoading = true;
|
|
539
|
-
await agentCharacterSelect(receiver.active.id, c.id);
|
|
582
|
+
await config.services.request.agentCharacterSelect(receiver.active.id, c.id);
|
|
540
583
|
character.active = { ...c };
|
|
541
584
|
closeCharacterList();
|
|
542
585
|
} finally {
|
|
@@ -559,7 +602,7 @@ function createChatStore() {
|
|
|
559
602
|
const getConversations = async (targetId, targetType) => {
|
|
560
603
|
try {
|
|
561
604
|
conversations.loading = true;
|
|
562
|
-
const { data } = await conversationsQuery({
|
|
605
|
+
const { data } = await config.services.request.conversationsQuery({
|
|
563
606
|
targetId,
|
|
564
607
|
targetType,
|
|
565
608
|
businessId: config.params.businessId,
|
|
@@ -586,7 +629,7 @@ function createChatStore() {
|
|
|
586
629
|
const canProceed = await config.hooks?.onBeforeDelConversation?.(conversationId);
|
|
587
630
|
if (canProceed === false) return;
|
|
588
631
|
conversations.delLoading = true;
|
|
589
|
-
await conversationDelete(conversationId);
|
|
632
|
+
await config.services.request.conversationDelete(conversationId);
|
|
590
633
|
antd.message.success("\u5220\u9664\u6210\u529F");
|
|
591
634
|
conversations.list.items = conversations.list.items.filter((item) => item.key !== conversationId);
|
|
592
635
|
delete conversation.messages[conversationId];
|
|
@@ -637,7 +680,7 @@ function createChatStore() {
|
|
|
637
680
|
if (!messages?.length) return;
|
|
638
681
|
let lastMessage = messages[messages.length - 1];
|
|
639
682
|
if (!lastMessage || lastMessage.sender.type !== 3 || lastMessage.id !== messageId) return;
|
|
640
|
-
const { data } = await messageSuggestedQuery(messageId);
|
|
683
|
+
const { data } = await config.services.request.messageSuggestedQuery(messageId);
|
|
641
684
|
lastMessage = messages[messages.length - 1];
|
|
642
685
|
if (lastMessage.id !== messageId) return;
|
|
643
686
|
conversation.messages[conversationId].questionList = data;
|
|
@@ -645,7 +688,7 @@ function createChatStore() {
|
|
|
645
688
|
const feedback = async (conversationId, messageId, msgFeedback, index) => {
|
|
646
689
|
try {
|
|
647
690
|
conversation.feedback.loading = true;
|
|
648
|
-
await feedbackUpdate({ conversationId, id: messageId, msgFeedback });
|
|
691
|
+
await config.services.request.feedbackUpdate({ conversationId, id: messageId, msgFeedback });
|
|
649
692
|
antd.message.success("\u611F\u8C22\u60A8\u7684\u53CD\u9988");
|
|
650
693
|
conversation.messages[conversationId].message[index].msgFeedback = msgFeedback;
|
|
651
694
|
} finally {
|
|
@@ -666,7 +709,7 @@ function createChatStore() {
|
|
|
666
709
|
};
|
|
667
710
|
const resolveConversationId = async (receiverId, strategy = 2) => {
|
|
668
711
|
if (strategy === 1) {
|
|
669
|
-
const { data } = await conversationRecentQuery({
|
|
712
|
+
const { data } = await config.services.request.conversationRecentQuery({
|
|
670
713
|
receiverId,
|
|
671
714
|
receiverType: 3,
|
|
672
715
|
businessId: config.params.businessId,
|
|
@@ -674,7 +717,7 @@ function createChatStore() {
|
|
|
674
717
|
});
|
|
675
718
|
return data;
|
|
676
719
|
} else {
|
|
677
|
-
const { data } = await conversationCreate({
|
|
720
|
+
const { data } = await config.services.request.conversationCreate({
|
|
678
721
|
receiverId,
|
|
679
722
|
receiverType: 3,
|
|
680
723
|
businessId: config.params.businessId,
|
|
@@ -689,7 +732,7 @@ function createChatStore() {
|
|
|
689
732
|
};
|
|
690
733
|
const initConversation = async (conversationId) => {
|
|
691
734
|
try {
|
|
692
|
-
const { data } = await conversationMemberQuery(conversationId);
|
|
735
|
+
const { data } = await config.services.request.conversationMemberQuery(conversationId);
|
|
693
736
|
conversation.active = { id: conversationId, member: {} };
|
|
694
737
|
data.forEach((member) => {
|
|
695
738
|
if (member.memberType === 3) {
|
|
@@ -749,7 +792,7 @@ function createChatStore() {
|
|
|
749
792
|
setInitMessage(conversationId);
|
|
750
793
|
}
|
|
751
794
|
if (conversation.messages[conversationId].message.length === 0) {
|
|
752
|
-
const { data } = await conversationMessagesQuery({
|
|
795
|
+
const { data } = await config.services.request.conversationMessagesQuery({
|
|
753
796
|
pageNo: 1,
|
|
754
797
|
pageSize: 1e3,
|
|
755
798
|
conversationId
|
|
@@ -809,7 +852,7 @@ function createChatStore() {
|
|
|
809
852
|
setHeaderOpen(false);
|
|
810
853
|
}
|
|
811
854
|
try {
|
|
812
|
-
await conversationMessageSend(sendParams);
|
|
855
|
+
await config.services.request.conversationMessageSend(sendParams);
|
|
813
856
|
config.hooks?.onAfterSend?.();
|
|
814
857
|
} finally {
|
|
815
858
|
conversation.messages[conversationId].loading = false;
|
|
@@ -817,7 +860,7 @@ function createChatStore() {
|
|
|
817
860
|
};
|
|
818
861
|
const cancelReceive = async () => {
|
|
819
862
|
console.log("\u53D6\u6D88\u63A5\u6536");
|
|
820
|
-
await conversationStop(conversation.active.id);
|
|
863
|
+
await config.services.request.conversationStop(conversation.active.id);
|
|
821
864
|
};
|
|
822
865
|
const updateConversationTitle = (conversationId, title) => {
|
|
823
866
|
const idx = conversations.list.items.findIndex((item) => item.id === conversationId);
|
|
@@ -887,6 +930,7 @@ function createChatStore() {
|
|
|
887
930
|
};
|
|
888
931
|
return {
|
|
889
932
|
config,
|
|
933
|
+
setServices,
|
|
890
934
|
setPreview,
|
|
891
935
|
setLayout,
|
|
892
936
|
setHooks,
|
|
@@ -930,6 +974,13 @@ var customComponents = {
|
|
|
930
974
|
fileEdit: () => Promise.resolve().then(() => (init_FileEdit(), FileEdit_exports)),
|
|
931
975
|
quoteList: () => Promise.resolve().then(() => (init_QuoteList(), QuoteList_exports))
|
|
932
976
|
};
|
|
977
|
+
|
|
978
|
+
// src/components/styles.module.less
|
|
979
|
+
var styles_module_default2 = {
|
|
980
|
+
chatAttachments: "styles_module_chatAttachments",
|
|
981
|
+
chatSender: "styles_module_chatSender",
|
|
982
|
+
chatQuoteMsg: "styles_module_chatQuoteMsg"
|
|
983
|
+
};
|
|
933
984
|
var MessageRender_default = ({ message: message3, placement }) => {
|
|
934
985
|
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, children: [
|
|
935
986
|
message3.msgContent && /* @__PURE__ */ jsxRuntime.jsx(x.Bubble, { placement, content: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: message3.msgContent, customComponents }) }),
|
|
@@ -952,7 +1003,34 @@ var MessageRender_default = ({ message: message3, placement }) => {
|
|
|
952
1003
|
)
|
|
953
1004
|
},
|
|
954
1005
|
file.content
|
|
955
|
-
))
|
|
1006
|
+
)),
|
|
1007
|
+
message3.quoteMsg?.id && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1008
|
+
x.Bubble,
|
|
1009
|
+
{
|
|
1010
|
+
className: classNames9__default.default(styles_module_default2.chatQuoteMsg),
|
|
1011
|
+
placement,
|
|
1012
|
+
content: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
|
|
1013
|
+
message3.quoteMsg.msgContent && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
|
|
1014
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u3010\u5F15\u7528\u6D88\u606F\u3011\uFF1A" }),
|
|
1015
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: "text-ellipsis", children: message3.quoteMsg.msgContent })
|
|
1016
|
+
] }),
|
|
1017
|
+
message3.quoteMsg?.msgFiles && message3.quoteMsg.msgFiles.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
|
|
1018
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u3010\u5F15\u7528\u6587\u4EF6\u3011\uFF1A" }),
|
|
1019
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, wrap: true, flex: 1, children: message3.quoteMsg.msgFiles.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1020
|
+
x.Attachments.FileCard,
|
|
1021
|
+
{
|
|
1022
|
+
item: {
|
|
1023
|
+
uid: file.content,
|
|
1024
|
+
name: file.name,
|
|
1025
|
+
url: file.content
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
1028
|
+
file.content
|
|
1029
|
+
)) })
|
|
1030
|
+
] })
|
|
1031
|
+
] })
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
956
1034
|
] });
|
|
957
1035
|
};
|
|
958
1036
|
|
|
@@ -968,7 +1046,7 @@ init_utils();
|
|
|
968
1046
|
init_Context();
|
|
969
1047
|
|
|
970
1048
|
// src/ui/common/styles.module.less
|
|
971
|
-
var
|
|
1049
|
+
var styles_module_default3 = {
|
|
972
1050
|
loadingMessage: "styles_module_loadingMessage",
|
|
973
1051
|
nsConversationListPanel: "styles_module_nsConversationListPanel",
|
|
974
1052
|
nsConversations: "styles_module_nsConversations",
|
|
@@ -1030,7 +1108,7 @@ var MessageAIRender_default = ({ message: message3, placement }) => {
|
|
|
1030
1108
|
x.Bubble,
|
|
1031
1109
|
{
|
|
1032
1110
|
placement,
|
|
1033
|
-
className:
|
|
1111
|
+
className: classNames9__default.default({ [styles_module_default3.loadingMessage]: message3.type && message3.type !== "TEXT_MESSAGE_END" }),
|
|
1034
1112
|
content: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1035
1113
|
thinkContents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
1114
|
antd.Collapse,
|
|
@@ -1099,11 +1177,11 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1099
1177
|
() => [
|
|
1100
1178
|
{
|
|
1101
1179
|
key: "placeholder",
|
|
1102
|
-
content: /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { direction: "vertical", size: 16, className:
|
|
1180
|
+
content: /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { direction: "vertical", size: 16, className: styles_module_default3.chatWelcomeWrap, children: [
|
|
1103
1181
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1104
1182
|
x.Welcome,
|
|
1105
1183
|
{
|
|
1106
|
-
className:
|
|
1184
|
+
className: classNames9__default.default(styles_module_default3.chatWelcome, "p-t-32"),
|
|
1107
1185
|
variant: "borderless",
|
|
1108
1186
|
icon: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { shape: "square", size: 58, src: receiverState.active.logo }),
|
|
1109
1187
|
title: `\u4F60\u597D\uFF0C\u6211\u662F${receiverState.active.name || ""}`,
|
|
@@ -1121,7 +1199,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1121
1199
|
label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
|
|
1122
1200
|
children: receiverState.active.config.recommendQuestions.map(({ question }) => ({
|
|
1123
1201
|
key: question,
|
|
1124
|
-
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className:
|
|
1202
|
+
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className: classNames9__default.default(styles_module_default3.chatWelcomePrompts, "text-ellipsis"), children: question })
|
|
1125
1203
|
}))
|
|
1126
1204
|
}
|
|
1127
1205
|
]
|
|
@@ -1254,7 +1332,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1254
1332
|
autoScroll: false,
|
|
1255
1333
|
ref: listRef,
|
|
1256
1334
|
items: bubbleListItems,
|
|
1257
|
-
className:
|
|
1335
|
+
className: classNames9__default.default(styles_module_default3.nsBubbleList, "height-full", "scroll-fade-in", "zero-chat-bubbles"),
|
|
1258
1336
|
onScroll: handleScroll
|
|
1259
1337
|
},
|
|
1260
1338
|
conversationState.active.id
|
|
@@ -1285,18 +1363,18 @@ var CharacterList_default = () => {
|
|
|
1285
1363
|
okText: "\u5207\u6362\u6027\u683C",
|
|
1286
1364
|
onOk: () => chatStore.switchCharacter(activeCharacter),
|
|
1287
1365
|
confirmLoading: characterState.switchLoading,
|
|
1288
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1366
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsAvatarListContainer, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Row, { wrap: true, gutter: [16, 32], className: styles_module_default3.nsAvatarList, children: characterState.list.map((item) => /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, align: "center", className: styles_module_default3.nsAvatarListItem, onClick: () => setActiveCharacter(item), children: [
|
|
1289
1367
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1290
1368
|
antd.Avatar,
|
|
1291
1369
|
{
|
|
1292
|
-
className:
|
|
1293
|
-
[
|
|
1370
|
+
className: classNames9__default.default(styles_module_default3.nsAvatarListItemIcon, "cursor-pointer", {
|
|
1371
|
+
[styles_module_default3.nsAvatarListItemIconActive]: activeCharacter.id === item.id
|
|
1294
1372
|
}),
|
|
1295
1373
|
size: 50,
|
|
1296
1374
|
src: /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.logo, alt: "\u5934\u50CF" })
|
|
1297
1375
|
}
|
|
1298
1376
|
),
|
|
1299
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1377
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsAvatarListItemName, children: item.characterName })
|
|
1300
1378
|
] }) }, item.id)) }) })
|
|
1301
1379
|
}
|
|
1302
1380
|
);
|
|
@@ -1348,7 +1426,7 @@ var ConversationList_default = () => {
|
|
|
1348
1426
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1349
1427
|
x.Conversations,
|
|
1350
1428
|
{
|
|
1351
|
-
className:
|
|
1429
|
+
className: styles_module_default3.nsConversations,
|
|
1352
1430
|
items: conversationList,
|
|
1353
1431
|
activeKey: conversationState.active.id,
|
|
1354
1432
|
onActiveChange: async (id) => chatStore.switchConversation(id),
|
|
@@ -1384,7 +1462,7 @@ var ChatHeader_default = ({
|
|
|
1384
1462
|
const chatStore = useChatStore();
|
|
1385
1463
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
1386
1464
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
1387
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className:
|
|
1465
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className: classNames9__default.default(styles_module_default3.nsChatHeader, "zero-chat-header"), children: [
|
|
1388
1466
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, align: "center", children: [
|
|
1389
1467
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1390
1468
|
common.RenderWrapper,
|
|
@@ -1392,7 +1470,7 @@ var ChatHeader_default = ({
|
|
|
1392
1470
|
control: title,
|
|
1393
1471
|
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1394
1472
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 22, src: receiverState.active.logo, alt: receiverState.active.name }),
|
|
1395
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1473
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsChatTitle, children: receiverState.active.name })
|
|
1396
1474
|
] })
|
|
1397
1475
|
}
|
|
1398
1476
|
),
|
|
@@ -1416,7 +1494,7 @@ var ChatHeader_default = ({
|
|
|
1416
1494
|
{
|
|
1417
1495
|
getPopupContainer: (e) => e,
|
|
1418
1496
|
placement: "bottom",
|
|
1419
|
-
classNames: { body:
|
|
1497
|
+
classNames: { body: styles_module_default3.nsChatHeaderPopover },
|
|
1420
1498
|
content: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}),
|
|
1421
1499
|
trigger: ["click"],
|
|
1422
1500
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u5386\u53F2\u4F1A\u8BDD", type: "text", size: "large", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CommentOutlined, {}) })
|
|
@@ -1434,13 +1512,7 @@ var ChatHeader_default = ({
|
|
|
1434
1512
|
] })
|
|
1435
1513
|
] }) });
|
|
1436
1514
|
};
|
|
1437
|
-
|
|
1438
|
-
// src/components/styles.module.less
|
|
1439
|
-
var styles_module_default3 = {
|
|
1440
|
-
chatAttachments: "styles_module_chatAttachments",
|
|
1441
|
-
chatSender: "styles_module_chatSender"
|
|
1442
|
-
};
|
|
1443
|
-
var Attachments_default = react.forwardRef(({ fileUploadConfig = [], fileList = [], onChange, extraParams }, ref) => {
|
|
1515
|
+
var Attachments_default = react.forwardRef(({ fileUpload, fileUploadConfig = [], fileList = [], onChange, extraParams }, ref) => {
|
|
1444
1516
|
const { message: message3 } = antd.App.useApp();
|
|
1445
1517
|
const fileListRef = react.useRef([]);
|
|
1446
1518
|
const [attachedFiles, setAttachedFiles, getAttachedFiles] = common.useRefState([]);
|
|
@@ -1573,7 +1645,7 @@ var Attachments_default = react.forwardRef(({ fileUploadConfig = [], fileList =
|
|
|
1573
1645
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1574
1646
|
x.Attachments,
|
|
1575
1647
|
{
|
|
1576
|
-
className:
|
|
1648
|
+
className: styles_module_default2.chatAttachments,
|
|
1577
1649
|
accept: acceptStr,
|
|
1578
1650
|
multiple: true,
|
|
1579
1651
|
customRequest: onCustomRequest,
|
|
@@ -1605,11 +1677,11 @@ var ChatSender_default = react.forwardRef(
|
|
|
1605
1677
|
extraFooter,
|
|
1606
1678
|
extraFooterBelow,
|
|
1607
1679
|
sendBtnProps,
|
|
1608
|
-
fileUpload
|
|
1680
|
+
fileUpload
|
|
1609
1681
|
}, ref) => {
|
|
1610
1682
|
const senderRef = react.useRef(null);
|
|
1611
1683
|
const { inputValue, setInputValue } = common.useSyncInput(content || "", onContentChange);
|
|
1612
|
-
const attachmentsNode = (
|
|
1684
|
+
const attachmentsNode = (fileUpload?.config?.length ?? 0 > 0) && /* @__PURE__ */ jsxRuntime.jsx(antd.Badge, { dot: !!fileList?.length && !headerOpen, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PaperClipOutlined, {}), onClick: () => onHeaderOpenChange(!headerOpen) }) });
|
|
1613
1685
|
const attachmentsRef = react.useRef();
|
|
1614
1686
|
const senderHeader = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1615
1687
|
/* @__PURE__ */ jsxRuntime.jsx(x.Sender.Header, { title: "\u9009\u62E9\u6587\u4EF6", open: headerOpen, onOpenChange: onHeaderOpenChange, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1617,9 +1689,10 @@ var ChatSender_default = react.forwardRef(
|
|
|
1617
1689
|
{
|
|
1618
1690
|
ref: attachmentsRef,
|
|
1619
1691
|
fileList,
|
|
1692
|
+
fileUpload: fileUpload.request,
|
|
1620
1693
|
onChange: onFileListChange,
|
|
1621
|
-
fileUploadConfig:
|
|
1622
|
-
extraParams:
|
|
1694
|
+
fileUploadConfig: fileUpload.config,
|
|
1695
|
+
extraParams: fileUpload.params
|
|
1623
1696
|
}
|
|
1624
1697
|
) }),
|
|
1625
1698
|
extraHeader
|
|
@@ -1641,7 +1714,7 @@ var ChatSender_default = react.forwardRef(
|
|
|
1641
1714
|
return /* @__PURE__ */ jsxRuntime.jsx(x.Suggestion, { items: [], onSelect: (itemVal) => setInputValue(`[${itemVal}]:`), children: ({}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1642
1715
|
x.Sender,
|
|
1643
1716
|
{
|
|
1644
|
-
className:
|
|
1717
|
+
className: styles_module_default2.chatSender,
|
|
1645
1718
|
ref: senderRef,
|
|
1646
1719
|
value: inputValue,
|
|
1647
1720
|
header: senderHeader,
|
|
@@ -1690,16 +1763,16 @@ var SenderPromptsItems_default = () => {
|
|
|
1690
1763
|
{
|
|
1691
1764
|
itemLayout: "horizontal",
|
|
1692
1765
|
split: false,
|
|
1693
|
-
className:
|
|
1766
|
+
className: styles_module_default3.nsSenderList,
|
|
1694
1767
|
dataSource: question.items,
|
|
1695
|
-
renderItem: (item) => /* @__PURE__ */ jsxRuntime.jsx(antd.List.Item, { onClick: () => chatStore.sendMessage(item.question), className:
|
|
1696
|
-
footer: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "end", className:
|
|
1768
|
+
renderItem: (item) => /* @__PURE__ */ jsxRuntime.jsx(antd.List.Item, { onClick: () => chatStore.sendMessage(item.question), className: styles_module_default3.nsSenderListItem, children: item.question }),
|
|
1769
|
+
footer: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "end", className: styles_module_default3.nsSenderListFooter, children: "(\u60A8\u53EF\u70B9\u51FB\u4EE5\u4E0A\u95EE\u9898\u5F00\u542FAI\u4F53\u9A8C)" })
|
|
1697
1770
|
}
|
|
1698
1771
|
),
|
|
1699
1772
|
title: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1700
1773
|
"div",
|
|
1701
1774
|
{
|
|
1702
|
-
className:
|
|
1775
|
+
className: classNames9__default.default(styles_module_default3.nsSenderListTitle, "text-ellipsis"),
|
|
1703
1776
|
children: `${receiverState.active.name}\u5F00\u59CB\u5173\u6CE8${question.name}\u5185\u5BB9\uFF01`
|
|
1704
1777
|
}
|
|
1705
1778
|
),
|
|
@@ -1715,6 +1788,7 @@ var SenderPromptsItems_default = () => {
|
|
|
1715
1788
|
var ChatSender_default2 = react.forwardRef(
|
|
1716
1789
|
({ placeholder, extraBtn = false, referencesBtn = false, sendBtnProps, footerBelow = false, prompts = true }, ref) => {
|
|
1717
1790
|
const chatStore = useChatStore();
|
|
1791
|
+
const configState = valtio.useSnapshot(chatStore.config);
|
|
1718
1792
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
1719
1793
|
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
1720
1794
|
const chatMessage = react.useMemo(
|
|
@@ -1746,6 +1820,7 @@ var ChatSender_default2 = react.forwardRef(
|
|
|
1746
1820
|
onCancel: chatStore.cancelReceive,
|
|
1747
1821
|
onFocus: chatStore.config.hooks?.onSenderFocus,
|
|
1748
1822
|
fileUpload: {
|
|
1823
|
+
request: configState.services.request?.fileUpload,
|
|
1749
1824
|
config: receiverState.active.config?.fileUpload
|
|
1750
1825
|
},
|
|
1751
1826
|
sendBtnProps: common.isFunction(sendBtnProps) ? sendBtnProps() : {},
|
|
@@ -1788,8 +1863,8 @@ var ChatSender_default2 = react.forwardRef(
|
|
|
1788
1863
|
open: !!chatMessage?.references?.content?.name,
|
|
1789
1864
|
onOpenChange: () => chatStore.setReferences(),
|
|
1790
1865
|
classNames: {
|
|
1791
|
-
header:
|
|
1792
|
-
content: common.shouldRender(referencesBtn) ? "" :
|
|
1866
|
+
header: styles_module_default3.nsSenderReferenceHeaderTitle,
|
|
1867
|
+
content: common.shouldRender(referencesBtn) ? "" : styles_module_default3.nsSenderReferenceHeaderContent
|
|
1793
1868
|
},
|
|
1794
1869
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
1870
|
common.RenderWrapper,
|
|
@@ -1817,7 +1892,7 @@ var ConversationListHeader_default = () => {
|
|
|
1817
1892
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-24", children: [
|
|
1818
1893
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
1819
1894
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 36, src: receiverState.active.logo }),
|
|
1820
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1895
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_module_default3.nsChatUserName, children: receiverState.active.name })
|
|
1821
1896
|
] }),
|
|
1822
1897
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1823
1898
|
antd.Button,
|
|
@@ -1826,7 +1901,7 @@ var ConversationListHeader_default = () => {
|
|
|
1826
1901
|
type: "primary",
|
|
1827
1902
|
shape: "round",
|
|
1828
1903
|
onClick: () => chatStore.createConversation(),
|
|
1829
|
-
className:
|
|
1904
|
+
className: classNames9__default.default("m-t-16"),
|
|
1830
1905
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
1831
1906
|
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
1832
1907
|
}
|
|
@@ -1834,7 +1909,7 @@ var ConversationListHeader_default = () => {
|
|
|
1834
1909
|
] });
|
|
1835
1910
|
};
|
|
1836
1911
|
var ConversationListPanel_default = ({ header }) => {
|
|
1837
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
1912
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames9__default.default("height-full", "zero-chat-conversations", styles_module_default3.nsConversationListPanel), children: [
|
|
1838
1913
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
1839
1914
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}) })
|
|
1840
1915
|
] });
|
|
@@ -1850,9 +1925,12 @@ var styles_module_default4 = {
|
|
|
1850
1925
|
nsChatBody: "styles_module_nsChatBody",
|
|
1851
1926
|
nsBodyWidth: "styles_module_nsBodyWidth"
|
|
1852
1927
|
};
|
|
1853
|
-
var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout, config }, ref) => {
|
|
1928
|
+
var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout, config, services }, ref) => {
|
|
1854
1929
|
const chatStore = react.useMemo(() => createChatStore(), []);
|
|
1855
1930
|
const senderRef = react.useRef();
|
|
1931
|
+
common.useDeepEffect(() => {
|
|
1932
|
+
chatStore.setServices(services);
|
|
1933
|
+
}, [services]);
|
|
1856
1934
|
common.useDeepEffect(() => {
|
|
1857
1935
|
if (config?.conversationId) {
|
|
1858
1936
|
chatStore.switchConversation(config.conversationId);
|
|
@@ -1886,6 +1964,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
1886
1964
|
setReferences: chatStore.setReferences,
|
|
1887
1965
|
setMessage: chatStore.setContent,
|
|
1888
1966
|
setFiles: chatStore.setFileList,
|
|
1967
|
+
setServices: chatStore.setServices,
|
|
1889
1968
|
setParams: chatStore.setParams,
|
|
1890
1969
|
senderFocus: (options) => {
|
|
1891
1970
|
senderRef.current?.focus(options);
|
|
@@ -1908,7 +1987,19 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
1908
1987
|
}
|
|
1909
1988
|
}, [hasPreView]);
|
|
1910
1989
|
common.useWebSocket({
|
|
1911
|
-
url:
|
|
1990
|
+
url: configState.services.websocketBaseUrls?.[0] && common.getWebSocketUrl(
|
|
1991
|
+
`${configState.services.websocketBaseUrls?.[0]}/lolr/conversation/ws/subscribe?NS-TOKEN=${common.getToken()}`,
|
|
1992
|
+
common.isLocalhost() ? "192.168.6.23" : ""
|
|
1993
|
+
),
|
|
1994
|
+
onMessage: chatStore.acceptMessage,
|
|
1995
|
+
clientHeartbeat: false,
|
|
1996
|
+
reconnectInterval: 1e4
|
|
1997
|
+
});
|
|
1998
|
+
common.useWebSocket({
|
|
1999
|
+
url: configState.services.websocketBaseUrls?.[1] && common.getWebSocketUrl(
|
|
2000
|
+
`${configState.services.websocketBaseUrls?.[1]}/lolr/conversation/ws/subscribe?NS-TOKEN=${common.getToken()}`,
|
|
2001
|
+
common.isLocalhost() ? "192.168.6.23" : ""
|
|
2002
|
+
),
|
|
1912
2003
|
onMessage: chatStore.acceptMessage,
|
|
1913
2004
|
clientHeartbeat: false,
|
|
1914
2005
|
reconnectInterval: 1e4
|
|
@@ -1916,7 +2007,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
1916
2007
|
react.useEffect(() => {
|
|
1917
2008
|
configState.hooks?.onBeforeInit?.();
|
|
1918
2009
|
}, []);
|
|
1919
|
-
return /* @__PURE__ */ jsxRuntime.jsx(x.XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
2010
|
+
return /* @__PURE__ */ jsxRuntime.jsx(x.XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames9__default.default(styles_module_default4.nsChatLayout, "zero-chat-layout", "height-full"), children: [
|
|
1920
2011
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
1921
2012
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { className: "full-scroll", children: [
|
|
1922
2013
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.leftPanel }),
|
|
@@ -1965,20 +2056,20 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
1965
2056
|
}
|
|
1966
2057
|
});
|
|
1967
2058
|
},
|
|
1968
|
-
onDownloadFile: (content, type) => fileCreate(content, configState.preview.file.fileName, type),
|
|
2059
|
+
onDownloadFile: (content, type) => configState.services.request.fileCreate(content, configState.preview.file.fileName, type),
|
|
1969
2060
|
extraNav: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Tag, { bordered: false, color: "default", className: "cursor-pointer", onClick: () => chatStore.setPreview(), children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseOutlined, {}) }) })
|
|
1970
2061
|
}
|
|
1971
2062
|
)
|
|
1972
2063
|
] }) }),
|
|
1973
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
2064
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames9__default.default("height-full"), children: [
|
|
1974
2065
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
1975
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className:
|
|
2066
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames9__default.default("full-scroll"), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1976
2067
|
antd.Flex,
|
|
1977
2068
|
{
|
|
1978
2069
|
justify: "center",
|
|
1979
2070
|
vertical: true,
|
|
1980
2071
|
gap: 24,
|
|
1981
|
-
className:
|
|
2072
|
+
className: classNames9__default.default("height-full", styles_module_default4.nsChatBody, "zero-chat-body", styles_module_default4.nsBodyWidth),
|
|
1982
2073
|
children: [
|
|
1983
2074
|
common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
|
|
1984
2075
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
|