@openpeepshq/react 0.2.3 → 0.2.4
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 +7 -2
- 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/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +4 -4
- 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 +34 -8
- 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/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 +53 -0
- package/dist/contexts/openpeeps/hooks/admin.js +1 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- 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/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/package.json +12 -7
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
|
+
import { normalizeEventDataForSave, truncateText, } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
6
|
+
import { EventForm } from '../../components/index.js';
|
|
7
|
+
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
8
|
+
export function EditEvent() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const { eventId = '' } = useParams();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const postQuery = openpeepsApi.usePost(eventId);
|
|
14
|
+
const updatePost = openpeepsApi.updatePostAction({ id: eventId });
|
|
15
|
+
const [postData, setPostData] = useState(null);
|
|
16
|
+
const [loadedEventId, setLoadedEventId] = useState(null);
|
|
17
|
+
const [submitting, setSubmitting] = useState(false);
|
|
18
|
+
const [error, setError] = useState(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (postQuery.data?.type === 'event' &&
|
|
21
|
+
postQuery.data.id !== loadedEventId) {
|
|
22
|
+
setPostData({
|
|
23
|
+
visibility: postQuery.data.visibility,
|
|
24
|
+
type: 'event',
|
|
25
|
+
groupId: postQuery.data.groupId ?? undefined,
|
|
26
|
+
audience: postQuery.data.audience ?? undefined,
|
|
27
|
+
data: postQuery.data.data,
|
|
28
|
+
});
|
|
29
|
+
setLoadedEventId(postQuery.data.id);
|
|
30
|
+
}
|
|
31
|
+
}, [loadedEventId, postQuery.data]);
|
|
32
|
+
const event = postData?.data.type === 'event' ? postData.data : null;
|
|
33
|
+
const eventName = postQuery.data?.data?.name;
|
|
34
|
+
const submit = useCallback(async () => {
|
|
35
|
+
if (!postData || !event)
|
|
36
|
+
return;
|
|
37
|
+
setError(null);
|
|
38
|
+
if (!event.start) {
|
|
39
|
+
setError(t('events.validation.startRequired', {
|
|
40
|
+
defaultValue: 'Start date is required',
|
|
41
|
+
}));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setSubmitting(true);
|
|
45
|
+
try {
|
|
46
|
+
await updatePost(normalizeEventDataForSave(event));
|
|
47
|
+
navigate(`/posts/${eventId}`);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
setError(err.message);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
setSubmitting(false);
|
|
54
|
+
}
|
|
55
|
+
}, [event, eventId, navigate, postData, t, updatePost]);
|
|
56
|
+
const headerActions = useMemo(() => (_jsx(Button, { title: t('events.update.title', { defaultValue: 'Update event' }), variant: "default", action: submit, disabled: submitting || !event?.start, children: submitting
|
|
57
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
58
|
+
: t('events.update.title', { defaultValue: 'Update event' }) })), [event?.start, submit, submitting, t]);
|
|
59
|
+
useSetPageHeader(eventName
|
|
60
|
+
? `${t('events.edit', { defaultValue: 'Edit event' })} ${truncateText(eventName)}`
|
|
61
|
+
: t('events.edit', { defaultValue: 'Edit event' }), headerActions);
|
|
62
|
+
if (postQuery.isLoading) {
|
|
63
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
64
|
+
}
|
|
65
|
+
if (!postQuery.data || !postData) {
|
|
66
|
+
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('events.notFound', { defaultValue: 'Event not found' }) }));
|
|
67
|
+
}
|
|
68
|
+
return (_jsxs("div", { className: "pb-12", children: [_jsx(EventForm, { postData: postData, onChange: setPostData, isEdit: true }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error }) })) : null] }));
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EventsIndex(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
5
|
+
import { EventsFeed, NewEventButton, useCurrentProfile, useDefaultVisibility, } from '../../components/index.js';
|
|
6
|
+
export function EventsIndex() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const navigate = useNavigate();
|
|
9
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
10
|
+
const currentProfile = useCurrentProfile();
|
|
11
|
+
const visibility = useDefaultVisibility();
|
|
12
|
+
const [tab, setTab] = useState('upcoming');
|
|
13
|
+
const upcomingQuery = openpeepsApi.useUpcomingEventsFeed();
|
|
14
|
+
const pastQuery = openpeepsApi.usePastEventsFeed();
|
|
15
|
+
const activeQuery = tab === 'upcoming' ? upcomingQuery : pastQuery;
|
|
16
|
+
useSetPageHeader(t('navigation.events', { defaultValue: 'Events' }), undefined, 'events-page-heading');
|
|
17
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx(NewEventButton, { visibility: visibility, currentProfile: currentProfile, onNavigate: () => navigate('/events/new'), showButton: false }), _jsxs("nav", { "aria-label": t('events.feed.label', {
|
|
18
|
+
defaultValue: 'Event timeframe',
|
|
19
|
+
}), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsFeed, { query: activeQuery })] }));
|
|
20
|
+
}
|
|
21
|
+
function TabButton({ active, onClick, children, }) {
|
|
22
|
+
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 }));
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EventsMy(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
4
|
+
import { Feed } from '../../components/index.js';
|
|
5
|
+
export function EventsMy() {
|
|
6
|
+
const t = useT();
|
|
7
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
8
|
+
const [tab, setTab] = useState('upcoming');
|
|
9
|
+
const upcomingQuery = openpeepsApi.useMyUpcomingEventsFeed();
|
|
10
|
+
const currentQuery = openpeepsApi.useMyCurrentEventsFeed();
|
|
11
|
+
const pastQuery = openpeepsApi.useMyPastEventsFeed();
|
|
12
|
+
const activeQuery = tab === 'upcoming'
|
|
13
|
+
? upcomingQuery
|
|
14
|
+
: tab === 'current'
|
|
15
|
+
? currentQuery
|
|
16
|
+
: pastQuery;
|
|
17
|
+
useSetPageHeader(t('navigation.myEvents', { defaultValue: 'My events' }));
|
|
18
|
+
return (_jsxs("div", { children: [_jsxs("nav", { "aria-label": t('events.feed.label', {
|
|
19
|
+
defaultValue: 'Event timeframe',
|
|
20
|
+
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'current', onClick: () => setTab('current'), children: t('events.feed.current', { defaultValue: 'Now' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(Feed, { query: activeQuery })] }));
|
|
21
|
+
}
|
|
22
|
+
function TabButton({ active, onClick, children, }) {
|
|
23
|
+
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 }));
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NewEvent(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { useT, useOpenpeeps, eventSanitizer, getNewPostStores, useSetPageHeader, } from '../../index.js';
|
|
5
|
+
import { EventForm, useServerInfo } from '../../components/index.js';
|
|
6
|
+
import { Button, Toast } from '@openpeepshq/react-ui';
|
|
7
|
+
import { normalizeEventDataForSave } from '@openpeepshq/common/lib';
|
|
8
|
+
export function NewEvent() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const serverInfo = useServerInfo();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const createPost = openpeepsApi.createPostAction();
|
|
14
|
+
const stores = getNewPostStores();
|
|
15
|
+
const sanitize = useMemo(() => eventSanitizer(serverInfo.publicContent), [serverInfo.publicContent]);
|
|
16
|
+
const [postData, setPostData] = useState(() => sanitize(stores.event));
|
|
17
|
+
const [submitting, setSubmitting] = useState(false);
|
|
18
|
+
const [error, setError] = useState(null);
|
|
19
|
+
const event = postData.data.type === 'event' ? postData.data : null;
|
|
20
|
+
const canSubmit = !!event?.start &&
|
|
21
|
+
!!event?.name?.trim() &&
|
|
22
|
+
!(postData.visibility === 'direct' && !postData.audience?.length);
|
|
23
|
+
const submit = useCallback(async () => {
|
|
24
|
+
setError(null);
|
|
25
|
+
if (!event?.start) {
|
|
26
|
+
setError(t('events.validation.startRequired', {
|
|
27
|
+
defaultValue: 'Start date is required',
|
|
28
|
+
}));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!event.name?.trim()) {
|
|
32
|
+
setError(t('events.validation.nameRequired', {
|
|
33
|
+
defaultValue: 'Event name is required',
|
|
34
|
+
}));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (postData.visibility === 'direct' && !postData.audience?.length) {
|
|
38
|
+
setError('Choose at least one recipient for a direct event.');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setSubmitting(true);
|
|
42
|
+
try {
|
|
43
|
+
const created = await createPost({
|
|
44
|
+
...postData,
|
|
45
|
+
type: 'event',
|
|
46
|
+
data: normalizeEventDataForSave(event),
|
|
47
|
+
});
|
|
48
|
+
stores.resetNewEventState();
|
|
49
|
+
navigate(`/posts/${created.id}`);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
setError(err.message);
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setSubmitting(false);
|
|
56
|
+
}
|
|
57
|
+
}, [createPost, event, navigate, postData, stores, t]);
|
|
58
|
+
const headerActions = useMemo(() => (_jsx(Button, { title: t('events.create.title', { defaultValue: 'Create Event' }), variant: "default", action: submit, disabled: submitting || !canSubmit, "data-testid": "events-create-submit", children: submitting
|
|
59
|
+
? t('common.submitting', { defaultValue: 'Creating…' })
|
|
60
|
+
: t('events.create.title', { defaultValue: 'Create Event' }) })), [canSubmit, submit, submitting, t]);
|
|
61
|
+
useSetPageHeader(t('events.create.title', { defaultValue: 'Create Event' }), headerActions);
|
|
62
|
+
return (_jsxs("div", { className: "pb-12", children: [_jsx(EventForm, { postData: postData, onChange: (data) => {
|
|
63
|
+
setPostData(data);
|
|
64
|
+
stores.event = data;
|
|
65
|
+
} }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error }) })) : null] }));
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FeedsBookmarks(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
3
|
+
import { Feed } from '../../components/index.js';
|
|
4
|
+
export function FeedsBookmarks() {
|
|
5
|
+
const t = useT();
|
|
6
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
7
|
+
const query = openpeepsApi.useBookmarkedPosts();
|
|
8
|
+
useSetPageHeader(t('navigation.bookmarks', { defaultValue: 'Bookmarks' }));
|
|
9
|
+
return _jsx(Feed, { query: query });
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FeedsLocal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
3
|
+
import { Feed, useDefaultVisibility, useNewNotePlusButton, useServerInfo, PluginSlot, } from '../../components/index.js';
|
|
4
|
+
export function FeedsLocal() {
|
|
5
|
+
const t = useT();
|
|
6
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
7
|
+
const serverInfo = useServerInfo();
|
|
8
|
+
const visibility = useDefaultVisibility();
|
|
9
|
+
useNewNotePlusButton({ visibility });
|
|
10
|
+
const query = openpeepsApi.useLocalFeed();
|
|
11
|
+
const pinnedPostId = serverInfo.communityConfig?.content?.pinnedPost;
|
|
12
|
+
useSetPageHeader(t('navigation.community', { defaultValue: 'Community' }), undefined, 'feeds-community-heading');
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(PluginSlot, { name: "plugins.header", className: "p-4 pb-0" }), _jsx(Feed, { query: query, pinnedPostId: pinnedPostId ?? undefined })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FeedsMy(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
3
|
+
import { Feed, useDefaultVisibility, useNewNotePlusButton, } from '../../components/index.js';
|
|
4
|
+
export function FeedsMy() {
|
|
5
|
+
const t = useT();
|
|
6
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
7
|
+
const visibility = useDefaultVisibility();
|
|
8
|
+
useNewNotePlusButton({ visibility });
|
|
9
|
+
const query = openpeepsApi.useMyFeed();
|
|
10
|
+
useSetPageHeader(t('navigation.myFeed', { defaultValue: 'My feed' }));
|
|
11
|
+
return _jsx(Feed, { query: query });
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditGroup(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
5
|
+
import { GroupForm } from '../../components/index.js';
|
|
6
|
+
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
7
|
+
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
8
|
+
export function EditGroup() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const { handle: handleParam = '' } = useParams();
|
|
12
|
+
const handle = routeHandleParam(handleParam);
|
|
13
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
14
|
+
const groupQuery = openpeepsApi.useGroupByHandle(handle);
|
|
15
|
+
const updateGroup = openpeepsApi.updateGroupAction();
|
|
16
|
+
useSetPageHeader(t('groups.edit.title', { defaultValue: 'Edit group' }));
|
|
17
|
+
const [groupData, setGroupData] = useState(null);
|
|
18
|
+
const [submitting, setSubmitting] = useState(false);
|
|
19
|
+
const [error, setError] = useState(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (groupQuery.data) {
|
|
22
|
+
const { handle, avatar, header, displayName, description, rules, capabilities, } = groupQuery.data;
|
|
23
|
+
setGroupData({
|
|
24
|
+
handle,
|
|
25
|
+
avatar,
|
|
26
|
+
header,
|
|
27
|
+
displayName,
|
|
28
|
+
description,
|
|
29
|
+
rules,
|
|
30
|
+
capabilities,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}, [groupQuery.data]);
|
|
34
|
+
if (groupQuery.isLoading || !groupData) {
|
|
35
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
36
|
+
}
|
|
37
|
+
if (!groupQuery.data) {
|
|
38
|
+
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('groups.notFound', { defaultValue: 'Group not found' }) }));
|
|
39
|
+
}
|
|
40
|
+
const submit = async () => {
|
|
41
|
+
setError(null);
|
|
42
|
+
setSubmitting(true);
|
|
43
|
+
try {
|
|
44
|
+
const updated = (await updateGroup({ ...groupQuery.data, ...groupData }, { id: groupQuery.data.id }));
|
|
45
|
+
navigate(`/groups/@${updated.handle}`);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
setError(err.message);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
setSubmitting(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, onChange: setGroupData, isEdit: true }), error && (_jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error })), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
55
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
56
|
+
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GroupsIndex(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { Plus, Users } from 'lucide-react';
|
|
4
|
+
import { checkRoleCapabilities } from '@openpeepshq/common';
|
|
5
|
+
import { matchesQuery } from '@openpeepshq/common/lib';
|
|
6
|
+
import { useT, useOpenpeeps, useSetPageHeader, useSetPlusButtonActions, } from '../../index.js';
|
|
7
|
+
import { GroupCard, useCurrentProfile } from '../../components/index.js';
|
|
8
|
+
import { Input } from '@openpeepshq/react-ui';
|
|
9
|
+
export function GroupsIndex() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const currentProfile = useCurrentProfile();
|
|
13
|
+
const [search, setSearch] = useState('');
|
|
14
|
+
const [tab, setTab] = useState('mine');
|
|
15
|
+
const groupsQuery = openpeepsApi.useGroups();
|
|
16
|
+
const unseenCountsQuery = openpeepsApi.useUnseenPostCounts();
|
|
17
|
+
const groups = groupsQuery.data ?? [];
|
|
18
|
+
const unseenByGroup = unseenCountsQuery.data?.groups ?? {};
|
|
19
|
+
const myGroupIds = useMemo(() => new Set((currentProfile?.memberships ?? []).map((membership) => membership.group.id)), [currentProfile?.memberships]);
|
|
20
|
+
const tabGroups = useMemo(() => tab === 'mine'
|
|
21
|
+
? groups.filter((group) => myGroupIds.has(group.id))
|
|
22
|
+
: groups, [groups, myGroupIds, tab]);
|
|
23
|
+
const plusButton = useMemo(() => checkRoleCapabilities(currentProfile?.roles ?? [], ['core-groups-create'])
|
|
24
|
+
.success
|
|
25
|
+
? {
|
|
26
|
+
title: t('groups.new', { defaultValue: 'New Group' }),
|
|
27
|
+
icon: Plus,
|
|
28
|
+
action: '/groups/new',
|
|
29
|
+
}
|
|
30
|
+
: undefined, [currentProfile?.roles, t]);
|
|
31
|
+
useSetPlusButtonActions(plusButton);
|
|
32
|
+
useSetPageHeader(t('navigation.groups', { defaultValue: 'Groups' }));
|
|
33
|
+
const filtered = useMemo(() => tabGroups.filter((g) => !search || matchesQuery(g, search)), [tabGroups, search]);
|
|
34
|
+
return (_jsxs("div", { className: "p-4", children: [_jsxs("nav", { "aria-label": t('groups.tabs.label', {
|
|
35
|
+
defaultValue: 'Group lists',
|
|
36
|
+
}), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'mine', onClick: () => setTab('mine'), children: t('groups.tabs.myGroups', { defaultValue: 'My groups' }) }), _jsx(TabButton, { active: tab === 'all', onClick: () => setTab('all'), children: t('groups.tabs.allGroups', { defaultValue: 'All groups' }) })] }), _jsx("form", { role: "search", onSubmit: (e) => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
}, children: _jsx(Input, { placeholder: t('groups.searchPlaceholder', {
|
|
39
|
+
defaultValue: 'Search by group name',
|
|
40
|
+
}), value: search, onChange: (e) => setSearch(e.target.value), "data-testid": "groups-search-input" }) }), _jsxs("div", { className: "space-y-2 py-4", children: [filtered.map((group) => (_jsx(GroupCard, { group: group, unreadCount: tab === 'mine' ? (unseenByGroup[group.id] ?? 0) : undefined }, group.id))), filtered.length === 0 && (_jsxs("div", { className: "flex h-[60vh] w-full flex-col items-center justify-center gap-y-6", children: [_jsx(Users, { size: 60 }), search === '' ? (_jsx("p", { children: tab === 'mine'
|
|
41
|
+
? t('groups.noGroupsYet', {
|
|
42
|
+
defaultValue: 'You have no groups yet',
|
|
43
|
+
})
|
|
44
|
+
: t('groups.noGroupsFound', {
|
|
45
|
+
defaultValue: 'No groups found',
|
|
46
|
+
}) })) : (_jsx("p", { children: t('groups.noGroupsFound', { defaultValue: 'No groups found' }) }))] }))] })] }));
|
|
47
|
+
}
|
|
48
|
+
function TabButton({ active, onClick, children, }) {
|
|
49
|
+
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 }));
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GroupInfo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { useT, useOpenpeeps } from '../../index.js';
|
|
4
|
+
import { GroupHeader, PostMarkdown } from '../../components/index.js';
|
|
5
|
+
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
6
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
7
|
+
export function GroupInfo() {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const { handle: handleParam = '' } = useParams();
|
|
10
|
+
const handle = routeHandleParam(handleParam);
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const groupQuery = openpeepsApi.useGroupByHandle(handle);
|
|
13
|
+
const group = groupQuery.data;
|
|
14
|
+
if (groupQuery.isLoading) {
|
|
15
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
16
|
+
}
|
|
17
|
+
if (!group) {
|
|
18
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx("p", { className: "text-2xl font-bold", children: t('groups.notFound', { defaultValue: 'Group not found' }) }) }));
|
|
19
|
+
}
|
|
20
|
+
return (_jsxs("div", { children: [_jsx(GroupHeader, { group: group }), _jsxs("div", { className: "space-y-2 p-4", children: [_jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Description" }), _jsx(PostMarkdown, { source: group.description || 'No description yet' })] }), _jsxs("section", { className: "space-y-2 border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Details" }), group.capabilities?.none?.add?.includes('core-groups-read') ? (_jsxs(_Fragment, { children: [_jsx("h4", { className: "font-semibold", children: "Public" }), _jsx("p", { children: "Anyone on this community can see posts in the group. Group members can add comments and create posts" })] })) : (_jsxs(_Fragment, { children: [_jsx("h4", { className: "font-semibold", children: "Private" }), _jsx("p", { children: "Only group members can see posts in the group. Group members can add comments and create posts" })] })), _jsx("h4", { className: "font-semibold", children: "Created" }), _jsx("p", { children: new Date(group.createdAt).toLocaleDateString() })] }), _jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Rules" }), _jsx(PostMarkdown, { source: group.rules || 'No rules yet' })] })] })] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GroupMembers(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useParams } from 'react-router-dom';
|
|
4
|
+
import { groupName } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
6
|
+
import { AddGroupMembersButton, GroupMembersList } from '../../components/index.js';
|
|
7
|
+
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
8
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
9
|
+
export function GroupMembers() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { handle: handleParam = '' } = useParams();
|
|
12
|
+
const handle = routeHandleParam(handleParam);
|
|
13
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
14
|
+
const groupQuery = openpeepsApi.useGroupByHandle(handle);
|
|
15
|
+
const group = groupQuery.data;
|
|
16
|
+
const headerTitle = group
|
|
17
|
+
? `${groupName(group)} - ${t('groups.members.title', { defaultValue: 'Members' })}`
|
|
18
|
+
: t('groups.members.title', { defaultValue: 'Members' });
|
|
19
|
+
const headerActions = useMemo(() => (group ? _jsx(AddGroupMembersButton, { group: group }) : undefined), [group]);
|
|
20
|
+
useSetPageHeader(headerTitle, headerActions);
|
|
21
|
+
if (groupQuery.isLoading) {
|
|
22
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
23
|
+
}
|
|
24
|
+
if (!group) {
|
|
25
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx("p", { className: "text-2xl font-bold", children: t('groups.notFound', { defaultValue: 'Group not found' }) }) }));
|
|
26
|
+
}
|
|
27
|
+
return _jsx(GroupMembersList, { group: group });
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NewGroup(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { groupCapabilityTemplates } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
6
|
+
import { GroupForm, ProfilesInput, useCurrentProfile, useServerInfo, } from '../../components/index.js';
|
|
7
|
+
import { Button, Label, Toast } from '@openpeepshq/react-ui';
|
|
8
|
+
export function NewGroup() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const createGroup = openpeepsApi.createGroupAction();
|
|
13
|
+
const { publicContent } = useServerInfo();
|
|
14
|
+
const me = useCurrentProfile();
|
|
15
|
+
const [members, setMembers] = useState([]);
|
|
16
|
+
useSetPageHeader(t('groups.new.title', { defaultValue: 'Create group' }), undefined, 'groups-create-page-title');
|
|
17
|
+
const [groupData, setGroupData] = useState(() => ({
|
|
18
|
+
displayName: '',
|
|
19
|
+
handle: '',
|
|
20
|
+
description: '',
|
|
21
|
+
rules: '',
|
|
22
|
+
capabilities: publicContent
|
|
23
|
+
? groupCapabilityTemplates.defaultGroup.capabilities
|
|
24
|
+
: groupCapabilityTemplates.defaultGroupClosedCommunity.capabilities,
|
|
25
|
+
}));
|
|
26
|
+
const [submitting, setSubmitting] = useState(false);
|
|
27
|
+
const [error, setError] = useState(null);
|
|
28
|
+
const submit = async () => {
|
|
29
|
+
setError(null);
|
|
30
|
+
let data = groupData;
|
|
31
|
+
if (data.handle.length === 0) {
|
|
32
|
+
if (!data.displayName) {
|
|
33
|
+
setError(t('handle.validation.error', {
|
|
34
|
+
defaultValue: 'A handle or display name is required',
|
|
35
|
+
}));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
data = {
|
|
39
|
+
...data,
|
|
40
|
+
handle: data
|
|
41
|
+
.displayName.toLowerCase()
|
|
42
|
+
.replaceAll(' ', '_')
|
|
43
|
+
.replace(/[^a-zA-Z0-9_]/g, '')
|
|
44
|
+
.trim()
|
|
45
|
+
.slice(0, 16),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
setSubmitting(true);
|
|
49
|
+
try {
|
|
50
|
+
const group = (await createGroup({
|
|
51
|
+
...data,
|
|
52
|
+
members,
|
|
53
|
+
}));
|
|
54
|
+
navigate(`/groups/@${group.handle}`);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
setError(err.message);
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
setSubmitting(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, onChange: setGroupData }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "group-members", children: t('groups.form.members', { defaultValue: 'Members' }) }), _jsx(ProfilesInput, { value: members, onChange: setMembers, banlist: me ? [me] : [], placeholder: t('groups.form.membersPlaceholder', {
|
|
64
|
+
defaultValue: 'Add members to this group',
|
|
65
|
+
}) })] }), error && (_jsx(Toast, { variant: "error", testId: "groups-duplicate-handle-error", onDismiss: () => setError(null), children: error })), _jsx(Button, { title: "Create group", variant: "default", action: submit, disabled: submitting, "data-testid": "groups-create-submit", children: submitting
|
|
66
|
+
? t('common.submitting', { defaultValue: 'Creating…' })
|
|
67
|
+
: t('common.submit', { defaultValue: 'Create group' }) })] }));
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GroupShow(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
|
+
import { useT, useOpenpeeps } from '../../index.js';
|
|
5
|
+
import { Feed, GroupFeed, GroupHeader, NewEventButton, PostMarkdown, useCurrentProfile, } from '../../components/index.js';
|
|
6
|
+
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
7
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
8
|
+
export function GroupShow() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const { handle: handleParam = '' } = useParams();
|
|
12
|
+
const handle = routeHandleParam(handleParam);
|
|
13
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
14
|
+
const groupQuery = openpeepsApi.useGroupByHandle(handle);
|
|
15
|
+
const group = groupQuery.data;
|
|
16
|
+
const currentProfile = useCurrentProfile();
|
|
17
|
+
const [tab, setTab] = useState('posts');
|
|
18
|
+
const upcomingEvents = openpeepsApi.useGroupUpcomingEventsFeed(group?.id ?? '');
|
|
19
|
+
const pastEvents = openpeepsApi.useGroupPastEventsFeed(group?.id ?? '');
|
|
20
|
+
const [eventsTab, setEventsTab] = useState('upcoming');
|
|
21
|
+
const capabilities = group?.capabilities;
|
|
22
|
+
const visibilityValue = capabilities?.none?.add?.includes('core-groups-read')
|
|
23
|
+
? 'public'
|
|
24
|
+
: capabilities?.local?.add?.includes('core-groups-read')
|
|
25
|
+
? 'local'
|
|
26
|
+
: 'private';
|
|
27
|
+
const postsVisibilityValue = capabilities?.none?.add?.includes('core-posts-read')
|
|
28
|
+
? 'public'
|
|
29
|
+
: capabilities?.local?.add?.includes('core-posts-read')
|
|
30
|
+
? 'local'
|
|
31
|
+
: 'private';
|
|
32
|
+
const whoCanJoinValue = capabilities?.local?.add?.includes('core-groups-join')
|
|
33
|
+
? 'open'
|
|
34
|
+
: 'closed';
|
|
35
|
+
const whoCanPostValue = capabilities?.member?.add?.includes('core-posts-create-*')
|
|
36
|
+
? 'members'
|
|
37
|
+
: 'admin';
|
|
38
|
+
const whoCanPostEventsValue = capabilities?.member?.remove?.includes('core-posts-create-event')
|
|
39
|
+
? 'admin'
|
|
40
|
+
: 'members';
|
|
41
|
+
if (groupQuery.isLoading) {
|
|
42
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
43
|
+
}
|
|
44
|
+
if (!group) {
|
|
45
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx("p", { className: "text-2xl font-bold", children: t('groups.notFound', { defaultValue: 'Group not found' }) }) }));
|
|
46
|
+
}
|
|
47
|
+
return (_jsxs("div", { children: [_jsx(GroupHeader, { group: group }), _jsxs("nav", { "aria-label": t('groups.sections.label', {
|
|
48
|
+
defaultValue: 'Group sections',
|
|
49
|
+
}), className: "border-border flex border-b", "data-testid": "tab-group", children: [_jsx(TabButton, { active: tab === 'posts', onClick: () => {
|
|
50
|
+
setTab('posts');
|
|
51
|
+
window.history.replaceState(null, '', window.location.pathname);
|
|
52
|
+
}, children: t('groups.sections.posts', { defaultValue: 'Posts' }) }), _jsx(TabButton, { active: tab === 'events', onClick: () => {
|
|
53
|
+
setTab('events');
|
|
54
|
+
window.history.replaceState(null, '', `${window.location.pathname}#events`);
|
|
55
|
+
}, testId: "groups-tab-events", children: t('groups.sections.events', { defaultValue: 'Events' }) }), _jsx(TabButton, { active: tab === 'description', onClick: () => {
|
|
56
|
+
setTab('description');
|
|
57
|
+
window.history.replaceState(null, '', `${window.location.pathname}#description`);
|
|
58
|
+
}, testId: "groups-tab-description", children: t('groups.sections.description', { defaultValue: 'Description' }) })] }), tab === 'posts' && _jsx(GroupFeed, { group: group }), tab === 'events' && (_jsxs("div", { children: [_jsx(NewEventButton, { visibility: "group", currentProfile: currentProfile, group: group, onNavigate: () => navigate('/events/new') }), _jsxs("nav", { "aria-label": t('groups.eventsTabs.label', {
|
|
59
|
+
defaultValue: 'Event timeframe',
|
|
60
|
+
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: eventsTab === 'upcoming', onClick: () => setEventsTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: eventsTab === 'past', onClick: () => setEventsTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(Feed, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents })] })), tab === 'description' && (_jsxs("div", { className: "space-y-2 p-4", children: [_jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Description" }), _jsx(PostMarkdown, { source: group.description || 'No description yet' })] }), _jsxs("section", { className: "space-y-2 border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Details" }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: "Created" }), _jsx("p", { children: new Date(group.createdAt).toLocaleDateString() })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.visibility.title') }), _jsx("p", { children: t(`groups.visibility.${visibilityValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanJoin.title') }), _jsx("p", { children: t(`groups.whoCanJoin.${whoCanJoinValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanPost.title') }), _jsxs("p", { children: [t(`groups.whoCanPost.${whoCanPostValue}.description`), ".", ' ', t(`groups.whoCanPostEvents.${whoCanPostEventsValue}.description`)] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.postsVisibility.title') }), _jsx("p", { children: t(`groups.postsVisibility.${postsVisibilityValue}.description`) })] })] }), _jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Rules" }), _jsx(PostMarkdown, { source: group.rules || 'No rules yet' })] })] }))] }));
|
|
61
|
+
}
|
|
62
|
+
function TabButton({ active, onClick, children, testId, }) {
|
|
63
|
+
return (_jsx("button", { type: "button", onClick: onClick, "data-testid": testId, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: children }));
|
|
64
|
+
}
|