@openpeepshq/react 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accounts/SignUpLoginModal.js +2 -2
- package/dist/components/configuration/ConfigMenuButton.d.ts +10 -0
- package/dist/components/configuration/ConfigMenuButton.js +12 -0
- package/dist/components/configuration/ConfigurationTree.js +1 -1
- package/dist/components/configuration/index.d.ts +2 -0
- package/dist/components/configuration/index.js +1 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +2 -1
- package/dist/components/conversations/ConversationMessageBubble.js +4 -5
- package/dist/components/conversations/CreateNewConversation.js +10 -42
- package/dist/components/conversations/DirectMessagesHeaderActions.js +1 -1
- package/dist/components/conversations/MessageInThread.js +1 -2
- package/dist/components/form/ImageEditModal.js +2 -4
- package/dist/components/form/ImageInput.js +13 -8
- package/dist/components/form/LocationInput.js +1 -1
- package/dist/components/groups/AddGroupMembersButton.d.ts +1 -1
- package/dist/components/groups/AddGroupMembersButton.js +2 -2
- package/dist/components/groups/ChangeGroupRolesModal.js +1 -1
- package/dist/components/groups/ConfirmGroupExitModal.js +2 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +1 -1
- package/dist/components/groups/DeleteGroupModal.js +1 -1
- package/dist/components/groups/GroupAvatar.js +4 -4
- package/dist/components/groups/GroupCard.js +3 -3
- package/dist/components/groups/GroupHeader.js +1 -1
- package/dist/components/groups/GroupMembersList.js +2 -3
- package/dist/components/groups/GroupOptionsMenu.js +12 -6
- package/dist/components/groups/JoinGroupButton.js +3 -20
- package/dist/components/jams/CreateNewJam.js +4 -4
- package/dist/components/jams/JamCallParticipant.js +17 -7
- package/dist/components/jams/JamCapacityGate.js +1 -1
- package/dist/components/jams/JamChatDrawer.js +2 -2
- package/dist/components/jams/JamConference.js +1 -1
- package/dist/components/jams/JamContext.d.ts +4 -0
- package/dist/components/jams/JamContext.js +17 -2
- package/dist/components/jams/JamDetailsDrawer.js +1 -1
- package/dist/components/jams/JamDeviceSelectors.d.ts +15 -0
- package/dist/components/jams/JamDeviceSelectors.js +4 -3
- package/dist/components/jams/JamFooter.js +15 -16
- package/dist/components/jams/JamGuestForm.js +2 -2
- package/dist/components/jams/JamLobby.js +9 -19
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +1 -1
- package/dist/components/jams/JamPeopleDrawer.js +17 -13
- package/dist/components/jams/JamReactionMenu.js +1 -1
- package/dist/components/jams/JamRequestJoin.js +1 -1
- package/dist/components/jams/JamRoom.js +84 -4
- package/dist/components/jams/JamToolbarButton.d.ts +21 -0
- package/dist/components/jams/JamToolbarButton.js +19 -0
- package/dist/components/jams/JamVideoCall.js +8 -3
- package/dist/components/jams/JamVideoLayout.js +16 -5
- package/dist/components/jams/LeaveCloseButton.js +9 -44
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/constants.js +4 -0
- package/dist/components/jams/useParticipantConnection.d.ts +7 -0
- package/dist/components/jams/useParticipantConnection.js +11 -0
- package/dist/components/layout/Auth.js +1 -1
- package/dist/components/layout/Infos.js +2 -2
- package/dist/components/layout/OpenpeepsContextProvider.js +4 -3
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +3 -4
- package/dist/components/layout/OpenpeepsThemeProvider.js +23 -9
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/markdown/CompiledMarkdown.js +15 -1
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/index.d.ts +1 -1
- package/dist/components/markdown/index.js +1 -1
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +5 -1
- package/dist/components/navigation/HeaderMobile.js +1 -1
- package/dist/components/navigation/MobileMenuItem.js +1 -1
- package/dist/components/navigation/PageHeaderAction.js +1 -1
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +6 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +5 -1
- package/dist/components/navigation/sideBarNavLinkClass.js +1 -1
- package/dist/components/notifications/NotificationHeaderActions.js +2 -2
- package/dist/components/notifications/NotificationWrapper.js +1 -1
- package/dist/components/notifications/NotificationsList.js +3 -3
- package/dist/components/notifications/TypedNotification.js +3 -3
- package/dist/components/post/Feed.js +3 -3
- package/dist/components/post/FeedPost.d.ts +2 -1
- package/dist/components/post/FeedPost.js +7 -2
- package/dist/components/post/FeedPostContent.js +1 -1
- package/dist/components/post/FullPostLayout.js +11 -4
- package/dist/components/post/NewEventButton.js +1 -1
- package/dist/components/post/NewNoteButton.js +1 -1
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/ReplyBox.js +1 -1
- package/dist/components/post/feed/events/EventsFeed.js +3 -3
- package/dist/components/post/feed/threaded/ThreadPost.js +1 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +3 -1
- package/dist/components/post/feed/threaded/ThreadedFeed.js +3 -3
- package/dist/components/post/pieces/Attachments.js +3 -3
- package/dist/components/post/pieces/EventMenu.js +1 -1
- package/dist/components/post/pieces/EventRsvpButton.js +3 -3
- package/dist/components/post/pieces/GalleryModal.js +36 -5
- package/dist/components/post/pieces/PollContent.js +4 -4
- package/dist/components/post/pieces/PostActions.js +6 -45
- package/dist/components/post/pieces/PostInfoHeader.js +1 -1
- package/dist/components/post/pieces/PostMenu.js +34 -8
- package/dist/components/post/pieces/PostReactionHeader.js +1 -1
- package/dist/components/post/pieces/ShareMenu.js +4 -2
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +5 -3
- package/dist/components/post/pieces/UnreadPostIndicator.js +4 -3
- package/dist/components/post/pieces/modals/DeletePostModal.js +1 -1
- package/dist/components/post/post-form/AttachmentCard.js +2 -2
- package/dist/components/post/post-form/ComposeAttachments.js +1 -1
- package/dist/components/post/post-form/DescriptionEditModal.js +1 -1
- package/dist/components/post/post-form/EditPostModal.js +22 -12
- package/dist/components/post/post-form/EventForm.js +2 -2
- package/dist/components/post/post-form/EventTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/NewPostModal.d.ts +1 -1
- package/dist/components/post/post-form/NewPostModal.js +10 -10
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +2 -2
- package/dist/components/post/post-form/PollComposerFields.d.ts +2 -0
- package/dist/components/post/post-form/PollComposerFields.js +12 -8
- package/dist/components/post/post-form/PostAudienceSelector.js +3 -3
- package/dist/components/post/post-form/PostTypeSwitcher.js +1 -1
- package/dist/components/post/post-form/ReplyModal.js +9 -8
- package/dist/components/post/post-form/VisibilitySelector.js +1 -1
- package/dist/components/post/types/Article.js +2 -1
- package/dist/components/post/types/Event.js +1 -1
- package/dist/components/post/types/Note.js +2 -1
- package/dist/components/post/types/Poll.js +2 -1
- package/dist/components/post/types/event/CardEvent.js +2 -2
- package/dist/components/post/types/event/FullEvent.js +8 -8
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +1 -1
- package/dist/components/post/types/event/ProfileEventRelationship.js +38 -18
- package/dist/components/preview-link/LocalPreviewLink.js +1 -1
- package/dist/components/preview-link/RemotePreviewLink.js +5 -1
- package/dist/components/profile/Avatar.js +3 -2
- package/dist/components/profile/FollowUnfollowButton.js +2 -2
- package/dist/components/profile/ProfileBadge.js +1 -1
- package/dist/components/profile/ProfileCard.js +1 -1
- package/dist/components/profile/ProfileHeader.js +1 -1
- package/dist/components/profile/ProfilePageAction.js +3 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +3 -1
- package/dist/components/profile/ProfileSelector.js +3 -3
- package/dist/components/profile/ProfilesInput.js +1 -1
- package/dist/components/profile/ReportProfileOrPostModal.js +6 -4
- package/dist/components/server-data/context.d.ts +8 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +53 -0
- package/dist/contexts/openpeeps/hooks/admin.js +1 -0
- package/dist/contexts/openpeeps/hooks/jams.js +1 -1
- package/dist/contexts/openpeeps/hooks/other.d.ts +8 -0
- package/dist/contexts/openpeeps/index.js +10 -2
- package/dist/contexts/router/index.d.ts +8 -3
- package/dist/contexts/router/index.js +7 -3
- package/dist/hooks/conversations/useCreateConversation.d.ts +124 -0
- package/dist/hooks/conversations/useCreateConversation.js +56 -0
- package/dist/hooks/groups/useJoinGroup.d.ts +8 -0
- package/dist/hooks/groups/useJoinGroup.js +23 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +20 -0
- package/dist/hooks/jams/useLeaveCloseJam.js +59 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +18 -0
- package/dist/hooks/posts/useFeedPostActions.js +51 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Markdown.d.ts +14 -0
- package/dist/lib/Markdown.js +16 -0
- package/dist/lib/analyticsClicks.d.ts +12 -0
- package/dist/lib/analyticsClicks.js +64 -0
- package/dist/lib/auth.d.ts +8 -0
- package/dist/lib/auth.js +27 -0
- package/dist/lib/canvasUtils.d.ts +6 -0
- package/dist/lib/canvasUtils.js +62 -1
- package/dist/lib/groupCapabilityHelpers.d.ts +1 -1
- package/dist/lib/passwordStrength.d.ts +6 -0
- package/dist/lib/passwordStrength.js +26 -0
- package/dist/lib/postViewCounter.d.ts +1 -1
- package/dist/lib/postViewCounter.js +3 -1
- package/dist/lib/routeHandles.d.ts +2 -0
- package/dist/lib/routeHandles.js +2 -0
- package/dist/lib/svgCover.d.ts +2 -0
- package/dist/lib/svgCover.js +18 -0
- package/dist/navigation/index.d.ts +11 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/menuItems.d.ts +8 -0
- package/dist/navigation/menuItems.js +83 -0
- package/dist/navigation/targets.d.ts +94 -0
- package/dist/navigation/targets.js +12 -0
- package/dist/pages/About.d.ts +1 -0
- package/dist/pages/About.js +19 -0
- package/dist/pages/CodeOfConduct.d.ts +1 -0
- package/dist/pages/CodeOfConduct.js +14 -0
- package/dist/pages/Explore.d.ts +1 -0
- package/dist/pages/Explore.js +132 -0
- package/dist/pages/Home.d.ts +6 -0
- package/dist/pages/Home.js +31 -0
- package/dist/pages/Members.d.ts +1 -0
- package/dist/pages/Members.js +35 -0
- package/dist/pages/NotFound.d.ts +1 -0
- package/dist/pages/NotFound.js +9 -0
- package/dist/pages/Notifications.d.ts +1 -0
- package/dist/pages/Notifications.js +8 -0
- package/dist/pages/PostDetail.d.ts +1 -0
- package/dist/pages/PostDetail.js +27 -0
- package/dist/pages/Profile.d.ts +1 -0
- package/dist/pages/Profile.js +20 -0
- package/dist/pages/Tags.d.ts +1 -0
- package/dist/pages/Tags.js +14 -0
- package/dist/pages/Welcome.d.ts +1 -0
- package/dist/pages/Welcome.js +89 -0
- package/dist/pages/admin/Analytics.d.ts +11 -0
- package/dist/pages/admin/Analytics.js +11 -0
- package/dist/pages/admin/ApiKeys.d.ts +1 -0
- package/dist/pages/admin/ApiKeys.js +141 -0
- package/dist/pages/admin/Backups.d.ts +1 -0
- package/dist/pages/admin/Backups.js +39 -0
- package/dist/pages/admin/ConfigEditor.d.ts +14 -0
- package/dist/pages/admin/ConfigEditor.js +91 -0
- package/dist/pages/admin/Configuration.d.ts +1 -0
- package/dist/pages/admin/Configuration.js +8 -0
- package/dist/pages/admin/ConfigurationCommunity.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunity.js +7 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityLanguage.js +71 -0
- package/dist/pages/admin/ConfigurationEmail.d.ts +1 -0
- package/dist/pages/admin/ConfigurationEmail.js +97 -0
- package/dist/pages/admin/ConfigurationI18n.d.ts +1 -0
- package/dist/pages/admin/ConfigurationI18n.js +51 -0
- package/dist/pages/admin/Dashboard.d.ts +1 -0
- package/dist/pages/admin/Dashboard.js +40 -0
- package/dist/pages/admin/Db.d.ts +1 -0
- package/dist/pages/admin/Db.js +238 -0
- package/dist/pages/admin/Diagnostics.d.ts +1 -0
- package/dist/pages/admin/Diagnostics.js +8 -0
- package/dist/pages/admin/DiagnosticsEmail.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsEmail.js +65 -0
- package/dist/pages/admin/DiagnosticsJob.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsJob.js +51 -0
- package/dist/pages/admin/DiagnosticsLogs.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsLogs.js +62 -0
- package/dist/pages/admin/DiagnosticsPerformance.d.ts +1 -0
- package/dist/pages/admin/DiagnosticsPerformance.js +34 -0
- package/dist/pages/admin/GroupMembers.d.ts +1 -0
- package/dist/pages/admin/GroupMembers.js +109 -0
- package/dist/pages/admin/Groups.d.ts +1 -0
- package/dist/pages/admin/Groups.js +61 -0
- package/dist/pages/admin/Invites.d.ts +1 -0
- package/dist/pages/admin/Invites.js +72 -0
- package/dist/pages/admin/Members.d.ts +1 -0
- package/dist/pages/admin/Members.js +49 -0
- package/dist/pages/admin/Moderation.d.ts +1 -0
- package/dist/pages/admin/Moderation.js +62 -0
- package/dist/pages/admin/Reports.d.ts +1 -0
- package/dist/pages/admin/Reports.js +178 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.d.ts +14 -0
- package/dist/pages/admin/analytics/AnalyticsLayout.js +104 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.d.ts +9 -0
- package/dist/pages/admin/analytics/AnalyticsRangeContext.js +9 -0
- package/dist/pages/admin/analytics/Content.d.ts +1 -0
- package/dist/pages/admin/analytics/Content.js +117 -0
- package/dist/pages/admin/analytics/Engagement.d.ts +1 -0
- package/dist/pages/admin/analytics/Engagement.js +220 -0
- package/dist/pages/admin/analytics/Groups.d.ts +1 -0
- package/dist/pages/admin/analytics/Groups.js +139 -0
- package/dist/pages/admin/analytics/Members.d.ts +1 -0
- package/dist/pages/admin/analytics/Members.js +96 -0
- package/dist/pages/admin/analytics/Overview.d.ts +1 -0
- package/dist/pages/admin/analytics/Overview.js +165 -0
- package/dist/pages/admin/analytics/ReportSettings.d.ts +1 -0
- package/dist/pages/admin/analytics/ReportSettings.js +62 -0
- package/dist/pages/admin/analytics/analyticsInfo.d.ts +3 -0
- package/dist/pages/admin/analytics/analyticsInfo.js +4 -0
- package/dist/pages/admin/analytics/downloadCsv.d.ts +2 -0
- package/dist/pages/admin/analytics/downloadCsv.js +20 -0
- package/dist/pages/admin/community/CommunityFavicons.d.ts +1 -0
- package/dist/pages/admin/community/CommunityFavicons.js +47 -0
- package/dist/pages/admin/community/CommunityInfo.d.ts +1 -0
- package/dist/pages/admin/community/CommunityInfo.js +35 -0
- package/dist/pages/admin/community/CommunityLinks.d.ts +1 -0
- package/dist/pages/admin/community/CommunityLinks.js +35 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.d.ts +8 -0
- package/dist/pages/admin/community/CommunityMarkdownPage.js +35 -0
- package/dist/pages/admin/community/CommunityProfileFields.d.ts +1 -0
- package/dist/pages/admin/community/CommunityProfileFields.js +50 -0
- package/dist/pages/admin/community/CommunityRoles.d.ts +1 -0
- package/dist/pages/admin/community/CommunityRoles.js +109 -0
- package/dist/pages/admin/community/CommunityTheme.d.ts +1 -0
- package/dist/pages/admin/community/CommunityTheme.js +56 -0
- package/dist/pages/admin/community/useCommunityConfig.d.ts +168 -0
- package/dist/pages/admin/community/useCommunityConfig.js +28 -0
- package/dist/pages/admin/components/AdminCharts.d.ts +22 -0
- package/dist/pages/admin/components/AdminCharts.js +29 -0
- package/dist/pages/admin/components/AdminGroupCard.d.ts +6 -0
- package/dist/pages/admin/components/AdminGroupCard.js +42 -0
- package/dist/pages/admin/components/AdminInviteActions.d.ts +1 -0
- package/dist/pages/admin/components/AdminInviteActions.js +23 -0
- package/dist/pages/admin/components/InviteWithEmailModal.d.ts +3 -0
- package/dist/pages/admin/components/InviteWithEmailModal.js +82 -0
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +22 -0
- package/dist/pages/admin/components/InviteWithLinkModal.js +98 -0
- package/dist/pages/admin/components/ProfileRowActions.d.ts +5 -0
- package/dist/pages/admin/components/ProfileRowActions.js +131 -0
- package/dist/pages/admin/components/RestoreBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreBackupModal.js +33 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.d.ts +4 -0
- package/dist/pages/admin/components/RestoreTestBackupModal.js +36 -0
- package/dist/pages/articles/Edit.d.ts +1 -0
- package/dist/pages/articles/Edit.js +60 -0
- package/dist/pages/articles/Index.d.ts +1 -0
- package/dist/pages/articles/Index.js +18 -0
- package/dist/pages/articles/New.d.ts +1 -0
- package/dist/pages/articles/New.js +48 -0
- package/dist/pages/auth/Closed.d.ts +1 -0
- package/dist/pages/auth/Closed.js +14 -0
- package/dist/pages/auth/Login.d.ts +1 -0
- package/dist/pages/auth/Login.js +74 -0
- package/dist/pages/auth/OidcCallback.d.ts +5 -0
- package/dist/pages/auth/OidcCallback.js +31 -0
- package/dist/pages/auth/OidcPending.d.ts +5 -0
- package/dist/pages/auth/OidcPending.js +39 -0
- package/dist/pages/auth/Register.d.ts +4 -0
- package/dist/pages/auth/Register.js +124 -0
- package/dist/pages/auth/RegisterInvitation.d.ts +1 -0
- package/dist/pages/auth/RegisterInvitation.js +5 -0
- package/dist/pages/auth/RequestResetPassword.d.ts +1 -0
- package/dist/pages/auth/RequestResetPassword.js +50 -0
- package/dist/pages/auth/ResetPassword.d.ts +1 -0
- package/dist/pages/auth/ResetPassword.js +40 -0
- package/dist/pages/auth/SsoCallback.d.ts +1 -0
- package/dist/pages/auth/SsoCallback.js +34 -0
- package/dist/pages/auth/ValidateEmail.d.ts +6 -0
- package/dist/pages/auth/ValidateEmail.js +64 -0
- package/dist/pages/conversations/Index.d.ts +1 -0
- package/dist/pages/conversations/Index.js +58 -0
- package/dist/pages/conversations/Info.d.ts +1 -0
- package/dist/pages/conversations/Info.js +26 -0
- package/dist/pages/conversations/New.d.ts +1 -0
- package/dist/pages/conversations/New.js +8 -0
- package/dist/pages/conversations/Show.d.ts +1 -0
- package/dist/pages/conversations/Show.js +100 -0
- package/dist/pages/events/Edit.d.ts +1 -0
- package/dist/pages/events/Edit.js +69 -0
- package/dist/pages/events/Index.d.ts +1 -0
- package/dist/pages/events/Index.js +23 -0
- package/dist/pages/events/My.d.ts +1 -0
- package/dist/pages/events/My.js +24 -0
- package/dist/pages/events/New.d.ts +1 -0
- package/dist/pages/events/New.js +66 -0
- package/dist/pages/feeds/Bookmarks.d.ts +1 -0
- package/dist/pages/feeds/Bookmarks.js +10 -0
- package/dist/pages/feeds/Local.d.ts +1 -0
- package/dist/pages/feeds/Local.js +14 -0
- package/dist/pages/feeds/My.d.ts +1 -0
- package/dist/pages/feeds/My.js +12 -0
- package/dist/pages/groups/Edit.d.ts +1 -0
- package/dist/pages/groups/Edit.js +57 -0
- package/dist/pages/groups/Index.d.ts +1 -0
- package/dist/pages/groups/Index.js +50 -0
- package/dist/pages/groups/Info.d.ts +1 -0
- package/dist/pages/groups/Info.js +21 -0
- package/dist/pages/groups/Members.d.ts +1 -0
- package/dist/pages/groups/Members.js +28 -0
- package/dist/pages/groups/New.d.ts +1 -0
- package/dist/pages/groups/New.js +68 -0
- package/dist/pages/groups/Show.d.ts +1 -0
- package/dist/pages/groups/Show.js +64 -0
- package/dist/pages/index.d.ts +94 -0
- package/dist/pages/index.js +94 -0
- package/dist/pages/jams/Event.d.ts +8 -0
- package/dist/pages/jams/Event.js +57 -0
- package/dist/pages/jams/Index.d.ts +6 -0
- package/dist/pages/jams/Index.js +44 -0
- package/dist/pages/payment/Success.d.ts +1 -0
- package/dist/pages/payment/Success.js +30 -0
- package/dist/pages/plugins/Index.d.ts +1 -0
- package/dist/pages/plugins/Index.js +69 -0
- package/dist/pages/profile/Followers.d.ts +6 -0
- package/dist/pages/profile/Followers.js +28 -0
- package/dist/pages/settings/AccessTokens.d.ts +1 -0
- package/dist/pages/settings/AccessTokens.js +149 -0
- package/dist/pages/settings/Account.d.ts +1 -0
- package/dist/pages/settings/Account.js +81 -0
- package/dist/pages/settings/Billing.d.ts +1 -0
- package/dist/pages/settings/Billing.js +82 -0
- package/dist/pages/settings/Index.d.ts +1 -0
- package/dist/pages/settings/Index.js +13 -0
- package/dist/pages/settings/Language.d.ts +1 -0
- package/dist/pages/settings/Language.js +54 -0
- package/dist/pages/settings/NotificationPreferences.d.ts +1 -0
- package/dist/pages/settings/NotificationPreferences.js +180 -0
- package/dist/pages/settings/Notifications.d.ts +1 -0
- package/dist/pages/settings/Notifications.js +10 -0
- package/dist/pages/settings/PublicProfile.d.ts +1 -0
- package/dist/pages/settings/PublicProfile.js +135 -0
- package/dist/pages/settings/PushEnabledDevices.d.ts +1 -0
- package/dist/pages/settings/PushEnabledDevices.js +67 -0
- package/dist/pages/settings/Theme.d.ts +1 -0
- package/dist/pages/settings/Theme.js +37 -0
- package/dist/pages/test/Error.d.ts +1 -0
- package/dist/pages/test/Error.js +10 -0
- package/dist/pages/test/Markdown.d.ts +1 -0
- package/dist/pages/test/Markdown.js +32 -0
- package/dist/pwa/InstallPrompt.js +1 -1
- package/dist/pwa/NotificationPermissionPrompt.js +2 -2
- package/dist/pwa/UpdatePrompt.js +1 -1
- package/dist/react-native.d.ts +1 -0
- package/dist/react-native.js +1 -0
- package/dist/session/useSessionEvents.d.ts +3 -0
- package/dist/session/useSessionEvents.js +64 -0
- package/package.json +12 -7
- package/dist/components/jams/useJamLiveKitTheme.d.ts +0 -3
- package/dist/components/jams/useJamLiveKitTheme.js +0 -10
|
@@ -16748,6 +16748,36 @@ export declare const adminHooks: (client: ReturnType<typeof openpeepsClient>) =>
|
|
|
16748
16748
|
value: number;
|
|
16749
16749
|
}[] | undefined;
|
|
16750
16750
|
};
|
|
16751
|
+
dau: {
|
|
16752
|
+
key: string;
|
|
16753
|
+
value: number;
|
|
16754
|
+
previousValue: number;
|
|
16755
|
+
deltaPct: number | null;
|
|
16756
|
+
series?: {
|
|
16757
|
+
day: string;
|
|
16758
|
+
value: number;
|
|
16759
|
+
}[] | undefined;
|
|
16760
|
+
};
|
|
16761
|
+
mau: {
|
|
16762
|
+
key: string;
|
|
16763
|
+
value: number;
|
|
16764
|
+
previousValue: number;
|
|
16765
|
+
deltaPct: number | null;
|
|
16766
|
+
series?: {
|
|
16767
|
+
day: string;
|
|
16768
|
+
value: number;
|
|
16769
|
+
}[] | undefined;
|
|
16770
|
+
};
|
|
16771
|
+
dauMau: {
|
|
16772
|
+
key: string;
|
|
16773
|
+
value: number;
|
|
16774
|
+
previousValue: number;
|
|
16775
|
+
deltaPct: number | null;
|
|
16776
|
+
series?: {
|
|
16777
|
+
day: string;
|
|
16778
|
+
value: number;
|
|
16779
|
+
}[] | undefined;
|
|
16780
|
+
};
|
|
16751
16781
|
};
|
|
16752
16782
|
signupsByDay: {
|
|
16753
16783
|
day: string;
|
|
@@ -16853,6 +16883,7 @@ export declare const adminHooks: (client: ReturnType<typeof openpeepsClient>) =>
|
|
|
16853
16883
|
comments: number;
|
|
16854
16884
|
reposts: number;
|
|
16855
16885
|
bookmarks: number;
|
|
16886
|
+
dms: number;
|
|
16856
16887
|
}[];
|
|
16857
16888
|
impressionsByPeriod: {
|
|
16858
16889
|
day: string;
|
|
@@ -16947,6 +16978,28 @@ export declare const adminHooks: (client: ReturnType<typeof openpeepsClient>) =>
|
|
|
16947
16978
|
message?: string | undefined;
|
|
16948
16979
|
key?: string | undefined;
|
|
16949
16980
|
}>;
|
|
16981
|
+
useAnalyticsClicks: (query?: Record<string, string>) => import("@tanstack/react-query").UseQueryResult<{
|
|
16982
|
+
range: {
|
|
16983
|
+
from: string;
|
|
16984
|
+
to: string;
|
|
16985
|
+
previousFrom: string;
|
|
16986
|
+
previousTo: string;
|
|
16987
|
+
compiledAt: string | null;
|
|
16988
|
+
preset?: "all" | "7d" | "30d" | "3m" | "6m" | "12m" | undefined;
|
|
16989
|
+
};
|
|
16990
|
+
pages: {
|
|
16991
|
+
target: string;
|
|
16992
|
+
clicks: number;
|
|
16993
|
+
}[];
|
|
16994
|
+
links: {
|
|
16995
|
+
target: string;
|
|
16996
|
+
clicks: number;
|
|
16997
|
+
}[];
|
|
16998
|
+
}, {
|
|
16999
|
+
success: boolean;
|
|
17000
|
+
message?: string | undefined;
|
|
17001
|
+
key?: string | undefined;
|
|
17002
|
+
}>;
|
|
16950
17003
|
useAnalyticsReportSettings: () => import("@tanstack/react-query").UseQueryResult<{
|
|
16951
17004
|
enabled: boolean;
|
|
16952
17005
|
recipients: string[];
|
|
@@ -78,6 +78,7 @@ export const adminHooks = (client) => ({
|
|
|
78
78
|
useAnalyticsGrowth: (query) => apiHook(client.admin.analytics.growth, { queryParams: query }),
|
|
79
79
|
useAnalyticsEngagement: (query) => apiHook(client.admin.analytics.engagement, { queryParams: query }),
|
|
80
80
|
useAnalyticsRetention: (query) => apiHook(client.admin.analytics.retention, { queryParams: query }),
|
|
81
|
+
useAnalyticsClicks: (query) => apiHook(client.admin.analytics.clicks, { queryParams: query }),
|
|
81
82
|
useAnalyticsReportSettings: () => apiHook(client.admin.analytics.reportSettings.read),
|
|
82
83
|
updateAnalyticsReportSettingsAction: payloadMutation(client.admin.analytics.reportSettings.update, [['admin', 'analytics', 'reportSettings']]),
|
|
83
84
|
usei18n: () => apiHook(client.admin.i18n.read),
|
|
@@ -6,7 +6,7 @@ export const jamHooks = (client) => ({
|
|
|
6
6
|
}),
|
|
7
7
|
closeJamAction: noPayloadMutation(client.jams.close, [['jams']]),
|
|
8
8
|
useJamToken: (id) => apiHook(client.jams.token, { pathParams: { id } }),
|
|
9
|
-
useJamState: (id) => apiHook(client.jams.state, { pathParams: { id }, refetchInterval:
|
|
9
|
+
useJamState: (id) => apiHook(client.jams.state, { pathParams: { id }, refetchInterval: 5000 }),
|
|
10
10
|
muteJamParticipantAction: payloadMutation(client.jams.muteParticipant),
|
|
11
11
|
useJamEvents: (id) => apiHook(client.jams.events.list, { pathParams: { id } }),
|
|
12
12
|
useInfiniteJamEvents: (id, limit = 100) => infiniteChronologicalQueryApiHook(client.jams.events.list, {
|
|
@@ -44,6 +44,10 @@ export declare const otherHooks: (client: OpenpeepsClient) => {
|
|
|
44
44
|
primaryHex: string;
|
|
45
45
|
light: {
|
|
46
46
|
primaryHex: string;
|
|
47
|
+
secondaryHex?: string | undefined;
|
|
48
|
+
fontFamily?: string | undefined;
|
|
49
|
+
buttonRadius?: string | undefined;
|
|
50
|
+
radius?: string | undefined;
|
|
47
51
|
logoSmall?: string | undefined;
|
|
48
52
|
defaultProfileAvatar?: string | undefined;
|
|
49
53
|
defaultGroupAvatar?: string | undefined;
|
|
@@ -52,6 +56,10 @@ export declare const otherHooks: (client: OpenpeepsClient) => {
|
|
|
52
56
|
};
|
|
53
57
|
dark: {
|
|
54
58
|
primaryHex: string;
|
|
59
|
+
secondaryHex?: string | undefined;
|
|
60
|
+
fontFamily?: string | undefined;
|
|
61
|
+
buttonRadius?: string | undefined;
|
|
62
|
+
radius?: string | undefined;
|
|
55
63
|
logoSmall?: string | undefined;
|
|
56
64
|
defaultProfileAvatar?: string | undefined;
|
|
57
65
|
defaultGroupAvatar?: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { createContext, useContext, useState, useEffect, useMemo, useCallback, } from 'react';
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { openpeepsClient, } from '@openpeepshq/client';
|
|
@@ -7,6 +7,8 @@ import { buildOpenpeepsApi } from './hooks/index.js';
|
|
|
7
7
|
import { CredentialsStoreProvider } from '../credentialsStore/index.js';
|
|
8
8
|
export { useHasAuthToken } from './hooks/useHasAuthToken.js';
|
|
9
9
|
import { isServiceOnlyJwt, jwtHasRemainingValidityAtLeast, } from '@openpeepshq/common';
|
|
10
|
+
import { useSessionEvents } from '../../session/useSessionEvents.js';
|
|
11
|
+
import { useNotificationBadgeSync } from '../../pwa/useNotificationBadgeSync.js';
|
|
10
12
|
/** Refresh when less than this many seconds remain (login JWTs are 1w). */
|
|
11
13
|
const REFRESH_WHEN_REMAINING_BELOW_SEC = 24 * 60 * 60;
|
|
12
14
|
const isAuthFailure = (error) => {
|
|
@@ -35,6 +37,12 @@ export const useOpenpeeps = () => {
|
|
|
35
37
|
}
|
|
36
38
|
return context;
|
|
37
39
|
};
|
|
40
|
+
const SessionEventsMount = () => {
|
|
41
|
+
const { client, currentProfile } = useOpenpeeps();
|
|
42
|
+
useNotificationBadgeSync();
|
|
43
|
+
useSessionEvents(client, Boolean(currentProfile));
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
38
46
|
export const OpenpeepsProvider = ({ children, credentialsStore, baseUrl, subscribeToForeground }) => {
|
|
39
47
|
const openpeepsClientOptionsProvider = useCallback(async () => {
|
|
40
48
|
return {
|
|
@@ -176,5 +184,5 @@ export const OpenpeepsProvider = ({ children, credentialsStore, baseUrl, subscri
|
|
|
176
184
|
currentProfile,
|
|
177
185
|
currentAccount,
|
|
178
186
|
queryClient,
|
|
179
|
-
}, children: _jsx(QueryClientProvider, { client: queryClient, children:
|
|
187
|
+
}, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsxs(CredentialsStoreProvider, { credentialsStore: credentialsStore, children: [_jsx(SessionEventsMount, {}), children] }) }) }));
|
|
180
188
|
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Navigator, NavTarget } from '../../navigation';
|
|
2
3
|
export interface RouterAdapter {
|
|
3
4
|
pathname: string;
|
|
4
5
|
searchParams: URLSearchParams;
|
|
5
|
-
|
|
6
|
+
/** Navigate to an abstract target (preferred) or a raw path string. */
|
|
7
|
+
navigate: (target: NavTarget | string) => void;
|
|
8
|
+
hrefOf: (target: NavTarget) => string;
|
|
9
|
+
match: (pathname: string) => NavTarget | null;
|
|
6
10
|
back: () => void;
|
|
7
11
|
}
|
|
8
12
|
export declare const useRouter: () => RouterAdapter;
|
|
9
|
-
export declare const useNavigate: () => (
|
|
13
|
+
export declare const useNavigate: () => (target: NavTarget | string) => void;
|
|
14
|
+
export declare const useHrefOf: () => (target: NavTarget) => string;
|
|
10
15
|
export declare const usePathname: () => string;
|
|
11
16
|
export declare const useSearchParams: () => URLSearchParams;
|
|
12
17
|
/** Pathname when inside `RouterProvider`, otherwise `undefined` (no throw). */
|
|
@@ -25,4 +30,4 @@ export declare function RouterProvider({ adapter, children }: RouterProviderProp
|
|
|
25
30
|
* Browser-only fallback — uses `window.location` + `popstate`. Suitable for
|
|
26
31
|
* standalone PWAs that don't ship with a real router (e.g. dev shells).
|
|
27
32
|
*/
|
|
28
|
-
export declare function useBrowserRouter(): RouterAdapter;
|
|
33
|
+
export declare function useBrowserRouter(navigator: Navigator): RouterAdapter;
|
|
@@ -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
|
+
}
|