@openpeepshq/react 0.2.3
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/LICENSE.md +21 -0
- package/README.md +1 -0
- package/dist/auth/credentials/index.d.ts +11 -0
- package/dist/auth/credentials/index.js +57 -0
- package/dist/auth/credentials/types.d.ts +6 -0
- package/dist/auth/credentials/types.js +1 -0
- package/dist/components/accounts/SignUpLoginModal.d.ts +9 -0
- package/dist/components/accounts/SignUpLoginModal.js +19 -0
- package/dist/components/accounts/SignUpLoginModalContext.d.ts +10 -0
- package/dist/components/accounts/SignUpLoginModalContext.js +16 -0
- package/dist/components/accounts/index.d.ts +3 -0
- package/dist/components/accounts/index.js +2 -0
- package/dist/components/configuration/ConfigurationCategory.d.ts +12 -0
- package/dist/components/configuration/ConfigurationCategory.js +61 -0
- package/dist/components/configuration/ConfigurationList.d.ts +10 -0
- package/dist/components/configuration/ConfigurationList.js +30 -0
- package/dist/components/configuration/ConfigurationTree.d.ts +8 -0
- package/dist/components/configuration/ConfigurationTree.js +20 -0
- package/dist/components/configuration/ConfigurationValueEditor.d.ts +11 -0
- package/dist/components/configuration/ConfigurationValueEditor.js +45 -0
- package/dist/components/configuration/index.d.ts +4 -0
- package/dist/components/configuration/index.js +4 -0
- package/dist/components/conversations/ConversationMessageBubble.d.ts +4 -0
- package/dist/components/conversations/ConversationMessageBubble.js +10 -0
- package/dist/components/conversations/CreateNewConversation.d.ts +8 -0
- package/dist/components/conversations/CreateNewConversation.js +62 -0
- package/dist/components/conversations/CreateNewConversationContext.d.ts +15 -0
- package/dist/components/conversations/CreateNewConversationContext.js +18 -0
- package/dist/components/conversations/DirectMessagesHeaderActions.d.ts +1 -0
- package/dist/components/conversations/DirectMessagesHeaderActions.js +10 -0
- package/dist/components/conversations/MessageInThread.d.ts +13 -0
- package/dist/components/conversations/MessageInThread.js +41 -0
- package/dist/components/conversations/index.d.ts +8 -0
- package/dist/components/conversations/index.js +5 -0
- package/dist/components/form/HeaderAvatarInput.d.ts +13 -0
- package/dist/components/form/HeaderAvatarInput.js +16 -0
- package/dist/components/form/ImageEditModal.d.ts +23 -0
- package/dist/components/form/ImageEditModal.js +75 -0
- package/dist/components/form/ImageInput.d.ts +32 -0
- package/dist/components/form/ImageInput.js +65 -0
- package/dist/components/form/LocationInput.d.ts +20 -0
- package/dist/components/form/LocationInput.js +59 -0
- package/dist/components/form/index.d.ts +8 -0
- package/dist/components/form/index.js +4 -0
- package/dist/components/groups/AddGroupMemberModal.d.ts +6 -0
- package/dist/components/groups/AddGroupMemberModal.js +40 -0
- package/dist/components/groups/AddGroupMembersButton.d.ts +5 -0
- package/dist/components/groups/AddGroupMembersButton.js +17 -0
- package/dist/components/groups/ChangeGroupRolesModal.d.ts +7 -0
- package/dist/components/groups/ChangeGroupRolesModal.js +45 -0
- package/dist/components/groups/ConfirmGroupExitModal.d.ts +6 -0
- package/dist/components/groups/ConfirmGroupExitModal.js +35 -0
- package/dist/components/groups/ConfirmMemberRemovalModal.d.ts +7 -0
- package/dist/components/groups/ConfirmMemberRemovalModal.js +33 -0
- package/dist/components/groups/DeleteGroupModal.d.ts +6 -0
- package/dist/components/groups/DeleteGroupModal.js +34 -0
- package/dist/components/groups/GroupAvatar.d.ts +14 -0
- package/dist/components/groups/GroupAvatar.js +32 -0
- package/dist/components/groups/GroupCard.d.ts +19 -0
- package/dist/components/groups/GroupCard.js +12 -0
- package/dist/components/groups/GroupFeed.d.ts +9 -0
- package/dist/components/groups/GroupFeed.js +14 -0
- package/dist/components/groups/GroupForm.d.ts +7 -0
- package/dist/components/groups/GroupForm.js +73 -0
- package/dist/components/groups/GroupHeader.d.ts +5 -0
- package/dist/components/groups/GroupHeader.js +14 -0
- package/dist/components/groups/GroupMembersList.d.ts +5 -0
- package/dist/components/groups/GroupMembersList.js +38 -0
- package/dist/components/groups/GroupOptionsMenu.d.ts +5 -0
- package/dist/components/groups/GroupOptionsMenu.js +61 -0
- package/dist/components/groups/GroupShareMenu.d.ts +5 -0
- package/dist/components/groups/GroupShareMenu.js +29 -0
- package/dist/components/groups/JoinGroupButton.d.ts +6 -0
- package/dist/components/groups/JoinGroupButton.js +28 -0
- package/dist/components/groups/index.d.ts +30 -0
- package/dist/components/groups/index.js +15 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/index.js +15 -0
- package/dist/components/jams/CreateNewJam.d.ts +4 -0
- package/dist/components/jams/CreateNewJam.js +138 -0
- package/dist/components/jams/CreateNewJamContext.d.ts +9 -0
- package/dist/components/jams/CreateNewJamContext.js +16 -0
- package/dist/components/jams/JamAnimatedEmoji.d.ts +4 -0
- package/dist/components/jams/JamAnimatedEmoji.js +12 -0
- package/dist/components/jams/JamCallParticipant.d.ts +15 -0
- package/dist/components/jams/JamCallParticipant.js +101 -0
- package/dist/components/jams/JamCapacityGate.d.ts +7 -0
- package/dist/components/jams/JamCapacityGate.js +30 -0
- package/dist/components/jams/JamChatDrawer.d.ts +6 -0
- package/dist/components/jams/JamChatDrawer.js +88 -0
- package/dist/components/jams/JamChatMessage.d.ts +5 -0
- package/dist/components/jams/JamChatMessage.js +35 -0
- package/dist/components/jams/JamConference.d.ts +8 -0
- package/dist/components/jams/JamConference.js +38 -0
- package/dist/components/jams/JamContext.d.ts +20 -0
- package/dist/components/jams/JamContext.js +24 -0
- package/dist/components/jams/JamDetailsDrawer.d.ts +9 -0
- package/dist/components/jams/JamDetailsDrawer.js +39 -0
- package/dist/components/jams/JamDeviceSelectors.d.ts +12 -0
- package/dist/components/jams/JamDeviceSelectors.js +71 -0
- package/dist/components/jams/JamEventsContext.d.ts +14 -0
- package/dist/components/jams/JamEventsContext.js +143 -0
- package/dist/components/jams/JamFooter.d.ts +18 -0
- package/dist/components/jams/JamFooter.js +171 -0
- package/dist/components/jams/JamGuestForm.d.ts +1 -0
- package/dist/components/jams/JamGuestForm.js +55 -0
- package/dist/components/jams/JamLobby.d.ts +17 -0
- package/dist/components/jams/JamLobby.js +159 -0
- package/dist/components/jams/JamObserverShell.d.ts +6 -0
- package/dist/components/jams/JamObserverShell.js +11 -0
- package/dist/components/jams/JamParticipantConference.d.ts +7 -0
- package/dist/components/jams/JamParticipantConference.js +80 -0
- package/dist/components/jams/JamPeopleDrawer.d.ts +10 -0
- package/dist/components/jams/JamPeopleDrawer.js +76 -0
- package/dist/components/jams/JamReactionMenu.d.ts +12 -0
- package/dist/components/jams/JamReactionMenu.js +79 -0
- package/dist/components/jams/JamRequestJoin.d.ts +9 -0
- package/dist/components/jams/JamRequestJoin.js +34 -0
- package/dist/components/jams/JamRoom.d.ts +21 -0
- package/dist/components/jams/JamRoom.js +166 -0
- package/dist/components/jams/JamRoomIndicators.d.ts +10 -0
- package/dist/components/jams/JamRoomIndicators.js +39 -0
- package/dist/components/jams/JamVideoCall.d.ts +15 -0
- package/dist/components/jams/JamVideoCall.js +18 -0
- package/dist/components/jams/JamVideoLayout.d.ts +13 -0
- package/dist/components/jams/JamVideoLayout.js +68 -0
- package/dist/components/jams/LeaveCloseButton.d.ts +6 -0
- package/dist/components/jams/LeaveCloseButton.js +58 -0
- package/dist/components/jams/LiveJamsSection.d.ts +1 -0
- package/dist/components/jams/LiveJamsSection.js +16 -0
- package/dist/components/jams/animateEmoji.d.ts +1 -0
- package/dist/components/jams/animateEmoji.js +48 -0
- package/dist/components/jams/blurProcessor.d.ts +8 -0
- package/dist/components/jams/blurProcessor.js +28 -0
- package/dist/components/jams/constants.d.ts +10 -0
- package/dist/components/jams/constants.js +44 -0
- package/dist/components/jams/index.d.ts +24 -0
- package/dist/components/jams/index.js +19 -0
- package/dist/components/jams/jamEventActions.d.ts +26 -0
- package/dist/components/jams/jamEventActions.js +76 -0
- package/dist/components/jams/jamLocalSettings.d.ts +17 -0
- package/dist/components/jams/jamLocalSettings.js +53 -0
- package/dist/components/jams/jamReactionPreferences.d.ts +15 -0
- package/dist/components/jams/jamReactionPreferences.js +53 -0
- package/dist/components/jams/jamRecordingState.d.ts +10 -0
- package/dist/components/jams/jamRecordingState.js +25 -0
- package/dist/components/jams/reactionEmojis.d.ts +30 -0
- package/dist/components/jams/reactionEmojis.js +73 -0
- package/dist/components/jams/useJamHands.d.ts +7 -0
- package/dist/components/jams/useJamHands.js +39 -0
- package/dist/components/jams/useJamLiveKitTheme.d.ts +3 -0
- package/dist/components/jams/useJamLiveKitTheme.js +10 -0
- package/dist/components/layout/AccessDenied.d.ts +14 -0
- package/dist/components/layout/AccessDenied.js +28 -0
- package/dist/components/layout/AccessDeniedLoader.d.ts +16 -0
- package/dist/components/layout/AccessDeniedLoader.js +12 -0
- package/dist/components/layout/Auth.d.ts +22 -0
- package/dist/components/layout/Auth.js +82 -0
- package/dist/components/layout/IdentityContext.d.ts +17 -0
- package/dist/components/layout/IdentityContext.js +38 -0
- package/dist/components/layout/Infos.d.ts +5 -0
- package/dist/components/layout/Infos.js +42 -0
- package/dist/components/layout/OpenpeepsContextProvider.d.ts +10 -0
- package/dist/components/layout/OpenpeepsContextProvider.js +63 -0
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +11 -0
- package/dist/components/layout/OpenpeepsThemeProvider.js +47 -0
- package/dist/components/layout/ProfileGuard.d.ts +14 -0
- package/dist/components/layout/ProfileGuard.js +38 -0
- package/dist/components/layout/ProfileProvider.d.ts +10 -0
- package/dist/components/layout/ProfileProvider.js +60 -0
- package/dist/components/layout/Root.d.ts +16 -0
- package/dist/components/layout/Root.js +36 -0
- package/dist/components/layout/ToastProvider.d.ts +22 -0
- package/dist/components/layout/ToastProvider.js +37 -0
- package/dist/components/layout/index.d.ts +21 -0
- package/dist/components/layout/index.js +11 -0
- package/dist/components/markdown/CompiledMarkdown.d.ts +5 -0
- package/dist/components/markdown/CompiledMarkdown.js +3 -0
- package/dist/components/markdown/OpenpeepsMarkdown.d.ts +16 -0
- package/dist/components/markdown/OpenpeepsMarkdown.js +66 -0
- package/dist/components/markdown/classes.d.ts +2 -0
- package/dist/components/markdown/classes.js +2 -0
- package/dist/components/markdown/compileMarkdown.d.ts +5 -0
- package/dist/components/markdown/compileMarkdown.js +36 -0
- package/dist/components/markdown/index.d.ts +11 -0
- package/dist/components/markdown/index.js +7 -0
- package/dist/components/markdown/linkTargets.d.ts +3 -0
- package/dist/components/markdown/linkTargets.js +27 -0
- package/dist/components/markdown/staticRender.d.ts +16 -0
- package/dist/components/markdown/staticRender.js +17 -0
- package/dist/components/navigation/ContentHeader.d.ts +1 -0
- package/dist/components/navigation/ContentHeader.js +18 -0
- package/dist/components/navigation/FooterMobile.d.ts +5 -0
- package/dist/components/navigation/FooterMobile.js +8 -0
- package/dist/components/navigation/HeaderMobile.d.ts +11 -0
- package/dist/components/navigation/HeaderMobile.js +26 -0
- package/dist/components/navigation/MobileMenuItem.d.ts +7 -0
- package/dist/components/navigation/MobileMenuItem.js +13 -0
- package/dist/components/navigation/PageHeaderAction.d.ts +5 -0
- package/dist/components/navigation/PageHeaderAction.js +7 -0
- package/dist/components/navigation/PlusButton.d.ts +1 -0
- package/dist/components/navigation/PlusButton.js +11 -0
- package/dist/components/navigation/SideBar.d.ts +16 -0
- package/dist/components/navigation/SideBar.js +24 -0
- package/dist/components/navigation/SidebarNavContext.d.ts +3 -0
- package/dist/components/navigation/SidebarNavContext.js +4 -0
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.js +10 -0
- package/dist/components/navigation/breadcrumbs/Crumb.d.ts +5 -0
- package/dist/components/navigation/breadcrumbs/Crumb.js +4 -0
- package/dist/components/navigation/index.d.ts +17 -0
- package/dist/components/navigation/index.js +11 -0
- package/dist/components/navigation/sideBarNavLinkClass.d.ts +4 -0
- package/dist/components/navigation/sideBarNavLinkClass.js +3 -0
- package/dist/components/notifications/NotificationErrorBoundary.d.ts +16 -0
- package/dist/components/notifications/NotificationErrorBoundary.js +21 -0
- package/dist/components/notifications/NotificationHeaderActions.d.ts +6 -0
- package/dist/components/notifications/NotificationHeaderActions.js +35 -0
- package/dist/components/notifications/NotificationItem.d.ts +5 -0
- package/dist/components/notifications/NotificationItem.js +6 -0
- package/dist/components/notifications/NotificationWrapper.d.ts +10 -0
- package/dist/components/notifications/NotificationWrapper.js +6 -0
- package/dist/components/notifications/NotificationsList.d.ts +12 -0
- package/dist/components/notifications/NotificationsList.js +88 -0
- package/dist/components/notifications/TypedNotification.d.ts +4 -0
- package/dist/components/notifications/TypedNotification.js +201 -0
- package/dist/components/notifications/index.d.ts +7 -0
- package/dist/components/notifications/index.js +5 -0
- package/dist/components/post/Feed.d.ts +20 -0
- package/dist/components/post/Feed.js +63 -0
- package/dist/components/post/FeedPost.d.ts +17 -0
- package/dist/components/post/FeedPost.js +31 -0
- package/dist/components/post/FeedPostContent.d.ts +5 -0
- package/dist/components/post/FeedPostContent.js +22 -0
- package/dist/components/post/FullPostLayout.d.ts +7 -0
- package/dist/components/post/FullPostLayout.js +23 -0
- package/dist/components/post/Markdown.d.ts +2 -0
- package/dist/components/post/Markdown.js +1 -0
- package/dist/components/post/NewEventButton.d.ts +14 -0
- package/dist/components/post/NewEventButton.js +39 -0
- package/dist/components/post/NewNoteButton.d.ts +14 -0
- package/dist/components/post/NewNoteButton.js +38 -0
- package/dist/components/post/PinnedPost.d.ts +5 -0
- package/dist/components/post/PinnedPost.js +15 -0
- package/dist/components/post/PostDetail.d.ts +4 -0
- package/dist/components/post/PostDetail.js +31 -0
- package/dist/components/post/ReplyBox.d.ts +5 -0
- package/dist/components/post/ReplyBox.js +30 -0
- package/dist/components/post/VideoPlayOverlay.d.ts +5 -0
- package/dist/components/post/VideoPlayOverlay.js +8 -0
- package/dist/components/post/attachmentPreview.d.ts +5 -0
- package/dist/components/post/attachmentPreview.js +14 -0
- package/dist/components/post/feed/events/EventsFeed.d.ts +7 -0
- package/dist/components/post/feed/events/EventsFeed.js +44 -0
- package/dist/components/post/feed/threaded/ThreadPost.d.ts +9 -0
- package/dist/components/post/feed/threaded/ThreadPost.js +19 -0
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +10 -0
- package/dist/components/post/feed/threaded/ThreadedFeed.js +8 -0
- package/dist/components/post/helpers.d.ts +6 -0
- package/dist/components/post/helpers.js +24 -0
- package/dist/components/post/index.d.ts +78 -0
- package/dist/components/post/index.js +57 -0
- package/dist/components/post/pieces/Attachments.d.ts +5 -0
- package/dist/components/post/pieces/Attachments.js +44 -0
- package/dist/components/post/pieces/EventLocation.d.ts +7 -0
- package/dist/components/post/pieces/EventLocation.js +28 -0
- package/dist/components/post/pieces/EventMenu.d.ts +6 -0
- package/dist/components/post/pieces/EventMenu.js +35 -0
- package/dist/components/post/pieces/EventRsvpButton.d.ts +5 -0
- package/dist/components/post/pieces/EventRsvpButton.js +60 -0
- package/dist/components/post/pieces/FeedPostStats.d.ts +5 -0
- package/dist/components/post/pieces/FeedPostStats.js +27 -0
- package/dist/components/post/pieces/GalleryModal.d.ts +7 -0
- package/dist/components/post/pieces/GalleryModal.js +16 -0
- package/dist/components/post/pieces/ParticipantsCard.d.ts +8 -0
- package/dist/components/post/pieces/ParticipantsCard.js +13 -0
- package/dist/components/post/pieces/PollContent.d.ts +5 -0
- package/dist/components/post/pieces/PollContent.js +109 -0
- package/dist/components/post/pieces/PostActions.d.ts +6 -0
- package/dist/components/post/pieces/PostActions.js +63 -0
- package/dist/components/post/pieces/PostInfoHeader.d.ts +7 -0
- package/dist/components/post/pieces/PostInfoHeader.js +8 -0
- package/dist/components/post/pieces/PostMenu.d.ts +6 -0
- package/dist/components/post/pieces/PostMenu.js +77 -0
- package/dist/components/post/pieces/PostReactionHeader.d.ts +12 -0
- package/dist/components/post/pieces/PostReactionHeader.js +31 -0
- package/dist/components/post/pieces/ShareMenu.d.ts +6 -0
- package/dist/components/post/pieces/ShareMenu.js +46 -0
- package/dist/components/post/pieces/UnreadPostIndicator.d.ts +9 -0
- package/dist/components/post/pieces/UnreadPostIndicator.js +6 -0
- package/dist/components/post/pieces/VideoPlayer.d.ts +16 -0
- package/dist/components/post/pieces/VideoPlayer.js +127 -0
- package/dist/components/post/pieces/modals/DeletePostModal.d.ts +8 -0
- package/dist/components/post/pieces/modals/DeletePostModal.js +20 -0
- package/dist/components/post/pieces/modals/ReactionsModal.d.ts +7 -0
- package/dist/components/post/pieces/modals/ReactionsModal.js +11 -0
- package/dist/components/post/pieces/modals/RepostModal.d.ts +7 -0
- package/dist/components/post/pieces/modals/RepostModal.js +13 -0
- package/dist/components/post/post-form/ArticleForm.d.ts +7 -0
- package/dist/components/post/post-form/ArticleForm.js +45 -0
- package/dist/components/post/post-form/AttachmentCard.d.ts +29 -0
- package/dist/components/post/post-form/AttachmentCard.js +120 -0
- package/dist/components/post/post-form/ComposeAttachments.d.ts +25 -0
- package/dist/components/post/post-form/ComposeAttachments.js +137 -0
- package/dist/components/post/post-form/ComposePreviewLinks.d.ts +4 -0
- package/dist/components/post/post-form/ComposePreviewLinks.js +9 -0
- package/dist/components/post/post-form/DescriptionEditModal.d.ts +13 -0
- package/dist/components/post/post-form/DescriptionEditModal.js +22 -0
- package/dist/components/post/post-form/EditPostModal.d.ts +6 -0
- package/dist/components/post/post-form/EditPostModal.js +81 -0
- package/dist/components/post/post-form/EditPostModalContext.d.ts +10 -0
- package/dist/components/post/post-form/EditPostModalContext.js +18 -0
- package/dist/components/post/post-form/EventForm.d.ts +7 -0
- package/dist/components/post/post-form/EventForm.js +104 -0
- package/dist/components/post/post-form/EventTypeSwitcher.d.ts +8 -0
- package/dist/components/post/post-form/EventTypeSwitcher.js +165 -0
- package/dist/components/post/post-form/NewPostModal.d.ts +13 -0
- package/dist/components/post/post-form/NewPostModal.js +272 -0
- package/dist/components/post/post-form/NewPostModalContext.d.ts +15 -0
- package/dist/components/post/post-form/NewPostModalContext.js +20 -0
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.d.ts +19 -0
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +65 -0
- package/dist/components/post/post-form/PollComposerFields.d.ts +12 -0
- package/dist/components/post/post-form/PollComposerFields.js +19 -0
- package/dist/components/post/post-form/PostAudienceSelector.d.ts +12 -0
- package/dist/components/post/post-form/PostAudienceSelector.js +83 -0
- package/dist/components/post/post-form/PostTypeSwitcher.d.ts +16 -0
- package/dist/components/post/post-form/PostTypeSwitcher.js +22 -0
- package/dist/components/post/post-form/ReplyModal.d.ts +6 -0
- package/dist/components/post/post-form/ReplyModal.js +202 -0
- package/dist/components/post/post-form/ReplyModalContext.d.ts +10 -0
- package/dist/components/post/post-form/ReplyModalContext.js +18 -0
- package/dist/components/post/post-form/VisibilitySelector.d.ts +8 -0
- package/dist/components/post/post-form/VisibilitySelector.js +35 -0
- package/dist/components/post/post-form/audienceChoices.d.ts +14 -0
- package/dist/components/post/post-form/audienceChoices.js +66 -0
- package/dist/components/post/types/Article.d.ts +5 -0
- package/dist/components/post/types/Article.js +14 -0
- package/dist/components/post/types/Event.d.ts +5 -0
- package/dist/components/post/types/Event.js +19 -0
- package/dist/components/post/types/Note.d.ts +5 -0
- package/dist/components/post/types/Note.js +10 -0
- package/dist/components/post/types/Poll.d.ts +7 -0
- package/dist/components/post/types/Poll.js +11 -0
- package/dist/components/post/types/article/FullArticle.d.ts +5 -0
- package/dist/components/post/types/article/FullArticle.js +8 -0
- package/dist/components/post/types/event/CardEvent.d.ts +5 -0
- package/dist/components/post/types/event/CardEvent.js +45 -0
- package/dist/components/post/types/event/FullEvent.d.ts +5 -0
- package/dist/components/post/types/event/FullEvent.js +161 -0
- package/dist/components/post/types/event/ProfileEventRelationship.d.ts +5 -0
- package/dist/components/post/types/event/ProfileEventRelationship.js +31 -0
- package/dist/components/post/types/note/FullNote.d.ts +5 -0
- package/dist/components/post/types/note/FullNote.js +5 -0
- package/dist/components/post/types/poll/FullPoll.d.ts +5 -0
- package/dist/components/post/types/poll/FullPoll.js +7 -0
- package/dist/components/post/visibility.d.ts +7 -0
- package/dist/components/post/visibility.js +10 -0
- package/dist/components/preview-link/LocalPreviewLink.d.ts +4 -0
- package/dist/components/preview-link/LocalPreviewLink.js +12 -0
- package/dist/components/preview-link/PreviewLink.d.ts +4 -0
- package/dist/components/preview-link/PreviewLink.js +11 -0
- package/dist/components/preview-link/RemotePreviewLink.d.ts +4 -0
- package/dist/components/preview-link/RemotePreviewLink.js +21 -0
- package/dist/components/preview-link/helpers.d.ts +7 -0
- package/dist/components/preview-link/helpers.js +31 -0
- package/dist/components/preview-link/index.d.ts +3 -0
- package/dist/components/preview-link/index.js +2 -0
- package/dist/components/preview-link/local/GroupPreview.d.ts +4 -0
- package/dist/components/preview-link/local/GroupPreview.js +15 -0
- package/dist/components/preview-link/local/JamPreview.d.ts +9 -0
- package/dist/components/preview-link/local/JamPreview.js +20 -0
- package/dist/components/preview-link/local/PostPreview.d.ts +4 -0
- package/dist/components/preview-link/local/PostPreview.js +15 -0
- package/dist/components/profile/Avatar.d.ts +17 -0
- package/dist/components/profile/Avatar.js +36 -0
- package/dist/components/profile/AvatarWithName.d.ts +5 -0
- package/dist/components/profile/AvatarWithName.js +5 -0
- package/dist/components/profile/FollowUnfollowButton.d.ts +8 -0
- package/dist/components/profile/FollowUnfollowButton.js +27 -0
- package/dist/components/profile/ProfileBadge.d.ts +7 -0
- package/dist/components/profile/ProfileBadge.js +12 -0
- package/dist/components/profile/ProfileCard.d.ts +24 -0
- package/dist/components/profile/ProfileCard.js +12 -0
- package/dist/components/profile/ProfileFromId.d.ts +6 -0
- package/dist/components/profile/ProfileFromId.js +15 -0
- package/dist/components/profile/ProfileHeader.d.ts +10 -0
- package/dist/components/profile/ProfileHeader.js +16 -0
- package/dist/components/profile/ProfileLink.d.ts +9 -0
- package/dist/components/profile/ProfileLink.js +9 -0
- package/dist/components/profile/ProfilePageAction.d.ts +6 -0
- package/dist/components/profile/ProfilePageAction.js +35 -0
- package/dist/components/profile/ProfilePostsAndReplies.d.ts +9 -0
- package/dist/components/profile/ProfilePostsAndReplies.js +24 -0
- package/dist/components/profile/ProfileSelector.d.ts +14 -0
- package/dist/components/profile/ProfileSelector.js +72 -0
- package/dist/components/profile/ProfileStats.d.ts +5 -0
- package/dist/components/profile/ProfileStats.js +6 -0
- package/dist/components/profile/ProfileWithActionCard.d.ts +5 -0
- package/dist/components/profile/ProfileWithActionCard.js +6 -0
- package/dist/components/profile/ProfilesInput.d.ts +15 -0
- package/dist/components/profile/ProfilesInput.js +31 -0
- package/dist/components/profile/ReportProfileOrPostModal.d.ts +9 -0
- package/dist/components/profile/ReportProfileOrPostModal.js +75 -0
- package/dist/components/profile/index.d.ts +30 -0
- package/dist/components/profile/index.js +15 -0
- package/dist/components/registry/ErrorComponent.d.ts +6 -0
- package/dist/components/registry/ErrorComponent.js +7 -0
- package/dist/components/registry/PluginLoader.d.ts +3 -0
- package/dist/components/registry/PluginLoader.js +51 -0
- package/dist/components/registry/PluginRegistryProvider.d.ts +23 -0
- package/dist/components/registry/PluginRegistryProvider.js +57 -0
- package/dist/components/registry/PluginSlot.d.ts +7 -0
- package/dist/components/registry/PluginSlot.js +31 -0
- package/dist/components/registry/index.d.ts +10 -0
- package/dist/components/registry/index.js +16 -0
- package/dist/components/server-data/ServerDataProvider.d.ts +8 -0
- package/dist/components/server-data/ServerDataProvider.js +30 -0
- package/dist/components/server-data/context.d.ts +121 -0
- package/dist/components/server-data/context.js +10 -0
- package/dist/components/server-data/index.d.ts +4 -0
- package/dist/components/server-data/index.js +2 -0
- package/dist/components/server-data/types.d.ts +5 -0
- package/dist/components/server-data/types.js +1 -0
- package/dist/contexts/credentialsStore/index.d.ts +8 -0
- package/dist/contexts/credentialsStore/index.js +13 -0
- package/dist/contexts/credentialsStore/types.d.ts +4 -0
- package/dist/contexts/credentialsStore/types.js +1 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.js +3 -0
- package/dist/contexts/openpeeps/helpers.d.ts +93 -0
- package/dist/contexts/openpeeps/helpers.js +311 -0
- package/dist/contexts/openpeeps/hooks/accounts.d.ts +302 -0
- package/dist/contexts/openpeeps/hooks/accounts.js +17 -0
- package/dist/contexts/openpeeps/hooks/admin.d.ts +17177 -0
- package/dist/contexts/openpeeps/hooks/admin.js +115 -0
- package/dist/contexts/openpeeps/hooks/auth.d.ts +55 -0
- package/dist/contexts/openpeeps/hooks/auth.js +22 -0
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +9815 -0
- package/dist/contexts/openpeeps/hooks/conversations.js +6 -0
- package/dist/contexts/openpeeps/hooks/groups.d.ts +319 -0
- package/dist/contexts/openpeeps/hooks/groups.js +31 -0
- package/dist/contexts/openpeeps/hooks/index.d.ts +18 -0
- package/dist/contexts/openpeeps/hooks/index.js +26 -0
- package/dist/contexts/openpeeps/hooks/jams.d.ts +3318 -0
- package/dist/contexts/openpeeps/hooks/jams.js +32 -0
- package/dist/contexts/openpeeps/hooks/other.d.ts +239 -0
- package/dist/contexts/openpeeps/hooks/other.js +89 -0
- package/dist/contexts/openpeeps/hooks/payments.d.ts +36 -0
- package/dist/contexts/openpeeps/hooks/payments.js +10 -0
- package/dist/contexts/openpeeps/hooks/posts.d.ts +26001 -0
- package/dist/contexts/openpeeps/hooks/posts.js +139 -0
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +6896 -0
- package/dist/contexts/openpeeps/hooks/profiles.js +43 -0
- package/dist/contexts/openpeeps/hooks/search.d.ts +9620 -0
- package/dist/contexts/openpeeps/hooks/search.js +24 -0
- package/dist/contexts/openpeeps/hooks/streaming.d.ts +26 -0
- package/dist/contexts/openpeeps/hooks/streaming.js +10 -0
- package/dist/contexts/openpeeps/hooks/useHasAuthToken.d.ts +2 -0
- package/dist/contexts/openpeeps/hooks/useHasAuthToken.js +35 -0
- package/dist/contexts/openpeeps/index.d.ts +21 -0
- package/dist/contexts/openpeeps/index.js +180 -0
- package/dist/contexts/openpeeps/types.d.ts +11 -0
- package/dist/contexts/openpeeps/types.js +1 -0
- package/dist/contexts/router/index.d.ts +28 -0
- package/dist/contexts/router/index.js +69 -0
- package/dist/email/index.d.ts +13 -0
- package/dist/email/index.js +10 -0
- package/dist/i18n/I18nProvider.d.ts +19 -0
- package/dist/i18n/I18nProvider.js +33 -0
- package/dist/i18n/context.d.ts +8 -0
- package/dist/i18n/context.js +10 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.js +23 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/lib/apiErrorMessage.d.ts +3 -0
- package/dist/lib/apiErrorMessage.js +14 -0
- package/dist/lib/canvasUtils.d.ts +12 -0
- package/dist/lib/canvasUtils.js +104 -0
- package/dist/lib/configuration/helpers.d.ts +7 -0
- package/dist/lib/configuration/helpers.js +83 -0
- package/dist/lib/configuration/resolveSchema.d.ts +3 -0
- package/dist/lib/configuration/resolveSchema.js +8 -0
- package/dist/lib/groupCapabilityHelpers.d.ts +24 -0
- package/dist/lib/groupCapabilityHelpers.js +119 -0
- package/dist/lib/notificationBadge.d.ts +5 -0
- package/dist/lib/notificationBadge.js +25 -0
- package/dist/lib/postUnread.d.ts +2 -0
- package/dist/lib/postUnread.js +1 -0
- package/dist/lib/postViewCounter.d.ts +17 -0
- package/dist/lib/postViewCounter.js +162 -0
- package/dist/lib/threadHelpers.d.ts +5 -0
- package/dist/lib/threadHelpers.js +23 -0
- package/dist/lib/unseenCountsOptimistic.d.ts +15 -0
- package/dist/lib/unseenCountsOptimistic.js +43 -0
- package/dist/log/index.d.ts +11 -0
- package/dist/log/index.js +14 -0
- package/dist/push/index.d.ts +16 -0
- package/dist/push/index.js +145 -0
- package/dist/push/usePushSubscription.d.ts +18 -0
- package/dist/push/usePushSubscription.js +102 -0
- package/dist/push/vapid.d.ts +6 -0
- package/dist/push/vapid.js +12 -0
- package/dist/pwa/InstallPrompt.d.ts +13 -0
- package/dist/pwa/InstallPrompt.js +17 -0
- package/dist/pwa/NotificationPermissionPrompt.d.ts +22 -0
- package/dist/pwa/NotificationPermissionPrompt.js +56 -0
- package/dist/pwa/PwaProvider.d.ts +16 -0
- package/dist/pwa/PwaProvider.js +56 -0
- package/dist/pwa/UpdatePrompt.d.ts +14 -0
- package/dist/pwa/UpdatePrompt.js +14 -0
- package/dist/pwa/index.d.ts +18 -0
- package/dist/pwa/index.js +16 -0
- package/dist/pwa/navigationUrl.d.ts +16 -0
- package/dist/pwa/navigationUrl.js +51 -0
- package/dist/pwa/pushInvalidate.d.ts +7 -0
- package/dist/pwa/pushInvalidate.js +29 -0
- package/dist/pwa/registration.d.ts +28 -0
- package/dist/pwa/registration.js +71 -0
- package/dist/pwa/sw-types.d.ts +14 -0
- package/dist/pwa/sw-types.js +1 -0
- package/dist/pwa/sw.d.ts +2 -0
- package/dist/pwa/sw.js +171 -0
- package/dist/pwa/useInstallPrompt.d.ts +10 -0
- package/dist/pwa/useInstallPrompt.js +45 -0
- package/dist/pwa/useNotificationBadgeSync.d.ts +2 -0
- package/dist/pwa/useNotificationBadgeSync.js +23 -0
- package/dist/pwa/useServiceWorker.d.ts +19 -0
- package/dist/pwa/useServiceWorker.js +49 -0
- package/dist/pwa/vite.d.ts +50 -0
- package/dist/pwa/vite.js +53 -0
- package/dist/react-native.d.ts +11 -0
- package/dist/react-native.js +11 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +5 -0
- package/dist/stores/breadcrumbs.d.ts +5 -0
- package/dist/stores/breadcrumbs.js +5 -0
- package/dist/stores/createStore.d.ts +19 -0
- package/dist/stores/createStore.js +63 -0
- package/dist/stores/index.d.ts +7 -0
- package/dist/stores/index.js +9 -0
- package/dist/stores/newPosts.d.ts +591 -0
- package/dist/stores/newPosts.js +191 -0
- package/dist/stores/pageHeader.d.ts +15 -0
- package/dist/stores/pageHeader.js +22 -0
- package/dist/stores/plusButton.d.ts +5 -0
- package/dist/stores/plusButton.js +13 -0
- package/dist/stores/types.d.ts +35 -0
- package/dist/stores/types.js +1 -0
- package/dist/streaming.d.ts +6 -0
- package/dist/streaming.js +6 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/index.js +1 -0
- package/package.json +72 -0
- package/src/pwa/navigationUrl.ts +61 -0
- package/src/pwa/sw-types.ts +9 -0
- package/src/pwa/sw.ts +228 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Copy, CopyCheck, X } from 'lucide-react';
|
|
4
|
+
import { truncateText } from '@openpeepshq/common';
|
|
5
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
6
|
+
import { useT } from '../../i18n/index.js';
|
|
7
|
+
import { useJamContext } from './JamContext.js';
|
|
8
|
+
/**
|
|
9
|
+
* Jam details side menu (joining info + moderator observer link), styled like
|
|
10
|
+
* the chat / people drawers. Replaces the previous floating info popover.
|
|
11
|
+
*/
|
|
12
|
+
export const JamDetailsDrawer = ({ open, onClose }) => {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const { jamPost } = useJamContext();
|
|
15
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
16
|
+
const observerLinkQuery = openpeepsApi.useObserverLink(jamPost.id);
|
|
17
|
+
const [copied, setCopied] = useState(false);
|
|
18
|
+
const [observerCopied, setObserverCopied] = useState(false);
|
|
19
|
+
if (!open)
|
|
20
|
+
return null;
|
|
21
|
+
const href = typeof window !== 'undefined' ? window.location.href : '';
|
|
22
|
+
const observerPath = observerLinkQuery.data?.path;
|
|
23
|
+
const observerUrl = typeof window !== 'undefined' && observerPath
|
|
24
|
+
? observerPath.startsWith('http')
|
|
25
|
+
? observerPath
|
|
26
|
+
: `${window.location.origin}${observerPath}`
|
|
27
|
+
: null;
|
|
28
|
+
return (_jsxs("div", { className: "bg-surface-100 text-foreground absolute right-0 top-0 flex h-full w-full flex-col gap-3 overflow-hidden rounded md:relative md:w-80", children: [_jsxs("div", { className: "flex w-full flex-none items-center justify-between border-b p-2", children: [_jsx("h3", { className: "text-lg", children: t('jams.details.panelHeading') }), _jsx("button", { type: "button", title: t('jams.details.closePanel'), className: "text-neutral-400", onClick: onClose, children: _jsx(X, {}) })] }), _jsxs("div", { className: "flex-1 space-y-4 overflow-y-auto px-2 pb-4", children: [_jsxs("div", { children: [_jsx("h4", { className: "text-muted-foreground text-xs font-semibold uppercase", children: t('jams.details.joiningInfoHeading') }), _jsx("span", { className: "mt-1 block break-all text-sm", children: href }), _jsxs("button", { type: "button", className: "mt-2 flex items-center text-sm", onClick: () => {
|
|
29
|
+
void navigator.clipboard.writeText(href);
|
|
30
|
+
setCopied(true);
|
|
31
|
+
}, children: [copied ? (_jsx(CopyCheck, { className: "size-4" })) : (_jsx(Copy, { className: "size-4" })), _jsx("span", { className: "ml-2", children: copied
|
|
32
|
+
? t('jams.details.copiedJoiningInfo')
|
|
33
|
+
: t('jams.details.copyJoiningInfo') })] })] }), observerUrl ? (_jsxs("div", { children: [_jsx("h4", { className: "text-muted-foreground text-xs font-semibold uppercase", children: t('jams.details.observerLinkHeading') }), _jsx("span", { className: "mt-1 block break-all text-sm", children: truncateText(observerUrl, 40) }), _jsxs("button", { type: "button", className: "mt-2 flex items-center text-sm", onClick: () => {
|
|
34
|
+
void navigator.clipboard.writeText(observerUrl);
|
|
35
|
+
setObserverCopied(true);
|
|
36
|
+
}, children: [observerCopied ? (_jsx(CopyCheck, { className: "size-4" })) : (_jsx(Copy, { className: "size-4" })), _jsx("span", { className: "ml-2", children: observerCopied
|
|
37
|
+
? t('jams.details.copiedObserverLink')
|
|
38
|
+
: t('jams.details.copyObserverLink') })] })] })) : null] })] }));
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** In-room microphone control mirroring `MicrophoneSelectorAndSwitch.svelte`. */
|
|
2
|
+
export declare const JamMicSelector: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
/** In-room camera control mirroring `CameraSelectorAndSwitch.svelte`. */
|
|
4
|
+
export declare const JamCameraSelector: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export interface JamAudioOutputSelectorProps {
|
|
6
|
+
speakerDeviceId?: string;
|
|
7
|
+
speakerEnabled: boolean;
|
|
8
|
+
onSpeakerChange: (deviceId: string) => void;
|
|
9
|
+
onToggleSpeaker: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** In-room speaker control mirroring `AudioOutputSelector.svelte`. */
|
|
12
|
+
export declare const JamAudioOutputSelector: ({ speakerDeviceId, speakerEnabled, onSpeakerChange, onToggleSpeaker, }: JamAudioOutputSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMediaDeviceSelect, useRoomContext, useTrackToggle, } from '@livekit/components-react';
|
|
3
|
+
import { LocalAudioTrack, LocalVideoTrack, Track } from 'livekit-client';
|
|
4
|
+
import { Check, Mic, MicOff, Video, VideoOff, Volume2, VolumeX, } from 'lucide-react';
|
|
5
|
+
import { PopupMenuButton, SplitButtonMenu, } from '@openpeepshq/react-ui';
|
|
6
|
+
import { useT } from '../../i18n/index.js';
|
|
7
|
+
import { audioOutputSupported } from './constants.js';
|
|
8
|
+
/** Pill mirroring Svelte `DeviceSelectorAndSwitch.svelte`. */
|
|
9
|
+
const DeviceSelectorPill = ({ enabled, onToggle, onIcon: OnIcon, offIcon: OffIcon, deviceType, devices, activeDeviceId, onDeviceChange, }) => {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const deviceLabel = deviceType === 'mic'
|
|
12
|
+
? t('jams.device.microphone')
|
|
13
|
+
: deviceType === 'camera'
|
|
14
|
+
? t('jams.device.camera')
|
|
15
|
+
: '';
|
|
16
|
+
return (_jsx(SplitButtonMenu, { className: "bg-surface-100 rounded-full backdrop-blur", title: `${enabled ? t('jams.device.turnOff') : t('jams.device.turnOn')}${deviceLabel ? ` ${deviceLabel}` : ''}`, variant: enabled ? 'variant-soft-surface' : 'variant-filled-error', action: onToggle, menuTitle: t('jams.device.changeTitle'), placement: "top-start", menuChildren: _jsxs(_Fragment, { children: [!enabled ? (_jsx(PopupMenuButton, { title: t('jams.device.turnOn'), action: onToggle, text: t('jams.device.turnOn'), icon: OnIcon })) : (_jsx(PopupMenuButton, { title: t('jams.device.turnOff'), action: onToggle, text: t('jams.device.turnOff'), icon: OffIcon })), devices.length === 0 ? (_jsx("div", { className: "p-2 text-sm", children: t('jams.device.loadingDevices') })) : (devices.map((device) => (_jsx(PopupMenuButton, { title: t('jams.device.switchTitle'), action: () => onDeviceChange(device.deviceId), icon: OnIcon, textSlot: _jsxs("span", { className: "flex w-full min-w-0 items-center gap-2", children: [_jsx("span", { className: "truncate", children: device.label ||
|
|
17
|
+
(device.deviceId === 'default'
|
|
18
|
+
? t('jams.device.defaultSpeaker')
|
|
19
|
+
: device.deviceId) }), (device.deviceId === activeDeviceId ||
|
|
20
|
+
(activeDeviceId === '' &&
|
|
21
|
+
device.deviceId === 'default')) && (_jsx(Check, { className: "ml-auto size-4 shrink-0" }))] }) }, device.deviceId))))] }), children: enabled ? _jsx(OnIcon, {}) : _jsx(OffIcon, {}) }));
|
|
22
|
+
};
|
|
23
|
+
/** In-room microphone control mirroring `MicrophoneSelectorAndSwitch.svelte`. */
|
|
24
|
+
export const JamMicSelector = () => {
|
|
25
|
+
const { enabled, toggle, track } = useTrackToggle({
|
|
26
|
+
source: Track.Source.Microphone,
|
|
27
|
+
});
|
|
28
|
+
const { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({
|
|
29
|
+
kind: 'audioinput',
|
|
30
|
+
track: track?.track,
|
|
31
|
+
requestPermissions: true,
|
|
32
|
+
});
|
|
33
|
+
return (_jsx(DeviceSelectorPill, { enabled: enabled, onToggle: () => void toggle(), onIcon: Mic, offIcon: MicOff, deviceType: "mic", devices: devices, activeDeviceId: activeDeviceId, onDeviceChange: (deviceId) => void setActiveMediaDevice(deviceId) }));
|
|
34
|
+
};
|
|
35
|
+
/** In-room camera control mirroring `CameraSelectorAndSwitch.svelte`. */
|
|
36
|
+
export const JamCameraSelector = () => {
|
|
37
|
+
const { enabled, toggle, track } = useTrackToggle({
|
|
38
|
+
source: Track.Source.Camera,
|
|
39
|
+
});
|
|
40
|
+
const { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({
|
|
41
|
+
kind: 'videoinput',
|
|
42
|
+
track: track?.track,
|
|
43
|
+
requestPermissions: true,
|
|
44
|
+
});
|
|
45
|
+
return (_jsx(DeviceSelectorPill, { enabled: enabled, onToggle: () => void toggle(), onIcon: Video, offIcon: VideoOff, deviceType: "camera", devices: devices, activeDeviceId: activeDeviceId, onDeviceChange: (deviceId) => void setActiveMediaDevice(deviceId) }));
|
|
46
|
+
};
|
|
47
|
+
/** In-room speaker control mirroring `AudioOutputSelector.svelte`. */
|
|
48
|
+
export const JamAudioOutputSelector = ({ speakerDeviceId, speakerEnabled, onSpeakerChange, onToggleSpeaker, }) => {
|
|
49
|
+
const room = useRoomContext();
|
|
50
|
+
const { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({
|
|
51
|
+
kind: 'audiooutput',
|
|
52
|
+
requestPermissions: false,
|
|
53
|
+
});
|
|
54
|
+
const handleDeviceChange = async (deviceId) => {
|
|
55
|
+
await setActiveMediaDevice(deviceId).catch(() => undefined);
|
|
56
|
+
onSpeakerChange(deviceId);
|
|
57
|
+
if (audioOutputSupported) {
|
|
58
|
+
await room
|
|
59
|
+
.switchActiveDevice('audiooutput', deviceId, true)
|
|
60
|
+
.catch(() => undefined);
|
|
61
|
+
}
|
|
62
|
+
document.querySelectorAll('audio').forEach((audio) => {
|
|
63
|
+
if (audioOutputSupported && 'setSinkId' in audio) {
|
|
64
|
+
void audio.setSinkId(deviceId).catch(() => undefined);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
if (!audioOutputSupported)
|
|
69
|
+
return null;
|
|
70
|
+
return (_jsx(DeviceSelectorPill, { enabled: speakerEnabled, onToggle: onToggleSpeaker, onIcon: Volume2, offIcon: VolumeX, deviceType: "speaker", devices: devices, activeDeviceId: activeDeviceId || speakerDeviceId || '', onDeviceChange: (deviceId) => void handleDeviceChange(deviceId) }));
|
|
71
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { JamEvent } from '@openpeepshq/common/types';
|
|
3
|
+
export interface JamEventsContextValue {
|
|
4
|
+
sessionEvents: JamEvent[];
|
|
5
|
+
ownReactions: JamEvent[];
|
|
6
|
+
reactionsForParticipant: (participantId: string) => JamEvent[];
|
|
7
|
+
sendMessage: (message: string) => Promise<void>;
|
|
8
|
+
sendReactionEmoji: (emoji: string) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function JamEventsProvider({ children }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function useJamEventsContext(): JamEventsContextValue;
|
|
14
|
+
export declare function useMaybeJamEventsContext(): JamEventsContextValue | null;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { useRoomContext } from '@livekit/components-react';
|
|
4
|
+
import { RoomEvent, ConnectionState } from 'livekit-client';
|
|
5
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
6
|
+
import { useJamContext, useJamObserver } from './JamContext.js';
|
|
7
|
+
import { parseJamEventPayload, sendAttendance, sendJamEvent, sendReaction, } from './jamEventActions.js';
|
|
8
|
+
const JamEventsContext = createContext(null);
|
|
9
|
+
const REACTION_DURATION_MS = 5000;
|
|
10
|
+
export function JamEventsProvider({ children }) {
|
|
11
|
+
const room = useRoomContext();
|
|
12
|
+
const { jamPost } = useJamContext();
|
|
13
|
+
const observer = useJamObserver();
|
|
14
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
15
|
+
const createEvent = openpeepsApi.createJamEventAction({ id: jamPost.id });
|
|
16
|
+
const [sessionEvents, setSessionEvents] = useState([]);
|
|
17
|
+
const [ownReactions, setOwnReactions] = useState([]);
|
|
18
|
+
const [participantReactions, setParticipantReactions] = useState({});
|
|
19
|
+
const timeoutIdsRef = useRef(new Map());
|
|
20
|
+
// Keep the latest persist action without re-running the attendance effect.
|
|
21
|
+
const createEventRef = useRef(createEvent);
|
|
22
|
+
createEventRef.current = createEvent;
|
|
23
|
+
// Announce join once connected and leave on unmount (mirrors Svelte sendAttendance).
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (observer)
|
|
26
|
+
return;
|
|
27
|
+
const announceJoin = () => {
|
|
28
|
+
void sendAttendance(room, createEventRef.current, 'join').catch(() => undefined);
|
|
29
|
+
};
|
|
30
|
+
const announceLeave = () => {
|
|
31
|
+
void sendAttendance(room, createEventRef.current, 'leave').catch(() => undefined);
|
|
32
|
+
};
|
|
33
|
+
if (room.state === ConnectionState.Connected) {
|
|
34
|
+
announceJoin();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
room.on(RoomEvent.Connected, announceJoin);
|
|
38
|
+
}
|
|
39
|
+
return () => {
|
|
40
|
+
room.off(RoomEvent.Connected, announceJoin);
|
|
41
|
+
if (room.state === ConnectionState.Connected) {
|
|
42
|
+
announceLeave();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}, [observer, room]);
|
|
46
|
+
const scheduleReactionRemoval = useCallback((profileId, reactionId) => {
|
|
47
|
+
const existing = timeoutIdsRef.current.get(reactionId);
|
|
48
|
+
if (existing)
|
|
49
|
+
clearTimeout(existing);
|
|
50
|
+
const timeoutId = setTimeout(() => {
|
|
51
|
+
setParticipantReactions((current) => {
|
|
52
|
+
const next = { ...current };
|
|
53
|
+
next[profileId] = (next[profileId] ?? []).filter((reaction) => reaction.id !== reactionId);
|
|
54
|
+
if (next[profileId]?.length === 0) {
|
|
55
|
+
delete next[profileId];
|
|
56
|
+
}
|
|
57
|
+
return next;
|
|
58
|
+
});
|
|
59
|
+
setOwnReactions((current) => current.filter((reaction) => reaction.id !== reactionId));
|
|
60
|
+
timeoutIdsRef.current.delete(reactionId);
|
|
61
|
+
}, REACTION_DURATION_MS);
|
|
62
|
+
timeoutIdsRef.current.set(reactionId, timeoutId);
|
|
63
|
+
}, []);
|
|
64
|
+
const addReaction = useCallback((event) => {
|
|
65
|
+
if (event.type !== 'reaction' || !event.profileId)
|
|
66
|
+
return;
|
|
67
|
+
setParticipantReactions((current) => {
|
|
68
|
+
const existing = current[event.profileId] ?? [];
|
|
69
|
+
if (existing.some((reaction) => reaction.id === event.id)) {
|
|
70
|
+
return current;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
...current,
|
|
74
|
+
[event.profileId]: [...existing, event],
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
if (event.profileId === room.localParticipant.identity) {
|
|
78
|
+
setOwnReactions((current) => {
|
|
79
|
+
if (current.some((reaction) => reaction.id === event.id)) {
|
|
80
|
+
return current;
|
|
81
|
+
}
|
|
82
|
+
return [...current, event];
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
scheduleReactionRemoval(event.profileId, event.id);
|
|
86
|
+
}, [room.localParticipant.identity, scheduleReactionRemoval]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const onDataReceived = (payload) => {
|
|
89
|
+
const jamEvent = parseJamEventPayload(payload);
|
|
90
|
+
if (!jamEvent)
|
|
91
|
+
return;
|
|
92
|
+
setSessionEvents((events) => [...events, jamEvent]);
|
|
93
|
+
if (jamEvent.type === 'reaction') {
|
|
94
|
+
addReaction(jamEvent);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
room.on(RoomEvent.DataReceived, onDataReceived);
|
|
98
|
+
return () => {
|
|
99
|
+
room.off(RoomEvent.DataReceived, onDataReceived);
|
|
100
|
+
for (const timeoutId of timeoutIdsRef.current.values()) {
|
|
101
|
+
clearTimeout(timeoutId);
|
|
102
|
+
}
|
|
103
|
+
timeoutIdsRef.current.clear();
|
|
104
|
+
};
|
|
105
|
+
}, [room, addReaction]);
|
|
106
|
+
const sendMessage = useCallback(async (message) => {
|
|
107
|
+
if (observer || !message.trim())
|
|
108
|
+
return;
|
|
109
|
+
const event = await sendJamEvent(room, createEvent, 'message', message);
|
|
110
|
+
setSessionEvents((events) => [...events, event]);
|
|
111
|
+
}, [createEvent, observer, room]);
|
|
112
|
+
const sendReactionEmoji = useCallback(async (emoji) => {
|
|
113
|
+
if (observer)
|
|
114
|
+
return;
|
|
115
|
+
const event = await sendReaction(room, emoji, createEvent);
|
|
116
|
+
addReaction(event);
|
|
117
|
+
}, [addReaction, createEvent, observer, room]);
|
|
118
|
+
const reactionsForParticipant = useCallback((participantId) => participantReactions[participantId] ?? [], [participantReactions]);
|
|
119
|
+
const value = useMemo(() => ({
|
|
120
|
+
sessionEvents,
|
|
121
|
+
ownReactions,
|
|
122
|
+
reactionsForParticipant,
|
|
123
|
+
sendMessage,
|
|
124
|
+
sendReactionEmoji,
|
|
125
|
+
}), [
|
|
126
|
+
ownReactions,
|
|
127
|
+
reactionsForParticipant,
|
|
128
|
+
sendMessage,
|
|
129
|
+
sendReactionEmoji,
|
|
130
|
+
sessionEvents,
|
|
131
|
+
]);
|
|
132
|
+
return (_jsx(JamEventsContext.Provider, { value: value, children: children }));
|
|
133
|
+
}
|
|
134
|
+
export function useJamEventsContext() {
|
|
135
|
+
const ctx = useContext(JamEventsContext);
|
|
136
|
+
if (!ctx) {
|
|
137
|
+
throw new Error('useJamEventsContext must be used inside <JamEventsProvider>');
|
|
138
|
+
}
|
|
139
|
+
return ctx;
|
|
140
|
+
}
|
|
141
|
+
export function useMaybeJamEventsContext() {
|
|
142
|
+
return useContext(JamEventsContext);
|
|
143
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface JamFooterProps {
|
|
2
|
+
chatOpen: boolean;
|
|
3
|
+
onToggleChat: () => void;
|
|
4
|
+
peopleOpen: boolean;
|
|
5
|
+
onTogglePeople: () => void;
|
|
6
|
+
detailsOpen: boolean;
|
|
7
|
+
onToggleDetails: () => void;
|
|
8
|
+
speakerDeviceId?: string;
|
|
9
|
+
speakerEnabled: boolean;
|
|
10
|
+
onSpeakerChange: (deviceId: string) => void;
|
|
11
|
+
onToggleSpeaker: () => void;
|
|
12
|
+
blur: boolean;
|
|
13
|
+
onToggleBlur: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* In-room footer mirroring the Svelte `DesktopFooter` / `MobileFooter` split.
|
|
17
|
+
*/
|
|
18
|
+
export declare const JamFooter: ({ chatOpen, onToggleChat, peopleOpen, onTogglePeople, detailsOpen, onToggleDetails, speakerDeviceId, speakerEnabled, onSpeakerChange, onToggleSpeaker, blur, onToggleBlur, }: JamFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useParticipants, useRoomContext, useTrackToggle, } from '@livekit/components-react';
|
|
4
|
+
import { Track } from 'livekit-client';
|
|
5
|
+
import { CircleEllipsis, CircleStop, Disc, Dot, Hand, Info, Laugh, MessageSquareText, ScreenShare, ScreenShareOff, UsersRound, } from 'lucide-react';
|
|
6
|
+
import { Blur, Button, SquareStop } from '@openpeepshq/react-ui';
|
|
7
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
8
|
+
import { subscribePushNotifications } from '../../push/index.js';
|
|
9
|
+
import { useT } from '../../i18n/index.js';
|
|
10
|
+
import { useServerInfo } from '../server-data/index.js';
|
|
11
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
12
|
+
import { useToast } from '../layout/ToastProvider.js';
|
|
13
|
+
import { useJamContext } from './JamContext.js';
|
|
14
|
+
import { useJamEventsContext } from './JamEventsContext.js';
|
|
15
|
+
import { useJamRecordingState } from './jamRecordingState.js';
|
|
16
|
+
import { JamAudioOutputSelector, JamCameraSelector, JamMicSelector, } from './JamDeviceSelectors.js';
|
|
17
|
+
import { JamReactionMenu } from './JamReactionMenu.js';
|
|
18
|
+
import { LeaveCloseButton } from './LeaveCloseButton.js';
|
|
19
|
+
import { toggleHand } from './jamEventActions.js';
|
|
20
|
+
import { useRaisedHands } from './useJamHands.js';
|
|
21
|
+
/** Shared business logic + data for both footer variants. */
|
|
22
|
+
const useFooterControls = () => {
|
|
23
|
+
const t = useT();
|
|
24
|
+
const room = useRoomContext();
|
|
25
|
+
const me = useCurrentProfile();
|
|
26
|
+
const serverInfo = useServerInfo();
|
|
27
|
+
const { jam, jamPost } = useJamContext();
|
|
28
|
+
const { openpeepsApi, client } = useOpenpeeps();
|
|
29
|
+
const { sendReactionEmoji } = useJamEventsContext();
|
|
30
|
+
const participants = useParticipants();
|
|
31
|
+
const raisedHands = useRaisedHands(room);
|
|
32
|
+
// Entering the jam room is a strong signal the user wants live updates, so
|
|
33
|
+
// opportunistically register push notifications, mirroring the Svelte
|
|
34
|
+
// `DesktopFooter` onMount subscription.
|
|
35
|
+
const vapidKey = serverInfo.vapid.publicKey;
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
void subscribePushNotifications({ client, applicationServerKey: vapidKey });
|
|
38
|
+
}, [client, vapidKey]);
|
|
39
|
+
const { success: toastSuccess, error: toastError } = useToast();
|
|
40
|
+
const isModerator = !!me && jam.moderators.includes(me.id);
|
|
41
|
+
const { isRecording } = useJamRecordingState();
|
|
42
|
+
const handRaised = raisedHands.has(room.localParticipant.identity);
|
|
43
|
+
const recordingEnabled = serverInfo.jams.livekit.recordingEnabled;
|
|
44
|
+
const startRecording = openpeepsApi.startRecordingAction({ id: jamPost.id });
|
|
45
|
+
const stopRecording = openpeepsApi.stopRecordingAction({ id: jamPost.id });
|
|
46
|
+
const waitingRoom = openpeepsApi.useWaitingRoomStream(isModerator && jam.waitingRoom ? jamPost.id : '');
|
|
47
|
+
const [busy, setBusy] = useState(false);
|
|
48
|
+
const waitingRoomCount = isModerator && jam.waitingRoom && waitingRoom
|
|
49
|
+
? Object.keys(waitingRoom).length
|
|
50
|
+
: 0;
|
|
51
|
+
const toggleRecording = async () => {
|
|
52
|
+
setBusy(true);
|
|
53
|
+
try {
|
|
54
|
+
if (isRecording) {
|
|
55
|
+
const recording = await stopRecording();
|
|
56
|
+
toastSuccess(t('jams.recording.stopped', { id: recording.id }));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const recording = await startRecording();
|
|
60
|
+
toastSuccess(t('jams.recording.started', { id: recording.id }));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
toastError(isRecording
|
|
65
|
+
? t('jams.recording.stopError')
|
|
66
|
+
: t('jams.recording.startError'));
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
setBusy(false);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
t,
|
|
74
|
+
room,
|
|
75
|
+
isModerator,
|
|
76
|
+
isRecording,
|
|
77
|
+
recordingEnabled,
|
|
78
|
+
handRaised,
|
|
79
|
+
busy,
|
|
80
|
+
participantCount: participants.length,
|
|
81
|
+
waitingRoomCount,
|
|
82
|
+
sendReactionEmoji,
|
|
83
|
+
toggleRecording,
|
|
84
|
+
raiseHand: () => void toggleHand(room),
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/** Toolbar icon button mirroring Svelte `Button` with soft variants. */
|
|
88
|
+
const ToolbarButton = ({ title, active, className = '', onClick, children, }) => (_jsx(Button, { title: title, variant: active ? 'variant-soft-primary' : 'variant-soft-surface', className: `size-10 rounded-full p-2 ${className}`, action: onClick, children: children }));
|
|
89
|
+
/** Record control mirroring `RecordSwitch.svelte` (always red, Disc / SquareStop). */
|
|
90
|
+
const RecordButton = ({ isRecording, busy, onToggle, t, className = '', }) => (_jsx("button", { type: "button", disabled: busy, title: isRecording
|
|
91
|
+
? t('jams.recording.stopTitle')
|
|
92
|
+
: t('events.recordingInProgress'), onClick: onToggle, className: `bg-error-500 text-on-primary-token flex size-10 items-center justify-center rounded-full p-2 ${className}`, children: isRecording ? _jsx(SquareStop, {}) : _jsx(Disc, {}) }));
|
|
93
|
+
/** People button with count badges mirroring Svelte `UserButton.svelte`. */
|
|
94
|
+
const UserButton = ({ active, count, waitingRoomCount, onToggle, t, }) => (_jsxs(Button, { title: t('jams.participant.showEveryone'), variant: active ? 'variant-soft-primary' : 'variant-soft-surface', className: "relative size-10 rounded-full p-2", action: onToggle, children: [_jsx("span", { className: "bg-surface-400 absolute -right-2 -top-2 size-6 rounded-full p-1 px-2 text-xs", children: count }), waitingRoomCount > 0 ? (_jsx("span", { className: "bg-surface-400 absolute -bottom-2 -right-2 size-6 rounded-full p-1 px-2 text-xs", children: waitingRoomCount })) : null, _jsx(UsersRound, {})] }));
|
|
95
|
+
/** Chat toggle with unread dot mirroring `ChatDrawerButton.svelte`. */
|
|
96
|
+
const ChatButton = ({ active, onToggle, t, }) => {
|
|
97
|
+
const { sessionEvents } = useJamEventsContext();
|
|
98
|
+
const [lastSeenMessageId, setLastSeenMessageId] = useState('');
|
|
99
|
+
const [hasNewMessages, setHasNewMessages] = useState(false);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
const lastMessage = [...sessionEvents]
|
|
102
|
+
.reverse()
|
|
103
|
+
.find((event) => event.type === 'message');
|
|
104
|
+
if (!lastMessage || lastMessage.type !== 'message')
|
|
105
|
+
return;
|
|
106
|
+
if (active) {
|
|
107
|
+
setLastSeenMessageId(lastMessage.id);
|
|
108
|
+
setHasNewMessages(false);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (lastSeenMessageId && lastMessage.id > lastSeenMessageId) {
|
|
112
|
+
setHasNewMessages(true);
|
|
113
|
+
}
|
|
114
|
+
else if (!lastSeenMessageId) {
|
|
115
|
+
setLastSeenMessageId(lastMessage.id);
|
|
116
|
+
}
|
|
117
|
+
}, [sessionEvents, active, lastSeenMessageId]);
|
|
118
|
+
return (_jsxs(Button, { title: t('jams.chat.openEveryoneTitle'), variant: active ? 'variant-soft-primary' : 'variant-soft-surface', className: "relative size-10 rounded-full p-1", action: () => {
|
|
119
|
+
onToggle();
|
|
120
|
+
setHasNewMessages(false);
|
|
121
|
+
}, children: [_jsx(MessageSquareText, {}), hasNewMessages && !active ? (_jsx(Dot, { size: 13, className: "bg-error-500 text-error-500 absolute right-0 top-0 rounded-full" })) : null] }));
|
|
122
|
+
};
|
|
123
|
+
/** Screen share control mirroring `ScreenShareSwitch.svelte`. */
|
|
124
|
+
const ScreenShareButton = ({ closeMenu, t, mobile = false, }) => {
|
|
125
|
+
const { enabled, toggle } = useTrackToggle({
|
|
126
|
+
source: Track.Source.ScreenShare,
|
|
127
|
+
captureOptions: { audio: true },
|
|
128
|
+
});
|
|
129
|
+
const action = () => {
|
|
130
|
+
closeMenu?.();
|
|
131
|
+
void toggle();
|
|
132
|
+
};
|
|
133
|
+
if (mobile) {
|
|
134
|
+
return (_jsxs("button", { type: "button", className: "text-tertiary-500 flex flex-col items-center justify-center gap-y-2 p-2 md:hidden", onClick: action, children: [enabled ? _jsx(ScreenShareOff, {}) : _jsx(ScreenShare, {}), _jsx("span", { children: enabled
|
|
135
|
+
? t('jams.screenShare.stopScreenshareMobile')
|
|
136
|
+
: t('jams.screenShare.startScreenshareMobile') })] }));
|
|
137
|
+
}
|
|
138
|
+
return (_jsx(Button, { title: t('jams.screenShare.startStopTitle'), variant: enabled ? 'variant-soft-primary' : 'variant-soft-surface', className: "hidden size-10 rounded-full p-2 md:flex", action: action, children: enabled ? _jsx(ScreenShareOff, {}) : _jsx(ScreenShare, {}) }));
|
|
139
|
+
};
|
|
140
|
+
/** Mobile overflow menu mirroring `MobileMenu.svelte`. */
|
|
141
|
+
const MobileMenu = ({ isModerator, recordingEnabled, isRecording, busy, onClose, onOpenChat, onOpenPeople, onOpenDetails, onRaiseHand, onToggleRecording, t, }) => (_jsxs("div", { className: "bg-surface-100 text-foreground absolute bottom-20 left-2 right-2 z-50 grid grid-cols-3 rounded-md p-2", children: [_jsxs("button", { type: "button", className: "text-tertiary-500 flex flex-col items-center justify-center gap-y-2 p-2 md:hidden", onClick: () => {
|
|
142
|
+
onClose();
|
|
143
|
+
onOpenChat();
|
|
144
|
+
}, children: [_jsx(MessageSquareText, {}), _jsx("span", { children: t('jams.mobileMenu.inJamMessage') })] }), _jsxs("button", { type: "button", className: "text-tertiary-500 flex flex-col items-center justify-center gap-y-2 p-2 md:hidden", onClick: () => {
|
|
145
|
+
onClose();
|
|
146
|
+
onOpenDetails();
|
|
147
|
+
}, children: [_jsx(Info, {}), _jsx("span", { children: t('jams.mobileMenu.jamDetails') })] }), _jsx(ScreenShareButton, { closeMenu: onClose, t: t, mobile: true }), _jsxs("button", { type: "button", className: "text-tertiary-500 flex flex-col items-center justify-center gap-y-2 p-2 md:hidden", onClick: () => {
|
|
148
|
+
onClose();
|
|
149
|
+
onRaiseHand();
|
|
150
|
+
}, children: [_jsx(Hand, {}), _jsx("span", { children: t('jams.hand.raiseLabel') })] }), _jsxs("button", { type: "button", className: "text-tertiary-500 flex flex-col items-center justify-center gap-y-2 p-2 md:hidden", onClick: () => {
|
|
151
|
+
onClose();
|
|
152
|
+
onOpenPeople();
|
|
153
|
+
}, children: [_jsx(UsersRound, {}), _jsx("span", { children: t('jams.mobileMenu.people') })] }), isModerator && recordingEnabled ? (_jsxs("button", { type: "button", disabled: busy, className: "text-tertiary-500 flex flex-col items-center justify-center gap-y-2 p-2 md:hidden", onClick: () => {
|
|
154
|
+
onClose();
|
|
155
|
+
onToggleRecording();
|
|
156
|
+
}, children: [isRecording ? _jsx(CircleStop, {}) : _jsx(Disc, {}), _jsx("span", { children: isRecording
|
|
157
|
+
? t('jams.recording.stopTitle')
|
|
158
|
+
: t('events.recordingInProgress') })] })) : null] }));
|
|
159
|
+
/**
|
|
160
|
+
* In-room footer mirroring the Svelte `DesktopFooter` / `MobileFooter` split.
|
|
161
|
+
*/
|
|
162
|
+
export const JamFooter = ({ chatOpen, onToggleChat, peopleOpen, onTogglePeople, detailsOpen, onToggleDetails, speakerDeviceId, speakerEnabled, onSpeakerChange, onToggleSpeaker, blur, onToggleBlur, }) => {
|
|
163
|
+
const { t, isModerator, isRecording, recordingEnabled, handRaised, busy, participantCount, waitingRoomCount, sendReactionEmoji, toggleRecording, raiseHand, } = useFooterControls();
|
|
164
|
+
const { jamEvent } = useJamContext();
|
|
165
|
+
const [reactionMenuOpen, setReactionMenuOpen] = useState(false);
|
|
166
|
+
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
|
167
|
+
const handleEmojiSelect = async (emoji) => {
|
|
168
|
+
await sendReactionEmoji(emoji);
|
|
169
|
+
};
|
|
170
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "hidden w-full flex-none items-center justify-between px-4 py-3 md:flex", children: [_jsx("h1", { className: "truncate pr-2", children: jamEvent.name }), _jsxs("div", { className: "relative flex items-center gap-x-4", children: [reactionMenuOpen ? (_jsx("div", { className: "absolute bottom-12 right-0 z-50 md:w-max", children: _jsx(JamReactionMenu, { onSelect: handleEmojiSelect }) })) : null, _jsx(JamMicSelector, {}), _jsx(JamCameraSelector, {}), _jsx(JamAudioOutputSelector, { speakerDeviceId: speakerDeviceId, speakerEnabled: speakerEnabled, onSpeakerChange: onSpeakerChange, onToggleSpeaker: onToggleSpeaker }), isModerator && recordingEnabled ? (_jsx(RecordButton, { isRecording: isRecording, busy: busy, onToggle: () => void toggleRecording(), t: t })) : null, _jsx(ToolbarButton, { title: blur ? t('jams.blur.turnOff') : t('jams.blur.blurBackground'), active: blur, onClick: onToggleBlur, children: _jsx(Blur, {}) }), _jsx(ToolbarButton, { title: t('jams.hand.raiseTitle'), active: handRaised, onClick: raiseHand, children: _jsx(Hand, {}) }), _jsx(ScreenShareButton, { t: t }), _jsx(ToolbarButton, { title: t('jams.reactions.sendTitle'), active: reactionMenuOpen, onClick: () => setReactionMenuOpen((open) => !open), children: _jsx(Laugh, {}) }), _jsx(ChatButton, { active: chatOpen, onToggle: onToggleChat, t: t })] }), _jsxs("div", { className: "relative flex items-center gap-x-4", children: [_jsx(ToolbarButton, { title: t('jams.mobileMenu.jamDetails'), active: detailsOpen, onClick: onToggleDetails, children: _jsx(Info, {}) }), _jsx(UserButton, { active: peopleOpen, count: participantCount, waitingRoomCount: waitingRoomCount, onToggle: onTogglePeople, t: t }), _jsx(LeaveCloseButton, {})] })] }), _jsxs("div", { className: "bg-surface-50/75 fixed bottom-0 flex w-full items-center justify-between gap-x-2 px-2 py-3 md:hidden", children: [reactionMenuOpen ? (_jsx("div", { className: "absolute bottom-20 right-[7%] z-50 mt-2 w-[90%] rounded-md p-2", children: _jsx(JamReactionMenu, { onSelect: handleEmojiSelect, mobile: true }) })) : null, mobileMenuOpen ? (_jsx(MobileMenu, { isModerator: isModerator, recordingEnabled: recordingEnabled, isRecording: isRecording, busy: busy, onClose: () => setMobileMenuOpen(false), onOpenChat: onToggleChat, onOpenPeople: onTogglePeople, onOpenDetails: onToggleDetails, onRaiseHand: raiseHand, onToggleRecording: () => void toggleRecording(), t: t })) : null, _jsx(JamMicSelector, {}), _jsx(JamCameraSelector, {}), _jsx(JamAudioOutputSelector, { speakerDeviceId: speakerDeviceId, speakerEnabled: speakerEnabled, onSpeakerChange: onSpeakerChange, onToggleSpeaker: onToggleSpeaker }), _jsx("button", { type: "button", title: t('jams.reactions.sendTitle'), onClick: () => setReactionMenuOpen((open) => !open), className: `text-on-primary-token flex items-center justify-center rounded-full p-2 ${reactionMenuOpen ? 'bg-primary-500' : 'bg-surface-400'}`, children: _jsx(Laugh, {}) }), _jsx("button", { type: "button", title: t('jams.drawer.jamControls'), onClick: () => setMobileMenuOpen((open) => !open), className: "bg-surface-400 text-on-primary-token flex items-center justify-center rounded-full p-2", children: _jsx(CircleEllipsis, {}) }), _jsx(LeaveCloseButton, {})] })] }));
|
|
171
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function JamGuestForm(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { profileName } from '@openpeepshq/common/lib';
|
|
4
|
+
import { Button, Input, Label } from '@openpeepshq/react-ui';
|
|
5
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
6
|
+
import { useT } from '../../i18n/index.js';
|
|
7
|
+
import { useServerInfo } from '../server-data/context.js';
|
|
8
|
+
import { useJamContext } from './JamContext.js';
|
|
9
|
+
export function JamGuestForm() {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const serverInfo = useServerInfo();
|
|
12
|
+
const { jamPost, jamEvent } = useJamContext();
|
|
13
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
14
|
+
const guestPass = openpeepsApi.guestPassAction();
|
|
15
|
+
const [guestData, setGuestData] = useState({
|
|
16
|
+
displayName: '',
|
|
17
|
+
email: '',
|
|
18
|
+
});
|
|
19
|
+
const [submitting, setSubmitting] = useState(false);
|
|
20
|
+
const [error, setError] = useState(null);
|
|
21
|
+
const termsLink = serverInfo.communityConfig?.info?.termsAndConditions ??
|
|
22
|
+
'/docs/terms-and-conditions';
|
|
23
|
+
const submit = async () => {
|
|
24
|
+
setError(null);
|
|
25
|
+
setSubmitting(true);
|
|
26
|
+
try {
|
|
27
|
+
await guestPass({
|
|
28
|
+
...guestData,
|
|
29
|
+
resource: { type: 'jams', id: jamPost.id },
|
|
30
|
+
});
|
|
31
|
+
window.location.reload();
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
setError(err.message);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
setSubmitting(false);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return (_jsx("div", { className: "mx-auto flex h-full w-full max-w-md items-center justify-center p-4", children: _jsxs("div", { className: "bg-card w-full space-y-4 rounded-md border p-6", children: [_jsxs("div", { className: "text-center", children: [_jsxs("h2", { className: "text-xl font-semibold", children: [jamEvent.name, " \u2014 ", profileName(jamPost.profile)] }), _jsx("p", { className: "text-muted-foreground mt-2 text-sm", children: t('jams.lobby.guestIntro', {
|
|
41
|
+
defaultValue: 'Enter your details to join as a guest.',
|
|
42
|
+
}) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "guest-name", children: t('jams.lobby.guestFullNameLabel', { defaultValue: 'Full name' }) }), _jsx(Input, { id: "guest-name", value: guestData.displayName, onChange: (e) => setGuestData((d) => ({ ...d, displayName: e.target.value })), placeholder: t('jams.lobby.guestFullNamePlaceholder', {
|
|
43
|
+
defaultValue: 'Your name',
|
|
44
|
+
}) })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "guest-email", children: t('jams.lobby.guestEmailLabel', { defaultValue: 'Email' }) }), _jsx(Input, { id: "guest-email", type: "email", value: guestData.email, onChange: (e) => setGuestData((d) => ({ ...d, email: e.target.value })), placeholder: t('jams.lobby.guestEmailPlaceholder', {
|
|
45
|
+
defaultValue: 'you@example.com',
|
|
46
|
+
}) })] }), _jsxs("p", { className: "text-muted-foreground text-sm", children: [t('jams.lobby.guestTermsAgreePrefix', {
|
|
47
|
+
defaultValue: 'By continuing you agree to the',
|
|
48
|
+
}), ' ', _jsx("a", { href: termsLink, className: "anchor", target: "_blank", rel: "noreferrer", children: t('navigation.termsAndConditions', {
|
|
49
|
+
defaultValue: 'terms and conditions',
|
|
50
|
+
}) }), "."] }), error ? (_jsx("p", { className: "border-error/40 text-error rounded-md border p-2 text-sm", children: error })) : null, _jsx(Button, { variant: "variant-filled-primary", action: submit, disabled: submitting ||
|
|
51
|
+
!guestData.displayName.trim() ||
|
|
52
|
+
!guestData.email.trim(), className: "w-full", children: submitting
|
|
53
|
+
? t('common.submitting', { defaultValue: 'Submitting…' })
|
|
54
|
+
: t('jams.lobby.guestContinue', { defaultValue: 'Continue' }) })] }) }));
|
|
55
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type LocalUserChoices } from '@livekit/components-react';
|
|
2
|
+
export interface JamLobbyProps {
|
|
3
|
+
/** Called once the user has picked devices and the join token has been obtained. */
|
|
4
|
+
onJoin: (params: {
|
|
5
|
+
token: string;
|
|
6
|
+
livekitUrl: string;
|
|
7
|
+
choices: LocalUserChoices;
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Pre-room screen. Guests without a jam-scoped pass see {@link JamGuestForm};
|
|
12
|
+
* authenticated users get a device-selection card that mirrors the Svelte
|
|
13
|
+
* lobby (`lobby/Lobby.svelte` + `DeviceSelectionForm.svelte`): a centered card
|
|
14
|
+
* with a square camera preview, mic/camera controls, and a join button. The
|
|
15
|
+
* preview tracks and device lists come from `@livekit/components-react`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function JamLobby({ onJoin }: JamLobbyProps): import("react/jsx-runtime").JSX.Element;
|