sceyt-chat-react-uikit 1.7.7-beta.13 → 1.7.7-beta.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/index.js +43 -45
- package/index.modern.js +43 -45
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -18850,8 +18850,31 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
|
|
|
18850
18850
|
return Promise.reject(e);
|
|
18851
18851
|
}
|
|
18852
18852
|
};
|
|
18853
|
+
var updateMessage$1 = function updateMessage(actionType, pending, channel, scrollToNewMessage) {
|
|
18854
|
+
if (scrollToNewMessage === void 0) {
|
|
18855
|
+
scrollToNewMessage = true;
|
|
18856
|
+
}
|
|
18857
|
+
try {
|
|
18858
|
+
var activeChannelId = getActiveChannelId();
|
|
18859
|
+
if (actionType !== RESEND_MESSAGE) {
|
|
18860
|
+
addMessageToMap(channel.id, pending);
|
|
18861
|
+
if (activeChannelId === channel.id) {
|
|
18862
|
+
addAllMessages([pending], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
18863
|
+
}
|
|
18864
|
+
if (activeChannelId === channel.id) {
|
|
18865
|
+
store.dispatch(addMessageAC(pending));
|
|
18866
|
+
}
|
|
18867
|
+
if (scrollToNewMessage) {
|
|
18868
|
+
store.dispatch(scrollToNewMessageAC(true));
|
|
18869
|
+
}
|
|
18870
|
+
}
|
|
18871
|
+
return Promise.resolve();
|
|
18872
|
+
} catch (e) {
|
|
18873
|
+
return Promise.reject(e);
|
|
18874
|
+
}
|
|
18875
|
+
};
|
|
18853
18876
|
function sendMessage(action) {
|
|
18854
|
-
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, isAddToPendingMessagesMap, pendingMessages, channel, SceytChatClient, createChannelData, mentionedUserIds, customUploader, linkAttachment, attachmentsToSend, messagesToSend, mediaAttachments, _loop, i, messageBuilder, messageToSend, _loop2, _i, _t2;
|
|
18877
|
+
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, isAddToPendingMessagesMap, pendingMessages, channel, SceytChatClient, createChannelData, mentionedUserIds, customUploader, linkAttachment, attachmentsToSend, messagesToSend, mediaAttachments, _loop, i, messageBuilder, messageToSend, pending, _loop2, _i, _t2;
|
|
18855
18878
|
return _regenerator().w(function (_context3) {
|
|
18856
18879
|
while (1) switch (_context3.p = _context3.n) {
|
|
18857
18880
|
case 0:
|
|
@@ -18918,7 +18941,7 @@ function sendMessage(action) {
|
|
|
18918
18941
|
break;
|
|
18919
18942
|
}
|
|
18920
18943
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
18921
|
-
var attachment, uri, attachmentBuilder, messageAttachment, handleUpdateUploadProgress, _messageBuilder, _messageToSend, messageForSend;
|
|
18944
|
+
var attachment, uri, attachmentBuilder, messageAttachment, handleUpdateUploadProgress, _messageBuilder, _messageToSend, messageForSend, _pending;
|
|
18922
18945
|
return _regenerator().w(function (_context) {
|
|
18923
18946
|
while (1) switch (_context.n) {
|
|
18924
18947
|
case 0:
|
|
@@ -18983,9 +19006,12 @@ function sendMessage(action) {
|
|
|
18983
19006
|
createdAt: new Date(Date.now())
|
|
18984
19007
|
});
|
|
18985
19008
|
messagesToSend.push(messageForSend);
|
|
18986
|
-
|
|
18987
|
-
attachments: [attachment]
|
|
18988
|
-
|
|
19009
|
+
_pending = _extends({}, messageForSend, {
|
|
19010
|
+
attachments: [attachment],
|
|
19011
|
+
createdAt: new Date(Date.now())
|
|
19012
|
+
});
|
|
19013
|
+
pendingMessages.push(_pending);
|
|
19014
|
+
updateMessage$1(action.type, _pending, channel);
|
|
18989
19015
|
} else {
|
|
18990
19016
|
attachmentsToSend.push(messageAttachment);
|
|
18991
19017
|
}
|
|
@@ -19022,9 +19048,12 @@ function sendMessage(action) {
|
|
|
19022
19048
|
messageBuilder.setReplyInThread();
|
|
19023
19049
|
}
|
|
19024
19050
|
messageToSend = action.type === RESEND_MESSAGE ? action.payload.message : messageBuilder.create();
|
|
19025
|
-
|
|
19026
|
-
attachments: message.attachments
|
|
19027
|
-
|
|
19051
|
+
pending = _extends({}, messageToSend, {
|
|
19052
|
+
attachments: message.attachments,
|
|
19053
|
+
createdAt: new Date(Date.now())
|
|
19054
|
+
});
|
|
19055
|
+
pendingMessages.push(pending);
|
|
19056
|
+
updateMessage$1(action.type, pending, channel);
|
|
19028
19057
|
messageToSend = _extends({}, messageToSend, {
|
|
19029
19058
|
attachments: attachmentsToSend
|
|
19030
19059
|
});
|
|
@@ -19032,7 +19061,7 @@ function sendMessage(action) {
|
|
|
19032
19061
|
}
|
|
19033
19062
|
case 11:
|
|
19034
19063
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
19035
|
-
var messageAttachment, messageToSend, messageCopy,
|
|
19064
|
+
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, messageToUpdate, channelUpdateParam, pendingMessage, _t;
|
|
19036
19065
|
return _regenerator().w(function (_context2) {
|
|
19037
19066
|
while (1) switch (_context2.p = _context2.n) {
|
|
19038
19067
|
case 0:
|
|
@@ -19040,23 +19069,6 @@ function sendMessage(action) {
|
|
|
19040
19069
|
messageToSend = messagesToSend[_i];
|
|
19041
19070
|
_context2.p = 1;
|
|
19042
19071
|
messageCopy = JSON.parse(JSON.stringify(messagesToSend[_i]));
|
|
19043
|
-
activeChannelId = getActiveChannelId();
|
|
19044
|
-
if (action.type !== RESEND_MESSAGE) {
|
|
19045
|
-
addMessageToMap(channel.id, _extends({}, messageToSend, {
|
|
19046
|
-
createdAt: new Date(Date.now())
|
|
19047
|
-
}));
|
|
19048
|
-
if (activeChannelId === channel.id) {
|
|
19049
|
-
addAllMessages([_extends({}, messageToSend, {
|
|
19050
|
-
createdAt: new Date(Date.now())
|
|
19051
|
-
})], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19052
|
-
}
|
|
19053
|
-
if (activeChannelId === channel.id) {
|
|
19054
|
-
store.dispatch(addMessageAC(_extends({}, messageToSend, {
|
|
19055
|
-
createdAt: new Date(Date.now())
|
|
19056
|
-
})));
|
|
19057
|
-
}
|
|
19058
|
-
store.dispatch(scrollToNewMessageAC(true));
|
|
19059
|
-
}
|
|
19060
19072
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19061
19073
|
_context2.n = 12;
|
|
19062
19074
|
break;
|
|
@@ -19253,7 +19265,7 @@ function sendMessage(action) {
|
|
|
19253
19265
|
}, _marked$3, null, [[1, 15]]);
|
|
19254
19266
|
}
|
|
19255
19267
|
function sendTextMessage(action) {
|
|
19256
|
-
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, pendingMessage, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend,
|
|
19268
|
+
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, pendingMessage, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19257
19269
|
return _regenerator().w(function (_context4) {
|
|
19258
19270
|
while (1) switch (_context4.p = _context4.n) {
|
|
19259
19271
|
case 0:
|
|
@@ -19329,16 +19341,8 @@ function sendTextMessage(action) {
|
|
|
19329
19341
|
if (pendingMessage && pendingMessage.metadata) {
|
|
19330
19342
|
pendingMessage.metadata = JSON.parse(pendingMessage.metadata);
|
|
19331
19343
|
}
|
|
19332
|
-
if (
|
|
19333
|
-
|
|
19334
|
-
addMessageToMap(channel.id, pendingMessage);
|
|
19335
|
-
if (_activeChannelId === channel.id) {
|
|
19336
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19337
|
-
}
|
|
19338
|
-
if (_activeChannelId === channel.id) {
|
|
19339
|
-
store.dispatch(addMessageAC(pendingMessage));
|
|
19340
|
-
}
|
|
19341
|
-
store.dispatch(scrollToNewMessageAC(true));
|
|
19344
|
+
if (pendingMessage) {
|
|
19345
|
+
updateMessage$1(action.type, pendingMessage, channel);
|
|
19342
19346
|
}
|
|
19343
19347
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19344
19348
|
_context4.n = 15;
|
|
@@ -19570,14 +19574,8 @@ function forwardMessage(action) {
|
|
|
19570
19574
|
_context5.n = 8;
|
|
19571
19575
|
return effects.put(getMessagesAC(channel));
|
|
19572
19576
|
case 8:
|
|
19573
|
-
if (
|
|
19574
|
-
|
|
19575
|
-
if (activeChannelId === channel.id) {
|
|
19576
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19577
|
-
}
|
|
19578
|
-
if (activeChannelId === channel.id) {
|
|
19579
|
-
store.dispatch(addMessageAC(pendingMessage));
|
|
19580
|
-
}
|
|
19577
|
+
if (pendingMessage) {
|
|
19578
|
+
updateMessage$1(action.type, pendingMessage, channel, false);
|
|
19581
19579
|
}
|
|
19582
19580
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19583
19581
|
_context5.n = 14;
|
package/index.modern.js
CHANGED
|
@@ -18849,8 +18849,31 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
|
|
|
18849
18849
|
return Promise.reject(e);
|
|
18850
18850
|
}
|
|
18851
18851
|
};
|
|
18852
|
+
var updateMessage$1 = function updateMessage(actionType, pending, channel, scrollToNewMessage) {
|
|
18853
|
+
if (scrollToNewMessage === void 0) {
|
|
18854
|
+
scrollToNewMessage = true;
|
|
18855
|
+
}
|
|
18856
|
+
try {
|
|
18857
|
+
var activeChannelId = getActiveChannelId();
|
|
18858
|
+
if (actionType !== RESEND_MESSAGE) {
|
|
18859
|
+
addMessageToMap(channel.id, pending);
|
|
18860
|
+
if (activeChannelId === channel.id) {
|
|
18861
|
+
addAllMessages([pending], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
18862
|
+
}
|
|
18863
|
+
if (activeChannelId === channel.id) {
|
|
18864
|
+
store.dispatch(addMessageAC(pending));
|
|
18865
|
+
}
|
|
18866
|
+
if (scrollToNewMessage) {
|
|
18867
|
+
store.dispatch(scrollToNewMessageAC(true));
|
|
18868
|
+
}
|
|
18869
|
+
}
|
|
18870
|
+
return Promise.resolve();
|
|
18871
|
+
} catch (e) {
|
|
18872
|
+
return Promise.reject(e);
|
|
18873
|
+
}
|
|
18874
|
+
};
|
|
18852
18875
|
function sendMessage(action) {
|
|
18853
|
-
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, isAddToPendingMessagesMap, pendingMessages, channel, SceytChatClient, createChannelData, mentionedUserIds, customUploader, linkAttachment, attachmentsToSend, messagesToSend, mediaAttachments, _loop, i, messageBuilder, messageToSend, _loop2, _i, _t2;
|
|
18876
|
+
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, isAddToPendingMessagesMap, pendingMessages, channel, SceytChatClient, createChannelData, mentionedUserIds, customUploader, linkAttachment, attachmentsToSend, messagesToSend, mediaAttachments, _loop, i, messageBuilder, messageToSend, pending, _loop2, _i, _t2;
|
|
18854
18877
|
return _regenerator().w(function (_context3) {
|
|
18855
18878
|
while (1) switch (_context3.p = _context3.n) {
|
|
18856
18879
|
case 0:
|
|
@@ -18917,7 +18940,7 @@ function sendMessage(action) {
|
|
|
18917
18940
|
break;
|
|
18918
18941
|
}
|
|
18919
18942
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
18920
|
-
var attachment, uri, attachmentBuilder, messageAttachment, handleUpdateUploadProgress, _messageBuilder, _messageToSend, messageForSend;
|
|
18943
|
+
var attachment, uri, attachmentBuilder, messageAttachment, handleUpdateUploadProgress, _messageBuilder, _messageToSend, messageForSend, _pending;
|
|
18921
18944
|
return _regenerator().w(function (_context) {
|
|
18922
18945
|
while (1) switch (_context.n) {
|
|
18923
18946
|
case 0:
|
|
@@ -18982,9 +19005,12 @@ function sendMessage(action) {
|
|
|
18982
19005
|
createdAt: new Date(Date.now())
|
|
18983
19006
|
});
|
|
18984
19007
|
messagesToSend.push(messageForSend);
|
|
18985
|
-
|
|
18986
|
-
attachments: [attachment]
|
|
18987
|
-
|
|
19008
|
+
_pending = _extends({}, messageForSend, {
|
|
19009
|
+
attachments: [attachment],
|
|
19010
|
+
createdAt: new Date(Date.now())
|
|
19011
|
+
});
|
|
19012
|
+
pendingMessages.push(_pending);
|
|
19013
|
+
updateMessage$1(action.type, _pending, channel);
|
|
18988
19014
|
} else {
|
|
18989
19015
|
attachmentsToSend.push(messageAttachment);
|
|
18990
19016
|
}
|
|
@@ -19021,9 +19047,12 @@ function sendMessage(action) {
|
|
|
19021
19047
|
messageBuilder.setReplyInThread();
|
|
19022
19048
|
}
|
|
19023
19049
|
messageToSend = action.type === RESEND_MESSAGE ? action.payload.message : messageBuilder.create();
|
|
19024
|
-
|
|
19025
|
-
attachments: message.attachments
|
|
19026
|
-
|
|
19050
|
+
pending = _extends({}, messageToSend, {
|
|
19051
|
+
attachments: message.attachments,
|
|
19052
|
+
createdAt: new Date(Date.now())
|
|
19053
|
+
});
|
|
19054
|
+
pendingMessages.push(pending);
|
|
19055
|
+
updateMessage$1(action.type, pending, channel);
|
|
19027
19056
|
messageToSend = _extends({}, messageToSend, {
|
|
19028
19057
|
attachments: attachmentsToSend
|
|
19029
19058
|
});
|
|
@@ -19031,7 +19060,7 @@ function sendMessage(action) {
|
|
|
19031
19060
|
}
|
|
19032
19061
|
case 11:
|
|
19033
19062
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
19034
|
-
var messageAttachment, messageToSend, messageCopy,
|
|
19063
|
+
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, messageToUpdate, channelUpdateParam, pendingMessage, _t;
|
|
19035
19064
|
return _regenerator().w(function (_context2) {
|
|
19036
19065
|
while (1) switch (_context2.p = _context2.n) {
|
|
19037
19066
|
case 0:
|
|
@@ -19039,23 +19068,6 @@ function sendMessage(action) {
|
|
|
19039
19068
|
messageToSend = messagesToSend[_i];
|
|
19040
19069
|
_context2.p = 1;
|
|
19041
19070
|
messageCopy = JSON.parse(JSON.stringify(messagesToSend[_i]));
|
|
19042
|
-
activeChannelId = getActiveChannelId();
|
|
19043
|
-
if (action.type !== RESEND_MESSAGE) {
|
|
19044
|
-
addMessageToMap(channel.id, _extends({}, messageToSend, {
|
|
19045
|
-
createdAt: new Date(Date.now())
|
|
19046
|
-
}));
|
|
19047
|
-
if (activeChannelId === channel.id) {
|
|
19048
|
-
addAllMessages([_extends({}, messageToSend, {
|
|
19049
|
-
createdAt: new Date(Date.now())
|
|
19050
|
-
})], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19051
|
-
}
|
|
19052
|
-
if (activeChannelId === channel.id) {
|
|
19053
|
-
store.dispatch(addMessageAC(_extends({}, messageToSend, {
|
|
19054
|
-
createdAt: new Date(Date.now())
|
|
19055
|
-
})));
|
|
19056
|
-
}
|
|
19057
|
-
store.dispatch(scrollToNewMessageAC(true));
|
|
19058
|
-
}
|
|
19059
19071
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19060
19072
|
_context2.n = 12;
|
|
19061
19073
|
break;
|
|
@@ -19252,7 +19264,7 @@ function sendMessage(action) {
|
|
|
19252
19264
|
}, _marked$3, null, [[1, 15]]);
|
|
19253
19265
|
}
|
|
19254
19266
|
function sendTextMessage(action) {
|
|
19255
|
-
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, pendingMessage, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend,
|
|
19267
|
+
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, pendingMessage, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19256
19268
|
return _regenerator().w(function (_context4) {
|
|
19257
19269
|
while (1) switch (_context4.p = _context4.n) {
|
|
19258
19270
|
case 0:
|
|
@@ -19328,16 +19340,8 @@ function sendTextMessage(action) {
|
|
|
19328
19340
|
if (pendingMessage && pendingMessage.metadata) {
|
|
19329
19341
|
pendingMessage.metadata = JSON.parse(pendingMessage.metadata);
|
|
19330
19342
|
}
|
|
19331
|
-
if (
|
|
19332
|
-
|
|
19333
|
-
addMessageToMap(channel.id, pendingMessage);
|
|
19334
|
-
if (_activeChannelId === channel.id) {
|
|
19335
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19336
|
-
}
|
|
19337
|
-
if (_activeChannelId === channel.id) {
|
|
19338
|
-
store.dispatch(addMessageAC(pendingMessage));
|
|
19339
|
-
}
|
|
19340
|
-
store.dispatch(scrollToNewMessageAC(true));
|
|
19343
|
+
if (pendingMessage) {
|
|
19344
|
+
updateMessage$1(action.type, pendingMessage, channel);
|
|
19341
19345
|
}
|
|
19342
19346
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19343
19347
|
_context4.n = 15;
|
|
@@ -19569,14 +19573,8 @@ function forwardMessage(action) {
|
|
|
19569
19573
|
_context5.n = 8;
|
|
19570
19574
|
return put(getMessagesAC(channel));
|
|
19571
19575
|
case 8:
|
|
19572
|
-
if (
|
|
19573
|
-
|
|
19574
|
-
if (activeChannelId === channel.id) {
|
|
19575
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19576
|
-
}
|
|
19577
|
-
if (activeChannelId === channel.id) {
|
|
19578
|
-
store.dispatch(addMessageAC(pendingMessage));
|
|
19579
|
-
}
|
|
19576
|
+
if (pendingMessage) {
|
|
19577
|
+
updateMessage$1(action.type, pendingMessage, channel, false);
|
|
19580
19578
|
}
|
|
19581
19579
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19582
19580
|
_context5.n = 14;
|