bhd-components 0.10.39 → 0.10.40
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.esm.es5.development.js +15 -10
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +316 -316
- package/dist/vendor.esm.es5.production.js +1 -1
- package/es2017/customerService/contactsList.js +3 -3
- package/es2017/customerService/function.d.ts +2 -1
- package/es2017/customerService/function.js +5 -1
- package/es2017/customerService/index.js +7 -8
- package/esm/customerService/contactsList.js +3 -3
- package/esm/customerService/function.d.ts +2 -1
- package/esm/customerService/function.js +6 -1
- package/esm/customerService/index.js +9 -9
- package/package.json +1 -1
|
@@ -2965,6 +2965,11 @@ var handleRenderSyntaxBlock = function(markdownContent, flag) {
|
|
|
2965
2965
|
return markdownContent;
|
|
2966
2966
|
}
|
|
2967
2967
|
};
|
|
2968
|
+
// 去掉think
|
|
2969
|
+
var replaceThinkAndYaml = function() {
|
|
2970
|
+
var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
2971
|
+
return text.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "").replace(/<thinking>([\s\S]*?)<\/thinking>/g, "").replace(RegExp('<div\\s+class="think-block">.*?<\\/div>', "gs"), "").replace(/^[ \n]+/g, "");
|
|
2972
|
+
};
|
|
2968
2973
|
|
|
2969
2974
|
var HistoryFun = function(props) {
|
|
2970
2975
|
var type = props.type; props.roomId; var userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, loadSpecifiedData = props.loadSpecifiedData;
|
|
@@ -3514,7 +3519,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
3514
3519
|
}),
|
|
3515
3520
|
/*#__PURE__*/ jsx("p", {
|
|
3516
3521
|
className: modules_63b47c51$f.con,
|
|
3517
|
-
children: contactsList.length > 0 && contactsList[0].lastMsg
|
|
3522
|
+
children: contactsList.length > 0 && replaceThinkAndYaml(contactsList[0].lastMsg)
|
|
3518
3523
|
})
|
|
3519
3524
|
]
|
|
3520
3525
|
})
|
|
@@ -3560,7 +3565,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
3560
3565
|
}),
|
|
3561
3566
|
/*#__PURE__*/ jsx("p", {
|
|
3562
3567
|
className: modules_63b47c51$f.con,
|
|
3563
|
-
children: item.lastMsg
|
|
3568
|
+
children: replaceThinkAndYaml(item.lastMsg)
|
|
3564
3569
|
})
|
|
3565
3570
|
]
|
|
3566
3571
|
})
|
|
@@ -8216,11 +8221,6 @@ function escapeHtml(str) {
|
|
|
8216
8221
|
return str;
|
|
8217
8222
|
}
|
|
8218
8223
|
var exactRegex = /class\s*=\s*["']think-block["']/;
|
|
8219
|
-
// 去掉think
|
|
8220
|
-
var replaceThinkAndYaml = function() {
|
|
8221
|
-
var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
8222
|
-
return text.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "").replace(/<thinking>([\s\S]*?)<\/thinking>/g, "").replace(RegExp('<div\\s+class="think-block">.*?<\\/div>', "gs"), "").replace(/^[ \n]+/g, "");
|
|
8223
|
-
};
|
|
8224
8224
|
r.initialize({
|
|
8225
8225
|
startOnLoad: false,
|
|
8226
8226
|
theme: "default",
|
|
@@ -9668,6 +9668,7 @@ var CustomerService = function(props) {
|
|
|
9668
9668
|
//识别的内容
|
|
9669
9669
|
// console.log("eventSource msg: ", event.data);
|
|
9670
9670
|
var msg = JSON.parse(event.data);
|
|
9671
|
+
console.log("tempMessageId", tempMessageId);
|
|
9671
9672
|
msg.tempMessageId = tempMessageId;
|
|
9672
9673
|
if (msg.message) {
|
|
9673
9674
|
// if (!hasYamlStarted && msg.message && /```\s*yaml/.test(content)) {
|
|
@@ -10016,7 +10017,11 @@ var CustomerService = function(props) {
|
|
|
10016
10017
|
}).then(function(res) {
|
|
10017
10018
|
var newHistoryMessageList = [];
|
|
10018
10019
|
if (res.data.messages.length > 0) {
|
|
10019
|
-
var dataList = res.data.messages.reverse()
|
|
10020
|
+
var dataList = res.data.messages.reverse().map(function(x) {
|
|
10021
|
+
return _object_spread_props(_object_spread({}, x), {
|
|
10022
|
+
messageId: x.id
|
|
10023
|
+
});
|
|
10024
|
+
});
|
|
10020
10025
|
var originList = 0;
|
|
10021
10026
|
var newList = 0;
|
|
10022
10027
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -11423,7 +11428,7 @@ var CustomerService = function(props) {
|
|
|
11423
11428
|
/*#__PURE__*/ jsx("i", {
|
|
11424
11429
|
className: "Frame427319094 ".concat(item.upvoted ? styles.active : ""),
|
|
11425
11430
|
onClick: function() {
|
|
11426
|
-
likeMessage(item.
|
|
11431
|
+
likeMessage(item.messageId, item.upvoted, item.id);
|
|
11427
11432
|
//老师的聊天窗口中不需要点赞和踩消息
|
|
11428
11433
|
if (!isAiChatWindow) return;
|
|
11429
11434
|
//只有最后一条回答,支持发送点赞或踩
|
|
@@ -11446,7 +11451,7 @@ var CustomerService = function(props) {
|
|
|
11446
11451
|
/*#__PURE__*/ jsx("i", {
|
|
11447
11452
|
className: "Frame427319095 ".concat(item.downvoted ? styles.active : ""),
|
|
11448
11453
|
onClick: function() {
|
|
11449
|
-
disagreeMessage(item.
|
|
11454
|
+
disagreeMessage(item.messageId, item.downvoted, item.id);
|
|
11450
11455
|
//老师的聊天窗口中不需要点赞和踩消息
|
|
11451
11456
|
if (!isAiChatWindow) return;
|
|
11452
11457
|
//只有最后一条回答,支持发送点赞或踩
|