bhd-components 0.10.15 → 0.10.17

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.
@@ -60,6 +60,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
60
60
  setTextValue,
61
61
  sendMsg,
62
62
  refreshSendMsg,
63
+ sendMsgLeft,
63
64
  clearText: ()=>{
64
65
  setTextValue("");
65
66
  },
@@ -219,6 +220,14 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
219
220
  fileList: fileList || []
220
221
  });
221
222
  };
223
+ const sendMsgLeft = function(msgId, value, reference, fileList) {
224
+ sendMsgAjax({
225
+ id: msgId,
226
+ value: value,
227
+ reference: reference || null,
228
+ fileList: fileList || []
229
+ });
230
+ };
222
231
  const sendMsgAjax = (recordObj)=>{
223
232
  const { url, method = "POST", headers = ()=>({}), params = ()=>"", onOpen = ()=>{}, onMessage = (ev)=>ev, onClose = ()=>{}, onError = ()=>{}, coverProps = {}, beforeSendMsg = ()=>Promise.resolve() } = sendMsgAjaxParams;
224
233
  ctrl.current = new AbortController();
@@ -395,7 +395,14 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
395
395
  topDom.style.cssText = "";
396
396
  };
397
397
  const renderAction = (location, item)=>{
398
- if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId) return null;
398
+ if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId || item.hideAction) {
399
+ if (location === "floatBottom") {
400
+ return /*#__PURE__*/ _jsx("div", {
401
+ className: `${getCls("msgItem-action-empty")}`
402
+ });
403
+ }
404
+ return null;
405
+ }
399
406
  let copyNode = /*#__PURE__*/ _jsx(CopyIcon, {
400
407
  prefix: prefix,
401
408
  content: item.content
@@ -359,6 +359,10 @@
359
359
  }
360
360
  }
361
361
 
362
+ .msgItem-action-empty{
363
+ min-height: 24px;
364
+ }
365
+
362
366
  .msgItem-reference-text {
363
367
  padding: 8px;
364
368
  border-radius: 2px;
@@ -65,7 +65,6 @@ export interface contentConfigProps {
65
65
  fileCustomRender?: {// 文件对象的自定义渲染
66
66
  iconFileRender?: (suffix: string) => React.ReactNode; // 文件上传的 icon。参数 文件对象file 返回值为图标
67
67
  fileTitleRender?: (item: dataItemType) => React.ReactNode;
68
- fileBottomRender?: (item: dataItemType) => React.ReactNode;
69
68
  fileRender?: (item: dataItemType) => React.ReactNode;
70
69
  };
71
70
  onSendedHelloMsg?:()=>void;//发送招呼语之后
@@ -162,6 +161,7 @@ export interface footerRefProps {
162
161
  setTextValue: (value: string) => void; // 设置输入框的值
163
162
  sendMsg: (value: string) => void; // 发送消息
164
163
  refreshSendMsg:(msgId:string,value:string,reference?:any,fileList?:any)=>void;// 刷新消息
164
+ sendMsgLeft:(msgId:string,value:string,reference?:any,fileList?:any)=>void;// 发送消息只显示ai返回的 不显示自己发送的
165
165
  clearText: () => void; // 清空输入框
166
166
  getCanSendMsg: () => boolean; //获取当前是否允许发送消息的状态
167
167
  stopMessage: () => void; //停止发送消息
@@ -305,4 +305,5 @@ export interface dataItemType {
305
305
  suffix?:string;
306
306
  fileTitle?:string;
307
307
  fileList?:fileCustomProps[];
308
+ hideAction?:boolean;
308
309
  }
@@ -64,6 +64,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
64
64
  setTextValue: setTextValue,
65
65
  sendMsg: sendMsg,
66
66
  refreshSendMsg: refreshSendMsg,
67
+ sendMsgLeft: sendMsgLeft,
67
68
  clearText: function() {
68
69
  setTextValue("");
69
70
  },
@@ -223,6 +224,14 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
223
224
  fileList: fileList || []
224
225
  });
225
226
  };
227
+ var sendMsgLeft = function sendMsgLeft(msgId, value, reference, fileList) {
228
+ sendMsgAjax({
229
+ id: msgId,
230
+ value: value,
231
+ reference: reference || null,
232
+ fileList: fileList || []
233
+ });
234
+ };
226
235
  var sendMsgAjax = function(recordObj) {
227
236
  var url = sendMsgAjaxParams.url, _sendMsgAjaxParams_method = sendMsgAjaxParams.method, method = _sendMsgAjaxParams_method === void 0 ? "POST" : _sendMsgAjaxParams_method, _sendMsgAjaxParams_headers = sendMsgAjaxParams.headers, headers = _sendMsgAjaxParams_headers === void 0 ? function() {
228
237
  return {};
@@ -399,7 +399,14 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
399
399
  topDom.style.cssText = "";
400
400
  };
401
401
  var renderAction = function(location, item) {
402
- if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId) return null;
402
+ if (item.id === "inputing" || item.id === "helloMsg" || item.id === recordRef.current.sendingId || item.hideAction) {
403
+ if (location === "floatBottom") {
404
+ return /*#__PURE__*/ _jsx("div", {
405
+ className: "".concat(getCls("msgItem-action-empty"))
406
+ });
407
+ }
408
+ return null;
409
+ }
403
410
  var copyNode = /*#__PURE__*/ _jsx(CopyIcon, {
404
411
  prefix: prefix,
405
412
  content: item.content
@@ -359,6 +359,10 @@
359
359
  }
360
360
  }
361
361
 
362
+ .msgItem-action-empty{
363
+ min-height: 24px;
364
+ }
365
+
362
366
  .msgItem-reference-text {
363
367
  padding: 8px;
364
368
  border-radius: 2px;
@@ -65,7 +65,6 @@ export interface contentConfigProps {
65
65
  fileCustomRender?: {// 文件对象的自定义渲染
66
66
  iconFileRender?: (suffix: string) => React.ReactNode; // 文件上传的 icon。参数 文件对象file 返回值为图标
67
67
  fileTitleRender?: (item: dataItemType) => React.ReactNode;
68
- fileBottomRender?: (item: dataItemType) => React.ReactNode;
69
68
  fileRender?: (item: dataItemType) => React.ReactNode;
70
69
  };
71
70
  onSendedHelloMsg?:()=>void;//发送招呼语之后
@@ -162,6 +161,7 @@ export interface footerRefProps {
162
161
  setTextValue: (value: string) => void; // 设置输入框的值
163
162
  sendMsg: (value: string) => void; // 发送消息
164
163
  refreshSendMsg:(msgId:string,value:string,reference?:any,fileList?:any)=>void;// 刷新消息
164
+ sendMsgLeft:(msgId:string,value:string,reference?:any,fileList?:any)=>void;// 发送消息只显示ai返回的 不显示自己发送的
165
165
  clearText: () => void; // 清空输入框
166
166
  getCanSendMsg: () => boolean; //获取当前是否允许发送消息的状态
167
167
  stopMessage: () => void; //停止发送消息
@@ -305,4 +305,5 @@ export interface dataItemType {
305
305
  suffix?:string;
306
306
  fileTitle?:string;
307
307
  fileList?:fileCustomProps[];
308
+ hideAction?:boolean;
308
309
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.10.15",
3
+ "version": "0.10.17",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {