sceyt-chat-react-uikit 1.8.9-beta.15 → 1.8.9-beta.16
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const hasSendableTextOrPoll: (messageText: string, isPoll: boolean) => boolean;
|
package/index.js
CHANGED
|
@@ -53198,6 +53198,10 @@ var SettingItem = styled__default.div(_templateObject9$j || (_templateObject9$j
|
|
|
53198
53198
|
return props.color;
|
|
53199
53199
|
});
|
|
53200
53200
|
|
|
53201
|
+
var hasSendableTextOrPoll = function hasSendableTextOrPoll(messageText, isPoll) {
|
|
53202
|
+
return Boolean(messageText.trim() || isPoll);
|
|
53203
|
+
};
|
|
53204
|
+
|
|
53201
53205
|
var _templateObject$W, _templateObject2$R, _templateObject3$I, _templateObject4$C, _templateObject5$x, _templateObject6$t, _templateObject7$q, _templateObject8$n, _templateObject9$k, _templateObject0$i, _templateObject1$f, _templateObject10$c, _templateObject11$9, _templateObject12$7, _templateObject13$6, _templateObject14$5, _templateObject15$3, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$2, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35$1, _templateObject36$1, _templateObject37$1, _templateObject38$1, _templateObject39$1, _templateObject40$1, _templateObject41$1, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46;
|
|
53202
53206
|
function AutoFocusPlugin(_ref) {
|
|
53203
53207
|
var messageForReply = _ref.messageForReply;
|
|
@@ -53724,7 +53728,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
53724
53728
|
type = event.type,
|
|
53725
53729
|
code = event.code;
|
|
53726
53730
|
var isEnter = (code === 'Enter' || code === 'NumpadEnter') && shiftKey === false;
|
|
53727
|
-
var isPoll = pollDetails && pollDetails.options.length > 0 && pollDetails.name.trim();
|
|
53731
|
+
var isPoll = Boolean(pollDetails && pollDetails.options.length > 0 && pollDetails.name.trim());
|
|
53728
53732
|
var messageTextForSend = isPoll ? pollDetails === null || pollDetails === void 0 ? void 0 : pollDetails.name.trim() : messageText.trim();
|
|
53729
53733
|
var shouldSend = (isEnter || type === 'click') && (messageToEdit || messageTextForSend || attachments.length && attachments.length > 0);
|
|
53730
53734
|
if (isEnter) {
|
|
@@ -53839,7 +53843,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
53839
53843
|
});
|
|
53840
53844
|
}
|
|
53841
53845
|
}
|
|
53842
|
-
if (messageTexToSend
|
|
53846
|
+
if (hasSendableTextOrPoll(messageTexToSend, isPoll) && !attachments.length) {
|
|
53843
53847
|
if (linkAttachment) {
|
|
53844
53848
|
messageToSend.attachments = [linkAttachment];
|
|
53845
53849
|
}
|
package/index.modern.js
CHANGED
|
@@ -53178,6 +53178,10 @@ var SettingItem = styled.div(_templateObject9$j || (_templateObject9$j = _tagged
|
|
|
53178
53178
|
return props.color;
|
|
53179
53179
|
});
|
|
53180
53180
|
|
|
53181
|
+
var hasSendableTextOrPoll = function hasSendableTextOrPoll(messageText, isPoll) {
|
|
53182
|
+
return Boolean(messageText.trim() || isPoll);
|
|
53183
|
+
};
|
|
53184
|
+
|
|
53181
53185
|
var _templateObject$W, _templateObject2$R, _templateObject3$I, _templateObject4$C, _templateObject5$x, _templateObject6$t, _templateObject7$q, _templateObject8$n, _templateObject9$k, _templateObject0$i, _templateObject1$f, _templateObject10$c, _templateObject11$9, _templateObject12$7, _templateObject13$6, _templateObject14$5, _templateObject15$3, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$2, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35$1, _templateObject36$1, _templateObject37$1, _templateObject38$1, _templateObject39$1, _templateObject40$1, _templateObject41$1, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46;
|
|
53182
53186
|
function AutoFocusPlugin(_ref) {
|
|
53183
53187
|
var messageForReply = _ref.messageForReply;
|
|
@@ -53704,7 +53708,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
53704
53708
|
type = event.type,
|
|
53705
53709
|
code = event.code;
|
|
53706
53710
|
var isEnter = (code === 'Enter' || code === 'NumpadEnter') && shiftKey === false;
|
|
53707
|
-
var isPoll = pollDetails && pollDetails.options.length > 0 && pollDetails.name.trim();
|
|
53711
|
+
var isPoll = Boolean(pollDetails && pollDetails.options.length > 0 && pollDetails.name.trim());
|
|
53708
53712
|
var messageTextForSend = isPoll ? pollDetails === null || pollDetails === void 0 ? void 0 : pollDetails.name.trim() : messageText.trim();
|
|
53709
53713
|
var shouldSend = (isEnter || type === 'click') && (messageToEdit || messageTextForSend || attachments.length && attachments.length > 0);
|
|
53710
53714
|
if (isEnter) {
|
|
@@ -53819,7 +53823,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
53819
53823
|
});
|
|
53820
53824
|
}
|
|
53821
53825
|
}
|
|
53822
|
-
if (messageTexToSend
|
|
53826
|
+
if (hasSendableTextOrPoll(messageTexToSend, isPoll) && !attachments.length) {
|
|
53823
53827
|
if (linkAttachment) {
|
|
53824
53828
|
messageToSend.attachments = [linkAttachment];
|
|
53825
53829
|
}
|