sceyt-chat-react-uikit 1.9.0-beta.10 → 1.9.0-beta.12
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/ChannelList/index.d.ts +2 -0
- package/index.js +34 -17
- package/index.modern.js +34 -17
- package/package.json +1 -1
|
@@ -32,6 +32,8 @@ interface IChannelListProps {
|
|
|
32
32
|
searchInputBorderRadius?: string;
|
|
33
33
|
searchChannelsPadding?: string;
|
|
34
34
|
getSelectedChannel?: (channel: IChannel) => void;
|
|
35
|
+
/** Called whenever the raw channel-search input changes, including clear. */
|
|
36
|
+
onSearchValueChange?: (value: string) => void;
|
|
35
37
|
filter?: {
|
|
36
38
|
channelType?: string;
|
|
37
39
|
};
|
package/index.js
CHANGED
|
@@ -11139,7 +11139,7 @@ var compressAndCacheImage = function compressAndCacheImage(url, cacheKey, maxWid
|
|
|
11139
11139
|
|
|
11140
11140
|
var bytesToSize = function bytesToSize(bytes, decimals) {
|
|
11141
11141
|
if (decimals === void 0) {
|
|
11142
|
-
decimals =
|
|
11142
|
+
decimals = 1;
|
|
11143
11143
|
}
|
|
11144
11144
|
if (bytes === 0) return '0 Bytes';
|
|
11145
11145
|
var k = 1000;
|
|
@@ -36535,6 +36535,7 @@ var ChannelList = function ChannelList(_ref2) {
|
|
|
36535
36535
|
List = _ref2.List,
|
|
36536
36536
|
ListItem = _ref2.ListItem,
|
|
36537
36537
|
getSelectedChannel = _ref2.getSelectedChannel,
|
|
36538
|
+
onSearchValueChange = _ref2.onSearchValueChange,
|
|
36538
36539
|
Profile = _ref2.Profile,
|
|
36539
36540
|
CreateChannel = _ref2.CreateChannel,
|
|
36540
36541
|
ChannelsTitle = _ref2.ChannelsTitle,
|
|
@@ -36663,10 +36664,13 @@ var ChannelList = function ChannelList(_ref2) {
|
|
|
36663
36664
|
getMyChannels();
|
|
36664
36665
|
};
|
|
36665
36666
|
var handleSearchValueChange = function handleSearchValueChange(e) {
|
|
36666
|
-
|
|
36667
|
+
var value = e.target.value;
|
|
36668
|
+
setSearchValue(value);
|
|
36669
|
+
onSearchValueChange === null || onSearchValueChange === void 0 ? void 0 : onSearchValueChange(value);
|
|
36667
36670
|
};
|
|
36668
36671
|
var getMyChannels = function getMyChannels() {
|
|
36669
36672
|
setSearchValue('');
|
|
36673
|
+
onSearchValueChange === null || onSearchValueChange === void 0 ? void 0 : onSearchValueChange('');
|
|
36670
36674
|
};
|
|
36671
36675
|
var handleOpenProfile = function handleOpenProfile() {
|
|
36672
36676
|
setProfileIsOpen(!profileIsOpen);
|
|
@@ -41206,7 +41210,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
41206
41210
|
}, _formatLargeText(isPreview ? attachment.data.name : attachment.name, fileAttachmentWidth ? fileAttachmentWidth / 12.5 : isPreview ? 18 : 30)), /*#__PURE__*/React__default.createElement(AttachmentSize, {
|
|
41207
41211
|
color: selectedFileAttachmentsSizeColor || textSecondary,
|
|
41208
41212
|
errorColor: errorColor
|
|
41209
|
-
}, (isInUploadingState || downloadingFile) && sizeProgress ? bytesToSize(sizeProgress.loaded, 1) + " \u2022 " + bytesToSize(sizeProgress.total, 1) : (attachment.data && attachment.data.size || attachment.size) && bytesToSize(isPreview ? attachment.data.size : +attachment.size)))), isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
|
|
41213
|
+
}, (isInUploadingState || downloadingFile) && sizeProgress ? bytesToSize(sizeProgress.loaded, 1) + " \u2022 " + bytesToSize(sizeProgress.total, 1) : (attachment.data && attachment.data.size || attachment.size) && bytesToSize(isPreview ? attachment.data.size : +attachment.size, 1)))), isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
|
|
41210
41214
|
"$backgroundColor": background,
|
|
41211
41215
|
color: iconPrimary,
|
|
41212
41216
|
onClick: function onClick() {
|
|
@@ -50788,9 +50792,10 @@ var MESSAGE_ACTIONS_HOVER_DELAY = 450;
|
|
|
50788
50792
|
var MESSAGE_ACTIONS_FLIP_THRESHOLD = 110;
|
|
50789
50793
|
var MAX_SELECTED_MESSAGES = 30;
|
|
50790
50794
|
var EMOJI_POPUP_THRESHOLD = 300;
|
|
50795
|
+
var PIN_TYPE_PERSONAL$1 = 1;
|
|
50791
50796
|
var lastMediaItemClickTime = 0;
|
|
50792
50797
|
var Message$1 = function Message(_ref) {
|
|
50793
|
-
var _tabIsActiveRef$curre, _message$pinDetails, _message$reactionTota;
|
|
50798
|
+
var _tabIsActiveRef$curre, _message$pinDetails, _channel$members, _message$reactionTota;
|
|
50794
50799
|
var message = _ref.message,
|
|
50795
50800
|
channel = _ref.channel,
|
|
50796
50801
|
MessageActionsMenu = _ref.MessageActionsMenu,
|
|
@@ -51021,6 +51026,8 @@ var Message$1 = function Message(_ref) {
|
|
|
51021
51026
|
}, [pins, message.id, message.tid]);
|
|
51022
51027
|
var isPinned = !!((_message$pinDetails = message.pinDetails) !== null && _message$pinDetails !== void 0 && _message$pinDetails.pinned) || !!pinnedMessage;
|
|
51023
51028
|
var canPinForAll = checkActionPermission('pinMessage');
|
|
51029
|
+
var user = getClient().user;
|
|
51030
|
+
var isSelfChannel = (channel === null || channel === void 0 ? void 0 : channel.type) === DEFAULT_CHANNEL_TYPE.DIRECT && (channel === null || channel === void 0 ? void 0 : channel.memberCount) === 1 && (channel === null || channel === void 0 ? void 0 : (_channel$members = channel.members) === null || _channel$members === void 0 ? void 0 : _channel$members.length) > 0 && (channel === null || channel === void 0 ? void 0 : channel.members[0].id) === (user === null || user === void 0 ? void 0 : user.id);
|
|
51024
51031
|
var messageItemRef = React.useRef(null);
|
|
51025
51032
|
var isVisible = useOnScreen(messageItemRef);
|
|
51026
51033
|
var _useState = React.useState(false),
|
|
@@ -51045,7 +51052,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51045
51052
|
var nextMessageFirstInInterval = !nextMessage || nextDay !== null && nextDay.diff(current, 'days') !== 0 || nextMessage.type === exports.MESSAGE_TYPE.SYSTEM || nextMessageStartsUnreadSection;
|
|
51046
51053
|
var messageTimeVisible = showMessageTime && (showMessageTimeForEachMessage || !nextMessage);
|
|
51047
51054
|
var messageStatusVisible = !message.incoming && showMessageStatus && message.state !== MESSAGE_STATUS.DELETE && (showMessageStatusForEachMessage || !nextMessage);
|
|
51048
|
-
var renderAvatar = (!!prevMessageUserID || ifLatestAndHasNotPreview) && (prevMessageUserID !== messageUserID || firstMessageInInterval) && !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar);
|
|
51055
|
+
var renderAvatar = (!!prevMessageUserID || ifLatestAndHasNotPreview) && (prevMessageUserID !== messageUserID || firstMessageInInterval) && !(isPinnedMessagesList && channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) && !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar);
|
|
51049
51056
|
var selectionIsActive = selectedMessagesMap && selectedMessagesMap.size > 0;
|
|
51050
51057
|
var isSelectedMessage = selectedMessagesMap && selectedMessagesMap.get(message.id || message.tid);
|
|
51051
51058
|
var tooManySelected = selectedMessagesMap && selectedMessagesMap.size >= MAX_SELECTED_MESSAGES;
|
|
@@ -51098,11 +51105,16 @@ var Message$1 = function Message(_ref) {
|
|
|
51098
51105
|
setMessageActionsShow(false);
|
|
51099
51106
|
}, [channel.id, isPinnedMessagesList, message.id, message.tid, setInfoPopupOpen, setMessageActionsShow]);
|
|
51100
51107
|
var handleTogglePinMessagePopup = React.useCallback(function () {
|
|
51108
|
+
if (isSelfChannel) {
|
|
51109
|
+
dispatch(pinMessageAC(channel.id, message, PIN_TYPE_PERSONAL$1));
|
|
51110
|
+
setMessageActionsShow(false);
|
|
51111
|
+
return;
|
|
51112
|
+
}
|
|
51101
51113
|
setPinPopupOpen(function (prev) {
|
|
51102
51114
|
return !prev;
|
|
51103
51115
|
});
|
|
51104
51116
|
setMessageActionsShow(false);
|
|
51105
|
-
}, [
|
|
51117
|
+
}, [channel.id, dispatch, isSelfChannel, message, setMessageActionsShow, setPinPopupOpen]);
|
|
51106
51118
|
var handlePinMessage = React.useCallback(function (scope) {
|
|
51107
51119
|
dispatch(pinMessageAC(channel.id, message, scope));
|
|
51108
51120
|
setPinPopupOpen(false);
|
|
@@ -51296,6 +51308,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51296
51308
|
}
|
|
51297
51309
|
}, [dispatch, selectionIsActive]);
|
|
51298
51310
|
React.useEffect(function () {
|
|
51311
|
+
if (isPinnedMessagesList) return;
|
|
51299
51312
|
if (isVisible) {
|
|
51300
51313
|
if (setLastVisibleMessageId) {
|
|
51301
51314
|
setLastVisibleMessageId(message);
|
|
@@ -51308,12 +51321,13 @@ var Message$1 = function Message(_ref) {
|
|
|
51308
51321
|
} else {
|
|
51309
51322
|
dispatch(removeVisibleMessageAC(message));
|
|
51310
51323
|
}
|
|
51311
|
-
}, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, isTabActive]);
|
|
51324
|
+
}, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, isTabActive, isPinnedMessagesList]);
|
|
51312
51325
|
React.useEffect(function () {
|
|
51326
|
+
if (isPinnedMessagesList) return undefined;
|
|
51313
51327
|
return function () {
|
|
51314
51328
|
dispatch(removeVisibleMessageAC(message));
|
|
51315
51329
|
};
|
|
51316
|
-
}, [dispatch, message]);
|
|
51330
|
+
}, [dispatch, isPinnedMessagesList, message]);
|
|
51317
51331
|
React.useEffect(function () {
|
|
51318
51332
|
if (!isPinnedMessagesList && !isVisible && infoPopupOpen) {
|
|
51319
51333
|
setInfoPopupOpen(false);
|
|
@@ -51457,7 +51471,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51457
51471
|
selectionIsActive: selectionIsActive,
|
|
51458
51472
|
messageWidthPercent: messageWidthPercent,
|
|
51459
51473
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
51460
|
-
withAvatar: !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar),
|
|
51474
|
+
withAvatar: !(isPinnedMessagesList && channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) && !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar),
|
|
51461
51475
|
className: 'messageContent'
|
|
51462
51476
|
}, message.state === MESSAGE_STATUS.FAILED && (/*#__PURE__*/React__default.createElement(FailedMessageIcon, {
|
|
51463
51477
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
@@ -52906,7 +52920,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
52906
52920
|
isUnreadMessage: false,
|
|
52907
52921
|
nextMessageStartsUnreadSection: false,
|
|
52908
52922
|
isHighlighted: false,
|
|
52909
|
-
ifLatestAndHasNotPreview:
|
|
52923
|
+
ifLatestAndHasNotPreview: channel.type !== DEFAULT_CHANNEL_TYPE.DIRECT,
|
|
52910
52924
|
registerInMessagesIndex: false,
|
|
52911
52925
|
isPinnedMessagesList: true
|
|
52912
52926
|
});
|
|
@@ -55026,10 +55040,10 @@ var Emoji$1 = styled__default.li(_templateObject8$m || (_templateObject8$m = _ta
|
|
|
55026
55040
|
return props.hoverBackgroundColor;
|
|
55027
55041
|
});
|
|
55028
55042
|
|
|
55029
|
-
var
|
|
55043
|
+
var waitForMediaAttachmentPreparation = function waitForMediaAttachmentPreparation(attachments, preparations) {
|
|
55030
55044
|
try {
|
|
55031
55045
|
return Promise.resolve(Promise.all(attachments.filter(function (attachment) {
|
|
55032
|
-
return attachment.type === attachmentTypes.image;
|
|
55046
|
+
return attachment.type === attachmentTypes.image || getOutgoingAttachmentType(attachment) === attachmentTypes.video;
|
|
55033
55047
|
}).map(function (attachment) {
|
|
55034
55048
|
return attachment.tid ? preparations.get(attachment.tid) : undefined;
|
|
55035
55049
|
}))).then(function () {});
|
|
@@ -57083,7 +57097,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
57083
57097
|
}
|
|
57084
57098
|
var _temp = function () {
|
|
57085
57099
|
if (attachments.length) {
|
|
57086
|
-
return Promise.resolve(
|
|
57100
|
+
return Promise.resolve(waitForMediaAttachmentPreparation(attachments, attachmentPreparationPromisesRef.current)).then(function () {
|
|
57087
57101
|
var sendAsSeparateMessage = getSendAttachmentsAsSeparateMessages();
|
|
57088
57102
|
messageToSend.attachments = mergePreparedAttachmentPatches(attachments, preparedAttachmentPatchesRef.current).map(function (preparedAttachment) {
|
|
57089
57103
|
return {
|
|
@@ -57672,7 +57686,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
57672
57686
|
}
|
|
57673
57687
|
}, 0);
|
|
57674
57688
|
});
|
|
57675
|
-
if (fileType === 'image') {
|
|
57689
|
+
if (fileType === 'image' || fileType === 'video') {
|
|
57676
57690
|
attachmentPreparationPromisesRef.current.set(tid, preparationPromise);
|
|
57677
57691
|
}
|
|
57678
57692
|
return Promise.resolve();
|
|
@@ -60474,7 +60488,7 @@ var Files = function Files(_ref) {
|
|
|
60474
60488
|
fontSize: fileSizeFontSize,
|
|
60475
60489
|
lineHeight: fileSizeLineHeight,
|
|
60476
60490
|
color: filePreviewSizeColor || textSecondary
|
|
60477
|
-
}, file.size ? bytesToSize(file.size) + " \u2022 " + formatChannelDetailsDate(file.createdAt) : formatChannelDetailsDate(file.createdAt))), /*#__PURE__*/React__default.createElement(DownloadWrapper, {
|
|
60491
|
+
}, file.size ? bytesToSize(file.size, 1) + " \u2022 " + formatChannelDetailsDate(file.createdAt) : formatChannelDetailsDate(file.createdAt))), /*#__PURE__*/React__default.createElement(DownloadWrapper, {
|
|
60478
60492
|
visible: !!downloadingFilesMap[file.id],
|
|
60479
60493
|
iconColor: accentColor,
|
|
60480
60494
|
onClick: function onClick() {
|
|
@@ -64278,7 +64292,10 @@ var UnreadCount$2 = styled__default.span(_templateObject2$1c || (_templateObject
|
|
|
64278
64292
|
return props.textColor || '#fff';
|
|
64279
64293
|
});
|
|
64280
64294
|
|
|
64281
|
-
var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback) {
|
|
64295
|
+
var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback, dontCreateIfNotExists) {
|
|
64296
|
+
if (dontCreateIfNotExists === void 0) {
|
|
64297
|
+
dontCreateIfNotExists = false;
|
|
64298
|
+
}
|
|
64282
64299
|
try {
|
|
64283
64300
|
if (user) {
|
|
64284
64301
|
store.dispatch(createChannelAC({
|
|
@@ -64287,7 +64304,7 @@ var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback)
|
|
|
64287
64304
|
members: [_extends({}, user, {
|
|
64288
64305
|
role: 'owner'
|
|
64289
64306
|
})]
|
|
64290
|
-
},
|
|
64307
|
+
}, dontCreateIfNotExists, callback));
|
|
64291
64308
|
}
|
|
64292
64309
|
return Promise.resolve();
|
|
64293
64310
|
} catch (e) {
|
package/index.modern.js
CHANGED
|
@@ -11119,7 +11119,7 @@ var compressAndCacheImage = function compressAndCacheImage(url, cacheKey, maxWid
|
|
|
11119
11119
|
|
|
11120
11120
|
var bytesToSize = function bytesToSize(bytes, decimals) {
|
|
11121
11121
|
if (decimals === void 0) {
|
|
11122
|
-
decimals =
|
|
11122
|
+
decimals = 1;
|
|
11123
11123
|
}
|
|
11124
11124
|
if (bytes === 0) return '0 Bytes';
|
|
11125
11125
|
var k = 1000;
|
|
@@ -36515,6 +36515,7 @@ var ChannelList = function ChannelList(_ref2) {
|
|
|
36515
36515
|
List = _ref2.List,
|
|
36516
36516
|
ListItem = _ref2.ListItem,
|
|
36517
36517
|
getSelectedChannel = _ref2.getSelectedChannel,
|
|
36518
|
+
onSearchValueChange = _ref2.onSearchValueChange,
|
|
36518
36519
|
Profile = _ref2.Profile,
|
|
36519
36520
|
CreateChannel = _ref2.CreateChannel,
|
|
36520
36521
|
ChannelsTitle = _ref2.ChannelsTitle,
|
|
@@ -36643,10 +36644,13 @@ var ChannelList = function ChannelList(_ref2) {
|
|
|
36643
36644
|
getMyChannels();
|
|
36644
36645
|
};
|
|
36645
36646
|
var handleSearchValueChange = function handleSearchValueChange(e) {
|
|
36646
|
-
|
|
36647
|
+
var value = e.target.value;
|
|
36648
|
+
setSearchValue(value);
|
|
36649
|
+
onSearchValueChange === null || onSearchValueChange === void 0 ? void 0 : onSearchValueChange(value);
|
|
36647
36650
|
};
|
|
36648
36651
|
var getMyChannels = function getMyChannels() {
|
|
36649
36652
|
setSearchValue('');
|
|
36653
|
+
onSearchValueChange === null || onSearchValueChange === void 0 ? void 0 : onSearchValueChange('');
|
|
36650
36654
|
};
|
|
36651
36655
|
var handleOpenProfile = function handleOpenProfile() {
|
|
36652
36656
|
setProfileIsOpen(!profileIsOpen);
|
|
@@ -41186,7 +41190,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
41186
41190
|
}, _formatLargeText(isPreview ? attachment.data.name : attachment.name, fileAttachmentWidth ? fileAttachmentWidth / 12.5 : isPreview ? 18 : 30)), /*#__PURE__*/React__default.createElement(AttachmentSize, {
|
|
41187
41191
|
color: selectedFileAttachmentsSizeColor || textSecondary,
|
|
41188
41192
|
errorColor: errorColor
|
|
41189
|
-
}, (isInUploadingState || downloadingFile) && sizeProgress ? bytesToSize(sizeProgress.loaded, 1) + " \u2022 " + bytesToSize(sizeProgress.total, 1) : (attachment.data && attachment.data.size || attachment.size) && bytesToSize(isPreview ? attachment.data.size : +attachment.size)))), isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
|
|
41193
|
+
}, (isInUploadingState || downloadingFile) && sizeProgress ? bytesToSize(sizeProgress.loaded, 1) + " \u2022 " + bytesToSize(sizeProgress.total, 1) : (attachment.data && attachment.data.size || attachment.size) && bytesToSize(isPreview ? attachment.data.size : +attachment.size, 1)))), isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
|
|
41190
41194
|
"$backgroundColor": background,
|
|
41191
41195
|
color: iconPrimary,
|
|
41192
41196
|
onClick: function onClick() {
|
|
@@ -50768,9 +50772,10 @@ var MESSAGE_ACTIONS_HOVER_DELAY = 450;
|
|
|
50768
50772
|
var MESSAGE_ACTIONS_FLIP_THRESHOLD = 110;
|
|
50769
50773
|
var MAX_SELECTED_MESSAGES = 30;
|
|
50770
50774
|
var EMOJI_POPUP_THRESHOLD = 300;
|
|
50775
|
+
var PIN_TYPE_PERSONAL$1 = 1;
|
|
50771
50776
|
var lastMediaItemClickTime = 0;
|
|
50772
50777
|
var Message$1 = function Message(_ref) {
|
|
50773
|
-
var _tabIsActiveRef$curre, _message$pinDetails, _message$reactionTota;
|
|
50778
|
+
var _tabIsActiveRef$curre, _message$pinDetails, _channel$members, _message$reactionTota;
|
|
50774
50779
|
var message = _ref.message,
|
|
50775
50780
|
channel = _ref.channel,
|
|
50776
50781
|
MessageActionsMenu = _ref.MessageActionsMenu,
|
|
@@ -51001,6 +51006,8 @@ var Message$1 = function Message(_ref) {
|
|
|
51001
51006
|
}, [pins, message.id, message.tid]);
|
|
51002
51007
|
var isPinned = !!((_message$pinDetails = message.pinDetails) !== null && _message$pinDetails !== void 0 && _message$pinDetails.pinned) || !!pinnedMessage;
|
|
51003
51008
|
var canPinForAll = checkActionPermission('pinMessage');
|
|
51009
|
+
var user = getClient().user;
|
|
51010
|
+
var isSelfChannel = (channel === null || channel === void 0 ? void 0 : channel.type) === DEFAULT_CHANNEL_TYPE.DIRECT && (channel === null || channel === void 0 ? void 0 : channel.memberCount) === 1 && (channel === null || channel === void 0 ? void 0 : (_channel$members = channel.members) === null || _channel$members === void 0 ? void 0 : _channel$members.length) > 0 && (channel === null || channel === void 0 ? void 0 : channel.members[0].id) === (user === null || user === void 0 ? void 0 : user.id);
|
|
51004
51011
|
var messageItemRef = useRef(null);
|
|
51005
51012
|
var isVisible = useOnScreen(messageItemRef);
|
|
51006
51013
|
var _useState = useState(false),
|
|
@@ -51025,7 +51032,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51025
51032
|
var nextMessageFirstInInterval = !nextMessage || nextDay !== null && nextDay.diff(current, 'days') !== 0 || nextMessage.type === MESSAGE_TYPE.SYSTEM || nextMessageStartsUnreadSection;
|
|
51026
51033
|
var messageTimeVisible = showMessageTime && (showMessageTimeForEachMessage || !nextMessage);
|
|
51027
51034
|
var messageStatusVisible = !message.incoming && showMessageStatus && message.state !== MESSAGE_STATUS.DELETE && (showMessageStatusForEachMessage || !nextMessage);
|
|
51028
|
-
var renderAvatar = (!!prevMessageUserID || ifLatestAndHasNotPreview) && (prevMessageUserID !== messageUserID || firstMessageInInterval) && !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar);
|
|
51035
|
+
var renderAvatar = (!!prevMessageUserID || ifLatestAndHasNotPreview) && (prevMessageUserID !== messageUserID || firstMessageInInterval) && !(isPinnedMessagesList && channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) && !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar);
|
|
51029
51036
|
var selectionIsActive = selectedMessagesMap && selectedMessagesMap.size > 0;
|
|
51030
51037
|
var isSelectedMessage = selectedMessagesMap && selectedMessagesMap.get(message.id || message.tid);
|
|
51031
51038
|
var tooManySelected = selectedMessagesMap && selectedMessagesMap.size >= MAX_SELECTED_MESSAGES;
|
|
@@ -51078,11 +51085,16 @@ var Message$1 = function Message(_ref) {
|
|
|
51078
51085
|
setMessageActionsShow(false);
|
|
51079
51086
|
}, [channel.id, isPinnedMessagesList, message.id, message.tid, setInfoPopupOpen, setMessageActionsShow]);
|
|
51080
51087
|
var handleTogglePinMessagePopup = useCallback(function () {
|
|
51088
|
+
if (isSelfChannel) {
|
|
51089
|
+
dispatch(pinMessageAC(channel.id, message, PIN_TYPE_PERSONAL$1));
|
|
51090
|
+
setMessageActionsShow(false);
|
|
51091
|
+
return;
|
|
51092
|
+
}
|
|
51081
51093
|
setPinPopupOpen(function (prev) {
|
|
51082
51094
|
return !prev;
|
|
51083
51095
|
});
|
|
51084
51096
|
setMessageActionsShow(false);
|
|
51085
|
-
}, [
|
|
51097
|
+
}, [channel.id, dispatch, isSelfChannel, message, setMessageActionsShow, setPinPopupOpen]);
|
|
51086
51098
|
var handlePinMessage = useCallback(function (scope) {
|
|
51087
51099
|
dispatch(pinMessageAC(channel.id, message, scope));
|
|
51088
51100
|
setPinPopupOpen(false);
|
|
@@ -51276,6 +51288,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51276
51288
|
}
|
|
51277
51289
|
}, [dispatch, selectionIsActive]);
|
|
51278
51290
|
useEffect(function () {
|
|
51291
|
+
if (isPinnedMessagesList) return;
|
|
51279
51292
|
if (isVisible) {
|
|
51280
51293
|
if (setLastVisibleMessageId) {
|
|
51281
51294
|
setLastVisibleMessageId(message);
|
|
@@ -51288,12 +51301,13 @@ var Message$1 = function Message(_ref) {
|
|
|
51288
51301
|
} else {
|
|
51289
51302
|
dispatch(removeVisibleMessageAC(message));
|
|
51290
51303
|
}
|
|
51291
|
-
}, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, isTabActive]);
|
|
51304
|
+
}, [isVisible, setLastVisibleMessageId, message.id, handleSendReadMarker, channel.lastMessage, scrollToNewMessage.scrollToBottom, dispatch, message, isTabActive, isPinnedMessagesList]);
|
|
51292
51305
|
useEffect(function () {
|
|
51306
|
+
if (isPinnedMessagesList) return undefined;
|
|
51293
51307
|
return function () {
|
|
51294
51308
|
dispatch(removeVisibleMessageAC(message));
|
|
51295
51309
|
};
|
|
51296
|
-
}, [dispatch, message]);
|
|
51310
|
+
}, [dispatch, isPinnedMessagesList, message]);
|
|
51297
51311
|
useEffect(function () {
|
|
51298
51312
|
if (!isPinnedMessagesList && !isVisible && infoPopupOpen) {
|
|
51299
51313
|
setInfoPopupOpen(false);
|
|
@@ -51437,7 +51451,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51437
51451
|
selectionIsActive: selectionIsActive,
|
|
51438
51452
|
messageWidthPercent: messageWidthPercent,
|
|
51439
51453
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
51440
|
-
withAvatar: !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar),
|
|
51454
|
+
withAvatar: !(isPinnedMessagesList && channel.type === DEFAULT_CHANNEL_TYPE.DIRECT) && !(channel.type === DEFAULT_CHANNEL_TYPE.DIRECT && !showSenderNameOnDirectChannel) && !(!message.incoming && !showOwnAvatar),
|
|
51441
51455
|
className: 'messageContent'
|
|
51442
51456
|
}, message.state === MESSAGE_STATUS.FAILED && (/*#__PURE__*/React__default.createElement(FailedMessageIcon, {
|
|
51443
51457
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
@@ -52886,7 +52900,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
52886
52900
|
isUnreadMessage: false,
|
|
52887
52901
|
nextMessageStartsUnreadSection: false,
|
|
52888
52902
|
isHighlighted: false,
|
|
52889
|
-
ifLatestAndHasNotPreview:
|
|
52903
|
+
ifLatestAndHasNotPreview: channel.type !== DEFAULT_CHANNEL_TYPE.DIRECT,
|
|
52890
52904
|
registerInMessagesIndex: false,
|
|
52891
52905
|
isPinnedMessagesList: true
|
|
52892
52906
|
});
|
|
@@ -55006,10 +55020,10 @@ var Emoji$1 = styled.li(_templateObject8$m || (_templateObject8$m = _taggedTempl
|
|
|
55006
55020
|
return props.hoverBackgroundColor;
|
|
55007
55021
|
});
|
|
55008
55022
|
|
|
55009
|
-
var
|
|
55023
|
+
var waitForMediaAttachmentPreparation = function waitForMediaAttachmentPreparation(attachments, preparations) {
|
|
55010
55024
|
try {
|
|
55011
55025
|
return Promise.resolve(Promise.all(attachments.filter(function (attachment) {
|
|
55012
|
-
return attachment.type === attachmentTypes.image;
|
|
55026
|
+
return attachment.type === attachmentTypes.image || getOutgoingAttachmentType(attachment) === attachmentTypes.video;
|
|
55013
55027
|
}).map(function (attachment) {
|
|
55014
55028
|
return attachment.tid ? preparations.get(attachment.tid) : undefined;
|
|
55015
55029
|
}))).then(function () {});
|
|
@@ -57063,7 +57077,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
57063
57077
|
}
|
|
57064
57078
|
var _temp = function () {
|
|
57065
57079
|
if (attachments.length) {
|
|
57066
|
-
return Promise.resolve(
|
|
57080
|
+
return Promise.resolve(waitForMediaAttachmentPreparation(attachments, attachmentPreparationPromisesRef.current)).then(function () {
|
|
57067
57081
|
var sendAsSeparateMessage = getSendAttachmentsAsSeparateMessages();
|
|
57068
57082
|
messageToSend.attachments = mergePreparedAttachmentPatches(attachments, preparedAttachmentPatchesRef.current).map(function (preparedAttachment) {
|
|
57069
57083
|
return {
|
|
@@ -57652,7 +57666,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
57652
57666
|
}
|
|
57653
57667
|
}, 0);
|
|
57654
57668
|
});
|
|
57655
|
-
if (fileType === 'image') {
|
|
57669
|
+
if (fileType === 'image' || fileType === 'video') {
|
|
57656
57670
|
attachmentPreparationPromisesRef.current.set(tid, preparationPromise);
|
|
57657
57671
|
}
|
|
57658
57672
|
return Promise.resolve();
|
|
@@ -60454,7 +60468,7 @@ var Files = function Files(_ref) {
|
|
|
60454
60468
|
fontSize: fileSizeFontSize,
|
|
60455
60469
|
lineHeight: fileSizeLineHeight,
|
|
60456
60470
|
color: filePreviewSizeColor || textSecondary
|
|
60457
|
-
}, file.size ? bytesToSize(file.size) + " \u2022 " + formatChannelDetailsDate(file.createdAt) : formatChannelDetailsDate(file.createdAt))), /*#__PURE__*/React__default.createElement(DownloadWrapper, {
|
|
60471
|
+
}, file.size ? bytesToSize(file.size, 1) + " \u2022 " + formatChannelDetailsDate(file.createdAt) : formatChannelDetailsDate(file.createdAt))), /*#__PURE__*/React__default.createElement(DownloadWrapper, {
|
|
60458
60472
|
visible: !!downloadingFilesMap[file.id],
|
|
60459
60473
|
iconColor: accentColor,
|
|
60460
60474
|
onClick: function onClick() {
|
|
@@ -64258,7 +64272,10 @@ var UnreadCount$2 = styled.span(_templateObject2$1c || (_templateObject2$1c = _t
|
|
|
64258
64272
|
return props.textColor || '#fff';
|
|
64259
64273
|
});
|
|
64260
64274
|
|
|
64261
|
-
var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback) {
|
|
64275
|
+
var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback, dontCreateIfNotExists) {
|
|
64276
|
+
if (dontCreateIfNotExists === void 0) {
|
|
64277
|
+
dontCreateIfNotExists = false;
|
|
64278
|
+
}
|
|
64262
64279
|
try {
|
|
64263
64280
|
if (user) {
|
|
64264
64281
|
store.dispatch(createChannelAC({
|
|
@@ -64267,7 +64284,7 @@ var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback)
|
|
|
64267
64284
|
members: [_extends({}, user, {
|
|
64268
64285
|
role: 'owner'
|
|
64269
64286
|
})]
|
|
64270
|
-
},
|
|
64287
|
+
}, dontCreateIfNotExists, callback));
|
|
64271
64288
|
}
|
|
64272
64289
|
return Promise.resolve();
|
|
64273
64290
|
} catch (e) {
|