bhd-components 0.10.27 → 0.10.29

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.
@@ -321,26 +321,29 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
321
321
  },
322
322
  onmessage: (ev)=>{
323
323
  let data = onMessage(ev, closeCallback, bodyParams, msgId);
324
- if (recordObj) {
325
- data.id = recordObj.id;
326
- }
327
324
  msgContent += data.content;
328
325
  let str = msgContent.replace(/\\n/g, "\n");
329
326
  str = conversionContent(str);
330
327
  delete data.content;
331
- recordMsgObj = _object_spread({
332
- createTime: createTime,
333
- content: str || "正在输入...",
334
- location: "left",
335
- reference: null,
336
- source: null
337
- }, data);
338
- apiRef.contentApi.setSendingId(data.id);
339
- apiRef.contentApi.updateMsg(msgId, recordMsgObj);
340
- msgId = data.id;
341
- // updateMsgRef.current = setTimeout(function () {
342
- apiRef.contentApi.scrollToBottom();
343
- // }, 100);
328
+ // 有内容返回再去填充 因为onmessage存在空内容的心跳维持
329
+ if (str) {
330
+ if (recordObj) {
331
+ data.id = recordObj.id;
332
+ }
333
+ recordMsgObj = _object_spread({
334
+ createTime: createTime,
335
+ content: str,
336
+ location: "left",
337
+ reference: null,
338
+ source: null
339
+ }, data);
340
+ apiRef.contentApi.setSendingId(data.id);
341
+ apiRef.contentApi.updateMsg(msgId, recordMsgObj);
342
+ msgId = data.id;
343
+ // updateMsgRef.current = setTimeout(function () {
344
+ apiRef.contentApi.scrollToBottom();
345
+ // }, 100);
346
+ }
344
347
  },
345
348
  onclose: ()=>{
346
349
  closeCallback();
@@ -397,7 +397,7 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
397
397
  };
398
398
  const renderAction = (location, item)=>{
399
399
  if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId || item.hideAction) {
400
- if (location === "floatBottom") {
400
+ if (location === "floatBottom" || location === "floatTop") {
401
401
  return /*#__PURE__*/ _jsx("div", {
402
402
  className: `${getCls("msgItem-action-empty")}`
403
403
  });
@@ -581,7 +581,7 @@ const CustomerService = (props)=>{
581
581
  roomId: roomId,
582
582
  sender: "AI",
583
583
  recevier: mid,
584
- message: `Hi,我是智能学习助手,你遇到了什么问题?1`,
584
+ message: `Hi,我是智能学习助手,你遇到了什么问题?`,
585
585
  extraInfos: questionsList == null ? null : questionsList
586
586
  };
587
587
  if (pageNumHistory <= 1) {
@@ -335,26 +335,29 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
335
335
  },
336
336
  onmessage: function(ev) {
337
337
  var data = onMessage(ev, closeCallback, bodyParams, msgId);
338
- if (recordObj) {
339
- data.id = recordObj.id;
340
- }
341
338
  msgContent += data.content;
342
339
  var str = msgContent.replace(/\\n/g, "\n");
343
340
  str = conversionContent(str);
344
341
  delete data.content;
345
- recordMsgObj = _object_spread({
346
- createTime: createTime,
347
- content: str || "正在输入...",
348
- location: "left",
349
- reference: null,
350
- source: null
351
- }, data);
352
- apiRef.contentApi.setSendingId(data.id);
353
- apiRef.contentApi.updateMsg(msgId, recordMsgObj);
354
- msgId = data.id;
355
- // updateMsgRef.current = setTimeout(function () {
356
- apiRef.contentApi.scrollToBottom();
357
- // }, 100);
342
+ // 有内容返回再去填充 因为onmessage存在空内容的心跳维持
343
+ if (str) {
344
+ if (recordObj) {
345
+ data.id = recordObj.id;
346
+ }
347
+ recordMsgObj = _object_spread({
348
+ createTime: createTime,
349
+ content: str,
350
+ location: "left",
351
+ reference: null,
352
+ source: null
353
+ }, data);
354
+ apiRef.contentApi.setSendingId(data.id);
355
+ apiRef.contentApi.updateMsg(msgId, recordMsgObj);
356
+ msgId = data.id;
357
+ // updateMsgRef.current = setTimeout(function () {
358
+ apiRef.contentApi.scrollToBottom();
359
+ // }, 100);
360
+ }
358
361
  },
359
362
  onclose: function() {
360
363
  closeCallback();
@@ -405,7 +405,7 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
405
405
  };
406
406
  var renderAction = function(location, item) {
407
407
  if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId || item.hideAction) {
408
- if (location === "floatBottom") {
408
+ if (location === "floatBottom" || location === "floatTop") {
409
409
  return /*#__PURE__*/ _jsx("div", {
410
410
  className: "".concat(getCls("msgItem-action-empty"))
411
411
  });
@@ -592,7 +592,7 @@ var CustomerService = function(props) {
592
592
  roomId: roomId,
593
593
  sender: "AI",
594
594
  recevier: mid,
595
- message: "Hi,我是智能学习助手,你遇到了什么问题?1",
595
+ message: "Hi,我是智能学习助手,你遇到了什么问题?",
596
596
  extraInfos: questionsList == null ? null : questionsList
597
597
  };
598
598
  if (pageNumHistory <= 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.10.27",
3
+ "version": "0.10.29",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {