@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
|
@@ -8,6 +8,7 @@ export const useRouter = () => {
|
|
|
8
8
|
return ctx;
|
|
9
9
|
};
|
|
10
10
|
export const useNavigate = () => useRouter().navigate;
|
|
11
|
+
export const useHrefOf = () => useRouter().hrefOf;
|
|
11
12
|
export const usePathname = () => useRouter().pathname;
|
|
12
13
|
export const useSearchParams = () => useRouter().searchParams;
|
|
13
14
|
/** Pathname when inside `RouterProvider`, otherwise `undefined` (no throw). */
|
|
@@ -27,7 +28,7 @@ export function RouterProvider({ adapter, children }) {
|
|
|
27
28
|
* Browser-only fallback — uses `window.location` + `popstate`. Suitable for
|
|
28
29
|
* standalone PWAs that don't ship with a real router (e.g. dev shells).
|
|
29
30
|
*/
|
|
30
|
-
export function useBrowserRouter() {
|
|
31
|
+
export function useBrowserRouter(navigator) {
|
|
31
32
|
const initial = useMemo(() => {
|
|
32
33
|
if (typeof window === 'undefined') {
|
|
33
34
|
return { pathname: '/', searchParams: new URLSearchParams() };
|
|
@@ -51,9 +52,12 @@ export function useBrowserRouter() {
|
|
|
51
52
|
return useMemo(() => ({
|
|
52
53
|
pathname: state.pathname,
|
|
53
54
|
searchParams: state.searchParams,
|
|
54
|
-
|
|
55
|
+
hrefOf: navigator.hrefOf,
|
|
56
|
+
match: navigator.match,
|
|
57
|
+
navigate: (target) => {
|
|
55
58
|
if (typeof window === 'undefined')
|
|
56
59
|
return;
|
|
60
|
+
const url = typeof target === 'string' ? target : navigator.hrefOf(target);
|
|
57
61
|
history.pushState({}, '', url);
|
|
58
62
|
setState({
|
|
59
63
|
pathname: window.location.pathname,
|
|
@@ -65,5 +69,5 @@ export function useBrowserRouter() {
|
|
|
65
69
|
return;
|
|
66
70
|
history.back();
|
|
67
71
|
},
|
|
68
|
-
}), [state]);
|
|
72
|
+
}), [state, navigator]);
|
|
69
73
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { PublicProfile } from '@openpeepshq/common/types';
|
|
2
|
+
export type UseCreateConversationArgs = {
|
|
3
|
+
profiles?: PublicProfile[];
|
|
4
|
+
message?: string;
|
|
5
|
+
skipProfileSelection?: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Non-DOM conversation-create controller (steps + submit).
|
|
10
|
+
*/
|
|
11
|
+
export declare const useCreateConversation: ({ profiles: initialProfiles, message: initialMessage, skipProfileSelection, onClose, }: UseCreateConversationArgs) => {
|
|
12
|
+
me: import("@openpeepshq/common").ProfileWithMeta | undefined;
|
|
13
|
+
step: number;
|
|
14
|
+
setStep: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
15
|
+
selectedProfiles: {
|
|
16
|
+
id: string;
|
|
17
|
+
type: "local" | "guest" | "federated";
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
handle: string;
|
|
21
|
+
memberships: {
|
|
22
|
+
group: {
|
|
23
|
+
handle: string;
|
|
24
|
+
capabilities: Record<string, {
|
|
25
|
+
add?: string[] | undefined;
|
|
26
|
+
remove?: string[] | undefined;
|
|
27
|
+
} | undefined>;
|
|
28
|
+
id: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
avatar?: string | null | undefined;
|
|
32
|
+
header?: string | null | undefined;
|
|
33
|
+
displayName?: string | undefined;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
rules?: string | undefined;
|
|
36
|
+
pinnedPostId?: string | undefined;
|
|
37
|
+
discoverable?: boolean | undefined;
|
|
38
|
+
deletedAt?: string | null | undefined;
|
|
39
|
+
};
|
|
40
|
+
roles?: ("none" | "local" | "member" | "admin" | "moderator" | "invited")[] | null | undefined;
|
|
41
|
+
}[] | undefined;
|
|
42
|
+
deletedAt?: string | null | undefined;
|
|
43
|
+
avatar?: string | null | undefined;
|
|
44
|
+
header?: string | null | undefined;
|
|
45
|
+
displayName?: string | undefined;
|
|
46
|
+
bio?: string | undefined;
|
|
47
|
+
location?: {
|
|
48
|
+
text: string;
|
|
49
|
+
coordinates?: {
|
|
50
|
+
lat: number;
|
|
51
|
+
lng: number;
|
|
52
|
+
alt?: number | undefined;
|
|
53
|
+
} | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
locked?: boolean | undefined;
|
|
56
|
+
bot?: boolean | undefined;
|
|
57
|
+
discoverable?: boolean | undefined;
|
|
58
|
+
fields?: {
|
|
59
|
+
name: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
profileStats?: {
|
|
63
|
+
followersCount: number;
|
|
64
|
+
followingCount: number;
|
|
65
|
+
} | undefined;
|
|
66
|
+
}[];
|
|
67
|
+
setSelectedProfiles: import("react").Dispatch<import("react").SetStateAction<{
|
|
68
|
+
id: string;
|
|
69
|
+
type: "local" | "guest" | "federated";
|
|
70
|
+
createdAt: string;
|
|
71
|
+
updatedAt: string;
|
|
72
|
+
handle: string;
|
|
73
|
+
memberships: {
|
|
74
|
+
group: {
|
|
75
|
+
handle: string;
|
|
76
|
+
capabilities: Record<string, {
|
|
77
|
+
add?: string[] | undefined;
|
|
78
|
+
remove?: string[] | undefined;
|
|
79
|
+
} | undefined>;
|
|
80
|
+
id: string;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
updatedAt: string;
|
|
83
|
+
avatar?: string | null | undefined;
|
|
84
|
+
header?: string | null | undefined;
|
|
85
|
+
displayName?: string | undefined;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
rules?: string | undefined;
|
|
88
|
+
pinnedPostId?: string | undefined;
|
|
89
|
+
discoverable?: boolean | undefined;
|
|
90
|
+
deletedAt?: string | null | undefined;
|
|
91
|
+
};
|
|
92
|
+
roles?: ("none" | "local" | "member" | "admin" | "moderator" | "invited")[] | null | undefined;
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
deletedAt?: string | null | undefined;
|
|
95
|
+
avatar?: string | null | undefined;
|
|
96
|
+
header?: string | null | undefined;
|
|
97
|
+
displayName?: string | undefined;
|
|
98
|
+
bio?: string | undefined;
|
|
99
|
+
location?: {
|
|
100
|
+
text: string;
|
|
101
|
+
coordinates?: {
|
|
102
|
+
lat: number;
|
|
103
|
+
lng: number;
|
|
104
|
+
alt?: number | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
} | undefined;
|
|
107
|
+
locked?: boolean | undefined;
|
|
108
|
+
bot?: boolean | undefined;
|
|
109
|
+
discoverable?: boolean | undefined;
|
|
110
|
+
fields?: {
|
|
111
|
+
name: string;
|
|
112
|
+
value: string;
|
|
113
|
+
}[] | undefined;
|
|
114
|
+
profileStats?: {
|
|
115
|
+
followersCount: number;
|
|
116
|
+
followingCount: number;
|
|
117
|
+
} | undefined;
|
|
118
|
+
}[]>>;
|
|
119
|
+
message: string;
|
|
120
|
+
setMessage: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
121
|
+
submitting: boolean;
|
|
122
|
+
error: string | null;
|
|
123
|
+
send: () => Promise<void>;
|
|
124
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useNavigate } from '../../contexts/router/index.js';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
5
|
+
/**
|
|
6
|
+
* Non-DOM conversation-create controller (steps + submit).
|
|
7
|
+
*/
|
|
8
|
+
export const useCreateConversation = ({ profiles: initialProfiles = [], message: initialMessage = '', skipProfileSelection = false, onClose, }) => {
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const me = useCurrentProfile();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const createPost = openpeepsApi.createPostAction();
|
|
13
|
+
const [step, setStep] = useState(skipProfileSelection ? 2 : 1);
|
|
14
|
+
const [selectedProfiles, setSelectedProfiles] = useState(initialProfiles);
|
|
15
|
+
const [message, setMessage] = useState(initialMessage);
|
|
16
|
+
const [submitting, setSubmitting] = useState(false);
|
|
17
|
+
const [error, setError] = useState(null);
|
|
18
|
+
const send = async () => {
|
|
19
|
+
if (!me || selectedProfiles.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
setError(null);
|
|
22
|
+
setSubmitting(true);
|
|
23
|
+
try {
|
|
24
|
+
const payload = {
|
|
25
|
+
visibility: 'direct',
|
|
26
|
+
type: 'note',
|
|
27
|
+
audience: [me, ...selectedProfiles],
|
|
28
|
+
data: {
|
|
29
|
+
type: 'note',
|
|
30
|
+
content: message.trim(),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const created = (await createPost(payload));
|
|
34
|
+
onClose();
|
|
35
|
+
navigate({ type: 'conversation', id: created.id });
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
setError(err.message);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setSubmitting(false);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
me,
|
|
46
|
+
step,
|
|
47
|
+
setStep,
|
|
48
|
+
selectedProfiles,
|
|
49
|
+
setSelectedProfiles,
|
|
50
|
+
message,
|
|
51
|
+
setMessage,
|
|
52
|
+
submitting,
|
|
53
|
+
error,
|
|
54
|
+
send,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GroupWithMeta } from '@openpeepshq/common/types';
|
|
2
|
+
/**
|
|
3
|
+
* Non-DOM join-group controller — reusable from web and (later) RN screens.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useJoinGroup: (group: GroupWithMeta, onJoined?: () => void) => {
|
|
6
|
+
canJoin: boolean;
|
|
7
|
+
join: () => Promise<void>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { checkGroupCapabilities } from '@openpeepshq/common/lib';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useAuthData, useCurrentProfile, } from '../../components/layout/IdentityContext.js';
|
|
5
|
+
/**
|
|
6
|
+
* Non-DOM join-group controller — reusable from web and (later) RN screens.
|
|
7
|
+
*/
|
|
8
|
+
export const useJoinGroup = (group, onJoined) => {
|
|
9
|
+
const authData = useAuthData();
|
|
10
|
+
const me = useCurrentProfile();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const joinGroup = openpeepsApi.joinGroupAction({ id: group.id });
|
|
13
|
+
const [joined, setJoined] = useState(false);
|
|
14
|
+
const isMember = joined || me?.memberships?.some((m) => m.group.id === group.id);
|
|
15
|
+
const canJoin = !isMember &&
|
|
16
|
+
checkGroupCapabilities(authData, ['core-groups-join'], group).success;
|
|
17
|
+
const join = async () => {
|
|
18
|
+
await joinGroup(undefined);
|
|
19
|
+
setJoined(true);
|
|
20
|
+
onJoined?.();
|
|
21
|
+
};
|
|
22
|
+
return { canJoin, join };
|
|
23
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useJoinGroup } from './groups/useJoinGroup';
|
|
2
|
+
export { useCreateConversation } from './conversations/useCreateConversation';
|
|
3
|
+
export type { UseCreateConversationArgs } from './conversations/useCreateConversation';
|
|
4
|
+
export { useLeaveCloseJam } from './jams/useLeaveCloseJam';
|
|
5
|
+
export type { UseLeaveCloseJamArgs } from './jams/useLeaveCloseJam';
|
|
6
|
+
export { useFeedPostActions } from './posts/useFeedPostActions';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useJoinGroup } from './groups/useJoinGroup.js';
|
|
2
|
+
export { useCreateConversation } from './conversations/useCreateConversation.js';
|
|
3
|
+
export { useLeaveCloseJam } from './jams/useLeaveCloseJam.js';
|
|
4
|
+
export { useFeedPostActions } from './posts/useFeedPostActions.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type UseLeaveCloseJamArgs = {
|
|
2
|
+
jamPostId: string;
|
|
3
|
+
moderatorIds: string[];
|
|
4
|
+
/** Host supplies room disconnect (LiveKit / native). */
|
|
5
|
+
disconnect: () => Promise<void> | void;
|
|
6
|
+
markIntentionalLeave: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Non-DOM leave/close jam controller. UI supplies `disconnect`; this owns
|
|
10
|
+
* confirm state, close API, and navigation targets.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useLeaveCloseJam: ({ jamPostId, moderatorIds, disconnect, markIntentionalLeave, }: UseLeaveCloseJamArgs) => {
|
|
13
|
+
isModerator: boolean;
|
|
14
|
+
busy: boolean;
|
|
15
|
+
confirmOpen: boolean;
|
|
16
|
+
setConfirmOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
+
handleClick: () => void;
|
|
18
|
+
handleLeave: () => Promise<void>;
|
|
19
|
+
handleClose: () => Promise<void>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useNavigate } from '../../contexts/router/index.js';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
5
|
+
/**
|
|
6
|
+
* Non-DOM leave/close jam controller. UI supplies `disconnect`; this owns
|
|
7
|
+
* confirm state, close API, and navigation targets.
|
|
8
|
+
*/
|
|
9
|
+
export const useLeaveCloseJam = ({ jamPostId, moderatorIds, disconnect, markIntentionalLeave, }) => {
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const me = useCurrentProfile();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const closeJam = openpeepsApi.closeJamAction({ id: jamPostId });
|
|
14
|
+
const isModerator = !!me && moderatorIds.includes(me.id);
|
|
15
|
+
const [busy, setBusy] = useState(false);
|
|
16
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
17
|
+
const leave = async () => {
|
|
18
|
+
markIntentionalLeave();
|
|
19
|
+
await disconnect();
|
|
20
|
+
navigate({ type: 'jams' });
|
|
21
|
+
};
|
|
22
|
+
const handleLeave = async () => {
|
|
23
|
+
setBusy(true);
|
|
24
|
+
try {
|
|
25
|
+
await leave();
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
setBusy(false);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleClose = async () => {
|
|
32
|
+
setBusy(true);
|
|
33
|
+
try {
|
|
34
|
+
markIntentionalLeave();
|
|
35
|
+
await closeJam();
|
|
36
|
+
navigate({ type: 'jams' });
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
setBusy(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const handleClick = () => {
|
|
43
|
+
if (isModerator) {
|
|
44
|
+
setConfirmOpen(true);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
void handleLeave();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
isModerator,
|
|
52
|
+
busy,
|
|
53
|
+
confirmOpen,
|
|
54
|
+
setConfirmOpen,
|
|
55
|
+
handleClick,
|
|
56
|
+
handleLeave,
|
|
57
|
+
handleClose,
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
/**
|
|
3
|
+
* Non-DOM post footer actions (reply / repost / react) for FeedPost and RN.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useFeedPostActions: (post: PublicPost) => {
|
|
6
|
+
me: import("@openpeepshq/common").ProfileWithMeta | undefined;
|
|
7
|
+
myRepost: {
|
|
8
|
+
id: string;
|
|
9
|
+
repost?: {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
} | undefined;
|
|
13
|
+
iReacted: boolean;
|
|
14
|
+
disabledForGroup: boolean;
|
|
15
|
+
reply: () => void;
|
|
16
|
+
toggleRepost: () => Promise<void>;
|
|
17
|
+
toggleReaction: () => Promise<void>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
3
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
4
|
+
import { useReplyModal } from '../../components/post/post-form/ReplyModalContext.js';
|
|
5
|
+
/**
|
|
6
|
+
* Non-DOM post footer actions (reply / repost / react) for FeedPost and RN.
|
|
7
|
+
*/
|
|
8
|
+
export const useFeedPostActions = (post) => {
|
|
9
|
+
const me = useCurrentProfile();
|
|
10
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
11
|
+
const { openReply } = useReplyModal();
|
|
12
|
+
const repostsQuery = openpeepsApi.useCurrentProfileReposts();
|
|
13
|
+
const reactToPost = openpeepsApi.reactToPostAction({ id: post.id });
|
|
14
|
+
const retractReaction = openpeepsApi.retractPostReactionAction({
|
|
15
|
+
id: post.id,
|
|
16
|
+
});
|
|
17
|
+
const repostPost = openpeepsApi.repostPostAction({ id: post.id });
|
|
18
|
+
const deletePost = openpeepsApi.deletePostAction({ id: post.id });
|
|
19
|
+
const myRepost = useMemo(() => repostsQuery.data?.find((p) => p.repost?.id === post.id), [repostsQuery.data, post.id]);
|
|
20
|
+
const iReacted = useMemo(() => !!post.reactions?.some((r) => r.profile.id === me?.id), [post.reactions, me?.id]);
|
|
21
|
+
const isGroupPost = !!post.groupId;
|
|
22
|
+
const membershipExists = !!me?.memberships?.some((m) => m.group.id === post.group?.id);
|
|
23
|
+
const disabledForGroup = isGroupPost && !membershipExists;
|
|
24
|
+
const reply = () => openReply(post);
|
|
25
|
+
const toggleRepost = async () => {
|
|
26
|
+
if (myRepost) {
|
|
27
|
+
await deletePost({ id: myRepost.id });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
await repostPost(undefined);
|
|
31
|
+
}
|
|
32
|
+
await repostsQuery.refetch();
|
|
33
|
+
};
|
|
34
|
+
const toggleReaction = async () => {
|
|
35
|
+
if (iReacted) {
|
|
36
|
+
await retractReaction(undefined);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
await reactToPost({ reaction: '👍' });
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
me,
|
|
44
|
+
myRepost,
|
|
45
|
+
iReacted,
|
|
46
|
+
disabledForGroup,
|
|
47
|
+
reply,
|
|
48
|
+
toggleRepost,
|
|
49
|
+
toggleReaction,
|
|
50
|
+
};
|
|
51
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,13 @@ export * from './streaming';
|
|
|
5
5
|
export * from './stores';
|
|
6
6
|
export * from './push';
|
|
7
7
|
export * from './lib/postViewCounter';
|
|
8
|
+
export * from './lib/analyticsClicks';
|
|
8
9
|
export * from './lib/unseenCountsOptimistic';
|
|
9
10
|
export * from './lib/notificationBadge';
|
|
10
11
|
export * from './lib/postUnread';
|
|
11
12
|
export * from './components';
|
|
13
|
+
export * from './navigation';
|
|
14
|
+
export * from './hooks';
|
|
12
15
|
export { resolveAdminConfigSchema } from './lib/configuration/resolveSchema';
|
|
13
16
|
export { diffConfigTrees, equal } from './lib/configuration/helpers';
|
|
14
17
|
export * as pwa from './pwa';
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,13 @@ export * from './streaming.js';
|
|
|
5
5
|
export * from './stores/index.js';
|
|
6
6
|
export * from './push/index.js';
|
|
7
7
|
export * from './lib/postViewCounter.js';
|
|
8
|
+
export * from './lib/analyticsClicks.js';
|
|
8
9
|
export * from './lib/unseenCountsOptimistic.js';
|
|
9
10
|
export * from './lib/notificationBadge.js';
|
|
10
11
|
export * from './lib/postUnread.js';
|
|
11
12
|
export * from './components/index.js';
|
|
13
|
+
export * from './navigation/index.js';
|
|
14
|
+
export * from './hooks/index.js';
|
|
12
15
|
export { resolveAdminConfigSchema } from './lib/configuration/resolveSchema.js';
|
|
13
16
|
export { diffConfigTrees, equal } from './lib/configuration/helpers.js';
|
|
14
17
|
export * as pwa from './pwa/index.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface MarkdownProps {
|
|
2
|
+
source: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Inline Markdown renderer. Uses `marked` synchronously to render trusted
|
|
7
|
+
* content (community-authored about/welcome pages, code-of-conduct, etc.).
|
|
8
|
+
*
|
|
9
|
+
* Note: this purposefully does NOT sanitize the output — the source is
|
|
10
|
+
* configured by community admins, mirroring how `OpenpeepsMarkdown` in the
|
|
11
|
+
* Svelte app behaves. If you ever feed untrusted markdown through here,
|
|
12
|
+
* sanitize first.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Markdown({ source, className }: MarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { marked } from 'marked';
|
|
4
|
+
/**
|
|
5
|
+
* Inline Markdown renderer. Uses `marked` synchronously to render trusted
|
|
6
|
+
* content (community-authored about/welcome pages, code-of-conduct, etc.).
|
|
7
|
+
*
|
|
8
|
+
* Note: this purposefully does NOT sanitize the output — the source is
|
|
9
|
+
* configured by community admins, mirroring how `OpenpeepsMarkdown` in the
|
|
10
|
+
* Svelte app behaves. If you ever feed untrusted markdown through here,
|
|
11
|
+
* sanitize first.
|
|
12
|
+
*/
|
|
13
|
+
export function Markdown({ source, className }) {
|
|
14
|
+
const html = useMemo(() => marked.parse(source ?? '', { async: false }), [source]);
|
|
15
|
+
return (_jsx("div", { className: className ?? 'prose prose-sm dark:prose-invert max-w-none', dangerouslySetInnerHTML: { __html: html } }));
|
|
16
|
+
}
|
|
@@ -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;
|