sceyt-chat-react-uikit 1.7.3-beta.2 → 1.7.3-beta.4
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/ChannelList/index.d.ts +1 -0
- package/index.js +70 -32
- package/index.modern.js +70 -32
- package/package.json +1 -1
|
@@ -79,6 +79,7 @@ interface IChannelListProps {
|
|
|
79
79
|
[key: string]: IContact;
|
|
80
80
|
}, getFromContacts: boolean, warningColor: string, user: IUser, MessageText: any) => any;
|
|
81
81
|
doNotShowMessageDeliveryTypes?: string[];
|
|
82
|
+
showPhoneNumber?: boolean;
|
|
82
83
|
}
|
|
83
84
|
declare const ChannelList: React.FC<IChannelListProps>;
|
|
84
85
|
export default ChannelList;
|
package/index.js
CHANGED
|
@@ -21484,6 +21484,7 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
|
|
|
21484
21484
|
}), channel.lastReactedMessage && '"')))));
|
|
21485
21485
|
};
|
|
21486
21486
|
var Channel = function Channel(_ref3) {
|
|
21487
|
+
var _channel$members, _channel$members$, _channel$members$2;
|
|
21487
21488
|
var channel = _ref3.channel,
|
|
21488
21489
|
theme = _ref3.theme,
|
|
21489
21490
|
_ref3$showAvatar = _ref3.showAvatar,
|
|
@@ -21510,7 +21511,8 @@ var Channel = function Channel(_ref3) {
|
|
|
21510
21511
|
channelAvatarTextSize = _ref3.channelAvatarTextSize,
|
|
21511
21512
|
setSelectedChannel = _ref3.setSelectedChannel,
|
|
21512
21513
|
getCustomLatestMessage = _ref3.getCustomLatestMessage,
|
|
21513
|
-
doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes
|
|
21514
|
+
doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes,
|
|
21515
|
+
showPhoneNumber = _ref3.showPhoneNumber;
|
|
21514
21516
|
var _useColor = useColors(),
|
|
21515
21517
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
21516
21518
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -21703,7 +21705,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21703
21705
|
subjectLineHeight: channelSubjectLineHeight,
|
|
21704
21706
|
subjectColor: channelSubjectColor || textPrimary,
|
|
21705
21707
|
avatarSize: channelAvatarSize
|
|
21706
|
-
}, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
|
|
21708
|
+
}, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? showPhoneNumber && (_channel$members = channel.members) !== null && _channel$members !== void 0 && _channel$members.length && (_channel$members$ = channel.members[0]) !== null && _channel$members$ !== void 0 && _channel$members$.id ? "+" + ((_channel$members$2 = channel.members[0]) === null || _channel$members$2 === void 0 ? void 0 : _channel$members$2.id) + " (You)" : 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
|
|
21707
21709
|
color: notificationsIsMutedIconColor || iconInactive
|
|
21708
21710
|
}, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), getCustomLatestMessage ? getCustomLatestMessageComponent({
|
|
21709
21711
|
lastMessage: lastMessage,
|
|
@@ -23767,7 +23769,9 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
23767
23769
|
searchChannelsPadding = _ref.searchChannelsPadding,
|
|
23768
23770
|
getCustomLatestMessage = _ref.getCustomLatestMessage,
|
|
23769
23771
|
_ref$doNotShowMessage = _ref.doNotShowMessageDeliveryTypes,
|
|
23770
|
-
doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage
|
|
23772
|
+
doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage,
|
|
23773
|
+
_ref$showPhoneNumber = _ref.showPhoneNumber,
|
|
23774
|
+
showPhoneNumber = _ref$showPhoneNumber === void 0 ? false : _ref$showPhoneNumber;
|
|
23771
23775
|
var _useColor = useColors(),
|
|
23772
23776
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
23773
23777
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -24078,7 +24082,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24078
24082
|
contactsMap: contactsMap,
|
|
24079
24083
|
setSelectedChannel: setSelectedChannel,
|
|
24080
24084
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24081
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24085
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24086
|
+
showPhoneNumber: showPhoneNumber
|
|
24082
24087
|
}));
|
|
24083
24088
|
}))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
24084
24089
|
color: textSecondary,
|
|
@@ -24115,7 +24120,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24115
24120
|
contactsMap: contactsMap,
|
|
24116
24121
|
setSelectedChannel: setSelectedChannel,
|
|
24117
24122
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24118
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24123
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24124
|
+
showPhoneNumber: showPhoneNumber
|
|
24119
24125
|
}));
|
|
24120
24126
|
}))), !!(searchedChannels.contacts && searchedChannels.contacts.length) && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
24121
24127
|
color: textSecondary,
|
|
@@ -24184,7 +24190,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24184
24190
|
contactsMap: contactsMap,
|
|
24185
24191
|
setSelectedChannel: setSelectedChannel,
|
|
24186
24192
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24187
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24193
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24194
|
+
showPhoneNumber: showPhoneNumber
|
|
24188
24195
|
}));
|
|
24189
24196
|
}))))) : (/*#__PURE__*/React__default.createElement(NoData, {
|
|
24190
24197
|
color: textSecondary,
|
|
@@ -24234,7 +24241,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24234
24241
|
contactsMap: contactsMap,
|
|
24235
24242
|
setSelectedChannel: setSelectedChannel,
|
|
24236
24243
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24237
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24244
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24245
|
+
showPhoneNumber: showPhoneNumber
|
|
24238
24246
|
}));
|
|
24239
24247
|
}))), !!searchValue && (channelsLoading === LOADING_STATE.LOADED ? !((_searchedChannels$cha4 = searchedChannels.chats_groups) !== null && _searchedChannels$cha4 !== void 0 && _searchedChannels$cha4.length) && !((_searchedChannels$cha5 = searchedChannels.chats_groups) !== null && _searchedChannels$cha5 !== void 0 && _searchedChannels$cha5.length) && !((_searchedChannels$cha6 = searchedChannels.channels) !== null && _searchedChannels$cha6 !== void 0 && _searchedChannels$cha6.length) ? (/*#__PURE__*/React__default.createElement(NoData, {
|
|
24240
24248
|
color: textSecondary,
|
|
@@ -24274,7 +24282,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24274
24282
|
key: channel.id,
|
|
24275
24283
|
setSelectedChannel: setSelectedChannel,
|
|
24276
24284
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24277
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24285
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24286
|
+
showPhoneNumber: showPhoneNumber
|
|
24278
24287
|
}));
|
|
24279
24288
|
}))), !!searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
24280
24289
|
color: textSecondary,
|
|
@@ -24311,7 +24320,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24311
24320
|
contactsMap: contactsMap,
|
|
24312
24321
|
setSelectedChannel: setSelectedChannel,
|
|
24313
24322
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24314
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24323
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24324
|
+
showPhoneNumber: showPhoneNumber
|
|
24315
24325
|
}));
|
|
24316
24326
|
}))))) : (/*#__PURE__*/React__default.createElement(LoadingWrapper, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
|
|
24317
24327
|
color: textFootnote
|
|
@@ -25374,6 +25384,7 @@ function ForwardMessagePopup(_ref) {
|
|
|
25374
25384
|
var _useState4 = React.useState(false),
|
|
25375
25385
|
isScrolling = _useState4[0],
|
|
25376
25386
|
setIsScrolling = _useState4[1];
|
|
25387
|
+
var loadingRef = React.useRef(false);
|
|
25377
25388
|
var handleForwardMessage = function handleForwardMessage() {
|
|
25378
25389
|
handleForward(selectedChannels.map(function (channel) {
|
|
25379
25390
|
return channel.id;
|
|
@@ -25382,11 +25393,21 @@ function ForwardMessagePopup(_ref) {
|
|
|
25382
25393
|
};
|
|
25383
25394
|
var handleChannelListScroll = function handleChannelListScroll(event) {
|
|
25384
25395
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
|
|
25385
|
-
if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext) {
|
|
25396
|
+
if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext && !loadingRef.current) {
|
|
25397
|
+
loadingRef.current = true;
|
|
25386
25398
|
dispatch(loadMoreChannelsForForward(15));
|
|
25399
|
+
var timeout = setTimeout(function () {
|
|
25400
|
+
loadingRef.current = false;
|
|
25401
|
+
clearTimeout(timeout);
|
|
25402
|
+
}, 100);
|
|
25387
25403
|
}
|
|
25388
25404
|
}
|
|
25389
25405
|
};
|
|
25406
|
+
React.useEffect(function () {
|
|
25407
|
+
if (channelsLoading === LOADING_STATE.LOADED) {
|
|
25408
|
+
loadingRef.current = false;
|
|
25409
|
+
}
|
|
25410
|
+
}, [channelsLoading]);
|
|
25390
25411
|
var handleSearchValueChange = function handleSearchValueChange(e) {
|
|
25391
25412
|
var value = e.target.value;
|
|
25392
25413
|
setSearchValue(value);
|
|
@@ -26571,7 +26592,8 @@ function ReactionsPopup(_ref) {
|
|
|
26571
26592
|
reactionTotals = _ref.reactionTotals,
|
|
26572
26593
|
reactionsDetailsPopupBorderRadius = _ref.reactionsDetailsPopupBorderRadius,
|
|
26573
26594
|
reactionsDetailsPopupHeaderItemsStyle = _ref.reactionsDetailsPopupHeaderItemsStyle,
|
|
26574
|
-
rtlDirection = _ref.rtlDirection
|
|
26595
|
+
rtlDirection = _ref.rtlDirection,
|
|
26596
|
+
openUserProfile = _ref.openUserProfile;
|
|
26575
26597
|
var _useColor = useColors(),
|
|
26576
26598
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
26577
26599
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -26645,7 +26667,7 @@ function ReactionsPopup(_ref) {
|
|
|
26645
26667
|
return scoresElem.offsetHeight;
|
|
26646
26668
|
}
|
|
26647
26669
|
return 0;
|
|
26648
|
-
}, [scoresRef]);
|
|
26670
|
+
}, [scoresRef, reactionTotals === null || reactionTotals === void 0 ? void 0 : reactionTotals.length]);
|
|
26649
26671
|
React.useEffect(function () {
|
|
26650
26672
|
if (!reactionTotals || !reactionTotals.length) {
|
|
26651
26673
|
handleReactionsPopupClose();
|
|
@@ -26655,19 +26677,18 @@ function ReactionsPopup(_ref) {
|
|
|
26655
26677
|
return reactions.length * 50 + 45;
|
|
26656
26678
|
}, [reactions]);
|
|
26657
26679
|
React.useEffect(function () {
|
|
26658
|
-
if (reactions
|
|
26659
|
-
if (
|
|
26680
|
+
if (reactions) {
|
|
26681
|
+
if (reactionsPrevLength !== reactions.length) {
|
|
26660
26682
|
setPopupHeight(reactionsHeight);
|
|
26683
|
+
reactionsPrevLength = reactions.length;
|
|
26661
26684
|
}
|
|
26662
|
-
reactionsPrevLength = reactions.length;
|
|
26663
26685
|
} else {
|
|
26664
|
-
reactionsPrevLength =
|
|
26686
|
+
reactionsPrevLength = 0;
|
|
26687
|
+
setPopupHeight(0);
|
|
26665
26688
|
}
|
|
26666
|
-
if (reactions && reactions.length) {
|
|
26667
|
-
|
|
26668
|
-
|
|
26669
|
-
setCalculateSizes(false);
|
|
26670
|
-
}
|
|
26689
|
+
if (reactions && reactions.length && calculateSizes) {
|
|
26690
|
+
setPopupHeight(reactionsHeight);
|
|
26691
|
+
setCalculateSizes(false);
|
|
26671
26692
|
}
|
|
26672
26693
|
}, [reactions, reactionsHeight]);
|
|
26673
26694
|
var popupVerticalPosition = React.useMemo(function () {
|
|
@@ -26733,7 +26754,12 @@ function ReactionsPopup(_ref) {
|
|
|
26733
26754
|
key: reaction.id,
|
|
26734
26755
|
hoverBackgroundColor: backgroundHovered,
|
|
26735
26756
|
onClick: function onClick() {
|
|
26736
|
-
|
|
26757
|
+
if (reaction.user.id === user.id) {
|
|
26758
|
+
handleAddDeleteEmoji(reaction.key);
|
|
26759
|
+
} else {
|
|
26760
|
+
openUserProfile(reaction.user);
|
|
26761
|
+
handleReactionsPopupClose();
|
|
26762
|
+
}
|
|
26737
26763
|
}
|
|
26738
26764
|
}, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
26739
26765
|
name: reaction.user.firstName || reaction.user.id,
|
|
@@ -29677,7 +29703,9 @@ var AudioPlayer = function AudioPlayer(_ref) {
|
|
|
29677
29703
|
setCurrentTime(formatAudioVideoTime(file.metadata.dur));
|
|
29678
29704
|
}
|
|
29679
29705
|
if (file.metadata.tmb) {
|
|
29680
|
-
var maxVal =
|
|
29706
|
+
var maxVal = Array.isArray(file.metadata.tmb) && file.metadata.tmb.length > 0 ? file.metadata.tmb.reduce(function (acc, n) {
|
|
29707
|
+
return n > acc ? n : acc;
|
|
29708
|
+
}, -Infinity) : 0;
|
|
29681
29709
|
var dec = maxVal / 100;
|
|
29682
29710
|
peaks = file.metadata.tmb.map(function (peak) {
|
|
29683
29711
|
return peak / dec / 100;
|
|
@@ -32400,11 +32428,7 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32400
32428
|
togglePopup = _ref.togglePopup,
|
|
32401
32429
|
labels = _ref.labels,
|
|
32402
32430
|
_ref$tabsOrder = _ref.tabsOrder,
|
|
32403
|
-
tabsOrder = _ref$tabsOrder === void 0 ? [
|
|
32404
|
-
key: 'played',
|
|
32405
|
-
label: 'Played by',
|
|
32406
|
-
data: []
|
|
32407
|
-
}] : [], [{
|
|
32431
|
+
tabsOrder = _ref$tabsOrder === void 0 ? [{
|
|
32408
32432
|
key: 'received',
|
|
32409
32433
|
label: 'Delivered to',
|
|
32410
32434
|
data: []
|
|
@@ -32412,7 +32436,11 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32412
32436
|
key: 'displayed',
|
|
32413
32437
|
label: 'Seen by',
|
|
32414
32438
|
data: []
|
|
32415
|
-
}]
|
|
32439
|
+
}].concat(message.attachments && message.attachments.length > 0 && message.attachments[0].type === 'voice' ? [{
|
|
32440
|
+
key: 'played',
|
|
32441
|
+
label: 'Played by',
|
|
32442
|
+
data: []
|
|
32443
|
+
}] : []) : _ref$tabsOrder,
|
|
32416
32444
|
_ref$showCounts = _ref.showCounts,
|
|
32417
32445
|
showCounts = _ref$showCounts === void 0 ? false : _ref$showCounts,
|
|
32418
32446
|
_ref$avatarSize = _ref.avatarSize,
|
|
@@ -33469,6 +33497,7 @@ var Message$1 = function Message(_ref) {
|
|
|
33469
33497
|
return handleReplyMessage(true);
|
|
33470
33498
|
}
|
|
33471
33499
|
}, message.replyCount + " replies")), reactionsPopupOpen && (/*#__PURE__*/React__default.createElement(ReactionsPopup, {
|
|
33500
|
+
openUserProfile: handleOpenUserProfile,
|
|
33472
33501
|
bottomPosition: reactionsPopupPosition,
|
|
33473
33502
|
horizontalPositions: reactionsPopupHorizontalPosition,
|
|
33474
33503
|
reactionTotals: message.reactionTotals || [],
|
|
@@ -37009,7 +37038,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
37009
37038
|
var _ref3;
|
|
37010
37039
|
var thumbData = (_ref3 = audioRecording || currentRecordedFile) === null || _ref3 === void 0 ? void 0 : _ref3.thumb;
|
|
37011
37040
|
if (Array.isArray(thumbData) && thumbData.length > 0) {
|
|
37012
|
-
var maxVal =
|
|
37041
|
+
var maxVal = thumbData.reduce(function (acc, n) {
|
|
37042
|
+
return n > acc ? n : acc;
|
|
37043
|
+
}, -Infinity);
|
|
37013
37044
|
if (maxVal > 0 && isFinite(maxVal)) {
|
|
37014
37045
|
var dec = maxVal / 100;
|
|
37015
37046
|
peaks = thumbData.map(function (peak) {
|
|
@@ -37068,7 +37099,14 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
37068
37099
|
var start = i * segmentSize;
|
|
37069
37100
|
var end = start + segmentSize;
|
|
37070
37101
|
var segment = audioBuffer.getChannelData(0).slice(start, end);
|
|
37071
|
-
var maxAmplitude =
|
|
37102
|
+
var maxAmplitude = 0;
|
|
37103
|
+
for (var j = 0; j < segment.length; j++) {
|
|
37104
|
+
var val = segment[j];
|
|
37105
|
+
var absVal = val < 0 ? -val : val;
|
|
37106
|
+
if (absVal > maxAmplitude) {
|
|
37107
|
+
maxAmplitude = absVal;
|
|
37108
|
+
}
|
|
37109
|
+
}
|
|
37072
37110
|
waveform.push(Math.floor(maxAmplitude * 1000));
|
|
37073
37111
|
}
|
|
37074
37112
|
setStartRecording(false);
|
|
@@ -37129,7 +37167,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
37129
37167
|
}
|
|
37130
37168
|
};
|
|
37131
37169
|
React.useEffect(function () {
|
|
37132
|
-
var MAX_RECORDER_TIME =
|
|
37170
|
+
var MAX_RECORDER_TIME = 1800;
|
|
37133
37171
|
var recordingInterval = null;
|
|
37134
37172
|
if (recording) {
|
|
37135
37173
|
setTimeout(function () {
|
package/index.modern.js
CHANGED
|
@@ -21482,6 +21482,7 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
|
|
|
21482
21482
|
}), channel.lastReactedMessage && '"')))));
|
|
21483
21483
|
};
|
|
21484
21484
|
var Channel = function Channel(_ref3) {
|
|
21485
|
+
var _channel$members, _channel$members$, _channel$members$2;
|
|
21485
21486
|
var channel = _ref3.channel,
|
|
21486
21487
|
theme = _ref3.theme,
|
|
21487
21488
|
_ref3$showAvatar = _ref3.showAvatar,
|
|
@@ -21508,7 +21509,8 @@ var Channel = function Channel(_ref3) {
|
|
|
21508
21509
|
channelAvatarTextSize = _ref3.channelAvatarTextSize,
|
|
21509
21510
|
setSelectedChannel = _ref3.setSelectedChannel,
|
|
21510
21511
|
getCustomLatestMessage = _ref3.getCustomLatestMessage,
|
|
21511
|
-
doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes
|
|
21512
|
+
doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes,
|
|
21513
|
+
showPhoneNumber = _ref3.showPhoneNumber;
|
|
21512
21514
|
var _useColor = useColors(),
|
|
21513
21515
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
21514
21516
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -21701,7 +21703,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21701
21703
|
subjectLineHeight: channelSubjectLineHeight,
|
|
21702
21704
|
subjectColor: channelSubjectColor || textPrimary,
|
|
21703
21705
|
avatarSize: channelAvatarSize
|
|
21704
|
-
}, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
|
|
21706
|
+
}, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? showPhoneNumber && (_channel$members = channel.members) !== null && _channel$members !== void 0 && _channel$members.length && (_channel$members$ = channel.members[0]) !== null && _channel$members$ !== void 0 && _channel$members$.id ? "+" + ((_channel$members$2 = channel.members[0]) === null || _channel$members$2 === void 0 ? void 0 : _channel$members$2.id) + " (You)" : 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
|
|
21705
21707
|
color: notificationsIsMutedIconColor || iconInactive
|
|
21706
21708
|
}, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), getCustomLatestMessage ? getCustomLatestMessageComponent({
|
|
21707
21709
|
lastMessage: lastMessage,
|
|
@@ -23765,7 +23767,9 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
23765
23767
|
searchChannelsPadding = _ref.searchChannelsPadding,
|
|
23766
23768
|
getCustomLatestMessage = _ref.getCustomLatestMessage,
|
|
23767
23769
|
_ref$doNotShowMessage = _ref.doNotShowMessageDeliveryTypes,
|
|
23768
|
-
doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage
|
|
23770
|
+
doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage,
|
|
23771
|
+
_ref$showPhoneNumber = _ref.showPhoneNumber,
|
|
23772
|
+
showPhoneNumber = _ref$showPhoneNumber === void 0 ? false : _ref$showPhoneNumber;
|
|
23769
23773
|
var _useColor = useColors(),
|
|
23770
23774
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
23771
23775
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -24076,7 +24080,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24076
24080
|
contactsMap: contactsMap,
|
|
24077
24081
|
setSelectedChannel: setSelectedChannel,
|
|
24078
24082
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24079
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24083
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24084
|
+
showPhoneNumber: showPhoneNumber
|
|
24080
24085
|
}));
|
|
24081
24086
|
}))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
24082
24087
|
color: textSecondary,
|
|
@@ -24113,7 +24118,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24113
24118
|
contactsMap: contactsMap,
|
|
24114
24119
|
setSelectedChannel: setSelectedChannel,
|
|
24115
24120
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24116
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24121
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24122
|
+
showPhoneNumber: showPhoneNumber
|
|
24117
24123
|
}));
|
|
24118
24124
|
}))), !!(searchedChannels.contacts && searchedChannels.contacts.length) && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
24119
24125
|
color: textSecondary,
|
|
@@ -24182,7 +24188,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24182
24188
|
contactsMap: contactsMap,
|
|
24183
24189
|
setSelectedChannel: setSelectedChannel,
|
|
24184
24190
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24185
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24191
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24192
|
+
showPhoneNumber: showPhoneNumber
|
|
24186
24193
|
}));
|
|
24187
24194
|
}))))) : (/*#__PURE__*/React__default.createElement(NoData, {
|
|
24188
24195
|
color: textSecondary,
|
|
@@ -24232,7 +24239,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24232
24239
|
contactsMap: contactsMap,
|
|
24233
24240
|
setSelectedChannel: setSelectedChannel,
|
|
24234
24241
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24235
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24242
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24243
|
+
showPhoneNumber: showPhoneNumber
|
|
24236
24244
|
}));
|
|
24237
24245
|
}))), !!searchValue && (channelsLoading === LOADING_STATE.LOADED ? !((_searchedChannels$cha4 = searchedChannels.chats_groups) !== null && _searchedChannels$cha4 !== void 0 && _searchedChannels$cha4.length) && !((_searchedChannels$cha5 = searchedChannels.chats_groups) !== null && _searchedChannels$cha5 !== void 0 && _searchedChannels$cha5.length) && !((_searchedChannels$cha6 = searchedChannels.channels) !== null && _searchedChannels$cha6 !== void 0 && _searchedChannels$cha6.length) ? (/*#__PURE__*/React__default.createElement(NoData, {
|
|
24238
24246
|
color: textSecondary,
|
|
@@ -24272,7 +24280,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24272
24280
|
key: channel.id,
|
|
24273
24281
|
setSelectedChannel: setSelectedChannel,
|
|
24274
24282
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24275
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24283
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24284
|
+
showPhoneNumber: showPhoneNumber
|
|
24276
24285
|
}));
|
|
24277
24286
|
}))), !!searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
24278
24287
|
color: textSecondary,
|
|
@@ -24309,7 +24318,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
24309
24318
|
contactsMap: contactsMap,
|
|
24310
24319
|
setSelectedChannel: setSelectedChannel,
|
|
24311
24320
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
24312
|
-
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
|
|
24321
|
+
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
24322
|
+
showPhoneNumber: showPhoneNumber
|
|
24313
24323
|
}));
|
|
24314
24324
|
}))))) : (/*#__PURE__*/React__default.createElement(LoadingWrapper, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
|
|
24315
24325
|
color: textFootnote
|
|
@@ -25372,6 +25382,7 @@ function ForwardMessagePopup(_ref) {
|
|
|
25372
25382
|
var _useState4 = useState(false),
|
|
25373
25383
|
isScrolling = _useState4[0],
|
|
25374
25384
|
setIsScrolling = _useState4[1];
|
|
25385
|
+
var loadingRef = useRef(false);
|
|
25375
25386
|
var handleForwardMessage = function handleForwardMessage() {
|
|
25376
25387
|
handleForward(selectedChannels.map(function (channel) {
|
|
25377
25388
|
return channel.id;
|
|
@@ -25380,11 +25391,21 @@ function ForwardMessagePopup(_ref) {
|
|
|
25380
25391
|
};
|
|
25381
25392
|
var handleChannelListScroll = function handleChannelListScroll(event) {
|
|
25382
25393
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
|
|
25383
|
-
if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext) {
|
|
25394
|
+
if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext && !loadingRef.current) {
|
|
25395
|
+
loadingRef.current = true;
|
|
25384
25396
|
dispatch(loadMoreChannelsForForward(15));
|
|
25397
|
+
var timeout = setTimeout(function () {
|
|
25398
|
+
loadingRef.current = false;
|
|
25399
|
+
clearTimeout(timeout);
|
|
25400
|
+
}, 100);
|
|
25385
25401
|
}
|
|
25386
25402
|
}
|
|
25387
25403
|
};
|
|
25404
|
+
useEffect(function () {
|
|
25405
|
+
if (channelsLoading === LOADING_STATE.LOADED) {
|
|
25406
|
+
loadingRef.current = false;
|
|
25407
|
+
}
|
|
25408
|
+
}, [channelsLoading]);
|
|
25388
25409
|
var handleSearchValueChange = function handleSearchValueChange(e) {
|
|
25389
25410
|
var value = e.target.value;
|
|
25390
25411
|
setSearchValue(value);
|
|
@@ -26569,7 +26590,8 @@ function ReactionsPopup(_ref) {
|
|
|
26569
26590
|
reactionTotals = _ref.reactionTotals,
|
|
26570
26591
|
reactionsDetailsPopupBorderRadius = _ref.reactionsDetailsPopupBorderRadius,
|
|
26571
26592
|
reactionsDetailsPopupHeaderItemsStyle = _ref.reactionsDetailsPopupHeaderItemsStyle,
|
|
26572
|
-
rtlDirection = _ref.rtlDirection
|
|
26593
|
+
rtlDirection = _ref.rtlDirection,
|
|
26594
|
+
openUserProfile = _ref.openUserProfile;
|
|
26573
26595
|
var _useColor = useColors(),
|
|
26574
26596
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
26575
26597
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -26643,7 +26665,7 @@ function ReactionsPopup(_ref) {
|
|
|
26643
26665
|
return scoresElem.offsetHeight;
|
|
26644
26666
|
}
|
|
26645
26667
|
return 0;
|
|
26646
|
-
}, [scoresRef]);
|
|
26668
|
+
}, [scoresRef, reactionTotals === null || reactionTotals === void 0 ? void 0 : reactionTotals.length]);
|
|
26647
26669
|
useEffect(function () {
|
|
26648
26670
|
if (!reactionTotals || !reactionTotals.length) {
|
|
26649
26671
|
handleReactionsPopupClose();
|
|
@@ -26653,19 +26675,18 @@ function ReactionsPopup(_ref) {
|
|
|
26653
26675
|
return reactions.length * 50 + 45;
|
|
26654
26676
|
}, [reactions]);
|
|
26655
26677
|
useEffect(function () {
|
|
26656
|
-
if (reactions
|
|
26657
|
-
if (
|
|
26678
|
+
if (reactions) {
|
|
26679
|
+
if (reactionsPrevLength !== reactions.length) {
|
|
26658
26680
|
setPopupHeight(reactionsHeight);
|
|
26681
|
+
reactionsPrevLength = reactions.length;
|
|
26659
26682
|
}
|
|
26660
|
-
reactionsPrevLength = reactions.length;
|
|
26661
26683
|
} else {
|
|
26662
|
-
reactionsPrevLength =
|
|
26684
|
+
reactionsPrevLength = 0;
|
|
26685
|
+
setPopupHeight(0);
|
|
26663
26686
|
}
|
|
26664
|
-
if (reactions && reactions.length) {
|
|
26665
|
-
|
|
26666
|
-
|
|
26667
|
-
setCalculateSizes(false);
|
|
26668
|
-
}
|
|
26687
|
+
if (reactions && reactions.length && calculateSizes) {
|
|
26688
|
+
setPopupHeight(reactionsHeight);
|
|
26689
|
+
setCalculateSizes(false);
|
|
26669
26690
|
}
|
|
26670
26691
|
}, [reactions, reactionsHeight]);
|
|
26671
26692
|
var popupVerticalPosition = useMemo(function () {
|
|
@@ -26731,7 +26752,12 @@ function ReactionsPopup(_ref) {
|
|
|
26731
26752
|
key: reaction.id,
|
|
26732
26753
|
hoverBackgroundColor: backgroundHovered,
|
|
26733
26754
|
onClick: function onClick() {
|
|
26734
|
-
|
|
26755
|
+
if (reaction.user.id === user.id) {
|
|
26756
|
+
handleAddDeleteEmoji(reaction.key);
|
|
26757
|
+
} else {
|
|
26758
|
+
openUserProfile(reaction.user);
|
|
26759
|
+
handleReactionsPopupClose();
|
|
26760
|
+
}
|
|
26735
26761
|
}
|
|
26736
26762
|
}, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
26737
26763
|
name: reaction.user.firstName || reaction.user.id,
|
|
@@ -29675,7 +29701,9 @@ var AudioPlayer = function AudioPlayer(_ref) {
|
|
|
29675
29701
|
setCurrentTime(formatAudioVideoTime(file.metadata.dur));
|
|
29676
29702
|
}
|
|
29677
29703
|
if (file.metadata.tmb) {
|
|
29678
|
-
var maxVal =
|
|
29704
|
+
var maxVal = Array.isArray(file.metadata.tmb) && file.metadata.tmb.length > 0 ? file.metadata.tmb.reduce(function (acc, n) {
|
|
29705
|
+
return n > acc ? n : acc;
|
|
29706
|
+
}, -Infinity) : 0;
|
|
29679
29707
|
var dec = maxVal / 100;
|
|
29680
29708
|
peaks = file.metadata.tmb.map(function (peak) {
|
|
29681
29709
|
return peak / dec / 100;
|
|
@@ -32398,11 +32426,7 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32398
32426
|
togglePopup = _ref.togglePopup,
|
|
32399
32427
|
labels = _ref.labels,
|
|
32400
32428
|
_ref$tabsOrder = _ref.tabsOrder,
|
|
32401
|
-
tabsOrder = _ref$tabsOrder === void 0 ? [
|
|
32402
|
-
key: 'played',
|
|
32403
|
-
label: 'Played by',
|
|
32404
|
-
data: []
|
|
32405
|
-
}] : [], [{
|
|
32429
|
+
tabsOrder = _ref$tabsOrder === void 0 ? [{
|
|
32406
32430
|
key: 'received',
|
|
32407
32431
|
label: 'Delivered to',
|
|
32408
32432
|
data: []
|
|
@@ -32410,7 +32434,11 @@ var MessageInfo = function MessageInfo(_ref) {
|
|
|
32410
32434
|
key: 'displayed',
|
|
32411
32435
|
label: 'Seen by',
|
|
32412
32436
|
data: []
|
|
32413
|
-
}]
|
|
32437
|
+
}].concat(message.attachments && message.attachments.length > 0 && message.attachments[0].type === 'voice' ? [{
|
|
32438
|
+
key: 'played',
|
|
32439
|
+
label: 'Played by',
|
|
32440
|
+
data: []
|
|
32441
|
+
}] : []) : _ref$tabsOrder,
|
|
32414
32442
|
_ref$showCounts = _ref.showCounts,
|
|
32415
32443
|
showCounts = _ref$showCounts === void 0 ? false : _ref$showCounts,
|
|
32416
32444
|
_ref$avatarSize = _ref.avatarSize,
|
|
@@ -33467,6 +33495,7 @@ var Message$1 = function Message(_ref) {
|
|
|
33467
33495
|
return handleReplyMessage(true);
|
|
33468
33496
|
}
|
|
33469
33497
|
}, message.replyCount + " replies")), reactionsPopupOpen && (/*#__PURE__*/React__default.createElement(ReactionsPopup, {
|
|
33498
|
+
openUserProfile: handleOpenUserProfile,
|
|
33470
33499
|
bottomPosition: reactionsPopupPosition,
|
|
33471
33500
|
horizontalPositions: reactionsPopupHorizontalPosition,
|
|
33472
33501
|
reactionTotals: message.reactionTotals || [],
|
|
@@ -37007,7 +37036,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
37007
37036
|
var _ref3;
|
|
37008
37037
|
var thumbData = (_ref3 = audioRecording || currentRecordedFile) === null || _ref3 === void 0 ? void 0 : _ref3.thumb;
|
|
37009
37038
|
if (Array.isArray(thumbData) && thumbData.length > 0) {
|
|
37010
|
-
var maxVal =
|
|
37039
|
+
var maxVal = thumbData.reduce(function (acc, n) {
|
|
37040
|
+
return n > acc ? n : acc;
|
|
37041
|
+
}, -Infinity);
|
|
37011
37042
|
if (maxVal > 0 && isFinite(maxVal)) {
|
|
37012
37043
|
var dec = maxVal / 100;
|
|
37013
37044
|
peaks = thumbData.map(function (peak) {
|
|
@@ -37066,7 +37097,14 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
37066
37097
|
var start = i * segmentSize;
|
|
37067
37098
|
var end = start + segmentSize;
|
|
37068
37099
|
var segment = audioBuffer.getChannelData(0).slice(start, end);
|
|
37069
|
-
var maxAmplitude =
|
|
37100
|
+
var maxAmplitude = 0;
|
|
37101
|
+
for (var j = 0; j < segment.length; j++) {
|
|
37102
|
+
var val = segment[j];
|
|
37103
|
+
var absVal = val < 0 ? -val : val;
|
|
37104
|
+
if (absVal > maxAmplitude) {
|
|
37105
|
+
maxAmplitude = absVal;
|
|
37106
|
+
}
|
|
37107
|
+
}
|
|
37070
37108
|
waveform.push(Math.floor(maxAmplitude * 1000));
|
|
37071
37109
|
}
|
|
37072
37110
|
setStartRecording(false);
|
|
@@ -37127,7 +37165,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
37127
37165
|
}
|
|
37128
37166
|
};
|
|
37129
37167
|
useEffect(function () {
|
|
37130
|
-
var MAX_RECORDER_TIME =
|
|
37168
|
+
var MAX_RECORDER_TIME = 1800;
|
|
37131
37169
|
var recordingInterval = null;
|
|
37132
37170
|
if (recording) {
|
|
37133
37171
|
setTimeout(function () {
|