bhd-components 0.10.37 → 0.10.39
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.css +1644 -1495
- package/dist/index.esm.es5.development.js +126 -48
- package/dist/index.esm.es5.production.css +1 -1
- 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/AIMessageList/components/footer/index.js +2 -2
- package/es2017/AIMessageList/components/virtuosoList/index.js +11 -2
- package/es2017/customerService/common.module.less +3 -0
- package/es2017/customerService/index.js +103 -32
- package/es2017/customerService/index.module.less +57 -1
- package/es2017/customerService/index2.module.less +58 -1
- package/esm/AIMessageList/components/footer/index.js +2 -2
- package/esm/AIMessageList/components/virtuosoList/index.js +11 -2
- package/esm/customerService/common.module.less +3 -0
- package/esm/customerService/index.js +104 -32
- package/esm/customerService/index.module.less +57 -1
- package/esm/customerService/index2.module.less +58 -1
- package/package.json +1 -1
|
@@ -39,6 +39,7 @@ import { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, re
|
|
|
39
39
|
// import html2canvas from "html2canvas";
|
|
40
40
|
// const screenShot = require('./screenShotPlugin.esm')
|
|
41
41
|
import ScreenShot from "./js-screen-shot/main";
|
|
42
|
+
import { guidGenerator } from "../utils/number";
|
|
42
43
|
/*
|
|
43
44
|
自定义remarkable的text解析规则
|
|
44
45
|
*/ var HTML_ESCAPE_TEST_RE = /[&<>"]/;
|
|
@@ -58,6 +59,13 @@ function escapeHtml(str) {
|
|
|
58
59
|
}
|
|
59
60
|
return str;
|
|
60
61
|
}
|
|
62
|
+
var pattern = /!\[.*?\]\((.*?)\)/;
|
|
63
|
+
var exactRegex = /class\s*=\s*["']think-block["']/;
|
|
64
|
+
// 去掉think
|
|
65
|
+
var replaceThinkAndYaml = function() {
|
|
66
|
+
var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
67
|
+
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, "");
|
|
68
|
+
};
|
|
61
69
|
mermaid.initialize({
|
|
62
70
|
startOnLoad: false,
|
|
63
71
|
theme: "default",
|
|
@@ -140,6 +148,7 @@ var CustomerService = function(props) {
|
|
|
140
148
|
var getLisyFlagRef = useRef(0);
|
|
141
149
|
var _useState36 = _sliced_to_array(useState(false), 2), showMemaid = _useState36[0], setShowMemaid = _useState36[1]; //是否显示mermaid弹窗
|
|
142
150
|
var _useState37 = _sliced_to_array(useState(""), 2), memaidContent = _useState37[0], setMemaidContent = _useState37[1]; //mermaid内容
|
|
151
|
+
var shouqiTimer = useRef(null);
|
|
143
152
|
var remarkable = new Remarkable({
|
|
144
153
|
html: true,
|
|
145
154
|
highlight: function highlight(str, lang) {
|
|
@@ -226,6 +235,7 @@ var CustomerService = function(props) {
|
|
|
226
235
|
// //获取热门推荐
|
|
227
236
|
// videoPageQuestiionsList(1);
|
|
228
237
|
// }
|
|
238
|
+
console.log("initShowType", initShowType);
|
|
229
239
|
setShowType(initShowType);
|
|
230
240
|
}, [
|
|
231
241
|
initShowType
|
|
@@ -1395,6 +1405,8 @@ var CustomerService = function(props) {
|
|
|
1395
1405
|
//先请求问题列表
|
|
1396
1406
|
videoPageQuestiionsList(3);
|
|
1397
1407
|
}
|
|
1408
|
+
var hasYamlStarted = false;
|
|
1409
|
+
var tempMessageId = guidGenerator();
|
|
1398
1410
|
//使用fetchEventSource接收数据
|
|
1399
1411
|
var eventSource = fetchEventSource("".concat(urllocation, "/chat-service/public/v1.0/chat-with-ai/messages"), {
|
|
1400
1412
|
method: "POST",
|
|
@@ -1504,7 +1516,13 @@ var CustomerService = function(props) {
|
|
|
1504
1516
|
//识别的内容
|
|
1505
1517
|
// console.log("eventSource msg: ", event.data);
|
|
1506
1518
|
var msg = JSON.parse(event.data);
|
|
1507
|
-
|
|
1519
|
+
msg.tempMessageId = tempMessageId;
|
|
1520
|
+
if (msg.message) {
|
|
1521
|
+
// if (!hasYamlStarted && msg.message && /```\s*yaml/.test(content)) {
|
|
1522
|
+
// hasYamlStarted = true;
|
|
1523
|
+
// }
|
|
1524
|
+
msg.message = msg.message.replace(/<thinking>/g, '<div class="think-block">').replace(/<\/thinking>/g, "</div>\n");
|
|
1525
|
+
}
|
|
1508
1526
|
finishedRef.current = false;
|
|
1509
1527
|
setFinished(false);
|
|
1510
1528
|
msgStreamingCountRef.current = msgStreamingCountRef.current + 1;
|
|
@@ -1521,6 +1539,20 @@ var CustomerService = function(props) {
|
|
|
1521
1539
|
videoPageQuestiionsList(2);
|
|
1522
1540
|
}
|
|
1523
1541
|
testLabQuestion(JSON.parse(data).message, content, "");
|
|
1542
|
+
if (shouqiTimer.current) {
|
|
1543
|
+
clearTimeout(shouqiTimer.current);
|
|
1544
|
+
}
|
|
1545
|
+
shouqiTimer.current = setTimeout(function() {
|
|
1546
|
+
if ($(".think-block").last().css("display") === "block") {
|
|
1547
|
+
clearTimeout(shouqiTimer.current);
|
|
1548
|
+
$(".think-block").last().parent().find(".think-block").css({
|
|
1549
|
+
display: "none"
|
|
1550
|
+
});
|
|
1551
|
+
$(".think-block").last().parent().parent().find("i").css({
|
|
1552
|
+
transform: "rotate(180deg)"
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
}, 1000);
|
|
1524
1556
|
} else {}
|
|
1525
1557
|
},
|
|
1526
1558
|
onclose: function onclose() {
|
|
@@ -1540,7 +1572,7 @@ var CustomerService = function(props) {
|
|
|
1540
1572
|
// console.log(aiSendQuestions().abort(),'slkdsdsdsd')
|
|
1541
1573
|
if (pageNumHistory > 1) return;
|
|
1542
1574
|
var obj = msg;
|
|
1543
|
-
var id = msg.
|
|
1575
|
+
var id = msg.tempMessageId;
|
|
1544
1576
|
setHistoryMessageList(function(prevHistoryMessageList) {
|
|
1545
1577
|
var list1 = prevHistoryMessageList;
|
|
1546
1578
|
//删除临时数据
|
|
@@ -1565,6 +1597,7 @@ var CustomerService = function(props) {
|
|
|
1565
1597
|
recevier: mid,
|
|
1566
1598
|
message: message,
|
|
1567
1599
|
id: id,
|
|
1600
|
+
messageId: msg.messageId,
|
|
1568
1601
|
upvoted: false,
|
|
1569
1602
|
downvoted: false,
|
|
1570
1603
|
createdAt: getDataTime(-1),
|
|
@@ -1595,6 +1628,7 @@ var CustomerService = function(props) {
|
|
|
1595
1628
|
if (item.id == id) {
|
|
1596
1629
|
return _object_spread_props(_object_spread({}, item), {
|
|
1597
1630
|
message: message,
|
|
1631
|
+
messageId: msg.messageId,
|
|
1598
1632
|
extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
|
|
1599
1633
|
});
|
|
1600
1634
|
} else {
|
|
@@ -1714,6 +1748,14 @@ var CustomerService = function(props) {
|
|
|
1714
1748
|
// getHistoryMessage(page-1,5,'1',dataList);
|
|
1715
1749
|
// return;
|
|
1716
1750
|
// }
|
|
1751
|
+
dataList = dataList.map(function(ele, index) {
|
|
1752
|
+
if (ele.message.includes("<thinking>") && !ele.message.includes("</thinking>")) {
|
|
1753
|
+
ele.message = ele.message + "</thinking>";
|
|
1754
|
+
}
|
|
1755
|
+
return _object_spread_props(_object_spread({}, ele), {
|
|
1756
|
+
messageId: ele.id
|
|
1757
|
+
});
|
|
1758
|
+
});
|
|
1717
1759
|
setPageCount(Math.ceil(total / maxPageSize));
|
|
1718
1760
|
setFirstItemIndex(total - maxPageSize * (page - 1));
|
|
1719
1761
|
var newHistoryMessageList = [];
|
|
@@ -1905,7 +1947,7 @@ var CustomerService = function(props) {
|
|
|
1905
1947
|
} catch (error) {}
|
|
1906
1948
|
};
|
|
1907
1949
|
//点赞消息
|
|
1908
|
-
var likeMessage = function(
|
|
1950
|
+
var likeMessage = function(messageId, state, id) {
|
|
1909
1951
|
var url = "";
|
|
1910
1952
|
//点赞状态
|
|
1911
1953
|
if (!state) {
|
|
@@ -1914,7 +1956,7 @@ var CustomerService = function(props) {
|
|
|
1914
1956
|
url = "".concat(urllocation, "/chat-service/public/v1.0/history-messages:cancelUpvote");
|
|
1915
1957
|
}
|
|
1916
1958
|
http.post(url, {
|
|
1917
|
-
messageId:
|
|
1959
|
+
messageId: messageId
|
|
1918
1960
|
}).then(function(res) {
|
|
1919
1961
|
setHistoryMessageList(function(historyMessageList) {
|
|
1920
1962
|
var list = historyMessageList;
|
|
@@ -1929,7 +1971,7 @@ var CustomerService = function(props) {
|
|
|
1929
1971
|
});
|
|
1930
1972
|
};
|
|
1931
1973
|
//踩
|
|
1932
|
-
var disagreeMessage = function(
|
|
1974
|
+
var disagreeMessage = function(messageId, state, id) {
|
|
1933
1975
|
var url = "";
|
|
1934
1976
|
//点赞状态
|
|
1935
1977
|
if (!state) {
|
|
@@ -1938,7 +1980,7 @@ var CustomerService = function(props) {
|
|
|
1938
1980
|
url = "".concat(urllocation, "/chat-service/public/v1.0/history-messages:cancelDownvote");
|
|
1939
1981
|
}
|
|
1940
1982
|
http.post(url, {
|
|
1941
|
-
messageId:
|
|
1983
|
+
messageId: messageId
|
|
1942
1984
|
}).then(function(res) {
|
|
1943
1985
|
setHistoryMessageList(function(historyMessageList) {
|
|
1944
1986
|
var list = historyMessageList;
|
|
@@ -2546,6 +2588,9 @@ var CustomerService = function(props) {
|
|
|
2546
2588
|
message = removeMermaidBlockComments(message);
|
|
2547
2589
|
}
|
|
2548
2590
|
message = handleRenderSyntaxBlock(message, finishedRef.current || i != historyMessageList.length - 1);
|
|
2591
|
+
message = message.replace(/<thinking>([\s\S]*?)<\/thinking>/g, '<div class="think-block">$1</div>\n');
|
|
2592
|
+
message = message.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "");
|
|
2593
|
+
message = message.replace(/```\s*yaml[\s\S]*/, "");
|
|
2549
2594
|
if (lastId == item.id && keyWordProblem != "") {
|
|
2550
2595
|
//点击历史记录时,找到关键字,防止关键字和标签名重复
|
|
2551
2596
|
// let key_sign = 'sign_'+new Date().getTime();+'sign';
|
|
@@ -2594,8 +2639,9 @@ var CustomerService = function(props) {
|
|
|
2594
2639
|
/*#__PURE__*/ _jsx("i", {
|
|
2595
2640
|
className: "yinyong_quote1",
|
|
2596
2641
|
onClick: function() {
|
|
2642
|
+
// 问题的引用
|
|
2597
2643
|
setCitationContent({
|
|
2598
|
-
content: item.message,
|
|
2644
|
+
content: replaceThinkAndYaml(item.message),
|
|
2599
2645
|
id: item.id,
|
|
2600
2646
|
imageUrl: !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" ? JSON.parse(item.extraInfo)[0].value : ""
|
|
2601
2647
|
});
|
|
@@ -2612,7 +2658,7 @@ var CustomerService = function(props) {
|
|
|
2612
2658
|
}) : /*#__PURE__*/ _jsx("i", {
|
|
2613
2659
|
className: "fuzhi21",
|
|
2614
2660
|
onClick: function() {
|
|
2615
|
-
var bol = copyText(item.message);
|
|
2661
|
+
var bol = copyText(replaceThinkAndYaml(item.message));
|
|
2616
2662
|
if (bol) {
|
|
2617
2663
|
var obj = copyTextOBJ;
|
|
2618
2664
|
obj = obj.filter(function(list) {
|
|
@@ -2675,14 +2721,14 @@ var CustomerService = function(props) {
|
|
|
2675
2721
|
item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
|
|
2676
2722
|
className: styles.citation_content,
|
|
2677
2723
|
children: [
|
|
2678
|
-
getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
2724
|
+
getByteLen(replaceThinkAndYaml(item.quotedMessage)) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
2679
2725
|
overlayClassName: styles.popover_main_content,
|
|
2680
|
-
title: item.quotedMessage,
|
|
2726
|
+
title: replaceThinkAndYaml(item.quotedMessage),
|
|
2681
2727
|
placement: "leftTop",
|
|
2682
2728
|
children: /*#__PURE__*/ _jsxs("p", {
|
|
2683
2729
|
className: styles.text_exceed,
|
|
2684
2730
|
children: [
|
|
2685
|
-
item.quotedMessage,
|
|
2731
|
+
replaceThinkAndYaml(item.quotedMessage),
|
|
2686
2732
|
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
2687
2733
|
]
|
|
2688
2734
|
})
|
|
@@ -2840,6 +2886,35 @@ var CustomerService = function(props) {
|
|
|
2840
2886
|
/*#__PURE__*/ _jsxs("div", {
|
|
2841
2887
|
className: styles.content,
|
|
2842
2888
|
children: [
|
|
2889
|
+
!exactRegex.test(message) ? null : /*#__PURE__*/ _jsxs("div", {
|
|
2890
|
+
id: "click_" + i,
|
|
2891
|
+
onClick: function() {
|
|
2892
|
+
if ($("#click_".concat(i, " + p .think-block")).css("display") === "inline-block" || $("#click_".concat(i, " + p .think-block")).css("display") === "block") {
|
|
2893
|
+
$("#click_".concat(i, " + p .think-block")).css({
|
|
2894
|
+
display: "none"
|
|
2895
|
+
});
|
|
2896
|
+
$("#click_".concat(i, " i")).css({
|
|
2897
|
+
transform: "rotate(180deg)"
|
|
2898
|
+
});
|
|
2899
|
+
} else {
|
|
2900
|
+
$("#click_".concat(i, " + p .think-block")).css({
|
|
2901
|
+
display: "block"
|
|
2902
|
+
});
|
|
2903
|
+
$("#click_".concat(i, " i")).css({
|
|
2904
|
+
transform: "rotate(0deg)"
|
|
2905
|
+
});
|
|
2906
|
+
}
|
|
2907
|
+
},
|
|
2908
|
+
className: styles.content_put,
|
|
2909
|
+
children: [
|
|
2910
|
+
/*#__PURE__*/ _jsx("span", {
|
|
2911
|
+
children: "思考过程"
|
|
2912
|
+
}),
|
|
2913
|
+
/*#__PURE__*/ _jsx("i", {
|
|
2914
|
+
className: "iconfont iconfangxiang-xiaxiao"
|
|
2915
|
+
})
|
|
2916
|
+
]
|
|
2917
|
+
}),
|
|
2843
2918
|
item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsx("p", {
|
|
2844
2919
|
dangerouslySetInnerHTML: {
|
|
2845
2920
|
__html: message
|
|
@@ -2924,14 +2999,14 @@ var CustomerService = function(props) {
|
|
|
2924
2999
|
item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
|
|
2925
3000
|
className: styles.citation_content,
|
|
2926
3001
|
children: [
|
|
2927
|
-
getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
3002
|
+
getByteLen(replaceThinkAndYaml(item.quotedMessage)) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
2928
3003
|
overlayClassName: styles.popover_main_content,
|
|
2929
|
-
title: item.quotedMessage,
|
|
3004
|
+
title: replaceThinkAndYaml(item.quotedMessage),
|
|
2930
3005
|
placement: "rightTop",
|
|
2931
3006
|
children: /*#__PURE__*/ _jsxs("p", {
|
|
2932
3007
|
className: styles.text_exceed,
|
|
2933
3008
|
children: [
|
|
2934
|
-
item.quotedMessage,
|
|
3009
|
+
replaceThinkAndYaml(item.quotedMessage),
|
|
2935
3010
|
/*#__PURE__*/ _jsx(RightOutlined, {})
|
|
2936
3011
|
]
|
|
2937
3012
|
})
|
|
@@ -3000,11 +3075,7 @@ var CustomerService = function(props) {
|
|
|
3000
3075
|
style: {
|
|
3001
3076
|
height: "100%"
|
|
3002
3077
|
},
|
|
3003
|
-
initialTopMostItemIndex
|
|
3004
|
-
index: "LAST",
|
|
3005
|
-
align: "end",
|
|
3006
|
-
offset: showType === 3 ? 58 : showType === 4 ? 144 : 58
|
|
3007
|
-
},
|
|
3078
|
+
// initialTopMostItemIndex={!finished&&isPositionState?undefined:{ index: "LAST", align: "end",offset:showType===3?58:showType===4?144:58 }}
|
|
3008
3079
|
initialItemCount: 10,
|
|
3009
3080
|
itemsRendered: function() {
|
|
3010
3081
|
renderMermaid();
|
|
@@ -3159,8 +3230,9 @@ var CustomerService = function(props) {
|
|
|
3159
3230
|
/*#__PURE__*/ _jsx("i", {
|
|
3160
3231
|
className: "yinyong_quote1",
|
|
3161
3232
|
onClick: function() {
|
|
3233
|
+
// 答案的引用
|
|
3162
3234
|
setCitationContent({
|
|
3163
|
-
content: item.message,
|
|
3235
|
+
content: replaceThinkAndYaml(item.message),
|
|
3164
3236
|
imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
|
|
3165
3237
|
id: item.id
|
|
3166
3238
|
});
|
|
@@ -3177,7 +3249,7 @@ var CustomerService = function(props) {
|
|
|
3177
3249
|
}) : /*#__PURE__*/ _jsx("i", {
|
|
3178
3250
|
className: "fuzhi21",
|
|
3179
3251
|
onClick: function() {
|
|
3180
|
-
var bol = copyText(item.message);
|
|
3252
|
+
var bol = copyText(replaceThinkAndYaml(item.message));
|
|
3181
3253
|
if (bol) {
|
|
3182
3254
|
var obj = copyTextOBJ;
|
|
3183
3255
|
obj = obj.filter(function(list) {
|
|
@@ -3203,7 +3275,7 @@ var CustomerService = function(props) {
|
|
|
3203
3275
|
/*#__PURE__*/ _jsx("i", {
|
|
3204
3276
|
className: "Frame427319094 ".concat(item.upvoted ? styles.active : ""),
|
|
3205
3277
|
onClick: function() {
|
|
3206
|
-
likeMessage(item.id, item.upvoted);
|
|
3278
|
+
likeMessage(item.id, item.upvoted, item.id);
|
|
3207
3279
|
//老师的聊天窗口中不需要点赞和踩消息
|
|
3208
3280
|
if (!isAiChatWindow) return;
|
|
3209
3281
|
//只有最后一条回答,支持发送点赞或踩
|
|
@@ -3211,7 +3283,7 @@ var CustomerService = function(props) {
|
|
|
3211
3283
|
if (!item.extraInfo && item.sender == "AI") {
|
|
3212
3284
|
aiSendQuestions(1, {
|
|
3213
3285
|
roomId: roomId,
|
|
3214
|
-
message: "
|
|
3286
|
+
message: "\x03\x03\x03你给出的答案我非常满意,赞!\x03\x03\x03",
|
|
3215
3287
|
quotedMessage: "",
|
|
3216
3288
|
regenerate: false,
|
|
3217
3289
|
generateUpvoteOrDownvoteMessage: true
|
|
@@ -3226,7 +3298,7 @@ var CustomerService = function(props) {
|
|
|
3226
3298
|
/*#__PURE__*/ _jsx("i", {
|
|
3227
3299
|
className: "Frame427319095 ".concat(item.downvoted ? styles.active : ""),
|
|
3228
3300
|
onClick: function() {
|
|
3229
|
-
disagreeMessage(item.id, item.downvoted);
|
|
3301
|
+
disagreeMessage(item.id, item.downvoted, item.id);
|
|
3230
3302
|
//老师的聊天窗口中不需要点赞和踩消息
|
|
3231
3303
|
if (!isAiChatWindow) return;
|
|
3232
3304
|
//只有最后一条回答,支持发送点赞或踩
|
|
@@ -3234,7 +3306,7 @@ var CustomerService = function(props) {
|
|
|
3234
3306
|
if (!item.extraInfo && item.sender == "AI") {
|
|
3235
3307
|
aiSendQuestions(1, {
|
|
3236
3308
|
roomId: roomId,
|
|
3237
|
-
message: "
|
|
3309
|
+
message: "\x03\x03\x03你给出的答案很糟糕,我不满意,踩!\x03\x03\x03",
|
|
3238
3310
|
quotedMessage: "",
|
|
3239
3311
|
regenerate: false,
|
|
3240
3312
|
generateUpvoteOrDownvoteMessage: true
|
|
@@ -3368,9 +3440,9 @@ var CustomerService = function(props) {
|
|
|
3368
3440
|
className: "yinyong_quote1",
|
|
3369
3441
|
onClick: function() {
|
|
3370
3442
|
setCitationContent({
|
|
3371
|
-
content: item.message,
|
|
3443
|
+
content: replaceThinkAndYaml(item.message),
|
|
3372
3444
|
imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
|
|
3373
|
-
id: item.
|
|
3445
|
+
id: item.messageId
|
|
3374
3446
|
});
|
|
3375
3447
|
resettingBottomHei();
|
|
3376
3448
|
onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
|
|
@@ -3385,7 +3457,7 @@ var CustomerService = function(props) {
|
|
|
3385
3457
|
}) : /*#__PURE__*/ _jsx("i", {
|
|
3386
3458
|
className: "fuzhi21",
|
|
3387
3459
|
onClick: function() {
|
|
3388
|
-
var bol = copyText(item.message);
|
|
3460
|
+
var bol = copyText(replaceThinkAndYaml(item.message));
|
|
3389
3461
|
if (bol) {
|
|
3390
3462
|
var obj = copyTextOBJ;
|
|
3391
3463
|
obj = obj.filter(function(list) {
|
|
@@ -3411,7 +3483,7 @@ var CustomerService = function(props) {
|
|
|
3411
3483
|
/*#__PURE__*/ _jsx("i", {
|
|
3412
3484
|
className: "Frame427319094 ".concat(item.upvoted ? styles.active : ""),
|
|
3413
3485
|
onClick: function() {
|
|
3414
|
-
likeMessage(item.
|
|
3486
|
+
likeMessage(item.messageId, item.upvoted, item.id);
|
|
3415
3487
|
//老师的聊天窗口中不需要点赞和踩消息
|
|
3416
3488
|
if (!isAiChatWindow) return;
|
|
3417
3489
|
//只有最后一条回答,支持发送点赞或踩
|
|
@@ -3420,7 +3492,7 @@ var CustomerService = function(props) {
|
|
|
3420
3492
|
if (!item.extraInfo && item.sender == "AI") {
|
|
3421
3493
|
aiSendQuestions(1, {
|
|
3422
3494
|
roomId: roomId,
|
|
3423
|
-
message: "
|
|
3495
|
+
message: "\x03\x03\x03你给出的答案我非常满意,赞!\x03\x03\x03",
|
|
3424
3496
|
quotedMessage: "",
|
|
3425
3497
|
regenerate: false,
|
|
3426
3498
|
generateUpvoteOrDownvoteMessage: true
|
|
@@ -3436,7 +3508,7 @@ var CustomerService = function(props) {
|
|
|
3436
3508
|
/*#__PURE__*/ _jsx("i", {
|
|
3437
3509
|
className: "Frame427319095 ".concat(item.downvoted ? styles.active : ""),
|
|
3438
3510
|
onClick: function() {
|
|
3439
|
-
disagreeMessage(item.
|
|
3511
|
+
disagreeMessage(item.messageId, item.downvoted, item.id);
|
|
3440
3512
|
//老师的聊天窗口中不需要点赞和踩消息
|
|
3441
3513
|
if (!isAiChatWindow) return;
|
|
3442
3514
|
//只有最后一条回答,支持发送点赞或踩
|
|
@@ -3447,7 +3519,7 @@ var CustomerService = function(props) {
|
|
|
3447
3519
|
//AI回答
|
|
3448
3520
|
aiSendQuestions(1, {
|
|
3449
3521
|
roomId: roomId,
|
|
3450
|
-
message: "
|
|
3522
|
+
message: "\x03\x03\x03你给出的答案很糟糕,我不满意,踩!\x03\x03\x03",
|
|
3451
3523
|
quotedMessage: "",
|
|
3452
3524
|
regenerate: false,
|
|
3453
3525
|
generateUpvoteOrDownvoteMessage: true
|
|
@@ -369,6 +369,42 @@
|
|
|
369
369
|
.content_child {
|
|
370
370
|
padding: 0;
|
|
371
371
|
line-height: 1;
|
|
372
|
+
img {
|
|
373
|
+
width: 100%;
|
|
374
|
+
}
|
|
375
|
+
:global {
|
|
376
|
+
.think-block {
|
|
377
|
+
padding: 12px;
|
|
378
|
+
border-left: 1px solid rgba(0, 0, 0, 0.15);
|
|
379
|
+
background: rgba(0, 0, 0, 0.04);
|
|
380
|
+
// display: inline-block;
|
|
381
|
+
margin-bottom: 8px;
|
|
382
|
+
width: 100%;
|
|
383
|
+
font-weight: 400;
|
|
384
|
+
font-size: 12px;
|
|
385
|
+
line-height: 1.5;
|
|
386
|
+
color: rgba(0, 0, 0, 0.45);
|
|
387
|
+
* {
|
|
388
|
+
color: rgba(0, 0, 0, 0.45);
|
|
389
|
+
font-weight: 400;
|
|
390
|
+
font-size: 12px;
|
|
391
|
+
line-height: 150%;
|
|
392
|
+
}
|
|
393
|
+
&:not(:first-of-type, :last-of-type){
|
|
394
|
+
padding-top:0;
|
|
395
|
+
padding-bottom: 0;
|
|
396
|
+
}
|
|
397
|
+
&:first-of-type{
|
|
398
|
+
padding-top: 12px !important;
|
|
399
|
+
}
|
|
400
|
+
&:last-of-type{
|
|
401
|
+
padding-bottom: 12px !important;
|
|
402
|
+
}
|
|
403
|
+
&+.think-block{
|
|
404
|
+
margin-top: -8px;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
372
408
|
|
|
373
409
|
p{
|
|
374
410
|
word-break: break-all;
|
|
@@ -441,7 +477,7 @@
|
|
|
441
477
|
// > ul + *, > ol + * {
|
|
442
478
|
// margin-top:16px;
|
|
443
479
|
// }
|
|
444
|
-
> *:not(pre){
|
|
480
|
+
> *:not(pre):not(:global(.think-block)){
|
|
445
481
|
word-break: break-all;
|
|
446
482
|
padding-top: 8px;
|
|
447
483
|
padding-bottom: 8px;
|
|
@@ -2279,4 +2315,24 @@ strong {
|
|
|
2279
2315
|
padding: 10px;
|
|
2280
2316
|
}
|
|
2281
2317
|
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
.content_put {
|
|
2321
|
+
display: flex;
|
|
2322
|
+
padding: 4px 16px;
|
|
2323
|
+
margin-bottom: 8px;
|
|
2324
|
+
border-radius: 100px;
|
|
2325
|
+
background: rgba(0, 0, 0, 0.04);
|
|
2326
|
+
width: max-content;
|
|
2327
|
+
align-items: center;
|
|
2328
|
+
cursor: pointer;
|
|
2329
|
+
span {
|
|
2330
|
+
color: rgba(0, 0, 0, 0.65);
|
|
2331
|
+
font-size: 12px;
|
|
2332
|
+
font-weight: 400;
|
|
2333
|
+
line-height: 150%;
|
|
2334
|
+
}
|
|
2335
|
+
i {
|
|
2336
|
+
margin-left: 8px;
|
|
2337
|
+
}
|
|
2282
2338
|
}
|
|
@@ -365,6 +365,43 @@
|
|
|
365
365
|
.content_child {
|
|
366
366
|
padding: 0;
|
|
367
367
|
line-height: 1;
|
|
368
|
+
img {
|
|
369
|
+
width: 100%;
|
|
370
|
+
}
|
|
371
|
+
:global {
|
|
372
|
+
.think-block {
|
|
373
|
+
padding: 12px;
|
|
374
|
+
padding-top: 12px !important;
|
|
375
|
+
border-left: 1px solid rgba(0, 0, 0, 0.15);
|
|
376
|
+
background: rgba(0, 0, 0, 0.04);
|
|
377
|
+
// display: inline-block;
|
|
378
|
+
margin-bottom: 8px;
|
|
379
|
+
width: 100%;
|
|
380
|
+
font-weight: 400;
|
|
381
|
+
font-size: 12px;
|
|
382
|
+
line-height: 1.5;
|
|
383
|
+
color: rgba(0, 0, 0, 0.45);
|
|
384
|
+
* {
|
|
385
|
+
color: rgba(0, 0, 0, 0.45);
|
|
386
|
+
font-weight: 400;
|
|
387
|
+
font-size: 12px;
|
|
388
|
+
line-height: 150%;
|
|
389
|
+
}
|
|
390
|
+
&:not(:first-of-type, :last-of-type){
|
|
391
|
+
padding-top:0;
|
|
392
|
+
padding-bottom: 0;
|
|
393
|
+
}
|
|
394
|
+
&:first-of-type{
|
|
395
|
+
padding-top: 12px !important;
|
|
396
|
+
}
|
|
397
|
+
&:last-of-type{
|
|
398
|
+
padding-bottom: 12px !important;
|
|
399
|
+
}
|
|
400
|
+
&+.think-block{
|
|
401
|
+
margin-top: -8px;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
368
405
|
p{
|
|
369
406
|
word-break: break-all;
|
|
370
407
|
white-space: break-spaces;
|
|
@@ -436,7 +473,7 @@
|
|
|
436
473
|
// > ul + *, > ol + * {
|
|
437
474
|
// margin-top:16px;
|
|
438
475
|
// }
|
|
439
|
-
> *:not(pre){
|
|
476
|
+
> *:not(pre):not(:global(.think-block)){
|
|
440
477
|
word-break: break-all;
|
|
441
478
|
padding-top: 8px;
|
|
442
479
|
padding-bottom: 8px;
|
|
@@ -2217,3 +2254,23 @@
|
|
|
2217
2254
|
strong {
|
|
2218
2255
|
font-weight: bold !important;
|
|
2219
2256
|
}
|
|
2257
|
+
|
|
2258
|
+
.content_put {
|
|
2259
|
+
display: flex;
|
|
2260
|
+
padding: 4px 16px;
|
|
2261
|
+
margin-bottom: 8px;
|
|
2262
|
+
border-radius: 100px;
|
|
2263
|
+
background: rgba(0, 0, 0, 0.04);
|
|
2264
|
+
width: max-content;
|
|
2265
|
+
align-items: center;
|
|
2266
|
+
cursor: pointer;
|
|
2267
|
+
span {
|
|
2268
|
+
color: rgba(0, 0, 0, 0.65);
|
|
2269
|
+
font-size: 12px;
|
|
2270
|
+
font-weight: 400;
|
|
2271
|
+
line-height: 150%;
|
|
2272
|
+
}
|
|
2273
|
+
i {
|
|
2274
|
+
margin-left: 8px;
|
|
2275
|
+
}
|
|
2276
|
+
}
|