bhd-components 0.10.13 → 0.10.15
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.js +7 -3
- 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 +6 -2
- package/es2017/AIMessageList/components/virtuosoList/index.js +2 -1
- package/es2017/AIMessageList/type.d.ts +1 -0
- package/esm/AIMessageList/components/footer/index.js +6 -2
- package/esm/AIMessageList/components/virtuosoList/index.js +2 -1
- package/esm/AIMessageList/type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -14248,7 +14248,7 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
14248
14248
|
var getList = contentConfig.getList, coverRenderText = contentConfig.coverRenderText, _contentConfig_msgAction = contentConfig.msgAction, msgAction = _contentConfig_msgAction === void 0 ? [
|
|
14249
14249
|
"copy",
|
|
14250
14250
|
"reference"
|
|
14251
|
-
] : _contentConfig_msgAction, coverRenderReferences = contentConfig.coverRenderReferences, _contentConfig_onRecordMessage = contentConfig.onRecordMessage, onRecordMessage = _contentConfig_onRecordMessage === void 0 ? function() {} : _contentConfig_onRecordMessage, _contentConfig_onVoteChange = contentConfig.onVoteChange, onVoteChange = _contentConfig_onVoteChange === void 0 ? function() {} : _contentConfig_onVoteChange, _contentConfig_onRefresh = contentConfig.onRefresh, onRefresh = _contentConfig_onRefresh === void 0 ? function() {} : _contentConfig_onRefresh, helloMsg = contentConfig.helloMsg, _contentConfig_fileCustomRender = contentConfig.fileCustomRender, fileCustomRender = _contentConfig_fileCustomRender === void 0 ? {} : _contentConfig_fileCustomRender;
|
|
14251
|
+
] : _contentConfig_msgAction, coverRenderReferences = contentConfig.coverRenderReferences, _contentConfig_onRecordMessage = contentConfig.onRecordMessage, onRecordMessage = _contentConfig_onRecordMessage === void 0 ? function() {} : _contentConfig_onRecordMessage, _contentConfig_onVoteChange = contentConfig.onVoteChange, onVoteChange = _contentConfig_onVoteChange === void 0 ? function() {} : _contentConfig_onVoteChange, _contentConfig_onRefresh = contentConfig.onRefresh, onRefresh = _contentConfig_onRefresh === void 0 ? function() {} : _contentConfig_onRefresh, helloMsg = contentConfig.helloMsg, _contentConfig_fileCustomRender = contentConfig.fileCustomRender, fileCustomRender = _contentConfig_fileCustomRender === void 0 ? {} : _contentConfig_fileCustomRender, _contentConfig_onSendedHelloMsg = contentConfig.onSendedHelloMsg, onSendedHelloMsg = _contentConfig_onSendedHelloMsg === void 0 ? function() {} : _contentConfig_onSendedHelloMsg;
|
|
14252
14252
|
var loadMoreProps = contentConfig.loadMore || true;
|
|
14253
14253
|
var virtuosoRef = useRef(null);
|
|
14254
14254
|
var _useState = _sliced_to_array(useState(false), 2), loading = _useState[0], setLoading = _useState[1]; // 是否加载中
|
|
@@ -14331,6 +14331,7 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
14331
14331
|
source: null,
|
|
14332
14332
|
fileList: []
|
|
14333
14333
|
});
|
|
14334
|
+
onSendedHelloMsg();
|
|
14334
14335
|
}
|
|
14335
14336
|
});
|
|
14336
14337
|
var removeFn = delegate$1(wrapperRef.current, "click", ".".concat(modules_63b47c51$9.copyCode), function(event, target) {
|
|
@@ -15516,6 +15517,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15516
15517
|
},
|
|
15517
15518
|
clickFn: function() {
|
|
15518
15519
|
if (textValue.trim().length === 0) return;
|
|
15520
|
+
if (!canSendMsg) return;
|
|
15519
15521
|
sendMsg(textValue);
|
|
15520
15522
|
}
|
|
15521
15523
|
});
|
|
@@ -15568,14 +15570,16 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15568
15570
|
// 如果只按了 Enter,则阻止默认行为并发送消息
|
|
15569
15571
|
e.preventDefault();
|
|
15570
15572
|
// 在这里添加发送消息的逻辑
|
|
15573
|
+
if (!canSendMsg) return;
|
|
15571
15574
|
sendMsg(textValue);
|
|
15572
15575
|
}
|
|
15573
15576
|
};
|
|
15574
15577
|
// 发现消息
|
|
15575
15578
|
var sendMsg = function(value) {
|
|
15576
|
-
if (value.trim().length === 0) return;
|
|
15577
|
-
if (!canSendMsg) return;
|
|
15578
15579
|
console.log("发送消息:", value);
|
|
15580
|
+
if (value.trim().length === 0) {
|
|
15581
|
+
throw new Error("消息不能为空");
|
|
15582
|
+
}
|
|
15579
15583
|
apiRef.contentApi.addMsg({
|
|
15580
15584
|
id: guidGenerator(),
|
|
15581
15585
|
createTime: new Date().getTime(),
|