sceyt-chat-react-uikit 1.8.8-beta.1 → 1.8.8-beta.3
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 +19 -9
- package/index.modern.js +19 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10468,17 +10468,21 @@ function setMessageToEditAC(message) {
|
|
|
10468
10468
|
message: message
|
|
10469
10469
|
});
|
|
10470
10470
|
}
|
|
10471
|
-
function loadLatestMessagesAC(channel, messageId, networkChanged, applyVisibleWindow) {
|
|
10471
|
+
function loadLatestMessagesAC(channel, messageId, networkChanged, applyVisibleWindow, forceLatestWindow) {
|
|
10472
10472
|
if (applyVisibleWindow === void 0) {
|
|
10473
10473
|
applyVisibleWindow = true;
|
|
10474
10474
|
}
|
|
10475
|
+
if (forceLatestWindow === void 0) {
|
|
10476
|
+
forceLatestWindow = false;
|
|
10477
|
+
}
|
|
10475
10478
|
return {
|
|
10476
10479
|
type: LOAD_LATEST_MESSAGES,
|
|
10477
10480
|
payload: {
|
|
10478
10481
|
channel: channel,
|
|
10479
10482
|
messageId: messageId,
|
|
10480
10483
|
networkChanged: networkChanged,
|
|
10481
|
-
applyVisibleWindow: applyVisibleWindow
|
|
10484
|
+
applyVisibleWindow: applyVisibleWindow,
|
|
10485
|
+
forceLatestWindow: forceLatestWindow
|
|
10482
10486
|
}
|
|
10483
10487
|
};
|
|
10484
10488
|
}
|
|
@@ -18649,7 +18653,7 @@ function loadDefaultMessages(action) {
|
|
|
18649
18653
|
}, _marked26, null, [[0, 34, 35, 37]]);
|
|
18650
18654
|
}
|
|
18651
18655
|
function getMessagesQuery(action) {
|
|
18652
|
-
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
18656
|
+
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, _action$payload5$forc, forceLatestWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
18653
18657
|
return _regenerator().w(function (_context33) {
|
|
18654
18658
|
while (1) switch (_context33.p = _context33.n) {
|
|
18655
18659
|
case 0:
|
|
@@ -18657,7 +18661,7 @@ function getMessagesQuery(action) {
|
|
|
18657
18661
|
_context33.n = 1;
|
|
18658
18662
|
return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
|
|
18659
18663
|
case 1:
|
|
18660
|
-
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl;
|
|
18664
|
+
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl, _action$payload5$forc = _action$payload5.forceLatestWindow, forceLatestWindow = _action$payload5$forc === void 0 ? false : _action$payload5$forc;
|
|
18661
18665
|
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
18662
18666
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
18663
18667
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
@@ -18699,7 +18703,7 @@ function getMessagesQuery(action) {
|
|
|
18699
18703
|
hasNext: false
|
|
18700
18704
|
};
|
|
18701
18705
|
appliedMessages = [];
|
|
18702
|
-
if (!(!networkChanged && channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
18706
|
+
if (!(!networkChanged && !forceLatestWindow && channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
18703
18707
|
_context33.n = 17;
|
|
18704
18708
|
break;
|
|
18705
18709
|
}
|
|
@@ -44600,7 +44604,7 @@ function useChatController(_ref5) {
|
|
|
44600
44604
|
};
|
|
44601
44605
|
return Promise.resolve(beginWindowPagedRequest(function () {
|
|
44602
44606
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
44603
|
-
dispatch(loadLatestMessagesAC(channelRef.current));
|
|
44607
|
+
dispatch(loadLatestMessagesAC(channelRef.current, undefined, undefined, true, true));
|
|
44604
44608
|
return;
|
|
44605
44609
|
}
|
|
44606
44610
|
dispatch(loadDefaultMessagesAC(channelRef.current));
|
|
@@ -45035,8 +45039,6 @@ function useChatController(_ref5) {
|
|
|
45035
45039
|
}
|
|
45036
45040
|
if (currentScrollTop <= historyEdgeScrollTop + PRELOAD_TRIGGER_PX) {
|
|
45037
45041
|
currentScrollTop = historyEdgeScrollTop;
|
|
45038
|
-
} else if (currentScrollTop >= latestEdgeScrollTop - PRELOAD_TRIGGER_PX) {
|
|
45039
|
-
currentScrollTop = latestEdgeScrollTop;
|
|
45040
45042
|
}
|
|
45041
45043
|
if (currentScrollTop !== container.scrollTop) {
|
|
45042
45044
|
setScrollTop(container, currentScrollTop, 'auto');
|
|
@@ -50781,7 +50783,15 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
50781
50783
|
if (messageBodyAttributes && messageBodyAttributes.length) {
|
|
50782
50784
|
messageBodyAttributes.forEach(function (att) {
|
|
50783
50785
|
if (att.type === 'mention') {
|
|
50784
|
-
|
|
50786
|
+
var mentionsToFind = [].concat(mentionedUsers);
|
|
50787
|
+
var draftMessage = getDraftMessageFromMap(activeChannel.id);
|
|
50788
|
+
if (draftMessage) {
|
|
50789
|
+
mentionsToFind = [].concat(draftMessage.mentionedUsers, mentionedUsers);
|
|
50790
|
+
}
|
|
50791
|
+
var mentionToAdd = mentionsToFind.find(function (mention) {
|
|
50792
|
+
return mention.id === att.metadata;
|
|
50793
|
+
});
|
|
50794
|
+
mentionUsersToSend.push(mentionToAdd || {
|
|
50785
50795
|
id: att.metadata
|
|
50786
50796
|
});
|
|
50787
50797
|
}
|
package/index.modern.js
CHANGED
|
@@ -10467,17 +10467,21 @@ function setMessageToEditAC(message) {
|
|
|
10467
10467
|
message: message
|
|
10468
10468
|
});
|
|
10469
10469
|
}
|
|
10470
|
-
function loadLatestMessagesAC(channel, messageId, networkChanged, applyVisibleWindow) {
|
|
10470
|
+
function loadLatestMessagesAC(channel, messageId, networkChanged, applyVisibleWindow, forceLatestWindow) {
|
|
10471
10471
|
if (applyVisibleWindow === void 0) {
|
|
10472
10472
|
applyVisibleWindow = true;
|
|
10473
10473
|
}
|
|
10474
|
+
if (forceLatestWindow === void 0) {
|
|
10475
|
+
forceLatestWindow = false;
|
|
10476
|
+
}
|
|
10474
10477
|
return {
|
|
10475
10478
|
type: LOAD_LATEST_MESSAGES,
|
|
10476
10479
|
payload: {
|
|
10477
10480
|
channel: channel,
|
|
10478
10481
|
messageId: messageId,
|
|
10479
10482
|
networkChanged: networkChanged,
|
|
10480
|
-
applyVisibleWindow: applyVisibleWindow
|
|
10483
|
+
applyVisibleWindow: applyVisibleWindow,
|
|
10484
|
+
forceLatestWindow: forceLatestWindow
|
|
10481
10485
|
}
|
|
10482
10486
|
};
|
|
10483
10487
|
}
|
|
@@ -18648,7 +18652,7 @@ function loadDefaultMessages(action) {
|
|
|
18648
18652
|
}, _marked26, null, [[0, 34, 35, 37]]);
|
|
18649
18653
|
}
|
|
18650
18654
|
function getMessagesQuery(action) {
|
|
18651
|
-
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
18655
|
+
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, _action$payload5$forc, forceLatestWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
18652
18656
|
return _regenerator().w(function (_context33) {
|
|
18653
18657
|
while (1) switch (_context33.p = _context33.n) {
|
|
18654
18658
|
case 0:
|
|
@@ -18656,7 +18660,7 @@ function getMessagesQuery(action) {
|
|
|
18656
18660
|
_context33.n = 1;
|
|
18657
18661
|
return call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
|
|
18658
18662
|
case 1:
|
|
18659
|
-
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl;
|
|
18663
|
+
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl, _action$payload5$forc = _action$payload5.forceLatestWindow, forceLatestWindow = _action$payload5$forc === void 0 ? false : _action$payload5$forc;
|
|
18660
18664
|
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
18661
18665
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
18662
18666
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
@@ -18698,7 +18702,7 @@ function getMessagesQuery(action) {
|
|
|
18698
18702
|
hasNext: false
|
|
18699
18703
|
};
|
|
18700
18704
|
appliedMessages = [];
|
|
18701
|
-
if (!(!networkChanged && channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
18705
|
+
if (!(!networkChanged && !forceLatestWindow && channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
18702
18706
|
_context33.n = 17;
|
|
18703
18707
|
break;
|
|
18704
18708
|
}
|
|
@@ -44599,7 +44603,7 @@ function useChatController(_ref5) {
|
|
|
44599
44603
|
};
|
|
44600
44604
|
return Promise.resolve(beginWindowPagedRequest(function () {
|
|
44601
44605
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
44602
|
-
dispatch(loadLatestMessagesAC(channelRef.current));
|
|
44606
|
+
dispatch(loadLatestMessagesAC(channelRef.current, undefined, undefined, true, true));
|
|
44603
44607
|
return;
|
|
44604
44608
|
}
|
|
44605
44609
|
dispatch(loadDefaultMessagesAC(channelRef.current));
|
|
@@ -45034,8 +45038,6 @@ function useChatController(_ref5) {
|
|
|
45034
45038
|
}
|
|
45035
45039
|
if (currentScrollTop <= historyEdgeScrollTop + PRELOAD_TRIGGER_PX) {
|
|
45036
45040
|
currentScrollTop = historyEdgeScrollTop;
|
|
45037
|
-
} else if (currentScrollTop >= latestEdgeScrollTop - PRELOAD_TRIGGER_PX) {
|
|
45038
|
-
currentScrollTop = latestEdgeScrollTop;
|
|
45039
45041
|
}
|
|
45040
45042
|
if (currentScrollTop !== container.scrollTop) {
|
|
45041
45043
|
setScrollTop(container, currentScrollTop, 'auto');
|
|
@@ -50780,7 +50782,15 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
50780
50782
|
if (messageBodyAttributes && messageBodyAttributes.length) {
|
|
50781
50783
|
messageBodyAttributes.forEach(function (att) {
|
|
50782
50784
|
if (att.type === 'mention') {
|
|
50783
|
-
|
|
50785
|
+
var mentionsToFind = [].concat(mentionedUsers);
|
|
50786
|
+
var draftMessage = getDraftMessageFromMap(activeChannel.id);
|
|
50787
|
+
if (draftMessage) {
|
|
50788
|
+
mentionsToFind = [].concat(draftMessage.mentionedUsers, mentionedUsers);
|
|
50789
|
+
}
|
|
50790
|
+
var mentionToAdd = mentionsToFind.find(function (mention) {
|
|
50791
|
+
return mention.id === att.metadata;
|
|
50792
|
+
});
|
|
50793
|
+
mentionUsersToSend.push(mentionToAdd || {
|
|
50784
50794
|
id: att.metadata
|
|
50785
50795
|
});
|
|
50786
50796
|
}
|