@openpeepshq/react 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accounts/SignUpLoginModal.js +2 -2
- package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
- package/dist/components/configuration/ConfigMenuButton.js +12 -0
- package/dist/components/configuration/ConfigurationTree.js +1 -1
- package/dist/components/configuration/index.d.ts +2 -0
- package/dist/components/configuration/index.js +1 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
- package/dist/components/conversations/ConversationMessageBubble.js +4 -5
- package/dist/components/conversations/CreateNewConversation.js +10 -42
- package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
- package/dist/components/conversations/MessageInThread.js +1 -2
- package/dist/components/form/ImageEditModal.js +2 -4
- package/dist/components/form/ImageInput.js +13 -8
- package/dist/components/form/LocationInput.js +1 -1
- package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
- package/dist/components/groups/AddGroupMembersButton.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupAvatar.js +4 -4
- package/dist/components/groups/GroupCard.js +3 -3
- package/dist/components/groups/GroupHeader.js +1 -1
- package/dist/components/groups/GroupMembersList.js +2 -3
- package/dist/components/groups/GroupOptionsMenu.js +12 -6
- package/dist/components/groups/JoinGroupButton.js +3 -20
- package/dist/components/jams/CreateNewJam.js +4 -4
- package/dist/components/jams/JamCallParticipant.js +17 -7
- package/dist/components/jams/JamCapacityGate.js +1 -1
- package/dist/components/jams/JamChatDrawer.js +2 -2
- package/dist/components/jams/JamConference.js +1 -1
- package/dist/components/jams/JamContext.d.ts +4 -0
- package/dist/components/jams/JamContext.js +17 -2
- package/dist/components/jams/JamDetailsDrawer.js +1 -1
- package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
- package/dist/components/jams/JamDeviceSelectors.js +4 -3
- package/dist/components/jams/JamFooter.js +15 -16
- package/dist/components/jams/JamGuestForm.js +2 -2
- package/dist/components/jams/JamLobby.js +9 -19
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +1 -1
- package/dist/components/jams/JamPeopleDrawer.js +17 -13
- package/dist/components/jams/JamReactionMenu.js +1 -1
- package/dist/components/jams/JamRequestJoin.js +1 -1
- package/dist/components/jams/JamRoom.js +84 -4
- package/dist/components/jams/JamToolbarButton.d.ts +21 -0
- package/dist/components/jams/JamToolbarButton.js +19 -0
- package/dist/components/jams/JamVideoCall.js +8 -3
- package/dist/components/jams/JamVideoLayout.js +16 -5
- package/dist/components/jams/LeaveCloseButton.js +9 -44
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/constants.js +4 -0
- package/dist/components/jams/useParticipantConnection.d.ts +7 -0
- package/dist/components/jams/useParticipantConnection.js +11 -0
- package/dist/components/layout/Auth.js +1 -1
- package/dist/components/layout/Infos.js +2 -2
- package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
- package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/markdown/CompiledMarkdown.js +15 -1
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +5 -1
- package/dist/components/navigation/HeaderMobile.js +1 -1
- package/dist/components/navigation/MobileMenuItem.js +1 -1
- package/dist/components/navigation/PageHeaderAction.js +1 -1
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +6 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
- package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
- package/dist/components/notifications/NotificationHeaderActions.js +2 -2
- package/dist/components/notifications/NotificationWrapper.js +1 -1
- package/dist/components/notifications/NotificationsList.js +3 -3
- package/dist/components/notifications/TypedNotification.js +3 -3
- package/dist/components/post/Feed.js +3 -3
- package/dist/components/post/FeedPost.d.ts +2 -1
- package/dist/components/post/FeedPost.js +11 -6
- package/dist/components/post/FeedPostContent.js +1 -1
- package/dist/components/post/FullPostLayout.js +11 -4
- package/dist/components/post/NewEventButton.js +1 -1
- package/dist/components/post/NewNoteButton.js +1 -1
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/ReplyBox.js +1 -1
- package/dist/components/post/feed/events/EventsFeed.js +3 -3
- package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
- package/dist/components/post/pieces/Attachments.js +3 -3
- package/dist/components/post/pieces/EventMenu.js +1 -1
- package/dist/components/post/pieces/EventRsvpButton.js +3 -3
- package/dist/components/post/pieces/FeedPostStats.js +2 -2
- package/dist/components/post/pieces/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +33 -14
- package/dist/components/post/pieces/PostActions.js +6 -45
- package/dist/components/post/pieces/PostInfoHeader.js +1 -1
- package/dist/components/post/pieces/PostMenu.js +35 -9
- package/dist/components/post/pieces/PostReactionHeader.js +1 -1
- package/dist/components/post/pieces/ShareMenu.js +4 -2
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
- package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
- package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
- package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
- package/dist/components/post/pieces/modals/RepostModal.js +8 -7
- package/dist/components/post/post-form/AttachmentCard.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.js +1 -1
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +22 -12
- package/dist/components/post/post-form/EventForm.js +2 -2
- package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
- package/dist/components/post/post-form/NewPostModal.js +10 -10
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
- package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
- package/dist/components/post/post-form/PollComposerFields.js +12 -8
- package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
- package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/ReplyModal.js +9 -8
- package/dist/components/post/post-form/VisibilitySelector.js +1 -1
- package/dist/components/post/types/Article.js +2 -1
- package/dist/components/post/types/Event.js +1 -1
- package/dist/components/post/types/Note.js +2 -1
- package/dist/components/post/types/Poll.js +2 -1
- package/dist/components/post/types/event/CardEvent.js +2 -2
- package/dist/components/post/types/event/FullEvent.js +8 -8
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
- package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
- package/dist/components/preview-link/LocalPreviewLink.js +1 -1
- package/dist/components/preview-link/RemotePreviewLink.js +5 -1
- package/dist/components/profile/Avatar.js +3 -2
- package/dist/components/profile/FollowUnfollowButton.js +2 -2
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfileCard.js +1 -1
- package/dist/components/profile/ProfileHeader.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +3 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
- package/dist/components/profile/ProfileSelector.js +3 -3
- package/dist/components/profile/ProfilesInput.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
- package/dist/components/server-data/context.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +63 -16774
- package/dist/contexts/openpeeps/hooks/admin.js +34 -14
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +330 -0
- package/dist/contexts/openpeeps/hooks/jams.d.ts +110 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/posts.d.ts +933 -53
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +220 -0
- package/dist/contexts/openpeeps/hooks/search.d.ts +330 -0
- package/dist/contexts/openpeeps/index.d.ts +1 -1
- package/dist/contexts/openpeeps/index.js +10 -2
- package/dist/contexts/router/index.d.ts +8 -3
- package/dist/contexts/router/index.js +7 -3
- package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
- package/dist/hooks/conversations/useCreateConversation.js +56 -0
- package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
- package/dist/hooks/groups/useJoinGroup.js +23 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
- package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
- package/dist/hooks/posts/useFeedPostActions.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Markdown.d.ts +14 -0
- package/dist/lib/Markdown.js +16 -0
- package/dist/lib/analyticsClicks.d.ts +12 -0
- package/dist/lib/analyticsClicks.js +64 -0
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +27 -0
- package/dist/lib/canvasUtils.d.ts +6 -0
- package/dist/lib/canvasUtils.js +62 -1
- package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
- package/dist/lib/passwordStrength.d.ts +6 -0
- package/dist/lib/passwordStrength.js +26 -0
- package/dist/lib/postUnread.d.ts +7 -0
- package/dist/lib/postUnread.js +7 -0
- package/dist/lib/postViewCounter.d.ts +1 -1
- package/dist/lib/postViewCounter.js +3 -1
- package/dist/lib/routeHandles.d.ts +2 -0
- package/dist/lib/routeHandles.js +2 -0
- package/dist/lib/svgCover.d.ts +2 -0
- package/dist/lib/svgCover.js +18 -0
- package/dist/navigation/index.d.ts +11 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/menuItems.d.ts +8 -0
- package/dist/navigation/menuItems.js +83 -0
- package/dist/navigation/targets.d.ts +94 -0
- package/dist/navigation/targets.js +12 -0
- package/dist/pages/About.d.ts +1 -0
- package/dist/pages/About.js +19 -0
- package/dist/pages/CodeOfConduct.d.ts +1 -0
- package/dist/pages/CodeOfConduct.js +14 -0
- package/dist/pages/Explore.d.ts +1 -0
- package/dist/pages/Explore.js +132 -0
- package/dist/pages/Home.d.ts +6 -0
- package/dist/pages/Home.js +31 -0
- package/dist/pages/Members.d.ts +1 -0
- package/dist/pages/Members.js +35 -0
- package/dist/pages/NotFound.d.ts +1 -0
- package/dist/pages/NotFound.js +9 -0
- package/dist/pages/Notifications.d.ts +1 -0
- package/dist/pages/Notifications.js +8 -0
- package/dist/pages/PostDetail.d.ts +1 -0
- package/dist/pages/PostDetail.js +27 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/Profile.js +20 -0
- package/dist/pages/Tags.d.ts +1 -0
- package/dist/pages/Tags.js +14 -0
- package/dist/pages/Welcome.d.ts +1 -0
- package/dist/pages/Welcome.js +89 -0
- package/dist/pages/admin/Analytics.d.ts +11 -0
- package/dist/pages/admin/Analytics.js +11 -0
- package/dist/pages/admin/ApiKeys.d.ts +1 -0
- package/dist/pages/admin/ApiKeys.js +141 -0
- package/dist/pages/admin/Backups.d.ts +1 -0
- package/dist/pages/admin/Backups.js +39 -0
- package/dist/pages/admin/ConfigEditor.d.ts +14 -0
- package/dist/pages/admin/ConfigEditor.js +91 -0
- package/dist/pages/admin/Configuration.d.ts +1 -0
- package/dist/pages/admin/Configuration.js +8 -0
- package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunity.js +7 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
- package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
- package/dist/pages/admin/ConfigurationEmail.js +97 -0
- package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
- package/dist/pages/admin/ConfigurationI18n.js +51 -0
- package/dist/pages/admin/Dashboard.d.ts +1 -0
- package/dist/pages/admin/Dashboard.js +40 -0
- package/dist/pages/admin/Db.d.ts +1 -0
- package/dist/pages/admin/Db.js +238 -0
- package/dist/pages/admin/Diagnostics.d.ts +1 -0
- package/dist/pages/admin/Diagnostics.js +8 -0
- package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsEmail.js +65 -0
- package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsJob.js +51 -0
- package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsLogs.js +62 -0
- package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
- package/dist/pages/admin/GroupMembers.d.ts +1 -0
- package/dist/pages/admin/GroupMembers.js +109 -0
- package/dist/pages/admin/Groups.d.ts +1 -0
- package/dist/pages/admin/Groups.js +61 -0
- package/dist/pages/admin/Invites.d.ts +1 -0
- package/dist/pages/admin/Invites.js +72 -0
- package/dist/pages/admin/Members.d.ts +1 -0
- package/dist/pages/admin/Members.js +49 -0
- package/dist/pages/admin/Moderation.d.ts +1 -0
- package/dist/pages/admin/Moderation.js +62 -0
- package/dist/pages/admin/Reports.d.ts +1 -0
- package/dist/pages/admin/Reports.js +178 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
- package/dist/pages/admin/analytics/Content.d.ts +1 -0
- package/dist/pages/admin/analytics/Content.js +117 -0
- package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
- package/dist/pages/admin/analytics/Engagement.js +220 -0
- package/dist/pages/admin/analytics/Groups.d.ts +1 -0
- package/dist/pages/admin/analytics/Groups.js +139 -0
- package/dist/pages/admin/analytics/Members.d.ts +1 -0
- package/dist/pages/admin/analytics/Members.js +96 -0
- package/dist/pages/admin/analytics/Overview.d.ts +1 -0
- package/dist/pages/admin/analytics/Overview.js +165 -0
- package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
- package/dist/pages/admin/analytics/ReportSettings.js +62 -0
- package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
- package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
- package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
- package/dist/pages/admin/analytics/downloadCsv.js +20 -0
- package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
- package/dist/pages/admin/community/CommunityFavicons.js +47 -0
- package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
- package/dist/pages/admin/community/CommunityInfo.js +35 -0
- package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
- package/dist/pages/admin/community/CommunityLinks.js +35 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
- package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
- package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
- package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
- package/dist/pages/admin/community/CommunityRoles.js +109 -0
- package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
- package/dist/pages/admin/community/CommunityTheme.js +56 -0
- package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
- package/dist/pages/admin/community/useCommunityConfig.js +28 -0
- package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
- package/dist/pages/admin/components/AdminCharts.js +29 -0
- package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
- package/dist/pages/admin/components/AdminGroupCard.js +42 -0
- package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
- package/dist/pages/admin/components/AdminInviteActions.js +23 -0
- package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
- package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
- package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
- package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
- package/dist/pages/admin/components/ProfileRowActions.js +131 -0
- package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
- package/dist/pages/articles/Edit.d.ts +1 -0
- package/dist/pages/articles/Edit.js +60 -0
- package/dist/pages/articles/Index.d.ts +1 -0
- package/dist/pages/articles/Index.js +18 -0
- package/dist/pages/articles/New.d.ts +1 -0
- package/dist/pages/articles/New.js +48 -0
- package/dist/pages/auth/Closed.d.ts +1 -0
- package/dist/pages/auth/Closed.js +14 -0
- package/dist/pages/auth/Login.d.ts +1 -0
- package/dist/pages/auth/Login.js +74 -0
- package/dist/pages/auth/OidcCallback.d.ts +5 -0
- package/dist/pages/auth/OidcCallback.js +31 -0
- package/dist/pages/auth/OidcPending.d.ts +5 -0
- package/dist/pages/auth/OidcPending.js +39 -0
- package/dist/pages/auth/Register.d.ts +4 -0
- package/dist/pages/auth/Register.js +124 -0
- package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
- package/dist/pages/auth/RegisterInvitation.js +5 -0
- package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
- package/dist/pages/auth/RequestResetPassword.js +50 -0
- package/dist/pages/auth/ResetPassword.d.ts +1 -0
- package/dist/pages/auth/ResetPassword.js +40 -0
- package/dist/pages/auth/SsoCallback.d.ts +1 -0
- package/dist/pages/auth/SsoCallback.js +34 -0
- package/dist/pages/auth/ValidateEmail.d.ts +6 -0
- package/dist/pages/auth/ValidateEmail.js +64 -0
- package/dist/pages/conversations/Index.d.ts +1 -0
- package/dist/pages/conversations/Index.js +58 -0
- package/dist/pages/conversations/Info.d.ts +1 -0
- package/dist/pages/conversations/Info.js +26 -0
- package/dist/pages/conversations/New.d.ts +1 -0
- package/dist/pages/conversations/New.js +8 -0
- package/dist/pages/conversations/Show.d.ts +1 -0
- package/dist/pages/conversations/Show.js +100 -0
- package/dist/pages/events/Edit.d.ts +1 -0
- package/dist/pages/events/Edit.js +69 -0
- package/dist/pages/events/Index.d.ts +1 -0
- package/dist/pages/events/Index.js +23 -0
- package/dist/pages/events/My.d.ts +1 -0
- package/dist/pages/events/My.js +24 -0
- package/dist/pages/events/New.d.ts +1 -0
- package/dist/pages/events/New.js +66 -0
- package/dist/pages/feeds/Bookmarks.d.ts +1 -0
- package/dist/pages/feeds/Bookmarks.js +10 -0
- package/dist/pages/feeds/Local.d.ts +1 -0
- package/dist/pages/feeds/Local.js +14 -0
- package/dist/pages/feeds/My.d.ts +1 -0
- package/dist/pages/feeds/My.js +12 -0
- package/dist/pages/groups/Edit.d.ts +1 -0
- package/dist/pages/groups/Edit.js +57 -0
- package/dist/pages/groups/Index.d.ts +1 -0
- package/dist/pages/groups/Index.js +50 -0
- package/dist/pages/groups/Info.d.ts +1 -0
- package/dist/pages/groups/Info.js +21 -0
- package/dist/pages/groups/Members.d.ts +1 -0
- package/dist/pages/groups/Members.js +28 -0
- package/dist/pages/groups/New.d.ts +1 -0
- package/dist/pages/groups/New.js +68 -0
- package/dist/pages/groups/Show.d.ts +1 -0
- package/dist/pages/groups/Show.js +64 -0
- package/dist/pages/index.d.ts +94 -0
- package/dist/pages/index.js +94 -0
- package/dist/pages/jams/Event.d.ts +8 -0
- package/dist/pages/jams/Event.js +57 -0
- package/dist/pages/jams/Index.d.ts +6 -0
- package/dist/pages/jams/Index.js +44 -0
- package/dist/pages/payment/Success.d.ts +1 -0
- package/dist/pages/payment/Success.js +30 -0
- package/dist/pages/plugins/Index.d.ts +1 -0
- package/dist/pages/plugins/Index.js +69 -0
- package/dist/pages/profile/Followers.d.ts +6 -0
- package/dist/pages/profile/Followers.js +28 -0
- package/dist/pages/settings/AccessTokens.d.ts +1 -0
- package/dist/pages/settings/AccessTokens.js +149 -0
- package/dist/pages/settings/Account.d.ts +1 -0
- package/dist/pages/settings/Account.js +81 -0
- package/dist/pages/settings/Billing.d.ts +1 -0
- package/dist/pages/settings/Billing.js +82 -0
- package/dist/pages/settings/Index.d.ts +1 -0
- package/dist/pages/settings/Index.js +13 -0
- package/dist/pages/settings/Language.d.ts +1 -0
- package/dist/pages/settings/Language.js +54 -0
- package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
- package/dist/pages/settings/NotificationPreferences.js +180 -0
- package/dist/pages/settings/Notifications.d.ts +1 -0
- package/dist/pages/settings/Notifications.js +10 -0
- package/dist/pages/settings/PublicProfile.d.ts +1 -0
- package/dist/pages/settings/PublicProfile.js +135 -0
- package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
- package/dist/pages/settings/PushEnabledDevices.js +67 -0
- package/dist/pages/settings/Theme.d.ts +1 -0
- package/dist/pages/settings/Theme.js +37 -0
- package/dist/pages/test/Error.d.ts +1 -0
- package/dist/pages/test/Error.js +10 -0
- package/dist/pages/test/Markdown.d.ts +1 -0
- package/dist/pages/test/Markdown.js +32 -0
- package/dist/pwa/InstallPrompt.js +1 -1
- package/dist/pwa/NotificationPermissionPrompt.js +2 -2
- package/dist/pwa/UpdatePrompt.js +1 -1
- package/dist/react-native.d.ts +1 -0
- package/dist/react-native.js +1 -0
- package/dist/session/useSessionEvents.d.ts +3 -0
- package/dist/session/useSessionEvents.js +64 -0
- package/dist/stores/newPosts.d.ts +8 -8
- package/package.json +14 -9
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
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
|
+
};
|
package/dist/lib/postUnread.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
2
|
export declare const isUnreadPostForViewer: (post: PublicPost, viewerId?: string) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Unseen SQL counts the feed row (`post.id`). For a repost that is the
|
|
5
|
+
* wrapper, not the nested original — viewing the original elsewhere must
|
|
6
|
+
* not clear the wrapper, and mark-seen must write `post_seen` for the
|
|
7
|
+
* wrapper.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isUnreadFeedActivityForViewer: (post: PublicPost, viewerId?: string) => boolean;
|
package/dist/lib/postUnread.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export const isUnreadPostForViewer = (post, viewerId) => post.seen === false && !!viewerId && post.profile.id !== viewerId;
|
|
2
|
+
/**
|
|
3
|
+
* Unseen SQL counts the feed row (`post.id`). For a repost that is the
|
|
4
|
+
* wrapper, not the nested original — viewing the original elsewhere must
|
|
5
|
+
* not clear the wrapper, and mark-seen must write `post_seen` for the
|
|
6
|
+
* wrapper.
|
|
7
|
+
*/
|
|
8
|
+
export const isUnreadFeedActivityForViewer = (post, viewerId) => isUnreadPostForViewer(post, viewerId);
|
|
@@ -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;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { Loader2, Search } from 'lucide-react';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader } from '../index.js';
|
|
6
|
+
import { CardEvent, FeedPost, GroupCard, ProfileCard } from '../components/index.js';
|
|
7
|
+
import { Button, Input, LoadingSpinner } from '@openpeepshq/react-ui';
|
|
8
|
+
const tabFromHash = (hash) => {
|
|
9
|
+
if (hash.includes('posts'))
|
|
10
|
+
return 'posts';
|
|
11
|
+
if (hash.includes('jams'))
|
|
12
|
+
return 'jams';
|
|
13
|
+
if (hash.includes('events'))
|
|
14
|
+
return 'events';
|
|
15
|
+
if (hash.includes('groups'))
|
|
16
|
+
return 'groups';
|
|
17
|
+
return 'members';
|
|
18
|
+
};
|
|
19
|
+
export function Explore() {
|
|
20
|
+
const t = useT();
|
|
21
|
+
const [params, setParams] = useSearchParams();
|
|
22
|
+
const initialQ = params.get('q') ?? '';
|
|
23
|
+
const [searchInput, setSearchInput] = useState(initialQ);
|
|
24
|
+
const [search, setSearch] = useState(initialQ);
|
|
25
|
+
const [tab, setTab] = useState(() => tabFromHash(typeof window !== 'undefined' ? window.location.hash : ''));
|
|
26
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
27
|
+
const sentinelRef = useRef(null);
|
|
28
|
+
useSetPageHeader(t('explore.title', { defaultValue: 'Explore' }));
|
|
29
|
+
const profilesQuery = openpeepsApi.useSearchProfiles(search);
|
|
30
|
+
const postsQuery = openpeepsApi.useSearchPosts(search);
|
|
31
|
+
const jamsQuery = openpeepsApi.useSearchJams(search);
|
|
32
|
+
const eventsQuery = openpeepsApi.useSearchEvents(search);
|
|
33
|
+
const groupsQuery = openpeepsApi.useSearchGroups(search);
|
|
34
|
+
const countsQuery = openpeepsApi.useSearchCounts(search);
|
|
35
|
+
const listQuery = useMemo(() => {
|
|
36
|
+
switch (tab) {
|
|
37
|
+
case 'posts':
|
|
38
|
+
return postsQuery;
|
|
39
|
+
case 'jams':
|
|
40
|
+
return jamsQuery;
|
|
41
|
+
case 'events':
|
|
42
|
+
return eventsQuery;
|
|
43
|
+
case 'groups':
|
|
44
|
+
return groupsQuery;
|
|
45
|
+
default:
|
|
46
|
+
return profilesQuery;
|
|
47
|
+
}
|
|
48
|
+
}, [tab, postsQuery, jamsQuery, eventsQuery, groupsQuery, profilesQuery]);
|
|
49
|
+
const profileItems = useMemo(() => (profilesQuery.data?.pages ?? [])
|
|
50
|
+
.flat()
|
|
51
|
+
.map((item) => item.data), [profilesQuery.data]);
|
|
52
|
+
const postItems = useMemo(() => (postsQuery.data?.pages ?? [])
|
|
53
|
+
.flat()
|
|
54
|
+
.map((item) => item.data), [postsQuery.data]);
|
|
55
|
+
const jamItems = useMemo(() => (jamsQuery.data?.pages ?? [])
|
|
56
|
+
.flat()
|
|
57
|
+
.map((item) => item.data), [jamsQuery.data]);
|
|
58
|
+
const eventItems = useMemo(() => (eventsQuery.data?.pages ?? [])
|
|
59
|
+
.flat()
|
|
60
|
+
.map((item) => item.data), [eventsQuery.data]);
|
|
61
|
+
const groupItems = useMemo(() => (groupsQuery.data?.pages ?? [])
|
|
62
|
+
.flat()
|
|
63
|
+
.map((item) => item.data), [groupsQuery.data]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const el = sentinelRef.current;
|
|
66
|
+
if (!el)
|
|
67
|
+
return;
|
|
68
|
+
const obs = new IntersectionObserver((entries) => {
|
|
69
|
+
const entry = entries[0];
|
|
70
|
+
if (!entry)
|
|
71
|
+
return;
|
|
72
|
+
if (entry.isIntersecting &&
|
|
73
|
+
listQuery.hasNextPage &&
|
|
74
|
+
!listQuery.isFetchingNextPage) {
|
|
75
|
+
void listQuery.fetchNextPage();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
obs.observe(el);
|
|
79
|
+
return () => obs.disconnect();
|
|
80
|
+
}, [listQuery]);
|
|
81
|
+
// Mirror Svelte explore: keep the active tab in sync with the URL hash so
|
|
82
|
+
// browser back/forward navigation selects the matching tab.
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const syncTabFromHash = () => setTab(tabFromHash(window.location.hash));
|
|
85
|
+
window.addEventListener('popstate', syncTabFromHash);
|
|
86
|
+
window.addEventListener('hashchange', syncTabFromHash);
|
|
87
|
+
return () => {
|
|
88
|
+
window.removeEventListener('popstate', syncTabFromHash);
|
|
89
|
+
window.removeEventListener('hashchange', syncTabFromHash);
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
92
|
+
const triggerSearch = () => {
|
|
93
|
+
setSearch(searchInput);
|
|
94
|
+
setParams({ q: searchInput });
|
|
95
|
+
};
|
|
96
|
+
const switchTab = (next) => {
|
|
97
|
+
setTab(next);
|
|
98
|
+
window.history.replaceState(null, '', `${window.location.pathname}?q=${search}#${next}`);
|
|
99
|
+
};
|
|
100
|
+
const counts = countsQuery.data;
|
|
101
|
+
const countsLoading = countsQuery.isLoading || countsQuery.isFetching;
|
|
102
|
+
return (_jsxs("div", { className: "p-4", children: [_jsxs("form", { role: "search", className: "flex gap-x-2", onSubmit: (e) => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
triggerSearch();
|
|
105
|
+
}, children: [_jsx(Input, { placeholder: t('explore.enterSearchQuery', {
|
|
106
|
+
defaultValue: 'Search for members, posts, groups…',
|
|
107
|
+
}), value: searchInput, onChange: (e) => setSearchInput(e.target.value), "data-testid": "explore-search-input" }), _jsx(Button, { title: t('explore.SearchButton', { defaultValue: 'Search' }), variant: "default", action: triggerSearch, className: "px-8", children: _jsx(Search, {}) })] }), _jsxs("nav", { "aria-label": t('explore.tabs.label', { defaultValue: 'Result types' }), className: "border-border mt-4 flex flex-wrap border-b", children: [_jsx(TabButton, { active: tab === 'members', onClick: () => switchTab('members'), count: counts?.profiles, countLoading: countsLoading, children: t('explore.tabs.members', { defaultValue: 'Members' }) }), _jsx(TabButton, { active: tab === 'posts', onClick: () => switchTab('posts'), count: counts?.posts, countLoading: countsLoading, children: t('explore.tabs.posts', { defaultValue: 'Posts' }) }), _jsx(TabButton, { active: tab === 'jams', onClick: () => switchTab('jams'), count: counts?.jams, countLoading: countsLoading, children: t('explore.tabs.jams', { defaultValue: 'Jams' }) }), _jsx(TabButton, { active: tab === 'events', onClick: () => switchTab('events'), count: counts?.events, countLoading: countsLoading, children: t('explore.tabs.events', { defaultValue: 'Events' }) }), _jsx(TabButton, { active: tab === 'groups', onClick: () => switchTab('groups'), count: counts?.groups, countLoading: countsLoading, children: t('explore.tabs.groups', { defaultValue: 'Groups' }) })] }), _jsxs("div", { className: "mt-2", children: [search.length <= 2 ? (_jsx("p", { className: "text-muted-foreground p-6 text-sm", children: t('explore.startTyping', {
|
|
108
|
+
defaultValue: 'Type at least 3 characters to start searching.',
|
|
109
|
+
}) })) : listQuery.isLoading ? (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) })) : tab === 'jams' ? (_jsx(EventSearchResults, { posts: jamItems, emptyMessage: t('explore.noJamsFound', {
|
|
110
|
+
defaultValue: 'No jams found',
|
|
111
|
+
}) })) : tab === 'events' ? (_jsx(EventSearchResults, { posts: eventItems, emptyMessage: t('explore.noEventsFound', {
|
|
112
|
+
defaultValue: 'No events found',
|
|
113
|
+
}) })) : tab === 'groups' ? (_jsxs(_Fragment, { children: [groupItems.map((group) => (_jsx(GroupCard, { group: group }, group.id))), groupItems.length === 0 ? (_jsx(EmptyResults, { message: t('explore.noGroupsFound', {
|
|
114
|
+
defaultValue: 'No groups found',
|
|
115
|
+
}) })) : null] })) : tab === 'posts' ? (_jsxs("div", { role: "feed", children: [postItems.map((post) => (_jsx("a", { href: `/posts/${post.id}`, children: _jsx(FeedPost, { post: post }) }, post.id))), postItems.length === 0 ? (_jsx(EmptyResults, { message: t('explore.noPostsFound', {
|
|
116
|
+
defaultValue: 'No posts found',
|
|
117
|
+
}) })) : null] })) : profileItems.length === 0 ? (_jsx(EmptyResults, { message: t('explore.noProfilesFound', {
|
|
118
|
+
defaultValue: 'No profiles found',
|
|
119
|
+
}), testId: "explore-no-profiles-found" })) : (profileItems.map((profile) => (_jsx(ProfileCard, { profile: profile }, profile.id)))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), listQuery.isFetchingNextPage ? (_jsx("div", { className: "text-muted-foreground flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) })) : null] })] }));
|
|
120
|
+
}
|
|
121
|
+
function EventSearchResults({ posts, emptyMessage, }) {
|
|
122
|
+
if (posts.length === 0) {
|
|
123
|
+
return _jsx(EmptyResults, { message: emptyMessage });
|
|
124
|
+
}
|
|
125
|
+
return (_jsx("div", { className: "grid gap-4 sm:grid-cols-2", role: "feed", children: posts.map((post) => (_jsx(CardEvent, { post: post }, post.id))) }));
|
|
126
|
+
}
|
|
127
|
+
function EmptyResults({ message, testId, }) {
|
|
128
|
+
return (_jsx("div", { className: "flex w-full items-center justify-center p-8", children: _jsx("h2", { className: "text-lg", "data-testid": testId, children: message }) }));
|
|
129
|
+
}
|
|
130
|
+
function TabButton({ active, count, countLoading = false, onClick, children, }) {
|
|
131
|
+
return (_jsxs("button", { type: "button", onClick: onClick, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: [children, countLoading ? (_jsx(Loader2, { className: "ml-1 inline-block h-3 w-3 animate-spin" })) : typeof count === 'number' ? (_jsx("span", { className: "bg-surface-2 ml-1 rounded-full px-2 py-0.5 text-xs", children: count > 99 ? '99+' : count })) : null] }));
|
|
132
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redirect to `/feeds/local` when the user is signed in or the community has
|
|
3
|
+
* public content, otherwise to `/auth/login`. Surfaces the `?toast=success`
|
|
4
|
+
* notice from the email validation flow as a transient banner.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Home(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { Toast } from '@openpeepshq/react-ui';
|
|
5
|
+
import { useT } from '../index.js';
|
|
6
|
+
import { useCurrentProfile, useServerInfo } from '../components/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Redirect to `/feeds/local` when the user is signed in or the community has
|
|
9
|
+
* public content, otherwise to `/auth/login`. Surfaces the `?toast=success`
|
|
10
|
+
* notice from the email validation flow as a transient banner.
|
|
11
|
+
*/
|
|
12
|
+
export function Home() {
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const [searchParams] = useSearchParams();
|
|
15
|
+
const serverInfo = useServerInfo();
|
|
16
|
+
const currentProfile = useCurrentProfile();
|
|
17
|
+
const t = useT();
|
|
18
|
+
const toastType = searchParams.get('toast');
|
|
19
|
+
const profileKey = currentProfile?.id ?? '';
|
|
20
|
+
const hasPublic = !!serverInfo.publicContent;
|
|
21
|
+
const target = useMemo(() => (profileKey || hasPublic ? '/feeds/local' : '/auth/login'), [profileKey, hasPublic]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
navigate(target, { replace: true });
|
|
24
|
+
}, [target, navigate]);
|
|
25
|
+
if (toastType === 'success') {
|
|
26
|
+
return (_jsx(Toast, { variant: "success", children: t('auth.email.validation.success', {
|
|
27
|
+
defaultValue: 'Email validated.',
|
|
28
|
+
}) }));
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Members(): import("react/jsx-runtime").JSX.Element;
|