@openpeepshq/react 0.2.5 → 0.2.6
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/CapabilityMatrix.d.ts +24 -0
- package/dist/components/CapabilityMatrix.js +51 -0
- package/dist/components/RelationCapabilitiesEditor.d.ts +1 -0
- package/dist/components/RelationCapabilitiesEditor.js +138 -0
- package/dist/components/RoleCapabilityMatrix.d.ts +10 -0
- package/dist/components/RoleCapabilityMatrix.js +100 -0
- package/dist/components/accounts/SignUpLoginModal.js +7 -5
- package/dist/components/configuration/ConfigMenuButton.d.ts +3 -1
- package/dist/components/configuration/ConfigMenuButton.js +2 -2
- package/dist/components/configuration/ConfigurationList.js +7 -4
- package/dist/components/configuration/ConfigurationValueEditor.js +2 -2
- package/dist/components/conversations/ConversationParticipantsModal.d.ts +7 -0
- package/dist/components/conversations/ConversationParticipantsModal.js +10 -0
- package/dist/components/conversations/CreateNewConversation.js +9 -7
- package/dist/components/conversations/MessageInThread.js +4 -1
- package/dist/components/conversations/index.d.ts +2 -0
- package/dist/components/conversations/index.js +1 -0
- package/dist/components/form/ImageEditModal.js +4 -4
- package/dist/components/form/LocationInput.js +2 -2
- package/dist/components/form/TimeZoneSelect.d.ts +7 -0
- package/dist/components/form/TimeZoneSelect.js +7 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/groups/ChangeGroupRolesModal.js +15 -4
- package/dist/components/groups/ConfirmGroupExitModal.js +4 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +4 -2
- package/dist/components/groups/DeleteGroupModal.js +4 -2
- package/dist/components/groups/GroupAvatar.d.ts +2 -1
- package/dist/components/groups/GroupAvatar.js +9 -12
- package/dist/components/groups/GroupCapabilityMatrix.d.ts +6 -0
- package/dist/components/groups/GroupCapabilityMatrix.js +12 -0
- package/dist/components/groups/GroupCard.js +2 -2
- package/dist/components/groups/GroupFeed.js +2 -1
- package/dist/components/groups/GroupForm.d.ts +11 -1
- package/dist/components/groups/GroupForm.js +14 -67
- package/dist/components/groups/GroupMembersList.js +25 -17
- package/dist/components/groups/GroupOptionsMenu.js +13 -10
- package/dist/components/groups/index.d.ts +3 -1
- package/dist/components/groups/index.js +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +3 -0
- package/dist/components/jams/CreateNewJam.js +5 -127
- package/dist/components/jams/JamCallParticipant.d.ts +7 -1
- package/dist/components/jams/JamCallParticipant.js +28 -38
- package/dist/components/jams/JamCapacityGate.d.ts +2 -1
- package/dist/components/jams/JamCapacityGate.js +2 -2
- package/dist/components/jams/JamChatDrawer.js +12 -47
- package/dist/components/jams/JamChatMessage.d.ts +3 -2
- package/dist/components/jams/JamChatMessage.js +13 -4
- package/dist/components/jams/JamConference.js +4 -3
- package/dist/components/jams/JamContext.d.ts +8 -3
- package/dist/components/jams/JamContext.js +4 -7
- package/dist/components/jams/JamDetailsDrawer.js +11 -8
- package/dist/components/jams/JamEventsContext.d.ts +3 -1
- package/dist/components/jams/JamEventsContext.js +1 -3
- package/dist/components/jams/JamFooter.js +12 -78
- package/dist/components/jams/JamGuestForm.js +0 -1
- package/dist/components/jams/JamLobby.d.ts +2 -6
- package/dist/components/jams/JamLobby.js +11 -57
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +5 -2
- package/dist/components/jams/JamPeopleDrawer.js +5 -41
- package/dist/components/jams/JamRequestJoin.d.ts +2 -6
- package/dist/components/jams/JamRequestJoin.js +3 -21
- package/dist/components/jams/JamRoom.d.ts +2 -1
- package/dist/components/jams/JamRoom.js +13 -175
- package/dist/components/jams/JamToolbarButton.js +2 -2
- package/dist/components/jams/JamVideoCall.d.ts +3 -2
- package/dist/components/jams/JamVideoCall.js +1 -1
- package/dist/components/jams/JamVideoLayout.d.ts +2 -2
- package/dist/components/jams/JamVideoLayout.js +81 -26
- package/dist/components/jams/LeaveCloseButton.js +2 -1
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/disconnectReason.d.ts +6 -0
- package/dist/components/jams/disconnectReason.js +19 -0
- package/dist/components/jams/jamEventActions.d.ts +3 -0
- package/dist/components/jams/jamEventActions.js +10 -0
- package/dist/components/jams/jamRecordingState.d.ts +6 -0
- package/dist/components/jams/jamRecordingState.js +15 -1
- package/dist/components/jams/reactionEmojis.d.ts +1 -28
- package/dist/components/jams/reactionEmojis.js +1 -55
- package/dist/components/jams/speakerLayout.d.ts +19 -0
- package/dist/components/jams/speakerLayout.js +33 -0
- package/dist/components/jams/useJamSpotlight.d.ts +14 -0
- package/dist/components/jams/useJamSpotlight.js +72 -0
- package/dist/components/layout/Auth.js +20 -3
- package/dist/components/layout/IdentityContext.js +7 -1
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +15 -0
- package/dist/components/layout/OpenpeepsThemeProvider.js +13 -3
- package/dist/components/layout/ProfileProvider.d.ts +2 -2
- package/dist/components/layout/ProfileProvider.js +15 -32
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/layout/useProfileIdentity.d.ts +59 -0
- package/dist/components/layout/useProfileIdentity.js +38 -0
- package/dist/components/markdown/OpenpeepsMarkdown.js +2 -9
- package/dist/components/markdown/classes.d.ts +2 -2
- package/dist/components/markdown/classes.js +2 -2
- package/dist/components/markdown/staticRender.d.ts +2 -0
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +4 -1
- package/dist/components/navigation/HeaderMobile.js +6 -2
- package/dist/components/navigation/MobileMenuItem.d.ts +3 -1
- package/dist/components/navigation/MobileMenuItem.js +6 -4
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +5 -1
- package/dist/components/notifications/NotificationHeaderActions.js +3 -1
- package/dist/components/notifications/NotificationsList.js +28 -16
- package/dist/components/notifications/TypedNotification.js +50 -6
- package/dist/components/post/CompactReplyParent.d.ts +7 -0
- package/dist/components/post/CompactReplyParent.js +121 -0
- package/dist/components/post/EventViewSwitch.d.ts +1 -0
- package/dist/components/post/EventViewSwitch.js +15 -0
- package/dist/components/post/Feed.d.ts +3 -1
- package/dist/components/post/Feed.js +11 -5
- package/dist/components/post/FeedFormatSwitch.d.ts +1 -0
- package/dist/components/post/FeedFormatSwitch.js +16 -0
- package/dist/components/post/FeedPost.js +9 -19
- package/dist/components/post/FeedPostContent.js +8 -1
- package/dist/components/post/FullPostLayout.js +8 -11
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/feed/events/EventsCalendar.d.ts +7 -0
- package/dist/components/post/feed/events/EventsCalendar.js +54 -0
- package/dist/components/post/feed/events/EventsView.d.ts +10 -0
- package/dist/components/post/feed/events/EventsView.js +9 -0
- package/dist/components/post/feed/events/eventCalendar.d.ts +36 -0
- package/dist/components/post/feed/events/eventCalendar.js +145 -0
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +1 -4
- package/dist/components/post/feed/threaded/ThreadedFeed.js +5 -2
- package/dist/components/post/helpers.js +3 -1
- package/dist/components/post/index.d.ts +11 -0
- package/dist/components/post/index.js +6 -0
- package/dist/components/post/pieces/Attachments.js +19 -13
- package/dist/components/post/pieces/AudioAttachment.d.ts +13 -0
- package/dist/components/post/pieces/AudioAttachment.js +93 -0
- package/dist/components/post/pieces/EventLocation.d.ts +2 -1
- package/dist/components/post/pieces/EventLocation.js +13 -9
- package/dist/components/post/pieces/EventMenu.d.ts +2 -1
- package/dist/components/post/pieces/EventMenu.js +26 -26
- package/dist/components/post/pieces/EventOccurrenceList.d.ts +10 -0
- package/dist/components/post/pieces/EventOccurrenceList.js +49 -0
- package/dist/components/post/pieces/EventRsvpButton.d.ts +3 -1
- package/dist/components/post/pieces/EventRsvpButton.js +15 -37
- package/dist/components/post/pieces/EventRsvpList.d.ts +12 -0
- package/dist/components/post/pieces/EventRsvpList.js +108 -0
- package/dist/components/post/pieces/EventRsvpScopeDialog.d.ts +16 -0
- package/dist/components/post/pieces/EventRsvpScopeDialog.js +92 -0
- package/dist/components/post/pieces/FeedPostStats.js +5 -4
- package/dist/components/post/pieces/FeedThreadPreview.d.ts +9 -0
- package/dist/components/post/pieces/FeedThreadPreview.js +37 -0
- package/dist/components/post/pieces/GalleryModal.js +8 -5
- package/dist/components/post/pieces/PollContent.js +8 -4
- package/dist/components/post/pieces/PostActions.js +2 -2
- package/dist/components/post/pieces/PostMenu.js +17 -1
- package/dist/components/post/pieces/ShareMenu.js +11 -16
- package/dist/components/post/pieces/VideoPlayer.js +1 -1
- package/dist/components/post/pieces/modals/DeletePostModal.js +6 -2
- package/dist/components/post/pieces/modals/ReactionsModal.js +2 -3
- package/dist/components/post/post-form/ArticleForm.js +2 -14
- package/dist/components/post/post-form/AttachmentCard.js +18 -7
- package/dist/components/post/post-form/ComposeAttachments.d.ts +1 -0
- package/dist/components/post/post-form/ComposeAttachments.js +30 -7
- package/dist/components/post/post-form/DescriptionEditModal.js +2 -2
- package/dist/components/post/post-form/EditPostModal.js +9 -7
- package/dist/components/post/post-form/EventForm.d.ts +2 -1
- package/dist/components/post/post-form/EventForm.js +41 -61
- package/dist/components/post/post-form/EventTypeSwitcher.d.ts +1 -1
- package/dist/components/post/post-form/EventTypeSwitcher.js +15 -134
- package/dist/components/post/post-form/NewPostModal.js +14 -9
- package/dist/components/post/post-form/NewPostModalContext.js +6 -2
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +1 -1
- package/dist/components/post/post-form/PollComposerFields.js +7 -5
- package/dist/components/post/post-form/PostAudienceSelector.js +4 -2
- package/dist/components/post/post-form/PostTypeSwitcher.d.ts +5 -2
- package/dist/components/post/post-form/PostTypeSwitcher.js +19 -1
- package/dist/components/post/post-form/ReplyModal.js +13 -9
- package/dist/components/post/post-form/ReplyModalContext.d.ts +5 -8
- package/dist/components/post/post-form/ReplyModalContext.js +9 -12
- package/dist/components/post/post-form/audienceChoices.d.ts +4 -6
- package/dist/components/post/post-form/audienceChoices.js +12 -63
- package/dist/components/post/types/Article.js +3 -1
- package/dist/components/post/types/Event.js +13 -2
- package/dist/components/post/types/article/FullArticle.js +5 -1
- package/dist/components/post/types/event/CardEvent.d.ts +2 -1
- package/dist/components/post/types/event/CardEvent.js +16 -10
- package/dist/components/post/types/event/FullEvent.js +78 -44
- package/dist/components/preview-link/local/PostPreview.js +3 -2
- package/dist/components/profile/Avatar.d.ts +3 -3
- package/dist/components/profile/Avatar.js +15 -15
- package/dist/components/profile/FollowUnfollowButton.d.ts +2 -1
- package/dist/components/profile/FollowUnfollowButton.js +8 -15
- package/dist/components/profile/ProfileActivitySummary.d.ts +5 -0
- package/dist/components/profile/ProfileActivitySummary.js +41 -0
- package/dist/components/profile/ProfileCard.js +3 -1
- package/dist/components/profile/ProfileHeader.js +7 -1
- package/dist/components/profile/ProfilePageAction.js +46 -4
- package/dist/components/profile/ProfilePostsAndReplies.d.ts +4 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +8 -5
- package/dist/components/profile/ProfileSelector.js +2 -2
- package/dist/components/profile/ProfileWithActionCard.d.ts +3 -1
- package/dist/components/profile/ProfileWithActionCard.js +2 -2
- package/dist/components/profile/ReportProfileOrPostModal.js +7 -7
- package/dist/components/profile/index.d.ts +2 -0
- package/dist/components/profile/index.js +1 -0
- package/dist/components/profile/profileFieldDisplay.d.ts +8 -0
- package/dist/components/profile/profileFieldDisplay.js +36 -0
- package/dist/components/registry/PluginRegistryProvider.d.ts +1 -0
- package/dist/components/registry/PluginRegistryProvider.js +6 -1
- package/dist/components/registry/PluginSlot.js +1 -1
- package/dist/components/server-data/context.d.ts +18 -1
- package/dist/contexts/openpeeps/helpers.js +12 -1
- package/dist/contexts/openpeeps/hooks/accounts.js +42 -1
- package/dist/contexts/openpeeps/hooks/admin.d.ts +10065 -4
- package/dist/contexts/openpeeps/hooks/admin.js +17 -0
- package/dist/contexts/openpeeps/hooks/auth.d.ts +2 -1
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +12 -10140
- package/dist/contexts/openpeeps/hooks/conversations.js +8 -2
- package/dist/contexts/openpeeps/hooks/groups.d.ts +15 -3
- package/dist/contexts/openpeeps/hooks/jams.d.ts +7273 -606
- package/dist/contexts/openpeeps/hooks/jams.js +20 -5
- package/dist/contexts/openpeeps/hooks/other.d.ts +18 -1
- package/dist/contexts/openpeeps/hooks/posts.d.ts +64999 -11998
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +49 -7101
- package/dist/contexts/openpeeps/hooks/profiles.js +24 -4
- package/dist/contexts/openpeeps/hooks/search.d.ts +13 -9948
- package/dist/contexts/openpeeps/index.js +18 -9
- package/dist/hooks/auth/useAuthForms.d.ts +25 -0
- package/dist/hooks/auth/useAuthForms.js +101 -0
- package/dist/hooks/community/useCommunityInfoPages.d.ts +10 -0
- package/dist/hooks/community/useCommunityInfoPages.js +18 -0
- package/dist/hooks/conversations/useCreateConversation.d.ts +14 -2
- package/dist/hooks/events/useEventComposer.d.ts +10965 -0
- package/dist/hooks/events/useEventComposer.js +164 -0
- package/dist/hooks/events/useEventForm.d.ts +108 -0
- package/dist/hooks/events/useEventForm.js +154 -0
- package/dist/hooks/events/useEventMenu.d.ts +9 -0
- package/dist/hooks/events/useEventMenu.js +47 -0
- package/dist/hooks/events/useEventRsvp.d.ts +99 -0
- package/dist/hooks/events/useEventRsvp.js +111 -0
- package/dist/hooks/events/useEventTypeSwitcher.d.ts +102 -0
- package/dist/hooks/events/useEventTypeSwitcher.js +160 -0
- package/dist/hooks/events/useEventsCalendar.d.ts +19822 -0
- package/dist/hooks/events/useEventsCalendar.js +89 -0
- package/dist/hooks/groups/useEditGroup.d.ts +87 -0
- package/dist/hooks/groups/useEditGroup.js +80 -0
- package/dist/hooks/groups/useGroupTemplateSelection.d.ts +22 -0
- package/dist/hooks/groups/useGroupTemplateSelection.js +67 -0
- package/dist/hooks/groups/useNewGroup.d.ts +152 -0
- package/dist/hooks/groups/useNewGroup.js +75 -0
- package/dist/hooks/index.d.ts +58 -0
- package/dist/hooks/index.js +36 -0
- package/dist/hooks/jams/useCreateNewJamForm.d.ts +543 -0
- package/dist/hooks/jams/useCreateNewJamForm.js +140 -0
- package/dist/hooks/jams/useJamChat.d.ts +78 -0
- package/dist/hooks/jams/useJamChat.js +64 -0
- package/dist/hooks/jams/useJamDetails.d.ts +9921 -0
- package/dist/hooks/jams/useJamDetails.js +74 -0
- package/dist/hooks/jams/useJamFooterControls.d.ts +27 -0
- package/dist/hooks/jams/useJamFooterControls.js +92 -0
- package/dist/hooks/jams/useJamLobby.d.ts +105 -0
- package/dist/hooks/jams/useJamLobby.js +61 -0
- package/dist/hooks/jams/useJamParticipant.d.ts +11 -0
- package/dist/hooks/jams/useJamParticipant.js +49 -0
- package/dist/hooks/jams/useJamPeople.d.ts +79 -0
- package/dist/hooks/jams/useJamPeople.js +63 -0
- package/dist/hooks/jams/useJamRoom.d.ts +19934 -0
- package/dist/hooks/jams/useJamRoom.js +216 -0
- package/dist/hooks/jams/useJamStage.d.ts +21 -0
- package/dist/hooks/jams/useJamStage.js +48 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +2 -1
- package/dist/hooks/jams/useLeaveCloseJam.js +3 -3
- package/dist/hooks/posts/replyOpener.d.ts +9 -0
- package/dist/hooks/posts/replyOpener.js +12 -0
- package/dist/hooks/posts/useArticleComposer.d.ts +10879 -0
- package/dist/hooks/posts/useArticleComposer.js +112 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +3 -1
- package/dist/hooks/posts/useFeedPostActions.js +21 -10
- package/dist/hooks/posts/useFeedPostPresentation.d.ts +19827 -0
- package/dist/hooks/posts/useFeedPostPresentation.js +39 -0
- package/dist/hooks/posts/usePostDetailTitle.d.ts +9906 -0
- package/dist/hooks/posts/usePostDetailTitle.js +32 -0
- package/dist/hooks/posts/usePostThreads.d.ts +6 -0
- package/dist/hooks/posts/usePostThreads.js +17 -0
- package/dist/hooks/posts/useShareMenu.d.ts +14 -0
- package/dist/hooks/posts/useShareMenu.js +24 -0
- package/dist/hooks/profile/useFollowProfile.d.ts +8 -0
- package/dist/hooks/profile/useFollowProfile.js +21 -0
- package/dist/hooks/settings/useAccessTokens.d.ts +61 -0
- package/dist/hooks/settings/useAccessTokens.js +128 -0
- package/dist/hooks/settings/useFeedFormatPreference.d.ts +8 -0
- package/dist/hooks/settings/useFeedFormatPreference.js +35 -0
- package/dist/hooks/settings/useLanguagePreference.d.ts +11 -0
- package/dist/hooks/settings/useLanguagePreference.js +55 -0
- package/dist/hooks/settings/useNotificationPreferences.d.ts +26 -0
- package/dist/hooks/settings/useNotificationPreferences.js +79 -0
- package/dist/hooks/settings/usePushEnabledDevices.d.ts +111 -0
- package/dist/hooks/settings/usePushEnabledDevices.js +63 -0
- package/dist/hooks/settings/useThemePreference.d.ts +7 -0
- package/dist/hooks/settings/useThemePreference.js +27 -0
- package/dist/hooks/settings/useTimezonePreference.d.ts +14 -0
- package/dist/hooks/settings/useTimezonePreference.js +52 -0
- package/dist/hooks/useResolvedFeedFormat.d.ts +16 -0
- package/dist/hooks/useResolvedFeedFormat.js +20 -0
- package/dist/i18n/I18nProvider.js +21 -15
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/index.js +26 -0
- package/dist/lib/analyticsClicks.d.ts +1 -1
- package/dist/lib/analyticsClicks.js +4 -10
- package/dist/lib/audienceChoices.d.ts +14 -0
- package/dist/lib/audienceChoices.js +50 -0
- package/dist/lib/audienceSetting.d.ts +6 -0
- package/dist/lib/audienceSetting.js +18 -0
- package/dist/lib/capabilityMatrix.d.ts +76 -0
- package/dist/lib/capabilityMatrix.js +274 -0
- package/dist/lib/configuration/helpers.d.ts +12 -0
- package/dist/lib/configuration/helpers.js +38 -2
- package/dist/lib/groupCapabilityMatrix.d.ts +12 -0
- package/dist/lib/groupCapabilityMatrix.js +17 -0
- package/dist/lib/groupFormErrors.d.ts +15 -0
- package/dist/lib/groupFormErrors.js +61 -0
- package/dist/lib/initialsAvatar.d.ts +7 -0
- package/dist/lib/initialsAvatar.js +23 -0
- package/dist/lib/notificationBadge.d.ts +6 -2
- package/dist/lib/notificationBadge.js +17 -0
- package/dist/lib/reactionEmojis.d.ts +28 -0
- package/dist/lib/reactionEmojis.js +55 -0
- package/dist/navigation/targets.d.ts +2 -1
- package/dist/pages/About.js +4 -7
- package/dist/pages/CodeOfConduct.js +4 -5
- package/dist/pages/Explore.js +2 -2
- package/dist/pages/PostDetail.js +11 -20
- package/dist/pages/Profile.js +9 -2
- package/dist/pages/Tags.d.ts +1 -1
- package/dist/pages/Tags.js +48 -6
- package/dist/pages/Tags.test.d.ts +1 -0
- package/dist/pages/Tags.test.js +75 -0
- package/dist/pages/Welcome.js +1 -1
- package/dist/pages/admin/Analytics.d.ts +1 -0
- package/dist/pages/admin/Analytics.js +1 -0
- package/dist/pages/admin/ConfigEditor.js +4 -8
- package/dist/pages/admin/Configuration.js +18 -2
- package/dist/pages/admin/ConfigurationCommunity.js +1 -1
- package/dist/pages/admin/ConfigurationCommunityFeed.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityFeed.js +69 -0
- package/dist/pages/admin/ConfigurationCommunityTimezone.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityTimezone.js +69 -0
- package/dist/pages/admin/ConfigurationPluginPage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationPluginPage.js +21 -0
- package/dist/pages/admin/ConfigurationSso.d.ts +1 -0
- package/dist/pages/admin/ConfigurationSso.js +104 -0
- package/dist/pages/admin/ConfigurationSsoNew.d.ts +1 -0
- package/dist/pages/admin/ConfigurationSsoNew.js +44 -0
- package/dist/pages/admin/Dashboard.js +65 -20
- package/dist/pages/admin/Db.js +2 -2
- package/dist/pages/admin/GroupMembers.js +6 -39
- package/dist/pages/admin/Groups.js +4 -2
- package/dist/pages/admin/Invites.js +9 -4
- package/dist/pages/admin/MemberDetail.d.ts +1 -0
- package/dist/pages/admin/MemberDetail.js +66 -0
- package/dist/pages/admin/Members.js +39 -10
- package/dist/pages/admin/Plugins.d.ts +1 -0
- package/dist/pages/admin/Plugins.js +208 -0
- package/dist/pages/admin/Reports.js +17 -17
- package/dist/pages/admin/analytics/AnalyticsLayout.js +30 -5
- package/dist/pages/admin/analytics/Content.js +6 -6
- package/dist/pages/admin/analytics/Engagement.js +10 -10
- package/dist/pages/admin/analytics/Groups.js +5 -13
- package/dist/pages/admin/analytics/Members.js +10 -2
- package/dist/pages/admin/analytics/Overview.js +10 -10
- package/dist/pages/admin/analytics/PluginPage.d.ts +1 -0
- package/dist/pages/admin/analytics/PluginPage.js +26 -0
- package/dist/pages/admin/analytics/analyticsPluginTabs.d.ts +4 -0
- package/dist/pages/admin/analytics/analyticsPluginTabs.js +25 -0
- package/dist/pages/admin/community/CommunityRoles.js +107 -58
- package/dist/pages/admin/community/CommunityTheme.js +1 -1
- package/dist/pages/admin/community/useCommunityConfig.d.ts +6 -2
- package/dist/pages/admin/components/AdminGroupCard.js +1 -1
- package/dist/pages/admin/components/InviteWithEmailModal.js +5 -5
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +0 -1
- package/dist/pages/admin/components/InviteWithLinkModal.js +45 -14
- package/dist/pages/admin/components/ProfileRowActions.js +19 -13
- package/dist/pages/admin/components/RestoreBackupModal.js +6 -2
- package/dist/pages/admin/components/RestoreTestBackupModal.js +6 -4
- package/dist/pages/admin/components/ServerStatusSection.d.ts +5 -0
- package/dist/pages/admin/components/ServerStatusSection.js +62 -0
- package/dist/pages/admin/components/inviteQr.d.ts +8 -0
- package/dist/pages/admin/components/inviteQr.js +72 -0
- package/dist/pages/admin/components/serverStatusFormat.d.ts +3 -0
- package/dist/pages/admin/components/serverStatusFormat.js +32 -0
- package/dist/pages/admin/configurationPluginPages.d.ts +4 -0
- package/dist/pages/admin/configurationPluginPages.js +26 -0
- package/dist/pages/admin/configurationSsoShared.d.ts +307 -0
- package/dist/pages/admin/configurationSsoShared.js +192 -0
- package/dist/pages/articles/Edit.js +6 -40
- package/dist/pages/articles/Index.js +2 -1
- package/dist/pages/articles/New.js +6 -39
- package/dist/pages/auth/Closed.js +4 -2
- package/dist/pages/auth/Login.js +55 -21
- package/dist/pages/auth/Register.js +25 -9
- package/dist/pages/auth/RequestResetPassword.js +4 -4
- package/dist/pages/auth/ResetPassword.js +4 -4
- package/dist/pages/conversations/Index.js +19 -6
- package/dist/pages/conversations/Info.js +40 -3
- package/dist/pages/conversations/Show.js +29 -20
- package/dist/pages/events/Edit.js +11 -52
- package/dist/pages/events/Index.js +7 -4
- package/dist/pages/events/My.js +2 -2
- package/dist/pages/events/New.js +6 -57
- package/dist/pages/feeds/Bookmarks.js +4 -2
- package/dist/pages/feeds/Local.js +2 -1
- package/dist/pages/feeds/My.js +2 -1
- package/dist/pages/groups/Edit.js +11 -41
- package/dist/pages/groups/EditInfo.d.ts +1 -0
- package/dist/pages/groups/EditInfo.js +22 -0
- package/dist/pages/groups/EditRoles.d.ts +1 -0
- package/dist/pages/groups/EditRoles.js +29 -0
- package/dist/pages/groups/New.js +6 -58
- package/dist/pages/groups/Show.js +2 -2
- package/dist/pages/index.d.ts +13 -0
- package/dist/pages/index.js +13 -0
- package/dist/pages/jams/Event.js +3 -1
- package/dist/pages/jams/Index.js +3 -1
- package/dist/pages/payment/Success.js +2 -2
- package/dist/pages/settings/AccessTokens.js +10 -104
- package/dist/pages/settings/Account.js +43 -2
- package/dist/pages/settings/Billing.js +11 -7
- package/dist/pages/settings/Blocked.d.ts +1 -0
- package/dist/pages/settings/Blocked.js +29 -0
- package/dist/pages/settings/Feed.d.ts +1 -0
- package/dist/pages/settings/Feed.js +36 -0
- package/dist/pages/settings/Index.js +1 -1
- package/dist/pages/settings/Language.js +9 -44
- package/dist/pages/settings/NotificationPreferences.js +16 -68
- package/dist/pages/settings/PublicProfile.js +9 -0
- package/dist/pages/settings/PushEnabledDevices.js +10 -43
- package/dist/pages/settings/Theme.js +5 -21
- package/dist/pages/settings/Timezone.d.ts +1 -0
- package/dist/pages/settings/Timezone.js +19 -0
- package/dist/pwa/PwaProvider.d.ts +3 -2
- package/dist/pwa/PwaProvider.js +19 -2
- package/dist/pwa/pageReload.d.ts +12 -0
- package/dist/pwa/pageReload.js +30 -0
- package/dist/pwa/registration.js +3 -0
- package/dist/pwa/staleAppReload.d.ts +33 -0
- package/dist/pwa/staleAppReload.js +123 -0
- package/dist/pwa/useServiceWorker.d.ts +1 -1
- package/dist/pwa/useServiceWorker.js +15 -1
- package/dist/react-native.d.ts +46 -0
- package/dist/react-native.js +33 -0
- package/dist/stores/eventView.d.ts +10 -0
- package/dist/stores/eventView.js +14 -0
- package/dist/stores/feedFormat.d.ts +7 -0
- package/dist/stores/feedFormat.js +14 -0
- package/dist/stores/index.d.ts +3 -0
- package/dist/stores/index.js +2 -0
- package/dist/stores/newPosts.d.ts +78 -12
- package/package.json +10 -6
- package/dist/lib/groupCapabilityHelpers.d.ts +0 -24
- package/dist/lib/groupCapabilityHelpers.js +0 -119
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { SSO_ADD_KINDS, ssoOidcKind } from '@openpeepshq/common/lib';
|
|
4
|
+
import { useNavigate, useSetPageHeader } from '../../index.js';
|
|
5
|
+
import { Button, Label, Switch, Toast } from '@openpeepshq/react-ui';
|
|
6
|
+
import { Building2, IdCard, Puzzle } from 'lucide-react';
|
|
7
|
+
import { siAuth0, siAuthentik, siDiscord, siGithub, siGitlab, siGoogle, siKeycloak, siOkta, siOpenid, } from 'simple-icons';
|
|
8
|
+
import { fromGeneric, fromOidc, SsoProviderFields, toGeneric, toOidc, useSsoConfig, validateProviderForm, } from './configurationSsoShared.js';
|
|
9
|
+
const BrandIcon = ({ icon, className, }) => (_jsx("svg", { role: "img", viewBox: "0 0 24 24", className: className, "aria-hidden": "true", children: _jsx("path", { d: icon.path, fill: "currentColor" }) }));
|
|
10
|
+
const KIND_ICONS = {
|
|
11
|
+
gitlab: { brand: siGitlab },
|
|
12
|
+
'gitlab-selfhosted': { brand: siGitlab },
|
|
13
|
+
github: { brand: siGithub },
|
|
14
|
+
google: { brand: siGoogle },
|
|
15
|
+
entra: { lucide: Building2 },
|
|
16
|
+
discord: { brand: siDiscord },
|
|
17
|
+
auth0: { brand: siAuth0 },
|
|
18
|
+
okta: { brand: siOkta },
|
|
19
|
+
keycloak: { brand: siKeycloak },
|
|
20
|
+
authentik: { brand: siAuthentik },
|
|
21
|
+
pocketid: { lucide: IdCard },
|
|
22
|
+
oidc: { brand: siOpenid },
|
|
23
|
+
generic: { lucide: Puzzle },
|
|
24
|
+
};
|
|
25
|
+
export function AdminConfigurationSso() {
|
|
26
|
+
const navigate = useNavigate();
|
|
27
|
+
const { t, core, sso, persist, saving, status, setStatus, configQuery } = useSsoConfig();
|
|
28
|
+
useSetPageHeader(t('configuration.sso.title', { defaultValue: 'SSO' }));
|
|
29
|
+
const [editing, setEditing] = useState();
|
|
30
|
+
const [editForm, setEditForm] = useState();
|
|
31
|
+
const saveEdit = async () => {
|
|
32
|
+
if (!editing || !editForm)
|
|
33
|
+
return;
|
|
34
|
+
const error = validateProviderForm(editForm, t, editing.id, sso);
|
|
35
|
+
if (error) {
|
|
36
|
+
setStatus({ type: 'error', message: error });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (editing.bucket === 'generic') {
|
|
40
|
+
await persist({
|
|
41
|
+
generic: sso.generic.map((provider) => provider.id === editing.id ? toGeneric(editForm) : provider),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
await persist({
|
|
46
|
+
oidc: sso.oidc.map((provider) => provider.id === editing.id ? toOidc(editForm) : provider),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
setEditing(undefined);
|
|
50
|
+
setEditForm(undefined);
|
|
51
|
+
};
|
|
52
|
+
const removeProvider = async (bucket, id) => {
|
|
53
|
+
if (bucket === 'generic') {
|
|
54
|
+
await persist({
|
|
55
|
+
generic: sso.generic.filter((provider) => provider.id !== id),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
await persist({
|
|
60
|
+
oidc: sso.oidc.filter((provider) => provider.id !== id),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (editing?.id === id) {
|
|
64
|
+
setEditing(undefined);
|
|
65
|
+
setEditForm(undefined);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (configQuery.isLoading || !core) {
|
|
69
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
70
|
+
}
|
|
71
|
+
const listed = [
|
|
72
|
+
...sso.oidc.map((provider) => ({
|
|
73
|
+
bucket: 'oidc',
|
|
74
|
+
id: provider.id,
|
|
75
|
+
name: provider.name,
|
|
76
|
+
kind: ssoOidcKind(provider),
|
|
77
|
+
})),
|
|
78
|
+
...sso.generic.map((provider) => ({
|
|
79
|
+
bucket: 'generic',
|
|
80
|
+
id: provider.id,
|
|
81
|
+
name: provider.name,
|
|
82
|
+
kind: 'generic',
|
|
83
|
+
})),
|
|
84
|
+
];
|
|
85
|
+
return (_jsxs("div", { className: "space-y-8 p-4", children: [_jsx("p", { className: "text-sm opacity-80", children: t('configuration.sso.intro') }), _jsx(Label, { title: t('configuration.sso.onlySSO'), description: t('configuration.sso.onlySSODescription'), forCheckbox: true, children: _jsx(Switch, { checked: !!sso.onlySSO, onCheckedChange: (onlySSO) => void persist({ onlySSO }), "data-testid": "admin-sso-only" }) }), _jsxs("section", { className: "space-y-3", children: [_jsx("h3", { className: "text-base font-semibold", children: t('configuration.sso.providers') }), listed.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-sm", children: t('configuration.sso.empty') })) : (listed.map((item) => {
|
|
86
|
+
const isEditing = editing?.bucket === item.bucket && editing.id === item.id;
|
|
87
|
+
return (_jsxs("div", { className: "bg-surface-2 space-y-3 rounded-lg p-4", "data-testid": `admin-sso-provider-${item.id}`, children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("div", { children: [_jsx("p", { className: "font-medium", children: item.name }), _jsxs("p", { className: "text-muted-foreground text-xs", children: [t(`configuration.sso.kind.${item.kind}`), " \u00B7 ", item.id] })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "outline", size: "sm", title: t('configuration.sso.editProvider'), action: () => {
|
|
88
|
+
if (isEditing) {
|
|
89
|
+
setEditing(undefined);
|
|
90
|
+
setEditForm(undefined);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
setEditing({ bucket: item.bucket, id: item.id });
|
|
94
|
+
setEditForm(item.bucket === 'generic'
|
|
95
|
+
? fromGeneric(sso.generic.find((provider) => provider.id === item.id))
|
|
96
|
+
: fromOidc(sso.oidc.find((provider) => provider.id === item.id)));
|
|
97
|
+
}, children: isEditing
|
|
98
|
+
? t('configuration.sso.cancelEdit')
|
|
99
|
+
: t('configuration.sso.editProvider') }), _jsx(Button, { variant: "outline", size: "sm", title: t('configuration.sso.removeProvider'), action: () => void removeProvider(item.bucket, item.id), children: t('configuration.sso.removeProvider') })] })] }), isEditing && editForm ? (_jsx(SsoProviderFields, { form: editForm, onChange: setEditForm, lockId: true, host: core.server.host })) : null, isEditing ? (_jsx("div", { className: "flex justify-end", children: _jsx(Button, { title: t('configuration.sso.saveProvider'), action: () => void saveEdit(), disabled: saving, loading: saving, children: t('configuration.sso.saveProvider') }) })) : null] }, `${item.bucket}:${item.id}`));
|
|
100
|
+
}))] }), _jsxs("section", { className: "space-y-4", children: [_jsx("h3", { className: "text-base font-semibold", children: t('configuration.sso.addTitle') }), _jsx("p", { className: "text-muted-foreground text-sm", children: t('configuration.sso.addChooseType') }), _jsx("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4", "data-testid": "admin-sso-type-grid", children: SSO_ADD_KINDS.map((kind) => {
|
|
101
|
+
const icon = KIND_ICONS[kind];
|
|
102
|
+
return (_jsxs("button", { type: "button", "data-testid": `admin-sso-type-${kind}`, onClick: () => navigate(`/admin/configuration/sso/new/${kind}`), className: "hover:bg-surface border-border flex flex-col items-center gap-2 rounded-lg border px-3 py-4 text-center", children: ['brand' in icon ? (_jsx(BrandIcon, { icon: icon.brand, className: "size-8" })) : (_jsx(icon.lucide, { className: "size-8", "aria-hidden": "true" })), _jsx("span", { className: "text-sm font-medium", children: t(`configuration.sso.types.${kind}.title`) })] }, kind));
|
|
103
|
+
}) })] }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-sso-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationSsoNew(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Navigate, useParams } from 'react-router-dom';
|
|
4
|
+
import { isSsoAddKind } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useNavigate, useSetPageHeader } from '../../index.js';
|
|
6
|
+
import { Button, Toast } from '@openpeepshq/react-ui';
|
|
7
|
+
import { emptyForm, SsoProviderFields, toGeneric, toOidc, usedProviderIds, useSsoConfig, validateProviderForm, } from './configurationSsoShared.js';
|
|
8
|
+
export function AdminConfigurationSsoNew() {
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const { kind: kindParam = '' } = useParams();
|
|
11
|
+
const { t, core, sso, persist, saving, status, setStatus, configQuery } = useSsoConfig();
|
|
12
|
+
const kind = isSsoAddKind(kindParam) ? kindParam : undefined;
|
|
13
|
+
const [form, setForm] = useState();
|
|
14
|
+
useSetPageHeader(t('configuration.sso.addPageTitle', {
|
|
15
|
+
name: kind
|
|
16
|
+
? t(`configuration.sso.types.${kind}.title`)
|
|
17
|
+
: t('configuration.sso.addTitle'),
|
|
18
|
+
}));
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!kind || !core || form)
|
|
21
|
+
return;
|
|
22
|
+
setForm(emptyForm(kind, usedProviderIds(sso)));
|
|
23
|
+
}, [kind, core, sso, form]);
|
|
24
|
+
if (!kind) {
|
|
25
|
+
return _jsx(Navigate, { to: "/admin/configuration/sso", replace: true });
|
|
26
|
+
}
|
|
27
|
+
if (configQuery.isLoading || !core || !form) {
|
|
28
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
29
|
+
}
|
|
30
|
+
const saveAdd = async () => {
|
|
31
|
+
const error = validateProviderForm(form, t, undefined, sso);
|
|
32
|
+
if (error) {
|
|
33
|
+
setStatus({ type: 'error', message: error });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const ok = form.kind === 'generic'
|
|
37
|
+
? await persist({ generic: [...sso.generic, toGeneric(form)] })
|
|
38
|
+
: await persist({ oidc: [...sso.oidc, toOidc(form)] });
|
|
39
|
+
if (ok) {
|
|
40
|
+
navigate('/admin/configuration/sso');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsx("button", { type: "button", className: "text-muted-foreground text-sm underline", "data-testid": "admin-sso-back", onClick: () => navigate('/admin/configuration/sso'), children: t('configuration.sso.backToList') }), _jsx(SsoProviderFields, { form: form, onChange: setForm, lockId: false, host: core.server.host }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { title: t('configuration.sso.saveProvider'), action: () => void saveAdd(), disabled: saving, loading: saving, "data-testid": "admin-sso-save", children: t('configuration.sso.saveProvider') }) }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-sso-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
44
|
+
}
|
|
@@ -1,40 +1,85 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { AnalyticsLineChart, LoadingSpinner, MetricCard, } from '@openpeepshq/react-ui';
|
|
3
3
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
4
4
|
import { useServerInfo } from '../../components/index.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { AnalyticsSection } from './analytics/AnalyticsLayout.js';
|
|
6
|
+
import { ServerStatusSection } from './components/ServerStatusSection.js';
|
|
7
|
+
const WEEK = { preset: '7d' };
|
|
8
|
+
const deltaPct = (value, previous) => {
|
|
9
|
+
if (previous === 0)
|
|
10
|
+
return value === 0 ? null : 100;
|
|
11
|
+
return ((value - previous) / previous) * 100;
|
|
12
|
+
};
|
|
13
|
+
const sumMetrics = (metrics) => {
|
|
14
|
+
const value = metrics.reduce((sum, metric) => sum + metric.value, 0);
|
|
15
|
+
const previous = metrics.reduce((sum, metric) => sum + metric.previousValue, 0);
|
|
16
|
+
return { value, deltaPct: deltaPct(value, previous) };
|
|
17
|
+
};
|
|
10
18
|
export function AdminDashboard() {
|
|
11
19
|
const t = useT();
|
|
12
20
|
const { openpeepsApi } = useOpenpeeps();
|
|
13
21
|
const serverInfo = useServerInfo();
|
|
22
|
+
const overview = openpeepsApi.admin.useAnalyticsOverview(WEEK);
|
|
23
|
+
const growth = openpeepsApi.admin.useAnalyticsGrowth(WEEK);
|
|
24
|
+
const engagement = openpeepsApi.admin.useAnalyticsEngagement(WEEK);
|
|
14
25
|
const statsQuery = openpeepsApi.admin.useGeneralStats();
|
|
15
26
|
useSetPageHeader(t('admin.dashboard.title', { defaultValue: 'Administration' }));
|
|
16
|
-
|
|
27
|
+
const info = (key, defaultValue) => t(`admin.analytics.info.${key}`, { defaultValue });
|
|
28
|
+
const overviewInfo = (key, defaultValue) => t(`admin.overview.info.${key}`, { defaultValue });
|
|
29
|
+
if (overview.isLoading ||
|
|
30
|
+
growth.isLoading ||
|
|
31
|
+
engagement.isLoading ||
|
|
32
|
+
statsQuery.isLoading) {
|
|
17
33
|
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
18
34
|
}
|
|
35
|
+
const overviewData = overview.data;
|
|
36
|
+
const growthData = growth.data;
|
|
37
|
+
const engagementData = engagement.data;
|
|
19
38
|
const stats = statsQuery.data;
|
|
20
|
-
if (!stats) {
|
|
21
|
-
return (_jsx("div", { className: "text-muted-foreground p-4 text-sm", children:
|
|
39
|
+
if (!overviewData || !growthData || !engagementData || !stats) {
|
|
40
|
+
return (_jsx("div", { className: "text-muted-foreground p-4 text-sm", children: t('admin.overview.noStats', { defaultValue: 'No stats available' }) }));
|
|
22
41
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
const interactions = sumMetrics([
|
|
43
|
+
engagementData.metrics.likes,
|
|
44
|
+
engagementData.metrics.comments,
|
|
45
|
+
engagementData.metrics.reposts,
|
|
46
|
+
engagementData.metrics.bookmarks,
|
|
47
|
+
]);
|
|
48
|
+
const thisPeriod = t('admin.analytics.period.thisPeriod', {
|
|
49
|
+
defaultValue: 'This period',
|
|
50
|
+
});
|
|
51
|
+
const lastWeek = t('admin.overview.lastWeek', { defaultValue: 'Last Week' });
|
|
52
|
+
const signups = growthData.signupsByDay.map((point) => ({
|
|
53
|
+
label: point.day.slice(5),
|
|
54
|
+
value: point.value,
|
|
55
|
+
}));
|
|
56
|
+
return (_jsxs("div", { className: "space-y-6 p-4", children: [_jsx(ServerStatusSection, { status: serverInfo, host: stats.host }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.communityOverview', {
|
|
28
57
|
defaultValue: 'Community overview',
|
|
29
|
-
}) }), _jsxs("div", { className: "grid gap-
|
|
58
|
+
}) }), _jsxs("div", { className: "grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [_jsx(MetricCard, { label: t('admin.overview.totalProfiles', {
|
|
30
59
|
defaultValue: 'Total Profiles',
|
|
31
|
-
}),
|
|
60
|
+
}), value: overviewData.metrics.totalMembers.value, deltaPct: overviewData.metrics.totalMembers.deltaPct, subtitle: t('admin.analytics.period.allTime', {
|
|
61
|
+
defaultValue: 'All-time',
|
|
62
|
+
}), info: info('totalMembers', 'Count of non-deleted member profiles created on or before the end of the selected range (all-time cumulative).') }), _jsx(MetricCard, { label: t('admin.overview.activeProfiles', {
|
|
32
63
|
defaultValue: 'Active Profiles',
|
|
33
|
-
}),
|
|
64
|
+
}), value: overviewData.metrics.activeMembers.value, deltaPct: overviewData.metrics.activeMembers.deltaPct, subtitle: lastWeek, info: info('activeMembers', 'Distinct members who posted, liked, replied, reposted, or bookmarked at least once in the selected range. A member active on multiple days is counted once.') }), _jsx(MetricCard, { label: t('admin.overview.recentInteractions', {
|
|
34
65
|
defaultValue: 'Recent Interactions',
|
|
35
|
-
}),
|
|
66
|
+
}), value: interactions.value, deltaPct: interactions.deltaPct, subtitle: lastWeek, info: overviewInfo('recentInteractions', 'Likes, replies, reposts, and bookmarks recorded in the last seven days.') }), _jsx(MetricCard, { label: t('admin.overview.allPosts', { defaultValue: 'All Posts' }), value: overviewData.metrics.allTimePosts.value, deltaPct: overviewData.metrics.allTimePosts.deltaPct, subtitle: t('admin.analytics.period.allTime', {
|
|
67
|
+
defaultValue: 'All-time',
|
|
68
|
+
}), info: info('totalPostsAllTime', 'All non-deleted, non-direct posts created on or before the end of the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.jamSessions', {
|
|
36
69
|
defaultValue: 'Jam Sessions',
|
|
37
|
-
}),
|
|
70
|
+
}), value: stats.jams.sessions.all, deltaPct: deltaPct(stats.jams.sessions.all, stats.jams.sessions.week.lastPeriod), subtitle: lastWeek, info: overviewInfo('jamSessions', 'All-time jam sessions. Delta compares to jam sessions in the previous week.') }), _jsx(MetricCard, { label: t('admin.overview.jamParticipants', {
|
|
38
71
|
defaultValue: 'Jam Participants',
|
|
39
|
-
}),
|
|
72
|
+
}), value: stats.jams.participants.week.currentPeriod, deltaPct: deltaPct(stats.jams.participants.week.currentPeriod, stats.jams.participants.week.lastPeriod), subtitle: lastWeek, info: overviewInfo('jamParticipants', 'Distinct jam participants in the last seven days.') })] })] }), _jsx(AnalyticsSection, { title: t('admin.overview.newSignups', { defaultValue: 'New signups' }), info: info('signupsByDay', 'New member profiles created on each calendar day in the selected range.'), children: _jsx(AnalyticsLineChart, { data: signups, height: 220 }) }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.profilesSection', { defaultValue: 'Profiles' }) }), _jsxs("div", { className: "grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(MetricCard, { label: t('admin.overview.totalProfiles', {
|
|
73
|
+
defaultValue: 'Total Profiles',
|
|
74
|
+
}), value: overviewData.metrics.totalMembers.value, info: info('totalMembers', 'Count of non-deleted member profiles created on or before the end of the selected range (all-time cumulative).') }), _jsx(MetricCard, { label: t('admin.analytics.metrics.mau', { defaultValue: 'MAU' }), value: growthData.metrics.mau.value, deltaPct: growthData.metrics.mau.deltaPct, subtitle: t('admin.analytics.period.rolling30d', {
|
|
75
|
+
defaultValue: 'Rolling 30 days',
|
|
76
|
+
}), info: info('mau', 'Distinct members who posted, liked, replied, reposted, or bookmarked in the 30 days ending at the range end.') }), _jsx(MetricCard, { label: t('admin.overview.activeWeek', {
|
|
77
|
+
defaultValue: 'Active (week)',
|
|
78
|
+
}), value: overviewData.metrics.activeMembers.value, deltaPct: overviewData.metrics.activeMembers.deltaPct, subtitle: thisPeriod, info: info('activeMembers', 'Distinct members who posted, liked, replied, reposted, or bookmarked at least once in the selected range. A member active on multiple days is counted once.') }), _jsx(MetricCard, { label: t('admin.analytics.metrics.dau', { defaultValue: 'DAU' }), value: growthData.metrics.dau.value, deltaPct: growthData.metrics.dau.deltaPct, subtitle: thisPeriod, info: info('dau', 'Average daily active members in the selected range. Active means posted, liked, replied, reposted, or bookmarked that day.') })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.postsSection', { defaultValue: 'Posts' }) }), _jsxs("div", { className: "grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(MetricCard, { label: t('admin.overview.allPosts', { defaultValue: 'All Posts' }), value: overviewData.metrics.allTimePosts.value, info: info('totalPostsAllTime', 'All non-deleted, non-direct posts created on or before the end of the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.replies', { defaultValue: 'Replies' }), value: engagementData.metrics.comments.value, deltaPct: engagementData.metrics.comments.deltaPct, subtitle: thisPeriod, info: info('comments', 'Replies recorded during the selected range.') }), _jsx(MetricCard, { label: t('admin.overview.postsThisPeriod', {
|
|
79
|
+
defaultValue: 'This week',
|
|
80
|
+
}), value: overviewData.metrics.totalPosts.value, deltaPct: overviewData.metrics.totalPosts.deltaPct, subtitle: thisPeriod, info: info('totalPostsPeriod', 'Posts created during the selected range (excluding direct messages). Delta compares to the previous period.') }), _jsx(MetricCard, { label: t('admin.overview.recentInteractions', {
|
|
81
|
+
defaultValue: 'Recent Interactions',
|
|
82
|
+
}), value: interactions.value, deltaPct: interactions.deltaPct, subtitle: thisPeriod, info: overviewInfo('recentInteractions', 'Likes, replies, reposts, and bookmarks recorded in the last seven days.') })] })] }), _jsxs("section", { children: [_jsx("h2", { className: "mb-3 text-lg font-medium", children: t('admin.overview.jamsSection', { defaultValue: 'Jams' }) }), _jsxs("div", { className: "grid min-w-0 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [_jsx(MetricCard, { label: t('admin.overview.sessions', { defaultValue: 'Sessions' }), value: stats.jams.sessions.all, info: overviewInfo('jamSessions', 'All-time jam sessions.') }), _jsx(MetricCard, { label: t('admin.overview.participants', {
|
|
83
|
+
defaultValue: 'Participants',
|
|
84
|
+
}), value: stats.jams.participants.all, info: overviewInfo('jamParticipantsAll', 'All-time jam participants.') })] })] })] }));
|
|
40
85
|
}
|
package/dist/pages/admin/Db.js
CHANGED
|
@@ -186,7 +186,7 @@ export function AdminDb() {
|
|
|
186
186
|
setOffset(0);
|
|
187
187
|
})] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto rounded border", children: rowsQuery.isLoading ? (_jsx("p", { className: "p-3 text-sm", children: t('admin.database.loading', {
|
|
188
188
|
defaultValue: 'Loading…',
|
|
189
|
-
}) })) : rowsQuery.isError ? (_jsx("p", { className: "p-3 text-sm
|
|
189
|
+
}) })) : rowsQuery.isError ? (_jsx("p", { className: "text-error p-3 text-sm", children: t('admin.database.loadError', {
|
|
190
190
|
defaultValue: 'Failed to load rows.',
|
|
191
191
|
}) })) : (_jsxs("table", { className: "w-full border-collapse text-left text-xs", children: [_jsx("thead", { className: "bg-surface sticky top-0", children: _jsx("tr", { children: columns.map((col) => (_jsxs("th", { className: "whitespace-nowrap border-b px-2 py-1 font-medium", children: [col.name, _jsx("span", { className: "text-muted-foreground ml-1 font-normal", children: col.dataType })] }, col.name))) }) }), _jsx("tbody", { children: rows.map((row, rowIndex) => {
|
|
192
192
|
const pk = {};
|
|
@@ -218,7 +218,7 @@ export function AdminDb() {
|
|
|
218
218
|
defaultValue: 'Download CSV',
|
|
219
219
|
}), variant: "outline", action: downloadSqlCsv, disabled: !sqlResult?.columns.length, children: t('admin.database.downloadCsv', {
|
|
220
220
|
defaultValue: 'Download CSV',
|
|
221
|
-
}) }), pageSizeSelect(sqlPageSize, setSqlPageSize)] }), sqlError ? (_jsx("pre", { className: "overflow-auto rounded border
|
|
221
|
+
}) }), pageSizeSelect(sqlPageSize, setSqlPageSize)] }), sqlError ? (_jsx("pre", { className: "border-error/30 bg-error/10 text-error overflow-auto rounded border p-2 text-xs", children: sqlError })) : null, sqlResult ? (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-1", children: [_jsx("p", { className: "text-sm", children: sqlResult.rows.length < sqlResult.rowCount
|
|
222
222
|
? t('admin.database.sqlMetaTruncated', {
|
|
223
223
|
defaultValue: '{{command}} — showing {{shown}} of {{count}} row(s)',
|
|
224
224
|
command: sqlResult.command,
|
|
@@ -3,10 +3,9 @@ import { useState } from 'react';
|
|
|
3
3
|
import { useParams } from 'react-router-dom';
|
|
4
4
|
import { MessageSquareText, MoreVertical, PencilIcon, Trash2, } from 'lucide-react';
|
|
5
5
|
import { groupName, truncateText } from '@openpeepshq/common/lib';
|
|
6
|
-
import { defaultGroupRoles } from '@openpeepshq/common/types';
|
|
7
6
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
8
|
-
import { Avatar, useCreateNewConversation, useCurrentProfile, } from '../../components/index.js';
|
|
9
|
-
import {
|
|
7
|
+
import { Avatar, ChangeGroupRolesModal, useCreateNewConversation, useCurrentProfile, } from '../../components/index.js';
|
|
8
|
+
import { Dialog, DialogActions, DialogContent, DialogHeader, DialogTitle, LoadingSpinner, PopupMenu, PopupMenuButton, } from '@openpeepshq/react-ui';
|
|
10
9
|
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
11
10
|
export function AdminGroupMembers() {
|
|
12
11
|
const t = useT();
|
|
@@ -46,41 +45,7 @@ function MemberRowActions({ group, member, }) {
|
|
|
46
45
|
defaultValue: 'Change Roles',
|
|
47
46
|
}), text: t('groups.changeRoles.title', { defaultValue: 'Change Roles' }), action: () => setActiveModal('roles') }), _jsx(PopupMenuButton, { icon: Trash2, title: t('groups.removeMember.title', {
|
|
48
47
|
defaultValue: 'Remove Member',
|
|
49
|
-
}), text: t('groups.removeMember.confirm', { defaultValue: 'Remove' }), action: () => setActiveModal('remove'), danger: true })] }), activeModal === 'roles' ? (_jsx(
|
|
50
|
-
}
|
|
51
|
-
function ChangeRolesModal({ group, member, onClose, }) {
|
|
52
|
-
const t = useT();
|
|
53
|
-
const { openpeepsApi } = useOpenpeeps();
|
|
54
|
-
const setMemberRoles = openpeepsApi.setGroupMemberRolesAction();
|
|
55
|
-
const [selected, setSelected] = useState(() => new Set((member.roles ?? [])));
|
|
56
|
-
const [submitting, setSubmitting] = useState(false);
|
|
57
|
-
const [error, setError] = useState(null);
|
|
58
|
-
const toggle = (role, checked) => setSelected((prev) => {
|
|
59
|
-
const next = new Set(prev);
|
|
60
|
-
if (checked)
|
|
61
|
-
next.add(role);
|
|
62
|
-
else
|
|
63
|
-
next.delete(role);
|
|
64
|
-
return next;
|
|
65
|
-
});
|
|
66
|
-
const submit = async () => {
|
|
67
|
-
setError(null);
|
|
68
|
-
setSubmitting(true);
|
|
69
|
-
try {
|
|
70
|
-
await setMemberRoles({ roles: Array.from(selected) }, { id: group.id, memberId: member.profile.id });
|
|
71
|
-
onClose();
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
setError(err.message);
|
|
75
|
-
}
|
|
76
|
-
finally {
|
|
77
|
-
setSubmitting(false);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('groups.changeRoles.title', { defaultValue: 'Change Roles' }) }) }), _jsx("p", { className: "px-1 text-sm", children: t('groups.changeRoles.description', {
|
|
81
|
-
defaultValue: 'Change roles for this group',
|
|
82
|
-
handle: member.profile.handle,
|
|
83
|
-
}) }), _jsx("div", { className: "space-y-3 px-1", children: defaultGroupRoles.map((role) => (_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsx(Label, { htmlFor: `group-role-${role}`, classes: "text-base", children: t(`groups.roles.${role}`, { defaultValue: role }) }), _jsx("input", { id: `group-role-${role}`, type: "checkbox", className: "size-4", checked: selected.has(role), onChange: (e) => toggle(role, e.target.checked) })] }, role))) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", action: onClose, children: t('common.cancel', { defaultValue: 'Cancel' }) }), _jsx(Button, { variant: "default", action: submit, disabled: submitting, children: t('groups.changeRoles.confirm', { defaultValue: 'Update Roles' }) })] })] }) }));
|
|
48
|
+
}), text: t('groups.removeMember.confirm', { defaultValue: 'Remove' }), action: () => setActiveModal('remove'), danger: true })] }), activeModal === 'roles' ? (_jsx(ChangeGroupRolesModal, { group: group, member: member, onClose: () => setActiveModal(null) })) : null, activeModal === 'remove' ? (_jsx(RemoveMemberModal, { group: group, member: member, onClose: () => setActiveModal(null) })) : null] }));
|
|
84
49
|
}
|
|
85
50
|
function RemoveMemberModal({ group, member, onClose, }) {
|
|
86
51
|
const t = useT();
|
|
@@ -105,5 +70,7 @@ function RemoveMemberModal({ group, member, onClose, }) {
|
|
|
105
70
|
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('groups.removeMember.title', { defaultValue: 'Remove Member' }) }) }), _jsx("p", { className: "px-1 text-sm", children: t('groups.removeMember.description', {
|
|
106
71
|
defaultValue: 'Are you sure you want to remove @{{handle}} from group?',
|
|
107
72
|
handle: member.profile.handle,
|
|
108
|
-
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null,
|
|
73
|
+
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('groups.removeMember.confirm', {
|
|
74
|
+
defaultValue: 'Remove',
|
|
75
|
+
}), onAction: submit, actionVariant: "destructive", disabled: submitting })] }) }));
|
|
109
76
|
}
|
|
@@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom';
|
|
|
4
4
|
import { Users } from 'lucide-react';
|
|
5
5
|
import { groupName } from '@openpeepshq/common/lib';
|
|
6
6
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
7
|
-
import { Button, Dialog,
|
|
7
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogHeader, DialogTitle, Input, } from '@openpeepshq/react-ui';
|
|
8
8
|
import { AdminGroupCard } from './components/AdminGroupCard.js';
|
|
9
9
|
export function AdminGroups() {
|
|
10
10
|
const t = useT();
|
|
@@ -57,5 +57,7 @@ function DeleteGroupModal({ group, onClose, }) {
|
|
|
57
57
|
return (_jsx(Dialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(DialogContent, { className: "max-w-sm", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('admin.groups.deleteTitle', { defaultValue: 'Delete group' }) }) }), _jsx("p", { className: "px-1 text-sm", children: t('admin.groups.deleteDescription', {
|
|
58
58
|
defaultValue: 'Are you sure you want to delete this group? This action cannot be undone.',
|
|
59
59
|
name: groupName(group),
|
|
60
|
-
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null,
|
|
60
|
+
}) }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(DialogActions, { cancelLabel: t('common.cancel', { defaultValue: 'Cancel' }), onCancel: onClose, actionLabel: t('admin.groups.delete', {
|
|
61
|
+
defaultValue: 'Delete group',
|
|
62
|
+
}), onAction: submit, actionVariant: "destructive", disabled: submitting })] }) }));
|
|
61
63
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
|
-
import { CheckCheck, Copy, MoreVertical, Users, X } from 'lucide-react';
|
|
3
|
+
import { CheckCheck, Copy, MoreVertical, QrCode, Users, X } from 'lucide-react';
|
|
4
4
|
import { inviteLinkMatchesQuery } from '@openpeepshq/common/lib';
|
|
5
|
-
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
5
|
+
import { useT, useOpenpeeps, useServerInfo, useSetPageHeader, } from '../../index.js';
|
|
6
6
|
import { Avatar } from '../../components/index.js';
|
|
7
7
|
import { UpdatingDate } from '@openpeepshq/react-ui';
|
|
8
8
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, Input, PopupMenu, PopupMenuButton, } from '@openpeepshq/react-ui';
|
|
9
9
|
import { AdminInviteActions } from './components/AdminInviteActions.js';
|
|
10
|
-
import { inviteUrl } from './components/
|
|
10
|
+
import { communityQrLogoSrc, downloadInviteQr, inviteUrl, } from './components/inviteQr.js';
|
|
11
11
|
export function AdminInvites() {
|
|
12
12
|
const t = useT();
|
|
13
13
|
const { openpeepsApi } = useOpenpeeps();
|
|
@@ -45,6 +45,7 @@ export function AdminInvites() {
|
|
|
45
45
|
function InvitesTablePopup({ invite }) {
|
|
46
46
|
const t = useT();
|
|
47
47
|
const { openpeepsApi } = useOpenpeeps();
|
|
48
|
+
const logoSrc = communityQrLogoSrc(useServerInfo().communityConfig);
|
|
48
49
|
const activate = openpeepsApi.admin.activateInviteAction();
|
|
49
50
|
const deactivate = openpeepsApi.admin.deactivateInviteAction();
|
|
50
51
|
const [showInvited, setShowInvited] = useState(false);
|
|
@@ -56,7 +57,11 @@ function InvitesTablePopup({ invite }) {
|
|
|
56
57
|
defaultValue: 'See invited accounts',
|
|
57
58
|
}), action: () => setShowInvited(true) }), active ? (_jsxs(_Fragment, { children: [_jsx(PopupMenuButton, { icon: Copy, title: t('admin.invites.copyLink', {
|
|
58
59
|
defaultValue: 'Copy link',
|
|
59
|
-
}), text: t('admin.invites.copyLink', { defaultValue: 'Copy link' }), action: () => void navigator.clipboard.writeText(inviteUrl(invite.slug)) }), _jsx(PopupMenuButton, { icon:
|
|
60
|
+
}), text: t('admin.invites.copyLink', { defaultValue: 'Copy link' }), action: () => void navigator.clipboard.writeText(inviteUrl(invite.slug)) }), _jsx(PopupMenuButton, { icon: QrCode, title: t('admin.invites.saveAsQrCode', {
|
|
61
|
+
defaultValue: 'Save as QR code',
|
|
62
|
+
}), text: t('admin.invites.saveAsQrCode', {
|
|
63
|
+
defaultValue: 'Save as QR code',
|
|
64
|
+
}), action: () => downloadInviteQr(invite.slug, logoSrc) }), _jsx(PopupMenuButton, { icon: X, title: t('admin.invites.deactivate', {
|
|
60
65
|
defaultValue: 'Deactivate',
|
|
61
66
|
}), text: t('admin.invites.deactivate', {
|
|
62
67
|
defaultValue: 'Deactivate',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminMemberDetail(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { useT, useOpenpeeps, useSetPageHeader, useNavigate } from '../../index.js';
|
|
4
|
+
import { Avatar } from '../../components/index.js';
|
|
5
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
6
|
+
const StatRow = ({ label, value, }) => (_jsxs("div", { className: "flex items-center justify-between py-2", children: [_jsx("span", { className: "text-muted-foreground text-sm", children: label }), _jsx("span", { className: "font-medium", children: value })] }));
|
|
7
|
+
export function AdminMemberDetail() {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
11
|
+
const { profileId = '' } = useParams();
|
|
12
|
+
const summaryQuery = openpeepsApi.admin.useAdminProfileSummary(profileId);
|
|
13
|
+
useSetPageHeader(summaryQuery.data?.profile
|
|
14
|
+
? `${summaryQuery.data.profile.displayName || summaryQuery.data.profile.handle} — ${t('admin.members.title', { defaultValue: 'Members' })}`
|
|
15
|
+
: t('admin.members.title', { defaultValue: 'Members' }));
|
|
16
|
+
if (summaryQuery.isLoading) {
|
|
17
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
18
|
+
}
|
|
19
|
+
if (!summaryQuery.data) {
|
|
20
|
+
return (_jsx("div", { className: "p-4", children: t('admin.members.notFound', {
|
|
21
|
+
defaultValue: 'Profile not found',
|
|
22
|
+
}) }));
|
|
23
|
+
}
|
|
24
|
+
const data = summaryQuery.data;
|
|
25
|
+
const profile = data.profile;
|
|
26
|
+
const formattedDate = (iso) => new Date(iso).toLocaleDateString(undefined, {
|
|
27
|
+
year: 'numeric',
|
|
28
|
+
month: 'short',
|
|
29
|
+
day: 'numeric',
|
|
30
|
+
});
|
|
31
|
+
return (_jsxs("div", { className: "p-4", children: [_jsxs("div", { className: "mb-6 flex items-center gap-4", children: [_jsx(Avatar, { profile: profile, size: 4 }), _jsxs("div", { children: [_jsx("h2", { className: "text-xl font-bold", children: profile.displayName || `@${profile.handle}` }), _jsxs("p", { className: "text-muted-foreground", children: ["@", profile.handle] })] })] }), _jsxs("div", { className: "space-y-6", children: [_jsxs("section", { children: [_jsx("h3", { className: "text-sm font-semibold uppercase", children: t('admin.members.profileInfo', {
|
|
32
|
+
defaultValue: 'Profile Information',
|
|
33
|
+
}) }), _jsxs("div", { className: "border-border border-t", children: [_jsx(StatRow, { label: t('admin.members.dateJoined', {
|
|
34
|
+
defaultValue: 'Date joined',
|
|
35
|
+
}), value: formattedDate(data.createdAt) }), _jsx(StatRow, { label: t('admin.members.emailAddress', {
|
|
36
|
+
defaultValue: 'Email address',
|
|
37
|
+
}), value: data.email ?? '—' }), _jsx(StatRow, { label: t('admin.members.profileId', {
|
|
38
|
+
defaultValue: 'Profile ID',
|
|
39
|
+
}), value: profile.id })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-sm font-semibold uppercase", children: t('admin.members.activity', {
|
|
40
|
+
defaultValue: 'Activity',
|
|
41
|
+
}) }), _jsxs("div", { className: "border-border border-t", children: [_jsx(StatRow, { label: t('admin.members.followers', {
|
|
42
|
+
defaultValue: 'Followers',
|
|
43
|
+
}), value: data.followersCount }), _jsx(StatRow, { label: t('admin.members.following', {
|
|
44
|
+
defaultValue: 'Following',
|
|
45
|
+
}), value: data.followingCount }), _jsx(StatRow, { label: t('admin.members.posts', {
|
|
46
|
+
defaultValue: 'Posts',
|
|
47
|
+
}), value: data.activity.postsCount }), _jsx(StatRow, { label: t('admin.members.replies', {
|
|
48
|
+
defaultValue: 'Replies',
|
|
49
|
+
}), value: data.activity.repliesCount }), _jsx(StatRow, { label: t('admin.members.events', {
|
|
50
|
+
defaultValue: 'Events',
|
|
51
|
+
}), value: data.activity.eventsCount }), _jsx(StatRow, { label: t('admin.members.groups', {
|
|
52
|
+
defaultValue: 'Groups',
|
|
53
|
+
}), value: data.activity.groupsCount }), _jsx(StatRow, { label: t('admin.members.reports', {
|
|
54
|
+
defaultValue: 'Reports',
|
|
55
|
+
}), value: data.reportsCount }), _jsx(StatRow, { label: t('admin.members.blockedBy', {
|
|
56
|
+
defaultValue: 'Blocked by',
|
|
57
|
+
}), value: data.blockedByCount }), _jsx(StatRow, { label: t('admin.members.rsvps', {
|
|
58
|
+
defaultValue: 'RSVPs',
|
|
59
|
+
}), value: data.activity.rsvpsCount }), _jsx(StatRow, { label: t('admin.members.bookmarks', {
|
|
60
|
+
defaultValue: 'Bookmarks',
|
|
61
|
+
}), value: data.activity.bookmarksCount })] })] })] }), _jsx("div", { className: "mt-6", children: _jsx(Button, { variant: "outline", compact: true, action: () => navigate({ type: 'admin', section: 'members' }), title: t('admin.members.backToMembers', {
|
|
62
|
+
defaultValue: 'Back to members',
|
|
63
|
+
}), children: t('admin.members.backToMembers', {
|
|
64
|
+
defaultValue: 'Back to members',
|
|
65
|
+
}) }) })] }));
|
|
66
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import { DownloadIcon } from 'lucide-react';
|
|
3
|
+
import { ChevronDownIcon, ChevronUpIcon, DownloadIcon } from 'lucide-react';
|
|
4
4
|
import { matchesQuery } from '@openpeepshq/common/lib';
|
|
5
5
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
6
6
|
import { Avatar } from '../../components/index.js';
|
|
@@ -21,29 +21,58 @@ export function AdminMembers() {
|
|
|
21
21
|
const { openpeepsApi, client } = useOpenpeeps();
|
|
22
22
|
const profilesQuery = openpeepsApi.admin.useProfilesList();
|
|
23
23
|
const [search, setSearch] = useState('');
|
|
24
|
+
const [sort, setSort] = useState({
|
|
25
|
+
column: 'createdAt',
|
|
26
|
+
direction: 'desc',
|
|
27
|
+
});
|
|
28
|
+
const toggleSort = useCallback((column) => {
|
|
29
|
+
setSort((prev) => {
|
|
30
|
+
if (prev.column === column) {
|
|
31
|
+
return {
|
|
32
|
+
column,
|
|
33
|
+
direction: prev.direction === 'asc' ? 'desc' : 'asc',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return { column, direction: 'asc' };
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
24
39
|
const handleDownload = useCallback(async () => {
|
|
25
40
|
const csv = await client.admin.profiles.exportCsv();
|
|
26
41
|
downloadCsv(csv, 'members.csv');
|
|
27
42
|
}, [client]);
|
|
28
43
|
const headerActions = useMemo(() => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { variant: "outline", compact: true, action: handleDownload, children: [_jsx(DownloadIcon, { size: 16 }), t('admin.members.downloadCsv', { defaultValue: 'Download CSV' })] }), _jsx(AdminInviteActions, {})] })), [handleDownload, t]);
|
|
29
44
|
useSetPageHeader(t('admin.members.title', { defaultValue: 'Members' }), headerActions);
|
|
30
|
-
const
|
|
45
|
+
const sorted = useMemo(() => {
|
|
31
46
|
const profiles = profilesQuery.data ?? [];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
const searched = search
|
|
48
|
+
? profiles.filter((p) => matchesQuery(p, search))
|
|
49
|
+
: profiles;
|
|
50
|
+
const multiplier = sort.direction === 'asc' ? 1 : -1;
|
|
51
|
+
return [...searched].sort((a, b) => {
|
|
52
|
+
const aVal = sort.column === 'handle' ? (a.handle ?? '') : a.createdAt;
|
|
53
|
+
const bVal = sort.column === 'handle' ? (b.handle ?? '') : b.createdAt;
|
|
54
|
+
if (aVal < bVal)
|
|
55
|
+
return -multiplier;
|
|
56
|
+
if (aVal > bVal)
|
|
57
|
+
return multiplier;
|
|
58
|
+
return 0;
|
|
59
|
+
});
|
|
60
|
+
}, [profilesQuery.data, search, sort]);
|
|
36
61
|
return (_jsxs("div", { className: "p-4", children: [_jsx("form", { role: "search", className: "mb-4", onSubmit: (e) => {
|
|
37
62
|
e.preventDefault();
|
|
38
63
|
}, children: _jsx(Input, { placeholder: t('admin.members.searchPlaceholder', {
|
|
39
64
|
defaultValue: 'Search member by name or email',
|
|
40
|
-
}), value: search, onChange: (e) => setSearch(e.target.value) }) }),
|
|
65
|
+
}), value: search, onChange: (e) => setSearch(e.target.value) }) }), sorted.length === 0 ? (_jsx("div", { className: "flex w-full items-center justify-center p-4", children: _jsx("h2", { className: "text-lg", children: t('admin.members.noUsersFound', {
|
|
41
66
|
defaultValue: 'No users found',
|
|
42
67
|
}) }) })) : (_jsx("div", { className: "rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-surface", children: _jsxs("tr", { children: [_jsx("th", { className: "p-2 text-left", children: t('admin.members.profileColumn', {
|
|
43
68
|
defaultValue: 'Profile',
|
|
44
|
-
}) }),
|
|
45
|
-
|
|
46
|
-
|
|
69
|
+
}) }), _jsxs("th", { className: "cursor-pointer select-none p-2 text-left", onClick: () => toggleSort('handle'), children: [t('admin.members.handleColumn', {
|
|
70
|
+
defaultValue: 'Handle',
|
|
71
|
+
}), sort.column === 'handle' &&
|
|
72
|
+
(sort.direction === 'asc' ? (_jsx(ChevronUpIcon, { className: "ml-1 inline h-3 w-3" })) : (_jsx(ChevronDownIcon, { className: "ml-1 inline h-3 w-3" })))] }), _jsx("th", { className: "p-2 text-left", children: t('admin.members.rolesColumn', { defaultValue: 'Roles' }) }), _jsxs("th", { className: "cursor-pointer select-none p-2 text-left", onClick: () => toggleSort('createdAt'), children: [t('admin.members.createdColumn', {
|
|
73
|
+
defaultValue: 'Created',
|
|
74
|
+
}), sort.column === 'createdAt' &&
|
|
75
|
+
(sort.direction === 'asc' ? (_jsx(ChevronUpIcon, { className: "ml-1 inline h-3 w-3" })) : (_jsx(ChevronDownIcon, { className: "ml-1 inline h-3 w-3" })))] }), _jsx("th", { className: "p-2" })] }) }), _jsx("tbody", { children: sorted.map((p) => (_jsxs("tr", { className: "border-t", children: [_jsx("td", { className: "p-2", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { profile: p, size: 2 }), _jsx("span", { children: p.displayName || `@${p.handle}` })] }) }), _jsxs("td", { className: "text-muted-foreground p-2", children: ["@", p.handle] }), _jsx("td", { className: "p-2 text-xs", children: (p.roles ?? [])
|
|
47
76
|
.map((r) => r.displayName || r.key)
|
|
48
77
|
.join(', ') || '—' }), _jsx("td", { className: "text-muted-foreground p-2 text-xs", children: new Date(p.createdAt).toLocaleDateString() }), _jsx("td", { className: "p-2 text-right", children: _jsx(ProfileRowActions, { profile: p }) })] }, p.id))) })] }) }))] }));
|
|
49
78
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdminPlugins: () => import("react/jsx-runtime").JSX.Element;
|