@openpeepshq/react 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accounts/SignUpLoginModal.js +2 -2
- package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
- package/dist/components/configuration/ConfigMenuButton.js +12 -0
- package/dist/components/configuration/ConfigurationTree.js +1 -1
- package/dist/components/configuration/index.d.ts +2 -0
- package/dist/components/configuration/index.js +1 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
- package/dist/components/conversations/ConversationMessageBubble.js +4 -5
- package/dist/components/conversations/CreateNewConversation.js +10 -42
- package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
- package/dist/components/conversations/MessageInThread.js +1 -2
- package/dist/components/form/ImageEditModal.js +2 -4
- package/dist/components/form/ImageInput.js +13 -8
- package/dist/components/form/LocationInput.js +1 -1
- package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
- package/dist/components/groups/AddGroupMembersButton.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupAvatar.js +4 -4
- package/dist/components/groups/GroupCard.js +3 -3
- package/dist/components/groups/GroupHeader.js +1 -1
- package/dist/components/groups/GroupMembersList.js +2 -3
- package/dist/components/groups/GroupOptionsMenu.js +12 -6
- package/dist/components/groups/JoinGroupButton.js +3 -20
- package/dist/components/jams/CreateNewJam.js +4 -4
- package/dist/components/jams/JamCallParticipant.js +17 -7
- package/dist/components/jams/JamCapacityGate.js +1 -1
- package/dist/components/jams/JamChatDrawer.js +2 -2
- package/dist/components/jams/JamConference.js +1 -1
- package/dist/components/jams/JamContext.d.ts +4 -0
- package/dist/components/jams/JamContext.js +17 -2
- package/dist/components/jams/JamDetailsDrawer.js +1 -1
- package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
- package/dist/components/jams/JamDeviceSelectors.js +4 -3
- package/dist/components/jams/JamFooter.js +15 -16
- package/dist/components/jams/JamGuestForm.js +2 -2
- package/dist/components/jams/JamLobby.js +9 -19
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +1 -1
- package/dist/components/jams/JamPeopleDrawer.js +17 -13
- package/dist/components/jams/JamReactionMenu.js +1 -1
- package/dist/components/jams/JamRequestJoin.js +1 -1
- package/dist/components/jams/JamRoom.js +84 -4
- package/dist/components/jams/JamToolbarButton.d.ts +21 -0
- package/dist/components/jams/JamToolbarButton.js +19 -0
- package/dist/components/jams/JamVideoCall.js +8 -3
- package/dist/components/jams/JamVideoLayout.js +16 -5
- package/dist/components/jams/LeaveCloseButton.js +9 -44
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/constants.js +4 -0
- package/dist/components/jams/useParticipantConnection.d.ts +7 -0
- package/dist/components/jams/useParticipantConnection.js +11 -0
- package/dist/components/layout/Auth.js +1 -1
- package/dist/components/layout/Infos.js +2 -2
- package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
- package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/markdown/CompiledMarkdown.js +15 -1
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +5 -1
- package/dist/components/navigation/HeaderMobile.js +1 -1
- package/dist/components/navigation/MobileMenuItem.js +1 -1
- package/dist/components/navigation/PageHeaderAction.js +1 -1
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +6 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
- package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
- package/dist/components/notifications/NotificationHeaderActions.js +2 -2
- package/dist/components/notifications/NotificationWrapper.js +1 -1
- package/dist/components/notifications/NotificationsList.js +3 -3
- package/dist/components/notifications/TypedNotification.js +3 -3
- package/dist/components/post/Feed.js +3 -3
- package/dist/components/post/FeedPost.d.ts +2 -1
- package/dist/components/post/FeedPost.js +11 -6
- package/dist/components/post/FeedPostContent.js +1 -1
- package/dist/components/post/FullPostLayout.js +11 -4
- package/dist/components/post/NewEventButton.js +1 -1
- package/dist/components/post/NewNoteButton.js +1 -1
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/ReplyBox.js +1 -1
- package/dist/components/post/feed/events/EventsFeed.js +3 -3
- package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
- package/dist/components/post/pieces/Attachments.js +3 -3
- package/dist/components/post/pieces/EventMenu.js +1 -1
- package/dist/components/post/pieces/EventRsvpButton.js +3 -3
- package/dist/components/post/pieces/FeedPostStats.js +2 -2
- package/dist/components/post/pieces/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +33 -14
- package/dist/components/post/pieces/PostActions.js +6 -45
- package/dist/components/post/pieces/PostInfoHeader.js +1 -1
- package/dist/components/post/pieces/PostMenu.js +35 -9
- package/dist/components/post/pieces/PostReactionHeader.js +1 -1
- package/dist/components/post/pieces/ShareMenu.js +4 -2
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
- package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
- package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
- package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
- package/dist/components/post/pieces/modals/RepostModal.js +8 -7
- package/dist/components/post/post-form/AttachmentCard.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.js +1 -1
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +22 -12
- package/dist/components/post/post-form/EventForm.js +2 -2
- package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
- package/dist/components/post/post-form/NewPostModal.js +10 -10
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
- package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
- package/dist/components/post/post-form/PollComposerFields.js +12 -8
- package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
- package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/ReplyModal.js +9 -8
- package/dist/components/post/post-form/VisibilitySelector.js +1 -1
- package/dist/components/post/types/Article.js +2 -1
- package/dist/components/post/types/Event.js +1 -1
- package/dist/components/post/types/Note.js +2 -1
- package/dist/components/post/types/Poll.js +2 -1
- package/dist/components/post/types/event/CardEvent.js +2 -2
- package/dist/components/post/types/event/FullEvent.js +8 -8
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
- package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
- package/dist/components/preview-link/LocalPreviewLink.js +1 -1
- package/dist/components/preview-link/RemotePreviewLink.js +5 -1
- package/dist/components/profile/Avatar.js +3 -2
- package/dist/components/profile/FollowUnfollowButton.js +2 -2
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfileCard.js +1 -1
- package/dist/components/profile/ProfileHeader.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +3 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
- package/dist/components/profile/ProfileSelector.js +3 -3
- package/dist/components/profile/ProfilesInput.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
- package/dist/components/server-data/context.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +63 -16774
- package/dist/contexts/openpeeps/hooks/admin.js +34 -14
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +330 -0
- package/dist/contexts/openpeeps/hooks/jams.d.ts +110 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/posts.d.ts +933 -53
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +220 -0
- package/dist/contexts/openpeeps/hooks/search.d.ts +330 -0
- package/dist/contexts/openpeeps/index.d.ts +1 -1
- package/dist/contexts/openpeeps/index.js +10 -2
- package/dist/contexts/router/index.d.ts +8 -3
- package/dist/contexts/router/index.js +7 -3
- package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
- package/dist/hooks/conversations/useCreateConversation.js +56 -0
- package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
- package/dist/hooks/groups/useJoinGroup.js +23 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
- package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
- package/dist/hooks/posts/useFeedPostActions.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Markdown.d.ts +14 -0
- package/dist/lib/Markdown.js +16 -0
- package/dist/lib/analyticsClicks.d.ts +12 -0
- package/dist/lib/analyticsClicks.js +64 -0
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +27 -0
- package/dist/lib/canvasUtils.d.ts +6 -0
- package/dist/lib/canvasUtils.js +62 -1
- package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
- package/dist/lib/passwordStrength.d.ts +6 -0
- package/dist/lib/passwordStrength.js +26 -0
- package/dist/lib/postUnread.d.ts +7 -0
- package/dist/lib/postUnread.js +7 -0
- package/dist/lib/postViewCounter.d.ts +1 -1
- package/dist/lib/postViewCounter.js +3 -1
- package/dist/lib/routeHandles.d.ts +2 -0
- package/dist/lib/routeHandles.js +2 -0
- package/dist/lib/svgCover.d.ts +2 -0
- package/dist/lib/svgCover.js +18 -0
- package/dist/navigation/index.d.ts +11 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/menuItems.d.ts +8 -0
- package/dist/navigation/menuItems.js +83 -0
- package/dist/navigation/targets.d.ts +94 -0
- package/dist/navigation/targets.js +12 -0
- package/dist/pages/About.d.ts +1 -0
- package/dist/pages/About.js +19 -0
- package/dist/pages/CodeOfConduct.d.ts +1 -0
- package/dist/pages/CodeOfConduct.js +14 -0
- package/dist/pages/Explore.d.ts +1 -0
- package/dist/pages/Explore.js +132 -0
- package/dist/pages/Home.d.ts +6 -0
- package/dist/pages/Home.js +31 -0
- package/dist/pages/Members.d.ts +1 -0
- package/dist/pages/Members.js +35 -0
- package/dist/pages/NotFound.d.ts +1 -0
- package/dist/pages/NotFound.js +9 -0
- package/dist/pages/Notifications.d.ts +1 -0
- package/dist/pages/Notifications.js +8 -0
- package/dist/pages/PostDetail.d.ts +1 -0
- package/dist/pages/PostDetail.js +27 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/Profile.js +20 -0
- package/dist/pages/Tags.d.ts +1 -0
- package/dist/pages/Tags.js +14 -0
- package/dist/pages/Welcome.d.ts +1 -0
- package/dist/pages/Welcome.js +89 -0
- package/dist/pages/admin/Analytics.d.ts +11 -0
- package/dist/pages/admin/Analytics.js +11 -0
- package/dist/pages/admin/ApiKeys.d.ts +1 -0
- package/dist/pages/admin/ApiKeys.js +141 -0
- package/dist/pages/admin/Backups.d.ts +1 -0
- package/dist/pages/admin/Backups.js +39 -0
- package/dist/pages/admin/ConfigEditor.d.ts +14 -0
- package/dist/pages/admin/ConfigEditor.js +91 -0
- package/dist/pages/admin/Configuration.d.ts +1 -0
- package/dist/pages/admin/Configuration.js +8 -0
- package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunity.js +7 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
- package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
- package/dist/pages/admin/ConfigurationEmail.js +97 -0
- package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
- package/dist/pages/admin/ConfigurationI18n.js +51 -0
- package/dist/pages/admin/Dashboard.d.ts +1 -0
- package/dist/pages/admin/Dashboard.js +40 -0
- package/dist/pages/admin/Db.d.ts +1 -0
- package/dist/pages/admin/Db.js +238 -0
- package/dist/pages/admin/Diagnostics.d.ts +1 -0
- package/dist/pages/admin/Diagnostics.js +8 -0
- package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsEmail.js +65 -0
- package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsJob.js +51 -0
- package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsLogs.js +62 -0
- package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
- package/dist/pages/admin/GroupMembers.d.ts +1 -0
- package/dist/pages/admin/GroupMembers.js +109 -0
- package/dist/pages/admin/Groups.d.ts +1 -0
- package/dist/pages/admin/Groups.js +61 -0
- package/dist/pages/admin/Invites.d.ts +1 -0
- package/dist/pages/admin/Invites.js +72 -0
- package/dist/pages/admin/Members.d.ts +1 -0
- package/dist/pages/admin/Members.js +49 -0
- package/dist/pages/admin/Moderation.d.ts +1 -0
- package/dist/pages/admin/Moderation.js +62 -0
- package/dist/pages/admin/Reports.d.ts +1 -0
- package/dist/pages/admin/Reports.js +178 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
- package/dist/pages/admin/analytics/Content.d.ts +1 -0
- package/dist/pages/admin/analytics/Content.js +117 -0
- package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
- package/dist/pages/admin/analytics/Engagement.js +220 -0
- package/dist/pages/admin/analytics/Groups.d.ts +1 -0
- package/dist/pages/admin/analytics/Groups.js +139 -0
- package/dist/pages/admin/analytics/Members.d.ts +1 -0
- package/dist/pages/admin/analytics/Members.js +96 -0
- package/dist/pages/admin/analytics/Overview.d.ts +1 -0
- package/dist/pages/admin/analytics/Overview.js +165 -0
- package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
- package/dist/pages/admin/analytics/ReportSettings.js +62 -0
- package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
- package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
- package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
- package/dist/pages/admin/analytics/downloadCsv.js +20 -0
- package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
- package/dist/pages/admin/community/CommunityFavicons.js +47 -0
- package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
- package/dist/pages/admin/community/CommunityInfo.js +35 -0
- package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
- package/dist/pages/admin/community/CommunityLinks.js +35 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
- package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
- package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
- package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
- package/dist/pages/admin/community/CommunityRoles.js +109 -0
- package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
- package/dist/pages/admin/community/CommunityTheme.js +56 -0
- package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
- package/dist/pages/admin/community/useCommunityConfig.js +28 -0
- package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
- package/dist/pages/admin/components/AdminCharts.js +29 -0
- package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
- package/dist/pages/admin/components/AdminGroupCard.js +42 -0
- package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
- package/dist/pages/admin/components/AdminInviteActions.js +23 -0
- package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
- package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
- package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
- package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
- package/dist/pages/admin/components/ProfileRowActions.js +131 -0
- package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
- package/dist/pages/articles/Edit.d.ts +1 -0
- package/dist/pages/articles/Edit.js +60 -0
- package/dist/pages/articles/Index.d.ts +1 -0
- package/dist/pages/articles/Index.js +18 -0
- package/dist/pages/articles/New.d.ts +1 -0
- package/dist/pages/articles/New.js +48 -0
- package/dist/pages/auth/Closed.d.ts +1 -0
- package/dist/pages/auth/Closed.js +14 -0
- package/dist/pages/auth/Login.d.ts +1 -0
- package/dist/pages/auth/Login.js +74 -0
- package/dist/pages/auth/OidcCallback.d.ts +5 -0
- package/dist/pages/auth/OidcCallback.js +31 -0
- package/dist/pages/auth/OidcPending.d.ts +5 -0
- package/dist/pages/auth/OidcPending.js +39 -0
- package/dist/pages/auth/Register.d.ts +4 -0
- package/dist/pages/auth/Register.js +124 -0
- package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
- package/dist/pages/auth/RegisterInvitation.js +5 -0
- package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
- package/dist/pages/auth/RequestResetPassword.js +50 -0
- package/dist/pages/auth/ResetPassword.d.ts +1 -0
- package/dist/pages/auth/ResetPassword.js +40 -0
- package/dist/pages/auth/SsoCallback.d.ts +1 -0
- package/dist/pages/auth/SsoCallback.js +34 -0
- package/dist/pages/auth/ValidateEmail.d.ts +6 -0
- package/dist/pages/auth/ValidateEmail.js +64 -0
- package/dist/pages/conversations/Index.d.ts +1 -0
- package/dist/pages/conversations/Index.js +58 -0
- package/dist/pages/conversations/Info.d.ts +1 -0
- package/dist/pages/conversations/Info.js +26 -0
- package/dist/pages/conversations/New.d.ts +1 -0
- package/dist/pages/conversations/New.js +8 -0
- package/dist/pages/conversations/Show.d.ts +1 -0
- package/dist/pages/conversations/Show.js +100 -0
- package/dist/pages/events/Edit.d.ts +1 -0
- package/dist/pages/events/Edit.js +69 -0
- package/dist/pages/events/Index.d.ts +1 -0
- package/dist/pages/events/Index.js +23 -0
- package/dist/pages/events/My.d.ts +1 -0
- package/dist/pages/events/My.js +24 -0
- package/dist/pages/events/New.d.ts +1 -0
- package/dist/pages/events/New.js +66 -0
- package/dist/pages/feeds/Bookmarks.d.ts +1 -0
- package/dist/pages/feeds/Bookmarks.js +10 -0
- package/dist/pages/feeds/Local.d.ts +1 -0
- package/dist/pages/feeds/Local.js +14 -0
- package/dist/pages/feeds/My.d.ts +1 -0
- package/dist/pages/feeds/My.js +12 -0
- package/dist/pages/groups/Edit.d.ts +1 -0
- package/dist/pages/groups/Edit.js +57 -0
- package/dist/pages/groups/Index.d.ts +1 -0
- package/dist/pages/groups/Index.js +50 -0
- package/dist/pages/groups/Info.d.ts +1 -0
- package/dist/pages/groups/Info.js +21 -0
- package/dist/pages/groups/Members.d.ts +1 -0
- package/dist/pages/groups/Members.js +28 -0
- package/dist/pages/groups/New.d.ts +1 -0
- package/dist/pages/groups/New.js +68 -0
- package/dist/pages/groups/Show.d.ts +1 -0
- package/dist/pages/groups/Show.js +64 -0
- package/dist/pages/index.d.ts +94 -0
- package/dist/pages/index.js +94 -0
- package/dist/pages/jams/Event.d.ts +8 -0
- package/dist/pages/jams/Event.js +57 -0
- package/dist/pages/jams/Index.d.ts +6 -0
- package/dist/pages/jams/Index.js +44 -0
- package/dist/pages/payment/Success.d.ts +1 -0
- package/dist/pages/payment/Success.js +30 -0
- package/dist/pages/plugins/Index.d.ts +1 -0
- package/dist/pages/plugins/Index.js +69 -0
- package/dist/pages/profile/Followers.d.ts +6 -0
- package/dist/pages/profile/Followers.js +28 -0
- package/dist/pages/settings/AccessTokens.d.ts +1 -0
- package/dist/pages/settings/AccessTokens.js +149 -0
- package/dist/pages/settings/Account.d.ts +1 -0
- package/dist/pages/settings/Account.js +81 -0
- package/dist/pages/settings/Billing.d.ts +1 -0
- package/dist/pages/settings/Billing.js +82 -0
- package/dist/pages/settings/Index.d.ts +1 -0
- package/dist/pages/settings/Index.js +13 -0
- package/dist/pages/settings/Language.d.ts +1 -0
- package/dist/pages/settings/Language.js +54 -0
- package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
- package/dist/pages/settings/NotificationPreferences.js +180 -0
- package/dist/pages/settings/Notifications.d.ts +1 -0
- package/dist/pages/settings/Notifications.js +10 -0
- package/dist/pages/settings/PublicProfile.d.ts +1 -0
- package/dist/pages/settings/PublicProfile.js +135 -0
- package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
- package/dist/pages/settings/PushEnabledDevices.js +67 -0
- package/dist/pages/settings/Theme.d.ts +1 -0
- package/dist/pages/settings/Theme.js +37 -0
- package/dist/pages/test/Error.d.ts +1 -0
- package/dist/pages/test/Error.js +10 -0
- package/dist/pages/test/Markdown.d.ts +1 -0
- package/dist/pages/test/Markdown.js +32 -0
- package/dist/pwa/InstallPrompt.js +1 -1
- package/dist/pwa/NotificationPermissionPrompt.js +2 -2
- package/dist/pwa/UpdatePrompt.js +1 -1
- package/dist/react-native.d.ts +1 -0
- package/dist/react-native.js +1 -0
- package/dist/session/useSessionEvents.d.ts +3 -0
- package/dist/session/useSessionEvents.js +64 -0
- package/dist/stores/newPosts.d.ts +8 -8
- package/package.json +14 -9
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
4
|
+
import { useOpenpeeps, useT } from '../../../index.js';
|
|
5
|
+
import { AnalyticsLoading } from './AnalyticsLayout.js';
|
|
6
|
+
const parseRecipients = (raw) => raw
|
|
7
|
+
.split(/[\n,;]+/)
|
|
8
|
+
.map((s) => s.trim())
|
|
9
|
+
.filter(Boolean);
|
|
10
|
+
export const AnalyticsReportSettingsPage = () => {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const query = openpeepsApi.admin.useAnalyticsReportSettings();
|
|
14
|
+
const updateSettings = openpeepsApi.admin.updateAnalyticsReportSettingsAction();
|
|
15
|
+
const [enabled, setEnabled] = useState(false);
|
|
16
|
+
const [recipientsText, setRecipientsText] = useState('');
|
|
17
|
+
const [busy, setBusy] = useState(false);
|
|
18
|
+
const [message, setMessage] = useState(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!query.data)
|
|
21
|
+
return;
|
|
22
|
+
setEnabled(query.data.enabled);
|
|
23
|
+
setRecipientsText(query.data.recipients.join('\n'));
|
|
24
|
+
}, [query.data]);
|
|
25
|
+
if (query.isLoading)
|
|
26
|
+
return _jsx(AnalyticsLoading, {});
|
|
27
|
+
if (!query.data)
|
|
28
|
+
return null;
|
|
29
|
+
const onSave = async () => {
|
|
30
|
+
setBusy(true);
|
|
31
|
+
setMessage(null);
|
|
32
|
+
try {
|
|
33
|
+
await updateSettings({
|
|
34
|
+
enabled,
|
|
35
|
+
recipients: parseRecipients(recipientsText),
|
|
36
|
+
});
|
|
37
|
+
setMessage(t('admin.analytics.reports.saved', {
|
|
38
|
+
defaultValue: 'Report settings saved',
|
|
39
|
+
}));
|
|
40
|
+
await query.refetch();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
setMessage(t('admin.analytics.reports.saveFailed', {
|
|
44
|
+
defaultValue: 'Failed to save report settings',
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
setBusy(false);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return (_jsx("div", { className: "mx-auto max-w-xl space-y-5", children: _jsxs("section", { className: "bg-background rounded-xl border p-4 shadow-sm", children: [_jsx("h2", { className: "text-muted-foreground mb-1 text-xs font-semibold uppercase tracking-wide", children: t('admin.analytics.reports.title', {
|
|
52
|
+
defaultValue: 'Monthly board report',
|
|
53
|
+
}) }), _jsx("p", { className: "text-muted-foreground mb-4 text-sm", children: t('admin.analytics.reports.help', {
|
|
54
|
+
defaultValue: 'When enabled, a narrative PDF report for the previous calendar month is emailed on the 1st at 08:00 UTC.',
|
|
55
|
+
}) }), _jsxs("label", { className: "mb-4 flex items-center gap-2 text-sm", children: [_jsx("input", { type: "checkbox", checked: enabled, onChange: (e) => setEnabled(e.target.checked) }), t('admin.analytics.reports.enabled', {
|
|
56
|
+
defaultValue: 'Enable monthly report emails',
|
|
57
|
+
})] }), _jsxs("label", { className: "block text-sm", children: [_jsx("span", { className: "mb-1 block font-medium", children: t('admin.analytics.reports.recipients', {
|
|
58
|
+
defaultValue: 'Recipients',
|
|
59
|
+
}) }), _jsx("textarea", { className: "border-input bg-background min-h-28 w-full rounded-md border px-3 py-2 text-sm", value: recipientsText, onChange: (e) => setRecipientsText(e.target.value), placeholder: "ops@example.com" }), _jsx("span", { className: "text-muted-foreground mt-1 block text-xs", children: t('admin.analytics.reports.recipientsHelp', {
|
|
60
|
+
defaultValue: 'One email per line, or comma-separated.',
|
|
61
|
+
}) })] }), _jsxs("div", { className: "mt-4 flex items-center gap-3", children: [_jsx(Button, { type: "button", size: "sm", disabled: busy, onClick: () => void onSave(), children: t('admin.analytics.reports.save', { defaultValue: 'Save' }) }), message ? (_jsx("p", { className: "text-muted-foreground text-xs", children: message })) : null] })] }) }));
|
|
62
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AnalyticsInfoBadge } from '@openpeepshq/react-ui';
|
|
3
|
+
/** Table header with a trailing clickable info badge. */
|
|
4
|
+
export const columnHeader = (label, info) => (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [_jsx("span", { children: label }), _jsx(AnalyticsInfoBadge, { label: label, info: info })] }));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const toCsv = (rows) => rows
|
|
2
|
+
.map((row) => row
|
|
3
|
+
.map((cell) => {
|
|
4
|
+
const value = String(cell);
|
|
5
|
+
if (/[",\n\r]/.test(value)) {
|
|
6
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
})
|
|
10
|
+
.join(','))
|
|
11
|
+
.join('\n');
|
|
12
|
+
export const downloadCsv = (filename, rows) => {
|
|
13
|
+
const blob = new Blob([toCsv(rows)], { type: 'text/csv;charset=utf-8' });
|
|
14
|
+
const url = URL.createObjectURL(blob);
|
|
15
|
+
const a = document.createElement('a');
|
|
16
|
+
a.href = url;
|
|
17
|
+
a.download = filename;
|
|
18
|
+
a.click();
|
|
19
|
+
URL.revokeObjectURL(url);
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityFavicons(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import { useT, useSetPageHeader, useOpenpeeps } from '../../../index.js';
|
|
4
|
+
import { Button, Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
import { useCommunityConfig } from './useCommunityConfig.js';
|
|
6
|
+
export function AdminConfigurationCommunityFavicons() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
9
|
+
const { upload } = openpeepsApi.useMediaUpload();
|
|
10
|
+
const { isLoading, base, draft, save } = useCommunityConfig();
|
|
11
|
+
const [icon, setIcon] = useState(null);
|
|
12
|
+
const [status, setStatus] = useState(null);
|
|
13
|
+
const inputRef = useRef(null);
|
|
14
|
+
useSetPageHeader('Community Customization - Favicons');
|
|
15
|
+
const currentIcon = icon ?? base?.theme?.icon ?? '/pwa/icons/128x128.png';
|
|
16
|
+
const onPick = async (file) => {
|
|
17
|
+
const attachment = await upload({
|
|
18
|
+
file,
|
|
19
|
+
usage: t('configuration.community.icon'),
|
|
20
|
+
});
|
|
21
|
+
if (attachment.url)
|
|
22
|
+
setIcon(attachment.url);
|
|
23
|
+
};
|
|
24
|
+
const handleSubmit = async () => {
|
|
25
|
+
if (!draft)
|
|
26
|
+
return;
|
|
27
|
+
setStatus(null);
|
|
28
|
+
if (icon)
|
|
29
|
+
draft.theme.icon = icon;
|
|
30
|
+
try {
|
|
31
|
+
await save(draft);
|
|
32
|
+
window.location.reload();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
setStatus(err.message);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
if (isLoading || !draft) {
|
|
39
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
40
|
+
}
|
|
41
|
+
return (_jsxs("div", { className: "relative mb-20 h-full w-full p-4", children: [_jsx("p", { children: t('configuration.community.favicons.title') }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4", children: t('configuration.community.favicons.description') }), _jsxs("div", { className: "mb-2 flex gap-x-6", children: [_jsxs("span", { children: [t('configuration.community.currentIcon'), ":"] }), _jsx("img", { className: "size-8", alt: t('configuration.community.icon'), src: currentIcon })] }), _jsx(Button, { variant: "outline", action: () => inputRef.current?.click(), title: t('configuration.community.upload'), children: t('configuration.community.upload') }), _jsx("input", { ref: inputRef, type: "file", accept: "image/*", className: "hidden", onChange: (e) => {
|
|
42
|
+
const file = e.target.files?.[0];
|
|
43
|
+
if (file)
|
|
44
|
+
void onPick(file);
|
|
45
|
+
e.target.value = '';
|
|
46
|
+
} }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.iconRequirements') })] }), _jsx(Button, { variant: "default", className: "mt-4 w-full", action: handleSubmit, title: t('configuration.community.save'), children: t('configuration.community.save') }), status ? (_jsx(Toast, { variant: "error", onDismiss: () => setStatus(null), children: status })) : null] }));
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityInfo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useForm } from 'react-hook-form';
|
|
4
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
|
+
import { communityConfigSchema, } from '@openpeepshq/common/types';
|
|
6
|
+
import { useT, useSetPageHeader } from '../../../index.js';
|
|
7
|
+
import { Button, Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Input, Textarea, Toast, } from '@openpeepshq/react-ui';
|
|
8
|
+
import { useCommunityConfig } from './useCommunityConfig.js';
|
|
9
|
+
export function AdminConfigurationCommunityInfo() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { isLoading, draft, save } = useCommunityConfig();
|
|
12
|
+
const [status, setStatus] = useState(null);
|
|
13
|
+
useSetPageHeader(t('configuration.community.info.title', { defaultValue: 'Basic Info' }));
|
|
14
|
+
const form = useForm({
|
|
15
|
+
resolver: zodResolver(communityConfigSchema),
|
|
16
|
+
values: draft ?? undefined,
|
|
17
|
+
});
|
|
18
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
19
|
+
setStatus(null);
|
|
20
|
+
try {
|
|
21
|
+
await save(data);
|
|
22
|
+
setStatus({
|
|
23
|
+
type: 'success',
|
|
24
|
+
message: t('configuration.community.updateSuccess'),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
setStatus({ type: 'error', message: err.message });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
if (isLoading || !draft) {
|
|
32
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
33
|
+
}
|
|
34
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: onSubmit, children: [_jsx(FormField, { control: form.control, name: "info.name", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.name') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", "data-testid": "admin-community-info-name" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.tagLine", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.tagline') }), _jsx(FormControl, { children: _jsx(Textarea, { ...field, "data-testid": "admin-community-info-tagline" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.contactEmail", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.email') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "email", value: field.value ?? '', "data-testid": "admin-community-info-email" }) }), _jsx(FormMessage, {})] })) }), _jsx(Button, { type: "submit", variant: "default", title: t('configuration.community.save'), loading: form.formState.isSubmitting, "data-testid": "admin-community-info-save", children: t('configuration.community.save') })] }) }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-community-info-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityLinks(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useForm } from 'react-hook-form';
|
|
4
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
5
|
+
import { communityConfigSchema, } from '@openpeepshq/common/types';
|
|
6
|
+
import { useT, useSetPageHeader } from '../../../index.js';
|
|
7
|
+
import { Button, Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Input, Toast, } from '@openpeepshq/react-ui';
|
|
8
|
+
import { useCommunityConfig } from './useCommunityConfig.js';
|
|
9
|
+
export function AdminConfigurationCommunityLinks() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { isLoading, draft, save } = useCommunityConfig();
|
|
12
|
+
const [status, setStatus] = useState(null);
|
|
13
|
+
useSetPageHeader(t('configuration.community.links.title', { defaultValue: 'Policy Links' }));
|
|
14
|
+
const form = useForm({
|
|
15
|
+
resolver: zodResolver(communityConfigSchema),
|
|
16
|
+
values: draft ?? undefined,
|
|
17
|
+
});
|
|
18
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
19
|
+
setStatus(null);
|
|
20
|
+
try {
|
|
21
|
+
await save(data);
|
|
22
|
+
setStatus({
|
|
23
|
+
type: 'success',
|
|
24
|
+
message: t('configuration.community.updateSuccess'),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
setStatus({ type: 'error', message: err.message });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
if (isLoading || !draft) {
|
|
32
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
33
|
+
}
|
|
34
|
+
return (_jsxs("div", { className: "p-4", children: [_jsx(Form, { ...form, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: onSubmit, children: [_jsx(FormField, { control: form.control, name: "info.privacyPolicy", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.privacyPolicy') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '', "data-testid": "admin-community-links-privacy" }) }), _jsx(FormMessage, {})] })) }), _jsx(FormField, { control: form.control, name: "info.termsAndConditions", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormLabel, { children: t('configuration.community.termsAndConditions') }), _jsx(FormControl, { children: _jsx(Input, { ...field, type: "text", value: field.value ?? '', "data-testid": "admin-community-links-terms" }) }), _jsx(FormMessage, {})] })) }), _jsx(Button, { type: "submit", variant: "default", title: t('configuration.community.save'), loading: form.formState.isSubmitting, "data-testid": "admin-community-links-save", children: t('configuration.community.save') })] }) }), status ? (_jsx(Toast, { variant: status.type, testId: "admin-community-links-toast", onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommunityConfig } from '@openpeepshq/common/types';
|
|
2
|
+
export interface CommunityMarkdownPageProps {
|
|
3
|
+
/** Config path to the markdown field, e.g. `['content', 'welcomePage']`. */
|
|
4
|
+
path: ['content', keyof NonNullable<CommunityConfig['content']>];
|
|
5
|
+
titleKey: string;
|
|
6
|
+
descriptionKey: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CommunityMarkdownPage({ path, titleKey, descriptionKey, }: CommunityMarkdownPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useT, useSetPageHeader } from '../../../index.js';
|
|
4
|
+
import { OpenpeepsMarkdownInput } from '../../../components/index.js';
|
|
5
|
+
import { Button, Toast, deepGet, deepSet } from '@openpeepshq/react-ui';
|
|
6
|
+
import { useCommunityConfig } from './useCommunityConfig.js';
|
|
7
|
+
export function CommunityMarkdownPage({ path, titleKey, descriptionKey, }) {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const { isLoading, base, draft, save } = useCommunityConfig();
|
|
10
|
+
const [content, setContent] = useState(null);
|
|
11
|
+
const [status, setStatus] = useState(null);
|
|
12
|
+
useSetPageHeader(t(titleKey));
|
|
13
|
+
const stored = base ? (deepGet(base, path) ?? '') : '';
|
|
14
|
+
const value = content ?? stored;
|
|
15
|
+
const handleSubmit = async () => {
|
|
16
|
+
if (!draft)
|
|
17
|
+
return;
|
|
18
|
+
setStatus(null);
|
|
19
|
+
deepSet(draft, path, value);
|
|
20
|
+
try {
|
|
21
|
+
await save(draft);
|
|
22
|
+
setStatus({
|
|
23
|
+
type: 'success',
|
|
24
|
+
message: t('configuration.community.updateSuccess'),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
setStatus({ type: 'error', message: err.message });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
if (isLoading || !draft) {
|
|
32
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
33
|
+
}
|
|
34
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("p", { className: "pb-2 pt-4", children: t(descriptionKey) }), _jsx(OpenpeepsMarkdownInput, { value: value, maxLength: 10000, rows: 18, className: "min-h-[30rem]", onChange: setContent }), _jsx(Button, { variant: "default", action: handleSubmit, title: t('configuration.community.save'), children: t('configuration.community.save') }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityProfileFields(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { MinusSquare, PlusSquare } from 'lucide-react';
|
|
4
|
+
import { useT, useSetPageHeader, useOpenpeeps } from '../../../index.js';
|
|
5
|
+
import { Button, Input, Label, Toast } from '@openpeepshq/react-ui';
|
|
6
|
+
export function AdminConfigurationCommunityProfileFields() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
9
|
+
const configQuery = openpeepsApi.admin.useConfigRead('openpeeps', 'community');
|
|
10
|
+
const updateConfig = openpeepsApi.admin.updateConfigAction({
|
|
11
|
+
namespace: 'openpeeps',
|
|
12
|
+
name: 'community',
|
|
13
|
+
});
|
|
14
|
+
const [fields, setFields] = useState([]);
|
|
15
|
+
const [status, setStatus] = useState(null);
|
|
16
|
+
useSetPageHeader(t('configuration.community.profileFields.title'));
|
|
17
|
+
const base = configQuery.data?.config;
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setFields(structuredClone(base?.profiles?.additionalFields ?? []));
|
|
20
|
+
}, [base]);
|
|
21
|
+
const updateField = (index, patch) => setFields((prev) => prev.map((f, i) => (i === index ? { ...f, ...patch } : f)));
|
|
22
|
+
const handleSubmit = async () => {
|
|
23
|
+
setStatus(null);
|
|
24
|
+
if (fields.some((field) => !field.key.trim())) {
|
|
25
|
+
setStatus({
|
|
26
|
+
type: 'error',
|
|
27
|
+
message: t('configuration.community.profileFields.emptyKeyError', {
|
|
28
|
+
defaultValue: 'Each profile field needs a non-empty key.',
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
await updateConfig({
|
|
35
|
+
config: { profiles: { additionalFields: fields } },
|
|
36
|
+
});
|
|
37
|
+
setStatus({
|
|
38
|
+
type: 'success',
|
|
39
|
+
message: t('configuration.community.updateSuccess'),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
setStatus({ type: 'error', message: err.message });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
if (configQuery.isLoading) {
|
|
47
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
48
|
+
}
|
|
49
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("p", { className: "text-sm", children: t('configuration.profileFields.description') }), fields.map((field, index) => (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("h4", { className: "text-lg font-semibold", children: index + 1 }), _jsx(Label, { title: t('profile.form.fields.label'), children: _jsx(Input, { value: field.label, onChange: (e) => updateField(index, { label: e.target.value }) }) }), _jsx(Label, { title: t('common.form.fieldKey'), children: _jsx(Input, { value: field.key, onChange: (e) => updateField(index, { key: e.target.value }) }) })] }, index))), fields.length ? (_jsxs(Button, { variant: "outline", action: () => setFields((prev) => prev.slice(0, -1)), title: t('common.listEditor.removeTitle'), children: [_jsx(MinusSquare, { className: "mr-1 size-4" }), t('common.listEditor.removeTitle')] })) : null, _jsxs(Button, { variant: "outline", action: () => setFields((prev) => [...prev, { key: '', label: '' }]), title: t('posts.form.poll.addOption'), children: [_jsx(PlusSquare, { className: "mr-1 size-4" }), t('posts.form.poll.addOption')] }), _jsx(Button, { variant: "ghost", action: handleSubmit, title: t('common.form.save'), children: t('common.form.save') }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityRoles(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useT, useSetPageHeader, useOpenpeeps } from '../../../index.js';
|
|
4
|
+
import { Button, Label, Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
function DefaultRoles({ base }) {
|
|
6
|
+
const t = useT();
|
|
7
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
8
|
+
const updateConfig = openpeepsApi.admin.updateConfigAction({
|
|
9
|
+
namespace: 'openpeeps',
|
|
10
|
+
name: 'community',
|
|
11
|
+
});
|
|
12
|
+
const [roleOnRegistration, setRoleOnRegistration] = useState(base.roles.onRegistration.add?.[0] ?? 'pendingmember');
|
|
13
|
+
const [status, setStatus] = useState(null);
|
|
14
|
+
const handleSubmit = async () => {
|
|
15
|
+
setStatus(null);
|
|
16
|
+
const roles = structuredClone(base.roles);
|
|
17
|
+
roles.onRegistration.add = [roleOnRegistration];
|
|
18
|
+
try {
|
|
19
|
+
await updateConfig({ config: { roles } });
|
|
20
|
+
setStatus({
|
|
21
|
+
type: 'success',
|
|
22
|
+
message: t('admin.configuration.community.defaultRoles.success'),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
setStatus({ type: 'error', message: err.message });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("h3", { className: "text-xl font-bold", children: t('admin.configuration.community.defaultRoles.title') }), _jsx(Label, { title: t('admin.configuration.community.defaultRoles.roleOnRegistration'), description: t('admin.configuration.community.defaultRoles.roleOnRegistrationDescription'), children: _jsxs("select", { className: "op-input", value: roleOnRegistration, onChange: (e) => setRoleOnRegistration(e.target.value), children: [_jsx("option", { value: "pendingmember", children: "Pending Member" }), _jsx("option", { value: "member", children: "Member" })] }) }), _jsx(Button, { variant: "ghost", action: handleSubmit, title: "Save", children: "Save" }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
30
|
+
}
|
|
31
|
+
const EVENT_CAPABILITY = 'core-posts-create-*';
|
|
32
|
+
const NOTE_CAPABILITIES = [
|
|
33
|
+
'core-posts-create-note-*',
|
|
34
|
+
'core-posts-create-question-*',
|
|
35
|
+
'core-posts-create-article-*',
|
|
36
|
+
];
|
|
37
|
+
const GROUP_CAPABILITY = 'core-groups-create';
|
|
38
|
+
function RolesSimple({ roles }) {
|
|
39
|
+
const t = useT();
|
|
40
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
41
|
+
const updateRole = openpeepsApi.admin.updateRoleAction();
|
|
42
|
+
const memberRole = roles.find((role) => role.key === 'member');
|
|
43
|
+
const [canCreateEvents, setCanCreateEvents] = useState(false);
|
|
44
|
+
const [canCreateGroups, setCanCreateGroups] = useState(false);
|
|
45
|
+
const [status, setStatus] = useState(null);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
setCanCreateEvents(!!memberRole?.capabilities?.add?.includes(EVENT_CAPABILITY));
|
|
48
|
+
setCanCreateGroups(!!memberRole?.capabilities?.add?.includes(GROUP_CAPABILITY));
|
|
49
|
+
}, [memberRole]);
|
|
50
|
+
const adjustCapabilities = (capabilities) => {
|
|
51
|
+
let result = [...capabilities];
|
|
52
|
+
if (canCreateGroups && !result.includes(GROUP_CAPABILITY)) {
|
|
53
|
+
result = [...result, GROUP_CAPABILITY];
|
|
54
|
+
}
|
|
55
|
+
if (!canCreateGroups) {
|
|
56
|
+
result = result.filter((c) => c !== GROUP_CAPABILITY);
|
|
57
|
+
}
|
|
58
|
+
if (canCreateEvents) {
|
|
59
|
+
result = result.filter((c) => !NOTE_CAPABILITIES.includes(c));
|
|
60
|
+
if (!result.includes(EVENT_CAPABILITY))
|
|
61
|
+
result = [...result, EVENT_CAPABILITY];
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
result = result.filter((c) => c !== EVENT_CAPABILITY);
|
|
65
|
+
for (const cap of NOTE_CAPABILITIES) {
|
|
66
|
+
if (!result.includes(cap))
|
|
67
|
+
result = [...result, cap];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
};
|
|
72
|
+
const handleSubmit = async () => {
|
|
73
|
+
if (!memberRole)
|
|
74
|
+
return;
|
|
75
|
+
setStatus(null);
|
|
76
|
+
try {
|
|
77
|
+
await updateRole({
|
|
78
|
+
...memberRole,
|
|
79
|
+
default: false,
|
|
80
|
+
capabilities: {
|
|
81
|
+
add: adjustCapabilities(memberRole.capabilities?.add ?? []),
|
|
82
|
+
},
|
|
83
|
+
}, { roleId: memberRole.id });
|
|
84
|
+
setStatus({
|
|
85
|
+
type: 'success',
|
|
86
|
+
message: t('admin.configuration.community.roleConfigurationSimple.success'),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
setStatus({ type: 'error', message: err.message });
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("h3", { className: "text-xl font-bold", children: t('admin.configuration.community.roleConfigurationSimple.title') }), _jsx(Label, { title: t('admin.configuration.community.roleConfigurationSimple.membersCanCreateEvents.title'), description: t('admin.configuration.community.roleConfigurationSimple.membersCanCreateEvents.description'), forCheckbox: true, children: _jsx("input", { type: "checkbox", className: "h-5 w-9", checked: canCreateEvents, onChange: (e) => setCanCreateEvents(e.target.checked) }) }), _jsx(Label, { title: t('admin.configuration.community.roleConfigurationSimple.membersCanCreateGroups.title'), description: t('admin.configuration.community.roleConfigurationSimple.membersCanCreateGroups.description'), forCheckbox: true, children: _jsx("input", { type: "checkbox", className: "h-5 w-9", checked: canCreateGroups, onChange: (e) => setCanCreateGroups(e.target.checked) }) }), _jsx(Button, { variant: "ghost", action: handleSubmit, title: "Save", children: "Save" }), status ? (_jsx(Toast, { variant: status.type, onDismiss: () => setStatus(null), children: status.message })) : null] }));
|
|
94
|
+
}
|
|
95
|
+
export function AdminConfigurationCommunityRoles() {
|
|
96
|
+
const t = useT();
|
|
97
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
98
|
+
const configQuery = openpeepsApi.admin.useConfigRead('openpeeps', 'community');
|
|
99
|
+
const rolesQuery = openpeepsApi.admin.useRolesList();
|
|
100
|
+
useSetPageHeader(t('admin.configuration.community.capabilities.title'));
|
|
101
|
+
const base = configQuery.data?.config;
|
|
102
|
+
if (configQuery.isLoading ||
|
|
103
|
+
rolesQuery.isLoading ||
|
|
104
|
+
!base ||
|
|
105
|
+
!rolesQuery.data) {
|
|
106
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
107
|
+
}
|
|
108
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(DefaultRoles, { base: base }), _jsx(RolesSimple, { roles: rolesQuery.data })] }));
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AdminConfigurationCommunityTheme(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useT, useSetPageHeader, useOpenpeeps, equal } from '../../../index.js';
|
|
4
|
+
import { Button, ThemeFontSelect, Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
import { useCommunityConfig } from './useCommunityConfig.js';
|
|
6
|
+
export function AdminConfigurationCommunityTheme() {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
9
|
+
const { upload } = openpeepsApi.useMediaUpload();
|
|
10
|
+
const { isLoading, base, save } = useCommunityConfig();
|
|
11
|
+
const [cfg, setCfg] = useState(null);
|
|
12
|
+
const [status, setStatus] = useState(null);
|
|
13
|
+
useSetPageHeader(t('configuration.community.theme.title'));
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (base)
|
|
16
|
+
setCfg(structuredClone(base));
|
|
17
|
+
}, [base]);
|
|
18
|
+
const patch = (fn) => setCfg((prev) => {
|
|
19
|
+
if (!prev)
|
|
20
|
+
return prev;
|
|
21
|
+
const next = structuredClone(prev);
|
|
22
|
+
fn(next);
|
|
23
|
+
return next;
|
|
24
|
+
});
|
|
25
|
+
const uploadInto = async (file, apply, usageKey) => {
|
|
26
|
+
const attachment = await upload({ file, usage: t(usageKey) });
|
|
27
|
+
if (attachment.url)
|
|
28
|
+
patch((c) => apply(c, attachment.url ?? ''));
|
|
29
|
+
};
|
|
30
|
+
const handleSubmit = async () => {
|
|
31
|
+
if (!cfg)
|
|
32
|
+
return;
|
|
33
|
+
setStatus(null);
|
|
34
|
+
try {
|
|
35
|
+
await save(cfg);
|
|
36
|
+
window.location.reload();
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
setStatus(err.message);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
if (isLoading || !cfg) {
|
|
43
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: t('common.form.loading', { defaultValue: 'Loading…' }) }));
|
|
44
|
+
}
|
|
45
|
+
const fileInput = (onChange, label, preview, previewClass = 'h-[400px] w-full bg-contain bg-center bg-no-repeat') => (_jsxs("div", { children: [_jsx("div", { className: previewClass, style: preview ? { backgroundImage: `url(${preview})` } : undefined }), _jsxs("label", { className: "border-primary mt-2 flex cursor-pointer items-center justify-center rounded border-2 border-dashed p-4 text-sm", children: [label, _jsx("input", { type: "file", accept: "image/*", className: "hidden", onChange: (e) => {
|
|
46
|
+
const file = e.target.files?.[0];
|
|
47
|
+
if (file)
|
|
48
|
+
void onChange(file);
|
|
49
|
+
e.target.value = '';
|
|
50
|
+
} })] })] }));
|
|
51
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.theme.title') }), _jsx("span", { children: t('configuration.community.themeDescription') }), _jsx("div", { className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-2", children: [
|
|
52
|
+
['OpenpeepsLight', 'configuration.community.lightTheme.mode'],
|
|
53
|
+
['OpenpeepsDark', 'configuration.community.darkTheme.mode'],
|
|
54
|
+
].map(([base, labelKey]) => (_jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "radio", className: "h-4 w-4", checked: cfg.theme.base === base, onChange: () => patch((c) => (c.theme.base = base)) }), _jsx("span", { children: t(labelKey) })] }, base))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.color') }), _jsx("span", { children: t('configuration.community.colorDescription') }), _jsx("div", { className: "mt-2 flex gap-x-4", children: ['light', 'dark'].map((mode) => (_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [_jsx("span", { className: "mr-4", children: t(`configuration.community.${mode}Theme.color`) }), _jsx("input", { className: "!size-8 !rounded-full", type: "color", value: cfg.theme[mode].primaryHex, onChange: (e) => patch((c) => (c.theme[mode].primaryHex = e.target.value)) }), _jsx("input", { className: "op-input w-32", type: "text", value: cfg.theme[mode].primaryHex, readOnly: true, tabIndex: -1 })] }, mode))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.typographyAndRadii') }), _jsx("div", { className: "mt-2 grid gap-4 sm:grid-cols-2", children: ['light', 'dark'].map((mode) => (_jsxs("div", { className: "space-y-3", children: [_jsx("div", { className: "font-medium", children: t(`configuration.community.${mode}Theme.color`) }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.fontFamily'), _jsx(ThemeFontSelect, { className: "op-input mt-1 w-full", "aria-label": t('configuration.community.fontFamily'), value: cfg.theme[mode].fontFamily, onChange: (fontFamily) => patch((c) => (c.theme[mode].fontFamily = fontFamily)) })] }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.buttonRadius'), _jsx("input", { className: "op-input mt-1 w-full", type: "text", placeholder: "9999px", value: cfg.theme[mode].buttonRadius ?? '', onChange: (e) => patch((c) => (c.theme[mode].buttonRadius =
|
|
55
|
+
e.target.value || undefined)) })] }), _jsxs("label", { className: "block text-sm", children: [t('configuration.community.radius'), _jsx("input", { className: "op-input mt-1 w-full", type: "text", placeholder: "8px", value: cfg.theme[mode].radius ?? '', onChange: (e) => patch((c) => (c.theme[mode].radius = e.target.value || undefined)) })] })] }, mode))) })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.authBackground') }), _jsx("span", { children: t('configuration.community.authBackgroundDescription') }), _jsx("div", { className: "flex flex-wrap gap-x-4", children: ['light', 'dark'].map((mode) => fileInput((file) => uploadInto(file, (c, url) => (c.theme[mode].backgroundAuth = url), 'configuration.community.backgroundAuth'), t(`configuration.community.${mode}Theme.uploadAuthBackground`), cfg.theme[mode].backgroundAuth)) }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.authBackgroundRequirements') })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.background') }), _jsx("span", { children: t('configuration.community.backgroundDescription') }), _jsx("div", { className: "flex flex-wrap gap-x-4", children: ['light', 'dark'].map((mode) => fileInput((file) => uploadInto(file, (c, url) => (c.theme[mode].background = url), 'configuration.community.background'), t(`configuration.community.${mode}Theme.uploadBackground`), cfg.theme[mode].background)) }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.backgroundRequirements') })] }), _jsxs("div", { className: "border p-4", children: [_jsx("h4", { className: "my-4 text-lg font-semibold", children: t('configuration.community.logo') }), _jsx("span", { children: t('configuration.community.logoDescription') }), _jsx("div", { className: "flex flex-wrap gap-x-4", children: ['light', 'dark'].map((mode) => (_jsxs("div", { children: [_jsx("div", { className: "mb-2 flex flex-wrap gap-x-6 gap-y-2", children: _jsx("img", { className: "h-20 object-contain", alt: t('configuration.community.logo'), src: cfg.theme[mode].logoSmall ?? '/img/logo-small.png' }) }), fileInput((file) => uploadInto(file, (c, url) => (c.theme[mode].logoSmall = url), 'configuration.community.logo'), t(`configuration.community.${mode}Theme.uploadLogo`), undefined, 'hidden')] }, mode))) }), _jsx("p", { className: "py-3 text-sm", children: t('configuration.community.logoRequirements') })] }), _jsx(Button, { variant: "default", action: handleSubmit, disabled: !base || equal(base, cfg), title: t('configuration.community.save'), children: t('configuration.community.save') }), status ? (_jsx(Toast, { variant: "error", onDismiss: () => setStatus(null), children: status })) : null] }));
|
|
56
|
+
}
|