frst-components 0.21.63 → 0.21.65
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/dist/index.js
CHANGED
|
@@ -4675,12 +4675,22 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
4675
4675
|
const [users, setUsers] = React.useState([]);
|
|
4676
4676
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
4677
4677
|
const inputRef = React.useRef(null);
|
|
4678
|
+
const user = {
|
|
4679
|
+
user_uuid: replyMentionedUser.uuid,
|
|
4680
|
+
name: replyMentionedUser.name,
|
|
4681
|
+
profile: {
|
|
4682
|
+
avatar: replyMentionedUser.avatar,
|
|
4683
|
+
company_name: replyMentionedUser.company_name,
|
|
4684
|
+
role_name: replyMentionedUser.role_name
|
|
4685
|
+
}
|
|
4686
|
+
};
|
|
4687
|
+
const [userMentionedOnReplied, setUserMentionedOnReply] = React.useState(false);
|
|
4688
|
+
const handleClickOutside = (event) => {
|
|
4689
|
+
if (inputRef.current && !inputRef.current.contains(event.target) && comment.length === 0) {
|
|
4690
|
+
handleHiddenInput();
|
|
4691
|
+
}
|
|
4692
|
+
};
|
|
4678
4693
|
React.useEffect(() => {
|
|
4679
|
-
const handleClickOutside = (event) => {
|
|
4680
|
-
if (inputRef.current && !inputRef.current.contains(event.target) && comment.length === 0) {
|
|
4681
|
-
handleHiddenInput();
|
|
4682
|
-
}
|
|
4683
|
-
};
|
|
4684
4694
|
document.addEventListener('mousedown', handleClickOutside);
|
|
4685
4695
|
return () => {
|
|
4686
4696
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
@@ -4702,6 +4712,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
4702
4712
|
};
|
|
4703
4713
|
let timeout;
|
|
4704
4714
|
const setCommentData = (value) => {
|
|
4715
|
+
setUserMentionedOnReply(true);
|
|
4705
4716
|
clearTimeout(timeout);
|
|
4706
4717
|
timeout = setTimeout(() => {
|
|
4707
4718
|
setComment(value);
|
|
@@ -4713,29 +4724,17 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
4713
4724
|
};
|
|
4714
4725
|
return (jsxRuntime.jsxs(Container$g, { children: [jsxRuntime.jsx(Avatar, { src: imgProfile, size: "32px", style: { marginTop: '55px', marginRight: '8px' } }), jsxRuntime.jsxs(InputContainer, { ref: inputRef, style: { ...styles }, children: [jsxRuntime.jsx(InputComment$1, { styles: { width: '100%', marginTop: '22.5px' }, className: "userComment", onChange: (e) => {
|
|
4715
4726
|
handleSearchUsers(e);
|
|
4716
|
-
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, replyMentionedUser:
|
|
4727
|
+
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, replyMentionedUser: !userMentionedOnReplied && user }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || isLoading, label: publishButtonText, onClick: () => handlePublish(), variant: "primary", styles: { marginLeft: 'auto', marginTop: '15px' } }), isLoading && jsxRuntime.jsx(Loading, {})] })] }));
|
|
4717
4728
|
};
|
|
4718
4729
|
|
|
4719
4730
|
const CommentaryBoxReply = ({ commentData, showMoreButtonText, showLessButtonText, answerButtonText, onClickAnswerButton }) => {
|
|
4720
|
-
return (jsxRuntime.jsx(CommentaryBoxV2, { hasActionToClickOnAvatar: false, imgProfile: commentData.user?.
|
|
4731
|
+
return (jsxRuntime.jsx(CommentaryBoxV2, { hasActionToClickOnAvatar: false, imgProfile: commentData.user?.avatar, itsLiked: false, userName: commentData.user?.name, userOffice: commentData.user?.role_name, userCompany: commentData.user?.company_name, commentId: commentData.id, commentText: commentData.text, howLongAgo: commentData.howLongAgo, showMoreText: showMoreButtonText, actionAnswer: () => onClickAnswerButton(commentData.id), showLessText: showLessButtonText, answerButtonText: answerButtonText, styles: { marginTop: '8px' }, commentTextWithMention: commentData.mentionText }));
|
|
4721
4732
|
};
|
|
4722
4733
|
|
|
4723
4734
|
const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onClickPublishButton, showReplysButtonText, publishButtonText, limitInputs, answerButtonText, loggedUserProfileImg, getSearchUsers, showMoreButtonText, showLessButtonText, styles, relationToPhaseText }) => {
|
|
4724
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
4725
4735
|
const [showAnswers, setShowAnswers] = React.useState(false);
|
|
4726
4736
|
const [showReplyInput, setShowReplyInput] = React.useState(false);
|
|
4727
4737
|
const [showInputByIdReply, setShowInputByIdReply] = React.useState([]);
|
|
4728
|
-
const handleShowReplys = async () => {
|
|
4729
|
-
setIsLoading(true);
|
|
4730
|
-
try {
|
|
4731
|
-
setShowAnswers(true);
|
|
4732
|
-
}
|
|
4733
|
-
catch (error) {
|
|
4734
|
-
}
|
|
4735
|
-
finally {
|
|
4736
|
-
setIsLoading(false);
|
|
4737
|
-
}
|
|
4738
|
-
};
|
|
4739
4738
|
const handleHiddenInput = () => {
|
|
4740
4739
|
setShowReplyInput(false);
|
|
4741
4740
|
};
|
|
@@ -4748,7 +4747,7 @@ const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onCli
|
|
|
4748
4747
|
const handleCommentReplyReply = (idReply) => {
|
|
4749
4748
|
setShowInputByIdReply([...showInputByIdReply, idReply]);
|
|
4750
4749
|
};
|
|
4751
|
-
return (jsxRuntime.jsx(Container$h, { style: styles, children: jsxRuntime.jsxs(CommentarysContainer, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { styles: { marginBottom: '8px' }, hasActionToClickOnAvatar: false, imgProfile: mainComment.user
|
|
4750
|
+
return (jsxRuntime.jsx(Container$h, { style: styles, children: jsxRuntime.jsxs(CommentarysContainer, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { styles: { marginBottom: '8px' }, hasActionToClickOnAvatar: false, imgProfile: mainComment.user?.avatar, itsLiked: false, userId: mainComment.user?.uuid, userName: mainComment.user?.name, userOffice: mainComment.user?.role_name, userCompany: mainComment.user?.company_name, commentId: mainComment.id, commentText: mainComment.text, howLongAgo: mainComment.howLongAgo, showMoreText: showMoreButtonText, showLessText: showLessButtonText, answerButtonText: answerButtonText, showLikeButton: false, actionAnswer: handleCommentReply, relationToPhaseText: relationToPhaseText, commentTextWithMention: mainComment.mentionText }), listReplyComments?.length > 0 && !showAnswers && (jsxRuntime.jsx(ViewReplysButtonContainer, { children: jsxRuntime.jsx("span", { onClick: () => setShowAnswers(true), children: showReplysButtonText }) })), showReplyInput && (jsxRuntime.jsx(InputReply, { styles: { width: '100%', marginTop: '24px' }, imgProfile: loggedUserProfileImg, idInput: `idInput-${mainComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, getSearchUsers: getSearchUsers, replyMentionedUser: mainComment.user, parentId: Number(mainComment.id), handleHiddenInput: handleHiddenInput }))] }), showAnswers && (jsxRuntime.jsx(RepplysContainer, { children: listReplyComments?.map((replyComment) => {
|
|
4752
4751
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CommentaryBoxReply, { commentData: replyComment, answerButtonText: answerButtonText, showMoreButtonText: showMoreButtonText, showLessButtonText: showLessButtonText, onClickAnswerButton: handleCommentReplyReply }), showInputByIdReply.includes(replyComment.id) && (jsxRuntime.jsx(InputReply, { imgProfile: loggedUserProfileImg, styles: { width: '100%', marginTop: '24px' }, idInput: `idInput-${replyComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, replyMentionedUser: replyComment.user, getSearchUsers: getSearchUsers, parentId: Number(mainComment.id), handleHiddenInput: (replyId = replyComment.id) => handleHiddenInputReply(replyId) }))] }));
|
|
4753
4752
|
}) }))] }) }));
|
|
4754
4753
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/FI/ThreadComments/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/FI/ThreadComments/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKxD,eAAO,MAAM,cAAc,iQAexB,eAAe,gBA0GjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/FI/ThreadComments/utilitiesComponents/inputReply/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/FI/ThreadComments/utilitiesComponents/inputReply/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,eAAO,MAAM,UAAU,kKAWpB,WAAW,gBAgGb,CAAC"}
|