@openpeepshq/react 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accounts/SignUpLoginModal.js +2 -2
- package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
- package/dist/components/configuration/ConfigMenuButton.js +12 -0
- package/dist/components/configuration/ConfigurationTree.js +1 -1
- package/dist/components/configuration/index.d.ts +2 -0
- package/dist/components/configuration/index.js +1 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
- package/dist/components/conversations/ConversationMessageBubble.js +4 -5
- package/dist/components/conversations/CreateNewConversation.js +10 -42
- package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
- package/dist/components/conversations/MessageInThread.js +1 -2
- package/dist/components/form/ImageEditModal.js +2 -4
- package/dist/components/form/ImageInput.js +13 -8
- package/dist/components/form/LocationInput.js +1 -1
- package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
- package/dist/components/groups/AddGroupMembersButton.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupAvatar.js +4 -4
- package/dist/components/groups/GroupCard.js +3 -3
- package/dist/components/groups/GroupHeader.js +1 -1
- package/dist/components/groups/GroupMembersList.js +2 -3
- package/dist/components/groups/GroupOptionsMenu.js +12 -6
- package/dist/components/groups/JoinGroupButton.js +3 -20
- package/dist/components/jams/CreateNewJam.js +4 -4
- package/dist/components/jams/JamCallParticipant.js +17 -7
- package/dist/components/jams/JamCapacityGate.js +1 -1
- package/dist/components/jams/JamChatDrawer.js +2 -2
- package/dist/components/jams/JamConference.js +1 -1
- package/dist/components/jams/JamContext.d.ts +4 -0
- package/dist/components/jams/JamContext.js +17 -2
- package/dist/components/jams/JamDetailsDrawer.js +1 -1
- package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
- package/dist/components/jams/JamDeviceSelectors.js +4 -3
- package/dist/components/jams/JamFooter.js +15 -16
- package/dist/components/jams/JamGuestForm.js +2 -2
- package/dist/components/jams/JamLobby.js +9 -19
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +1 -1
- package/dist/components/jams/JamPeopleDrawer.js +17 -13
- package/dist/components/jams/JamReactionMenu.js +1 -1
- package/dist/components/jams/JamRequestJoin.js +1 -1
- package/dist/components/jams/JamRoom.js +84 -4
- package/dist/components/jams/JamToolbarButton.d.ts +21 -0
- package/dist/components/jams/JamToolbarButton.js +19 -0
- package/dist/components/jams/JamVideoCall.js +8 -3
- package/dist/components/jams/JamVideoLayout.js +16 -5
- package/dist/components/jams/LeaveCloseButton.js +9 -44
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/constants.js +4 -0
- package/dist/components/jams/useParticipantConnection.d.ts +7 -0
- package/dist/components/jams/useParticipantConnection.js +11 -0
- package/dist/components/layout/Auth.js +1 -1
- package/dist/components/layout/Infos.js +2 -2
- package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
- package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/markdown/CompiledMarkdown.js +15 -1
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +5 -1
- package/dist/components/navigation/HeaderMobile.js +1 -1
- package/dist/components/navigation/MobileMenuItem.js +1 -1
- package/dist/components/navigation/PageHeaderAction.js +1 -1
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +6 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
- package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
- package/dist/components/notifications/NotificationHeaderActions.js +2 -2
- package/dist/components/notifications/NotificationWrapper.js +1 -1
- package/dist/components/notifications/NotificationsList.js +3 -3
- package/dist/components/notifications/TypedNotification.js +3 -3
- package/dist/components/post/Feed.js +3 -3
- package/dist/components/post/FeedPost.d.ts +2 -1
- package/dist/components/post/FeedPost.js +11 -6
- package/dist/components/post/FeedPostContent.js +1 -1
- package/dist/components/post/FullPostLayout.js +11 -4
- package/dist/components/post/NewEventButton.js +1 -1
- package/dist/components/post/NewNoteButton.js +1 -1
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/ReplyBox.js +1 -1
- package/dist/components/post/feed/events/EventsFeed.js +3 -3
- package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
- package/dist/components/post/pieces/Attachments.js +3 -3
- package/dist/components/post/pieces/EventMenu.js +1 -1
- package/dist/components/post/pieces/EventRsvpButton.js +3 -3
- package/dist/components/post/pieces/FeedPostStats.js +2 -2
- package/dist/components/post/pieces/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +33 -14
- package/dist/components/post/pieces/PostActions.js +6 -45
- package/dist/components/post/pieces/PostInfoHeader.js +1 -1
- package/dist/components/post/pieces/PostMenu.js +35 -9
- package/dist/components/post/pieces/PostReactionHeader.js +1 -1
- package/dist/components/post/pieces/ShareMenu.js +4 -2
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
- package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
- package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
- package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
- package/dist/components/post/pieces/modals/RepostModal.js +8 -7
- package/dist/components/post/post-form/AttachmentCard.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.js +1 -1
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +22 -12
- package/dist/components/post/post-form/EventForm.js +2 -2
- package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
- package/dist/components/post/post-form/NewPostModal.js +10 -10
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
- package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
- package/dist/components/post/post-form/PollComposerFields.js +12 -8
- package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
- package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/ReplyModal.js +9 -8
- package/dist/components/post/post-form/VisibilitySelector.js +1 -1
- package/dist/components/post/types/Article.js +2 -1
- package/dist/components/post/types/Event.js +1 -1
- package/dist/components/post/types/Note.js +2 -1
- package/dist/components/post/types/Poll.js +2 -1
- package/dist/components/post/types/event/CardEvent.js +2 -2
- package/dist/components/post/types/event/FullEvent.js +8 -8
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
- package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
- package/dist/components/preview-link/LocalPreviewLink.js +1 -1
- package/dist/components/preview-link/RemotePreviewLink.js +5 -1
- package/dist/components/profile/Avatar.js +3 -2
- package/dist/components/profile/FollowUnfollowButton.js +2 -2
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfileCard.js +1 -1
- package/dist/components/profile/ProfileHeader.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +3 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
- package/dist/components/profile/ProfileSelector.js +3 -3
- package/dist/components/profile/ProfilesInput.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
- package/dist/components/server-data/context.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +63 -16774
- package/dist/contexts/openpeeps/hooks/admin.js +34 -14
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +330 -0
- package/dist/contexts/openpeeps/hooks/jams.d.ts +110 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/posts.d.ts +933 -53
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +220 -0
- package/dist/contexts/openpeeps/hooks/search.d.ts +330 -0
- package/dist/contexts/openpeeps/index.d.ts +1 -1
- package/dist/contexts/openpeeps/index.js +10 -2
- package/dist/contexts/router/index.d.ts +8 -3
- package/dist/contexts/router/index.js +7 -3
- package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
- package/dist/hooks/conversations/useCreateConversation.js +56 -0
- package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
- package/dist/hooks/groups/useJoinGroup.js +23 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
- package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
- package/dist/hooks/posts/useFeedPostActions.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Markdown.d.ts +14 -0
- package/dist/lib/Markdown.js +16 -0
- package/dist/lib/analyticsClicks.d.ts +12 -0
- package/dist/lib/analyticsClicks.js +64 -0
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +27 -0
- package/dist/lib/canvasUtils.d.ts +6 -0
- package/dist/lib/canvasUtils.js +62 -1
- package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
- package/dist/lib/passwordStrength.d.ts +6 -0
- package/dist/lib/passwordStrength.js +26 -0
- package/dist/lib/postUnread.d.ts +7 -0
- package/dist/lib/postUnread.js +7 -0
- package/dist/lib/postViewCounter.d.ts +1 -1
- package/dist/lib/postViewCounter.js +3 -1
- package/dist/lib/routeHandles.d.ts +2 -0
- package/dist/lib/routeHandles.js +2 -0
- package/dist/lib/svgCover.d.ts +2 -0
- package/dist/lib/svgCover.js +18 -0
- package/dist/navigation/index.d.ts +11 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/menuItems.d.ts +8 -0
- package/dist/navigation/menuItems.js +83 -0
- package/dist/navigation/targets.d.ts +94 -0
- package/dist/navigation/targets.js +12 -0
- package/dist/pages/About.d.ts +1 -0
- package/dist/pages/About.js +19 -0
- package/dist/pages/CodeOfConduct.d.ts +1 -0
- package/dist/pages/CodeOfConduct.js +14 -0
- package/dist/pages/Explore.d.ts +1 -0
- package/dist/pages/Explore.js +132 -0
- package/dist/pages/Home.d.ts +6 -0
- package/dist/pages/Home.js +31 -0
- package/dist/pages/Members.d.ts +1 -0
- package/dist/pages/Members.js +35 -0
- package/dist/pages/NotFound.d.ts +1 -0
- package/dist/pages/NotFound.js +9 -0
- package/dist/pages/Notifications.d.ts +1 -0
- package/dist/pages/Notifications.js +8 -0
- package/dist/pages/PostDetail.d.ts +1 -0
- package/dist/pages/PostDetail.js +27 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/Profile.js +20 -0
- package/dist/pages/Tags.d.ts +1 -0
- package/dist/pages/Tags.js +14 -0
- package/dist/pages/Welcome.d.ts +1 -0
- package/dist/pages/Welcome.js +89 -0
- package/dist/pages/admin/Analytics.d.ts +11 -0
- package/dist/pages/admin/Analytics.js +11 -0
- package/dist/pages/admin/ApiKeys.d.ts +1 -0
- package/dist/pages/admin/ApiKeys.js +141 -0
- package/dist/pages/admin/Backups.d.ts +1 -0
- package/dist/pages/admin/Backups.js +39 -0
- package/dist/pages/admin/ConfigEditor.d.ts +14 -0
- package/dist/pages/admin/ConfigEditor.js +91 -0
- package/dist/pages/admin/Configuration.d.ts +1 -0
- package/dist/pages/admin/Configuration.js +8 -0
- package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunity.js +7 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
- package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
- package/dist/pages/admin/ConfigurationEmail.js +97 -0
- package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
- package/dist/pages/admin/ConfigurationI18n.js +51 -0
- package/dist/pages/admin/Dashboard.d.ts +1 -0
- package/dist/pages/admin/Dashboard.js +40 -0
- package/dist/pages/admin/Db.d.ts +1 -0
- package/dist/pages/admin/Db.js +238 -0
- package/dist/pages/admin/Diagnostics.d.ts +1 -0
- package/dist/pages/admin/Diagnostics.js +8 -0
- package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsEmail.js +65 -0
- package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsJob.js +51 -0
- package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsLogs.js +62 -0
- package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
- package/dist/pages/admin/GroupMembers.d.ts +1 -0
- package/dist/pages/admin/GroupMembers.js +109 -0
- package/dist/pages/admin/Groups.d.ts +1 -0
- package/dist/pages/admin/Groups.js +61 -0
- package/dist/pages/admin/Invites.d.ts +1 -0
- package/dist/pages/admin/Invites.js +72 -0
- package/dist/pages/admin/Members.d.ts +1 -0
- package/dist/pages/admin/Members.js +49 -0
- package/dist/pages/admin/Moderation.d.ts +1 -0
- package/dist/pages/admin/Moderation.js +62 -0
- package/dist/pages/admin/Reports.d.ts +1 -0
- package/dist/pages/admin/Reports.js +178 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
- package/dist/pages/admin/analytics/Content.d.ts +1 -0
- package/dist/pages/admin/analytics/Content.js +117 -0
- package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
- package/dist/pages/admin/analytics/Engagement.js +220 -0
- package/dist/pages/admin/analytics/Groups.d.ts +1 -0
- package/dist/pages/admin/analytics/Groups.js +139 -0
- package/dist/pages/admin/analytics/Members.d.ts +1 -0
- package/dist/pages/admin/analytics/Members.js +96 -0
- package/dist/pages/admin/analytics/Overview.d.ts +1 -0
- package/dist/pages/admin/analytics/Overview.js +165 -0
- package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
- package/dist/pages/admin/analytics/ReportSettings.js +62 -0
- package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
- package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
- package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
- package/dist/pages/admin/analytics/downloadCsv.js +20 -0
- package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
- package/dist/pages/admin/community/CommunityFavicons.js +47 -0
- package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
- package/dist/pages/admin/community/CommunityInfo.js +35 -0
- package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
- package/dist/pages/admin/community/CommunityLinks.js +35 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
- package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
- package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
- package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
- package/dist/pages/admin/community/CommunityRoles.js +109 -0
- package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
- package/dist/pages/admin/community/CommunityTheme.js +56 -0
- package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
- package/dist/pages/admin/community/useCommunityConfig.js +28 -0
- package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
- package/dist/pages/admin/components/AdminCharts.js +29 -0
- package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
- package/dist/pages/admin/components/AdminGroupCard.js +42 -0
- package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
- package/dist/pages/admin/components/AdminInviteActions.js +23 -0
- package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
- package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
- package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
- package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
- package/dist/pages/admin/components/ProfileRowActions.js +131 -0
- package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
- package/dist/pages/articles/Edit.d.ts +1 -0
- package/dist/pages/articles/Edit.js +60 -0
- package/dist/pages/articles/Index.d.ts +1 -0
- package/dist/pages/articles/Index.js +18 -0
- package/dist/pages/articles/New.d.ts +1 -0
- package/dist/pages/articles/New.js +48 -0
- package/dist/pages/auth/Closed.d.ts +1 -0
- package/dist/pages/auth/Closed.js +14 -0
- package/dist/pages/auth/Login.d.ts +1 -0
- package/dist/pages/auth/Login.js +74 -0
- package/dist/pages/auth/OidcCallback.d.ts +5 -0
- package/dist/pages/auth/OidcCallback.js +31 -0
- package/dist/pages/auth/OidcPending.d.ts +5 -0
- package/dist/pages/auth/OidcPending.js +39 -0
- package/dist/pages/auth/Register.d.ts +4 -0
- package/dist/pages/auth/Register.js +124 -0
- package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
- package/dist/pages/auth/RegisterInvitation.js +5 -0
- package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
- package/dist/pages/auth/RequestResetPassword.js +50 -0
- package/dist/pages/auth/ResetPassword.d.ts +1 -0
- package/dist/pages/auth/ResetPassword.js +40 -0
- package/dist/pages/auth/SsoCallback.d.ts +1 -0
- package/dist/pages/auth/SsoCallback.js +34 -0
- package/dist/pages/auth/ValidateEmail.d.ts +6 -0
- package/dist/pages/auth/ValidateEmail.js +64 -0
- package/dist/pages/conversations/Index.d.ts +1 -0
- package/dist/pages/conversations/Index.js +58 -0
- package/dist/pages/conversations/Info.d.ts +1 -0
- package/dist/pages/conversations/Info.js +26 -0
- package/dist/pages/conversations/New.d.ts +1 -0
- package/dist/pages/conversations/New.js +8 -0
- package/dist/pages/conversations/Show.d.ts +1 -0
- package/dist/pages/conversations/Show.js +100 -0
- package/dist/pages/events/Edit.d.ts +1 -0
- package/dist/pages/events/Edit.js +69 -0
- package/dist/pages/events/Index.d.ts +1 -0
- package/dist/pages/events/Index.js +23 -0
- package/dist/pages/events/My.d.ts +1 -0
- package/dist/pages/events/My.js +24 -0
- package/dist/pages/events/New.d.ts +1 -0
- package/dist/pages/events/New.js +66 -0
- package/dist/pages/feeds/Bookmarks.d.ts +1 -0
- package/dist/pages/feeds/Bookmarks.js +10 -0
- package/dist/pages/feeds/Local.d.ts +1 -0
- package/dist/pages/feeds/Local.js +14 -0
- package/dist/pages/feeds/My.d.ts +1 -0
- package/dist/pages/feeds/My.js +12 -0
- package/dist/pages/groups/Edit.d.ts +1 -0
- package/dist/pages/groups/Edit.js +57 -0
- package/dist/pages/groups/Index.d.ts +1 -0
- package/dist/pages/groups/Index.js +50 -0
- package/dist/pages/groups/Info.d.ts +1 -0
- package/dist/pages/groups/Info.js +21 -0
- package/dist/pages/groups/Members.d.ts +1 -0
- package/dist/pages/groups/Members.js +28 -0
- package/dist/pages/groups/New.d.ts +1 -0
- package/dist/pages/groups/New.js +68 -0
- package/dist/pages/groups/Show.d.ts +1 -0
- package/dist/pages/groups/Show.js +64 -0
- package/dist/pages/index.d.ts +94 -0
- package/dist/pages/index.js +94 -0
- package/dist/pages/jams/Event.d.ts +8 -0
- package/dist/pages/jams/Event.js +57 -0
- package/dist/pages/jams/Index.d.ts +6 -0
- package/dist/pages/jams/Index.js +44 -0
- package/dist/pages/payment/Success.d.ts +1 -0
- package/dist/pages/payment/Success.js +30 -0
- package/dist/pages/plugins/Index.d.ts +1 -0
- package/dist/pages/plugins/Index.js +69 -0
- package/dist/pages/profile/Followers.d.ts +6 -0
- package/dist/pages/profile/Followers.js +28 -0
- package/dist/pages/settings/AccessTokens.d.ts +1 -0
- package/dist/pages/settings/AccessTokens.js +149 -0
- package/dist/pages/settings/Account.d.ts +1 -0
- package/dist/pages/settings/Account.js +81 -0
- package/dist/pages/settings/Billing.d.ts +1 -0
- package/dist/pages/settings/Billing.js +82 -0
- package/dist/pages/settings/Index.d.ts +1 -0
- package/dist/pages/settings/Index.js +13 -0
- package/dist/pages/settings/Language.d.ts +1 -0
- package/dist/pages/settings/Language.js +54 -0
- package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
- package/dist/pages/settings/NotificationPreferences.js +180 -0
- package/dist/pages/settings/Notifications.d.ts +1 -0
- package/dist/pages/settings/Notifications.js +10 -0
- package/dist/pages/settings/PublicProfile.d.ts +1 -0
- package/dist/pages/settings/PublicProfile.js +135 -0
- package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
- package/dist/pages/settings/PushEnabledDevices.js +67 -0
- package/dist/pages/settings/Theme.d.ts +1 -0
- package/dist/pages/settings/Theme.js +37 -0
- package/dist/pages/test/Error.d.ts +1 -0
- package/dist/pages/test/Error.js +10 -0
- package/dist/pages/test/Markdown.d.ts +1 -0
- package/dist/pages/test/Markdown.js +32 -0
- package/dist/pwa/InstallPrompt.js +1 -1
- package/dist/pwa/NotificationPermissionPrompt.js +2 -2
- package/dist/pwa/UpdatePrompt.js +1 -1
- package/dist/react-native.d.ts +1 -0
- package/dist/react-native.js +1 -0
- package/dist/session/useSessionEvents.d.ts +3 -0
- package/dist/session/useSessionEvents.js +64 -0
- package/dist/stores/newPosts.d.ts +8 -8
- package/package.json +14 -9
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { matchesQuery, sortProfiles } from '@openpeepshq/common/lib';
|
|
4
|
+
import { useT, useOpenpeeps } from '../index.js';
|
|
5
|
+
import { ProfileCard, AccessDeniedLoader } from '../components/index.js';
|
|
6
|
+
import { Input } from '@openpeepshq/react-ui';
|
|
7
|
+
const SEARCH_DEBOUNCE_MS = 300;
|
|
8
|
+
const MIN_SEARCH_LENGTH = 3;
|
|
9
|
+
export function Members() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const [searchInput, setSearchInput] = useState('');
|
|
13
|
+
const [search, setSearch] = useState('');
|
|
14
|
+
const profilesQuery = openpeepsApi.useProfiles();
|
|
15
|
+
const profiles = profilesQuery.data ?? [];
|
|
16
|
+
// Mirror SearchAndFilterBar.svelte: only filter on >=3 chars, debounced.
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (searchInput.length < MIN_SEARCH_LENGTH) {
|
|
19
|
+
setSearch('');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const timeout = setTimeout(() => {
|
|
23
|
+
setSearch(searchInput);
|
|
24
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
25
|
+
return () => clearTimeout(timeout);
|
|
26
|
+
}, [searchInput]);
|
|
27
|
+
const filtered = useMemo(() => sortProfiles(profiles).filter((p) => !search || matchesQuery(p, search)), [profiles, search]);
|
|
28
|
+
return (_jsx(AccessDeniedLoader, { queries: [profilesQuery], children: _jsxs("div", { className: "p-4", children: [_jsx("form", { role: "search", onSubmit: (e) => {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
}, children: _jsx(Input, { placeholder: t('members.searchPlaceholder', {
|
|
31
|
+
defaultValue: 'Search member by name or handle',
|
|
32
|
+
}), value: searchInput, onChange: (e) => setSearchInput(e.target.value), "data-testid": "members-search-input" }) }), _jsxs("div", { className: "my-4 pb-10", children: [filtered.map((profile) => (_jsx(ProfileCard, { profile: profile }, profile.id))), filtered.length === 0 && (_jsx("div", { className: "flex w-full items-center justify-center p-4", children: _jsx("h2", { className: "text-lg", children: t('members.empty', { defaultValue: 'No profiles found' }) }) }))] }), profilesQuery.error && (_jsx("div", { className: "text-error w-full text-center text-sm", children: t('members.fetchError', {
|
|
33
|
+
defaultValue: 'Failed to fetch accounts. Please try again later.',
|
|
34
|
+
}) }))] }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NotFound(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { useT } from '../index.js';
|
|
4
|
+
export function NotFound() {
|
|
5
|
+
const t = useT();
|
|
6
|
+
return (_jsxs("div", { className: "mx-auto flex max-w-md flex-col items-center gap-3 px-6 py-16 text-center", children: [_jsx("h1", { className: "text-foreground text-3xl font-semibold", children: "404" }), _jsx("p", { className: "text-muted-foreground text-sm", children: t('common.notFound', {
|
|
7
|
+
defaultValue: "We couldn't find that page.",
|
|
8
|
+
}) }), _jsx(Link, { to: "/", className: "text-primary text-sm underline", children: t('common.backHome', { defaultValue: 'Back home' }) })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Notifications(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useT, useSetPageHeader } from '../index.js';
|
|
3
|
+
import { NotificationsList, NotificationHeaderActions } from '../components/index.js';
|
|
4
|
+
export function Notifications() {
|
|
5
|
+
const t = useT();
|
|
6
|
+
useSetPageHeader(t('navigation.notifications', { defaultValue: 'Notifications' }), _jsx(NotificationHeaderActions, {}), 'notifications-page-heading');
|
|
7
|
+
return (_jsx("div", { className: "space-y-2 p-4", children: _jsx(NotificationsList, {}) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PostDetail(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { profileName } from '@openpeepshq/common';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../index.js';
|
|
5
|
+
import { PostDetail as PostDetailComponent } from '../components/index.js';
|
|
6
|
+
export function PostDetail() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { postId = '' } = useParams();
|
|
9
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
10
|
+
// Shares the react-query cache with the detail component below, so this does
|
|
11
|
+
// not trigger an extra request.
|
|
12
|
+
const post = openpeepsApi.usePost(postId).data;
|
|
13
|
+
const author = post?.profile ? profileName(post.profile) : undefined;
|
|
14
|
+
const title = author
|
|
15
|
+
? post?.type === 'event'
|
|
16
|
+
? t('post.detail.eventTitle', {
|
|
17
|
+
defaultValue: "{{author}}'s event",
|
|
18
|
+
author,
|
|
19
|
+
})
|
|
20
|
+
: t('post.detail.title', {
|
|
21
|
+
defaultValue: "{{author}}'s post",
|
|
22
|
+
author,
|
|
23
|
+
})
|
|
24
|
+
: t('post.detail.fallbackTitle', { defaultValue: 'Post' });
|
|
25
|
+
useSetPageHeader(title);
|
|
26
|
+
return _jsx(PostDetailComponent, { postId: postId });
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Profile(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { Rss } from 'lucide-react';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../index.js';
|
|
5
|
+
import { ProfileHeader, ProfilePostsAndReplies, useCurrentProfile, AccessDeniedLoader, } from '../components/index.js';
|
|
6
|
+
import { routeHandleParam } from '../lib/routeHandles.js';
|
|
7
|
+
export function Profile() {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const { handle: handleParam = '' } = useParams();
|
|
10
|
+
const handle = routeHandleParam(handleParam);
|
|
11
|
+
const me = useCurrentProfile();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const profileQuery = openpeepsApi.useProfileByHandle(handle);
|
|
14
|
+
const profile = me?.handle === handle ? me : (profileQuery.data ?? undefined);
|
|
15
|
+
useSetPageHeader(profile?.displayName || `@${handle}`);
|
|
16
|
+
const notFound = (_jsxs("div", { className: "relative flex flex-col items-center pt-20", children: [_jsx(Rss, { size: 60 }), _jsx("p", { className: "mt-2 text-lg font-medium", "data-testid": "profile-not-found-title", children: t('profile.notFound.title', { defaultValue: 'Profile not found' }) }), _jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: t('profile.notFound.description', {
|
|
17
|
+
defaultValue: "We couldn't find a profile with that handle.",
|
|
18
|
+
}) })] }));
|
|
19
|
+
return (_jsx(AccessDeniedLoader, { queries: [profileQuery], fallbackError: notFound, children: profile ? (_jsxs("div", { children: [_jsx(ProfileHeader, { profile: profile, isCurrentProfile: me?.handle === profile.handle }), _jsx(ProfilePostsAndReplies, { profile: profile })] })) : (notFound) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Tags(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../index.js';
|
|
4
|
+
import { Feed, useDefaultVisibility, useNewNotePlusButton, } from '../components/index.js';
|
|
5
|
+
export function Tags() {
|
|
6
|
+
const t = useT();
|
|
7
|
+
const { hashtag = '' } = useParams();
|
|
8
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
9
|
+
const visibility = useDefaultVisibility();
|
|
10
|
+
useNewNotePlusButton({ visibility });
|
|
11
|
+
const query = openpeepsApi.usePostsByHashtag(hashtag);
|
|
12
|
+
useSetPageHeader(t('tags.title', { defaultValue: '#{{hashtag}}', hashtag }));
|
|
13
|
+
return _jsx(Feed, { query: query });
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Welcome(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
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 { CheckIcon, ChevronRight, MailIcon, PencilIcon, SquareUserRound, UserCheck, } from 'lucide-react';
|
|
5
|
+
import { useT, useOpenpeeps, useNewPostModal, useDefaultVisibility, } from '../index.js';
|
|
6
|
+
import { useCurrentProfile, useCurrentAccount, useServerInfo, useToast, AccessDeniedLoader, } from '../components/index.js';
|
|
7
|
+
import { Markdown } from '../lib/Markdown.js';
|
|
8
|
+
export function Welcome() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const serverInfo = useServerInfo();
|
|
12
|
+
const me = useCurrentProfile();
|
|
13
|
+
const account = useCurrentAccount();
|
|
14
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
15
|
+
const { openNewPost } = useNewPostModal();
|
|
16
|
+
const { success, error: toastError } = useToast();
|
|
17
|
+
const visibility = useDefaultVisibility();
|
|
18
|
+
const validateEmail = openpeepsApi.validationEmailAction();
|
|
19
|
+
const postsQuery = openpeepsApi.usePostsByProfile(me?.id ?? '', { limit: 1 });
|
|
20
|
+
const hasFirstPost = (postsQuery.data?.pages ?? []).flat().length > 0;
|
|
21
|
+
const [emailStatus, setEmailStatus] = useState('idle');
|
|
22
|
+
const verifyEmail = useCallback(async () => {
|
|
23
|
+
setEmailStatus('pending');
|
|
24
|
+
try {
|
|
25
|
+
await validateEmail();
|
|
26
|
+
success(t('welcome.validationEmailSent', {
|
|
27
|
+
defaultValue: 'Validation email sent',
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
toastError(t('welcome.validationEmailFailed', {
|
|
32
|
+
defaultValue: 'Failed to send validation email',
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
setEmailStatus('idle');
|
|
37
|
+
}
|
|
38
|
+
}, [validateEmail, success, toastError, t]);
|
|
39
|
+
const items = useMemo(() => [
|
|
40
|
+
{
|
|
41
|
+
Icon: MailIcon,
|
|
42
|
+
label: t('welcome.verifyEmail', {
|
|
43
|
+
defaultValue: 'Verify your email address',
|
|
44
|
+
}),
|
|
45
|
+
key: 'verify-email',
|
|
46
|
+
completed: !!account?.emailValidated,
|
|
47
|
+
action: () => {
|
|
48
|
+
void verifyEmail();
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
Icon: SquareUserRound,
|
|
53
|
+
label: t('welcome.addProfileDetails', {
|
|
54
|
+
defaultValue: 'Add profile details',
|
|
55
|
+
}),
|
|
56
|
+
key: 'profile-details',
|
|
57
|
+
completed: !!me?.avatar && !!me?.bio && !!me?.header,
|
|
58
|
+
route: '/settings/public-profile',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Icon: PencilIcon,
|
|
62
|
+
label: t('welcome.firstPost', { defaultValue: 'Make first post' }),
|
|
63
|
+
key: 'make-post',
|
|
64
|
+
completed: hasFirstPost,
|
|
65
|
+
action: () => openNewPost({ visibility }),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
Icon: UserCheck,
|
|
69
|
+
label: t('welcome.connect', { defaultValue: 'Connect with others' }),
|
|
70
|
+
key: 'connect-with-others',
|
|
71
|
+
completed: (me?.following?.length ?? 0) > 0,
|
|
72
|
+
route: '/members',
|
|
73
|
+
},
|
|
74
|
+
], [me, account, hasFirstPost, t, visibility, openNewPost, verifyEmail]);
|
|
75
|
+
const communityName = serverInfo.communityConfig?.info?.name ?? 'this community';
|
|
76
|
+
const privacyPolicyLink = serverInfo.communityConfig?.info?.privacyPolicy ?? '/docs/privacy';
|
|
77
|
+
const termsAndConditionsLink = serverInfo.communityConfig?.info?.termsAndConditions;
|
|
78
|
+
const welcomePage = serverInfo.communityConfig?.content?.welcomePage ??
|
|
79
|
+
'Welcome to this community, hosted on AllPeep.';
|
|
80
|
+
return (_jsxs("div", { className: "relative col-span-3 min-h-[90vh] rounded-md bg-left-bottom bg-no-repeat p-6 pt-4", children: [_jsx("h1", { className: "mt-8 flex pb-4 text-5xl font-bold", children: t('welcome.heading', {
|
|
81
|
+
defaultValue: 'Welcome to {{name}}',
|
|
82
|
+
name: communityName,
|
|
83
|
+
}) }), _jsx("div", { className: "text-left", children: _jsx(Markdown, { source: welcomePage }) }), _jsx("div", { className: "my-4 text-3xl font-bold", children: t('welcome.completeSetup', { defaultValue: 'Complete account setup' }) }), _jsx(AccessDeniedLoader, { queries: [postsQuery], children: items.map((item) => (_jsxs("div", { "data-testid": `welcome-checklist-${item.key}`, className: "mb-2 flex w-full cursor-pointer flex-row items-center justify-between rounded-md px-1 py-2", onClick: () => {
|
|
84
|
+
if (item.action)
|
|
85
|
+
item.action();
|
|
86
|
+
else if (item.route)
|
|
87
|
+
navigate(item.route);
|
|
88
|
+
}, children: [_jsx("div", { className: "bg-surface flex items-center justify-center rounded-full p-4", children: _jsx(item.Icon, {}) }), _jsxs("div", { className: "ml-4 flex-1 text-lg", children: [item.label, item.key === 'verify-email' && emailStatus === 'pending' ? (_jsx("span", { className: "text-muted-foreground ml-2 text-sm", children: t('common.sending', { defaultValue: 'Sending…' }) })) : null] }), item.completed ? (_jsx("div", { className: "bg-secondary flex items-center justify-center rounded-full p-2", children: _jsx(CheckIcon, { className: "text-background" }) })) : (_jsx("div", { className: "flex items-center justify-center p-2", children: _jsx(ChevronRight, { className: "text-foreground" }) }))] }, item.key))) }), _jsx("h2", { className: "mt-8 flex justify-start pb-4 text-4xl font-bold", children: t('welcome.usefulLinks', { defaultValue: 'Useful Links' }) }), _jsxs("ul", { children: [_jsx("li", { children: _jsx("a", { className: "anchor", href: "/feeds/local", children: "See community content" }) }), _jsx("li", { children: _jsx("a", { className: "anchor", href: "/settings", children: "Change your name, photo and bio" }) }), _jsx("li", { children: _jsx("a", { className: "anchor", href: "/docs", children: "View documentation" }) }), _jsx("li", { children: _jsx("a", { className: "anchor", href: "/members", children: "See all community members" }) }), _jsx("li", { children: _jsx("a", { className: "anchor", href: privacyPolicyLink, children: "Privacy policy" }) }), termsAndConditionsLink && (_jsx("li", { children: _jsx("a", { className: "anchor", href: termsAndConditionsLink, children: "Terms and conditions" }) })), _jsx("li", { children: _jsx("a", { className: "anchor", href: "/code-of-conduct", children: "Code of conduct" }) })] })] }));
|
|
89
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AnalyticsLayout as AdminAnalytics } from './analytics/AnalyticsLayout';
|
|
2
|
+
export { AnalyticsOverviewPage } from './analytics/Overview';
|
|
3
|
+
export { AnalyticsMembersPage } from './analytics/Members';
|
|
4
|
+
export { AnalyticsContentPage } from './analytics/Content';
|
|
5
|
+
export { AnalyticsEngagementPage } from './analytics/Engagement';
|
|
6
|
+
export { AnalyticsGroupsPage } from './analytics/Groups';
|
|
7
|
+
export { AnalyticsReportSettingsPage } from './analytics/ReportSettings';
|
|
8
|
+
/** @deprecated Use AnalyticsMembersPage */
|
|
9
|
+
export { AnalyticsMembersPage as AnalyticsGrowthPage } from './analytics/Members';
|
|
10
|
+
/** @deprecated Folded into AnalyticsMembersPage */
|
|
11
|
+
export { AnalyticsMembersPage as AnalyticsRetentionPage } from './analytics/Members';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AnalyticsLayout as AdminAnalytics } from './analytics/AnalyticsLayout.js';
|
|
2
|
+
export { AnalyticsOverviewPage } from './analytics/Overview.js';
|
|
3
|
+
export { AnalyticsMembersPage } from './analytics/Members.js';
|
|
4
|
+
export { AnalyticsContentPage } from './analytics/Content.js';
|
|
5
|
+
export { AnalyticsEngagementPage } from './analytics/Engagement.js';
|
|
6
|
+
export { AnalyticsGroupsPage } from './analytics/Groups.js';
|
|
7
|
+
export { AnalyticsReportSettingsPage } from './analytics/ReportSettings.js';
|
|
8
|
+
/** @deprecated Use AnalyticsMembersPage */
|
|
9
|
+
export { AnalyticsMembersPage as AnalyticsGrowthPage } from './analytics/Members.js';
|
|
10
|
+
/** @deprecated Folded into AnalyticsMembersPage */
|
|
11
|
+
export { AnalyticsMembersPage as AnalyticsRetentionPage } from './analytics/Members.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdminApiKeys: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Copy } from 'lucide-react';
|
|
4
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
5
|
+
import { Button, Input, Label, Toast } from '@openpeepshq/react-ui';
|
|
6
|
+
const SERVICE_RESOURCE_TYPES = [
|
|
7
|
+
'analytics',
|
|
8
|
+
'webhooks',
|
|
9
|
+
'posts',
|
|
10
|
+
'profiles',
|
|
11
|
+
];
|
|
12
|
+
const SCOPE_LEVELS = ['read', 'write', 'admin'];
|
|
13
|
+
const EXPIRATION_OPTIONS = [
|
|
14
|
+
{ value: '7d', labelKey: 'sevenDays' },
|
|
15
|
+
{ value: '30d', labelKey: 'thirtyDays' },
|
|
16
|
+
{ value: '90d', labelKey: 'ninetyDays' },
|
|
17
|
+
{ value: '1y', labelKey: 'oneYear' },
|
|
18
|
+
];
|
|
19
|
+
const EXPIRATION_OPTION_DEFAULTS = {
|
|
20
|
+
sevenDays: '7 days',
|
|
21
|
+
thirtyDays: '30 days',
|
|
22
|
+
ninetyDays: '90 days',
|
|
23
|
+
oneYear: '1 year',
|
|
24
|
+
};
|
|
25
|
+
const defaultForm = {
|
|
26
|
+
name: '',
|
|
27
|
+
description: '',
|
|
28
|
+
expirationTime: '30d',
|
|
29
|
+
scopes: [{ scopeLevel: 'read', resource: { type: 'profiles', id: '*' } }],
|
|
30
|
+
};
|
|
31
|
+
const scopeLabel = (scope) => `${scope.scopeLevel ?? 'read'}:${scope.resource.type}:${scope.resource.id ?? '*'}`;
|
|
32
|
+
const isExpiredToken = (token, now) => token.expiresAt != null && new Date(token.expiresAt).getTime() <= now;
|
|
33
|
+
const TokenCard = ({ token, onRevoke, expiresLabel, neverLabel, revokeLabel, revokedLabel, noScopesLabel, }) => (_jsxs("div", { className: "rounded-md border p-3", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: token.name }), token.description ? (_jsx("p", { className: "text-muted-foreground text-sm", children: token.description })) : null, _jsxs("p", { className: "text-muted-foreground mt-1 text-xs", children: [expiresLabel, ":", ' ', token.expiresAt
|
|
34
|
+
? new Date(token.expiresAt).toLocaleString()
|
|
35
|
+
: neverLabel] })] }), _jsx(Button, { variant: "outline", disabled: !!token.revokedAt, action: () => onRevoke(token.id), children: token.revokedAt ? revokedLabel : revokeLabel })] }), _jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: token.scopes?.length ? (token.scopes.map((scope, i) => (_jsx("span", { className: "rounded-full border px-2 py-1 text-xs", children: scopeLabel(scope) }, i)))) : (_jsx("span", { className: "text-xs opacity-70", children: noScopesLabel })) })] }));
|
|
36
|
+
export const AdminApiKeys = () => {
|
|
37
|
+
const t = useT();
|
|
38
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
39
|
+
const tokensQuery = openpeepsApi.admin.useServiceAccessTokens();
|
|
40
|
+
const createToken = openpeepsApi.admin.createServiceAccessTokenAction();
|
|
41
|
+
const revokeToken = openpeepsApi.admin.revokeServiceAccessTokenAction();
|
|
42
|
+
useSetPageHeader(t('admin.apiKeys.title', { defaultValue: 'Service Access Tokens' }));
|
|
43
|
+
const [form, setForm] = useState(defaultForm);
|
|
44
|
+
const [creating, setCreating] = useState(false);
|
|
45
|
+
const [createdToken, setCreatedToken] = useState();
|
|
46
|
+
const [error, setError] = useState();
|
|
47
|
+
const tokens = (tokensQuery.data ?? []);
|
|
48
|
+
const now = Date.now();
|
|
49
|
+
const activeTokens = tokens.filter((token) => !isExpiredToken(token, now));
|
|
50
|
+
const expiredTokens = tokens.filter((token) => isExpiredToken(token, now));
|
|
51
|
+
const create = async () => {
|
|
52
|
+
setError(undefined);
|
|
53
|
+
if (!form.name?.trim()) {
|
|
54
|
+
setError(t('admin.apiKeys.nameRequired', { defaultValue: 'Name is required.' }));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (!(form.scopes?.length ?? 0)) {
|
|
58
|
+
setError(t('admin.apiKeys.scopeRequired', {
|
|
59
|
+
defaultValue: 'At least one scope is required.',
|
|
60
|
+
}));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setCreating(true);
|
|
64
|
+
setCreatedToken(undefined);
|
|
65
|
+
try {
|
|
66
|
+
const created = (await createToken({
|
|
67
|
+
name: form.name.trim(),
|
|
68
|
+
description: form.description?.trim() || undefined,
|
|
69
|
+
expirationTime: form.expirationTime,
|
|
70
|
+
scopes: (form.scopes ?? []).map((scope) => ({
|
|
71
|
+
...scope,
|
|
72
|
+
resource: { ...scope.resource, id: '*' },
|
|
73
|
+
})),
|
|
74
|
+
}));
|
|
75
|
+
setCreatedToken(created.signedToken);
|
|
76
|
+
setForm(defaultForm);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
setError(t('admin.apiKeys.createError', {
|
|
80
|
+
defaultValue: 'Failed to create service token.',
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
setCreating(false);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const cardLabels = {
|
|
88
|
+
expiresLabel: t('admin.apiKeys.expiresAt', { defaultValue: 'Expires at' }),
|
|
89
|
+
neverLabel: t('admin.apiKeys.never', { defaultValue: 'Never' }),
|
|
90
|
+
revokeLabel: t('admin.apiKeys.revoke', { defaultValue: 'Revoke' }),
|
|
91
|
+
revokedLabel: t('admin.apiKeys.revoked', { defaultValue: 'Revoked' }),
|
|
92
|
+
noScopesLabel: t('admin.apiKeys.noScopes', { defaultValue: 'No scopes' }),
|
|
93
|
+
};
|
|
94
|
+
return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsxs("section", { className: "space-y-3 rounded-md border p-4", children: [_jsx("h2", { className: "text-lg font-medium", children: t('admin.apiKeys.createTitle', {
|
|
95
|
+
defaultValue: 'Create Service Access Token',
|
|
96
|
+
}) }), _jsx("p", { className: "text-sm opacity-80", children: t('admin.apiKeys.createDescription', {
|
|
97
|
+
defaultValue: 'Create a service token for integrations. Copy the token value when it is created.',
|
|
98
|
+
}) }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-name", children: t('admin.apiKeys.name', { defaultValue: 'Name' }) }), _jsx(Input, { id: "svc-name", value: form.name, onChange: (e) => setForm((f) => ({ ...f, name: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-description", children: t('admin.apiKeys.descriptionLabel', {
|
|
99
|
+
defaultValue: 'Description',
|
|
100
|
+
}) }), _jsx(Input, { id: "svc-description", value: form.description ?? '', onChange: (e) => setForm((f) => ({ ...f, description: e.target.value })) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "svc-expiration", children: t('admin.apiKeys.expiration', { defaultValue: 'Expiration' }) }), _jsx("select", { id: "svc-expiration", className: "border-input bg-background w-full rounded-md border px-2 py-2 text-sm", value: form.expirationTime ?? '30d', onChange: (e) => setForm((f) => ({ ...f, expirationTime: e.target.value })), children: EXPIRATION_OPTIONS.map((option) => (_jsx("option", { value: option.value, children: t(`admin.apiKeys.expirationOptions.${option.labelKey}`, {
|
|
101
|
+
defaultValue: EXPIRATION_OPTION_DEFAULTS[option.labelKey],
|
|
102
|
+
}) }, option.value))) })] }), _jsx("p", { className: "text-sm font-medium", children: t('admin.apiKeys.scopes', { defaultValue: 'Scopes' }) }), (form.scopes ?? []).map((scope, index) => (_jsxs("div", { className: "flex flex-wrap items-end gap-2", children: [_jsx("select", { className: "border-input bg-background rounded-md border px-2 py-2 text-sm", value: scope.scopeLevel ?? 'read', onChange: (e) => setForm((f) => ({
|
|
103
|
+
...f,
|
|
104
|
+
scopes: (f.scopes ?? []).map((s, i) => i === index
|
|
105
|
+
? { ...s, scopeLevel: e.target.value }
|
|
106
|
+
: s),
|
|
107
|
+
})), children: SCOPE_LEVELS.map((level) => (_jsx("option", { value: level, children: level }, level))) }), _jsx("select", { className: "border-input bg-background rounded-md border px-2 py-2 text-sm", value: scope.resource.type, onChange: (e) => setForm((f) => ({
|
|
108
|
+
...f,
|
|
109
|
+
scopes: (f.scopes ?? []).map((s, i) => i === index
|
|
110
|
+
? {
|
|
111
|
+
...s,
|
|
112
|
+
resource: {
|
|
113
|
+
...s.resource,
|
|
114
|
+
type: e.target.value,
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
: s),
|
|
118
|
+
})), children: SERVICE_RESOURCE_TYPES.map((type) => (_jsx("option", { value: type, children: type }, type))) }), _jsx(Button, { variant: "outline", disabled: (form.scopes?.length ?? 0) === 1, action: () => setForm((f) => ({
|
|
119
|
+
...f,
|
|
120
|
+
scopes: (f.scopes ?? []).filter((_, i) => i !== index),
|
|
121
|
+
})), children: t('admin.apiKeys.removeScope', { defaultValue: 'Remove' }) })] }, index))), _jsx(Button, { variant: "outline", action: () => setForm((f) => ({
|
|
122
|
+
...f,
|
|
123
|
+
scopes: [
|
|
124
|
+
...(f.scopes ?? []),
|
|
125
|
+
{ scopeLevel: 'read', resource: { type: 'profiles', id: '*' } },
|
|
126
|
+
],
|
|
127
|
+
})), children: t('admin.apiKeys.addScope', { defaultValue: 'Add Scope' }) }), error ? (_jsx(Toast, { variant: "error", onDismiss: () => setError(undefined), children: error })) : null, _jsx(Button, { variant: "default", disabled: creating, action: create, children: creating
|
|
128
|
+
? t('admin.apiKeys.creating', { defaultValue: 'Creating...' })
|
|
129
|
+
: t('admin.apiKeys.create', {
|
|
130
|
+
defaultValue: 'Create Service Token',
|
|
131
|
+
}) }), createdToken ? (_jsxs("div", { className: "rounded-md border p-3", children: [_jsx("p", { className: "text-sm font-semibold", children: t('admin.apiKeys.copyWarning', {
|
|
132
|
+
defaultValue: 'Copy this token now. It will not be shown again.',
|
|
133
|
+
}) }), _jsxs("div", { className: "mt-2 flex items-start gap-2", children: [_jsx("code", { className: "break-all text-sm", children: createdToken }), _jsx("button", { type: "button", title: t('admin.apiKeys.copy', { defaultValue: 'Copy' }), onClick: () => void navigator.clipboard.writeText(createdToken), children: _jsx(Copy, { className: "size-4" }) })] })] })) : null] }), _jsxs("section", { className: "space-y-3 rounded-md border p-4", children: [_jsx("h2", { className: "text-lg font-medium", children: t('admin.apiKeys.listTitle', {
|
|
134
|
+
defaultValue: 'Service Access Tokens',
|
|
135
|
+
}) }), activeTokens.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('admin.apiKeys.empty', {
|
|
136
|
+
defaultValue: 'No active service access tokens.',
|
|
137
|
+
}) })) : (activeTokens.map((token) => (_jsx(TokenCard, { token: token, onRevoke: (accessTokenId) => revokeToken({ accessTokenId }), ...cardLabels }, token.id)))), expiredTokens.length > 0 ? (_jsxs("details", { className: "rounded-md border p-3", children: [_jsx("summary", { className: "cursor-pointer text-sm font-medium", children: t('admin.apiKeys.expiredToggle', {
|
|
138
|
+
count: expiredTokens.length,
|
|
139
|
+
defaultValue: 'Expired tokens ({{count}})',
|
|
140
|
+
}) }), _jsx("div", { className: "mt-3 space-y-3", children: expiredTokens.map((token) => (_jsx(TokenCard, { token: token, onRevoke: (accessTokenId) => revokeToken({ accessTokenId }), ...cardLabels }, token.id))) })] })) : null] })] }));
|
|
141
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminBackups(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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;
|