sceyt-chat-react-uikit 1.6.8-beta.9 → 1.6.9
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/components/Channel/index.d.ts +1 -0
- package/components/Message/Message.types.d.ts +2 -0
- package/components/Message/MessageBody/index.d.ts +3 -1
- package/components/Message/index.d.ts +1 -1
- package/components/Messages/MessageList/index.d.ts +5 -1
- package/components/Messages/index.d.ts +1 -0
- package/components/MessagesScrollToBottomButton/index.d.ts +1 -0
- package/components/MessagesScrollToUnreadMentionsButton/index.d.ts +1 -0
- package/index.js +452 -265
- package/index.modern.js +452 -265
- package/messageUtils/index.d.ts +4 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7692,6 +7692,7 @@ var DELETE_REACTION = 'DELETE_REACTION';
|
|
|
7692
7692
|
var SET_SCROLL_TO_NEW_MESSAGE = 'SET_SCROLL_TO_NEW_MESSAGE';
|
|
7693
7693
|
var SET_SHOW_SCROLL_TO_NEW_MESSAGE_BUTTON = 'SET_SHOW_SCROLL_TO_NEW_MESSAGE_BUTTON';
|
|
7694
7694
|
var SET_MESSAGE_MENU_OPENED = 'SET_MESSAGE_MENU_OPENED';
|
|
7695
|
+
var SET_SCROLL_TO_MENTIONED_MESSAGE = 'SET_SCROLL_TO_MENTIONED_MESSAGE';
|
|
7695
7696
|
var queryDirection = {
|
|
7696
7697
|
PREV: 'prev',
|
|
7697
7698
|
NEXT: 'next',
|
|
@@ -8290,9 +8291,6 @@ function checkChannelExistsOnMessagesMap(channelId) {
|
|
|
8290
8291
|
return !!messagesMap[channelId];
|
|
8291
8292
|
}
|
|
8292
8293
|
var pendingVideoAttachmentsThumbs = {};
|
|
8293
|
-
var setVideoThumb = function setVideoThumb(attachmentId, thumb) {
|
|
8294
|
-
pendingVideoAttachmentsThumbs[attachmentId] = thumb;
|
|
8295
|
-
};
|
|
8296
8294
|
var getVideoThumb = function getVideoThumb(attachmentId) {
|
|
8297
8295
|
return pendingVideoAttachmentsThumbs[attachmentId];
|
|
8298
8296
|
};
|
|
@@ -8395,6 +8393,7 @@ var initialState$1 = {
|
|
|
8395
8393
|
messageForReply: null,
|
|
8396
8394
|
attachmentsUploadingState: {},
|
|
8397
8395
|
scrollToMessage: null,
|
|
8396
|
+
scrollToMentionedMessage: false,
|
|
8398
8397
|
reactionsList: [],
|
|
8399
8398
|
reactionsHasNext: true,
|
|
8400
8399
|
reactionsLoadingState: null,
|
|
@@ -8437,6 +8436,11 @@ var MessageReducer = (function (state, _temp) {
|
|
|
8437
8436
|
newState.scrollToMessage = payload.messageId;
|
|
8438
8437
|
return newState;
|
|
8439
8438
|
}
|
|
8439
|
+
case SET_SCROLL_TO_MENTIONED_MESSAGE:
|
|
8440
|
+
{
|
|
8441
|
+
newState.scrollToMentionedMessage = payload.isScrollToMentionedMessage;
|
|
8442
|
+
return newState;
|
|
8443
|
+
}
|
|
8440
8444
|
case SET_SCROLL_TO_NEW_MESSAGE:
|
|
8441
8445
|
{
|
|
8442
8446
|
newState.scrollToNewMessage = {
|
|
@@ -9205,8 +9209,8 @@ var defaultTheme = {
|
|
|
9205
9209
|
light: '#C8D0FF',
|
|
9206
9210
|
dark: '#3B3D68'
|
|
9207
9211
|
}, _colors[THEME_COLORS.TOOLTIP_BACKGROUND] = {
|
|
9208
|
-
light: '#
|
|
9209
|
-
dark: '#
|
|
9212
|
+
light: '#111539E5',
|
|
9213
|
+
dark: '#000000E5'
|
|
9210
9214
|
}, _colors)
|
|
9211
9215
|
};
|
|
9212
9216
|
var defaultThemeMode = 'light';
|
|
@@ -9863,6 +9867,14 @@ function setScrollToMessagesAC(messageId) {
|
|
|
9863
9867
|
}
|
|
9864
9868
|
};
|
|
9865
9869
|
}
|
|
9870
|
+
function setScrollToMentionedMessageAC(isScrollToMentionedMessage) {
|
|
9871
|
+
return {
|
|
9872
|
+
type: SET_SCROLL_TO_MENTIONED_MESSAGE,
|
|
9873
|
+
payload: {
|
|
9874
|
+
isScrollToMentionedMessage: isScrollToMentionedMessage
|
|
9875
|
+
}
|
|
9876
|
+
};
|
|
9877
|
+
}
|
|
9866
9878
|
function setMessagesLoadingStateAC(state) {
|
|
9867
9879
|
return {
|
|
9868
9880
|
type: SET_MESSAGES_LOADING_STATE,
|
|
@@ -10627,6 +10639,9 @@ var messageToEditSelector = function messageToEditSelector(store) {
|
|
|
10627
10639
|
var scrollToNewMessageSelector = function scrollToNewMessageSelector(store) {
|
|
10628
10640
|
return store.MessageReducer.scrollToNewMessage;
|
|
10629
10641
|
};
|
|
10642
|
+
var scrollToMentionedMessageSelector = function scrollToMentionedMessageSelector(store) {
|
|
10643
|
+
return store.MessageReducer.scrollToMentionedMessage;
|
|
10644
|
+
};
|
|
10630
10645
|
var showScrollToNewMessageButtonSelector = function showScrollToNewMessageButtonSelector(store) {
|
|
10631
10646
|
return store.MessageReducer.showScrollToNewMessageButton;
|
|
10632
10647
|
};
|
|
@@ -10770,6 +10785,10 @@ var setAvatarColor = function setAvatarColor(colors) {
|
|
|
10770
10785
|
};
|
|
10771
10786
|
};
|
|
10772
10787
|
var getAvatarColors = function getAvatarColors(theme) {
|
|
10788
|
+
var _avatarColors$theme;
|
|
10789
|
+
if (!((_avatarColors$theme = _avatarColors[theme]) !== null && _avatarColors$theme !== void 0 && _avatarColors$theme.length)) {
|
|
10790
|
+
return _avatarColors.light;
|
|
10791
|
+
}
|
|
10773
10792
|
return _avatarColors[theme];
|
|
10774
10793
|
};
|
|
10775
10794
|
|
|
@@ -11171,7 +11190,7 @@ var UploadAvatarButton = styled__default.button(_templateObject24 || (_templateO
|
|
|
11171
11190
|
var UploadAvatarHandler = styled__default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteralLoose(["\n margin-left: 18px;\n font-size: 13px;\n color: ", ";\n"])), function (props) {
|
|
11172
11191
|
return props.color;
|
|
11173
11192
|
});
|
|
11174
|
-
var StyledText = styled__default.span(_templateObject26 || (_templateObject26 = _taggedTemplateLiteralLoose(["\n font-weight: ", ";\n font-family: ", ";\n font-style: ", ";\n text-decoration: ", ";\n letter-spacing: ", ";\n\n &.mention {\n color: ", ";\n font-weight: ", ";\n }\n &.bold {\n font-weight: 600;\n }\n &.italic {\n font-style: italic;\n }\n &.underline {\n text-decoration: underline;\n }\n &.strikethrough {\n text-decoration: line-through;\n }\n &.underline.strikethrough {\n text-decoration: underline line-through;\n }\n &.monospace {\n letter-spacing: 4px;\n }\n"])), function (props) {
|
|
11193
|
+
var StyledText = styled__default.span(_templateObject26 || (_templateObject26 = _taggedTemplateLiteralLoose(["\n font-weight: ", ";\n font-family: ", ";\n font-style: ", ";\n text-decoration: ", ";\n letter-spacing: ", ";\n\n &.mention {\n color: ", ";\n font-weight: ", ";\n cursor: ", ";\n }\n &.bold {\n font-weight: 600;\n }\n &.italic {\n font-style: italic;\n }\n &.underline {\n text-decoration: underline;\n }\n &.strikethrough {\n text-decoration: line-through;\n }\n &.underline.strikethrough {\n text-decoration: underline line-through;\n }\n &.monospace {\n letter-spacing: 4px;\n }\n"])), function (props) {
|
|
11175
11194
|
return props.fontWeight || props.isLastMessage && '500';
|
|
11176
11195
|
}, function (props) {
|
|
11177
11196
|
return props.fontFamily;
|
|
@@ -11185,6 +11204,8 @@ var StyledText = styled__default.span(_templateObject26 || (_templateObject26 =
|
|
|
11185
11204
|
return props.color;
|
|
11186
11205
|
}, function (props) {
|
|
11187
11206
|
return props.isLastMessage && '500';
|
|
11207
|
+
}, function (props) {
|
|
11208
|
+
return props.shouldOpenUserProfileForMention && 'pointer';
|
|
11188
11209
|
});
|
|
11189
11210
|
var MessageOwner = styled__default.h3(_templateObject27 || (_templateObject27 = _taggedTemplateLiteralLoose(["\n margin: 0 12px 4px 0;\n white-space: nowrap;\n color: ", ";\n margin-left: ", ";\n font-weight: 500;\n font-size: ", ";\n line-height: ", ";\n cursor: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (props) {
|
|
11190
11211
|
return props.color;
|
|
@@ -11430,7 +11451,9 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11430
11451
|
isLastMessage = _ref2.isLastMessage,
|
|
11431
11452
|
asSampleText = _ref2.asSampleText,
|
|
11432
11453
|
accentColor = _ref2.accentColor,
|
|
11433
|
-
textSecondary = _ref2.textSecondary
|
|
11454
|
+
textSecondary = _ref2.textSecondary,
|
|
11455
|
+
onMentionNameClick = _ref2.onMentionNameClick,
|
|
11456
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention;
|
|
11434
11457
|
try {
|
|
11435
11458
|
var messageText = [];
|
|
11436
11459
|
var linkify = new LinkifyIt();
|
|
@@ -11475,12 +11498,18 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11475
11498
|
className: "" + combinedAttributesList[index - 1].type,
|
|
11476
11499
|
isLastMessage: isLastMessage,
|
|
11477
11500
|
key: attributeOffset + index,
|
|
11478
|
-
color: isLastMessage ? textSecondary : accentColor
|
|
11501
|
+
color: isLastMessage ? textSecondary : accentColor,
|
|
11502
|
+
shouldOpenUserProfileForMention: onMentionNameClick && shouldOpenUserProfileForMention
|
|
11479
11503
|
}, firsTextPart, /*#__PURE__*/React__default.createElement(StyledText, {
|
|
11480
11504
|
className: 'mention',
|
|
11481
11505
|
isLastMessage: isLastMessage,
|
|
11482
11506
|
color: isLastMessage ? textSecondary : accentColor,
|
|
11483
|
-
key: attributeOffset + index
|
|
11507
|
+
key: attributeOffset + index,
|
|
11508
|
+
onClick: function onClick() {
|
|
11509
|
+
if (onMentionNameClick && shouldOpenUserProfileForMention) {
|
|
11510
|
+
onMentionNameClick(mentionDisplay);
|
|
11511
|
+
}
|
|
11512
|
+
}
|
|
11484
11513
|
}, mentionDisplayName), secondTextPart)), index === combinedAttributesList.length - 1 ? secondPart : '');
|
|
11485
11514
|
} else {
|
|
11486
11515
|
nextPartIndex = attribute.offset + attribute.length;
|
|
@@ -11488,7 +11517,13 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
|
|
|
11488
11517
|
className: attribute.type,
|
|
11489
11518
|
isLastMessage: isLastMessage,
|
|
11490
11519
|
color: isLastMessage ? textSecondary : accentColor,
|
|
11491
|
-
key: attributeOffset
|
|
11520
|
+
key: attributeOffset,
|
|
11521
|
+
onClick: function onClick() {
|
|
11522
|
+
if (onMentionNameClick && shouldOpenUserProfileForMention) {
|
|
11523
|
+
onMentionNameClick(mentionDisplay);
|
|
11524
|
+
}
|
|
11525
|
+
},
|
|
11526
|
+
shouldOpenUserProfileForMention: onMentionNameClick && shouldOpenUserProfileForMention
|
|
11492
11527
|
}, mentionDisplayName)), index === combinedAttributesList.length - 1 ? secondPart : '');
|
|
11493
11528
|
}
|
|
11494
11529
|
} else {
|
|
@@ -13847,30 +13882,31 @@ function getChannelMentions(action) {
|
|
|
13847
13882
|
mentionsQueryBuilder = new SceytChatClient.MentionsListQueryBuilder();
|
|
13848
13883
|
mentionsQueryBuilder.setChannelId(channelId);
|
|
13849
13884
|
mentionsQueryBuilder.limit(10);
|
|
13850
|
-
|
|
13885
|
+
mentionsQueryBuilder.setDirection(queryDirection.NEXT);
|
|
13886
|
+
_context7.next = 10;
|
|
13851
13887
|
return effects.call(mentionsQueryBuilder.build);
|
|
13852
|
-
case
|
|
13888
|
+
case 10:
|
|
13853
13889
|
mentionsQuery = _context7.sent;
|
|
13854
|
-
_context7.next =
|
|
13890
|
+
_context7.next = 13;
|
|
13855
13891
|
return effects.call(mentionsQuery.loadNext);
|
|
13856
|
-
case
|
|
13892
|
+
case 13:
|
|
13857
13893
|
mentions = _context7.sent;
|
|
13858
|
-
_context7.next =
|
|
13894
|
+
_context7.next = 16;
|
|
13859
13895
|
return effects.put(updateChannelDataAC(channelId, {
|
|
13860
13896
|
mentionsIds: mentions.mentions
|
|
13861
13897
|
}));
|
|
13862
|
-
case
|
|
13863
|
-
_context7.next =
|
|
13898
|
+
case 16:
|
|
13899
|
+
_context7.next = 21;
|
|
13864
13900
|
break;
|
|
13865
|
-
case
|
|
13866
|
-
_context7.prev =
|
|
13901
|
+
case 18:
|
|
13902
|
+
_context7.prev = 18;
|
|
13867
13903
|
_context7.t0 = _context7["catch"](0);
|
|
13868
13904
|
log.error(_context7.t0, 'Error in get channel mentions');
|
|
13869
|
-
case
|
|
13905
|
+
case 21:
|
|
13870
13906
|
case "end":
|
|
13871
13907
|
return _context7.stop();
|
|
13872
13908
|
}
|
|
13873
|
-
}, _marked7, null, [[0,
|
|
13909
|
+
}, _marked7, null, [[0, 18]]);
|
|
13874
13910
|
}
|
|
13875
13911
|
function channelsForForwardLoadMore(action) {
|
|
13876
13912
|
var payload, limit, SceytChatClient, channelQueryForward, channelsData, channelsToAdd, _yield$call4, mappedChannels;
|
|
@@ -15490,21 +15526,6 @@ var addData = function addData(db, storeName, keyPath, data) {
|
|
|
15490
15526
|
}
|
|
15491
15527
|
};
|
|
15492
15528
|
|
|
15493
|
-
var getFrame3 = function getFrame3(video, time) {
|
|
15494
|
-
try {
|
|
15495
|
-
var canvas = document.createElement('canvas');
|
|
15496
|
-
canvas.width = video.videoWidth;
|
|
15497
|
-
canvas.height = video.videoHeight;
|
|
15498
|
-
var ctx = canvas.getContext('2d');
|
|
15499
|
-
if (time) {
|
|
15500
|
-
video.currentTime = time;
|
|
15501
|
-
}
|
|
15502
|
-
ctx.drawImage(video, 0, 0);
|
|
15503
|
-
return Promise.resolve(createImageThumbnail(null, canvas.toDataURL(), 10, 10));
|
|
15504
|
-
} catch (e) {
|
|
15505
|
-
return Promise.reject(e);
|
|
15506
|
-
}
|
|
15507
|
-
};
|
|
15508
15529
|
var getFrame = function getFrame(videoSrc, time) {
|
|
15509
15530
|
try {
|
|
15510
15531
|
var video = document.createElement('video');
|
|
@@ -18732,20 +18753,25 @@ var useStateComplex = function useStateComplex(initialState) {
|
|
|
18732
18753
|
}];
|
|
18733
18754
|
};
|
|
18734
18755
|
|
|
18735
|
-
function useOnScreen(ref) {
|
|
18756
|
+
function useOnScreen(ref, rootElement) {
|
|
18736
18757
|
var _useState = React.useState(false),
|
|
18737
18758
|
isIntersecting = _useState[0],
|
|
18738
18759
|
setIntersecting = _useState[1];
|
|
18739
|
-
var observer = new IntersectionObserver(function (_ref) {
|
|
18740
|
-
var entry = _ref[0];
|
|
18741
|
-
return setIntersecting(entry.isIntersecting);
|
|
18742
|
-
});
|
|
18743
18760
|
React.useEffect(function () {
|
|
18761
|
+
if (!(ref !== null && ref !== void 0 && ref.current)) return;
|
|
18762
|
+
var observer = new IntersectionObserver(function (_ref) {
|
|
18763
|
+
var entry = _ref[0];
|
|
18764
|
+
return setIntersecting(entry.isIntersecting);
|
|
18765
|
+
}, {
|
|
18766
|
+
root: rootElement || null,
|
|
18767
|
+
rootMargin: '0px',
|
|
18768
|
+
threshold: 0.1
|
|
18769
|
+
});
|
|
18744
18770
|
observer.observe(ref.current);
|
|
18745
18771
|
return function () {
|
|
18746
18772
|
observer.disconnect();
|
|
18747
18773
|
};
|
|
18748
|
-
}, []);
|
|
18774
|
+
}, [ref, rootElement]);
|
|
18749
18775
|
return isIntersecting;
|
|
18750
18776
|
}
|
|
18751
18777
|
|
|
@@ -19469,7 +19495,7 @@ var DeletedAvatarWrapper = styled__default(SvgDeletedUserAvatar)(_templateObject
|
|
|
19469
19495
|
return props.color;
|
|
19470
19496
|
});
|
|
19471
19497
|
|
|
19472
|
-
var _templateObject$4, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$2, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject0$1, _templateObject1$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1;
|
|
19498
|
+
var _templateObject$4, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$2, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject0$1, _templateObject1$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20$1;
|
|
19473
19499
|
var ChannelMessageText = function ChannelMessageText(_ref) {
|
|
19474
19500
|
var isTypingOrRecording = _ref.isTypingOrRecording,
|
|
19475
19501
|
textPrimary = _ref.textPrimary,
|
|
@@ -19492,7 +19518,7 @@ var ChannelMessageText = function ChannelMessageText(_ref) {
|
|
|
19492
19518
|
return mem === user.id ? ' You' : " " + systemMessageUserName(mem, contactsMap && contactsMap[mem], lastMessage.mentionedUsers);
|
|
19493
19519
|
})) + " " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.length > 5 ? "and " + (lastMessageMetas.m.length - 5) + " more" : '') : lastMessage.body === 'RM' ? " removed " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.slice(0, 5).map(function (mem) {
|
|
19494
19520
|
return mem === user.id ? ' You' : " " + systemMessageUserName(mem, contactsMap && contactsMap[mem], lastMessage.mentionedUsers);
|
|
19495
|
-
})) + " " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.length > 5 ? "and " + (lastMessageMetas.m.length - 5) + " more" : '') : lastMessage.body === 'LG' ? 'Left this group' : '') : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channel.lastReactedMessage && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Reacted", /*#__PURE__*/React__default.createElement(ReactionItem, null, channel.newReactions && channel.newReactions[0] && channel.newReactions[0].key), "to", ' "')), !!(lastMessage.attachments && lastMessage.attachments.length) && (lastMessage.attachments[0].type === attachmentTypes.image ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgPicture, null), lastMessage.body ? '' : 'Photo')) : lastMessage.attachments[0].type === attachmentTypes.video ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgVideoCall, null), lastMessage.body ? '' : 'Video')) : lastMessage.attachments[0].type === attachmentTypes.file ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgChoseFile, null), lastMessage.body ? '' : 'File')) : lastMessage.attachments[0].type === attachmentTypes.voice ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgVoiceIcon, null), lastMessage.body ? '' : 'Voice')) : null), !!(lastMessage && lastMessage.id) && MessageTextFormat({
|
|
19521
|
+
})) + " " + (lastMessageMetas && lastMessageMetas.m && lastMessageMetas.m.length > 5 ? "and " + (lastMessageMetas.m.length - 5) + " more" : '') : lastMessage.body === 'LG' ? 'Left this group' : '') : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channel.lastReactedMessage && (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Reacted", /*#__PURE__*/React__default.createElement(ReactionItem, null, channel.newReactions && channel.newReactions[0] && channel.newReactions[0].key), "to", ' "')), !!(lastMessage.attachments && lastMessage.attachments.length) && (lastMessage.attachments[0].type === attachmentTypes.image ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgPicture, null), lastMessage.body ? '' : 'Photo')) : lastMessage.attachments[0].type === attachmentTypes.video ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgVideoCall, null), lastMessage.body ? '' : 'Video')) : lastMessage.attachments[0].type === attachmentTypes.file ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgChoseFile, null), lastMessage.body ? '' : 'File')) : lastMessage.attachments[0].type === attachmentTypes.voice ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SvgVoiceIcon, null), lastMessage.body ? '' : 'Voice')) : null), /*#__PURE__*/React__default.createElement(LastMessageDescription, null, !!(lastMessage && lastMessage.id) && MessageTextFormat({
|
|
19496
19522
|
text: lastMessage.body,
|
|
19497
19523
|
message: lastMessage,
|
|
19498
19524
|
contactsMap: contactsMap,
|
|
@@ -19500,7 +19526,7 @@ var ChannelMessageText = function ChannelMessageText(_ref) {
|
|
|
19500
19526
|
isLastMessage: true,
|
|
19501
19527
|
accentColor: accentColor,
|
|
19502
19528
|
textSecondary: textSecondary
|
|
19503
|
-
}), channel.lastReactedMessage && '"'))));
|
|
19529
|
+
})), channel.lastReactedMessage && '"'))));
|
|
19504
19530
|
};
|
|
19505
19531
|
var Channel = function Channel(_ref2) {
|
|
19506
19532
|
var _channel$metadata, _channel$metadata2;
|
|
@@ -19703,7 +19729,7 @@ var Channel = function Channel(_ref2) {
|
|
|
19703
19729
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
19704
19730
|
ref: messageAuthorRef
|
|
19705
19731
|
}, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !isTypingOrRecording && (isDirectChannel ? !isTypingOrRecording && (draftMessageText || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id)) : isTypingOrRecording && draftMessageText || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== 'system') && (/*#__PURE__*/React__default.createElement(Points, {
|
|
19706
|
-
color: draftMessageText && warningColor
|
|
19732
|
+
color: draftMessageText && warningColor || textPrimary
|
|
19707
19733
|
}, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
|
|
19708
19734
|
color: textSecondary,
|
|
19709
19735
|
withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && !isTypingOrRecording,
|
|
@@ -19804,7 +19830,7 @@ var LastMessageAuthor = styled__default.div(_templateObject9$1 || (_templateObje
|
|
|
19804
19830
|
var Points = styled__default.span(_templateObject0$1 || (_templateObject0$1 = _taggedTemplateLiteralLoose(["\n margin-right: 4px;\n color: ", ";\n"])), function (props) {
|
|
19805
19831
|
return props.color;
|
|
19806
19832
|
});
|
|
19807
|
-
var LastMessageText = styled__default.span(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-style: ", ";\n transform: ", ";\n //height: 20px;\n\n > svg {\n width: 16px;\n height: 16px;\n
|
|
19833
|
+
var LastMessageText = styled__default.span(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-style: ", ";\n transform: ", ";\n //height: 20px;\n\n > svg {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n margin-right: 4px;\n color: ", ";\n transform: translate(0px, 3px);\n }\n & > span {\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n }\n & > div {\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n & > svg {\n width: 18px;\n height: 18px;\n min-width: 18px;\n min-height: 18px;\n color: ", ";\n }\n }\n"])), function (props) {
|
|
19808
19834
|
return props.color;
|
|
19809
19835
|
}, function (props) {
|
|
19810
19836
|
return props.deletedMessage && 'italic';
|
|
@@ -19813,28 +19839,29 @@ var LastMessageText = styled__default.span(_templateObject1$1 || (_templateObjec
|
|
|
19813
19839
|
}, function (props) {
|
|
19814
19840
|
return props.color;
|
|
19815
19841
|
}, function (props) {
|
|
19816
|
-
return props.
|
|
19842
|
+
return props.color;
|
|
19817
19843
|
});
|
|
19818
|
-
var
|
|
19844
|
+
var LastMessageDescription = styled__default.div(_templateObject10$1 || (_templateObject10$1 = _taggedTemplateLiteralLoose(["\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n"])));
|
|
19845
|
+
var ChannelStatus = styled__default.div(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteralLoose(["\n position: absolute;\n right: 16px;\n top: 15px;\n display: flex;\n flex-wrap: wrap;\n height: 42px;\n margin-left: auto;\n\n & > svg {\n width: 16px;\n height: 16px;\n color: ", ";\n }\n"])), function (props) {
|
|
19819
19846
|
return props.color;
|
|
19820
19847
|
});
|
|
19821
|
-
var LastMessageDate = styled__default.span(
|
|
19848
|
+
var LastMessageDate = styled__default.span(_templateObject12$1 || (_templateObject12$1 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-size: ", ";\n line-height: 16px;\n"])), function (props) {
|
|
19822
19849
|
return props.color;
|
|
19823
19850
|
}, function (props) {
|
|
19824
19851
|
return props.fontSize || '12px';
|
|
19825
19852
|
});
|
|
19826
|
-
var DeliveryIconCont = styled__default.span(
|
|
19827
|
-
var UnreadMentionIconWrapper = styled__default.span(
|
|
19853
|
+
var DeliveryIconCont = styled__default.span(_templateObject13$1 || (_templateObject13$1 = _taggedTemplateLiteralLoose(["\n margin-right: 6px;\n line-height: 13px;\n"])));
|
|
19854
|
+
var UnreadMentionIconWrapper = styled__default.span(_templateObject14$1 || (_templateObject14$1 = _taggedTemplateLiteralLoose(["\n margin-right: ", ";\n line-height: 13px;\n\n & > svg {\n color: ", ";\n }\n"])), function (props) {
|
|
19828
19855
|
return props.rightMargin && '8px';
|
|
19829
19856
|
}, function (props) {
|
|
19830
19857
|
return props.iconColor;
|
|
19831
19858
|
});
|
|
19832
|
-
var TypingIndicator = styled__default.span(
|
|
19833
|
-
var ReactionItem = styled__default.span(
|
|
19834
|
-
var UnreadInfo = styled__default.span(
|
|
19859
|
+
var TypingIndicator = styled__default.span(_templateObject15$1 || (_templateObject15$1 = _taggedTemplateLiteralLoose(["\n font-style: italic;\n"])));
|
|
19860
|
+
var ReactionItem = styled__default.span(_templateObject16$1 || (_templateObject16$1 = _taggedTemplateLiteralLoose(["\n font-family:\n apple color emoji,\n segoe ui emoji,\n noto color emoji,\n android emoji,\n emojisymbols,\n emojione mozilla,\n twemoji mozilla,\n segoe ui symbol;\n padding: 0 3px;\n"])));
|
|
19861
|
+
var UnreadInfo = styled__default.span(_templateObject17$1 || (_templateObject17$1 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: ", ";\n right: 16px;\n display: flex;\n margin-top: 7px;\n align-items: center;\n flex: 0 0 auto;\n margin-left: auto;\n"])), function (props) {
|
|
19835
19862
|
return props.bottom || '11px';
|
|
19836
19863
|
});
|
|
19837
|
-
var UnreadCount = styled__default.span(
|
|
19864
|
+
var UnreadCount = styled__default.span(_templateObject18$1 || (_templateObject18$1 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n padding: 0 4px;\n font-size: ", ";\n min-width: ", ";\n height: ", ";\n text-align: center;\n font-weight: 500;\n color: ", ";\n border-radius: 10px;\n box-sizing: border-box;\n\n ", "\n"])), function (props) {
|
|
19838
19865
|
return props.backgroundColor;
|
|
19839
19866
|
}, function (props) {
|
|
19840
19867
|
return props.fontSize || '13px';
|
|
@@ -19847,10 +19874,10 @@ var UnreadCount = styled__default.span(_templateObject17$1 || (_templateObject17
|
|
|
19847
19874
|
}, function (props) {
|
|
19848
19875
|
return props.isMuted && "background-color: " + props.mutedBackgroundColor + ";";
|
|
19849
19876
|
});
|
|
19850
|
-
var PinnedIconWrapper = styled__default.span(
|
|
19877
|
+
var PinnedIconWrapper = styled__default.span(_templateObject19$1 || (_templateObject19$1 = _taggedTemplateLiteralLoose(["\n & > svg {\n color: ", ";\n }\n"])), function (props) {
|
|
19851
19878
|
return props.color;
|
|
19852
19879
|
});
|
|
19853
|
-
var MessageTextContainer = styled__default.div(
|
|
19880
|
+
var MessageTextContainer = styled__default.div(_templateObject20$1 || (_templateObject20$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n gap: 4px;\n"])));
|
|
19854
19881
|
|
|
19855
19882
|
var _templateObject$5, _templateObject2$5;
|
|
19856
19883
|
var SearchInputContainer = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n max-width: ", ";\n box-sizing: border-box;\n padding: ", ";\n\n & ", " {\n ", ";\n }\n"])), function (props) {
|
|
@@ -21660,7 +21687,7 @@ var UserNumber = styled__default.h4(_templateObject6$4 || (_templateObject6$4 =
|
|
|
21660
21687
|
|
|
21661
21688
|
var _templateObject$g, _templateObject2$e, _templateObject3$a, _templateObject4$8, _templateObject5$6, _templateObject6$5, _templateObject7$4, _templateObject8$4, _templateObject9$4, _templateObject0$3;
|
|
21662
21689
|
var ChannelList = function ChannelList(_ref) {
|
|
21663
|
-
var _channelListRef$curre2, _searchedChannels$cha, _searchedChannels$cha2, _searchedChannels$con, _searchedChannels$cha3, _searchedChannels$cha4, _searchedChannels$cha5, _searchedChannels$cha6;
|
|
21690
|
+
var _activeChannel$member, _channelListRef$curre2, _searchedChannels$cha, _searchedChannels$cha2, _searchedChannels$con, _searchedChannels$cha3, _searchedChannels$cha4, _searchedChannels$cha5, _searchedChannels$cha6;
|
|
21664
21691
|
var className = _ref.className,
|
|
21665
21692
|
selectedChannelBackground = _ref.selectedChannelBackground,
|
|
21666
21693
|
selectedChannelLeftBorder = _ref.selectedChannelLeftBorder,
|
|
@@ -21911,10 +21938,12 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
21911
21938
|
}, [searchValue]);
|
|
21912
21939
|
useDidUpdate(function () {
|
|
21913
21940
|
if (getSelectedChannel) {
|
|
21914
|
-
|
|
21941
|
+
if (!(activeChannel !== null && activeChannel !== void 0 && activeChannel.mentionsIds)) {
|
|
21942
|
+
dispatch(getChannelMentionsAC(activeChannel.id));
|
|
21943
|
+
}
|
|
21915
21944
|
getSelectedChannel(activeChannel);
|
|
21916
21945
|
}
|
|
21917
|
-
}, [activeChannel
|
|
21946
|
+
}, [activeChannel, activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.members, activeChannel === null || activeChannel === void 0 ? void 0 : (_activeChannel$member = activeChannel.members) === null || _activeChannel$member === void 0 ? void 0 : _activeChannel$member.length, activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.id]);
|
|
21918
21947
|
useDidUpdate(function () {
|
|
21919
21948
|
if (closeSearchChannels) {
|
|
21920
21949
|
getMyChannels();
|
|
@@ -22272,7 +22301,7 @@ var NoData = styled__default.div(_templateObject8$4 || (_templateObject8$4 = _ta
|
|
|
22272
22301
|
return props.color;
|
|
22273
22302
|
});
|
|
22274
22303
|
var LoadingWrapper = styled__default.div(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n"])));
|
|
22275
|
-
var ChannelListHeader = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: 12px;\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
|
|
22304
|
+
var ChannelListHeader = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: 12px;\n padding-left: 22px;\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
|
|
22276
22305
|
return props.maxWidth ? props.maxWidth + "px" : 'inherit';
|
|
22277
22306
|
}, function (props) {
|
|
22278
22307
|
return props.withoutProfile && '52px';
|
|
@@ -22392,7 +22421,7 @@ function Chat(_ref) {
|
|
|
22392
22421
|
color: textSecondary
|
|
22393
22422
|
}, "Please select a chat to start messaging."))))), children);
|
|
22394
22423
|
}
|
|
22395
|
-
var Container$8 = styled__default.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n max-width: ", ";\n display: flex;\n transition: all 0.1s;\n flex-direction: column;\n"])), function (props) {
|
|
22424
|
+
var Container$8 = styled__default.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n max-width: ", ";\n display: flex;\n transition: all 0.1s;\n flex-direction: column;\n overflow: hidden;\n"])), function (props) {
|
|
22396
22425
|
return props.widthOffset || props.channelDetailsWidth ? "calc(100% - " + (props.widthOffset + (props.channelDetailsWidth ? props.channelDetailsWidth + 1 : 0)) + "px)" : '';
|
|
22397
22426
|
});
|
|
22398
22427
|
var SelectChatContainer = styled__default.div(_templateObject2$f || (_templateObject2$f = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: ", ";\n z-index: 99;\n"])), function (props) {
|
|
@@ -25379,18 +25408,21 @@ var VideoPreview = /*#__PURE__*/React.memo(function VideoPreview(_ref) {
|
|
|
25379
25408
|
border = _useColor[THEME_COLORS.BORDER],
|
|
25380
25409
|
overlayBackground2 = _useColor[THEME_COLORS.OVERLAY_BACKGROUND_2],
|
|
25381
25410
|
textOnPrimary = _useColor[THEME_COLORS.TEXT_ON_PRIMARY];
|
|
25382
|
-
var
|
|
25383
|
-
|
|
25384
|
-
|
|
25385
|
-
|
|
25386
|
-
|
|
25387
|
-
|
|
25388
|
-
var
|
|
25389
|
-
|
|
25390
|
-
|
|
25391
|
-
var
|
|
25392
|
-
|
|
25393
|
-
|
|
25411
|
+
var currentTime = '';
|
|
25412
|
+
if (file.metadata && file.metadata.dur) {
|
|
25413
|
+
var mins = Math.floor(file.metadata.dur / 60);
|
|
25414
|
+
var seconds = Math.floor(file.metadata.dur % 60);
|
|
25415
|
+
currentTime = mins + ":" + (seconds < 10 ? "0" + seconds : seconds);
|
|
25416
|
+
}
|
|
25417
|
+
var _useState = React.useState(currentTime),
|
|
25418
|
+
videoCurrentTime = _useState[0],
|
|
25419
|
+
setVideoCurrentTime = _useState[1];
|
|
25420
|
+
var _useState2 = React.useState(true),
|
|
25421
|
+
loading = _useState2[0],
|
|
25422
|
+
setLoading = _useState2[1];
|
|
25423
|
+
var _useState3 = React.useState(''),
|
|
25424
|
+
videoUrl = _useState3[0],
|
|
25425
|
+
setVideoUrl = _useState3[1];
|
|
25394
25426
|
var videoRef = React.useRef(null);
|
|
25395
25427
|
var attachmentThumb;
|
|
25396
25428
|
var withPrefix = true;
|
|
@@ -25403,55 +25435,41 @@ var VideoPreview = /*#__PURE__*/React.memo(function VideoPreview(_ref) {
|
|
|
25403
25435
|
}
|
|
25404
25436
|
}
|
|
25405
25437
|
React.useEffect(function () {
|
|
25406
|
-
var
|
|
25407
|
-
if (
|
|
25408
|
-
|
|
25409
|
-
|
|
25410
|
-
|
|
25411
|
-
|
|
25412
|
-
|
|
25413
|
-
|
|
25414
|
-
|
|
25415
|
-
|
|
25416
|
-
|
|
25417
|
-
}
|
|
25418
|
-
};
|
|
25419
|
-
intervalCount++;
|
|
25420
|
-
var _temp3 = function () {
|
|
25421
|
-
if (videoRef.current && videoRef.current.readyState > 3) {
|
|
25422
|
-
var _temp2 = function _temp2() {
|
|
25423
|
-
clearInterval(checkVideoInterval);
|
|
25424
|
-
};
|
|
25425
|
-
setLoading(false);
|
|
25426
|
-
setVideoDuration(videoRef.current.duration);
|
|
25427
|
-
var minutes = Math.floor(videoRef.current.duration / 60);
|
|
25428
|
-
var seconds = Math.floor(videoRef.current.duration % 60);
|
|
25429
|
-
setVideoCurrentTime(minutes + ":" + (seconds < 10 ? "0" + seconds : seconds));
|
|
25430
|
-
var _temp = function () {
|
|
25431
|
-
if (isPreview) {
|
|
25432
|
-
return Promise.resolve(getFrame3(videoRef.current, 0)).then(function (thumb) {
|
|
25433
|
-
if (thumb) {
|
|
25434
|
-
setVideoThumb(file.tid, _extends({}, thumb, {
|
|
25435
|
-
duration: videoRef.current.duration
|
|
25436
|
-
}));
|
|
25437
|
-
if (setVideoIsReadyToSend) {
|
|
25438
|
-
setVideoIsReadyToSend(file.tid);
|
|
25439
|
-
}
|
|
25440
|
-
}
|
|
25441
|
-
});
|
|
25442
|
-
}
|
|
25443
|
-
}();
|
|
25444
|
-
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
25445
|
-
}
|
|
25446
|
-
}();
|
|
25447
|
-
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
|
25448
|
-
} catch (e) {
|
|
25449
|
-
return Promise.reject(e);
|
|
25438
|
+
var video = videoRef.current;
|
|
25439
|
+
if (!video) return;
|
|
25440
|
+
var checkReadyState = function checkReadyState() {
|
|
25441
|
+
if (video.readyState > 3) {
|
|
25442
|
+
setLoading(false);
|
|
25443
|
+
var minutes = Math.floor(video.duration / 60);
|
|
25444
|
+
var _seconds = Math.floor(video.duration % 60);
|
|
25445
|
+
setVideoCurrentTime(minutes + ":" + (_seconds < 10 ? "0" + _seconds : _seconds));
|
|
25446
|
+
console.log('videoCurrentTime **************', minutes + ":" + (_seconds < 10 ? "0" + _seconds : _seconds));
|
|
25447
|
+
if (setVideoIsReadyToSend) {
|
|
25448
|
+
setVideoIsReadyToSend(file.tid);
|
|
25450
25449
|
}
|
|
25451
|
-
|
|
25452
|
-
|
|
25450
|
+
return true;
|
|
25451
|
+
}
|
|
25452
|
+
return false;
|
|
25453
|
+
};
|
|
25454
|
+
if (checkReadyState()) return;
|
|
25455
|
+
var handleCanPlay = function handleCanPlay() {
|
|
25456
|
+
return checkReadyState();
|
|
25457
|
+
};
|
|
25458
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
25459
|
+
return checkReadyState();
|
|
25460
|
+
};
|
|
25461
|
+
video.addEventListener('canplay', handleCanPlay);
|
|
25462
|
+
video.addEventListener('loadedmetadata', handleLoadedMetadata);
|
|
25463
|
+
var interval = setInterval(function () {
|
|
25464
|
+
console.log('checkReadyState **************');
|
|
25465
|
+
if (checkReadyState()) {
|
|
25466
|
+
clearInterval(interval);
|
|
25467
|
+
}
|
|
25468
|
+
}, 1000);
|
|
25453
25469
|
return function () {
|
|
25454
|
-
|
|
25470
|
+
video.removeEventListener('canplay', handleCanPlay);
|
|
25471
|
+
video.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
|
25472
|
+
clearInterval(interval);
|
|
25455
25473
|
};
|
|
25456
25474
|
}, []);
|
|
25457
25475
|
React.useEffect(function () {
|
|
@@ -25486,7 +25504,7 @@ var VideoPreview = /*#__PURE__*/React.memo(function VideoPreview(_ref) {
|
|
|
25486
25504
|
preload: 'auto',
|
|
25487
25505
|
id: 'video',
|
|
25488
25506
|
src: file.attachmentUrl || videoUrl
|
|
25489
|
-
}), videoCurrentTime && (/*#__PURE__*/React__default.createElement(VideoControls, null, !isPreview && !!
|
|
25507
|
+
}), videoCurrentTime && (/*#__PURE__*/React__default.createElement(VideoControls, null, !isPreview && !!videoCurrentTime && !isRepliedMessage && !uploading && !isDetailsView && (
|
|
25490
25508
|
/*#__PURE__*/
|
|
25491
25509
|
React__default.createElement(VideoPlayButton, null, /*#__PURE__*/React__default.createElement(SvgPlayVideo, null))), /*#__PURE__*/React__default.createElement(VideoTime, {
|
|
25492
25510
|
isDetailsView: isDetailsView,
|
|
@@ -25496,7 +25514,7 @@ var VideoPreview = /*#__PURE__*/React.memo(function VideoPreview(_ref) {
|
|
|
25496
25514
|
}, !isRepliedMessage && !isPreview && /*#__PURE__*/React__default.createElement(SvgVideoCall, null), videoCurrentTime))));
|
|
25497
25515
|
});
|
|
25498
25516
|
var VideoControls = styled__default.div(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
25499
|
-
var VideoTime = styled__default.div(_templateObject2$o || (_templateObject2$o = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: ", ";\n bottom: ", ";\n left: ", ";\n font-size: ", ";\n display: flex;\n align-items: center;\n border-radius: 16px;\n padding: ", ";\n background-color: ", ";\n line-height: 14px;\n color: ", ";\n\n & > svg {\n color: ", ";\n margin-right: 4px;\n }\n"])), function (props) {
|
|
25517
|
+
var VideoTime = styled__default.div(_templateObject2$o || (_templateObject2$o = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: ", ";\n bottom: ", ";\n left: ", ";\n font-size: ", ";\n display: flex;\n align-items: center;\n border-radius: 16px;\n padding: ", ";\n background-color: ", ";\n line-height: 14px;\n color: ", ";\n z-index: 10;\n\n & > svg {\n color: ", ";\n margin-right: 4px;\n }\n"])), function (props) {
|
|
25500
25518
|
return props.isRepliedMessage ? '3px' : props.isDetailsView ? undefined : '8px';
|
|
25501
25519
|
}, function (props) {
|
|
25502
25520
|
return props.isDetailsView ? '8px' : undefined;
|
|
@@ -27685,7 +27703,10 @@ var Attachment = function Attachment(_ref) {
|
|
|
27685
27703
|
var _useState5 = React.useState(3),
|
|
27686
27704
|
progress = _useState5[0],
|
|
27687
27705
|
setProgress = _useState5[1];
|
|
27688
|
-
var _useState6 = React.useState(
|
|
27706
|
+
var _useState6 = React.useState({
|
|
27707
|
+
loaded: 0,
|
|
27708
|
+
total: (attachment === null || attachment === void 0 ? void 0 : attachment.size) || 0
|
|
27709
|
+
}),
|
|
27689
27710
|
sizeProgress = _useState6[0],
|
|
27690
27711
|
setSizeProgress = _useState6[1];
|
|
27691
27712
|
var _useState7 = React.useState(true),
|
|
@@ -29385,7 +29406,7 @@ var HiddenMessageTime = styled__default.span(_templateObject2$u || (_templateObj
|
|
|
29385
29406
|
}, function (props) {
|
|
29386
29407
|
return props.color;
|
|
29387
29408
|
});
|
|
29388
|
-
var MessageStatusAndTimeContainer = styled__default.span(_templateObject3$o || (_templateObject3$o = _taggedTemplateLiteralLoose(["\n visibility: ", ";\n display: ", ";\n align-items: flex-end;\n border-radius: 16px;\n padding: ", ";\n background-color: ", ";\n float: right;\n line-height: ", ";\n margin-right: ", ";\n margin-left: ", ";\n margin-bottom: ", ";\n direction: ", ";\n transform: translate(0px, 4px);\n white-space: nowrap;\n width: ", ";\n justify-content: ", ";\n\n & > svg {\n margin-left: 4px;\n height: 14px;\n width: 16px;\n }\n\n & > ", " {\n color: ", ";\n }\n\n ", "\n"])), function (props) {
|
|
29409
|
+
var MessageStatusAndTimeContainer = styled__default.span(_templateObject3$o || (_templateObject3$o = _taggedTemplateLiteralLoose(["\n visibility: ", ";\n display: ", ";\n align-items: flex-end;\n border-radius: 16px;\n padding: ", ";\n background-color: ", ";\n float: right;\n line-height: ", ";\n margin-right: ", ";\n margin-left: ", ";\n margin-bottom: ", ";\n direction: ", ";\n transform: translate(0px, 4px);\n white-space: nowrap;\n width: ", ";\n justify-content: ", ";\n z-index: 10;\n\n & > svg {\n margin-left: 4px;\n height: 14px;\n width: 16px;\n }\n\n & > ", " {\n color: ", ";\n }\n\n ", "\n"])), function (props) {
|
|
29389
29410
|
return props.showOnlyOnHover && 'hidden';
|
|
29390
29411
|
}, function (props) {
|
|
29391
29412
|
return props.hide ? 'none' : 'flex';
|
|
@@ -29410,7 +29431,7 @@ var MessageStatusAndTimeContainer = styled__default.span(_templateObject3$o || (
|
|
|
29410
29431
|
}, HiddenMessageTime, function (props) {
|
|
29411
29432
|
return props.withAttachment ? props.messageTimeColorOnAttachment : '';
|
|
29412
29433
|
}, function (props) {
|
|
29413
|
-
return props.withAttachment && "\n position: absolute;\n z-index:
|
|
29434
|
+
return props.withAttachment && "\n position: absolute;\n z-index: 10;\n right: " + (props.fileAttachment ? '6px' : '10px') + ";\n bottom: " + (props.fileAttachment ? '9px' : '14px') + ";\n ";
|
|
29414
29435
|
});
|
|
29415
29436
|
var MessageStatusUpdated = styled__default.span(_templateObject4$k || (_templateObject4$k = _taggedTemplateLiteralLoose(["\n margin-right: 4px;\n font-style: italic;\n font-weight: 400;\n font-size: ", ";\n color: ", ";\n"])), function (props) {
|
|
29416
29437
|
return props.fontSize || '12px';
|
|
@@ -29553,7 +29574,9 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
29553
29574
|
handleMouseLeave = _ref.handleMouseLeave,
|
|
29554
29575
|
handleReactionAddDelete = _ref.handleReactionAddDelete,
|
|
29555
29576
|
handleCreateChat = _ref.handleCreateChat,
|
|
29556
|
-
messageTextRef = _ref.messageTextRef
|
|
29577
|
+
messageTextRef = _ref.messageTextRef,
|
|
29578
|
+
handleOpenUserProfile = _ref.handleOpenUserProfile,
|
|
29579
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
29557
29580
|
var _useColor = useColors(),
|
|
29558
29581
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
29559
29582
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -29754,7 +29777,9 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
29754
29777
|
contactsMap: contactsMap,
|
|
29755
29778
|
getFromContacts: getFromContacts,
|
|
29756
29779
|
accentColor: accentColor,
|
|
29757
|
-
textSecondary: textSecondary
|
|
29780
|
+
textSecondary: textSecondary,
|
|
29781
|
+
onMentionNameClick: handleOpenUserProfile,
|
|
29782
|
+
shouldOpenUserProfileForMention: !!shouldOpenUserProfileForMention
|
|
29758
29783
|
})), !withAttachments && message.state === MESSAGE_STATUS.DELETE ? (/*#__PURE__*/React__default.createElement(MessageStatusDeleted$1, {
|
|
29759
29784
|
color: textSecondary
|
|
29760
29785
|
}, " Message was deleted. ")) : '', messageStatusAndTimePosition === 'onMessage' && !notLinkAttachment && (messageStatusVisible || messageTimeVisible) ? (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
@@ -30040,7 +30065,8 @@ var Message$1 = function Message(_ref) {
|
|
|
30040
30065
|
theme = _ref.theme,
|
|
30041
30066
|
messageTextFontSize = _ref.messageTextFontSize,
|
|
30042
30067
|
messageTextLineHeight = _ref.messageTextLineHeight,
|
|
30043
|
-
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment
|
|
30068
|
+
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment,
|
|
30069
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
30044
30070
|
var _useColor = useColors(),
|
|
30045
30071
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
30046
30072
|
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS],
|
|
@@ -30304,8 +30330,22 @@ var Message$1 = function Message(_ref) {
|
|
|
30304
30330
|
document.removeEventListener('mousedown', handleClick);
|
|
30305
30331
|
};
|
|
30306
30332
|
}, []);
|
|
30333
|
+
var handleOpenChannelDetails = function handleOpenChannelDetails() {
|
|
30334
|
+
dispatch(switchChannelInfoAC(true));
|
|
30335
|
+
};
|
|
30336
|
+
var handleOpenUserProfile = function handleOpenUserProfile(user) {
|
|
30337
|
+
if (getOpenChatOnUserInteraction() && user && !selectionIsActive) {
|
|
30338
|
+
dispatch(createChannelAC({
|
|
30339
|
+
metadata: '',
|
|
30340
|
+
type: DEFAULT_CHANNEL_TYPE.DIRECT,
|
|
30341
|
+
members: [_extends({}, user, {
|
|
30342
|
+
role: 'owner'
|
|
30343
|
+
})]
|
|
30344
|
+
}, true));
|
|
30345
|
+
handleOpenChannelDetails();
|
|
30346
|
+
}
|
|
30347
|
+
};
|
|
30307
30348
|
return /*#__PURE__*/React__default.createElement(MessageItem, {
|
|
30308
|
-
key: message.id || message.tid,
|
|
30309
30349
|
className: 'message_item',
|
|
30310
30350
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
30311
30351
|
withAvatar: renderAvatar,
|
|
@@ -30343,7 +30383,7 @@ var Message$1 = function Message(_ref) {
|
|
|
30343
30383
|
}, message.state === MESSAGE_STATUS.FAILED && (/*#__PURE__*/React__default.createElement(FailedMessageIcon, {
|
|
30344
30384
|
rtl: ownMessageOnRightSide && !message.incoming
|
|
30345
30385
|
}, /*#__PURE__*/React__default.createElement(ErrorIconWrapper, null))), CustomMessageItem ? (/*#__PURE__*/React__default.createElement(CustomMessageItem, {
|
|
30346
|
-
key: message.id,
|
|
30386
|
+
key: message.id || message.tid,
|
|
30347
30387
|
channel: channel,
|
|
30348
30388
|
message: message,
|
|
30349
30389
|
prevMessage: prevMessage,
|
|
@@ -30373,7 +30413,8 @@ var Message$1 = function Message(_ref) {
|
|
|
30373
30413
|
handleReactionAddDelete: handleReactionAddDelete,
|
|
30374
30414
|
handleScrollToRepliedMessage: handleScrollToRepliedMessage,
|
|
30375
30415
|
handleMediaItemClick: handleMediaItemClick,
|
|
30376
|
-
isThreadMessage: isThreadMessage
|
|
30416
|
+
isThreadMessage: isThreadMessage,
|
|
30417
|
+
handleOpenUserProfile: handleOpenUserProfile
|
|
30377
30418
|
})) : (/*#__PURE__*/React__default.createElement(MessageBody$1, {
|
|
30378
30419
|
message: message,
|
|
30379
30420
|
channel: channel,
|
|
@@ -30493,7 +30534,9 @@ var Message$1 = function Message(_ref) {
|
|
|
30493
30534
|
handleDeletePendingMessage: handleDeletePendingMessage,
|
|
30494
30535
|
handleCreateChat: handleCreateChat,
|
|
30495
30536
|
messageTextRef: messageTextRef,
|
|
30496
|
-
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textOnPrimary
|
|
30537
|
+
messageTimeColorOnAttachment: messageTimeColorOnAttachment || textOnPrimary,
|
|
30538
|
+
handleOpenUserProfile: handleOpenUserProfile,
|
|
30539
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
30497
30540
|
})), messageStatusAndTimePosition === 'bottomOfMessage' && (messageStatusVisible || messageTimeVisible) && (/*#__PURE__*/React__default.createElement(MessageStatusAndTime$1, {
|
|
30498
30541
|
message: message,
|
|
30499
30542
|
showMessageTimeAndStatusOnlyOnHover: showMessageTimeAndStatusOnlyOnHover,
|
|
@@ -30741,6 +30784,7 @@ var CreateMessageDateDivider = function CreateMessageDateDivider(_ref) {
|
|
|
30741
30784
|
}));
|
|
30742
30785
|
};
|
|
30743
30786
|
var MessageList = function MessageList(_ref2) {
|
|
30787
|
+
var _channel$lastMessage, _channel$lastMessage3, _scrollRef$current;
|
|
30744
30788
|
var messages = _ref2.messages,
|
|
30745
30789
|
fontFamily = _ref2.fontFamily,
|
|
30746
30790
|
_ref2$ownMessageOnRig = _ref2.ownMessageOnRightSide,
|
|
@@ -30881,7 +30925,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30881
30925
|
messageTimeFontSize = _ref2.messageTimeFontSize,
|
|
30882
30926
|
messageTimeColor = _ref2.messageTimeColor,
|
|
30883
30927
|
messageStatusAndTimeLineHeight = _ref2.messageStatusAndTimeLineHeight,
|
|
30884
|
-
hiddenMessagesProperties = _ref2.hiddenMessagesProperties
|
|
30928
|
+
hiddenMessagesProperties = _ref2.hiddenMessagesProperties,
|
|
30929
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention;
|
|
30885
30930
|
var _useColor = useColors(),
|
|
30886
30931
|
outgoingMessageBackground = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND],
|
|
30887
30932
|
themeBackgroundColor = _useColor[THEME_COLORS.BACKGROUND],
|
|
@@ -30893,7 +30938,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30893
30938
|
textOnPrimary = _useColor[THEME_COLORS.TEXT_ON_PRIMARY],
|
|
30894
30939
|
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
30895
30940
|
surface2 = _useColor[THEME_COLORS.SURFACE_2],
|
|
30896
|
-
border = _useColor[THEME_COLORS.BORDER]
|
|
30941
|
+
border = _useColor[THEME_COLORS.BORDER],
|
|
30942
|
+
highlightedBackground = _useColor[THEME_COLORS.HIGHLIGHTED_BACKGROUND];
|
|
30897
30943
|
var ChatClient = getClient();
|
|
30898
30944
|
var user = ChatClient.user;
|
|
30899
30945
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -30905,12 +30951,14 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30905
30951
|
var tabIsActive = reactRedux.useSelector(tabIsActiveSelector, reactRedux.shallowEqual);
|
|
30906
30952
|
var selectedMessagesMap = reactRedux.useSelector(selectedMessagesMapSelector);
|
|
30907
30953
|
var scrollToNewMessage = reactRedux.useSelector(scrollToNewMessageSelector, reactRedux.shallowEqual);
|
|
30954
|
+
var scrollToMentionedMessage = reactRedux.useSelector(scrollToMentionedMessageSelector, reactRedux.shallowEqual);
|
|
30908
30955
|
var scrollToRepliedMessage = reactRedux.useSelector(scrollToMessageSelector, reactRedux.shallowEqual);
|
|
30909
30956
|
var browserTabIsActive = reactRedux.useSelector(browserTabIsActiveSelector, reactRedux.shallowEqual);
|
|
30910
30957
|
var hasNextMessages = reactRedux.useSelector(messagesHasNextSelector, reactRedux.shallowEqual);
|
|
30911
30958
|
var hasPrevMessages = reactRedux.useSelector(messagesHasPrevSelector, reactRedux.shallowEqual);
|
|
30912
30959
|
var messagesLoading = reactRedux.useSelector(messagesLoadingState);
|
|
30913
30960
|
var draggingSelector = reactRedux.useSelector(isDraggingSelector, reactRedux.shallowEqual);
|
|
30961
|
+
var showScrollToNewMessageButton = reactRedux.useSelector(showScrollToNewMessageButtonSelector, reactRedux.shallowEqual);
|
|
30914
30962
|
var _useState = React.useState(''),
|
|
30915
30963
|
unreadMessageId = _useState[0],
|
|
30916
30964
|
setUnreadMessageId = _useState[1];
|
|
@@ -30936,6 +30984,12 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30936
30984
|
var _useState8 = React.useState(null),
|
|
30937
30985
|
scrollToReply = _useState8[0],
|
|
30938
30986
|
setScrollToReply = _useState8[1];
|
|
30987
|
+
var _useState9 = React.useState(0),
|
|
30988
|
+
previousScrollTop = _useState9[0],
|
|
30989
|
+
setPreviousScrollTop = _useState9[1];
|
|
30990
|
+
var _useState0 = React.useState(false),
|
|
30991
|
+
shouldPreserveScroll = _useState0[0],
|
|
30992
|
+
setShouldPreserveScroll = _useState0[1];
|
|
30939
30993
|
var messageForReply = {};
|
|
30940
30994
|
var messageList = React.useMemo(function () {
|
|
30941
30995
|
return messages;
|
|
@@ -30966,8 +31020,17 @@ var MessageList = function MessageList(_ref2) {
|
|
|
30966
31020
|
messageTopDate.style.display = 'none';
|
|
30967
31021
|
}
|
|
30968
31022
|
};
|
|
30969
|
-
var handleMessagesListScroll = function
|
|
31023
|
+
var handleMessagesListScroll = React.useCallback(function (event) {
|
|
30970
31024
|
try {
|
|
31025
|
+
if (scrollToMentionedMessage) {
|
|
31026
|
+
var _target = event.target;
|
|
31027
|
+
if (_target.scrollTop <= -50 || channel.lastMessage.id !== messages[messages.length - 1].id) {
|
|
31028
|
+
dispatch(showScrollToNewMessageButtonAC(true));
|
|
31029
|
+
} else {
|
|
31030
|
+
dispatch(showScrollToNewMessageButtonAC(false));
|
|
31031
|
+
}
|
|
31032
|
+
return Promise.resolve();
|
|
31033
|
+
}
|
|
30971
31034
|
setShowTopDate(true);
|
|
30972
31035
|
clearTimeout(hideTopDateTimeout.current);
|
|
30973
31036
|
hideTopDateTimeout.current = setTimeout(function () {
|
|
@@ -31029,7 +31092,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31029
31092
|
} catch (e) {
|
|
31030
31093
|
return Promise.reject(e);
|
|
31031
31094
|
}
|
|
31032
|
-
};
|
|
31095
|
+
}, [channel === null || channel === void 0 ? void 0 : (_channel$lastMessage = channel.lastMessage) === null || _channel$lastMessage === void 0 ? void 0 : _channel$lastMessage.id, messages, scrollToMentionedMessage, scrollToNewMessage, messagesLoading, loading, hasPrevMessages, hasNextMessages, messagesIndexMap, lastVisibleMessageId, connectionStatus, shouldLoadMessages, loadDirection, getHasPrevCached, getHasNextCached, scrollToReply]);
|
|
31033
31096
|
var handleScrollToRepliedMessage = function handleScrollToRepliedMessage(messageId) {
|
|
31034
31097
|
try {
|
|
31035
31098
|
prevDisable = true;
|
|
@@ -31056,6 +31119,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31056
31119
|
}
|
|
31057
31120
|
};
|
|
31058
31121
|
var handleLoadMoreMessages = function handleLoadMoreMessages(direction, limit) {
|
|
31122
|
+
if (scrollToMentionedMessage) {
|
|
31123
|
+
return;
|
|
31124
|
+
}
|
|
31059
31125
|
var lastMessageId = messages.length && messages[messages.length - 1].id;
|
|
31060
31126
|
var firstMessageId = messages.length && messages[0].id;
|
|
31061
31127
|
var hasPrevCached = getHasPrevCached();
|
|
@@ -31156,6 +31222,12 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31156
31222
|
e.dataTransfer.clearData();
|
|
31157
31223
|
}
|
|
31158
31224
|
};
|
|
31225
|
+
React.useEffect(function () {
|
|
31226
|
+
var _messages, _channel$lastMessage2;
|
|
31227
|
+
if (messages.length > 0 && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.id) === ((_channel$lastMessage2 = channel.lastMessage) === null || _channel$lastMessage2 === void 0 ? void 0 : _channel$lastMessage2.id) && scrollRef.current && scrollRef.current.scrollTop > -50 && !showScrollToNewMessageButton) {
|
|
31228
|
+
dispatch(showScrollToNewMessageButtonAC(false));
|
|
31229
|
+
}
|
|
31230
|
+
}, [messages, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage3 = channel.lastMessage) === null || _channel$lastMessage3 === void 0 ? void 0 : _channel$lastMessage3.id, scrollRef === null || scrollRef === void 0 ? void 0 : (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollTop, showScrollToNewMessageButton]);
|
|
31159
31231
|
React.useEffect(function () {
|
|
31160
31232
|
if (scrollToRepliedMessage) {
|
|
31161
31233
|
loading = false;
|
|
@@ -31164,6 +31236,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31164
31236
|
if (repliedMessage) {
|
|
31165
31237
|
setScrollToReply(repliedMessage && repliedMessage.offsetTop - (channel.backToLinkedChannel ? 0 : 200));
|
|
31166
31238
|
scrollRef.current.scrollTop = repliedMessage && repliedMessage.offsetTop - (channel.backToLinkedChannel ? 0 : 200);
|
|
31239
|
+
scrollRef.current.style.scrollBehavior = 'smooth';
|
|
31167
31240
|
if (!channel.backToLinkedChannel) {
|
|
31168
31241
|
repliedMessage && repliedMessage.classList.add('highlight');
|
|
31169
31242
|
}
|
|
@@ -31235,6 +31308,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31235
31308
|
if (selectedMessagesMap && selectedMessagesMap.size) {
|
|
31236
31309
|
dispatch(clearSelectedMessagesAC());
|
|
31237
31310
|
}
|
|
31311
|
+
setPreviousScrollTop(0);
|
|
31312
|
+
setShouldPreserveScroll(false);
|
|
31238
31313
|
nextDisable = false;
|
|
31239
31314
|
prevDisable = false;
|
|
31240
31315
|
scrollToBottom = true;
|
|
@@ -31254,6 +31329,13 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31254
31329
|
}
|
|
31255
31330
|
}, [messages]);
|
|
31256
31331
|
React.useEffect(function () {
|
|
31332
|
+
if (scrollRef.current) {
|
|
31333
|
+
var isAtBottom = scrollRef.current.scrollTop > -50;
|
|
31334
|
+
if (!isAtBottom) {
|
|
31335
|
+
setPreviousScrollTop(scrollRef.current.scrollTop);
|
|
31336
|
+
setShouldPreserveScroll(true);
|
|
31337
|
+
}
|
|
31338
|
+
}
|
|
31257
31339
|
if (loading) {
|
|
31258
31340
|
if (loadDirection !== 'next') {
|
|
31259
31341
|
var lastVisibleMessage = document.getElementById(lastVisibleMessageId);
|
|
@@ -31314,6 +31396,17 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31314
31396
|
dispatch(scrollToNewMessageAC(true));
|
|
31315
31397
|
scrollToBottom = false;
|
|
31316
31398
|
}
|
|
31399
|
+
if (shouldPreserveScroll && scrollRef.current && previousScrollTop > 0) {
|
|
31400
|
+
requestAnimationFrame(function () {
|
|
31401
|
+
if (scrollRef.current) {
|
|
31402
|
+
scrollRef.current.style.scrollBehavior = 'inherit';
|
|
31403
|
+
scrollRef.current.scrollTop = previousScrollTop;
|
|
31404
|
+
scrollRef.current.style.scrollBehavior = 'smooth';
|
|
31405
|
+
}
|
|
31406
|
+
setShouldPreserveScroll(false);
|
|
31407
|
+
setPreviousScrollTop(0);
|
|
31408
|
+
});
|
|
31409
|
+
}
|
|
31317
31410
|
}, [messages]);
|
|
31318
31411
|
useDidUpdate(function () {
|
|
31319
31412
|
log.info('connection status is changed.. .... ', connectionStatus, 'channel ... ', channel);
|
|
@@ -31414,9 +31507,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31414
31507
|
var isUnreadMessage = !!(unreadMessageId && unreadMessageId === message.id && nextMessage) && !channel.backToLinkedChannel;
|
|
31415
31508
|
var messageMetas = isJSON(message.metadata) ? JSON.parse(message.metadata) : message.metadata;
|
|
31416
31509
|
messagesIndexMap[message.id] = index;
|
|
31417
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
31418
|
-
key: message.id || message.tid
|
|
31419
|
-
}, /*#__PURE__*/React__default.createElement(CreateMessageDateDivider, {
|
|
31510
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CreateMessageDateDivider, {
|
|
31420
31511
|
noMargin: !isUnreadMessage && prevMessage && prevMessage.type === 'system' && message.type !== 'system',
|
|
31421
31512
|
theme: theme,
|
|
31422
31513
|
lastIndex: false,
|
|
@@ -31432,6 +31523,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31432
31523
|
marginBottom: prevMessage && prevMessage.type === 'system' && message.type !== 'system' ? '16px' : '0',
|
|
31433
31524
|
marginTop: differentUserMessageSpacing
|
|
31434
31525
|
}), message.type === 'system' ? (/*#__PURE__*/React__default.createElement(SystemMessage, {
|
|
31526
|
+
key: message.id || message.tid,
|
|
31435
31527
|
channel: channel,
|
|
31436
31528
|
message: message,
|
|
31437
31529
|
nextMessage: nextMessage,
|
|
@@ -31445,8 +31537,10 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31445
31537
|
backgroundColor: dateDividerBackgroundColor,
|
|
31446
31538
|
borderRadius: dateDividerBorderRadius
|
|
31447
31539
|
})) : (/*#__PURE__*/React__default.createElement(MessageWrapper, {
|
|
31540
|
+
key: message.id || message.tid,
|
|
31448
31541
|
id: message.id,
|
|
31449
|
-
className: (message.incoming ? incomingMessageStyles === null || incomingMessageStyles === void 0 ? void 0 : incomingMessageStyles.classname : outgoingMessageStyles === null || outgoingMessageStyles === void 0 ? void 0 : outgoingMessageStyles.classname) || ''
|
|
31542
|
+
className: (message.incoming ? incomingMessageStyles === null || incomingMessageStyles === void 0 ? void 0 : incomingMessageStyles.classname : outgoingMessageStyles === null || outgoingMessageStyles === void 0 ? void 0 : outgoingMessageStyles.classname) || '',
|
|
31543
|
+
highlightBg: highlightedBackground
|
|
31450
31544
|
}, /*#__PURE__*/React__default.createElement(Message$2, {
|
|
31451
31545
|
message: _extends({}, message, {
|
|
31452
31546
|
metadata: messageMetas
|
|
@@ -31577,7 +31671,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31577
31671
|
messageStateColor: messageStateColor,
|
|
31578
31672
|
messageTimeFontSize: messageTimeFontSize,
|
|
31579
31673
|
messageTimeColor: messageTimeColor,
|
|
31580
|
-
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight
|
|
31674
|
+
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
31675
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
31581
31676
|
}))), isUnreadMessage ? (/*#__PURE__*/React__default.createElement(MessageDivider, {
|
|
31582
31677
|
theme: theme,
|
|
31583
31678
|
newMessagesSeparatorTextColor: newMessagesSeparatorTextColor,
|
|
@@ -31658,7 +31753,9 @@ var DropAttachmentArea = styled__default.div(_templateObject7$e || (_templateObj
|
|
|
31658
31753
|
}, IconWrapper$1, function (props) {
|
|
31659
31754
|
return props.iconBackgroundColor;
|
|
31660
31755
|
});
|
|
31661
|
-
var MessageWrapper = styled__default.div(_templateObject8$d || (_templateObject8$d = _taggedTemplateLiteralLoose(["\n &.highlight {\n & .messageBody {\n transform: scale(1.1);\n background-color:
|
|
31756
|
+
var MessageWrapper = styled__default.div(_templateObject8$d || (_templateObject8$d = _taggedTemplateLiteralLoose(["\n &.highlight {\n & .messageBody {\n transform: scale(1.1);\n background-color: ", ";\n }\n }\n"])), function (props) {
|
|
31757
|
+
return props.highlightBg || '#d5d5d5';
|
|
31758
|
+
});
|
|
31662
31759
|
var NoMessagesContainer = styled__default.div(_templateObject9$c || (_templateObject9$c = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n width: 100%;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n color: ", ";\n"])), function (props) {
|
|
31663
31760
|
return props.color;
|
|
31664
31761
|
});
|
|
@@ -31810,7 +31907,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
31810
31907
|
messageTimeColor = _ref.messageTimeColor,
|
|
31811
31908
|
messageStatusAndTimeLineHeight = _ref.messageStatusAndTimeLineHeight,
|
|
31812
31909
|
_ref$hiddenMessagesPr = _ref.hiddenMessagesProperties,
|
|
31813
|
-
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr
|
|
31910
|
+
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr,
|
|
31911
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention;
|
|
31814
31912
|
var messages = reactRedux.useSelector(activeChannelMessagesSelector) || [];
|
|
31815
31913
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MessageList, {
|
|
31816
31914
|
messages: messages,
|
|
@@ -31938,7 +32036,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
31938
32036
|
messageTimeFontSize: messageTimeFontSize,
|
|
31939
32037
|
messageTimeColor: messageTimeColor,
|
|
31940
32038
|
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
31941
|
-
hiddenMessagesProperties: hiddenMessagesProperties
|
|
32039
|
+
hiddenMessagesProperties: hiddenMessagesProperties,
|
|
32040
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
31942
32041
|
}));
|
|
31943
32042
|
};
|
|
31944
32043
|
|
|
@@ -34097,7 +34196,7 @@ var RecordingAnimation = function RecordingAnimation(_ref2) {
|
|
|
34097
34196
|
}));
|
|
34098
34197
|
};
|
|
34099
34198
|
|
|
34100
|
-
var _templateObject$I, _templateObject2$D, _templateObject3$w, _templateObject4$r, _templateObject5$n, _templateObject6$j, _templateObject7$h, _templateObject8$f, _templateObject9$d, _templateObject0$c, _templateObject1$8, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$
|
|
34199
|
+
var _templateObject$I, _templateObject2$D, _templateObject3$w, _templateObject4$r, _templateObject5$n, _templateObject6$j, _templateObject7$h, _templateObject8$f, _templateObject9$d, _templateObject0$c, _templateObject1$8, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _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;
|
|
34101
34200
|
function AutoFocusPlugin(_ref) {
|
|
34102
34201
|
var messageForReply = _ref.messageForReply;
|
|
34103
34202
|
var _useLexicalComposerCo = LexicalComposerContext.useLexicalComposerContext(),
|
|
@@ -34412,17 +34511,6 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34412
34511
|
}
|
|
34413
34512
|
};
|
|
34414
34513
|
var handleSendEditMessage = function handleSendEditMessage(event) {
|
|
34415
|
-
if (typingTimout) {
|
|
34416
|
-
if (!inTypingStateTimout) {
|
|
34417
|
-
handleSendTypingState(true);
|
|
34418
|
-
}
|
|
34419
|
-
clearTimeout(typingTimout);
|
|
34420
|
-
} else {
|
|
34421
|
-
handleSendTypingState(true);
|
|
34422
|
-
}
|
|
34423
|
-
setTypingTimout(setTimeout(function () {
|
|
34424
|
-
setTypingTimout(0);
|
|
34425
|
-
}, 2000));
|
|
34426
34514
|
var shiftKey = event.shiftKey,
|
|
34427
34515
|
type = event.type,
|
|
34428
34516
|
code = event.code;
|
|
@@ -34524,6 +34612,18 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34524
34612
|
setMentionedMembers([]);
|
|
34525
34613
|
setMessageBodyAttributes([]);
|
|
34526
34614
|
dispatch(setCloseSearchChannelsAC(true));
|
|
34615
|
+
} else {
|
|
34616
|
+
if (typingTimout) {
|
|
34617
|
+
if (!inTypingStateTimout) {
|
|
34618
|
+
handleSendTypingState(true);
|
|
34619
|
+
}
|
|
34620
|
+
clearTimeout(typingTimout);
|
|
34621
|
+
} else {
|
|
34622
|
+
handleSendTypingState(true);
|
|
34623
|
+
}
|
|
34624
|
+
setTypingTimout(setTimeout(function () {
|
|
34625
|
+
setTypingTimout(0);
|
|
34626
|
+
}, 2000));
|
|
34527
34627
|
}
|
|
34528
34628
|
};
|
|
34529
34629
|
var handleEditMessage = function handleEditMessage() {
|
|
@@ -34752,7 +34852,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34752
34852
|
fileChecksum = "" + reader.result;
|
|
34753
34853
|
}
|
|
34754
34854
|
return Promise.resolve(hashString(fileChecksum || '')).then(function (checksumHash) {
|
|
34755
|
-
function
|
|
34855
|
+
function _temp12() {
|
|
34756
34856
|
if (dataFromDb) {
|
|
34757
34857
|
cachedUrl = dataFromDb.url;
|
|
34758
34858
|
setPendingAttachment(tid, {
|
|
@@ -34764,60 +34864,85 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34764
34864
|
checksum: checksumHash
|
|
34765
34865
|
});
|
|
34766
34866
|
}
|
|
34767
|
-
var
|
|
34867
|
+
var _temp10 = function () {
|
|
34768
34868
|
if (customUploader) {
|
|
34769
|
-
|
|
34770
|
-
|
|
34771
|
-
|
|
34772
|
-
|
|
34773
|
-
return
|
|
34774
|
-
|
|
34775
|
-
|
|
34776
|
-
|
|
34777
|
-
|
|
34778
|
-
|
|
34779
|
-
|
|
34780
|
-
|
|
34781
|
-
|
|
34782
|
-
|
|
34783
|
-
|
|
34784
|
-
|
|
34785
|
-
|
|
34786
|
-
|
|
34787
|
-
|
|
34788
|
-
|
|
34789
|
-
|
|
34790
|
-
|
|
34791
|
-
|
|
34792
|
-
|
|
34793
|
-
|
|
34794
|
-
|
|
34795
|
-
|
|
34796
|
-
|
|
34797
|
-
|
|
34798
|
-
|
|
34799
|
-
|
|
34800
|
-
|
|
34801
|
-
|
|
34802
|
-
|
|
34803
|
-
|
|
34804
|
-
|
|
34805
|
-
|
|
34806
|
-
|
|
34807
|
-
|
|
34808
|
-
|
|
34809
|
-
|
|
34810
|
-
|
|
34811
|
-
|
|
34812
|
-
|
|
34813
|
-
|
|
34814
|
-
|
|
34869
|
+
var _temp2 = function () {
|
|
34870
|
+
if (fileType === 'image') {
|
|
34871
|
+
resizeImage(file).then(function (resizedFile) {
|
|
34872
|
+
try {
|
|
34873
|
+
return Promise.resolve(createImageThumbnail(file)).then(function (_ref4) {
|
|
34874
|
+
var thumbnail = _ref4.thumbnail,
|
|
34875
|
+
imageWidth = _ref4.imageWidth,
|
|
34876
|
+
imageHeight = _ref4.imageHeight;
|
|
34877
|
+
setAttachments(function (prevState) {
|
|
34878
|
+
return [].concat(prevState, [{
|
|
34879
|
+
data: file,
|
|
34880
|
+
cachedUrl: cachedUrl,
|
|
34881
|
+
upload: false,
|
|
34882
|
+
type: isMediaAttachment ? fileType : 'file',
|
|
34883
|
+
attachmentUrl: URL.createObjectURL(resizedFile.blob),
|
|
34884
|
+
tid: tid,
|
|
34885
|
+
size: dataFromDb ? dataFromDb.size : file.size,
|
|
34886
|
+
metadata: _extends({}, dataFromDb && dataFromDb.metadata, {
|
|
34887
|
+
szw: imageWidth,
|
|
34888
|
+
szh: imageHeight,
|
|
34889
|
+
tmb: thumbnail
|
|
34890
|
+
})
|
|
34891
|
+
}]);
|
|
34892
|
+
});
|
|
34893
|
+
});
|
|
34894
|
+
} catch (e) {
|
|
34895
|
+
return Promise.reject(e);
|
|
34896
|
+
}
|
|
34897
|
+
});
|
|
34898
|
+
} else {
|
|
34899
|
+
var _temp13 = function () {
|
|
34900
|
+
if (fileType === 'video') {
|
|
34901
|
+
return Promise.resolve(getFrame(URL.createObjectURL(file), 0)).then(function (_ref5) {
|
|
34902
|
+
var thumb = _ref5.thumb,
|
|
34903
|
+
width = _ref5.width,
|
|
34904
|
+
height = _ref5.height;
|
|
34905
|
+
setAttachments(function (prevState) {
|
|
34906
|
+
return [].concat(prevState, [{
|
|
34907
|
+
data: file,
|
|
34908
|
+
cachedUrl: cachedUrl,
|
|
34909
|
+
upload: false,
|
|
34910
|
+
type: isMediaAttachment ? fileType : 'file',
|
|
34911
|
+
attachmentUrl: URL.createObjectURL(file),
|
|
34912
|
+
tid: tid,
|
|
34913
|
+
size: dataFromDb ? dataFromDb.size : file.size,
|
|
34914
|
+
metadata: _extends({}, dataFromDb && dataFromDb.metadata, {
|
|
34915
|
+
szw: width,
|
|
34916
|
+
szh: height,
|
|
34917
|
+
tmb: thumb
|
|
34918
|
+
})
|
|
34919
|
+
}]);
|
|
34920
|
+
});
|
|
34921
|
+
});
|
|
34922
|
+
} else {
|
|
34923
|
+
setAttachments(function (prevState) {
|
|
34924
|
+
return [].concat(prevState, [{
|
|
34925
|
+
data: file,
|
|
34926
|
+
cachedUrl: cachedUrl,
|
|
34927
|
+
upload: false,
|
|
34928
|
+
type: 'file',
|
|
34929
|
+
tid: tid,
|
|
34930
|
+
size: dataFromDb ? dataFromDb.size : file.size,
|
|
34931
|
+
metadata: dataFromDb && dataFromDb.metadata
|
|
34932
|
+
}]);
|
|
34933
|
+
});
|
|
34934
|
+
}
|
|
34935
|
+
}();
|
|
34936
|
+
if (_temp13 && _temp13.then) return _temp13.then(function () {});
|
|
34937
|
+
}
|
|
34938
|
+
}();
|
|
34939
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
34815
34940
|
} else {
|
|
34816
|
-
var
|
|
34941
|
+
var _temp1 = function () {
|
|
34817
34942
|
if (fileType === 'image') {
|
|
34818
|
-
var
|
|
34943
|
+
var _temp7 = function () {
|
|
34819
34944
|
if (isMediaAttachment) {
|
|
34820
|
-
var
|
|
34945
|
+
var _temp4 = function _temp4() {
|
|
34821
34946
|
if (file.type === 'image/gif') {
|
|
34822
34947
|
setAttachments(function (prevState) {
|
|
34823
34948
|
return [].concat(prevState, [{
|
|
@@ -34877,23 +35002,23 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34877
35002
|
}
|
|
34878
35003
|
};
|
|
34879
35004
|
var metas = {};
|
|
34880
|
-
var
|
|
35005
|
+
var _temp3 = function () {
|
|
34881
35006
|
if (dataFromDb) {
|
|
34882
35007
|
metas = dataFromDb.metadata;
|
|
34883
35008
|
} else {
|
|
34884
|
-
return Promise.resolve(createImageThumbnail(file)).then(function (
|
|
34885
|
-
var thumbnail =
|
|
34886
|
-
imageWidth =
|
|
34887
|
-
imageHeight =
|
|
35009
|
+
return Promise.resolve(createImageThumbnail(file)).then(function (_ref6) {
|
|
35010
|
+
var thumbnail = _ref6.thumbnail,
|
|
35011
|
+
imageWidth = _ref6.imageWidth,
|
|
35012
|
+
imageHeight = _ref6.imageHeight;
|
|
34888
35013
|
metas.imageHeight = imageHeight;
|
|
34889
35014
|
metas.imageWidth = imageWidth;
|
|
34890
35015
|
metas.thumbnail = thumbnail;
|
|
34891
35016
|
});
|
|
34892
35017
|
}
|
|
34893
35018
|
}();
|
|
34894
|
-
return
|
|
35019
|
+
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
34895
35020
|
} else {
|
|
34896
|
-
var
|
|
35021
|
+
var _temp6 = function _temp6() {
|
|
34897
35022
|
setAttachments(function (prevState) {
|
|
34898
35023
|
return [].concat(prevState, [{
|
|
34899
35024
|
data: file,
|
|
@@ -34910,24 +35035,24 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34910
35035
|
});
|
|
34911
35036
|
};
|
|
34912
35037
|
var _metas = {};
|
|
34913
|
-
var
|
|
35038
|
+
var _temp5 = function () {
|
|
34914
35039
|
if (dataFromDb) {
|
|
34915
35040
|
_metas = dataFromDb.metadata;
|
|
34916
35041
|
} else {
|
|
34917
|
-
return Promise.resolve(createImageThumbnail(file, undefined, 50, 50)).then(function (
|
|
34918
|
-
var thumbnail =
|
|
35042
|
+
return Promise.resolve(createImageThumbnail(file, undefined, 50, 50)).then(function (_ref7) {
|
|
35043
|
+
var thumbnail = _ref7.thumbnail;
|
|
34919
35044
|
_metas.thumbnail = thumbnail;
|
|
34920
35045
|
});
|
|
34921
35046
|
}
|
|
34922
35047
|
}();
|
|
34923
|
-
return
|
|
35048
|
+
return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
|
|
34924
35049
|
}
|
|
34925
35050
|
}();
|
|
34926
|
-
if (
|
|
35051
|
+
if (_temp7 && _temp7.then) return _temp7.then(function () {});
|
|
34927
35052
|
} else {
|
|
34928
|
-
var
|
|
35053
|
+
var _temp14 = function () {
|
|
34929
35054
|
if (fileType === 'video') {
|
|
34930
|
-
var
|
|
35055
|
+
var _temp9 = function _temp9() {
|
|
34931
35056
|
setAttachments(function (prevState) {
|
|
34932
35057
|
return [].concat(prevState, [{
|
|
34933
35058
|
data: file,
|
|
@@ -34942,14 +35067,14 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34942
35067
|
});
|
|
34943
35068
|
};
|
|
34944
35069
|
var metas = {};
|
|
34945
|
-
var
|
|
35070
|
+
var _temp8 = function () {
|
|
34946
35071
|
if (dataFromDb) {
|
|
34947
35072
|
metas = dataFromDb.metadata;
|
|
34948
35073
|
} else {
|
|
34949
|
-
return Promise.resolve(getFrame(URL.createObjectURL(file), 0)).then(function (
|
|
34950
|
-
var thumb =
|
|
34951
|
-
width =
|
|
34952
|
-
height =
|
|
35074
|
+
return Promise.resolve(getFrame(URL.createObjectURL(file), 0)).then(function (_ref8) {
|
|
35075
|
+
var thumb = _ref8.thumb,
|
|
35076
|
+
width = _ref8.width,
|
|
35077
|
+
height = _ref8.height;
|
|
34953
35078
|
metas.tmb = thumb;
|
|
34954
35079
|
metas.width = width;
|
|
34955
35080
|
metas.height = height;
|
|
@@ -34957,7 +35082,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34957
35082
|
});
|
|
34958
35083
|
}
|
|
34959
35084
|
}();
|
|
34960
|
-
return
|
|
35085
|
+
return _temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8);
|
|
34961
35086
|
} else {
|
|
34962
35087
|
setAttachments(function (prevState) {
|
|
34963
35088
|
return [].concat(prevState, [{
|
|
@@ -34972,23 +35097,23 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
34972
35097
|
});
|
|
34973
35098
|
}
|
|
34974
35099
|
}();
|
|
34975
|
-
if (
|
|
35100
|
+
if (_temp14 && _temp14.then) return _temp14.then(function () {});
|
|
34976
35101
|
}
|
|
34977
35102
|
}();
|
|
34978
|
-
if (
|
|
35103
|
+
if (_temp1 && _temp1.then) return _temp1.then(function () {});
|
|
34979
35104
|
}
|
|
34980
35105
|
}();
|
|
34981
|
-
if (
|
|
35106
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
34982
35107
|
}
|
|
34983
35108
|
var dataFromDb;
|
|
34984
|
-
var
|
|
35109
|
+
var _temp11 = _catch(function () {
|
|
34985
35110
|
return Promise.resolve(_getDataFromDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, checksumHash, 'checksum')).then(function (_getDataFromDB) {
|
|
34986
35111
|
dataFromDb = _getDataFromDB;
|
|
34987
35112
|
});
|
|
34988
35113
|
}, function (e) {
|
|
34989
35114
|
log.error('error in get data from db . . . . ', e);
|
|
34990
35115
|
});
|
|
34991
|
-
return
|
|
35116
|
+
return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
|
|
34992
35117
|
});
|
|
34993
35118
|
} catch (e) {
|
|
34994
35119
|
return Promise.reject(e);
|
|
@@ -35635,10 +35760,10 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
35635
35760
|
showRecording: showRecording
|
|
35636
35761
|
}))))))))));
|
|
35637
35762
|
};
|
|
35638
|
-
var SendMessageWrapper = styled__default.div(_templateObject$I || (_templateObject$I = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n"])), function (props) {
|
|
35763
|
+
var SendMessageWrapper = styled__default.div(_templateObject$I || (_templateObject$I = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n position: relative;\n z-index: 15;\n"])), function (props) {
|
|
35639
35764
|
return props.backgroundColor;
|
|
35640
35765
|
});
|
|
35641
|
-
var Container$k = styled__default.div(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n margin: ", ";\n border: ", ";\n border-radius: ", ";\n position: relative;\n padding: ", ";\n\n & span.rdw-suggestion-dropdown {\n position: absolute;\n bottom: 100%;\n height: 160px;\n min-width: 150px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n padding: 6px 12px;\n border: 1px solid #ccc;\n background: #fff;\n z-index: 99;\n }\n\n & .text_formatting_toolbar {\n display: ", ";\n position: fixed;\n top: ", ";\n left: ", ";\n }\n\n & .rdw-suggestion-option-active {\n background-color: rgb(243, 245, 248);\n }\n\n & .custom_editor {\n cursor: text;\n\n & .rdw-mention-link {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
35766
|
+
var Container$k = styled__default.div(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n margin: ", ";\n border: ", ";\n border-radius: ", ";\n position: relative;\n padding: ", ";\n z-index: 15;\n\n & span.rdw-suggestion-dropdown {\n position: absolute;\n bottom: 100%;\n height: 160px;\n min-width: 150px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n padding: 6px 12px;\n border: 1px solid #ccc;\n background: #fff;\n z-index: 99;\n }\n\n & .text_formatting_toolbar {\n display: ", ";\n position: fixed;\n top: ", ";\n left: ", ";\n }\n\n & .rdw-suggestion-option-active {\n background-color: rgb(243, 245, 248);\n }\n\n & .custom_editor {\n cursor: text;\n\n & .rdw-mention-link {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
35642
35767
|
return props.margin || '30px 0 16px';
|
|
35643
35768
|
}, function (props) {
|
|
35644
35769
|
return props.border || '';
|
|
@@ -35750,7 +35875,7 @@ var TypingIndicatorCont = styled__default.div(_templateObject18$2 || (_templateO
|
|
|
35750
35875
|
var TypingFrom = styled__default.h5(_templateObject19$2 || (_templateObject19$2 = _taggedTemplateLiteralLoose(["\n margin: 0 4px 0 0;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: -0.2px;\n color: ", ";\n"])), function (props) {
|
|
35751
35876
|
return props.color;
|
|
35752
35877
|
});
|
|
35753
|
-
var sizeAnimation = styled.keyframes(_templateObject20$
|
|
35878
|
+
var sizeAnimation = styled.keyframes(_templateObject20$2 || (_templateObject20$2 = _taggedTemplateLiteralLoose(["\n 0% {\n width: 2px;\n height: 2px;\n opacity: 0.4;\n }\n 50% {\n width: 2px;\n height: 2px;\n opacity: 0.4;\n }\n 100% {\n width: 6px;\n height: 6px;\n opacity: 1;\n }\n"])));
|
|
35754
35879
|
var DotOne = styled__default.span(_templateObject21$1 || (_templateObject21$1 = _taggedTemplateLiteralLoose([""])));
|
|
35755
35880
|
var DotTwo = styled__default.span(_templateObject22$1 || (_templateObject22$1 = _taggedTemplateLiteralLoose([""])));
|
|
35756
35881
|
var DotThree = styled__default.span(_templateObject23$1 || (_templateObject23$1 = _taggedTemplateLiteralLoose([""])));
|
|
@@ -38713,7 +38838,9 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
38713
38838
|
unreadCountWidth = _ref.unreadCountWidth,
|
|
38714
38839
|
unreadCountHeight = _ref.unreadCountHeight,
|
|
38715
38840
|
unreadCountFontSize = _ref.unreadCountFontSize,
|
|
38716
|
-
unreadCountTextColor = _ref.unreadCountTextColor
|
|
38841
|
+
unreadCountTextColor = _ref.unreadCountTextColor,
|
|
38842
|
+
_ref$animateFrom = _ref.animateFrom,
|
|
38843
|
+
animateFrom = _ref$animateFrom === void 0 ? 'bottom' : _ref$animateFrom;
|
|
38717
38844
|
var _useColor = useColors(),
|
|
38718
38845
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
38719
38846
|
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS];
|
|
@@ -38736,12 +38863,8 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
38736
38863
|
if (repliedMessage) {
|
|
38737
38864
|
var scrollRef = document.getElementById('scrollableDiv');
|
|
38738
38865
|
if (scrollRef) {
|
|
38739
|
-
scrollRef.scrollTop = repliedMessage.offsetTop
|
|
38866
|
+
scrollRef.scrollTop = repliedMessage.offsetTop;
|
|
38740
38867
|
}
|
|
38741
|
-
repliedMessage.classList.add('highlight');
|
|
38742
|
-
setTimeout(function () {
|
|
38743
|
-
repliedMessage.classList.remove('highlight');
|
|
38744
|
-
}, 1000);
|
|
38745
38868
|
}
|
|
38746
38869
|
} else {
|
|
38747
38870
|
dispatch(getMessagesAC(channel, undefined, messageId));
|
|
@@ -38751,7 +38874,9 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
38751
38874
|
return Promise.reject(e);
|
|
38752
38875
|
}
|
|
38753
38876
|
};
|
|
38754
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null,
|
|
38877
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(BottomButton, {
|
|
38878
|
+
show: !!showScrollToNewMessageButton,
|
|
38879
|
+
animateFrom: animateFrom,
|
|
38755
38880
|
theme: theme,
|
|
38756
38881
|
width: buttonWidth,
|
|
38757
38882
|
height: buttonHeight,
|
|
@@ -38771,12 +38896,16 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
38771
38896
|
fontSize: unreadCountFontSize,
|
|
38772
38897
|
backgroundColor: accentColor,
|
|
38773
38898
|
isMuted: channel.muted
|
|
38774
|
-
}, channel.newMessageCount ? channel.newMessageCount > 99 ? '99+' : channel.newMessageCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgChevronDown, null)))
|
|
38899
|
+
}, channel.newMessageCount ? channel.newMessageCount > 99 ? '99+' : channel.newMessageCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgChevronDown, null)));
|
|
38775
38900
|
};
|
|
38776
|
-
var BottomButton = styled__default.div(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose(["\n position: absolute;\n
|
|
38777
|
-
return props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) + "px";
|
|
38901
|
+
var BottomButton = styled__default.div(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose(["\n transition: all 0.3s ease-in-out;\n position: absolute;\n ", ";\n\n ", ";\n\n ", ";\n right: ", "px;\n\n margin-right: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 50px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n z-index: 14;\n & > svg {\n color: rgba(129, 140, 153, 1);\n }\n\n & > span {\n bottom: 32px;\n right: 0;\n }\n"])), function (props) {
|
|
38902
|
+
return props.animateFrom === 'bottom' && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) - 130) + "px";
|
|
38778
38903
|
}, function (props) {
|
|
38779
|
-
return (props.rightPosition === undefined ? 16 : props.rightPosition) + "px";
|
|
38904
|
+
return props.animateFrom === 'right' && "right: " + (props.rightPosition === undefined ? 16 : props.rightPosition - 100) + "px";
|
|
38905
|
+
}, function (props) {
|
|
38906
|
+
return props.show && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition)) + "px";
|
|
38907
|
+
}, function (props) {
|
|
38908
|
+
return props.rightPosition === undefined ? 16 : props.rightPosition;
|
|
38780
38909
|
}, function (props) {
|
|
38781
38910
|
return props.backgroundColor;
|
|
38782
38911
|
});
|
|
@@ -38838,7 +38967,9 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
38838
38967
|
unreadCountWidth = _ref.unreadCountWidth,
|
|
38839
38968
|
unreadCountHeight = _ref.unreadCountHeight,
|
|
38840
38969
|
unreadCountFontSize = _ref.unreadCountFontSize,
|
|
38841
|
-
unreadCountTextColor = _ref.unreadCountTextColor
|
|
38970
|
+
unreadCountTextColor = _ref.unreadCountTextColor,
|
|
38971
|
+
_ref$animateFrom = _ref.animateFrom,
|
|
38972
|
+
animateFrom = _ref$animateFrom === void 0 ? 'bottom' : _ref$animateFrom;
|
|
38842
38973
|
var _useColor = useColors(),
|
|
38843
38974
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
38844
38975
|
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS];
|
|
@@ -38848,19 +38979,41 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
38848
38979
|
var sendMessageInputHeight = reactRedux.useSelector(sendMessageInputHeightSelector);
|
|
38849
38980
|
var showScrollToNewMessageButton = reactRedux.useSelector(showScrollToNewMessageButtonSelector);
|
|
38850
38981
|
var messages = reactRedux.useSelector(activeChannelMessagesSelector) || [];
|
|
38851
|
-
var
|
|
38852
|
-
|
|
38853
|
-
|
|
38854
|
-
|
|
38855
|
-
|
|
38856
|
-
|
|
38857
|
-
|
|
38982
|
+
var isMessageRead = React.useCallback(function (messageId) {
|
|
38983
|
+
var _message$userMarkers;
|
|
38984
|
+
var message = messages.find(function (msg) {
|
|
38985
|
+
return msg.id === messageId;
|
|
38986
|
+
});
|
|
38987
|
+
return message === null || message === void 0 ? void 0 : (_message$userMarkers = message.userMarkers) === null || _message$userMarkers === void 0 ? void 0 : _message$userMarkers.find(function (marker) {
|
|
38988
|
+
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
38989
|
+
});
|
|
38990
|
+
}, [messages]);
|
|
38991
|
+
var _handleScrollToMentions = function handleScrollToMentions(mentionsIds) {
|
|
38992
|
+
var newMentionsIds = [].concat(mentionsIds);
|
|
38993
|
+
var isRead = isMessageRead(mentionsIds[0]);
|
|
38994
|
+
if (!isRead) {
|
|
38995
|
+
handleScrollToMentionedMessage(mentionsIds[0]);
|
|
38996
|
+
dispatch(markMessagesAsReadAC(channel.id, [mentionsIds[0]]));
|
|
38997
|
+
newMentionsIds = mentionsIds.slice(1);
|
|
38858
38998
|
dispatch(updateChannelDataAC(channel.id, {
|
|
38859
|
-
mentionsIds:
|
|
38999
|
+
mentionsIds: newMentionsIds
|
|
38860
39000
|
}));
|
|
39001
|
+
} else {
|
|
39002
|
+
newMentionsIds = mentionsIds.slice(1);
|
|
39003
|
+
if (newMentionsIds.length > 0) {
|
|
39004
|
+
_handleScrollToMentions(newMentionsIds);
|
|
39005
|
+
} else {
|
|
39006
|
+
dispatch(updateChannelDataAC(channel.id, {
|
|
39007
|
+
mentionsIds: []
|
|
39008
|
+
}));
|
|
39009
|
+
return;
|
|
39010
|
+
}
|
|
39011
|
+
}
|
|
39012
|
+
if (channel.newMentionCount >= 3 && (!newMentionsIds || newMentionsIds.length < 3)) {
|
|
39013
|
+
dispatch(getChannelMentionsAC(channel.id));
|
|
38861
39014
|
}
|
|
38862
39015
|
};
|
|
38863
|
-
var
|
|
39016
|
+
var handleScrollToMentionedMessage = function handleScrollToMentionedMessage(messageId) {
|
|
38864
39017
|
try {
|
|
38865
39018
|
if (messages.findIndex(function (msg) {
|
|
38866
39019
|
return msg.id === messageId;
|
|
@@ -38869,12 +39022,38 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
38869
39022
|
if (repliedMessage) {
|
|
38870
39023
|
var scrollRef = document.getElementById('scrollableDiv');
|
|
38871
39024
|
if (scrollRef) {
|
|
38872
|
-
|
|
39025
|
+
var handleScrollEnd = function handleScrollEnd() {
|
|
39026
|
+
dispatch(setScrollToMentionedMessageAC(false));
|
|
39027
|
+
};
|
|
39028
|
+
var _handleScrollEndEvent = function handleScrollEndEvent() {
|
|
39029
|
+
scrollRef.removeEventListener('scrollend', _handleScrollEndEvent);
|
|
39030
|
+
handleScrollEnd();
|
|
39031
|
+
};
|
|
39032
|
+
var scrollTimeout;
|
|
39033
|
+
var _handleScrollEvent = function handleScrollEvent() {
|
|
39034
|
+
clearTimeout(scrollTimeout);
|
|
39035
|
+
scrollTimeout = setTimeout(function () {
|
|
39036
|
+
scrollRef.removeEventListener('scroll', _handleScrollEvent);
|
|
39037
|
+
handleScrollEnd();
|
|
39038
|
+
}, 150);
|
|
39039
|
+
};
|
|
39040
|
+
if ('onscrollend' in scrollRef) {
|
|
39041
|
+
;
|
|
39042
|
+
scrollRef.addEventListener('scrollend', _handleScrollEndEvent);
|
|
39043
|
+
} else {
|
|
39044
|
+
;
|
|
39045
|
+
scrollRef.addEventListener('scroll', _handleScrollEvent);
|
|
39046
|
+
}
|
|
39047
|
+
dispatch(setScrollToMentionedMessageAC(true));
|
|
39048
|
+
scrollRef.scrollTo({
|
|
39049
|
+
top: repliedMessage.offsetTop - scrollRef.offsetHeight / 2,
|
|
39050
|
+
behavior: 'smooth'
|
|
39051
|
+
});
|
|
38873
39052
|
}
|
|
38874
39053
|
repliedMessage.classList.add('highlight');
|
|
38875
39054
|
setTimeout(function () {
|
|
38876
39055
|
repliedMessage.classList.remove('highlight');
|
|
38877
|
-
},
|
|
39056
|
+
}, 1500);
|
|
38878
39057
|
}
|
|
38879
39058
|
} else {
|
|
38880
39059
|
dispatch(getMessagesAC(channel, undefined, messageId));
|
|
@@ -38889,8 +39068,10 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
38889
39068
|
dispatch(getChannelMentionsAC(channel.id));
|
|
38890
39069
|
}
|
|
38891
39070
|
}, [channel.newMentionCount]);
|
|
38892
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null,
|
|
39071
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(BottomButton$1, {
|
|
38893
39072
|
theme: theme,
|
|
39073
|
+
animateFrom: animateFrom,
|
|
39074
|
+
show: !!channel.newMentionCount,
|
|
38894
39075
|
width: buttonWidth,
|
|
38895
39076
|
height: buttonHeight,
|
|
38896
39077
|
border: buttonBorder,
|
|
@@ -38898,7 +39079,9 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
38898
39079
|
backgroundColor: buttonBackgroundColor || backgroundSections,
|
|
38899
39080
|
hoverBackgroundColor: buttonHoverBackgroundColor,
|
|
38900
39081
|
shadow: buttonShadow,
|
|
38901
|
-
onClick:
|
|
39082
|
+
onClick: function onClick() {
|
|
39083
|
+
return _handleScrollToMentions(channel.mentionsIds || []);
|
|
39084
|
+
},
|
|
38902
39085
|
bottomOffset: sendMessageInputHeight,
|
|
38903
39086
|
bottomPosition: bottomPosition,
|
|
38904
39087
|
showsUnreadMentionsButton: !!showScrollToNewMessageButton,
|
|
@@ -38910,10 +39093,14 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
38910
39093
|
fontSize: unreadCountFontSize,
|
|
38911
39094
|
backgroundColor: accentColor,
|
|
38912
39095
|
isMuted: channel.muted
|
|
38913
|
-
}, channel.newMentionCount ? channel.newMentionCount > 99 ? '99+' : channel.newMentionCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgMention, null)))
|
|
39096
|
+
}, channel.newMentionCount ? channel.newMentionCount > 99 ? '99+' : channel.newMentionCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgMention, null)));
|
|
38914
39097
|
};
|
|
38915
|
-
var BottomButton$1 = styled__default.div(_templateObject$X || (_templateObject$X = _taggedTemplateLiteralLoose(["\n position: absolute;\n
|
|
38916
|
-
return props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) + (props.showsUnreadMentionsButton ? 60 : 0) + "px";
|
|
39098
|
+
var BottomButton$1 = styled__default.div(_templateObject$X || (_templateObject$X = _taggedTemplateLiteralLoose(["\n transition: all 0.3s ease-in-out;\n position: absolute;\n ", ";\n\n ", ";\n\n ", ";\n right: ", ";\n margin-right: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 50px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n z-index: 14;\n\n & > svg {\n color: rgba(129, 140, 153, 1);\n }\n\n & > span {\n bottom: 32px;\n right: 0;\n }\n"])), function (props) {
|
|
39099
|
+
return props.animateFrom === 'bottom' && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) + (props.showsUnreadMentionsButton ? 60 : 0) - 180) + "px";
|
|
39100
|
+
}, function (props) {
|
|
39101
|
+
return props.animateFrom === 'right' && "right: " + (props.rightPosition === undefined ? 16 : props.rightPosition - 100) + "px";
|
|
39102
|
+
}, function (props) {
|
|
39103
|
+
return props.show && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) + (props.showsUnreadMentionsButton ? 60 : 0)) + "px";
|
|
38917
39104
|
}, function (props) {
|
|
38918
39105
|
return (props.rightPosition === undefined ? 16 : props.rightPosition) + "px";
|
|
38919
39106
|
}, function (props) {
|