sceyt-chat-react-uikit 1.7.2-beta.1 → 1.7.2-beta.11
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/Attachment/index.d.ts +4 -1
- package/components/AudioPlayer/index.d.ts +3 -0
- package/components/ChatContainer/index.d.ts +2 -1
- package/components/Message/Message.types.d.ts +24 -1
- package/components/Message/MessageActions/index.d.ts +1 -1
- package/components/Message/MessageBody/index.d.ts +6 -1
- package/components/Message/OGMetadata/index.d.ts +2 -1
- package/components/Message/index.d.ts +1 -1
- package/components/Messages/MessageList/index.d.ts +22 -1
- package/components/Messages/index.d.ts +22 -1
- package/components/SceytChat/index.d.ts +1 -1
- package/index.js +1666 -906
- package/index.modern.js +1666 -887
- package/package.json +1 -1
- package/types/index.d.ts +28 -9
package/index.modern.js
CHANGED
|
@@ -20,6 +20,7 @@ import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
|
20
20
|
import { createPortal } from 'react-dom';
|
|
21
21
|
import { useBasicTypeaheadTriggerMatch, LexicalTypeaheadMenuPlugin, MenuOption } from '@lexical/react/LexicalTypeaheadMenuPlugin';
|
|
22
22
|
import { $createOffsetView } from '@lexical/offset';
|
|
23
|
+
import MicRecorder from 'mic-recorder-to-mp3';
|
|
23
24
|
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
24
25
|
|
|
25
26
|
// src/utils/formatProdErrorMessage.ts
|
|
@@ -2593,7 +2594,8 @@ var MESSAGE_DELIVERY_STATUS = {
|
|
|
2593
2594
|
PENDING: 'pending',
|
|
2594
2595
|
SENT: 'sent',
|
|
2595
2596
|
DELIVERED: 'received',
|
|
2596
|
-
READ: 'displayed'
|
|
2597
|
+
READ: 'displayed',
|
|
2598
|
+
PLAYED: 'played'
|
|
2597
2599
|
};
|
|
2598
2600
|
var MESSAGE_STATUS = {
|
|
2599
2601
|
UNMODIFIED: 'unmodified',
|
|
@@ -8947,6 +8949,7 @@ var UploadImageIcon;
|
|
|
8947
8949
|
var showChannelDetails = false;
|
|
8948
8950
|
var channelTypesFilter = [];
|
|
8949
8951
|
var memberCount = 10;
|
|
8952
|
+
var disableFrowardMentionsCount = false;
|
|
8950
8953
|
function setChannelInMap(channel) {
|
|
8951
8954
|
channelsMap[channel.id] = _extends({}, channel);
|
|
8952
8955
|
}
|
|
@@ -9043,6 +9046,12 @@ function getChannelMembersCount() {
|
|
|
9043
9046
|
function setChannelMembersCount(count) {
|
|
9044
9047
|
memberCount = count;
|
|
9045
9048
|
}
|
|
9049
|
+
function setDisableFrowardMentionsCount(disable) {
|
|
9050
|
+
disableFrowardMentionsCount = disable;
|
|
9051
|
+
}
|
|
9052
|
+
function getDisableFrowardMentionsCount() {
|
|
9053
|
+
return disableFrowardMentionsCount;
|
|
9054
|
+
}
|
|
9046
9055
|
var handleNewMessages;
|
|
9047
9056
|
function setHandleNewMessages(callback) {
|
|
9048
9057
|
handleNewMessages = callback;
|
|
@@ -9557,6 +9566,7 @@ var UPDATE_CHANNEL = 'UPDATE_CHANNEL';
|
|
|
9557
9566
|
var REMOVE_CHANNEL_CACHES = 'REMOVE_CHANNEL_CACHES';
|
|
9558
9567
|
var MARK_MESSAGES_AS_READ = 'MARK_MESSAGES_AS_READ';
|
|
9559
9568
|
var MARK_MESSAGES_AS_DELIVERED = 'MARK_MESSAGES_AS_DELIVERED';
|
|
9569
|
+
var MARK_VOICE_MESSAGE_AS_PLAYED = 'MARK_VOICE_MESSAGE_AS_PLAYED';
|
|
9560
9570
|
var SEND_TYPING = 'SEND_TYPING';
|
|
9561
9571
|
var SEND_RECORDING = 'SEND_RECORDING';
|
|
9562
9572
|
var JOIN_TO_CHANNEL = 'JOIN_TO_CHANNEL';
|
|
@@ -10327,7 +10337,11 @@ var initialState$1 = {
|
|
|
10327
10337
|
openedMessageMenu: '',
|
|
10328
10338
|
attachmentsUploadingProgress: {},
|
|
10329
10339
|
playingAudioId: null,
|
|
10330
|
-
selectedMessagesMap: null
|
|
10340
|
+
selectedMessagesMap: null,
|
|
10341
|
+
oGMetadata: {},
|
|
10342
|
+
attachmentUpdatedMap: {},
|
|
10343
|
+
messageMarkers: {},
|
|
10344
|
+
messagesMarkersLoadingState: null
|
|
10331
10345
|
};
|
|
10332
10346
|
var messageSlice = createSlice({
|
|
10333
10347
|
name: 'messages',
|
|
@@ -10456,39 +10470,8 @@ var messageSlice = createSlice({
|
|
|
10456
10470
|
updateMessageAttachment: function updateMessageAttachment(state, action) {
|
|
10457
10471
|
var _action$payload4 = action.payload,
|
|
10458
10472
|
url = _action$payload4.url,
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
state.activeChannelMessages = state.activeChannelMessages.map(function (message) {
|
|
10462
|
-
if (message.id === messageId) {
|
|
10463
|
-
for (var index = 0; index < message.attachments.length; index++) {
|
|
10464
|
-
var attachment = message.attachments[index];
|
|
10465
|
-
if (attachment.url === url) {
|
|
10466
|
-
message.attachments[index] = _extends({}, attachment, params);
|
|
10467
|
-
}
|
|
10468
|
-
}
|
|
10469
|
-
}
|
|
10470
|
-
if (message.attachments.length) {
|
|
10471
|
-
var detachedAttachments = message.attachments.map(function (att) {
|
|
10472
|
-
var _att$user, _att$user2;
|
|
10473
|
-
return _extends({}, att, {
|
|
10474
|
-
user: _extends({}, att.user, {
|
|
10475
|
-
metadata: _extends({}, ((_att$user = att.user) === null || _att$user === void 0 ? void 0 : _att$user.metadata) || {}),
|
|
10476
|
-
presence: _extends({}, ((_att$user2 = att.user) === null || _att$user2 === void 0 ? void 0 : _att$user2.presence) || {})
|
|
10477
|
-
})
|
|
10478
|
-
});
|
|
10479
|
-
});
|
|
10480
|
-
updateMessageOnAllMessages(messageId, {
|
|
10481
|
-
attachments: detachedAttachments
|
|
10482
|
-
});
|
|
10483
|
-
updateMessageOnMap(message.channelId, {
|
|
10484
|
-
messageId: messageId,
|
|
10485
|
-
params: {
|
|
10486
|
-
attachments: detachedAttachments
|
|
10487
|
-
}
|
|
10488
|
-
});
|
|
10489
|
-
}
|
|
10490
|
-
return message;
|
|
10491
|
-
});
|
|
10473
|
+
attachmentUrl = _action$payload4.attachmentUrl;
|
|
10474
|
+
state.attachmentUpdatedMap[url] = attachmentUrl;
|
|
10492
10475
|
},
|
|
10493
10476
|
addReactionToMessage: function addReactionToMessage(state, action) {
|
|
10494
10477
|
var _action$payload5 = action.payload,
|
|
@@ -10670,6 +10653,69 @@ var messageSlice = createSlice({
|
|
|
10670
10653
|
},
|
|
10671
10654
|
clearSelectedMessages: function clearSelectedMessages(state) {
|
|
10672
10655
|
state.selectedMessagesMap = null;
|
|
10656
|
+
},
|
|
10657
|
+
setOGMetadata: function setOGMetadata(state, action) {
|
|
10658
|
+
var _action$payload10 = action.payload,
|
|
10659
|
+
url = _action$payload10.url,
|
|
10660
|
+
metadata = _action$payload10.metadata;
|
|
10661
|
+
state.oGMetadata[url] = metadata;
|
|
10662
|
+
},
|
|
10663
|
+
updateOGMetadata: function updateOGMetadata(state, action) {
|
|
10664
|
+
var _action$payload11 = action.payload,
|
|
10665
|
+
url = _action$payload11.url,
|
|
10666
|
+
metadata = _action$payload11.metadata;
|
|
10667
|
+
if (metadata) {
|
|
10668
|
+
var existing = state.oGMetadata[url];
|
|
10669
|
+
state.oGMetadata[url] = existing ? _extends({}, existing, metadata) : metadata;
|
|
10670
|
+
}
|
|
10671
|
+
},
|
|
10672
|
+
setMessageMarkers: function setMessageMarkers(state, action) {
|
|
10673
|
+
var _action$payload12 = action.payload,
|
|
10674
|
+
channelId = _action$payload12.channelId,
|
|
10675
|
+
messageId = _action$payload12.messageId,
|
|
10676
|
+
messageMarkers = _action$payload12.messageMarkers,
|
|
10677
|
+
deliveryStatus = _action$payload12.deliveryStatus;
|
|
10678
|
+
if (!state.messageMarkers[channelId]) {
|
|
10679
|
+
state.messageMarkers[channelId] = {};
|
|
10680
|
+
}
|
|
10681
|
+
if (!state.messageMarkers[channelId][messageId]) {
|
|
10682
|
+
state.messageMarkers[channelId][messageId] = {};
|
|
10683
|
+
}
|
|
10684
|
+
if (!state.messageMarkers[channelId][messageId][deliveryStatus]) {
|
|
10685
|
+
state.messageMarkers[channelId][messageId][deliveryStatus] = [];
|
|
10686
|
+
}
|
|
10687
|
+
state.messageMarkers[channelId][messageId][deliveryStatus] = [].concat(messageMarkers);
|
|
10688
|
+
},
|
|
10689
|
+
updateMessagesMarkers: function updateMessagesMarkers(state, action) {
|
|
10690
|
+
var _marker$user;
|
|
10691
|
+
var _action$payload13 = action.payload,
|
|
10692
|
+
channelId = _action$payload13.channelId,
|
|
10693
|
+
deliveryStatus = _action$payload13.deliveryStatus,
|
|
10694
|
+
marker = _action$payload13.marker;
|
|
10695
|
+
var userId = (_marker$user = marker.user) === null || _marker$user === void 0 ? void 0 : _marker$user.id;
|
|
10696
|
+
var messageIds = marker.messageIds;
|
|
10697
|
+
for (var _iterator = _createForOfIteratorHelperLoose(messageIds), _step; !(_step = _iterator()).done;) {
|
|
10698
|
+
var messageId = _step.value;
|
|
10699
|
+
if (!state.messageMarkers[channelId]) {
|
|
10700
|
+
state.messageMarkers[channelId] = {};
|
|
10701
|
+
}
|
|
10702
|
+
if (!state.messageMarkers[channelId][messageId]) {
|
|
10703
|
+
state.messageMarkers[channelId][messageId] = {};
|
|
10704
|
+
}
|
|
10705
|
+
if (!state.messageMarkers[channelId][messageId][deliveryStatus]) {
|
|
10706
|
+
state.messageMarkers[channelId][messageId][deliveryStatus] = [];
|
|
10707
|
+
}
|
|
10708
|
+
var isUserMarkered = state.messageMarkers[channelId][messageId][deliveryStatus].some(function (marker) {
|
|
10709
|
+
var _marker$user2;
|
|
10710
|
+
return ((_marker$user2 = marker.user) === null || _marker$user2 === void 0 ? void 0 : _marker$user2.id) === userId;
|
|
10711
|
+
});
|
|
10712
|
+
if (!isUserMarkered) {
|
|
10713
|
+
state.messageMarkers[channelId][messageId][deliveryStatus].push(marker);
|
|
10714
|
+
}
|
|
10715
|
+
}
|
|
10716
|
+
},
|
|
10717
|
+
setMessagesMarkersLoadingState: function setMessagesMarkersLoadingState(state, action) {
|
|
10718
|
+
state.messagesMarkersLoadingState = action.payload.state;
|
|
10673
10719
|
}
|
|
10674
10720
|
},
|
|
10675
10721
|
extraReducers: function extraReducers(builder) {
|
|
@@ -10719,7 +10765,12 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
10719
10765
|
setPlayingAudioId = _messageSlice$actions.setPlayingAudioId,
|
|
10720
10766
|
addSelectedMessage = _messageSlice$actions.addSelectedMessage,
|
|
10721
10767
|
removeSelectedMessage = _messageSlice$actions.removeSelectedMessage,
|
|
10722
|
-
clearSelectedMessages = _messageSlice$actions.clearSelectedMessages
|
|
10768
|
+
clearSelectedMessages = _messageSlice$actions.clearSelectedMessages,
|
|
10769
|
+
setOGMetadata = _messageSlice$actions.setOGMetadata,
|
|
10770
|
+
updateOGMetadata = _messageSlice$actions.updateOGMetadata,
|
|
10771
|
+
setMessageMarkers = _messageSlice$actions.setMessageMarkers,
|
|
10772
|
+
setMessagesMarkersLoadingState = _messageSlice$actions.setMessagesMarkersLoadingState,
|
|
10773
|
+
updateMessagesMarkers = _messageSlice$actions.updateMessagesMarkers;
|
|
10723
10774
|
var MessageReducer = messageSlice.reducer;
|
|
10724
10775
|
|
|
10725
10776
|
var initialState$2 = {
|
|
@@ -11331,6 +11382,15 @@ var markMessagesAsDeliveredAC = function markMessagesAsDeliveredAC(channelId, me
|
|
|
11331
11382
|
}
|
|
11332
11383
|
};
|
|
11333
11384
|
};
|
|
11385
|
+
var markVoiceMessageAsPlayedAC = function markVoiceMessageAsPlayedAC(channelId, messageIds) {
|
|
11386
|
+
return {
|
|
11387
|
+
type: MARK_VOICE_MESSAGE_AS_PLAYED,
|
|
11388
|
+
payload: {
|
|
11389
|
+
channelId: channelId,
|
|
11390
|
+
messageIds: messageIds
|
|
11391
|
+
}
|
|
11392
|
+
};
|
|
11393
|
+
};
|
|
11334
11394
|
var sendTypingAC = function sendTypingAC(state) {
|
|
11335
11395
|
return {
|
|
11336
11396
|
type: SEND_TYPING,
|
|
@@ -11506,6 +11566,7 @@ var getChannelMentionsAC = function getChannelMentionsAC(channelId) {
|
|
|
11506
11566
|
|
|
11507
11567
|
var GET_MESSAGES = 'GET_MESSAGES';
|
|
11508
11568
|
var GET_MESSAGE = 'GET_MESSAGE';
|
|
11569
|
+
var GET_MESSAGE_MARKERS = 'GET_MESSAGE_MARKERS';
|
|
11509
11570
|
var LOAD_MORE_MESSAGES = 'LOAD_MORE_MESSAGES';
|
|
11510
11571
|
var SEND_MESSAGE = 'SEND_MESSAGE';
|
|
11511
11572
|
var SEND_TEXT_MESSAGE = 'SEND_TEXT_MESSAGE';
|
|
@@ -11799,11 +11860,22 @@ function setMessagesHasNextAC(hasNext) {
|
|
|
11799
11860
|
hasNext: hasNext
|
|
11800
11861
|
});
|
|
11801
11862
|
}
|
|
11802
|
-
function
|
|
11863
|
+
function setOGMetadataAC(url, metadata) {
|
|
11864
|
+
return setOGMetadata({
|
|
11865
|
+
url: url,
|
|
11866
|
+
metadata: metadata
|
|
11867
|
+
});
|
|
11868
|
+
}
|
|
11869
|
+
function updateOGMetadataAC(url, metadata) {
|
|
11870
|
+
return updateOGMetadata({
|
|
11871
|
+
url: url,
|
|
11872
|
+
metadata: metadata
|
|
11873
|
+
});
|
|
11874
|
+
}
|
|
11875
|
+
function setUpdateMessageAttachmentAC(url, attachmentUrl) {
|
|
11803
11876
|
return updateMessageAttachment({
|
|
11804
11877
|
url: url,
|
|
11805
|
-
|
|
11806
|
-
params: params
|
|
11878
|
+
attachmentUrl: attachmentUrl
|
|
11807
11879
|
});
|
|
11808
11880
|
}
|
|
11809
11881
|
function updateMessageAC(messageId, params, addIfNotExists) {
|
|
@@ -11928,6 +12000,36 @@ function removeSelectedMessageAC(messageId) {
|
|
|
11928
12000
|
function clearSelectedMessagesAC() {
|
|
11929
12001
|
return clearSelectedMessages();
|
|
11930
12002
|
}
|
|
12003
|
+
function getMessageMarkersAC(messageId, channelId, deliveryStatus) {
|
|
12004
|
+
return {
|
|
12005
|
+
type: GET_MESSAGE_MARKERS,
|
|
12006
|
+
payload: {
|
|
12007
|
+
messageId: messageId,
|
|
12008
|
+
channelId: channelId,
|
|
12009
|
+
deliveryStatus: deliveryStatus
|
|
12010
|
+
}
|
|
12011
|
+
};
|
|
12012
|
+
}
|
|
12013
|
+
function setMessageMarkersAC(channelId, messageId, messageMarkers, deliveryStatus) {
|
|
12014
|
+
return setMessageMarkers({
|
|
12015
|
+
channelId: channelId,
|
|
12016
|
+
messageId: messageId,
|
|
12017
|
+
messageMarkers: messageMarkers,
|
|
12018
|
+
deliveryStatus: deliveryStatus
|
|
12019
|
+
});
|
|
12020
|
+
}
|
|
12021
|
+
function updateMessagesMarkersAC(channelId, deliveryStatus, marker) {
|
|
12022
|
+
return updateMessagesMarkers({
|
|
12023
|
+
channelId: channelId,
|
|
12024
|
+
deliveryStatus: deliveryStatus,
|
|
12025
|
+
marker: marker
|
|
12026
|
+
});
|
|
12027
|
+
}
|
|
12028
|
+
function setMessagesMarkersLoadingStateAC(state) {
|
|
12029
|
+
return setMessagesMarkersLoadingState({
|
|
12030
|
+
state: state
|
|
12031
|
+
});
|
|
12032
|
+
}
|
|
11931
12033
|
|
|
11932
12034
|
var SET_CONTACT_LOADING_STATE = 'SET_CONTACT_LOADING_STATE';
|
|
11933
12035
|
var GET_CONTACTS = 'GET_CONTACTS';
|
|
@@ -14202,6 +14304,8 @@ function watchForEvents() {
|
|
|
14202
14304
|
name: markerList.name,
|
|
14203
14305
|
markersMap: markersMap
|
|
14204
14306
|
});
|
|
14307
|
+
_context.n = 71;
|
|
14308
|
+
return put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
14205
14309
|
case 71:
|
|
14206
14310
|
return _context.a(3, 142);
|
|
14207
14311
|
case 72:
|
|
@@ -14736,27 +14840,28 @@ var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
14736
14840
|
_marked7 = /*#__PURE__*/_regenerator().m(getChannelMentions),
|
|
14737
14841
|
_marked8 = /*#__PURE__*/_regenerator().m(channelsForForwardLoadMore),
|
|
14738
14842
|
_marked9 = /*#__PURE__*/_regenerator().m(markMessagesRead),
|
|
14739
|
-
_marked0 = /*#__PURE__*/_regenerator().m(
|
|
14740
|
-
_marked1 = /*#__PURE__*/_regenerator().m(
|
|
14741
|
-
_marked10 = /*#__PURE__*/_regenerator().m(
|
|
14742
|
-
_marked11 = /*#__PURE__*/_regenerator().m(
|
|
14743
|
-
_marked12 = /*#__PURE__*/_regenerator().m(
|
|
14744
|
-
_marked13 = /*#__PURE__*/_regenerator().m(
|
|
14745
|
-
_marked14 = /*#__PURE__*/_regenerator().m(
|
|
14746
|
-
_marked15 = /*#__PURE__*/_regenerator().m(
|
|
14747
|
-
_marked16 = /*#__PURE__*/_regenerator().m(
|
|
14748
|
-
_marked17 = /*#__PURE__*/_regenerator().m(
|
|
14749
|
-
_marked18 = /*#__PURE__*/_regenerator().m(
|
|
14750
|
-
_marked19 = /*#__PURE__*/_regenerator().m(
|
|
14751
|
-
_marked20 = /*#__PURE__*/_regenerator().m(
|
|
14752
|
-
_marked21 = /*#__PURE__*/_regenerator().m(
|
|
14753
|
-
_marked22 = /*#__PURE__*/_regenerator().m(
|
|
14754
|
-
_marked23 = /*#__PURE__*/_regenerator().m(
|
|
14755
|
-
_marked24 = /*#__PURE__*/_regenerator().m(
|
|
14756
|
-
_marked25 = /*#__PURE__*/_regenerator().m(
|
|
14757
|
-
_marked26 = /*#__PURE__*/_regenerator().m(
|
|
14758
|
-
_marked27 = /*#__PURE__*/_regenerator().m(
|
|
14759
|
-
_marked28 = /*#__PURE__*/_regenerator().m(
|
|
14843
|
+
_marked0 = /*#__PURE__*/_regenerator().m(markVoiceMessageAsPlayed),
|
|
14844
|
+
_marked1 = /*#__PURE__*/_regenerator().m(markMessagesDelivered),
|
|
14845
|
+
_marked10 = /*#__PURE__*/_regenerator().m(switchChannel),
|
|
14846
|
+
_marked11 = /*#__PURE__*/_regenerator().m(notificationsTurnOff),
|
|
14847
|
+
_marked12 = /*#__PURE__*/_regenerator().m(notificationsTurnOn),
|
|
14848
|
+
_marked13 = /*#__PURE__*/_regenerator().m(markChannelAsRead),
|
|
14849
|
+
_marked14 = /*#__PURE__*/_regenerator().m(markChannelAsUnRead),
|
|
14850
|
+
_marked15 = /*#__PURE__*/_regenerator().m(pinChannel),
|
|
14851
|
+
_marked16 = /*#__PURE__*/_regenerator().m(unpinChannel),
|
|
14852
|
+
_marked17 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
|
|
14853
|
+
_marked18 = /*#__PURE__*/_regenerator().m(leaveChannel),
|
|
14854
|
+
_marked19 = /*#__PURE__*/_regenerator().m(deleteChannel),
|
|
14855
|
+
_marked20 = /*#__PURE__*/_regenerator().m(blockChannel),
|
|
14856
|
+
_marked21 = /*#__PURE__*/_regenerator().m(updateChannel),
|
|
14857
|
+
_marked22 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
|
|
14858
|
+
_marked23 = /*#__PURE__*/_regenerator().m(sendTyping),
|
|
14859
|
+
_marked24 = /*#__PURE__*/_regenerator().m(sendRecording),
|
|
14860
|
+
_marked25 = /*#__PURE__*/_regenerator().m(clearHistory),
|
|
14861
|
+
_marked26 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
|
|
14862
|
+
_marked27 = /*#__PURE__*/_regenerator().m(joinChannel),
|
|
14863
|
+
_marked28 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
|
|
14864
|
+
_marked29 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
14760
14865
|
function createChannel(action) {
|
|
14761
14866
|
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
14762
14867
|
return _regenerator().w(function (_context) {
|
|
@@ -14874,7 +14979,7 @@ function createChannel(action) {
|
|
|
14874
14979
|
}
|
|
14875
14980
|
messageToSend = {
|
|
14876
14981
|
body: createdChannel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || createdChannel.type === DEFAULT_CHANNEL_TYPE.PUBLIC ? 'CC' : 'CG',
|
|
14877
|
-
|
|
14982
|
+
mentionedUsers: [],
|
|
14878
14983
|
attachments: [],
|
|
14879
14984
|
type: 'system'
|
|
14880
14985
|
};
|
|
@@ -15654,7 +15759,7 @@ function markMessagesRead(action) {
|
|
|
15654
15759
|
deliveryStatus: MESSAGE_DELIVERY_STATUS.READ,
|
|
15655
15760
|
userMarkers: [{
|
|
15656
15761
|
user: messageListMarker.user,
|
|
15657
|
-
createdAt: messageListMarker.
|
|
15762
|
+
createdAt: messageListMarker.createdAt,
|
|
15658
15763
|
messageId: messageId,
|
|
15659
15764
|
name: MESSAGE_DELIVERY_STATUS.READ
|
|
15660
15765
|
}]
|
|
@@ -15682,7 +15787,7 @@ function markMessagesRead(action) {
|
|
|
15682
15787
|
}
|
|
15683
15788
|
}, _marked9, null, [[2, 9]]);
|
|
15684
15789
|
}
|
|
15685
|
-
function
|
|
15790
|
+
function markVoiceMessageAsPlayed(action) {
|
|
15686
15791
|
var payload, channelId, messageIds, channel, _t10;
|
|
15687
15792
|
return _regenerator().w(function (_context0) {
|
|
15688
15793
|
while (1) switch (_context0.p = _context0.n) {
|
|
@@ -15704,151 +15809,148 @@ function markMessagesDelivered(action) {
|
|
|
15704
15809
|
_context0.n = 3;
|
|
15705
15810
|
break;
|
|
15706
15811
|
}
|
|
15707
|
-
log.info('send delivered marker ', messageIds);
|
|
15708
15812
|
_context0.n = 3;
|
|
15709
|
-
return call(channel.
|
|
15813
|
+
return call(channel.markVoiceMessagesAsPlayed, messageIds);
|
|
15710
15814
|
case 3:
|
|
15711
15815
|
_context0.n = 5;
|
|
15712
15816
|
break;
|
|
15713
15817
|
case 4:
|
|
15714
15818
|
_context0.p = 4;
|
|
15715
15819
|
_t10 = _context0.v;
|
|
15716
|
-
log.error(_t10, 'Error on mark messages
|
|
15820
|
+
log.error(_t10, 'Error on mark voice messages read');
|
|
15717
15821
|
case 5:
|
|
15718
15822
|
return _context0.a(2);
|
|
15719
15823
|
}
|
|
15720
15824
|
}, _marked0, null, [[1, 4]]);
|
|
15721
15825
|
}
|
|
15722
|
-
function
|
|
15723
|
-
var payload,
|
|
15826
|
+
function markMessagesDelivered(action) {
|
|
15827
|
+
var payload, channelId, messageIds, channel, _t11;
|
|
15724
15828
|
return _regenerator().w(function (_context1) {
|
|
15725
15829
|
while (1) switch (_context1.p = _context1.n) {
|
|
15726
15830
|
case 0:
|
|
15727
|
-
|
|
15831
|
+
payload = action.payload;
|
|
15832
|
+
channelId = payload.channelId, messageIds = payload.messageIds;
|
|
15833
|
+
_context1.p = 1;
|
|
15834
|
+
_context1.n = 2;
|
|
15835
|
+
return call(getChannelFromMap, channelId);
|
|
15836
|
+
case 2:
|
|
15837
|
+
channel = _context1.v;
|
|
15838
|
+
if (!channel) {
|
|
15839
|
+
channel = getChannelFromAllChannels(channelId);
|
|
15840
|
+
if (channel) {
|
|
15841
|
+
setChannelInMap(channel);
|
|
15842
|
+
}
|
|
15843
|
+
}
|
|
15844
|
+
if (!channel) {
|
|
15845
|
+
_context1.n = 3;
|
|
15846
|
+
break;
|
|
15847
|
+
}
|
|
15848
|
+
log.info('send delivered marker ', messageIds);
|
|
15849
|
+
_context1.n = 3;
|
|
15850
|
+
return call(channel.markMessagesAsReceived, messageIds);
|
|
15851
|
+
case 3:
|
|
15852
|
+
_context1.n = 5;
|
|
15853
|
+
break;
|
|
15854
|
+
case 4:
|
|
15855
|
+
_context1.p = 4;
|
|
15856
|
+
_t11 = _context1.v;
|
|
15857
|
+
log.error(_t11, 'Error on mark messages delivered');
|
|
15858
|
+
case 5:
|
|
15859
|
+
return _context1.a(2);
|
|
15860
|
+
}
|
|
15861
|
+
}, _marked1, null, [[1, 4]]);
|
|
15862
|
+
}
|
|
15863
|
+
function switchChannel(action) {
|
|
15864
|
+
var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, _SceytChatClient5, fetchedChannel, channelFromMap, currentActiveChannel, _t12;
|
|
15865
|
+
return _regenerator().w(function (_context10) {
|
|
15866
|
+
while (1) switch (_context10.p = _context10.n) {
|
|
15867
|
+
case 0:
|
|
15868
|
+
_context10.p = 0;
|
|
15728
15869
|
payload = action.payload;
|
|
15729
15870
|
channel = payload.channel, updateActiveChannel = payload.updateActiveChannel;
|
|
15730
15871
|
channelToSwitch = channel;
|
|
15731
15872
|
if (!(!(channel !== null && channel !== void 0 && channel.id) && updateActiveChannel)) {
|
|
15732
|
-
|
|
15873
|
+
_context10.n = 3;
|
|
15733
15874
|
break;
|
|
15734
15875
|
}
|
|
15735
|
-
|
|
15876
|
+
_context10.n = 1;
|
|
15736
15877
|
return call(setActiveChannelId, '');
|
|
15737
15878
|
case 1:
|
|
15738
|
-
|
|
15879
|
+
_context10.n = 2;
|
|
15739
15880
|
return put(setActiveChannelAC({}));
|
|
15740
15881
|
case 2:
|
|
15741
|
-
return
|
|
15882
|
+
return _context10.a(2);
|
|
15742
15883
|
case 3:
|
|
15743
15884
|
existingChannel = checkChannelExists(channel.id);
|
|
15744
15885
|
if (existingChannel) {
|
|
15745
|
-
|
|
15886
|
+
_context10.n = 9;
|
|
15746
15887
|
break;
|
|
15747
15888
|
}
|
|
15748
15889
|
addChannel = getChannelFromAllChannels(channel.id);
|
|
15749
15890
|
if (!addChannel) {
|
|
15750
|
-
|
|
15891
|
+
_context10.n = 5;
|
|
15751
15892
|
break;
|
|
15752
15893
|
}
|
|
15753
15894
|
setChannelInMap(addChannel);
|
|
15754
|
-
|
|
15895
|
+
_context10.n = 4;
|
|
15755
15896
|
return put(addChannelAC(JSON.parse(JSON.stringify(addChannel))));
|
|
15756
15897
|
case 4:
|
|
15757
15898
|
channelToSwitch = _extends({}, channelToSwitch, addChannel);
|
|
15758
|
-
|
|
15899
|
+
_context10.n = 8;
|
|
15759
15900
|
break;
|
|
15760
15901
|
case 5:
|
|
15761
15902
|
_SceytChatClient5 = getClient();
|
|
15762
|
-
|
|
15903
|
+
_context10.n = 6;
|
|
15763
15904
|
return call(_SceytChatClient5.getChannel, channel.id);
|
|
15764
15905
|
case 6:
|
|
15765
|
-
fetchedChannel =
|
|
15906
|
+
fetchedChannel = _context10.v;
|
|
15766
15907
|
addChannelToAllChannels(fetchedChannel);
|
|
15767
15908
|
setChannelInMap(fetchedChannel);
|
|
15768
|
-
|
|
15909
|
+
_context10.n = 7;
|
|
15769
15910
|
return put(addChannelAC(JSON.parse(JSON.stringify(fetchedChannel))));
|
|
15770
15911
|
case 7:
|
|
15771
15912
|
channelToSwitch = _extends({}, channelToSwitch, fetchedChannel);
|
|
15772
15913
|
case 8:
|
|
15773
|
-
|
|
15914
|
+
_context10.n = 10;
|
|
15774
15915
|
break;
|
|
15775
15916
|
case 9:
|
|
15776
15917
|
channelFromMap = getChannelFromMap(channel.id);
|
|
15777
15918
|
channelToSwitch = _extends({}, channelToSwitch, channelFromMap);
|
|
15778
15919
|
case 10:
|
|
15779
15920
|
if (!updateActiveChannel) {
|
|
15780
|
-
|
|
15921
|
+
_context10.n = 13;
|
|
15781
15922
|
break;
|
|
15782
15923
|
}
|
|
15783
15924
|
currentActiveChannel = getChannelFromMap(getActiveChannelId());
|
|
15784
|
-
|
|
15925
|
+
_context10.n = 11;
|
|
15785
15926
|
return call(setUnreadScrollTo, true);
|
|
15786
15927
|
case 11:
|
|
15787
|
-
|
|
15928
|
+
_context10.n = 12;
|
|
15788
15929
|
return call(setActiveChannelId, channel && channel.id);
|
|
15789
15930
|
case 12:
|
|
15790
15931
|
if (channel.isLinkedChannel) {
|
|
15791
15932
|
channelToSwitch.linkedFrom = currentActiveChannel;
|
|
15792
15933
|
}
|
|
15793
|
-
|
|
15934
|
+
_context10.n = 13;
|
|
15794
15935
|
return put(setActiveChannelAC(_extends({}, channelToSwitch)));
|
|
15795
15936
|
case 13:
|
|
15796
|
-
|
|
15937
|
+
_context10.n = 15;
|
|
15797
15938
|
break;
|
|
15798
15939
|
case 14:
|
|
15799
|
-
|
|
15800
|
-
_t11 = _context1.v;
|
|
15801
|
-
log.error('error in switch channel', _t11);
|
|
15802
|
-
case 15:
|
|
15803
|
-
return _context1.a(2);
|
|
15804
|
-
}
|
|
15805
|
-
}, _marked1, null, [[0, 14]]);
|
|
15806
|
-
}
|
|
15807
|
-
function notificationsTurnOff(action) {
|
|
15808
|
-
var expireTime, activeChannelId, channel, updatedChannel, _t12;
|
|
15809
|
-
return _regenerator().w(function (_context10) {
|
|
15810
|
-
while (1) switch (_context10.p = _context10.n) {
|
|
15811
|
-
case 0:
|
|
15812
|
-
expireTime = action.payload.expireTime;
|
|
15813
|
-
_context10.n = 1;
|
|
15814
|
-
return call(getActiveChannelId);
|
|
15815
|
-
case 1:
|
|
15816
|
-
activeChannelId = _context10.v;
|
|
15817
|
-
_context10.n = 2;
|
|
15818
|
-
return call(getChannelFromMap, activeChannelId);
|
|
15819
|
-
case 2:
|
|
15820
|
-
channel = _context10.v;
|
|
15821
|
-
_context10.p = 3;
|
|
15822
|
-
_context10.n = 4;
|
|
15823
|
-
return call(channel.mute, expireTime);
|
|
15824
|
-
case 4:
|
|
15825
|
-
updatedChannel = _context10.v;
|
|
15826
|
-
updateChannelOnAllChannels(channel.id, {
|
|
15827
|
-
muted: updatedChannel.muted,
|
|
15828
|
-
mutedTill: updatedChannel.mutedTill
|
|
15829
|
-
});
|
|
15830
|
-
_context10.n = 5;
|
|
15831
|
-
return put(updateChannelDataAC(updatedChannel.id, {
|
|
15832
|
-
muted: updatedChannel.muted,
|
|
15833
|
-
mutedTill: updatedChannel.mutedTill
|
|
15834
|
-
}));
|
|
15835
|
-
case 5:
|
|
15836
|
-
_context10.n = 7;
|
|
15837
|
-
break;
|
|
15838
|
-
case 6:
|
|
15839
|
-
_context10.p = 6;
|
|
15940
|
+
_context10.p = 14;
|
|
15840
15941
|
_t12 = _context10.v;
|
|
15841
|
-
log.error('
|
|
15842
|
-
case
|
|
15942
|
+
log.error('error in switch channel', _t12);
|
|
15943
|
+
case 15:
|
|
15843
15944
|
return _context10.a(2);
|
|
15844
15945
|
}
|
|
15845
|
-
}, _marked10, null, [[
|
|
15946
|
+
}, _marked10, null, [[0, 14]]);
|
|
15846
15947
|
}
|
|
15847
|
-
function
|
|
15848
|
-
var activeChannelId, channel, updatedChannel, _t13;
|
|
15948
|
+
function notificationsTurnOff(action) {
|
|
15949
|
+
var expireTime, activeChannelId, channel, updatedChannel, _t13;
|
|
15849
15950
|
return _regenerator().w(function (_context11) {
|
|
15850
15951
|
while (1) switch (_context11.p = _context11.n) {
|
|
15851
15952
|
case 0:
|
|
15953
|
+
expireTime = action.payload.expireTime;
|
|
15852
15954
|
_context11.n = 1;
|
|
15853
15955
|
return call(getActiveChannelId);
|
|
15854
15956
|
case 1:
|
|
@@ -15859,7 +15961,7 @@ function notificationsTurnOn() {
|
|
|
15859
15961
|
channel = _context11.v;
|
|
15860
15962
|
_context11.p = 3;
|
|
15861
15963
|
_context11.n = 4;
|
|
15862
|
-
return call(channel.
|
|
15964
|
+
return call(channel.mute, expireTime);
|
|
15863
15965
|
case 4:
|
|
15864
15966
|
updatedChannel = _context11.v;
|
|
15865
15967
|
updateChannelOnAllChannels(channel.id, {
|
|
@@ -15877,51 +15979,53 @@ function notificationsTurnOn() {
|
|
|
15877
15979
|
case 6:
|
|
15878
15980
|
_context11.p = 6;
|
|
15879
15981
|
_t13 = _context11.v;
|
|
15880
|
-
log.error('ERROR turn
|
|
15982
|
+
log.error('ERROR turn off notifications', _t13.message);
|
|
15881
15983
|
case 7:
|
|
15882
15984
|
return _context11.a(2);
|
|
15883
15985
|
}
|
|
15884
15986
|
}, _marked11, null, [[3, 6]]);
|
|
15885
15987
|
}
|
|
15886
|
-
function
|
|
15887
|
-
var
|
|
15988
|
+
function notificationsTurnOn() {
|
|
15989
|
+
var activeChannelId, channel, updatedChannel, _t14;
|
|
15888
15990
|
return _regenerator().w(function (_context12) {
|
|
15889
15991
|
while (1) switch (_context12.p = _context12.n) {
|
|
15890
15992
|
case 0:
|
|
15891
|
-
_context12.p = 0;
|
|
15892
|
-
channelId = action.payload.channelId;
|
|
15893
15993
|
_context12.n = 1;
|
|
15894
|
-
return call(
|
|
15994
|
+
return call(getActiveChannelId);
|
|
15895
15995
|
case 1:
|
|
15896
|
-
|
|
15897
|
-
if (!channel) {
|
|
15898
|
-
channel = getChannelFromAllChannels(channelId);
|
|
15899
|
-
}
|
|
15996
|
+
activeChannelId = _context12.v;
|
|
15900
15997
|
_context12.n = 2;
|
|
15901
|
-
return call(
|
|
15998
|
+
return call(getChannelFromMap, activeChannelId);
|
|
15902
15999
|
case 2:
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
16000
|
+
channel = _context12.v;
|
|
16001
|
+
_context12.p = 3;
|
|
16002
|
+
_context12.n = 4;
|
|
16003
|
+
return call(channel.unmute);
|
|
16004
|
+
case 4:
|
|
16005
|
+
updatedChannel = _context12.v;
|
|
16006
|
+
updateChannelOnAllChannels(channel.id, {
|
|
16007
|
+
muted: updatedChannel.muted,
|
|
16008
|
+
mutedTill: updatedChannel.mutedTill
|
|
16009
|
+
});
|
|
15912
16010
|
_context12.n = 5;
|
|
16011
|
+
return put(updateChannelDataAC(updatedChannel.id, {
|
|
16012
|
+
muted: updatedChannel.muted,
|
|
16013
|
+
mutedTill: updatedChannel.mutedTill
|
|
16014
|
+
}));
|
|
16015
|
+
case 5:
|
|
16016
|
+
_context12.n = 7;
|
|
15913
16017
|
break;
|
|
15914
|
-
case
|
|
15915
|
-
_context12.p =
|
|
16018
|
+
case 6:
|
|
16019
|
+
_context12.p = 6;
|
|
15916
16020
|
_t14 = _context12.v;
|
|
15917
|
-
log.error(
|
|
15918
|
-
case
|
|
16021
|
+
log.error('ERROR turn on notifications: ', _t14.message);
|
|
16022
|
+
case 7:
|
|
15919
16023
|
return _context12.a(2);
|
|
15920
16024
|
}
|
|
15921
|
-
}, _marked12, null, [[
|
|
16025
|
+
}, _marked12, null, [[3, 6]]);
|
|
15922
16026
|
}
|
|
15923
|
-
function
|
|
15924
|
-
var channelId, channel, _t15;
|
|
16027
|
+
function markChannelAsRead(action) {
|
|
16028
|
+
var channelId, channel, updateData, _t15;
|
|
15925
16029
|
return _regenerator().w(function (_context13) {
|
|
15926
16030
|
while (1) switch (_context13.p = _context13.n) {
|
|
15927
16031
|
case 0:
|
|
@@ -15935,15 +16039,16 @@ function markChannelAsUnRead(action) {
|
|
|
15935
16039
|
channel = getChannelFromAllChannels(channelId);
|
|
15936
16040
|
}
|
|
15937
16041
|
_context13.n = 2;
|
|
15938
|
-
return call(channel.
|
|
16042
|
+
return call(channel.markAsRead);
|
|
15939
16043
|
case 2:
|
|
15940
|
-
|
|
15941
|
-
unread:
|
|
15942
|
-
|
|
16044
|
+
updateData = {
|
|
16045
|
+
unread: false,
|
|
16046
|
+
newMessageCount: 0,
|
|
16047
|
+
newMentionCount: 0
|
|
16048
|
+
};
|
|
16049
|
+
updateChannelOnAllChannels(channel.id, updateData);
|
|
15943
16050
|
_context13.n = 3;
|
|
15944
|
-
return put(updateChannelDataAC(channel.id,
|
|
15945
|
-
unread: true
|
|
15946
|
-
}));
|
|
16051
|
+
return put(updateChannelDataAC(channel.id, updateData));
|
|
15947
16052
|
case 3:
|
|
15948
16053
|
_context13.n = 5;
|
|
15949
16054
|
break;
|
|
@@ -15956,8 +16061,8 @@ function markChannelAsUnRead(action) {
|
|
|
15956
16061
|
}
|
|
15957
16062
|
}, _marked13, null, [[0, 4]]);
|
|
15958
16063
|
}
|
|
15959
|
-
function
|
|
15960
|
-
var channelId, channel,
|
|
16064
|
+
function markChannelAsUnRead(action) {
|
|
16065
|
+
var channelId, channel, _t16;
|
|
15961
16066
|
return _regenerator().w(function (_context14) {
|
|
15962
16067
|
while (1) switch (_context14.p = _context14.n) {
|
|
15963
16068
|
case 0:
|
|
@@ -15971,29 +16076,28 @@ function pinChannel(action) {
|
|
|
15971
16076
|
channel = getChannelFromAllChannels(channelId);
|
|
15972
16077
|
}
|
|
15973
16078
|
_context14.n = 2;
|
|
15974
|
-
return call(channel.
|
|
16079
|
+
return call(channel.markAsUnRead);
|
|
15975
16080
|
case 2:
|
|
15976
|
-
updatedChannel = _context14.v;
|
|
15977
16081
|
updateChannelOnAllChannels(channel.id, {
|
|
15978
|
-
|
|
16082
|
+
unread: true
|
|
15979
16083
|
});
|
|
15980
16084
|
_context14.n = 3;
|
|
15981
|
-
return put(updateChannelDataAC(
|
|
15982
|
-
|
|
15983
|
-
}
|
|
16085
|
+
return put(updateChannelDataAC(channel.id, {
|
|
16086
|
+
unread: true
|
|
16087
|
+
}));
|
|
15984
16088
|
case 3:
|
|
15985
16089
|
_context14.n = 5;
|
|
15986
16090
|
break;
|
|
15987
16091
|
case 4:
|
|
15988
16092
|
_context14.p = 4;
|
|
15989
16093
|
_t16 = _context14.v;
|
|
15990
|
-
log.error(_t16, 'Error in
|
|
16094
|
+
log.error(_t16, 'Error in set channel unread');
|
|
15991
16095
|
case 5:
|
|
15992
16096
|
return _context14.a(2);
|
|
15993
16097
|
}
|
|
15994
16098
|
}, _marked14, null, [[0, 4]]);
|
|
15995
16099
|
}
|
|
15996
|
-
function
|
|
16100
|
+
function pinChannel(action) {
|
|
15997
16101
|
var channelId, channel, updatedChannel, _t17;
|
|
15998
16102
|
return _regenerator().w(function (_context15) {
|
|
15999
16103
|
while (1) switch (_context15.p = _context15.n) {
|
|
@@ -16008,7 +16112,7 @@ function unpinChannel(action) {
|
|
|
16008
16112
|
channel = getChannelFromAllChannels(channelId);
|
|
16009
16113
|
}
|
|
16010
16114
|
_context15.n = 2;
|
|
16011
|
-
return call(channel.
|
|
16115
|
+
return call(channel.pin);
|
|
16012
16116
|
case 2:
|
|
16013
16117
|
updatedChannel = _context15.v;
|
|
16014
16118
|
updateChannelOnAllChannels(channel.id, {
|
|
@@ -16017,197 +16121,234 @@ function unpinChannel(action) {
|
|
|
16017
16121
|
_context15.n = 3;
|
|
16018
16122
|
return put(updateChannelDataAC(updatedChannel.id, {
|
|
16019
16123
|
pinnedAt: updatedChannel.pinnedAt
|
|
16020
|
-
},
|
|
16124
|
+
}, true));
|
|
16021
16125
|
case 3:
|
|
16022
16126
|
_context15.n = 5;
|
|
16023
16127
|
break;
|
|
16024
16128
|
case 4:
|
|
16025
16129
|
_context15.p = 4;
|
|
16026
16130
|
_t17 = _context15.v;
|
|
16027
|
-
log.error(_t17, 'Error in
|
|
16131
|
+
log.error(_t17, 'Error in pinChannel');
|
|
16028
16132
|
case 5:
|
|
16029
16133
|
return _context15.a(2);
|
|
16030
16134
|
}
|
|
16031
16135
|
}, _marked15, null, [[0, 4]]);
|
|
16032
16136
|
}
|
|
16137
|
+
function unpinChannel(action) {
|
|
16138
|
+
var channelId, channel, updatedChannel, _t18;
|
|
16139
|
+
return _regenerator().w(function (_context16) {
|
|
16140
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
16141
|
+
case 0:
|
|
16142
|
+
_context16.p = 0;
|
|
16143
|
+
channelId = action.payload.channelId;
|
|
16144
|
+
_context16.n = 1;
|
|
16145
|
+
return call(getChannelFromMap, channelId);
|
|
16146
|
+
case 1:
|
|
16147
|
+
channel = _context16.v;
|
|
16148
|
+
if (!channel) {
|
|
16149
|
+
channel = getChannelFromAllChannels(channelId);
|
|
16150
|
+
}
|
|
16151
|
+
_context16.n = 2;
|
|
16152
|
+
return call(channel.unpin);
|
|
16153
|
+
case 2:
|
|
16154
|
+
updatedChannel = _context16.v;
|
|
16155
|
+
updateChannelOnAllChannels(channel.id, {
|
|
16156
|
+
pinnedAt: updatedChannel.pinnedAt
|
|
16157
|
+
});
|
|
16158
|
+
_context16.n = 3;
|
|
16159
|
+
return put(updateChannelDataAC(updatedChannel.id, {
|
|
16160
|
+
pinnedAt: updatedChannel.pinnedAt
|
|
16161
|
+
}, false, true));
|
|
16162
|
+
case 3:
|
|
16163
|
+
_context16.n = 5;
|
|
16164
|
+
break;
|
|
16165
|
+
case 4:
|
|
16166
|
+
_context16.p = 4;
|
|
16167
|
+
_t18 = _context16.v;
|
|
16168
|
+
log.error(_t18, 'Error in unpinChannel');
|
|
16169
|
+
case 5:
|
|
16170
|
+
return _context16.a(2);
|
|
16171
|
+
}
|
|
16172
|
+
}, _marked16, null, [[0, 4]]);
|
|
16173
|
+
}
|
|
16033
16174
|
function removeChannelCaches(action) {
|
|
16034
16175
|
var payload, channelId, activeChannelId, activeChannel;
|
|
16035
|
-
return _regenerator().w(function (
|
|
16036
|
-
while (1) switch (
|
|
16176
|
+
return _regenerator().w(function (_context17) {
|
|
16177
|
+
while (1) switch (_context17.n) {
|
|
16037
16178
|
case 0:
|
|
16038
16179
|
payload = action.payload;
|
|
16039
16180
|
channelId = payload.channelId;
|
|
16040
|
-
|
|
16181
|
+
_context17.n = 1;
|
|
16041
16182
|
return call(getActiveChannelId);
|
|
16042
16183
|
case 1:
|
|
16043
|
-
activeChannelId =
|
|
16184
|
+
activeChannelId = _context17.v;
|
|
16044
16185
|
removeChannelFromMap(channelId);
|
|
16045
16186
|
removeMessagesFromMap(channelId);
|
|
16046
16187
|
if (!(activeChannelId === channelId)) {
|
|
16047
|
-
|
|
16188
|
+
_context17.n = 3;
|
|
16048
16189
|
break;
|
|
16049
16190
|
}
|
|
16050
|
-
|
|
16191
|
+
_context17.n = 2;
|
|
16051
16192
|
return call(getLastChannelFromMap);
|
|
16052
16193
|
case 2:
|
|
16053
|
-
activeChannel =
|
|
16194
|
+
activeChannel = _context17.v;
|
|
16054
16195
|
if (!activeChannel) {
|
|
16055
|
-
|
|
16196
|
+
_context17.n = 3;
|
|
16056
16197
|
break;
|
|
16057
16198
|
}
|
|
16058
|
-
|
|
16199
|
+
_context17.n = 3;
|
|
16059
16200
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16060
16201
|
case 3:
|
|
16061
|
-
return
|
|
16202
|
+
return _context17.a(2);
|
|
16062
16203
|
}
|
|
16063
|
-
},
|
|
16204
|
+
}, _marked17);
|
|
16064
16205
|
}
|
|
16065
16206
|
function leaveChannel(action) {
|
|
16066
|
-
var payload, channelId, channel, messageBuilder, messageToSend,
|
|
16067
|
-
return _regenerator().w(function (
|
|
16068
|
-
while (1) switch (
|
|
16207
|
+
var payload, channelId, channel, messageBuilder, messageToSend, _t19;
|
|
16208
|
+
return _regenerator().w(function (_context18) {
|
|
16209
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
16069
16210
|
case 0:
|
|
16070
|
-
|
|
16211
|
+
_context18.p = 0;
|
|
16071
16212
|
payload = action.payload;
|
|
16072
16213
|
channelId = payload.channelId;
|
|
16073
|
-
|
|
16214
|
+
_context18.n = 1;
|
|
16074
16215
|
return call(getChannelFromMap, channelId);
|
|
16075
16216
|
case 1:
|
|
16076
|
-
channel =
|
|
16217
|
+
channel = _context18.v;
|
|
16077
16218
|
if (!channel) {
|
|
16078
16219
|
channel = getChannelFromAllChannels(channelId);
|
|
16079
16220
|
}
|
|
16080
16221
|
if (!channel) {
|
|
16081
|
-
|
|
16222
|
+
_context18.n = 5;
|
|
16082
16223
|
break;
|
|
16083
16224
|
}
|
|
16084
16225
|
if (!(channel.type === DEFAULT_CHANNEL_TYPE.GROUP || channel.type === DEFAULT_CHANNEL_TYPE.PRIVATE)) {
|
|
16085
|
-
|
|
16226
|
+
_context18.n = 2;
|
|
16086
16227
|
break;
|
|
16087
16228
|
}
|
|
16088
16229
|
messageBuilder = channel.createMessageBuilder();
|
|
16089
16230
|
messageBuilder.setBody('LG').setType('system').setDisplayCount(0).setSilent(true);
|
|
16090
16231
|
messageToSend = messageBuilder.create();
|
|
16091
16232
|
log.info('send message for left');
|
|
16092
|
-
|
|
16233
|
+
_context18.n = 2;
|
|
16093
16234
|
return call(channel.sendMessage, messageToSend);
|
|
16094
16235
|
case 2:
|
|
16095
16236
|
log.info('leave');
|
|
16096
|
-
|
|
16237
|
+
_context18.n = 3;
|
|
16097
16238
|
return call(channel.leave);
|
|
16098
16239
|
case 3:
|
|
16099
|
-
|
|
16240
|
+
_context18.n = 4;
|
|
16100
16241
|
return put(removeChannelAC(channelId));
|
|
16101
16242
|
case 4:
|
|
16102
16243
|
deleteChannelFromAllChannels(channelId);
|
|
16103
|
-
|
|
16244
|
+
_context18.n = 5;
|
|
16104
16245
|
return put(removeChannelCachesAC(channelId));
|
|
16105
16246
|
case 5:
|
|
16106
|
-
|
|
16247
|
+
_context18.n = 7;
|
|
16107
16248
|
break;
|
|
16108
16249
|
case 6:
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
log.error('ERROR in leave channel - ',
|
|
16250
|
+
_context18.p = 6;
|
|
16251
|
+
_t19 = _context18.v;
|
|
16252
|
+
log.error('ERROR in leave channel - ', _t19.message);
|
|
16112
16253
|
case 7:
|
|
16113
|
-
return
|
|
16254
|
+
return _context18.a(2);
|
|
16114
16255
|
}
|
|
16115
|
-
},
|
|
16256
|
+
}, _marked18, null, [[0, 6]]);
|
|
16116
16257
|
}
|
|
16117
16258
|
function deleteChannel(action) {
|
|
16118
|
-
var payload, channelId, channel,
|
|
16119
|
-
return _regenerator().w(function (
|
|
16120
|
-
while (1) switch (
|
|
16259
|
+
var payload, channelId, channel, _t20;
|
|
16260
|
+
return _regenerator().w(function (_context19) {
|
|
16261
|
+
while (1) switch (_context19.p = _context19.n) {
|
|
16121
16262
|
case 0:
|
|
16122
|
-
|
|
16263
|
+
_context19.p = 0;
|
|
16123
16264
|
payload = action.payload;
|
|
16124
16265
|
channelId = payload.channelId;
|
|
16125
|
-
|
|
16266
|
+
_context19.n = 1;
|
|
16126
16267
|
return call(getChannelFromMap, channelId);
|
|
16127
16268
|
case 1:
|
|
16128
|
-
channel =
|
|
16269
|
+
channel = _context19.v;
|
|
16129
16270
|
if (!channel) {
|
|
16130
16271
|
channel = getChannelFromAllChannels(channelId);
|
|
16131
16272
|
}
|
|
16132
16273
|
if (!channel) {
|
|
16133
|
-
|
|
16274
|
+
_context19.n = 5;
|
|
16134
16275
|
break;
|
|
16135
16276
|
}
|
|
16136
|
-
|
|
16277
|
+
_context19.n = 2;
|
|
16137
16278
|
return call(channel["delete"]);
|
|
16138
16279
|
case 2:
|
|
16139
|
-
|
|
16280
|
+
_context19.n = 3;
|
|
16140
16281
|
return put(setChannelToRemoveAC(channel));
|
|
16141
16282
|
case 3:
|
|
16142
|
-
|
|
16283
|
+
_context19.n = 4;
|
|
16143
16284
|
return put(removeChannelAC(channelId));
|
|
16144
16285
|
case 4:
|
|
16145
|
-
|
|
16286
|
+
_context19.n = 5;
|
|
16146
16287
|
return put(removeChannelCachesAC(channelId));
|
|
16147
16288
|
case 5:
|
|
16148
|
-
|
|
16289
|
+
_context19.n = 7;
|
|
16149
16290
|
break;
|
|
16150
16291
|
case 6:
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
log.error('ERROR in delete channel',
|
|
16292
|
+
_context19.p = 6;
|
|
16293
|
+
_t20 = _context19.v;
|
|
16294
|
+
log.error('ERROR in delete channel', _t20);
|
|
16154
16295
|
case 7:
|
|
16155
|
-
return
|
|
16296
|
+
return _context19.a(2);
|
|
16156
16297
|
}
|
|
16157
|
-
},
|
|
16298
|
+
}, _marked19, null, [[0, 6]]);
|
|
16158
16299
|
}
|
|
16159
16300
|
function blockChannel(action) {
|
|
16160
|
-
var payload, channelId, channel,
|
|
16161
|
-
return _regenerator().w(function (
|
|
16162
|
-
while (1) switch (
|
|
16301
|
+
var payload, channelId, channel, _t21;
|
|
16302
|
+
return _regenerator().w(function (_context20) {
|
|
16303
|
+
while (1) switch (_context20.p = _context20.n) {
|
|
16163
16304
|
case 0:
|
|
16164
|
-
|
|
16305
|
+
_context20.p = 0;
|
|
16165
16306
|
payload = action.payload;
|
|
16166
16307
|
channelId = payload.channelId;
|
|
16167
|
-
|
|
16308
|
+
_context20.n = 1;
|
|
16168
16309
|
return call(getChannelFromMap, channelId);
|
|
16169
16310
|
case 1:
|
|
16170
|
-
channel =
|
|
16311
|
+
channel = _context20.v;
|
|
16171
16312
|
if (!channel) {
|
|
16172
16313
|
channel = getChannelFromAllChannels(channelId);
|
|
16173
16314
|
}
|
|
16174
16315
|
if (!channel) {
|
|
16175
|
-
|
|
16316
|
+
_context20.n = 4;
|
|
16176
16317
|
break;
|
|
16177
16318
|
}
|
|
16178
|
-
|
|
16319
|
+
_context20.n = 2;
|
|
16179
16320
|
return call(channel.block);
|
|
16180
16321
|
case 2:
|
|
16181
|
-
|
|
16322
|
+
_context20.n = 3;
|
|
16182
16323
|
return put(removeChannelAC(channelId));
|
|
16183
16324
|
case 3:
|
|
16184
|
-
|
|
16325
|
+
_context20.n = 4;
|
|
16185
16326
|
return put(removeChannelCachesAC(channelId));
|
|
16186
16327
|
case 4:
|
|
16187
|
-
|
|
16328
|
+
_context20.n = 6;
|
|
16188
16329
|
break;
|
|
16189
16330
|
case 5:
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
log.error('ERROR in block channel - ',
|
|
16331
|
+
_context20.p = 5;
|
|
16332
|
+
_t21 = _context20.v;
|
|
16333
|
+
log.error('ERROR in block channel - ', _t21.message);
|
|
16193
16334
|
case 6:
|
|
16194
|
-
return
|
|
16335
|
+
return _context20.a(2);
|
|
16195
16336
|
}
|
|
16196
|
-
},
|
|
16337
|
+
}, _marked20, null, [[0, 5]]);
|
|
16197
16338
|
}
|
|
16198
16339
|
function updateChannel(action) {
|
|
16199
|
-
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata,
|
|
16200
|
-
return _regenerator().w(function (
|
|
16201
|
-
while (1) switch (
|
|
16340
|
+
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, _t22;
|
|
16341
|
+
return _regenerator().w(function (_context21) {
|
|
16342
|
+
while (1) switch (_context21.p = _context21.n) {
|
|
16202
16343
|
case 0:
|
|
16203
|
-
|
|
16344
|
+
_context21.p = 0;
|
|
16204
16345
|
payload = action.payload;
|
|
16205
16346
|
channelId = payload.channelId, config = payload.config;
|
|
16206
16347
|
_SceytChatClient6 = getClient();
|
|
16207
|
-
|
|
16348
|
+
_context21.n = 1;
|
|
16208
16349
|
return call(getChannelFromMap, channelId);
|
|
16209
16350
|
case 1:
|
|
16210
|
-
channel =
|
|
16351
|
+
channel = _context21.v;
|
|
16211
16352
|
if (!channel) {
|
|
16212
16353
|
channel = getChannelFromAllChannels(channelId);
|
|
16213
16354
|
}
|
|
@@ -16218,7 +16359,7 @@ function updateChannel(action) {
|
|
|
16218
16359
|
avatarUrl: channel.avatarUrl
|
|
16219
16360
|
};
|
|
16220
16361
|
if (!config.avatar) {
|
|
16221
|
-
|
|
16362
|
+
_context21.n = 3;
|
|
16222
16363
|
break;
|
|
16223
16364
|
}
|
|
16224
16365
|
fileToUpload = {
|
|
@@ -16227,10 +16368,10 @@ function updateChannel(action) {
|
|
|
16227
16368
|
log.info('upload percent - ', progressPercent);
|
|
16228
16369
|
}
|
|
16229
16370
|
};
|
|
16230
|
-
|
|
16371
|
+
_context21.n = 2;
|
|
16231
16372
|
return call(_SceytChatClient6.uploadFile, fileToUpload);
|
|
16232
16373
|
case 2:
|
|
16233
|
-
paramsToUpdate.avatarUrl =
|
|
16374
|
+
paramsToUpdate.avatarUrl = _context21.v;
|
|
16234
16375
|
case 3:
|
|
16235
16376
|
if (config.subject) {
|
|
16236
16377
|
paramsToUpdate.subject = config.subject;
|
|
@@ -16241,14 +16382,14 @@ function updateChannel(action) {
|
|
|
16241
16382
|
if (config.avatarUrl === '') {
|
|
16242
16383
|
paramsToUpdate.avatarUrl = '';
|
|
16243
16384
|
}
|
|
16244
|
-
|
|
16385
|
+
_context21.n = 4;
|
|
16245
16386
|
return call(channel.update, paramsToUpdate);
|
|
16246
16387
|
case 4:
|
|
16247
|
-
_yield$call5 =
|
|
16388
|
+
_yield$call5 = _context21.v;
|
|
16248
16389
|
subject = _yield$call5.subject;
|
|
16249
16390
|
avatarUrl = _yield$call5.avatarUrl;
|
|
16250
16391
|
metadata = _yield$call5.metadata;
|
|
16251
|
-
|
|
16392
|
+
_context21.n = 5;
|
|
16252
16393
|
return put(updateChannelDataAC(channelId, {
|
|
16253
16394
|
subject: subject,
|
|
16254
16395
|
avatarUrl: avatarUrl,
|
|
@@ -16260,29 +16401,29 @@ function updateChannel(action) {
|
|
|
16260
16401
|
avatarUrl: avatarUrl,
|
|
16261
16402
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
16262
16403
|
});
|
|
16263
|
-
|
|
16404
|
+
_context21.n = 7;
|
|
16264
16405
|
break;
|
|
16265
16406
|
case 6:
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
log.error('ERROR in update channel',
|
|
16407
|
+
_context21.p = 6;
|
|
16408
|
+
_t22 = _context21.v;
|
|
16409
|
+
log.error('ERROR in update channel', _t22.message);
|
|
16269
16410
|
case 7:
|
|
16270
|
-
return
|
|
16411
|
+
return _context21.a(2);
|
|
16271
16412
|
}
|
|
16272
|
-
},
|
|
16413
|
+
}, _marked21, null, [[0, 6]]);
|
|
16273
16414
|
}
|
|
16274
16415
|
function checkUsersStatus() {
|
|
16275
|
-
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData,
|
|
16276
|
-
return _regenerator().w(function (
|
|
16277
|
-
while (1) switch (
|
|
16416
|
+
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t23;
|
|
16417
|
+
return _regenerator().w(function (_context22) {
|
|
16418
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
16278
16419
|
case 0:
|
|
16279
|
-
|
|
16420
|
+
_context22.p = 0;
|
|
16280
16421
|
_SceytChatClient7 = getClient();
|
|
16281
16422
|
usersForUpdate = Object.keys(usersMap);
|
|
16282
|
-
|
|
16423
|
+
_context22.n = 1;
|
|
16283
16424
|
return call(_SceytChatClient7.getUsers, usersForUpdate);
|
|
16284
16425
|
case 1:
|
|
16285
|
-
updatedUsers =
|
|
16426
|
+
updatedUsers = _context22.v;
|
|
16286
16427
|
usersToUpdateMap = {};
|
|
16287
16428
|
update = false;
|
|
16288
16429
|
updatedUsers.forEach(function (updatedUser) {
|
|
@@ -16294,149 +16435,149 @@ function checkUsersStatus() {
|
|
|
16294
16435
|
}
|
|
16295
16436
|
});
|
|
16296
16437
|
if (!update) {
|
|
16297
|
-
|
|
16438
|
+
_context22.n = 4;
|
|
16298
16439
|
break;
|
|
16299
16440
|
}
|
|
16300
16441
|
updateData = JSON.parse(JSON.stringify(usersToUpdateMap));
|
|
16301
|
-
|
|
16442
|
+
_context22.n = 2;
|
|
16302
16443
|
return put(updateMembersPresenceAC(updateData));
|
|
16303
16444
|
case 2:
|
|
16304
|
-
|
|
16445
|
+
_context22.n = 3;
|
|
16305
16446
|
return put(updateUserStatusOnMapAC(updateData));
|
|
16306
16447
|
case 3:
|
|
16307
|
-
|
|
16448
|
+
_context22.n = 4;
|
|
16308
16449
|
return put(updateUserStatusOnChannelAC(updateData));
|
|
16309
16450
|
case 4:
|
|
16310
|
-
|
|
16451
|
+
_context22.n = 6;
|
|
16311
16452
|
break;
|
|
16312
16453
|
case 5:
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
log.error('ERROR in check user status : ',
|
|
16454
|
+
_context22.p = 5;
|
|
16455
|
+
_t23 = _context22.v;
|
|
16456
|
+
log.error('ERROR in check user status : ', _t23.message);
|
|
16316
16457
|
case 6:
|
|
16317
|
-
return
|
|
16458
|
+
return _context22.a(2);
|
|
16318
16459
|
}
|
|
16319
|
-
},
|
|
16460
|
+
}, _marked22, null, [[0, 5]]);
|
|
16320
16461
|
}
|
|
16321
16462
|
function sendTyping(action) {
|
|
16322
|
-
var state, activeChannelId, channel,
|
|
16323
|
-
return _regenerator().w(function (
|
|
16324
|
-
while (1) switch (
|
|
16463
|
+
var state, activeChannelId, channel, _t24;
|
|
16464
|
+
return _regenerator().w(function (_context23) {
|
|
16465
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
16325
16466
|
case 0:
|
|
16326
16467
|
state = action.payload.state;
|
|
16327
|
-
|
|
16468
|
+
_context23.n = 1;
|
|
16328
16469
|
return call(getActiveChannelId);
|
|
16329
16470
|
case 1:
|
|
16330
|
-
activeChannelId =
|
|
16331
|
-
|
|
16471
|
+
activeChannelId = _context23.v;
|
|
16472
|
+
_context23.n = 2;
|
|
16332
16473
|
return call(getChannelFromMap, activeChannelId);
|
|
16333
16474
|
case 2:
|
|
16334
|
-
channel =
|
|
16335
|
-
|
|
16475
|
+
channel = _context23.v;
|
|
16476
|
+
_context23.p = 3;
|
|
16336
16477
|
if (!channel) {
|
|
16337
|
-
|
|
16478
|
+
_context23.n = 6;
|
|
16338
16479
|
break;
|
|
16339
16480
|
}
|
|
16340
16481
|
if (!state) {
|
|
16341
|
-
|
|
16482
|
+
_context23.n = 5;
|
|
16342
16483
|
break;
|
|
16343
16484
|
}
|
|
16344
|
-
|
|
16485
|
+
_context23.n = 4;
|
|
16345
16486
|
return call(channel.startTyping);
|
|
16346
16487
|
case 4:
|
|
16347
|
-
|
|
16488
|
+
_context23.n = 6;
|
|
16348
16489
|
break;
|
|
16349
16490
|
case 5:
|
|
16350
|
-
|
|
16491
|
+
_context23.n = 6;
|
|
16351
16492
|
return call(channel.stopTyping);
|
|
16352
16493
|
case 6:
|
|
16353
|
-
|
|
16494
|
+
_context23.n = 8;
|
|
16354
16495
|
break;
|
|
16355
16496
|
case 7:
|
|
16356
|
-
|
|
16357
|
-
|
|
16358
|
-
log.error('ERROR in send typing',
|
|
16497
|
+
_context23.p = 7;
|
|
16498
|
+
_t24 = _context23.v;
|
|
16499
|
+
log.error('ERROR in send typing', _t24);
|
|
16359
16500
|
case 8:
|
|
16360
|
-
return
|
|
16501
|
+
return _context23.a(2);
|
|
16361
16502
|
}
|
|
16362
|
-
},
|
|
16503
|
+
}, _marked23, null, [[3, 7]]);
|
|
16363
16504
|
}
|
|
16364
16505
|
function sendRecording(action) {
|
|
16365
|
-
var _action$payload, state, channelId, channel,
|
|
16366
|
-
return _regenerator().w(function (
|
|
16367
|
-
while (1) switch (
|
|
16506
|
+
var _action$payload, state, channelId, channel, _t25;
|
|
16507
|
+
return _regenerator().w(function (_context24) {
|
|
16508
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
16368
16509
|
case 0:
|
|
16369
16510
|
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
16370
|
-
|
|
16511
|
+
_context24.n = 1;
|
|
16371
16512
|
return call(getChannelFromMap, channelId);
|
|
16372
16513
|
case 1:
|
|
16373
|
-
channel =
|
|
16374
|
-
|
|
16514
|
+
channel = _context24.v;
|
|
16515
|
+
_context24.p = 2;
|
|
16375
16516
|
if (!channel) {
|
|
16376
|
-
|
|
16517
|
+
_context24.n = 5;
|
|
16377
16518
|
break;
|
|
16378
16519
|
}
|
|
16379
16520
|
if (!state) {
|
|
16380
|
-
|
|
16521
|
+
_context24.n = 4;
|
|
16381
16522
|
break;
|
|
16382
16523
|
}
|
|
16383
|
-
|
|
16524
|
+
_context24.n = 3;
|
|
16384
16525
|
return call(channel.startRecording);
|
|
16385
16526
|
case 3:
|
|
16386
|
-
|
|
16527
|
+
_context24.n = 5;
|
|
16387
16528
|
break;
|
|
16388
16529
|
case 4:
|
|
16389
|
-
|
|
16530
|
+
_context24.n = 5;
|
|
16390
16531
|
return call(channel.stopRecording);
|
|
16391
16532
|
case 5:
|
|
16392
|
-
|
|
16533
|
+
_context24.n = 7;
|
|
16393
16534
|
break;
|
|
16394
16535
|
case 6:
|
|
16395
|
-
|
|
16396
|
-
|
|
16397
|
-
log.error('ERROR in send recording',
|
|
16536
|
+
_context24.p = 6;
|
|
16537
|
+
_t25 = _context24.v;
|
|
16538
|
+
log.error('ERROR in send recording', _t25);
|
|
16398
16539
|
case 7:
|
|
16399
|
-
return
|
|
16540
|
+
return _context24.a(2);
|
|
16400
16541
|
}
|
|
16401
|
-
},
|
|
16542
|
+
}, _marked24, null, [[2, 6]]);
|
|
16402
16543
|
}
|
|
16403
16544
|
function clearHistory(action) {
|
|
16404
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
16405
|
-
return _regenerator().w(function (
|
|
16406
|
-
while (1) switch (
|
|
16545
|
+
var payload, channelId, channel, activeChannelId, groupName, _t26;
|
|
16546
|
+
return _regenerator().w(function (_context25) {
|
|
16547
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
16407
16548
|
case 0:
|
|
16408
|
-
|
|
16549
|
+
_context25.p = 0;
|
|
16409
16550
|
payload = action.payload;
|
|
16410
16551
|
channelId = payload.channelId;
|
|
16411
|
-
|
|
16552
|
+
_context25.n = 1;
|
|
16412
16553
|
return call(getChannelFromMap, channelId);
|
|
16413
16554
|
case 1:
|
|
16414
|
-
channel =
|
|
16555
|
+
channel = _context25.v;
|
|
16415
16556
|
if (!channel) {
|
|
16416
16557
|
channel = getChannelFromAllChannels(channelId);
|
|
16417
16558
|
}
|
|
16418
|
-
|
|
16559
|
+
_context25.n = 2;
|
|
16419
16560
|
return call(getActiveChannelId);
|
|
16420
16561
|
case 2:
|
|
16421
|
-
activeChannelId =
|
|
16562
|
+
activeChannelId = _context25.v;
|
|
16422
16563
|
if (!channel) {
|
|
16423
|
-
|
|
16564
|
+
_context25.n = 7;
|
|
16424
16565
|
break;
|
|
16425
16566
|
}
|
|
16426
|
-
|
|
16567
|
+
_context25.n = 3;
|
|
16427
16568
|
return call(channel.deleteAllMessages);
|
|
16428
16569
|
case 3:
|
|
16429
|
-
|
|
16570
|
+
_context25.n = 4;
|
|
16430
16571
|
return put(clearMessagesAC());
|
|
16431
16572
|
case 4:
|
|
16432
16573
|
removeMessagesFromMap(channelId);
|
|
16433
16574
|
if (channelId === activeChannelId) {
|
|
16434
16575
|
removeAllMessages();
|
|
16435
16576
|
}
|
|
16436
|
-
|
|
16577
|
+
_context25.n = 5;
|
|
16437
16578
|
return put(clearSelectedMessagesAC());
|
|
16438
16579
|
case 5:
|
|
16439
|
-
|
|
16580
|
+
_context25.n = 6;
|
|
16440
16581
|
return put(updateChannelDataAC(channel.id, {
|
|
16441
16582
|
lastMessage: null,
|
|
16442
16583
|
newMessageCount: 0,
|
|
@@ -16449,64 +16590,64 @@ function clearHistory(action) {
|
|
|
16449
16590
|
newMentionCount: 0
|
|
16450
16591
|
});
|
|
16451
16592
|
groupName = getChannelGroupName(channel);
|
|
16452
|
-
|
|
16593
|
+
_context25.n = 7;
|
|
16453
16594
|
return put(updateSearchedChannelDataAC(channel.id, {
|
|
16454
16595
|
lastMessage: null,
|
|
16455
16596
|
newMessageCount: 0,
|
|
16456
16597
|
newMentionCount: 0
|
|
16457
16598
|
}, groupName));
|
|
16458
16599
|
case 7:
|
|
16459
|
-
|
|
16600
|
+
_context25.n = 9;
|
|
16460
16601
|
break;
|
|
16461
16602
|
case 8:
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
log.error('ERROR in clear history',
|
|
16603
|
+
_context25.p = 8;
|
|
16604
|
+
_t26 = _context25.v;
|
|
16605
|
+
log.error('ERROR in clear history', _t26);
|
|
16465
16606
|
case 9:
|
|
16466
|
-
return
|
|
16607
|
+
return _context25.a(2);
|
|
16467
16608
|
}
|
|
16468
|
-
},
|
|
16609
|
+
}, _marked25, null, [[0, 8]]);
|
|
16469
16610
|
}
|
|
16470
16611
|
function deleteAllMessages(action) {
|
|
16471
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
16472
|
-
return _regenerator().w(function (
|
|
16473
|
-
while (1) switch (
|
|
16612
|
+
var payload, channelId, channel, activeChannelId, groupName, _t27;
|
|
16613
|
+
return _regenerator().w(function (_context26) {
|
|
16614
|
+
while (1) switch (_context26.p = _context26.n) {
|
|
16474
16615
|
case 0:
|
|
16475
|
-
|
|
16616
|
+
_context26.p = 0;
|
|
16476
16617
|
payload = action.payload;
|
|
16477
16618
|
channelId = payload.channelId;
|
|
16478
|
-
|
|
16619
|
+
_context26.n = 1;
|
|
16479
16620
|
return call(getChannelFromMap, channelId);
|
|
16480
16621
|
case 1:
|
|
16481
|
-
channel =
|
|
16622
|
+
channel = _context26.v;
|
|
16482
16623
|
if (!channel) {
|
|
16483
16624
|
channel = getChannelFromAllChannels(channelId);
|
|
16484
16625
|
}
|
|
16485
|
-
|
|
16626
|
+
_context26.n = 2;
|
|
16486
16627
|
return call(getActiveChannelId);
|
|
16487
16628
|
case 2:
|
|
16488
|
-
activeChannelId =
|
|
16629
|
+
activeChannelId = _context26.v;
|
|
16489
16630
|
if (!channel) {
|
|
16490
|
-
|
|
16631
|
+
_context26.n = 8;
|
|
16491
16632
|
break;
|
|
16492
16633
|
}
|
|
16493
|
-
|
|
16634
|
+
_context26.n = 3;
|
|
16494
16635
|
return call(channel.deleteAllMessages, true);
|
|
16495
16636
|
case 3:
|
|
16496
16637
|
removeMessagesFromMap(channelId);
|
|
16497
16638
|
if (!(channelId === activeChannelId)) {
|
|
16498
|
-
|
|
16639
|
+
_context26.n = 5;
|
|
16499
16640
|
break;
|
|
16500
16641
|
}
|
|
16501
|
-
|
|
16642
|
+
_context26.n = 4;
|
|
16502
16643
|
return put(clearMessagesAC());
|
|
16503
16644
|
case 4:
|
|
16504
16645
|
removeAllMessages();
|
|
16505
16646
|
case 5:
|
|
16506
|
-
|
|
16647
|
+
_context26.n = 6;
|
|
16507
16648
|
return put(clearSelectedMessagesAC());
|
|
16508
16649
|
case 6:
|
|
16509
|
-
|
|
16650
|
+
_context26.n = 7;
|
|
16510
16651
|
return put(updateChannelDataAC(channel.id, {
|
|
16511
16652
|
lastMessage: null,
|
|
16512
16653
|
newMessageCount: 0,
|
|
@@ -16519,182 +16660,185 @@ function deleteAllMessages(action) {
|
|
|
16519
16660
|
newMentionCount: 0
|
|
16520
16661
|
});
|
|
16521
16662
|
groupName = getChannelGroupName(channel);
|
|
16522
|
-
|
|
16663
|
+
_context26.n = 8;
|
|
16523
16664
|
return put(updateSearchedChannelDataAC(channel.id, {
|
|
16524
16665
|
lastMessage: null,
|
|
16525
16666
|
newMessageCount: 0,
|
|
16526
16667
|
newMentionCount: 0
|
|
16527
16668
|
}, groupName));
|
|
16528
16669
|
case 8:
|
|
16529
|
-
|
|
16670
|
+
_context26.n = 10;
|
|
16530
16671
|
break;
|
|
16531
16672
|
case 9:
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
log.error('ERROR in clear history',
|
|
16673
|
+
_context26.p = 9;
|
|
16674
|
+
_t27 = _context26.v;
|
|
16675
|
+
log.error('ERROR in clear history', _t27);
|
|
16535
16676
|
case 10:
|
|
16536
|
-
return
|
|
16677
|
+
return _context26.a(2);
|
|
16537
16678
|
}
|
|
16538
|
-
},
|
|
16679
|
+
}, _marked26, null, [[0, 9]]);
|
|
16539
16680
|
}
|
|
16540
16681
|
function joinChannel(action) {
|
|
16541
|
-
var payload, channelId, _SceytChatClient8, channel, joinedChannel,
|
|
16542
|
-
return _regenerator().w(function (
|
|
16543
|
-
while (1) switch (
|
|
16682
|
+
var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t28;
|
|
16683
|
+
return _regenerator().w(function (_context27) {
|
|
16684
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
16544
16685
|
case 0:
|
|
16545
|
-
|
|
16686
|
+
_context27.p = 0;
|
|
16546
16687
|
payload = action.payload;
|
|
16547
16688
|
channelId = payload.channelId;
|
|
16548
16689
|
_SceytChatClient8 = getClient();
|
|
16549
|
-
|
|
16690
|
+
_context27.n = 1;
|
|
16550
16691
|
return call(getChannelFromMap, channelId);
|
|
16551
16692
|
case 1:
|
|
16552
|
-
channel =
|
|
16693
|
+
channel = _context27.v;
|
|
16553
16694
|
if (!channel) {
|
|
16554
16695
|
channel = getChannelFromAllChannels(channelId);
|
|
16555
16696
|
}
|
|
16556
16697
|
if (channel) {
|
|
16557
|
-
|
|
16698
|
+
_context27.n = 3;
|
|
16558
16699
|
break;
|
|
16559
16700
|
}
|
|
16560
|
-
|
|
16701
|
+
_context27.n = 2;
|
|
16561
16702
|
return call(_SceytChatClient8.getChannel, channelId);
|
|
16562
16703
|
case 2:
|
|
16563
|
-
channel =
|
|
16704
|
+
channel = _context27.v;
|
|
16564
16705
|
case 3:
|
|
16565
|
-
|
|
16706
|
+
_context27.n = 4;
|
|
16566
16707
|
return call(channel.join);
|
|
16567
16708
|
case 4:
|
|
16568
|
-
joinedChannel =
|
|
16569
|
-
|
|
16709
|
+
joinedChannel = _context27.v;
|
|
16710
|
+
_context27.n = 5;
|
|
16570
16711
|
return put(setCloseSearchChannelsAC(true));
|
|
16571
16712
|
case 5:
|
|
16572
|
-
|
|
16713
|
+
_context27.n = 6;
|
|
16573
16714
|
return put(setChannelToAddAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
16574
16715
|
case 6:
|
|
16575
|
-
|
|
16716
|
+
_context27.n = 7;
|
|
16576
16717
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
16577
16718
|
case 7:
|
|
16578
16719
|
addChannelToAllChannels(joinedChannel);
|
|
16579
|
-
|
|
16720
|
+
_context27.n = 8;
|
|
16580
16721
|
return call(setActiveChannelId, joinedChannel.id);
|
|
16581
16722
|
case 8:
|
|
16582
|
-
|
|
16723
|
+
_context27.n = 10;
|
|
16583
16724
|
break;
|
|
16584
16725
|
case 9:
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
|
-
log.error(
|
|
16726
|
+
_context27.p = 9;
|
|
16727
|
+
_t28 = _context27.v;
|
|
16728
|
+
log.error(_t28, 'Error in join to channel');
|
|
16588
16729
|
case 10:
|
|
16589
|
-
return
|
|
16730
|
+
return _context27.a(2);
|
|
16590
16731
|
}
|
|
16591
|
-
},
|
|
16732
|
+
}, _marked27, null, [[0, 9]]);
|
|
16592
16733
|
}
|
|
16593
16734
|
function watchForChannelEvents() {
|
|
16594
|
-
return _regenerator().w(function (
|
|
16595
|
-
while (1) switch (
|
|
16735
|
+
return _regenerator().w(function (_context28) {
|
|
16736
|
+
while (1) switch (_context28.n) {
|
|
16596
16737
|
case 0:
|
|
16597
|
-
|
|
16738
|
+
_context28.n = 1;
|
|
16598
16739
|
return call(watchForEvents);
|
|
16599
16740
|
case 1:
|
|
16600
|
-
return
|
|
16741
|
+
return _context28.a(2);
|
|
16601
16742
|
}
|
|
16602
|
-
},
|
|
16743
|
+
}, _marked28);
|
|
16603
16744
|
}
|
|
16604
16745
|
function ChannelsSaga() {
|
|
16605
|
-
return _regenerator().w(function (
|
|
16606
|
-
while (1) switch (
|
|
16746
|
+
return _regenerator().w(function (_context29) {
|
|
16747
|
+
while (1) switch (_context29.n) {
|
|
16607
16748
|
case 0:
|
|
16608
|
-
|
|
16749
|
+
_context29.n = 1;
|
|
16609
16750
|
return takeLatest(CREATE_CHANNEL, createChannel);
|
|
16610
16751
|
case 1:
|
|
16611
|
-
|
|
16752
|
+
_context29.n = 2;
|
|
16612
16753
|
return takeLatest(GET_CHANNELS, getChannels);
|
|
16613
16754
|
case 2:
|
|
16614
|
-
|
|
16755
|
+
_context29.n = 3;
|
|
16615
16756
|
return takeLatest(SEARCH_CHANNELS, searchChannels);
|
|
16616
16757
|
case 3:
|
|
16617
|
-
|
|
16758
|
+
_context29.n = 4;
|
|
16618
16759
|
return takeLatest(GET_CHANNELS_FOR_FORWARD, getChannelsForForward);
|
|
16619
16760
|
case 4:
|
|
16620
|
-
|
|
16761
|
+
_context29.n = 5;
|
|
16621
16762
|
return takeLatest(SEARCH_CHANNELS_FOR_FORWARD, searchChannelsForForward);
|
|
16622
16763
|
case 5:
|
|
16623
|
-
|
|
16764
|
+
_context29.n = 6;
|
|
16624
16765
|
return takeLatest(LOAD_MORE_CHANNEL, channelsLoadMore);
|
|
16625
16766
|
case 6:
|
|
16626
|
-
|
|
16767
|
+
_context29.n = 7;
|
|
16627
16768
|
return takeLatest(LOAD_MORE_CHANNELS_FOR_FORWARD, channelsForForwardLoadMore);
|
|
16628
16769
|
case 7:
|
|
16629
|
-
|
|
16770
|
+
_context29.n = 8;
|
|
16630
16771
|
return takeEvery(SWITCH_CHANNEL, switchChannel);
|
|
16631
16772
|
case 8:
|
|
16632
|
-
|
|
16773
|
+
_context29.n = 9;
|
|
16633
16774
|
return takeLatest(LEAVE_CHANNEL, leaveChannel);
|
|
16634
16775
|
case 9:
|
|
16635
|
-
|
|
16776
|
+
_context29.n = 10;
|
|
16636
16777
|
return takeLatest(DELETE_CHANNEL, deleteChannel);
|
|
16637
16778
|
case 10:
|
|
16638
|
-
|
|
16779
|
+
_context29.n = 11;
|
|
16639
16780
|
return takeLatest(BLOCK_CHANNEL, blockChannel);
|
|
16640
16781
|
case 11:
|
|
16641
|
-
|
|
16782
|
+
_context29.n = 12;
|
|
16642
16783
|
return takeLatest(UPDATE_CHANNEL, updateChannel);
|
|
16643
16784
|
case 12:
|
|
16644
|
-
|
|
16785
|
+
_context29.n = 13;
|
|
16645
16786
|
return takeEvery(MARK_MESSAGES_AS_READ, markMessagesRead);
|
|
16646
16787
|
case 13:
|
|
16647
|
-
|
|
16788
|
+
_context29.n = 14;
|
|
16648
16789
|
return takeLatest(MARK_MESSAGES_AS_DELIVERED, markMessagesDelivered);
|
|
16649
16790
|
case 14:
|
|
16650
|
-
|
|
16651
|
-
return takeLatest(
|
|
16791
|
+
_context29.n = 15;
|
|
16792
|
+
return takeLatest(MARK_VOICE_MESSAGE_AS_PLAYED, markVoiceMessageAsPlayed);
|
|
16652
16793
|
case 15:
|
|
16653
|
-
|
|
16654
|
-
return takeLatest(
|
|
16794
|
+
_context29.n = 16;
|
|
16795
|
+
return takeLatest(WATCH_FOR_EVENTS, watchForChannelEvents);
|
|
16655
16796
|
case 16:
|
|
16656
|
-
|
|
16657
|
-
return takeLatest(
|
|
16797
|
+
_context29.n = 17;
|
|
16798
|
+
return takeLatest(TURN_OFF_NOTIFICATION, notificationsTurnOff);
|
|
16658
16799
|
case 17:
|
|
16659
|
-
|
|
16660
|
-
return takeLatest(
|
|
16800
|
+
_context29.n = 18;
|
|
16801
|
+
return takeLatest(TURN_ON_NOTIFICATION, notificationsTurnOn);
|
|
16661
16802
|
case 18:
|
|
16662
|
-
|
|
16663
|
-
return takeLatest(
|
|
16803
|
+
_context29.n = 19;
|
|
16804
|
+
return takeLatest(MARK_CHANNEL_AS_READ, markChannelAsRead);
|
|
16664
16805
|
case 19:
|
|
16665
|
-
|
|
16666
|
-
return takeLatest(
|
|
16806
|
+
_context29.n = 20;
|
|
16807
|
+
return takeLatest(MARK_CHANNEL_AS_UNREAD, markChannelAsUnRead);
|
|
16667
16808
|
case 20:
|
|
16668
|
-
|
|
16669
|
-
return takeLatest(
|
|
16809
|
+
_context29.n = 21;
|
|
16810
|
+
return takeLatest(CHECK_USER_STATUS, checkUsersStatus);
|
|
16670
16811
|
case 21:
|
|
16671
|
-
|
|
16672
|
-
return takeLatest(
|
|
16812
|
+
_context29.n = 22;
|
|
16813
|
+
return takeLatest(SEND_TYPING, sendTyping);
|
|
16673
16814
|
case 22:
|
|
16674
|
-
|
|
16675
|
-
return takeLatest(
|
|
16815
|
+
_context29.n = 23;
|
|
16816
|
+
return takeLatest(SEND_RECORDING, sendRecording);
|
|
16676
16817
|
case 23:
|
|
16677
|
-
|
|
16678
|
-
return takeLatest(
|
|
16818
|
+
_context29.n = 24;
|
|
16819
|
+
return takeLatest(PIN_CHANNEL, pinChannel);
|
|
16679
16820
|
case 24:
|
|
16680
|
-
|
|
16681
|
-
return takeLatest(
|
|
16821
|
+
_context29.n = 25;
|
|
16822
|
+
return takeLatest(UNPIN_CHANNEL, unpinChannel);
|
|
16682
16823
|
case 25:
|
|
16683
|
-
|
|
16684
|
-
return takeLatest(
|
|
16824
|
+
_context29.n = 26;
|
|
16825
|
+
return takeLatest(CLEAR_HISTORY, clearHistory);
|
|
16685
16826
|
case 26:
|
|
16686
|
-
|
|
16687
|
-
return takeLatest(
|
|
16827
|
+
_context29.n = 27;
|
|
16828
|
+
return takeLatest(JOIN_TO_CHANNEL, joinChannel);
|
|
16688
16829
|
case 27:
|
|
16689
|
-
|
|
16690
|
-
return takeLatest(
|
|
16830
|
+
_context29.n = 28;
|
|
16831
|
+
return takeLatest(DELETE_ALL_MESSAGES, deleteAllMessages);
|
|
16691
16832
|
case 28:
|
|
16692
|
-
|
|
16693
|
-
return takeLatest(
|
|
16833
|
+
_context29.n = 29;
|
|
16834
|
+
return takeLatest(REMOVE_CHANNEL_CACHES, removeChannelCaches);
|
|
16694
16835
|
case 29:
|
|
16695
|
-
|
|
16836
|
+
_context29.n = 30;
|
|
16837
|
+
return takeLatest(GET_CHANNEL_MENTIONS, getChannelMentions);
|
|
16838
|
+
case 30:
|
|
16839
|
+
return _context29.a(2);
|
|
16696
16840
|
}
|
|
16697
|
-
},
|
|
16841
|
+
}, _marked29);
|
|
16698
16842
|
}
|
|
16699
16843
|
|
|
16700
16844
|
function rgbaToThumbHash(w, h, rgba) {
|
|
@@ -17114,6 +17258,15 @@ var playingAudioIdSelector = function playingAudioIdSelector(store) {
|
|
|
17114
17258
|
var selectedMessagesMapSelector = function selectedMessagesMapSelector(store) {
|
|
17115
17259
|
return store.MessageReducer.selectedMessagesMap;
|
|
17116
17260
|
};
|
|
17261
|
+
var attachmentUpdatedMapSelector = function attachmentUpdatedMapSelector(store) {
|
|
17262
|
+
return store.MessageReducer.attachmentUpdatedMap;
|
|
17263
|
+
};
|
|
17264
|
+
var messageMarkersSelector = function messageMarkersSelector(store) {
|
|
17265
|
+
return store.MessageReducer.messageMarkers;
|
|
17266
|
+
};
|
|
17267
|
+
var messagesMarkersLoadingStateSelector = function messagesMarkersLoadingStateSelector(store) {
|
|
17268
|
+
return store.MessageReducer.messagesMarkersLoadingState;
|
|
17269
|
+
};
|
|
17117
17270
|
|
|
17118
17271
|
var getFrame = function getFrame(videoSrc, time) {
|
|
17119
17272
|
try {
|
|
@@ -17184,7 +17337,8 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(sendMessage),
|
|
|
17184
17337
|
_marked13$1 = /*#__PURE__*/_regenerator().m(loadMoreMessageAttachments),
|
|
17185
17338
|
_marked14$1 = /*#__PURE__*/_regenerator().m(pauseAttachmentUploading),
|
|
17186
17339
|
_marked15$1 = /*#__PURE__*/_regenerator().m(resumeAttachmentUploading),
|
|
17187
|
-
_marked16$1 = /*#__PURE__*/_regenerator().m(
|
|
17340
|
+
_marked16$1 = /*#__PURE__*/_regenerator().m(getMessageMarkers),
|
|
17341
|
+
_marked17$1 = /*#__PURE__*/_regenerator().m(MessageSaga);
|
|
17188
17342
|
var handleUploadAttachments = function handleUploadAttachments(attachments, message, channel) {
|
|
17189
17343
|
try {
|
|
17190
17344
|
return Promise.resolve(Promise.all(attachments.map(function (attachment) {
|
|
@@ -17198,7 +17352,7 @@ var handleUploadAttachments = function handleUploadAttachments(attachments, mess
|
|
|
17198
17352
|
}, thumbnailMetas.duration ? {
|
|
17199
17353
|
dur: thumbnailMetas.duration
|
|
17200
17354
|
} : {})));
|
|
17201
|
-
var attachmentBuilder = channel.
|
|
17355
|
+
var attachmentBuilder = channel.createdAttachmentBuilder(uri, attachment.type);
|
|
17202
17356
|
var attachmentToSend = attachmentBuilder.setName(attachment.name).setMetadata(attachmentMeta).setFileSize(fileSize || attachment.size).setUpload(false).create();
|
|
17203
17357
|
return attachmentToSend;
|
|
17204
17358
|
}
|
|
@@ -17270,7 +17424,7 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
|
|
|
17270
17424
|
try {
|
|
17271
17425
|
var messageToAdd = JSON.parse(JSON.stringify(_extends({}, messageCopy, {
|
|
17272
17426
|
createdAt: new Date(Date.now()),
|
|
17273
|
-
mentionedUsers: message.
|
|
17427
|
+
mentionedUsers: message.mentionedUsers,
|
|
17274
17428
|
parentMessage: message.parentMessage
|
|
17275
17429
|
})));
|
|
17276
17430
|
addMessageToMap(channel.id, messageToAdd);
|
|
@@ -17328,7 +17482,7 @@ function sendMessage(action) {
|
|
|
17328
17482
|
_context3.n = 7;
|
|
17329
17483
|
return put(addChannelAC(JSON.parse(JSON.stringify(channel))));
|
|
17330
17484
|
case 7:
|
|
17331
|
-
mentionedUserIds = message.
|
|
17485
|
+
mentionedUserIds = message.mentionedUsers ? message.mentionedUsers.map(function (member) {
|
|
17332
17486
|
return member.id;
|
|
17333
17487
|
}) : [];
|
|
17334
17488
|
customUploader = getCustomUploader();
|
|
@@ -17358,7 +17512,7 @@ function sendMessage(action) {
|
|
|
17358
17512
|
if (attachment.cachedUrl) {
|
|
17359
17513
|
uri = attachment.cachedUrl;
|
|
17360
17514
|
}
|
|
17361
|
-
attachmentBuilder = channel.
|
|
17515
|
+
attachmentBuilder = channel.createdAttachmentBuilder(uri || attachment.data, attachment.type);
|
|
17362
17516
|
messageAttachment = attachmentBuilder.setName(attachment.name).setMetadata(attachment.metadata).setUpload(customUploader ? false : attachment.upload).setFileSize(attachment.size).create();
|
|
17363
17517
|
if (!customUploader) {
|
|
17364
17518
|
handleUpdateUploadProgress = function handleUpdateUploadProgress(percent) {
|
|
@@ -17506,7 +17660,7 @@ function sendMessage(action) {
|
|
|
17506
17660
|
case 3:
|
|
17507
17661
|
linkAttachmentToSend = null;
|
|
17508
17662
|
if (_i === 0 && linkAttachment) {
|
|
17509
|
-
linkAttachmentBuilder = channel.
|
|
17663
|
+
linkAttachmentBuilder = channel.createdAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
17510
17664
|
linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
17511
17665
|
}
|
|
17512
17666
|
if (linkAttachmentToSend) {
|
|
@@ -17709,12 +17863,12 @@ function sendTextMessage(action) {
|
|
|
17709
17863
|
_context4.n = 7;
|
|
17710
17864
|
return put(addChannelAC(JSON.parse(JSON.stringify(channel))));
|
|
17711
17865
|
case 7:
|
|
17712
|
-
mentionedUserIds = message.
|
|
17866
|
+
mentionedUserIds = message.mentionedUsers ? message.mentionedUsers.map(function (member) {
|
|
17713
17867
|
return member.id;
|
|
17714
17868
|
}) : [];
|
|
17715
17869
|
attachments = message.attachments;
|
|
17716
17870
|
if (message.attachments && message.attachments.length) {
|
|
17717
|
-
attachmentBuilder = channel.
|
|
17871
|
+
attachmentBuilder = channel.createdAttachmentBuilder(attachments[0].data, attachments[0].type);
|
|
17718
17872
|
att = attachmentBuilder.setName('').setUpload(attachments[0].upload).create();
|
|
17719
17873
|
attachments = [att];
|
|
17720
17874
|
}
|
|
@@ -17729,7 +17883,7 @@ function sendTextMessage(action) {
|
|
|
17729
17883
|
messageToSend = messageBuilder.create();
|
|
17730
17884
|
pendingMessage = JSON.parse(JSON.stringify(_extends({}, messageToSend, {
|
|
17731
17885
|
createdAt: new Date(Date.now()),
|
|
17732
|
-
mentionedUsers: message.
|
|
17886
|
+
mentionedUsers: message.mentionedUsers,
|
|
17733
17887
|
parentMessage: message.parentMessage
|
|
17734
17888
|
})));
|
|
17735
17889
|
sendMessageTid = messageToSend.tid;
|
|
@@ -17815,16 +17969,14 @@ function sendTextMessage(action) {
|
|
|
17815
17969
|
case 16:
|
|
17816
17970
|
throw new Error('Connection required to send message');
|
|
17817
17971
|
case 17:
|
|
17972
|
+
store.dispatch(getMessagesAC(channel, true, channel.lastMessage.id, undefined, undefined, false));
|
|
17818
17973
|
_context4.n = 18;
|
|
17819
|
-
return put(scrollToNewMessageAC(true));
|
|
17820
|
-
case 18:
|
|
17821
|
-
_context4.n = 19;
|
|
17822
17974
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
17823
|
-
case
|
|
17824
|
-
_context4.n =
|
|
17975
|
+
case 18:
|
|
17976
|
+
_context4.n = 21;
|
|
17825
17977
|
break;
|
|
17826
|
-
case
|
|
17827
|
-
_context4.p =
|
|
17978
|
+
case 19:
|
|
17979
|
+
_context4.p = 19;
|
|
17828
17980
|
_t3 = _context4.v;
|
|
17829
17981
|
log.error('error on send text message ... ', _t3);
|
|
17830
17982
|
updateMessageOnMap(channel.id, {
|
|
@@ -17834,23 +17986,23 @@ function sendTextMessage(action) {
|
|
|
17834
17986
|
}
|
|
17835
17987
|
});
|
|
17836
17988
|
if (!(activeChannelId === channel.id)) {
|
|
17837
|
-
_context4.n =
|
|
17989
|
+
_context4.n = 20;
|
|
17838
17990
|
break;
|
|
17839
17991
|
}
|
|
17840
17992
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
17841
17993
|
state: MESSAGE_STATUS.FAILED
|
|
17842
17994
|
});
|
|
17843
|
-
_context4.n =
|
|
17995
|
+
_context4.n = 20;
|
|
17844
17996
|
return put(updateMessageAC(sendMessageTid, {
|
|
17845
17997
|
state: MESSAGE_STATUS.FAILED
|
|
17846
17998
|
}));
|
|
17847
|
-
case
|
|
17848
|
-
_context4.n =
|
|
17999
|
+
case 20:
|
|
18000
|
+
_context4.n = 21;
|
|
17849
18001
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
17850
|
-
case
|
|
18002
|
+
case 21:
|
|
17851
18003
|
return _context4.a(2);
|
|
17852
18004
|
}
|
|
17853
|
-
}, _marked2$2, null, [[3,
|
|
18005
|
+
}, _marked2$2, null, [[3, 19]]);
|
|
17854
18006
|
}
|
|
17855
18007
|
function forwardMessage(action) {
|
|
17856
18008
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
@@ -17889,7 +18041,7 @@ function forwardMessage(action) {
|
|
|
17889
18041
|
_context5.n = 6;
|
|
17890
18042
|
return put(addChannelAC(JSON.parse(JSON.stringify(channel))));
|
|
17891
18043
|
case 6:
|
|
17892
|
-
mentionedUserIds = message.
|
|
18044
|
+
mentionedUserIds = message.mentionedUsers ? message.mentionedUsers.map(function (member) {
|
|
17893
18045
|
return member.id;
|
|
17894
18046
|
}) : [];
|
|
17895
18047
|
attachments = message.attachments;
|
|
@@ -17898,12 +18050,12 @@ function forwardMessage(action) {
|
|
|
17898
18050
|
break;
|
|
17899
18051
|
}
|
|
17900
18052
|
if (message.attachments && message.attachments.length) {
|
|
17901
|
-
attachmentBuilder = channel.
|
|
18053
|
+
attachmentBuilder = channel.createdAttachmentBuilder(attachments[0].url, attachments[0].type);
|
|
17902
18054
|
att = attachmentBuilder.setName(attachments[0].name).setMetadata(attachments[0].metadata).setFileSize(attachments[0].size).setUpload(false).create();
|
|
17903
18055
|
attachments = [att];
|
|
17904
18056
|
}
|
|
17905
18057
|
messageBuilder = channel.createMessageBuilder();
|
|
17906
|
-
messageBuilder.setBody(message.body).setBodyAttributes(message.bodyAttributes).setAttachments(attachments).setMentionUserIds(mentionedUserIds).setType(message.type).setMetadata(message.metadata ? JSON.stringify(message.metadata) : '').setForwardingMessageId(message.forwardingDetails ? message.forwardingDetails.messageId : message.id);
|
|
18058
|
+
messageBuilder.setBody(message.body).setBodyAttributes(message.bodyAttributes).setAttachments(attachments).setMentionUserIds(mentionedUserIds).setType(message.type).setDisableMentionsCount(getDisableFrowardMentionsCount()).setMetadata(message.metadata ? JSON.stringify(message.metadata) : '').setForwardingMessageId(message.forwardingDetails ? message.forwardingDetails.messageId : message.id);
|
|
17907
18059
|
messageToSend = messageBuilder.create();
|
|
17908
18060
|
pendingMessage = JSON.parse(JSON.stringify(_extends({}, messageToSend, {
|
|
17909
18061
|
createdAt: new Date(Date.now())
|
|
@@ -18184,7 +18336,7 @@ function resendMessage(action) {
|
|
|
18184
18336
|
} : {})));
|
|
18185
18337
|
}
|
|
18186
18338
|
log.info('attachmentMeta ... ', attachmentMeta);
|
|
18187
|
-
attachmentBuilder = channel.
|
|
18339
|
+
attachmentBuilder = channel.createdAttachmentBuilder(uri, messageAttachment.type);
|
|
18188
18340
|
attachmentToSend = attachmentBuilder.setName(messageAttachment.name).setMetadata(attachmentMeta).setFileSize(fileSize).setUpload(false).create();
|
|
18189
18341
|
log.info('attachmentToSend ... ', attachmentToSend);
|
|
18190
18342
|
attachmentToSend.tid = messageAttachment.tid;
|
|
@@ -18443,7 +18595,7 @@ function editMessage(action) {
|
|
|
18443
18595
|
});
|
|
18444
18596
|
linkAttachmentsToSend = [];
|
|
18445
18597
|
linkAttachments.forEach(function (linkAttachment) {
|
|
18446
|
-
var linkAttachmentBuilder = channel.
|
|
18598
|
+
var linkAttachmentBuilder = channel.createdAttachmentBuilder(linkAttachment.data, linkAttachment.type);
|
|
18447
18599
|
var linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
18448
18600
|
linkAttachmentsToSend.push(linkAttachmentToSend);
|
|
18449
18601
|
});
|
|
@@ -19397,64 +19549,111 @@ function resumeAttachmentUploading(action) {
|
|
|
19397
19549
|
}
|
|
19398
19550
|
}, _marked15$1, null, [[0, 2]]);
|
|
19399
19551
|
}
|
|
19400
|
-
function
|
|
19552
|
+
function getMessageMarkers(action) {
|
|
19553
|
+
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers, _t18;
|
|
19401
19554
|
return _regenerator().w(function (_context18) {
|
|
19402
|
-
while (1) switch (_context18.n) {
|
|
19555
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
19403
19556
|
case 0:
|
|
19557
|
+
_context18.p = 0;
|
|
19404
19558
|
_context18.n = 1;
|
|
19405
|
-
return
|
|
19559
|
+
return put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADING));
|
|
19406
19560
|
case 1:
|
|
19561
|
+
_action$payload4 = action.payload, messageId = _action$payload4.messageId, channelId = _action$payload4.channelId, deliveryStatus = _action$payload4.deliveryStatus;
|
|
19562
|
+
sceytChatClient = getClient();
|
|
19563
|
+
if (!sceytChatClient) {
|
|
19564
|
+
_context18.n = 4;
|
|
19565
|
+
break;
|
|
19566
|
+
}
|
|
19567
|
+
messageMarkerListQueryBuilder = new sceytChatClient.MessageMarkerListQueryBuilder(channelId, String(messageId), deliveryStatus);
|
|
19407
19568
|
_context18.n = 2;
|
|
19408
|
-
return
|
|
19569
|
+
return call(messageMarkerListQueryBuilder.build);
|
|
19409
19570
|
case 2:
|
|
19571
|
+
messageMarkerListQuery = _context18.v;
|
|
19410
19572
|
_context18.n = 3;
|
|
19411
|
-
return
|
|
19573
|
+
return call(messageMarkerListQuery.loadNext);
|
|
19412
19574
|
case 3:
|
|
19575
|
+
messageMarkers = _context18.v;
|
|
19413
19576
|
_context18.n = 4;
|
|
19577
|
+
return put(setMessageMarkersAC(channelId, messageId, messageMarkers.markers, deliveryStatus));
|
|
19578
|
+
case 4:
|
|
19579
|
+
_context18.n = 6;
|
|
19580
|
+
break;
|
|
19581
|
+
case 5:
|
|
19582
|
+
_context18.p = 5;
|
|
19583
|
+
_t18 = _context18.v;
|
|
19584
|
+
log.error('error in get message markers', _t18);
|
|
19585
|
+
case 6:
|
|
19586
|
+
_context18.p = 6;
|
|
19587
|
+
_context18.n = 7;
|
|
19588
|
+
return put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADED));
|
|
19589
|
+
case 7:
|
|
19590
|
+
return _context18.f(6);
|
|
19591
|
+
case 8:
|
|
19592
|
+
return _context18.a(2);
|
|
19593
|
+
}
|
|
19594
|
+
}, _marked16$1, null, [[0, 5, 6, 8]]);
|
|
19595
|
+
}
|
|
19596
|
+
function MessageSaga() {
|
|
19597
|
+
return _regenerator().w(function (_context19) {
|
|
19598
|
+
while (1) switch (_context19.n) {
|
|
19599
|
+
case 0:
|
|
19600
|
+
_context19.n = 1;
|
|
19601
|
+
return takeEvery(SEND_MESSAGE, sendMessage);
|
|
19602
|
+
case 1:
|
|
19603
|
+
_context19.n = 2;
|
|
19604
|
+
return takeEvery(SEND_TEXT_MESSAGE, sendTextMessage);
|
|
19605
|
+
case 2:
|
|
19606
|
+
_context19.n = 3;
|
|
19607
|
+
return takeEvery(FORWARD_MESSAGE, forwardMessage);
|
|
19608
|
+
case 3:
|
|
19609
|
+
_context19.n = 4;
|
|
19414
19610
|
return takeEvery(RESEND_MESSAGE, resendMessage);
|
|
19415
19611
|
case 4:
|
|
19416
|
-
|
|
19612
|
+
_context19.n = 5;
|
|
19417
19613
|
return takeLatest(EDIT_MESSAGE, editMessage);
|
|
19418
19614
|
case 5:
|
|
19419
|
-
|
|
19615
|
+
_context19.n = 6;
|
|
19420
19616
|
return takeEvery(DELETE_MESSAGE, deleteMessage);
|
|
19421
19617
|
case 6:
|
|
19422
|
-
|
|
19618
|
+
_context19.n = 7;
|
|
19423
19619
|
return takeLatest(GET_MESSAGES, getMessagesQuery);
|
|
19424
19620
|
case 7:
|
|
19425
|
-
|
|
19621
|
+
_context19.n = 8;
|
|
19426
19622
|
return takeEvery(GET_MESSAGE, getMessageQuery);
|
|
19427
19623
|
case 8:
|
|
19428
|
-
|
|
19429
|
-
return takeLatest(
|
|
19624
|
+
_context19.n = 9;
|
|
19625
|
+
return takeLatest(GET_MESSAGE_MARKERS, getMessageMarkers);
|
|
19430
19626
|
case 9:
|
|
19431
|
-
|
|
19432
|
-
return takeLatest(
|
|
19627
|
+
_context19.n = 10;
|
|
19628
|
+
return takeLatest(GET_MESSAGES_ATTACHMENTS, getMessageAttachments);
|
|
19433
19629
|
case 10:
|
|
19434
|
-
|
|
19435
|
-
return takeLatest(
|
|
19630
|
+
_context19.n = 11;
|
|
19631
|
+
return takeLatest(LOAD_MORE_MESSAGES_ATTACHMENTS, loadMoreMessageAttachments);
|
|
19436
19632
|
case 11:
|
|
19437
|
-
|
|
19438
|
-
return takeLatest(
|
|
19633
|
+
_context19.n = 12;
|
|
19634
|
+
return takeLatest(ADD_REACTION, addReaction);
|
|
19439
19635
|
case 12:
|
|
19440
|
-
|
|
19441
|
-
return
|
|
19636
|
+
_context19.n = 13;
|
|
19637
|
+
return takeLatest(DELETE_REACTION, deleteReaction);
|
|
19442
19638
|
case 13:
|
|
19443
|
-
|
|
19444
|
-
return takeEvery(
|
|
19639
|
+
_context19.n = 14;
|
|
19640
|
+
return takeEvery(LOAD_MORE_MESSAGES, loadMoreMessages);
|
|
19445
19641
|
case 14:
|
|
19446
|
-
|
|
19447
|
-
return takeEvery(
|
|
19642
|
+
_context19.n = 15;
|
|
19643
|
+
return takeEvery(GET_REACTIONS, getReactions);
|
|
19448
19644
|
case 15:
|
|
19449
|
-
|
|
19450
|
-
return takeEvery(
|
|
19645
|
+
_context19.n = 16;
|
|
19646
|
+
return takeEvery(LOAD_MORE_REACTIONS, loadMoreReactions);
|
|
19451
19647
|
case 16:
|
|
19452
|
-
|
|
19453
|
-
return takeEvery(
|
|
19648
|
+
_context19.n = 17;
|
|
19649
|
+
return takeEvery(PAUSE_ATTACHMENT_UPLOADING, pauseAttachmentUploading);
|
|
19454
19650
|
case 17:
|
|
19455
|
-
|
|
19651
|
+
_context19.n = 18;
|
|
19652
|
+
return takeEvery(RESUME_ATTACHMENT_UPLOADING, resumeAttachmentUploading);
|
|
19653
|
+
case 18:
|
|
19654
|
+
return _context19.a(2);
|
|
19456
19655
|
}
|
|
19457
|
-
},
|
|
19656
|
+
}, _marked17$1);
|
|
19458
19657
|
}
|
|
19459
19658
|
|
|
19460
19659
|
var _marked$4 = /*#__PURE__*/_regenerator().m(getMembers),
|
|
@@ -19593,7 +19792,7 @@ function addMembers(action) {
|
|
|
19593
19792
|
m: membersIds
|
|
19594
19793
|
},
|
|
19595
19794
|
body: 'AM',
|
|
19596
|
-
|
|
19795
|
+
mentionedUsers: addedMembers,
|
|
19597
19796
|
attachments: [],
|
|
19598
19797
|
type: 'system'
|
|
19599
19798
|
};
|
|
@@ -19655,7 +19854,7 @@ function kickMemberFromChannel(action) {
|
|
|
19655
19854
|
m: membersIds
|
|
19656
19855
|
},
|
|
19657
19856
|
body: 'RM',
|
|
19658
|
-
|
|
19857
|
+
mentionedUsers: removedMembers,
|
|
19659
19858
|
attachments: [],
|
|
19660
19859
|
type: 'system'
|
|
19661
19860
|
};
|
|
@@ -20455,7 +20654,9 @@ var SceytChat = function SceytChat(_ref) {
|
|
|
20455
20654
|
openChatOnUserInteraction = _ref$openChatOnUserIn === void 0 ? true : _ref$openChatOnUserIn,
|
|
20456
20655
|
_ref$autoSelectFirstC = _ref.autoSelectFirstChannel,
|
|
20457
20656
|
autoSelectFirstChannel = _ref$autoSelectFirstC === void 0 ? false : _ref$autoSelectFirstC,
|
|
20458
|
-
memberCount = _ref.memberCount
|
|
20657
|
+
memberCount = _ref.memberCount,
|
|
20658
|
+
_ref$disableFrowardMe = _ref.disableFrowardMentionsCount,
|
|
20659
|
+
disableFrowardMentionsCount = _ref$disableFrowardMe === void 0 ? false : _ref$disableFrowardMe;
|
|
20459
20660
|
var _useColor = useColors(),
|
|
20460
20661
|
backgroundColor = _useColor[THEME_COLORS.BACKGROUND],
|
|
20461
20662
|
highlightedBackground = _useColor[THEME_COLORS.HIGHLIGHTED_BACKGROUND];
|
|
@@ -20660,6 +20861,9 @@ var SceytChat = function SceytChat(_ref) {
|
|
|
20660
20861
|
useEffect(function () {
|
|
20661
20862
|
setChannelMembersCount(memberCount || 0);
|
|
20662
20863
|
}, [memberCount]);
|
|
20864
|
+
useEffect(function () {
|
|
20865
|
+
setDisableFrowardMentionsCount(disableFrowardMentionsCount);
|
|
20866
|
+
}, [disableFrowardMentionsCount]);
|
|
20663
20867
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, SceytChatClient ? (/*#__PURE__*/React__default.createElement(ChatContainer, {
|
|
20664
20868
|
onDrop: handleDropFile,
|
|
20665
20869
|
onDragOver: handleDragOver,
|
|
@@ -20706,7 +20910,8 @@ var SceytChatContainer = function SceytChatContainer(_ref) {
|
|
|
20706
20910
|
autoSelectFirstChannel = _ref.autoSelectFirstChannel,
|
|
20707
20911
|
_ref$logLevel = _ref.logLevel,
|
|
20708
20912
|
logLevel = _ref$logLevel === void 0 ? 'silent' : _ref$logLevel,
|
|
20709
|
-
memberCount = _ref.memberCount
|
|
20913
|
+
memberCount = _ref.memberCount,
|
|
20914
|
+
disableFrowardMentionsCount = _ref.disableFrowardMentionsCount;
|
|
20710
20915
|
useEffect(function () {
|
|
20711
20916
|
log.setLevel(logLevel);
|
|
20712
20917
|
}, []);
|
|
@@ -20731,7 +20936,8 @@ var SceytChatContainer = function SceytChatContainer(_ref) {
|
|
|
20731
20936
|
openChatOnUserInteraction: openChatOnUserInteraction,
|
|
20732
20937
|
autoSelectFirstChannel: autoSelectFirstChannel,
|
|
20733
20938
|
channelTypeFilter: channelTypeFilter,
|
|
20734
|
-
memberCount: memberCount
|
|
20939
|
+
memberCount: memberCount,
|
|
20940
|
+
disableFrowardMentionsCount: disableFrowardMentionsCount
|
|
20735
20941
|
}));
|
|
20736
20942
|
};
|
|
20737
20943
|
|
|
@@ -21353,7 +21559,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21353
21559
|
if (channelDraftMessage) {
|
|
21354
21560
|
setDraftMessageText(channelDraftMessage.text);
|
|
21355
21561
|
setDraftMessage({
|
|
21356
|
-
mentionedUsers: channelDraftMessage.
|
|
21562
|
+
mentionedUsers: channelDraftMessage.mentionedUsers,
|
|
21357
21563
|
body: channelDraftMessage.text,
|
|
21358
21564
|
bodyAttributes: channelDraftMessage.bodyAttributes
|
|
21359
21565
|
});
|
|
@@ -26380,21 +26586,15 @@ function ReactionsPopup(_ref) {
|
|
|
26380
26586
|
var _useState = useState('all'),
|
|
26381
26587
|
activeTabKey = _useState[0],
|
|
26382
26588
|
setActiveTabKey = _useState[1];
|
|
26383
|
-
var _useState2 = useState(
|
|
26384
|
-
|
|
26385
|
-
|
|
26386
|
-
var _useState3 = useState(
|
|
26387
|
-
|
|
26388
|
-
|
|
26389
|
-
var _useState4 = useState(
|
|
26390
|
-
|
|
26391
|
-
|
|
26392
|
-
var _useState5 = useState(false),
|
|
26393
|
-
calculateSizes = _useState5[0],
|
|
26394
|
-
setCalculateSizes = _useState5[1];
|
|
26395
|
-
var _useState6 = useState(false),
|
|
26396
|
-
closeIsApproved = _useState6[0],
|
|
26397
|
-
setCloseIsApproved = _useState6[1];
|
|
26589
|
+
var _useState2 = useState(0),
|
|
26590
|
+
popupHeight = _useState2[0],
|
|
26591
|
+
setPopupHeight = _useState2[1];
|
|
26592
|
+
var _useState3 = useState(false),
|
|
26593
|
+
calculateSizes = _useState3[0],
|
|
26594
|
+
setCalculateSizes = _useState3[1];
|
|
26595
|
+
var _useState4 = useState(false),
|
|
26596
|
+
closeIsApproved = _useState4[0],
|
|
26597
|
+
setCloseIsApproved = _useState4[1];
|
|
26398
26598
|
var totalReactions = 0;
|
|
26399
26599
|
if (reactionTotals) {
|
|
26400
26600
|
reactionTotals.forEach(function (summery) {
|
|
@@ -26403,9 +26603,9 @@ function ReactionsPopup(_ref) {
|
|
|
26403
26603
|
}
|
|
26404
26604
|
var user = getClient().user;
|
|
26405
26605
|
var dispatch = useDispatch();
|
|
26406
|
-
var
|
|
26407
|
-
isScrolling =
|
|
26408
|
-
setIsScrolling =
|
|
26606
|
+
var _useState5 = useState(false),
|
|
26607
|
+
isScrolling = _useState5[0],
|
|
26608
|
+
setIsScrolling = _useState5[1];
|
|
26409
26609
|
var handleReactionsListScroll = function handleReactionsListScroll(event) {
|
|
26410
26610
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100 && reactionsHasNext) {
|
|
26411
26611
|
if (reactionsLoadingState === LOADING_STATE.LOADED) {
|
|
@@ -26434,20 +26634,23 @@ function ReactionsPopup(_ref) {
|
|
|
26434
26634
|
dispatch(setReactionsListAC([], true));
|
|
26435
26635
|
};
|
|
26436
26636
|
}, [messageId]);
|
|
26437
|
-
|
|
26637
|
+
var scoresHeight = useMemo(function () {
|
|
26438
26638
|
var scoresElem = scoresRef.current;
|
|
26439
26639
|
if (scoresElem) {
|
|
26440
|
-
|
|
26640
|
+
return scoresElem.offsetHeight;
|
|
26441
26641
|
}
|
|
26442
|
-
|
|
26642
|
+
return 0;
|
|
26643
|
+
}, [scoresRef]);
|
|
26443
26644
|
useEffect(function () {
|
|
26444
26645
|
if (!reactionTotals || !reactionTotals.length) {
|
|
26445
26646
|
handleReactionsPopupClose();
|
|
26446
26647
|
}
|
|
26447
26648
|
}, [reactionTotals]);
|
|
26649
|
+
var reactionsHeight = useMemo(function () {
|
|
26650
|
+
return reactions.length * 50 + 45;
|
|
26651
|
+
}, [reactions]);
|
|
26448
26652
|
useEffect(function () {
|
|
26449
26653
|
if (reactions && reactionsPrevLength < reactions.length) {
|
|
26450
|
-
var reactionsHeight = reactions.length * 44 + 45;
|
|
26451
26654
|
if (reactionsHeight > popupHeight) {
|
|
26452
26655
|
setPopupHeight(reactionsHeight);
|
|
26453
26656
|
}
|
|
@@ -26457,14 +26660,15 @@ function ReactionsPopup(_ref) {
|
|
|
26457
26660
|
}
|
|
26458
26661
|
if (reactions && reactions.length) {
|
|
26459
26662
|
if (calculateSizes) {
|
|
26460
|
-
|
|
26461
|
-
var _reactionsHeight = reactions.length * 50 + 45;
|
|
26462
|
-
setPopupHeight(_reactionsHeight);
|
|
26463
|
-
setPopupVerticalPosition(botPost >= (_reactionsHeight > 320 ? 320 : _reactionsHeight) ? 'bottom' : 'top');
|
|
26663
|
+
setPopupHeight(reactionsHeight);
|
|
26464
26664
|
setCalculateSizes(false);
|
|
26465
26665
|
}
|
|
26466
26666
|
}
|
|
26467
|
-
}, [reactions]);
|
|
26667
|
+
}, [reactions, reactionsHeight]);
|
|
26668
|
+
var popupVerticalPosition = useMemo(function () {
|
|
26669
|
+
var botPost = bottomPosition - messageInputHeight - 40;
|
|
26670
|
+
return botPost >= (reactionsHeight > 320 ? 320 : reactionsHeight) ? 'bottom' : 'top';
|
|
26671
|
+
}, [bottomPosition, messageInputHeight, reactionsHeight]);
|
|
26468
26672
|
return /*#__PURE__*/React__default.createElement(Container$d, {
|
|
26469
26673
|
ref: popupRef,
|
|
26470
26674
|
popupVerticalPosition: popupVerticalPosition,
|
|
@@ -26522,7 +26726,10 @@ function ReactionsPopup(_ref) {
|
|
|
26522
26726
|
}, reactions.map(function (reaction) {
|
|
26523
26727
|
return /*#__PURE__*/React__default.createElement(ReactionItem$1, {
|
|
26524
26728
|
key: reaction.id,
|
|
26525
|
-
hoverBackgroundColor: backgroundHovered
|
|
26729
|
+
hoverBackgroundColor: backgroundHovered,
|
|
26730
|
+
onClick: function onClick() {
|
|
26731
|
+
return handleAddDeleteEmoji(reaction.key);
|
|
26732
|
+
}
|
|
26526
26733
|
}, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
26527
26734
|
name: reaction.user.firstName || reaction.user.id,
|
|
26528
26735
|
image: reaction.user.avatarUrl,
|
|
@@ -26533,11 +26740,7 @@ function ReactionsPopup(_ref) {
|
|
|
26533
26740
|
color: textPrimary
|
|
26534
26741
|
}, makeUsername(reaction.user.id === user.id ? reaction.user : contactsMap[reaction.user.id], reaction.user, getFromContacts)), /*#__PURE__*/React__default.createElement(SubTitle, {
|
|
26535
26742
|
color: textSecondary
|
|
26536
|
-
}, reaction.user.presence && reaction.user.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : reaction.user.presence && reaction.user.presence.lastActiveAt && userLastActiveDateFormat(reaction.user.presence.lastActiveAt))), /*#__PURE__*/React__default.createElement(ReactionKey,
|
|
26537
|
-
onClick: function onClick() {
|
|
26538
|
-
return handleAddDeleteEmoji(reaction.key);
|
|
26539
|
-
}
|
|
26540
|
-
}, reaction.key));
|
|
26743
|
+
}, reaction.user.presence && reaction.user.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : reaction.user.presence && reaction.user.presence.lastActiveAt && userLastActiveDateFormat(reaction.user.presence.lastActiveAt))), /*#__PURE__*/React__default.createElement(ReactionKey, null, reaction.key));
|
|
26541
26744
|
})));
|
|
26542
26745
|
}
|
|
26543
26746
|
var Container$d = styled.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: absolute;\n /*right: ", ";*/\n right: ", ";\n /*left: ", ";*/\n left: ", ";\n top: ", ";\n bottom: ", ";\n width: 340px;\n height: ", "px;\n //overflow: ", ";\n overflow: hidden;\n max-height: 320px;\n background: ", ";\n //border: 1px solid #dfe0eb;\n box-shadow:\n 0 6px 24px -6px rgba(15, 34, 67, 0.12),\n 0px 1px 3px rgba(24, 23, 37, 0.14);\n box-sizing: border-box;\n //box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);\n border-radius: ", ";\n visibility: ", ";\n transition: all 0.2s;\n\n direction: initial;\n z-index: 12;\n &::after {\n content: '';\n position: absolute;\n width: 12px;\n height: 12px;\n\n right: ", ";\n left: ", ";\n top: ", ";\n bottom: ", ";\n transform: rotate(45deg);\n box-shadow: ", ";\n border-radius: 2px;\n visibility: ", ";\n transition-delay: 150ms;\n transition-property: visibility;\n\n background: ", ";\n }\n"])), function (props) {
|
|
@@ -26607,7 +26810,7 @@ var ReactionScoreItem = styled.div(_templateObject8$9 || (_templateObject8$9 = _
|
|
|
26607
26810
|
return props.active && !props.bubbleStyle && "\n &::after {\n content: '';\n position: absolute;\n left: 0;\n bottom: -13px;\n width: 100%;\n height: 2px;\n background-color: " + props.activeColor + ";\n border-radius: 2px;\n }\n ";
|
|
26608
26811
|
}, TabKey);
|
|
26609
26812
|
var ReactionKey = styled.span(_templateObject9$9 || (_templateObject9$9 = _taggedTemplateLiteralLoose(["\n font-family:\n apple color emoji,\n segoe ui emoji,\n noto color emoji,\n android emoji,\n emojisymbols,\n emojione mozilla,\n twemoji mozilla,\n segoe ui symbol;\n font-size: 20px;\n cursor: pointer;\n"])));
|
|
26610
|
-
var ReactionItem$1 = styled.li(_templateObject0$8 || (_templateObject0$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n font-size: 15px;\n padding: 6px 16px;\n transition: all 0.2s;\n\n &:hover {\n background-color: ", ";\n }\n\n & ", " {\n width: 10px;\n height: 10px;\n }\n"])), function (props) {
|
|
26813
|
+
var ReactionItem$1 = styled.li(_templateObject0$8 || (_templateObject0$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n font-size: 15px;\n padding: 6px 16px;\n transition: all 0.2s;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n & ", " {\n width: 10px;\n height: 10px;\n }\n"])), function (props) {
|
|
26611
26814
|
return props.hoverBackgroundColor;
|
|
26612
26815
|
}, UserStatus);
|
|
26613
26816
|
|
|
@@ -26872,6 +27075,7 @@ function MessageActions(_ref) {
|
|
|
26872
27075
|
messageStatus = _ref.messageStatus,
|
|
26873
27076
|
handleSelectMessage = _ref.handleSelectMessage,
|
|
26874
27077
|
handleReplyMessage = _ref.handleReplyMessage,
|
|
27078
|
+
handleOpenInfoMessage = _ref.handleOpenInfoMessage,
|
|
26875
27079
|
isThreadMessage = _ref.isThreadMessage,
|
|
26876
27080
|
rtlDirection = _ref.rtlDirection,
|
|
26877
27081
|
showMessageReaction = _ref.showMessageReaction,
|
|
@@ -26883,6 +27087,8 @@ function MessageActions(_ref) {
|
|
|
26883
27087
|
showDeleteMessage = _ref.showDeleteMessage,
|
|
26884
27088
|
showSelectMessage = _ref.showSelectMessage,
|
|
26885
27089
|
showReportMessage = _ref.showReportMessage,
|
|
27090
|
+
showInfoMessage = _ref.showInfoMessage,
|
|
27091
|
+
infoIconOrder = _ref.infoIconOrder,
|
|
26886
27092
|
reactionIcon = _ref.reactionIcon,
|
|
26887
27093
|
editIcon = _ref.editIcon,
|
|
26888
27094
|
copyIcon = _ref.copyIcon,
|
|
@@ -26890,6 +27096,7 @@ function MessageActions(_ref) {
|
|
|
26890
27096
|
replyInThreadIcon = _ref.replyInThreadIcon,
|
|
26891
27097
|
deleteIcon = _ref.deleteIcon,
|
|
26892
27098
|
selectIcon = _ref.selectIcon,
|
|
27099
|
+
infoIcon = _ref.infoIcon,
|
|
26893
27100
|
allowEditDeleteIncomingMessage = _ref.allowEditDeleteIncomingMessage,
|
|
26894
27101
|
reportIcon = _ref.reportIcon,
|
|
26895
27102
|
reactionIconOrder = _ref.reactionIconOrder,
|
|
@@ -26910,6 +27117,7 @@ function MessageActions(_ref) {
|
|
|
26910
27117
|
forwardIconTooltipText = _ref.forwardIconTooltipText,
|
|
26911
27118
|
deleteIconTooltipText = _ref.deleteIconTooltipText,
|
|
26912
27119
|
selectIconTooltipText = _ref.selectIconTooltipText,
|
|
27120
|
+
infoIconTooltipText = _ref.infoIconTooltipText,
|
|
26913
27121
|
reportIconTooltipText = _ref.reportIconTooltipText,
|
|
26914
27122
|
myRole = _ref.myRole,
|
|
26915
27123
|
isIncoming = _ref.isIncoming,
|
|
@@ -27038,8 +27246,20 @@ function MessageActions(_ref) {
|
|
|
27038
27246
|
disabledColor: textSecondary,
|
|
27039
27247
|
bgColor: tooltipBackground,
|
|
27040
27248
|
direction: 'top'
|
|
27041
|
-
}, selectIconTooltipText || 'Select', /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), selectIcon || /*#__PURE__*/React__default.createElement(SvgCheckCircle, null))),
|
|
27042
|
-
order:
|
|
27249
|
+
}, selectIconTooltipText || 'Select', /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), selectIcon || /*#__PURE__*/React__default.createElement(SvgCheckCircle, null))), showInfoMessage && !isIncoming && (/*#__PURE__*/React__default.createElement(Action, {
|
|
27250
|
+
order: infoIconOrder || 7,
|
|
27251
|
+
iconColor: messageActionIconsColor || iconInactive,
|
|
27252
|
+
hoverBackgroundColor: backgroundHovered,
|
|
27253
|
+
hoverIconColor: accentColor,
|
|
27254
|
+
onClick: function onClick() {
|
|
27255
|
+
return handleOpenInfoMessage();
|
|
27256
|
+
}
|
|
27257
|
+
}, /*#__PURE__*/React__default.createElement(ItemNote, {
|
|
27258
|
+
disabledColor: textSecondary,
|
|
27259
|
+
bgColor: tooltipBackground,
|
|
27260
|
+
direction: 'top'
|
|
27261
|
+
}, infoIconTooltipText || 'Info', /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), infoIcon || /*#__PURE__*/React__default.createElement(SvgInfo, null))), showDeleteMessage && (channel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || channel.type === DEFAULT_CHANNEL_TYPE.PUBLIC ? myRole === 'owner' || myRole === 'admin' : true) && (/*#__PURE__*/React__default.createElement(Action, {
|
|
27262
|
+
order: deleteIconOrder || 8,
|
|
27043
27263
|
iconColor: messageActionIconsColor || warningColor,
|
|
27044
27264
|
hoverBackgroundColor: backgroundHovered,
|
|
27045
27265
|
hoverIconColor: accentColor,
|
|
@@ -27051,7 +27271,7 @@ function MessageActions(_ref) {
|
|
|
27051
27271
|
bgColor: tooltipBackground,
|
|
27052
27272
|
direction: 'top'
|
|
27053
27273
|
}, deleteIconTooltipText || 'Delete Message', /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), deleteIcon || /*#__PURE__*/React__default.createElement(SvgDeleteIcon, null))), showReportMessage && messageStatus !== MESSAGE_DELIVERY_STATUS.PENDING && (/*#__PURE__*/React__default.createElement(Action, {
|
|
27054
|
-
order: reportIconOrder ||
|
|
27274
|
+
order: reportIconOrder || 9,
|
|
27055
27275
|
iconColor: messageActionIconsColor || iconInactive,
|
|
27056
27276
|
hoverBackgroundColor: backgroundHovered,
|
|
27057
27277
|
hoverIconColor: accentColor,
|
|
@@ -29313,7 +29533,10 @@ WaveSurfer.dom = dom;
|
|
|
29313
29533
|
var _templateObject$t, _templateObject2$p, _templateObject3$j, _templateObject4$g, _templateObject5$e, _templateObject6$c;
|
|
29314
29534
|
var AudioPlayer = function AudioPlayer(_ref) {
|
|
29315
29535
|
var url = _ref.url,
|
|
29316
|
-
file = _ref.file
|
|
29536
|
+
file = _ref.file,
|
|
29537
|
+
messagePlayed = _ref.messagePlayed,
|
|
29538
|
+
channelId = _ref.channelId,
|
|
29539
|
+
incoming = _ref.incoming;
|
|
29317
29540
|
var recordingInitialState = {
|
|
29318
29541
|
recordingSeconds: 0,
|
|
29319
29542
|
recordingMilliseconds: 0,
|
|
@@ -29379,6 +29602,9 @@ var AudioPlayer = function AudioPlayer(_ref) {
|
|
|
29379
29602
|
}
|
|
29380
29603
|
}
|
|
29381
29604
|
wavesurfer.current.playPause();
|
|
29605
|
+
if (!messagePlayed && incoming) {
|
|
29606
|
+
dispatch(markVoiceMessageAsPlayedAC(channelId, [file.messageId]));
|
|
29607
|
+
}
|
|
29382
29608
|
}
|
|
29383
29609
|
};
|
|
29384
29610
|
useEffect(function () {
|
|
@@ -29556,7 +29782,10 @@ var Attachment = function Attachment(_ref) {
|
|
|
29556
29782
|
imageAttachmentMaxHeight = _ref.imageAttachmentMaxHeight,
|
|
29557
29783
|
videoAttachmentMaxWidth = _ref.videoAttachmentMaxWidth,
|
|
29558
29784
|
videoAttachmentMaxHeight = _ref.videoAttachmentMaxHeight,
|
|
29559
|
-
messageType = _ref.messageType
|
|
29785
|
+
messageType = _ref.messageType,
|
|
29786
|
+
messagePlayed = _ref.messagePlayed,
|
|
29787
|
+
channelId = _ref.channelId,
|
|
29788
|
+
incoming = _ref.incoming;
|
|
29560
29789
|
var _useColor = useColors(),
|
|
29561
29790
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
29562
29791
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -29574,13 +29803,17 @@ var Attachment = function Attachment(_ref) {
|
|
|
29574
29803
|
var connectionStatus = useSelector(connectionStatusSelector);
|
|
29575
29804
|
var theme = useSelector(themeSelector);
|
|
29576
29805
|
var imageContRef = useRef(null);
|
|
29577
|
-
var
|
|
29806
|
+
var attachmentUpdatedMap = useSelector(attachmentUpdatedMapSelector) || {};
|
|
29807
|
+
var attachmentUrlFromMap = useMemo(function () {
|
|
29808
|
+
return attachmentUpdatedMap[attachment.url];
|
|
29809
|
+
}, [attachmentUpdatedMap, attachment.url]);
|
|
29810
|
+
var _useState = useState(!attachmentUrlFromMap),
|
|
29578
29811
|
imageLoading = _useState[0],
|
|
29579
29812
|
setImageLoading = _useState[1];
|
|
29580
29813
|
var _useState2 = useState(false),
|
|
29581
29814
|
downloadingFile = _useState2[0],
|
|
29582
29815
|
setDownloadingFile = _useState2[1];
|
|
29583
|
-
var _useState3 = useState(
|
|
29816
|
+
var _useState3 = useState(attachmentUrlFromMap),
|
|
29584
29817
|
attachmentUrl = _useState3[0],
|
|
29585
29818
|
setAttachmentUrl = _useState3[1];
|
|
29586
29819
|
var _useState4 = useState(),
|
|
@@ -29604,27 +29837,26 @@ var Attachment = function Attachment(_ref) {
|
|
|
29604
29837
|
var fileNameRef = useRef(null);
|
|
29605
29838
|
var customDownloader = getCustomDownloader();
|
|
29606
29839
|
var previewFileType = isPreview && attachment.data.type.split('/')[0];
|
|
29840
|
+
var attachmentMetadata = useMemo(function () {
|
|
29841
|
+
return isJSON(attachment.metadata) ? JSON.parse(attachment.metadata) : attachment.metadata;
|
|
29842
|
+
}, [attachment.metadata]);
|
|
29607
29843
|
var _useMemo = useMemo(function () {
|
|
29608
29844
|
var attachmentData = null;
|
|
29609
|
-
|
|
29610
|
-
attachmentData = isJSON(attachment.metadata) ? JSON.parse(attachment.metadata) : attachment.metadata;
|
|
29611
|
-
} else if (attachment.metadata && attachment.metadata.szw && attachment.metadata.szh) {
|
|
29612
|
-
attachmentData = attachment.metadata;
|
|
29613
|
-
}
|
|
29845
|
+
attachmentData = attachmentMetadata;
|
|
29614
29846
|
return attachmentData && attachmentData.szw && attachmentData.szh ? calculateRenderedImageWidth(attachmentData.szw, attachmentData.szh, attachment.type === attachmentTypes.image ? imageAttachmentMaxWidth : videoAttachmentMaxWidth, attachment.type === attachmentTypes.image ? imageAttachmentMaxHeight || 400 : videoAttachmentMaxHeight) : [];
|
|
29615
|
-
}, []),
|
|
29847
|
+
}, [attachmentMetadata]),
|
|
29616
29848
|
renderWidth = _useMemo[0],
|
|
29617
29849
|
renderHeight = _useMemo[1];
|
|
29618
29850
|
var isInUploadingState = attachmentCompilationState[attachment.tid] && (attachmentCompilationState[attachment.tid] === UPLOAD_STATE.UPLOADING || attachmentCompilationState[attachment.tid] === UPLOAD_STATE.PAUSED);
|
|
29619
29851
|
var attachmentThumb;
|
|
29620
29852
|
var withPrefix = true;
|
|
29621
|
-
if (attachment.type !== attachmentTypes.voice && attachment.type !== attachmentTypes.link &&
|
|
29853
|
+
if (attachment.type !== attachmentTypes.voice && attachment.type !== attachmentTypes.link && attachmentMetadata && attachmentMetadata.tmb) {
|
|
29622
29854
|
try {
|
|
29623
|
-
if (
|
|
29624
|
-
attachmentThumb = base64ToToDataURL(
|
|
29855
|
+
if (attachmentMetadata.tmb.length < 70) {
|
|
29856
|
+
attachmentThumb = base64ToToDataURL(attachmentMetadata.tmb);
|
|
29625
29857
|
withPrefix = false;
|
|
29626
29858
|
} else {
|
|
29627
|
-
attachmentThumb =
|
|
29859
|
+
attachmentThumb = attachmentMetadata && attachmentMetadata.tmb;
|
|
29628
29860
|
}
|
|
29629
29861
|
} catch (e) {
|
|
29630
29862
|
log.error('error on get attachmentThumb', e);
|
|
@@ -29788,9 +30020,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29788
30020
|
if (attachment.type === attachmentTypes.image && !isPreview) {
|
|
29789
30021
|
if (cachedUrl) {
|
|
29790
30022
|
setAttachmentUrl(cachedUrl);
|
|
29791
|
-
dispatch(setUpdateMessageAttachmentAC(attachment.url,
|
|
29792
|
-
attachmentUrl: cachedUrl
|
|
29793
|
-
}));
|
|
30023
|
+
dispatch(setUpdateMessageAttachmentAC(attachment.url, cachedUrl));
|
|
29794
30024
|
setIsCached(true);
|
|
29795
30025
|
} else {
|
|
29796
30026
|
setIsCached(false);
|
|
@@ -30074,7 +30304,10 @@ var Attachment = function Attachment(_ref) {
|
|
|
30074
30304
|
}
|
|
30075
30305
|
}))))) : attachment.type === attachmentTypes.voice ? (/*#__PURE__*/React__default.createElement(AudioPlayer, {
|
|
30076
30306
|
url: attachment.attachmentUrl || attachmentUrl,
|
|
30077
|
-
file: attachment
|
|
30307
|
+
file: attachment,
|
|
30308
|
+
messagePlayed: messagePlayed,
|
|
30309
|
+
channelId: channelId,
|
|
30310
|
+
incoming: incoming
|
|
30078
30311
|
})) : attachment.type === attachmentTypes.link ? null : (
|
|
30079
30312
|
/*#__PURE__*/
|
|
30080
30313
|
React__default.createElement(AttachmentFile$1, {
|
|
@@ -31363,54 +31596,99 @@ var validateUrl = function validateUrl(url) {
|
|
|
31363
31596
|
}
|
|
31364
31597
|
};
|
|
31365
31598
|
var OGMetadata = function OGMetadata(_ref) {
|
|
31366
|
-
var _metadata$
|
|
31599
|
+
var _metadata$og4, _metadata$og4$image, _metadata$og4$image$, _metadata$og5, _metadata$og5$image, _metadata$og5$image$, _metadata$og6, _metadata$og7, _metadata$og7$favicon, _metadata$og8, _metadata$og8$favicon, _metadata$og9, _metadata$og0, _metadata$og1;
|
|
31367
31600
|
var attachments = _ref.attachments,
|
|
31368
|
-
state = _ref.state
|
|
31369
|
-
|
|
31370
|
-
|
|
31371
|
-
|
|
31372
|
-
|
|
31373
|
-
|
|
31374
|
-
|
|
31375
|
-
|
|
31376
|
-
|
|
31377
|
-
setFaviconLoadError = _useState3[1];
|
|
31378
|
-
var _useState4 = useState(false),
|
|
31379
|
-
imageLoaded = _useState4[0],
|
|
31380
|
-
setImageLoaded = _useState4[1];
|
|
31381
|
-
var _useState5 = useState(0),
|
|
31382
|
-
imageWidth = _useState5[0],
|
|
31383
|
-
setImageWidth = _useState5[1];
|
|
31384
|
-
var _useState6 = useState(0),
|
|
31385
|
-
imageHeight = _useState6[0],
|
|
31386
|
-
setImageHeight = _useState6[1];
|
|
31601
|
+
state = _ref.state,
|
|
31602
|
+
incoming = _ref.incoming;
|
|
31603
|
+
var dispatch = useDispatch();
|
|
31604
|
+
var oGMetadata = useSelector(function (state) {
|
|
31605
|
+
return state.MessageReducer.oGMetadata;
|
|
31606
|
+
});
|
|
31607
|
+
var _useColor = useColors(),
|
|
31608
|
+
incomingMessageBackgroundX = _useColor[THEME_COLORS.INCOMING_MESSAGE_BACKGROUND_X],
|
|
31609
|
+
outgoingMessageBackgroundX = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND_X];
|
|
31387
31610
|
var attachment = useMemo(function () {
|
|
31388
31611
|
return attachments.find(function (attachment) {
|
|
31389
31612
|
return attachment.type === attachmentTypes.link;
|
|
31390
31613
|
});
|
|
31391
31614
|
}, [attachments]);
|
|
31615
|
+
var metadata = useMemo(function () {
|
|
31616
|
+
return oGMetadata[attachment === null || attachment === void 0 ? void 0 : attachment.url] || null;
|
|
31617
|
+
}, [oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url]);
|
|
31618
|
+
var _useState = useState(false),
|
|
31619
|
+
imageLoadError = _useState[0],
|
|
31620
|
+
setImageLoadError = _useState[1];
|
|
31621
|
+
var _useState2 = useState(false),
|
|
31622
|
+
faviconLoadError = _useState2[0],
|
|
31623
|
+
setFaviconLoadError = _useState2[1];
|
|
31624
|
+
var _useState3 = useState(false),
|
|
31625
|
+
shouldAnimate = _useState3[0],
|
|
31626
|
+
setShouldAnimate = _useState3[1];
|
|
31627
|
+
var handleMetadata = useCallback(function (metadata) {
|
|
31628
|
+
if (metadata) {
|
|
31629
|
+
dispatch(setOGMetadataAC(attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata));
|
|
31630
|
+
} else {
|
|
31631
|
+
dispatch(setOGMetadataAC(attachment === null || attachment === void 0 ? void 0 : attachment.url, null));
|
|
31632
|
+
}
|
|
31633
|
+
}, []);
|
|
31392
31634
|
var ogMetadataQueryBuilder = useCallback(function (url) {
|
|
31393
31635
|
try {
|
|
31394
31636
|
var client = getClient();
|
|
31395
|
-
var
|
|
31637
|
+
var _temp3 = function () {
|
|
31396
31638
|
if (client) {
|
|
31397
|
-
var
|
|
31639
|
+
var _temp2 = _catch(function () {
|
|
31398
31640
|
var queryBuilder = new client.MessageLinkOGQueryBuilder(url);
|
|
31399
31641
|
return Promise.resolve(queryBuilder.build()).then(function (query) {
|
|
31400
31642
|
return Promise.resolve(query.loadOGData()).then(function (metadata) {
|
|
31401
|
-
|
|
31402
|
-
|
|
31403
|
-
|
|
31643
|
+
var _metadata$og, _metadata$og$image, _metadata$og$image$;
|
|
31644
|
+
var image = new Image();
|
|
31645
|
+
image.src = metadata === null || metadata === void 0 ? void 0 : (_metadata$og = metadata.og) === null || _metadata$og === void 0 ? void 0 : (_metadata$og$image = _metadata$og.image) === null || _metadata$og$image === void 0 ? void 0 : (_metadata$og$image$ = _metadata$og$image[0]) === null || _metadata$og$image$ === void 0 ? void 0 : _metadata$og$image$.url;
|
|
31646
|
+
var _temp = function () {
|
|
31647
|
+
if (image.src) {
|
|
31648
|
+
image.onload = function () {
|
|
31649
|
+
try {
|
|
31650
|
+
var imageWidth = image.width;
|
|
31651
|
+
var imageHeight = image.height;
|
|
31652
|
+
return Promise.resolve(storeMetadata(url, _extends({}, metadata, {
|
|
31653
|
+
imageWidth: imageWidth,
|
|
31654
|
+
imageHeight: imageHeight
|
|
31655
|
+
}))).then(function () {
|
|
31656
|
+
handleMetadata(_extends({}, metadata, {
|
|
31657
|
+
imageWidth: imageWidth,
|
|
31658
|
+
imageHeight: imageHeight
|
|
31659
|
+
}));
|
|
31660
|
+
});
|
|
31661
|
+
} catch (e) {
|
|
31662
|
+
return Promise.reject(e);
|
|
31663
|
+
}
|
|
31664
|
+
};
|
|
31665
|
+
image.onerror = function () {
|
|
31666
|
+
try {
|
|
31667
|
+
setImageLoadError(true);
|
|
31668
|
+
return Promise.resolve(storeMetadata(url, _extends({}, metadata))).then(function () {
|
|
31669
|
+
handleMetadata(_extends({}, metadata));
|
|
31670
|
+
});
|
|
31671
|
+
} catch (e) {
|
|
31672
|
+
return Promise.reject(e);
|
|
31673
|
+
}
|
|
31674
|
+
};
|
|
31675
|
+
} else {
|
|
31676
|
+
return Promise.resolve(storeMetadata(url, _extends({}, metadata))).then(function () {
|
|
31677
|
+
handleMetadata(_extends({}, metadata));
|
|
31678
|
+
});
|
|
31679
|
+
}
|
|
31680
|
+
}();
|
|
31681
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
31404
31682
|
});
|
|
31405
31683
|
});
|
|
31406
31684
|
}, function () {
|
|
31407
31685
|
console.log('Failed to fetch OG metadata');
|
|
31408
|
-
|
|
31686
|
+
handleMetadata(null);
|
|
31409
31687
|
});
|
|
31410
|
-
if (
|
|
31688
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
31411
31689
|
}
|
|
31412
31690
|
}();
|
|
31413
|
-
return Promise.resolve(
|
|
31691
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {
|
|
31414
31692
|
return null;
|
|
31415
31693
|
}) : null);
|
|
31416
31694
|
} catch (e) {
|
|
@@ -31418,16 +31696,16 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31418
31696
|
}
|
|
31419
31697
|
}, []);
|
|
31420
31698
|
useEffect(function () {
|
|
31421
|
-
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url) {
|
|
31699
|
+
if (attachment !== null && attachment !== void 0 && attachment.id && attachment !== null && attachment !== void 0 && attachment.url && !metadata) {
|
|
31700
|
+
setShouldAnimate(true);
|
|
31422
31701
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
31423
31702
|
if (url) {
|
|
31424
31703
|
getMetadata(url).then(function (cachedMetadata) {
|
|
31425
31704
|
try {
|
|
31426
31705
|
if (cachedMetadata) {
|
|
31427
|
-
|
|
31428
|
-
} else {
|
|
31429
|
-
ogMetadataQueryBuilder(url);
|
|
31706
|
+
handleMetadata(cachedMetadata);
|
|
31430
31707
|
}
|
|
31708
|
+
ogMetadataQueryBuilder(url);
|
|
31431
31709
|
return Promise.resolve();
|
|
31432
31710
|
} catch (e) {
|
|
31433
31711
|
return Promise.reject(e);
|
|
@@ -31437,7 +31715,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31437
31715
|
});
|
|
31438
31716
|
}
|
|
31439
31717
|
}
|
|
31440
|
-
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url]);
|
|
31718
|
+
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata]);
|
|
31441
31719
|
var ogUrl = useMemo(function () {
|
|
31442
31720
|
var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
|
|
31443
31721
|
var urlObj = validateUrl(url);
|
|
@@ -31447,102 +31725,130 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
31447
31725
|
return url;
|
|
31448
31726
|
}, [attachment === null || attachment === void 0 ? void 0 : attachment.url]);
|
|
31449
31727
|
var showOGMetadata = useMemo(function () {
|
|
31450
|
-
var _metadata$
|
|
31451
|
-
return state !== 'deleted' && (metadata === null || metadata === void 0 ? void 0 : (_metadata$
|
|
31728
|
+
var _metadata$og2, _metadata$og3;
|
|
31729
|
+
return state !== 'deleted' && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og2 = metadata.og) === null || _metadata$og2 === void 0 ? void 0 : _metadata$og2.title) && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og3 = metadata.og) === null || _metadata$og3 === void 0 ? void 0 : _metadata$og3.description) && metadata;
|
|
31452
31730
|
}, [state, metadata]);
|
|
31453
|
-
useEffect(function () {
|
|
31454
|
-
var _metadata$og4, _metadata$og4$image, _metadata$og4$image$;
|
|
31455
|
-
if (metadata !== null && metadata !== void 0 && (_metadata$og4 = metadata.og) !== null && _metadata$og4 !== void 0 && (_metadata$og4$image = _metadata$og4.image) !== null && _metadata$og4$image !== void 0 && (_metadata$og4$image$ = _metadata$og4$image[0]) !== null && _metadata$og4$image$ !== void 0 && _metadata$og4$image$.url) {
|
|
31456
|
-
var _metadata$og5, _metadata$og5$image, _metadata$og5$image$;
|
|
31457
|
-
var image = new Image();
|
|
31458
|
-
image.src = metadata === null || metadata === void 0 ? void 0 : (_metadata$og5 = metadata.og) === null || _metadata$og5 === void 0 ? void 0 : (_metadata$og5$image = _metadata$og5.image) === null || _metadata$og5$image === void 0 ? void 0 : (_metadata$og5$image$ = _metadata$og5$image[0]) === null || _metadata$og5$image$ === void 0 ? void 0 : _metadata$og5$image$.url;
|
|
31459
|
-
image.onload = function () {
|
|
31460
|
-
var imageWidth = image.width;
|
|
31461
|
-
var imageHeight = image.height;
|
|
31462
|
-
setImageWidth(imageWidth);
|
|
31463
|
-
setImageHeight(imageHeight);
|
|
31464
|
-
setImageLoadError(false);
|
|
31465
|
-
setImageLoaded(true);
|
|
31466
|
-
};
|
|
31467
|
-
image.onerror = function () {
|
|
31468
|
-
setImageLoadError(true);
|
|
31469
|
-
setImageLoaded(true);
|
|
31470
|
-
};
|
|
31471
|
-
}
|
|
31472
|
-
}, [metadata === null || metadata === void 0 ? void 0 : (_metadata$og6 = metadata.og) === null || _metadata$og6 === void 0 ? void 0 : (_metadata$og6$image = _metadata$og6.image) === null || _metadata$og6$image === void 0 ? void 0 : (_metadata$og6$image$ = _metadata$og6$image[0]) === null || _metadata$og6$image$ === void 0 ? void 0 : _metadata$og6$image$.url]);
|
|
31473
31731
|
var calculatedImageHeight = useMemo(function () {
|
|
31474
|
-
|
|
31475
|
-
|
|
31732
|
+
if (!(metadata !== null && metadata !== void 0 && metadata.imageWidth)) {
|
|
31733
|
+
return 0;
|
|
31734
|
+
}
|
|
31735
|
+
return (metadata === null || metadata === void 0 ? void 0 : metadata.imageHeight) / ((metadata === null || metadata === void 0 ? void 0 : metadata.imageWidth) / 400);
|
|
31736
|
+
}, [metadata === null || metadata === void 0 ? void 0 : metadata.imageWidth, metadata === null || metadata === void 0 ? void 0 : metadata.imageHeight]);
|
|
31476
31737
|
return /*#__PURE__*/React__default.createElement(OGMetadataContainer, {
|
|
31477
|
-
showOGMetadata: !!showOGMetadata
|
|
31738
|
+
showOGMetadata: !!showOGMetadata,
|
|
31739
|
+
bgColor: incoming ? incomingMessageBackgroundX : outgoingMessageBackgroundX
|
|
31478
31740
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
31479
31741
|
onClick: function onClick() {
|
|
31480
31742
|
window.open(attachment === null || attachment === void 0 ? void 0 : attachment.url, '_blank');
|
|
31743
|
+
},
|
|
31744
|
+
style: {
|
|
31745
|
+
width: showOGMetadata ? '100%' : 'auto'
|
|
31481
31746
|
}
|
|
31482
31747
|
}, /*#__PURE__*/React__default.createElement(ImageContainer, {
|
|
31483
|
-
showOGMetadata: !!showOGMetadata && !imageLoadError
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31487
|
-
|
|
31748
|
+
showOGMetadata: !!showOGMetadata && !imageLoadError,
|
|
31749
|
+
containerWidth: 400,
|
|
31750
|
+
containerHeight: calculatedImageHeight,
|
|
31751
|
+
shouldAnimate: shouldAnimate
|
|
31752
|
+
}, metadata !== null && metadata !== void 0 && (_metadata$og4 = metadata.og) !== null && _metadata$og4 !== void 0 && (_metadata$og4$image = _metadata$og4.image) !== null && _metadata$og4$image !== void 0 && (_metadata$og4$image$ = _metadata$og4$image[0]) !== null && _metadata$og4$image$ !== void 0 && _metadata$og4$image$.url && !imageLoadError ? (/*#__PURE__*/React__default.createElement(Img, {
|
|
31753
|
+
src: metadata === null || metadata === void 0 ? void 0 : (_metadata$og5 = metadata.og) === null || _metadata$og5 === void 0 ? void 0 : (_metadata$og5$image = _metadata$og5.image) === null || _metadata$og5$image === void 0 ? void 0 : (_metadata$og5$image$ = _metadata$og5$image[0]) === null || _metadata$og5$image$ === void 0 ? void 0 : _metadata$og5$image$.url,
|
|
31488
31754
|
alt: 'OG metadata image',
|
|
31489
|
-
|
|
31490
|
-
|
|
31491
|
-
|
|
31492
|
-
|
|
31493
|
-
|
|
31494
|
-
|
|
31495
|
-
|
|
31496
|
-
|
|
31755
|
+
imageWidth: 400,
|
|
31756
|
+
imageHeight: calculatedImageHeight,
|
|
31757
|
+
shouldAnimate: shouldAnimate
|
|
31758
|
+
})) : null), showOGMetadata ? (/*#__PURE__*/React__default.createElement(OGText, {
|
|
31759
|
+
shouldAnimate: shouldAnimate
|
|
31760
|
+
}, /*#__PURE__*/React__default.createElement(Url, {
|
|
31761
|
+
maxWidth: 400,
|
|
31762
|
+
shouldAnimate: shouldAnimate
|
|
31763
|
+
}, ogUrl), metadata !== null && metadata !== void 0 && (_metadata$og6 = metadata.og) !== null && _metadata$og6 !== void 0 && _metadata$og6.title ? (/*#__PURE__*/React__default.createElement(Title, {
|
|
31764
|
+
maxWidth: 400,
|
|
31765
|
+
shouldAnimate: shouldAnimate
|
|
31766
|
+
}, metadata !== null && metadata !== void 0 && (_metadata$og7 = metadata.og) !== null && _metadata$og7 !== void 0 && (_metadata$og7$favicon = _metadata$og7.favicon) !== null && _metadata$og7$favicon !== void 0 && _metadata$og7$favicon.url && !faviconLoadError ? (/*#__PURE__*/React__default.createElement(Favicon, {
|
|
31767
|
+
shouldAnimate: shouldAnimate,
|
|
31768
|
+
src: metadata === null || metadata === void 0 ? void 0 : (_metadata$og8 = metadata.og) === null || _metadata$og8 === void 0 ? void 0 : (_metadata$og8$favicon = _metadata$og8.favicon) === null || _metadata$og8$favicon === void 0 ? void 0 : _metadata$og8$favicon.url,
|
|
31497
31769
|
onLoad: function onLoad() {
|
|
31498
31770
|
return setFaviconLoadError(false);
|
|
31499
31771
|
},
|
|
31500
31772
|
onError: function onError() {
|
|
31501
|
-
|
|
31773
|
+
dispatch(updateOGMetadataAC(attachment === null || attachment === void 0 ? void 0 : attachment.url, _extends({}, metadata, {
|
|
31774
|
+
og: _extends({}, metadata === null || metadata === void 0 ? void 0 : metadata.og, {
|
|
31775
|
+
favicon: {
|
|
31776
|
+
url: ''
|
|
31777
|
+
}
|
|
31778
|
+
})
|
|
31779
|
+
})));
|
|
31780
|
+
setFaviconLoadError(true);
|
|
31502
31781
|
}
|
|
31503
|
-
})) : null, /*#__PURE__*/React__default.createElement("span", null, metadata === null || metadata === void 0 ? void 0 : (_metadata$
|
|
31504
|
-
maxWidth: 400
|
|
31505
|
-
|
|
31782
|
+
})) : null, /*#__PURE__*/React__default.createElement("span", null, metadata === null || metadata === void 0 ? void 0 : (_metadata$og9 = metadata.og) === null || _metadata$og9 === void 0 ? void 0 : _metadata$og9.title))) : null, metadata !== null && metadata !== void 0 && (_metadata$og0 = metadata.og) !== null && _metadata$og0 !== void 0 && _metadata$og0.description ? (/*#__PURE__*/React__default.createElement(Desc, {
|
|
31783
|
+
maxWidth: 400,
|
|
31784
|
+
shouldAnimate: shouldAnimate
|
|
31785
|
+
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$og1 = metadata.og) === null || _metadata$og1 === void 0 ? void 0 : _metadata$og1.description)) : null)) : null));
|
|
31506
31786
|
};
|
|
31507
|
-
var OGMetadataContainer = styled.div(_templateObject$A || (_templateObject$A = _taggedTemplateLiteralLoose(["\n min-width: inherit;\n max-width: inherit;\n display: grid;\n grid-template-columns: 1fr;\n background-color:
|
|
31508
|
-
var
|
|
31787
|
+
var OGMetadataContainer = styled.div(_templateObject$A || (_templateObject$A = _taggedTemplateLiteralLoose(["\n min-width: inherit;\n max-width: inherit;\n display: grid;\n grid-template-columns: 1fr;\n background-color: ", ";\n border-radius: 6px;\n margin-bottom: 0.4rem;\n margin: 0 auto;\n margin-bottom: ", ";\n &:hover {\n opacity: 0.9;\n cursor: pointer;\n }\n"])), function (_ref2) {
|
|
31788
|
+
var bgColor = _ref2.bgColor;
|
|
31789
|
+
return bgColor;
|
|
31790
|
+
}, function (_ref3) {
|
|
31791
|
+
var showOGMetadata = _ref3.showOGMetadata;
|
|
31509
31792
|
return showOGMetadata ? '0.8rem' : '0';
|
|
31510
31793
|
});
|
|
31511
|
-
var ImageContainer = styled.div(_templateObject2$v || (_templateObject2$v = _taggedTemplateLiteralLoose(["\n ", "\n\n ", "\n\n opacity: ", ";\n overflow: hidden;\n margin: 0 auto;\n padding: ", ";\n
|
|
31512
|
-
var
|
|
31513
|
-
return
|
|
31514
|
-
}, function (_ref4) {
|
|
31515
|
-
var height = _ref4.height,
|
|
31516
|
-
showOGMetadata = _ref4.showOGMetadata;
|
|
31517
|
-
return height ? "\n max-height: " + (height + "px") + ";\n height: " + (showOGMetadata ? height + "px" : '0') + ";\n " : "\n max-height: 200px;\n height: " + (showOGMetadata ? '200px' : '0') + ";\n ";
|
|
31794
|
+
var ImageContainer = styled.div(_templateObject2$v || (_templateObject2$v = _taggedTemplateLiteralLoose(["\n ", "\n\n ", "\n\n opacity: ", ";\n overflow: hidden;\n margin: 0 auto;\n padding: ", ";\n ", "\n"])), function (_ref4) {
|
|
31795
|
+
var containerWidth = _ref4.containerWidth;
|
|
31796
|
+
return containerWidth ? "\n max-width: " + (containerWidth + "px") + ";\n " : "\n max-width: 100%;\n width: 100%;\n ";
|
|
31518
31797
|
}, function (_ref5) {
|
|
31519
|
-
var
|
|
31520
|
-
|
|
31798
|
+
var containerHeight = _ref5.containerHeight,
|
|
31799
|
+
showOGMetadata = _ref5.showOGMetadata;
|
|
31800
|
+
return containerHeight ? "\n max-height: " + (containerHeight + "px") + ";\n height: " + (showOGMetadata ? containerHeight + "px" : '0') + ";\n " : "\n height: 0;\n ";
|
|
31521
31801
|
}, function (_ref6) {
|
|
31522
|
-
var showOGMetadata = _ref6.showOGMetadata
|
|
31523
|
-
|
|
31524
|
-
|
|
31525
|
-
|
|
31526
|
-
var
|
|
31527
|
-
|
|
31802
|
+
var showOGMetadata = _ref6.showOGMetadata,
|
|
31803
|
+
containerHeight = _ref6.containerHeight;
|
|
31804
|
+
return showOGMetadata && containerHeight ? 1 : 0;
|
|
31805
|
+
}, function (_ref7) {
|
|
31806
|
+
var showOGMetadata = _ref7.showOGMetadata,
|
|
31807
|
+
containerHeight = _ref7.containerHeight;
|
|
31808
|
+
return showOGMetadata && containerHeight ? '4px' : '0';
|
|
31809
|
+
}, function (_ref8) {
|
|
31810
|
+
var shouldAnimate = _ref8.shouldAnimate;
|
|
31811
|
+
return shouldAnimate && "\n transition: height 0.2s ease;\n ";
|
|
31812
|
+
});
|
|
31813
|
+
var OGText = styled.div(_templateObject3$p || (_templateObject3$p = _taggedTemplateLiteralLoose(["\n padding: 0.5rem;\n margin: 0;\n ", "\n"])), function (_ref9) {
|
|
31814
|
+
var shouldAnimate = _ref9.shouldAnimate;
|
|
31815
|
+
return shouldAnimate && "\n transition: all 0.2s ease;\n ";
|
|
31816
|
+
});
|
|
31817
|
+
var Url = styled.p(_templateObject4$l || (_templateObject4$l = _taggedTemplateLiteralLoose(["\n font-weight: normal;\n font-size: 13px;\n padding: 0;\n margin: 0 0 12px 0;\n color: gray;\n ", "\n ", "\n"])), function (_ref0) {
|
|
31818
|
+
var maxWidth = _ref0.maxWidth;
|
|
31528
31819
|
return maxWidth && "\n max-width: " + (maxWidth + "px") + ";\n ";
|
|
31820
|
+
}, function (_ref1) {
|
|
31821
|
+
var shouldAnimate = _ref1.shouldAnimate;
|
|
31822
|
+
return shouldAnimate && "\n transition: all 0.2s ease;\n ";
|
|
31529
31823
|
});
|
|
31530
|
-
var Title = styled.p(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n font-weight: bold;\n font-size: 13px;\n padding: 0;\n display: flex;\n align-items: center;\n ", "\n
|
|
31531
|
-
var maxWidth =
|
|
31824
|
+
var Title = styled.p(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n font-weight: bold;\n font-size: 13px;\n padding: 0;\n display: flex;\n align-items: center;\n ", "\n ", "\n"])), function (_ref10) {
|
|
31825
|
+
var maxWidth = _ref10.maxWidth;
|
|
31532
31826
|
return maxWidth && "\n max-width: " + (maxWidth + "px") + ";\n ";
|
|
31827
|
+
}, function (_ref11) {
|
|
31828
|
+
var shouldAnimate = _ref11.shouldAnimate;
|
|
31829
|
+
return shouldAnimate && "\n transition: all 0.2s ease;\n ";
|
|
31533
31830
|
});
|
|
31534
|
-
var Desc = styled.p(_templateObject6$f || (_templateObject6$f = _taggedTemplateLiteralLoose(["\n font-weight: normal;\n font-size: 13px;\n padding: 0;\n
|
|
31535
|
-
var maxWidth =
|
|
31831
|
+
var Desc = styled.p(_templateObject6$f || (_templateObject6$f = _taggedTemplateLiteralLoose(["\n font-weight: normal;\n font-size: 13px;\n padding: 0;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n ", "\n ", "\n"])), function (_ref12) {
|
|
31832
|
+
var maxWidth = _ref12.maxWidth;
|
|
31536
31833
|
return maxWidth && "\n max-width: " + (maxWidth + "px") + ";\n ";
|
|
31834
|
+
}, function (_ref13) {
|
|
31835
|
+
var shouldAnimate = _ref13.shouldAnimate;
|
|
31836
|
+
return shouldAnimate && "\n transition: all 0.2s ease;\n ";
|
|
31537
31837
|
});
|
|
31538
|
-
var Img = styled.img(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n object-fit: cover;\n
|
|
31539
|
-
var
|
|
31540
|
-
return
|
|
31541
|
-
}, function (
|
|
31542
|
-
var
|
|
31543
|
-
return
|
|
31838
|
+
var Img = styled.img(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n\n object-fit: cover;\n ", "\n"])), function (_ref14) {
|
|
31839
|
+
var imageWidth = _ref14.imageWidth;
|
|
31840
|
+
return imageWidth && "\n max-width: 100%;\n width: " + ("calc(" + imageWidth + "px - 8px)") + ";\n ";
|
|
31841
|
+
}, function (_ref15) {
|
|
31842
|
+
var imageHeight = _ref15.imageHeight;
|
|
31843
|
+
return imageHeight && "\n max-height: " + (imageHeight + "px") + ";\n min-height: " + (imageHeight + "px") + ";\n height: " + (imageHeight + "px") + ";\n ";
|
|
31844
|
+
}, function (_ref16) {
|
|
31845
|
+
var shouldAnimate = _ref16.shouldAnimate;
|
|
31846
|
+
return shouldAnimate && "\n transition: height 0.2s ease;\n ";
|
|
31847
|
+
});
|
|
31848
|
+
var Favicon = styled.img(_templateObject8$c || (_templateObject8$c = _taggedTemplateLiteralLoose(["\n ", "\n width: 24px;\n height: 24px;\n object-fit: contain;\n margin-right: 4px;\n"])), function (_ref17) {
|
|
31849
|
+
var shouldAnimate = _ref17.shouldAnimate;
|
|
31850
|
+
return shouldAnimate && "\n transition: all 0.2s ease;\n ";
|
|
31544
31851
|
});
|
|
31545
|
-
var Favicon = styled.img(_templateObject8$c || (_templateObject8$c = _taggedTemplateLiteralLoose(["\n transition: all 0.2s ease;\n width: 24px;\n height: 24px;\n object-fit: contain;\n margin-right: 4px;\n"])));
|
|
31546
31852
|
|
|
31547
31853
|
var _templateObject$B, _templateObject2$w, _templateObject3$q, _templateObject4$m, _templateObject5$i;
|
|
31548
31854
|
var MessageBody = function MessageBody(_ref) {
|
|
@@ -31596,6 +31902,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31596
31902
|
deleteMessage = _ref$deleteMessage === void 0 ? true : _ref$deleteMessage,
|
|
31597
31903
|
_ref$selectMessage = _ref.selectMessage,
|
|
31598
31904
|
selectMessage = _ref$selectMessage === void 0 ? true : _ref$selectMessage,
|
|
31905
|
+
showInfoMessage = _ref.showInfoMessage,
|
|
31599
31906
|
allowEditDeleteIncomingMessage = _ref.allowEditDeleteIncomingMessage,
|
|
31600
31907
|
_ref$forwardMessage = _ref.forwardMessage,
|
|
31601
31908
|
forwardMessage = _ref$forwardMessage === void 0 ? true : _ref$forwardMessage,
|
|
@@ -31608,6 +31915,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31608
31915
|
replyInThreadIcon = _ref.replyInThreadIcon,
|
|
31609
31916
|
forwardIcon = _ref.forwardIcon,
|
|
31610
31917
|
deleteIcon = _ref.deleteIcon,
|
|
31918
|
+
infoIcon = _ref.infoIcon,
|
|
31611
31919
|
selectIcon = _ref.selectIcon,
|
|
31612
31920
|
starIcon = _ref.starIcon,
|
|
31613
31921
|
staredIcon = _ref.staredIcon,
|
|
@@ -31619,6 +31927,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31619
31927
|
replyInThreadIconOrder = _ref.replyInThreadIconOrder,
|
|
31620
31928
|
forwardIconOrder = _ref.forwardIconOrder,
|
|
31621
31929
|
deleteIconOrder = _ref.deleteIconOrder,
|
|
31930
|
+
infoIconOrder = _ref.infoIconOrder,
|
|
31622
31931
|
selectIconOrder = _ref.selectIconOrder,
|
|
31623
31932
|
starIconOrder = _ref.starIconOrder,
|
|
31624
31933
|
reportIconOrder = _ref.reportIconOrder,
|
|
@@ -31632,6 +31941,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31632
31941
|
selectIconTooltipText = _ref.selectIconTooltipText,
|
|
31633
31942
|
starIconTooltipText = _ref.starIconTooltipText,
|
|
31634
31943
|
reportIconTooltipText = _ref.reportIconTooltipText,
|
|
31944
|
+
infoIconTooltipText = _ref.infoIconTooltipText,
|
|
31635
31945
|
messageActionIconsColor = _ref.messageActionIconsColor,
|
|
31636
31946
|
messageStatusSize = _ref.messageStatusSize,
|
|
31637
31947
|
messageStatusColor = _ref.messageStatusColor,
|
|
@@ -31660,6 +31970,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31660
31970
|
messageTextFontSize = _ref.messageTextFontSize,
|
|
31661
31971
|
messageTextLineHeight = _ref.messageTextLineHeight,
|
|
31662
31972
|
handleToggleForwardMessagePopup = _ref.handleToggleForwardMessagePopup,
|
|
31973
|
+
handleToggleInfoMessagePopupOpen = _ref.handleToggleInfoMessagePopupOpen,
|
|
31663
31974
|
messageActionsShow = _ref.messageActionsShow,
|
|
31664
31975
|
closeMessageActions = _ref.closeMessageActions,
|
|
31665
31976
|
handleDeletePendingMessage = _ref.handleDeletePendingMessage,
|
|
@@ -31808,6 +32119,7 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31808
32119
|
handleCopyMessage: handleCopyMessage,
|
|
31809
32120
|
handleDeletePendingMessage: handleDeletePendingMessage,
|
|
31810
32121
|
handleOpenForwardMessage: handleToggleForwardMessagePopup,
|
|
32122
|
+
handleOpenInfoMessage: handleToggleInfoMessagePopupOpen,
|
|
31811
32123
|
handleResendMessage: handleResendMessage,
|
|
31812
32124
|
handleReplyMessage: _handleReplyMessage,
|
|
31813
32125
|
handleReportMessage: handleToggleReportPopupOpen,
|
|
@@ -31859,7 +32171,11 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31859
32171
|
reportIconTooltipText: reportIconTooltipText,
|
|
31860
32172
|
messageActionIconsColor: messageActionIconsColor,
|
|
31861
32173
|
myRole: channel.userRole,
|
|
31862
|
-
isIncoming: message.incoming
|
|
32174
|
+
isIncoming: message.incoming,
|
|
32175
|
+
infoIconTooltipText: infoIconTooltipText,
|
|
32176
|
+
infoIcon: infoIcon,
|
|
32177
|
+
showInfoMessage: showInfoMessage,
|
|
32178
|
+
infoIconOrder: infoIconOrder
|
|
31863
32179
|
}))), message.parentMessage && message.parentMessage.id && !isThreadMessage && (/*#__PURE__*/React__default.createElement(RepliedMessage$1, {
|
|
31864
32180
|
message: message,
|
|
31865
32181
|
theme: theme,
|
|
@@ -31907,10 +32223,11 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31907
32223
|
incomingMessageStyles: incomingMessageStyles,
|
|
31908
32224
|
incoming: message.incoming,
|
|
31909
32225
|
linkColor: linkColor
|
|
31910
|
-
}, linkAttachment && /*#__PURE__*/React__default.createElement(OGMetadata, {
|
|
32226
|
+
}, linkAttachment && (/*#__PURE__*/React__default.createElement(OGMetadata, {
|
|
31911
32227
|
attachments: [linkAttachment],
|
|
31912
|
-
state: message.state
|
|
31913
|
-
|
|
32228
|
+
state: message.state,
|
|
32229
|
+
incoming: message.incoming
|
|
32230
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
31914
32231
|
ref: messageTextRef
|
|
31915
32232
|
}, MessageTextFormat({
|
|
31916
32233
|
text: message.body,
|
|
@@ -31978,7 +32295,10 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
31978
32295
|
imageAttachmentMaxHeight: imageAttachmentMaxHeight,
|
|
31979
32296
|
videoAttachmentMaxWidth: videoAttachmentMaxWidth,
|
|
31980
32297
|
videoAttachmentMaxHeight: videoAttachmentMaxHeight,
|
|
31981
|
-
messageType: message.type
|
|
32298
|
+
messageType: message.type,
|
|
32299
|
+
messagePlayed: message.deliveryStatus === MESSAGE_DELIVERY_STATUS.PLAYED,
|
|
32300
|
+
channelId: message.channelId,
|
|
32301
|
+
incoming: message.incoming
|
|
31982
32302
|
});
|
|
31983
32303
|
}), emojisPopupOpen && emojisPopupPosition && (/*#__PURE__*/React__default.createElement(EmojiContainer, {
|
|
31984
32304
|
id: message.id + "_emoji_popup_container",
|
|
@@ -32058,7 +32378,426 @@ var FrequentlyEmojisContainer = styled.div(_templateObject5$i || (_templateObjec
|
|
|
32058
32378
|
return props.rtlDirection && '0';
|
|
32059
32379
|
});
|
|
32060
32380
|
|
|
32061
|
-
var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$7
|
|
32381
|
+
var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$7;
|
|
32382
|
+
var defaultFormatDate = function defaultFormatDate(date) {
|
|
32383
|
+
var m = moment(date);
|
|
32384
|
+
if (m.isSame(moment(), 'day')) {
|
|
32385
|
+
return "Today, " + m.format('HH:mm');
|
|
32386
|
+
}
|
|
32387
|
+
if (m.isSame(moment().subtract(1, 'day'), 'day')) {
|
|
32388
|
+
return "Yesterday, " + m.format('HH:mm');
|
|
32389
|
+
}
|
|
32390
|
+
return m.format('DD.MM.YYYY');
|
|
32391
|
+
};
|
|
32392
|
+
var MessageInfo = function MessageInfo(_ref) {
|
|
32393
|
+
var _tabsOrder$;
|
|
32394
|
+
var message = _ref.message,
|
|
32395
|
+
togglePopup = _ref.togglePopup,
|
|
32396
|
+
labels = _ref.labels,
|
|
32397
|
+
_ref$tabsOrder = _ref.tabsOrder,
|
|
32398
|
+
tabsOrder = _ref$tabsOrder === void 0 ? [].concat(message.attachments && message.attachments.length > 0 && message.attachments[0].type === 'voice' ? [{
|
|
32399
|
+
key: 'played',
|
|
32400
|
+
label: 'Played by',
|
|
32401
|
+
data: []
|
|
32402
|
+
}] : [], [{
|
|
32403
|
+
key: 'received',
|
|
32404
|
+
label: 'Delivered to',
|
|
32405
|
+
data: []
|
|
32406
|
+
}, {
|
|
32407
|
+
key: 'displayed',
|
|
32408
|
+
label: 'Seen by',
|
|
32409
|
+
data: []
|
|
32410
|
+
}]) : _ref$tabsOrder,
|
|
32411
|
+
_ref$showCounts = _ref.showCounts,
|
|
32412
|
+
showCounts = _ref$showCounts === void 0 ? false : _ref$showCounts,
|
|
32413
|
+
_ref$avatarSize = _ref.avatarSize,
|
|
32414
|
+
avatarSize = _ref$avatarSize === void 0 ? 32 : _ref$avatarSize,
|
|
32415
|
+
_ref$maxWidth = _ref.maxWidth,
|
|
32416
|
+
maxWidth = _ref$maxWidth === void 0 ? '340px' : _ref$maxWidth,
|
|
32417
|
+
_ref$minWidth = _ref.minWidth,
|
|
32418
|
+
minWidth = _ref$minWidth === void 0 ? '340px' : _ref$minWidth,
|
|
32419
|
+
_ref$height = _ref.height,
|
|
32420
|
+
height = _ref$height === void 0 ? '300px' : _ref$height,
|
|
32421
|
+
renderItem = _ref.renderItem,
|
|
32422
|
+
_ref$formatDate = _ref.formatDate,
|
|
32423
|
+
formatDate = _ref$formatDate === void 0 ? defaultFormatDate : _ref$formatDate,
|
|
32424
|
+
_ref$tabsStyles = _ref.tabsStyles,
|
|
32425
|
+
tabsStyles = _ref$tabsStyles === void 0 ? {} : _ref$tabsStyles,
|
|
32426
|
+
_ref$listItemStyles = _ref.listItemStyles,
|
|
32427
|
+
listItemStyles = _ref$listItemStyles === void 0 ? {} : _ref$listItemStyles,
|
|
32428
|
+
handleOpenUserProfile = _ref.handleOpenUserProfile,
|
|
32429
|
+
contacts = _ref.contacts;
|
|
32430
|
+
var _useColor = useColors(),
|
|
32431
|
+
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
32432
|
+
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
32433
|
+
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
32434
|
+
backgroundHovered = _useColor[THEME_COLORS.BACKGROUND_HOVERED],
|
|
32435
|
+
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS],
|
|
32436
|
+
textOnPrimary = _useColor[THEME_COLORS.TEXT_ON_PRIMARY],
|
|
32437
|
+
border = _useColor[THEME_COLORS.BORDER];
|
|
32438
|
+
var dispatch = useDispatch();
|
|
32439
|
+
var messageMarkers = useSelector(messageMarkersSelector);
|
|
32440
|
+
var messagesMarkersLoadingState = useSelector(messagesMarkersLoadingStateSelector);
|
|
32441
|
+
var markers = useMemo(function () {
|
|
32442
|
+
return messageMarkers[message.channelId] && messageMarkers[message.channelId][message.id];
|
|
32443
|
+
}, [messageMarkers, message.channelId, message.id]);
|
|
32444
|
+
var _useState = useState(((_tabsOrder$ = tabsOrder[0]) === null || _tabsOrder$ === void 0 ? void 0 : _tabsOrder$.key) || 'played'),
|
|
32445
|
+
activeTab = _useState[0],
|
|
32446
|
+
setActiveTab = _useState[1];
|
|
32447
|
+
var _useState2 = useState(false),
|
|
32448
|
+
open = _useState2[0],
|
|
32449
|
+
setOpen = _useState2[1];
|
|
32450
|
+
var rootRef = useRef(null);
|
|
32451
|
+
var _useState3 = useState(false),
|
|
32452
|
+
flipAbove = _useState3[0],
|
|
32453
|
+
setFlipAbove = _useState3[1];
|
|
32454
|
+
var panelRef = useRef(null);
|
|
32455
|
+
var contentRef = useRef(null);
|
|
32456
|
+
var tabsRef = useRef(null);
|
|
32457
|
+
var listRef = useRef(null);
|
|
32458
|
+
var _useState4 = useState(0),
|
|
32459
|
+
panelHeightPx = _useState4[0],
|
|
32460
|
+
setPanelHeightPx = _useState4[1];
|
|
32461
|
+
var _useState5 = useState(false),
|
|
32462
|
+
isTransitioning = _useState5[0],
|
|
32463
|
+
setIsTransitioning = _useState5[1];
|
|
32464
|
+
var _useState6 = useState(false),
|
|
32465
|
+
ready = _useState6[0],
|
|
32466
|
+
setReady = _useState6[1];
|
|
32467
|
+
var _useState7 = useState(false),
|
|
32468
|
+
flipLocked = _useState7[0],
|
|
32469
|
+
setFlipLocked = _useState7[1];
|
|
32470
|
+
var getFromContacts = useMemo(function () {
|
|
32471
|
+
return getShowOnlyContactUsers();
|
|
32472
|
+
}, []);
|
|
32473
|
+
var activeMarkers = useMemo(function () {
|
|
32474
|
+
var list = markers && markers[activeTab] || [];
|
|
32475
|
+
return Array.isArray(list) ? [].concat(list).sort(sortByDateDesc) : [];
|
|
32476
|
+
}, [markers, activeTab]);
|
|
32477
|
+
var rowHeightPx = useMemo(function () {
|
|
32478
|
+
return (avatarSize || 32) + 24;
|
|
32479
|
+
}, [avatarSize]);
|
|
32480
|
+
var listMaxHeightPx = useMemo(function () {
|
|
32481
|
+
return rowHeightPx * 5 - 16;
|
|
32482
|
+
}, [rowHeightPx]);
|
|
32483
|
+
var tabItems = tabsOrder.map(function (tab) {
|
|
32484
|
+
switch (tab.key) {
|
|
32485
|
+
case 'played':
|
|
32486
|
+
return {
|
|
32487
|
+
key: tab.key,
|
|
32488
|
+
label: (labels === null || labels === void 0 ? void 0 : labels.playedBy) || 'Played by',
|
|
32489
|
+
data: activeMarkers
|
|
32490
|
+
};
|
|
32491
|
+
case 'received':
|
|
32492
|
+
return {
|
|
32493
|
+
key: tab.key,
|
|
32494
|
+
label: (labels === null || labels === void 0 ? void 0 : labels.receivedBy) || 'Delivered to',
|
|
32495
|
+
data: activeMarkers
|
|
32496
|
+
};
|
|
32497
|
+
case 'displayed':
|
|
32498
|
+
default:
|
|
32499
|
+
return {
|
|
32500
|
+
key: 'displayed',
|
|
32501
|
+
label: (labels === null || labels === void 0 ? void 0 : labels.displayedBy) || 'Seen by',
|
|
32502
|
+
data: activeMarkers
|
|
32503
|
+
};
|
|
32504
|
+
}
|
|
32505
|
+
});
|
|
32506
|
+
var renderRow = function renderRow(marker) {
|
|
32507
|
+
var _marker$user;
|
|
32508
|
+
var contact = contacts[((_marker$user = marker.user) === null || _marker$user === void 0 ? void 0 : _marker$user.id) || ''];
|
|
32509
|
+
var displayName = makeUsername(contact, marker.user, getFromContacts);
|
|
32510
|
+
var avatarUrl = marker.user ? marker.user.avatarUrl : '';
|
|
32511
|
+
var dateVal = marker.createdAt || marker.createdAt;
|
|
32512
|
+
var dateFormat = dateVal ? formatDate(new Date(dateVal)) : '';
|
|
32513
|
+
var node = /*#__PURE__*/React__default.createElement(Row$1, {
|
|
32514
|
+
backgroundHover: listItemStyles.hoverBackground || backgroundHovered,
|
|
32515
|
+
onClick: function onClick() {
|
|
32516
|
+
return handleOpenUserProfile === null || handleOpenUserProfile === void 0 ? void 0 : handleOpenUserProfile(marker.user);
|
|
32517
|
+
}
|
|
32518
|
+
}, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
32519
|
+
name: displayName,
|
|
32520
|
+
image: avatarUrl,
|
|
32521
|
+
size: avatarSize,
|
|
32522
|
+
textSize: 12,
|
|
32523
|
+
setDefaultAvatar: true
|
|
32524
|
+
}), /*#__PURE__*/React__default.createElement(RowInfo, null, /*#__PURE__*/React__default.createElement(RowTitle, {
|
|
32525
|
+
color: listItemStyles.nameColor || textPrimary
|
|
32526
|
+
}, displayName), /*#__PURE__*/React__default.createElement(RowDate, {
|
|
32527
|
+
color: listItemStyles.dateColor || textSecondary
|
|
32528
|
+
}, dateFormat)));
|
|
32529
|
+
return renderItem ? renderItem(marker, node) : node;
|
|
32530
|
+
};
|
|
32531
|
+
useLayoutEffect(function () {
|
|
32532
|
+
var _rootRef$current;
|
|
32533
|
+
var container = document.getElementById('scrollableDiv');
|
|
32534
|
+
var anchorEl = (_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.parentElement;
|
|
32535
|
+
if (container && anchorEl) {
|
|
32536
|
+
var containerRect = container.getBoundingClientRect();
|
|
32537
|
+
var anchorRect = anchorEl.getBoundingClientRect();
|
|
32538
|
+
var contentEl = contentRef.current;
|
|
32539
|
+
var tabsEl = tabsRef.current;
|
|
32540
|
+
var listEl = listRef.current;
|
|
32541
|
+
var cs = contentEl ? getComputedStyle(contentEl) : {};
|
|
32542
|
+
var padTop = parseFloat((cs === null || cs === void 0 ? void 0 : cs.paddingTop) || '0') || 0;
|
|
32543
|
+
var padBottom = parseFloat((cs === null || cs === void 0 ? void 0 : cs.paddingBottom) || '0') || 0;
|
|
32544
|
+
var contentPaddingY = padTop + padBottom;
|
|
32545
|
+
var tabsHeight = tabsEl ? tabsEl.getBoundingClientRect().height : 0;
|
|
32546
|
+
var tabsMarginBottom = 8;
|
|
32547
|
+
var listMarginTop = 8;
|
|
32548
|
+
var desiredListHeight = Math.min(listEl ? listEl.scrollHeight : 0, listMaxHeightPx);
|
|
32549
|
+
var desiredHeight = contentPaddingY + tabsHeight + tabsMarginBottom + listMarginTop + desiredListHeight;
|
|
32550
|
+
var maxPx = parseInt(String(height || '300'), 10) || 300;
|
|
32551
|
+
var measuredTarget = Math.min(desiredHeight || 0, maxPx);
|
|
32552
|
+
var flipTarget = messagesMarkersLoadingState === LOADING_STATE.LOADING ? maxPx : measuredTarget;
|
|
32553
|
+
setPanelHeightPx(measuredTarget);
|
|
32554
|
+
var availableBelow = containerRect.bottom - anchorRect.bottom - 8;
|
|
32555
|
+
var availableAbove = anchorRect.top - containerRect.top - 8;
|
|
32556
|
+
var nextFlip = Boolean(flipTarget > availableBelow && flipTarget <= availableAbove);
|
|
32557
|
+
setFlipAbove(nextFlip);
|
|
32558
|
+
}
|
|
32559
|
+
setIsTransitioning(true);
|
|
32560
|
+
setOpen(true);
|
|
32561
|
+
setReady(true);
|
|
32562
|
+
setFlipLocked(true);
|
|
32563
|
+
}, []);
|
|
32564
|
+
useEffect(function () {
|
|
32565
|
+
var onDown = function onDown(e) {
|
|
32566
|
+
if (rootRef.current && !rootRef.current.contains(e.target)) {
|
|
32567
|
+
togglePopup();
|
|
32568
|
+
}
|
|
32569
|
+
};
|
|
32570
|
+
document.addEventListener('mousedown', onDown);
|
|
32571
|
+
return function () {
|
|
32572
|
+
document.removeEventListener('mousedown', onDown);
|
|
32573
|
+
};
|
|
32574
|
+
}, []);
|
|
32575
|
+
useEffect(function () {
|
|
32576
|
+
var container = document.getElementById('scrollableDiv');
|
|
32577
|
+
if (!container) return;
|
|
32578
|
+
var recalc = function recalc() {
|
|
32579
|
+
if (!rootRef.current || !ready) return;
|
|
32580
|
+
if (messagesMarkersLoadingState === LOADING_STATE.LOADING) return;
|
|
32581
|
+
var containerRect = container.getBoundingClientRect();
|
|
32582
|
+
var anchorEl = rootRef.current.parentElement;
|
|
32583
|
+
if (!anchorEl) return;
|
|
32584
|
+
var anchorRect = anchorEl.getBoundingClientRect();
|
|
32585
|
+
var dropdownHeight = panelHeightPx || 0;
|
|
32586
|
+
if (!dropdownHeight || dropdownHeight < 8) {
|
|
32587
|
+
var parsed = parseInt(String(height || '300'), 10);
|
|
32588
|
+
dropdownHeight = isNaN(parsed) ? 300 : parsed;
|
|
32589
|
+
}
|
|
32590
|
+
var availableBelow = containerRect.bottom - anchorRect.bottom - 8;
|
|
32591
|
+
var availableAbove = anchorRect.top - containerRect.top - 8;
|
|
32592
|
+
var overflowBelow = dropdownHeight > availableBelow;
|
|
32593
|
+
var overflowAbove = dropdownHeight > availableAbove;
|
|
32594
|
+
if (!isTransitioning && !flipLocked) {
|
|
32595
|
+
setFlipAbove(function (prev) {
|
|
32596
|
+
if (prev) {
|
|
32597
|
+
if (overflowAbove && !overflowBelow) return false;
|
|
32598
|
+
return true;
|
|
32599
|
+
}
|
|
32600
|
+
if (overflowBelow && !overflowAbove) return true;
|
|
32601
|
+
return false;
|
|
32602
|
+
});
|
|
32603
|
+
}
|
|
32604
|
+
};
|
|
32605
|
+
if (open) {
|
|
32606
|
+
recalc();
|
|
32607
|
+
var raf1 = requestAnimationFrame(recalc);
|
|
32608
|
+
var raf2 = requestAnimationFrame(function () {
|
|
32609
|
+
return requestAnimationFrame(recalc);
|
|
32610
|
+
});
|
|
32611
|
+
var t1 = setTimeout(recalc, 50);
|
|
32612
|
+
var t2 = setTimeout(recalc, 200);
|
|
32613
|
+
panelRef.current && panelRef.current.addEventListener('transitionend', recalc);
|
|
32614
|
+
container.addEventListener('scroll', recalc);
|
|
32615
|
+
window.addEventListener('resize', recalc);
|
|
32616
|
+
return function () {
|
|
32617
|
+
cancelAnimationFrame(raf1);
|
|
32618
|
+
cancelAnimationFrame(raf2);
|
|
32619
|
+
clearTimeout(t1);
|
|
32620
|
+
clearTimeout(t2);
|
|
32621
|
+
panelRef.current && panelRef.current.removeEventListener('transitionend', recalc);
|
|
32622
|
+
container.removeEventListener('scroll', recalc);
|
|
32623
|
+
window.removeEventListener('resize', recalc);
|
|
32624
|
+
};
|
|
32625
|
+
} else {
|
|
32626
|
+
container.addEventListener('scroll', recalc);
|
|
32627
|
+
window.addEventListener('resize', recalc);
|
|
32628
|
+
return function () {
|
|
32629
|
+
container.removeEventListener('scroll', recalc);
|
|
32630
|
+
window.removeEventListener('resize', recalc);
|
|
32631
|
+
};
|
|
32632
|
+
}
|
|
32633
|
+
}, [open, ready, message.id, panelHeightPx, isTransitioning, flipLocked, height]);
|
|
32634
|
+
useLayoutEffect(function () {
|
|
32635
|
+
var _rootRef$current2;
|
|
32636
|
+
var container = document.getElementById('scrollableDiv');
|
|
32637
|
+
var anchorEl = (_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.parentElement;
|
|
32638
|
+
if (!container || !anchorEl || !ready) return;
|
|
32639
|
+
var containerRect = container.getBoundingClientRect();
|
|
32640
|
+
var anchorRect = anchorEl.getBoundingClientRect();
|
|
32641
|
+
var contentEl = contentRef.current;
|
|
32642
|
+
var tabsEl = tabsRef.current;
|
|
32643
|
+
var listEl = listRef.current;
|
|
32644
|
+
var cs = contentEl ? getComputedStyle(contentEl) : {};
|
|
32645
|
+
var padTop = parseFloat((cs === null || cs === void 0 ? void 0 : cs.paddingTop) || '0') || 0;
|
|
32646
|
+
var padBottom = parseFloat((cs === null || cs === void 0 ? void 0 : cs.paddingBottom) || '0') || 0;
|
|
32647
|
+
var contentPaddingY = padTop + padBottom;
|
|
32648
|
+
var tabsHeight = tabsEl ? tabsEl.getBoundingClientRect().height : 0;
|
|
32649
|
+
var tabsMarginBottom = 8;
|
|
32650
|
+
var listMarginTop = 8;
|
|
32651
|
+
var desiredListHeight = Math.min(listEl ? listEl.scrollHeight : 0, listMaxHeightPx);
|
|
32652
|
+
var desiredHeight = contentPaddingY + tabsHeight + tabsMarginBottom + listMarginTop + desiredListHeight;
|
|
32653
|
+
var maxPx = parseInt(String(height || '300'), 10);
|
|
32654
|
+
var measuredTarget = Math.min(desiredHeight || 0, isNaN(maxPx) ? 300 : Math.min(maxPx, desiredHeight));
|
|
32655
|
+
var nextHeight = Math.max(panelHeightPx || 0, measuredTarget);
|
|
32656
|
+
var availableBelow = containerRect.bottom - anchorRect.bottom - 8;
|
|
32657
|
+
var availableAbove = anchorRect.top - containerRect.top - 8;
|
|
32658
|
+
setFlipLocked(true);
|
|
32659
|
+
if (messagesMarkersLoadingState !== LOADING_STATE.LOADING) {
|
|
32660
|
+
var overflowBelow = nextHeight > availableBelow;
|
|
32661
|
+
var overflowAbove = nextHeight > availableAbove;
|
|
32662
|
+
setFlipAbove(function (prev) {
|
|
32663
|
+
if (prev) {
|
|
32664
|
+
if (overflowAbove && !overflowBelow) return false;
|
|
32665
|
+
return true;
|
|
32666
|
+
}
|
|
32667
|
+
if (overflowBelow && !overflowAbove) return true;
|
|
32668
|
+
return false;
|
|
32669
|
+
});
|
|
32670
|
+
}
|
|
32671
|
+
if (panelHeightPx !== nextHeight) {
|
|
32672
|
+
setIsTransitioning(true);
|
|
32673
|
+
setPanelHeightPx(nextHeight);
|
|
32674
|
+
}
|
|
32675
|
+
}, [ready, panelHeightPx, activeMarkers.length, messagesMarkersLoadingState, height]);
|
|
32676
|
+
useEffect(function () {
|
|
32677
|
+
if (messagesMarkersLoadingState === LOADING_STATE.LOADING) {
|
|
32678
|
+
setFlipLocked(true);
|
|
32679
|
+
}
|
|
32680
|
+
}, [messagesMarkersLoadingState]);
|
|
32681
|
+
useEffect(function () {
|
|
32682
|
+
var el = panelRef.current;
|
|
32683
|
+
if (!el) return;
|
|
32684
|
+
var onEnd = function onEnd(e) {
|
|
32685
|
+
if (e.propertyName === 'height') {
|
|
32686
|
+
setIsTransitioning(false);
|
|
32687
|
+
setTimeout(function () {
|
|
32688
|
+
setFlipLocked(false);
|
|
32689
|
+
}, 50);
|
|
32690
|
+
}
|
|
32691
|
+
};
|
|
32692
|
+
el.addEventListener('transitionend', onEnd);
|
|
32693
|
+
return function () {
|
|
32694
|
+
el.removeEventListener('transitionend', onEnd);
|
|
32695
|
+
};
|
|
32696
|
+
}, []);
|
|
32697
|
+
useEffect(function () {
|
|
32698
|
+
if (activeTab && message.id && message.channelId) {
|
|
32699
|
+
dispatch(getMessageMarkersAC(message.id, message.channelId, activeTab));
|
|
32700
|
+
}
|
|
32701
|
+
}, [activeTab, message.id, message.channelId]);
|
|
32702
|
+
return /*#__PURE__*/React__default.createElement(DropdownRoot, {
|
|
32703
|
+
ref: rootRef,
|
|
32704
|
+
rtl: message.incoming,
|
|
32705
|
+
backgroundColor: backgroundSections,
|
|
32706
|
+
flip: flipAbove,
|
|
32707
|
+
ready: ready
|
|
32708
|
+
}, /*#__PURE__*/React__default.createElement(Panel, {
|
|
32709
|
+
ref: panelRef,
|
|
32710
|
+
bg: backgroundSections,
|
|
32711
|
+
open: open,
|
|
32712
|
+
heightPx: panelHeightPx,
|
|
32713
|
+
maxHeight: height,
|
|
32714
|
+
maxWidth: maxWidth,
|
|
32715
|
+
minWidth: minWidth
|
|
32716
|
+
}, /*#__PURE__*/React__default.createElement(Content, {
|
|
32717
|
+
ref: contentRef
|
|
32718
|
+
}, /*#__PURE__*/React__default.createElement(Tabs, {
|
|
32719
|
+
ref: tabsRef
|
|
32720
|
+
}, tabItems.map(function (tab) {
|
|
32721
|
+
return /*#__PURE__*/React__default.createElement(Tab, {
|
|
32722
|
+
key: tab.key,
|
|
32723
|
+
active: activeTab === tab.key,
|
|
32724
|
+
activeColor: tabsStyles.activeColor || textOnPrimary,
|
|
32725
|
+
inactiveColor: tabsStyles.inactiveColor || textSecondary,
|
|
32726
|
+
onClick: function onClick() {
|
|
32727
|
+
return setActiveTab(tab.key);
|
|
32728
|
+
},
|
|
32729
|
+
textOnPrimary: textOnPrimary,
|
|
32730
|
+
textSecondary: textSecondary,
|
|
32731
|
+
background: activeTab === tab.key ? accentColor : 'transparent',
|
|
32732
|
+
borderColor: border
|
|
32733
|
+
}, tab.label, showCounts ? " (" + tab.data.length + ")" : '');
|
|
32734
|
+
})), /*#__PURE__*/React__default.createElement(List$1, {
|
|
32735
|
+
ref: listRef,
|
|
32736
|
+
maxHeight: listMaxHeightPx
|
|
32737
|
+
}, activeMarkers.map(function (marker) {
|
|
32738
|
+
var _marker$user2;
|
|
32739
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
32740
|
+
key: (((_marker$user2 = marker.user) === null || _marker$user2 === void 0 ? void 0 : _marker$user2.id) || 'deleted') + "-" + (marker.createdAt || '')
|
|
32741
|
+
}, renderRow(marker));
|
|
32742
|
+
}), !activeMarkers.length && messagesMarkersLoadingState !== LOADING_STATE.LOADING && (/*#__PURE__*/React__default.createElement(Empty, {
|
|
32743
|
+
color: textSecondary
|
|
32744
|
+
}, "No results"))))));
|
|
32745
|
+
};
|
|
32746
|
+
function sortByDateDesc(a, b) {
|
|
32747
|
+
var aDate = a.createdAt || a.createdAt;
|
|
32748
|
+
var bDate = b.createdAt || b.createdAt;
|
|
32749
|
+
var aTime = aDate ? new Date(aDate).getTime() : 0;
|
|
32750
|
+
var bTime = bDate ? new Date(bDate).getTime() : 0;
|
|
32751
|
+
return bTime - aTime;
|
|
32752
|
+
}
|
|
32753
|
+
var Tabs = styled.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n gap: 8px;\n justify-content: start;\n margin-bottom: 8px;\n"])));
|
|
32754
|
+
var Tab = styled.button(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 6px 11px;\n border-radius: 16px;\n color: ", ";\n background: ", ";\n border: 1px solid ", ";\n &:hover {\n opacity: 0.9;\n }\n font-weight: 500;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: center;\n"])), function (p) {
|
|
32755
|
+
return p.active ? p.textOnPrimary : p.textSecondary;
|
|
32756
|
+
}, function (p) {
|
|
32757
|
+
return p.background;
|
|
32758
|
+
}, function (p) {
|
|
32759
|
+
return p.active ? p.background : p.borderColor;
|
|
32760
|
+
});
|
|
32761
|
+
var List$1 = styled.div(_templateObject3$r || (_templateObject3$r = _taggedTemplateLiteralLoose(["\n margin-top: 8px;\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n max-height: ", ";\n min-height: 120px;\n"])), function (p) {
|
|
32762
|
+
return p.maxHeight ? p.maxHeight + "px" : 'unset';
|
|
32763
|
+
});
|
|
32764
|
+
var Row$1 = styled.div(_templateObject4$n || (_templateObject4$n = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 6px;\n border-radius: 10px;\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n"])), function (p) {
|
|
32765
|
+
return p.backgroundHover;
|
|
32766
|
+
});
|
|
32767
|
+
var RowInfo = styled.div(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n display: flex;\n margin-right: auto;\n min-width: 0;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n"])));
|
|
32768
|
+
var RowTitle = styled.div(_templateObject6$g || (_templateObject6$g = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-size: 16px;\n font-weight: 500;\n line-height: 22px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (p) {
|
|
32769
|
+
return p.color;
|
|
32770
|
+
});
|
|
32771
|
+
var RowDate = styled.div(_templateObject7$e || (_templateObject7$e = _taggedTemplateLiteralLoose(["\n color: ", ";\n min-width: max-content;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n"])), function (p) {
|
|
32772
|
+
return p.color;
|
|
32773
|
+
});
|
|
32774
|
+
var Empty = styled.div(_templateObject8$d || (_templateObject8$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n text-align: center;\n padding: 16px 0;\n font-size: 14px;\n height: calc(100% - 32px);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n"])), function (p) {
|
|
32775
|
+
return p.color;
|
|
32776
|
+
});
|
|
32777
|
+
var DropdownRoot = styled.div(_templateObject9$b || (_templateObject9$b = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: ", ";\n bottom: ", ";\n ", "\n z-index: 15;\n background: ", ";\n box-shadow: 0px 0px 24px 0px #11153929;\n border-radius: 16px;\n direction: initial;\n visibility: ", ";\n"])), function (p) {
|
|
32778
|
+
return p.flip ? 'auto' : 'calc(100% + 8px)';
|
|
32779
|
+
}, function (p) {
|
|
32780
|
+
return p.flip ? 'calc(100% + 8px)' : 'auto';
|
|
32781
|
+
}, function (p) {
|
|
32782
|
+
return p.rtl ? 'left: 4%;' : 'right: 4%;';
|
|
32783
|
+
}, function (_ref2) {
|
|
32784
|
+
var backgroundColor = _ref2.backgroundColor;
|
|
32785
|
+
return backgroundColor;
|
|
32786
|
+
}, function (p) {
|
|
32787
|
+
return p.ready ? 'visible' : 'hidden';
|
|
32788
|
+
});
|
|
32789
|
+
var Panel = styled.div(_templateObject0$a || (_templateObject0$a = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: 16px;\n overflow: hidden;\n transition: height 0.25s ease;\n height: ", ";\n width: ", ";\n min-width: ", ";\n display: flex;\n flex-direction: column;\n"])), function (p) {
|
|
32790
|
+
return p.bg;
|
|
32791
|
+
}, function (p) {
|
|
32792
|
+
return p.open ? Math.min(p.heightPx || 0, parseInt(String(p.maxHeight || '300'), 10) || 300) + "px" : '0';
|
|
32793
|
+
}, function (p) {
|
|
32794
|
+
return p.maxWidth || '340px';
|
|
32795
|
+
}, function (p) {
|
|
32796
|
+
return p.minWidth || '340px';
|
|
32797
|
+
});
|
|
32798
|
+
var Content = styled.div(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n padding: 16px 12px;\n height: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n"])));
|
|
32799
|
+
|
|
32800
|
+
var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$8, _templateObject10$4, _templateObject11$4, _templateObject12$3;
|
|
32062
32801
|
var Message$1 = function Message(_ref) {
|
|
32063
32802
|
var message = _ref.message,
|
|
32064
32803
|
channel = _ref.channel,
|
|
@@ -32118,6 +32857,8 @@ var Message$1 = function Message(_ref) {
|
|
|
32118
32857
|
deleteMessage = _ref$deleteMessage === void 0 ? true : _ref$deleteMessage,
|
|
32119
32858
|
_ref$selectMessage = _ref.selectMessage,
|
|
32120
32859
|
selectMessage = _ref$selectMessage === void 0 ? true : _ref$selectMessage,
|
|
32860
|
+
_ref$showInfoMessage = _ref.showInfoMessage,
|
|
32861
|
+
showInfoMessage = _ref$showInfoMessage === void 0 ? true : _ref$showInfoMessage,
|
|
32121
32862
|
allowEditDeleteIncomingMessage = _ref.allowEditDeleteIncomingMessage,
|
|
32122
32863
|
_ref$forwardMessage = _ref.forwardMessage,
|
|
32123
32864
|
forwardMessage = _ref$forwardMessage === void 0 ? true : _ref$forwardMessage,
|
|
@@ -32146,6 +32887,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32146
32887
|
selectIconOrder = _ref.selectIconOrder,
|
|
32147
32888
|
starIconOrder = _ref.starIconOrder,
|
|
32148
32889
|
reportIconOrder = _ref.reportIconOrder,
|
|
32890
|
+
infoIconOrder = _ref.infoIconOrder,
|
|
32149
32891
|
reactionIconTooltipText = _ref.reactionIconTooltipText,
|
|
32150
32892
|
editIconTooltipText = _ref.editIconTooltipText,
|
|
32151
32893
|
copyIconTooltipText = _ref.copyIconTooltipText,
|
|
@@ -32156,6 +32898,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32156
32898
|
selectIconTooltipText = _ref.selectIconTooltipText,
|
|
32157
32899
|
starIconTooltipText = _ref.starIconTooltipText,
|
|
32158
32900
|
reportIconTooltipText = _ref.reportIconTooltipText,
|
|
32901
|
+
infoIconTooltipText = _ref.infoIconTooltipText,
|
|
32159
32902
|
messageActionIconsColor = _ref.messageActionIconsColor,
|
|
32160
32903
|
messageStatusSize = _ref.messageStatusSize,
|
|
32161
32904
|
messageStatusColor = _ref.messageStatusColor,
|
|
@@ -32207,7 +32950,9 @@ var Message$1 = function Message(_ref) {
|
|
|
32207
32950
|
messageTextFontSize = _ref.messageTextFontSize,
|
|
32208
32951
|
messageTextLineHeight = _ref.messageTextLineHeight,
|
|
32209
32952
|
messageTimeColorOnAttachment = _ref.messageTimeColorOnAttachment,
|
|
32210
|
-
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention
|
|
32953
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention,
|
|
32954
|
+
_ref$showInfoMessageP = _ref.showInfoMessageProps,
|
|
32955
|
+
showInfoMessageProps = _ref$showInfoMessageP === void 0 ? {} : _ref$showInfoMessageP;
|
|
32211
32956
|
var _useColor = useColors(),
|
|
32212
32957
|
accentColor = _useColor[THEME_COLORS.ACCENT],
|
|
32213
32958
|
backgroundSections = _useColor[THEME_COLORS.BACKGROUND_SECTIONS],
|
|
@@ -32229,29 +32974,32 @@ var Message$1 = function Message(_ref) {
|
|
|
32229
32974
|
reportPopupOpen = _useState3[0],
|
|
32230
32975
|
setReportPopupOpen = _useState3[1];
|
|
32231
32976
|
var _useState4 = useState(false),
|
|
32232
|
-
|
|
32233
|
-
|
|
32977
|
+
infoPopupOpen = _useState4[0],
|
|
32978
|
+
setInfoPopupOpen = _useState4[1];
|
|
32234
32979
|
var _useState5 = useState(false),
|
|
32235
|
-
|
|
32236
|
-
|
|
32980
|
+
messageActionsShow = _useState5[0],
|
|
32981
|
+
setMessageActionsShow = _useState5[1];
|
|
32237
32982
|
var _useState6 = useState(false),
|
|
32238
|
-
|
|
32239
|
-
|
|
32983
|
+
emojisPopupOpen = _useState6[0],
|
|
32984
|
+
setEmojisPopupOpen = _useState6[1];
|
|
32240
32985
|
var _useState7 = useState(false),
|
|
32241
|
-
|
|
32242
|
-
|
|
32243
|
-
var _useState8 = useState(
|
|
32244
|
-
|
|
32245
|
-
|
|
32246
|
-
var _useState9 = useState(
|
|
32247
|
-
|
|
32248
|
-
|
|
32249
|
-
var _useState0 = useState(
|
|
32986
|
+
frequentlyEmojisOpen = _useState7[0],
|
|
32987
|
+
setFrequentlyEmojisOpen = _useState7[1];
|
|
32988
|
+
var _useState8 = useState(false),
|
|
32989
|
+
reactionsPopupOpen = _useState8[0],
|
|
32990
|
+
setReactionsPopupOpen = _useState8[1];
|
|
32991
|
+
var _useState9 = useState(0),
|
|
32992
|
+
reactionsPopupPosition = _useState9[0],
|
|
32993
|
+
setReactionsPopupPosition = _useState9[1];
|
|
32994
|
+
var _useState0 = useState(''),
|
|
32995
|
+
emojisPopupPosition = _useState0[0],
|
|
32996
|
+
setEmojisPopupPosition = _useState0[1];
|
|
32997
|
+
var _useState1 = useState({
|
|
32250
32998
|
left: 0,
|
|
32251
32999
|
right: 0
|
|
32252
33000
|
}),
|
|
32253
|
-
reactionsPopupHorizontalPosition =
|
|
32254
|
-
setReactionsPopupHorizontalPosition =
|
|
33001
|
+
reactionsPopupHorizontalPosition = _useState1[0],
|
|
33002
|
+
setReactionsPopupHorizontalPosition = _useState1[1];
|
|
32255
33003
|
var scrollToNewMessage = useSelector(scrollToNewMessageSelector, shallowEqual);
|
|
32256
33004
|
var messageItemRef = useRef();
|
|
32257
33005
|
var isVisible = useOnScreen(messageItemRef);
|
|
@@ -32287,6 +33035,10 @@ var Message$1 = function Message(_ref) {
|
|
|
32287
33035
|
setMessageActionsShow(false);
|
|
32288
33036
|
stopScrolling(!forwardPopupOpen);
|
|
32289
33037
|
};
|
|
33038
|
+
var handleToggleInfoMessagePopupOpen = function handleToggleInfoMessagePopupOpen() {
|
|
33039
|
+
setInfoPopupOpen(!infoPopupOpen);
|
|
33040
|
+
setMessageActionsShow(false);
|
|
33041
|
+
};
|
|
32290
33042
|
var handleReplyMessage = function handleReplyMessage(threadReply) {
|
|
32291
33043
|
if (threadReply) ; else {
|
|
32292
33044
|
dispatch(setMessageForReplyAC(message));
|
|
@@ -32544,6 +33296,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32544
33296
|
emojisPopupPosition: emojisPopupPosition,
|
|
32545
33297
|
handleSetMessageForEdit: toggleEditMode,
|
|
32546
33298
|
handleResendMessage: handleResendMessage,
|
|
33299
|
+
handleOpenInfoMessage: handleToggleInfoMessagePopupOpen,
|
|
32547
33300
|
handleOpenDeleteMessage: handleToggleDeleteMessagePopup,
|
|
32548
33301
|
handleOpenForwardMessage: handleToggleForwardMessagePopup,
|
|
32549
33302
|
handleCopyMessage: handleCopyMessage,
|
|
@@ -32596,6 +33349,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32596
33349
|
replyMessageInThread: replyMessageInThread,
|
|
32597
33350
|
deleteMessage: deleteMessage,
|
|
32598
33351
|
selectMessage: selectMessage,
|
|
33352
|
+
showInfoMessage: showInfoMessage,
|
|
32599
33353
|
allowEditDeleteIncomingMessage: allowEditDeleteIncomingMessage,
|
|
32600
33354
|
forwardMessage: forwardMessage,
|
|
32601
33355
|
reportMessage: reportMessage,
|
|
@@ -32620,6 +33374,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32620
33374
|
selectIconOrder: selectIconOrder,
|
|
32621
33375
|
starIconOrder: starIconOrder,
|
|
32622
33376
|
reportIconOrder: reportIconOrder,
|
|
33377
|
+
infoIconOrder: infoIconOrder,
|
|
32623
33378
|
reactionIconTooltipText: reactionIconTooltipText,
|
|
32624
33379
|
editIconTooltipText: editIconTooltipText,
|
|
32625
33380
|
copyIconTooltipText: copyIconTooltipText,
|
|
@@ -32630,6 +33385,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32630
33385
|
selectIconTooltipText: selectIconTooltipText,
|
|
32631
33386
|
starIconTooltipText: starIconTooltipText,
|
|
32632
33387
|
reportIconTooltipText: reportIconTooltipText,
|
|
33388
|
+
infoIconTooltipText: infoIconTooltipText,
|
|
32633
33389
|
messageActionIconsColor: messageActionIconsColor,
|
|
32634
33390
|
messageStatusSize: messageStatusSize,
|
|
32635
33391
|
messageStatusColor: messageStatusColor,
|
|
@@ -32663,6 +33419,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32663
33419
|
setMessageActionsShow: setMessageActionsShow,
|
|
32664
33420
|
closeMessageActions: closeMessageActions,
|
|
32665
33421
|
handleToggleForwardMessagePopup: handleToggleForwardMessagePopup,
|
|
33422
|
+
handleToggleInfoMessagePopupOpen: handleToggleInfoMessagePopupOpen,
|
|
32666
33423
|
handleReplyMessage: handleReplyMessage,
|
|
32667
33424
|
handleToggleDeleteMessagePopup: handleToggleDeleteMessagePopup,
|
|
32668
33425
|
handleToggleReportPopupOpen: handleToggleReportPopupOpen,
|
|
@@ -32716,7 +33473,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32716
33473
|
handleAddDeleteEmoji: handleReactionAddDelete,
|
|
32717
33474
|
reactionsDetailsPopupBorderRadius: reactionsDetailsPopupBorderRadius,
|
|
32718
33475
|
reactionsDetailsPopupHeaderItemsStyle: reactionsDetailsPopupHeaderItemsStyle
|
|
32719
|
-
})),
|
|
33476
|
+
})), /*#__PURE__*/React__default.createElement(ReactionsContainer, {
|
|
32720
33477
|
id: message.id + "_reactions_container",
|
|
32721
33478
|
border: reactionsContainerBorder,
|
|
32722
33479
|
boxShadow: reactionsContainerBoxShadow,
|
|
@@ -32724,8 +33481,9 @@ var Message$1 = function Message(_ref) {
|
|
|
32724
33481
|
topPosition: reactionsContainerTopPosition,
|
|
32725
33482
|
padding: reactionsContainerPadding,
|
|
32726
33483
|
backgroundColor: reactionsContainerBackground || backgroundSections,
|
|
32727
|
-
rtlDirection: ownMessageOnRightSide && !message.incoming
|
|
32728
|
-
|
|
33484
|
+
rtlDirection: ownMessageOnRightSide && !message.incoming,
|
|
33485
|
+
isReacted: message.reactionTotals && message.reactionTotals.length > 0
|
|
33486
|
+
}, message.reactionTotals && message.reactionTotals.length && (/*#__PURE__*/React__default.createElement(MessageReactionsCont, {
|
|
32729
33487
|
rtlDirection: ownMessageOnRightSide && !message.incoming,
|
|
32730
33488
|
onClick: handleToggleReactionsPopup
|
|
32731
33489
|
}, message.reactionTotals.slice(0, reactionsDisplayCount || 5).map(function (summery) {
|
|
@@ -32769,16 +33527,22 @@ var Message$1 = function Message(_ref) {
|
|
|
32769
33527
|
togglePopup: handleToggleForwardMessagePopup,
|
|
32770
33528
|
buttonText: 'Forward',
|
|
32771
33529
|
title: 'Forward message'
|
|
32772
|
-
}))
|
|
33530
|
+
})), infoPopupOpen && (/*#__PURE__*/React__default.createElement(MessageInfo, Object.assign({
|
|
33531
|
+
message: message,
|
|
33532
|
+
togglePopup: handleToggleInfoMessagePopupOpen
|
|
33533
|
+
}, showInfoMessageProps, {
|
|
33534
|
+
contacts: contactsMap,
|
|
33535
|
+
handleOpenUserProfile: handleOpenUserProfile
|
|
33536
|
+
}))));
|
|
32773
33537
|
};
|
|
32774
33538
|
var Message$2 = /*#__PURE__*/React__default.memo(Message$1, function (prevProps, nextProps) {
|
|
32775
33539
|
return prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.state === nextProps.message.state && prevProps.message.userReactions === nextProps.message.userReactions && prevProps.message.body === nextProps.message.body && prevProps.message.reactionTotals === nextProps.message.reactionTotals && prevProps.message.attachments === nextProps.message.attachments && prevProps.message.metadata === nextProps.message.metadata && prevProps.message.userMarkers === nextProps.message.userMarkers && prevProps.prevMessage === nextProps.prevMessage && prevProps.nextMessage === nextProps.nextMessage && prevProps.selectedMessagesMap === nextProps.selectedMessagesMap && prevProps.contactsMap === nextProps.contactsMap && prevProps.connectionStatus === nextProps.connectionStatus && prevProps.openedMessageMenuId === nextProps.openedMessageMenuId && prevProps.theme === nextProps.theme;
|
|
32776
33540
|
});
|
|
32777
|
-
var MessageReactionKey = styled.span(_templateObject$
|
|
32778
|
-
var ReactionItemCount = styled.span(_templateObject2$
|
|
33541
|
+
var MessageReactionKey = styled.span(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n font-family:\n apple color emoji,\n segoe ui emoji,\n noto color emoji,\n android emoji,\n emojisymbols,\n emojione mozilla,\n twemoji mozilla,\n segoe ui symbol;\n"])));
|
|
33542
|
+
var ReactionItemCount = styled.span(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n margin-left: 2px;\n font-family: Inter, sans-serif;\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n"])), function (props) {
|
|
32779
33543
|
return props.color;
|
|
32780
33544
|
});
|
|
32781
|
-
var MessageReaction = styled.span(_templateObject3$
|
|
33545
|
+
var MessageReaction = styled.span(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n //min-width: 23px;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin: ", ";\n margin-right: ", ";\n border: ", ";\n color: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n font-size: ", ";\n line-height: ", ";\n padding: ", ";\n background-color: ", ";\n white-space: nowrap;\n\n &:last-child {\n margin-right: 0;\n }\n"])), function (props) {
|
|
32782
33546
|
return props.margin || '0 8px 0 0';
|
|
32783
33547
|
}, function (props) {
|
|
32784
33548
|
return props.isLastReaction && '0';
|
|
@@ -32797,26 +33561,26 @@ var MessageReaction = styled.span(_templateObject3$r || (_templateObject3$r = _t
|
|
|
32797
33561
|
}, function (props) {
|
|
32798
33562
|
return props.backgroundColor;
|
|
32799
33563
|
});
|
|
32800
|
-
var ThreadMessageCountContainer = styled.div(_templateObject4$
|
|
33564
|
+
var ThreadMessageCountContainer = styled.div(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n position: relative;\n color: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 15px;\n margin: 12px;\n cursor: pointer;\n\n &::before {\n content: '';\n position: absolute;\n left: -25px;\n top: -21px;\n width: 16px;\n height: 26px;\n border-left: 2px solid #cdcdcf;\n border-bottom: 2px solid #cdcdcf;\n border-radius: 0 0 0 14px;\n }\n"])), function (props) {
|
|
32801
33565
|
return props.color;
|
|
32802
33566
|
});
|
|
32803
|
-
var FailedMessageIcon = styled.div(_templateObject5$
|
|
33567
|
+
var FailedMessageIcon = styled.div(_templateObject5$k || (_templateObject5$k = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: -6px;\n left: ", ";\n right: ", ";\n width: 20px;\n height: 20px;\n"])), function (props) {
|
|
32804
33568
|
return !props.rtl && '-24px';
|
|
32805
33569
|
}, function (props) {
|
|
32806
33570
|
return props.rtl && '-24px';
|
|
32807
33571
|
});
|
|
32808
|
-
var ErrorIconWrapper = styled(SvgErrorIcon)(_templateObject6$
|
|
32809
|
-
var SelectMessageWrapper = styled.div(_templateObject7$
|
|
33572
|
+
var ErrorIconWrapper = styled(SvgErrorIcon)(_templateObject6$h || (_templateObject6$h = _taggedTemplateLiteralLoose(["\n width: 20px;\n height: 20px;\n"])));
|
|
33573
|
+
var SelectMessageWrapper = styled.div(_templateObject7$f || (_templateObject7$f = _taggedTemplateLiteralLoose(["\n display: flex;\n padding: 10px;\n position: absolute;\n left: 4%;\n bottom: calc(50% - 22px);\n cursor: ", ";\n & > svg {\n color: ", ";\n width: 24px;\n height: 24px;\n }\n"])), function (props) {
|
|
32810
33574
|
return !props.disabled && 'pointer';
|
|
32811
33575
|
}, function (props) {
|
|
32812
33576
|
return props.activeColor;
|
|
32813
33577
|
});
|
|
32814
|
-
var EmptySelection = styled.span(_templateObject8$
|
|
33578
|
+
var EmptySelection = styled.span(_templateObject8$e || (_templateObject8$e = _taggedTemplateLiteralLoose(["\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 1.5px solid ", ";\n box-sizing: border-box;\n border-radius: 50%;\n transform: scale(0.92);\n opacity: ", ";\n"])), function (props) {
|
|
32815
33579
|
return props.borderColor;
|
|
32816
33580
|
}, function (props) {
|
|
32817
33581
|
return props.disabled && '0.5';
|
|
32818
33582
|
});
|
|
32819
|
-
var ReactionsContainer = styled.div(_templateObject9$
|
|
33583
|
+
var ReactionsContainer = styled.div(_templateObject9$c || (_templateObject9$c = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n margin-left: ", ";\n margin-right: ", ";\n\n margin-top: 4px;\n justify-content: flex-end;\n border: ", ";\n box-shadow: ", ";\n filter: drop-shadow(0px 0px 2px rgba(17, 21, 57, 0.08));\n border-radius: ", ";\n background-color: ", ";\n padding: ", ";\n z-index: 9;\n ", ";\n overflow: hidden;\n height: ", ";\n transition: all 0.3s;\n"])), function (props) {
|
|
32820
33584
|
return props.rtlDirection && 'auto';
|
|
32821
33585
|
}, function (props) {
|
|
32822
33586
|
return !props.rtlDirection && 'auto';
|
|
@@ -32829,14 +33593,16 @@ var ReactionsContainer = styled.div(_templateObject9$b || (_templateObject9$b =
|
|
|
32829
33593
|
}, function (props) {
|
|
32830
33594
|
return props.backgroundColor;
|
|
32831
33595
|
}, function (props) {
|
|
32832
|
-
return props.padding || '4px 8px';
|
|
33596
|
+
return !props.isReacted ? '0' : props.padding || '4px 8px';
|
|
32833
33597
|
}, function (props) {
|
|
32834
33598
|
return props.topPosition && "\n position: relative;\n top: " + props.topPosition + ";\n ";
|
|
33599
|
+
}, function (props) {
|
|
33600
|
+
return props.isReacted ? '16px' : '0';
|
|
32835
33601
|
});
|
|
32836
|
-
var MessageReactionsCont = styled.div(_templateObject0$
|
|
33602
|
+
var MessageReactionsCont = styled.div(_templateObject0$b || (_templateObject0$b = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n max-width: 300px;\n direction: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
32837
33603
|
return props.rtlDirection && 'ltr';
|
|
32838
33604
|
});
|
|
32839
|
-
var MessageStatus$1 = styled.span(_templateObject1$
|
|
33605
|
+
var MessageStatus$1 = styled.span(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
|
|
32840
33606
|
return props.height || '14px';
|
|
32841
33607
|
});
|
|
32842
33608
|
var HiddenMessageTime$1 = styled.span(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n display: ", ";\n font-weight: 400;\n font-size: ", ";\n color: ", ";\n"])), function (props) {
|
|
@@ -32881,7 +33647,7 @@ var HiddenMessageProperty;
|
|
|
32881
33647
|
HiddenMessageProperty["hideAfterSendMessage"] = "hideAfterSendMessage";
|
|
32882
33648
|
})(HiddenMessageProperty || (HiddenMessageProperty = {}));
|
|
32883
33649
|
|
|
32884
|
-
var _templateObject$
|
|
33650
|
+
var _templateObject$E, _templateObject2$z, _templateObject3$t, _templateObject4$p, _templateObject5$l, _templateObject6$i, _templateObject7$g, _templateObject8$f, _templateObject9$d, _templateObject0$c, _templateObject1$9;
|
|
32885
33651
|
var CreateMessageDateDivider = function CreateMessageDateDivider(_ref) {
|
|
32886
33652
|
var lastIndex = _ref.lastIndex,
|
|
32887
33653
|
currentMessageDate = _ref.currentMessageDate,
|
|
@@ -32958,6 +33724,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
32958
33724
|
forwardMessage = _ref2.forwardMessage,
|
|
32959
33725
|
deleteMessage = _ref2.deleteMessage,
|
|
32960
33726
|
selectMessage = _ref2.selectMessage,
|
|
33727
|
+
showInfoMessage = _ref2.showInfoMessage,
|
|
32961
33728
|
reportMessage = _ref2.reportMessage,
|
|
32962
33729
|
reactionIcon = _ref2.reactionIcon,
|
|
32963
33730
|
editIcon = _ref2.editIcon,
|
|
@@ -33004,6 +33771,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33004
33771
|
selectIconOrder = _ref2.selectIconOrder,
|
|
33005
33772
|
starIconOrder = _ref2.starIconOrder,
|
|
33006
33773
|
reportIconOrder = _ref2.reportIconOrder,
|
|
33774
|
+
infoIconOrder = _ref2.infoIconOrder,
|
|
33007
33775
|
reactionIconTooltipText = _ref2.reactionIconTooltipText,
|
|
33008
33776
|
editIconTooltipText = _ref2.editIconTooltipText,
|
|
33009
33777
|
copyIconTooltipText = _ref2.copyIconTooltipText,
|
|
@@ -33011,6 +33779,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33011
33779
|
replyInThreadIconTooltipText = _ref2.replyInThreadIconTooltipText,
|
|
33012
33780
|
forwardIconTooltipText = _ref2.forwardIconTooltipText,
|
|
33013
33781
|
deleteIconTooltipText = _ref2.deleteIconTooltipText,
|
|
33782
|
+
infoIconTooltipText = _ref2.infoIconTooltipText,
|
|
33014
33783
|
selectIconTooltipText = _ref2.selectIconTooltipText,
|
|
33015
33784
|
starIconTooltipText = _ref2.starIconTooltipText,
|
|
33016
33785
|
reportIconTooltipText = _ref2.reportIconTooltipText,
|
|
@@ -33063,7 +33832,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33063
33832
|
messageTimeColor = _ref2.messageTimeColor,
|
|
33064
33833
|
messageStatusAndTimeLineHeight = _ref2.messageStatusAndTimeLineHeight,
|
|
33065
33834
|
hiddenMessagesProperties = _ref2.hiddenMessagesProperties,
|
|
33066
|
-
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention
|
|
33835
|
+
shouldOpenUserProfileForMention = _ref2.shouldOpenUserProfileForMention,
|
|
33836
|
+
_ref2$showInfoMessage = _ref2.showInfoMessageProps,
|
|
33837
|
+
showInfoMessageProps = _ref2$showInfoMessage === void 0 ? {} : _ref2$showInfoMessage;
|
|
33067
33838
|
var _useColor = useColors(),
|
|
33068
33839
|
outgoingMessageBackground = _useColor[THEME_COLORS.OUTGOING_MESSAGE_BACKGROUND],
|
|
33069
33840
|
themeBackgroundColor = _useColor[THEME_COLORS.BACKGROUND],
|
|
@@ -33153,7 +33924,14 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33153
33924
|
var text = '';
|
|
33154
33925
|
for (var i = dateLabels.length - 1; i >= 0; i--) {
|
|
33155
33926
|
var dateLabel = dateLabels[i];
|
|
33156
|
-
|
|
33927
|
+
var aroundThreshold = 40;
|
|
33928
|
+
var labelTop = dateLabel.offsetTop - 28;
|
|
33929
|
+
var labelBottom = labelTop + (dateLabel.offsetHeight || 0) - 28;
|
|
33930
|
+
if (container.scrollTop >= labelTop - aroundThreshold && container.scrollTop <= labelBottom + aroundThreshold) {
|
|
33931
|
+
setShowTopDate(false);
|
|
33932
|
+
break;
|
|
33933
|
+
}
|
|
33934
|
+
if (!text && container.scrollTop > labelTop - 28) {
|
|
33157
33935
|
var span = (dateLabel === null || dateLabel === void 0 ? void 0 : dateLabel.firstChild) && dateLabel.firstChild.firstChild;
|
|
33158
33936
|
text = span ? span.innerText || '' : '';
|
|
33159
33937
|
setTopDateLabel(text);
|
|
@@ -33175,9 +33953,6 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33175
33953
|
}
|
|
33176
33954
|
setShowTopDate(true);
|
|
33177
33955
|
clearTimeout(hideTopDateTimeout.current);
|
|
33178
|
-
hideTopDateTimeout.current = setTimeout(function () {
|
|
33179
|
-
setShowTopDate(false);
|
|
33180
|
-
}, 1000);
|
|
33181
33956
|
renderTopDate();
|
|
33182
33957
|
var forceLoadPrevMessages = false;
|
|
33183
33958
|
if (-target.scrollTop + target.offsetHeight + 30 > target.scrollHeight) {
|
|
@@ -33802,6 +34577,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33802
34577
|
replyMessageInThread: replyMessageInThread,
|
|
33803
34578
|
deleteMessage: deleteMessage,
|
|
33804
34579
|
selectMessage: selectMessage,
|
|
34580
|
+
showInfoMessage: showInfoMessage,
|
|
33805
34581
|
allowEditDeleteIncomingMessage: allowEditDeleteIncomingMessage,
|
|
33806
34582
|
reportMessage: reportMessage,
|
|
33807
34583
|
reactionIcon: reactionIcon,
|
|
@@ -33827,6 +34603,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33827
34603
|
replyInThreadIconOrder: replyInThreadIconOrder,
|
|
33828
34604
|
forwardIconOrder: forwardIconOrder,
|
|
33829
34605
|
deleteIconOrder: deleteIconOrder,
|
|
34606
|
+
infoIconOrder: infoIconOrder,
|
|
33830
34607
|
selectIconOrder: selectIconOrder,
|
|
33831
34608
|
starIconOrder: starIconOrder,
|
|
33832
34609
|
reportIconOrder: reportIconOrder,
|
|
@@ -33837,6 +34614,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33837
34614
|
replyInThreadIconTooltipText: replyInThreadIconTooltipText,
|
|
33838
34615
|
forwardIconTooltipText: forwardIconTooltipText,
|
|
33839
34616
|
deleteIconTooltipText: deleteIconTooltipText,
|
|
34617
|
+
infoIconTooltipText: infoIconTooltipText,
|
|
33840
34618
|
selectIconTooltipText: selectIconTooltipText,
|
|
33841
34619
|
starIconTooltipText: starIconTooltipText,
|
|
33842
34620
|
reportIconTooltipText: reportIconTooltipText,
|
|
@@ -33886,7 +34664,8 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33886
34664
|
messageTimeFontSize: messageTimeFontSize,
|
|
33887
34665
|
messageTimeColor: messageTimeColor,
|
|
33888
34666
|
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
33889
|
-
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
34667
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention,
|
|
34668
|
+
showInfoMessageProps: showInfoMessageProps
|
|
33890
34669
|
}))), isUnreadMessage ? (/*#__PURE__*/React__default.createElement(MessageDivider, {
|
|
33891
34670
|
theme: theme,
|
|
33892
34671
|
newMessagesSeparatorTextColor: newMessagesSeparatorTextColor,
|
|
@@ -33916,14 +34695,14 @@ var MessageList = function MessageList(_ref2) {
|
|
|
33916
34695
|
attachmentsPreview: attachmentsPreview
|
|
33917
34696
|
})))));
|
|
33918
34697
|
};
|
|
33919
|
-
var Container$h = styled.div(_templateObject$
|
|
34698
|
+
var Container$h = styled.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column-reverse;\n flex-grow: 1;\n position: relative;\n overflow: auto;\n scroll-behavior: smooth;\n will-change: left, top;\n background-color: ", ";\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
33920
34699
|
return props.backgroundColor;
|
|
33921
34700
|
}, function (props) {
|
|
33922
34701
|
return props.thumbColor;
|
|
33923
34702
|
});
|
|
33924
|
-
var EmptyDiv = styled.div(_templateObject2$
|
|
33925
|
-
var MessagesBox = styled.div(_templateObject3$
|
|
33926
|
-
var MessageTopDate = styled.div(_templateObject4$
|
|
34703
|
+
var EmptyDiv = styled.div(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n height: 300px;\n"])));
|
|
34704
|
+
var MessagesBox = styled.div(_templateObject3$t || (_templateObject3$t = _taggedTemplateLiteralLoose(["\n //height: auto;\n display: flex;\n //flex-direction: column-reverse;\n flex-direction: column;\n padding-bottom: 20px;\n //overflow: auto;\n //scroll-behavior: unset;\n"])));
|
|
34705
|
+
var MessageTopDate = styled.div(_templateObject4$p || (_templateObject4$p = _taggedTemplateLiteralLoose(["\n position: absolute;\n justify-content: center;\n width: 100%;\n top: ", ";\n left: 0;\n margin-top: ", ";\n margin-bottom: ", ";\n text-align: center;\n z-index: 10;\n background: transparent;\n opacity: ", ";\n transition: all 0.2s ease-in-out;\n width: calc(100% - 8px);\n\n span {\n display: inline-block;\n max-width: 380px;\n font-style: normal;\n font-weight: normal;\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n border: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n padding: 5px 16px;\n box-shadow:\n 0 0 2px rgba(0, 0, 0, 0.08),\n 0 2px 24px rgba(0, 0, 0, 0.08);\n text-overflow: ellipsis;\n overflow: hidden;\n }\n"])), function (props) {
|
|
33927
34706
|
return props.topOffset ? props.topOffset + 22 + "px" : '22px';
|
|
33928
34707
|
}, function (props) {
|
|
33929
34708
|
return props.marginTop;
|
|
@@ -33942,19 +34721,19 @@ var MessageTopDate = styled.div(_templateObject4$o || (_templateObject4$o = _tag
|
|
|
33942
34721
|
}, function (props) {
|
|
33943
34722
|
return props.dateDividerBorderRadius || '14px';
|
|
33944
34723
|
});
|
|
33945
|
-
var DragAndDropContainer = styled.div(_templateObject5$
|
|
34724
|
+
var DragAndDropContainer = styled.div(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n margin-bottom: -31px;\n margin-top: -2px;\n\n position: absolute;\n left: 0;\n top: ", ";\n width: 100%;\n height: ", ";\n background-color: ", ";\n z-index: 999;\n"])), function (props) {
|
|
33946
34725
|
return props.topOffset ? props.topOffset + 2 + "px" : 0;
|
|
33947
34726
|
}, function (props) {
|
|
33948
34727
|
return props.height ? props.height + 30 + "px" : '100%';
|
|
33949
34728
|
}, function (props) {
|
|
33950
34729
|
return props.backgroundColor;
|
|
33951
34730
|
});
|
|
33952
|
-
var IconWrapper$1 = styled.span(_templateObject6$
|
|
34731
|
+
var IconWrapper$1 = styled.span(_templateObject6$i || (_templateObject6$i = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 64px;\n width: 64px;\n background-color: ", ";\n border-radius: 50%;\n text-align: center;\n margin-bottom: 16px;\n transition: all 0.3s;\n pointer-events: none;\n\n & > svg {\n color: ", ";\n width: 32px;\n height: 32px;\n }\n"])), function (props) {
|
|
33953
34732
|
return props.backgroundColor;
|
|
33954
34733
|
}, function (props) {
|
|
33955
34734
|
return props.iconColor;
|
|
33956
34735
|
});
|
|
33957
|
-
var DropAttachmentArea = styled.div(_templateObject7$
|
|
34736
|
+
var DropAttachmentArea = styled.div(_templateObject7$g || (_templateObject7$g = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n border: 1px dashed ", ";\n border-radius: 16px;\n margin: ", ";\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n color: ", ";\n transition: all 0.1s;\n\n &.dragover {\n background-color: ", ";\n border: 1px dashed ", ";\n\n ", " {\n background-color: ", ";\n }\n }\n"])), function (props) {
|
|
33958
34737
|
return props.borderColor;
|
|
33959
34738
|
}, function (props) {
|
|
33960
34739
|
return props.margin || '12px 32px 32px';
|
|
@@ -33967,16 +34746,16 @@ var DropAttachmentArea = styled.div(_templateObject7$f || (_templateObject7$f =
|
|
|
33967
34746
|
}, IconWrapper$1, function (props) {
|
|
33968
34747
|
return props.iconBackgroundColor;
|
|
33969
34748
|
});
|
|
33970
|
-
var MessageWrapper = styled.div(_templateObject8$
|
|
34749
|
+
var MessageWrapper = styled.div(_templateObject8$f || (_templateObject8$f = _taggedTemplateLiteralLoose(["\n &.highlight {\n & .message_item {\n transition: all 0.2s ease-in-out;\n padding-top: 4px;\n padding-bottom: 4px;\n background-color: ", ";\n }\n }\n\n & .message_item {\n transition: all 0.2s ease-in-out;\n }\n"])), function (props) {
|
|
33971
34750
|
return props.highlightBg || '#d5d5d5';
|
|
33972
34751
|
});
|
|
33973
|
-
var NoMessagesContainer = styled.div(_templateObject9$
|
|
34752
|
+
var NoMessagesContainer = styled.div(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n height: 100%;\n width: 100%;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n color: ", ";\n"])), function (props) {
|
|
33974
34753
|
return props.color;
|
|
33975
34754
|
});
|
|
33976
|
-
var NoMessagesTitle = styled.h4(_templateObject0$
|
|
34755
|
+
var NoMessagesTitle = styled.h4(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n margin: 12px 0 8px;\n font-family: Inter, sans-serif;\n text-align: center;\n font-size: 20px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: ", ";\n"])), function (props) {
|
|
33977
34756
|
return props.color;
|
|
33978
34757
|
});
|
|
33979
|
-
var NoMessagesText = styled.p(_templateObject1$
|
|
34758
|
+
var NoMessagesText = styled.p(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
|
|
33980
34759
|
return props.color;
|
|
33981
34760
|
});
|
|
33982
34761
|
|
|
@@ -34016,6 +34795,7 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34016
34795
|
forwardMessage = _ref.forwardMessage,
|
|
34017
34796
|
deleteMessage = _ref.deleteMessage,
|
|
34018
34797
|
selectMessage = _ref.selectMessage,
|
|
34798
|
+
showInfoMessage = _ref.showInfoMessage,
|
|
34019
34799
|
reportMessage = _ref.reportMessage,
|
|
34020
34800
|
reactionIcon = _ref.reactionIcon,
|
|
34021
34801
|
editIcon = _ref.editIcon,
|
|
@@ -34062,6 +34842,7 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34062
34842
|
selectIconOrder = _ref.selectIconOrder,
|
|
34063
34843
|
starIconOrder = _ref.starIconOrder,
|
|
34064
34844
|
reportIconOrder = _ref.reportIconOrder,
|
|
34845
|
+
infoIconOrder = _ref.infoIconOrder,
|
|
34065
34846
|
reactionIconTooltipText = _ref.reactionIconTooltipText,
|
|
34066
34847
|
editIconTooltipText = _ref.editIconTooltipText,
|
|
34067
34848
|
copyIconTooltipText = _ref.copyIconTooltipText,
|
|
@@ -34072,6 +34853,7 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34072
34853
|
selectIconTooltipText = _ref.selectIconTooltipText,
|
|
34073
34854
|
starIconTooltipText = _ref.starIconTooltipText,
|
|
34074
34855
|
reportIconTooltipText = _ref.reportIconTooltipText,
|
|
34856
|
+
infoIconTooltipText = _ref.infoIconTooltipText,
|
|
34075
34857
|
messageActionIconsColor = _ref.messageActionIconsColor,
|
|
34076
34858
|
dateDividerFontSize = _ref.dateDividerFontSize,
|
|
34077
34859
|
dateDividerTextColor = _ref.dateDividerTextColor,
|
|
@@ -34122,7 +34904,9 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34122
34904
|
messageStatusAndTimeLineHeight = _ref.messageStatusAndTimeLineHeight,
|
|
34123
34905
|
_ref$hiddenMessagesPr = _ref.hiddenMessagesProperties,
|
|
34124
34906
|
hiddenMessagesProperties = _ref$hiddenMessagesPr === void 0 ? [] : _ref$hiddenMessagesPr,
|
|
34125
|
-
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention
|
|
34907
|
+
shouldOpenUserProfileForMention = _ref.shouldOpenUserProfileForMention,
|
|
34908
|
+
_ref$showInfoMessageP = _ref.showInfoMessageProps,
|
|
34909
|
+
showInfoMessageProps = _ref$showInfoMessageP === void 0 ? {} : _ref$showInfoMessageP;
|
|
34126
34910
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MessageList, {
|
|
34127
34911
|
fontFamily: fontFamily,
|
|
34128
34912
|
ownMessageOnRightSide: ownMessageOnRightSide,
|
|
@@ -34153,6 +34937,7 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34153
34937
|
forwardMessage: forwardMessage,
|
|
34154
34938
|
deleteMessage: deleteMessage,
|
|
34155
34939
|
selectMessage: selectMessage,
|
|
34940
|
+
showInfoMessage: showInfoMessage,
|
|
34156
34941
|
reportMessage: reportMessage,
|
|
34157
34942
|
reactionIcon: reactionIcon,
|
|
34158
34943
|
editIcon: editIcon,
|
|
@@ -34195,6 +34980,7 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34195
34980
|
forwardIconOrder: forwardIconOrder,
|
|
34196
34981
|
deleteIconOrder: deleteIconOrder,
|
|
34197
34982
|
selectIconOrder: selectIconOrder,
|
|
34983
|
+
infoIconOrder: infoIconOrder,
|
|
34198
34984
|
starIconOrder: starIconOrder,
|
|
34199
34985
|
reportIconOrder: reportIconOrder,
|
|
34200
34986
|
reactionIconTooltipText: reactionIconTooltipText,
|
|
@@ -34207,6 +34993,7 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34207
34993
|
selectIconTooltipText: selectIconTooltipText,
|
|
34208
34994
|
starIconTooltipText: starIconTooltipText,
|
|
34209
34995
|
reportIconTooltipText: reportIconTooltipText,
|
|
34996
|
+
infoIconTooltipText: infoIconTooltipText,
|
|
34210
34997
|
messageActionIconsColor: messageActionIconsColor,
|
|
34211
34998
|
dateDividerFontSize: dateDividerFontSize,
|
|
34212
34999
|
dateDividerTextColor: dateDividerTextColor,
|
|
@@ -34249,7 +35036,8 @@ var MessagesContainer = function MessagesContainer(_ref) {
|
|
|
34249
35036
|
messageTimeColor: messageTimeColor,
|
|
34250
35037
|
messageStatusAndTimeLineHeight: messageStatusAndTimeLineHeight,
|
|
34251
35038
|
hiddenMessagesProperties: hiddenMessagesProperties,
|
|
34252
|
-
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention
|
|
35039
|
+
shouldOpenUserProfileForMention: shouldOpenUserProfileForMention,
|
|
35040
|
+
showInfoMessageProps: showInfoMessageProps
|
|
34253
35041
|
}));
|
|
34254
35042
|
};
|
|
34255
35043
|
|
|
@@ -34361,7 +35149,7 @@ function $isMentionNode(node) {
|
|
|
34361
35149
|
return node instanceof MentionNode;
|
|
34362
35150
|
}
|
|
34363
35151
|
|
|
34364
|
-
var _templateObject$
|
|
35152
|
+
var _templateObject$F, _templateObject2$A, _templateObject3$u, _templateObject4$q, _templateObject5$m;
|
|
34365
35153
|
var PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;';
|
|
34366
35154
|
var NAME = '\\b[A-Z][^\\s' + PUNCTUATION + ']';
|
|
34367
35155
|
var DocumentMentionsRegex = {
|
|
@@ -34641,8 +35429,8 @@ function MentionsPlugin(_ref3) {
|
|
|
34641
35429
|
}
|
|
34642
35430
|
});
|
|
34643
35431
|
}
|
|
34644
|
-
var MentionsContainerWrapper = styled.div(_templateObject$
|
|
34645
|
-
var MentionsList = styled.ul(_templateObject2$
|
|
35432
|
+
var MentionsContainerWrapper = styled.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose(["\n position: relative;\n animation: fadeIn 0.2s ease-in-out;\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n"])));
|
|
35433
|
+
var MentionsList = styled.ul(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 100%;\n width: 300px;\n transition: all 0.2s;\n overflow: auto;\n max-height: 240px;\n z-index: 200;\n padding: 2px 0 0;\n background: ", ";\n border: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: 6px;\n visibility: ", ";\n"])), function (props) {
|
|
34646
35434
|
return props.backgroundColor;
|
|
34647
35435
|
}, function (props) {
|
|
34648
35436
|
return props.withBorder && "1px solid " + props.borderColor;
|
|
@@ -34651,11 +35439,11 @@ var MentionsList = styled.ul(_templateObject2$z || (_templateObject2$z = _tagged
|
|
|
34651
35439
|
}, function (props) {
|
|
34652
35440
|
return props.hidden ? 'hidden' : 'visible';
|
|
34653
35441
|
});
|
|
34654
|
-
var MemberItem = styled.li(_templateObject3$
|
|
35442
|
+
var MemberItem = styled.li(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n font-size: 15px;\n padding: 6px 16px;\n transition: all 0.2s;\n cursor: pointer;\n background-color: ", ";\n\n & ", " {\n width: 10px;\n height: 10px;\n }\n"])), function (props) {
|
|
34655
35443
|
return props.isActiveItem && props.activeBackgroundColor;
|
|
34656
35444
|
}, UserStatus);
|
|
34657
|
-
var UserNamePresence$2 = styled.div(_templateObject4$
|
|
34658
|
-
var MemberName$2 = styled.h3(_templateObject5$
|
|
35445
|
+
var UserNamePresence$2 = styled.div(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n width: calc(100% - 44px);\n margin-left: 12px;\n"])));
|
|
35446
|
+
var MemberName$2 = styled.h3(_templateObject5$m || (_templateObject5$m = _taggedTemplateLiteralLoose(["\n margin: 0;\n max-width: calc(100% - 1px);\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n color: ", ";\n"])), function (props) {
|
|
34659
35447
|
return props.color;
|
|
34660
35448
|
});
|
|
34661
35449
|
|
|
@@ -34788,7 +35576,7 @@ function SvgUnderline(props) {
|
|
|
34788
35576
|
}))));
|
|
34789
35577
|
}
|
|
34790
35578
|
|
|
34791
|
-
var _templateObject$
|
|
35579
|
+
var _templateObject$G, _templateObject2$B;
|
|
34792
35580
|
function mergeRegister() {
|
|
34793
35581
|
for (var _len = arguments.length, func = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34794
35582
|
func[_key] = arguments[_key];
|
|
@@ -35169,10 +35957,10 @@ function FloatingTextFormatToolbarPlugin(_ref3) {
|
|
|
35169
35957
|
editor = _useLexicalComposerCo[0];
|
|
35170
35958
|
return useFloatingTextFormatToolbar(editor, anchorElem);
|
|
35171
35959
|
}
|
|
35172
|
-
var FloatingTextFormatPopup = styled.div(_templateObject$
|
|
35960
|
+
var FloatingTextFormatPopup = styled.div(_templateObject$G || (_templateObject$G = _taggedTemplateLiteralLoose(["\n display: flex;\n background: ", ";\n vertical-align: middle;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);\n border-radius: 8px;\n transition: opacity 0.5s;\n padding: 12px;\n will-change: transform;\n z-index: 99;\n\n & button.popup-item {\n border: 0;\n display: flex;\n background: none;\n border-radius: 10px;\n padding: 8px;\n cursor: pointer;\n vertical-align: middle;\n }\n & button.popup-item:disabled {\n cursor: not-allowed;\n }\n & button.popup-item.spaced {\n margin-right: 2px;\n }\n & button.popup-item i.format {\n background-size: contain;\n height: 18px;\n width: 18px;\n margin-top: 2px;\n vertical-align: -0.25em;\n display: flex;\n opacity: 0.6;\n }\n\n & button.popup-item:disabled i.format {\n opacity: 0.2;\n }\n & button.popup-item.active {\n background-color: rgba(223, 232, 250, 0.3);\n }\n & button.popup-item.active i {\n opacity: 1;\n }\n & .popup-item:hover:not([disabled]) {\n background-color: #eee;\n }\n & select.popup-item {\n border: 0;\n display: flex;\n background: none;\n border-radius: 10px;\n padding: 8px;\n vertical-align: middle;\n -webkit-appearance: none;\n -moz-appearance: none;\n width: 70px;\n font-size: 14px;\n color: #777;\n text-overflow: ellipsis;\n }\n & select.code-language {\n text-transform: capitalize;\n width: 130px;\n }\n\n & .popup-item .text {\n display: flex;\n line-height: 20px;\n vertical-align: middle;\n font-size: 14px;\n color: #777;\n text-overflow: ellipsis;\n width: 70px;\n overflow: hidden;\n height: 20px;\n text-align: left;\n }\n\n & .popup-item .icon {\n display: flex;\n width: 20px;\n height: 20px;\n user-select: none;\n margin-right: 8px;\n line-height: 16px;\n background-size: contain;\n }\n & i.chevron-down {\n margin-top: 3px;\n width: 16px;\n height: 16px;\n display: flex;\n user-select: none;\n }\n & i.chevron-down.inside {\n width: 16px;\n height: 16px;\n display: flex;\n margin-left: -25px;\n margin-top: 11px;\n margin-right: 10px;\n pointer-events: none;\n }\n & .divider {\n width: 1px;\n background-color: #eee;\n margin: 0 4px;\n }\n @media (max-width: 1024px) {\n & button.insert-comment {\n display: none;\n }\n }\n"])), function (props) {
|
|
35173
35961
|
return props.popupColor;
|
|
35174
35962
|
});
|
|
35175
|
-
var Action$1 = styled.button(_templateObject2$
|
|
35963
|
+
var Action$1 = styled.button(_templateObject2$B || (_templateObject2$B = _taggedTemplateLiteralLoose(["\n border: 0;\n display: flex;\n background-color: inherit;\n vertical-align: middle;\n position: relative;\n padding: 3px;\n margin-right: 10px;\n //margin: 8px 6px;\n cursor: pointer;\n transition: all 0.2s;\n color: ", ";\n border-radius: 50%;\n ", "\n\n &:last-child {\n margin-right: 0;\n }\n\n &:hover {\n color: ", ";\n background-color: ", ";\n\n ", " {\n display: block;\n }\n }\n"])), function (props) {
|
|
35176
35964
|
return props.iconColor;
|
|
35177
35965
|
}, function (props) {
|
|
35178
35966
|
return props.isActive && "\n color: " + props.hoverIconColor + ";\n background-color: " + props.hoverBackgroundColor + ";\n ";
|
|
@@ -35495,7 +36283,7 @@ function FormatMessagePlugin(_ref) {
|
|
|
35495
36283
|
return null;
|
|
35496
36284
|
}
|
|
35497
36285
|
|
|
35498
|
-
var _templateObject$
|
|
36286
|
+
var _templateObject$H, _templateObject2$C, _templateObject3$v, _templateObject4$r, _templateObject5$n, _templateObject6$j, _templateObject7$h, _templateObject8$g;
|
|
35499
36287
|
var EmojiIcon$1 = function EmojiIcon(_ref) {
|
|
35500
36288
|
var collectionName = _ref.collectionName;
|
|
35501
36289
|
switch (collectionName) {
|
|
@@ -35690,7 +36478,7 @@ function EmojisPopup$1(_ref2) {
|
|
|
35690
36478
|
}));
|
|
35691
36479
|
}))));
|
|
35692
36480
|
}
|
|
35693
|
-
var Container$i = styled.div(_templateObject$
|
|
36481
|
+
var Container$i = styled.div(_templateObject$H || (_templateObject$H = _taggedTemplateLiteralLoose(["\n position: ", ";\n left: ", ";\n right: ", ";\n direction: ", ";\n bottom: ", ";\n width: 306px;\n border: ", ";\n box-sizing: border-box;\n box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);\n border-radius: ", ";\n background: ", ";\n z-index: 35;\n //transform: scaleY(0);\n height: 0;\n overflow: hidden;\n transform-origin: ", ";\n transition: all 0.2s ease-in-out;\n ", ";\n"])), function (props) {
|
|
35694
36482
|
return props.leftPosition ? 'fixed' : props.relativePosition ? 'relative' : 'absolute';
|
|
35695
36483
|
}, function (props) {
|
|
35696
36484
|
return props.rightSide ? "calc(" + props.leftPosition + " - 250px)" : props.leftPosition || (props.rtlDirection ? '' : props.rightSide ? '' : '5px');
|
|
@@ -35711,23 +36499,23 @@ var Container$i = styled.div(_templateObject$G || (_templateObject$G = _taggedTe
|
|
|
35711
36499
|
}, function (props) {
|
|
35712
36500
|
return props.rendered && "\n height: 225px;\n ";
|
|
35713
36501
|
});
|
|
35714
|
-
var EmojiHeader$1 = styled.div(_templateObject2$
|
|
36502
|
+
var EmojiHeader$1 = styled.div(_templateObject2$C || (_templateObject2$C = _taggedTemplateLiteralLoose(["\n align-items: flex-end;\n font-style: normal;\n font-weight: 500;\n font-size: 12px;\n line-height: 22px;\n text-transform: uppercase;\n color: ", ";\n display: flex;\n padding: ", ";\n"])), function (props) {
|
|
35715
36503
|
return props.color;
|
|
35716
36504
|
}, function (props) {
|
|
35717
36505
|
return props.padding || '6px 18px';
|
|
35718
36506
|
});
|
|
35719
|
-
var EmojiSection$1 = styled.div(_templateObject3$
|
|
35720
|
-
var EmojiCollection$1 = styled.span(_templateObject4$
|
|
36507
|
+
var EmojiSection$1 = styled.div(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n height: 180px;\n overflow-x: hidden;\n\n & ::selection {\n color: inherit;\n background: inherit;\n }\n"])));
|
|
36508
|
+
var EmojiCollection$1 = styled.span(_templateObject4$r || (_templateObject4$r = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: flex;\n justify-content: center;\n align-items: center;\n\n & > * {\n color: ", ";\n }\n"])), function (props) {
|
|
35721
36509
|
return props.iconColor;
|
|
35722
36510
|
});
|
|
35723
|
-
var CollectionPointer$1 = styled.span(_templateObject5$
|
|
35724
|
-
var AllEmojis$1 = styled.ul(_templateObject6$
|
|
35725
|
-
var EmojiFooter$1 = styled.div(_templateObject7$
|
|
36511
|
+
var CollectionPointer$1 = styled.span(_templateObject5$n || (_templateObject5$n = _taggedTemplateLiteralLoose([""])));
|
|
36512
|
+
var AllEmojis$1 = styled.ul(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n padding: 0 8px 8px;\n margin: 0;\n"])));
|
|
36513
|
+
var EmojiFooter$1 = styled.div(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n height: 42px;\n display: flex;\n justify-content: space-around;\n align-items: center;\n border-top: ", ";\n border-bottom: ", ";\n padding: 0 10px;\n & > span {\n width: 100%;\n text-align: center;\n }\n"])), function (props) {
|
|
35726
36514
|
return props.emojisCategoryIconsPosition !== 'top' && "1px solid " + props.borderColor;
|
|
35727
36515
|
}, function (props) {
|
|
35728
36516
|
return props.emojisCategoryIconsPosition === 'top' && "1px solid " + props.borderColor;
|
|
35729
36517
|
});
|
|
35730
|
-
var Emoji$1 = styled.li(_templateObject8$
|
|
36518
|
+
var Emoji$1 = styled.li(_templateObject8$g || (_templateObject8$g = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n width: 32px;\n height: 32px;\n margin: 0 2px;\n display: inline-block;\n box-sizing: border-box;\n border-radius: 50%;\n padding-top: 2px;\n text-align: center;\n background: transparent;\n font-family:\n apple color emoji,\n segoe ui emoji,\n noto color emoji,\n android emoji,\n emojisymbols,\n emojione mozilla,\n twemoji mozilla,\n segoe ui symbol;\n & > * {\n font-size: 22px;\n }\n &:hover {\n background: ", ";\n }\n"])), function (props) {
|
|
35731
36519
|
return props.hoverBackgroundColor;
|
|
35732
36520
|
});
|
|
35733
36521
|
|
|
@@ -35928,7 +36716,7 @@ function SvgRecordButton(props) {
|
|
|
35928
36716
|
})));
|
|
35929
36717
|
}
|
|
35930
36718
|
|
|
35931
|
-
var _templateObject$
|
|
36719
|
+
var _templateObject$I, _templateObject2$D, _templateObject3$w, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i;
|
|
35932
36720
|
var shouldDraw = false;
|
|
35933
36721
|
var AudioRecord = function AudioRecord(_ref) {
|
|
35934
36722
|
var sendRecordedFile = _ref.sendRecordedFile,
|
|
@@ -36124,7 +36912,6 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
36124
36912
|
handleStopRecording();
|
|
36125
36913
|
if (currentRecordedFile) {
|
|
36126
36914
|
var _wavesurfer$current2;
|
|
36127
|
-
removeAudioRecordingFromMap(currentChannelId);
|
|
36128
36915
|
dispatch(setChannelDraftMessageIsRemovedAC(currentChannelId));
|
|
36129
36916
|
setRecordedFile(null);
|
|
36130
36917
|
setPlayAudio(false);
|
|
@@ -36133,8 +36920,9 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
36133
36920
|
}
|
|
36134
36921
|
} else {
|
|
36135
36922
|
shouldDraw = false;
|
|
36136
|
-
recorder.stop();
|
|
36923
|
+
recorder === null || recorder === void 0 ? void 0 : recorder.stop();
|
|
36137
36924
|
}
|
|
36925
|
+
removeAudioRecordingFromMap(currentChannelId);
|
|
36138
36926
|
setRecordingIsReadyToPlay(false);
|
|
36139
36927
|
setStartRecording(false);
|
|
36140
36928
|
setCurrentTime(0);
|
|
@@ -36391,29 +37179,20 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
36391
37179
|
}, [currentRecordedFile, currentChannelId]);
|
|
36392
37180
|
useEffect(function () {
|
|
36393
37181
|
if (!currentRecordedFile) {
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36397
|
-
|
|
36398
|
-
|
|
36399
|
-
|
|
36400
|
-
|
|
36401
|
-
|
|
36402
|
-
|
|
36403
|
-
|
|
36404
|
-
setRecorder(recorder);
|
|
36405
|
-
});
|
|
36406
|
-
}, function (e) {
|
|
36407
|
-
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
36408
|
-
});
|
|
36409
|
-
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
36410
|
-
}
|
|
36411
|
-
}();
|
|
36412
|
-
return _temp5 && _temp5.then ? _temp5.then(function () {}) : void 0;
|
|
36413
|
-
} catch (e) {
|
|
36414
|
-
Promise.reject(e);
|
|
37182
|
+
try {
|
|
37183
|
+
if (!recorder) {
|
|
37184
|
+
try {
|
|
37185
|
+
var newRecorder = new MicRecorder({
|
|
37186
|
+
bitRate: 128
|
|
37187
|
+
});
|
|
37188
|
+
setRecorder(newRecorder);
|
|
37189
|
+
} catch (e) {
|
|
37190
|
+
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
37191
|
+
}
|
|
36415
37192
|
}
|
|
36416
|
-
}
|
|
37193
|
+
} catch (e) {
|
|
37194
|
+
Promise.reject(e);
|
|
37195
|
+
}
|
|
36417
37196
|
}
|
|
36418
37197
|
}, [currentRecordedFile]);
|
|
36419
37198
|
useEffect(function () {
|
|
@@ -36492,10 +37271,10 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
36492
37271
|
iconColor: accentColor
|
|
36493
37272
|
}, showRecording || currentRecordedFile ? /*#__PURE__*/React__default.createElement(SvgSend, null) : /*#__PURE__*/React__default.createElement(SvgRecordButton, null)));
|
|
36494
37273
|
};
|
|
36495
|
-
var Container$j = styled.div(_templateObject$
|
|
37274
|
+
var Container$j = styled.div(_templateObject$I || (_templateObject$I = _taggedTemplateLiteralLoose(["\n width: 32px;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n ", ";\n transition: all 0.3s ease-in-out;\n"])), function (props) {
|
|
36496
37275
|
return props.recording && "width: 400px";
|
|
36497
37276
|
});
|
|
36498
|
-
var AudioWrapper = styled.div(_templateObject2$
|
|
37277
|
+
var AudioWrapper = styled.div(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n align-items: center;\n height: 36px;\n width: ", ";\n overflow: hidden;\n margin: ", ";\n background-color: ", ";\n padding: ", ";\n border-radius: 20px;\n"])), function (props) {
|
|
36499
37278
|
return props.recording ? 'calc(100% - 84px)' : '0';
|
|
36500
37279
|
}, function (props) {
|
|
36501
37280
|
return props.recording ? '0 8px' : '0';
|
|
@@ -36504,10 +37283,10 @@ var AudioWrapper = styled.div(_templateObject2$C || (_templateObject2$C = _tagge
|
|
|
36504
37283
|
}, function (props) {
|
|
36505
37284
|
return props.recording ? '0 12px 0 0' : '0';
|
|
36506
37285
|
});
|
|
36507
|
-
var RecordIconWrapper = styled.span(_templateObject3$
|
|
37286
|
+
var RecordIconWrapper = styled.span(_templateObject3$w || (_templateObject3$w = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n > svg {\n color: ", ";\n }\n"])), function (props) {
|
|
36508
37287
|
return props.iconColor;
|
|
36509
37288
|
});
|
|
36510
|
-
var AudioVisualization$1 = styled.div(_templateObject4$
|
|
37289
|
+
var AudioVisualization$1 = styled.div(_templateObject4$s || (_templateObject4$s = _taggedTemplateLiteralLoose(["\n position: absolute;\n opacity: ", ";\n z-index: ", ";\n visibility: ", ";\n width: 300px;\n height: 28px;\n max-width: calc(100% - 100px);\n left: 40px;\n background-color: ", ";\n"])), function (_ref5) {
|
|
36511
37290
|
var show = _ref5.show;
|
|
36512
37291
|
return show ? '1' : '0';
|
|
36513
37292
|
}, function (_ref6) {
|
|
@@ -36519,10 +37298,10 @@ var AudioVisualization$1 = styled.div(_templateObject4$r || (_templateObject4$r
|
|
|
36519
37298
|
}, function (props) {
|
|
36520
37299
|
return props.color;
|
|
36521
37300
|
});
|
|
36522
|
-
var PlayPause$1 = styled.div(_templateObject5$
|
|
37301
|
+
var PlayPause$1 = styled.div(_templateObject5$o || (_templateObject5$o = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n padding: 10px;\n > svg {\n color: ", ";\n }\n"])), function (props) {
|
|
36523
37302
|
return props.iconColor;
|
|
36524
37303
|
});
|
|
36525
|
-
var Canvas = styled.canvas(_templateObject6$
|
|
37304
|
+
var Canvas = styled.canvas(_templateObject6$k || (_templateObject6$k = _taggedTemplateLiteralLoose(["\n height: 28px;\n width: ", ";\n max-width: calc(100% - 110px);\n position: absolute;\n opacity: ", ";\n z-index: ", ";\n left: 42px;\n"])), function (_ref8) {
|
|
36526
37305
|
var recording = _ref8.recording;
|
|
36527
37306
|
return recording ? '300px' : '0';
|
|
36528
37307
|
}, function (_ref9) {
|
|
@@ -36532,14 +37311,14 @@ var Canvas = styled.canvas(_templateObject6$j || (_templateObject6$j = _taggedTe
|
|
|
36532
37311
|
var hide = _ref0.hide;
|
|
36533
37312
|
return hide && '-1';
|
|
36534
37313
|
});
|
|
36535
|
-
var Timer$2 = styled.div(_templateObject7$
|
|
37314
|
+
var Timer$2 = styled.div(_templateObject7$i || (_templateObject7$i = _taggedTemplateLiteralLoose(["\n width: 40px;\n font-weight: 400;\n font-size: 16px;\n line-height: 12px;\n color: ", ";\n margin-left: auto;\n"])), function (props) {
|
|
36536
37315
|
return props.color;
|
|
36537
37316
|
});
|
|
36538
37317
|
|
|
36539
|
-
var _templateObject$
|
|
36540
|
-
var wave = keyframes(_templateObject$
|
|
36541
|
-
var Wrapper = styled.div(_templateObject2$
|
|
36542
|
-
var Bar = styled.span(_templateObject3$
|
|
37318
|
+
var _templateObject$J, _templateObject2$E, _templateObject3$x;
|
|
37319
|
+
var wave = keyframes(_templateObject$J || (_templateObject$J = _taggedTemplateLiteralLoose(["\n 0%, 100% {\n transform: scaleY(0.5);\n opacity: 0.6;\n }\n 50% {\n transform: scaleY(1.2);\n opacity: 1;\n }\n"])));
|
|
37320
|
+
var Wrapper = styled.div(_templateObject2$E || (_templateObject2$E = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n height: 8px;\n gap: 1.5px;\n"])));
|
|
37321
|
+
var Bar = styled.span(_templateObject3$x || (_templateObject3$x = _taggedTemplateLiteralLoose(["\n display: block;\n width: 3px;\n height: 8px;\n border-radius: 2px;\n background: ", ";\n animation: ", " 1s infinite;\n animation-delay: ", "s;\n"])), function (props) {
|
|
36543
37322
|
return props.borderColor;
|
|
36544
37323
|
}, wave, function (_ref) {
|
|
36545
37324
|
var delay = _ref.delay;
|
|
@@ -36565,7 +37344,7 @@ var RecordingAnimation = function RecordingAnimation(_ref2) {
|
|
|
36565
37344
|
}));
|
|
36566
37345
|
};
|
|
36567
37346
|
|
|
36568
|
-
var _templateObject$
|
|
37347
|
+
var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$a, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1;
|
|
36569
37348
|
function AutoFocusPlugin(_ref) {
|
|
36570
37349
|
var messageForReply = _ref.messageForReply;
|
|
36571
37350
|
var _useLexicalComposerCo = useLexicalComposerContext(),
|
|
@@ -36774,8 +37553,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36774
37553
|
messageBodyAttributes = _useState11[0],
|
|
36775
37554
|
setMessageBodyAttributes = _useState11[1];
|
|
36776
37555
|
var _useState12 = useState([]),
|
|
36777
|
-
|
|
36778
|
-
|
|
37556
|
+
mentionedUsers = _useState12[0],
|
|
37557
|
+
setMentionedUsers = _useState12[1];
|
|
36779
37558
|
var _useState13 = useState(''),
|
|
36780
37559
|
browser = _useState13[0],
|
|
36781
37560
|
setBrowser = _useState13[1];
|
|
@@ -36901,21 +37680,21 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36901
37680
|
var messageToSend = {
|
|
36902
37681
|
body: messageTexToSend,
|
|
36903
37682
|
bodyAttributes: messageBodyAttributes,
|
|
36904
|
-
|
|
37683
|
+
mentionedUsers: [],
|
|
36905
37684
|
attachments: [],
|
|
36906
37685
|
type: 'text'
|
|
36907
37686
|
};
|
|
36908
|
-
var
|
|
37687
|
+
var mentionUsersToSend = [];
|
|
36909
37688
|
if (messageBodyAttributes && messageBodyAttributes.length) {
|
|
36910
37689
|
messageBodyAttributes.forEach(function (att) {
|
|
36911
37690
|
if (att.type === 'mention') {
|
|
36912
|
-
|
|
37691
|
+
mentionUsersToSend.push({
|
|
36913
37692
|
id: att.metadata
|
|
36914
37693
|
});
|
|
36915
37694
|
}
|
|
36916
37695
|
});
|
|
36917
37696
|
}
|
|
36918
|
-
messageToSend.
|
|
37697
|
+
messageToSend.mentionedUsers = mentionUsersToSend;
|
|
36919
37698
|
log.info('message to send ..........................................', JSON.stringify(messageToSend));
|
|
36920
37699
|
if (messageForReply) {
|
|
36921
37700
|
messageToSend.parentMessage = messageForReply;
|
|
@@ -36975,7 +37754,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
36975
37754
|
setShouldClearEditor({
|
|
36976
37755
|
clear: true
|
|
36977
37756
|
});
|
|
36978
|
-
|
|
37757
|
+
setMentionedUsers([]);
|
|
36979
37758
|
setMessageBodyAttributes([]);
|
|
36980
37759
|
dispatch(setCloseSearchChannelsAC(true));
|
|
36981
37760
|
} else {
|
|
@@ -37007,21 +37786,21 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37007
37786
|
};
|
|
37008
37787
|
}
|
|
37009
37788
|
}
|
|
37010
|
-
var
|
|
37011
|
-
var
|
|
37012
|
-
if (
|
|
37789
|
+
var mentionedUsersPositions = [];
|
|
37790
|
+
var mentionUsersToSend = [];
|
|
37791
|
+
if (mentionedUsers && mentionedUsers.length) {
|
|
37013
37792
|
if (messageBodyAttributes && messageBodyAttributes.length) {
|
|
37014
37793
|
messageBodyAttributes.forEach(function (att) {
|
|
37015
37794
|
if (att.type === 'mention') {
|
|
37016
|
-
var mentionsToFind = [].concat(
|
|
37795
|
+
var mentionsToFind = [].concat(mentionedUsers);
|
|
37017
37796
|
var draftMessage = getDraftMessageFromMap(activeChannel.id);
|
|
37018
37797
|
if (draftMessage) {
|
|
37019
|
-
mentionsToFind = [].concat(draftMessage.
|
|
37798
|
+
mentionsToFind = [].concat(draftMessage.mentionedUsers, mentionedUsers);
|
|
37020
37799
|
}
|
|
37021
37800
|
var mentionToAdd = mentionsToFind.find(function (mention) {
|
|
37022
37801
|
return mention.id === att.metadata;
|
|
37023
37802
|
});
|
|
37024
|
-
|
|
37803
|
+
mentionUsersToSend.push(mentionToAdd);
|
|
37025
37804
|
}
|
|
37026
37805
|
});
|
|
37027
37806
|
}
|
|
@@ -37029,9 +37808,9 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37029
37808
|
var messageToSend = _extends({}, messageToEdit, linkAttachment ? {
|
|
37030
37809
|
attachments: [linkAttachment]
|
|
37031
37810
|
} : {}, {
|
|
37032
|
-
metadata:
|
|
37811
|
+
metadata: mentionedUsersPositions,
|
|
37033
37812
|
bodyAttributes: messageBodyAttributes,
|
|
37034
|
-
mentionedUsers:
|
|
37813
|
+
mentionedUsers: mentionUsersToSend,
|
|
37035
37814
|
body: messageTexToSend
|
|
37036
37815
|
});
|
|
37037
37816
|
messageToSend.type = /(https?:\/\/[^\s]+)/.test(messageToSend.body) ? 'link' : messageToSend.type;
|
|
@@ -37041,7 +37820,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37041
37820
|
};
|
|
37042
37821
|
var handleCloseEditMode = function handleCloseEditMode() {
|
|
37043
37822
|
setEditMessageText('');
|
|
37044
|
-
|
|
37823
|
+
setMentionedUsers([]);
|
|
37045
37824
|
dispatch(setMessageToEditAC(null));
|
|
37046
37825
|
};
|
|
37047
37826
|
var removeUpload = function removeUpload(attachmentId) {
|
|
@@ -37140,7 +37919,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37140
37919
|
};
|
|
37141
37920
|
var handleCut = function handleCut() {
|
|
37142
37921
|
setMessageText('');
|
|
37143
|
-
|
|
37922
|
+
setMentionedUsers([]);
|
|
37144
37923
|
};
|
|
37145
37924
|
var handleEmojiPopupToggle = function handleEmojiPopupToggle(bool) {
|
|
37146
37925
|
setIsEmojisOpened(bool);
|
|
@@ -37208,7 +37987,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37208
37987
|
dispatch(clearSelectedMessagesAC());
|
|
37209
37988
|
};
|
|
37210
37989
|
var handleSetMentionMember = function handleSetMentionMember(mentionMember) {
|
|
37211
|
-
|
|
37990
|
+
setMentionedUsers(function (prevState) {
|
|
37212
37991
|
return [].concat(prevState, [mentionMember]);
|
|
37213
37992
|
});
|
|
37214
37993
|
};
|
|
@@ -37589,7 +38368,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37589
38368
|
var messageToSend = {
|
|
37590
38369
|
metadata: '',
|
|
37591
38370
|
body: '',
|
|
37592
|
-
|
|
38371
|
+
mentionedUsers: [],
|
|
37593
38372
|
attachments: [{
|
|
37594
38373
|
name: v4() + ".mp3",
|
|
37595
38374
|
data: recordedFile.file,
|
|
@@ -37644,7 +38423,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37644
38423
|
dispatch(setMessageForReplyAC(draftMessage.messageForReply));
|
|
37645
38424
|
}
|
|
37646
38425
|
setMessageText(draftMessage.text);
|
|
37647
|
-
|
|
38426
|
+
setMentionedUsers(draftMessage.mentionedUsers);
|
|
37648
38427
|
}
|
|
37649
38428
|
setShouldClearEditor({
|
|
37650
38429
|
clear: true,
|
|
@@ -37655,7 +38434,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37655
38434
|
prevActiveChannelId = activeChannel.id;
|
|
37656
38435
|
}
|
|
37657
38436
|
dispatch(getMembersAC(activeChannel.id));
|
|
37658
|
-
|
|
38437
|
+
setMentionedUsers([]);
|
|
37659
38438
|
}, [activeChannel.id]);
|
|
37660
38439
|
useEffect(function () {
|
|
37661
38440
|
if (messageText.trim() || editMessageText.trim() && editMessageText && editMessageText.trim() !== messageToEdit.body || attachments.length) {
|
|
@@ -37690,10 +38469,10 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37690
38469
|
}
|
|
37691
38470
|
if (messageText.trim()) {
|
|
37692
38471
|
var draftMessage = getDraftMessageFromMap(activeChannel.id);
|
|
37693
|
-
if (draftMessage && draftMessage.
|
|
38472
|
+
if (draftMessage && draftMessage.mentionedUsers && draftMessage.mentionedUsers.length) {
|
|
37694
38473
|
setDraftMessageToMap(activeChannel.id, {
|
|
37695
38474
|
text: messageText,
|
|
37696
|
-
|
|
38475
|
+
mentionedUsers: draftMessage.mentionedUsers,
|
|
37697
38476
|
messageForReply: messageForReply,
|
|
37698
38477
|
editorState: realEditorState,
|
|
37699
38478
|
bodyAttributes: messageBodyAttributes
|
|
@@ -37701,7 +38480,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37701
38480
|
} else {
|
|
37702
38481
|
setDraftMessageToMap(activeChannel.id, {
|
|
37703
38482
|
text: messageText,
|
|
37704
|
-
|
|
38483
|
+
mentionedUsers: mentionedUsers,
|
|
37705
38484
|
messageForReply: messageForReply,
|
|
37706
38485
|
editorState: realEditorState,
|
|
37707
38486
|
bodyAttributes: messageBodyAttributes
|
|
@@ -37721,15 +38500,15 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37721
38500
|
}
|
|
37722
38501
|
}, [messageText, attachments, editMessageText, readyVideoAttachments, messageBodyAttributes]);
|
|
37723
38502
|
useDidUpdate(function () {
|
|
37724
|
-
if (
|
|
38503
|
+
if (mentionedUsers && mentionedUsers.length) {
|
|
37725
38504
|
setDraftMessageToMap(activeChannel.id, {
|
|
37726
38505
|
text: messageText,
|
|
37727
|
-
|
|
38506
|
+
mentionedUsers: mentionedUsers,
|
|
37728
38507
|
messageForReply: messageForReply,
|
|
37729
38508
|
bodyAttributes: messageBodyAttributes
|
|
37730
38509
|
});
|
|
37731
38510
|
}
|
|
37732
|
-
}, [
|
|
38511
|
+
}, [mentionedUsers]);
|
|
37733
38512
|
useEffect(function () {
|
|
37734
38513
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
37735
38514
|
var pendingMessagesMap = getPendingMessagesMap();
|
|
@@ -37780,7 +38559,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
37780
38559
|
if (draftMessagesMap[activeChannel.id]) {
|
|
37781
38560
|
setDraftMessageToMap(activeChannel.id, {
|
|
37782
38561
|
text: messageText,
|
|
37783
|
-
|
|
38562
|
+
mentionedUsers: mentionedUsers,
|
|
37784
38563
|
messageForReply: messageForReply,
|
|
37785
38564
|
bodyAttributes: messageBodyAttributes
|
|
37786
38565
|
});
|
|
@@ -38095,7 +38874,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
38095
38874
|
editMessage: messageToEdit,
|
|
38096
38875
|
contactsMap: contactsMap,
|
|
38097
38876
|
getFromContacts: getFromContacts,
|
|
38098
|
-
setMentionedMember:
|
|
38877
|
+
setMentionedMember: setMentionedUsers
|
|
38099
38878
|
}), /*#__PURE__*/React__default.createElement(FormatMessagePlugin, {
|
|
38100
38879
|
editorState: realEditorState,
|
|
38101
38880
|
setMessageBodyAttributes: setMessageBodyAttributes,
|
|
@@ -38152,10 +38931,10 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
38152
38931
|
channelId: activeChannel.id
|
|
38153
38932
|
}))))))))));
|
|
38154
38933
|
};
|
|
38155
|
-
var SendMessageWrapper = styled.div(_templateObject$
|
|
38934
|
+
var SendMessageWrapper = styled.div(_templateObject$K || (_templateObject$K = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n position: relative;\n z-index: 15;\n"])), function (props) {
|
|
38156
38935
|
return props.backgroundColor;
|
|
38157
38936
|
});
|
|
38158
|
-
var Container$k = styled.div(_templateObject2$
|
|
38937
|
+
var Container$k = styled.div(_templateObject2$F || (_templateObject2$F = _taggedTemplateLiteralLoose(["\n margin: ", ";\n border: ", ";\n border-radius: ", ";\n position: relative;\n padding: ", ";\n z-index: 15;\n\n & span.rdw-suggestion-dropdown {\n position: absolute;\n bottom: 100%;\n height: 160px;\n min-width: 150px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n padding: 6px 12px;\n border: 1px solid #ccc;\n background: #fff;\n z-index: 99;\n }\n\n & .text_formatting_toolbar {\n display: ", ";\n position: fixed;\n top: ", ";\n left: ", ";\n }\n\n & .rdw-suggestion-option-active {\n background-color: rgb(243, 245, 248);\n }\n\n & .custom_editor {\n cursor: text;\n\n & .rdw-mention-link {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
38159
38938
|
return props.margin || '30px 0 16px';
|
|
38160
38939
|
}, function (props) {
|
|
38161
38940
|
return props.border || '';
|
|
@@ -38172,7 +38951,7 @@ var Container$k = styled.div(_templateObject2$E || (_templateObject2$E = _tagged
|
|
|
38172
38951
|
}, function (props) {
|
|
38173
38952
|
return props.mentionColor;
|
|
38174
38953
|
});
|
|
38175
|
-
var EditReplyMessageCont = styled.div(_templateObject3$
|
|
38954
|
+
var EditReplyMessageCont = styled.div(_templateObject3$y || (_templateObject3$y = _taggedTemplateLiteralLoose(["\n position: relative;\n left: ", ";\n bottom: ", ";\n width: ", ";\n border-radius: ", ";\n padding: ", ";\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.2px;\n color: ", ";\n background-color: ", ";\n z-index: 19;\n box-sizing: content-box;\n"])), function (props) {
|
|
38176
38955
|
return props.left || '0';
|
|
38177
38956
|
}, function (props) {
|
|
38178
38957
|
return props.bottom || '0';
|
|
@@ -38187,19 +38966,19 @@ var EditReplyMessageCont = styled.div(_templateObject3$x || (_templateObject3$x
|
|
|
38187
38966
|
}, function (props) {
|
|
38188
38967
|
return props.backgroundColor;
|
|
38189
38968
|
});
|
|
38190
|
-
var EditMessageText = styled.p(_templateObject4$
|
|
38191
|
-
var UploadErrorMessage = styled.p(_templateObject5$
|
|
38969
|
+
var EditMessageText = styled.p(_templateObject4$t || (_templateObject4$t = _taggedTemplateLiteralLoose(["\n margin: 0;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n"])));
|
|
38970
|
+
var UploadErrorMessage = styled.p(_templateObject5$p || (_templateObject5$p = _taggedTemplateLiteralLoose(["\n margin: 0;\n position: absolute;\n top: -30px;\n color: ", ";\n"])), function (props) {
|
|
38192
38971
|
return props.color;
|
|
38193
38972
|
});
|
|
38194
|
-
var CloseEditMode = styled.span(_templateObject6$
|
|
38973
|
+
var CloseEditMode = styled.span(_templateObject6$l || (_templateObject6$l = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 12px;\n width: 20px;\n height: 20px;\n text-align: center;\n line-height: 22px;\n cursor: pointer;\n\n & > svg {\n color: ", ";\n }\n"])), function (props) {
|
|
38195
38974
|
return props.color;
|
|
38196
38975
|
});
|
|
38197
|
-
var UserName$1 = styled.span(_templateObject7$
|
|
38198
|
-
var ReplyMessageBody$1 = styled.div(_templateObject8$
|
|
38199
|
-
var EditReplyMessageHeader = styled.h4(_templateObject9$
|
|
38976
|
+
var UserName$1 = styled.span(_templateObject7$j || (_templateObject7$j = _taggedTemplateLiteralLoose(["\n font-weight: 500;\n margin-left: 4px;\n"])));
|
|
38977
|
+
var ReplyMessageBody$1 = styled.div(_templateObject8$h || (_templateObject8$h = _taggedTemplateLiteralLoose(["\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
38978
|
+
var EditReplyMessageHeader = styled.h4(_templateObject9$e || (_templateObject9$e = _taggedTemplateLiteralLoose(["\n display: flex;\n margin: 0 0 2px;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n color: ", ";\n\n > svg {\n margin-right: 4px;\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
38200
38979
|
return props.color;
|
|
38201
38980
|
});
|
|
38202
|
-
var AddAttachmentIcon = styled.span(_templateObject0$
|
|
38981
|
+
var AddAttachmentIcon = styled.span(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose(["\n display: flex;\n height: ", ";\n align-items: center;\n margin: 0 8px;\n cursor: pointer;\n line-height: 13px;\n z-index: 2;\n order: ", ";\n\n > svg {\n ", ";\n width: 24px;\n }\n\n &:hover > svg {\n color: ", ";\n }\n"])), function (props) {
|
|
38203
38982
|
return props.height ? props.height + "px" : '36px';
|
|
38204
38983
|
}, function (props) {
|
|
38205
38984
|
return props.order === 0 || props.order ? props.order : 1;
|
|
@@ -38208,7 +38987,7 @@ var AddAttachmentIcon = styled.span(_templateObject0$c || (_templateObject0$c =
|
|
|
38208
38987
|
}, function (props) {
|
|
38209
38988
|
return props.hoverColor;
|
|
38210
38989
|
});
|
|
38211
|
-
var SendMessageInputContainer = styled.div(_templateObject1$
|
|
38990
|
+
var SendMessageInputContainer = styled.div(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
|
|
38212
38991
|
return props.minHeight || '36px';
|
|
38213
38992
|
}, function (props) {
|
|
38214
38993
|
return props.messageForReply ? '0 0 4px 4px' : '4px';
|
|
@@ -38504,7 +39283,7 @@ function SvgUnpin(props) {
|
|
|
38504
39283
|
})));
|
|
38505
39284
|
}
|
|
38506
39285
|
|
|
38507
|
-
var _templateObject$
|
|
39286
|
+
var _templateObject$L, _templateObject2$G, _templateObject3$z, _templateObject4$u, _templateObject5$q, _templateObject6$m, _templateObject7$k, _templateObject8$i, _templateObject9$f, _templateObject0$e, _templateObject1$b, _templateObject10$6, _templateObject11$6, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$3, _templateObject16$3;
|
|
38508
39287
|
var Actions = function Actions(_ref) {
|
|
38509
39288
|
var setActionsHeight = _ref.setActionsHeight,
|
|
38510
39289
|
channel = _ref.channel,
|
|
@@ -38968,21 +39747,21 @@ var Actions = function Actions(_ref) {
|
|
|
38968
39747
|
title: popupTitle
|
|
38969
39748
|
})));
|
|
38970
39749
|
};
|
|
38971
|
-
var Container$l = styled.div(_templateObject$
|
|
39750
|
+
var Container$l = styled.div(_templateObject$L || (_templateObject$L = _taggedTemplateLiteralLoose(["\n padding: 10px 16px;\n border-bottom: 6px solid ", ";\n]"])), function (props) {
|
|
38972
39751
|
return props.borderColor;
|
|
38973
39752
|
});
|
|
38974
|
-
var ActionHeader = styled.div(_templateObject2$
|
|
38975
|
-
var MenuTriggerIcon = styled.span(_templateObject3$
|
|
39753
|
+
var ActionHeader = styled.div(_templateObject2$G || (_templateObject2$G = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 25px 0 22px;\n cursor: pointer;\n"])));
|
|
39754
|
+
var MenuTriggerIcon = styled.span(_templateObject3$z || (_templateObject3$z = _taggedTemplateLiteralLoose(["\n transition: all 0.2s;\n ", "\n"])), function (props) {
|
|
38976
39755
|
return !props.isOpen && ' transform: rotate(-90deg);';
|
|
38977
39756
|
});
|
|
38978
|
-
var ActionsMenu = styled.ul(_templateObject4$
|
|
38979
|
-
var DefaultMutedIcon = styled(SvgUnmuteNotifications)(_templateObject5$
|
|
38980
|
-
var DefaultMuteIcon = styled(SvgNotifications)(_templateObject6$
|
|
38981
|
-
var DefaultStarIcon = styled(SvgStar)(_templateObject7$
|
|
38982
|
-
var DefaultUnpinIcon = styled(SvgUnpin)(_templateObject8$
|
|
38983
|
-
var DefaultPinIcon = styled(SvgPin)(_templateObject9$
|
|
38984
|
-
var DefaultMarkAsRead = styled(SvgMarkAsRead)(_templateObject0$
|
|
38985
|
-
var DefaultMarkAsUnRead = styled(SvgMarkAsUnRead)(_templateObject1$
|
|
39757
|
+
var ActionsMenu = styled.ul(_templateObject4$u || (_templateObject4$u = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
39758
|
+
var DefaultMutedIcon = styled(SvgUnmuteNotifications)(_templateObject5$q || (_templateObject5$q = _taggedTemplateLiteralLoose([""])));
|
|
39759
|
+
var DefaultMuteIcon = styled(SvgNotifications)(_templateObject6$m || (_templateObject6$m = _taggedTemplateLiteralLoose([""])));
|
|
39760
|
+
var DefaultStarIcon = styled(SvgStar)(_templateObject7$k || (_templateObject7$k = _taggedTemplateLiteralLoose([""])));
|
|
39761
|
+
var DefaultUnpinIcon = styled(SvgUnpin)(_templateObject8$i || (_templateObject8$i = _taggedTemplateLiteralLoose([""])));
|
|
39762
|
+
var DefaultPinIcon = styled(SvgPin)(_templateObject9$f || (_templateObject9$f = _taggedTemplateLiteralLoose([""])));
|
|
39763
|
+
var DefaultMarkAsRead = styled(SvgMarkAsRead)(_templateObject0$e || (_templateObject0$e = _taggedTemplateLiteralLoose([""])));
|
|
39764
|
+
var DefaultMarkAsUnRead = styled(SvgMarkAsUnRead)(_templateObject1$b || (_templateObject1$b = _taggedTemplateLiteralLoose([""])));
|
|
38986
39765
|
var DefaultBlockIcon = styled(SvgBlockChannel)(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose([""])));
|
|
38987
39766
|
var DefaultReportIcon = styled(SvgReport)(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose([""])));
|
|
38988
39767
|
var DefaultClearIcon = styled(SvgClear)(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose([""])));
|
|
@@ -39062,7 +39841,7 @@ function SvgMoreVert(props) {
|
|
|
39062
39841
|
})));
|
|
39063
39842
|
}
|
|
39064
39843
|
|
|
39065
|
-
var _templateObject$
|
|
39844
|
+
var _templateObject$M, _templateObject2$H, _templateObject3$A;
|
|
39066
39845
|
var ChangeMemberRole = function ChangeMemberRole(_ref) {
|
|
39067
39846
|
var theme = _ref.theme,
|
|
39068
39847
|
channelId = _ref.channelId,
|
|
@@ -39162,14 +39941,14 @@ var ChangeMemberRole = function ChangeMemberRole(_ref) {
|
|
|
39162
39941
|
onClick: handleSave
|
|
39163
39942
|
}, "Save"))));
|
|
39164
39943
|
};
|
|
39165
|
-
var RolesSelect = styled.div(_templateObject$
|
|
39166
|
-
var RoleLabel = styled.div(_templateObject2$
|
|
39944
|
+
var RolesSelect = styled.div(_templateObject$M || (_templateObject$M = _taggedTemplateLiteralLoose(["\n margin-bottom: 32px;\n"])));
|
|
39945
|
+
var RoleLabel = styled.div(_templateObject2$H || (_templateObject2$H = _taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: 500;\n font-size: 14px;\n margin: 20px 0 8px;\n color: ", ";\n"])), function (_ref2) {
|
|
39167
39946
|
var color = _ref2.color;
|
|
39168
39947
|
return color;
|
|
39169
39948
|
});
|
|
39170
|
-
var RoleSpan = styled.span(_templateObject3$
|
|
39949
|
+
var RoleSpan = styled.span(_templateObject3$A || (_templateObject3$A = _taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n text-transform: capitalize;\n"])));
|
|
39171
39950
|
|
|
39172
|
-
var _templateObject$
|
|
39951
|
+
var _templateObject$N, _templateObject2$I, _templateObject3$B, _templateObject4$v, _templateObject5$r, _templateObject6$n, _templateObject7$l, _templateObject8$j, _templateObject9$g;
|
|
39173
39952
|
var Members = function Members(_ref) {
|
|
39174
39953
|
var channel = _ref.channel,
|
|
39175
39954
|
theme = _ref.theme,
|
|
@@ -39472,18 +40251,18 @@ var Members = function Members(_ref) {
|
|
|
39472
40251
|
toggleCreatePopup: handleAddMemberPopup
|
|
39473
40252
|
})));
|
|
39474
40253
|
};
|
|
39475
|
-
var Container$m = styled.div(_templateObject$
|
|
39476
|
-
var ActionsMenu$1 = styled.div(_templateObject2$
|
|
39477
|
-
var MemberNamePresence = styled.div(_templateObject3$
|
|
39478
|
-
var MemberNameWrapper = styled.div(_templateObject4$
|
|
39479
|
-
var MemberName$3 = styled.h4(_templateObject5$
|
|
40254
|
+
var Container$m = styled.div(_templateObject$N || (_templateObject$N = _taggedTemplateLiteralLoose([""])));
|
|
40255
|
+
var ActionsMenu$1 = styled.div(_templateObject2$I || (_templateObject2$I = _taggedTemplateLiteralLoose(["\n position: relative;\n transition: all 0.2s;\n"])));
|
|
40256
|
+
var MemberNamePresence = styled.div(_templateObject3$B || (_templateObject3$B = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n max-width: calc(100% - 84px);\n\n & > ", " {\n display: block;\n }\n"])), SubTitle);
|
|
40257
|
+
var MemberNameWrapper = styled.div(_templateObject4$v || (_templateObject4$v = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n"])));
|
|
40258
|
+
var MemberName$3 = styled.h4(_templateObject5$r || (_templateObject5$r = _taggedTemplateLiteralLoose(["\n margin: 0;\n font-weight: 400;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n color: ", ";\n"])), function (props) {
|
|
39480
40259
|
return props.color;
|
|
39481
40260
|
});
|
|
39482
|
-
var EditMemberIcon = styled.span(_templateObject6$
|
|
40261
|
+
var EditMemberIcon = styled.span(_templateObject6$n || (_templateObject6$n = _taggedTemplateLiteralLoose(["\n margin-left: auto;\n cursor: pointer;\n padding: 15px;\n opacity: 0;\n visibility: hidden;\n transition: all 0.2s;\n\n & svg {\n color: ", ";\n }\n"])), function (props) {
|
|
39483
40262
|
return props.color;
|
|
39484
40263
|
});
|
|
39485
|
-
var MembersList = styled.ul(_templateObject7$
|
|
39486
|
-
var MemberItem$1 = styled.li(_templateObject8$
|
|
40264
|
+
var MembersList = styled.ul(_templateObject7$l || (_templateObject7$l = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
40265
|
+
var MemberItem$1 = styled.li(_templateObject8$j || (_templateObject8$j = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n font-size: ", ";\n font-weight: 500;\n padding: 6px 16px;\n transition: all 0.2s;\n color: ", ";\n cursor: pointer;\n\n & > svg {\n rect {\n fill: transparent;\n }\n }\n\n &:first-child {\n cursor: pointer;\n\n > svg {\n color: ", ";\n margin-right: 12px;\n & > rect {\n fill: ", " !important;\n }\n }\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:hover ", " {\n opacity: 1;\n visibility: visible;\n }\n\n & .dropdown-wrapper {\n margin-left: auto;\n }\n\n & ", " {\n width: 12px;\n height: 12px;\n right: -1px;\n bottom: -1px;\n }\n"])), function (props) {
|
|
39487
40266
|
return props.fontSize || '15px';
|
|
39488
40267
|
}, function (props) {
|
|
39489
40268
|
return props.color;
|
|
@@ -39494,13 +40273,13 @@ var MemberItem$1 = styled.li(_templateObject8$i || (_templateObject8$i = _tagged
|
|
|
39494
40273
|
}, function (props) {
|
|
39495
40274
|
return props.hoverBackground;
|
|
39496
40275
|
}, EditMemberIcon, UserStatus);
|
|
39497
|
-
var RoleBadge = styled.span(_templateObject9$
|
|
40276
|
+
var RoleBadge = styled.span(_templateObject9$g || (_templateObject9$g = _taggedTemplateLiteralLoose(["\n position: relative;\n padding: 2px 8px;\n border-radius: 12px;\n margin-left: 4px;\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n border-radius: 12px;\n width: 100%;\n height: 100%;\n background-color: ", ";\n opacity: 0.1;\n }\n"])), function (props) {
|
|
39498
40277
|
return props.color;
|
|
39499
40278
|
}, function (props) {
|
|
39500
40279
|
return props.backgroundColor;
|
|
39501
40280
|
});
|
|
39502
40281
|
|
|
39503
|
-
var _templateObject$
|
|
40282
|
+
var _templateObject$O, _templateObject2$J;
|
|
39504
40283
|
var Media = function Media(_ref) {
|
|
39505
40284
|
var channel = _ref.channel;
|
|
39506
40285
|
var _useColor = useColors(),
|
|
@@ -39546,8 +40325,8 @@ var Media = function Media(_ref) {
|
|
|
39546
40325
|
currentMediaFile: mediaFile
|
|
39547
40326
|
})));
|
|
39548
40327
|
};
|
|
39549
|
-
var Container$n = styled.div(_templateObject$
|
|
39550
|
-
var MediaItem = styled.div(_templateObject2$
|
|
40328
|
+
var Container$n = styled.div(_templateObject$O || (_templateObject$O = _taggedTemplateLiteralLoose(["\n padding: 6px 4px;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
40329
|
+
var MediaItem = styled.div(_templateObject2$J || (_templateObject2$J = _taggedTemplateLiteralLoose(["\n width: calc(33.3333% - 4px);\n height: 110px;\n box-sizing: border-box;\n //border: 1px solid #ccc;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n overflow: hidden;\n margin: 2px;\n"])));
|
|
39551
40330
|
|
|
39552
40331
|
var _rect$3, _path$1n;
|
|
39553
40332
|
function _extends$1r() {
|
|
@@ -39603,7 +40382,7 @@ function SvgDownloadFile(props) {
|
|
|
39603
40382
|
})));
|
|
39604
40383
|
}
|
|
39605
40384
|
|
|
39606
|
-
var _templateObject$
|
|
40385
|
+
var _templateObject$P, _templateObject2$K, _templateObject3$C, _templateObject4$w, _templateObject5$s, _templateObject6$o, _templateObject7$m, _templateObject8$k;
|
|
39607
40386
|
var Files = function Files(_ref) {
|
|
39608
40387
|
var channelId = _ref.channelId,
|
|
39609
40388
|
filePreviewIcon = _ref.filePreviewIcon,
|
|
@@ -39720,30 +40499,30 @@ var Files = function Files(_ref) {
|
|
|
39720
40499
|
}))) : filePreviewDownloadIcon || /*#__PURE__*/React__default.createElement(SvgDownloadFile, null)));
|
|
39721
40500
|
}));
|
|
39722
40501
|
};
|
|
39723
|
-
var Container$o = styled.ul(_templateObject$
|
|
39724
|
-
var DownloadWrapper = styled.a(_templateObject2$
|
|
40502
|
+
var Container$o = styled.ul(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
40503
|
+
var DownloadWrapper = styled.a(_templateObject2$K || (_templateObject2$K = _taggedTemplateLiteralLoose(["\n text-decoration: none;\n visibility: ", ";\n padding: 5px 6px;\n position: absolute;\n top: 25%;\n right: 16px;\n cursor: pointer;\n & > svg {\n & path {\n fill: ", ";\n }\n color: ", ";\n }\n"])), function (props) {
|
|
39725
40504
|
return props.visible ? 'visible' : 'hidden';
|
|
39726
40505
|
}, function (props) {
|
|
39727
40506
|
return props.iconColor;
|
|
39728
40507
|
}, function (props) {
|
|
39729
40508
|
return props.iconColor;
|
|
39730
40509
|
});
|
|
39731
|
-
var ProgressWrapper$2 = styled.span(_templateObject3$
|
|
39732
|
-
var FileIconCont = styled.span(_templateObject4$
|
|
40510
|
+
var ProgressWrapper$2 = styled.span(_templateObject3$C || (_templateObject3$C = _taggedTemplateLiteralLoose(["\n display: inline-block;\n width: 20px;\n height: 20px;\n animation: preloader 1.5s linear infinite;\n\n @keyframes preloader {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
|
|
40511
|
+
var FileIconCont = styled.span(_templateObject4$w || (_templateObject4$w = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n\n & > svg {\n width: 40px;\n height: 40px;\n color: ", ";\n fill: ", ";\n }\n"])), function (props) {
|
|
39733
40512
|
return props.iconColor;
|
|
39734
40513
|
}, function (props) {
|
|
39735
40514
|
return props.fillColor;
|
|
39736
40515
|
});
|
|
39737
|
-
var FileHoverIconCont = styled.span(_templateObject5$
|
|
40516
|
+
var FileHoverIconCont = styled.span(_templateObject5$s || (_templateObject5$s = _taggedTemplateLiteralLoose(["\n display: none;\n & > svg {\n color: ", ";\n width: 40px;\n height: 40px;\n fill: ", ";\n }\n"])), function (props) {
|
|
39738
40517
|
return props.iconColor;
|
|
39739
40518
|
}, function (props) {
|
|
39740
40519
|
return props.fillColor;
|
|
39741
40520
|
});
|
|
39742
|
-
var FileThumb = styled.img(_templateObject6$
|
|
39743
|
-
var FileItem = styled.div(_templateObject7$
|
|
40521
|
+
var FileThumb = styled.img(_templateObject6$o || (_templateObject6$o = _taggedTemplateLiteralLoose(["\n width: 40px;\n height: 40px;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n object-fit: cover;\n"])));
|
|
40522
|
+
var FileItem = styled.div(_templateObject7$m || (_templateObject7$m = _taggedTemplateLiteralLoose(["\n position: relative;\n padding: 11px 16px;\n display: flex;\n align-items: center;\n font-size: 15px;\n transition: all 0.2s;\n div {\n margin-left: 7px;\n width: calc(100% - 48px);\n }\n &:hover {\n background-color: ", ";\n ", " {\n visibility: visible;\n }\n & ", " {\n display: none;\n }\n & ", " {\n display: inline-flex;\n }\n }\n /*&.isHover {\n\n }*/\n"])), function (props) {
|
|
39744
40523
|
return props.hoverBackgroundColor;
|
|
39745
40524
|
}, DownloadWrapper, FileIconCont, FileHoverIconCont);
|
|
39746
|
-
var FileSizeAndDate = styled.span(_templateObject8$
|
|
40525
|
+
var FileSizeAndDate = styled.span(_templateObject8$k || (_templateObject8$k = _taggedTemplateLiteralLoose(["\n display: block;\n font-style: normal;\n font-weight: normal;\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: 2px;\n"])), function (props) {
|
|
39747
40526
|
return props.fontSize || '13px';
|
|
39748
40527
|
}, function (props) {
|
|
39749
40528
|
return props.lineHeight || '16px';
|
|
@@ -39782,7 +40561,7 @@ function SvgLinkIcon(props) {
|
|
|
39782
40561
|
})));
|
|
39783
40562
|
}
|
|
39784
40563
|
|
|
39785
|
-
var _templateObject$
|
|
40564
|
+
var _templateObject$Q, _templateObject2$L, _templateObject3$D, _templateObject4$x, _templateObject5$t;
|
|
39786
40565
|
var LinkItem = function LinkItem(_ref) {
|
|
39787
40566
|
var link = _ref.link,
|
|
39788
40567
|
linkPreviewIcon = _ref.linkPreviewIcon,
|
|
@@ -39813,25 +40592,25 @@ var LinkItem = function LinkItem(_ref) {
|
|
|
39813
40592
|
color: linkPreviewColor || textPrimary
|
|
39814
40593
|
}, link))));
|
|
39815
40594
|
};
|
|
39816
|
-
var LinkIconCont = styled.span(_templateObject$
|
|
40595
|
+
var LinkIconCont = styled.span(_templateObject$Q || (_templateObject$Q = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n > svg {\n color: ", ";\n fill: ", ";\n }\n"])), function (props) {
|
|
39817
40596
|
return props.iconColor;
|
|
39818
40597
|
}, function (props) {
|
|
39819
40598
|
return props.fillColor;
|
|
39820
40599
|
});
|
|
39821
|
-
var LinkHoverIconCont = styled.span(_templateObject2$
|
|
40600
|
+
var LinkHoverIconCont = styled.span(_templateObject2$L || (_templateObject2$L = _taggedTemplateLiteralLoose(["\n display: none;\n > svg {\n color: ", ";\n fill: ", ";\n }\n"])), function (props) {
|
|
39822
40601
|
return props.iconColor;
|
|
39823
40602
|
}, function (props) {
|
|
39824
40603
|
return props.fillColor;
|
|
39825
40604
|
});
|
|
39826
|
-
var LinkInfoCont = styled.div(_templateObject3$
|
|
39827
|
-
var FileItem$1 = styled.li(_templateObject4$
|
|
40605
|
+
var LinkInfoCont = styled.div(_templateObject3$D || (_templateObject3$D = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n width: calc(100% - 40px);\n"])));
|
|
40606
|
+
var FileItem$1 = styled.li(_templateObject4$x || (_templateObject4$x = _taggedTemplateLiteralLoose(["\n padding: 9px 16px;\n a {\n display: flex;\n align-items: center;\n text-decoration: none;\n }\n &:hover {\n background-color: ", ";\n & ", " {\n display: none;\n }\n & ", " {\n display: inline-flex;\n }\n }\n"])), function (props) {
|
|
39828
40607
|
return props.hoverBackgroundColor;
|
|
39829
40608
|
}, LinkIconCont, LinkHoverIconCont);
|
|
39830
|
-
var LinkUrl = styled.span(_templateObject5$
|
|
40609
|
+
var LinkUrl = styled.span(_templateObject5$t || (_templateObject5$t = _taggedTemplateLiteralLoose(["\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: calc(100% - 52px);\n font-style: normal;\n font-weight: normal;\n font-size: 13px;\n line-height: 16px;\n text-decoration: underline;\n color: ", ";\n"])), function (props) {
|
|
39831
40610
|
return props.color;
|
|
39832
40611
|
});
|
|
39833
40612
|
|
|
39834
|
-
var _templateObject$
|
|
40613
|
+
var _templateObject$R;
|
|
39835
40614
|
var Links = function Links(_ref) {
|
|
39836
40615
|
var channelId = _ref.channelId,
|
|
39837
40616
|
linkPreviewIcon = _ref.linkPreviewIcon,
|
|
@@ -39856,7 +40635,7 @@ var Links = function Links(_ref) {
|
|
|
39856
40635
|
});
|
|
39857
40636
|
}));
|
|
39858
40637
|
};
|
|
39859
|
-
var Container$p = styled.ul(_templateObject$
|
|
40638
|
+
var Container$p = styled.ul(_templateObject$R || (_templateObject$R = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 11px 0 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
39860
40639
|
|
|
39861
40640
|
var _rect$5, _path$1q;
|
|
39862
40641
|
function _extends$1u() {
|
|
@@ -39912,7 +40691,7 @@ function SvgVoicePreviewPause(props) {
|
|
|
39912
40691
|
})));
|
|
39913
40692
|
}
|
|
39914
40693
|
|
|
39915
|
-
var _templateObject$
|
|
40694
|
+
var _templateObject$S, _templateObject2$M, _templateObject3$E, _templateObject4$y, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l;
|
|
39916
40695
|
var VoiceItem = function VoiceItem(_ref) {
|
|
39917
40696
|
var file = _ref.file,
|
|
39918
40697
|
voicePreviewPlayIcon = _ref.voicePreviewPlayIcon,
|
|
@@ -40037,32 +40816,32 @@ var VoiceItem = function VoiceItem(_ref) {
|
|
|
40037
40816
|
type: 'audio/mpeg'
|
|
40038
40817
|
})));
|
|
40039
40818
|
};
|
|
40040
|
-
var FileIconCont$1 = styled.span(_templateObject$
|
|
40819
|
+
var FileIconCont$1 = styled.span(_templateObject$S || (_templateObject$S = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: inline-flex;\n fill: ", ";\n rect {\n fill: ", ";\n }\n"])), function (props) {
|
|
40041
40820
|
return props.fill || 'transparent';
|
|
40042
40821
|
}, function (props) {
|
|
40043
40822
|
return props.fill || 'transparent';
|
|
40044
40823
|
});
|
|
40045
|
-
var FileHoverIconCont$1 = styled.span(_templateObject2$
|
|
40824
|
+
var FileHoverIconCont$1 = styled.span(_templateObject2$M || (_templateObject2$M = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: none;\n fill: ", ";\n rect {\n fill: ", ";\n }\n"])), function (props) {
|
|
40046
40825
|
return props.fill || 'transparent';
|
|
40047
40826
|
}, function (props) {
|
|
40048
40827
|
return props.fill || 'transparent';
|
|
40049
40828
|
});
|
|
40050
|
-
var FileItem$2 = styled.li(_templateObject3$
|
|
40829
|
+
var FileItem$2 = styled.li(_templateObject3$E || (_templateObject3$E = _taggedTemplateLiteralLoose(["\n padding: 9px 16px;\n display: flex;\n align-items: center;\n text-decoration: none;\n\n &:hover {\n background-color: ", ";\n }\n div {\n margin-left: 12px;\n width: 100%;\n }\n img {\n width: 42px;\n height: 42px;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n box-sizing: border-box;\n border-radius: 6px;\n }\n\n &.isHover {\n & ", " {\n display: none;\n }\n & ", " {\n display: inline-flex;\n }\n }\n"])), function (props) {
|
|
40051
40830
|
return props.hoverBackgroundColor;
|
|
40052
40831
|
}, FileIconCont$1, FileHoverIconCont$1);
|
|
40053
|
-
var AudioInfo = styled.div(_templateObject4$
|
|
40054
|
-
var AudioTitle = styled.span(_templateObject5$
|
|
40832
|
+
var AudioInfo = styled.div(_templateObject4$y || (_templateObject4$y = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
40833
|
+
var AudioTitle = styled.span(_templateObject5$u || (_templateObject5$u = _taggedTemplateLiteralLoose(["\n display: block;\n font-style: normal;\n font-weight: 500;\n font-size: 15px;\n line-height: 20px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: calc(100% - 72px);\n color: ", ";\n"])), function (props) {
|
|
40055
40834
|
return props.color;
|
|
40056
40835
|
});
|
|
40057
|
-
var AudioDate = styled.span(_templateObject6$
|
|
40836
|
+
var AudioDate = styled.span(_templateObject6$p || (_templateObject6$p = _taggedTemplateLiteralLoose(["\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: calc(100% - 72px);\n font-style: normal;\n font-weight: normal;\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n"])), function (props) {
|
|
40058
40837
|
return props.color;
|
|
40059
40838
|
});
|
|
40060
|
-
var AudioSendTime = styled.span(_templateObject7$
|
|
40839
|
+
var AudioSendTime = styled.span(_templateObject7$n || (_templateObject7$n = _taggedTemplateLiteralLoose(["\n position: absolute;\n right: 0;\n top: 11px;\n color: ", ";\n font-size: 12px;\n line-height: 16px;\n"])), function (props) {
|
|
40061
40840
|
return props.color;
|
|
40062
40841
|
});
|
|
40063
|
-
var Audio = styled.audio(_templateObject8$
|
|
40842
|
+
var Audio = styled.audio(_templateObject8$l || (_templateObject8$l = _taggedTemplateLiteralLoose(["\n display: none;\n"])));
|
|
40064
40843
|
|
|
40065
|
-
var _templateObject$
|
|
40844
|
+
var _templateObject$T;
|
|
40066
40845
|
var Voices = function Voices(_ref) {
|
|
40067
40846
|
var channelId = _ref.channelId,
|
|
40068
40847
|
voicePreviewPlayIcon = _ref.voicePreviewPlayIcon,
|
|
@@ -40093,9 +40872,9 @@ var Voices = function Voices(_ref) {
|
|
|
40093
40872
|
});
|
|
40094
40873
|
}));
|
|
40095
40874
|
};
|
|
40096
|
-
var Container$q = styled.ul(_templateObject$
|
|
40875
|
+
var Container$q = styled.ul(_templateObject$T || (_templateObject$T = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 11px 0 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
40097
40876
|
|
|
40098
|
-
var _templateObject$
|
|
40877
|
+
var _templateObject$U, _templateObject2$N;
|
|
40099
40878
|
var DetailsTab = function DetailsTab(_ref) {
|
|
40100
40879
|
var channel = _ref.channel,
|
|
40101
40880
|
theme = _ref.theme,
|
|
@@ -40244,8 +41023,8 @@ var DetailsTab = function DetailsTab(_ref) {
|
|
|
40244
41023
|
voicePreviewHoverBackgroundColor: voicePreviewHoverBackgroundColor
|
|
40245
41024
|
})));
|
|
40246
41025
|
};
|
|
40247
|
-
var Container$r = styled.div(_templateObject$
|
|
40248
|
-
var DetailsTabHeader = styled.div(_templateObject2$
|
|
41026
|
+
var Container$r = styled.div(_templateObject$U || (_templateObject$U = _taggedTemplateLiteralLoose(["\n min-height: calc(100vh - 64px);\n"])));
|
|
41027
|
+
var DetailsTabHeader = styled.div(_templateObject2$N || (_templateObject2$N = _taggedTemplateLiteralLoose(["\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid ", ";\n background-color: ", ";\n display: flex;\n justify-content: space-between;\n position: sticky;\n top: 0;\n z-index: 12;\n /* width */\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n /* Handle on hover */\n &::-webkit-scrollbar-thumb:hover {\n background: transparent;\n }\n button {\n position: relative;\n border: none;\n background: transparent;\n outline: none;\n height: 44px;\n text-transform: capitalize;\n font-style: normal;\n font-weight: 500;\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n min-width: ", ";\n cursor: pointer;\n }\n\n & span {\n position: relative;\n display: inline-flex;\n align-items: center;\n height: 100%;\n }\n\n & .active span {\n color: ", ";\n\n &:after {\n content: '';\n width: 100%;\n border-radius: 2px;\n height: 2px;\n background-color: ", ";\n position: absolute;\n top: calc(100% - 1px);\n left: 0;\n }\n }\n"])), function (props) {
|
|
40249
41028
|
return props.borderColor;
|
|
40250
41029
|
}, function (props) {
|
|
40251
41030
|
return props.backgroundColor || 'transparent';
|
|
@@ -40263,17 +41042,17 @@ var DetailsTabHeader = styled.div(_templateObject2$M || (_templateObject2$M = _t
|
|
|
40263
41042
|
return props.activeTabColor;
|
|
40264
41043
|
});
|
|
40265
41044
|
|
|
40266
|
-
var _templateObject$
|
|
40267
|
-
var Container$s = styled.div(_templateObject$
|
|
41045
|
+
var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z;
|
|
41046
|
+
var Container$s = styled.div(_templateObject$V || (_templateObject$V = _taggedTemplateLiteralLoose(["\n ", ";\n height: ", ";\n position: absolute;\n padding: 24px 16px;\n background-color: ", ";\n z-index: 25;\n"])), function (props) {
|
|
40268
41047
|
return props.active ? 'display: block' : 'display: none';
|
|
40269
41048
|
}, function (props) {
|
|
40270
41049
|
return "calc(100vh - " + (props.heightOffset ? props.heightOffset + 48 : 48) + "px)";
|
|
40271
41050
|
}, function (props) {
|
|
40272
41051
|
return props.backgroundColor;
|
|
40273
41052
|
});
|
|
40274
|
-
var AvatarCont = styled.div(_templateObject2$
|
|
40275
|
-
var DropDownWrapper = styled.div(_templateObject3$
|
|
40276
|
-
var EditChannelFooter = styled(ButtonBlock)(_templateObject4$
|
|
41053
|
+
var AvatarCont = styled.div(_templateObject2$O || (_templateObject2$O = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n margin-bottom: 4px;\n\n &::after {\n content: '';\n position: absolute;\n width: 120px;\n height: 120px;\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.4);\n }\n .dropdown-body {\n top: inherit;\n right: inherit;\n bottom: -90px;\n }\n"])));
|
|
41054
|
+
var DropDownWrapper = styled.div(_templateObject3$F || (_templateObject3$F = _taggedTemplateLiteralLoose(["\n position: absolute;\n z-index: 4;\n width: 40px;\n height: 40px;\n"])));
|
|
41055
|
+
var EditChannelFooter = styled(ButtonBlock)(_templateObject4$z || (_templateObject4$z = _taggedTemplateLiteralLoose(["\n margin-top: 24px;\n\n & > button {\n margin-left: 12px;\n }\n"])));
|
|
40277
41056
|
var EditChannel = function EditChannel(_ref) {
|
|
40278
41057
|
var channel = _ref.channel,
|
|
40279
41058
|
theme = _ref.theme,
|
|
@@ -40528,7 +41307,7 @@ var EditChannel = function EditChannel(_ref) {
|
|
|
40528
41307
|
})));
|
|
40529
41308
|
};
|
|
40530
41309
|
|
|
40531
|
-
var _templateObject$
|
|
41310
|
+
var _templateObject$W, _templateObject2$P, _templateObject3$G, _templateObject4$A, _templateObject5$v, _templateObject6$q, _templateObject7$o, _templateObject8$m, _templateObject9$h, _templateObject0$f, _templateObject1$c, _templateObject10$7;
|
|
40532
41311
|
var Details = function Details(_ref) {
|
|
40533
41312
|
var _activeChannel$member;
|
|
40534
41313
|
var detailsTitleText = _ref.detailsTitleText,
|
|
@@ -40915,17 +41694,17 @@ var Details = function Details(_ref) {
|
|
|
40915
41694
|
onTabChange: handleTabChange
|
|
40916
41695
|
}))));
|
|
40917
41696
|
};
|
|
40918
|
-
var Container$t = styled.div(_templateObject$
|
|
41697
|
+
var Container$t = styled.div(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose(["\n flex: 0 0 auto;\n width: 0;\n border-left: 1px solid ", ";\n //transition: all 0.1s;\n ", "\n background-color: ", ";\n}\n"])), function (props) {
|
|
40919
41698
|
return props.borderColor;
|
|
40920
41699
|
}, function (props) {
|
|
40921
41700
|
return props.mounted && " width: " + (props.size === 'small' ? '300px' : props.size === 'medium' ? '350px' : '400px') + ";";
|
|
40922
41701
|
}, function (props) {
|
|
40923
41702
|
return props.backgroundColor;
|
|
40924
41703
|
});
|
|
40925
|
-
var ChannelDetailsHeader = styled.div(_templateObject2$
|
|
41704
|
+
var ChannelDetailsHeader = styled.div(_templateObject2$P || (_templateObject2$P = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 16px;\n position: relative;\n height: 64px;\n box-sizing: border-box;\n border-bottom: 1px solid ", ";\n\n & svg {\n cursor: pointer;\n }\n"])), function (props) {
|
|
40926
41705
|
return props.borderColor;
|
|
40927
41706
|
});
|
|
40928
|
-
var ChatDetails = styled.div(_templateObject3$
|
|
41707
|
+
var ChatDetails = styled.div(_templateObject3$G || (_templateObject3$G = _taggedTemplateLiteralLoose(["\n //position: relative;\n width: ", ";\n //height: ", ";\n height: ", ";\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
40929
41708
|
return props.size === 'small' ? '300px' : props.size === 'medium' ? '350px' : '400px';
|
|
40930
41709
|
}, function (props) {
|
|
40931
41710
|
return props.height ? "calc(100vh - " + props.heightOffset + "px)" : '100vh';
|
|
@@ -40934,37 +41713,37 @@ var ChatDetails = styled.div(_templateObject3$F || (_templateObject3$F = _tagged
|
|
|
40934
41713
|
}, function (props) {
|
|
40935
41714
|
return props.thumbColor;
|
|
40936
41715
|
});
|
|
40937
|
-
var AboutChannel = styled.div(_templateObject4$
|
|
40938
|
-
var AboutChannelTitle = styled.h4(_templateObject5$
|
|
41716
|
+
var AboutChannel = styled.div(_templateObject4$A || (_templateObject4$A = _taggedTemplateLiteralLoose(["\n margin-top: 20px;\n"])));
|
|
41717
|
+
var AboutChannelTitle = styled.h4(_templateObject5$v || (_templateObject5$v = _taggedTemplateLiteralLoose(["\n font-size: 12px;\n margin: 0;\n line-height: 16px;\n color: ", ";\n"])), function (props) {
|
|
40939
41718
|
return props.color;
|
|
40940
41719
|
});
|
|
40941
|
-
var AboutChannelText = styled.h3(_templateObject6$
|
|
41720
|
+
var AboutChannelText = styled.h3(_templateObject6$q || (_templateObject6$q = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n margin: 0;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
|
|
40942
41721
|
return props.color;
|
|
40943
41722
|
});
|
|
40944
|
-
var ChannelInfo$4 = styled.div(_templateObject7$
|
|
41723
|
+
var ChannelInfo$4 = styled.div(_templateObject7$o || (_templateObject7$o = _taggedTemplateLiteralLoose(["\n position: relative;\n margin-left: ", ";\n margin-top: ", ";\n text-align: ", ";\n"])), function (props) {
|
|
40945
41724
|
return (!props.direction || props.direction !== 'column') && '16px';
|
|
40946
41725
|
}, function (props) {
|
|
40947
41726
|
return props.direction && props.direction === 'column' && '16px';
|
|
40948
41727
|
}, function (props) {
|
|
40949
41728
|
return props.direction && props.direction === 'column' && 'center';
|
|
40950
41729
|
});
|
|
40951
|
-
var DetailsHeader = styled.div(_templateObject8$
|
|
41730
|
+
var DetailsHeader = styled.div(_templateObject8$m || (_templateObject8$m = _taggedTemplateLiteralLoose(["\n border-bottom: 6px solid ", ";\n align-items: center;\n box-sizing: border-box;\n padding: 20px 16px;\n"])), function (props) {
|
|
40952
41731
|
return props.borderColor;
|
|
40953
41732
|
});
|
|
40954
|
-
var ChannelAvatarAndName = styled.div(_templateObject9$
|
|
41733
|
+
var ChannelAvatarAndName = styled.div(_templateObject9$h || (_templateObject9$h = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n align-items: center;\n box-sizing: border-box;\n flex-direction: ", ";\n"])), function (props) {
|
|
40955
41734
|
return props.direction;
|
|
40956
41735
|
});
|
|
40957
|
-
var ChannelName$1 = styled(SectionHeader)(_templateObject0$
|
|
41736
|
+
var ChannelName$1 = styled(SectionHeader)(_templateObject0$f || (_templateObject0$f = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n max-width: ", ";\n text-overflow: ellipsis;\n text-color: ", ";\n overflow: hidden;\n text-transform: ", ";\n"])), function (props) {
|
|
40958
41737
|
return props.isDirect ? '200px' : '168px';
|
|
40959
41738
|
}, function (props) {
|
|
40960
41739
|
return props.color;
|
|
40961
41740
|
}, function (props) {
|
|
40962
41741
|
return props.uppercase && 'uppercase';
|
|
40963
41742
|
});
|
|
40964
|
-
var ChannelNameWrapper = styled.div(_templateObject1$
|
|
41743
|
+
var ChannelNameWrapper = styled.div(_templateObject1$c || (_templateObject1$c = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
|
|
40965
41744
|
var EditButton = styled.span(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
|
|
40966
41745
|
|
|
40967
|
-
var _templateObject$
|
|
41746
|
+
var _templateObject$X;
|
|
40968
41747
|
var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
40969
41748
|
var _ref$size = _ref.size,
|
|
40970
41749
|
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
@@ -41193,7 +41972,7 @@ var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
|
41193
41972
|
showPhoneNumber: showPhoneNumber
|
|
41194
41973
|
})));
|
|
41195
41974
|
};
|
|
41196
|
-
var DetailsWrapper = styled.div(_templateObject$
|
|
41975
|
+
var DetailsWrapper = styled.div(_templateObject$X || (_templateObject$X = _taggedTemplateLiteralLoose([""])));
|
|
41197
41976
|
|
|
41198
41977
|
var _path$1s;
|
|
41199
41978
|
function _extends$1w() {
|
|
@@ -41217,7 +41996,7 @@ function SvgChevronDown(props) {
|
|
|
41217
41996
|
})));
|
|
41218
41997
|
}
|
|
41219
41998
|
|
|
41220
|
-
var _templateObject$
|
|
41999
|
+
var _templateObject$Y, _templateObject2$Q;
|
|
41221
42000
|
var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
41222
42001
|
var buttonIcon = _ref.buttonIcon,
|
|
41223
42002
|
buttonWidth = _ref.buttonWidth,
|
|
@@ -41300,7 +42079,7 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
41300
42079
|
isMuted: channel.muted
|
|
41301
42080
|
}, channel.newMessageCount ? channel.newMessageCount > 99 ? '99+' : channel.newMessageCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgChevronDown, null)));
|
|
41302
42081
|
};
|
|
41303
|
-
var BottomButton = styled.div(_templateObject$
|
|
42082
|
+
var BottomButton = styled.div(_templateObject$Y || (_templateObject$Y = _taggedTemplateLiteralLoose(["\n transition: all 0.3s ease-in-out;\n position: absolute;\n ", ";\n\n ", ";\n\n ", ";\n right: ", "px;\n\n margin-right: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 50px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n z-index: 14;\n & > svg {\n color: rgba(129, 140, 153, 1);\n }\n\n & > span {\n bottom: 32px;\n right: 0;\n }\n"])), function (props) {
|
|
41304
42083
|
return props.animateFrom === 'bottom' && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) - 130) + "px";
|
|
41305
42084
|
}, function (props) {
|
|
41306
42085
|
return props.animateFrom === 'right' && "right: " + (props.rightPosition === undefined ? 16 : props.rightPosition - 100) + "px";
|
|
@@ -41311,7 +42090,7 @@ var BottomButton = styled.div(_templateObject$X || (_templateObject$X = _taggedT
|
|
|
41311
42090
|
}, function (props) {
|
|
41312
42091
|
return props.backgroundColor;
|
|
41313
42092
|
});
|
|
41314
|
-
var UnreadCount$1 = styled.span(_templateObject2$
|
|
42093
|
+
var UnreadCount$1 = styled.span(_templateObject2$Q || (_templateObject2$Q = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 11px;\n right: 16px;\n flex: 0 0 auto;\n margin-left: auto;\n background-color: ", ";\n padding: 0 4px;\n font-size: ", ";\n line-height: 20px;\n min-width: ", ";\n height: ", ";\n text-align: center;\n font-weight: 500;\n color: ", ";\n border-radius: 10px;\n box-sizing: border-box;\n"])), function (props) {
|
|
41315
42094
|
return props.backgroundColor;
|
|
41316
42095
|
}, function (props) {
|
|
41317
42096
|
return props.fontSize || '13px';
|
|
@@ -41354,7 +42133,7 @@ function SvgMention(props) {
|
|
|
41354
42133
|
})));
|
|
41355
42134
|
}
|
|
41356
42135
|
|
|
41357
|
-
var _templateObject$
|
|
42136
|
+
var _templateObject$Z, _templateObject2$R;
|
|
41358
42137
|
var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentionsButton(_ref) {
|
|
41359
42138
|
var buttonIcon = _ref.buttonIcon,
|
|
41360
42139
|
buttonWidth = _ref.buttonWidth,
|
|
@@ -41497,7 +42276,7 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
41497
42276
|
isMuted: channel.muted
|
|
41498
42277
|
}, channel.newMentionCount ? channel.newMentionCount > 99 ? '99+' : channel.newMentionCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgMention, null)));
|
|
41499
42278
|
};
|
|
41500
|
-
var BottomButton$1 = styled.div(_templateObject$
|
|
42279
|
+
var BottomButton$1 = styled.div(_templateObject$Z || (_templateObject$Z = _taggedTemplateLiteralLoose(["\n transition: all 0.3s ease-in-out;\n position: absolute;\n ", ";\n\n ", ";\n\n ", ";\n right: ", ";\n margin-right: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 50px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n z-index: 14;\n\n & > svg {\n color: rgba(129, 140, 153, 1);\n }\n\n & > span {\n bottom: 32px;\n right: 0;\n }\n"])), function (props) {
|
|
41501
42280
|
return props.animateFrom === 'bottom' && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) + (props.showsUnreadMentionsButton ? 60 : 0) - 180) + "px";
|
|
41502
42281
|
}, function (props) {
|
|
41503
42282
|
return props.animateFrom === 'right' && "right: " + (props.rightPosition === undefined ? 16 : props.rightPosition - 100) + "px";
|
|
@@ -41508,7 +42287,7 @@ var BottomButton$1 = styled.div(_templateObject$Y || (_templateObject$Y = _tagge
|
|
|
41508
42287
|
}, function (props) {
|
|
41509
42288
|
return props.backgroundColor;
|
|
41510
42289
|
});
|
|
41511
|
-
var UnreadCount$2 = styled.span(_templateObject2$
|
|
42290
|
+
var UnreadCount$2 = styled.span(_templateObject2$R || (_templateObject2$R = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 11px;\n right: 16px;\n flex: 0 0 auto;\n margin-left: auto;\n background-color: ", ";\n padding: 0 4px;\n font-size: ", ";\n line-height: 20px;\n min-width: ", ";\n height: ", ";\n text-align: center;\n font-weight: 500;\n color: ", ";\n border-radius: 10px;\n box-sizing: border-box;\n"])), function (props) {
|
|
41512
42291
|
return props.backgroundColor;
|
|
41513
42292
|
}, function (props) {
|
|
41514
42293
|
return props.fontSize || '13px';
|