sceyt-chat-react-uikit 1.7.5-beta.19 → 1.7.5-beta.20
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 +57 -26
- package/index.modern.js +57 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13307,12 +13307,14 @@ var UploadFileLabel = styled__default.label(_templateObject8 || (_templateObject
|
|
|
13307
13307
|
var InputErrorMessage = styled__default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n font-size: 12px;\n color: ", ";\n margin: 4px 0 0;\n"])), function (props) {
|
|
13308
13308
|
return props.color;
|
|
13309
13309
|
});
|
|
13310
|
-
var CustomInput = styled__default.input(_templateObject0 || (_templateObject0 = _taggedTemplateLiteralLoose(["\n height: 40px;\n width: 100%;\n background: ", ";\n border: ", ";\n color: ", ";\n box-sizing: border-box;\n border-radius: 8px;\n padding:
|
|
13310
|
+
var CustomInput = styled__default.input(_templateObject0 || (_templateObject0 = _taggedTemplateLiteralLoose(["\n height: 40px;\n width: 100%;\n background: ", ";\n border: ", ";\n color: ", ";\n box-sizing: border-box;\n border-radius: 8px;\n padding: ", ";\n font-family: Inter, sans-serif;\n font-style: normal;\n font-weight: normal;\n font-size: 15px;\n line-height: 20px;\n opacity: 1;\n outline: none;\n\n &:focus {\n border: 1px solid ", ";\n outline: ", ";\n }\n &:disabled {\n background-color: ", ";\n opacity: 1;\n color: #383b51;\n }\n &::placeholder {\n opacity: 1;\n color: ", ";\n }\n"])), function (props) {
|
|
13311
13311
|
return props.backgroundColor;
|
|
13312
13312
|
}, function (props) {
|
|
13313
13313
|
return props.error ? "1px solid " + props.errorColor : "1px solid " + props.borderColor;
|
|
13314
13314
|
}, function (props) {
|
|
13315
13315
|
return props.color;
|
|
13316
|
+
}, function (props) {
|
|
13317
|
+
return props.padding || '11px 14px';
|
|
13316
13318
|
}, function (props) {
|
|
13317
13319
|
return props.error ? "1px solid " + props.errorColor : 'transparent';
|
|
13318
13320
|
}, function (props) {
|
|
@@ -19129,7 +19131,7 @@ function sendTextMessage(action) {
|
|
|
19129
19131
|
}, _marked2$2, null, [[3, 20]]);
|
|
19130
19132
|
}
|
|
19131
19133
|
function forwardMessage(action) {
|
|
19132
|
-
var payload, message, channelId, connectionState, isForward, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
19134
|
+
var payload, message, channelId, connectionState, isForward, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
19133
19135
|
return _regenerator().w(function (_context5) {
|
|
19134
19136
|
while (1) switch (_context5.p = _context5.n) {
|
|
19135
19137
|
case 0:
|
|
@@ -19179,7 +19181,24 @@ function forwardMessage(action) {
|
|
|
19179
19181
|
attachments = [att];
|
|
19180
19182
|
}
|
|
19181
19183
|
messageBuilder = channel.createMessageBuilder();
|
|
19182
|
-
|
|
19184
|
+
pollDetails = null;
|
|
19185
|
+
if (message.pollDetails) {
|
|
19186
|
+
pollDetails = {
|
|
19187
|
+
id: uuid.v4(),
|
|
19188
|
+
name: message.pollDetails.name,
|
|
19189
|
+
description: message.pollDetails.description || '',
|
|
19190
|
+
options: message.pollDetails.options.map(function (option) {
|
|
19191
|
+
return {
|
|
19192
|
+
id: uuid.v4(),
|
|
19193
|
+
name: option.name
|
|
19194
|
+
};
|
|
19195
|
+
}),
|
|
19196
|
+
anonymous: message.pollDetails.anonymous,
|
|
19197
|
+
allowMultipleVotes: message.pollDetails.allowMultipleVotes,
|
|
19198
|
+
allowVoteRetract: message.pollDetails.allowVoteRetract
|
|
19199
|
+
};
|
|
19200
|
+
}
|
|
19201
|
+
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).setPollDetails(pollDetails);
|
|
19183
19202
|
messageToSend = messageBuilder.create();
|
|
19184
19203
|
pendingMessage = JSON.parse(JSON.stringify(_extends({}, messageToSend, {
|
|
19185
19204
|
createdAt: new Date(Date.now())
|
|
@@ -34270,8 +34289,8 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
|
|
|
34270
34289
|
}, /*#__PURE__*/React__default.createElement(OptionHeader, null, /*#__PURE__*/React__default.createElement(OptionTitle, {
|
|
34271
34290
|
color: textPrimary
|
|
34272
34291
|
}, opt.name), /*#__PURE__*/React__default.createElement(OptionCount, {
|
|
34273
|
-
color:
|
|
34274
|
-
}, totalVotes, " votes
|
|
34292
|
+
color: textPrimary
|
|
34293
|
+
}, totalVotes, " ", totalVotes > 1 ? 'votes' : 'vote')), /*#__PURE__*/React__default.createElement(Voters, null, allVotes.map(function (vote) {
|
|
34275
34294
|
var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4, _vote$user4$profile, _vote$user5, _vote$user5$presence, _vote$user6, _vote$user6$presence, _vote$user7, _vote$user7$presence, _vote$user8;
|
|
34276
34295
|
return /*#__PURE__*/React__default.createElement(VoterRow$1, {
|
|
34277
34296
|
key: opt.id + "_" + vote.user.id
|
|
@@ -34319,17 +34338,17 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
|
|
|
34319
34338
|
})) === null || _poll$options$find === void 0 ? void 0 : _poll$options$find.name) || ''
|
|
34320
34339
|
})));
|
|
34321
34340
|
};
|
|
34322
|
-
var OptionsList = styled__default.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height:
|
|
34341
|
+
var OptionsList = styled__default.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height: 570px;\n border-radius: 12px;\n"])));
|
|
34323
34342
|
var OptionBlock = styled__default.div(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: 12px;\n border: 1px solid ", "0F; /* subtle */\n padding: 14px 16px 0 16px;\n"])), function (p) {
|
|
34324
34343
|
return p.background;
|
|
34325
34344
|
}, function (p) {
|
|
34326
34345
|
return p.border;
|
|
34327
34346
|
});
|
|
34328
34347
|
var OptionHeader = styled__default.div(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n"])));
|
|
34329
|
-
var OptionTitle = styled__default.div(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight:
|
|
34348
|
+
var OptionTitle = styled__default.div(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n color: ", ";\n max-width: calc(100% - 60px);\n font-family: Inter;\n font-weight: 500;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.4px;\n"])), function (p) {
|
|
34330
34349
|
return p.color;
|
|
34331
34350
|
});
|
|
34332
|
-
var OptionCount = styled__default.div(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-size: 13px;\n"])), function (p) {
|
|
34351
|
+
var OptionCount = styled__default.div(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-size: 13px;\n margin-bottom: auto;\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.4px;\n"])), function (p) {
|
|
34333
34352
|
return p.color;
|
|
34334
34353
|
});
|
|
34335
34354
|
var Voters = styled__default.div(_templateObject6$h || (_templateObject6$h = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n margin-bottom: 5px;\n"])));
|
|
@@ -34519,10 +34538,10 @@ var EmptyCircle = styled__default.span(_templateObject8$f || (_templateObject8$f
|
|
|
34519
34538
|
var StyledCheck = styled__default(SvgFilledCheckbox)(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n width: 18.5px;\n height: 18.5px;\n"])), function (p) {
|
|
34520
34539
|
return p.color;
|
|
34521
34540
|
});
|
|
34522
|
-
var Title$2 = styled__default.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n"])), function (p) {
|
|
34541
|
+
var Title$2 = styled__default.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n max-width: calc(100% - 80px);\n"])), function (p) {
|
|
34523
34542
|
return p.color;
|
|
34524
34543
|
});
|
|
34525
|
-
var Votes = styled__default.span(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n
|
|
34544
|
+
var Votes = styled__default.span(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n"])), function (p) {
|
|
34526
34545
|
return p.color;
|
|
34527
34546
|
});
|
|
34528
34547
|
var Bar = styled__default.div(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: 6px;\n border-radius: 6px;\n background: ", ";\n overflow: hidden;\n margin-left: auto;\n"])), function (p) {
|
|
@@ -34531,7 +34550,7 @@ var Bar = styled__default.div(_templateObject10$5 || (_templateObject10$5 = _tag
|
|
|
34531
34550
|
return p.track;
|
|
34532
34551
|
});
|
|
34533
34552
|
var Fill = styled__default.div(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: 6px;\n transition: width 0.3s ease-in-out;\n"])));
|
|
34534
|
-
var UsersContainer = styled__default.div(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n
|
|
34553
|
+
var UsersContainer = styled__default.div(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n"])));
|
|
34535
34554
|
|
|
34536
34555
|
var _templateObject$F, _templateObject2$A, _templateObject3$u, _templateObject4$q, _templateObject5$l, _templateObject6$j, _templateObject7$h, _templateObject8$g, _templateObject9$e, _templateObject0$d, _templateObject1$9;
|
|
34537
34556
|
var validateUrl = function validateUrl(url) {
|
|
@@ -40682,7 +40701,6 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40682
40701
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
40683
40702
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
40684
40703
|
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
40685
|
-
textFootnote = _useColor[THEME_COLORS.TEXT_FOOTNOTE],
|
|
40686
40704
|
iconPrimary = _useColor[THEME_COLORS.ICON_PRIMARY],
|
|
40687
40705
|
iconInactive = _useColor[THEME_COLORS.ICON_INACTIVE],
|
|
40688
40706
|
borderColor = _useColor[THEME_COLORS.BORDER],
|
|
@@ -40719,6 +40737,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40719
40737
|
var optionInputRefs = React.useRef({});
|
|
40720
40738
|
var questionLimit = 200;
|
|
40721
40739
|
var optionLimit = 120;
|
|
40740
|
+
var maxOptions = 12;
|
|
40722
40741
|
var canCreate = React.useMemo(function () {
|
|
40723
40742
|
var validOptions = options.map(function (o) {
|
|
40724
40743
|
return o.name.trim();
|
|
@@ -40744,11 +40763,16 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40744
40763
|
}
|
|
40745
40764
|
};
|
|
40746
40765
|
var addOption = function addOption() {
|
|
40766
|
+
if (options.length >= maxOptions) return;
|
|
40747
40767
|
var nextId = uuid.v4();
|
|
40748
40768
|
setOptions([].concat(options, [{
|
|
40749
40769
|
id: nextId,
|
|
40750
40770
|
name: ''
|
|
40751
40771
|
}]));
|
|
40772
|
+
setTimeout(function () {
|
|
40773
|
+
var _optionInputRefs$curr;
|
|
40774
|
+
return (_optionInputRefs$curr = optionInputRefs.current[nextId]) === null || _optionInputRefs$curr === void 0 ? void 0 : _optionInputRefs$curr.focus();
|
|
40775
|
+
}, 0);
|
|
40752
40776
|
};
|
|
40753
40777
|
var removeOption = function removeOption(id) {
|
|
40754
40778
|
if (options.length <= 2) return;
|
|
@@ -40770,7 +40794,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40770
40794
|
}) : o;
|
|
40771
40795
|
});
|
|
40772
40796
|
var nowFilled = value.trim().length > 0;
|
|
40773
|
-
if (isLast && wasEmpty && nowFilled) {
|
|
40797
|
+
if (isLast && wasEmpty && nowFilled && prev.length < maxOptions) {
|
|
40774
40798
|
var nextId = uuid.v4();
|
|
40775
40799
|
return [].concat(updated, [{
|
|
40776
40800
|
id: nextId,
|
|
@@ -40847,9 +40871,9 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40847
40871
|
if (currentIndex === -1) return;
|
|
40848
40872
|
var next = options[currentIndex + 1];
|
|
40849
40873
|
if (next) {
|
|
40850
|
-
var _optionInputRefs$
|
|
40851
|
-
(_optionInputRefs$
|
|
40852
|
-
} else {
|
|
40874
|
+
var _optionInputRefs$curr2;
|
|
40875
|
+
(_optionInputRefs$curr2 = optionInputRefs.current[next.id]) === null || _optionInputRefs$curr2 === void 0 ? void 0 : _optionInputRefs$curr2.focus();
|
|
40876
|
+
} else if (options.length < maxOptions) {
|
|
40853
40877
|
var newId = uuid.v4();
|
|
40854
40878
|
setOptions(function (prev) {
|
|
40855
40879
|
return [].concat(prev, [{
|
|
@@ -40858,8 +40882,8 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40858
40882
|
}]);
|
|
40859
40883
|
});
|
|
40860
40884
|
setTimeout(function () {
|
|
40861
|
-
var _optionInputRefs$
|
|
40862
|
-
return (_optionInputRefs$
|
|
40885
|
+
var _optionInputRefs$curr3;
|
|
40886
|
+
return (_optionInputRefs$curr3 = optionInputRefs.current[newId]) === null || _optionInputRefs$curr3 === void 0 ? void 0 : _optionInputRefs$curr3.focus();
|
|
40863
40887
|
}, 0);
|
|
40864
40888
|
}
|
|
40865
40889
|
}, 0);
|
|
@@ -40880,8 +40904,9 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40880
40904
|
}, "Create poll"), /*#__PURE__*/React__default.createElement(Label, {
|
|
40881
40905
|
color: textSecondary
|
|
40882
40906
|
}, "Question"), /*#__PURE__*/React__default.createElement(QuestionInputWrapper, null, /*#__PURE__*/React__default.createElement(CustomInput, {
|
|
40907
|
+
padding: '11px 64px 11px 14px',
|
|
40883
40908
|
color: textPrimary,
|
|
40884
|
-
placeholderColor:
|
|
40909
|
+
placeholderColor: textSecondary,
|
|
40885
40910
|
backgroundColor: surface1,
|
|
40886
40911
|
borderColor: borderColor,
|
|
40887
40912
|
errorColor: borderColor,
|
|
@@ -40897,7 +40922,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40897
40922
|
},
|
|
40898
40923
|
"data-allow-paste": 'true'
|
|
40899
40924
|
}), /*#__PURE__*/React__default.createElement(TextCounter, {
|
|
40900
|
-
color:
|
|
40925
|
+
color: textSecondary
|
|
40901
40926
|
}, question.length + "/" + questionLimit)), /*#__PURE__*/React__default.createElement(Label, {
|
|
40902
40927
|
color: textSecondary
|
|
40903
40928
|
}, "Options"), /*#__PURE__*/React__default.createElement(OptionsList$1, {
|
|
@@ -40928,10 +40953,10 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40928
40953
|
setDragOverId(null);
|
|
40929
40954
|
}
|
|
40930
40955
|
}, /*#__PURE__*/React__default.createElement(SvgDotsVertica, {
|
|
40931
|
-
color:
|
|
40956
|
+
color: textSecondary
|
|
40932
40957
|
}), /*#__PURE__*/React__default.createElement(CustomInput, {
|
|
40933
40958
|
color: textPrimary,
|
|
40934
|
-
placeholderColor:
|
|
40959
|
+
placeholderColor: textSecondary,
|
|
40935
40960
|
backgroundColor: surface1,
|
|
40936
40961
|
borderColor: borderColor,
|
|
40937
40962
|
errorColor: borderColor,
|
|
@@ -40965,7 +40990,9 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40965
40990
|
})), /*#__PURE__*/React__default.createElement(AddOptionButton, {
|
|
40966
40991
|
type: 'button',
|
|
40967
40992
|
color: accentColor,
|
|
40968
|
-
onClick: addOption
|
|
40993
|
+
onClick: addOption,
|
|
40994
|
+
disabled: options.length >= maxOptions,
|
|
40995
|
+
disabledColor: iconInactive
|
|
40969
40996
|
}, "Add another option"), /*#__PURE__*/React__default.createElement(Label, {
|
|
40970
40997
|
color: textSecondary
|
|
40971
40998
|
}, "Poll settings"), /*#__PURE__*/React__default.createElement(Settings, null, /*#__PURE__*/React__default.createElement(SettingItem, {
|
|
@@ -41020,7 +41047,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
41020
41047
|
})));
|
|
41021
41048
|
};
|
|
41022
41049
|
var QuestionInputWrapper = styled__default.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
41023
|
-
var TextCounter = styled__default.span(_templateObject2$K || (_templateObject2$K = _taggedTemplateLiteralLoose(["\n position: absolute;\n top:
|
|
41050
|
+
var TextCounter = styled__default.span(_templateObject2$K || (_templateObject2$K = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 12px;\n right: 12px;\n color: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 20px;\n"])), function (props) {
|
|
41024
41051
|
return props.color;
|
|
41025
41052
|
});
|
|
41026
41053
|
var OptionsList$1 = styled__default.div(_templateObject3$D || (_templateObject3$D = _taggedTemplateLiteralLoose(["\n max-height: 240px;\n overflow-y: auto;\n margin-top: 8px;\n padding-right: 6px;\n"])));
|
|
@@ -41038,8 +41065,12 @@ var RemoveOptionIcon = styled__default(SvgClose)(_templateObject5$t || (_templat
|
|
|
41038
41065
|
}, function (props) {
|
|
41039
41066
|
return props.disabled ? 0.5 : 1;
|
|
41040
41067
|
});
|
|
41041
|
-
var AddOptionButton = styled__default.button(_templateObject6$p || (_templateObject6$p = _taggedTemplateLiteralLoose(["\n margin: 16px 0 0 0;\n background: transparent;\n border: none;\n color: ", ";\n cursor:
|
|
41042
|
-
return props.color;
|
|
41068
|
+
var AddOptionButton = styled__default.button(_templateObject6$p || (_templateObject6$p = _taggedTemplateLiteralLoose(["\n margin: 16px 0 0 0;\n background: transparent;\n border: none;\n color: ", ";\n cursor: ", ";\n width: 100%;\n text-align: left;\n padding-left: 32px;\n opacity: ", ";\n"])), function (props) {
|
|
41069
|
+
return props.disabled ? props.disabledColor : props.color;
|
|
41070
|
+
}, function (props) {
|
|
41071
|
+
return props.disabled ? 'not-allowed' : 'pointer';
|
|
41072
|
+
}, function (props) {
|
|
41073
|
+
return props.disabled ? 0.5 : 1;
|
|
41043
41074
|
});
|
|
41044
41075
|
var Settings = styled__default.div(_templateObject7$n || (_templateObject7$n = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin-top: 8px;\n"])));
|
|
41045
41076
|
var SettingItem = styled__default.div(_templateObject8$l || (_templateObject8$l = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n color: ", ";\n"])), function (props) {
|
package/index.modern.js
CHANGED
|
@@ -13306,12 +13306,14 @@ var UploadFileLabel = styled.label(_templateObject8 || (_templateObject8 = _tagg
|
|
|
13306
13306
|
var InputErrorMessage = styled.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n font-size: 12px;\n color: ", ";\n margin: 4px 0 0;\n"])), function (props) {
|
|
13307
13307
|
return props.color;
|
|
13308
13308
|
});
|
|
13309
|
-
var CustomInput = styled.input(_templateObject0 || (_templateObject0 = _taggedTemplateLiteralLoose(["\n height: 40px;\n width: 100%;\n background: ", ";\n border: ", ";\n color: ", ";\n box-sizing: border-box;\n border-radius: 8px;\n padding:
|
|
13309
|
+
var CustomInput = styled.input(_templateObject0 || (_templateObject0 = _taggedTemplateLiteralLoose(["\n height: 40px;\n width: 100%;\n background: ", ";\n border: ", ";\n color: ", ";\n box-sizing: border-box;\n border-radius: 8px;\n padding: ", ";\n font-family: Inter, sans-serif;\n font-style: normal;\n font-weight: normal;\n font-size: 15px;\n line-height: 20px;\n opacity: 1;\n outline: none;\n\n &:focus {\n border: 1px solid ", ";\n outline: ", ";\n }\n &:disabled {\n background-color: ", ";\n opacity: 1;\n color: #383b51;\n }\n &::placeholder {\n opacity: 1;\n color: ", ";\n }\n"])), function (props) {
|
|
13310
13310
|
return props.backgroundColor;
|
|
13311
13311
|
}, function (props) {
|
|
13312
13312
|
return props.error ? "1px solid " + props.errorColor : "1px solid " + props.borderColor;
|
|
13313
13313
|
}, function (props) {
|
|
13314
13314
|
return props.color;
|
|
13315
|
+
}, function (props) {
|
|
13316
|
+
return props.padding || '11px 14px';
|
|
13315
13317
|
}, function (props) {
|
|
13316
13318
|
return props.error ? "1px solid " + props.errorColor : 'transparent';
|
|
13317
13319
|
}, function (props) {
|
|
@@ -19128,7 +19130,7 @@ function sendTextMessage(action) {
|
|
|
19128
19130
|
}, _marked2$2, null, [[3, 20]]);
|
|
19129
19131
|
}
|
|
19130
19132
|
function forwardMessage(action) {
|
|
19131
|
-
var payload, message, channelId, connectionState, isForward, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
19133
|
+
var payload, message, channelId, connectionState, isForward, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
19132
19134
|
return _regenerator().w(function (_context5) {
|
|
19133
19135
|
while (1) switch (_context5.p = _context5.n) {
|
|
19134
19136
|
case 0:
|
|
@@ -19178,7 +19180,24 @@ function forwardMessage(action) {
|
|
|
19178
19180
|
attachments = [att];
|
|
19179
19181
|
}
|
|
19180
19182
|
messageBuilder = channel.createMessageBuilder();
|
|
19181
|
-
|
|
19183
|
+
pollDetails = null;
|
|
19184
|
+
if (message.pollDetails) {
|
|
19185
|
+
pollDetails = {
|
|
19186
|
+
id: v4(),
|
|
19187
|
+
name: message.pollDetails.name,
|
|
19188
|
+
description: message.pollDetails.description || '',
|
|
19189
|
+
options: message.pollDetails.options.map(function (option) {
|
|
19190
|
+
return {
|
|
19191
|
+
id: v4(),
|
|
19192
|
+
name: option.name
|
|
19193
|
+
};
|
|
19194
|
+
}),
|
|
19195
|
+
anonymous: message.pollDetails.anonymous,
|
|
19196
|
+
allowMultipleVotes: message.pollDetails.allowMultipleVotes,
|
|
19197
|
+
allowVoteRetract: message.pollDetails.allowVoteRetract
|
|
19198
|
+
};
|
|
19199
|
+
}
|
|
19200
|
+
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).setPollDetails(pollDetails);
|
|
19182
19201
|
messageToSend = messageBuilder.create();
|
|
19183
19202
|
pendingMessage = JSON.parse(JSON.stringify(_extends({}, messageToSend, {
|
|
19184
19203
|
createdAt: new Date(Date.now())
|
|
@@ -34269,8 +34288,8 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
|
|
|
34269
34288
|
}, /*#__PURE__*/React__default.createElement(OptionHeader, null, /*#__PURE__*/React__default.createElement(OptionTitle, {
|
|
34270
34289
|
color: textPrimary
|
|
34271
34290
|
}, opt.name), /*#__PURE__*/React__default.createElement(OptionCount, {
|
|
34272
|
-
color:
|
|
34273
|
-
}, totalVotes, " votes
|
|
34291
|
+
color: textPrimary
|
|
34292
|
+
}, totalVotes, " ", totalVotes > 1 ? 'votes' : 'vote')), /*#__PURE__*/React__default.createElement(Voters, null, allVotes.map(function (vote) {
|
|
34274
34293
|
var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4, _vote$user4$profile, _vote$user5, _vote$user5$presence, _vote$user6, _vote$user6$presence, _vote$user7, _vote$user7$presence, _vote$user8;
|
|
34275
34294
|
return /*#__PURE__*/React__default.createElement(VoterRow$1, {
|
|
34276
34295
|
key: opt.id + "_" + vote.user.id
|
|
@@ -34318,17 +34337,17 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
|
|
|
34318
34337
|
})) === null || _poll$options$find === void 0 ? void 0 : _poll$options$find.name) || ''
|
|
34319
34338
|
})));
|
|
34320
34339
|
};
|
|
34321
|
-
var OptionsList = styled.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height:
|
|
34340
|
+
var OptionsList = styled.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height: 570px;\n border-radius: 12px;\n"])));
|
|
34322
34341
|
var OptionBlock = styled.div(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: 12px;\n border: 1px solid ", "0F; /* subtle */\n padding: 14px 16px 0 16px;\n"])), function (p) {
|
|
34323
34342
|
return p.background;
|
|
34324
34343
|
}, function (p) {
|
|
34325
34344
|
return p.border;
|
|
34326
34345
|
});
|
|
34327
34346
|
var OptionHeader = styled.div(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n"])));
|
|
34328
|
-
var OptionTitle = styled.div(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight:
|
|
34347
|
+
var OptionTitle = styled.div(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n color: ", ";\n max-width: calc(100% - 60px);\n font-family: Inter;\n font-weight: 500;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.4px;\n"])), function (p) {
|
|
34329
34348
|
return p.color;
|
|
34330
34349
|
});
|
|
34331
|
-
var OptionCount = styled.div(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-size: 13px;\n"])), function (p) {
|
|
34350
|
+
var OptionCount = styled.div(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-size: 13px;\n margin-bottom: auto;\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.4px;\n"])), function (p) {
|
|
34332
34351
|
return p.color;
|
|
34333
34352
|
});
|
|
34334
34353
|
var Voters = styled.div(_templateObject6$h || (_templateObject6$h = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n margin-bottom: 5px;\n"])));
|
|
@@ -34518,10 +34537,10 @@ var EmptyCircle = styled.span(_templateObject8$f || (_templateObject8$f = _tagge
|
|
|
34518
34537
|
var StyledCheck = styled(SvgFilledCheckbox)(_templateObject9$d || (_templateObject9$d = _taggedTemplateLiteralLoose(["\n color: ", ";\n width: 18.5px;\n height: 18.5px;\n"])), function (p) {
|
|
34519
34538
|
return p.color;
|
|
34520
34539
|
});
|
|
34521
|
-
var Title$2 = styled.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n"])), function (p) {
|
|
34540
|
+
var Title$2 = styled.div(_templateObject0$c || (_templateObject0$c = _taggedTemplateLiteralLoose(["\n flex: 1 1 auto;\n color: ", ";\n margin-right: auto;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n max-width: calc(100% - 80px);\n"])), function (p) {
|
|
34522
34541
|
return p.color;
|
|
34523
34542
|
});
|
|
34524
|
-
var Votes = styled.span(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n
|
|
34543
|
+
var Votes = styled.span(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n letter-spacing: -0.2px;\n margin-left: 4px;\n"])), function (p) {
|
|
34525
34544
|
return p.color;
|
|
34526
34545
|
});
|
|
34527
34546
|
var Bar = styled.div(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: 6px;\n border-radius: 6px;\n background: ", ";\n overflow: hidden;\n margin-left: auto;\n"])), function (p) {
|
|
@@ -34530,7 +34549,7 @@ var Bar = styled.div(_templateObject10$5 || (_templateObject10$5 = _taggedTempla
|
|
|
34530
34549
|
return p.track;
|
|
34531
34550
|
});
|
|
34532
34551
|
var Fill = styled.div(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: 6px;\n transition: width 0.3s ease-in-out;\n"])));
|
|
34533
|
-
var UsersContainer = styled.div(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n
|
|
34552
|
+
var UsersContainer = styled.div(_templateObject12$3 || (_templateObject12$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n"])));
|
|
34534
34553
|
|
|
34535
34554
|
var _templateObject$F, _templateObject2$A, _templateObject3$u, _templateObject4$q, _templateObject5$l, _templateObject6$j, _templateObject7$h, _templateObject8$g, _templateObject9$e, _templateObject0$d, _templateObject1$9;
|
|
34536
34555
|
var validateUrl = function validateUrl(url) {
|
|
@@ -40681,7 +40700,6 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40681
40700
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
40682
40701
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
40683
40702
|
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
40684
|
-
textFootnote = _useColor[THEME_COLORS.TEXT_FOOTNOTE],
|
|
40685
40703
|
iconPrimary = _useColor[THEME_COLORS.ICON_PRIMARY],
|
|
40686
40704
|
iconInactive = _useColor[THEME_COLORS.ICON_INACTIVE],
|
|
40687
40705
|
borderColor = _useColor[THEME_COLORS.BORDER],
|
|
@@ -40718,6 +40736,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40718
40736
|
var optionInputRefs = useRef({});
|
|
40719
40737
|
var questionLimit = 200;
|
|
40720
40738
|
var optionLimit = 120;
|
|
40739
|
+
var maxOptions = 12;
|
|
40721
40740
|
var canCreate = useMemo(function () {
|
|
40722
40741
|
var validOptions = options.map(function (o) {
|
|
40723
40742
|
return o.name.trim();
|
|
@@ -40743,11 +40762,16 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40743
40762
|
}
|
|
40744
40763
|
};
|
|
40745
40764
|
var addOption = function addOption() {
|
|
40765
|
+
if (options.length >= maxOptions) return;
|
|
40746
40766
|
var nextId = v4();
|
|
40747
40767
|
setOptions([].concat(options, [{
|
|
40748
40768
|
id: nextId,
|
|
40749
40769
|
name: ''
|
|
40750
40770
|
}]));
|
|
40771
|
+
setTimeout(function () {
|
|
40772
|
+
var _optionInputRefs$curr;
|
|
40773
|
+
return (_optionInputRefs$curr = optionInputRefs.current[nextId]) === null || _optionInputRefs$curr === void 0 ? void 0 : _optionInputRefs$curr.focus();
|
|
40774
|
+
}, 0);
|
|
40751
40775
|
};
|
|
40752
40776
|
var removeOption = function removeOption(id) {
|
|
40753
40777
|
if (options.length <= 2) return;
|
|
@@ -40769,7 +40793,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40769
40793
|
}) : o;
|
|
40770
40794
|
});
|
|
40771
40795
|
var nowFilled = value.trim().length > 0;
|
|
40772
|
-
if (isLast && wasEmpty && nowFilled) {
|
|
40796
|
+
if (isLast && wasEmpty && nowFilled && prev.length < maxOptions) {
|
|
40773
40797
|
var nextId = v4();
|
|
40774
40798
|
return [].concat(updated, [{
|
|
40775
40799
|
id: nextId,
|
|
@@ -40846,9 +40870,9 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40846
40870
|
if (currentIndex === -1) return;
|
|
40847
40871
|
var next = options[currentIndex + 1];
|
|
40848
40872
|
if (next) {
|
|
40849
|
-
var _optionInputRefs$
|
|
40850
|
-
(_optionInputRefs$
|
|
40851
|
-
} else {
|
|
40873
|
+
var _optionInputRefs$curr2;
|
|
40874
|
+
(_optionInputRefs$curr2 = optionInputRefs.current[next.id]) === null || _optionInputRefs$curr2 === void 0 ? void 0 : _optionInputRefs$curr2.focus();
|
|
40875
|
+
} else if (options.length < maxOptions) {
|
|
40852
40876
|
var newId = v4();
|
|
40853
40877
|
setOptions(function (prev) {
|
|
40854
40878
|
return [].concat(prev, [{
|
|
@@ -40857,8 +40881,8 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40857
40881
|
}]);
|
|
40858
40882
|
});
|
|
40859
40883
|
setTimeout(function () {
|
|
40860
|
-
var _optionInputRefs$
|
|
40861
|
-
return (_optionInputRefs$
|
|
40884
|
+
var _optionInputRefs$curr3;
|
|
40885
|
+
return (_optionInputRefs$curr3 = optionInputRefs.current[newId]) === null || _optionInputRefs$curr3 === void 0 ? void 0 : _optionInputRefs$curr3.focus();
|
|
40862
40886
|
}, 0);
|
|
40863
40887
|
}
|
|
40864
40888
|
}, 0);
|
|
@@ -40879,8 +40903,9 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40879
40903
|
}, "Create poll"), /*#__PURE__*/React__default.createElement(Label, {
|
|
40880
40904
|
color: textSecondary
|
|
40881
40905
|
}, "Question"), /*#__PURE__*/React__default.createElement(QuestionInputWrapper, null, /*#__PURE__*/React__default.createElement(CustomInput, {
|
|
40906
|
+
padding: '11px 64px 11px 14px',
|
|
40882
40907
|
color: textPrimary,
|
|
40883
|
-
placeholderColor:
|
|
40908
|
+
placeholderColor: textSecondary,
|
|
40884
40909
|
backgroundColor: surface1,
|
|
40885
40910
|
borderColor: borderColor,
|
|
40886
40911
|
errorColor: borderColor,
|
|
@@ -40896,7 +40921,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40896
40921
|
},
|
|
40897
40922
|
"data-allow-paste": 'true'
|
|
40898
40923
|
}), /*#__PURE__*/React__default.createElement(TextCounter, {
|
|
40899
|
-
color:
|
|
40924
|
+
color: textSecondary
|
|
40900
40925
|
}, question.length + "/" + questionLimit)), /*#__PURE__*/React__default.createElement(Label, {
|
|
40901
40926
|
color: textSecondary
|
|
40902
40927
|
}, "Options"), /*#__PURE__*/React__default.createElement(OptionsList$1, {
|
|
@@ -40927,10 +40952,10 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40927
40952
|
setDragOverId(null);
|
|
40928
40953
|
}
|
|
40929
40954
|
}, /*#__PURE__*/React__default.createElement(SvgDotsVertica, {
|
|
40930
|
-
color:
|
|
40955
|
+
color: textSecondary
|
|
40931
40956
|
}), /*#__PURE__*/React__default.createElement(CustomInput, {
|
|
40932
40957
|
color: textPrimary,
|
|
40933
|
-
placeholderColor:
|
|
40958
|
+
placeholderColor: textSecondary,
|
|
40934
40959
|
backgroundColor: surface1,
|
|
40935
40960
|
borderColor: borderColor,
|
|
40936
40961
|
errorColor: borderColor,
|
|
@@ -40964,7 +40989,9 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
40964
40989
|
})), /*#__PURE__*/React__default.createElement(AddOptionButton, {
|
|
40965
40990
|
type: 'button',
|
|
40966
40991
|
color: accentColor,
|
|
40967
|
-
onClick: addOption
|
|
40992
|
+
onClick: addOption,
|
|
40993
|
+
disabled: options.length >= maxOptions,
|
|
40994
|
+
disabledColor: iconInactive
|
|
40968
40995
|
}, "Add another option"), /*#__PURE__*/React__default.createElement(Label, {
|
|
40969
40996
|
color: textSecondary
|
|
40970
40997
|
}, "Poll settings"), /*#__PURE__*/React__default.createElement(Settings, null, /*#__PURE__*/React__default.createElement(SettingItem, {
|
|
@@ -41019,7 +41046,7 @@ var CreatePollPopup = function CreatePollPopup(_ref) {
|
|
|
41019
41046
|
})));
|
|
41020
41047
|
};
|
|
41021
41048
|
var QuestionInputWrapper = styled.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
41022
|
-
var TextCounter = styled.span(_templateObject2$K || (_templateObject2$K = _taggedTemplateLiteralLoose(["\n position: absolute;\n top:
|
|
41049
|
+
var TextCounter = styled.span(_templateObject2$K || (_templateObject2$K = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 12px;\n right: 12px;\n color: ", ";\n font-weight: 500;\n font-size: 13px;\n line-height: 20px;\n"])), function (props) {
|
|
41023
41050
|
return props.color;
|
|
41024
41051
|
});
|
|
41025
41052
|
var OptionsList$1 = styled.div(_templateObject3$D || (_templateObject3$D = _taggedTemplateLiteralLoose(["\n max-height: 240px;\n overflow-y: auto;\n margin-top: 8px;\n padding-right: 6px;\n"])));
|
|
@@ -41037,8 +41064,12 @@ var RemoveOptionIcon = styled(SvgClose)(_templateObject5$t || (_templateObject5$
|
|
|
41037
41064
|
}, function (props) {
|
|
41038
41065
|
return props.disabled ? 0.5 : 1;
|
|
41039
41066
|
});
|
|
41040
|
-
var AddOptionButton = styled.button(_templateObject6$p || (_templateObject6$p = _taggedTemplateLiteralLoose(["\n margin: 16px 0 0 0;\n background: transparent;\n border: none;\n color: ", ";\n cursor:
|
|
41041
|
-
return props.color;
|
|
41067
|
+
var AddOptionButton = styled.button(_templateObject6$p || (_templateObject6$p = _taggedTemplateLiteralLoose(["\n margin: 16px 0 0 0;\n background: transparent;\n border: none;\n color: ", ";\n cursor: ", ";\n width: 100%;\n text-align: left;\n padding-left: 32px;\n opacity: ", ";\n"])), function (props) {
|
|
41068
|
+
return props.disabled ? props.disabledColor : props.color;
|
|
41069
|
+
}, function (props) {
|
|
41070
|
+
return props.disabled ? 'not-allowed' : 'pointer';
|
|
41071
|
+
}, function (props) {
|
|
41072
|
+
return props.disabled ? 0.5 : 1;
|
|
41042
41073
|
});
|
|
41043
41074
|
var Settings = styled.div(_templateObject7$n || (_templateObject7$n = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin-top: 8px;\n"])));
|
|
41044
41075
|
var SettingItem = styled.div(_templateObject8$l || (_templateObject8$l = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n color: ", ";\n"])), function (props) {
|