sceyt-chat-react-uikit 1.9.0-beta.13 → 1.9.0-beta.15
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/Message/Message.types.d.ts +1 -0
- package/components/Message/MessageReactions/index.d.ts +1 -0
- package/index.js +312 -226
- package/index.modern.js +312 -226
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -31515,11 +31515,38 @@ function MembersSaga$1() {
|
|
|
31515
31515
|
var isPinnedMessageDeleted = function isPinnedMessageDeleted(message) {
|
|
31516
31516
|
return (message === null || message === void 0 ? void 0 : message.state) === MESSAGE_STATUS.DELETE;
|
|
31517
31517
|
};
|
|
31518
|
-
var
|
|
31519
|
-
var _message$
|
|
31518
|
+
var getPinnedMessageBody = function getPinnedMessageBody(message, contactsMap, getFromContacts) {
|
|
31519
|
+
var _message$bodyAttribut;
|
|
31520
|
+
if (contactsMap === void 0) {
|
|
31521
|
+
contactsMap = {};
|
|
31522
|
+
}
|
|
31523
|
+
if (getFromContacts === void 0) {
|
|
31524
|
+
getFromContacts = false;
|
|
31525
|
+
}
|
|
31526
|
+
var body = (message === null || message === void 0 ? void 0 : message.body) || '';
|
|
31527
|
+
if (!body || !(message !== null && message !== void 0 && (_message$bodyAttribut = message.bodyAttributes) !== null && _message$bodyAttribut !== void 0 && _message$bodyAttribut.length)) return body;
|
|
31528
|
+
var formattedBody = MessageTextFormat({
|
|
31529
|
+
text: body,
|
|
31530
|
+
message: message,
|
|
31531
|
+
contactsMap: contactsMap,
|
|
31532
|
+
getFromContacts: getFromContacts,
|
|
31533
|
+
asSampleText: true,
|
|
31534
|
+
accentColor: '',
|
|
31535
|
+
textSecondary: ''
|
|
31536
|
+
});
|
|
31537
|
+
return Array.isArray(formattedBody) ? formattedBody.join('') : String(formattedBody);
|
|
31538
|
+
};
|
|
31539
|
+
var getPinnedMessagePreview = function getPinnedMessagePreview(message, contactsMap, getFromContacts) {
|
|
31540
|
+
var _message$attachments;
|
|
31541
|
+
if (contactsMap === void 0) {
|
|
31542
|
+
contactsMap = {};
|
|
31543
|
+
}
|
|
31544
|
+
if (getFromContacts === void 0) {
|
|
31545
|
+
getFromContacts = false;
|
|
31546
|
+
}
|
|
31520
31547
|
if (!message) return '';
|
|
31521
31548
|
if (isPinnedMessageDeleted(message)) return 'Deleted message';
|
|
31522
|
-
var body = (
|
|
31549
|
+
var body = getPinnedMessageBody(message, contactsMap, getFromContacts).trim();
|
|
31523
31550
|
if (body) return body;
|
|
31524
31551
|
if (message.pollDetails) return message.pollDetails.name || 'Poll';
|
|
31525
31552
|
var attachment = (_message$attachments = message.attachments) === null || _message$attachments === void 0 ? void 0 : _message$attachments[0];
|
|
@@ -33918,16 +33945,13 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
|
|
|
33918
33945
|
unsupportedMessage = _ref2.unsupportedMessage;
|
|
33919
33946
|
var isViewOnce = (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.type) === exports.MESSAGE_TYPE.VIEW_ONCE && (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.viewOnce);
|
|
33920
33947
|
var systemMessageActor = lastMessage.user ? lastMessage.user.id === user.id ? 'You' : makeUsername(lastMessage.user && contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true) : '';
|
|
33921
|
-
var audioRecording = React.useMemo(function () {
|
|
33922
|
-
return getAudioRecordingFromMap(channel.id);
|
|
33923
|
-
}, [channel.id, draftMessageText]);
|
|
33924
33948
|
return /*#__PURE__*/React__default.createElement(MessageTextContainer, null, isTypingOrRecording && (/*#__PURE__*/React__default.createElement(TypingIndicator, null, !isDirectChannel && /*#__PURE__*/React__default.createElement(Points, {
|
|
33925
33949
|
color: textPrimary
|
|
33926
33950
|
}, ":"), typingOrRecording.isTyping ? 'typing' : 'recording', "...")), !isTypingOrRecording && (draftMessageText ? (/*#__PURE__*/React__default.createElement(DraftMessageText, {
|
|
33927
33951
|
color: textSecondary
|
|
33928
33952
|
}, !lastMessage.body && (_lastMessage$attachme = lastMessage.attachments) !== null && _lastMessage$attachme !== void 0 && _lastMessage$attachme.length ? LastMessageAttachments({
|
|
33929
33953
|
lastMessage: lastMessage
|
|
33930
|
-
}) : null,
|
|
33954
|
+
}) : null, (!((_lastMessage$attachme2 = lastMessage.attachments) !== null && _lastMessage$attachme2 !== void 0 && _lastMessage$attachme2.length) || lastMessage.body) && MessageTextFormat({
|
|
33931
33955
|
text: (_lastMessage$attachme3 = lastMessage.attachments) !== null && _lastMessage$attachme3 !== void 0 && _lastMessage$attachme3.length ? lastMessage.body : draftMessageText,
|
|
33932
33956
|
message: lastMessage,
|
|
33933
33957
|
contactsMap: contactsMap,
|
|
@@ -42569,7 +42593,7 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
42569
42593
|
};
|
|
42570
42594
|
var handleClicks = React.useCallback(function (e) {
|
|
42571
42595
|
var target = e.target;
|
|
42572
|
-
if (!target.closest('.
|
|
42596
|
+
if (!target.closest('.slider-preview-media, .custom_video_player, .custom_carousel_arrow')) {
|
|
42573
42597
|
if (currentFileType === 'image') {
|
|
42574
42598
|
log.info('[MEDIA_IMAGE_SLIDER] outside click closing slider ' + JSON.stringify({
|
|
42575
42599
|
channelId: channel.id,
|
|
@@ -43006,6 +43030,7 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
43006
43030
|
})))), isItemLoading(file.id) && file.type === 'image' && (/*#__PURE__*/React__default.createElement(ItemLoadingCont, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
|
|
43007
43031
|
color: textOnPrimary
|
|
43008
43032
|
}))), file.type === 'image' ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, ((file.id === (currentFile === null || currentFile === void 0 ? void 0 : currentFile.id) ? currentAttachmentUrl : undefined) || attachmentUpdatedMap[getAttachmentURLWithVersion(file.url + '_original_image_url')] || getMediaThumbnailSource(file)) && (/*#__PURE__*/React__default.createElement("img", {
|
|
43033
|
+
className: 'slider-preview-media',
|
|
43009
43034
|
loading: 'eager',
|
|
43010
43035
|
decoding: 'async',
|
|
43011
43036
|
draggable: false,
|
|
@@ -43120,7 +43145,7 @@ var IconWrapper = styled__default.span(_templateObject10$7 || (_templateObject10
|
|
|
43120
43145
|
}, function (props) {
|
|
43121
43146
|
return props.hideInMobile && "\n @media (max-width: 550px) {\n display: none;\n }\n ";
|
|
43122
43147
|
});
|
|
43123
|
-
var CarouselItem$1 = styled__default.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n width: calc(100% - 200px);\n height: calc(100% - 80px);\n max-width: calc(100% - 200px);\n max-height: calc(100vh - 140px);\n align-items: center;\n justify-content: center;\n z-index: 2;\n\n img,\n video {\n
|
|
43148
|
+
var CarouselItem$1 = styled__default.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n width: calc(100% - 200px);\n height: calc(100% - 80px);\n max-width: calc(100% - 200px);\n max-height: calc(100vh - 140px);\n align-items: center;\n justify-content: center;\n z-index: 2;\n\n img,\n video {\n height: 100%;\n min-width: 0;\n min-height: 0;\n object-fit: contain;\n @media (max-width: 480px) {\n width: 100%;\n }\n }\n @media (max-width: 480px) {\n width: calc(100% - 100px);\n height: calc(100% - 48px);\n max-width: calc(100% - 100px);\n }\n\n img {\n display: block;\n }\n"])));
|
|
43124
43149
|
var UploadCont$1 = styled__default.div(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n left: calc((100vw - 100%) / -2);\n top: calc((100vh - 100%) / -2);\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n z-index: 1;\n"])));
|
|
43125
43150
|
var ItemLoadingCont = styled__default.div(_templateObject13$5 || (_templateObject13$5 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc((100vw - 100%) / -2);\n top: calc((100vh - 100% + 60px) / -2);\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1;\n"])));
|
|
43126
43151
|
var ArrowButton = styled__default.button(_templateObject14$5 || (_templateObject14$5 = _taggedTemplateLiteralLoose(["\n min-width: 60px;\n max-width: 60px;\n height: 60px;\n margin-right: ", ";\n margin-left: ", ";\n border: none;\n color: ", ";\n background: transparent;\n box-sizing: border-box;\n border-radius: 50%;\n line-height: 1px;\n align-self: center;\n outline: none;\n cursor: pointer;\n visibility: ", ";\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: ", ";\n right: ", ";\n & > svg {\n width: 40px;\n height: 40px;\n }\n @media (max-width: 768px) {\n min-width: 36px;\n max-width: 36px;\n height: 36px;\n margin-right: ", ";\n margin-left: ", ";\n\n & > svg {\n width: 22px;\n height: 22px;\n }\n }\n @media (max-width: 450px) {\n min-width: 32px;\n max-width: 32px;\n height: 32px;\n\n & > svg {\n width: 20px;\n height: 20px;\n }\n }\n"])), function (props) {
|
|
@@ -43172,8 +43197,8 @@ var Message = function Message(_ref) {
|
|
|
43172
43197
|
var actorName = message.incoming ? makeUsername(message.user && contactsMap[message.user.id], message.user, getFromContacts) : 'You';
|
|
43173
43198
|
var parentMessageId = ((_message$parentMessag = message.parentMessage) === null || _message$parentMessag === void 0 ? void 0 : _message$parentMessag.id) || ((_message$parentMessag2 = message.parentMessage) === null || _message$parentMessag2 === void 0 ? void 0 : _message$parentMessag2.tid) || message.parentMessageId || message.parentId;
|
|
43174
43199
|
var pinnedMessagePreview = React.useMemo(function () {
|
|
43175
|
-
return getPinnedMessagePreview(message.parentMessage);
|
|
43176
|
-
}, [message.parentMessage]);
|
|
43200
|
+
return getPinnedMessagePreview(message.parentMessage, contactsMap, getFromContacts);
|
|
43201
|
+
}, [contactsMap, getFromContacts, message.parentMessage]);
|
|
43177
43202
|
var pinnedMessageDeleted = isPinnedMessageDeleted(message.parentMessage);
|
|
43178
43203
|
var navigateToPinnedMessage = function navigateToPinnedMessage() {
|
|
43179
43204
|
if (parentMessageId) navigateToMessage(parentMessageId);
|
|
@@ -43262,18 +43287,18 @@ var attachmentMetadata = function attachmentMetadata(attachment) {
|
|
|
43262
43287
|
return {};
|
|
43263
43288
|
}
|
|
43264
43289
|
};
|
|
43265
|
-
var preview = function preview(message) {
|
|
43290
|
+
var preview = function preview(message, contactsMap, getFromContacts) {
|
|
43266
43291
|
var _message$attachments;
|
|
43267
43292
|
if (isPinnedMessageDeleted(message)) return 'Deleted Message';
|
|
43268
43293
|
if (message !== null && message !== void 0 && message.pollDetails) return "Poll: " + (message.pollDetails.name || message.body || 'Poll');
|
|
43269
43294
|
var attachment = message === null || message === void 0 ? void 0 : (_message$attachments = message.attachments) === null || _message$attachments === void 0 ? void 0 : _message$attachments[0];
|
|
43270
|
-
if (!attachment) return (message
|
|
43295
|
+
if (!attachment) return getPinnedMessageBody(message, contactsMap, getFromContacts) || (message !== null && message !== void 0 && message.forwardingDetails ? 'Shared content' : 'Message');
|
|
43271
43296
|
var metadata = attachmentMetadata(attachment);
|
|
43272
43297
|
if (attachment.type === attachmentTypes.voice) {
|
|
43273
43298
|
var duration = metadata.duration || metadata.dur || attachment.duration;
|
|
43274
43299
|
return "Voice" + (duration ? ": " + formatDuration(duration) : '');
|
|
43275
43300
|
}
|
|
43276
|
-
if (message !== null && message !== void 0 && message.body) return message
|
|
43301
|
+
if (message !== null && message !== void 0 && message.body) return getPinnedMessageBody(message, contactsMap, getFromContacts);
|
|
43277
43302
|
if (attachment.type === attachmentTypes.image) return 'Photo';
|
|
43278
43303
|
if (attachment.type === attachmentTypes.video) {
|
|
43279
43304
|
return 'Video';
|
|
@@ -43309,6 +43334,8 @@ var PinnedMessagesBanner = function PinnedMessagesBanner(_ref) {
|
|
|
43309
43334
|
var dispatch = useDispatch();
|
|
43310
43335
|
var pins = useSelector(pinnedMessagesSelector(channelId));
|
|
43311
43336
|
var nextToken = useSelector(pinnedMessagesCursorSelector(channelId));
|
|
43337
|
+
var contactsMap = useSelector(contactsMapSelector);
|
|
43338
|
+
var getFromContacts = getShowOnlyContactUsers();
|
|
43312
43339
|
var _useColor = useColors(),
|
|
43313
43340
|
surface1 = _useColor[THEME_COLORS.SURFACE_1],
|
|
43314
43341
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -43464,7 +43491,7 @@ var PinnedMessagesBanner = function PinnedMessagesBanner(_ref) {
|
|
|
43464
43491
|
}, /*#__PURE__*/React__default.createElement("strong", null, "Pinned messages"), /*#__PURE__*/React__default.createElement(PinnedCopyPreview, {
|
|
43465
43492
|
key: active.id,
|
|
43466
43493
|
textPrimary: textPrimary
|
|
43467
|
-
}, preview(active.message))), /*#__PURE__*/React__default.createElement(Controls$1, {
|
|
43494
|
+
}, preview(active.message, contactsMap, getFromContacts))), /*#__PURE__*/React__default.createElement(Controls$1, {
|
|
43468
43495
|
onClick: function onClick(event) {
|
|
43469
43496
|
return event.stopPropagation();
|
|
43470
43497
|
},
|
|
@@ -45735,7 +45762,12 @@ var PinnedMessagesList = function PinnedMessagesList(_ref) {
|
|
|
45735
45762
|
var rowBounds = event.currentTarget.getBoundingClientRect();
|
|
45736
45763
|
var contentBounds = messageContent.getBoundingClientRect();
|
|
45737
45764
|
var messageItem = event.currentTarget.querySelector('.message_item');
|
|
45738
|
-
var
|
|
45765
|
+
var reactionContainerId = message.id + "_reactions_container";
|
|
45766
|
+
var reactionContainer = Array.from(event.currentTarget.querySelectorAll('[id]')).find(function (element) {
|
|
45767
|
+
return element.id === reactionContainerId;
|
|
45768
|
+
});
|
|
45769
|
+
var itemMarginBottom = messageItem ? Number.parseFloat(window.getComputedStyle(messageItem).marginBottom) || 0 : 0;
|
|
45770
|
+
var bottom = itemMarginBottom + ((reactionContainer === null || reactionContainer === void 0 ? void 0 : reactionContainer.getBoundingClientRect().height) || 0);
|
|
45739
45771
|
var left = message.incoming ? contentBounds.right - rowBounds.left + 8 : contentBounds.left - rowBounds.left - 36 - 8;
|
|
45740
45772
|
setNavigationOffsets(function (current) {
|
|
45741
45773
|
var _extends2;
|
|
@@ -49330,6 +49362,8 @@ function ReactionsPopup(_ref) {
|
|
|
49330
49362
|
reactionTotals = _ref.reactionTotals,
|
|
49331
49363
|
reactionsDetailsPopupBorderRadius = _ref.reactionsDetailsPopupBorderRadius,
|
|
49332
49364
|
reactionsDetailsPopupHeaderItemsStyle = _ref.reactionsDetailsPopupHeaderItemsStyle,
|
|
49365
|
+
_ref$popupZIndex = _ref.popupZIndex,
|
|
49366
|
+
popupZIndex = _ref$popupZIndex === void 0 ? 12 : _ref$popupZIndex,
|
|
49333
49367
|
rtlDirection = _ref.rtlDirection,
|
|
49334
49368
|
openUserProfile = _ref.openUserProfile;
|
|
49335
49369
|
var _useColor = useColors(),
|
|
@@ -49444,9 +49478,9 @@ function ReactionsPopup(_ref) {
|
|
|
49444
49478
|
bottom: bottom,
|
|
49445
49479
|
left: left,
|
|
49446
49480
|
right: right,
|
|
49447
|
-
zIndex:
|
|
49481
|
+
zIndex: popupZIndex
|
|
49448
49482
|
};
|
|
49449
|
-
}, [popupVerticalPosition, anchorTop, anchorBottom, horizontalPositions, rtlDirection]);
|
|
49483
|
+
}, [popupVerticalPosition, anchorTop, anchorBottom, horizontalPositions, popupZIndex, rtlDirection]);
|
|
49450
49484
|
return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React__default.createElement(Container$i, {
|
|
49451
49485
|
ref: popupRef,
|
|
49452
49486
|
popupVerticalPosition: popupVerticalPosition,
|
|
@@ -49617,6 +49651,7 @@ var MessageReactions = function MessageReactions(_ref) {
|
|
|
49617
49651
|
reactionsContainerPadding = _ref.reactionsContainerPadding,
|
|
49618
49652
|
reactionsDetailsPopupBorderRadius = _ref.reactionsDetailsPopupBorderRadius,
|
|
49619
49653
|
reactionsDetailsPopupHeaderItemsStyle = _ref.reactionsDetailsPopupHeaderItemsStyle,
|
|
49654
|
+
popupZIndex = _ref.popupZIndex,
|
|
49620
49655
|
onToggleReactionsPopup = _ref.onToggleReactionsPopup,
|
|
49621
49656
|
onReactionAddDelete = _ref.onReactionAddDelete,
|
|
49622
49657
|
onOpenUserProfile = _ref.onOpenUserProfile;
|
|
@@ -49638,7 +49673,8 @@ var MessageReactions = function MessageReactions(_ref) {
|
|
|
49638
49673
|
rtlDirection: rtlDirection,
|
|
49639
49674
|
handleAddDeleteEmoji: onReactionAddDelete,
|
|
49640
49675
|
reactionsDetailsPopupBorderRadius: reactionsDetailsPopupBorderRadius,
|
|
49641
|
-
reactionsDetailsPopupHeaderItemsStyle: reactionsDetailsPopupHeaderItemsStyle
|
|
49676
|
+
reactionsDetailsPopupHeaderItemsStyle: reactionsDetailsPopupHeaderItemsStyle,
|
|
49677
|
+
popupZIndex: popupZIndex
|
|
49642
49678
|
})), /*#__PURE__*/React__default.createElement(ReactionsContainer, {
|
|
49643
49679
|
ref: enableTransitionRef,
|
|
49644
49680
|
id: message.id + "_reactions_container",
|
|
@@ -51045,8 +51081,8 @@ var Message$1 = function Message(_ref) {
|
|
|
51045
51081
|
var prevMessageUserID = prevMessage ? getComparableUserId(prevMessage.user) : null;
|
|
51046
51082
|
var current = moment(message.createdAt).startOf('day');
|
|
51047
51083
|
var firstMessageInInterval = React.useMemo(function () {
|
|
51048
|
-
return ifLatestAndHasNotPreview || !(prevMessage && current.diff(moment(prevMessage.createdAt).startOf('day'), 'days') === 0) || (prevMessage === null || prevMessage === void 0 ? void 0 : prevMessage.type) === exports.MESSAGE_TYPE.SYSTEM || unreadMessageId === prevMessage.id;
|
|
51049
|
-
}, [prevMessage, unreadMessageId, ifLatestAndHasNotPreview]);
|
|
51084
|
+
return ifLatestAndHasNotPreview || !isPinnedMessagesList && !(prevMessage && current.diff(moment(prevMessage.createdAt).startOf('day'), 'days') === 0) || (prevMessage === null || prevMessage === void 0 ? void 0 : prevMessage.type) === exports.MESSAGE_TYPE.SYSTEM || unreadMessageId === (prevMessage === null || prevMessage === void 0 ? void 0 : prevMessage.id);
|
|
51085
|
+
}, [prevMessage, unreadMessageId, ifLatestAndHasNotPreview, isPinnedMessagesList]);
|
|
51050
51086
|
var nextMessageUserID = nextMessage ? getComparableUserId(nextMessage.user) : null;
|
|
51051
51087
|
var nextDay = nextMessage ? moment(nextMessage.createdAt).startOf('day') : null;
|
|
51052
51088
|
var nextMessageFirstInInterval = !nextMessage || nextDay !== null && nextDay.diff(current, 'days') !== 0 || nextMessage.type === exports.MESSAGE_TYPE.SYSTEM || nextMessageStartsUnreadSection;
|
|
@@ -51056,17 +51092,10 @@ var Message$1 = function Message(_ref) {
|
|
|
51056
51092
|
var selectionIsActive = selectedMessagesMap && selectedMessagesMap.size > 0;
|
|
51057
51093
|
var isSelectedMessage = selectedMessagesMap && selectedMessagesMap.get(message.id || message.tid);
|
|
51058
51094
|
var tooManySelected = selectedMessagesMap && selectedMessagesMap.size >= MAX_SELECTED_MESSAGES;
|
|
51059
|
-
var openPinnedMessageInConversation = React.useCallback(function () {
|
|
51060
|
-
if (!isPinnedMessagesList) return;
|
|
51061
|
-
var messageId = message.id || message.tid;
|
|
51062
|
-
if (messageId) navigateToMessage(messageId);
|
|
51063
|
-
dispatch(requestPinnedMessagesListCloseAC());
|
|
51064
|
-
}, [dispatch, isPinnedMessagesList, message.id, message.tid]);
|
|
51065
51095
|
var toggleEditMode = React.useCallback(function () {
|
|
51066
|
-
openPinnedMessageInConversation();
|
|
51067
51096
|
dispatch(setMessageToEditAC(message));
|
|
51068
51097
|
setMessageActionsShow(false);
|
|
51069
|
-
}, [dispatch, message
|
|
51098
|
+
}, [dispatch, message]);
|
|
51070
51099
|
var handleRetractVote = React.useCallback(function () {
|
|
51071
51100
|
var _message$pollDetails;
|
|
51072
51101
|
if (message !== null && message !== void 0 && (_message$pollDetails = message.pollDetails) !== null && _message$pollDetails !== void 0 && _message$pollDetails.id) {
|
|
@@ -51133,12 +51162,11 @@ var Message$1 = function Message(_ref) {
|
|
|
51133
51162
|
setMessageActionsShow(false);
|
|
51134
51163
|
}, [channel.id, dispatch, message, pinnedMessage, setMessageActionsShow]);
|
|
51135
51164
|
var handleReplyMessage = React.useCallback(function (threadReply) {
|
|
51136
|
-
openPinnedMessageInConversation();
|
|
51137
51165
|
if (threadReply) ; else {
|
|
51138
51166
|
dispatch(setMessageForReplyAC(message));
|
|
51139
51167
|
}
|
|
51140
51168
|
setMessageActionsShow(false);
|
|
51141
|
-
}, [dispatch, message
|
|
51169
|
+
}, [dispatch, message]);
|
|
51142
51170
|
var handleToggleReportPopupOpen = React.useCallback(function () {
|
|
51143
51171
|
setReportPopupOpen(function (prev) {
|
|
51144
51172
|
return !prev;
|
|
@@ -51383,7 +51411,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51383
51411
|
if (!reactionsPopupOpen) {
|
|
51384
51412
|
return undefined;
|
|
51385
51413
|
}
|
|
51386
|
-
var scrollContainer = document.getElementById('scrollableDiv');
|
|
51414
|
+
var scrollContainer = document.getElementById(isPinnedMessagesList ? 'pinnedScrollableDiv' : 'scrollableDiv');
|
|
51387
51415
|
if (!scrollContainer) {
|
|
51388
51416
|
return undefined;
|
|
51389
51417
|
}
|
|
@@ -51396,7 +51424,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51396
51424
|
return function () {
|
|
51397
51425
|
scrollContainer.removeEventListener('scroll', handleChatScroll);
|
|
51398
51426
|
};
|
|
51399
|
-
}, [reactionsPopupOpen]);
|
|
51427
|
+
}, [isPinnedMessagesList, reactionsPopupOpen]);
|
|
51400
51428
|
React.useEffect(function () {
|
|
51401
51429
|
document.addEventListener('mousedown', handleClick);
|
|
51402
51430
|
return function () {
|
|
@@ -51430,8 +51458,8 @@ var Message$1 = function Message(_ref) {
|
|
|
51430
51458
|
if (!nextMessage || nextMessage.type === exports.MESSAGE_TYPE.SYSTEM) {
|
|
51431
51459
|
spacingBottom = '';
|
|
51432
51460
|
} else if (nextMessageStartsUnreadSection) {
|
|
51433
|
-
spacingBottom = differentUserMessageSpacing || '16px';
|
|
51434
|
-
} else if (nextMessageUserID && (nextMessageUserID !== messageUserID || nextMessageFirstInInterval)) {
|
|
51461
|
+
spacingBottom = isPinnedMessagesList ? '0' : differentUserMessageSpacing || '16px';
|
|
51462
|
+
} else if (nextMessageUserID && (nextMessageUserID !== messageUserID || nextMessageFirstInInterval && !isPinnedMessagesList)) {
|
|
51435
51463
|
spacingBottom = differentUserMessageSpacing || '16px';
|
|
51436
51464
|
}
|
|
51437
51465
|
spacingTop = sameUserMessageSpacing || '6px';
|
|
@@ -51444,7 +51472,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51444
51472
|
bottom: reactionsMargin || spacingBottom,
|
|
51445
51473
|
top: spacingTop
|
|
51446
51474
|
};
|
|
51447
|
-
}, [nextMessageUserID, messageUserID, nextMessageFirstInInterval, (_message$reactionTota = message.reactionTotals) === null || _message$reactionTota === void 0 ? void 0 : _message$reactionTota.length]);
|
|
51475
|
+
}, [nextMessageUserID, isPinnedMessagesList, messageUserID, nextMessageFirstInInterval, (_message$reactionTota = message.reactionTotals) === null || _message$reactionTota === void 0 ? void 0 : _message$reactionTota.length]);
|
|
51448
51476
|
return /*#__PURE__*/React__default.createElement(MessageItem, {
|
|
51449
51477
|
className: 'message_item',
|
|
51450
51478
|
rtl: ownMessageOnRightSide && !message.incoming,
|
|
@@ -51489,6 +51517,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51489
51517
|
ifLatestAndHasNotPreview: ifLatestAndHasNotPreview,
|
|
51490
51518
|
channel: channel,
|
|
51491
51519
|
message: message,
|
|
51520
|
+
isPinnedMessagesList: isPinnedMessagesList,
|
|
51492
51521
|
prevMessage: prevMessage,
|
|
51493
51522
|
nextMessage: nextMessage,
|
|
51494
51523
|
unreadMessageId: unreadMessageId,
|
|
@@ -51713,6 +51742,7 @@ var Message$1 = function Message(_ref) {
|
|
|
51713
51742
|
reactionsContainerPadding: reactionsContainerPadding,
|
|
51714
51743
|
reactionsDetailsPopupBorderRadius: reactionsDetailsPopupBorderRadius,
|
|
51715
51744
|
reactionsDetailsPopupHeaderItemsStyle: reactionsDetailsPopupHeaderItemsStyle,
|
|
51745
|
+
popupZIndex: isPinnedMessagesList ? 30 : undefined,
|
|
51716
51746
|
onToggleReactionsPopup: handleToggleReactionsPopup,
|
|
51717
51747
|
onReactionAddDelete: handleReactionAddDelete,
|
|
51718
51748
|
onOpenUserProfile: handleOpenUserProfile
|
|
@@ -52662,13 +52692,13 @@ var MessageList = function MessageList(_ref) {
|
|
|
52662
52692
|
MessageActionsMenu: MessageActionsMenu,
|
|
52663
52693
|
CustomMessageItem: CustomMessageItem,
|
|
52664
52694
|
messageReaction: messageReaction,
|
|
52665
|
-
editMessage: editMessage,
|
|
52695
|
+
editMessage: isPinnedMessagesList ? false : editMessage,
|
|
52666
52696
|
copyMessage: copyMessage,
|
|
52667
|
-
replyMessage: replyMessage,
|
|
52668
|
-
replyMessageInThread: replyMessageInThread,
|
|
52697
|
+
replyMessage: isPinnedMessagesList ? false : replyMessage,
|
|
52698
|
+
replyMessageInThread: isPinnedMessagesList ? false : replyMessageInThread,
|
|
52669
52699
|
deleteMessage: deleteMessage,
|
|
52670
52700
|
selectMessage: selectMessage,
|
|
52671
|
-
showInfoMessage: showInfoMessage,
|
|
52701
|
+
showInfoMessage: isPinnedMessagesList ? false : showInfoMessage,
|
|
52672
52702
|
allowEditDeleteIncomingMessage: allowEditDeleteIncomingMessage,
|
|
52673
52703
|
reportMessage: reportMessage,
|
|
52674
52704
|
reactionIcon: reactionIcon,
|
|
@@ -52928,7 +52958,7 @@ var MessageList = function MessageList(_ref) {
|
|
|
52928
52958
|
isUnreadMessage: false,
|
|
52929
52959
|
nextMessageStartsUnreadSection: false,
|
|
52930
52960
|
isHighlighted: false,
|
|
52931
|
-
ifLatestAndHasNotPreview:
|
|
52961
|
+
ifLatestAndHasNotPreview: index === 0,
|
|
52932
52962
|
registerInMessagesIndex: false,
|
|
52933
52963
|
isPinnedMessagesList: true
|
|
52934
52964
|
});
|
|
@@ -55357,6 +55387,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55357
55387
|
var recordButtonRef = React.useRef(null);
|
|
55358
55388
|
var audioElements = React.useRef({});
|
|
55359
55389
|
var intervalRef = React.useRef({});
|
|
55390
|
+
var isStoppingRef = React.useRef(false);
|
|
55391
|
+
var isStartingRef = React.useRef(false);
|
|
55392
|
+
var isRecordingRef = React.useRef(false);
|
|
55360
55393
|
var currentRecordedFile = React.useMemo(function () {
|
|
55361
55394
|
var current = getAudioRecordingFromMap(currentChannelId) || recordedFile;
|
|
55362
55395
|
return current;
|
|
@@ -55434,17 +55467,13 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55434
55467
|
setPlayAudio(false);
|
|
55435
55468
|
clearInterval(intervalRef.current[id]);
|
|
55436
55469
|
});
|
|
55437
|
-
audio.addEventListener('error', function () {
|
|
55438
|
-
var _audio$error;
|
|
55439
|
-
log.error('Audio playback error:', (_audio$error = audio.error) === null || _audio$error === void 0 ? void 0 : _audio$error.message);
|
|
55440
|
-
});
|
|
55441
55470
|
audio.src = fileData.objectUrl;
|
|
55442
55471
|
};
|
|
55443
55472
|
var startRecording = function startRecording(cId) {
|
|
55444
55473
|
try {
|
|
55445
55474
|
var id = cId || currentChannelId;
|
|
55446
55475
|
try {
|
|
55447
|
-
if (recording) {
|
|
55476
|
+
if (recording || isRecordingRef.current) {
|
|
55448
55477
|
stopRecording(true, id, false, recorder);
|
|
55449
55478
|
} else if (currentRecordedFile) {
|
|
55450
55479
|
if (!currentRecordedFile.dur) {
|
|
@@ -55460,8 +55489,16 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55460
55489
|
dispatch(setChannelDraftMessageIsRemovedAC(id));
|
|
55461
55490
|
sendRecordedFile(currentRecordedFile, id);
|
|
55462
55491
|
} else {
|
|
55463
|
-
if (!recorder)
|
|
55492
|
+
if (!recorder) {
|
|
55493
|
+
return Promise.resolve();
|
|
55494
|
+
}
|
|
55495
|
+
if (isStartingRef.current) {
|
|
55496
|
+
return Promise.resolve();
|
|
55497
|
+
}
|
|
55498
|
+
isStartingRef.current = true;
|
|
55464
55499
|
recorder.start().then(function () {
|
|
55500
|
+
isStartingRef.current = false;
|
|
55501
|
+
isRecordingRef.current = true;
|
|
55465
55502
|
handleStartRecording();
|
|
55466
55503
|
setAudioRecordingToMap(id, {
|
|
55467
55504
|
file: null,
|
|
@@ -55550,17 +55587,19 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55550
55587
|
};
|
|
55551
55588
|
soundAllowed(stream);
|
|
55552
55589
|
})["catch"](function (e) {
|
|
55590
|
+
isStartingRef.current = false;
|
|
55591
|
+
isRecordingRef.current = false;
|
|
55553
55592
|
if ((e === null || e === void 0 ? void 0 : e.name) === 'NotAllowedError' || (e === null || e === void 0 ? void 0 : e.name) === 'PermissionDeniedError') {
|
|
55554
55593
|
setMicrophonePermissionDenied(true);
|
|
55555
55594
|
}
|
|
55556
|
-
log.error(e);
|
|
55557
55595
|
});
|
|
55558
55596
|
}
|
|
55559
55597
|
} catch (e) {
|
|
55598
|
+
isStartingRef.current = false;
|
|
55599
|
+
isRecordingRef.current = false;
|
|
55560
55600
|
if ((e === null || e === void 0 ? void 0 : e.name) === 'NotAllowedError' || (e === null || e === void 0 ? void 0 : e.name) === 'PermissionDeniedError') {
|
|
55561
55601
|
setMicrophonePermissionDenied(true);
|
|
55562
55602
|
}
|
|
55563
|
-
log.error(e);
|
|
55564
55603
|
}
|
|
55565
55604
|
return Promise.resolve();
|
|
55566
55605
|
} catch (e) {
|
|
@@ -55568,7 +55607,12 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55568
55607
|
}
|
|
55569
55608
|
};
|
|
55570
55609
|
var cancelRecording = React.useCallback(function () {
|
|
55610
|
+
if (isStoppingRef.current) {
|
|
55611
|
+
return;
|
|
55612
|
+
}
|
|
55571
55613
|
handleStopRecording();
|
|
55614
|
+
isStartingRef.current = false;
|
|
55615
|
+
isRecordingRef.current = false;
|
|
55572
55616
|
if (currentRecordedFile) {
|
|
55573
55617
|
dispatch(setChannelDraftMessageIsRemovedAC(currentChannelId));
|
|
55574
55618
|
if (currentRecordedFile.objectUrl && currentRecordedFile.objectUrl.startsWith('blob:')) {
|
|
@@ -55589,10 +55633,21 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55589
55633
|
setShowRecording(false);
|
|
55590
55634
|
}, [currentRecordedFile, currentChannelId, setShowRecording, setRecordedFile]);
|
|
55591
55635
|
var stopRecording = React.useCallback(function (send, cId, draft, recorder) {
|
|
55636
|
+
var id = cId || channelId;
|
|
55637
|
+
if (isStoppingRef.current) {
|
|
55638
|
+
return;
|
|
55639
|
+
}
|
|
55640
|
+
if (!recorder) {
|
|
55641
|
+
return;
|
|
55642
|
+
}
|
|
55643
|
+
isStoppingRef.current = true;
|
|
55644
|
+
isStartingRef.current = false;
|
|
55645
|
+
isRecordingRef.current = false;
|
|
55592
55646
|
handleStopRecording();
|
|
55593
55647
|
shouldDraw = false;
|
|
55594
|
-
|
|
55595
|
-
|
|
55648
|
+
Promise.resolve().then(function () {
|
|
55649
|
+
return recorder.stop().getMp3();
|
|
55650
|
+
}).then(function (_ref2) {
|
|
55596
55651
|
var buffer = _ref2[0],
|
|
55597
55652
|
blob = _ref2[1];
|
|
55598
55653
|
var file = new File(buffer, 'record.mp3', {
|
|
@@ -55602,6 +55657,8 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55602
55657
|
var audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
|
55603
55658
|
var reader = new FileReader();
|
|
55604
55659
|
reader.onload = function (event) {
|
|
55660
|
+
var _event$target;
|
|
55661
|
+
var audioData = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.result;
|
|
55605
55662
|
var closeDecodeContext = function closeDecodeContext() {
|
|
55606
55663
|
if (audioContext.state !== 'closed') {
|
|
55607
55664
|
audioContext.close()["catch"](function () {
|
|
@@ -55609,76 +55666,100 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55609
55666
|
});
|
|
55610
55667
|
}
|
|
55611
55668
|
};
|
|
55612
|
-
|
|
55669
|
+
var handleDecodeError = function handleDecodeError() {
|
|
55613
55670
|
closeDecodeContext();
|
|
55614
|
-
var numberOfSegments = 50;
|
|
55615
|
-
var segmentSize = Math.floor(audioBuffer.length / numberOfSegments);
|
|
55616
|
-
var waveform = [];
|
|
55617
|
-
for (var i = 0; i < numberOfSegments; i++) {
|
|
55618
|
-
var start = i * segmentSize;
|
|
55619
|
-
var end = start + segmentSize;
|
|
55620
|
-
var segment = audioBuffer.getChannelData(0).slice(start, end);
|
|
55621
|
-
var maxAmplitude = 0;
|
|
55622
|
-
for (var j = 0; j < segment.length; j++) {
|
|
55623
|
-
var val = segment[j];
|
|
55624
|
-
var absVal = val < 0 ? -val : val;
|
|
55625
|
-
if (absVal > maxAmplitude) {
|
|
55626
|
-
maxAmplitude = absVal;
|
|
55627
|
-
}
|
|
55628
|
-
}
|
|
55629
|
-
waveform.push(Math.floor(maxAmplitude * 1000));
|
|
55630
|
-
}
|
|
55631
55671
|
setStartRecording(false);
|
|
55632
|
-
|
|
55633
|
-
|
|
55634
|
-
|
|
55635
|
-
|
|
55636
|
-
|
|
55637
|
-
|
|
55672
|
+
setShowRecording(false);
|
|
55673
|
+
removeAudioRecordingFromMap(id);
|
|
55674
|
+
dispatch(setChannelDraftMessageIsRemovedAC(id));
|
|
55675
|
+
isStoppingRef.current = false;
|
|
55676
|
+
};
|
|
55677
|
+
try {
|
|
55678
|
+
var decodeResult = audioContext.decodeAudioData(audioData, function (audioBuffer) {
|
|
55679
|
+
try {
|
|
55680
|
+
closeDecodeContext();
|
|
55681
|
+
var numberOfSegments = 50;
|
|
55682
|
+
var segmentSize = Math.floor(audioBuffer.length / numberOfSegments);
|
|
55683
|
+
var waveform = [];
|
|
55684
|
+
for (var i = 0; i < numberOfSegments; i++) {
|
|
55685
|
+
var start = i * segmentSize;
|
|
55686
|
+
var end = start + segmentSize;
|
|
55687
|
+
var segment = audioBuffer.getChannelData(0).slice(start, end);
|
|
55688
|
+
var maxAmplitude = 0;
|
|
55689
|
+
for (var j = 0; j < segment.length; j++) {
|
|
55690
|
+
var val = segment[j];
|
|
55691
|
+
var absVal = val < 0 ? -val : val;
|
|
55692
|
+
if (absVal > maxAmplitude) {
|
|
55693
|
+
maxAmplitude = absVal;
|
|
55694
|
+
}
|
|
55695
|
+
}
|
|
55696
|
+
waveform.push(Math.floor(maxAmplitude * 1000));
|
|
55638
55697
|
}
|
|
55639
|
-
|
|
55640
|
-
|
|
55641
|
-
|
|
55642
|
-
|
|
55643
|
-
|
|
55644
|
-
|
|
55645
|
-
|
|
55646
|
-
|
|
55647
|
-
|
|
55648
|
-
|
|
55649
|
-
|
|
55650
|
-
|
|
55651
|
-
|
|
55652
|
-
|
|
55653
|
-
|
|
55654
|
-
|
|
55655
|
-
|
|
55656
|
-
|
|
55657
|
-
|
|
55658
|
-
|
|
55659
|
-
|
|
55660
|
-
|
|
55661
|
-
|
|
55662
|
-
|
|
55663
|
-
|
|
55664
|
-
|
|
55665
|
-
|
|
55666
|
-
|
|
55667
|
-
|
|
55668
|
-
|
|
55669
|
-
|
|
55670
|
-
|
|
55671
|
-
|
|
55698
|
+
setStartRecording(false);
|
|
55699
|
+
var objectUrl = URL.createObjectURL(blob);
|
|
55700
|
+
var durationInt = Math.round(audioBuffer.duration);
|
|
55701
|
+
if (send) {
|
|
55702
|
+
if (!durationInt) {
|
|
55703
|
+
if (objectUrl.startsWith('blob:')) {
|
|
55704
|
+
URL.revokeObjectURL(objectUrl);
|
|
55705
|
+
}
|
|
55706
|
+
setShowRecording(false);
|
|
55707
|
+
removeAudioRecordingFromMap(id);
|
|
55708
|
+
dispatch(setChannelDraftMessageIsRemovedAC(id));
|
|
55709
|
+
isStoppingRef.current = false;
|
|
55710
|
+
return;
|
|
55711
|
+
}
|
|
55712
|
+
sendRecordedFile({
|
|
55713
|
+
file: file,
|
|
55714
|
+
objectUrl: objectUrl,
|
|
55715
|
+
thumb: waveform,
|
|
55716
|
+
dur: durationInt
|
|
55717
|
+
}, id);
|
|
55718
|
+
setShowRecording(false);
|
|
55719
|
+
removeAudioRecordingFromMap(id);
|
|
55720
|
+
dispatch(setChannelDraftMessageIsRemovedAC(id));
|
|
55721
|
+
} else {
|
|
55722
|
+
if (!draft) {
|
|
55723
|
+
setRecordedFile({
|
|
55724
|
+
file: file,
|
|
55725
|
+
objectUrl: objectUrl,
|
|
55726
|
+
thumb: waveform,
|
|
55727
|
+
dur: durationInt
|
|
55728
|
+
});
|
|
55729
|
+
}
|
|
55730
|
+
var audioRecording = {
|
|
55731
|
+
file: file,
|
|
55732
|
+
objectUrl: objectUrl,
|
|
55733
|
+
thumb: waveform,
|
|
55734
|
+
dur: durationInt
|
|
55735
|
+
};
|
|
55736
|
+
setAudioRecordingToMap(id, audioRecording);
|
|
55737
|
+
if (draft) {
|
|
55738
|
+
initAudioPlayback(draft, id, audioRecording);
|
|
55739
|
+
}
|
|
55740
|
+
}
|
|
55741
|
+
isStoppingRef.current = false;
|
|
55742
|
+
} catch (_unused) {}
|
|
55743
|
+
}, handleDecodeError);
|
|
55744
|
+
if (decodeResult && typeof decodeResult["catch"] === 'function') {
|
|
55745
|
+
decodeResult["catch"](function () {
|
|
55746
|
+
return undefined;
|
|
55747
|
+
});
|
|
55672
55748
|
}
|
|
55673
|
-
}
|
|
55674
|
-
|
|
55675
|
-
|
|
55676
|
-
|
|
55749
|
+
} catch (_unused2) {}
|
|
55750
|
+
};
|
|
55751
|
+
reader.onerror = function () {
|
|
55752
|
+
if (audioContext.state !== 'closed') {
|
|
55753
|
+
audioContext.close()["catch"](function () {
|
|
55754
|
+
return undefined;
|
|
55755
|
+
});
|
|
55756
|
+
}
|
|
55757
|
+
isStoppingRef.current = false;
|
|
55677
55758
|
};
|
|
55678
55759
|
reader.readAsArrayBuffer(blob);
|
|
55679
|
-
})["catch"](function (
|
|
55760
|
+
})["catch"](function () {
|
|
55761
|
+
isStoppingRef.current = false;
|
|
55680
55762
|
handleStopRecording();
|
|
55681
|
-
log.error(e);
|
|
55682
55763
|
});
|
|
55683
55764
|
}, [sendRecordedFile, setShowRecording, setAudioRecordingToMap, setRecordedFile, handleStopRecording, channelId]);
|
|
55684
55765
|
var handlePlayPause = function handlePlayPause(cId) {
|
|
@@ -55695,8 +55776,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55695
55776
|
setCurrentTimeSeconds(time);
|
|
55696
55777
|
}
|
|
55697
55778
|
}, 10);
|
|
55698
|
-
audio.play()["catch"](function (
|
|
55699
|
-
log.error('Audio play failed:', e);
|
|
55779
|
+
audio.play()["catch"](function () {
|
|
55700
55780
|
setPlayAudio(false);
|
|
55701
55781
|
});
|
|
55702
55782
|
} else {
|
|
@@ -55790,9 +55870,7 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
55790
55870
|
bitRate: 128
|
|
55791
55871
|
});
|
|
55792
55872
|
setRecorder(newRecorder);
|
|
55793
|
-
} catch (
|
|
55794
|
-
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
55795
|
-
}
|
|
55873
|
+
} catch (_unused3) {}
|
|
55796
55874
|
}
|
|
55797
55875
|
} catch (e) {
|
|
55798
55876
|
Promise.reject(e);
|
|
@@ -56644,101 +56722,109 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
56644
56722
|
var _useState = React.useState(false),
|
|
56645
56723
|
showRecording = _useState[0],
|
|
56646
56724
|
setShowRecording = _useState[1];
|
|
56725
|
+
var _useState2 = React.useState(0),
|
|
56726
|
+
setAudioRecordingRevision = _useState2[1];
|
|
56727
|
+
var handleShowRecording = React.useCallback(function (start) {
|
|
56728
|
+
setShowRecording(start);
|
|
56729
|
+
setAudioRecordingRevision(function (revision) {
|
|
56730
|
+
return revision + 1;
|
|
56731
|
+
});
|
|
56732
|
+
}, []);
|
|
56647
56733
|
var _usePermissions = usePermissions(activeChannel.userRole),
|
|
56648
56734
|
checkActionPermission = _usePermissions[0];
|
|
56649
|
-
var
|
|
56650
|
-
listenerIsAdded =
|
|
56651
|
-
setListenerIsAdded =
|
|
56652
|
-
var _useState3 = React.useState(''),
|
|
56653
|
-
messageText = _useState3[0],
|
|
56654
|
-
setMessageText = _useState3[1];
|
|
56735
|
+
var _useState3 = React.useState(false),
|
|
56736
|
+
listenerIsAdded = _useState3[0],
|
|
56737
|
+
setListenerIsAdded = _useState3[1];
|
|
56655
56738
|
var _useState4 = React.useState(''),
|
|
56656
|
-
|
|
56657
|
-
|
|
56658
|
-
var _useState5 = React.useState(
|
|
56659
|
-
|
|
56660
|
-
|
|
56661
|
-
var _useState6 = React.useState(
|
|
56662
|
-
|
|
56663
|
-
|
|
56664
|
-
var _useState7 = React.useState(
|
|
56665
|
-
|
|
56666
|
-
|
|
56739
|
+
messageText = _useState4[0],
|
|
56740
|
+
setMessageText = _useState4[1];
|
|
56741
|
+
var _useState5 = React.useState(''),
|
|
56742
|
+
editMessageText = _useState5[0],
|
|
56743
|
+
setEditMessageText = _useState5[1];
|
|
56744
|
+
var _useState6 = React.useState(null),
|
|
56745
|
+
restoredEditMessage = _useState6[0],
|
|
56746
|
+
setRestoredEditMessage = _useState6[1];
|
|
56747
|
+
var _useState7 = React.useState({}),
|
|
56748
|
+
readyVideoAttachments = _useState7[0],
|
|
56749
|
+
setReadyVideoAttachments = _useState7[1];
|
|
56667
56750
|
var _useState8 = React.useState(false),
|
|
56668
|
-
|
|
56669
|
-
|
|
56751
|
+
showChooseAttachmentType = _useState8[0],
|
|
56752
|
+
setShowChooseAttachmentType = _useState8[1];
|
|
56670
56753
|
var _useState9 = React.useState(false),
|
|
56671
|
-
|
|
56672
|
-
|
|
56673
|
-
var _useState0 = React.useState(
|
|
56674
|
-
|
|
56675
|
-
|
|
56754
|
+
isEmojisOpened = _useState9[0],
|
|
56755
|
+
setIsEmojisOpened = _useState9[1];
|
|
56756
|
+
var _useState0 = React.useState(false),
|
|
56757
|
+
emojisInRightSide = _useState0[0],
|
|
56758
|
+
setEmojisInRightSide = _useState0[1];
|
|
56676
56759
|
var _useState1 = React.useState(0),
|
|
56677
|
-
|
|
56678
|
-
|
|
56679
|
-
var _useState10 = React.useState(
|
|
56680
|
-
|
|
56681
|
-
|
|
56760
|
+
emojisPopupLeftPosition = _useState1[0],
|
|
56761
|
+
setEmojisPopupLeftPosition = _useState1[1];
|
|
56762
|
+
var _useState10 = React.useState(0),
|
|
56763
|
+
emojisPopupBottomPosition = _useState10[0],
|
|
56764
|
+
setEmojisPopupBottomPosition = _useState10[1];
|
|
56682
56765
|
var _useState11 = React.useState(false),
|
|
56683
|
-
|
|
56684
|
-
|
|
56685
|
-
var _useState12 = React.useState(
|
|
56766
|
+
addAttachmentsInRightSide = _useState11[0],
|
|
56767
|
+
setAddAttachmentsInRightSide = _useState11[1];
|
|
56768
|
+
var _useState12 = React.useState(false),
|
|
56769
|
+
showPoll = _useState12[0],
|
|
56770
|
+
setShowPoll = _useState12[1];
|
|
56771
|
+
var _useState13 = React.useState({
|
|
56686
56772
|
clear: false
|
|
56687
56773
|
}),
|
|
56688
|
-
shouldClearEditor =
|
|
56689
|
-
setShouldClearEditor =
|
|
56690
|
-
var _useState13 = React.useState([]),
|
|
56691
|
-
messageBodyAttributes = _useState13[0],
|
|
56692
|
-
setMessageBodyAttributes = _useState13[1];
|
|
56774
|
+
shouldClearEditor = _useState13[0],
|
|
56775
|
+
setShouldClearEditor = _useState13[1];
|
|
56693
56776
|
var _useState14 = React.useState([]),
|
|
56694
|
-
|
|
56695
|
-
|
|
56696
|
-
var _useState15 = React.useState(
|
|
56697
|
-
|
|
56698
|
-
|
|
56699
|
-
var _useState16 = React.useState(
|
|
56700
|
-
|
|
56701
|
-
|
|
56702
|
-
var _useState17 = React.useState(),
|
|
56703
|
-
|
|
56704
|
-
|
|
56705
|
-
var selectedText = React.useRef(null);
|
|
56777
|
+
messageBodyAttributes = _useState14[0],
|
|
56778
|
+
setMessageBodyAttributes = _useState14[1];
|
|
56779
|
+
var _useState15 = React.useState([]),
|
|
56780
|
+
mentionedUsers = _useState15[0],
|
|
56781
|
+
setMentionedUsers = _useState15[1];
|
|
56782
|
+
var _useState16 = React.useState(''),
|
|
56783
|
+
browser = _useState16[0],
|
|
56784
|
+
setBrowser = _useState16[1];
|
|
56785
|
+
var _useState17 = React.useState(false),
|
|
56786
|
+
mentionsIsOpen = _useState17[0],
|
|
56787
|
+
setMentionsIsOpen = _useState17[1];
|
|
56706
56788
|
var _useState18 = React.useState(),
|
|
56707
|
-
|
|
56708
|
-
|
|
56789
|
+
inputContainerHeight = _useState18[0],
|
|
56790
|
+
setInputContainerHeight = _useState18[1];
|
|
56791
|
+
var selectedText = React.useRef(null);
|
|
56709
56792
|
var _useState19 = React.useState(),
|
|
56710
|
-
|
|
56711
|
-
|
|
56712
|
-
var _useState20 = React.useState(
|
|
56713
|
-
|
|
56714
|
-
|
|
56793
|
+
typingTimout = _useState19[0],
|
|
56794
|
+
setTypingTimout = _useState19[1];
|
|
56795
|
+
var _useState20 = React.useState(),
|
|
56796
|
+
inTypingStateTimout = _useState20[0],
|
|
56797
|
+
setInTypingStateTimout = _useState20[1];
|
|
56715
56798
|
var _useState21 = React.useState(false),
|
|
56716
|
-
|
|
56717
|
-
|
|
56718
|
-
var _useState22 = React.useState(
|
|
56719
|
-
|
|
56720
|
-
|
|
56721
|
-
var _useState23 = React.useState(
|
|
56722
|
-
|
|
56723
|
-
|
|
56799
|
+
inTypingState = _useState21[0],
|
|
56800
|
+
setInTypingState = _useState21[1];
|
|
56801
|
+
var _useState22 = React.useState(false),
|
|
56802
|
+
sendMessageIsActive = _useState22[0],
|
|
56803
|
+
setSendMessageIsActive = _useState22[1];
|
|
56804
|
+
var _useState23 = React.useState([]),
|
|
56805
|
+
attachments = _useState23[0],
|
|
56806
|
+
setAttachments = _useState23[1];
|
|
56724
56807
|
var _useState24 = React.useState(false),
|
|
56725
|
-
|
|
56726
|
-
|
|
56808
|
+
forwardPopupOpen = _useState24[0],
|
|
56809
|
+
setForwardPopupOpen = _useState24[1];
|
|
56727
56810
|
var _useState25 = React.useState(false),
|
|
56728
|
-
|
|
56729
|
-
|
|
56730
|
-
var _useState26 = React.useState(
|
|
56731
|
-
|
|
56732
|
-
|
|
56733
|
-
var _useState27 = React.useState(''),
|
|
56734
|
-
|
|
56735
|
-
|
|
56736
|
-
var _useState28 = React.useState(
|
|
56737
|
-
|
|
56738
|
-
|
|
56739
|
-
var _useState29 = React.useState(
|
|
56740
|
-
|
|
56741
|
-
|
|
56811
|
+
deletePopupOpen = _useState25[0],
|
|
56812
|
+
setDeletePopupOpen = _useState25[1];
|
|
56813
|
+
var _useState26 = React.useState(false),
|
|
56814
|
+
isIncomingMessage = _useState26[0],
|
|
56815
|
+
setIsIncomingMessage = _useState26[1];
|
|
56816
|
+
var _useState27 = React.useState('.jpg,.jpeg,.png,.gif,.mp4,.mov,.avi,.wmv,.flv,.webm,.jfif'),
|
|
56817
|
+
mediaExtensions = _useState27[0],
|
|
56818
|
+
setMediaExtensions = _useState27[1];
|
|
56819
|
+
var _useState28 = React.useState(''),
|
|
56820
|
+
uploadErrorMessage = _useState28[0],
|
|
56821
|
+
setUploadErrorMessage = _useState28[1];
|
|
56822
|
+
var _useState29 = React.useState(false),
|
|
56823
|
+
viewOnce = _useState29[0],
|
|
56824
|
+
setViewOnce = _useState29[1];
|
|
56825
|
+
var _useState30 = React.useState(areDraftMessagesHydrated()),
|
|
56826
|
+
draftsHydrated = _useState30[0],
|
|
56827
|
+
setDraftsHydrated = _useState30[1];
|
|
56742
56828
|
var typingOrRecordingIndicator = useSelector(typingOrRecordingIndicatorArraySelector(activeChannel.id));
|
|
56743
56829
|
var contactsMap = useSelector(contactsMapSelector);
|
|
56744
56830
|
var connectionStatus = useSelector(connectionStatusSelector, reactRedux.shallowEqual);
|
|
@@ -56755,36 +56841,36 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
56755
56841
|
var restoringDraftRef = React.useRef(false);
|
|
56756
56842
|
var restoredDraftChannelIdRef = React.useRef(null);
|
|
56757
56843
|
var isNavigatingChannelRef = React.useRef(false);
|
|
56758
|
-
var
|
|
56759
|
-
realEditorState =
|
|
56760
|
-
setRealEditorState =
|
|
56761
|
-
var
|
|
56762
|
-
floatingAnchorElem =
|
|
56763
|
-
setFloatingAnchorElem =
|
|
56764
|
-
var _useState32 = React.useState(false),
|
|
56765
|
-
isSmallWidthViewport = _useState32[0],
|
|
56766
|
-
setIsSmallWidthViewport = _useState32[1];
|
|
56844
|
+
var _useState31 = React.useState(),
|
|
56845
|
+
realEditorState = _useState31[0],
|
|
56846
|
+
setRealEditorState = _useState31[1];
|
|
56847
|
+
var _useState32 = React.useState(null),
|
|
56848
|
+
floatingAnchorElem = _useState32[0],
|
|
56849
|
+
setFloatingAnchorElem = _useState32[1];
|
|
56767
56850
|
var _useState33 = React.useState(false),
|
|
56768
|
-
|
|
56769
|
-
|
|
56770
|
-
var _useState34 = React.useState(
|
|
56771
|
-
|
|
56772
|
-
|
|
56851
|
+
isSmallWidthViewport = _useState33[0],
|
|
56852
|
+
setIsSmallWidthViewport = _useState33[1];
|
|
56853
|
+
var _useState34 = React.useState(false),
|
|
56854
|
+
isScrolling = _useState34[0],
|
|
56855
|
+
setIsScrolling = _useState34[1];
|
|
56773
56856
|
var _useState35 = React.useState(null),
|
|
56774
|
-
|
|
56775
|
-
|
|
56776
|
-
var _useState36 = React.useState(
|
|
56777
|
-
|
|
56778
|
-
|
|
56779
|
-
var _useState37 = React.useState(
|
|
56780
|
-
|
|
56781
|
-
|
|
56857
|
+
linkPreview = _useState35[0],
|
|
56858
|
+
setLinkPreview = _useState35[1];
|
|
56859
|
+
var _useState36 = React.useState(null),
|
|
56860
|
+
detectedUrl = _useState36[0],
|
|
56861
|
+
setDetectedUrl = _useState36[1];
|
|
56862
|
+
var _useState37 = React.useState(new Set()),
|
|
56863
|
+
dismissedUrls = _useState37[0],
|
|
56864
|
+
setDismissedUrls = _useState37[1];
|
|
56782
56865
|
var _useState38 = React.useState(false),
|
|
56783
|
-
|
|
56784
|
-
|
|
56866
|
+
isClosingPreview = _useState38[0],
|
|
56867
|
+
setIsClosingPreview = _useState38[1];
|
|
56785
56868
|
var _useState39 = React.useState(false),
|
|
56786
|
-
|
|
56787
|
-
|
|
56869
|
+
replyLinkPreviewImageFailed = _useState39[0],
|
|
56870
|
+
setReplyLinkPreviewImageFailed = _useState39[1];
|
|
56871
|
+
var _useState40 = React.useState(false),
|
|
56872
|
+
linkPreviewImageFailed = _useState40[0],
|
|
56873
|
+
setLinkPreviewImageFailed = _useState40[1];
|
|
56788
56874
|
var addAttachmentByMenu = showChooseFileAttachment && showChooseMediaAttachment;
|
|
56789
56875
|
var linkify = new LinkifyIt();
|
|
56790
56876
|
var oGMetadata = useSelector(function (state) {
|
|
@@ -58565,7 +58651,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
58565
58651
|
activeColor: accentColor
|
|
58566
58652
|
}, /*#__PURE__*/React__default.createElement(AudioRecord$1, {
|
|
58567
58653
|
sendRecordedFile: sendRecordedFile,
|
|
58568
|
-
setShowRecording:
|
|
58654
|
+
setShowRecording: handleShowRecording,
|
|
58569
58655
|
showRecording: showRecording,
|
|
58570
58656
|
channelId: activeChannel.id,
|
|
58571
58657
|
maxRecordingDuration: audioRecordingMaxDuration,
|