sceyt-chat-react-uikit 1.7.2-beta.7 → 1.7.2-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +56 -88
- package/index.modern.js +56 -69
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
2
2
|
|
|
3
|
-
function _interopNamespace(e) {
|
|
4
|
-
if (e && e.__esModule) { return e; } else {
|
|
5
|
-
var n = {};
|
|
6
|
-
if (e) {
|
|
7
|
-
Object.keys(e).forEach(function (k) {
|
|
8
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return e[k];
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
n['default'] = e;
|
|
18
|
-
return n;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
3
|
var React = require('react');
|
|
23
4
|
var React__default = _interopDefault(React);
|
|
24
5
|
var reactRedux = require('react-redux');
|
|
@@ -44,6 +25,7 @@ var LexicalOnChangePlugin = require('@lexical/react/LexicalOnChangePlugin');
|
|
|
44
25
|
var ReactDOM = require('react-dom');
|
|
45
26
|
var LexicalTypeaheadMenuPlugin = require('@lexical/react/LexicalTypeaheadMenuPlugin');
|
|
46
27
|
var offset = require('@lexical/offset');
|
|
28
|
+
var MicRecorder = _interopDefault(require('mic-recorder-to-mp3'));
|
|
47
29
|
var LexicalHistoryPlugin = require('@lexical/react/LexicalHistoryPlugin');
|
|
48
30
|
|
|
49
31
|
// src/utils/formatProdErrorMessage.ts
|
|
@@ -17845,16 +17827,14 @@ function sendTextMessage(action) {
|
|
|
17845
17827
|
case 16:
|
|
17846
17828
|
throw new Error('Connection required to send message');
|
|
17847
17829
|
case 17:
|
|
17830
|
+
store.dispatch(getMessagesAC(channel, true, channel.lastMessage.id, undefined, undefined, false));
|
|
17848
17831
|
_context4.n = 18;
|
|
17849
|
-
return effects.put(scrollToNewMessageAC(true));
|
|
17850
|
-
case 18:
|
|
17851
|
-
_context4.n = 19;
|
|
17852
17832
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
17853
|
-
case
|
|
17854
|
-
_context4.n =
|
|
17833
|
+
case 18:
|
|
17834
|
+
_context4.n = 21;
|
|
17855
17835
|
break;
|
|
17856
|
-
case
|
|
17857
|
-
_context4.p =
|
|
17836
|
+
case 19:
|
|
17837
|
+
_context4.p = 19;
|
|
17858
17838
|
_t3 = _context4.v;
|
|
17859
17839
|
log.error('error on send text message ... ', _t3);
|
|
17860
17840
|
updateMessageOnMap(channel.id, {
|
|
@@ -17864,23 +17844,23 @@ function sendTextMessage(action) {
|
|
|
17864
17844
|
}
|
|
17865
17845
|
});
|
|
17866
17846
|
if (!(activeChannelId === channel.id)) {
|
|
17867
|
-
_context4.n =
|
|
17847
|
+
_context4.n = 20;
|
|
17868
17848
|
break;
|
|
17869
17849
|
}
|
|
17870
17850
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
17871
17851
|
state: MESSAGE_STATUS.FAILED
|
|
17872
17852
|
});
|
|
17873
|
-
_context4.n =
|
|
17853
|
+
_context4.n = 20;
|
|
17874
17854
|
return effects.put(updateMessageAC(sendMessageTid, {
|
|
17875
17855
|
state: MESSAGE_STATUS.FAILED
|
|
17876
17856
|
}));
|
|
17877
|
-
case
|
|
17878
|
-
_context4.n =
|
|
17857
|
+
case 20:
|
|
17858
|
+
_context4.n = 21;
|
|
17879
17859
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
17880
|
-
case
|
|
17860
|
+
case 21:
|
|
17881
17861
|
return _context4.a(2);
|
|
17882
17862
|
}
|
|
17883
|
-
}, _marked2$2, null, [[3,
|
|
17863
|
+
}, _marked2$2, null, [[3, 19]]);
|
|
17884
17864
|
}
|
|
17885
17865
|
function forwardMessage(action) {
|
|
17886
17866
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
@@ -26417,21 +26397,15 @@ function ReactionsPopup(_ref) {
|
|
|
26417
26397
|
var _useState = React.useState('all'),
|
|
26418
26398
|
activeTabKey = _useState[0],
|
|
26419
26399
|
setActiveTabKey = _useState[1];
|
|
26420
|
-
var _useState2 = React.useState(
|
|
26421
|
-
|
|
26422
|
-
|
|
26423
|
-
var _useState3 = React.useState(
|
|
26424
|
-
|
|
26425
|
-
|
|
26426
|
-
var _useState4 = React.useState(
|
|
26427
|
-
|
|
26428
|
-
|
|
26429
|
-
var _useState5 = React.useState(false),
|
|
26430
|
-
calculateSizes = _useState5[0],
|
|
26431
|
-
setCalculateSizes = _useState5[1];
|
|
26432
|
-
var _useState6 = React.useState(false),
|
|
26433
|
-
closeIsApproved = _useState6[0],
|
|
26434
|
-
setCloseIsApproved = _useState6[1];
|
|
26400
|
+
var _useState2 = React.useState(0),
|
|
26401
|
+
popupHeight = _useState2[0],
|
|
26402
|
+
setPopupHeight = _useState2[1];
|
|
26403
|
+
var _useState3 = React.useState(false),
|
|
26404
|
+
calculateSizes = _useState3[0],
|
|
26405
|
+
setCalculateSizes = _useState3[1];
|
|
26406
|
+
var _useState4 = React.useState(false),
|
|
26407
|
+
closeIsApproved = _useState4[0],
|
|
26408
|
+
setCloseIsApproved = _useState4[1];
|
|
26435
26409
|
var totalReactions = 0;
|
|
26436
26410
|
if (reactionTotals) {
|
|
26437
26411
|
reactionTotals.forEach(function (summery) {
|
|
@@ -26440,9 +26414,9 @@ function ReactionsPopup(_ref) {
|
|
|
26440
26414
|
}
|
|
26441
26415
|
var user = getClient().user;
|
|
26442
26416
|
var dispatch = useDispatch();
|
|
26443
|
-
var
|
|
26444
|
-
isScrolling =
|
|
26445
|
-
setIsScrolling =
|
|
26417
|
+
var _useState5 = React.useState(false),
|
|
26418
|
+
isScrolling = _useState5[0],
|
|
26419
|
+
setIsScrolling = _useState5[1];
|
|
26446
26420
|
var handleReactionsListScroll = function handleReactionsListScroll(event) {
|
|
26447
26421
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100 && reactionsHasNext) {
|
|
26448
26422
|
if (reactionsLoadingState === LOADING_STATE.LOADED) {
|
|
@@ -26471,20 +26445,23 @@ function ReactionsPopup(_ref) {
|
|
|
26471
26445
|
dispatch(setReactionsListAC([], true));
|
|
26472
26446
|
};
|
|
26473
26447
|
}, [messageId]);
|
|
26474
|
-
React.
|
|
26448
|
+
var scoresHeight = React.useMemo(function () {
|
|
26475
26449
|
var scoresElem = scoresRef.current;
|
|
26476
26450
|
if (scoresElem) {
|
|
26477
|
-
|
|
26451
|
+
return scoresElem.offsetHeight;
|
|
26478
26452
|
}
|
|
26479
|
-
|
|
26453
|
+
return 0;
|
|
26454
|
+
}, [scoresRef]);
|
|
26480
26455
|
React.useEffect(function () {
|
|
26481
26456
|
if (!reactionTotals || !reactionTotals.length) {
|
|
26482
26457
|
handleReactionsPopupClose();
|
|
26483
26458
|
}
|
|
26484
26459
|
}, [reactionTotals]);
|
|
26460
|
+
var reactionsHeight = React.useMemo(function () {
|
|
26461
|
+
return reactions.length * 50 + 45;
|
|
26462
|
+
}, [reactions]);
|
|
26485
26463
|
React.useEffect(function () {
|
|
26486
26464
|
if (reactions && reactionsPrevLength < reactions.length) {
|
|
26487
|
-
var reactionsHeight = reactions.length * 44 + 45;
|
|
26488
26465
|
if (reactionsHeight > popupHeight) {
|
|
26489
26466
|
setPopupHeight(reactionsHeight);
|
|
26490
26467
|
}
|
|
@@ -26494,14 +26471,15 @@ function ReactionsPopup(_ref) {
|
|
|
26494
26471
|
}
|
|
26495
26472
|
if (reactions && reactions.length) {
|
|
26496
26473
|
if (calculateSizes) {
|
|
26497
|
-
|
|
26498
|
-
var _reactionsHeight = reactions.length * 50 + 45;
|
|
26499
|
-
setPopupHeight(_reactionsHeight);
|
|
26500
|
-
setPopupVerticalPosition(botPost >= (_reactionsHeight > 320 ? 320 : _reactionsHeight) ? 'bottom' : 'top');
|
|
26474
|
+
setPopupHeight(reactionsHeight);
|
|
26501
26475
|
setCalculateSizes(false);
|
|
26502
26476
|
}
|
|
26503
26477
|
}
|
|
26504
|
-
}, [reactions]);
|
|
26478
|
+
}, [reactions, reactionsHeight]);
|
|
26479
|
+
var popupVerticalPosition = React.useMemo(function () {
|
|
26480
|
+
var botPost = bottomPosition - messageInputHeight - 40;
|
|
26481
|
+
return botPost >= (reactionsHeight > 320 ? 320 : reactionsHeight) ? 'bottom' : 'top';
|
|
26482
|
+
}, [bottomPosition, messageInputHeight, reactionsHeight]);
|
|
26505
26483
|
return /*#__PURE__*/React__default.createElement(Container$d, {
|
|
26506
26484
|
ref: popupRef,
|
|
26507
26485
|
popupVerticalPosition: popupVerticalPosition,
|
|
@@ -26559,7 +26537,10 @@ function ReactionsPopup(_ref) {
|
|
|
26559
26537
|
}, reactions.map(function (reaction) {
|
|
26560
26538
|
return /*#__PURE__*/React__default.createElement(ReactionItem$1, {
|
|
26561
26539
|
key: reaction.id,
|
|
26562
|
-
hoverBackgroundColor: backgroundHovered
|
|
26540
|
+
hoverBackgroundColor: backgroundHovered,
|
|
26541
|
+
onClick: function onClick() {
|
|
26542
|
+
return handleAddDeleteEmoji(reaction.key);
|
|
26543
|
+
}
|
|
26563
26544
|
}, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
26564
26545
|
name: reaction.user.firstName || reaction.user.id,
|
|
26565
26546
|
image: reaction.user.avatarUrl,
|
|
@@ -26570,11 +26551,7 @@ function ReactionsPopup(_ref) {
|
|
|
26570
26551
|
color: textPrimary
|
|
26571
26552
|
}, makeUsername(reaction.user.id === user.id ? reaction.user : contactsMap[reaction.user.id], reaction.user, getFromContacts)), /*#__PURE__*/React__default.createElement(SubTitle, {
|
|
26572
26553
|
color: textSecondary
|
|
26573
|
-
}, 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,
|
|
26574
|
-
onClick: function onClick() {
|
|
26575
|
-
return handleAddDeleteEmoji(reaction.key);
|
|
26576
|
-
}
|
|
26577
|
-
}, reaction.key));
|
|
26554
|
+
}, 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));
|
|
26578
26555
|
})));
|
|
26579
26556
|
}
|
|
26580
26557
|
var Container$d = styled__default.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) {
|
|
@@ -26644,7 +26621,7 @@ var ReactionScoreItem = styled__default.div(_templateObject8$9 || (_templateObje
|
|
|
26644
26621
|
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 ";
|
|
26645
26622
|
}, TabKey);
|
|
26646
26623
|
var ReactionKey = styled__default.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"])));
|
|
26647
|
-
var ReactionItem$1 = styled__default.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) {
|
|
26624
|
+
var ReactionItem$1 = styled__default.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) {
|
|
26648
26625
|
return props.hoverBackgroundColor;
|
|
26649
26626
|
}, UserStatus);
|
|
26650
26627
|
|
|
@@ -36510,29 +36487,20 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
36510
36487
|
}, [currentRecordedFile, currentChannelId]);
|
|
36511
36488
|
React.useEffect(function () {
|
|
36512
36489
|
if (!currentRecordedFile) {
|
|
36513
|
-
|
|
36514
|
-
|
|
36515
|
-
|
|
36516
|
-
|
|
36517
|
-
|
|
36518
|
-
|
|
36519
|
-
|
|
36520
|
-
|
|
36521
|
-
|
|
36522
|
-
|
|
36523
|
-
setRecorder(recorder);
|
|
36524
|
-
});
|
|
36525
|
-
}, function (e) {
|
|
36526
|
-
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
36527
|
-
});
|
|
36528
|
-
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
36529
|
-
}
|
|
36530
|
-
}();
|
|
36531
|
-
return _temp5 && _temp5.then ? _temp5.then(function () {}) : void 0;
|
|
36532
|
-
} catch (e) {
|
|
36533
|
-
Promise.reject(e);
|
|
36490
|
+
try {
|
|
36491
|
+
if (!recorder) {
|
|
36492
|
+
try {
|
|
36493
|
+
var newRecorder = new MicRecorder({
|
|
36494
|
+
bitRate: 128
|
|
36495
|
+
});
|
|
36496
|
+
setRecorder(newRecorder);
|
|
36497
|
+
} catch (e) {
|
|
36498
|
+
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
36499
|
+
}
|
|
36534
36500
|
}
|
|
36535
|
-
}
|
|
36501
|
+
} catch (e) {
|
|
36502
|
+
Promise.reject(e);
|
|
36503
|
+
}
|
|
36536
36504
|
}
|
|
36537
36505
|
}, [currentRecordedFile]);
|
|
36538
36506
|
React.useEffect(function () {
|
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
|
|
@@ -17824,16 +17825,14 @@ function sendTextMessage(action) {
|
|
|
17824
17825
|
case 16:
|
|
17825
17826
|
throw new Error('Connection required to send message');
|
|
17826
17827
|
case 17:
|
|
17828
|
+
store.dispatch(getMessagesAC(channel, true, channel.lastMessage.id, undefined, undefined, false));
|
|
17827
17829
|
_context4.n = 18;
|
|
17828
|
-
return put(scrollToNewMessageAC(true));
|
|
17829
|
-
case 18:
|
|
17830
|
-
_context4.n = 19;
|
|
17831
17830
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
17832
|
-
case
|
|
17833
|
-
_context4.n =
|
|
17831
|
+
case 18:
|
|
17832
|
+
_context4.n = 21;
|
|
17834
17833
|
break;
|
|
17835
|
-
case
|
|
17836
|
-
_context4.p =
|
|
17834
|
+
case 19:
|
|
17835
|
+
_context4.p = 19;
|
|
17837
17836
|
_t3 = _context4.v;
|
|
17838
17837
|
log.error('error on send text message ... ', _t3);
|
|
17839
17838
|
updateMessageOnMap(channel.id, {
|
|
@@ -17843,23 +17842,23 @@ function sendTextMessage(action) {
|
|
|
17843
17842
|
}
|
|
17844
17843
|
});
|
|
17845
17844
|
if (!(activeChannelId === channel.id)) {
|
|
17846
|
-
_context4.n =
|
|
17845
|
+
_context4.n = 20;
|
|
17847
17846
|
break;
|
|
17848
17847
|
}
|
|
17849
17848
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
17850
17849
|
state: MESSAGE_STATUS.FAILED
|
|
17851
17850
|
});
|
|
17852
|
-
_context4.n =
|
|
17851
|
+
_context4.n = 20;
|
|
17853
17852
|
return put(updateMessageAC(sendMessageTid, {
|
|
17854
17853
|
state: MESSAGE_STATUS.FAILED
|
|
17855
17854
|
}));
|
|
17856
|
-
case
|
|
17857
|
-
_context4.n =
|
|
17855
|
+
case 20:
|
|
17856
|
+
_context4.n = 21;
|
|
17858
17857
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
17859
|
-
case
|
|
17858
|
+
case 21:
|
|
17860
17859
|
return _context4.a(2);
|
|
17861
17860
|
}
|
|
17862
|
-
}, _marked2$2, null, [[3,
|
|
17861
|
+
}, _marked2$2, null, [[3, 19]]);
|
|
17863
17862
|
}
|
|
17864
17863
|
function forwardMessage(action) {
|
|
17865
17864
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
@@ -26396,21 +26395,15 @@ function ReactionsPopup(_ref) {
|
|
|
26396
26395
|
var _useState = useState('all'),
|
|
26397
26396
|
activeTabKey = _useState[0],
|
|
26398
26397
|
setActiveTabKey = _useState[1];
|
|
26399
|
-
var _useState2 = useState(
|
|
26400
|
-
|
|
26401
|
-
|
|
26402
|
-
var _useState3 = useState(
|
|
26403
|
-
|
|
26404
|
-
|
|
26405
|
-
var _useState4 = useState(
|
|
26406
|
-
|
|
26407
|
-
|
|
26408
|
-
var _useState5 = useState(false),
|
|
26409
|
-
calculateSizes = _useState5[0],
|
|
26410
|
-
setCalculateSizes = _useState5[1];
|
|
26411
|
-
var _useState6 = useState(false),
|
|
26412
|
-
closeIsApproved = _useState6[0],
|
|
26413
|
-
setCloseIsApproved = _useState6[1];
|
|
26398
|
+
var _useState2 = useState(0),
|
|
26399
|
+
popupHeight = _useState2[0],
|
|
26400
|
+
setPopupHeight = _useState2[1];
|
|
26401
|
+
var _useState3 = useState(false),
|
|
26402
|
+
calculateSizes = _useState3[0],
|
|
26403
|
+
setCalculateSizes = _useState3[1];
|
|
26404
|
+
var _useState4 = useState(false),
|
|
26405
|
+
closeIsApproved = _useState4[0],
|
|
26406
|
+
setCloseIsApproved = _useState4[1];
|
|
26414
26407
|
var totalReactions = 0;
|
|
26415
26408
|
if (reactionTotals) {
|
|
26416
26409
|
reactionTotals.forEach(function (summery) {
|
|
@@ -26419,9 +26412,9 @@ function ReactionsPopup(_ref) {
|
|
|
26419
26412
|
}
|
|
26420
26413
|
var user = getClient().user;
|
|
26421
26414
|
var dispatch = useDispatch();
|
|
26422
|
-
var
|
|
26423
|
-
isScrolling =
|
|
26424
|
-
setIsScrolling =
|
|
26415
|
+
var _useState5 = useState(false),
|
|
26416
|
+
isScrolling = _useState5[0],
|
|
26417
|
+
setIsScrolling = _useState5[1];
|
|
26425
26418
|
var handleReactionsListScroll = function handleReactionsListScroll(event) {
|
|
26426
26419
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100 && reactionsHasNext) {
|
|
26427
26420
|
if (reactionsLoadingState === LOADING_STATE.LOADED) {
|
|
@@ -26450,20 +26443,23 @@ function ReactionsPopup(_ref) {
|
|
|
26450
26443
|
dispatch(setReactionsListAC([], true));
|
|
26451
26444
|
};
|
|
26452
26445
|
}, [messageId]);
|
|
26453
|
-
|
|
26446
|
+
var scoresHeight = useMemo(function () {
|
|
26454
26447
|
var scoresElem = scoresRef.current;
|
|
26455
26448
|
if (scoresElem) {
|
|
26456
|
-
|
|
26449
|
+
return scoresElem.offsetHeight;
|
|
26457
26450
|
}
|
|
26458
|
-
|
|
26451
|
+
return 0;
|
|
26452
|
+
}, [scoresRef]);
|
|
26459
26453
|
useEffect(function () {
|
|
26460
26454
|
if (!reactionTotals || !reactionTotals.length) {
|
|
26461
26455
|
handleReactionsPopupClose();
|
|
26462
26456
|
}
|
|
26463
26457
|
}, [reactionTotals]);
|
|
26458
|
+
var reactionsHeight = useMemo(function () {
|
|
26459
|
+
return reactions.length * 50 + 45;
|
|
26460
|
+
}, [reactions]);
|
|
26464
26461
|
useEffect(function () {
|
|
26465
26462
|
if (reactions && reactionsPrevLength < reactions.length) {
|
|
26466
|
-
var reactionsHeight = reactions.length * 44 + 45;
|
|
26467
26463
|
if (reactionsHeight > popupHeight) {
|
|
26468
26464
|
setPopupHeight(reactionsHeight);
|
|
26469
26465
|
}
|
|
@@ -26473,14 +26469,15 @@ function ReactionsPopup(_ref) {
|
|
|
26473
26469
|
}
|
|
26474
26470
|
if (reactions && reactions.length) {
|
|
26475
26471
|
if (calculateSizes) {
|
|
26476
|
-
|
|
26477
|
-
var _reactionsHeight = reactions.length * 50 + 45;
|
|
26478
|
-
setPopupHeight(_reactionsHeight);
|
|
26479
|
-
setPopupVerticalPosition(botPost >= (_reactionsHeight > 320 ? 320 : _reactionsHeight) ? 'bottom' : 'top');
|
|
26472
|
+
setPopupHeight(reactionsHeight);
|
|
26480
26473
|
setCalculateSizes(false);
|
|
26481
26474
|
}
|
|
26482
26475
|
}
|
|
26483
|
-
}, [reactions]);
|
|
26476
|
+
}, [reactions, reactionsHeight]);
|
|
26477
|
+
var popupVerticalPosition = useMemo(function () {
|
|
26478
|
+
var botPost = bottomPosition - messageInputHeight - 40;
|
|
26479
|
+
return botPost >= (reactionsHeight > 320 ? 320 : reactionsHeight) ? 'bottom' : 'top';
|
|
26480
|
+
}, [bottomPosition, messageInputHeight, reactionsHeight]);
|
|
26484
26481
|
return /*#__PURE__*/React__default.createElement(Container$d, {
|
|
26485
26482
|
ref: popupRef,
|
|
26486
26483
|
popupVerticalPosition: popupVerticalPosition,
|
|
@@ -26538,7 +26535,10 @@ function ReactionsPopup(_ref) {
|
|
|
26538
26535
|
}, reactions.map(function (reaction) {
|
|
26539
26536
|
return /*#__PURE__*/React__default.createElement(ReactionItem$1, {
|
|
26540
26537
|
key: reaction.id,
|
|
26541
|
-
hoverBackgroundColor: backgroundHovered
|
|
26538
|
+
hoverBackgroundColor: backgroundHovered,
|
|
26539
|
+
onClick: function onClick() {
|
|
26540
|
+
return handleAddDeleteEmoji(reaction.key);
|
|
26541
|
+
}
|
|
26542
26542
|
}, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
|
|
26543
26543
|
name: reaction.user.firstName || reaction.user.id,
|
|
26544
26544
|
image: reaction.user.avatarUrl,
|
|
@@ -26549,11 +26549,7 @@ function ReactionsPopup(_ref) {
|
|
|
26549
26549
|
color: textPrimary
|
|
26550
26550
|
}, makeUsername(reaction.user.id === user.id ? reaction.user : contactsMap[reaction.user.id], reaction.user, getFromContacts)), /*#__PURE__*/React__default.createElement(SubTitle, {
|
|
26551
26551
|
color: textSecondary
|
|
26552
|
-
}, 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,
|
|
26553
|
-
onClick: function onClick() {
|
|
26554
|
-
return handleAddDeleteEmoji(reaction.key);
|
|
26555
|
-
}
|
|
26556
|
-
}, reaction.key));
|
|
26552
|
+
}, 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));
|
|
26557
26553
|
})));
|
|
26558
26554
|
}
|
|
26559
26555
|
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) {
|
|
@@ -26623,7 +26619,7 @@ var ReactionScoreItem = styled.div(_templateObject8$9 || (_templateObject8$9 = _
|
|
|
26623
26619
|
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 ";
|
|
26624
26620
|
}, TabKey);
|
|
26625
26621
|
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"])));
|
|
26626
|
-
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) {
|
|
26622
|
+
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) {
|
|
26627
26623
|
return props.hoverBackgroundColor;
|
|
26628
26624
|
}, UserStatus);
|
|
26629
26625
|
|
|
@@ -36489,29 +36485,20 @@ var AudioRecord = function AudioRecord(_ref) {
|
|
|
36489
36485
|
}, [currentRecordedFile, currentChannelId]);
|
|
36490
36486
|
useEffect(function () {
|
|
36491
36487
|
if (!currentRecordedFile) {
|
|
36492
|
-
|
|
36493
|
-
|
|
36494
|
-
|
|
36495
|
-
|
|
36496
|
-
|
|
36497
|
-
|
|
36498
|
-
|
|
36499
|
-
|
|
36500
|
-
|
|
36501
|
-
|
|
36502
|
-
setRecorder(recorder);
|
|
36503
|
-
});
|
|
36504
|
-
}, function (e) {
|
|
36505
|
-
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
36506
|
-
});
|
|
36507
|
-
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
36508
|
-
}
|
|
36509
|
-
}();
|
|
36510
|
-
return _temp5 && _temp5.then ? _temp5.then(function () {}) : void 0;
|
|
36511
|
-
} catch (e) {
|
|
36512
|
-
Promise.reject(e);
|
|
36488
|
+
try {
|
|
36489
|
+
if (!recorder) {
|
|
36490
|
+
try {
|
|
36491
|
+
var newRecorder = new MicRecorder({
|
|
36492
|
+
bitRate: 128
|
|
36493
|
+
});
|
|
36494
|
+
setRecorder(newRecorder);
|
|
36495
|
+
} catch (e) {
|
|
36496
|
+
log.error('Failed to init mic-recorder-to-mp3', e);
|
|
36497
|
+
}
|
|
36513
36498
|
}
|
|
36514
|
-
}
|
|
36499
|
+
} catch (e) {
|
|
36500
|
+
Promise.reject(e);
|
|
36501
|
+
}
|
|
36515
36502
|
}
|
|
36516
36503
|
}, [currentRecordedFile]);
|
|
36517
36504
|
useEffect(function () {
|