bhd-components 0.10.13 → 0.10.14
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 +5 -2
- 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/esm/AIMessageList/components/footer/index.js +6 -2
- package/package.json +1 -1
|
@@ -15516,6 +15516,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15516
15516
|
},
|
|
15517
15517
|
clickFn: function() {
|
|
15518
15518
|
if (textValue.trim().length === 0) return;
|
|
15519
|
+
if (!canSendMsg) return;
|
|
15519
15520
|
sendMsg(textValue);
|
|
15520
15521
|
}
|
|
15521
15522
|
});
|
|
@@ -15568,14 +15569,16 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15568
15569
|
// 如果只按了 Enter,则阻止默认行为并发送消息
|
|
15569
15570
|
e.preventDefault();
|
|
15570
15571
|
// 在这里添加发送消息的逻辑
|
|
15572
|
+
if (!canSendMsg) return;
|
|
15571
15573
|
sendMsg(textValue);
|
|
15572
15574
|
}
|
|
15573
15575
|
};
|
|
15574
15576
|
// 发现消息
|
|
15575
15577
|
var sendMsg = function(value) {
|
|
15576
|
-
if (value.trim().length === 0) return;
|
|
15577
|
-
if (!canSendMsg) return;
|
|
15578
15578
|
console.log("发送消息:", value);
|
|
15579
|
+
if (value.trim().length === 0) {
|
|
15580
|
+
throw new Error("消息不能为空");
|
|
15581
|
+
}
|
|
15579
15582
|
apiRef.contentApi.addMsg({
|
|
15580
15583
|
id: guidGenerator(),
|
|
15581
15584
|
createTime: new Date().getTime(),
|