@zero-library/chat-agent 2.1.13 → 2.1.15
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/README.md +1 -3
- package/dist/index.cjs.js +82 -90
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +29 -33
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +82 -27
- package/dist/index.d.ts +82 -27
- package/dist/index.esm.js +82 -90
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -8,13 +8,13 @@ var react = require('react');
|
|
|
8
8
|
var valtio = require('valtio');
|
|
9
9
|
var icons = require('@ant-design/icons');
|
|
10
10
|
var x = require('@ant-design/x');
|
|
11
|
-
var
|
|
11
|
+
var classNames8 = 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 classNames8__default = /*#__PURE__*/_interopDefault(classNames8);
|
|
18
18
|
var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
|
|
19
19
|
|
|
20
20
|
var __defProp = Object.defineProperty;
|
|
@@ -43,7 +43,7 @@ function transform(source, fieldMap) {
|
|
|
43
43
|
function transforms(sources, fieldMap) {
|
|
44
44
|
return sources?.map((source) => transform(source, fieldMap)) || [];
|
|
45
45
|
}
|
|
46
|
-
var copy, classifyTime;
|
|
46
|
+
var copy, classifyTime, replaceThinkTags;
|
|
47
47
|
var init_utils = __esm({
|
|
48
48
|
"src/core/utils.ts"() {
|
|
49
49
|
copy = (value) => {
|
|
@@ -68,6 +68,9 @@ var init_utils = __esm({
|
|
|
68
68
|
return "\u66F4\u65E9";
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
+
replaceThinkTags = (str) => {
|
|
72
|
+
return str.replace(/<think>/g, ":::alert type=think data={content:'").replace(/<\/think>/g, "'} :::");
|
|
73
|
+
};
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
76
|
var ChatProvider, useChatStore;
|
|
@@ -88,7 +91,8 @@ var init_styles_module = __esm({
|
|
|
88
91
|
fileEditHeader: "styles_module_fileEditHeader",
|
|
89
92
|
fileEditContent: "styles_module_fileEditContent",
|
|
90
93
|
quoteList: "styles_module_quoteList",
|
|
91
|
-
mdEdit: "styles_module_mdEdit"
|
|
94
|
+
mdEdit: "styles_module_mdEdit",
|
|
95
|
+
think: "styles_module_think"
|
|
92
96
|
};
|
|
93
97
|
}
|
|
94
98
|
});
|
|
@@ -106,7 +110,7 @@ var init_AppCard = __esm({
|
|
|
106
110
|
AppCard_default = ({ data, loading }) => {
|
|
107
111
|
const chatStore = useChatStore();
|
|
108
112
|
const onClick = () => {
|
|
109
|
-
chatStore.switchAgentConversation(
|
|
113
|
+
chatStore.switchAgentConversation(data.appKey);
|
|
110
114
|
};
|
|
111
115
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 4, align: "center", className: styles_module_default.appCard, onClick, children: [
|
|
112
116
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: data.iconUrl }),
|
|
@@ -297,6 +301,36 @@ var init_QuoteList = __esm({
|
|
|
297
301
|
}
|
|
298
302
|
});
|
|
299
303
|
|
|
304
|
+
// src/ui/common/markdownAlert/Think.tsx
|
|
305
|
+
var Think_exports = {};
|
|
306
|
+
__export(Think_exports, {
|
|
307
|
+
default: () => Think_default
|
|
308
|
+
});
|
|
309
|
+
var Think_default;
|
|
310
|
+
var init_Think = __esm({
|
|
311
|
+
"src/ui/common/markdownAlert/Think.tsx"() {
|
|
312
|
+
init_styles_module();
|
|
313
|
+
Think_default = ({ data, loading }) => {
|
|
314
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
315
|
+
antd.Collapse,
|
|
316
|
+
{
|
|
317
|
+
className: styles_module_default.think,
|
|
318
|
+
ghost: true,
|
|
319
|
+
size: "small",
|
|
320
|
+
defaultActiveKey: ["think"],
|
|
321
|
+
items: [
|
|
322
|
+
{
|
|
323
|
+
key: "think",
|
|
324
|
+
label: loading ? "\u4ED4\u7EC6\u601D\u8003\u4E2D..." : "\u601D\u8003\u8FC7\u7A0B",
|
|
325
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: data.content })
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
300
334
|
// src/stores/index.ts
|
|
301
335
|
init_utils();
|
|
302
336
|
|
|
@@ -910,6 +944,13 @@ function createChatStore() {
|
|
|
910
944
|
conversation.messages[msg.conversationId].loading = false;
|
|
911
945
|
getQuestionList(msg.conversationId, msg.id);
|
|
912
946
|
};
|
|
947
|
+
const errCallback = (msg) => {
|
|
948
|
+
const messages = conversation.messages[msg.conversationId].message;
|
|
949
|
+
const idx = findMsgIndex(msg.conversationId, msg.id);
|
|
950
|
+
if (idx === -1) return;
|
|
951
|
+
messages[idx] = { ...msg, type: void 0 };
|
|
952
|
+
conversation.messages[msg.conversationId].loading = false;
|
|
953
|
+
};
|
|
913
954
|
const acceptMessage = (newMessage) => {
|
|
914
955
|
const conversationId = newMessage.data.conversationId;
|
|
915
956
|
if (!conversation.messages[conversationId]?.message) return;
|
|
@@ -926,6 +967,9 @@ function createChatStore() {
|
|
|
926
967
|
case "TEXT_MESSAGE_END":
|
|
927
968
|
endCallback(newMessage.data);
|
|
928
969
|
break;
|
|
970
|
+
case "RUN_ERROR":
|
|
971
|
+
errCallback(newMessage.data);
|
|
972
|
+
break;
|
|
929
973
|
}
|
|
930
974
|
};
|
|
931
975
|
return {
|
|
@@ -965,6 +1009,9 @@ function createChatStore() {
|
|
|
965
1009
|
// src/ui/layouts/index.tsx
|
|
966
1010
|
init_Context();
|
|
967
1011
|
|
|
1012
|
+
// src/components/MessageRender.tsx
|
|
1013
|
+
init_utils();
|
|
1014
|
+
|
|
968
1015
|
// src/ui/common/markdownAlert/index.ts
|
|
969
1016
|
var customComponents = {
|
|
970
1017
|
appCard: () => Promise.resolve().then(() => (init_AppCard(), AppCard_exports)),
|
|
@@ -972,18 +1019,27 @@ var customComponents = {
|
|
|
972
1019
|
indexQuote: () => Promise.resolve().then(() => (init_IndexQuote(), IndexQuote_exports)),
|
|
973
1020
|
mdEdit: () => Promise.resolve().then(() => (init_MdEdit(), MdEdit_exports)),
|
|
974
1021
|
fileEdit: () => Promise.resolve().then(() => (init_FileEdit(), FileEdit_exports)),
|
|
975
|
-
quoteList: () => Promise.resolve().then(() => (init_QuoteList(), QuoteList_exports))
|
|
1022
|
+
quoteList: () => Promise.resolve().then(() => (init_QuoteList(), QuoteList_exports)),
|
|
1023
|
+
think: () => Promise.resolve().then(() => (init_Think(), Think_exports))
|
|
976
1024
|
};
|
|
977
1025
|
|
|
978
1026
|
// src/components/styles.module.less
|
|
979
1027
|
var styles_module_default2 = {
|
|
1028
|
+
loadingMessage: "styles_module_loadingMessage",
|
|
980
1029
|
chatAttachments: "styles_module_chatAttachments",
|
|
981
1030
|
chatSender: "styles_module_chatSender",
|
|
982
1031
|
chatQuoteMsg: "styles_module_chatQuoteMsg"
|
|
983
1032
|
};
|
|
984
1033
|
var MessageRender_default = ({ message: message3, placement }) => {
|
|
985
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
986
|
-
message3.msgContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1034
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, children: !(message3.msgContent || message3.msgFiles.length) ? /* @__PURE__ */ jsxRuntime.jsx(antd.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1035
|
+
message3.msgContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
|
+
x.Bubble,
|
|
1037
|
+
{
|
|
1038
|
+
placement,
|
|
1039
|
+
className: classNames8__default.default({ [styles_module_default2.loadingMessage]: message3.type }),
|
|
1040
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: replaceThinkTags(message3.msgContent), customComponents })
|
|
1041
|
+
}
|
|
1042
|
+
),
|
|
987
1043
|
message3.msgFiles?.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
988
1044
|
x.Bubble,
|
|
989
1045
|
{
|
|
@@ -1007,7 +1063,7 @@ var MessageRender_default = ({ message: message3, placement }) => {
|
|
|
1007
1063
|
message3.quoteMsg?.id && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1008
1064
|
x.Bubble,
|
|
1009
1065
|
{
|
|
1010
|
-
className:
|
|
1066
|
+
className: classNames8__default.default(styles_module_default2.chatQuoteMsg),
|
|
1011
1067
|
placement,
|
|
1012
1068
|
content: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
|
|
1013
1069
|
message3.quoteMsg.msgContent && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
|
|
@@ -1031,7 +1087,7 @@ var MessageRender_default = ({ message: message3, placement }) => {
|
|
|
1031
1087
|
] })
|
|
1032
1088
|
}
|
|
1033
1089
|
)
|
|
1034
|
-
] });
|
|
1090
|
+
] }) });
|
|
1035
1091
|
};
|
|
1036
1092
|
|
|
1037
1093
|
// src/core/constants.ts
|
|
@@ -1047,7 +1103,6 @@ init_Context();
|
|
|
1047
1103
|
|
|
1048
1104
|
// src/ui/common/styles.module.less
|
|
1049
1105
|
var styles_module_default3 = {
|
|
1050
|
-
loadingMessage: "styles_module_loadingMessage",
|
|
1051
1106
|
nsConversationListPanel: "styles_module_nsConversationListPanel",
|
|
1052
1107
|
nsConversations: "styles_module_nsConversations",
|
|
1053
1108
|
nsBubbleList: "styles_module_nsBubbleList",
|
|
@@ -1071,68 +1126,6 @@ var styles_module_default3 = {
|
|
|
1071
1126
|
nsAvatarListItemIconActive: "styles_module_nsAvatarListItemIconActive",
|
|
1072
1127
|
nsAvatarListItemName: "styles_module_nsAvatarListItemName"
|
|
1073
1128
|
};
|
|
1074
|
-
function extractThinkContent(content) {
|
|
1075
|
-
let main = content;
|
|
1076
|
-
const thinkContents = [];
|
|
1077
|
-
let buffer = "";
|
|
1078
|
-
const regex = /<think>(.*?)<\/think>/gs;
|
|
1079
|
-
for (const match of content.matchAll(regex)) {
|
|
1080
|
-
const thinkText = match[1].trim();
|
|
1081
|
-
thinkContents.push(thinkText);
|
|
1082
|
-
main = main.replace(match[0], "");
|
|
1083
|
-
}
|
|
1084
|
-
const lastStart = content.lastIndexOf("<think>");
|
|
1085
|
-
const lastEnd = content.lastIndexOf("</think>");
|
|
1086
|
-
if (lastStart > lastEnd) {
|
|
1087
|
-
buffer = content.slice(lastStart).replace("<think>", "");
|
|
1088
|
-
main = main.slice(0, lastStart);
|
|
1089
|
-
}
|
|
1090
|
-
return { mainContent: main, thinkContents, thinkBuffer: buffer };
|
|
1091
|
-
}
|
|
1092
|
-
function renderMarkdownPanel(content, label, key) {
|
|
1093
|
-
return {
|
|
1094
|
-
key,
|
|
1095
|
-
label,
|
|
1096
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content, customComponents })
|
|
1097
|
-
};
|
|
1098
|
-
}
|
|
1099
|
-
var MessageAIRender_default = ({ message: message3, placement }) => {
|
|
1100
|
-
const { mainContent, thinkContents, thinkBuffer } = react.useMemo(() => {
|
|
1101
|
-
if (!message3?.msgContent) return { mainContent: "", thinkContents: [], thinkBuffer: "" };
|
|
1102
|
-
return extractThinkContent(message3.msgContent);
|
|
1103
|
-
}, [message3?.msgContent]);
|
|
1104
|
-
if (!message3.msgContent) {
|
|
1105
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) });
|
|
1106
|
-
}
|
|
1107
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1108
|
-
x.Bubble,
|
|
1109
|
-
{
|
|
1110
|
-
placement,
|
|
1111
|
-
className: classNames9__default.default({ [styles_module_default3.loadingMessage]: message3.type && message3.type !== "TEXT_MESSAGE_END" }),
|
|
1112
|
-
content: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1113
|
-
thinkContents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1114
|
-
antd.Collapse,
|
|
1115
|
-
{
|
|
1116
|
-
ghost: true,
|
|
1117
|
-
size: "small",
|
|
1118
|
-
defaultActiveKey: thinkContents.map((_, i) => `think-${i}`),
|
|
1119
|
-
items: thinkContents.map((content, index) => renderMarkdownPanel(content, `\u601D\u8003\u8FC7\u7A0B`, `think-${index}`))
|
|
1120
|
-
}
|
|
1121
|
-
),
|
|
1122
|
-
thinkBuffer && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1123
|
-
antd.Collapse,
|
|
1124
|
-
{
|
|
1125
|
-
ghost: true,
|
|
1126
|
-
size: "small",
|
|
1127
|
-
defaultActiveKey: ["buffer-think"],
|
|
1128
|
-
items: [renderMarkdownPanel(thinkBuffer, "\u4ED4\u7EC6\u601D\u8003\u4E2D...", "buffer-think")]
|
|
1129
|
-
}
|
|
1130
|
-
),
|
|
1131
|
-
/* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: mainContent, customComponents })
|
|
1132
|
-
] })
|
|
1133
|
-
}
|
|
1134
|
-
) });
|
|
1135
|
-
};
|
|
1136
1129
|
var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, agent: true, other: true } }) => {
|
|
1137
1130
|
const chatStore = useChatStore();
|
|
1138
1131
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
@@ -1181,7 +1174,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1181
1174
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1182
1175
|
x.Welcome,
|
|
1183
1176
|
{
|
|
1184
|
-
className:
|
|
1177
|
+
className: classNames8__default.default(styles_module_default3.chatWelcome, "p-t-32"),
|
|
1185
1178
|
variant: "borderless",
|
|
1186
1179
|
icon: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { shape: "square", size: 58, src: receiverState.active.logo }),
|
|
1187
1180
|
title: `\u4F60\u597D\uFF0C\u6211\u662F${receiverState.active.name || ""}`,
|
|
@@ -1199,7 +1192,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1199
1192
|
label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
|
|
1200
1193
|
children: receiverState.active.config.recommendQuestions.map(({ question }) => ({
|
|
1201
1194
|
key: question,
|
|
1202
|
-
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className:
|
|
1195
|
+
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className: classNames8__default.default(styles_module_default3.chatWelcomePrompts, "text-ellipsis"), children: question })
|
|
1203
1196
|
}))
|
|
1204
1197
|
}
|
|
1205
1198
|
]
|
|
@@ -1245,8 +1238,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1245
1238
|
placement: role.placement,
|
|
1246
1239
|
variant: "borderless",
|
|
1247
1240
|
avatar: role.avatar,
|
|
1248
|
-
content:
|
|
1249
|
-
// loadingRender: () => <Spin size="small" />,
|
|
1241
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(MessageRender_default, { message: message3, placement: role.placement }),
|
|
1250
1242
|
footer: role.user === "agent" && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
|
|
1251
1243
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => copy(message3.msgContent), color: "default", variant: "text", size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyOutlined, {}) }),
|
|
1252
1244
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1332,7 +1324,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
|
|
|
1332
1324
|
autoScroll: false,
|
|
1333
1325
|
ref: listRef,
|
|
1334
1326
|
items: bubbleListItems,
|
|
1335
|
-
className:
|
|
1327
|
+
className: classNames8__default.default(styles_module_default3.nsBubbleList, "height-full", "scroll-fade-in", "zero-chat-bubbles"),
|
|
1336
1328
|
onScroll: handleScroll
|
|
1337
1329
|
},
|
|
1338
1330
|
conversationState.active.id
|
|
@@ -1367,7 +1359,7 @@ var CharacterList_default = () => {
|
|
|
1367
1359
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1368
1360
|
antd.Avatar,
|
|
1369
1361
|
{
|
|
1370
|
-
className:
|
|
1362
|
+
className: classNames8__default.default(styles_module_default3.nsAvatarListItemIcon, "cursor-pointer", {
|
|
1371
1363
|
[styles_module_default3.nsAvatarListItemIconActive]: activeCharacter.id === item.id
|
|
1372
1364
|
}),
|
|
1373
1365
|
size: 50,
|
|
@@ -1462,7 +1454,7 @@ var ChatHeader_default = ({
|
|
|
1462
1454
|
const chatStore = useChatStore();
|
|
1463
1455
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
1464
1456
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
1465
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className:
|
|
1457
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className: classNames8__default.default(styles_module_default3.nsChatHeader, "zero-chat-header"), children: [
|
|
1466
1458
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, align: "center", children: [
|
|
1467
1459
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1468
1460
|
common.RenderWrapper,
|
|
@@ -1732,7 +1724,7 @@ var ChatSender_default = react.forwardRef(
|
|
|
1732
1724
|
extraFooter,
|
|
1733
1725
|
" "
|
|
1734
1726
|
] }),
|
|
1735
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { align: "center", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingButton, {}) : /* @__PURE__ */ jsxRuntime.jsx(SendButton, { ...sendBtnProps }) })
|
|
1727
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { align: "center", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingButton, { disabled: false }) : /* @__PURE__ */ jsxRuntime.jsx(SendButton, { ...sendBtnProps }) })
|
|
1736
1728
|
] }),
|
|
1737
1729
|
extraFooterBelow
|
|
1738
1730
|
] });
|
|
@@ -1772,7 +1764,7 @@ var SenderPromptsItems_default = () => {
|
|
|
1772
1764
|
title: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1773
1765
|
"div",
|
|
1774
1766
|
{
|
|
1775
|
-
className:
|
|
1767
|
+
className: classNames8__default.default(styles_module_default3.nsSenderListTitle, "text-ellipsis"),
|
|
1776
1768
|
children: `${receiverState.active.name}\u5F00\u59CB\u5173\u6CE8${question.name}\u5185\u5BB9\uFF01`
|
|
1777
1769
|
}
|
|
1778
1770
|
),
|
|
@@ -1901,7 +1893,7 @@ var ConversationListHeader_default = () => {
|
|
|
1901
1893
|
type: "primary",
|
|
1902
1894
|
shape: "round",
|
|
1903
1895
|
onClick: () => chatStore.createConversation(),
|
|
1904
|
-
className:
|
|
1896
|
+
className: classNames8__default.default("m-t-16"),
|
|
1905
1897
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
1906
1898
|
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
1907
1899
|
}
|
|
@@ -1909,7 +1901,7 @@ var ConversationListHeader_default = () => {
|
|
|
1909
1901
|
] });
|
|
1910
1902
|
};
|
|
1911
1903
|
var ConversationListPanel_default = ({ header }) => {
|
|
1912
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
1904
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames8__default.default("height-full", "zero-chat-conversations", styles_module_default3.nsConversationListPanel), children: [
|
|
1913
1905
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
1914
1906
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}) })
|
|
1915
1907
|
] });
|
|
@@ -1989,7 +1981,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
1989
1981
|
common.useWebSocket({
|
|
1990
1982
|
url: configState.services.websocketBaseUrls?.[0] && common.getWebSocketUrl(
|
|
1991
1983
|
`${configState.services.websocketBaseUrls?.[0]}/lolr/conversation/ws/subscribe?NS-TOKEN=${common.getToken()}`,
|
|
1992
|
-
common.isLocalhost() ? "192.168.
|
|
1984
|
+
common.isLocalhost() ? "192.168.3.102" : ""
|
|
1993
1985
|
),
|
|
1994
1986
|
onMessage: chatStore.acceptMessage,
|
|
1995
1987
|
clientHeartbeat: false,
|
|
@@ -1998,7 +1990,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
1998
1990
|
common.useWebSocket({
|
|
1999
1991
|
url: configState.services.websocketBaseUrls?.[1] && common.getWebSocketUrl(
|
|
2000
1992
|
`${configState.services.websocketBaseUrls?.[1]}/lolr/conversation/ws/subscribe?NS-TOKEN=${common.getToken()}`,
|
|
2001
|
-
common.isLocalhost() ? "192.168.
|
|
1993
|
+
common.isLocalhost() ? "192.168.3.102" : ""
|
|
2002
1994
|
),
|
|
2003
1995
|
onMessage: chatStore.acceptMessage,
|
|
2004
1996
|
clientHeartbeat: false,
|
|
@@ -2007,7 +1999,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
2007
1999
|
react.useEffect(() => {
|
|
2008
2000
|
configState.hooks?.onBeforeInit?.();
|
|
2009
2001
|
}, []);
|
|
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:
|
|
2002
|
+
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: classNames8__default.default(styles_module_default4.nsChatLayout, "zero-chat-layout", "height-full"), children: [
|
|
2011
2003
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
2012
2004
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { className: "full-scroll", children: [
|
|
2013
2005
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.leftPanel }),
|
|
@@ -2061,15 +2053,15 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
2061
2053
|
}
|
|
2062
2054
|
)
|
|
2063
2055
|
] }) }),
|
|
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:
|
|
2056
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames8__default.default("height-full"), children: [
|
|
2065
2057
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
2066
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className:
|
|
2058
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames8__default.default("full-scroll"), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2067
2059
|
antd.Flex,
|
|
2068
2060
|
{
|
|
2069
2061
|
justify: "center",
|
|
2070
2062
|
vertical: true,
|
|
2071
2063
|
gap: 24,
|
|
2072
|
-
className:
|
|
2064
|
+
className: classNames8__default.default("height-full", styles_module_default4.nsChatBody, "zero-chat-body", styles_module_default4.nsBodyWidth),
|
|
2073
2065
|
children: [
|
|
2074
2066
|
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 }) }),
|
|
2075
2067
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
|