@openpeepshq/react 0.2.3 → 0.2.5
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/components/accounts/SignUpLoginModal.js +2 -2
- package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
- package/dist/components/configuration/ConfigMenuButton.js +12 -0
- package/dist/components/configuration/ConfigurationTree.js +1 -1
- package/dist/components/configuration/index.d.ts +2 -0
- package/dist/components/configuration/index.js +1 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
- package/dist/components/conversations/ConversationMessageBubble.js +4 -5
- package/dist/components/conversations/CreateNewConversation.js +10 -42
- package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
- package/dist/components/conversations/MessageInThread.js +1 -2
- package/dist/components/form/ImageEditModal.js +2 -4
- package/dist/components/form/ImageInput.js +13 -8
- package/dist/components/form/LocationInput.js +1 -1
- package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
- package/dist/components/groups/AddGroupMembersButton.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupAvatar.js +4 -4
- package/dist/components/groups/GroupCard.js +3 -3
- package/dist/components/groups/GroupHeader.js +1 -1
- package/dist/components/groups/GroupMembersList.js +2 -3
- package/dist/components/groups/GroupOptionsMenu.js +12 -6
- package/dist/components/groups/JoinGroupButton.js +3 -20
- package/dist/components/jams/CreateNewJam.js +4 -4
- package/dist/components/jams/JamCallParticipant.js +17 -7
- package/dist/components/jams/JamCapacityGate.js +1 -1
- package/dist/components/jams/JamChatDrawer.js +2 -2
- package/dist/components/jams/JamConference.js +1 -1
- package/dist/components/jams/JamContext.d.ts +4 -0
- package/dist/components/jams/JamContext.js +17 -2
- package/dist/components/jams/JamDetailsDrawer.js +1 -1
- package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
- package/dist/components/jams/JamDeviceSelectors.js +4 -3
- package/dist/components/jams/JamFooter.js +15 -16
- package/dist/components/jams/JamGuestForm.js +2 -2
- package/dist/components/jams/JamLobby.js +9 -19
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +1 -1
- package/dist/components/jams/JamPeopleDrawer.js +17 -13
- package/dist/components/jams/JamReactionMenu.js +1 -1
- package/dist/components/jams/JamRequestJoin.js +1 -1
- package/dist/components/jams/JamRoom.js +84 -4
- package/dist/components/jams/JamToolbarButton.d.ts +21 -0
- package/dist/components/jams/JamToolbarButton.js +19 -0
- package/dist/components/jams/JamVideoCall.js +8 -3
- package/dist/components/jams/JamVideoLayout.js +16 -5
- package/dist/components/jams/LeaveCloseButton.js +9 -44
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/constants.js +4 -0
- package/dist/components/jams/useParticipantConnection.d.ts +7 -0
- package/dist/components/jams/useParticipantConnection.js +11 -0
- package/dist/components/layout/Auth.js +1 -1
- package/dist/components/layout/Infos.js +2 -2
- package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
- package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/markdown/CompiledMarkdown.js +15 -1
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +5 -1
- package/dist/components/navigation/HeaderMobile.js +1 -1
- package/dist/components/navigation/MobileMenuItem.js +1 -1
- package/dist/components/navigation/PageHeaderAction.js +1 -1
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +6 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
- package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
- package/dist/components/notifications/NotificationHeaderActions.js +2 -2
- package/dist/components/notifications/NotificationWrapper.js +1 -1
- package/dist/components/notifications/NotificationsList.js +3 -3
- package/dist/components/notifications/TypedNotification.js +3 -3
- package/dist/components/post/Feed.js +3 -3
- package/dist/components/post/FeedPost.d.ts +2 -1
- package/dist/components/post/FeedPost.js +11 -6
- package/dist/components/post/FeedPostContent.js +1 -1
- package/dist/components/post/FullPostLayout.js +11 -4
- package/dist/components/post/NewEventButton.js +1 -1
- package/dist/components/post/NewNoteButton.js +1 -1
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/ReplyBox.js +1 -1
- package/dist/components/post/feed/events/EventsFeed.js +3 -3
- package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
- package/dist/components/post/pieces/Attachments.js +3 -3
- package/dist/components/post/pieces/EventMenu.js +1 -1
- package/dist/components/post/pieces/EventRsvpButton.js +3 -3
- package/dist/components/post/pieces/FeedPostStats.js +2 -2
- package/dist/components/post/pieces/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +33 -14
- package/dist/components/post/pieces/PostActions.js +6 -45
- package/dist/components/post/pieces/PostInfoHeader.js +1 -1
- package/dist/components/post/pieces/PostMenu.js +35 -9
- package/dist/components/post/pieces/PostReactionHeader.js +1 -1
- package/dist/components/post/pieces/ShareMenu.js +4 -2
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
- package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
- package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
- package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
- package/dist/components/post/pieces/modals/RepostModal.js +8 -7
- package/dist/components/post/post-form/AttachmentCard.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.js +1 -1
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +22 -12
- package/dist/components/post/post-form/EventForm.js +2 -2
- package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
- package/dist/components/post/post-form/NewPostModal.js +10 -10
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
- package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
- package/dist/components/post/post-form/PollComposerFields.js +12 -8
- package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
- package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/ReplyModal.js +9 -8
- package/dist/components/post/post-form/VisibilitySelector.js +1 -1
- package/dist/components/post/types/Article.js +2 -1
- package/dist/components/post/types/Event.js +1 -1
- package/dist/components/post/types/Note.js +2 -1
- package/dist/components/post/types/Poll.js +2 -1
- package/dist/components/post/types/event/CardEvent.js +2 -2
- package/dist/components/post/types/event/FullEvent.js +8 -8
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
- package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
- package/dist/components/preview-link/LocalPreviewLink.js +1 -1
- package/dist/components/preview-link/RemotePreviewLink.js +5 -1
- package/dist/components/profile/Avatar.js +3 -2
- package/dist/components/profile/FollowUnfollowButton.js +2 -2
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfileCard.js +1 -1
- package/dist/components/profile/ProfileHeader.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +3 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
- package/dist/components/profile/ProfileSelector.js +3 -3
- package/dist/components/profile/ProfilesInput.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
- package/dist/components/server-data/context.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +63 -16774
- package/dist/contexts/openpeeps/hooks/admin.js +34 -14
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +330 -0
- package/dist/contexts/openpeeps/hooks/jams.d.ts +110 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/posts.d.ts +933 -53
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +220 -0
- package/dist/contexts/openpeeps/hooks/search.d.ts +330 -0
- package/dist/contexts/openpeeps/index.d.ts +1 -1
- package/dist/contexts/openpeeps/index.js +10 -2
- package/dist/contexts/router/index.d.ts +8 -3
- package/dist/contexts/router/index.js +7 -3
- package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
- package/dist/hooks/conversations/useCreateConversation.js +56 -0
- package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
- package/dist/hooks/groups/useJoinGroup.js +23 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
- package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
- package/dist/hooks/posts/useFeedPostActions.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Markdown.d.ts +14 -0
- package/dist/lib/Markdown.js +16 -0
- package/dist/lib/analyticsClicks.d.ts +12 -0
- package/dist/lib/analyticsClicks.js +64 -0
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +27 -0
- package/dist/lib/canvasUtils.d.ts +6 -0
- package/dist/lib/canvasUtils.js +62 -1
- package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
- package/dist/lib/passwordStrength.d.ts +6 -0
- package/dist/lib/passwordStrength.js +26 -0
- package/dist/lib/postUnread.d.ts +7 -0
- package/dist/lib/postUnread.js +7 -0
- package/dist/lib/postViewCounter.d.ts +1 -1
- package/dist/lib/postViewCounter.js +3 -1
- package/dist/lib/routeHandles.d.ts +2 -0
- package/dist/lib/routeHandles.js +2 -0
- package/dist/lib/svgCover.d.ts +2 -0
- package/dist/lib/svgCover.js +18 -0
- package/dist/navigation/index.d.ts +11 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/menuItems.d.ts +8 -0
- package/dist/navigation/menuItems.js +83 -0
- package/dist/navigation/targets.d.ts +94 -0
- package/dist/navigation/targets.js +12 -0
- package/dist/pages/About.d.ts +1 -0
- package/dist/pages/About.js +19 -0
- package/dist/pages/CodeOfConduct.d.ts +1 -0
- package/dist/pages/CodeOfConduct.js +14 -0
- package/dist/pages/Explore.d.ts +1 -0
- package/dist/pages/Explore.js +132 -0
- package/dist/pages/Home.d.ts +6 -0
- package/dist/pages/Home.js +31 -0
- package/dist/pages/Members.d.ts +1 -0
- package/dist/pages/Members.js +35 -0
- package/dist/pages/NotFound.d.ts +1 -0
- package/dist/pages/NotFound.js +9 -0
- package/dist/pages/Notifications.d.ts +1 -0
- package/dist/pages/Notifications.js +8 -0
- package/dist/pages/PostDetail.d.ts +1 -0
- package/dist/pages/PostDetail.js +27 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/Profile.js +20 -0
- package/dist/pages/Tags.d.ts +1 -0
- package/dist/pages/Tags.js +14 -0
- package/dist/pages/Welcome.d.ts +1 -0
- package/dist/pages/Welcome.js +89 -0
- package/dist/pages/admin/Analytics.d.ts +11 -0
- package/dist/pages/admin/Analytics.js +11 -0
- package/dist/pages/admin/ApiKeys.d.ts +1 -0
- package/dist/pages/admin/ApiKeys.js +141 -0
- package/dist/pages/admin/Backups.d.ts +1 -0
- package/dist/pages/admin/Backups.js +39 -0
- package/dist/pages/admin/ConfigEditor.d.ts +14 -0
- package/dist/pages/admin/ConfigEditor.js +91 -0
- package/dist/pages/admin/Configuration.d.ts +1 -0
- package/dist/pages/admin/Configuration.js +8 -0
- package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunity.js +7 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
- package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
- package/dist/pages/admin/ConfigurationEmail.js +97 -0
- package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
- package/dist/pages/admin/ConfigurationI18n.js +51 -0
- package/dist/pages/admin/Dashboard.d.ts +1 -0
- package/dist/pages/admin/Dashboard.js +40 -0
- package/dist/pages/admin/Db.d.ts +1 -0
- package/dist/pages/admin/Db.js +238 -0
- package/dist/pages/admin/Diagnostics.d.ts +1 -0
- package/dist/pages/admin/Diagnostics.js +8 -0
- package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsEmail.js +65 -0
- package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsJob.js +51 -0
- package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsLogs.js +62 -0
- package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
- package/dist/pages/admin/GroupMembers.d.ts +1 -0
- package/dist/pages/admin/GroupMembers.js +109 -0
- package/dist/pages/admin/Groups.d.ts +1 -0
- package/dist/pages/admin/Groups.js +61 -0
- package/dist/pages/admin/Invites.d.ts +1 -0
- package/dist/pages/admin/Invites.js +72 -0
- package/dist/pages/admin/Members.d.ts +1 -0
- package/dist/pages/admin/Members.js +49 -0
- package/dist/pages/admin/Moderation.d.ts +1 -0
- package/dist/pages/admin/Moderation.js +62 -0
- package/dist/pages/admin/Reports.d.ts +1 -0
- package/dist/pages/admin/Reports.js +178 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
- package/dist/pages/admin/analytics/Content.d.ts +1 -0
- package/dist/pages/admin/analytics/Content.js +117 -0
- package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
- package/dist/pages/admin/analytics/Engagement.js +220 -0
- package/dist/pages/admin/analytics/Groups.d.ts +1 -0
- package/dist/pages/admin/analytics/Groups.js +139 -0
- package/dist/pages/admin/analytics/Members.d.ts +1 -0
- package/dist/pages/admin/analytics/Members.js +96 -0
- package/dist/pages/admin/analytics/Overview.d.ts +1 -0
- package/dist/pages/admin/analytics/Overview.js +165 -0
- package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
- package/dist/pages/admin/analytics/ReportSettings.js +62 -0
- package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
- package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
- package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
- package/dist/pages/admin/analytics/downloadCsv.js +20 -0
- package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
- package/dist/pages/admin/community/CommunityFavicons.js +47 -0
- package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
- package/dist/pages/admin/community/CommunityInfo.js +35 -0
- package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
- package/dist/pages/admin/community/CommunityLinks.js +35 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
- package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
- package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
- package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
- package/dist/pages/admin/community/CommunityRoles.js +109 -0
- package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
- package/dist/pages/admin/community/CommunityTheme.js +56 -0
- package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
- package/dist/pages/admin/community/useCommunityConfig.js +28 -0
- package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
- package/dist/pages/admin/components/AdminCharts.js +29 -0
- package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
- package/dist/pages/admin/components/AdminGroupCard.js +42 -0
- package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
- package/dist/pages/admin/components/AdminInviteActions.js +23 -0
- package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
- package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
- package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
- package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
- package/dist/pages/admin/components/ProfileRowActions.js +131 -0
- package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
- package/dist/pages/articles/Edit.d.ts +1 -0
- package/dist/pages/articles/Edit.js +60 -0
- package/dist/pages/articles/Index.d.ts +1 -0
- package/dist/pages/articles/Index.js +18 -0
- package/dist/pages/articles/New.d.ts +1 -0
- package/dist/pages/articles/New.js +48 -0
- package/dist/pages/auth/Closed.d.ts +1 -0
- package/dist/pages/auth/Closed.js +14 -0
- package/dist/pages/auth/Login.d.ts +1 -0
- package/dist/pages/auth/Login.js +74 -0
- package/dist/pages/auth/OidcCallback.d.ts +5 -0
- package/dist/pages/auth/OidcCallback.js +31 -0
- package/dist/pages/auth/OidcPending.d.ts +5 -0
- package/dist/pages/auth/OidcPending.js +39 -0
- package/dist/pages/auth/Register.d.ts +4 -0
- package/dist/pages/auth/Register.js +124 -0
- package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
- package/dist/pages/auth/RegisterInvitation.js +5 -0
- package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
- package/dist/pages/auth/RequestResetPassword.js +50 -0
- package/dist/pages/auth/ResetPassword.d.ts +1 -0
- package/dist/pages/auth/ResetPassword.js +40 -0
- package/dist/pages/auth/SsoCallback.d.ts +1 -0
- package/dist/pages/auth/SsoCallback.js +34 -0
- package/dist/pages/auth/ValidateEmail.d.ts +6 -0
- package/dist/pages/auth/ValidateEmail.js +64 -0
- package/dist/pages/conversations/Index.d.ts +1 -0
- package/dist/pages/conversations/Index.js +58 -0
- package/dist/pages/conversations/Info.d.ts +1 -0
- package/dist/pages/conversations/Info.js +26 -0
- package/dist/pages/conversations/New.d.ts +1 -0
- package/dist/pages/conversations/New.js +8 -0
- package/dist/pages/conversations/Show.d.ts +1 -0
- package/dist/pages/conversations/Show.js +100 -0
- package/dist/pages/events/Edit.d.ts +1 -0
- package/dist/pages/events/Edit.js +69 -0
- package/dist/pages/events/Index.d.ts +1 -0
- package/dist/pages/events/Index.js +23 -0
- package/dist/pages/events/My.d.ts +1 -0
- package/dist/pages/events/My.js +24 -0
- package/dist/pages/events/New.d.ts +1 -0
- package/dist/pages/events/New.js +66 -0
- package/dist/pages/feeds/Bookmarks.d.ts +1 -0
- package/dist/pages/feeds/Bookmarks.js +10 -0
- package/dist/pages/feeds/Local.d.ts +1 -0
- package/dist/pages/feeds/Local.js +14 -0
- package/dist/pages/feeds/My.d.ts +1 -0
- package/dist/pages/feeds/My.js +12 -0
- package/dist/pages/groups/Edit.d.ts +1 -0
- package/dist/pages/groups/Edit.js +57 -0
- package/dist/pages/groups/Index.d.ts +1 -0
- package/dist/pages/groups/Index.js +50 -0
- package/dist/pages/groups/Info.d.ts +1 -0
- package/dist/pages/groups/Info.js +21 -0
- package/dist/pages/groups/Members.d.ts +1 -0
- package/dist/pages/groups/Members.js +28 -0
- package/dist/pages/groups/New.d.ts +1 -0
- package/dist/pages/groups/New.js +68 -0
- package/dist/pages/groups/Show.d.ts +1 -0
- package/dist/pages/groups/Show.js +64 -0
- package/dist/pages/index.d.ts +94 -0
- package/dist/pages/index.js +94 -0
- package/dist/pages/jams/Event.d.ts +8 -0
- package/dist/pages/jams/Event.js +57 -0
- package/dist/pages/jams/Index.d.ts +6 -0
- package/dist/pages/jams/Index.js +44 -0
- package/dist/pages/payment/Success.d.ts +1 -0
- package/dist/pages/payment/Success.js +30 -0
- package/dist/pages/plugins/Index.d.ts +1 -0
- package/dist/pages/plugins/Index.js +69 -0
- package/dist/pages/profile/Followers.d.ts +6 -0
- package/dist/pages/profile/Followers.js +28 -0
- package/dist/pages/settings/AccessTokens.d.ts +1 -0
- package/dist/pages/settings/AccessTokens.js +149 -0
- package/dist/pages/settings/Account.d.ts +1 -0
- package/dist/pages/settings/Account.js +81 -0
- package/dist/pages/settings/Billing.d.ts +1 -0
- package/dist/pages/settings/Billing.js +82 -0
- package/dist/pages/settings/Index.d.ts +1 -0
- package/dist/pages/settings/Index.js +13 -0
- package/dist/pages/settings/Language.d.ts +1 -0
- package/dist/pages/settings/Language.js +54 -0
- package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
- package/dist/pages/settings/NotificationPreferences.js +180 -0
- package/dist/pages/settings/Notifications.d.ts +1 -0
- package/dist/pages/settings/Notifications.js +10 -0
- package/dist/pages/settings/PublicProfile.d.ts +1 -0
- package/dist/pages/settings/PublicProfile.js +135 -0
- package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
- package/dist/pages/settings/PushEnabledDevices.js +67 -0
- package/dist/pages/settings/Theme.d.ts +1 -0
- package/dist/pages/settings/Theme.js +37 -0
- package/dist/pages/test/Error.d.ts +1 -0
- package/dist/pages/test/Error.js +10 -0
- package/dist/pages/test/Markdown.d.ts +1 -0
- package/dist/pages/test/Markdown.js +32 -0
- package/dist/pwa/InstallPrompt.js +1 -1
- package/dist/pwa/NotificationPermissionPrompt.js +2 -2
- package/dist/pwa/UpdatePrompt.js +1 -1
- package/dist/react-native.d.ts +1 -0
- package/dist/react-native.js +1 -0
- package/dist/session/useSessionEvents.d.ts +3 -0
- package/dist/session/useSessionEvents.js +64 -0
- package/dist/stores/newPosts.d.ts +8 -8
- package/package.json +14 -9
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Input, Label } from '@openpeepshq/react-ui';
|
|
3
3
|
import { useT } from '../../../i18n/index.js';
|
|
4
|
+
export const pollOptionLabel = (index, t) => t('posts.form.poll.option', {
|
|
5
|
+
defaultValue: 'Option {{number}}',
|
|
6
|
+
number: index + 1,
|
|
7
|
+
});
|
|
4
8
|
/** Shared poll option + settings fields used in compose and edit flows. */
|
|
5
9
|
export function PollComposerFields({ options, onOptionsChange, expiresAt, onExpiresAtChange, multiple = false, onMultipleChange, votersVisible = false, onVotersVisibleChange, }) {
|
|
6
10
|
const t = useT();
|
|
7
|
-
return (_jsxs("div", { className: "space-y-2", children: [options.map((opt, index) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
return (_jsxs("div", { className: "space-y-2", children: [options.map((opt, index) => {
|
|
12
|
+
const label = pollOptionLabel(index, t);
|
|
13
|
+
return (_jsx(Label, { title: label, htmlFor: `poll-option-${index + 1}`, children: _jsx(Input, { id: `poll-option-${index + 1}`, value: opt, placeholder: label, "data-testid": `posts-poll-option-${index + 1}`, onChange: (e) => {
|
|
14
|
+
const next = [...options];
|
|
15
|
+
next[index] = e.target.value;
|
|
16
|
+
onOptionsChange(next);
|
|
17
|
+
} }) }, index));
|
|
18
|
+
}), options.length < 6 ? (_jsx(Button, { variant: "ghost", action: () => onOptionsChange([...options, '']), children: t('posts.form.poll.addOption', { defaultValue: 'Add option' }) })) : null, _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "poll-expires", children: t('posts.form.poll.expiresAt', { defaultValue: 'Expires at' }) }), _jsx(Input, { id: "poll-expires", type: "datetime-local", value: expiresAt, onChange: (e) => onExpiresAtChange(e.target.value) })] }), onMultipleChange ? (_jsxs("label", { className: "flex items-start gap-2 text-sm", children: [_jsx("input", { type: "checkbox", checked: multiple, onChange: (e) => onMultipleChange(e.target.checked) }), _jsx("span", { children: t('posts.form.poll.multipleAnswers', {
|
|
15
19
|
defaultValue: 'Allow multiple answers',
|
|
16
20
|
}) })] })) : null, onVotersVisibleChange ? (_jsxs("label", { className: "flex items-start gap-2 text-sm", children: [_jsx("input", { type: "checkbox", checked: votersVisible, onChange: (e) => onVotersVisibleChange(e.target.checked) }), _jsx("span", { children: t('posts.form.poll.seeWhoVotedTitle', {
|
|
17
21
|
defaultValue: 'Show who voted',
|
|
@@ -68,10 +68,10 @@ export const PostAudienceSelector = ({ open, onClose, type = 'note', visibility,
|
|
|
68
68
|
defaultValue: 'No groups available',
|
|
69
69
|
}) })) : null] })) : (_jsx("div", { className: "space-y-2", children: choices.map((choice) => {
|
|
70
70
|
const Icon = choice.icon;
|
|
71
|
-
return (_jsxs("button", { type: "button", className:
|
|
71
|
+
return (_jsxs("button", { type: "button", "aria-pressed": draftVisibility === choice.value, className: `hover:bg-surface rounded-button flex w-full items-start gap-3 border p-3 text-left ${draftVisibility === choice.value ? 'border-primary' : ''}`, onClick: () => selectVisibility(choice.value), children: [_jsx("span", { className: "bg-surface flex size-10 shrink-0 items-center justify-center rounded-full", children: _jsx(Icon, { className: "size-5" }) }), _jsxs("span", { className: "flex-1", children: [_jsx("span", { className: "block font-medium", children: choice.title }), _jsx("span", { className: "text-muted-foreground block text-sm", children: choice.description }), choice.value === 'group' && draftGroupId ? (_jsx("span", { className: "text-primary mt-1 block text-xs", children: groups.find((g) => g.id === draftGroupId)
|
|
72
72
|
?.displayName ??
|
|
73
|
-
groups.find((g) => g.id === draftGroupId)?.handle })) : null, choice.value === 'direct' && draftAudience.length ? (_jsx("span", { className: "mt-1 flex flex-wrap gap-1", children: draftAudience.map((profile) => (_jsx(ProfileBadge, { profile: profile, onRemove: () => setDraftAudience((current) => current.filter((p) => p.id !== profile.id)) }, profile.id))) })) : null] })
|
|
74
|
-
}) })), _jsxs(DialogFooter, { children: [view !== 'main' ? (_jsx(Button, { variant: "
|
|
73
|
+
groups.find((g) => g.id === draftGroupId)?.handle })) : null, choice.value === 'direct' && draftAudience.length ? (_jsx("span", { className: "mt-1 flex flex-wrap gap-1", children: draftAudience.map((profile) => (_jsx(ProfileBadge, { profile: profile, onRemove: () => setDraftAudience((current) => current.filter((p) => p.id !== profile.id)) }, profile.id))) })) : null] })] }, choice.value));
|
|
74
|
+
}) })), _jsxs(DialogFooter, { children: [view !== 'main' ? (_jsx(Button, { variant: "outline", action: () => setView('main'), children: t('navigation.back', { defaultValue: 'Back' }) })) : (_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) })), _jsx(Button, { variant: "default", action: confirm, children: t('common.done', { defaultValue: 'Done' }) })] })] }) }), _jsx(ProfileSelector, { open: open && view === 'audience', onOpenChange: (next) => {
|
|
75
75
|
if (!next)
|
|
76
76
|
setView('main');
|
|
77
77
|
}, mode: "multiple", selectedProfiles: draftAudience, banlist: me ? [me] : [], onConfirm: (profiles) => {
|
|
@@ -18,5 +18,5 @@ export function PostTypeSwitcher({ type, onSelect, onClose, showEventType = true
|
|
|
18
18
|
onClose();
|
|
19
19
|
navigate(path);
|
|
20
20
|
};
|
|
21
|
-
return (_jsxs("div", { className: "flex items-center gap-1", children: [type !== 'note' ? (_jsx(Button, { compact: true, variant: "
|
|
21
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [type !== 'note' ? (_jsx(Button, { compact: true, variant: "ghost", title: t('posts.switcher.note', { defaultValue: 'Write Note' }), action: () => onSelect('note'), children: _jsx(Notebook, { className: "size-5" }) })) : null, type !== 'question' ? (_jsx(Button, { compact: true, variant: "ghost", title: t('posts.switcher.poll', { defaultValue: 'Add Poll' }), action: () => onSelect('question'), "data-testid": "posts-composer-poll-type", children: _jsx(ChartColumnBig, { className: "size-5" }) })) : null, showEventType && isOwner ? (_jsx(Button, { compact: true, variant: "ghost", title: t('posts.switcher.event', { defaultValue: 'Create an Event' }), action: () => goto('/events/new'), children: _jsx(CalendarDays, { className: "size-5" }) })) : null, showArticleType ? (_jsx(Button, { compact: true, variant: "ghost", title: t('posts.switcher.article', { defaultValue: 'Write Article' }), action: () => goto('/articles/new'), children: _jsx(ScrollText, { className: "size-5" }) })) : null] }));
|
|
22
22
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { Image, Paperclip } from 'lucide-react';
|
|
4
|
+
import { resolvePollOptionContents } from '@openpeepshq/common';
|
|
4
5
|
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, ModalFooter, } from '@openpeepshq/react-ui';
|
|
5
6
|
import { useOpenpeeps } from '../../../contexts/openpeeps/index.js';
|
|
6
7
|
import { useT } from '../../../i18n/index.js';
|
|
@@ -14,7 +15,7 @@ import { OpenpeepsMarkdownInput } from './OpenpeepsMarkdownInput.js';
|
|
|
14
15
|
import { ComposePreviewLinks } from './ComposePreviewLinks.js';
|
|
15
16
|
import { useComposeAttachments } from './ComposeAttachments.js';
|
|
16
17
|
import { PostTypeSwitcher } from './PostTypeSwitcher.js';
|
|
17
|
-
import { PollComposerFields } from './PollComposerFields.js';
|
|
18
|
+
import { PollComposerFields, pollOptionLabel } from './PollComposerFields.js';
|
|
18
19
|
export function ReplyModal({ post, onClose }) {
|
|
19
20
|
const t = useT();
|
|
20
21
|
const { success, error: toastError } = useToast();
|
|
@@ -75,12 +76,12 @@ export function ReplyModal({ post, onClose }) {
|
|
|
75
76
|
});
|
|
76
77
|
};
|
|
77
78
|
const trimmedContent = content.trim();
|
|
78
|
-
const
|
|
79
|
+
const resolvedPollOptions = resolvePollOptionContents(pollOptions, (index) => pollOptionLabel(index, t));
|
|
79
80
|
const canSubmit = useMemo(() => {
|
|
80
81
|
if (submitting || composeAttachments.pending)
|
|
81
82
|
return false;
|
|
82
83
|
if (composerType === 'question') {
|
|
83
|
-
return trimmedContent.length > 0 &&
|
|
84
|
+
return trimmedContent.length > 0 && resolvedPollOptions.length >= 2;
|
|
84
85
|
}
|
|
85
86
|
return ((trimmedContent.length > 0 && trimmedContent.length <= 500) ||
|
|
86
87
|
attachments.length > 0);
|
|
@@ -89,7 +90,7 @@ export function ReplyModal({ post, onClose }) {
|
|
|
89
90
|
composeAttachments.pending,
|
|
90
91
|
composerType,
|
|
91
92
|
trimmedContent,
|
|
92
|
-
|
|
93
|
+
resolvedPollOptions.length,
|
|
93
94
|
attachments.length,
|
|
94
95
|
]);
|
|
95
96
|
const publish = async () => {
|
|
@@ -106,7 +107,7 @@ export function ReplyModal({ post, onClose }) {
|
|
|
106
107
|
...payload.data,
|
|
107
108
|
type: 'question',
|
|
108
109
|
content: trimmedContent,
|
|
109
|
-
options:
|
|
110
|
+
options: resolvedPollOptions.map((text) => ({
|
|
110
111
|
type: 'note',
|
|
111
112
|
content: text,
|
|
112
113
|
})),
|
|
@@ -192,11 +193,11 @@ export function ReplyModal({ post, onClose }) {
|
|
|
192
193
|
...draft,
|
|
193
194
|
data: { ...draft.data, votersVisible: value },
|
|
194
195
|
});
|
|
195
|
-
} })) : null] })] })] }), _jsx(ModalFooter, { className: "border-t", children: _jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsxs("div", { className: "flex items-center gap-1", children: [composerType === 'note' ? (_jsxs(_Fragment, { children: [_jsx(Button, { compact: true, variant: "
|
|
196
|
+
} })) : null] })] })] }), _jsx(ModalFooter, { className: "border-t", children: _jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsxs("div", { className: "flex items-center gap-1", children: [composerType === 'note' ? (_jsxs(_Fragment, { children: [_jsx(Button, { compact: true, variant: "ghost", title: t('posts.form.addImage', {
|
|
196
197
|
defaultValue: 'Add image',
|
|
197
|
-
}), action: composeAttachments.openImagePicker, children: _jsx(Image, { className: "size-5" }) }), _jsx(Button, { compact: true, variant: "
|
|
198
|
+
}), action: composeAttachments.openImagePicker, children: _jsx(Image, { className: "size-5" }) }), _jsx(Button, { compact: true, variant: "ghost", title: t('posts.form.addAttachment', {
|
|
198
199
|
defaultValue: 'Add attachment',
|
|
199
|
-
}), action: composeAttachments.openDocumentPicker, children: _jsx(Paperclip, { className: "size-5" }) })] })) : null, _jsx(PostTypeSwitcher, { type: composerType, onSelect: setComposerType, onClose: onClose, showEventType: false, showArticleType: false })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "
|
|
200
|
+
}), action: composeAttachments.openDocumentPicker, children: _jsx(Paperclip, { className: "size-5" }) })] })) : null, _jsx(PostTypeSwitcher, { type: composerType, onSelect: setComposerType, onClose: onClose, showEventType: false, showArticleType: false })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "ghost", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: publish, disabled: !canSubmit, children: submitting
|
|
200
201
|
? t('common.posting', { defaultValue: 'Posting…' })
|
|
201
202
|
: t('posts.reply', { defaultValue: 'Reply' }) })] })] }) })] }) }), composeAttachments.inputs] }));
|
|
202
203
|
}
|
|
@@ -31,5 +31,5 @@ export const VisibilitySelector = ({ postData, onClick, disabled = false, showDi
|
|
|
31
31
|
};
|
|
32
32
|
return (_jsxs("div", { className: "op-input-group grid grid-cols-[auto_1fr_auto]", children: [_jsx("div", { className: "op-input-group-shim", children: _jsx(Eye, { className: "size-4" }) }), _jsx("button", { type: "button", title: t('posts.form.changeAudience', {
|
|
33
33
|
defaultValue: 'Change audience',
|
|
34
|
-
}), className: "hover:bg-
|
|
34
|
+
}), className: "hover:bg-surface/50 flex h-10 w-full min-w-0 items-center px-3 text-left disabled:cursor-not-allowed disabled:opacity-50", onClick: onClick, disabled: disabled, children: content() }), !disabled ? (_jsx("div", { className: "op-input-group-shim", children: _jsx(ChevronDown, { className: "text-muted-foreground size-4" }) })) : null] }));
|
|
35
35
|
};
|
|
@@ -3,6 +3,7 @@ import { ArrowRight } from 'lucide-react';
|
|
|
3
3
|
import { useT } from '../../../i18n/index.js';
|
|
4
4
|
import { resolveStaticUrl, useStaticRender } from '../../markdown/staticRender.js';
|
|
5
5
|
import { PostMarkdown } from '../Markdown.js';
|
|
6
|
+
import { OPENPEEPS_POST_CAPTION_CLASS } from '../../markdown/classes.js';
|
|
6
7
|
import { firstNWords } from '../helpers.js';
|
|
7
8
|
export function FeedArticle({ post }) {
|
|
8
9
|
const t = useT();
|
|
@@ -10,5 +11,5 @@ export function FeedArticle({ post }) {
|
|
|
10
11
|
const article = post.data;
|
|
11
12
|
const previewContent = firstNWords(article.content, 50);
|
|
12
13
|
const showReadMore = !!article.content && previewContent.length < article.content.length;
|
|
13
|
-
return (_jsxs("div", { className: "flex w-full min-w-0 flex-col gap-2", children: [article.image && (_jsx("img", { src: article.image, className: "w-full object-cover", alt: `image for ${article.title ?? 'article'}` })), _jsx("div", { className: "prose", children: _jsx("h3", { children: article.title }) }), _jsx(PostMarkdown, { source: `${previewContent}${showReadMore ? '...' : ''}
|
|
14
|
+
return (_jsxs("div", { className: "flex w-full min-w-0 flex-col gap-2", children: [article.image && (_jsx("img", { src: article.image, className: "w-full object-cover", alt: `image for ${article.title ?? 'article'}` })), _jsx("div", { className: "prose-sm", children: _jsx("h3", { children: article.title }) }), _jsx(PostMarkdown, { source: `${previewContent}${showReadMore ? '...' : ''}`, className: OPENPEEPS_POST_CAPTION_CLASS }), showReadMore && (_jsx("div", { className: "flex justify-end", children: _jsxs("a", { href: resolveStaticUrl(`/posts/${post.id}`, staticRender ? baseUrl : undefined), className: "text-primary inline-flex items-center gap-1 text-sm hover:underline", children: [t('posts.article.readMore', { defaultValue: 'Read more' }), _jsx(ArrowRight, { className: "inline-block size-4" })] }) }))] }));
|
|
14
15
|
}
|
|
@@ -15,5 +15,5 @@ export function FeedEvent({ post }) {
|
|
|
15
15
|
return (_jsx("h1", { children: "FeedEvent was used but post type is not \"event\". Please report this to the developers." }));
|
|
16
16
|
}
|
|
17
17
|
const event = post.data;
|
|
18
|
-
return (_jsxs("div", { className: "flex w-full flex-col gap-2", children: [event.image && (_jsx("span", { className: "aspect-video w-full overflow-hidden", children: _jsx("img", { src: event.image, className: "h-full w-full object-cover", alt: `image for ${event.name ?? 'event'}` }) })), _jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsxs("span", { className: "text-
|
|
18
|
+
return (_jsxs("div", { className: "flex w-full flex-col gap-2", children: [event.image && (_jsx("span", { className: "aspect-video w-full overflow-hidden", children: _jsx("img", { src: event.image, className: "h-full w-full object-cover", alt: `image for ${event.name ?? 'event'}` }) })), _jsxs("div", { className: "flex w-full items-center justify-between", children: [_jsxs("span", { className: "text-destructive text-sm", children: [fmtRange(event.start, event.end), ' ', _jsx("span", { className: "text-muted-foreground", children: "(your local time)" })] }), _jsx("a", { href: resolveStaticUrl(`/posts/${post.id}`, staticRender ? baseUrl : undefined), className: "border-primary text-primary hover:bg-primary/10 rounded-button border px-3 py-1 text-sm", children: t('posts.event.viewEvent', { defaultValue: 'View Event' }) })] }), _jsx("div", { className: "text-lg font-medium", children: event.name }), _jsx(EventLocation, { post: post })] }));
|
|
19
19
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { OpenpeepsMarkdown } from '../../markdown/OpenpeepsMarkdown.js';
|
|
3
|
+
import { OPENPEEPS_POST_CAPTION_CLASS } from '../../markdown/classes.js';
|
|
3
4
|
import { Attachments } from '../pieces/Attachments.js';
|
|
4
5
|
export function FeedNote({ post }) {
|
|
5
6
|
if (post?.data?.type !== 'note') {
|
|
6
7
|
return (_jsx("h1", { children: "FeedNote was used but post type is not \"note\". Please report this to the developers." }));
|
|
7
8
|
}
|
|
8
9
|
const data = post.data;
|
|
9
|
-
return (_jsxs("div", { children: [_jsx(OpenpeepsMarkdown, { source: data.content, mentions: post.mentions, linkPreviewMode: post.data.attachments?.length ? 'none' : 'append' }), _jsx(Attachments, { post: post })] }));
|
|
10
|
+
return (_jsxs("div", { children: [_jsx(OpenpeepsMarkdown, { source: data.content, mentions: post.mentions, className: OPENPEEPS_POST_CAPTION_CLASS, linkPreviewMode: post.data.attachments?.length ? 'none' : 'append' }), _jsx(Attachments, { post: post })] }));
|
|
10
11
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { PostMarkdown } from '../Markdown.js';
|
|
3
|
+
import { OPENPEEPS_POST_CAPTION_CLASS } from '../../markdown/classes.js';
|
|
3
4
|
import { Attachments } from '../pieces/Attachments.js';
|
|
4
5
|
import { PollContent } from '../pieces/PollContent.js';
|
|
5
6
|
export function FeedPoll({ post, interactive = true }) {
|
|
@@ -7,5 +8,5 @@ export function FeedPoll({ post, interactive = true }) {
|
|
|
7
8
|
return (_jsx("p", { className: "text-error text-sm", children: "FeedPoll was used for a non-question post." }));
|
|
8
9
|
}
|
|
9
10
|
const data = post.data;
|
|
10
|
-
return (_jsxs("div", { className: "space-y-3", children: [data.content ? (_jsx(PostMarkdown, { source: data.content, mentions: post.mentions, linkPreviewMode: data.attachments?.length ? 'none' : 'append' })) : null, _jsx(Attachments, { post: post }), interactive ? (_jsx(PollContent, { post: post })) : (_jsxs(_Fragment, { children: [_jsx("ul", { className: "space-y-1.5", children: data.options.map((opt, idx) => (_jsx("li", { className: "rounded-md border
|
|
11
|
+
return (_jsxs("div", { className: "space-y-3", children: [data.content ? (_jsx(PostMarkdown, { source: data.content, mentions: post.mentions, className: OPENPEEPS_POST_CAPTION_CLASS, linkPreviewMode: data.attachments?.length ? 'none' : 'append' })) : null, _jsx(Attachments, { post: post }), interactive ? (_jsx(PollContent, { post: post })) : (_jsxs(_Fragment, { children: [_jsx("ul", { className: "space-y-1.5", children: data.options.map((opt, idx) => (_jsx("li", { className: "border-border rounded-md border px-3 py-2 text-sm", children: opt.content }, idx))) }), data.expiresAt ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: ["Closes ", new Date(data.expiresAt).toLocaleString()] })) : null] }))] }));
|
|
11
12
|
}
|
|
@@ -39,7 +39,7 @@ export function CardEvent({ post }) {
|
|
|
39
39
|
const attendeesLength = jamState?.participants.length ?? 0;
|
|
40
40
|
const jamLink = getJamUrl(post.id, typeof window !== 'undefined' ? window.location.origin : undefined);
|
|
41
41
|
const postLink = `/posts/${post.id}`;
|
|
42
|
-
return (_jsxs("
|
|
42
|
+
return (_jsxs("article", { ref: postViewRef, className: "hover:bg-surface mb-6 w-full overflow-hidden rounded-lg border", children: [_jsx("a", { href: postLink, className: "block", children: _jsx("div", { className: "aspect-video w-full overflow-hidden", children: _jsx("img", { src: event.image || '/img/event-default.png', alt: event.name ? `image for ${event.name}` : 'Event', className: "h-full w-full object-cover" }) }) }), _jsxs("div", { className: "grid gap-y-4 p-4", children: [_jsxs("a", { href: postLink, className: "block text-inherit no-underline", children: [_jsx("p", { className: "text-muted-foreground text-sm", children: formatEventTimespan(event) }), _jsx("h3", { className: "text-xl font-semibold", children: truncateText(event.name, 100) || '-' })] }), _jsxs("div", { className: "flex flex-wrap gap-x-2 gap-y-1", children: [_jsx(EventLocation, { post: post, truncate: true }), _jsx(ProfileEventRelationship, { post: post })] }), jam && me ? (jamState?.active ? (_jsxs("div", { className: "text-muted-foreground flex items-center justify-start gap-2 text-xs", children: [_jsx("span", { className: "w-12", children: _jsx(ParticipantsCard, { jamState: jamState }) }), _jsxs("span", { children: [attendeesLength, ' ', attendeesLength === 1
|
|
43
43
|
? t('events.jam.attendee', { defaultValue: 'attendee' })
|
|
44
|
-
: t('events.jam.attendees', { defaultValue: 'attendees' })] }), _jsx(Button, { action: jamLink, variant: "
|
|
44
|
+
: t('events.jam.attendees', { defaultValue: 'attendees' })] }), _jsx(Button, { action: jamLink, variant: "default", compact: true, children: t('jam.join.submit', { defaultValue: 'Join Jam' }) })] })) : jam.moderators.includes(me.id) ? (_jsx("div", { children: _jsx(Button, { action: jamLink, variant: "default", children: t('jam.start.submit', { defaultValue: 'Start Jam' }) }) })) : null) : null] })] }));
|
|
45
45
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Download, MoreHorizontal, Share, Trash2 } from 'lucide-react';
|
|
3
3
|
import { useMemo, useState } from 'react';
|
|
4
4
|
import { buildThreads, calculateEffectiveRsvps, canAccessJamRecordings, canManageEventRsvps, canModerateJam, countYesRsvps, groupName, isCapacityEvent, profileName, } from '@openpeepshq/common/lib';
|
|
5
|
-
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, LoadingSpinner, PopupMenu, PopupMenuButton, UpdatingDate } from '@openpeepshq/react-ui';
|
|
5
|
+
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, LoadingSpinner, PopupMenu, PopupMenuButton, UpdatingDate, } from '@openpeepshq/react-ui';
|
|
6
6
|
import { useOpenpeeps } from '../../../../contexts/openpeeps/index.js';
|
|
7
7
|
import { useT } from '../../../../i18n/index.js';
|
|
8
8
|
import { useCurrentProfile } from '../../../layout/IdentityContext.js';
|
|
@@ -50,7 +50,7 @@ export function FullEvent({ post }) {
|
|
|
50
50
|
return t('events.community', { defaultValue: 'Community' });
|
|
51
51
|
}, [post, t]);
|
|
52
52
|
const showJamAttendeesTab = !!event.jam && (myEvent || iAmModerator) && jamAttendeesQuery.isSuccess;
|
|
53
|
-
return (_jsxs("
|
|
53
|
+
return (_jsxs("article", { ref: postViewRef, className: "flex w-full flex-col gap-2 p-3", children: [_jsx("span", { className: "mb-3 block aspect-video w-full overflow-hidden rounded", children: _jsx("img", { src: event.image || '/img/event-default.png', className: "h-full w-full object-cover", alt: event.name ? `image for ${event.name}` : 'Event' }) }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex gap-x-4", children: [_jsx("span", { className: "bg-surface-2 mb-3 inline-block rounded-lg px-3 py-1 text-sm", children: eventScope }), slotsLeft !== null ? (_jsx("span", { className: "bg-surface-2 mb-3 inline-block rounded-lg px-3 py-1 text-sm", children: slotsLeft <= 0
|
|
54
54
|
? t('events.noSpotsAvailable', {
|
|
55
55
|
defaultValue: 'No spots available',
|
|
56
56
|
})
|
|
@@ -80,16 +80,16 @@ export function FullEvent({ post }) {
|
|
|
80
80
|
}) }), _jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: new Date(event.end).toLocaleTimeString(undefined, {
|
|
81
81
|
hour: '2-digit',
|
|
82
82
|
minute: '2-digit',
|
|
83
|
-
}) })] })] })) : null, _jsx(EventLocation, { post: post, preview: false }), _jsx(EventRsvpButton, { post: post }), event.jam && (myEvent || iAmModerator) ? (_jsx(Button, { variant: "
|
|
83
|
+
}) })] })] })) : null, _jsx(EventLocation, { post: post, preview: false }), _jsx(EventRsvpButton, { post: post }), event.jam && (myEvent || iAmModerator) ? (_jsx(Button, { variant: "default", className: "mt-2 w-full", action: `/events/${post.id}/jam`, children: t('events.jam.start', { defaultValue: 'Start jam' }) })) : null, _jsxs("nav", { "aria-label": t('events.tabs.label', { defaultValue: 'Event sections' }), className: "mt-4 flex flex-wrap gap-2 border-b", children: [event.content ? (_jsx(TabButton, { active: tab === 'description', onClick: () => setTab('description'), children: t('events.tabs.description', { defaultValue: 'Description' }) })) : null, _jsx(TabButton, { active: tab === 'replies', onClick: () => setTab('replies'), children: t('events.tabs.discussion', { defaultValue: 'Discussion' }) }), _jsx(TabButton, { active: tab === 'rsvps', onClick: () => setTab('rsvps'), children: t('events.tabs.rsvps', { defaultValue: 'RSVPs' }) }), showJamAttendeesTab ? (_jsx(TabButton, { active: tab === 'attendees', onClick: () => setTab('attendees'), children: t('events.tabs.jamAttendees', { defaultValue: 'Jam attendees' }) })) : null, event.jam && canViewRecordings ? (_jsx(TabButton, { active: tab === 'recordings', onClick: () => setTab('recordings'), children: t('events.tabs.recordings', { defaultValue: 'Recordings' }) })) : null] }), tab === 'description' && event.content ? (_jsx(OpenpeepsMarkdown, { source: event.content, mentions: post.mentions })) : null, tab === 'replies' ? (_jsxs(_Fragment, { children: [_jsx(ReplyBox, { post: post }), contextQuery.isLoading ? (_jsx("div", { className: "text-muted-foreground py-4 text-sm", children: _jsx(LoadingSpinner, {}) })) : (descendentThreads.map((thread) => (_jsx(ThreadedFeed, { thread: thread, isDescendants: true }, thread.id))))] })) : null, tab === 'rsvps' ? (rsvps.length ? (rsvps.map((rsvp) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "min-w-0 flex-1", children: _jsx(ProfileCard, { profile: rsvp.profile, action: profile && profile.id !== rsvp.profile.id ? (_jsxs(PopupMenu, { children: [profile.following?.some((f) => f.id === rsvp.profile.id) ? (_jsx(PopupMenuButton, { title: t('profile.actions.message', {
|
|
84
84
|
defaultValue: 'Message',
|
|
85
85
|
}), text: t('profile.actions.message', {
|
|
86
86
|
defaultValue: 'Message',
|
|
87
87
|
}), action: () => openCreateConversation({
|
|
88
88
|
profiles: [rsvp.profile],
|
|
89
89
|
skipProfileSelection: true,
|
|
90
|
-
}) })) : null, _jsx(FollowUnfollowButton, { profile: rsvp.profile, popup: true })] })) : undefined }) }), canManageRsvps && rsvp.profile.id !== post.profile.id ? (rsvp.response === 'removed' ? (_jsx(Button, { variant: "
|
|
90
|
+
}) })) : null, _jsx(FollowUnfollowButton, { profile: rsvp.profile, popup: true })] })) : undefined }) }), canManageRsvps && rsvp.profile.id !== post.profile.id ? (rsvp.response === 'removed' ? (_jsx(Button, { variant: "outline", action: () => rsvpManage({ response: 'yes' }, { id: post.id, profileId: rsvp.profile.id }), children: t('events.rsvp.restoreAttendee', {
|
|
91
91
|
defaultValue: 'Restore',
|
|
92
|
-
}) })) : (_jsx(Button, { variant: "
|
|
92
|
+
}) })) : (_jsx(Button, { variant: "outline", action: () => rsvpManage({ response: 'removed' }, { id: post.id, profileId: rsvp.profile.id }), children: t('events.rsvp.removeAttendee', {
|
|
93
93
|
defaultValue: 'Remove',
|
|
94
94
|
}) }))) : null] }, rsvp.profile.id)))) : (_jsx("p", { className: "text-muted-foreground py-4 text-sm", children: t('events.noRsvps', { defaultValue: 'No RSVPs yet.' }) }))) : null, tab === 'attendees' && showJamAttendeesTab ? (jamAttendeesQuery.data?.length ? (jamAttendeesQuery.data.map((attendee) => (_jsx(ProfileFromId, { profileId: attendee.profileId, action: _jsx(UpdatingDate, { date: attendee.createdAt }) }, attendee.id)))) : (_jsx("p", { className: "text-muted-foreground py-4 text-sm", children: t('events.noAttendees', { defaultValue: 'No attendees yet.' }) }))) : null, tab === 'recordings' && event.jam && canViewRecordings ? (recordingsQuery.isLoading ? (_jsx("div", { className: "text-muted-foreground py-4 text-sm", children: _jsx(LoadingSpinner, {}) })) : recordingsQuery.data?.length ? (recordingsQuery.data.map((recording) => (_jsx(JamRecordingItem, { post: post, recording: recording, canManage: canViewRecordings }, recording.id)))) : (_jsx("p", { className: "text-muted-foreground py-4 text-sm", children: t('events.noRecordings', { defaultValue: 'No recordings yet.' }) }))) : null, _jsx("div", { className: "h-[40vh]" })] }));
|
|
95
95
|
}
|
|
@@ -132,7 +132,7 @@ function JamRecordingItem({ post, recording, canManage, }) {
|
|
|
132
132
|
recording.status === 'completed' &&
|
|
133
133
|
recording.attachment ? (recording.replyPostId ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('events.recordingReplyPosted', {
|
|
134
134
|
defaultValue: 'Posted to discussion',
|
|
135
|
-
}) })) : (_jsx(Button, { variant: "
|
|
135
|
+
}) })) : (_jsx(Button, { variant: "outline", className: "self-start", action: async () => {
|
|
136
136
|
try {
|
|
137
137
|
await publishReply();
|
|
138
138
|
success(t('events.postRecordingReplySuccess', {
|
|
@@ -148,13 +148,13 @@ function JamRecordingItem({ post, recording, canManage, }) {
|
|
|
148
148
|
defaultValue: 'Post to discussion',
|
|
149
149
|
}) }))) : null, canManage &&
|
|
150
150
|
recording.status !== 'active' &&
|
|
151
|
-
recording.status !== 'requested' ? (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "
|
|
151
|
+
recording.status !== 'requested' ? (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "outline", className: "self-start", action: () => setConfirmOpen(true), children: [_jsx(Trash2, { className: "mr-1 h-4 w-4" }), t('events.deleteRecording', {
|
|
152
152
|
defaultValue: 'Delete recording',
|
|
153
153
|
})] }), _jsx(Dialog, { open: confirmOpen, onOpenChange: (next) => !next && setConfirmOpen(false), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('events.deleteRecording', {
|
|
154
154
|
defaultValue: 'Delete recording',
|
|
155
155
|
}) }) }), _jsx("p", { className: "text-sm", children: t('events.deleteRecordingConfirm', {
|
|
156
156
|
defaultValue: 'Delete this recording permanently?',
|
|
157
|
-
}) }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "
|
|
157
|
+
}) }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: () => setConfirmOpen(false), children: t('posts.deleteModal.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "destructive", action: handleDelete, children: t('posts.deleteModal.delete', { defaultValue: 'Delete' }) })] })] }) })] })) : null] })] }));
|
|
158
158
|
}
|
|
159
159
|
function TabButton({ active, onClick, children, }) {
|
|
160
160
|
return (_jsx("button", { type: "button", onClick: onClick, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: children }));
|
|
@@ -2,4 +2,4 @@ import type { PublicPost } from '@openpeepshq/common/types';
|
|
|
2
2
|
export interface ProfileEventRelationshipProps {
|
|
3
3
|
post: PublicPost;
|
|
4
4
|
}
|
|
5
|
-
export declare
|
|
5
|
+
export declare const ProfileEventRelationship: ({ post, }: ProfileEventRelationshipProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,31 +1,51 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { calculateEffectiveRsvps } from '@openpeepshq/common/lib';
|
|
3
|
+
import { Badge } from '@openpeepshq/react-ui';
|
|
3
4
|
import { useT } from '../../../../i18n/index.js';
|
|
4
5
|
import { useCurrentProfile } from '../../../layout/IdentityContext.js';
|
|
5
|
-
export
|
|
6
|
+
export const ProfileEventRelationship = ({ post, }) => {
|
|
6
7
|
const t = useT();
|
|
7
8
|
const me = useCurrentProfile();
|
|
8
9
|
const event = post.data;
|
|
9
10
|
const myEvent = post.profile?.id === me?.id;
|
|
10
11
|
const iAmModerator = !!event.moderators?.includes(me?.id ?? '');
|
|
11
12
|
const myRsvp = calculateEffectiveRsvps(post).find((rsvp) => me?.id === rsvp.profile.id);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const badge = (() => {
|
|
14
|
+
if (myEvent) {
|
|
15
|
+
return {
|
|
16
|
+
status: t('events.profileRelationship.owner', {
|
|
17
|
+
defaultValue: 'Owner',
|
|
18
|
+
}),
|
|
19
|
+
variant: 'default',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (iAmModerator) {
|
|
23
|
+
return {
|
|
24
|
+
status: t('events.profileRelationship.moderator', {
|
|
17
25
|
defaultValue: 'Moderator',
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
}),
|
|
27
|
+
variant: 'default',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (myRsvp?.response === 'yes') {
|
|
31
|
+
return {
|
|
32
|
+
status: t('events.profileRelationship.attending', {
|
|
22
33
|
defaultValue: 'Attending',
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
}),
|
|
35
|
+
variant: 'success',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (myRsvp?.response === 'tentative') {
|
|
39
|
+
return {
|
|
40
|
+
status: t('events.profileRelationship.tentative', {
|
|
27
41
|
defaultValue: 'Tentative',
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
42
|
+
}),
|
|
43
|
+
variant: 'outline',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
})();
|
|
48
|
+
if (!badge)
|
|
49
|
+
return null;
|
|
50
|
+
return _jsx(Badge, { status: badge.status, variant: badge.variant });
|
|
51
|
+
};
|
|
@@ -8,5 +8,5 @@ export function LocalPreviewLink({ url }) {
|
|
|
8
8
|
const isPost = isPostPath(path);
|
|
9
9
|
const isJam = isJamPath(path);
|
|
10
10
|
const isGroup = isGroupPath(path);
|
|
11
|
-
return (_jsxs("a", { href: url, className: "hover:bg-surface
|
|
11
|
+
return (_jsxs("a", { href: url, className: "hover:bg-surface mb-2 block w-full min-w-0 max-w-full overflow-hidden rounded-md border p-3 no-underline", onClick: (e) => e.stopPropagation(), children: [isPost ? _jsx(PostPreview, { path: path }) : null, isGroup ? _jsx(GroupPreview, { path: path }) : null, isJam ? _jsx(JamPreview, { path: path }) : null] }));
|
|
12
12
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
3
3
|
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { recordOutboundClick } from '../../lib/analyticsClicks.js';
|
|
4
5
|
export function RemotePreviewLink({ url }) {
|
|
5
6
|
const { openpeepsApi } = useOpenpeeps();
|
|
6
7
|
const previewQuery = openpeepsApi.usePreviewLink(url);
|
|
@@ -17,5 +18,8 @@ export function RemotePreviewLink({ url }) {
|
|
|
17
18
|
catch {
|
|
18
19
|
/* keep url */
|
|
19
20
|
}
|
|
20
|
-
return (_jsx("a", { href: url, target: "_blank", rel: "noreferrer", className: "hover:bg-surface
|
|
21
|
+
return (_jsx("a", { href: url, target: "_blank", rel: "noreferrer", className: "hover:bg-surface mb-2 block w-full min-w-0 max-w-full overflow-hidden rounded-md border no-underline", onClick: (e) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
recordOutboundClick(url);
|
|
24
|
+
}, children: _jsxs("div", { className: "flex w-full min-w-0 flex-row items-center gap-4 p-2", children: [data.image ? (_jsx("div", { className: "flex h-24 w-24 shrink-0 items-center justify-center", children: _jsx("img", { src: data.image, alt: data.title ?? '', className: "h-full w-full rounded-md object-cover" }) })) : null, _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsx("p", { className: "text-muted-foreground truncate text-xs", children: hostname }), data.title ? (_jsx("p", { className: "truncate font-semibold", children: data.title })) : null, data.description ? (_jsx("p", { className: "text-muted-foreground truncate text-sm", children: data.description })) : null] })] }) }));
|
|
21
25
|
}
|
|
@@ -3,6 +3,7 @@ import { getTheme, isDeletedProfile } from '@openpeepshq/common';
|
|
|
3
3
|
import { UserX } from 'lucide-react';
|
|
4
4
|
import { useServerInfo } from '../server-data/index.js';
|
|
5
5
|
import { useCurrentProfileSettings } from '../layout/IdentityContext.js';
|
|
6
|
+
import { svgCoverSrc } from '../../lib/svgCover.js';
|
|
6
7
|
const initials = (profile) => {
|
|
7
8
|
const name = profile?.displayName || profile?.handle || '?';
|
|
8
9
|
const parts = name.split(' ');
|
|
@@ -26,8 +27,8 @@ export function Avatar({ profile, size = 3.5, borderless = false, containerClass
|
|
|
26
27
|
const iconSize = Math.max(12, size * 8);
|
|
27
28
|
const borderClass = borderless
|
|
28
29
|
? ''
|
|
29
|
-
: 'border-4 border-
|
|
30
|
-
const inner = (_jsx("div", { className: `bg-surface-
|
|
30
|
+
: 'border-4 border-border hover:border-neutral-500';
|
|
31
|
+
const inner = (_jsx("div", { className: `bg-surface-2 relative inline-flex items-center justify-center overflow-hidden rounded-full ${borderClass}`, style: { width: `${size}rem`, height: `${size}rem` }, children: deleted ? (_jsx(UserX, { "aria-label": profile?.displayName || 'Deleted author', className: "text-muted-foreground", size: iconSize })) : src ? (_jsx("img", { src: svgCoverSrc(src), alt: profile?.displayName || profile?.handle || 'avatar', className: "h-full w-full rounded-full object-cover" })) : (_jsx("span", { className: "text-foreground/80 text-sm font-medium", children: initials(profile) })) }));
|
|
31
32
|
return (_jsx("div", { className: containerClassName, style: {
|
|
32
33
|
width: `${size}rem`,
|
|
33
34
|
height: `${size}rem`,
|
|
@@ -21,7 +21,7 @@ export function FollowUnfollowButton({ profile, compact = false, popup = false,
|
|
|
21
21
|
return (_jsx(PopupMenuButton, { title: t('profile.actions.follow', { defaultValue: 'Follow' }), text: t('profile.actions.follow', { defaultValue: 'Follow' }), action: () => followProfile({ reblogs: true, notify: true }) }));
|
|
22
22
|
}
|
|
23
23
|
if (isFollowing) {
|
|
24
|
-
return (_jsx(Button, { compact: compact, variant: "
|
|
24
|
+
return (_jsx(Button, { compact: compact, variant: "outline", action: () => unfollowProfile(undefined), children: t('profile.actions.unfollow', { defaultValue: 'Unfollow' }) }));
|
|
25
25
|
}
|
|
26
|
-
return (_jsx(Button, { compact: compact, variant: "
|
|
26
|
+
return (_jsx(Button, { compact: compact, variant: "default", action: () => followProfile({ reblogs: true, notify: true }), children: t('profile.actions.follow', { defaultValue: 'Follow' }) }));
|
|
27
27
|
}
|
|
@@ -5,7 +5,7 @@ import { useT } from '../../i18n/index.js';
|
|
|
5
5
|
import { Avatar } from './Avatar.js';
|
|
6
6
|
export const ProfileBadge = ({ profile, onRemove, className, }) => {
|
|
7
7
|
const t = useT();
|
|
8
|
-
return (_jsxs("div", { className: `border-secondary bg-
|
|
8
|
+
return (_jsxs("div", { className: `border-secondary bg-background text-primary flex items-center gap-1.5 rounded-md border px-2 py-1 text-sm ${className ?? ''}`, children: [_jsx(Avatar, { profile: profile, size: 0.75, borderless: true }), _jsx("span", { className: "max-w-40 truncate font-medium", children: profileName(profile) }), onRemove ? (_jsx("button", { type: "button", className: "hover:bg-secondary ml-0.5 rounded-full p-0.5 transition-colors", title: t('profile.selector.remove', { defaultValue: 'Remove' }), onClick: (e) => {
|
|
9
9
|
e.stopPropagation();
|
|
10
10
|
onRemove();
|
|
11
11
|
}, children: _jsx(X, { className: "size-3" }) })) : null] }));
|
|
@@ -8,5 +8,5 @@ import { FollowUnfollowButton } from './FollowUnfollowButton.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export function ProfileCard({ profile, onSelect, showAction = true, action, }) {
|
|
10
10
|
const details = (_jsxs(_Fragment, { children: [_jsx(Avatar, { profile: profile, size: 3 }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-sm font-semibold", children: profile.displayName || `@${profile.handle}` }), _jsxs("span", { className: "text-muted-foreground truncate text-xs", children: ["@", profile.handle] }), profile.bio && (_jsx("span", { className: "text-muted-foreground mt-1 line-clamp-2 text-sm", children: profile.bio }))] })] }));
|
|
11
|
-
return (_jsxs("
|
|
11
|
+
return (_jsxs("article", { className: "hover:bg-surface flex items-center justify-between gap-3 border-b p-4", children: [onSelect ? (_jsx("button", { type: "button", onClick: () => onSelect(profile), className: "flex min-w-0 flex-1 items-center gap-3 text-left", children: details })) : (_jsx("a", { href: `/@${profile.handle}`, className: "flex min-w-0 flex-1 items-center gap-3", children: details })), action ? (_jsx("div", { className: "flex-shrink-0", children: action })) : showAction ? (_jsx("div", { className: "flex-shrink-0", children: _jsx(FollowUnfollowButton, { profile: profile, compact: true }) })) : null] }));
|
|
12
12
|
}
|
|
@@ -12,5 +12,5 @@ import { ProfileStats } from './ProfileStats.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export function ProfileHeader({ profile, isCurrentProfile = false, }) {
|
|
14
14
|
const t = useT();
|
|
15
|
-
return (_jsx("div", { className: "relative", children: _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "relative aspect-[3/1] w-full", children: [_jsx("div", { className: "bg-surface-
|
|
15
|
+
return (_jsx("div", { className: "relative", children: _jsxs("div", { className: "mb-8", children: [_jsxs("div", { className: "relative aspect-[3/1] w-full", children: [_jsx("div", { className: "bg-surface-2 absolute inset-0 overflow-hidden", children: profile.header && (_jsx("img", { src: profile.header, alt: "banner", className: "h-full w-full object-cover" })) }), _jsx(Avatar, { profile: profile, size: 6, containerClassName: "absolute -bottom-12 left-4", borderless: true })] }), _jsx(ProfilePageAction, { profile: profile, isCurrentProfile: isCurrentProfile }), _jsxs("div", { className: "p-2", children: [_jsx("h1", { className: "mt-4 text-base font-semibold", "data-testid": "profile-header-title", children: truncateText(profile.displayName || profile.handle, 50) }), _jsxs("span", { className: "text-muted-foreground my-1 text-sm font-normal", children: ["@", profile.handle] }), _jsx(PostMarkdown, { source: profile.bio || t('profile.noBio', { defaultValue: '' }) }), profile.location?.text && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "input-group-shim", children: _jsx(MapPin, { className: "size-3" }) }), _jsx("p", { children: profile.location.text })] })), _jsx(ProfileStats, { profile: profile }), (profile.fields ?? []).map((field) => (_jsxs("div", { className: "mt-4 flex items-center gap-2", children: [_jsx("span", { className: "text-muted-foreground text-sm", children: field.name }), _jsx(PostMarkdown, { source: field.value, className: "pt-1 text-sm" })] }, field.name)))] })] }) }));
|
|
16
16
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Copy, Flag, MessageSquareText } from 'lucide-react';
|
|
4
4
|
import { canCreatePost } from '@openpeepshq/common/lib';
|
|
5
|
-
import { Button, PopupMenu, PopupMenuButton
|
|
5
|
+
import { Button, PopupMenu, PopupMenuButton } from '@openpeepshq/react-ui';
|
|
6
6
|
import { useT } from '../../i18n/index.js';
|
|
7
7
|
import { useAuthData, useCurrentProfile } from '../layout/IdentityContext.js';
|
|
8
8
|
import { useCreateNewConversation } from '../conversations/CreateNewConversationContext.js';
|
|
@@ -14,7 +14,7 @@ export function ProfilePageAction({ profile, isCurrentProfile = false, }) {
|
|
|
14
14
|
const authData = useAuthData();
|
|
15
15
|
const { openCreateConversation } = useCreateNewConversation();
|
|
16
16
|
const [reportOpen, setReportOpen] = useState(false);
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-2 flex h-6 items-center justify-end gap-x-2 pr-2 pt-3", children: isCurrentProfile ? (_jsx(Button, { variant: "
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-2 flex h-6 items-center justify-end gap-x-2 pr-2 pt-3", children: isCurrentProfile ? (_jsx(Button, { variant: "outline", action: "/settings/public-profile", children: t('profile.edit.title', { defaultValue: 'Edit profile' }) })) : me ? (_jsxs(_Fragment, { children: [_jsxs(PopupMenu, { menuButton: _jsx("span", { className: "text-muted-foreground px-2 text-sm", children: "\u22EF" }), title: t('profile.actions.menu', {
|
|
18
18
|
defaultValue: 'Profile actions',
|
|
19
19
|
}), children: [_jsx(PopupMenuButton, { title: t('profile.actions.copyProfileLink', {
|
|
20
20
|
defaultValue: 'Copy profile link',
|
|
@@ -26,7 +26,7 @@ export function ProfilePageAction({ profile, isCurrentProfile = false, }) {
|
|
|
26
26
|
}), text: t('common.actions.reportProfile', {
|
|
27
27
|
defaultValue: 'Report @{{handle}}',
|
|
28
28
|
handle: profile.handle,
|
|
29
|
-
}), icon: Flag, action: () => setReportOpen(true), danger: true })] }), canCreatePost(authData, 'note', 'direct') ? (_jsx(Button, { variant: "
|
|
29
|
+
}), icon: Flag, action: () => setReportOpen(true), danger: true })] }), canCreatePost(authData, 'note', 'direct') ? (_jsx(Button, { variant: "outline", title: t('conversations.newMessage', {
|
|
30
30
|
defaultValue: 'New message',
|
|
31
31
|
}), action: () => openCreateConversation({
|
|
32
32
|
profiles: [profile],
|
|
@@ -18,7 +18,9 @@ export function ProfilePostsAndReplies({ profile, }) {
|
|
|
18
18
|
const postsQuery = openpeepsApi.usePostsByProfile(profile.id);
|
|
19
19
|
const commonGroupsQuery = openpeepsApi.useCommonGroups(profile.id);
|
|
20
20
|
const [tab, setTab] = useState('posts');
|
|
21
|
-
return (_jsxs("div", { children: [_jsxs("
|
|
21
|
+
return (_jsxs("div", { children: [_jsxs("nav", { "aria-label": t('profile.tabs.label', {
|
|
22
|
+
defaultValue: 'Profile sections',
|
|
23
|
+
}), className: "flex border-b", children: [_jsx("button", { type: "button", className: `flex-1 px-4 py-3 text-sm font-medium ${tab === 'posts' ? 'border-primary border-b-2' : 'text-muted-foreground'}`, onClick: () => setTab('posts'), children: t('profile.posts', { defaultValue: 'Posts' }) }), _jsx("button", { type: "button", className: `flex-1 px-4 py-3 text-sm font-medium ${tab === 'groups' ? 'border-primary border-b-2' : 'text-muted-foreground'}`, onClick: () => setTab('groups'), children: t('profile.groups.tabName', { defaultValue: 'Groups' }) })] }), tab === 'posts' ? (_jsx(Feed, { query: postsQuery })) : (_jsxs(AccessDeniedLoader, { queries: [commonGroupsQuery], children: [(commonGroupsQuery.data ?? []).map((group) => (_jsx(GroupCard, { group: group, onSelect: () => navigate({ type: 'group', handle: group.handle }) }, group.id))), !commonGroupsQuery.data?.length ? (_jsxs("div", { className: "flex h-[60vh] w-full flex-col items-center justify-center gap-y-6", children: [_jsx(Users, { size: 60 }), _jsx("p", { children: t('profile.groups.noCommonGroups', {
|
|
22
24
|
defaultValue: 'No groups in common',
|
|
23
25
|
}) })] })) : null] }))] }));
|
|
24
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { Check, Search } from 'lucide-react';
|
|
4
|
-
import { matchesQuery, profileName, sortProfiles } from '@openpeepshq/common/lib';
|
|
4
|
+
import { matchesQuery, profileName, sortProfiles, } from '@openpeepshq/common/lib';
|
|
5
5
|
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, } from '@openpeepshq/react-ui';
|
|
6
6
|
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
7
7
|
import { useT } from '../../i18n/index.js';
|
|
@@ -67,6 +67,6 @@ export const ProfileSelector = ({ open, onOpenChange, mode, selectedProfiles, on
|
|
|
67
67
|
const selected = mode === 'single'
|
|
68
68
|
? profile.id === singleSelectionId || isSelected(profile.id)
|
|
69
69
|
: isSelected(profile.id);
|
|
70
|
-
return (_jsxs("button", { type: "button", className: `hover:bg-surface-
|
|
71
|
-
}))) : null }), mode === 'multiple' ? (_jsxs(DialogFooter, { children: [_jsx(Button, { variant: "
|
|
70
|
+
return (_jsxs("button", { type: "button", className: `hover:bg-surface rounded-button flex w-full items-center gap-3 p-2 text-left ${selected ? 'bg-secondary/40' : ''}`, onClick: () => toggleProfile(profile), children: [_jsx(Avatar, { profile: profile, size: 2.5, borderless: true }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-sm font-medium", children: profileName(profile) }), profile.handle ? (_jsxs("span", { className: "text-muted-foreground block truncate text-xs", children: ["@", profile.handle] })) : null] }), selected ? (_jsx(Check, { className: "text-primary size-4 shrink-0" })) : null] }, profile.id));
|
|
71
|
+
}))) : null }), mode === 'multiple' ? (_jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: () => onOpenChange(false), children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: confirmMultiple, children: t('profile.selector.confirm', { defaultValue: 'OK' }) })] })) : null] }) }));
|
|
72
72
|
};
|
|
@@ -10,7 +10,7 @@ export const ProfilesInput = ({ value, onChange, mode = 'multiple', placeholder,
|
|
|
10
10
|
const removeProfile = (profileId) => {
|
|
11
11
|
onChange(value.filter((profile) => profile.id !== profileId));
|
|
12
12
|
};
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { role: "button", tabIndex: disabled ? -1 : 0, "aria-disabled": disabled, className: `border-
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { role: "button", tabIndex: disabled ? -1 : 0, "aria-disabled": disabled, className: `border-border bg-surface-2 flex max-h-40 min-h-10 w-full flex-wrap content-start items-center gap-1 overflow-y-auto rounded-lg border px-3 py-1.5 text-left ${disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'} ${className ?? ''}`, onClick: () => {
|
|
14
14
|
if (!disabled)
|
|
15
15
|
setOpen(true);
|
|
16
16
|
}, onKeyDown: (e) => {
|