gsintegrations 0.0.484 → 0.0.485
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/bundle.cjs.js +231 -47
- package/dist/bundle.cjs.js.map +2 -2
- package/dist/bundle.esm.js +230 -48
- package/dist/bundle.esm.js.map +2 -2
- package/dist/index.d.ts +132 -42
- package/dist/types/components/social/EditedMark.d.ts +7 -0
- package/dist/types/components/social/ExperienceCard.d.ts +5 -0
- package/dist/types/components/social/ExperienceCommentRow.d.ts +3 -0
- package/dist/types/components/social/ExperienceCommentsSheet.d.ts +3 -0
- package/dist/types/components/social/ExperienceDetailView.d.ts +5 -0
- package/dist/types/components/social/SocialDeleteConfirmDialog.d.ts +11 -0
- package/dist/types/components/social/SocialEditTextDialog.d.ts +19 -0
- package/dist/types/components/social/index.d.ts +4 -0
- package/dist/types/components/social/types.d.ts +11 -0
- package/dist/types/pages/FinancialAccountPage/FinancialAccountPage.types.d.ts +12 -12
- package/dist/types/pages/FinancialRegisterPage/FinancialRegister.types.d.ts +28 -28
- package/dist/types/pages/Social/ExperienceDetailPage/ExperienceDetailPage.d.ts +7 -0
- package/dist/types/pages/Social/JourneyProfilePage/JourneyProfilePage.d.ts +8 -0
- package/dist/types/pages/Social/SocialDiscoverPage/SocialDiscoverPage.d.ts +6 -0
- package/dist/types/pages/Social/SocialHomePage/SocialHomePage.d.ts +7 -0
- package/dist/types/pages/Social/SocialSavedPage/SocialSavedPage.d.ts +7 -0
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -80018,7 +80018,7 @@ const TYPE = 16191; /* i: waiting for type bits, including last-flag
|
|
|
80018
80018
|
const TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */
|
|
80019
80019
|
const STORED = 16193; /* i: waiting for stored size (length and complement) */
|
|
80020
80020
|
const COPY_ = 16194; /* i/o: same as COPY below, but only first time in */
|
|
80021
|
-
const COPY$
|
|
80021
|
+
const COPY$2 = 16195; /* i/o: waiting for input or output to copy stored block */
|
|
80022
80022
|
const TABLE = 16196; /* i: waiting for dynamic block table lengths */
|
|
80023
80023
|
const LENLENS = 16197; /* i: waiting for code length code lengths */
|
|
80024
80024
|
const CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */
|
|
@@ -80823,9 +80823,9 @@ const inflate$2 = (strm, flush) => {
|
|
|
80823
80823
|
if (flush === Z_TREES) { break inf_leave; }
|
|
80824
80824
|
/* falls through */
|
|
80825
80825
|
case COPY_:
|
|
80826
|
-
state.mode = COPY$
|
|
80826
|
+
state.mode = COPY$2;
|
|
80827
80827
|
/* falls through */
|
|
80828
|
-
case COPY$
|
|
80828
|
+
case COPY$2:
|
|
80829
80829
|
copy = state.length;
|
|
80830
80830
|
if (copy) {
|
|
80831
80831
|
if (copy > have) { copy = have; }
|
|
@@ -128247,6 +128247,7 @@ const ExperienceSchema = objectType({
|
|
|
128247
128247
|
eventId: stringType().nullable().optional(),
|
|
128248
128248
|
terreiroId: stringType().nullable().optional(),
|
|
128249
128249
|
publishedAt: unionType([stringType(), dateType()]).nullable().optional(),
|
|
128250
|
+
editedAt: unionType([stringType(), dateType()]).nullable().optional(),
|
|
128250
128251
|
createdAt: unionType([stringType(), dateType()]).optional(),
|
|
128251
128252
|
});
|
|
128252
128253
|
const QuestionSchema = objectType({
|
|
@@ -128289,6 +128290,7 @@ const ExperienceCommentSchema = objectType({
|
|
|
128289
128290
|
likeCount: numberType().optional(),
|
|
128290
128291
|
viewerHasLiked: booleanType().optional(),
|
|
128291
128292
|
repliesHasMore: booleanType().optional(),
|
|
128293
|
+
editedAt: unionType([stringType(), dateType()]).nullable().optional(),
|
|
128292
128294
|
createdAt: unionType([stringType(), dateType()]).optional(),
|
|
128293
128295
|
});
|
|
128294
128296
|
const SocialProfileSchema = objectType({
|
|
@@ -128778,26 +128780,89 @@ const AlsoExperiencedButton = ({ count = 0, active = false, loading = false, dis
|
|
|
128778
128780
|
? `Eu também passei por isso · ${count}`
|
|
128779
128781
|
: "Eu também passei por isso"));
|
|
128780
128782
|
|
|
128783
|
+
const EditedMark = ({ editedAt, fontSize = "0.9375rem", }) => {
|
|
128784
|
+
if (!editedAt)
|
|
128785
|
+
return null;
|
|
128786
|
+
return (React$1.createElement(React$1.Fragment, null,
|
|
128787
|
+
React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize }, "data-testid": "edited-mark" }, "\u00B7"),
|
|
128788
|
+
React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize } }, "Editado")));
|
|
128789
|
+
};
|
|
128790
|
+
|
|
128791
|
+
const COPY$1 = {
|
|
128792
|
+
post: {
|
|
128793
|
+
title: "Excluir publicação",
|
|
128794
|
+
body: "Excluir esta publicação? Essa ação não pode ser desfeita.",
|
|
128795
|
+
},
|
|
128796
|
+
comment: {
|
|
128797
|
+
title: "Excluir comentário",
|
|
128798
|
+
body: "Excluir este comentário? As respostas também serão removidas.",
|
|
128799
|
+
},
|
|
128800
|
+
reply: {
|
|
128801
|
+
title: "Excluir resposta",
|
|
128802
|
+
body: "Excluir esta resposta? Essa ação não pode ser desfeita.",
|
|
128803
|
+
},
|
|
128804
|
+
};
|
|
128805
|
+
const SocialDeleteConfirmDialog = ({ open, kind, submitting = false, onClose, onConfirm, }) => {
|
|
128806
|
+
const copy = COPY$1[kind];
|
|
128807
|
+
return (React$1.createElement(Dialog$1, { open: open, onClose: submitting ? undefined : onClose, fullWidth: true, maxWidth: "xs", "data-testid": "social-delete-confirm-dialog" },
|
|
128808
|
+
React$1.createElement(DialogTitle$1, null, copy.title),
|
|
128809
|
+
React$1.createElement(DialogContent$1, null,
|
|
128810
|
+
React$1.createElement(DialogContentText$1, null, copy.body)),
|
|
128811
|
+
React$1.createElement(DialogActions$1, null,
|
|
128812
|
+
React$1.createElement(Button$1, { onClick: onClose, disabled: submitting }, "Cancelar"),
|
|
128813
|
+
React$1.createElement(Button$1, { variant: "contained", color: "error", disabled: submitting, onClick: () => void onConfirm() }, "Excluir"))));
|
|
128814
|
+
};
|
|
128815
|
+
|
|
128816
|
+
const SocialEditTextDialog = ({ open, dialogTitle, contentLabel, initialContent, initialTitle = null, showTitle = false, submitting = false, maxLength = 10000, onClose, onSave, }) => {
|
|
128817
|
+
const [title, setTitle] = React$1.useState(initialTitle !== null && initialTitle !== void 0 ? initialTitle : "");
|
|
128818
|
+
const [content, setContent] = React$1.useState(initialContent);
|
|
128819
|
+
React$1.useEffect(() => {
|
|
128820
|
+
if (!open)
|
|
128821
|
+
return;
|
|
128822
|
+
setTitle(initialTitle !== null && initialTitle !== void 0 ? initialTitle : "");
|
|
128823
|
+
setContent(initialContent);
|
|
128824
|
+
}, [open, initialContent, initialTitle]);
|
|
128825
|
+
const trimmed = content.trim();
|
|
128826
|
+
const canSave = trimmed.length > 0 && !submitting;
|
|
128827
|
+
return (React$1.createElement(Dialog$1, { open: open, onClose: submitting ? undefined : onClose, fullWidth: true, maxWidth: "xs", "data-testid": "social-edit-text-dialog" },
|
|
128828
|
+
React$1.createElement(DialogTitle$1, null, dialogTitle),
|
|
128829
|
+
React$1.createElement(DialogContent$1, null,
|
|
128830
|
+
showTitle ? (React$1.createElement(TextField$1, { label: "T\u00EDtulo", value: title, onChange: (event) => setTitle(event.target.value), fullWidth: true, margin: "normal", disabled: submitting, inputProps: { maxLength: 200 } })) : null,
|
|
128831
|
+
React$1.createElement(TextField$1, { label: contentLabel, value: content, onChange: (event) => setContent(event.target.value), fullWidth: true, multiline: true, minRows: 3, margin: "normal", disabled: submitting, inputProps: { maxLength } })),
|
|
128832
|
+
React$1.createElement(DialogActions$1, null,
|
|
128833
|
+
React$1.createElement(Button$1, { onClick: onClose, disabled: submitting }, "Cancelar"),
|
|
128834
|
+
React$1.createElement(Button$1, { variant: "contained", disabled: !canSave, onClick: () => void onSave(Object.assign({ content: trimmed }, (showTitle ? { title: title.trim() || null } : {}))) }, "Salvar"))));
|
|
128835
|
+
};
|
|
128836
|
+
|
|
128781
128837
|
const ActionCount$1 = ({ count, active }) => count > 0 ? (React$1.createElement(Typography$1, { variant: "caption", color: active ? "primary.main" : "text.secondary", sx: { minWidth: 16 } }, count)) : null;
|
|
128782
|
-
const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, onReactionToggle, onShare, onReport, onComment, onBookmark, onAuthorClick, alsoExperiencedLoading = false, compact = false, }) => {
|
|
128783
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
128838
|
+
const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, onReactionToggle, onShare, onReport, onEdit, onDelete, onComment, onBookmark, onAuthorClick, alsoExperiencedLoading = false, compact = false, }) => {
|
|
128839
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
128784
128840
|
const [menuAnchor, setMenuAnchor] = React$1.useState(null);
|
|
128841
|
+
const [editOpen, setEditOpen] = React$1.useState(false);
|
|
128842
|
+
const [deleteOpen, setDeleteOpen] = React$1.useState(false);
|
|
128843
|
+
const [actionPending, setActionPending] = React$1.useState(false);
|
|
128785
128844
|
const authorName = authorDisplayName(experience.author, {
|
|
128786
128845
|
authorId: (_b = (_a = experience.author) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : experience.authorId,
|
|
128787
128846
|
viewerUserId,
|
|
128788
128847
|
});
|
|
128789
128848
|
const username = (_c = experience.author) === null || _c === void 0 ? void 0 : _c.username;
|
|
128790
|
-
const
|
|
128791
|
-
|
|
128792
|
-
|
|
128849
|
+
const isAuthor = Boolean(viewerUserId) &&
|
|
128850
|
+
(experience.authorId === viewerUserId ||
|
|
128851
|
+
((_d = experience.author) === null || _d === void 0 ? void 0 : _d.userId) === viewerUserId);
|
|
128852
|
+
const canEdit = isAuthor && Boolean(onEdit);
|
|
128853
|
+
const canDelete = isAuthor && Boolean(onDelete);
|
|
128854
|
+
const showMenu = Boolean(onShare || (!isAuthor && onReport) || canEdit || canDelete);
|
|
128855
|
+
const verified = Boolean((_e = experience.author) === null || _e === void 0 ? void 0 : _e.verified);
|
|
128856
|
+
const timeLabel = formatRelativeTime((_f = experience.publishedAt) !== null && _f !== void 0 ? _f : experience.createdAt);
|
|
128857
|
+
const hasImage = Boolean((_g = experience.imageUrl) === null || _g === void 0 ? void 0 : _g.trim());
|
|
128793
128858
|
const postType = resolveExperiencePostType(experience);
|
|
128794
128859
|
const alsoActive = Boolean(experience.viewerHasAlsoExperienced);
|
|
128795
128860
|
const bookmarked = Boolean(experience.viewerHasBookmarked);
|
|
128796
|
-
const commentCount = (
|
|
128797
|
-
const bookmarkCount = (
|
|
128798
|
-
const shareCount = (
|
|
128799
|
-
const reactionCount = (
|
|
128800
|
-
const alsoCount = (
|
|
128861
|
+
const commentCount = (_h = experience.commentCount) !== null && _h !== void 0 ? _h : 0;
|
|
128862
|
+
const bookmarkCount = (_j = experience.bookmarkCount) !== null && _j !== void 0 ? _j : 0;
|
|
128863
|
+
const shareCount = (_k = experience.shareCount) !== null && _k !== void 0 ? _k : 0;
|
|
128864
|
+
const reactionCount = (_l = experience.reactionCount) !== null && _l !== void 0 ? _l : 0;
|
|
128865
|
+
const alsoCount = (_m = experience.alsoExperiencedCount) !== null && _m !== void 0 ? _m : 0;
|
|
128801
128866
|
const openAuthor = (event) => {
|
|
128802
128867
|
var _a, _b, _c;
|
|
128803
128868
|
event.stopPropagation();
|
|
@@ -128805,7 +128870,7 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
|
|
|
128805
128870
|
};
|
|
128806
128871
|
return (React$1.createElement(Box$1, { component: "article", sx: socialTimelineRowSx, "data-testid": "experience-card", "data-experience-id": experience.id },
|
|
128807
128872
|
React$1.createElement(Stack$1, { direction: "row", spacing: 1.5, alignItems: "flex-start" },
|
|
128808
|
-
React$1.createElement(Avatar$1, { src: (
|
|
128873
|
+
React$1.createElement(Avatar$1, { src: (_p = (_o = experience.author) === null || _o === void 0 ? void 0 : _o.avatarUrl) !== null && _p !== void 0 ? _p : undefined, alt: authorName, onClick: openAuthor, sx: {
|
|
128809
128874
|
width: 40,
|
|
128810
128875
|
height: 40,
|
|
128811
128876
|
mt: 0.25,
|
|
@@ -128832,8 +128897,9 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
|
|
|
128832
128897
|
timeLabel ? (React$1.createElement(React$1.Fragment, null,
|
|
128833
128898
|
React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize: "0.9375rem" } }, "\u00B7"),
|
|
128834
128899
|
React$1.createElement(Typography$1, { component: "span", color: "text.secondary", noWrap: true, sx: { fontSize: "0.9375rem" } }, timeLabel))) : null,
|
|
128900
|
+
React$1.createElement(EditedMark, { editedAt: experience.editedAt }),
|
|
128835
128901
|
React$1.createElement(Box$1, { sx: { flex: 1 } }),
|
|
128836
|
-
|
|
128902
|
+
showMenu ? (React$1.createElement(React$1.Fragment, null,
|
|
128837
128903
|
React$1.createElement(IconButton$1, { size: "small", "aria-label": "Mais op\u00E7\u00F5es", onClick: (event) => {
|
|
128838
128904
|
event.stopPropagation();
|
|
128839
128905
|
setMenuAnchor(event.currentTarget);
|
|
@@ -128844,10 +128910,18 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
|
|
|
128844
128910
|
setMenuAnchor(null);
|
|
128845
128911
|
onShare(experience.id);
|
|
128846
128912
|
} }, "Compartilhar")) : null,
|
|
128847
|
-
|
|
128913
|
+
canEdit ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
128914
|
+
setMenuAnchor(null);
|
|
128915
|
+
setEditOpen(true);
|
|
128916
|
+
} }, "Editar")) : null,
|
|
128917
|
+
canDelete ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
128918
|
+
setMenuAnchor(null);
|
|
128919
|
+
setDeleteOpen(true);
|
|
128920
|
+
} }, "Excluir")) : null,
|
|
128921
|
+
!isAuthor && onReport ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
128848
128922
|
setMenuAnchor(null);
|
|
128849
128923
|
onReport(experience.id);
|
|
128850
|
-
} }, "Denunciar")) : null)))),
|
|
128924
|
+
} }, "Denunciar")) : null))) : null),
|
|
128851
128925
|
React$1.createElement(Box$1, { role: onOpen ? "link" : undefined, tabIndex: onOpen ? 0 : undefined, onClick: () => onOpen === null || onOpen === void 0 ? void 0 : onOpen(experience.id), onKeyDown: (event) => {
|
|
128852
128926
|
if (!onOpen)
|
|
128853
128927
|
return;
|
|
@@ -128903,23 +128977,52 @@ const ExperienceCard = ({ experience, viewerUserId, onOpen, onAlsoExperienced, o
|
|
|
128903
128977
|
React$1.createElement(Stack$1, { direction: "row", alignItems: "center", spacing: 0.25 },
|
|
128904
128978
|
React$1.createElement(IconButton$1, { size: "small", "aria-label": "Compartilhar", onClick: () => onShare === null || onShare === void 0 ? void 0 : onShare(experience.id), disabled: !onShare, sx: socialActionIconSx },
|
|
128905
128979
|
React$1.createElement(ShareOutlined$1, { sx: { fontSize: 18 } })),
|
|
128906
|
-
React$1.createElement(ActionCount$1, { count: shareCount })))))
|
|
128980
|
+
React$1.createElement(ActionCount$1, { count: shareCount }))))),
|
|
128981
|
+
editOpen ? (React$1.createElement(SocialEditTextDialog, { open: true, dialogTitle: "Editar publica\u00E7\u00E3o", contentLabel: "Texto", initialContent: experience.content, initialTitle: experience.title, showTitle: Boolean((_q = experience.title) === null || _q === void 0 ? void 0 : _q.trim()), submitting: actionPending, onClose: () => setEditOpen(false), onSave: (value) => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
128982
|
+
if (!onEdit)
|
|
128983
|
+
return;
|
|
128984
|
+
setActionPending(true);
|
|
128985
|
+
try {
|
|
128986
|
+
yield onEdit(experience.id, value);
|
|
128987
|
+
setEditOpen(false);
|
|
128988
|
+
}
|
|
128989
|
+
finally {
|
|
128990
|
+
setActionPending(false);
|
|
128991
|
+
}
|
|
128992
|
+
}) })) : null,
|
|
128993
|
+
deleteOpen ? (React$1.createElement(SocialDeleteConfirmDialog, { open: true, kind: "post", submitting: actionPending, onClose: () => setDeleteOpen(false), onConfirm: () => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
128994
|
+
if (!onDelete)
|
|
128995
|
+
return;
|
|
128996
|
+
setActionPending(true);
|
|
128997
|
+
try {
|
|
128998
|
+
yield onDelete(experience.id);
|
|
128999
|
+
setDeleteOpen(false);
|
|
129000
|
+
}
|
|
129001
|
+
finally {
|
|
129002
|
+
setActionPending(false);
|
|
129003
|
+
}
|
|
129004
|
+
}) })) : null));
|
|
128907
129005
|
};
|
|
128908
129006
|
|
|
128909
|
-
const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, onAuthorClick, onReply, onToggleLike, }) => {
|
|
128910
|
-
var _a, _b, _c, _d;
|
|
129007
|
+
const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, viewerUserId, onAuthorClick, onReply, onToggleLike, onEdit, onDelete, }) => {
|
|
129008
|
+
var _a, _b, _c, _d, _e;
|
|
129009
|
+
const [menuAnchor, setMenuAnchor] = React$1.useState(null);
|
|
128911
129010
|
const name = authorDisplayName(comment.author);
|
|
128912
|
-
const
|
|
129011
|
+
const isAuthor = Boolean(viewerUserId) &&
|
|
129012
|
+
(comment.authorId === viewerUserId ||
|
|
129013
|
+
((_a = comment.author) === null || _a === void 0 ? void 0 : _a.userId) === viewerUserId);
|
|
129014
|
+
const showOwnerMenu = isAuthor && Boolean(onEdit || onDelete);
|
|
129015
|
+
const username = (_b = comment.author) === null || _b === void 0 ? void 0 : _b.username;
|
|
128913
129016
|
const isReply = depth === 1;
|
|
128914
129017
|
const avatarSize = isReply ? 28 : 36;
|
|
128915
|
-
const likeCount = (
|
|
129018
|
+
const likeCount = (_c = comment.likeCount) !== null && _c !== void 0 ? _c : 0;
|
|
128916
129019
|
const liked = Boolean(comment.viewerHasLiked);
|
|
128917
129020
|
return (React$1.createElement(Stack$1, { direction: "row", spacing: 1.25, alignItems: "flex-start", sx: {
|
|
128918
129021
|
px: 2,
|
|
128919
129022
|
py: 1.25,
|
|
128920
129023
|
pl: isReply ? 7 : 2,
|
|
128921
129024
|
}, "data-testid": "experience-comment-row" },
|
|
128922
|
-
React$1.createElement(Avatar$1, { src: (
|
|
129025
|
+
React$1.createElement(Avatar$1, { src: (_e = (_d = comment.author) === null || _d === void 0 ? void 0 : _d.avatarUrl) !== null && _e !== void 0 ? _e : undefined, alt: name, sx: {
|
|
128923
129026
|
width: avatarSize,
|
|
128924
129027
|
height: avatarSize,
|
|
128925
129028
|
cursor: onAuthorClick ? "pointer" : "default",
|
|
@@ -128939,6 +129042,7 @@ const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, onAuth
|
|
|
128939
129042
|
React$1.createElement(Box$1, { component: "span", sx: { whiteSpace: "pre-wrap" } }, comment.body)),
|
|
128940
129043
|
React$1.createElement(Stack$1, { direction: "row", spacing: 1.5, alignItems: "center", sx: { mt: 0.25 } },
|
|
128941
129044
|
React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" }, formatRelativeTime(comment.createdAt)),
|
|
129045
|
+
React$1.createElement(EditedMark, { editedAt: comment.editedAt, fontSize: "0.75rem" }),
|
|
128942
129046
|
onReply ? (React$1.createElement(ButtonBase$1, { onClick: () => onReply(comment), "aria-label": "Responder", sx: {
|
|
128943
129047
|
typography: "caption",
|
|
128944
129048
|
fontWeight: 700,
|
|
@@ -128947,6 +129051,18 @@ const ExperienceCommentRow = ({ comment, depth = 0, likeDisabled = false, onAuth
|
|
|
128947
129051
|
px: 0.25,
|
|
128948
129052
|
"&:hover": { color: "text.primary" },
|
|
128949
129053
|
} }, "Responder")) : null)),
|
|
129054
|
+
showOwnerMenu ? (React$1.createElement(React$1.Fragment, null,
|
|
129055
|
+
React$1.createElement(IconButton$1, { size: "small", "aria-label": "Mais op\u00E7\u00F5es do coment\u00E1rio", onClick: (event) => setMenuAnchor(event.currentTarget), sx: socialActionIconSx },
|
|
129056
|
+
React$1.createElement(MoreHoriz$1, { fontSize: "small" })),
|
|
129057
|
+
React$1.createElement(Menu$2, { anchorEl: menuAnchor, open: Boolean(menuAnchor), onClose: () => setMenuAnchor(null) },
|
|
129058
|
+
onEdit ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
129059
|
+
setMenuAnchor(null);
|
|
129060
|
+
onEdit(comment);
|
|
129061
|
+
} }, "Editar")) : null,
|
|
129062
|
+
onDelete ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
129063
|
+
setMenuAnchor(null);
|
|
129064
|
+
onDelete(comment);
|
|
129065
|
+
} }, "Excluir")) : null))) : null,
|
|
128950
129066
|
onToggleLike ? (React$1.createElement(Stack$1, { alignItems: "center", sx: { pt: 0.25, minWidth: 28 } },
|
|
128951
129067
|
React$1.createElement(IconButton$1, { size: "small", "aria-label": liked ? "Remover curtida" : "Curtir", disabled: likeDisabled, onClick: () => onToggleLike(comment), sx: {
|
|
128952
129068
|
color: liked ? "error.main" : "text.secondary",
|
|
@@ -129045,9 +129161,12 @@ const SocialMessageComposer = ({ value, onChange, onSend, isSending = false, dis
|
|
|
129045
129161
|
} }, isSending ? (React$1.createElement(CircularProgress$1, { size: 22, color: "inherit" })) : (React$1.createElement(Send, { fontSize: "small" })))))));
|
|
129046
129162
|
};
|
|
129047
129163
|
|
|
129048
|
-
const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading = false, isFetchingMore = false, hasMore = false, isSubmitting = false, error = null, composerDisabled = false, onClose, onLoadMore, onLoadMoreReplies, onSubmitComment, onRetry, onAuthorClick, onToggleLike, }) => {
|
|
129164
|
+
const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading = false, isFetchingMore = false, hasMore = false, isSubmitting = false, error = null, composerDisabled = false, onClose, onLoadMore, onLoadMoreReplies, onSubmitComment, onRetry, onAuthorClick, onToggleLike, viewerUserId, onEditComment, onDeleteComment, }) => {
|
|
129049
129165
|
var _a;
|
|
129050
129166
|
const [draft, setDraft] = React$1.useState("");
|
|
129167
|
+
const [editing, setEditing] = React$1.useState(null);
|
|
129168
|
+
const [deleting, setDeleting] = React$1.useState(null);
|
|
129169
|
+
const [actionPending, setActionPending] = React$1.useState(false);
|
|
129051
129170
|
const [replyTarget, setReplyTarget] = React$1.useState(null);
|
|
129052
129171
|
const [loadingRepliesFor, setLoadingRepliesFor] = React$1.useState(null);
|
|
129053
129172
|
const listRef = React$1.useRef(null);
|
|
@@ -129057,6 +129176,8 @@ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading
|
|
|
129057
129176
|
setDraft("");
|
|
129058
129177
|
setReplyTarget(null);
|
|
129059
129178
|
setLoadingRepliesFor(null);
|
|
129179
|
+
setEditing(null);
|
|
129180
|
+
setDeleting(null);
|
|
129060
129181
|
}
|
|
129061
129182
|
}, [open]);
|
|
129062
129183
|
React$1.useEffect(() => {
|
|
@@ -129132,8 +129253,8 @@ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading
|
|
|
129132
129253
|
(Boolean(comment.repliesHasMore) ||
|
|
129133
129254
|
replyCount > replies.length);
|
|
129134
129255
|
return (React$1.createElement(Box$1, { key: comment.id },
|
|
129135
|
-
React$1.createElement(ExperienceCommentRow, { comment: comment, depth: 0, likeDisabled: composerDisabled, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike }),
|
|
129136
|
-
replies.map((reply) => (React$1.createElement(ExperienceCommentRow, { key: reply.id, comment: reply, depth: 1, likeDisabled: composerDisabled, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike }))),
|
|
129256
|
+
React$1.createElement(ExperienceCommentRow, { comment: comment, depth: 0, likeDisabled: composerDisabled, viewerUserId: viewerUserId, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike, onEdit: onEditComment ? setEditing : undefined, onDelete: onDeleteComment ? setDeleting : undefined }),
|
|
129257
|
+
replies.map((reply) => (React$1.createElement(ExperienceCommentRow, { key: reply.id, comment: reply, depth: 1, likeDisabled: composerDisabled, viewerUserId: viewerUserId, onAuthorClick: onAuthorClick, onReply: onSubmitComment ? startReply : undefined, onToggleLike: onToggleLike, onEdit: onEditComment ? setEditing : undefined, onDelete: onDeleteComment ? setDeleting : undefined }))),
|
|
129137
129258
|
showViewReplies ? (React$1.createElement(Box$1, { sx: { pl: 7, pb: 1 } },
|
|
129138
129259
|
React$1.createElement(ButtonBase$1, { onClick: () => void handleLoadReplies(comment.id), disabled: loadingRepliesFor === comment.id, "aria-label": "Ver respostas", sx: {
|
|
129139
129260
|
typography: "caption",
|
|
@@ -129163,7 +129284,31 @@ const ExperienceCommentsSheet = ({ open, comments = [], commentCount, isLoading
|
|
|
129163
129284
|
React$1.createElement(default_1$N, { fontSize: "small" })))) : null,
|
|
129164
129285
|
React$1.createElement(SocialMessageComposer, { variant: "drawer", value: draft, onChange: setDraft, onSend: (message) => void handleSend(message), isSending: isSubmitting, disabled: composerDisabled || !onSubmitComment, placeholder: replyTarget
|
|
129165
129286
|
? "Adicione uma resposta..."
|
|
129166
|
-
: "Adicione um comentário...", maxLength: 2000 })
|
|
129287
|
+
: "Adicione um comentário...", maxLength: 2000 }),
|
|
129288
|
+
editing ? (React$1.createElement(SocialEditTextDialog, { open: true, dialogTitle: editing.parentId ? "Editar resposta" : "Editar comentário", contentLabel: "Texto", initialContent: editing.body, submitting: actionPending, maxLength: 2000, onClose: () => setEditing(null), onSave: (value) => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
129289
|
+
if (!onEditComment)
|
|
129290
|
+
return;
|
|
129291
|
+
setActionPending(true);
|
|
129292
|
+
try {
|
|
129293
|
+
yield onEditComment(editing, value.content);
|
|
129294
|
+
setEditing(null);
|
|
129295
|
+
}
|
|
129296
|
+
finally {
|
|
129297
|
+
setActionPending(false);
|
|
129298
|
+
}
|
|
129299
|
+
}) })) : null,
|
|
129300
|
+
deleting ? (React$1.createElement(SocialDeleteConfirmDialog, { open: true, kind: deleting.parentId ? "reply" : "comment", submitting: actionPending, onClose: () => setDeleting(null), onConfirm: () => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
129301
|
+
if (!onDeleteComment)
|
|
129302
|
+
return;
|
|
129303
|
+
setActionPending(true);
|
|
129304
|
+
try {
|
|
129305
|
+
yield onDeleteComment(deleting);
|
|
129306
|
+
setDeleting(null);
|
|
129307
|
+
}
|
|
129308
|
+
finally {
|
|
129309
|
+
setActionPending(false);
|
|
129310
|
+
}
|
|
129311
|
+
}) })) : null)));
|
|
129167
129312
|
};
|
|
129168
129313
|
|
|
129169
129314
|
const DEFAULT_OPTIONS = [
|
|
@@ -129318,9 +129463,12 @@ const SimilarExperienceCard = ({ experience, onOpen, }) => {
|
|
|
129318
129463
|
} }, experience.title || experience.content)))));
|
|
129319
129464
|
};
|
|
129320
129465
|
|
|
129321
|
-
const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserId, alsoExperiencedLoading, onAlsoExperienced, onReactionToggle, onComment, onShare, onReport, onAuthorClick, onSimilarOpen, }) => {
|
|
129322
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
129466
|
+
const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserId, alsoExperiencedLoading, onAlsoExperienced, onReactionToggle, onComment, onShare, onReport, onEdit, onDelete, onAuthorClick, onSimilarOpen, }) => {
|
|
129467
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
129323
129468
|
const [menuAnchor, setMenuAnchor] = React$1.useState(null);
|
|
129469
|
+
const [editOpen, setEditOpen] = React$1.useState(false);
|
|
129470
|
+
const [deleteOpen, setDeleteOpen] = React$1.useState(false);
|
|
129471
|
+
const [actionPending, setActionPending] = React$1.useState(false);
|
|
129324
129472
|
const authorName = authorDisplayName(experience.author, {
|
|
129325
129473
|
authorId: (_b = (_a = experience.author) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : experience.authorId,
|
|
129326
129474
|
viewerUserId,
|
|
@@ -129330,6 +129478,9 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
|
|
|
129330
129478
|
const isAuthor = Boolean(viewerUserId) &&
|
|
129331
129479
|
(experience.authorId === viewerUserId ||
|
|
129332
129480
|
((_e = experience.author) === null || _e === void 0 ? void 0 : _e.userId) === viewerUserId);
|
|
129481
|
+
const canEdit = isAuthor && Boolean(onEdit);
|
|
129482
|
+
const canDelete = isAuthor && Boolean(onDelete);
|
|
129483
|
+
const showMenu = Boolean(onShare || (!isAuthor && onReport) || canEdit || canDelete);
|
|
129333
129484
|
const hasImage = Boolean((_f = experience.imageUrl) === null || _f === void 0 ? void 0 : _f.trim());
|
|
129334
129485
|
const commentCount = (_g = experience.commentCount) !== null && _g !== void 0 ? _g : 0;
|
|
129335
129486
|
const shareCount = (_h = experience.shareCount) !== null && _h !== void 0 ? _h : 0;
|
|
@@ -129372,8 +129523,9 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
|
|
|
129372
129523
|
timeLabel ? (React$1.createElement(React$1.Fragment, null,
|
|
129373
129524
|
React$1.createElement(Typography$1, { component: "span", color: "text.secondary", sx: { fontSize: "0.9375rem" } }, "\u00B7"),
|
|
129374
129525
|
React$1.createElement(Typography$1, { component: "span", color: "text.secondary", noWrap: true, sx: { fontSize: "0.9375rem" } }, timeLabel))) : null,
|
|
129526
|
+
React$1.createElement(EditedMark, { editedAt: experience.editedAt }),
|
|
129375
129527
|
React$1.createElement(Box$1, { sx: { flex: 1 } }),
|
|
129376
|
-
|
|
129528
|
+
showMenu ? (React$1.createElement(React$1.Fragment, null,
|
|
129377
129529
|
React$1.createElement(IconButton$1, { size: "small", "aria-label": "Mais op\u00E7\u00F5es", onClick: (event) => setMenuAnchor(event.currentTarget), sx: socialActionIconSx },
|
|
129378
129530
|
React$1.createElement(default_1$K, { fontSize: "small" })),
|
|
129379
129531
|
React$1.createElement(Menu$2, { anchorEl: menuAnchor, open: Boolean(menuAnchor), onClose: () => setMenuAnchor(null) },
|
|
@@ -129381,6 +129533,14 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
|
|
|
129381
129533
|
setMenuAnchor(null);
|
|
129382
129534
|
onShare();
|
|
129383
129535
|
} }, "Compartilhar")) : null,
|
|
129536
|
+
canEdit ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
129537
|
+
setMenuAnchor(null);
|
|
129538
|
+
setEditOpen(true);
|
|
129539
|
+
} }, "Editar")) : null,
|
|
129540
|
+
canDelete ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
129541
|
+
setMenuAnchor(null);
|
|
129542
|
+
setDeleteOpen(true);
|
|
129543
|
+
} }, "Excluir")) : null,
|
|
129384
129544
|
!isAuthor && onReport ? (React$1.createElement(MenuItem$1, { onClick: () => {
|
|
129385
129545
|
setMenuAnchor(null);
|
|
129386
129546
|
onReport();
|
|
@@ -129431,7 +129591,31 @@ const ExperienceDetailView = ({ experience, similarExperiences = [], viewerUserI
|
|
|
129431
129591
|
borderBottom: 1,
|
|
129432
129592
|
borderColor: "divider",
|
|
129433
129593
|
} }, "Semelhantes"),
|
|
129434
|
-
similarExperiences.map((item) => (React$1.createElement(SimilarExperienceCard, { key: item.id, experience: item, onOpen: onSimilarOpen }))))) : null
|
|
129594
|
+
similarExperiences.map((item) => (React$1.createElement(SimilarExperienceCard, { key: item.id, experience: item, onOpen: onSimilarOpen }))))) : null,
|
|
129595
|
+
editOpen ? (React$1.createElement(SocialEditTextDialog, { open: true, dialogTitle: "Editar publica\u00E7\u00E3o", contentLabel: "Texto", initialContent: experience.content, initialTitle: experience.title, showTitle: Boolean((_p = experience.title) === null || _p === void 0 ? void 0 : _p.trim()), submitting: actionPending, onClose: () => setEditOpen(false), onSave: (value) => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
129596
|
+
if (!onEdit)
|
|
129597
|
+
return;
|
|
129598
|
+
setActionPending(true);
|
|
129599
|
+
try {
|
|
129600
|
+
yield onEdit(value);
|
|
129601
|
+
setEditOpen(false);
|
|
129602
|
+
}
|
|
129603
|
+
finally {
|
|
129604
|
+
setActionPending(false);
|
|
129605
|
+
}
|
|
129606
|
+
}) })) : null,
|
|
129607
|
+
deleteOpen ? (React$1.createElement(SocialDeleteConfirmDialog, { open: true, kind: "post", submitting: actionPending, onClose: () => setDeleteOpen(false), onConfirm: () => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
129608
|
+
if (!onDelete)
|
|
129609
|
+
return;
|
|
129610
|
+
setActionPending(true);
|
|
129611
|
+
try {
|
|
129612
|
+
yield onDelete();
|
|
129613
|
+
setDeleteOpen(false);
|
|
129614
|
+
}
|
|
129615
|
+
finally {
|
|
129616
|
+
setActionPending(false);
|
|
129617
|
+
}
|
|
129618
|
+
}) })) : null));
|
|
129435
129619
|
};
|
|
129436
129620
|
|
|
129437
129621
|
const QuestionSourceBadge = ({ source }) => {
|
|
@@ -178311,8 +178495,8 @@ const SocialHomePage = (props) => {
|
|
|
178311
178495
|
: undefined, onAction: tab === "para-voce"
|
|
178312
178496
|
? props.onCreateExperience
|
|
178313
178497
|
: props.onOpenFollow })) : (React$1.createElement(InfiniteScroll, { hasNextPage: feedHasNextPage, isFetchingNextPage: feedIsFetchingNextPage, onLoadMore: onFeedLoadMore !== null && onFeedLoadMore !== void 0 ? onFeedLoadMore : (() => undefined) },
|
|
178314
|
-
React$1.createElement(Box$1, { sx: { border: "none" } }, feed.map((item) => item.kind === "experience" ? (React$1.createElement(ExperienceCard, { key: `experience-${item.id}`, experience: item.experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onReport: props.onReportExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === item.id })) : (React$1.createElement(QuestionCard, { key: `question-${item.id}`, question: item.question, viewerUserId: props.viewerUserId, onOpen: openAnswers, onOpenAnswers: openAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson }))))))),
|
|
178315
|
-
React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_k = (_j = props.commentsCount) !== null && _j !== void 0 ? _j : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _k !== void 0 ? _k : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
|
|
178498
|
+
React$1.createElement(Box$1, { sx: { border: "none" } }, feed.map((item) => item.kind === "experience" ? (React$1.createElement(ExperienceCard, { key: `experience-${item.id}`, experience: item.experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onReport: props.onReportExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === item.id })) : (React$1.createElement(QuestionCard, { key: `question-${item.id}`, question: item.question, viewerUserId: props.viewerUserId, onOpen: openAnswers, onOpenAnswers: openAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson }))))))),
|
|
178499
|
+
React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_k = (_j = props.commentsCount) !== null && _j !== void 0 ? _j : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _k !== void 0 ? _k : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson, viewerUserId: props.viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment }),
|
|
178316
178500
|
React$1.createElement(QuestionAnswersSheet, { open: Boolean(answersQuestionId), questionId: answersQuestionId, questionTitle: answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.title, answers: props.answers, answerCount: (_m = (_l = props.answersCount) !== null && _l !== void 0 ? _l : answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.answerCount) !== null && _m !== void 0 ? _m : undefined, isLoading: props.answersLoading, isSubmitting: props.answersSubmitting, error: props.answersError, onClose: closeAnswers, onRetry: props.onRetryAnswers, onSubmitAnswer: props.onSubmitAnswer, onAuthorClick: props.onOpenPerson }),
|
|
178317
178501
|
hasCreateActions ? (React$1.createElement(React$1.Fragment, null,
|
|
178318
178502
|
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Criar", "data-testid": "social-create-fab", onClick: openCreateSheet, sx: {
|
|
@@ -178614,10 +178798,10 @@ const ExperienceDetailPage = (props) => {
|
|
|
178614
178798
|
(_a = props.onCloseComments) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
178615
178799
|
};
|
|
178616
178800
|
return (React$1.createElement(SocialPageShell, { title: "Experi\u00EAncia", onBack: props.onBack }, props.isLoading ? (React$1.createElement(SocialSkeleton, { count: 1 })) : props.error ? (React$1.createElement(SocialErrorState, { message: props.error, onRetry: props.onRetry })) : props.experience ? (React$1.createElement(React$1.Fragment, null,
|
|
178617
|
-
React$1.createElement(ExperienceDetailView, { experience: props.experience, similarExperiences: props.similarExperiences, viewerUserId: props.viewerUserId, alsoExperiencedLoading: props.alsoExperiencedLoading, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onComment: openComments, onShare: props.onShare, onReport: props.onReport, onAuthorClick: props.onAuthorClick, onSimilarOpen: props.onSimilarOpen }),
|
|
178801
|
+
React$1.createElement(ExperienceDetailView, { experience: props.experience, similarExperiences: props.similarExperiences, viewerUserId: props.viewerUserId, alsoExperiencedLoading: props.alsoExperiencedLoading, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onComment: openComments, onShare: props.onShare, onReport: props.onReport, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onAuthorClick: props.onAuthorClick, onSimilarOpen: props.onSimilarOpen }),
|
|
178618
178802
|
React$1.createElement(ShareSheet, { open: Boolean(props.shareOpen), onClose: (_b = props.onShareClose) !== null && _b !== void 0 ? _b : (() => undefined), previewText: (_c = props.sharePreviewText) !== null && _c !== void 0 ? _c : "Uma experiência na comunidade", shareUrl: (_d = props.shareUrl) !== null && _d !== void 0 ? _d : "", onWhatsAppShare: props.onWhatsAppShare, onCopyLink: props.onCopyLink, onShareStarted: props.onShareStarted }),
|
|
178619
178803
|
React$1.createElement(ReportDialog, { open: Boolean(props.reportOpen), onClose: (_e = props.onReportClose) !== null && _e !== void 0 ? _e : (() => undefined), onSubmit: (_f = props.onReportSubmit) !== null && _f !== void 0 ? _f : (() => undefined) }),
|
|
178620
|
-
React$1.createElement(ExperienceCommentsSheet, { open: commentsOpen, experienceId: props.experience.id, comments: props.comments, commentCount: (_h = (_g = props.commentsCount) !== null && _g !== void 0 ? _g : props.experience.commentCount) !== null && _h !== void 0 ? _h : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onCommentAuthorClick }))) : (React$1.createElement(SocialErrorState, { title: "Experi\u00EAncia n\u00E3o encontrada", message: "Este conte\u00FAdo pode ter sido removido ou n\u00E3o est\u00E1 dispon\u00EDvel.", onRetry: props.onRetry }))));
|
|
178804
|
+
React$1.createElement(ExperienceCommentsSheet, { open: commentsOpen, experienceId: props.experience.id, comments: props.comments, commentCount: (_h = (_g = props.commentsCount) !== null && _g !== void 0 ? _g : props.experience.commentCount) !== null && _h !== void 0 ? _h : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onCommentAuthorClick, viewerUserId: props.viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment }))) : (React$1.createElement(SocialErrorState, { title: "Experi\u00EAncia n\u00E3o encontrada", message: "Este conte\u00FAdo pode ter sido removido ou n\u00E3o est\u00E1 dispon\u00EDvel.", onRetry: props.onRetry }))));
|
|
178621
178805
|
};
|
|
178622
178806
|
|
|
178623
178807
|
const QuestionsPage = ({ questions = [], isLoading, error, onBack, onRetry, onOpenQuestion, onCreateQuestion, }) => (React$1.createElement(SocialPageShell, { title: "Perguntas", onBack: onBack },
|
|
@@ -178746,12 +178930,13 @@ const stubEmptyCopy = {
|
|
|
178746
178930
|
},
|
|
178747
178931
|
};
|
|
178748
178932
|
const JourneyProfilePage = (props) => {
|
|
178749
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
178933
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
178750
178934
|
const [contentTab, setContentTab] = React$1.useState("posts");
|
|
178751
178935
|
const [commentsExperienceId, setCommentsExperienceId] = React$1.useState(null);
|
|
178752
178936
|
const experiences = (_a = props.experiences) !== null && _a !== void 0 ? _a : [];
|
|
178753
178937
|
(_b = props.similarPeople) !== null && _b !== void 0 ? _b : [];
|
|
178754
178938
|
const isOwn = props.isOwnProfile || ((_c = props.profile) === null || _c === void 0 ? void 0 : _c.connectionStatus) === "SELF";
|
|
178939
|
+
const viewerUserId = (_d = props.viewerUserId) !== null && _d !== void 0 ? _d : (isOwn ? (_e = props.profile) === null || _e === void 0 ? void 0 : _e.userId : undefined);
|
|
178755
178940
|
const commentsTarget = commentsExperienceId == null
|
|
178756
178941
|
? undefined
|
|
178757
178942
|
: experiences.find((item) => item.id === commentsExperienceId);
|
|
@@ -178766,7 +178951,7 @@ const JourneyProfilePage = (props) => {
|
|
|
178766
178951
|
(_a = props.onCloseComments) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
178767
178952
|
};
|
|
178768
178953
|
return (React$1.createElement(SocialPageShell, { title: "Jornada", onBack: props.onBack, hideHeader: true }, props.isLoading ? (React$1.createElement(SocialSkeleton, { variant: "profile", count: 1 })) : props.error ? (React$1.createElement(SocialErrorState, { message: props.error, onRetry: props.onRetry })) : props.profile ? (React$1.createElement(React$1.Fragment, null,
|
|
178769
|
-
React$1.createElement(JourneyProfile, { profile: props.profile, isOwnProfile: isOwn, connectionLoading: props.connectionLoading, onBack: props.onBack, onSearch: props.onSearch, onMore: (
|
|
178954
|
+
React$1.createElement(JourneyProfile, { profile: props.profile, isOwnProfile: isOwn, connectionLoading: props.connectionLoading, onBack: props.onBack, onSearch: props.onSearch, onMore: (_f = props.onMore) !== null && _f !== void 0 ? _f : (isOwn ? undefined : props.onBlockOpen), onConnect: props.onConnect, onDisconnect: props.onDisconnect, onMessage: props.onMessage, onEdit: props.onEdit, onShare: props.onShare, onBlock: props.onBlockOpen, onOpenJoined: props.onOpenJoined, onOpenFollowing: props.onOpenFollowing, onOpenFollowers: props.onOpenFollowers, showVerificationBanner: Boolean(props.showVerificationBanner) && isOwn, verificationBannerMode: props.verificationBannerMode, verificationDaysRemaining: props.verificationDaysRemaining, onOpenVerificationProgress: props.onOpenVerificationProgress, onGetVerification: props.onGetVerification, onDismissVerification: props.onDismissVerification, experiencesCount: props.experiencesCount, connectionsCount: props.connectionsCount }),
|
|
178770
178955
|
React$1.createElement(Tabs$1, { value: contentTab, onChange: (_, value) => setContentTab(value), variant: "fullWidth", "aria-label": "Conte\u00FAdo da jornada", sx: {
|
|
178771
178956
|
borderBottom: 1,
|
|
178772
178957
|
borderColor: "divider",
|
|
@@ -178787,14 +178972,11 @@ const JourneyProfilePage = (props) => {
|
|
|
178787
178972
|
} },
|
|
178788
178973
|
React$1.createElement(Tab$1, { value: "posts", label: "Posts", disableRipple: true }),
|
|
178789
178974
|
React$1.createElement(Tab$1, { value: "replies", "aria-label": "Respostas", icon: React$1.createElement(ChatBubbleOutline$1, { fontSize: "small" }), disableRipple: true })),
|
|
178790
|
-
contentTab === "posts" ? (experiences.length === 0 ? (React$1.createElement(SocialEmptyState, { title: "Sem experi\u00EAncias p\u00FAblicas", description: "Esta jornada ainda n\u00E3o tem experi\u00EAncias vis\u00EDveis.", actionLabel: isOwn ? "Compartilhar experiência" : undefined, onAction: isOwn ? props.onCreateExperience : undefined })) : (React$1.createElement(Box$1, null, experiences.map((experience) => {
|
|
178791
|
-
var _a;
|
|
178792
|
-
return (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: isOwn ? (_a = props.profile) === null || _a === void 0 ? void 0 : _a.userId : undefined, onOpen: props.onOpenExperience, onComment: openComments, onAuthorClick: props.onOpenPerson, compact: true }));
|
|
178793
|
-
})))) : (React$1.createElement(SocialEmptyState, { title: stubEmptyCopy[contentTab].title, description: stubEmptyCopy[contentTab].description })),
|
|
178975
|
+
contentTab === "posts" ? (experiences.length === 0 ? (React$1.createElement(SocialEmptyState, { title: "Sem experi\u00EAncias p\u00FAblicas", description: "Esta jornada ainda n\u00E3o tem experi\u00EAncias vis\u00EDveis.", actionLabel: isOwn ? "Compartilhar experiência" : undefined, onAction: isOwn ? props.onCreateExperience : undefined })) : (React$1.createElement(Box$1, null, experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: viewerUserId, onOpen: props.onOpenExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onComment: openComments, onAuthorClick: props.onOpenPerson, compact: true })))))) : (React$1.createElement(SocialEmptyState, { title: stubEmptyCopy[contentTab].title, description: stubEmptyCopy[contentTab].description })),
|
|
178794
178976
|
isOwn && props.onCreateExperience ? (React$1.createElement(Fab$1, { color: "primary", "aria-label": "Nova experi\u00EAncia", onClick: props.onCreateExperience, sx: { position: "fixed", bottom: 24, right: 16, zIndex: 10 } },
|
|
178795
178977
|
React$1.createElement(Add$1, null))) : null,
|
|
178796
|
-
React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (
|
|
178797
|
-
React$1.createElement(BlockDialog, { open: Boolean(props.blockOpen), displayName: props.profile.displayName || props.profile.username || undefined, onClose: (
|
|
178978
|
+
React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_h = (_g = props.commentsCount) !== null && _g !== void 0 ? _g : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _h !== void 0 ? _h : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: props.commentsComposerDisabled, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson, viewerUserId: viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment }),
|
|
178979
|
+
React$1.createElement(BlockDialog, { open: Boolean(props.blockOpen), displayName: props.profile.displayName || props.profile.username || undefined, onClose: (_j = props.onBlockClose) !== null && _j !== void 0 ? _j : (() => undefined), onConfirm: (_k = props.onBlockConfirm) !== null && _k !== void 0 ? _k : (() => undefined) }))) : (React$1.createElement(Box$1, { sx: { pt: 2 } },
|
|
178798
178980
|
props.onBack ? (React$1.createElement(Typography$1, { component: "button", onClick: props.onBack, sx: {
|
|
178799
178981
|
display: "block",
|
|
178800
178982
|
mx: 2,
|
|
@@ -179554,7 +179736,7 @@ const SocialDiscoverPage = (props) => {
|
|
|
179554
179736
|
const renderMixed = (experienceItems, questionItems, peopleItems, sectioned) => (React$1.createElement(Box$1, null,
|
|
179555
179737
|
experienceItems.length > 0 ? (React$1.createElement(Box$1, null,
|
|
179556
179738
|
sectioned ? (React$1.createElement(Typography$1, { component: "h2", sx: sectionTitleSx$1 }, "Experi\u00EAncias")) : null,
|
|
179557
|
-
experienceItems.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, onOpen: props.onOpenExperience, compact: true }))),
|
|
179739
|
+
experienceItems.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, compact: true }))),
|
|
179558
179740
|
sectioned ? (React$1.createElement(DiscoverSeeMoreRow, { label: "Ver mais experi\u00EAncias", onSeeMore: () => goToTab("experiences") })) : null)) : null,
|
|
179559
179741
|
questionItems.length > 0 ? (React$1.createElement(Box$1, null,
|
|
179560
179742
|
sectioned ? (React$1.createElement(Typography$1, { component: "h2", sx: sectionTitleSx$1 }, "Perguntas")) : null,
|
|
@@ -179588,7 +179770,7 @@ const SocialDiscoverPage = (props) => {
|
|
|
179588
179770
|
return (React$1.createElement(SocialErrorState, { message: props.error, onRetry: props.onRetry }));
|
|
179589
179771
|
}
|
|
179590
179772
|
if (tab === "experiences" && experiences.length > 0) {
|
|
179591
|
-
return (React$1.createElement(Box$1, null, experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, onOpen: props.onOpenExperience, compact: true })))));
|
|
179773
|
+
return (React$1.createElement(Box$1, null, experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, compact: true })))));
|
|
179592
179774
|
}
|
|
179593
179775
|
if (tab === "questions" && questions.length > 0) {
|
|
179594
179776
|
return (React$1.createElement(Box$1, null, questions.map((question) => (React$1.createElement(QuestionCard, { key: question.id, question: question, onOpen: props.onOpenQuestion, onOpenAnswers: props.onOpenQuestionAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson })))));
|
|
@@ -179768,12 +179950,12 @@ const SocialSavedPage = (props) => {
|
|
|
179768
179950
|
showExperiences && experiences.length > 0 ? (React$1.createElement(InfiniteScroll, { hasNextPage: Boolean(props.hasNextPage), isFetchingNextPage: Boolean(props.isFetchingNextPage), onLoadMore: (_d = props.onLoadMore) !== null && _d !== void 0 ? _d : (() => undefined) },
|
|
179769
179951
|
React$1.createElement(Box$1, { sx: { border: "none" } },
|
|
179770
179952
|
tab === "all" ? (React$1.createElement(Typography$1, { sx: sectionTitleSx }, "Experi\u00EAncias")) : null,
|
|
179771
|
-
experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === experience.id })))))) : null,
|
|
179953
|
+
experiences.map((experience) => (React$1.createElement(ExperienceCard, { key: experience.id, experience: experience, viewerUserId: props.viewerUserId, onOpen: props.onOpenExperience, onAlsoExperienced: props.onAlsoExperienced, onReactionToggle: props.onReactionToggle, onShare: props.onShareExperience, onEdit: props.onEditExperience, onDelete: props.onDeleteExperience, onComment: openComments, onBookmark: props.onBookmarkExperience, onAuthorClick: props.onOpenPerson, alsoExperiencedLoading: props.alsoExperiencedLoadingId === experience.id })))))) : null,
|
|
179772
179954
|
showQuestions && questions.length > 0 ? (React$1.createElement(InfiniteScroll, { hasNextPage: Boolean(props.questionsHasNextPage), isFetchingNextPage: Boolean(props.questionsFetchingNextPage), onLoadMore: (_e = props.onLoadMoreQuestions) !== null && _e !== void 0 ? _e : (() => undefined) },
|
|
179773
179955
|
React$1.createElement(Box$1, { sx: { border: "none" } },
|
|
179774
179956
|
tab === "all" ? (React$1.createElement(Typography$1, { sx: sectionTitleSx }, "Perguntas")) : null,
|
|
179775
179957
|
questions.map((question) => (React$1.createElement(QuestionCard, { key: question.id, question: question, viewerUserId: props.viewerUserId, onOpen: openAnswers, onOpenAnswers: openAnswers, onBookmark: props.onBookmarkQuestion, onShare: props.onShareQuestion, onReactionToggle: props.onReactionToggleQuestion, onAuthorClick: props.onOpenPerson })))))) : null)),
|
|
179776
|
-
React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_g = (_f = props.commentsCount) !== null && _f !== void 0 ? _f : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _g !== void 0 ? _g : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: false, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
|
|
179958
|
+
React$1.createElement(ExperienceCommentsSheet, { open: Boolean(commentsExperienceId), experienceId: commentsExperienceId, comments: props.comments, commentCount: (_g = (_f = props.commentsCount) !== null && _f !== void 0 ? _f : commentsTarget === null || commentsTarget === void 0 ? void 0 : commentsTarget.commentCount) !== null && _g !== void 0 ? _g : undefined, isLoading: props.commentsLoading, isFetchingMore: props.commentsFetchingMore, hasMore: props.commentsHasMore, isSubmitting: props.commentsSubmitting, error: props.commentsError, composerDisabled: false, onClose: closeComments, onLoadMore: props.onLoadMoreComments, onLoadMoreReplies: props.onLoadMoreReplies, onSubmitComment: props.onSubmitComment, onToggleLike: props.onToggleCommentLike, viewerUserId: props.viewerUserId, onEditComment: props.onEditComment, onDeleteComment: props.onDeleteComment, onRetry: props.onRetryComments, onAuthorClick: props.onOpenPerson }),
|
|
179777
179959
|
React$1.createElement(QuestionAnswersSheet, { open: Boolean(answersQuestionId), questionId: answersQuestionId, questionTitle: answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.title, answers: props.answers, answerCount: (_j = (_h = props.answersCount) !== null && _h !== void 0 ? _h : answersTarget === null || answersTarget === void 0 ? void 0 : answersTarget.answerCount) !== null && _j !== void 0 ? _j : undefined, isLoading: props.answersLoading, isSubmitting: props.answersSubmitting, error: props.answersError, onClose: closeAnswers, onRetry: props.onRetryAnswers, onSubmitAnswer: props.onSubmitAnswer, onAuthorClick: props.onOpenPerson })));
|
|
179778
179960
|
};
|
|
179779
179961
|
|
|
@@ -195049,7 +195231,9 @@ exports.SocialConversationPeerSchema = SocialConversationPeerSchema;
|
|
|
195049
195231
|
exports.SocialConversationRow = SocialConversationRow;
|
|
195050
195232
|
exports.SocialConversationSchema = SocialConversationSchema;
|
|
195051
195233
|
exports.SocialCreateActionsSheet = SocialCreateActionsSheet;
|
|
195234
|
+
exports.SocialDeleteConfirmDialog = SocialDeleteConfirmDialog;
|
|
195052
195235
|
exports.SocialDiscoverPage = SocialDiscoverPage;
|
|
195236
|
+
exports.SocialEditTextDialog = SocialEditTextDialog;
|
|
195053
195237
|
exports.SocialEmptyState = SocialEmptyState;
|
|
195054
195238
|
exports.SocialErrorState = SocialErrorState;
|
|
195055
195239
|
exports.SocialFeedItemSchema = SocialFeedItemSchema;
|
package/dist/bundle.cjs.js.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/bundle.cjs.js.map
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 59070953 bytes
|
|
4
|
+
sha256: 9443d2a6077325c890ab08571c9edd744c9635167a340ef971e927ccfb3fb638
|