@openpeepshq/react 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CapabilityMatrix.d.ts +24 -0
- package/dist/components/CapabilityMatrix.js +51 -0
- package/dist/components/RelationCapabilitiesEditor.d.ts +1 -0
- package/dist/components/RelationCapabilitiesEditor.js +138 -0
- package/dist/components/RoleCapabilityMatrix.d.ts +10 -0
- package/dist/components/RoleCapabilityMatrix.js +100 -0
- package/dist/components/accounts/SignUpLoginModal.js +7 -5
- package/dist/components/configuration/ConfigMenuButton.d.ts +3 -1
- package/dist/components/configuration/ConfigMenuButton.js +2 -2
- package/dist/components/configuration/ConfigurationList.js +7 -4
- package/dist/components/configuration/ConfigurationValueEditor.js +2 -2
- package/dist/components/conversations/ConversationParticipantsModal.d.ts +7 -0
- package/dist/components/conversations/ConversationParticipantsModal.js +10 -0
- package/dist/components/conversations/CreateNewConversation.js +9 -7
- package/dist/components/conversations/MessageInThread.js +4 -1
- package/dist/components/conversations/index.d.ts +2 -0
- package/dist/components/conversations/index.js +1 -0
- package/dist/components/form/ImageEditModal.js +4 -4
- package/dist/components/form/LocationInput.js +2 -2
- package/dist/components/form/TimeZoneSelect.d.ts +7 -0
- package/dist/components/form/TimeZoneSelect.js +7 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/groups/ChangeGroupRolesModal.js +15 -4
- package/dist/components/groups/ConfirmGroupExitModal.js +4 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +4 -2
- package/dist/components/groups/DeleteGroupModal.js +4 -2
- package/dist/components/groups/GroupAvatar.d.ts +2 -1
- package/dist/components/groups/GroupAvatar.js +9 -12
- package/dist/components/groups/GroupCapabilityMatrix.d.ts +6 -0
- package/dist/components/groups/GroupCapabilityMatrix.js +12 -0
- package/dist/components/groups/GroupCard.js +2 -2
- package/dist/components/groups/GroupFeed.js +2 -1
- package/dist/components/groups/GroupForm.d.ts +11 -1
- package/dist/components/groups/GroupForm.js +14 -67
- package/dist/components/groups/GroupMembersList.js +25 -17
- package/dist/components/groups/GroupOptionsMenu.js +13 -10
- package/dist/components/groups/index.d.ts +3 -1
- package/dist/components/groups/index.js +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +3 -0
- package/dist/components/jams/CreateNewJam.js +5 -127
- package/dist/components/jams/JamCallParticipant.d.ts +7 -1
- package/dist/components/jams/JamCallParticipant.js +28 -38
- package/dist/components/jams/JamCapacityGate.d.ts +2 -1
- package/dist/components/jams/JamCapacityGate.js +2 -2
- package/dist/components/jams/JamChatDrawer.js +12 -47
- package/dist/components/jams/JamChatMessage.d.ts +3 -2
- package/dist/components/jams/JamChatMessage.js +13 -4
- package/dist/components/jams/JamConference.js +4 -3
- package/dist/components/jams/JamContext.d.ts +8 -3
- package/dist/components/jams/JamContext.js +4 -7
- package/dist/components/jams/JamDetailsDrawer.js +11 -8
- package/dist/components/jams/JamEventsContext.d.ts +3 -1
- package/dist/components/jams/JamEventsContext.js +1 -3
- package/dist/components/jams/JamFooter.js +12 -78
- package/dist/components/jams/JamGuestForm.js +0 -1
- package/dist/components/jams/JamLobby.d.ts +2 -6
- package/dist/components/jams/JamLobby.js +11 -57
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +5 -2
- package/dist/components/jams/JamPeopleDrawer.js +5 -41
- package/dist/components/jams/JamRequestJoin.d.ts +2 -6
- package/dist/components/jams/JamRequestJoin.js +3 -21
- package/dist/components/jams/JamRoom.d.ts +2 -1
- package/dist/components/jams/JamRoom.js +13 -175
- package/dist/components/jams/JamToolbarButton.js +2 -2
- package/dist/components/jams/JamVideoCall.d.ts +3 -2
- package/dist/components/jams/JamVideoCall.js +1 -1
- package/dist/components/jams/JamVideoLayout.d.ts +2 -2
- package/dist/components/jams/JamVideoLayout.js +81 -26
- package/dist/components/jams/LeaveCloseButton.js +2 -1
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/disconnectReason.d.ts +6 -0
- package/dist/components/jams/disconnectReason.js +19 -0
- package/dist/components/jams/jamEventActions.d.ts +3 -0
- package/dist/components/jams/jamEventActions.js +10 -0
- package/dist/components/jams/jamRecordingState.d.ts +6 -0
- package/dist/components/jams/jamRecordingState.js +15 -1
- package/dist/components/jams/reactionEmojis.d.ts +1 -28
- package/dist/components/jams/reactionEmojis.js +1 -55
- package/dist/components/jams/speakerLayout.d.ts +19 -0
- package/dist/components/jams/speakerLayout.js +33 -0
- package/dist/components/jams/useJamSpotlight.d.ts +14 -0
- package/dist/components/jams/useJamSpotlight.js +72 -0
- package/dist/components/layout/Auth.js +20 -3
- package/dist/components/layout/IdentityContext.js +7 -1
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +15 -0
- package/dist/components/layout/OpenpeepsThemeProvider.js +13 -3
- package/dist/components/layout/ProfileProvider.d.ts +2 -2
- package/dist/components/layout/ProfileProvider.js +15 -32
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/layout/useProfileIdentity.d.ts +59 -0
- package/dist/components/layout/useProfileIdentity.js +38 -0
- package/dist/components/markdown/OpenpeepsMarkdown.js +2 -9
- package/dist/components/markdown/classes.d.ts +2 -2
- package/dist/components/markdown/classes.js +2 -2
- package/dist/components/markdown/staticRender.d.ts +2 -0
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +4 -1
- package/dist/components/navigation/HeaderMobile.js +6 -2
- package/dist/components/navigation/MobileMenuItem.d.ts +3 -1
- package/dist/components/navigation/MobileMenuItem.js +6 -4
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +5 -1
- package/dist/components/notifications/NotificationHeaderActions.js +3 -1
- package/dist/components/notifications/NotificationsList.js +28 -16
- package/dist/components/notifications/TypedNotification.js +50 -6
- package/dist/components/post/CompactReplyParent.d.ts +7 -0
- package/dist/components/post/CompactReplyParent.js +121 -0
- package/dist/components/post/EventViewSwitch.d.ts +1 -0
- package/dist/components/post/EventViewSwitch.js +15 -0
- package/dist/components/post/Feed.d.ts +3 -1
- package/dist/components/post/Feed.js +11 -5
- package/dist/components/post/FeedFormatSwitch.d.ts +1 -0
- package/dist/components/post/FeedFormatSwitch.js +16 -0
- package/dist/components/post/FeedPost.js +9 -19
- package/dist/components/post/FeedPostContent.js +8 -1
- package/dist/components/post/FullPostLayout.js +8 -11
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/feed/events/EventsCalendar.d.ts +7 -0
- package/dist/components/post/feed/events/EventsCalendar.js +54 -0
- package/dist/components/post/feed/events/EventsView.d.ts +10 -0
- package/dist/components/post/feed/events/EventsView.js +9 -0
- package/dist/components/post/feed/events/eventCalendar.d.ts +36 -0
- package/dist/components/post/feed/events/eventCalendar.js +145 -0
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +1 -4
- package/dist/components/post/feed/threaded/ThreadedFeed.js +5 -2
- package/dist/components/post/helpers.js +3 -1
- package/dist/components/post/index.d.ts +11 -0
- package/dist/components/post/index.js +6 -0
- package/dist/components/post/pieces/Attachments.js +19 -13
- package/dist/components/post/pieces/AudioAttachment.d.ts +13 -0
- package/dist/components/post/pieces/AudioAttachment.js +93 -0
- package/dist/components/post/pieces/EventLocation.d.ts +2 -1
- package/dist/components/post/pieces/EventLocation.js +13 -9
- package/dist/components/post/pieces/EventMenu.d.ts +2 -1
- package/dist/components/post/pieces/EventMenu.js +26 -26
- package/dist/components/post/pieces/EventOccurrenceList.d.ts +10 -0
- package/dist/components/post/pieces/EventOccurrenceList.js +49 -0
- package/dist/components/post/pieces/EventRsvpButton.d.ts +3 -1
- package/dist/components/post/pieces/EventRsvpButton.js +15 -37
- package/dist/components/post/pieces/EventRsvpList.d.ts +12 -0
- package/dist/components/post/pieces/EventRsvpList.js +108 -0
- package/dist/components/post/pieces/EventRsvpScopeDialog.d.ts +16 -0
- package/dist/components/post/pieces/EventRsvpScopeDialog.js +92 -0
- package/dist/components/post/pieces/FeedPostStats.js +7 -6
- package/dist/components/post/pieces/FeedThreadPreview.d.ts +9 -0
- package/dist/components/post/pieces/FeedThreadPreview.js +37 -0
- package/dist/components/post/pieces/GalleryModal.js +8 -5
- package/dist/components/post/pieces/PollContent.js +36 -13
- package/dist/components/post/pieces/PostActions.js +2 -2
- package/dist/components/post/pieces/PostMenu.js +18 -2
- package/dist/components/post/pieces/ShareMenu.js +11 -16
- package/dist/components/post/pieces/VideoPlayer.js +1 -1
- package/dist/components/post/pieces/modals/DeletePostModal.js +6 -2
- package/dist/components/post/pieces/modals/ReactionsModal.js +2 -3
- package/dist/components/post/pieces/modals/RepostModal.d.ts +5 -3
- package/dist/components/post/pieces/modals/RepostModal.js +8 -7
- package/dist/components/post/post-form/ArticleForm.js +2 -14
- package/dist/components/post/post-form/AttachmentCard.js +18 -7
- package/dist/components/post/post-form/ComposeAttachments.d.ts +1 -0
- package/dist/components/post/post-form/ComposeAttachments.js +30 -7
- package/dist/components/post/post-form/DescriptionEditModal.js +2 -2
- package/dist/components/post/post-form/EditPostModal.js +9 -7
- package/dist/components/post/post-form/EventForm.d.ts +2 -1
- package/dist/components/post/post-form/EventForm.js +41 -61
- package/dist/components/post/post-form/EventTypeSwitcher.d.ts +1 -1
- package/dist/components/post/post-form/EventTypeSwitcher.js +15 -134
- package/dist/components/post/post-form/NewPostModal.js +14 -9
- package/dist/components/post/post-form/NewPostModalContext.js +6 -2
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +1 -1
- package/dist/components/post/post-form/PollComposerFields.js +7 -5
- package/dist/components/post/post-form/PostAudienceSelector.js +4 -2
- package/dist/components/post/post-form/PostTypeSwitcher.d.ts +5 -2
- package/dist/components/post/post-form/PostTypeSwitcher.js +19 -1
- package/dist/components/post/post-form/ReplyModal.js +13 -9
- package/dist/components/post/post-form/ReplyModalContext.d.ts +5 -8
- package/dist/components/post/post-form/ReplyModalContext.js +9 -12
- package/dist/components/post/post-form/audienceChoices.d.ts +4 -6
- package/dist/components/post/post-form/audienceChoices.js +12 -63
- package/dist/components/post/types/Article.js +3 -1
- package/dist/components/post/types/Event.js +13 -2
- package/dist/components/post/types/article/FullArticle.js +5 -1
- package/dist/components/post/types/event/CardEvent.d.ts +2 -1
- package/dist/components/post/types/event/CardEvent.js +16 -10
- package/dist/components/post/types/event/FullEvent.js +78 -44
- package/dist/components/preview-link/local/PostPreview.js +3 -2
- package/dist/components/profile/Avatar.d.ts +3 -3
- package/dist/components/profile/Avatar.js +15 -15
- package/dist/components/profile/FollowUnfollowButton.d.ts +2 -1
- package/dist/components/profile/FollowUnfollowButton.js +8 -15
- package/dist/components/profile/ProfileActivitySummary.d.ts +5 -0
- package/dist/components/profile/ProfileActivitySummary.js +41 -0
- package/dist/components/profile/ProfileCard.js +3 -1
- package/dist/components/profile/ProfileHeader.js +7 -1
- package/dist/components/profile/ProfilePageAction.js +46 -4
- package/dist/components/profile/ProfilePostsAndReplies.d.ts +4 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +8 -5
- package/dist/components/profile/ProfileSelector.js +2 -2
- package/dist/components/profile/ProfileWithActionCard.d.ts +3 -1
- package/dist/components/profile/ProfileWithActionCard.js +2 -2
- package/dist/components/profile/ReportProfileOrPostModal.js +7 -7
- package/dist/components/profile/index.d.ts +2 -0
- package/dist/components/profile/index.js +1 -0
- package/dist/components/profile/profileFieldDisplay.d.ts +8 -0
- package/dist/components/profile/profileFieldDisplay.js +36 -0
- package/dist/components/registry/PluginRegistryProvider.d.ts +1 -0
- package/dist/components/registry/PluginRegistryProvider.js +6 -1
- package/dist/components/registry/PluginSlot.js +1 -1
- package/dist/components/server-data/context.d.ts +18 -1
- package/dist/contexts/openpeeps/helpers.js +12 -1
- package/dist/contexts/openpeeps/hooks/accounts.js +42 -1
- package/dist/contexts/openpeeps/hooks/admin.d.ts +5759 -12462
- package/dist/contexts/openpeeps/hooks/admin.js +51 -15
- package/dist/contexts/openpeeps/hooks/auth.d.ts +2 -1
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +12 -9810
- package/dist/contexts/openpeeps/hooks/conversations.js +8 -2
- package/dist/contexts/openpeeps/hooks/groups.d.ts +15 -3
- package/dist/contexts/openpeeps/hooks/jams.d.ts +7511 -734
- package/dist/contexts/openpeeps/hooks/jams.js +20 -5
- package/dist/contexts/openpeeps/hooks/other.d.ts +18 -1
- package/dist/contexts/openpeeps/hooks/posts.d.ts +66236 -12355
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +49 -6881
- package/dist/contexts/openpeeps/hooks/profiles.js +24 -4
- package/dist/contexts/openpeeps/hooks/search.d.ts +13 -9618
- package/dist/contexts/openpeeps/index.d.ts +1 -1
- package/dist/contexts/openpeeps/index.js +18 -9
- package/dist/hooks/auth/useAuthForms.d.ts +25 -0
- package/dist/hooks/auth/useAuthForms.js +101 -0
- package/dist/hooks/community/useCommunityInfoPages.d.ts +10 -0
- package/dist/hooks/community/useCommunityInfoPages.js +18 -0
- package/dist/hooks/conversations/useCreateConversation.d.ts +14 -2
- package/dist/hooks/events/useEventComposer.d.ts +10965 -0
- package/dist/hooks/events/useEventComposer.js +164 -0
- package/dist/hooks/events/useEventForm.d.ts +108 -0
- package/dist/hooks/events/useEventForm.js +154 -0
- package/dist/hooks/events/useEventMenu.d.ts +9 -0
- package/dist/hooks/events/useEventMenu.js +47 -0
- package/dist/hooks/events/useEventRsvp.d.ts +99 -0
- package/dist/hooks/events/useEventRsvp.js +111 -0
- package/dist/hooks/events/useEventTypeSwitcher.d.ts +102 -0
- package/dist/hooks/events/useEventTypeSwitcher.js +160 -0
- package/dist/hooks/events/useEventsCalendar.d.ts +19822 -0
- package/dist/hooks/events/useEventsCalendar.js +89 -0
- package/dist/hooks/groups/useEditGroup.d.ts +87 -0
- package/dist/hooks/groups/useEditGroup.js +80 -0
- package/dist/hooks/groups/useGroupTemplateSelection.d.ts +22 -0
- package/dist/hooks/groups/useGroupTemplateSelection.js +67 -0
- package/dist/hooks/groups/useNewGroup.d.ts +152 -0
- package/dist/hooks/groups/useNewGroup.js +75 -0
- package/dist/hooks/index.d.ts +58 -0
- package/dist/hooks/index.js +36 -0
- package/dist/hooks/jams/useCreateNewJamForm.d.ts +543 -0
- package/dist/hooks/jams/useCreateNewJamForm.js +140 -0
- package/dist/hooks/jams/useJamChat.d.ts +78 -0
- package/dist/hooks/jams/useJamChat.js +64 -0
- package/dist/hooks/jams/useJamDetails.d.ts +9921 -0
- package/dist/hooks/jams/useJamDetails.js +74 -0
- package/dist/hooks/jams/useJamFooterControls.d.ts +27 -0
- package/dist/hooks/jams/useJamFooterControls.js +92 -0
- package/dist/hooks/jams/useJamLobby.d.ts +105 -0
- package/dist/hooks/jams/useJamLobby.js +61 -0
- package/dist/hooks/jams/useJamParticipant.d.ts +11 -0
- package/dist/hooks/jams/useJamParticipant.js +49 -0
- package/dist/hooks/jams/useJamPeople.d.ts +79 -0
- package/dist/hooks/jams/useJamPeople.js +63 -0
- package/dist/hooks/jams/useJamRoom.d.ts +19934 -0
- package/dist/hooks/jams/useJamRoom.js +216 -0
- package/dist/hooks/jams/useJamStage.d.ts +21 -0
- package/dist/hooks/jams/useJamStage.js +48 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +2 -1
- package/dist/hooks/jams/useLeaveCloseJam.js +3 -3
- package/dist/hooks/posts/replyOpener.d.ts +9 -0
- package/dist/hooks/posts/replyOpener.js +12 -0
- package/dist/hooks/posts/useArticleComposer.d.ts +10879 -0
- package/dist/hooks/posts/useArticleComposer.js +112 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +3 -1
- package/dist/hooks/posts/useFeedPostActions.js +21 -10
- package/dist/hooks/posts/useFeedPostPresentation.d.ts +19827 -0
- package/dist/hooks/posts/useFeedPostPresentation.js +39 -0
- package/dist/hooks/posts/usePostDetailTitle.d.ts +9906 -0
- package/dist/hooks/posts/usePostDetailTitle.js +32 -0
- package/dist/hooks/posts/usePostThreads.d.ts +6 -0
- package/dist/hooks/posts/usePostThreads.js +17 -0
- package/dist/hooks/posts/useShareMenu.d.ts +14 -0
- package/dist/hooks/posts/useShareMenu.js +24 -0
- package/dist/hooks/profile/useFollowProfile.d.ts +8 -0
- package/dist/hooks/profile/useFollowProfile.js +21 -0
- package/dist/hooks/settings/useAccessTokens.d.ts +61 -0
- package/dist/hooks/settings/useAccessTokens.js +128 -0
- package/dist/hooks/settings/useFeedFormatPreference.d.ts +8 -0
- package/dist/hooks/settings/useFeedFormatPreference.js +35 -0
- package/dist/hooks/settings/useLanguagePreference.d.ts +11 -0
- package/dist/hooks/settings/useLanguagePreference.js +55 -0
- package/dist/hooks/settings/useNotificationPreferences.d.ts +26 -0
- package/dist/hooks/settings/useNotificationPreferences.js +79 -0
- package/dist/hooks/settings/usePushEnabledDevices.d.ts +111 -0
- package/dist/hooks/settings/usePushEnabledDevices.js +63 -0
- package/dist/hooks/settings/useThemePreference.d.ts +7 -0
- package/dist/hooks/settings/useThemePreference.js +27 -0
- package/dist/hooks/settings/useTimezonePreference.d.ts +14 -0
- package/dist/hooks/settings/useTimezonePreference.js +52 -0
- package/dist/hooks/useResolvedFeedFormat.d.ts +16 -0
- package/dist/hooks/useResolvedFeedFormat.js +20 -0
- package/dist/i18n/I18nProvider.js +21 -15
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/index.js +26 -0
- package/dist/lib/analyticsClicks.d.ts +1 -1
- package/dist/lib/analyticsClicks.js +4 -10
- package/dist/lib/audienceChoices.d.ts +14 -0
- package/dist/lib/audienceChoices.js +50 -0
- package/dist/lib/audienceSetting.d.ts +6 -0
- package/dist/lib/audienceSetting.js +18 -0
- package/dist/lib/capabilityMatrix.d.ts +76 -0
- package/dist/lib/capabilityMatrix.js +274 -0
- package/dist/lib/configuration/helpers.d.ts +12 -0
- package/dist/lib/configuration/helpers.js +38 -2
- package/dist/lib/groupCapabilityMatrix.d.ts +12 -0
- package/dist/lib/groupCapabilityMatrix.js +17 -0
- package/dist/lib/groupFormErrors.d.ts +15 -0
- package/dist/lib/groupFormErrors.js +61 -0
- package/dist/lib/initialsAvatar.d.ts +7 -0
- package/dist/lib/initialsAvatar.js +23 -0
- package/dist/lib/notificationBadge.d.ts +6 -2
- package/dist/lib/notificationBadge.js +17 -0
- package/dist/lib/postUnread.d.ts +7 -0
- package/dist/lib/postUnread.js +7 -0
- package/dist/lib/reactionEmojis.d.ts +28 -0
- package/dist/lib/reactionEmojis.js +55 -0
- package/dist/navigation/targets.d.ts +2 -1
- package/dist/pages/About.js +4 -7
- package/dist/pages/CodeOfConduct.js +4 -5
- package/dist/pages/Explore.js +2 -2
- package/dist/pages/PostDetail.js +11 -20
- package/dist/pages/Profile.js +9 -2
- package/dist/pages/Tags.d.ts +1 -1
- package/dist/pages/Tags.js +48 -6
- package/dist/pages/Tags.test.d.ts +1 -0
- package/dist/pages/Tags.test.js +75 -0
- package/dist/pages/Welcome.js +1 -1
- package/dist/pages/admin/Analytics.d.ts +1 -0
- package/dist/pages/admin/Analytics.js +1 -0
- package/dist/pages/admin/ConfigEditor.js +4 -8
- package/dist/pages/admin/Configuration.js +18 -2
- package/dist/pages/admin/ConfigurationCommunity.js +1 -1
- package/dist/pages/admin/ConfigurationCommunityFeed.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityFeed.js +69 -0
- package/dist/pages/admin/ConfigurationCommunityTimezone.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityTimezone.js +69 -0
- package/dist/pages/admin/ConfigurationPluginPage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationPluginPage.js +21 -0
- package/dist/pages/admin/ConfigurationSso.d.ts +1 -0
- package/dist/pages/admin/ConfigurationSso.js +104 -0
- package/dist/pages/admin/ConfigurationSsoNew.d.ts +1 -0
- package/dist/pages/admin/ConfigurationSsoNew.js +44 -0
- package/dist/pages/admin/Dashboard.js +65 -20
- package/dist/pages/admin/Db.js +2 -2
- package/dist/pages/admin/GroupMembers.js +6 -39
- package/dist/pages/admin/Groups.js +4 -2
- package/dist/pages/admin/Invites.js +9 -4
- package/dist/pages/admin/MemberDetail.d.ts +1 -0
- package/dist/pages/admin/MemberDetail.js +66 -0
- package/dist/pages/admin/Members.js +39 -10
- package/dist/pages/admin/Plugins.d.ts +1 -0
- package/dist/pages/admin/Plugins.js +208 -0
- package/dist/pages/admin/Reports.js +17 -17
- package/dist/pages/admin/analytics/AnalyticsLayout.js +30 -5
- package/dist/pages/admin/analytics/Content.js +6 -6
- package/dist/pages/admin/analytics/Engagement.js +10 -10
- package/dist/pages/admin/analytics/Groups.js +5 -13
- package/dist/pages/admin/analytics/Members.js +10 -2
- package/dist/pages/admin/analytics/Overview.js +10 -10
- package/dist/pages/admin/analytics/PluginPage.d.ts +1 -0
- package/dist/pages/admin/analytics/PluginPage.js +26 -0
- package/dist/pages/admin/analytics/analyticsPluginTabs.d.ts +4 -0
- package/dist/pages/admin/analytics/analyticsPluginTabs.js +25 -0
- package/dist/pages/admin/community/CommunityRoles.js +107 -58
- package/dist/pages/admin/community/CommunityTheme.js +1 -1
- package/dist/pages/admin/community/useCommunityConfig.d.ts +6 -2
- package/dist/pages/admin/components/AdminGroupCard.js +1 -1
- package/dist/pages/admin/components/InviteWithEmailModal.js +5 -5
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +0 -1
- package/dist/pages/admin/components/InviteWithLinkModal.js +45 -14
- package/dist/pages/admin/components/ProfileRowActions.js +19 -13
- package/dist/pages/admin/components/RestoreBackupModal.js +6 -2
- package/dist/pages/admin/components/RestoreTestBackupModal.js +6 -4
- package/dist/pages/admin/components/ServerStatusSection.d.ts +5 -0
- package/dist/pages/admin/components/ServerStatusSection.js +62 -0
- package/dist/pages/admin/components/inviteQr.d.ts +8 -0
- package/dist/pages/admin/components/inviteQr.js +72 -0
- package/dist/pages/admin/components/serverStatusFormat.d.ts +3 -0
- package/dist/pages/admin/components/serverStatusFormat.js +32 -0
- package/dist/pages/admin/configurationPluginPages.d.ts +4 -0
- package/dist/pages/admin/configurationPluginPages.js +26 -0
- package/dist/pages/admin/configurationSsoShared.d.ts +307 -0
- package/dist/pages/admin/configurationSsoShared.js +192 -0
- package/dist/pages/articles/Edit.js +6 -40
- package/dist/pages/articles/Index.js +2 -1
- package/dist/pages/articles/New.js +6 -39
- package/dist/pages/auth/Closed.js +4 -2
- package/dist/pages/auth/Login.js +55 -21
- package/dist/pages/auth/Register.js +25 -9
- package/dist/pages/auth/RequestResetPassword.js +4 -4
- package/dist/pages/auth/ResetPassword.js +4 -4
- package/dist/pages/conversations/Index.js +19 -6
- package/dist/pages/conversations/Info.js +40 -3
- package/dist/pages/conversations/Show.js +29 -20
- package/dist/pages/events/Edit.js +11 -52
- package/dist/pages/events/Index.js +7 -4
- package/dist/pages/events/My.js +2 -2
- package/dist/pages/events/New.js +6 -57
- package/dist/pages/feeds/Bookmarks.js +4 -2
- package/dist/pages/feeds/Local.js +2 -1
- package/dist/pages/feeds/My.js +2 -1
- package/dist/pages/groups/Edit.js +11 -41
- package/dist/pages/groups/EditInfo.d.ts +1 -0
- package/dist/pages/groups/EditInfo.js +22 -0
- package/dist/pages/groups/EditRoles.d.ts +1 -0
- package/dist/pages/groups/EditRoles.js +29 -0
- package/dist/pages/groups/New.js +6 -58
- package/dist/pages/groups/Show.js +2 -2
- package/dist/pages/index.d.ts +13 -0
- package/dist/pages/index.js +13 -0
- package/dist/pages/jams/Event.js +3 -1
- package/dist/pages/jams/Index.js +3 -1
- package/dist/pages/payment/Success.js +2 -2
- package/dist/pages/settings/AccessTokens.js +10 -104
- package/dist/pages/settings/Account.js +43 -2
- package/dist/pages/settings/Billing.js +11 -7
- package/dist/pages/settings/Blocked.d.ts +1 -0
- package/dist/pages/settings/Blocked.js +29 -0
- package/dist/pages/settings/Feed.d.ts +1 -0
- package/dist/pages/settings/Feed.js +36 -0
- package/dist/pages/settings/Index.js +1 -1
- package/dist/pages/settings/Language.js +9 -44
- package/dist/pages/settings/NotificationPreferences.js +16 -68
- package/dist/pages/settings/PublicProfile.js +9 -0
- package/dist/pages/settings/PushEnabledDevices.js +10 -43
- package/dist/pages/settings/Theme.js +5 -21
- package/dist/pages/settings/Timezone.d.ts +1 -0
- package/dist/pages/settings/Timezone.js +19 -0
- package/dist/pwa/PwaProvider.d.ts +3 -2
- package/dist/pwa/PwaProvider.js +19 -2
- package/dist/pwa/pageReload.d.ts +12 -0
- package/dist/pwa/pageReload.js +30 -0
- package/dist/pwa/registration.js +3 -0
- package/dist/pwa/staleAppReload.d.ts +33 -0
- package/dist/pwa/staleAppReload.js +123 -0
- package/dist/pwa/useServiceWorker.d.ts +1 -1
- package/dist/pwa/useServiceWorker.js +15 -1
- package/dist/react-native.d.ts +46 -0
- package/dist/react-native.js +33 -0
- package/dist/stores/eventView.d.ts +10 -0
- package/dist/stores/eventView.js +14 -0
- package/dist/stores/feedFormat.d.ts +7 -0
- package/dist/stores/feedFormat.js +14 -0
- package/dist/stores/index.d.ts +3 -0
- package/dist/stores/index.js +2 -0
- package/dist/stores/newPosts.d.ts +70 -4
- package/package.json +12 -8
- package/dist/lib/groupCapabilityHelpers.d.ts +0 -24
- package/dist/lib/groupCapabilityHelpers.js +0 -119
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { canModerateJam } from '@openpeepshq/common/lib';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
6
|
+
import { useJamContext } from '../../components/jams/JamContext.js';
|
|
7
|
+
import { useJamRtmpStreamState } from '../../components/jams/jamRecordingState.js';
|
|
8
|
+
/** Details drawer data: moderator flag and the observer link path. */
|
|
9
|
+
export const useJamDetails = () => {
|
|
10
|
+
const me = useCurrentProfile();
|
|
11
|
+
const { jamPost, occurrence } = useJamContext();
|
|
12
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const observerLinkQuery = openpeepsApi.useObserverLink(jamPost.id, occurrence);
|
|
14
|
+
return {
|
|
15
|
+
jamPost,
|
|
16
|
+
isModerator: canModerateJam(me, jamPost),
|
|
17
|
+
observerPath: observerLinkQuery.data?.path,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/** Moderator RTMP restream form state (start/stop + credentials). */
|
|
21
|
+
export const useJamRtmpStream = ({ jamId, onSuccess, onError, }) => {
|
|
22
|
+
const t = useT();
|
|
23
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
24
|
+
const { isStreaming } = useJamRtmpStreamState();
|
|
25
|
+
const streamQuery = openpeepsApi.useRtmpStream(jamId);
|
|
26
|
+
const startStream = openpeepsApi.startRtmpStreamAction({ id: jamId });
|
|
27
|
+
const stopStream = openpeepsApi.stopRtmpStreamAction({ id: jamId });
|
|
28
|
+
const [url, setUrl] = useState('');
|
|
29
|
+
const [streamKey, setStreamKey] = useState('');
|
|
30
|
+
const [busy, setBusy] = useState(false);
|
|
31
|
+
const live = isStreaming ||
|
|
32
|
+
(streamQuery.isSuccess && streamQuery.data?.status === 'active');
|
|
33
|
+
const host = streamQuery.data?.destinationHost;
|
|
34
|
+
const onStart = async () => {
|
|
35
|
+
setBusy(true);
|
|
36
|
+
try {
|
|
37
|
+
await startStream({ url, streamKey });
|
|
38
|
+
setStreamKey('');
|
|
39
|
+
onSuccess(t('jams.details.rtmpStarted'));
|
|
40
|
+
await streamQuery.refetch();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
onError(t('jams.details.rtmpStartError'));
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setBusy(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const onStop = async () => {
|
|
50
|
+
setBusy(true);
|
|
51
|
+
try {
|
|
52
|
+
await stopStream();
|
|
53
|
+
onSuccess(t('jams.details.rtmpStopped'));
|
|
54
|
+
await streamQuery.refetch();
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
onError(t('jams.details.rtmpStopError'));
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
setBusy(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
live,
|
|
65
|
+
host,
|
|
66
|
+
url,
|
|
67
|
+
setUrl,
|
|
68
|
+
streamKey,
|
|
69
|
+
setStreamKey,
|
|
70
|
+
busy,
|
|
71
|
+
canSubmit: !busy && (live || (!!url.trim() && !!streamKey.trim())),
|
|
72
|
+
toggle: () => void (live ? onStop() : onStart()),
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Room } from 'livekit-client';
|
|
2
|
+
export type UseJamFooterControlsArgs = {
|
|
3
|
+
room: Room;
|
|
4
|
+
participantCount: number;
|
|
5
|
+
/** Asked before stopping a recording; resolve `false` to abort. */
|
|
6
|
+
confirmStopRecording: () => boolean | Promise<boolean>;
|
|
7
|
+
onSuccess: (message: string) => void;
|
|
8
|
+
onError: (message: string) => void;
|
|
9
|
+
};
|
|
10
|
+
/** Toolbar business logic shared by the web and native jam footers. */
|
|
11
|
+
export declare const useJamFooterControls: ({ room, participantCount, confirmStopRecording, onSuccess, onError, }: UseJamFooterControlsArgs) => {
|
|
12
|
+
isModerator: boolean;
|
|
13
|
+
isRecording: boolean;
|
|
14
|
+
recordingEnabled: boolean;
|
|
15
|
+
handRaised: boolean;
|
|
16
|
+
busy: boolean;
|
|
17
|
+
participantCount: number;
|
|
18
|
+
waitingRoomCount: number;
|
|
19
|
+
sendReactionEmoji: (emoji: string) => Promise<void>;
|
|
20
|
+
toggleRecording: () => Promise<void>;
|
|
21
|
+
raiseHand: () => undefined;
|
|
22
|
+
};
|
|
23
|
+
/** Unread-dot state for the chat toggle while the drawer is closed. */
|
|
24
|
+
export declare const useJamChatUnread: (active: boolean) => {
|
|
25
|
+
hasNewMessages: boolean;
|
|
26
|
+
clear: () => void;
|
|
27
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
3
|
+
import { useT } from '../../i18n/index.js';
|
|
4
|
+
import { useServerInfo } from '../../components/server-data/context.js';
|
|
5
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
6
|
+
import { useJamContext } from '../../components/jams/JamContext.js';
|
|
7
|
+
import { useJamEventsContext } from '../../components/jams/JamEventsContext.js';
|
|
8
|
+
import { useJamRecordingState } from '../../components/jams/jamRecordingState.js';
|
|
9
|
+
import { toggleHand } from '../../components/jams/jamEventActions.js';
|
|
10
|
+
import { useRaisedHands } from '../../components/jams/useJamHands.js';
|
|
11
|
+
/** Toolbar business logic shared by the web and native jam footers. */
|
|
12
|
+
export const useJamFooterControls = ({ room, participantCount, confirmStopRecording, onSuccess, onError, }) => {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const me = useCurrentProfile();
|
|
15
|
+
const serverInfo = useServerInfo();
|
|
16
|
+
const { jam, jamPost, occurrence } = useJamContext();
|
|
17
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
18
|
+
const { sendReactionEmoji } = useJamEventsContext();
|
|
19
|
+
const raisedHands = useRaisedHands(room);
|
|
20
|
+
const isModerator = !!me && jam.moderators.includes(me.id);
|
|
21
|
+
const { isRecording } = useJamRecordingState();
|
|
22
|
+
const handRaised = raisedHands.has(room.localParticipant.identity);
|
|
23
|
+
const recordingEnabled = serverInfo.jams.livekit.recordingEnabled;
|
|
24
|
+
const startRecording = openpeepsApi.startRecordingAction({ id: jamPost.id });
|
|
25
|
+
const stopRecording = openpeepsApi.stopRecordingAction({ id: jamPost.id });
|
|
26
|
+
const waitingRoom = openpeepsApi.useWaitingRoomStream(isModerator && jam.waitingRoom ? jamPost.id : '', occurrence);
|
|
27
|
+
const [busy, setBusy] = useState(false);
|
|
28
|
+
const waitingRoomCount = isModerator && jam.waitingRoom && waitingRoom
|
|
29
|
+
? Object.keys(waitingRoom).length
|
|
30
|
+
: 0;
|
|
31
|
+
const toggleRecording = async () => {
|
|
32
|
+
if (isRecording && !(await confirmStopRecording())) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
setBusy(true);
|
|
36
|
+
try {
|
|
37
|
+
if (isRecording) {
|
|
38
|
+
const recording = await stopRecording(undefined, occurrence ? { occurrence } : undefined);
|
|
39
|
+
onSuccess(t('jams.recording.stopped', { id: recording.id }));
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const recording = await startRecording(undefined, occurrence ? { occurrence } : undefined);
|
|
43
|
+
onSuccess(t('jams.recording.started', { id: recording.id }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
onError(isRecording
|
|
48
|
+
? t('jams.recording.stopError')
|
|
49
|
+
: t('jams.recording.startError'));
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
setBusy(false);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
isModerator,
|
|
57
|
+
isRecording,
|
|
58
|
+
recordingEnabled,
|
|
59
|
+
handRaised,
|
|
60
|
+
busy,
|
|
61
|
+
participantCount,
|
|
62
|
+
waitingRoomCount,
|
|
63
|
+
sendReactionEmoji,
|
|
64
|
+
toggleRecording,
|
|
65
|
+
raiseHand: () => void toggleHand(room),
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/** Unread-dot state for the chat toggle while the drawer is closed. */
|
|
69
|
+
export const useJamChatUnread = (active) => {
|
|
70
|
+
const { sessionEvents } = useJamEventsContext();
|
|
71
|
+
const [lastSeenMessageId, setLastSeenMessageId] = useState('');
|
|
72
|
+
const [hasNewMessages, setHasNewMessages] = useState(false);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const lastMessage = [...sessionEvents]
|
|
75
|
+
.reverse()
|
|
76
|
+
.find((event) => event.type === 'message');
|
|
77
|
+
if (!lastMessage || lastMessage.type !== 'message')
|
|
78
|
+
return;
|
|
79
|
+
if (active) {
|
|
80
|
+
setLastSeenMessageId(lastMessage.id);
|
|
81
|
+
setHasNewMessages(false);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (lastSeenMessageId && lastMessage.id > lastSeenMessageId) {
|
|
85
|
+
setHasNewMessages(true);
|
|
86
|
+
}
|
|
87
|
+
else if (!lastSeenMessageId) {
|
|
88
|
+
setLastSeenMessageId(lastMessage.id);
|
|
89
|
+
}
|
|
90
|
+
}, [sessionEvents, active, lastSeenMessageId]);
|
|
91
|
+
return { hasNewMessages, clear: () => setHasNewMessages(false) };
|
|
92
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ProfileWithMeta } from '@openpeepshq/common/types';
|
|
2
|
+
import type { JamJoinChoices, JamJoinParams } from './useJamRoom';
|
|
3
|
+
export declare const canAccessJamLobby: (profile: ProfileWithMeta | undefined, jamPostId: string) => boolean;
|
|
4
|
+
export type UseJamLobbyArgs = {
|
|
5
|
+
onJoin: (params: JamJoinParams) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Lobby state shared by web and native: guest-pass gate, join/start label and
|
|
9
|
+
* the token request. Device preview and selection stay in the renderer.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useJamLobby: ({ onJoin }: UseJamLobbyArgs) => {
|
|
12
|
+
me: ProfileWithMeta | undefined;
|
|
13
|
+
username: string;
|
|
14
|
+
jamEvent: {
|
|
15
|
+
type: "event";
|
|
16
|
+
start: string;
|
|
17
|
+
wholeDay: boolean;
|
|
18
|
+
content?: string | undefined;
|
|
19
|
+
sensitive?: boolean | undefined;
|
|
20
|
+
spoilerText?: string | undefined;
|
|
21
|
+
attachments?: {
|
|
22
|
+
type: string;
|
|
23
|
+
url: string;
|
|
24
|
+
previewUrl: string | null;
|
|
25
|
+
textUrl: null;
|
|
26
|
+
filename: string;
|
|
27
|
+
meta: {
|
|
28
|
+
usage?: string | undefined;
|
|
29
|
+
focus?: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
} | undefined;
|
|
33
|
+
mimetype?: string | undefined;
|
|
34
|
+
size?: number | undefined;
|
|
35
|
+
};
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
blurhash?: string | undefined;
|
|
38
|
+
status?: "failed" | "processing" | "ready" | undefined;
|
|
39
|
+
error?: string | undefined;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
customEmojis?: {
|
|
42
|
+
shortcode: string;
|
|
43
|
+
url: string;
|
|
44
|
+
staticUrl: string;
|
|
45
|
+
visibleInPicker: boolean;
|
|
46
|
+
category: string;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
language?: string | undefined;
|
|
49
|
+
name?: string | undefined;
|
|
50
|
+
timeZone?: string | undefined;
|
|
51
|
+
image?: string | undefined;
|
|
52
|
+
end?: string | undefined;
|
|
53
|
+
maxAttendees?: number | undefined;
|
|
54
|
+
attendeeListPublic?: boolean | undefined;
|
|
55
|
+
moderators?: string[] | undefined;
|
|
56
|
+
jam?: {
|
|
57
|
+
moderators: string[];
|
|
58
|
+
videoEnabled: boolean;
|
|
59
|
+
type: "video-call";
|
|
60
|
+
speakers?: string[] | undefined;
|
|
61
|
+
presenters?: string[] | undefined;
|
|
62
|
+
audience?: string[] | undefined;
|
|
63
|
+
maxSpeakers?: number | undefined;
|
|
64
|
+
maxPresenters?: number | undefined;
|
|
65
|
+
maxAudience?: number | undefined;
|
|
66
|
+
waitingRoom?: boolean | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
physicalLocation?: {
|
|
69
|
+
text: string;
|
|
70
|
+
coordinates?: {
|
|
71
|
+
lat: number;
|
|
72
|
+
lng: number;
|
|
73
|
+
alt?: number | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
url?: string | undefined;
|
|
77
|
+
recurrence?: {
|
|
78
|
+
freq: "DAILY" | "WEEKLY" | "MONTHLY";
|
|
79
|
+
interval?: number | undefined;
|
|
80
|
+
byDay?: ("MO" | "TU" | "WE" | "TH" | "FR" | "SA" | "SU")[] | undefined;
|
|
81
|
+
until?: string | undefined;
|
|
82
|
+
count?: number | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
exceptions?: {
|
|
85
|
+
recurrenceId: string;
|
|
86
|
+
cancelled?: boolean | undefined;
|
|
87
|
+
start?: string | undefined;
|
|
88
|
+
end?: string | undefined;
|
|
89
|
+
physicalLocation?: {
|
|
90
|
+
text: string;
|
|
91
|
+
coordinates?: {
|
|
92
|
+
lat: number;
|
|
93
|
+
lng: number;
|
|
94
|
+
alt?: number | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
}[] | undefined;
|
|
98
|
+
};
|
|
99
|
+
jamActive: boolean;
|
|
100
|
+
canAccess: boolean;
|
|
101
|
+
error: string | undefined;
|
|
102
|
+
setError: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
103
|
+
submitting: boolean;
|
|
104
|
+
join: <C extends JamJoinChoices>(choices: C) => Promise<void>;
|
|
105
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { profileName } from '@openpeepshq/common/lib';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
6
|
+
import { useJamContext } from '../../components/jams/JamContext.js';
|
|
7
|
+
import { apiErrorMessage } from '../../lib/apiErrorMessage.js';
|
|
8
|
+
export const canAccessJamLobby = (profile, jamPostId) => {
|
|
9
|
+
if (!profile)
|
|
10
|
+
return false;
|
|
11
|
+
if (profile.type === 'local')
|
|
12
|
+
return true;
|
|
13
|
+
return (profile.guestData?.resource?.type === 'jams' &&
|
|
14
|
+
profile.guestData.resource.id === jamPostId);
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Lobby state shared by web and native: guest-pass gate, join/start label and
|
|
18
|
+
* the token request. Device preview and selection stay in the renderer.
|
|
19
|
+
*/
|
|
20
|
+
export const useJamLobby = ({ onJoin }) => {
|
|
21
|
+
const t = useT();
|
|
22
|
+
const me = useCurrentProfile();
|
|
23
|
+
const { jamPost, jamEvent, occurrence } = useJamContext();
|
|
24
|
+
const { client, openpeepsApi } = useOpenpeeps();
|
|
25
|
+
const jamStateQuery = openpeepsApi.useJamState(jamPost.id, occurrence);
|
|
26
|
+
const [error, setError] = useState();
|
|
27
|
+
const [submitting, setSubmitting] = useState(false);
|
|
28
|
+
const tokenError = (err) => apiErrorMessage(err, t, t('jams.lobby.tokenError', { defaultValue: 'Failed to get jam token' }));
|
|
29
|
+
const join = async (choices) => {
|
|
30
|
+
setSubmitting(true);
|
|
31
|
+
setError(undefined);
|
|
32
|
+
try {
|
|
33
|
+
const res = await client.jams.token({
|
|
34
|
+
pathParameters: { id: jamPost.id },
|
|
35
|
+
queryParameters: occurrence ? { occurrence } : undefined,
|
|
36
|
+
});
|
|
37
|
+
if ('error' in res) {
|
|
38
|
+
setError(tokenError(res.error));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
onJoin({ ...res.data, choices });
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
setError(tokenError(err));
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setSubmitting(false);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
me,
|
|
52
|
+
username: (me ? profileName(me) : '') ?? '',
|
|
53
|
+
jamEvent,
|
|
54
|
+
jamActive: !!jamStateQuery.data?.active,
|
|
55
|
+
canAccess: canAccessJamLobby(me, jamPost.id),
|
|
56
|
+
error,
|
|
57
|
+
setError,
|
|
58
|
+
submitting,
|
|
59
|
+
join,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Participant } from 'livekit-client';
|
|
2
|
+
import type { JamJoinParams } from './useJamRoom';
|
|
3
|
+
export type UseJamParticipantMuteArgs = {
|
|
4
|
+
participant: Participant;
|
|
5
|
+
onSuccess: (message: string) => void;
|
|
6
|
+
onError: (message: string) => void;
|
|
7
|
+
};
|
|
8
|
+
/** Moderator action: server-side mute of a remote participant's microphone. */
|
|
9
|
+
export declare const useJamParticipantMute: ({ participant, onSuccess, onError, }: UseJamParticipantMuteArgs) => () => Promise<void>;
|
|
10
|
+
/** Joins automatically once a moderator admits us from the waiting room. */
|
|
11
|
+
export declare const useJoinWaitingRoomToken: (onJoin: (params: JamJoinParams) => void) => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
3
|
+
import { useT } from '../../i18n/index.js';
|
|
4
|
+
import { useJamContext } from '../../components/jams/JamContext.js';
|
|
5
|
+
/** Moderator action: server-side mute of a remote participant's microphone. */
|
|
6
|
+
export const useJamParticipantMute = ({ participant, onSuccess, onError, }) => {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { jamPost } = useJamContext();
|
|
9
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
10
|
+
const muteParticipant = openpeepsApi.muteJamParticipantAction({
|
|
11
|
+
id: jamPost.id,
|
|
12
|
+
});
|
|
13
|
+
return async () => {
|
|
14
|
+
const audioPublication = participant
|
|
15
|
+
.getTrackPublications()
|
|
16
|
+
.find((pub) => pub.track?.kind === 'audio');
|
|
17
|
+
if (!audioPublication)
|
|
18
|
+
return;
|
|
19
|
+
try {
|
|
20
|
+
await muteParticipant({
|
|
21
|
+
identity: participant.identity,
|
|
22
|
+
trackSid: audioPublication.trackSid,
|
|
23
|
+
});
|
|
24
|
+
onSuccess(t('jams.participants.muteSuccess', {
|
|
25
|
+
defaultValue: 'Participant muted successfully',
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
onError(t('jams.participants.muteError', {
|
|
30
|
+
defaultValue: 'Failed to mute participant',
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/** Joins automatically once a moderator admits us from the waiting room. */
|
|
36
|
+
export const useJoinWaitingRoomToken = (onJoin) => {
|
|
37
|
+
const { jamPost, occurrence } = useJamContext();
|
|
38
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
39
|
+
const tokenResponse = openpeepsApi.useJoinWaitingRoomStream(jamPost.id, occurrence);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (tokenResponse?.token && tokenResponse.livekitUrl) {
|
|
42
|
+
onJoin({
|
|
43
|
+
token: tokenResponse.token,
|
|
44
|
+
livekitUrl: tokenResponse.livekitUrl,
|
|
45
|
+
choices: { audioEnabled: true, videoEnabled: true },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}, [tokenResponse, onJoin]);
|
|
49
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Participant, Room } from 'livekit-client';
|
|
2
|
+
import type { PublicProfile } from '@openpeepshq/common/types';
|
|
3
|
+
export type UseJamPeopleArgs = {
|
|
4
|
+
room: Room;
|
|
5
|
+
participants: Participant[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* People drawer data: searchable in-jam list sorted by raised hand (observers
|
|
9
|
+
* hidden) and, for moderators, the waiting-room profiles with admit.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useJamPeople: ({ room, participants }: UseJamPeopleArgs) => {
|
|
12
|
+
isModerator: boolean;
|
|
13
|
+
hasWaitingRoom: boolean;
|
|
14
|
+
moderatorIds: string[];
|
|
15
|
+
raisedHands: Set<string>;
|
|
16
|
+
query: string;
|
|
17
|
+
setQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
18
|
+
listedParticipants: Participant[];
|
|
19
|
+
waitingProfiles: {
|
|
20
|
+
id: string;
|
|
21
|
+
type: "local" | "guest" | "federated";
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
handle: string;
|
|
25
|
+
memberships: {
|
|
26
|
+
group: {
|
|
27
|
+
handle: string;
|
|
28
|
+
capabilities: Record<string, {
|
|
29
|
+
add?: string[] | undefined;
|
|
30
|
+
remove?: string[] | undefined;
|
|
31
|
+
} | undefined>;
|
|
32
|
+
id: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
avatar?: string | null | undefined;
|
|
36
|
+
header?: string | null | undefined;
|
|
37
|
+
displayName?: string | undefined;
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
rules?: string | undefined;
|
|
40
|
+
pinnedPostId?: string | undefined;
|
|
41
|
+
discoverable?: boolean | undefined;
|
|
42
|
+
deletedAt?: string | null | undefined;
|
|
43
|
+
};
|
|
44
|
+
roles?: ("none" | "local" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
|
|
45
|
+
}[] | undefined;
|
|
46
|
+
deletedAt?: string | null | undefined;
|
|
47
|
+
avatar?: string | null | undefined;
|
|
48
|
+
header?: string | null | undefined;
|
|
49
|
+
displayName?: string | undefined;
|
|
50
|
+
bio?: string | undefined;
|
|
51
|
+
location?: {
|
|
52
|
+
text: string;
|
|
53
|
+
coordinates?: {
|
|
54
|
+
lat: number;
|
|
55
|
+
lng: number;
|
|
56
|
+
alt?: number | undefined;
|
|
57
|
+
} | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
locked?: boolean | undefined;
|
|
60
|
+
bot?: boolean | undefined;
|
|
61
|
+
discoverable?: boolean | undefined;
|
|
62
|
+
roles?: {
|
|
63
|
+
key: string;
|
|
64
|
+
displayName: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
fields?: {
|
|
67
|
+
name: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}[] | undefined;
|
|
70
|
+
profileStats?: {
|
|
71
|
+
followersCount: number;
|
|
72
|
+
followingCount: number;
|
|
73
|
+
} | undefined;
|
|
74
|
+
pinnedPostId?: string | undefined;
|
|
75
|
+
blockedByMe?: boolean | undefined;
|
|
76
|
+
}[];
|
|
77
|
+
admittingId: string | null;
|
|
78
|
+
admit: (profile: PublicProfile) => Promise<void>;
|
|
79
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react';
|
|
2
|
+
import { matchesQuery, sortByRaisedHand } from '@openpeepshq/common/lib';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useCurrentProfile } from '../../components/layout/IdentityContext.js';
|
|
5
|
+
import { useJamContext } from '../../components/jams/JamContext.js';
|
|
6
|
+
import { parseParticipantMetadata } from '../../components/jams/jamEventActions.js';
|
|
7
|
+
import { useRaisedHands } from '../../components/jams/useJamHands.js';
|
|
8
|
+
/**
|
|
9
|
+
* People drawer data: searchable in-jam list sorted by raised hand (observers
|
|
10
|
+
* hidden) and, for moderators, the waiting-room profiles with admit.
|
|
11
|
+
*/
|
|
12
|
+
export const useJamPeople = ({ room, participants }) => {
|
|
13
|
+
const me = useCurrentProfile();
|
|
14
|
+
const { jamPost, jam, occurrence } = useJamContext();
|
|
15
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
16
|
+
const raisedHands = useRaisedHands(room);
|
|
17
|
+
const isModerator = !!me && jam.moderators.includes(me.id);
|
|
18
|
+
const hasWaitingRoom = !!jam.waitingRoom;
|
|
19
|
+
const waitingRoom = openpeepsApi.useWaitingRoomStream(isModerator && hasWaitingRoom ? jamPost.id : '', occurrence);
|
|
20
|
+
const admitParticipant = openpeepsApi.admitParticipantAction();
|
|
21
|
+
const [query, setQuery] = useState('');
|
|
22
|
+
const [admittingId, setAdmittingId] = useState(null);
|
|
23
|
+
const listedParticipants = useMemo(() => {
|
|
24
|
+
const visible = participants.filter((participant) => {
|
|
25
|
+
const metadata = parseParticipantMetadata(participant.metadata);
|
|
26
|
+
if (metadata.observer)
|
|
27
|
+
return false;
|
|
28
|
+
return !query || matchesQuery(metadata.profile, query);
|
|
29
|
+
});
|
|
30
|
+
return sortByRaisedHand(visible, (participant) => participant.metadata);
|
|
31
|
+
// raisedHands changes participant metadata order; re-sort when it updates.
|
|
32
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
|
+
}, [participants, query, raisedHands]);
|
|
34
|
+
const waitingProfiles = useMemo(() => {
|
|
35
|
+
if (!waitingRoom)
|
|
36
|
+
return [];
|
|
37
|
+
return Object.values(waitingRoom).filter((profile) => !!profile &&
|
|
38
|
+
typeof profile === 'object' &&
|
|
39
|
+
'id' in profile &&
|
|
40
|
+
(!query || matchesQuery(profile, query)));
|
|
41
|
+
}, [waitingRoom, query]);
|
|
42
|
+
const admit = async (profile) => {
|
|
43
|
+
setAdmittingId(profile.id);
|
|
44
|
+
try {
|
|
45
|
+
await admitParticipant({ id: jamPost.id, profileId: profile.id }, occurrence ? { occurrence } : undefined);
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
setAdmittingId(null);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
isModerator,
|
|
53
|
+
hasWaitingRoom,
|
|
54
|
+
moderatorIds: jam.moderators,
|
|
55
|
+
raisedHands,
|
|
56
|
+
query,
|
|
57
|
+
setQuery,
|
|
58
|
+
listedParticipants,
|
|
59
|
+
waitingProfiles,
|
|
60
|
+
admittingId,
|
|
61
|
+
admit,
|
|
62
|
+
};
|
|
63
|
+
};
|