@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,132 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { Loader2, Search } from 'lucide-react';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../index.js';
|
|
6
|
+
import { CardEvent, FeedPost, GroupCard, ProfileCard } from '../components/index.js';
|
|
7
|
+
import { Button, Input, LoadingSpinner } from '@openpeepshq/react-ui';
|
|
8
|
+
const tabFromHash = (hash) => {
|
|
9
|
+
if (hash.includes('posts'))
|
|
10
|
+
return 'posts';
|
|
11
|
+
if (hash.includes('jams'))
|
|
12
|
+
return 'jams';
|
|
13
|
+
if (hash.includes('events'))
|
|
14
|
+
return 'events';
|
|
15
|
+
if (hash.includes('groups'))
|
|
16
|
+
return 'groups';
|
|
17
|
+
return 'members';
|
|
18
|
+
};
|
|
19
|
+
export function Explore() {
|
|
20
|
+
const t = useT();
|
|
21
|
+
const [params, setParams] = useSearchParams();
|
|
22
|
+
const initialQ = params.get('q') ?? '';
|
|
23
|
+
const [searchInput, setSearchInput] = useState(initialQ);
|
|
24
|
+
const [search, setSearch] = useState(initialQ);
|
|
25
|
+
const [tab, setTab] = useState(() => tabFromHash(typeof window !== 'undefined' ? window.location.hash : ''));
|
|
26
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
27
|
+
const sentinelRef = useRef(null);
|
|
28
|
+
useSetPageHeader(t('explore.title', { defaultValue: 'Explore' }));
|
|
29
|
+
const profilesQuery = openpeepsApi.useSearchProfiles(search);
|
|
30
|
+
const postsQuery = openpeepsApi.useSearchPosts(search);
|
|
31
|
+
const jamsQuery = openpeepsApi.useSearchJams(search);
|
|
32
|
+
const eventsQuery = openpeepsApi.useSearchEvents(search);
|
|
33
|
+
const groupsQuery = openpeepsApi.useSearchGroups(search);
|
|
34
|
+
const countsQuery = openpeepsApi.useSearchCounts(search);
|
|
35
|
+
const listQuery = useMemo(() => {
|
|
36
|
+
switch (tab) {
|
|
37
|
+
case 'posts':
|
|
38
|
+
return postsQuery;
|
|
39
|
+
case 'jams':
|
|
40
|
+
return jamsQuery;
|
|
41
|
+
case 'events':
|
|
42
|
+
return eventsQuery;
|
|
43
|
+
case 'groups':
|
|
44
|
+
return groupsQuery;
|
|
45
|
+
default:
|
|
46
|
+
return profilesQuery;
|
|
47
|
+
}
|
|
48
|
+
}, [tab, postsQuery, jamsQuery, eventsQuery, groupsQuery, profilesQuery]);
|
|
49
|
+
const profileItems = useMemo(() => (profilesQuery.data?.pages ?? [])
|
|
50
|
+
.flat()
|
|
51
|
+
.map((item) => item.data), [profilesQuery.data]);
|
|
52
|
+
const postItems = useMemo(() => (postsQuery.data?.pages ?? [])
|
|
53
|
+
.flat()
|
|
54
|
+
.map((item) => item.data), [postsQuery.data]);
|
|
55
|
+
const jamItems = useMemo(() => (jamsQuery.data?.pages ?? [])
|
|
56
|
+
.flat()
|
|
57
|
+
.map((item) => item.data), [jamsQuery.data]);
|
|
58
|
+
const eventItems = useMemo(() => (eventsQuery.data?.pages ?? [])
|
|
59
|
+
.flat()
|
|
60
|
+
.map((item) => item.data), [eventsQuery.data]);
|
|
61
|
+
const groupItems = useMemo(() => (groupsQuery.data?.pages ?? [])
|
|
62
|
+
.flat()
|
|
63
|
+
.map((item) => item.data), [groupsQuery.data]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const el = sentinelRef.current;
|
|
66
|
+
if (!el)
|
|
67
|
+
return;
|
|
68
|
+
const obs = new IntersectionObserver((entries) => {
|
|
69
|
+
const entry = entries[0];
|
|
70
|
+
if (!entry)
|
|
71
|
+
return;
|
|
72
|
+
if (entry.isIntersecting &&
|
|
73
|
+
listQuery.hasNextPage &&
|
|
74
|
+
!listQuery.isFetchingNextPage) {
|
|
75
|
+
void listQuery.fetchNextPage();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
obs.observe(el);
|
|
79
|
+
return () => obs.disconnect();
|
|
80
|
+
}, [listQuery]);
|
|
81
|
+
// Mirror Svelte explore: keep the active tab in sync with the URL hash so
|
|
82
|
+
// browser back/forward navigation selects the matching tab.
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const syncTabFromHash = () => setTab(tabFromHash(window.location.hash));
|
|
85
|
+
window.addEventListener('popstate', syncTabFromHash);
|
|
86
|
+
window.addEventListener('hashchange', syncTabFromHash);
|
|
87
|
+
return () => {
|
|
88
|
+
window.removeEventListener('popstate', syncTabFromHash);
|
|
89
|
+
window.removeEventListener('hashchange', syncTabFromHash);
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
92
|
+
const triggerSearch = () => {
|
|
93
|
+
setSearch(searchInput);
|
|
94
|
+
setParams({ q: searchInput });
|
|
95
|
+
};
|
|
96
|
+
const switchTab = (next) => {
|
|
97
|
+
setTab(next);
|
|
98
|
+
window.history.replaceState(null, '', `${window.location.pathname}?q=${search}#${next}`);
|
|
99
|
+
};
|
|
100
|
+
const counts = countsQuery.data;
|
|
101
|
+
const countsLoading = countsQuery.isLoading || countsQuery.isFetching;
|
|
102
|
+
return (_jsxs("div", { className: "p-4", children: [_jsxs("form", { role: "search", className: "flex gap-x-2", onSubmit: (e) => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
triggerSearch();
|
|
105
|
+
}, children: [_jsx(Input, { placeholder: t('explore.enterSearchQuery', {
|
|
106
|
+
defaultValue: 'Search for members, posts, groups…',
|
|
107
|
+
}), value: searchInput, onChange: (e) => setSearchInput(e.target.value), "data-testid": "explore-search-input" }), _jsx(Button, { title: t('explore.SearchButton', { defaultValue: 'Search' }), variant: "default", action: triggerSearch, className: "px-8", children: _jsx(Search, {}) })] }), _jsxs("nav", { "aria-label": t('explore.tabs.label', { defaultValue: 'Result types' }), className: "border-border mt-4 flex flex-wrap border-b", children: [_jsx(TabButton, { active: tab === 'members', onClick: () => switchTab('members'), count: counts?.profiles, countLoading: countsLoading, children: t('explore.tabs.members', { defaultValue: 'Members' }) }), _jsx(TabButton, { active: tab === 'posts', onClick: () => switchTab('posts'), count: counts?.posts, countLoading: countsLoading, children: t('explore.tabs.posts', { defaultValue: 'Posts' }) }), _jsx(TabButton, { active: tab === 'jams', onClick: () => switchTab('jams'), count: counts?.jams, countLoading: countsLoading, children: t('explore.tabs.jams', { defaultValue: 'Jams' }) }), _jsx(TabButton, { active: tab === 'events', onClick: () => switchTab('events'), count: counts?.events, countLoading: countsLoading, children: t('explore.tabs.events', { defaultValue: 'Events' }) }), _jsx(TabButton, { active: tab === 'groups', onClick: () => switchTab('groups'), count: counts?.groups, countLoading: countsLoading, children: t('explore.tabs.groups', { defaultValue: 'Groups' }) })] }), _jsxs("div", { className: "mt-2", children: [search.length <= 2 ? (_jsx("p", { className: "text-muted-foreground p-6 text-sm", children: t('explore.startTyping', {
|
|
108
|
+
defaultValue: 'Type at least 3 characters to start searching.',
|
|
109
|
+
}) })) : listQuery.isLoading ? (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) })) : tab === 'jams' ? (_jsx(EventSearchResults, { posts: jamItems, emptyMessage: t('explore.noJamsFound', {
|
|
110
|
+
defaultValue: 'No jams found',
|
|
111
|
+
}) })) : tab === 'events' ? (_jsx(EventSearchResults, { posts: eventItems, emptyMessage: t('explore.noEventsFound', {
|
|
112
|
+
defaultValue: 'No events found',
|
|
113
|
+
}) })) : tab === 'groups' ? (_jsxs(_Fragment, { children: [groupItems.map((group) => (_jsx(GroupCard, { group: group }, group.id))), groupItems.length === 0 ? (_jsx(EmptyResults, { message: t('explore.noGroupsFound', {
|
|
114
|
+
defaultValue: 'No groups found',
|
|
115
|
+
}) })) : null] })) : tab === 'posts' ? (_jsxs("div", { role: "feed", children: [postItems.map((post) => (_jsx("a", { href: `/posts/${post.id}`, children: _jsx(FeedPost, { post: post }) }, post.id))), postItems.length === 0 ? (_jsx(EmptyResults, { message: t('explore.noPostsFound', {
|
|
116
|
+
defaultValue: 'No posts found',
|
|
117
|
+
}) })) : null] })) : profileItems.length === 0 ? (_jsx(EmptyResults, { message: t('explore.noProfilesFound', {
|
|
118
|
+
defaultValue: 'No profiles found',
|
|
119
|
+
}), testId: "explore-no-profiles-found" })) : (profileItems.map((profile) => (_jsx(ProfileCard, { profile: profile }, profile.id)))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), listQuery.isFetchingNextPage ? (_jsx("div", { className: "text-muted-foreground flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) })) : null] })] }));
|
|
120
|
+
}
|
|
121
|
+
function EventSearchResults({ posts, emptyMessage, }) {
|
|
122
|
+
if (posts.length === 0) {
|
|
123
|
+
return _jsx(EmptyResults, { message: emptyMessage });
|
|
124
|
+
}
|
|
125
|
+
return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2", role: "feed", children: posts.map((post) => (_jsx(CardEvent, { post: post }, post.id))) }));
|
|
126
|
+
}
|
|
127
|
+
function EmptyResults({ message, testId, }) {
|
|
128
|
+
return (_jsx("div", { className: "flex w-full items-center justify-center p-8", children: _jsx("h2", { className: "text-lg", "data-testid": testId, children: message }) }));
|
|
129
|
+
}
|
|
130
|
+
function TabButton({ active, count, countLoading = false, onClick, children, }) {
|
|
131
|
+
return (_jsxs("button", { type: "button", onClick: onClick, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: [children, countLoading ? (_jsx(Loader2, { className: "ml-1 inline-block h-3 w-3 animate-spin" })) : typeof count === 'number' ? (_jsx("span", { className: "bg-surface-2 ml-1 rounded-full px-2 py-0.5 text-xs", children: count > 99 ? '99+' : count })) : null] }));
|
|
132
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redirect to `/feeds/local` when the user is signed in or the community has
|
|
3
|
+
* public content, otherwise to `/auth/login`. Surfaces the `?toast=success`
|
|
4
|
+
* notice from the email validation flow as a transient banner.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Home(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
import { useT } from '../index.js';
|
|
6
|
+
import { useCurrentProfile, useServerInfo } from '../components/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Redirect to `/feeds/local` when the user is signed in or the community has
|
|
9
|
+
* public content, otherwise to `/auth/login`. Surfaces the `?toast=success`
|
|
10
|
+
* notice from the email validation flow as a transient banner.
|
|
11
|
+
*/
|
|
12
|
+
export function Home() {
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const [searchParams] = useSearchParams();
|
|
15
|
+
const serverInfo = useServerInfo();
|
|
16
|
+
const currentProfile = useCurrentProfile();
|
|
17
|
+
const t = useT();
|
|
18
|
+
const toastType = searchParams.get('toast');
|
|
19
|
+
const profileKey = currentProfile?.id ?? '';
|
|
20
|
+
const hasPublic = !!serverInfo.publicContent;
|
|
21
|
+
const target = useMemo(() => (profileKey || hasPublic ? '/feeds/local' : '/auth/login'), [profileKey, hasPublic]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
navigate(target, { replace: true });
|
|
24
|
+
}, [target, navigate]);
|
|
25
|
+
if (toastType === 'success') {
|
|
26
|
+
return (_jsx(Toast, { variant: "success", children: t('auth.email.validation.success', {
|
|
27
|
+
defaultValue: 'Email validated.',
|
|
28
|
+
}) }));
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Members(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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;
|