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
|
@@ -135,6 +135,7 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
135
135
|
},
|
|
136
136
|
clickFn: ()=>{
|
|
137
137
|
if (textValue.trim().length === 0) return;
|
|
138
|
+
if (!canSendMsg) return;
|
|
138
139
|
sendMsg(textValue);
|
|
139
140
|
}
|
|
140
141
|
});
|
|
@@ -187,14 +188,17 @@ const Footer = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
187
188
|
// 如果只按了 Enter,则阻止默认行为并发送消息
|
|
188
189
|
e.preventDefault();
|
|
189
190
|
// 在这里添加发送消息的逻辑
|
|
191
|
+
if (!canSendMsg) return;
|
|
190
192
|
sendMsg(textValue);
|
|
191
193
|
}
|
|
192
194
|
};
|
|
193
195
|
// 发现消息
|
|
194
196
|
const sendMsg = (value)=>{
|
|
195
|
-
if (value.trim().length === 0) return;
|
|
196
|
-
if (!canSendMsg) return;
|
|
197
197
|
console.log("发送消息:", value);
|
|
198
|
+
if (value.trim().length === 0) {
|
|
199
|
+
throw new Error("消息不能为空");
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
198
202
|
apiRef.contentApi.addMsg({
|
|
199
203
|
id: guidGenerator(),
|
|
200
204
|
createTime: new Date().getTime(),
|
|
@@ -139,6 +139,7 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
139
139
|
},
|
|
140
140
|
clickFn: function() {
|
|
141
141
|
if (textValue.trim().length === 0) return;
|
|
142
|
+
if (!canSendMsg) return;
|
|
142
143
|
sendMsg(textValue);
|
|
143
144
|
}
|
|
144
145
|
});
|
|
@@ -191,14 +192,17 @@ var Footer = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
191
192
|
// 如果只按了 Enter,则阻止默认行为并发送消息
|
|
192
193
|
e.preventDefault();
|
|
193
194
|
// 在这里添加发送消息的逻辑
|
|
195
|
+
if (!canSendMsg) return;
|
|
194
196
|
sendMsg(textValue);
|
|
195
197
|
}
|
|
196
198
|
};
|
|
197
199
|
// 发现消息
|
|
198
200
|
var sendMsg = function(value) {
|
|
199
|
-
if (value.trim().length === 0) return;
|
|
200
|
-
if (!canSendMsg) return;
|
|
201
201
|
console.log("发送消息:", value);
|
|
202
|
+
if (value.trim().length === 0) {
|
|
203
|
+
throw new Error("消息不能为空");
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
202
206
|
apiRef.contentApi.addMsg({
|
|
203
207
|
id: guidGenerator(),
|
|
204
208
|
createTime: new Date().getTime(),
|