bhd-components 0.10.9 → 0.10.11
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 +89 -87
- package/dist/index.esm.es5.development.js +7 -8
- 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 +1 -1
- package/dist/vendor.esm.es5.production.js +1 -1
- package/es2017/AIMessageList/components/footer/index.js +4 -2
- package/es2017/AIMessageList/components/virtuosoList/index.js +0 -5
- package/es2017/AIMessageList/components/virtuosoList/index.module.less +2 -0
- package/es2017/AIMessageList/type.d.ts +1 -1
- package/esm/AIMessageList/components/footer/index.js +6 -2
- package/esm/AIMessageList/components/virtuosoList/index.js +0 -5
- package/esm/AIMessageList/components/virtuosoList/index.module.less +2 -0
- package/esm/AIMessageList/type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ const defaultFileUploadProps = {
|
|
|
26
26
|
};
|
|
27
27
|
const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
28
28
|
let { footerConfig, prefix, errorCallback, apiRef } = props;
|
|
29
|
-
let { placeholder = defaultProps.placeholder, className = defaultProps.className, maxLength = defaultProps.maxLength, renderAction, fileUpload, sendMsgAjaxParams, onClickStop = ()=>{} } = footerConfig;
|
|
29
|
+
let { placeholder = defaultProps.placeholder, className = defaultProps.className, maxLength = defaultProps.maxLength, renderAction, fileUpload, sendMsgAjaxParams, onClickStop = ()=>{}, conversionContent = (str)=>str } = footerConfig;
|
|
30
30
|
if (fileUpload) {
|
|
31
31
|
fileUpload = _object_spread({}, defaultFileUploadProps, fileUpload);
|
|
32
32
|
}
|
|
@@ -268,10 +268,12 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
268
268
|
onmessage: (ev)=>{
|
|
269
269
|
let data = onMessage(ev, closeCallback);
|
|
270
270
|
msgContent += data.content;
|
|
271
|
+
let str = msgContent.replace(/\\n/g, "\n");
|
|
272
|
+
str = conversionContent(str);
|
|
271
273
|
delete data.content;
|
|
272
274
|
recordMsgObj = _object_spread({
|
|
273
275
|
createTime: createTime,
|
|
274
|
-
content:
|
|
276
|
+
content: str || "正在输入...",
|
|
275
277
|
location: "left",
|
|
276
278
|
reference: null,
|
|
277
279
|
source: null
|
|
@@ -186,7 +186,6 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
186
186
|
reference: null,
|
|
187
187
|
source: null,
|
|
188
188
|
suffix: item.suffix,
|
|
189
|
-
fileSize: item.size || 0,
|
|
190
189
|
fileTitle: item.name
|
|
191
190
|
});
|
|
192
191
|
});
|
|
@@ -249,10 +248,6 @@ const VirtuosoList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
249
248
|
if (coverRenderText) {
|
|
250
249
|
contentNode = coverRenderText(item, html);
|
|
251
250
|
}
|
|
252
|
-
// item.type = "file";
|
|
253
|
-
// item.suffix = "docx";
|
|
254
|
-
// item.fileTitle = "这是一个文件名称.docx";
|
|
255
|
-
// item.fileSize = "5Mb";
|
|
256
251
|
if (item.type === "file") {
|
|
257
252
|
let renderFileObj = _object_spread({
|
|
258
253
|
fileTitleRender: (item)=>{
|
|
@@ -91,6 +91,7 @@ export interface footerConfigProps {
|
|
|
91
91
|
fileUpload?: boolean | fileUploadProps; // 默认为false
|
|
92
92
|
sendMsgAjaxParams: sendMsgAjaxParams;
|
|
93
93
|
onClickStop?: () => void;
|
|
94
|
+
conversionContent?:(content:string)=>string
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
export interface onOpenProps {
|
|
@@ -300,7 +301,6 @@ export interface dataItemType {
|
|
|
300
301
|
vote?:string;// "up":点赞。"down":踩
|
|
301
302
|
type?:"file"|"text",
|
|
302
303
|
suffix?:string;
|
|
303
|
-
fileSize?:number;
|
|
304
304
|
fileTitle?:string;
|
|
305
305
|
fileList?:fileCustomProps[];
|
|
306
306
|
}
|
|
@@ -28,7 +28,9 @@ var defaultFileUploadProps = {
|
|
|
28
28
|
};
|
|
29
29
|
var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
30
30
|
var footerConfig = props.footerConfig, prefix = props.prefix, errorCallback = props.errorCallback, apiRef = props.apiRef;
|
|
31
|
-
var _footerConfig_placeholder = footerConfig.placeholder, placeholder = _footerConfig_placeholder === void 0 ? defaultProps.placeholder : _footerConfig_placeholder, _footerConfig_className = footerConfig.className, className = _footerConfig_className === void 0 ? defaultProps.className : _footerConfig_className, _footerConfig_maxLength = footerConfig.maxLength, maxLength = _footerConfig_maxLength === void 0 ? defaultProps.maxLength : _footerConfig_maxLength, renderAction = footerConfig.renderAction, fileUpload = footerConfig.fileUpload, sendMsgAjaxParams = footerConfig.sendMsgAjaxParams, _footerConfig_onClickStop = footerConfig.onClickStop, onClickStop = _footerConfig_onClickStop === void 0 ? function() {} : _footerConfig_onClickStop
|
|
31
|
+
var _footerConfig_placeholder = footerConfig.placeholder, placeholder = _footerConfig_placeholder === void 0 ? defaultProps.placeholder : _footerConfig_placeholder, _footerConfig_className = footerConfig.className, className = _footerConfig_className === void 0 ? defaultProps.className : _footerConfig_className, _footerConfig_maxLength = footerConfig.maxLength, maxLength = _footerConfig_maxLength === void 0 ? defaultProps.maxLength : _footerConfig_maxLength, renderAction = footerConfig.renderAction, fileUpload = footerConfig.fileUpload, sendMsgAjaxParams = footerConfig.sendMsgAjaxParams, _footerConfig_onClickStop = footerConfig.onClickStop, onClickStop = _footerConfig_onClickStop === void 0 ? function() {} : _footerConfig_onClickStop, _footerConfig_conversionContent = footerConfig.conversionContent, conversionContent = _footerConfig_conversionContent === void 0 ? function(str) {
|
|
32
|
+
return str;
|
|
33
|
+
} : _footerConfig_conversionContent;
|
|
32
34
|
if (fileUpload) {
|
|
33
35
|
fileUpload = _object_spread({}, defaultFileUploadProps, fileUpload);
|
|
34
36
|
}
|
|
@@ -280,10 +282,12 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
280
282
|
onmessage: function(ev) {
|
|
281
283
|
var data = onMessage(ev, closeCallback);
|
|
282
284
|
msgContent += data.content;
|
|
285
|
+
var str = msgContent.replace(/\\n/g, "\n");
|
|
286
|
+
str = conversionContent(str);
|
|
283
287
|
delete data.content;
|
|
284
288
|
recordMsgObj = _object_spread({
|
|
285
289
|
createTime: createTime,
|
|
286
|
-
content:
|
|
290
|
+
content: str || "正在输入...",
|
|
287
291
|
location: "left",
|
|
288
292
|
reference: null,
|
|
289
293
|
source: null
|
|
@@ -192,7 +192,6 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
192
192
|
reference: null,
|
|
193
193
|
source: null,
|
|
194
194
|
suffix: item.suffix,
|
|
195
|
-
fileSize: item.size || 0,
|
|
196
195
|
fileTitle: item.name
|
|
197
196
|
});
|
|
198
197
|
});
|
|
@@ -249,10 +248,6 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
249
248
|
if (coverRenderText) {
|
|
250
249
|
contentNode = coverRenderText(item, html);
|
|
251
250
|
}
|
|
252
|
-
// item.type = "file";
|
|
253
|
-
// item.suffix = "docx";
|
|
254
|
-
// item.fileTitle = "这是一个文件名称.docx";
|
|
255
|
-
// item.fileSize = "5Mb";
|
|
256
251
|
if (item.type === "file") {
|
|
257
252
|
var renderFileObj = _object_spread({
|
|
258
253
|
fileTitleRender: function(item) {
|
|
@@ -91,6 +91,7 @@ export interface footerConfigProps {
|
|
|
91
91
|
fileUpload?: boolean | fileUploadProps; // 默认为false
|
|
92
92
|
sendMsgAjaxParams: sendMsgAjaxParams;
|
|
93
93
|
onClickStop?: () => void;
|
|
94
|
+
conversionContent?:(content:string)=>string
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
export interface onOpenProps {
|
|
@@ -300,7 +301,6 @@ export interface dataItemType {
|
|
|
300
301
|
vote?:string;// "up":点赞。"down":踩
|
|
301
302
|
type?:"file"|"text",
|
|
302
303
|
suffix?:string;
|
|
303
|
-
fileSize?:number;
|
|
304
304
|
fileTitle?:string;
|
|
305
305
|
fileList?:fileCustomProps[];
|
|
306
306
|
}
|