@openpeepshq/react 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accounts/SignUpLoginModal.js +2 -2
- package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
- package/dist/components/configuration/ConfigMenuButton.js +12 -0
- package/dist/components/configuration/ConfigurationTree.js +1 -1
- package/dist/components/configuration/index.d.ts +2 -0
- package/dist/components/configuration/index.js +1 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
- package/dist/components/conversations/ConversationMessageBubble.js +4 -5
- package/dist/components/conversations/CreateNewConversation.js +10 -42
- package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
- package/dist/components/conversations/MessageInThread.js +1 -2
- package/dist/components/form/ImageEditModal.js +2 -4
- package/dist/components/form/ImageInput.js +13 -8
- package/dist/components/form/LocationInput.js +1 -1
- package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
- package/dist/components/groups/AddGroupMembersButton.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupAvatar.js +4 -4
- package/dist/components/groups/GroupCard.js +3 -3
- package/dist/components/groups/GroupHeader.js +1 -1
- package/dist/components/groups/GroupMembersList.js +2 -3
- package/dist/components/groups/GroupOptionsMenu.js +12 -6
- package/dist/components/groups/JoinGroupButton.js +3 -20
- package/dist/components/jams/CreateNewJam.js +4 -4
- package/dist/components/jams/JamCallParticipant.js +17 -7
- package/dist/components/jams/JamCapacityGate.js +1 -1
- package/dist/components/jams/JamChatDrawer.js +2 -2
- package/dist/components/jams/JamConference.js +1 -1
- package/dist/components/jams/JamContext.d.ts +4 -0
- package/dist/components/jams/JamContext.js +17 -2
- package/dist/components/jams/JamDetailsDrawer.js +1 -1
- package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
- package/dist/components/jams/JamDeviceSelectors.js +4 -3
- package/dist/components/jams/JamFooter.js +15 -16
- package/dist/components/jams/JamGuestForm.js +2 -2
- package/dist/components/jams/JamLobby.js +9 -19
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +1 -1
- package/dist/components/jams/JamPeopleDrawer.js +17 -13
- package/dist/components/jams/JamReactionMenu.js +1 -1
- package/dist/components/jams/JamRequestJoin.js +1 -1
- package/dist/components/jams/JamRoom.js +84 -4
- package/dist/components/jams/JamToolbarButton.d.ts +21 -0
- package/dist/components/jams/JamToolbarButton.js +19 -0
- package/dist/components/jams/JamVideoCall.js +8 -3
- package/dist/components/jams/JamVideoLayout.js +16 -5
- package/dist/components/jams/LeaveCloseButton.js +9 -44
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/constants.js +4 -0
- package/dist/components/jams/useParticipantConnection.d.ts +7 -0
- package/dist/components/jams/useParticipantConnection.js +11 -0
- package/dist/components/layout/Auth.js +1 -1
- package/dist/components/layout/Infos.js +2 -2
- package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
- package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/markdown/CompiledMarkdown.js +15 -1
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +5 -1
- package/dist/components/navigation/HeaderMobile.js +1 -1
- package/dist/components/navigation/MobileMenuItem.js +1 -1
- package/dist/components/navigation/PageHeaderAction.js +1 -1
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +6 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
- package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
- package/dist/components/notifications/NotificationHeaderActions.js +2 -2
- package/dist/components/notifications/NotificationWrapper.js +1 -1
- package/dist/components/notifications/NotificationsList.js +3 -3
- package/dist/components/notifications/TypedNotification.js +3 -3
- package/dist/components/post/Feed.js +3 -3
- package/dist/components/post/FeedPost.d.ts +2 -1
- package/dist/components/post/FeedPost.js +7 -2
- package/dist/components/post/FeedPostContent.js +1 -1
- package/dist/components/post/FullPostLayout.js +11 -4
- package/dist/components/post/NewEventButton.js +1 -1
- package/dist/components/post/NewNoteButton.js +1 -1
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/ReplyBox.js +1 -1
- package/dist/components/post/feed/events/EventsFeed.js +3 -3
- package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
- package/dist/components/post/pieces/Attachments.js +3 -3
- package/dist/components/post/pieces/EventMenu.js +1 -1
- package/dist/components/post/pieces/EventRsvpButton.js +3 -3
- package/dist/components/post/pieces/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +4 -4
- package/dist/components/post/pieces/PostActions.js +6 -45
- package/dist/components/post/pieces/PostInfoHeader.js +1 -1
- package/dist/components/post/pieces/PostMenu.js +34 -8
- package/dist/components/post/pieces/PostReactionHeader.js +1 -1
- package/dist/components/post/pieces/ShareMenu.js +4 -2
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
- package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
- package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
- package/dist/components/post/post-form/AttachmentCard.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.js +1 -1
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +22 -12
- package/dist/components/post/post-form/EventForm.js +2 -2
- package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
- package/dist/components/post/post-form/NewPostModal.js +10 -10
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
- package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
- package/dist/components/post/post-form/PollComposerFields.js +12 -8
- package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
- package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/ReplyModal.js +9 -8
- package/dist/components/post/post-form/VisibilitySelector.js +1 -1
- package/dist/components/post/types/Article.js +2 -1
- package/dist/components/post/types/Event.js +1 -1
- package/dist/components/post/types/Note.js +2 -1
- package/dist/components/post/types/Poll.js +2 -1
- package/dist/components/post/types/event/CardEvent.js +2 -2
- package/dist/components/post/types/event/FullEvent.js +8 -8
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
- package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
- package/dist/components/preview-link/LocalPreviewLink.js +1 -1
- package/dist/components/preview-link/RemotePreviewLink.js +5 -1
- package/dist/components/profile/Avatar.js +3 -2
- package/dist/components/profile/FollowUnfollowButton.js +2 -2
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfileCard.js +1 -1
- package/dist/components/profile/ProfileHeader.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +3 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
- package/dist/components/profile/ProfileSelector.js +3 -3
- package/dist/components/profile/ProfilesInput.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
- package/dist/components/server-data/context.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +53 -0
- package/dist/contexts/openpeeps/hooks/admin.js +1 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- package/dist/contexts/openpeeps/index.js +10 -2
- package/dist/contexts/router/index.d.ts +8 -3
- package/dist/contexts/router/index.js +7 -3
- package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
- package/dist/hooks/conversations/useCreateConversation.js +56 -0
- package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
- package/dist/hooks/groups/useJoinGroup.js +23 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
- package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
- package/dist/hooks/posts/useFeedPostActions.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Markdown.d.ts +14 -0
- package/dist/lib/Markdown.js +16 -0
- package/dist/lib/analyticsClicks.d.ts +12 -0
- package/dist/lib/analyticsClicks.js +64 -0
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +27 -0
- package/dist/lib/canvasUtils.d.ts +6 -0
- package/dist/lib/canvasUtils.js +62 -1
- package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
- package/dist/lib/passwordStrength.d.ts +6 -0
- package/dist/lib/passwordStrength.js +26 -0
- package/dist/lib/postViewCounter.d.ts +1 -1
- package/dist/lib/postViewCounter.js +3 -1
- package/dist/lib/routeHandles.d.ts +2 -0
- package/dist/lib/routeHandles.js +2 -0
- package/dist/lib/svgCover.d.ts +2 -0
- package/dist/lib/svgCover.js +18 -0
- package/dist/navigation/index.d.ts +11 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/menuItems.d.ts +8 -0
- package/dist/navigation/menuItems.js +83 -0
- package/dist/navigation/targets.d.ts +94 -0
- package/dist/navigation/targets.js +12 -0
- package/dist/pages/About.d.ts +1 -0
- package/dist/pages/About.js +19 -0
- package/dist/pages/CodeOfConduct.d.ts +1 -0
- package/dist/pages/CodeOfConduct.js +14 -0
- package/dist/pages/Explore.d.ts +1 -0
- package/dist/pages/Explore.js +132 -0
- package/dist/pages/Home.d.ts +6 -0
- package/dist/pages/Home.js +31 -0
- package/dist/pages/Members.d.ts +1 -0
- package/dist/pages/Members.js +35 -0
- package/dist/pages/NotFound.d.ts +1 -0
- package/dist/pages/NotFound.js +9 -0
- package/dist/pages/Notifications.d.ts +1 -0
- package/dist/pages/Notifications.js +8 -0
- package/dist/pages/PostDetail.d.ts +1 -0
- package/dist/pages/PostDetail.js +27 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/Profile.js +20 -0
- package/dist/pages/Tags.d.ts +1 -0
- package/dist/pages/Tags.js +14 -0
- package/dist/pages/Welcome.d.ts +1 -0
- package/dist/pages/Welcome.js +89 -0
- package/dist/pages/admin/Analytics.d.ts +11 -0
- package/dist/pages/admin/Analytics.js +11 -0
- package/dist/pages/admin/ApiKeys.d.ts +1 -0
- package/dist/pages/admin/ApiKeys.js +141 -0
- package/dist/pages/admin/Backups.d.ts +1 -0
- package/dist/pages/admin/Backups.js +39 -0
- package/dist/pages/admin/ConfigEditor.d.ts +14 -0
- package/dist/pages/admin/ConfigEditor.js +91 -0
- package/dist/pages/admin/Configuration.d.ts +1 -0
- package/dist/pages/admin/Configuration.js +8 -0
- package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunity.js +7 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
- package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
- package/dist/pages/admin/ConfigurationEmail.js +97 -0
- package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
- package/dist/pages/admin/ConfigurationI18n.js +51 -0
- package/dist/pages/admin/Dashboard.d.ts +1 -0
- package/dist/pages/admin/Dashboard.js +40 -0
- package/dist/pages/admin/Db.d.ts +1 -0
- package/dist/pages/admin/Db.js +238 -0
- package/dist/pages/admin/Diagnostics.d.ts +1 -0
- package/dist/pages/admin/Diagnostics.js +8 -0
- package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsEmail.js +65 -0
- package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsJob.js +51 -0
- package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsLogs.js +62 -0
- package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
- package/dist/pages/admin/GroupMembers.d.ts +1 -0
- package/dist/pages/admin/GroupMembers.js +109 -0
- package/dist/pages/admin/Groups.d.ts +1 -0
- package/dist/pages/admin/Groups.js +61 -0
- package/dist/pages/admin/Invites.d.ts +1 -0
- package/dist/pages/admin/Invites.js +72 -0
- package/dist/pages/admin/Members.d.ts +1 -0
- package/dist/pages/admin/Members.js +49 -0
- package/dist/pages/admin/Moderation.d.ts +1 -0
- package/dist/pages/admin/Moderation.js +62 -0
- package/dist/pages/admin/Reports.d.ts +1 -0
- package/dist/pages/admin/Reports.js +178 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
- package/dist/pages/admin/analytics/Content.d.ts +1 -0
- package/dist/pages/admin/analytics/Content.js +117 -0
- package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
- package/dist/pages/admin/analytics/Engagement.js +220 -0
- package/dist/pages/admin/analytics/Groups.d.ts +1 -0
- package/dist/pages/admin/analytics/Groups.js +139 -0
- package/dist/pages/admin/analytics/Members.d.ts +1 -0
- package/dist/pages/admin/analytics/Members.js +96 -0
- package/dist/pages/admin/analytics/Overview.d.ts +1 -0
- package/dist/pages/admin/analytics/Overview.js +165 -0
- package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
- package/dist/pages/admin/analytics/ReportSettings.js +62 -0
- package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
- package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
- package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
- package/dist/pages/admin/analytics/downloadCsv.js +20 -0
- package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
- package/dist/pages/admin/community/CommunityFavicons.js +47 -0
- package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
- package/dist/pages/admin/community/CommunityInfo.js +35 -0
- package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
- package/dist/pages/admin/community/CommunityLinks.js +35 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
- package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
- package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
- package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
- package/dist/pages/admin/community/CommunityRoles.js +109 -0
- package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
- package/dist/pages/admin/community/CommunityTheme.js +56 -0
- package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
- package/dist/pages/admin/community/useCommunityConfig.js +28 -0
- package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
- package/dist/pages/admin/components/AdminCharts.js +29 -0
- package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
- package/dist/pages/admin/components/AdminGroupCard.js +42 -0
- package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
- package/dist/pages/admin/components/AdminInviteActions.js +23 -0
- package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
- package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
- package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
- package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
- package/dist/pages/admin/components/ProfileRowActions.js +131 -0
- package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
- package/dist/pages/articles/Edit.d.ts +1 -0
- package/dist/pages/articles/Edit.js +60 -0
- package/dist/pages/articles/Index.d.ts +1 -0
- package/dist/pages/articles/Index.js +18 -0
- package/dist/pages/articles/New.d.ts +1 -0
- package/dist/pages/articles/New.js +48 -0
- package/dist/pages/auth/Closed.d.ts +1 -0
- package/dist/pages/auth/Closed.js +14 -0
- package/dist/pages/auth/Login.d.ts +1 -0
- package/dist/pages/auth/Login.js +74 -0
- package/dist/pages/auth/OidcCallback.d.ts +5 -0
- package/dist/pages/auth/OidcCallback.js +31 -0
- package/dist/pages/auth/OidcPending.d.ts +5 -0
- package/dist/pages/auth/OidcPending.js +39 -0
- package/dist/pages/auth/Register.d.ts +4 -0
- package/dist/pages/auth/Register.js +124 -0
- package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
- package/dist/pages/auth/RegisterInvitation.js +5 -0
- package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
- package/dist/pages/auth/RequestResetPassword.js +50 -0
- package/dist/pages/auth/ResetPassword.d.ts +1 -0
- package/dist/pages/auth/ResetPassword.js +40 -0
- package/dist/pages/auth/SsoCallback.d.ts +1 -0
- package/dist/pages/auth/SsoCallback.js +34 -0
- package/dist/pages/auth/ValidateEmail.d.ts +6 -0
- package/dist/pages/auth/ValidateEmail.js +64 -0
- package/dist/pages/conversations/Index.d.ts +1 -0
- package/dist/pages/conversations/Index.js +58 -0
- package/dist/pages/conversations/Info.d.ts +1 -0
- package/dist/pages/conversations/Info.js +26 -0
- package/dist/pages/conversations/New.d.ts +1 -0
- package/dist/pages/conversations/New.js +8 -0
- package/dist/pages/conversations/Show.d.ts +1 -0
- package/dist/pages/conversations/Show.js +100 -0
- package/dist/pages/events/Edit.d.ts +1 -0
- package/dist/pages/events/Edit.js +69 -0
- package/dist/pages/events/Index.d.ts +1 -0
- package/dist/pages/events/Index.js +23 -0
- package/dist/pages/events/My.d.ts +1 -0
- package/dist/pages/events/My.js +24 -0
- package/dist/pages/events/New.d.ts +1 -0
- package/dist/pages/events/New.js +66 -0
- package/dist/pages/feeds/Bookmarks.d.ts +1 -0
- package/dist/pages/feeds/Bookmarks.js +10 -0
- package/dist/pages/feeds/Local.d.ts +1 -0
- package/dist/pages/feeds/Local.js +14 -0
- package/dist/pages/feeds/My.d.ts +1 -0
- package/dist/pages/feeds/My.js +12 -0
- package/dist/pages/groups/Edit.d.ts +1 -0
- package/dist/pages/groups/Edit.js +57 -0
- package/dist/pages/groups/Index.d.ts +1 -0
- package/dist/pages/groups/Index.js +50 -0
- package/dist/pages/groups/Info.d.ts +1 -0
- package/dist/pages/groups/Info.js +21 -0
- package/dist/pages/groups/Members.d.ts +1 -0
- package/dist/pages/groups/Members.js +28 -0
- package/dist/pages/groups/New.d.ts +1 -0
- package/dist/pages/groups/New.js +68 -0
- package/dist/pages/groups/Show.d.ts +1 -0
- package/dist/pages/groups/Show.js +64 -0
- package/dist/pages/index.d.ts +94 -0
- package/dist/pages/index.js +94 -0
- package/dist/pages/jams/Event.d.ts +8 -0
- package/dist/pages/jams/Event.js +57 -0
- package/dist/pages/jams/Index.d.ts +6 -0
- package/dist/pages/jams/Index.js +44 -0
- package/dist/pages/payment/Success.d.ts +1 -0
- package/dist/pages/payment/Success.js +30 -0
- package/dist/pages/plugins/Index.d.ts +1 -0
- package/dist/pages/plugins/Index.js +69 -0
- package/dist/pages/profile/Followers.d.ts +6 -0
- package/dist/pages/profile/Followers.js +28 -0
- package/dist/pages/settings/AccessTokens.d.ts +1 -0
- package/dist/pages/settings/AccessTokens.js +149 -0
- package/dist/pages/settings/Account.d.ts +1 -0
- package/dist/pages/settings/Account.js +81 -0
- package/dist/pages/settings/Billing.d.ts +1 -0
- package/dist/pages/settings/Billing.js +82 -0
- package/dist/pages/settings/Index.d.ts +1 -0
- package/dist/pages/settings/Index.js +13 -0
- package/dist/pages/settings/Language.d.ts +1 -0
- package/dist/pages/settings/Language.js +54 -0
- package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
- package/dist/pages/settings/NotificationPreferences.js +180 -0
- package/dist/pages/settings/Notifications.d.ts +1 -0
- package/dist/pages/settings/Notifications.js +10 -0
- package/dist/pages/settings/PublicProfile.d.ts +1 -0
- package/dist/pages/settings/PublicProfile.js +135 -0
- package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
- package/dist/pages/settings/PushEnabledDevices.js +67 -0
- package/dist/pages/settings/Theme.d.ts +1 -0
- package/dist/pages/settings/Theme.js +37 -0
- package/dist/pages/test/Error.d.ts +1 -0
- package/dist/pages/test/Error.js +10 -0
- package/dist/pages/test/Markdown.d.ts +1 -0
- package/dist/pages/test/Markdown.js +32 -0
- package/dist/pwa/InstallPrompt.js +1 -1
- package/dist/pwa/NotificationPermissionPrompt.js +2 -2
- package/dist/pwa/UpdatePrompt.js +1 -1
- package/dist/react-native.d.ts +1 -0
- package/dist/react-native.js +1 -0
- package/dist/session/useSessionEvents.d.ts +3 -0
- package/dist/session/useSessionEvents.js +64 -0
- package/package.json +12 -7
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AnalyticsClickEvent = {
|
|
2
|
+
kind: 'page' | 'link';
|
|
3
|
+
target: string;
|
|
4
|
+
};
|
|
5
|
+
type ClickIngest = (events: AnalyticsClickEvent[]) => void;
|
|
6
|
+
export declare const configureClickIngest: (next: ClickIngest | undefined) => void;
|
|
7
|
+
export declare const resetClickTrackingForTests: () => void;
|
|
8
|
+
export declare const recordPageView: (pathname: string) => void;
|
|
9
|
+
export declare const recordOutboundClick: (href: string, origin?: string) => void;
|
|
10
|
+
/** Configures ingest and records signed-in in-app page views. */
|
|
11
|
+
export declare const AnalyticsClickTracker: () => null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { isExternalLink } from '../components/markdown/linkTargets.js';
|
|
3
|
+
import { useHasAuthToken } from '../contexts/openpeeps/hooks/useHasAuthToken.js';
|
|
4
|
+
import { useOpenpeeps } from '../contexts/openpeeps/index.js';
|
|
5
|
+
import { useOptionalPathname } from '../contexts/router/index.js';
|
|
6
|
+
const PAGE_DEDUPE_MS = 2_000;
|
|
7
|
+
let ingest;
|
|
8
|
+
let lastPage;
|
|
9
|
+
let lastPageAt = 0;
|
|
10
|
+
export const configureClickIngest = (next) => {
|
|
11
|
+
ingest = next;
|
|
12
|
+
};
|
|
13
|
+
export const resetClickTrackingForTests = () => {
|
|
14
|
+
ingest = undefined;
|
|
15
|
+
lastPage = undefined;
|
|
16
|
+
lastPageAt = 0;
|
|
17
|
+
};
|
|
18
|
+
export const recordPageView = (pathname) => {
|
|
19
|
+
if (!pathname)
|
|
20
|
+
return;
|
|
21
|
+
if (pathname === '/admin' ||
|
|
22
|
+
pathname.startsWith('/admin/') ||
|
|
23
|
+
pathname.startsWith('/auth') ||
|
|
24
|
+
pathname.startsWith('/api')) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const now = Date.now();
|
|
28
|
+
if (pathname === lastPage && now - lastPageAt < PAGE_DEDUPE_MS)
|
|
29
|
+
return;
|
|
30
|
+
lastPage = pathname;
|
|
31
|
+
lastPageAt = now;
|
|
32
|
+
ingest?.([{ kind: 'page', target: pathname }]);
|
|
33
|
+
};
|
|
34
|
+
export const recordOutboundClick = (href, origin) => {
|
|
35
|
+
if (!href)
|
|
36
|
+
return;
|
|
37
|
+
const resolvedOrigin = origin ??
|
|
38
|
+
(typeof window !== 'undefined' ? window.location.origin : undefined);
|
|
39
|
+
if (!isExternalLink(href, resolvedOrigin))
|
|
40
|
+
return;
|
|
41
|
+
ingest?.([{ kind: 'link', target: href }]);
|
|
42
|
+
};
|
|
43
|
+
/** Configures ingest and records signed-in in-app page views. */
|
|
44
|
+
export const AnalyticsClickTracker = () => {
|
|
45
|
+
const { client } = useOpenpeeps();
|
|
46
|
+
const hasToken = useHasAuthToken();
|
|
47
|
+
const pathname = useOptionalPathname();
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!hasToken) {
|
|
50
|
+
configureClickIngest(undefined);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
configureClickIngest((events) => {
|
|
54
|
+
void client.analytics.recordClicks({ events });
|
|
55
|
+
});
|
|
56
|
+
return () => configureClickIngest(undefined);
|
|
57
|
+
}, [client, hasToken]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!hasToken || !pathname)
|
|
60
|
+
return;
|
|
61
|
+
recordPageView(pathname);
|
|
62
|
+
}, [hasToken, pathname]);
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OpenpeepsClient } from '@openpeepshq/client';
|
|
2
|
+
import type { CredentialsStore } from '../auth/credentials';
|
|
3
|
+
import type { LoginRequest, RegisterRequest, RequestResetPasswordRequest, ResetPasswordRequest, TokenResponse } from '@openpeepshq/common';
|
|
4
|
+
export declare const performLogin: (client: OpenpeepsClient, store: CredentialsStore, data: LoginRequest) => Promise<TokenResponse>;
|
|
5
|
+
export declare const performRegister: (client: OpenpeepsClient, store: CredentialsStore, data: RegisterRequest) => Promise<TokenResponse>;
|
|
6
|
+
export declare const performRequestResetPassword: (client: OpenpeepsClient, data: RequestResetPasswordRequest) => Promise<unknown>;
|
|
7
|
+
export declare const performResetPassword: (client: OpenpeepsClient, data: ResetPasswordRequest, token: string) => Promise<unknown>;
|
|
8
|
+
export declare const performLogout: (store: CredentialsStore) => Promise<void>;
|
package/dist/lib/auth.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin promise unwrapping for endpoints that return
|
|
3
|
+
* `{ data: T } | { error: SuccessFailureResponse }`. Throws on `error`.
|
|
4
|
+
*/
|
|
5
|
+
const unwrap = async (promise) => {
|
|
6
|
+
const r = await promise;
|
|
7
|
+
if ('error' in r)
|
|
8
|
+
throw new Error(r.error.message ?? 'Request failed');
|
|
9
|
+
return r.data;
|
|
10
|
+
};
|
|
11
|
+
export const performLogin = async (client, store, data) => {
|
|
12
|
+
const tr = await unwrap(client.auth.login(data));
|
|
13
|
+
await store.set({ token: tr.token });
|
|
14
|
+
return tr;
|
|
15
|
+
};
|
|
16
|
+
export const performRegister = async (client, store, data) => {
|
|
17
|
+
const tr = await unwrap(client.auth.register(data));
|
|
18
|
+
await store.set({ token: tr.token });
|
|
19
|
+
return tr;
|
|
20
|
+
};
|
|
21
|
+
export const performRequestResetPassword = (client, data) => unwrap(client.auth.requestResetPassword(data));
|
|
22
|
+
export const performResetPassword = (client, data, token) => unwrap(client.auth.resetPassword(data, {
|
|
23
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
24
|
+
}));
|
|
25
|
+
export const performLogout = async (store) => {
|
|
26
|
+
await store.clear();
|
|
27
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export type ImageSource = string | File;
|
|
2
|
+
/**
|
|
3
|
+
* Give an SVG intrinsic pixel size so the cropper and canvas treat it like a
|
|
4
|
+
* raster. Percentage / missing width+height otherwise collapse to the
|
|
5
|
+
* browser's default replaced-element size and letterbox inside the avatar.
|
|
6
|
+
*/
|
|
7
|
+
export declare const normalizeSvgFile: (file: File) => Promise<File>;
|
|
2
8
|
export declare const createImage: (imageSrc: ImageSource) => Promise<HTMLImageElement>;
|
|
3
9
|
export declare const getCroppedImg: (imageSrc: ImageSource, pixelCrop: {
|
|
4
10
|
x: number;
|
package/dist/lib/canvasUtils.js
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
import { randomString } from '@openpeepshq/common/lib';
|
|
2
2
|
const imageFileExtension = 'webp';
|
|
3
3
|
const imageFileFormat = `image/${imageFileExtension}`;
|
|
4
|
+
const isSvgFile = (file) => file.type === 'image/svg+xml' || file.name.toLowerCase().endsWith('.svg');
|
|
5
|
+
const parseSvgLength = (value) => {
|
|
6
|
+
if (!value)
|
|
7
|
+
return undefined;
|
|
8
|
+
const trimmed = value.trim();
|
|
9
|
+
if (trimmed.endsWith('%'))
|
|
10
|
+
return undefined;
|
|
11
|
+
const n = parseFloat(trimmed);
|
|
12
|
+
return Number.isFinite(n) && n > 0 ? n : undefined;
|
|
13
|
+
};
|
|
14
|
+
const viewBoxSize = (viewBox) => {
|
|
15
|
+
if (!viewBox)
|
|
16
|
+
return undefined;
|
|
17
|
+
const parts = viewBox
|
|
18
|
+
.trim()
|
|
19
|
+
.split(/[\s,]+/)
|
|
20
|
+
.map(Number);
|
|
21
|
+
const width = parts[2];
|
|
22
|
+
const height = parts[3];
|
|
23
|
+
if (typeof width !== 'number' ||
|
|
24
|
+
typeof height !== 'number' ||
|
|
25
|
+
!Number.isFinite(width) ||
|
|
26
|
+
!Number.isFinite(height) ||
|
|
27
|
+
width <= 0 ||
|
|
28
|
+
height <= 0) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
return { width, height };
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Give an SVG intrinsic pixel size so the cropper and canvas treat it like a
|
|
35
|
+
* raster. Percentage / missing width+height otherwise collapse to the
|
|
36
|
+
* browser's default replaced-element size and letterbox inside the avatar.
|
|
37
|
+
*/
|
|
38
|
+
export const normalizeSvgFile = async (file) => {
|
|
39
|
+
if (!isSvgFile(file) || typeof DOMParser === 'undefined')
|
|
40
|
+
return file;
|
|
41
|
+
const text = await file.text();
|
|
42
|
+
const doc = new DOMParser().parseFromString(text, 'image/svg+xml');
|
|
43
|
+
const svg = doc.documentElement;
|
|
44
|
+
if (svg.namespaceURI && !svg.namespaceURI.includes('svg'))
|
|
45
|
+
return file;
|
|
46
|
+
if (svg.tagName.toLowerCase() !== 'svg')
|
|
47
|
+
return file;
|
|
48
|
+
const fromViewBox = viewBoxSize(svg.getAttribute('viewBox'));
|
|
49
|
+
const width = parseSvgLength(svg.getAttribute('width')) ?? fromViewBox?.width;
|
|
50
|
+
const height = parseSvgLength(svg.getAttribute('height')) ?? fromViewBox?.height;
|
|
51
|
+
const nextWidth = width && width > 0 ? width : 1024;
|
|
52
|
+
const nextHeight = height && height > 0 ? height : 1024;
|
|
53
|
+
svg.setAttribute('width', String(nextWidth));
|
|
54
|
+
svg.setAttribute('height', String(nextHeight));
|
|
55
|
+
if (!svg.getAttribute('viewBox')) {
|
|
56
|
+
svg.setAttribute('viewBox', `0 0 ${nextWidth} ${nextHeight}`);
|
|
57
|
+
}
|
|
58
|
+
return new File([new XMLSerializer().serializeToString(svg)], file.name, {
|
|
59
|
+
type: 'image/svg+xml',
|
|
60
|
+
});
|
|
61
|
+
};
|
|
4
62
|
const canvasToFile = (canvas) => new Promise((resolve, reject) => canvas.toBlob((blob) => blob
|
|
5
63
|
? resolve(new File([blob], `${randomString(8)}.${imageFileExtension}`, {
|
|
6
64
|
type: imageFileFormat,
|
|
@@ -56,7 +114,10 @@ export const getRotatedImage = async (imageSrc, rotation = 0) => {
|
|
|
56
114
|
const image = await createImage(imageSrc);
|
|
57
115
|
const canvas = document.createElement('canvas');
|
|
58
116
|
const ctx = canvas.getContext('2d');
|
|
59
|
-
const orientationChanged = rotation === 90 ||
|
|
117
|
+
const orientationChanged = rotation === 90 ||
|
|
118
|
+
rotation === -90 ||
|
|
119
|
+
rotation === 270 ||
|
|
120
|
+
rotation === -270;
|
|
60
121
|
if (orientationChanged) {
|
|
61
122
|
canvas.width = image.height;
|
|
62
123
|
canvas.height = image.width;
|
|
@@ -2,7 +2,7 @@ import type { GroupData } from '@openpeepshq/common/types';
|
|
|
2
2
|
type GroupCapabilities = GroupData['capabilities'];
|
|
3
3
|
export declare function getGroupVisibilityValue(capabilities: GroupCapabilities | undefined): "local" | "public" | "private";
|
|
4
4
|
export declare function getGroupPostsVisibilityValue(capabilities: GroupCapabilities | undefined): "local" | "public" | "private";
|
|
5
|
-
export declare function getGroupWhoCanJoinValue(capabilities: GroupCapabilities | undefined): "
|
|
5
|
+
export declare function getGroupWhoCanJoinValue(capabilities: GroupCapabilities | undefined): "closed" | "open";
|
|
6
6
|
export declare function getGroupWhoCanPostValue(capabilities: GroupCapabilities | undefined): "admin" | "members";
|
|
7
7
|
export declare function getGroupWhoCanPostEventsValue(capabilities: GroupCapabilities | undefined): "admin" | "members";
|
|
8
8
|
export declare function setGroupVisibility(groupData: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of `@openpeepshq/svelte/utils/password-strength.ts`. Scores a password
|
|
3
|
+
* from 0 to 5 based on length + character class diversity.
|
|
4
|
+
*/
|
|
5
|
+
export declare const calculatePasswordStrength: (password: string) => number;
|
|
6
|
+
export declare const getStrengthMessage: (strength: number) => string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of `@openpeepshq/svelte/utils/password-strength.ts`. Scores a password
|
|
3
|
+
* from 0 to 5 based on length + character class diversity.
|
|
4
|
+
*/
|
|
5
|
+
export const calculatePasswordStrength = (password) => {
|
|
6
|
+
let strength = 0;
|
|
7
|
+
if (password.length >= 8) {
|
|
8
|
+
strength++;
|
|
9
|
+
if (/[A-Z]/.test(password))
|
|
10
|
+
strength++;
|
|
11
|
+
if (/[a-z]/.test(password))
|
|
12
|
+
strength++;
|
|
13
|
+
if (/\d/.test(password))
|
|
14
|
+
strength++;
|
|
15
|
+
if (/[!@#$%^&*(),.?":{}|<>]/.test(password))
|
|
16
|
+
strength++;
|
|
17
|
+
}
|
|
18
|
+
return strength;
|
|
19
|
+
};
|
|
20
|
+
export const getStrengthMessage = (strength) => {
|
|
21
|
+
if (strength < 3)
|
|
22
|
+
return 'Weak password';
|
|
23
|
+
if (strength < 5)
|
|
24
|
+
return 'Moderate password';
|
|
25
|
+
return 'Strong password';
|
|
26
|
+
};
|
|
@@ -14,4 +14,4 @@ export declare const PostViewCounterProvider: ({ markPostsSeen, hasAuthToken, on
|
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
/** Attach the returned ref to a post container to batch-mark it seen after 1s in view. */
|
|
17
|
-
export declare const usePostViewRef: (postId: string | undefined, viewContext?: PostViewContext) => import("react").RefObject<
|
|
17
|
+
export declare const usePostViewRef: <T extends HTMLElement = HTMLElement>(postId: string | undefined, viewContext?: PostViewContext) => import("react").RefObject<T | null>;
|
|
@@ -39,7 +39,9 @@ export const PostViewCounterProvider = ({ markPostsSeen, hasAuthToken, onPostQue
|
|
|
39
39
|
clearTimeout(flushDebounceTimer.current);
|
|
40
40
|
flushDebounceTimer.current = undefined;
|
|
41
41
|
}
|
|
42
|
-
if (flushing.current ||
|
|
42
|
+
if (flushing.current ||
|
|
43
|
+
pendingPostIds.current.size === 0 ||
|
|
44
|
+
!hasAuthToken) {
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
45
47
|
const postIds = [...pendingPostIds.current];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browsers render `<img src="*.svg">` with SVG's default
|
|
3
|
+
* `preserveAspectRatio="xMidYMid meet"` (contain), so `object-fit: cover`
|
|
4
|
+
* does not fill a square avatar the way a PNG/JPEG/GIF does.
|
|
5
|
+
*
|
|
6
|
+
* The SVG View fragment switches that to `slice` (cover).
|
|
7
|
+
* @see https://www.w3.org/TR/SVG11/linking.html#SVGFragmentIdentifiers
|
|
8
|
+
*/
|
|
9
|
+
const SVG_COVER_FRAGMENT = 'svgView(preserveAspectRatio(xMidYMid slice))';
|
|
10
|
+
export const isSvgUrl = (src) => /\.svg(?:$|[?#])/i.test(src) || /image\/svg\+xml/i.test(src);
|
|
11
|
+
export const svgCoverSrc = (src) => {
|
|
12
|
+
if (!isSvgUrl(src) || src.includes('#svgView')) {
|
|
13
|
+
return src;
|
|
14
|
+
}
|
|
15
|
+
const hash = src.indexOf('#');
|
|
16
|
+
const base = hash >= 0 ? src.slice(0, hash) : src;
|
|
17
|
+
return `${base}#${SVG_COVER_FRAGMENT}`;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NavTarget } from './targets';
|
|
2
|
+
/**
|
|
3
|
+
* Host-provided mapping between abstract {@link NavTarget} values and concrete
|
|
4
|
+
* URL paths. Implemented by `platform/web` (and later RN deep links).
|
|
5
|
+
*/
|
|
6
|
+
export type Navigator = {
|
|
7
|
+
hrefOf: (target: NavTarget) => string;
|
|
8
|
+
match: (pathname: string) => NavTarget | null;
|
|
9
|
+
};
|
|
10
|
+
export * from './targets';
|
|
11
|
+
export * from './menuItems';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NavItemDef, NavTarget } from './targets';
|
|
2
|
+
export type MainMenuCapabilities = {
|
|
3
|
+
jamsEnabled: boolean;
|
|
4
|
+
showAdmin: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** Default main-menu targets for hosts to render with their own icons/labels. */
|
|
7
|
+
export declare const buildMainNavItems: (caps: MainMenuCapabilities) => NavItemDef[];
|
|
8
|
+
export declare const isSameNavTarget: (a: NavTarget, b: NavTarget) => boolean;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** Default main-menu targets for hosts to render with their own icons/labels. */
|
|
2
|
+
export const buildMainNavItems = (caps) => {
|
|
3
|
+
const items = [
|
|
4
|
+
{
|
|
5
|
+
id: 'community',
|
|
6
|
+
target: { type: 'feed', feed: 'local' },
|
|
7
|
+
labelKey: 'navigation.community',
|
|
8
|
+
icon: 'Home',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: 'welcome',
|
|
12
|
+
target: { type: 'welcome' },
|
|
13
|
+
labelKey: 'navigation.goToWelcomePage',
|
|
14
|
+
icon: 'BookCheck',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'explore',
|
|
18
|
+
target: { type: 'explore' },
|
|
19
|
+
labelKey: 'navigation.explore',
|
|
20
|
+
icon: 'Search',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'myFeed',
|
|
24
|
+
target: { type: 'feed', feed: 'my' },
|
|
25
|
+
labelKey: 'navigation.myFeed',
|
|
26
|
+
icon: 'Newspaper',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
if (caps.jamsEnabled) {
|
|
30
|
+
items.push({
|
|
31
|
+
id: 'jams',
|
|
32
|
+
target: { type: 'jams' },
|
|
33
|
+
labelKey: 'navigation.jams',
|
|
34
|
+
icon: 'PhoneCall',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
items.push({
|
|
38
|
+
id: 'groups',
|
|
39
|
+
target: { type: 'groups' },
|
|
40
|
+
labelKey: 'navigation.groups',
|
|
41
|
+
icon: 'Users',
|
|
42
|
+
}, {
|
|
43
|
+
id: 'events',
|
|
44
|
+
target: { type: 'events' },
|
|
45
|
+
labelKey: 'navigation.events',
|
|
46
|
+
icon: 'CalendarDays',
|
|
47
|
+
}, {
|
|
48
|
+
id: 'articles',
|
|
49
|
+
target: { type: 'articles' },
|
|
50
|
+
labelKey: 'navigation.articles',
|
|
51
|
+
icon: 'ScrollText',
|
|
52
|
+
}, {
|
|
53
|
+
id: 'messages',
|
|
54
|
+
target: { type: 'conversation' },
|
|
55
|
+
labelKey: 'navigation.messages',
|
|
56
|
+
icon: 'MessageSquareText',
|
|
57
|
+
}, {
|
|
58
|
+
id: 'members',
|
|
59
|
+
target: { type: 'members' },
|
|
60
|
+
labelKey: 'navigation.members',
|
|
61
|
+
icon: 'BookUser',
|
|
62
|
+
}, {
|
|
63
|
+
id: 'bookmarks',
|
|
64
|
+
target: { type: 'feed', feed: 'bookmarks' },
|
|
65
|
+
labelKey: 'navigation.bookmarks',
|
|
66
|
+
icon: 'Bookmark',
|
|
67
|
+
}, {
|
|
68
|
+
id: 'settings',
|
|
69
|
+
target: { type: 'settings' },
|
|
70
|
+
labelKey: 'navigation.settings',
|
|
71
|
+
icon: 'Settings',
|
|
72
|
+
});
|
|
73
|
+
if (caps.showAdmin) {
|
|
74
|
+
items.push({
|
|
75
|
+
id: 'admin',
|
|
76
|
+
target: { type: 'admin' },
|
|
77
|
+
labelKey: 'navigation.administration',
|
|
78
|
+
icon: 'Bolt',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return items;
|
|
82
|
+
};
|
|
83
|
+
export const isSameNavTarget = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract navigation destinations. Host apps (web) map these to concrete
|
|
3
|
+
* paths via a Navigator — domain code must not hard-code URL strings.
|
|
4
|
+
*/
|
|
5
|
+
export type NavTarget = {
|
|
6
|
+
type: 'home';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'welcome';
|
|
9
|
+
} | {
|
|
10
|
+
type: 'explore';
|
|
11
|
+
} | {
|
|
12
|
+
type: 'feed';
|
|
13
|
+
feed: 'local' | 'my' | 'bookmarks';
|
|
14
|
+
} | {
|
|
15
|
+
type: 'profile';
|
|
16
|
+
handle: string;
|
|
17
|
+
tab?: 'followers' | 'following';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'post';
|
|
20
|
+
id: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'postNew';
|
|
23
|
+
} | {
|
|
24
|
+
type: 'group';
|
|
25
|
+
handle?: string;
|
|
26
|
+
view?: 'info' | 'edit' | 'members';
|
|
27
|
+
} | {
|
|
28
|
+
type: 'groups';
|
|
29
|
+
view?: 'new';
|
|
30
|
+
} | {
|
|
31
|
+
type: 'conversation';
|
|
32
|
+
id?: string;
|
|
33
|
+
view?: 'info' | 'new';
|
|
34
|
+
} | {
|
|
35
|
+
type: 'jam';
|
|
36
|
+
id?: string;
|
|
37
|
+
view?: 'event';
|
|
38
|
+
} | {
|
|
39
|
+
type: 'jams';
|
|
40
|
+
view?: 'my';
|
|
41
|
+
} | {
|
|
42
|
+
type: 'events';
|
|
43
|
+
view?: 'my' | 'new';
|
|
44
|
+
eventId?: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'articles';
|
|
47
|
+
view?: 'new';
|
|
48
|
+
articleId?: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'members';
|
|
51
|
+
} | {
|
|
52
|
+
type: 'notifications';
|
|
53
|
+
} | {
|
|
54
|
+
type: 'tags';
|
|
55
|
+
hashtag: string;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'auth';
|
|
58
|
+
mode: 'login' | 'register' | 'closed' | 'validate-email' | 'reset-password' | 'request-reset-password';
|
|
59
|
+
redirect?: NavTarget;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'admin';
|
|
62
|
+
section?: string;
|
|
63
|
+
handle?: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'settings';
|
|
66
|
+
section?: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'about';
|
|
69
|
+
} | {
|
|
70
|
+
type: 'codeOfConduct';
|
|
71
|
+
} | {
|
|
72
|
+
type: 'docs';
|
|
73
|
+
path?: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'paymentSuccess';
|
|
76
|
+
} | {
|
|
77
|
+
type: 'external';
|
|
78
|
+
href: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'path';
|
|
81
|
+
path: string;
|
|
82
|
+
};
|
|
83
|
+
export type NavItemDef = {
|
|
84
|
+
id: string;
|
|
85
|
+
target: NavTarget;
|
|
86
|
+
labelKey: string;
|
|
87
|
+
/** Lucide (or similar) icon component name — host maps to actual icon. */
|
|
88
|
+
icon?: string;
|
|
89
|
+
end?: boolean;
|
|
90
|
+
pill?: number;
|
|
91
|
+
};
|
|
92
|
+
/** Encode a redirect NavTarget into a query-safe string (JSON). */
|
|
93
|
+
export declare const encodeNavRedirect: (target: NavTarget) => string;
|
|
94
|
+
export declare const decodeNavRedirect: (raw: string | null | undefined) => NavTarget | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Encode a redirect NavTarget into a query-safe string (JSON). */
|
|
2
|
+
export const encodeNavRedirect = (target) => encodeURIComponent(JSON.stringify(target));
|
|
3
|
+
export const decodeNavRedirect = (raw) => {
|
|
4
|
+
if (!raw)
|
|
5
|
+
return null;
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(decodeURIComponent(raw));
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function About(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link as RouterLink, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { Link } from '@openpeepshq/react-ui';
|
|
4
|
+
import { useT } from '../index.js';
|
|
5
|
+
import { AuthLayout, useCurrentProfile, useServerInfo } from '../components/index.js';
|
|
6
|
+
import { Markdown } from '../lib/Markdown.js';
|
|
7
|
+
export function About() {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const serverInfo = useServerInfo();
|
|
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.';
|
|
15
|
+
return (_jsxs(AuthLayout, { noRedirect: true, navigate: (url) => void navigate(url), children: [_jsx("h1", { className: "h1 pb-4 font-bold", children: t('about.welcomeTo', {
|
|
16
|
+
defaultValue: `Welcome to ${communityName}`,
|
|
17
|
+
name: communityName,
|
|
18
|
+
}) }), _jsx(Markdown, { source: aboutPage }), !currentProfile && (_jsxs("div", { className: "flex justify-between px-2 pt-4", children: [serverInfo.communityConfig?.settings?.openRegistrations && (_jsxs("span", { children: ["Don't have an account?", ' ', _jsx(Link, { action: "/auth/register", className: "text-sm", children: "Sign Up" })] })), serverInfo.publicContent && (_jsx("span", { children: _jsx(RouterLink, { to: "/feeds/local", className: "op-anchor text-sm", children: "See community feed" }) }))] }))] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CodeOfConduct(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link as RouterLink, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { Link } from '@openpeepshq/react-ui';
|
|
4
|
+
import { useT } from '../index.js';
|
|
5
|
+
import { AuthLayout, useServerInfo } from '../components/index.js';
|
|
6
|
+
import { Markdown } from '../lib/Markdown.js';
|
|
7
|
+
export function CodeOfConduct() {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const serverInfo = useServerInfo();
|
|
11
|
+
const source = serverInfo.communityConfig?.content?.codeOfConduct ??
|
|
12
|
+
'This community has not published a code of conduct yet.';
|
|
13
|
+
return (_jsxs(AuthLayout, { noRedirect: true, navigate: (url) => void navigate(url), children: [_jsx("h1", { className: "h1 pb-4 font-bold", children: t('codeOfConduct.title', { defaultValue: 'Code of conduct' }) }), _jsx(Markdown, { source: source }), _jsxs("div", { className: "flex justify-between px-2 pt-4", children: [serverInfo.communityConfig?.settings?.openRegistrations && (_jsxs("span", { children: ["Don't have an account?", ' ', _jsx(Link, { action: "/auth/register", className: "text-sm", children: "Sign Up" })] })), serverInfo.publicContent && (_jsx("span", { children: _jsx(RouterLink, { to: "/feeds/local", className: "op-anchor text-sm", children: "See community feed" }) }))] })] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Explore(): import("react/jsx-runtime").JSX.Element;
|