@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,131 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { MailIcon, PencilIcon, Trash2 } from 'lucide-react';
|
|
4
|
+
import { useT, useOpenpeeps } from '../../../index.js';
|
|
5
|
+
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, PopupMenu, PopupMenuButton, PopupSection, PopupSeparator, } from '@openpeepshq/react-ui';
|
|
6
|
+
export function ProfileRowActions({ profile }) {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const [activeModal, setActiveModal] = useState(null);
|
|
9
|
+
const account = profile.controllers?.[0];
|
|
10
|
+
return (_jsxs(_Fragment, { children: [_jsxs(PopupMenu, { placement: "bottom-end", width: "w-64", children: [_jsxs("div", { className: "w-full space-y-2 p-2 text-sm", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: t('profile.table.dateJoined', { defaultValue: 'Date joined' }) }), _jsx("span", { children: new Date(profile.createdAt).toLocaleDateString() })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground", children: t('profile.table.emailVerified', {
|
|
11
|
+
defaultValue: 'Email verified',
|
|
12
|
+
}) }), _jsx("span", { children: account?.emailValidated ? '✅' : '❌' })] })] }), _jsx(PopupSeparator, {}), _jsx(PopupSection, { title: t('profile.table.actions', { defaultValue: 'Actions' }) }), _jsx(PopupMenuButton, { icon: MailIcon, title: t('profile.table.editEmail', { defaultValue: 'Edit Email' }), text: t('profile.table.editEmail', { defaultValue: 'Edit Email' }), action: () => setActiveModal('email') }), _jsx(PopupMenuButton, { icon: PencilIcon, title: t('profile.table.editRoles', { defaultValue: 'Edit Roles' }), text: t('profile.table.editRoles', { defaultValue: 'Edit Roles' }), action: () => setActiveModal('roles') }), _jsx(PopupMenuButton, { icon: Trash2, title: t('profile.table.deleteMember', {
|
|
13
|
+
defaultValue: 'Delete Member',
|
|
14
|
+
}), text: t('profile.table.delete', { defaultValue: 'Delete' }), action: () => setActiveModal('delete'), danger: true })] }), activeModal === 'email' && account ? (_jsx(EditEmailModal, { profile: profile, onClose: () => setActiveModal(null) })) : null, activeModal === 'roles' ? (_jsx(EditRolesModal, { profile: profile, onClose: () => setActiveModal(null) })) : null, activeModal === 'delete' ? (_jsx(DeleteProfileModal, { profile: profile, onClose: () => setActiveModal(null) })) : null] }));
|
|
15
|
+
}
|
|
16
|
+
function EditEmailModal({ profile, onClose, }) {
|
|
17
|
+
const t = useT();
|
|
18
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
19
|
+
const account = profile.controllers?.[0];
|
|
20
|
+
const updateAccount = openpeepsApi.admin.updateAccountAction({
|
|
21
|
+
id: account?.id ?? '',
|
|
22
|
+
});
|
|
23
|
+
const [email, setEmail] = useState(account?.email ?? '');
|
|
24
|
+
const [submitting, setSubmitting] = useState(false);
|
|
25
|
+
const [error, setError] = useState(null);
|
|
26
|
+
const submit = async () => {
|
|
27
|
+
setError(null);
|
|
28
|
+
if (email === account?.email) {
|
|
29
|
+
setError(t('accounts.editEmail.sameEmail', {
|
|
30
|
+
defaultValue: 'Enter a different email address than the current one.',
|
|
31
|
+
}));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setSubmitting(true);
|
|
35
|
+
try {
|
|
36
|
+
await updateAccount({ email });
|
|
37
|
+
onClose();
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
setError(err.message);
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
setSubmitting(false);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('accounts.editEmail.title', { defaultValue: 'Edit Email' }) }) }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "edit-email-input", children: t('accounts.editEmail.emailLabel', { defaultValue: 'Email' }) }), _jsx(Input, { id: "edit-email-input", type: "email", value: email, onChange: (e) => setEmail(e.target.value) })] }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: submit, disabled: submitting, children: t('accounts.editEmail.saveChanges', {
|
|
47
|
+
defaultValue: 'Update Email',
|
|
48
|
+
}) })] })] }) }));
|
|
49
|
+
}
|
|
50
|
+
function EditRolesModal({ profile, onClose, }) {
|
|
51
|
+
const t = useT();
|
|
52
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
53
|
+
const rolesQuery = openpeepsApi.admin.useRolesList();
|
|
54
|
+
const updateRoles = openpeepsApi.admin.updateProfileRolesAction({
|
|
55
|
+
id: profile.id,
|
|
56
|
+
});
|
|
57
|
+
const [selected, setSelected] = useState(() => new Set((profile.roles ?? []).map((r) => r.key)));
|
|
58
|
+
const [submitting, setSubmitting] = useState(false);
|
|
59
|
+
const [error, setError] = useState(null);
|
|
60
|
+
const allRoles = rolesQuery.data ?? [];
|
|
61
|
+
const toggle = (key, checked) => {
|
|
62
|
+
setSelected((prev) => {
|
|
63
|
+
const next = new Set(prev);
|
|
64
|
+
if (checked)
|
|
65
|
+
next.add(key);
|
|
66
|
+
else
|
|
67
|
+
next.delete(key);
|
|
68
|
+
return next;
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const submit = async () => {
|
|
72
|
+
setError(null);
|
|
73
|
+
setSubmitting(true);
|
|
74
|
+
try {
|
|
75
|
+
const roles = allRoles.filter((r) => selected.has(r.key));
|
|
76
|
+
await updateRoles({ roles });
|
|
77
|
+
onClose();
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
setError(err.message);
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
setSubmitting(false);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('profile.modals.editProfile.title', {
|
|
87
|
+
defaultValue: 'Edit Roles',
|
|
88
|
+
}) }) }), _jsx("p", { className: "px-1 text-sm", children: t('profile.modals.editProfile.description', {
|
|
89
|
+
defaultValue: 'Choose one or more roles for this profile',
|
|
90
|
+
}) }), _jsx("div", { className: "space-y-3 px-1", children: allRoles.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('profile.modals.editProfile.roles', { defaultValue: 'Roles' }) })) : (allRoles.map((role) => (_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx(Label, { htmlFor: `role-${role.key}`, classes: "text-base font-medium", children: role.displayName || role.key }), _jsx("input", { id: `role-${role.key}`, type: "checkbox", checked: selected.has(role.key), onChange: (e) => toggle(role.key, e.target.checked), className: "size-4" })] }, role.key)))) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: submit, disabled: submitting, children: t('profile.modals.editProfile.saveChanges', {
|
|
91
|
+
defaultValue: 'Save Changes',
|
|
92
|
+
}) })] })] }) }));
|
|
93
|
+
}
|
|
94
|
+
function DeleteProfileModal({ profile, onClose, }) {
|
|
95
|
+
const t = useT();
|
|
96
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
97
|
+
const account = profile.controllers?.[0];
|
|
98
|
+
const deleteProfile = openpeepsApi.admin.deleteProfileAction({
|
|
99
|
+
id: profile.id,
|
|
100
|
+
});
|
|
101
|
+
const deleteAccount = openpeepsApi.admin.deleteAccountAction({
|
|
102
|
+
id: account?.id ?? '',
|
|
103
|
+
});
|
|
104
|
+
const [submitting, setSubmitting] = useState(false);
|
|
105
|
+
const [error, setError] = useState(null);
|
|
106
|
+
const submit = async () => {
|
|
107
|
+
setError(null);
|
|
108
|
+
setSubmitting(true);
|
|
109
|
+
try {
|
|
110
|
+
await deleteProfile();
|
|
111
|
+
if (account)
|
|
112
|
+
await deleteAccount();
|
|
113
|
+
onClose();
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
setError(err.message);
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
setSubmitting(false);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('profile.modals.deleteProfile.title', {
|
|
123
|
+
defaultValue: 'Delete Profile',
|
|
124
|
+
}) }) }), _jsx("p", { className: "px-1 text-sm", children: t('profile.modals.deleteProfile.description', {
|
|
125
|
+
defaultValue: 'Are you sure you want to delete this profile? This action cannot be undone.',
|
|
126
|
+
username: profile.displayName || profile.handle,
|
|
127
|
+
handle: profile.handle,
|
|
128
|
+
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "destructive", action: submit, disabled: submitting, children: t('profile.modals.deleteProfile.delete', {
|
|
129
|
+
defaultValue: 'Delete',
|
|
130
|
+
}) })] })] }) }));
|
|
131
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useT, useOpenpeeps } from '../../../index.js';
|
|
4
|
+
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
|
|
5
|
+
export function RestoreBackupModal({ onClose }) {
|
|
6
|
+
const t = useT();
|
|
7
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
8
|
+
const restoreBackup = openpeepsApi.admin.restoreBackupAction();
|
|
9
|
+
const [file, setFile] = useState(null);
|
|
10
|
+
const [submitting, setSubmitting] = useState(false);
|
|
11
|
+
const [error, setError] = useState(null);
|
|
12
|
+
const submit = async () => {
|
|
13
|
+
if (!file) {
|
|
14
|
+
setError(t('admin.backups.restore.selectFile', { defaultValue: 'Select File' }));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setError(null);
|
|
18
|
+
setSubmitting(true);
|
|
19
|
+
try {
|
|
20
|
+
await restoreBackup(file);
|
|
21
|
+
onClose();
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
setError(err.message);
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
setSubmitting(false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-md", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('admin.backups.restore.title', {
|
|
31
|
+
defaultValue: 'Restore backup',
|
|
32
|
+
}) }) }), _jsx("div", { className: "px-1", children: _jsx("input", { type: "file", accept: ".zip", className: "w-full rounded-md border p-2 text-sm", onChange: (e) => setFile(e.target.files?.item(0) ?? null) }) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('admin.backups.restore.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: submit, disabled: !file || submitting, children: t('admin.backups.restore.confirm', { defaultValue: 'Confirm' }) })] })] }) }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useT, useOpenpeeps } from '../../../index.js';
|
|
4
|
+
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from '@openpeepshq/react-ui';
|
|
5
|
+
export function RestoreTestBackupModal({ onClose, }) {
|
|
6
|
+
const t = useT();
|
|
7
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
8
|
+
const restoreBackup = openpeepsApi.admin.restoreBackupAction();
|
|
9
|
+
const [submitting, setSubmitting] = useState(false);
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
const submit = async () => {
|
|
12
|
+
setError(null);
|
|
13
|
+
setSubmitting(true);
|
|
14
|
+
try {
|
|
15
|
+
const name = 'test-backup.zip';
|
|
16
|
+
const response = await fetch(`/template/${name}`);
|
|
17
|
+
const blob = await response.blob();
|
|
18
|
+
const file = new File([blob], name, { type: 'application/zip' });
|
|
19
|
+
await restoreBackup(file);
|
|
20
|
+
onClose();
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
setError(err.message);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
setSubmitting(false);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-md", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('admin.backups.testRestore.title', {
|
|
30
|
+
defaultValue: 'Restore test data',
|
|
31
|
+
}) }) }), _jsx("p", { className: "px-1 text-sm", children: t('admin.backups.testRestore.confirm', {
|
|
32
|
+
defaultValue: 'This will restore sample test data into the community. Are you sure?',
|
|
33
|
+
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('admin.backups.testRestore.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: submit, disabled: submitting, children: t('admin.backups.testRestore.continue', {
|
|
34
|
+
defaultValue: 'Continue',
|
|
35
|
+
}) })] })] }) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditArticle(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { truncateText } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
6
|
+
import { ArticleForm } from '../../components/index.js';
|
|
7
|
+
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
8
|
+
export function EditArticle() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const { articleId = '' } = useParams();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const postQuery = openpeepsApi.usePost(articleId);
|
|
14
|
+
const updatePost = openpeepsApi.updatePostAction({ id: articleId });
|
|
15
|
+
const [postData, setPostData] = useState(null);
|
|
16
|
+
const [submitting, setSubmitting] = useState(false);
|
|
17
|
+
const [error, setError] = useState(null);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (postQuery.data && postQuery.data.type === 'article') {
|
|
20
|
+
setPostData({
|
|
21
|
+
visibility: postQuery.data.visibility,
|
|
22
|
+
type: 'article',
|
|
23
|
+
groupId: postQuery.data.groupId ?? undefined,
|
|
24
|
+
audience: postQuery.data.audience ?? undefined,
|
|
25
|
+
data: postQuery.data.data,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, [postQuery.data]);
|
|
29
|
+
const articleTitle = postQuery.data?.data?.title;
|
|
30
|
+
const submit = useCallback(async () => {
|
|
31
|
+
if (!postData)
|
|
32
|
+
return;
|
|
33
|
+
setError(null);
|
|
34
|
+
setSubmitting(true);
|
|
35
|
+
try {
|
|
36
|
+
const article = postData.data.type === 'article' ? postData.data : null;
|
|
37
|
+
await updatePost(article);
|
|
38
|
+
navigate(`/posts/${articleId}`);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
setError(err.message);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
setSubmitting(false);
|
|
45
|
+
}
|
|
46
|
+
}, [articleId, navigate, postData, updatePost]);
|
|
47
|
+
const headerActions = useMemo(() => (_jsx(Button, { title: t('articles.update.title', { defaultValue: 'Update article' }), variant: "default", action: submit, disabled: submitting, children: submitting
|
|
48
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
49
|
+
: t('articles.update.title', { defaultValue: 'Update article' }) })), [submit, submitting, t]);
|
|
50
|
+
useSetPageHeader(articleTitle
|
|
51
|
+
? `${t('articles.edit', { defaultValue: 'Edit article' })} ${truncateText(articleTitle)}`
|
|
52
|
+
: t('articles.edit', { defaultValue: 'Edit article' }), headerActions);
|
|
53
|
+
if (postQuery.isLoading) {
|
|
54
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
55
|
+
}
|
|
56
|
+
if (!postQuery.data || !postData) {
|
|
57
|
+
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('articles.notFound', { defaultValue: 'Article not found' }) }));
|
|
58
|
+
}
|
|
59
|
+
return (_jsxs("div", { className: "pb-12", children: [_jsx(ArticleForm, { postData: postData, onChange: setPostData, isEdit: true }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error }) })) : null] }));
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ArticlesIndex(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { FilePlus } from 'lucide-react';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader, useSetPlusButtonActions, } from '../../index.js';
|
|
5
|
+
import { Feed } from '../../components/index.js';
|
|
6
|
+
export function ArticlesIndex() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
9
|
+
const query = openpeepsApi.usePostsByType('article');
|
|
10
|
+
useSetPageHeader(t('navigation.articles', { defaultValue: 'Articles' }));
|
|
11
|
+
const plusButton = useMemo(() => ({
|
|
12
|
+
title: t('articles.new', { defaultValue: 'New article' }),
|
|
13
|
+
icon: FilePlus,
|
|
14
|
+
action: '/articles/new',
|
|
15
|
+
}), [t]);
|
|
16
|
+
useSetPlusButtonActions(plusButton);
|
|
17
|
+
return _jsx(Feed, { query: query });
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NewArticle(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
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, defaultNewArticle, useSetPageHeader, } from '../../index.js';
|
|
5
|
+
import { ArticleForm, useServerInfo } from '../../components/index.js';
|
|
6
|
+
import { Button, Toast } from '@openpeepshq/react-ui';
|
|
7
|
+
export function NewArticle() {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const serverInfo = useServerInfo();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const createPost = openpeepsApi.createPostAction();
|
|
13
|
+
const [postData, setPostData] = useState(() => defaultNewArticle(serverInfo.publicContent));
|
|
14
|
+
const [submitting, setSubmitting] = useState(false);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
const article = postData.data.type === 'article' ? postData.data : null;
|
|
17
|
+
const canSubmit = !!article?.title?.trim() &&
|
|
18
|
+
!(postData.visibility === 'direct' && !postData.audience?.length);
|
|
19
|
+
const submit = useCallback(async () => {
|
|
20
|
+
setError(null);
|
|
21
|
+
if (!article?.title?.trim()) {
|
|
22
|
+
setError(t('articles.validation.titleRequired', {
|
|
23
|
+
defaultValue: 'Title is required',
|
|
24
|
+
}));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (postData.visibility === 'direct' && !postData.audience?.length) {
|
|
28
|
+
setError('Choose at least one recipient for a direct article.');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setSubmitting(true);
|
|
32
|
+
try {
|
|
33
|
+
const created = await createPost({ ...postData, type: 'article' });
|
|
34
|
+
navigate(`/posts/${created.id}`);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
setError(err.message);
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
setSubmitting(false);
|
|
41
|
+
}
|
|
42
|
+
}, [article, createPost, navigate, postData, t]);
|
|
43
|
+
const headerActions = useMemo(() => (_jsx(Button, { title: t('articles.create.title', { defaultValue: 'Create article' }), variant: "default", action: submit, disabled: submitting || !canSubmit, children: submitting
|
|
44
|
+
? t('common.submitting', { defaultValue: 'Publishing…' })
|
|
45
|
+
: t('articles.create.title', { defaultValue: 'Create article' }) })), [canSubmit, submit, submitting, t]);
|
|
46
|
+
useSetPageHeader(t('articles.new', { defaultValue: 'New article' }), headerActions);
|
|
47
|
+
return (_jsxs("div", { className: "pb-12", children: [_jsx(ArticleForm, { postData: postData, onChange: setPostData }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error }) })) : null] }));
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AuthClosed(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
4
|
+
import { useT } from '../../index.js';
|
|
5
|
+
import { AuthLayout } from '../../components/index.js';
|
|
6
|
+
export function AuthClosed() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const navigate = useNavigate();
|
|
9
|
+
return (_jsx(AuthLayout, { navigate: (url) => void navigate(url), noRedirect: true, children: _jsxs("div", { className: "text-token variant-glass flex h-fit flex-col items-center justify-center space-y-4 p-4 md:w-96", children: [_jsx("h2", { className: "text-lg font-bold", children: t('auth.closed.heading', {
|
|
10
|
+
defaultValue: 'Sign Ups are Currently Closed',
|
|
11
|
+
}) }), _jsx("p", { className: "text-center", children: t('auth.closed.message', {
|
|
12
|
+
defaultValue: 'We are not accepting new registrations at this time. Please check back later or contact support if you believe this is an error.',
|
|
13
|
+
}) }), _jsx(Button, { title: t('auth.closed.goToLogin', { defaultValue: 'Go to Login' }), action: () => navigate('/auth/login'), variant: "default", className: "mt-4 w-full", children: t('auth.closed.goToLogin', { defaultValue: 'Go to Login' }) })] }) }));
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Login(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Link as RouterLink } from 'react-router-dom';
|
|
4
|
+
import { Eye, EyeOff } from 'lucide-react';
|
|
5
|
+
import { useForm } from 'react-hook-form';
|
|
6
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
7
|
+
import { loginRequestSchema, } from '@openpeepshq/common/types';
|
|
8
|
+
import { Button, Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Input, Link, Toast, } from '@openpeepshq/react-ui';
|
|
9
|
+
import { useT, useOpenpeeps, useCredentialsStore, useNavigate, useSearchParams, useHrefOf, } from '../../index.js';
|
|
10
|
+
import { AuthLayout, useServerInfo, useToast } from '../../components/index.js';
|
|
11
|
+
import { performLogin } from '../../lib/auth.js';
|
|
12
|
+
export function Login() {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const navigate = useNavigate();
|
|
15
|
+
const searchParams = useSearchParams();
|
|
16
|
+
const href = useHrefOf();
|
|
17
|
+
const { client } = useOpenpeeps();
|
|
18
|
+
const { credentialsStore } = useCredentialsStore();
|
|
19
|
+
const serverInfo = useServerInfo();
|
|
20
|
+
const { success, error: toastError } = useToast();
|
|
21
|
+
const form = useForm({
|
|
22
|
+
resolver: zodResolver(loginRequestSchema),
|
|
23
|
+
defaultValues: { email: '', password: '' },
|
|
24
|
+
});
|
|
25
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
26
|
+
const [error, setError] = useState(null);
|
|
27
|
+
const redirectUrl = searchParams.get('redirect') ?? href({ type: 'feed', feed: 'local' });
|
|
28
|
+
const paymentParam = searchParams.get('payment');
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (paymentParam === 'success') {
|
|
31
|
+
success(t('payment.success.message', {
|
|
32
|
+
defaultValue: 'Payment received. Redirecting…',
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
else if (paymentParam === 'cancel') {
|
|
36
|
+
toastError(t('payment.cancelled', { defaultValue: 'Checkout was cancelled.' }));
|
|
37
|
+
}
|
|
38
|
+
}, [paymentParam, success, toastError, t]);
|
|
39
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
40
|
+
setError(null);
|
|
41
|
+
try {
|
|
42
|
+
const tr = await performLogin(client, credentialsStore, data);
|
|
43
|
+
if (tr.checkoutUrl) {
|
|
44
|
+
window.location.assign(tr.checkoutUrl);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
navigate(redirectUrl);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
setError(err.message);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return (_jsxs(AuthLayout, { redirectTo: redirectUrl, navigate: (url) => void navigate(url), hasPayment: !!paymentParam, children: [_jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-3", onSubmit: onSubmit, children: [_jsx("h2", { className: "text-xl", "data-testid": "auth-login-title", children: t('auth.login.title', { defaultValue: 'Login' }) }), _jsx("p", { children: t('auth.login.welcomeBack', {
|
|
55
|
+
defaultValue: 'Welcome back, enter details below to log into your community',
|
|
56
|
+
}) }), _jsx(FormField, { control: form.control, name: "email", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('auth.login.email', { defaultValue: 'Email' }) }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "email", autoComplete: "email", placeholder: t('auth.login.emailPlaceholder', {
|
|
57
|
+
defaultValue: 'you@email.org',
|
|
58
|
+
}), "data-testid": "auth-login-email" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "password", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('auth.login.password', { defaultValue: 'Password' }) }), _jsx(FormControl, { children: _jsxs("div", { className: "relative", children: [_jsx(Input, { ...field, type: showPassword ? 'text' : 'password', autoComplete: "current-password", "data-testid": "auth-login-password", className: "pr-10" }), _jsx("button", { type: "button", onClick: () => setShowPassword((v) => !v), "aria-label": showPassword
|
|
59
|
+
? t('auth.login.hidePassword', {
|
|
60
|
+
defaultValue: 'Hide password',
|
|
61
|
+
})
|
|
62
|
+
: t('auth.login.showPassword', {
|
|
63
|
+
defaultValue: 'Show password',
|
|
64
|
+
}), className: "absolute right-2 top-1/2 -translate-y-1/2", children: showPassword ? _jsx(EyeOff, { size: 20 }) : _jsx(Eye, { size: 20 }) })] }) }), _jsx(FormMessage, {})] })) }), _jsx("span", { className: "px-2", children: _jsx(Link, { action: href({ type: 'auth', mode: 'request-reset-password' }), className: "text-sm", children: t('auth.login.forgotPassword', {
|
|
65
|
+
defaultValue: 'Forgot Password?',
|
|
66
|
+
}) }) }), error && (_jsx(Toast, { variant: "error", testId: "auth-login-error", onDismiss: () => setError(null), children: error })), _jsx(Button, { type: "submit", variant: "default", title: t('auth.login.logIn', { defaultValue: 'Log in' }), loading: form.formState.isSubmitting, "data-testid": "auth-login-submit", children: t('auth.login.logIn', { defaultValue: 'Log in' }) })] }) }), serverInfo.sso?.oidc && serverInfo.sso.oidc.length > 0 && (_jsx("div", { className: "mt-4 flex flex-col gap-2", children: serverInfo.sso.oidc.map((provider) => (_jsx(Button, { variant: "outline", action: `/api/openpeeps/core/v1/sso/oidc/${provider.id}/authorize`, className: "w-full justify-center", "data-testid": `auth-login-oidc-${provider.id}`, children: t('auth.login.loginWith', {
|
|
67
|
+
defaultValue: 'Login with {{provider}}',
|
|
68
|
+
provider: provider.name,
|
|
69
|
+
}) }, provider.id))) })), _jsxs("div", { className: "flex justify-between px-2 pt-4", children: [serverInfo.communityConfig?.settings?.openRegistrations && (_jsx("span", { children: _jsx(RouterLink, { to: href({ type: 'about' }), className: "op-anchor text-sm", children: t('auth.login.joinCommunity', {
|
|
70
|
+
defaultValue: 'Join Community',
|
|
71
|
+
}) }) })), serverInfo.publicContent && (_jsx("span", { children: _jsx(RouterLink, { to: href({ type: 'feed', feed: 'local' }), className: "op-anchor text-sm", children: t('auth.login.seeCommunityFeed', {
|
|
72
|
+
defaultValue: 'See community feed',
|
|
73
|
+
}) }) }))] })] }));
|
|
74
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { useCredentialsStore, useT } from '../../index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Lands the browser after the server's OIDC callback has exchanged the code.
|
|
7
|
+
* The server redirects here with either `?token=` (success) or `?error=`.
|
|
8
|
+
*/
|
|
9
|
+
export function OidcCallback() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const navigate = useNavigate();
|
|
12
|
+
const [searchParams] = useSearchParams();
|
|
13
|
+
const { credentialsStore } = useCredentialsStore();
|
|
14
|
+
const [error, setError] = useState(null);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const token = searchParams.get('token');
|
|
17
|
+
const errorParam = searchParams.get('error');
|
|
18
|
+
if (errorParam) {
|
|
19
|
+
setError(errorParam);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (token) {
|
|
23
|
+
void credentialsStore.set({ token }).then(() => navigate('/feeds/local'));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setError(t('auth.sso.noToken', {
|
|
27
|
+
defaultValue: 'No token or error received from authentication provider.',
|
|
28
|
+
}));
|
|
29
|
+
}, [searchParams, credentialsStore, navigate, t]);
|
|
30
|
+
return (_jsx("div", { className: "flex min-h-screen items-center justify-center p-4 text-center", children: error ? (_jsxs("h1", { className: "text-error text-2xl font-semibold", children: [t('common.error', { defaultValue: 'Error' }), ": ", error] })) : (_jsx("h1", { className: "text-2xl font-semibold", children: t('auth.sso.signingIn', { defaultValue: 'Signing you in…' }) })) }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Link as RouterLink, useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { useT } from '../../index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Shown when an OIDC sign-in created a new account that requires admin
|
|
7
|
+
* approval before it can be used.
|
|
8
|
+
*/
|
|
9
|
+
export function OidcPending() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const [searchParams] = useSearchParams();
|
|
12
|
+
const { pendingEmail, providerName } = useMemo(() => {
|
|
13
|
+
const providerId = searchParams.get('provider') || '';
|
|
14
|
+
const state = searchParams.get('state');
|
|
15
|
+
const fallback = {
|
|
16
|
+
pendingEmail: t('auth.sso.yourEmail', { defaultValue: 'your email' }),
|
|
17
|
+
providerName: providerId || 'Administrator',
|
|
18
|
+
};
|
|
19
|
+
if (!state)
|
|
20
|
+
return fallback;
|
|
21
|
+
try {
|
|
22
|
+
const parsed = JSON.parse(atob(state));
|
|
23
|
+
return {
|
|
24
|
+
pendingEmail: parsed.pendingEmail || fallback.pendingEmail,
|
|
25
|
+
providerName: parsed.providerName || fallback.providerName,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return fallback;
|
|
30
|
+
}
|
|
31
|
+
}, [searchParams, t]);
|
|
32
|
+
return (_jsxs("div", { className: "mx-auto mt-8 max-w-md text-center", children: [_jsx("div", { className: "border-border border-t-primary mx-auto size-8 animate-spin rounded-full border-4" }), _jsx("h1", { className: "mt-4 text-2xl font-semibold", children: t('auth.sso.pendingTitle', { defaultValue: 'Account Pending Review' }) }), _jsx("p", { className: "text-muted-foreground mt-4", children: t('auth.sso.pendingBody', {
|
|
33
|
+
defaultValue: 'A new account for {{email}} requires administrator approval.',
|
|
34
|
+
email: pendingEmail,
|
|
35
|
+
}) }), _jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: t('auth.sso.pendingContact', {
|
|
36
|
+
defaultValue: 'Please contact the {{provider}} administrator to have your account reviewed.',
|
|
37
|
+
provider: providerName,
|
|
38
|
+
}) }), _jsx("div", { className: "mt-6", children: _jsx(RouterLink, { to: "/auth/login", className: "op-anchor", children: t('auth.sso.backToLogin', { defaultValue: 'Back to login' }) }) })] }));
|
|
39
|
+
}
|