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.
@@ -242,7 +242,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
242
242
  apiRef.contentApi.addMsg({
243
243
  id: msgId,
244
244
  createTime: createTime,
245
- content: "正在输入...",
245
+ content: "正在思考...",
246
246
  location: "left",
247
247
  reference: recordObj.reference || null,
248
248
  source: null,
@@ -252,7 +252,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
252
252
  apiRef.contentApi.addMsg({
253
253
  id: msgId,
254
254
  createTime: createTime,
255
- content: "正在输入...",
255
+ content: "正在思考...",
256
256
  location: "left",
257
257
  reference: null,
258
258
  source: null,
@@ -608,8 +608,17 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
608
608
  } else {
609
609
  // 没有跨天 判断是否相隔超过10分钟
610
610
  if (timeObj.timestamp - beforeTimeObj.timestamp > 10 * 60 * 1000) {
611
- // 超过10分钟 显示 时分
612
- time = `${timeObj.hours}:${timeObj.minutes}`;
611
+ // 超过10分钟 显示
612
+ let now = new Date();
613
+ // 当天的日期
614
+ let nowTimeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
615
+ if (nowTimeStr === `${timeObj.year}-${timeObj.month}-${timeObj.day}`) {
616
+ // 是当天 显示 时分
617
+ time = `${timeObj.hours}:${timeObj.minutes}`;
618
+ } else {
619
+ // 不是当天 显示 年月日 时分
620
+ time = `${timeObj.year}-${timeObj.month}-${timeObj.day} ${timeObj.hours}:${timeObj.minutes}`;
621
+ }
613
622
  }
614
623
  }
615
624
  }
@@ -463,6 +463,9 @@
463
463
  padding: 8px;
464
464
  border-radius: 2px;
465
465
  background: #e7e7e7;
466
+ img {
467
+ width: 100%;
468
+ }
466
469
  p {
467
470
  color: @color-text-Secondary-Tr;
468
471
  font-size: 12px;
@@ -35,6 +35,7 @@ import { readMessage, getByteLen, serverUrl, copyText, getDataTime, getQuery, re
35
35
  // import html2canvas from "html2canvas";
36
36
  // const screenShot = require('./screenShotPlugin.esm')
37
37
  import ScreenShot from "./js-screen-shot/main";
38
+ import { guidGenerator } from "../utils/number";
38
39
  /*
39
40
  自定义remarkable的text解析规则
40
41
  */ const HTML_ESCAPE_TEST_RE = /[&<>"]/;
@@ -54,6 +55,12 @@ function escapeHtml(str) {
54
55
  }
55
56
  return str;
56
57
  }
58
+ const pattern = /!\[.*?\]\((.*?)\)/;
59
+ const exactRegex = /class\s*=\s*["']think-block["']/;
60
+ // 去掉think
61
+ const replaceThinkAndYaml = (text = "")=>{
62
+ 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, '');
63
+ };
57
64
  mermaid.initialize({
58
65
  startOnLoad: false,
59
66
  theme: 'default',
@@ -136,6 +143,7 @@ const CustomerService = (props)=>{
136
143
  const getLisyFlagRef = useRef(0);
137
144
  const [showMemaid, setShowMemaid] = useState(false); //是否显示mermaid弹窗
138
145
  const [memaidContent, setMemaidContent] = useState(""); //mermaid内容
146
+ const shouqiTimer = useRef(null);
139
147
  const remarkable = new Remarkable({
140
148
  html: true,
141
149
  highlight: function(str, lang) {
@@ -222,6 +230,7 @@ const CustomerService = (props)=>{
222
230
  // //获取热门推荐
223
231
  // videoPageQuestiionsList(1);
224
232
  // }
233
+ console.log('initShowType', initShowType);
225
234
  setShowType(initShowType);
226
235
  }, [
227
236
  initShowType
@@ -1261,6 +1270,8 @@ const CustomerService = (props)=>{
1261
1270
  //先请求问题列表
1262
1271
  videoPageQuestiionsList(3);
1263
1272
  }
1273
+ let hasYamlStarted = false;
1274
+ const tempMessageId = guidGenerator();
1264
1275
  //使用fetchEventSource接收数据
1265
1276
  const eventSource = fetchEventSource(`${urllocation}/chat-service/public/v1.0/chat-with-ai/messages`, {
1266
1277
  method: "POST",
@@ -1357,7 +1368,13 @@ const CustomerService = (props)=>{
1357
1368
  //识别的内容
1358
1369
  // console.log("eventSource msg: ", event.data);
1359
1370
  let msg = JSON.parse(event.data);
1360
- if (msg.message) {}
1371
+ msg.tempMessageId = tempMessageId;
1372
+ if (msg.message) {
1373
+ // if (!hasYamlStarted && msg.message && /```\s*yaml/.test(content)) {
1374
+ // hasYamlStarted = true;
1375
+ // }
1376
+ msg.message = msg.message.replace(/<thinking>/g, '<div class="think-block">').replace(/<\/thinking>/g, '</div>\n');
1377
+ }
1361
1378
  finishedRef.current = false;
1362
1379
  setFinished(false);
1363
1380
  msgStreamingCountRef.current = msgStreamingCountRef.current + 1;
@@ -1374,6 +1391,20 @@ const CustomerService = (props)=>{
1374
1391
  videoPageQuestiionsList(2);
1375
1392
  }
1376
1393
  testLabQuestion(JSON.parse(data).message, content, "");
1394
+ if (shouqiTimer.current) {
1395
+ clearTimeout(shouqiTimer.current);
1396
+ }
1397
+ shouqiTimer.current = setTimeout(()=>{
1398
+ if ($(".think-block").last().css("display") === 'block') {
1399
+ clearTimeout(shouqiTimer.current);
1400
+ $(".think-block").last().parent().find(".think-block").css({
1401
+ display: "none"
1402
+ });
1403
+ $(".think-block").last().parent().parent().find("i").css({
1404
+ transform: "rotate(180deg)"
1405
+ });
1406
+ }
1407
+ }, 1000);
1377
1408
  } else {}
1378
1409
  },
1379
1410
  onclose () {
@@ -1391,7 +1422,7 @@ const CustomerService = (props)=>{
1391
1422
  // console.log(aiSendQuestions().abort(),'slkdsdsdsd')
1392
1423
  if (pageNumHistory > 1) return;
1393
1424
  let obj = msg;
1394
- let id = msg.messageId;
1425
+ let id = msg.tempMessageId;
1395
1426
  setHistoryMessageList((prevHistoryMessageList)=>{
1396
1427
  let list1 = prevHistoryMessageList;
1397
1428
  //删除临时数据
@@ -1416,6 +1447,7 @@ const CustomerService = (props)=>{
1416
1447
  recevier: mid,
1417
1448
  message: message,
1418
1449
  id: id,
1450
+ messageId: msg.messageId,
1419
1451
  upvoted: false,
1420
1452
  downvoted: false,
1421
1453
  createdAt: getDataTime(-1),
@@ -1446,6 +1478,7 @@ const CustomerService = (props)=>{
1446
1478
  if (item.id == id) {
1447
1479
  return _object_spread_props(_object_spread({}, item), {
1448
1480
  message: message,
1481
+ messageId: msg.messageId,
1449
1482
  extraInfo: extraInfo == null ? item.extraInfo : JSON.stringify(extraInfo)
1450
1483
  });
1451
1484
  } else {
@@ -1562,6 +1595,14 @@ const CustomerService = (props)=>{
1562
1595
  // getHistoryMessage(page-1,5,'1',dataList);
1563
1596
  // return;
1564
1597
  // }
1598
+ dataList = dataList.map((ele, index)=>{
1599
+ if (ele.message.includes("<thinking>") && !ele.message.includes("</thinking>")) {
1600
+ ele.message = ele.message + "</thinking>";
1601
+ }
1602
+ return _object_spread_props(_object_spread({}, ele), {
1603
+ messageId: ele.id
1604
+ });
1605
+ });
1565
1606
  setPageCount(Math.ceil(total / maxPageSize));
1566
1607
  setFirstItemIndex(total - maxPageSize * (page - 1));
1567
1608
  let newHistoryMessageList = [];
@@ -1745,7 +1786,7 @@ const CustomerService = (props)=>{
1745
1786
  } catch (error) {}
1746
1787
  };
1747
1788
  //点赞消息
1748
- const likeMessage = (id, state)=>{
1789
+ const likeMessage = (messageId, state, id)=>{
1749
1790
  let url = "";
1750
1791
  //点赞状态
1751
1792
  if (!state) {
@@ -1754,7 +1795,7 @@ const CustomerService = (props)=>{
1754
1795
  url = `${urllocation}/chat-service/public/v1.0/history-messages:cancelUpvote`;
1755
1796
  }
1756
1797
  http.post(url, {
1757
- messageId: id
1798
+ messageId: messageId
1758
1799
  }).then((res)=>{
1759
1800
  setHistoryMessageList((historyMessageList)=>{
1760
1801
  let list = historyMessageList;
@@ -1769,7 +1810,7 @@ const CustomerService = (props)=>{
1769
1810
  });
1770
1811
  };
1771
1812
  //踩
1772
- const disagreeMessage = (id, state)=>{
1813
+ const disagreeMessage = (messageId, state, id)=>{
1773
1814
  let url = "";
1774
1815
  //点赞状态
1775
1816
  if (!state) {
@@ -1778,7 +1819,7 @@ const CustomerService = (props)=>{
1778
1819
  url = `${urllocation}/chat-service/public/v1.0/history-messages:cancelDownvote`;
1779
1820
  }
1780
1821
  http.post(url, {
1781
- messageId: id
1822
+ messageId: messageId
1782
1823
  }).then((res)=>{
1783
1824
  setHistoryMessageList((historyMessageList)=>{
1784
1825
  let list = historyMessageList;
@@ -2366,6 +2407,9 @@ const CustomerService = (props)=>{
2366
2407
  message = removeMermaidBlockComments(message);
2367
2408
  }
2368
2409
  message = handleRenderSyntaxBlock(message, finishedRef.current || i != historyMessageList.length - 1);
2410
+ message = message.replace(/<thinking>([\s\S]*?)<\/thinking>/g, '<div class="think-block">$1</div>\n');
2411
+ message = message.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "");
2412
+ message = message.replace(/```\s*yaml[\s\S]*/, '');
2369
2413
  if (lastId == item.id && keyWordProblem != "") {
2370
2414
  //点击历史记录时,找到关键字,防止关键字和标签名重复
2371
2415
  // let key_sign = 'sign_'+new Date().getTime();+'sign';
@@ -2447,8 +2491,9 @@ const CustomerService = (props)=>{
2447
2491
  /*#__PURE__*/ _jsx("i", {
2448
2492
  className: "yinyong_quote1",
2449
2493
  onClick: ()=>{
2494
+ // 问题的引用
2450
2495
  setCitationContent({
2451
- content: item.message,
2496
+ content: replaceThinkAndYaml(item.message),
2452
2497
  id: item.id,
2453
2498
  imageUrl: !item.quotedMessage && item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" ? JSON.parse(item.extraInfo)[0].value : ""
2454
2499
  });
@@ -2463,7 +2508,7 @@ const CustomerService = (props)=>{
2463
2508
  }) : /*#__PURE__*/ _jsx("i", {
2464
2509
  className: "fuzhi21",
2465
2510
  onClick: ()=>{
2466
- let bol = copyText(item.message);
2511
+ let bol = copyText(replaceThinkAndYaml(item.message));
2467
2512
  if (bol) {
2468
2513
  let obj = copyTextOBJ;
2469
2514
  obj = obj.filter((list)=>list != item.id);
@@ -2516,14 +2561,14 @@ const CustomerService = (props)=>{
2516
2561
  item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2517
2562
  className: styles.citation_content,
2518
2563
  children: [
2519
- getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2564
+ getByteLen(replaceThinkAndYaml(item.quotedMessage)) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2520
2565
  overlayClassName: styles.popover_main_content,
2521
- title: item.quotedMessage,
2566
+ title: replaceThinkAndYaml(item.quotedMessage),
2522
2567
  placement: "leftTop",
2523
2568
  children: /*#__PURE__*/ _jsxs("p", {
2524
2569
  className: styles.text_exceed,
2525
2570
  children: [
2526
- item.quotedMessage,
2571
+ replaceThinkAndYaml(item.quotedMessage),
2527
2572
  /*#__PURE__*/ _jsx(RightOutlined, {})
2528
2573
  ]
2529
2574
  })
@@ -2677,6 +2722,35 @@ const CustomerService = (props)=>{
2677
2722
  /*#__PURE__*/ _jsxs("div", {
2678
2723
  className: styles.content,
2679
2724
  children: [
2725
+ !exactRegex.test(message) ? null : /*#__PURE__*/ _jsxs("div", {
2726
+ id: "click_" + i,
2727
+ onClick: ()=>{
2728
+ if ($(`#click_${i} + p .think-block`).css("display") === 'inline-block' || $(`#click_${i} + p .think-block`).css("display") === 'block') {
2729
+ $(`#click_${i} + p .think-block`).css({
2730
+ display: "none"
2731
+ });
2732
+ $(`#click_${i} i`).css({
2733
+ transform: "rotate(180deg)"
2734
+ });
2735
+ } else {
2736
+ $(`#click_${i} + p .think-block`).css({
2737
+ display: "block"
2738
+ });
2739
+ $(`#click_${i} i`).css({
2740
+ transform: "rotate(0deg)"
2741
+ });
2742
+ }
2743
+ },
2744
+ className: styles.content_put,
2745
+ children: [
2746
+ /*#__PURE__*/ _jsx("span", {
2747
+ children: "思考过程"
2748
+ }),
2749
+ /*#__PURE__*/ _jsx("i", {
2750
+ className: "iconfont iconfangxiang-xiaxiao"
2751
+ })
2752
+ ]
2753
+ }),
2680
2754
  item.message != "AI助手繁忙,请稍后再提问或" && /*#__PURE__*/ _jsx("p", {
2681
2755
  dangerouslySetInnerHTML: {
2682
2756
  __html: message
@@ -2755,14 +2829,14 @@ const CustomerService = (props)=>{
2755
2829
  item.quotedMessage && /*#__PURE__*/ _jsxs("div", {
2756
2830
  className: styles.citation_content,
2757
2831
  children: [
2758
- getByteLen(item.quotedMessage) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2832
+ getByteLen(replaceThinkAndYaml(item.quotedMessage)) > 120 ? /*#__PURE__*/ _jsx(Tooltip, {
2759
2833
  overlayClassName: styles.popover_main_content,
2760
- title: item.quotedMessage,
2834
+ title: replaceThinkAndYaml(item.quotedMessage),
2761
2835
  placement: "rightTop",
2762
2836
  children: /*#__PURE__*/ _jsxs("p", {
2763
2837
  className: styles.text_exceed,
2764
2838
  children: [
2765
- item.quotedMessage,
2839
+ replaceThinkAndYaml(item.quotedMessage),
2766
2840
  /*#__PURE__*/ _jsx(RightOutlined, {})
2767
2841
  ]
2768
2842
  })
@@ -2831,11 +2905,7 @@ const CustomerService = (props)=>{
2831
2905
  style: {
2832
2906
  height: '100%'
2833
2907
  },
2834
- initialTopMostItemIndex: !finished && isPositionState ? undefined : {
2835
- index: "LAST",
2836
- align: "end",
2837
- offset: showType === 3 ? 58 : showType === 4 ? 144 : 58
2838
- },
2908
+ // initialTopMostItemIndex={!finished&&isPositionState?undefined:{ index: "LAST", align: "end",offset:showType===3?58:showType===4?144:58 }}
2839
2909
  initialItemCount: 10,
2840
2910
  itemsRendered: ()=>{
2841
2911
  renderMermaid();
@@ -2988,8 +3058,9 @@ const CustomerService = (props)=>{
2988
3058
  /*#__PURE__*/ _jsx("i", {
2989
3059
  className: "yinyong_quote1",
2990
3060
  onClick: ()=>{
3061
+ // 答案的引用
2991
3062
  setCitationContent({
2992
- content: item.message,
3063
+ content: replaceThinkAndYaml(item.message),
2993
3064
  imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
2994
3065
  id: item.id
2995
3066
  });
@@ -3004,7 +3075,7 @@ const CustomerService = (props)=>{
3004
3075
  }) : /*#__PURE__*/ _jsx("i", {
3005
3076
  className: "fuzhi21",
3006
3077
  onClick: ()=>{
3007
- let bol = copyText(item.message);
3078
+ let bol = copyText(replaceThinkAndYaml(item.message));
3008
3079
  if (bol) {
3009
3080
  let obj = copyTextOBJ;
3010
3081
  obj = obj.filter((list)=>list != item.id);
@@ -3026,7 +3097,7 @@ const CustomerService = (props)=>{
3026
3097
  /*#__PURE__*/ _jsx("i", {
3027
3098
  className: `Frame427319094 ${item.upvoted ? styles.active : ""}`,
3028
3099
  onClick: ()=>{
3029
- likeMessage(item.id, item.upvoted);
3100
+ likeMessage(item.id, item.upvoted, item.id);
3030
3101
  //老师的聊天窗口中不需要点赞和踩消息
3031
3102
  if (!isAiChatWindow) return;
3032
3103
  //只有最后一条回答,支持发送点赞或踩
@@ -3034,7 +3105,7 @@ const CustomerService = (props)=>{
3034
3105
  if (!item.extraInfo && item.sender == "AI") {
3035
3106
  aiSendQuestions(1, {
3036
3107
  roomId: roomId,
3037
- message: "你给出的答案我非常满意,赞!",
3108
+ message: "\u0003\u0003\u0003你给出的答案我非常满意,赞!\u0003\u0003\u0003",
3038
3109
  quotedMessage: "",
3039
3110
  regenerate: false,
3040
3111
  generateUpvoteOrDownvoteMessage: true
@@ -3049,7 +3120,7 @@ const CustomerService = (props)=>{
3049
3120
  /*#__PURE__*/ _jsx("i", {
3050
3121
  className: `Frame427319095 ${item.downvoted ? styles.active : ""}`,
3051
3122
  onClick: ()=>{
3052
- disagreeMessage(item.id, item.downvoted);
3123
+ disagreeMessage(item.id, item.downvoted, item.id);
3053
3124
  //老师的聊天窗口中不需要点赞和踩消息
3054
3125
  if (!isAiChatWindow) return;
3055
3126
  //只有最后一条回答,支持发送点赞或踩
@@ -3057,7 +3128,7 @@ const CustomerService = (props)=>{
3057
3128
  if (!item.extraInfo && item.sender == "AI") {
3058
3129
  aiSendQuestions(1, {
3059
3130
  roomId: roomId,
3060
- message: "你给出的答案很糟糕,我不满意,踩!",
3131
+ message: "\u0003\u0003\u0003你给出的答案很糟糕,我不满意,踩!\u0003\u0003\u0003",
3061
3132
  quotedMessage: "",
3062
3133
  regenerate: false,
3063
3134
  generateUpvoteOrDownvoteMessage: true
@@ -3185,9 +3256,9 @@ const CustomerService = (props)=>{
3185
3256
  className: "yinyong_quote1",
3186
3257
  onClick: ()=>{
3187
3258
  setCitationContent({
3188
- content: item.message,
3259
+ content: replaceThinkAndYaml(item.message),
3189
3260
  imageUrl: item.extraInfo && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "imageUrl" && JSON.parse(extraInfo)[0].value,
3190
- id: item.id
3261
+ id: item.messageId
3191
3262
  });
3192
3263
  resettingBottomHei();
3193
3264
  onEvent(serverName + serverUrl(), "click_智能问答_引用", "提交");
@@ -3200,7 +3271,7 @@ const CustomerService = (props)=>{
3200
3271
  }) : /*#__PURE__*/ _jsx("i", {
3201
3272
  className: "fuzhi21",
3202
3273
  onClick: ()=>{
3203
- let bol = copyText(item.message);
3274
+ let bol = copyText(replaceThinkAndYaml(item.message));
3204
3275
  if (bol) {
3205
3276
  let obj = copyTextOBJ;
3206
3277
  obj = obj.filter((list)=>list != item.id);
@@ -3222,7 +3293,7 @@ const CustomerService = (props)=>{
3222
3293
  /*#__PURE__*/ _jsx("i", {
3223
3294
  className: `Frame427319094 ${item.upvoted ? styles.active : ""}`,
3224
3295
  onClick: ()=>{
3225
- likeMessage(item.id, item.upvoted);
3296
+ likeMessage(item.messageId, item.upvoted, item.id);
3226
3297
  //老师的聊天窗口中不需要点赞和踩消息
3227
3298
  if (!isAiChatWindow) return;
3228
3299
  //只有最后一条回答,支持发送点赞或踩
@@ -3231,7 +3302,7 @@ const CustomerService = (props)=>{
3231
3302
  if (!item.extraInfo && item.sender == "AI") {
3232
3303
  aiSendQuestions(1, {
3233
3304
  roomId: roomId,
3234
- message: "你给出的答案我非常满意,赞!",
3305
+ message: "\u0003\u0003\u0003你给出的答案我非常满意,赞!\u0003\u0003\u0003",
3235
3306
  quotedMessage: "",
3236
3307
  regenerate: false,
3237
3308
  generateUpvoteOrDownvoteMessage: true
@@ -3247,7 +3318,7 @@ const CustomerService = (props)=>{
3247
3318
  /*#__PURE__*/ _jsx("i", {
3248
3319
  className: `Frame427319095 ${item.downvoted ? styles.active : ""}`,
3249
3320
  onClick: ()=>{
3250
- disagreeMessage(item.id, item.downvoted);
3321
+ disagreeMessage(item.messageId, item.downvoted, item.id);
3251
3322
  //老师的聊天窗口中不需要点赞和踩消息
3252
3323
  if (!isAiChatWindow) return;
3253
3324
  //只有最后一条回答,支持发送点赞或踩
@@ -3258,7 +3329,7 @@ const CustomerService = (props)=>{
3258
3329
  //AI回答
3259
3330
  aiSendQuestions(1, {
3260
3331
  roomId: roomId,
3261
- message: "你给出的答案很糟糕,我不满意,踩!",
3332
+ message: "\u0003\u0003\u0003你给出的答案很糟糕,我不满意,踩!\u0003\u0003\u0003",
3262
3333
  quotedMessage: "",
3263
3334
  regenerate: false,
3264
3335
  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
+ }
@@ -254,7 +254,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
254
254
  apiRef.contentApi.addMsg({
255
255
  id: msgId,
256
256
  createTime: createTime,
257
- content: "正在输入...",
257
+ content: "正在思考...",
258
258
  location: "left",
259
259
  reference: recordObj.reference || null,
260
260
  source: null,
@@ -264,7 +264,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
264
264
  apiRef.contentApi.addMsg({
265
265
  id: msgId,
266
266
  createTime: createTime,
267
- content: "正在输入...",
267
+ content: "正在思考...",
268
268
  location: "left",
269
269
  reference: null,
270
270
  source: null,
@@ -587,8 +587,17 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
587
587
  } else {
588
588
  // 没有跨天 判断是否相隔超过10分钟
589
589
  if (timeObj.timestamp - beforeTimeObj.timestamp > 10 * 60 * 1000) {
590
- // 超过10分钟 显示 时分
591
- time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
590
+ // 超过10分钟 显示
591
+ var now = new Date();
592
+ // 当天的日期
593
+ var nowTimeStr = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, "0"), "-").concat(String(now.getDate()).padStart(2, "0"));
594
+ if (nowTimeStr === "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day)) {
595
+ // 是当天 显示 时分
596
+ time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
597
+ } else {
598
+ // 不是当天 显示 年月日 时分
599
+ time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
600
+ }
592
601
  }
593
602
  }
594
603
  }
@@ -463,6 +463,9 @@
463
463
  padding: 8px;
464
464
  border-radius: 2px;
465
465
  background: #e7e7e7;
466
+ img {
467
+ width: 100%;
468
+ }
466
469
  p {
467
470
  color: @color-text-Secondary-Tr;
468
471
  font-size: 12px;