@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,274 @@
|
|
|
1
|
+
import { checkCapabilities } from '@openpeepshq/common/lib';
|
|
2
|
+
import { defaultRoles } from '@openpeepshq/common/types';
|
|
3
|
+
const wildcardPrefix = (wildcard) => wildcard.replace(/\*$/, '');
|
|
4
|
+
/** Order-independent equality check for two capability add/remove arrays. */
|
|
5
|
+
export const capabilitySetsEqual = (a, b) => {
|
|
6
|
+
const sa = new Set(a ?? []);
|
|
7
|
+
const sb = new Set(b ?? []);
|
|
8
|
+
if (sa.size !== sb.size)
|
|
9
|
+
return false;
|
|
10
|
+
return [...sa].every((v) => sb.has(v));
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Returns only the columns whose add/remove lists differ from `defaults`, so a
|
|
14
|
+
* save never persists relationship buckets that are identical to the defaults.
|
|
15
|
+
*/
|
|
16
|
+
export const diffRelationshipMatrix = (edited, defaults, columns) => {
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const column of columns) {
|
|
19
|
+
const e = edited?.[column] ?? { add: [], remove: [] };
|
|
20
|
+
const d = defaults?.[column] ?? { add: [], remove: [] };
|
|
21
|
+
if (!capabilitySetsEqual(e.add, d.add) ||
|
|
22
|
+
!capabilitySetsEqual(e.remove, d.remove)) {
|
|
23
|
+
result[column] = { add: e.add ?? [], remove: e.remove ?? [] };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
/** Split editor keys into prefix groups with an optional `…-*` allow-all. */
|
|
29
|
+
export const capabilityEditorGroups = (editorKeys) => {
|
|
30
|
+
const wildcards = [...editorKeys]
|
|
31
|
+
.filter((key) => key.endsWith('*'))
|
|
32
|
+
.sort((a, b) => b.length - a.length);
|
|
33
|
+
const leaves = [...editorKeys].filter((key) => !key.includes('*'));
|
|
34
|
+
const groups = wildcards.map((wildcard) => ({
|
|
35
|
+
prefix: wildcardPrefix(wildcard),
|
|
36
|
+
wildcard,
|
|
37
|
+
leaves: [],
|
|
38
|
+
}));
|
|
39
|
+
for (const leaf of leaves) {
|
|
40
|
+
const group = groups.find((candidate) => leaf.startsWith(candidate.prefix));
|
|
41
|
+
if (group) {
|
|
42
|
+
group.leaves.push(leaf);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return groups
|
|
46
|
+
.filter((group) => group.leaves.length > 0 || group.wildcard)
|
|
47
|
+
.sort((a, b) => a.prefix.localeCompare(b.prefix));
|
|
48
|
+
};
|
|
49
|
+
export const columnAdds = (capabilities, column) => capabilities?.[column]?.add ?? [];
|
|
50
|
+
export const columnRemoves = (capabilities, column) => capabilities?.[column]?.remove ?? [];
|
|
51
|
+
export const hasExplicitCap = (capabilities, column, cap) => columnAdds(capabilities, column).includes(cap);
|
|
52
|
+
export const hasExplicitRemove = (capabilities, column, cap) => columnRemoves(capabilities, column).includes(cap);
|
|
53
|
+
const isMatchedByWildcard = (cap, granted) => granted.includes('*') && cap.startsWith(granted.split('*')[0] ?? '');
|
|
54
|
+
/** True when an add-list wildcard covers `cap` (same rule as `checkCapabilities`). */
|
|
55
|
+
export const isCoveredByWildcard = (capabilities, column, cap) => columnAdds(capabilities, column).some((granted) => isMatchedByWildcard(cap, granted));
|
|
56
|
+
/** True when a remove-list wildcard covers `cap`. */
|
|
57
|
+
export const isCoveredByWildcardRemove = (capabilities, column, cap) => columnRemoves(capabilities, column).some((denied) => isMatchedByWildcard(cap, denied));
|
|
58
|
+
/** Effective grant after wildcards and remove (matches runtime checks). */
|
|
59
|
+
export const isEffectivelyGranted = (capabilities, column, cap) => checkCapabilities([cap], capabilities?.[column] ?? {}).success;
|
|
60
|
+
/** True when the everyone column grants `cap`. */
|
|
61
|
+
export const isGrantedByColumn = (capabilities, everyoneColumn, cap) => everyoneColumn
|
|
62
|
+
? isEffectivelyGranted(capabilities, everyoneColumn, cap)
|
|
63
|
+
: false;
|
|
64
|
+
export const setColumnAdds = (capabilities, column, add) => ({
|
|
65
|
+
...capabilities,
|
|
66
|
+
[column]: {
|
|
67
|
+
...capabilities?.[column],
|
|
68
|
+
add,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
export const setColumnRemoves = (capabilities, column, remove) => ({
|
|
72
|
+
...capabilities,
|
|
73
|
+
[column]: {
|
|
74
|
+
...capabilities?.[column],
|
|
75
|
+
remove,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const implicitAddFromColumn = (options, capabilities, column, cap) => {
|
|
79
|
+
const { everyoneColumn } = options;
|
|
80
|
+
if (!everyoneColumn || column === everyoneColumn) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (!isGrantedByColumn(capabilities, everyoneColumn, cap)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (hasExplicitCap(capabilities, column, cap)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (isCoveredByWildcard(capabilities, column, cap)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
};
|
|
94
|
+
const implicitRemoveFromColumn = (capabilities, everyoneColumn, cap) => everyoneColumn
|
|
95
|
+
? isCoveredByWildcardRemove(capabilities, everyoneColumn, cap)
|
|
96
|
+
: false;
|
|
97
|
+
export const getCapabilityCellState = (options, capabilities, column, cap) => {
|
|
98
|
+
const { everyoneColumn } = options;
|
|
99
|
+
const explicitAdd = hasExplicitCap(capabilities, column, cap);
|
|
100
|
+
const explicitRemove = hasExplicitRemove(capabilities, column, cap);
|
|
101
|
+
const implicitAddHere = isCoveredByWildcard(capabilities, column, cap) && !explicitAdd;
|
|
102
|
+
const implicitAddFromEveryone = implicitAddFromColumn(options, capabilities, column, cap);
|
|
103
|
+
if (everyoneColumn &&
|
|
104
|
+
column !== everyoneColumn &&
|
|
105
|
+
implicitRemoveFromColumn(capabilities, everyoneColumn, cap)) {
|
|
106
|
+
return 'implicit-remove';
|
|
107
|
+
}
|
|
108
|
+
if (explicitRemove) {
|
|
109
|
+
return 'specific-remove';
|
|
110
|
+
}
|
|
111
|
+
if (isCoveredByWildcardRemove(capabilities, column, cap)) {
|
|
112
|
+
return 'implicit-remove';
|
|
113
|
+
}
|
|
114
|
+
if (explicitAdd) {
|
|
115
|
+
if (implicitAddFromEveryone) {
|
|
116
|
+
return 'implicit-add';
|
|
117
|
+
}
|
|
118
|
+
return 'specific-add';
|
|
119
|
+
}
|
|
120
|
+
if (implicitAddHere || implicitAddFromEveryone) {
|
|
121
|
+
return 'implicit-add';
|
|
122
|
+
}
|
|
123
|
+
return 'none';
|
|
124
|
+
};
|
|
125
|
+
const patchColumn = (capabilities, column, add, remove) => ({
|
|
126
|
+
...capabilities,
|
|
127
|
+
[column]: {
|
|
128
|
+
...capabilities?.[column],
|
|
129
|
+
add,
|
|
130
|
+
remove,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
const stripPrefixFromRemove = (remove, prefix) => remove.filter((item) => !item.startsWith(prefix));
|
|
134
|
+
/** Drop redundant explicit entries after wildcard add/remove changes. */
|
|
135
|
+
export const normalizeColumnCapabilities = (options, capabilities, column) => {
|
|
136
|
+
const { editorKeys, everyoneColumn } = options;
|
|
137
|
+
let add = [...columnAdds(capabilities, column)];
|
|
138
|
+
let remove = [...columnRemoves(capabilities, column)];
|
|
139
|
+
const snapshot = () => patchColumn(capabilities, column, add, remove);
|
|
140
|
+
for (const cap of editorKeys) {
|
|
141
|
+
const caps = snapshot();
|
|
142
|
+
if (everyoneColumn &&
|
|
143
|
+
column !== everyoneColumn &&
|
|
144
|
+
isGrantedByColumn(caps, everyoneColumn, cap)) {
|
|
145
|
+
add = add.filter((item) => item !== cap);
|
|
146
|
+
}
|
|
147
|
+
if (everyoneColumn &&
|
|
148
|
+
column !== everyoneColumn &&
|
|
149
|
+
implicitRemoveFromColumn(caps, everyoneColumn, cap)) {
|
|
150
|
+
add = add.filter((item) => item !== cap);
|
|
151
|
+
if (!cap.endsWith('*') && remove.includes(cap)) {
|
|
152
|
+
remove = remove.filter((item) => item !== cap);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (isCoveredByWildcardRemove(caps, column, cap)) {
|
|
156
|
+
add = add.filter((item) => item !== cap);
|
|
157
|
+
}
|
|
158
|
+
if (isCoveredByWildcard(caps, column, cap) &&
|
|
159
|
+
add.includes(cap) &&
|
|
160
|
+
!cap.endsWith('*')) {
|
|
161
|
+
add = add.filter((item) => item !== cap);
|
|
162
|
+
}
|
|
163
|
+
if (isCoveredByWildcardRemove(caps, column, cap) &&
|
|
164
|
+
remove.includes(cap) &&
|
|
165
|
+
!cap.endsWith('*')) {
|
|
166
|
+
remove = remove.filter((item) => item !== cap);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (const entry of add) {
|
|
170
|
+
if (!entry.endsWith('*'))
|
|
171
|
+
continue;
|
|
172
|
+
const prefix = wildcardPrefix(entry);
|
|
173
|
+
add = add.filter((item) => item === entry || item.endsWith('*') || !item.startsWith(prefix));
|
|
174
|
+
}
|
|
175
|
+
for (const entry of remove) {
|
|
176
|
+
if (!entry.endsWith('*'))
|
|
177
|
+
continue;
|
|
178
|
+
const prefix = wildcardPrefix(entry);
|
|
179
|
+
remove = remove.filter((item) => item === entry || item.endsWith('*') || !item.startsWith(prefix));
|
|
180
|
+
add = add.filter((item) => !isMatchedByWildcard(item, entry));
|
|
181
|
+
}
|
|
182
|
+
return patchColumn(capabilities, column, add, remove);
|
|
183
|
+
};
|
|
184
|
+
export const normalizeCapabilities = (options, capabilities) => {
|
|
185
|
+
let next = capabilities;
|
|
186
|
+
for (const column of options.columns) {
|
|
187
|
+
next = normalizeColumnCapabilities(options, next, column);
|
|
188
|
+
}
|
|
189
|
+
return next;
|
|
190
|
+
};
|
|
191
|
+
export const cycleCapabilityCell = (options, capabilities, column, cap) => {
|
|
192
|
+
const state = getCapabilityCellState(options, capabilities, column, cap);
|
|
193
|
+
if (state === 'implicit-remove') {
|
|
194
|
+
return capabilities;
|
|
195
|
+
}
|
|
196
|
+
const add = columnAdds(capabilities, column);
|
|
197
|
+
const remove = columnRemoves(capabilities, column);
|
|
198
|
+
const prefix = cap.endsWith('*') ? wildcardPrefix(cap) : undefined;
|
|
199
|
+
let next;
|
|
200
|
+
switch (state) {
|
|
201
|
+
case 'implicit-add':
|
|
202
|
+
next = setColumnRemoves(capabilities, column, [...remove, cap]);
|
|
203
|
+
break;
|
|
204
|
+
case 'specific-remove': {
|
|
205
|
+
const { everyoneColumn } = options;
|
|
206
|
+
const implicitGrant = (isCoveredByWildcard(capabilities, column, cap) &&
|
|
207
|
+
!hasExplicitCap(capabilities, column, cap)) ||
|
|
208
|
+
(everyoneColumn
|
|
209
|
+
? implicitAddFromColumn(options, capabilities, column, cap)
|
|
210
|
+
: false);
|
|
211
|
+
next = setColumnRemoves(capabilities, column, remove.filter((item) => item !== cap));
|
|
212
|
+
if (!implicitGrant && prefix) {
|
|
213
|
+
next = setColumnRemoves(next, column, stripPrefixFromRemove(columnRemoves(next, column), prefix));
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case 'specific-add':
|
|
218
|
+
next = patchColumn(capabilities, column, add.filter((item) => item !== cap), [...remove, cap]);
|
|
219
|
+
break;
|
|
220
|
+
case 'none':
|
|
221
|
+
next = patchColumn(capabilities, column, [...add, cap], remove);
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
next = capabilities;
|
|
225
|
+
}
|
|
226
|
+
return normalizeCapabilities(options, next);
|
|
227
|
+
};
|
|
228
|
+
/** @deprecated Use {@link cycleCapabilityCell} for explicit state cycling. */
|
|
229
|
+
export const toggleCapabilityCell = (options, capabilities, column, cap) => cycleCapabilityCell(options, capabilities, column, cap);
|
|
230
|
+
/**
|
|
231
|
+
* Derive a role key from a display name: lowercase letters and hyphens only
|
|
232
|
+
* (role keys match /^[a-z-]{1,32}$/), capped at 32 characters. Returns ''
|
|
233
|
+
* when the name yields no usable key.
|
|
234
|
+
*/
|
|
235
|
+
export const roleKeyFromName = (name) => {
|
|
236
|
+
const base = name
|
|
237
|
+
.trim()
|
|
238
|
+
.toLowerCase()
|
|
239
|
+
.replace(/[^a-z]+/g, '-')
|
|
240
|
+
.replace(/-+/g, '-')
|
|
241
|
+
.replace(/^-|-$/g, '');
|
|
242
|
+
return base.length > 32 ? base.slice(0, 32).replace(/-$/, '') : base;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Presentational filter for the roles matrix: keeps roles whose default/custom
|
|
246
|
+
* class is enabled and whose display name or key contains the
|
|
247
|
+
* case-insensitive filter string.
|
|
248
|
+
*/
|
|
249
|
+
export const filterRoles = (roles, { showDefault, showCustom, filter }) => {
|
|
250
|
+
const needle = filter.trim().toLowerCase();
|
|
251
|
+
return roles.filter((role) => {
|
|
252
|
+
if (role.default ? !showDefault : !showCustom)
|
|
253
|
+
return false;
|
|
254
|
+
if (!needle)
|
|
255
|
+
return true;
|
|
256
|
+
return ((role.displayName ?? '').toLowerCase().includes(needle) ||
|
|
257
|
+
role.key.toLowerCase().includes(needle));
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
const factoryRoleCapabilities = Object.fromEntries(defaultRoles.map((role) => [
|
|
261
|
+
role.key,
|
|
262
|
+
role.capabilities ?? { add: [], remove: [] },
|
|
263
|
+
]));
|
|
264
|
+
/**
|
|
265
|
+
* Reference capabilities per role key for change highlighting and "restore
|
|
266
|
+
* defaults": factory defaults for built-in roles, last-saved capabilities for
|
|
267
|
+
* custom roles (which have no factory default).
|
|
268
|
+
*/
|
|
269
|
+
export const roleDefaultCapabilities = (roles) => Object.fromEntries(roles.map((role) => [
|
|
270
|
+
role.key,
|
|
271
|
+
role.default && factoryRoleCapabilities[role.key]
|
|
272
|
+
? factoryRoleCapabilities[role.key]
|
|
273
|
+
: (role.capabilities ?? { add: [], remove: [] }),
|
|
274
|
+
]));
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { type ZodType } from 'zod';
|
|
2
2
|
import type { ConfigElement, ConfigTree } from '@openpeepshq/common/types';
|
|
3
3
|
export declare const unwrap: (schema: ZodType) => ZodType;
|
|
4
|
+
/**
|
|
5
|
+
* Value cloned when a config list gains a row. `.parse(undefined)` only
|
|
6
|
+
* succeeds for schemas that accept undefined (`.default()`, `.optional()`).
|
|
7
|
+
* A bare `z.string()` — `federation.allowedHosts` on the server settings
|
|
8
|
+
* page — throws and takes down the editor.
|
|
9
|
+
*/
|
|
10
|
+
export declare const defaultFromSchema: (schema: ZodType) => unknown;
|
|
4
11
|
export declare const diffConfigTrees: (lhs: ConfigTree, rhs: ConfigTree) => any;
|
|
5
12
|
export declare const diffConfigElements: (lhs: ConfigElement, rhs: ConfigElement) => any;
|
|
6
13
|
export declare const equal: (lhs: ConfigTree, rhs: ConfigTree) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Translation key for a configuration field label. Array indices are
|
|
16
|
+
* positional, so every entry of a list shares its siblings' labels.
|
|
17
|
+
*/
|
|
18
|
+
export declare const configurationLabelKey: (path: (string | number)[]) => string;
|
|
7
19
|
export declare const isFieldHidden: (schema: ZodType) => boolean;
|
|
@@ -15,8 +15,7 @@ export const unwrap = (schema) => {
|
|
|
15
15
|
return unwrap(s.def.innerType);
|
|
16
16
|
}
|
|
17
17
|
const zodClassic = z;
|
|
18
|
-
if (zodClassic.ZodEffects &&
|
|
19
|
-
schema instanceof zodClassic.ZodEffects) {
|
|
18
|
+
if (zodClassic.ZodEffects && schema instanceof zodClassic.ZodEffects) {
|
|
20
19
|
return unwrap(s.sourceType());
|
|
21
20
|
}
|
|
22
21
|
if (zodClassic.ZodTransformer &&
|
|
@@ -31,6 +30,35 @@ export const unwrap = (schema) => {
|
|
|
31
30
|
}
|
|
32
31
|
return schema;
|
|
33
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Value cloned when a config list gains a row. `.parse(undefined)` only
|
|
35
|
+
* succeeds for schemas that accept undefined (`.default()`, `.optional()`).
|
|
36
|
+
* A bare `z.string()` — `federation.allowedHosts` on the server settings
|
|
37
|
+
* page — throws and takes down the editor.
|
|
38
|
+
*/
|
|
39
|
+
export const defaultFromSchema = (schema) => {
|
|
40
|
+
const parsed = schema.safeParse(undefined);
|
|
41
|
+
if (parsed.success)
|
|
42
|
+
return parsed.data;
|
|
43
|
+
const inner = unwrap(schema);
|
|
44
|
+
if (inner instanceof z.ZodString)
|
|
45
|
+
return '';
|
|
46
|
+
if (inner instanceof z.ZodNumber)
|
|
47
|
+
return 0;
|
|
48
|
+
if (inner instanceof z.ZodBoolean)
|
|
49
|
+
return false;
|
|
50
|
+
if (inner instanceof z.ZodArray)
|
|
51
|
+
return [];
|
|
52
|
+
if (inner instanceof z.ZodEnum)
|
|
53
|
+
return inner.options[0];
|
|
54
|
+
if (inner instanceof z.ZodObject) {
|
|
55
|
+
return Object.fromEntries(Object.entries(inner.shape).map(([key, field]) => [
|
|
56
|
+
key,
|
|
57
|
+
defaultFromSchema(field),
|
|
58
|
+
]));
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
};
|
|
34
62
|
const isDate = (d) => d instanceof Date;
|
|
35
63
|
const isEmpty = (o) => Object.keys(o).length === 0;
|
|
36
64
|
const isObject = (o) => o != null && typeof o === 'object';
|
|
@@ -74,6 +102,14 @@ export const diffConfigElements = (lhs, rhs) => {
|
|
|
74
102
|
return diffConfigTrees(lhs, rhs);
|
|
75
103
|
};
|
|
76
104
|
export const equal = (lhs, rhs) => Object.keys(diffConfigTrees(lhs, rhs)).length === 0;
|
|
105
|
+
/**
|
|
106
|
+
* Translation key for a configuration field label. Array indices are
|
|
107
|
+
* positional, so every entry of a list shares its siblings' labels.
|
|
108
|
+
*/
|
|
109
|
+
export const configurationLabelKey = (path) => [
|
|
110
|
+
'configuration',
|
|
111
|
+
...path.filter((segment) => !/^\d+$/.test(String(segment))),
|
|
112
|
+
].join('.');
|
|
77
113
|
export const isFieldHidden = (schema) => {
|
|
78
114
|
const description = schema.description;
|
|
79
115
|
if (description === 'fixed' || description === 'hidden')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CapabilityCellState, type CapabilityEditorGroup, type MatrixCapabilities } from './capabilityMatrix';
|
|
2
|
+
export { columnAdds as relationshipAdds, columnRemoves as relationshipRemoves, hasExplicitCap, hasExplicitRemove, isCoveredByWildcard, isCoveredByWildcardRemove, isEffectivelyGranted, setColumnAdds as setRelationshipAdds, setColumnRemoves as setRelationshipRemoves, } from './capabilityMatrix';
|
|
3
|
+
export type { CapabilityCellState, CapabilityEditorGroup };
|
|
4
|
+
/** @deprecated Prefer {@link capabilityEditorGroups} from `capabilityMatrix`. */
|
|
5
|
+
export declare const groupCapabilityEditorGroups: () => CapabilityEditorGroup[];
|
|
6
|
+
export declare const isGrantedByNone: (capabilities: MatrixCapabilities, cap: string) => boolean;
|
|
7
|
+
export declare const getCapabilityCellState: (capabilities: MatrixCapabilities, column: string, cap: string) => CapabilityCellState;
|
|
8
|
+
export declare const normalizeRelationshipCapabilities: (capabilities: MatrixCapabilities, column: string) => MatrixCapabilities;
|
|
9
|
+
export declare const normalizeGroupCapabilities: (capabilities: MatrixCapabilities) => MatrixCapabilities;
|
|
10
|
+
export declare const cycleCapabilityCell: (capabilities: MatrixCapabilities, column: string, cap: string) => MatrixCapabilities;
|
|
11
|
+
/** @deprecated Use {@link cycleCapabilityCell} for explicit state cycling. */
|
|
12
|
+
export declare const toggleRelationshipCapability: (capabilities: MatrixCapabilities, column: string, cap: string) => MatrixCapabilities;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { groupCapabilityEditorKeys, groupCapabilityEditorRelationships, } from '@openpeepshq/common/types';
|
|
2
|
+
import { capabilityEditorGroups, getCapabilityCellState as _getCapabilityCellState, cycleCapabilityCell as _cycleCapabilityCell, normalizeColumnCapabilities as _normalizeColumnCapabilities, normalizeCapabilities as _normalizeCapabilities, toggleCapabilityCell as _toggleCapabilityCell, isGrantedByColumn, } from './capabilityMatrix.js';
|
|
3
|
+
export { columnAdds as relationshipAdds, columnRemoves as relationshipRemoves, hasExplicitCap, hasExplicitRemove, isCoveredByWildcard, isCoveredByWildcardRemove, isEffectivelyGranted, setColumnAdds as setRelationshipAdds, setColumnRemoves as setRelationshipRemoves, } from './capabilityMatrix.js';
|
|
4
|
+
const groupOptions = {
|
|
5
|
+
editorKeys: [...groupCapabilityEditorKeys],
|
|
6
|
+
columns: [...groupCapabilityEditorRelationships],
|
|
7
|
+
everyoneColumn: 'none',
|
|
8
|
+
};
|
|
9
|
+
/** @deprecated Prefer {@link capabilityEditorGroups} from `capabilityMatrix`. */
|
|
10
|
+
export const groupCapabilityEditorGroups = () => capabilityEditorGroups(groupOptions.editorKeys);
|
|
11
|
+
export const isGrantedByNone = (capabilities, cap) => isGrantedByColumn(capabilities, 'none', cap);
|
|
12
|
+
export const getCapabilityCellState = (capabilities, column, cap) => _getCapabilityCellState(groupOptions, capabilities, column, cap);
|
|
13
|
+
export const normalizeRelationshipCapabilities = (capabilities, column) => _normalizeColumnCapabilities(groupOptions, capabilities, column);
|
|
14
|
+
export const normalizeGroupCapabilities = (capabilities) => _normalizeCapabilities(groupOptions, capabilities);
|
|
15
|
+
export const cycleCapabilityCell = (capabilities, column, cap) => _cycleCapabilityCell(groupOptions, capabilities, column, cap);
|
|
16
|
+
/** @deprecated Use {@link cycleCapabilityCell} for explicit state cycling. */
|
|
17
|
+
export const toggleRelationshipCapability = (capabilities, column, cap) => _toggleCapabilityCell(groupOptions, capabilities, column, cap);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
export type GroupFormFieldErrors = {
|
|
3
|
+
displayName?: string;
|
|
4
|
+
handle?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const hasGroupFormFieldErrors: (errors: GroupFormFieldErrors) => boolean;
|
|
7
|
+
export declare const groupFormFieldErrors: (data: {
|
|
8
|
+
displayName?: string;
|
|
9
|
+
handle?: string;
|
|
10
|
+
}, t: TFunction, options?: {
|
|
11
|
+
skipHandle?: boolean;
|
|
12
|
+
}) => GroupFormFieldErrors;
|
|
13
|
+
/** Server conflict when a group/profile handle is already taken. */
|
|
14
|
+
export declare const isDuplicateHandleError: (err: unknown) => boolean;
|
|
15
|
+
export declare const duplicateHandleMessage: (t: TFunction) => string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { accountNameSchema, GROUP_DISPLAY_NAME_MAX_LENGTH, } from '@openpeepshq/common/types';
|
|
2
|
+
export const hasGroupFormFieldErrors = (errors) => Boolean(errors.displayName || errors.handle);
|
|
3
|
+
const displayNameMaxLengthMessage = (t) => t('groups.form.displayNameMaxLength', {
|
|
4
|
+
defaultValue: `Group name should be ${GROUP_DISPLAY_NAME_MAX_LENGTH} characters or fewer`,
|
|
5
|
+
max: GROUP_DISPLAY_NAME_MAX_LENGTH,
|
|
6
|
+
});
|
|
7
|
+
const handleErrorMessage = (issue, t) => issue === 'Handle is reserved'
|
|
8
|
+
? t('profile.form.handleReserved', {
|
|
9
|
+
defaultValue: 'That handle is reserved. Please choose another.',
|
|
10
|
+
})
|
|
11
|
+
: t('profile.form.handleInvalid', {
|
|
12
|
+
defaultValue: 'Handle must be 1–16 characters: letters, numbers, underscores, or hyphens (no spaces or punctuation)',
|
|
13
|
+
});
|
|
14
|
+
export const groupFormFieldErrors = (data, t, options) => {
|
|
15
|
+
const errors = {};
|
|
16
|
+
const displayName = data.displayName ?? '';
|
|
17
|
+
const handle = data.handle ?? '';
|
|
18
|
+
if (displayName.length > GROUP_DISPLAY_NAME_MAX_LENGTH) {
|
|
19
|
+
errors.displayName = displayNameMaxLengthMessage(t);
|
|
20
|
+
}
|
|
21
|
+
if (options?.skipHandle) {
|
|
22
|
+
return errors;
|
|
23
|
+
}
|
|
24
|
+
if (handle.length > 0) {
|
|
25
|
+
const result = accountNameSchema.safeParse(handle);
|
|
26
|
+
if (!result.success) {
|
|
27
|
+
errors.handle = handleErrorMessage(result.error.issues[0]?.message, t);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (!displayName && !errors.displayName) {
|
|
31
|
+
errors.displayName = t('handle.validation.error', {
|
|
32
|
+
defaultValue: 'A handle or display name is required',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return errors;
|
|
36
|
+
};
|
|
37
|
+
const apiErrorCandidate = (err) => {
|
|
38
|
+
if (typeof err !== 'object' || err === null) {
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
const record = err;
|
|
42
|
+
const nested = typeof record.error === 'object' && record.error !== null
|
|
43
|
+
? record.error
|
|
44
|
+
: undefined;
|
|
45
|
+
const candidate = record.errorKey ??
|
|
46
|
+
record.key ??
|
|
47
|
+
nested?.key ??
|
|
48
|
+
nested?.message ??
|
|
49
|
+
record.message;
|
|
50
|
+
return typeof candidate === 'string' ? candidate : '';
|
|
51
|
+
};
|
|
52
|
+
/** Server conflict when a group/profile handle is already taken. */
|
|
53
|
+
export const isDuplicateHandleError = (err) => {
|
|
54
|
+
const candidate = apiErrorCandidate(err);
|
|
55
|
+
return (candidate === 'groups.handleExists' ||
|
|
56
|
+
candidate.endsWith('.handleExists') ||
|
|
57
|
+
candidate.includes('groups.handleExists'));
|
|
58
|
+
};
|
|
59
|
+
export const duplicateHandleMessage = (t) => t('groups.handleExists', {
|
|
60
|
+
defaultValue: 'This handle is already in use. Please try a different one.',
|
|
61
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fallback rendering shared by Avatar and GroupAvatar: letter initials on a
|
|
3
|
+
* background derived from the handle.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getInitials: (displayName?: string, handle?: string) => string;
|
|
6
|
+
export declare const hueFromHandle: (handle: string) => number;
|
|
7
|
+
export declare const initialsBackground: (hue: number, dark: boolean) => string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fallback rendering shared by Avatar and GroupAvatar: letter initials on a
|
|
3
|
+
* background derived from the handle.
|
|
4
|
+
*/
|
|
5
|
+
export const getInitials = (displayName, handle) => {
|
|
6
|
+
const name = displayName || handle || '?';
|
|
7
|
+
const parts = name.split(' ');
|
|
8
|
+
return [parts.at(0), parts.at(-1)]
|
|
9
|
+
.filter(Boolean)
|
|
10
|
+
.map((part) => part?.substring(0, 1).toUpperCase())
|
|
11
|
+
.join('');
|
|
12
|
+
};
|
|
13
|
+
// Deterministic 0-359 hue from the handle so each account keeps a stable
|
|
14
|
+
// background color across sessions and between light and dark mode.
|
|
15
|
+
export const hueFromHandle = (handle) => {
|
|
16
|
+
let hash = 0;
|
|
17
|
+
for (const char of handle) {
|
|
18
|
+
hash = (hash * 31 + char.charCodeAt(0)) >>> 0;
|
|
19
|
+
}
|
|
20
|
+
return hash % 360;
|
|
21
|
+
};
|
|
22
|
+
// Same hue in both modes; dark mode uses muted dark shades, light mode pastels.
|
|
23
|
+
export const initialsBackground = (hue, dark) => dark ? `hsl(${hue} 30% 24%)` : `hsl(${hue} 50% 85%)`;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type { QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import type { NotificationStats } from '@openpeepshq/common/types';
|
|
1
|
+
import type { InfiniteData, QueryClient, QueryKey } from '@tanstack/react-query';
|
|
2
|
+
import type { NotificationStats, PublicNotification } from '@openpeepshq/common/types';
|
|
3
3
|
export declare const NOTIFICATION_STATS_QUERY_KEY: readonly ["profiles", "current", "notifications", "stats"];
|
|
4
|
+
/** Feed infinite-query keys end in `{ limit }`; stats/types use a string segment. */
|
|
5
|
+
export declare const isNotificationsFeedQueryKey: (queryKey: QueryKey) => boolean;
|
|
6
|
+
export declare const markNotificationPagesSeen: (current: InfiniteData<PublicNotification[]> | undefined) => InfiniteData<PublicNotification[]> | undefined;
|
|
7
|
+
export declare const markCachedNotificationsSeen: (queryClient: QueryClient) => void;
|
|
4
8
|
export declare const syncAppBadgeCount: (unseen: number) => Promise<void>;
|
|
5
9
|
export declare const applyNotificationStatsToCache: (queryClient: QueryClient, stats: NotificationStats) => void;
|
|
@@ -4,6 +4,23 @@ export const NOTIFICATION_STATS_QUERY_KEY = [
|
|
|
4
4
|
'notifications',
|
|
5
5
|
'stats',
|
|
6
6
|
];
|
|
7
|
+
/** Feed infinite-query keys end in `{ limit }`; stats/types use a string segment. */
|
|
8
|
+
export const isNotificationsFeedQueryKey = (queryKey) => queryKey[0] === 'profiles' &&
|
|
9
|
+
queryKey[1] === 'current' &&
|
|
10
|
+
queryKey[2] === 'notifications' &&
|
|
11
|
+
typeof queryKey[3] === 'object' &&
|
|
12
|
+
queryKey[3] !== null;
|
|
13
|
+
export const markNotificationPagesSeen = (current) => {
|
|
14
|
+
if (!current?.pages)
|
|
15
|
+
return current;
|
|
16
|
+
return {
|
|
17
|
+
...current,
|
|
18
|
+
pages: current.pages.map((page) => page.map((notification) => notification.seen ? notification : { ...notification, seen: true })),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export const markCachedNotificationsSeen = (queryClient) => {
|
|
22
|
+
queryClient.setQueriesData({ predicate: (query) => isNotificationsFeedQueryKey(query.queryKey) }, markNotificationPagesSeen);
|
|
23
|
+
};
|
|
7
24
|
export const syncAppBadgeCount = async (unseen) => {
|
|
8
25
|
if (typeof navigator === 'undefined')
|
|
9
26
|
return;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const SKIN_TONE_MODIFIERS: string[];
|
|
2
|
+
export declare const SKIN_TONE_OPTIONS: readonly [{
|
|
3
|
+
readonly tone: 0;
|
|
4
|
+
readonly emoji: "🖐️";
|
|
5
|
+
}, {
|
|
6
|
+
readonly tone: 1;
|
|
7
|
+
readonly emoji: "🖐🏻";
|
|
8
|
+
}, {
|
|
9
|
+
readonly tone: 2;
|
|
10
|
+
readonly emoji: "🖐🏼";
|
|
11
|
+
}, {
|
|
12
|
+
readonly tone: 3;
|
|
13
|
+
readonly emoji: "🖐🏽";
|
|
14
|
+
}, {
|
|
15
|
+
readonly tone: 4;
|
|
16
|
+
readonly emoji: "🖐🏾";
|
|
17
|
+
}, {
|
|
18
|
+
readonly tone: 5;
|
|
19
|
+
readonly emoji: "🖐🏿";
|
|
20
|
+
}];
|
|
21
|
+
export declare function stripSkinTone(emoji: string): string;
|
|
22
|
+
export declare function supportsSkinTone(emoji: string): boolean;
|
|
23
|
+
export declare function applySkinTone(emoji: string, skinTone: number): string;
|
|
24
|
+
export declare function applySkinToneToDefault(emoji: string, skinTone: number): string;
|
|
25
|
+
export declare function applySkinToneToRecentEmojis(recentEmojis: string[], skinTone: number): string[];
|
|
26
|
+
export declare function isDefaultEmoji(emoji: string): boolean;
|
|
27
|
+
export declare function addRecentEmoji(recentEmojis: string[], emoji: string): string[];
|
|
28
|
+
export declare function getSkinToneEmoji(tone: number): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { emojis } from '../components/jams/constants.js';
|
|
2
|
+
const SKIN_TONE_PATTERN = /[\u{1F3FB}-\u{1F3FF}]/u;
|
|
3
|
+
export const SKIN_TONE_MODIFIERS = [
|
|
4
|
+
'',
|
|
5
|
+
'\u{1F3FB}',
|
|
6
|
+
'\u{1F3FC}',
|
|
7
|
+
'\u{1F3FD}',
|
|
8
|
+
'\u{1F3FE}',
|
|
9
|
+
'\u{1F3FF}',
|
|
10
|
+
];
|
|
11
|
+
export const SKIN_TONE_OPTIONS = [
|
|
12
|
+
{ tone: 0, emoji: '🖐️' },
|
|
13
|
+
{ tone: 1, emoji: '🖐🏻' },
|
|
14
|
+
{ tone: 2, emoji: '🖐🏼' },
|
|
15
|
+
{ tone: 3, emoji: '🖐🏽' },
|
|
16
|
+
{ tone: 4, emoji: '🖐🏾' },
|
|
17
|
+
{ tone: 5, emoji: '🖐🏿' },
|
|
18
|
+
];
|
|
19
|
+
const defaultBaseEmojis = emojis.map(stripSkinTone);
|
|
20
|
+
const skinToneCapableDefaults = new Set(emojis.filter((emoji) => SKIN_TONE_PATTERN.test(emoji)).map(stripSkinTone));
|
|
21
|
+
export function stripSkinTone(emoji) {
|
|
22
|
+
return emoji.replace(SKIN_TONE_PATTERN, '');
|
|
23
|
+
}
|
|
24
|
+
export function supportsSkinTone(emoji) {
|
|
25
|
+
const base = stripSkinTone(emoji);
|
|
26
|
+
return SKIN_TONE_PATTERN.test(emoji) || skinToneCapableDefaults.has(base);
|
|
27
|
+
}
|
|
28
|
+
export function applySkinTone(emoji, skinTone) {
|
|
29
|
+
if (!supportsSkinTone(emoji)) {
|
|
30
|
+
return emoji;
|
|
31
|
+
}
|
|
32
|
+
const base = stripSkinTone(emoji);
|
|
33
|
+
return base + (SKIN_TONE_MODIFIERS[skinTone] ?? '');
|
|
34
|
+
}
|
|
35
|
+
export function applySkinToneToDefault(emoji, skinTone) {
|
|
36
|
+
const base = stripSkinTone(emoji);
|
|
37
|
+
if (!skinToneCapableDefaults.has(base)) {
|
|
38
|
+
return base;
|
|
39
|
+
}
|
|
40
|
+
return applySkinTone(emoji, skinTone);
|
|
41
|
+
}
|
|
42
|
+
export function applySkinToneToRecentEmojis(recentEmojis, skinTone) {
|
|
43
|
+
return recentEmojis.map((emoji) => applySkinTone(emoji, skinTone));
|
|
44
|
+
}
|
|
45
|
+
export function isDefaultEmoji(emoji) {
|
|
46
|
+
return defaultBaseEmojis.includes(stripSkinTone(emoji));
|
|
47
|
+
}
|
|
48
|
+
export function addRecentEmoji(recentEmojis, emoji) {
|
|
49
|
+
const withoutDuplicate = recentEmojis.filter((item) => item !== emoji);
|
|
50
|
+
return [emoji, ...withoutDuplicate].slice(0, 3);
|
|
51
|
+
}
|
|
52
|
+
export function getSkinToneEmoji(tone) {
|
|
53
|
+
return (SKIN_TONE_OPTIONS.find((option) => option.tone === tone)?.emoji ??
|
|
54
|
+
SKIN_TONE_OPTIONS[0].emoji);
|
|
55
|
+
}
|
|
@@ -18,12 +18,13 @@ export type NavTarget = {
|
|
|
18
18
|
} | {
|
|
19
19
|
type: 'post';
|
|
20
20
|
id: string;
|
|
21
|
+
occurrence?: string;
|
|
21
22
|
} | {
|
|
22
23
|
type: 'postNew';
|
|
23
24
|
} | {
|
|
24
25
|
type: 'group';
|
|
25
26
|
handle?: string;
|
|
26
|
-
view?: 'info' | 'edit' | 'members';
|
|
27
|
+
view?: 'info' | 'edit' | 'edit-info' | 'edit-roles' | 'members';
|
|
27
28
|
} | {
|
|
28
29
|
type: 'groups';
|
|
29
30
|
view?: 'new';
|
package/dist/pages/About.js
CHANGED
|
@@ -2,18 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Link as RouterLink, useNavigate } from 'react-router-dom';
|
|
3
3
|
import { Link } from '@openpeepshq/react-ui';
|
|
4
4
|
import { useT } from '../index.js';
|
|
5
|
-
import { AuthLayout
|
|
5
|
+
import { AuthLayout } from '../components/index.js';
|
|
6
|
+
import { useCommunityInfoPages } from '../hooks/index.js';
|
|
6
7
|
import { Markdown } from '../lib/Markdown.js';
|
|
7
8
|
export function About() {
|
|
8
9
|
const t = useT();
|
|
9
10
|
const navigate = useNavigate();
|
|
10
|
-
const
|
|
11
|
-
const currentProfile = useCurrentProfile();
|
|
12
|
-
const communityName = serverInfo.communityConfig?.info?.name ?? 'AllPeep';
|
|
13
|
-
const aboutPage = serverInfo.communityConfig?.content?.aboutPage ??
|
|
14
|
-
'This is a community hosted on AllPeep.';
|
|
11
|
+
const { communityName, aboutPage, showVisitorLinks, openRegistrations, publicContent, } = useCommunityInfoPages();
|
|
15
12
|
return (_jsxs(AuthLayout, { noRedirect: true, navigate: (url) => void navigate(url), children: [_jsx("h1", { className: "h1 pb-4 font-bold", children: t('about.welcomeTo', {
|
|
16
13
|
defaultValue: `Welcome to ${communityName}`,
|
|
17
14
|
name: communityName,
|
|
18
|
-
}) }), _jsx(Markdown, { source: aboutPage }),
|
|
15
|
+
}) }), _jsx(Markdown, { source: aboutPage }), showVisitorLinks && (_jsxs("div", { className: "flex justify-between px-2 pt-4", children: [openRegistrations && (_jsxs("span", { children: ["Don't have an account?", ' ', _jsx(Link, { action: "/auth/register", className: "text-sm", children: "Sign Up" })] })), publicContent && (_jsx("span", { children: _jsx(RouterLink, { to: "/feeds/local", className: "op-anchor text-sm", children: "See community feed" }) }))] }))] }));
|
|
19
16
|
}
|