@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,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { Database, Download, FlaskConical } from 'lucide-react';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader, useCredentialsStore, } from '../../index.js';
|
|
5
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
6
|
+
import { RestoreBackupModal } from './components/RestoreBackupModal.js';
|
|
7
|
+
import { RestoreTestBackupModal } from './components/RestoreTestBackupModal.js';
|
|
8
|
+
export function AdminBackups() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
11
|
+
const { credentialsStore } = useCredentialsStore();
|
|
12
|
+
const backupsQuery = openpeepsApi.admin.useBackupsList();
|
|
13
|
+
const createBackup = openpeepsApi.admin.createBackupAction();
|
|
14
|
+
const [showRestore, setShowRestore] = useState(false);
|
|
15
|
+
const [showTestRestore, setShowTestRestore] = useState(false);
|
|
16
|
+
const backups = backupsQuery.data ?? [];
|
|
17
|
+
const handleDownload = useCallback(async (name) => {
|
|
18
|
+
const token = (await credentialsStore.get())?.token;
|
|
19
|
+
if (!token)
|
|
20
|
+
return;
|
|
21
|
+
const url = `/backups/${encodeURIComponent(name)}.zip?token=${encodeURIComponent(token)}`;
|
|
22
|
+
window.location.assign(url);
|
|
23
|
+
}, [credentialsStore]);
|
|
24
|
+
const createLabel = t('admin.backups.create', {
|
|
25
|
+
defaultValue: 'Create backup',
|
|
26
|
+
});
|
|
27
|
+
const restoreLabel = t('admin.backups.restoreTitle', {
|
|
28
|
+
defaultValue: 'Restore a backup',
|
|
29
|
+
});
|
|
30
|
+
const headerActions = useMemo(() => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { title: restoreLabel, variant: "outline", action: () => setShowRestore(true), children: restoreLabel }), _jsx(Button, { title: createLabel, variant: "default", action: () => createBackup(), children: createLabel })] })), [createBackup, createLabel, restoreLabel]);
|
|
31
|
+
useSetPageHeader(t('admin.backups.title', { defaultValue: 'Backups' }), headerActions);
|
|
32
|
+
return (_jsxs("div", { className: "p-4", children: [showRestore ? (_jsx(RestoreBackupModal, { onClose: () => setShowRestore(false) })) : null, showTestRestore ? (_jsx(RestoreTestBackupModal, { onClose: () => setShowTestRestore(false) })) : null, _jsx("div", { className: "mb-2 flex justify-end", children: _jsxs(Button, { title: t('admin.backups.testBackup', { defaultValue: 'Test backup' }), variant: "ghost", action: () => setShowTestRestore(true), children: [_jsx(FlaskConical, { size: 18 }), t('admin.backups.testBackup', { defaultValue: 'Test backup' })] }) }), _jsx("div", { className: "mb-2 rounded-md border-2 p-4", children: t('admin.backups.description', {
|
|
33
|
+
defaultValue: 'All backups are stored in the server temporarily. Please download the backups and store them in a safe place. You can restore the backups by uploading them here.',
|
|
34
|
+
}) }), backups.length === 0 ? (_jsxs("div", { className: "text-muted-foreground flex flex-col items-center pt-20", children: [_jsx(Database, { size: 50 }), _jsx("p", { className: "mt-2 text-sm", children: t('admin.backups.noBackupsFound', {
|
|
35
|
+
defaultValue: 'No Backups found',
|
|
36
|
+
}) })] })) : (_jsx("ul", { className: "space-y-1 rounded-md border p-2 font-mono text-sm", children: [...backups].reverse().map((name) => (_jsxs("li", { className: "flex items-center justify-between border-b px-2 py-1 last:border-b-0", children: [_jsx("span", { children: name }), _jsx("button", { type: "button", title: t('common.actions.download', {
|
|
37
|
+
defaultValue: 'Download',
|
|
38
|
+
}), className: "hover:text-primary", onClick: () => handleDownload(name), children: _jsx(Download, { size: 18 }) })] }, name))) }))] }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ConfigEditorProps {
|
|
2
|
+
/** Page title. */
|
|
3
|
+
title: string;
|
|
4
|
+
/** Admin config namespace (e.g. 'openpeeps'). */
|
|
5
|
+
namespace: string;
|
|
6
|
+
/** Admin config item (e.g. 'core'). */
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Generic admin editor for `admin.config.*` slots. Uses the registered Zod
|
|
11
|
+
* schema (same as the Svelte ConfigurationTree) when available; otherwise
|
|
12
|
+
* falls back to a JSON editor.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AdminConfigEditor({ title, namespace, name, }: ConfigEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { useT, useOpenpeeps, useSetPageHeader, ConfigurationTree, resolveAdminConfigSchema, } from '../../index.js';
|
|
4
|
+
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generic admin editor for `admin.config.*` slots. Uses the registered Zod
|
|
10
|
+
* schema (same as the Svelte ConfigurationTree) when available; otherwise
|
|
11
|
+
* falls back to a JSON editor.
|
|
12
|
+
*/
|
|
13
|
+
export function AdminConfigEditor({ title, namespace, name, }) {
|
|
14
|
+
const t = useT();
|
|
15
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
16
|
+
const configQuery = openpeepsApi.admin.useConfigRead(namespace, name);
|
|
17
|
+
const updateConfig = openpeepsApi.admin.updateConfigAction({
|
|
18
|
+
namespace,
|
|
19
|
+
name,
|
|
20
|
+
});
|
|
21
|
+
useSetPageHeader(title);
|
|
22
|
+
const schema = useMemo(() => resolveAdminConfigSchema(namespace, name), [namespace, name]);
|
|
23
|
+
const config = configQuery.data?.config;
|
|
24
|
+
const defaults = configQuery.data?.defaults;
|
|
25
|
+
const [draft, setDraft] = useState('');
|
|
26
|
+
const [status, setStatus] = useState(null);
|
|
27
|
+
const [saving, setSaving] = useState(false);
|
|
28
|
+
const useSchemaForm = !!schema && (isPlainObject(config) || isPlainObject(defaults));
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (configQuery.data && !useSchemaForm) {
|
|
31
|
+
setDraft(JSON.stringify(configQuery.data.config ?? {}, null, 2));
|
|
32
|
+
}
|
|
33
|
+
}, [configQuery.data, useSchemaForm]);
|
|
34
|
+
if (configQuery.isLoading) {
|
|
35
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
36
|
+
}
|
|
37
|
+
const saveJson = async () => {
|
|
38
|
+
setStatus(null);
|
|
39
|
+
let parsed;
|
|
40
|
+
try {
|
|
41
|
+
parsed = JSON.parse(draft);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
setStatus({
|
|
45
|
+
type: 'error',
|
|
46
|
+
message: `Invalid JSON: ${err.message}`,
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
setSaving(true);
|
|
51
|
+
try {
|
|
52
|
+
await updateConfig({ config: parsed });
|
|
53
|
+
setStatus({
|
|
54
|
+
type: 'success',
|
|
55
|
+
message: t('admin.config.saved', { defaultValue: 'Saved.' }),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
setStatus({ type: 'error', message: err.message });
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
setSaving(false);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const saveSchemaPatch = async (patch) => {
|
|
66
|
+
setStatus(null);
|
|
67
|
+
setSaving(true);
|
|
68
|
+
try {
|
|
69
|
+
await updateConfig({ config: patch });
|
|
70
|
+
setStatus({
|
|
71
|
+
type: 'success',
|
|
72
|
+
message: t('admin.config.saved', { defaultValue: 'Saved.' }),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
setStatus({ type: 'error', message: err.message });
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
setSaving(false);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
if (useSchemaForm && schema) {
|
|
83
|
+
const cfg = isPlainObject(config) ? config : {};
|
|
84
|
+
const def = isPlainObject(defaults) ? defaults : {};
|
|
85
|
+
return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("p", { className: "text-muted-foreground text-xs", children: [namespace, ".", name] }), _jsx(ConfigurationTree, { schema: schema, config: cfg, defaults: def, onSave: saveSchemaPatch }), status && (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message }))] }));
|
|
86
|
+
}
|
|
87
|
+
const defaultsForView = defaults !== undefined ? JSON.stringify(defaults, null, 2) : null;
|
|
88
|
+
return (_jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("p", { className: "text-muted-foreground text-xs", children: [namespace, ".", name] }), !schema && (_jsx("p", { className: "text-muted-foreground text-xs", children: t('admin.config.noSchema', {
|
|
89
|
+
defaultValue: 'No Zod schema is registered for this slot — editing as JSON.',
|
|
90
|
+
}) })), _jsxs("section", { className: "space-y-2", children: [_jsx("h2", { className: "text-sm font-medium", children: "Current value (JSON)" }), _jsx("textarea", { rows: 20, value: draft, spellCheck: false, className: "bg-surface w-full rounded-md border p-2 font-mono text-xs", onChange: (e) => setDraft(e.target.value) })] }), defaultsForView !== null && (_jsxs("details", { className: "space-y-2 rounded-md border p-2 text-xs", children: [_jsx("summary", { className: "cursor-pointer font-medium", children: "View server defaults" }), _jsx("pre", { className: "bg-surface overflow-x-auto whitespace-pre-wrap p-2 text-xs", children: defaultsForView })] })), status && (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })), _jsx(Button, { title: "Save", variant: "default", action: saveJson, disabled: saving, loadingContent: t('common.saving', { defaultValue: 'Saving…' }), children: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfiguration(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT, useSetPageHeader } from '../../index.js';
|
|
3
|
+
import { ConfigMenuButton } from '../../components/index.js';
|
|
4
|
+
export function AdminConfiguration() {
|
|
5
|
+
const t = useT();
|
|
6
|
+
useSetPageHeader(t('configuration.title', { defaultValue: 'Configuration' }), undefined, 'admin-configuration-heading');
|
|
7
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx(ConfigMenuButton, { translationPrefix: "configuration.community", action: "/admin/configuration/community" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.serverSettings", action: "/admin/configuration/server-settings" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.email", action: "/admin/configuration/email" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.i18n", action: "/admin/configuration/i18n" })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunity(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useSetPageHeader } from '../../index.js';
|
|
3
|
+
import { ConfigMenuButton } from '../../components/index.js';
|
|
4
|
+
export function AdminConfigurationCommunity() {
|
|
5
|
+
useSetPageHeader('Community Customization');
|
|
6
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx(ConfigMenuButton, { translationPrefix: "configuration.community.info", action: "/admin/configuration/community/info" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.favicons", action: "/admin/configuration/community/favicons" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.theme", action: "/admin/configuration/community/theme" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.welcomePage", action: "/admin/configuration/community/welcome-page" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.codeOfConduct", action: "/admin/configuration/community/code-of-conduct" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.welcomeEmail", action: "/admin/configuration/community/welcome-email" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.aboutPage", action: "/admin/configuration/community/about-page" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.links", action: "/admin/configuration/community/links" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.profileFields", action: "/admin/configuration/community/profile-fields" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.roles", action: "/admin/configuration/community/roles" }), _jsx(ConfigMenuButton, { translationPrefix: "configuration.community.language", action: "/admin/configuration/community/language" })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityLanguage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
4
|
+
import { Button, Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
const AVAILABLE_LANGUAGES = [
|
|
6
|
+
{ code: 'en', name: 'English' },
|
|
7
|
+
{ code: 'de', name: 'Deutsch' },
|
|
8
|
+
];
|
|
9
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
10
|
+
export function AdminConfigurationCommunityLanguage() {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const configQuery = openpeepsApi.admin.useConfigRead('openpeeps', 'community');
|
|
14
|
+
const updateConfig = openpeepsApi.admin.updateConfigAction({
|
|
15
|
+
namespace: 'openpeeps',
|
|
16
|
+
name: 'community',
|
|
17
|
+
});
|
|
18
|
+
const [selectedLanguage, setSelectedLanguage] = useState(DEFAULT_LANGUAGE);
|
|
19
|
+
const [saving, setSaving] = useState(false);
|
|
20
|
+
const [status, setStatus] = useState(null);
|
|
21
|
+
useSetPageHeader(t('configuration.community.language.title', {
|
|
22
|
+
defaultValue: 'Default Language',
|
|
23
|
+
}));
|
|
24
|
+
const config = configQuery.data?.config;
|
|
25
|
+
const defaults = configQuery.data?.defaults;
|
|
26
|
+
const currentDefault = config?.settings?.defaultLanguage ??
|
|
27
|
+
defaults?.settings?.defaultLanguage ??
|
|
28
|
+
DEFAULT_LANGUAGE;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setSelectedLanguage(currentDefault);
|
|
31
|
+
}, [currentDefault]);
|
|
32
|
+
const hasChanges = selectedLanguage !== currentDefault;
|
|
33
|
+
const save = async () => {
|
|
34
|
+
setStatus(null);
|
|
35
|
+
setSaving(true);
|
|
36
|
+
try {
|
|
37
|
+
const base = (config ?? defaults ?? {});
|
|
38
|
+
await updateConfig({
|
|
39
|
+
config: {
|
|
40
|
+
...base,
|
|
41
|
+
settings: {
|
|
42
|
+
...base.settings,
|
|
43
|
+
defaultLanguage: selectedLanguage,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
setStatus({
|
|
48
|
+
type: 'success',
|
|
49
|
+
message: t('configuration.community.language.updateSuccess', {
|
|
50
|
+
defaultValue: 'Default language updated.',
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
setStatus({ type: 'error', message: err.message });
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
setSaving(false);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
if (configQuery.isLoading) {
|
|
62
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
63
|
+
}
|
|
64
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.language.title', {
|
|
65
|
+
defaultValue: 'Default language',
|
|
66
|
+
}) }), _jsx("span", { children: t('configuration.community.language.languageDescription', {
|
|
67
|
+
defaultValue: 'Choose the default language for new members.',
|
|
68
|
+
}) }), _jsx("div", { className: "mt-4 flex flex-wrap items-center gap-x-4 gap-y-2", children: AVAILABLE_LANGUAGES.map((lang) => (_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", checked: selectedLanguage === lang.code, onChange: () => setSelectedLanguage(lang.code) }), _jsxs("span", { children: [lang.name, lang.code === DEFAULT_LANGUAGE ? (_jsx("span", { className: "ml-1 text-sm opacity-60", children: t('settings.language.default', {
|
|
69
|
+
defaultValue: '(default)',
|
|
70
|
+
}) })) : null] })] }, lang.code))) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(Button, { variant: "default", action: save, disabled: !hasChanges || saving, children: t('common.form.save', { defaultValue: 'Save' }) })] }));
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationEmail(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { useForm } from 'react-hook-form';
|
|
4
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
|
+
import { coreConfigSanitizedSchema, } from '@openpeepshq/common/types';
|
|
6
|
+
import { useT, useSetPageHeader, useOpenpeeps, diffConfigTrees, equal, } from '../../index.js';
|
|
7
|
+
import { Button, ExpandableBox, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Toast, } from '@openpeepshq/react-ui';
|
|
8
|
+
const emailFormSchema = coreConfigSanitizedSchema.shape.email;
|
|
9
|
+
const withSecureTransport = (email) => ({
|
|
10
|
+
...email,
|
|
11
|
+
transportConfig: { ...email.transportConfig, secure: true },
|
|
12
|
+
});
|
|
13
|
+
export function AdminConfigurationEmail() {
|
|
14
|
+
const t = useT();
|
|
15
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
16
|
+
const configQuery = openpeepsApi.admin.useConfigRead('openpeeps', 'core');
|
|
17
|
+
const updateConfig = openpeepsApi.admin.updateConfigAction({
|
|
18
|
+
namespace: 'openpeeps',
|
|
19
|
+
name: 'core',
|
|
20
|
+
});
|
|
21
|
+
const sendTest = openpeepsApi.admin.sendTestEmailAction();
|
|
22
|
+
useSetPageHeader(t('configuration.email.title', { defaultValue: 'Email' }));
|
|
23
|
+
const baseEmail = configQuery.data?.config?.email;
|
|
24
|
+
const draft = useMemo(() => (baseEmail ? structuredClone(baseEmail) : null), [baseEmail]);
|
|
25
|
+
const form = useForm({
|
|
26
|
+
resolver: zodResolver(emailFormSchema),
|
|
27
|
+
values: draft ?? undefined,
|
|
28
|
+
mode: 'onChange',
|
|
29
|
+
});
|
|
30
|
+
const [testRecipient, setTestRecipient] = useState('');
|
|
31
|
+
const [sending, setSending] = useState(false);
|
|
32
|
+
const [status, setStatus] = useState(null);
|
|
33
|
+
const current = form.watch();
|
|
34
|
+
const unchanged = !!baseEmail &&
|
|
35
|
+
equal(baseEmail, current);
|
|
36
|
+
const onSubmit = form.handleSubmit(async (values) => {
|
|
37
|
+
if (!baseEmail)
|
|
38
|
+
return;
|
|
39
|
+
const next = withSecureTransport(values);
|
|
40
|
+
const data = diffConfigTrees(baseEmail, next);
|
|
41
|
+
if (Object.keys(data).length === 0)
|
|
42
|
+
return;
|
|
43
|
+
setStatus(null);
|
|
44
|
+
try {
|
|
45
|
+
await updateConfig({ config: { email: data } });
|
|
46
|
+
setStatus({
|
|
47
|
+
type: 'success',
|
|
48
|
+
message: t('configuration.email.updateSuccess'),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
setStatus({ type: 'error', message: err.message });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const handleSendTest = async () => {
|
|
56
|
+
const trimmed = testRecipient.trim();
|
|
57
|
+
if (!trimmed) {
|
|
58
|
+
setStatus({
|
|
59
|
+
type: 'error',
|
|
60
|
+
message: t('configuration.email.recipientRequired'),
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setSending(true);
|
|
65
|
+
setStatus(null);
|
|
66
|
+
try {
|
|
67
|
+
await sendTest({
|
|
68
|
+
to: trimmed,
|
|
69
|
+
email: withSecureTransport(form.getValues()),
|
|
70
|
+
});
|
|
71
|
+
setStatus({
|
|
72
|
+
type: 'success',
|
|
73
|
+
message: t('configuration.email.testSuccess'),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
const detail = err.message;
|
|
78
|
+
setStatus({
|
|
79
|
+
type: 'error',
|
|
80
|
+
message: detail
|
|
81
|
+
? `${t('configuration.email.testFailed')}: ${detail}`
|
|
82
|
+
: t('configuration.email.testFailed'),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
setSending(false);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
if (configQuery.isLoading || !draft || !baseEmail) {
|
|
90
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
91
|
+
}
|
|
92
|
+
return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsx("p", { className: "text-sm opacity-80", children: t('configuration.email.intro') }), _jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-6", onSubmit: onSubmit, children: [_jsxs("section", { className: "flex flex-col gap-4", "aria-labelledby": "email-config-transport-heading", children: [_jsx("h3", { id: "email-config-transport-heading", className: "text-base font-semibold", children: t('configuration.email.sections.transport') }), _jsx(FormField, { control: form.control, name: "transportConfig.host", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.host') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", "data-testid": "admin-email-host" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "transportConfig.port", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.port') }), _jsx(FormControl, { children: _jsx(Input, { type: "number", value: Number.isNaN(field.value) ? '' : field.value, onChange: (e) => field.onChange(e.target.value === ''
|
|
93
|
+
? Number.NaN
|
|
94
|
+
: Number(e.target.value)), "data-testid": "admin-email-port" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "transportConfig.auth.user", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.authUser') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '' }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "transportConfig.auth.pass", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.authPass') }), _jsx(FormDescription, { children: t('configuration.email.fields.authPassDescription') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "password", value: field.value ?? '' }) }), _jsx(FormMessage, {})] })) })] }), _jsx(ExpandableBox, { initialOpen: false, title: _jsx("p", { className: "text-base font-semibold", children: t('configuration.email.sections.general') }), children: _jsxs("div", { className: "flex flex-col gap-4 pt-1", children: [_jsx(FormField, { control: form.control, name: "service", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.service') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "defaultTemplatePath", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.defaultTemplatePath') }), _jsx(FormDescription, { children: t('configuration.email.fields.defaultTemplatePathDescription') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "defaultFrom", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.email.fields.defaultFrom') }), _jsx(FormDescription, { children: t('configuration.email.fields.defaultFromDescription') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '' }) }), _jsx(FormMessage, {})] })) })] }) }), _jsx("span", { className: "flex justify-end pt-2", children: _jsx(Button, { type: "submit", title: t('common.submit', { defaultValue: 'Submit' }), disabled: !form.formState.isValid || unchanged, loading: form.formState.isSubmitting, variant: "default", "data-testid": "admin-email-submit", children: t('common.submit', { defaultValue: 'Submit' }) }) })] }) }), _jsxs("div", { className: "bg-surface-2 rounded-lg p-4", children: [_jsx("p", { className: "font-medium", children: t('configuration.email.testTitle') }), _jsx("p", { className: "mb-3 text-sm opacity-80", children: t('configuration.email.testHint') }), _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-end", children: [_jsxs("label", { className: "flex-1", children: [_jsx("span", { children: t('configuration.email.testRecipient') }), _jsx("input", { type: "email", value: testRecipient, onChange: (e) => setTestRecipient(e.target.value), className: "op-input rounded", placeholder: t('configuration.email.testRecipientPlaceholder'), autoComplete: "email", "data-testid": "admin-email-test-recipient" })] }), _jsx(Button, { variant: "secondary", title: t('configuration.email.sendTest'), action: handleSendTest, disabled: sending, "data-testid": "admin-email-send-test", children: sending
|
|
95
|
+
? t('common.form.loading')
|
|
96
|
+
: t('configuration.email.sendTest') })] }), _jsx("p", { className: "mt-3 text-xs opacity-70", children: t('configuration.email.bounceNote') })] }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-email-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationI18n(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { useT, useSetPageHeader, useOpenpeeps } from '../../index.js';
|
|
4
|
+
import { Button, ExpandableBox, Input, Label, Toast, deepGet, deepSet, } from '@openpeepshq/react-ui';
|
|
5
|
+
function LeafEditor({ defaults, overrides, languages, path, onChange, }) {
|
|
6
|
+
return (_jsx(ExpandableBox, { initialOpen: true, title: _jsx("div", { className: "font-bold", children: path[path.length - 1] }), children: languages.map((language) => (_jsx(Label, { title: language, inline: true, children: _jsx(Input, { value: deepGet(overrides[language], path) ?? '', placeholder: deepGet(defaults[language], path) ?? '', onChange: (e) => onChange(language, path, e.target.value.trim()) }) }, language))) }));
|
|
7
|
+
}
|
|
8
|
+
function NamespaceEditor({ defaults, merged, overrides, languages, path, onChange, }) {
|
|
9
|
+
const current = (path.length ? deepGet(merged['en'], path) : merged['en']);
|
|
10
|
+
return (_jsx(ExpandableBox, { initialOpen: path.length === 0, title: _jsx("div", { className: "font-bold", children: path.length ? path[path.length - 1] : 'AllPeeP Core' }), children: Object.entries(current).map(([key, value]) => typeof value === 'string' ? (_jsx(LeafEditor, { defaults: defaults, overrides: overrides, languages: languages, path: [...path, key], onChange: onChange }, key)) : (_jsx(NamespaceEditor, { defaults: defaults, merged: merged, overrides: overrides, languages: languages, path: [...path, key], onChange: onChange }, key))) }));
|
|
11
|
+
}
|
|
12
|
+
export function AdminConfigurationI18n() {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
15
|
+
const i18nQuery = openpeepsApi.admin.usei18n();
|
|
16
|
+
const updateI18n = openpeepsApi.admin.updateI18nAction();
|
|
17
|
+
const [overrides, setOverrides] = useState(null);
|
|
18
|
+
const [status, setStatus] = useState(null);
|
|
19
|
+
useSetPageHeader(t('configuration.i18n.pageTitle', { defaultValue: 'Translations' }));
|
|
20
|
+
const data = i18nQuery.data;
|
|
21
|
+
const serverOverrides = data?.overrides;
|
|
22
|
+
const effectiveOverrides = useMemo(() => (serverOverrides ? structuredClone(serverOverrides) : null), [serverOverrides]);
|
|
23
|
+
const working = overrides ?? effectiveOverrides;
|
|
24
|
+
const languages = data ? Object.keys(data.merged) : [];
|
|
25
|
+
const onChange = (language, path, value) => {
|
|
26
|
+
setOverrides((prev) => {
|
|
27
|
+
const next = structuredClone(prev ?? effectiveOverrides ?? {});
|
|
28
|
+
deepSet(next, [language, ...path], value || undefined);
|
|
29
|
+
return next;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const handleSave = async () => {
|
|
33
|
+
if (!working)
|
|
34
|
+
return;
|
|
35
|
+
setStatus(null);
|
|
36
|
+
try {
|
|
37
|
+
await updateI18n(working);
|
|
38
|
+
setStatus({
|
|
39
|
+
type: 'success',
|
|
40
|
+
message: t('configuration.i18n.save', { defaultValue: 'Saved' }),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
setStatus({ type: 'error', message: err.message });
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
if (i18nQuery.isLoading || !data || !working) {
|
|
48
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
49
|
+
}
|
|
50
|
+
return (_jsxs("div", { className: "p-4", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between", children: [_jsx("h1", { className: "text-2xl font-bold", children: t('configuration.i18n.pageTitle', { defaultValue: 'Translations' }) }), _jsx(Button, { variant: "default", action: handleSave, title: t('configuration.i18n.save', { defaultValue: 'Save' }), children: t('configuration.i18n.save', { defaultValue: 'Save' }) })] }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null, _jsx(NamespaceEditor, { defaults: data.defaults, merged: data.merged, overrides: working, languages: languages, path: [], onChange: onChange })] }));
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminDashboard(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Hash, UsersRound } from 'lucide-react';
|
|
3
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
4
|
+
import { useServerInfo } from '../../components/index.js';
|
|
5
|
+
import { CommunityStatsCard, SignupChart } from './components/AdminCharts.js';
|
|
6
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
7
|
+
function Card({ title, value, hint, }) {
|
|
8
|
+
return (_jsxs("div", { className: "rounded-md border p-4", children: [_jsx("h3", { className: "text-muted-foreground text-sm", children: title }), _jsx("p", { className: "mt-1 text-2xl font-semibold", children: value }), hint && _jsx("p", { className: "text-muted-foreground mt-1 text-xs", children: hint })] }));
|
|
9
|
+
}
|
|
10
|
+
export function AdminDashboard() {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const serverInfo = useServerInfo();
|
|
14
|
+
const statsQuery = openpeepsApi.admin.useGeneralStats();
|
|
15
|
+
useSetPageHeader(t('admin.dashboard.title', { defaultValue: 'Administration' }));
|
|
16
|
+
if (statsQuery.isLoading) {
|
|
17
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
18
|
+
}
|
|
19
|
+
const stats = statsQuery.data;
|
|
20
|
+
if (!stats) {
|
|
21
|
+
return (_jsx("div", { className: "text-muted-foreground p-4 text-sm", children: "No stats available" }));
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("div", { className: "rounded-md border", children: [_jsxs("header", { className: "flex items-center gap-2 border-b p-4", children: [_jsx(UsersRound, { size: 24 }), _jsx("h3", { className: "text-lg font-medium", children: t('admin.overview.communityName', {
|
|
24
|
+
defaultValue: 'Community Name',
|
|
25
|
+
}) })] }), _jsx("section", { className: "p-4", children: serverInfo?.communityConfig.info.name ?? '' })] }), _jsxs("div", { className: "rounded-md border", children: [_jsxs("header", { className: "flex items-center gap-2 border-b p-4", children: [_jsx(Hash, { size: 24 }), _jsx("h3", { className: "text-lg font-medium", children: t('admin.overview.serverVersion', {
|
|
26
|
+
defaultValue: 'Server Version',
|
|
27
|
+
}) })] }), _jsx("section", { className: "p-4", children: serverInfo?.version ?? '' })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.communityOverview', {
|
|
28
|
+
defaultValue: 'Community overview',
|
|
29
|
+
}) }), _jsxs("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [_jsx(CommunityStatsCard, { title: t('admin.overview.totalProfiles', {
|
|
30
|
+
defaultValue: 'Total Profiles',
|
|
31
|
+
}), current: stats.profiles.all.all, previous: stats.profiles.all.all - stats.profiles.all.week.currentPeriod, text: t('admin.overview.lastWeek', { defaultValue: 'Last Week' }) }), _jsx(CommunityStatsCard, { title: t('admin.overview.activeProfiles', {
|
|
32
|
+
defaultValue: 'Active Profiles',
|
|
33
|
+
}), current: stats.profiles.active.week.currentPeriod, previous: stats.profiles.active.week.lastPeriod, text: t('admin.overview.lastWeek', { defaultValue: 'Last Week' }) }), _jsx(CommunityStatsCard, { title: t('admin.overview.recentInteractions', {
|
|
34
|
+
defaultValue: 'Recent Interactions',
|
|
35
|
+
}), current: stats.interactions.all.week.currentPeriod, previous: stats.interactions.all.week.lastPeriod, text: t('admin.overview.lastWeek', { defaultValue: 'Last Week' }) }), _jsx(CommunityStatsCard, { title: t('admin.overview.allPosts', { defaultValue: 'All Posts' }), current: stats.posts.all.all, previous: stats.posts.all.all - stats.posts.all.week.currentPeriod, text: t('admin.overview.lastWeek', { defaultValue: 'Last Week' }) }), _jsx(CommunityStatsCard, { title: t('admin.overview.jamSessions', {
|
|
36
|
+
defaultValue: 'Jam Sessions',
|
|
37
|
+
}), current: stats.jams.sessions.all, previous: stats.jams.sessions.week.lastPeriod, text: t('admin.overview.lastWeek', { defaultValue: 'Last Week' }) }), _jsx(CommunityStatsCard, { title: t('admin.overview.jamParticipants', {
|
|
38
|
+
defaultValue: 'Jam Participants',
|
|
39
|
+
}), current: stats.jams.participants.week.currentPeriod, previous: stats.jams.participants.week.lastPeriod, text: t('admin.overview.lastWeek', { defaultValue: 'Last Week' }) })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.newSignups', { defaultValue: 'New signups' }) }), _jsx(SignupChart, { stats: stats })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: "Profiles" }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Card, { title: "Total profiles", value: stats.profiles.all.all }), _jsx(Card, { title: "Active (month)", value: stats.profiles.active.month.currentPeriod, hint: `vs. ${stats.profiles.active.month.lastPeriod} last month` }), _jsx(Card, { title: "Active (week)", value: stats.profiles.active.week.currentPeriod }), _jsx(Card, { title: "Active (day)", value: stats.profiles.active.day.currentPeriod })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: "Posts" }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Card, { title: "All posts", value: stats.posts.all.all }), _jsx(Card, { title: "Replies", value: stats.posts.replies.all }), _jsx(Card, { title: "This month", value: stats.posts.all.month.currentPeriod }), _jsx(Card, { title: "Interactions (all)", value: stats.interactions.all.all })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: "Jams" }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(Card, { title: "Sessions", value: stats.jams.sessions.all }), _jsx(Card, { title: "Participants", value: stats.jams.participants.all })] })] })] }));
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminDb(): import("react/jsx-runtime").JSX.Element;
|