@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,159 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { Mic, MicOff, Video, VideoOff, Volume2, X } from 'lucide-react';
|
|
4
|
+
import { useMediaDevices, usePreviewTracks, } from '@livekit/components-react';
|
|
5
|
+
import { Track } from 'livekit-client';
|
|
6
|
+
import { profileName } from '@openpeepshq/common/lib';
|
|
7
|
+
import { Blur, Button } from '@openpeepshq/react-ui';
|
|
8
|
+
import { useNavigate } from '../../contexts/router/index.js';
|
|
9
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
10
|
+
import { useT } from '../../i18n/index.js';
|
|
11
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
12
|
+
import { useJamContext } from './JamContext.js';
|
|
13
|
+
import { JamGuestForm } from './JamGuestForm.js';
|
|
14
|
+
import { useJamLocalSettings } from './jamLocalSettings.js';
|
|
15
|
+
import { apiErrorMessage } from '../../lib/apiErrorMessage.js';
|
|
16
|
+
function canAccessJamLobby(profile, jamPostId) {
|
|
17
|
+
if (!profile)
|
|
18
|
+
return false;
|
|
19
|
+
if (profile.type === 'local')
|
|
20
|
+
return true;
|
|
21
|
+
return (profile.guestData?.resource?.type === 'jams' &&
|
|
22
|
+
profile.guestData.resource.id === jamPostId);
|
|
23
|
+
}
|
|
24
|
+
/** Pill mirroring the Svelte "selector and switch" controls (toggle + device list). */
|
|
25
|
+
function DeviceControl({ enabled, onToggle, onLabel, offLabel, OnIcon, OffIcon, devices, deviceId, onDeviceChange, iconOnly = false, }) {
|
|
26
|
+
return (_jsxs("div", { className: "bg-surface-100 flex items-center gap-1 rounded-full border p-1", children: [_jsx("button", { type: "button", title: enabled ? offLabel : onLabel, onClick: onToggle, className: `flex size-9 items-center justify-center rounded-full ${enabled ? '' : 'bg-surface-200'}`, children: enabled ? (_jsx(OnIcon, { className: "size-4" })) : (_jsx(OffIcon, { className: "size-4" })) }), !iconOnly && devices.length > 1 ? (_jsxs("select", { value: deviceId, onChange: (e) => onDeviceChange(e.target.value), className: "max-w-[6rem] truncate bg-transparent pr-1 text-xs outline-none", children: [_jsx("option", { value: "", children: onLabel }), devices.map((device, index) => (_jsx("option", { value: device.deviceId, children: device.label || `${index + 1}` }, device.deviceId)))] })) : null] }));
|
|
27
|
+
}
|
|
28
|
+
/** Speaker (audio output) selector for the lobby. Icon-only: the chosen device
|
|
29
|
+
* is persisted and applied to the room's audio output on join, and there is no
|
|
30
|
+
* on/off toggle since no audio is playing pre-room. */
|
|
31
|
+
function SpeakerControl({ label }) {
|
|
32
|
+
return (_jsx("div", { className: "bg-surface-100 flex items-center gap-1 rounded-full border p-1", children: _jsx("span", { title: label, className: "flex size-9 items-center justify-center rounded-full", children: _jsx(Volume2, { className: "size-4" }) }) }));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Pre-room screen. Guests without a jam-scoped pass see {@link JamGuestForm};
|
|
36
|
+
* authenticated users get a device-selection card that mirrors the Svelte
|
|
37
|
+
* lobby (`lobby/Lobby.svelte` + `DeviceSelectionForm.svelte`): a centered card
|
|
38
|
+
* with a square camera preview, mic/camera controls, and a join button. The
|
|
39
|
+
* preview tracks and device lists come from `@livekit/components-react`.
|
|
40
|
+
*/
|
|
41
|
+
export function JamLobby({ onJoin }) {
|
|
42
|
+
const t = useT();
|
|
43
|
+
const navigate = useNavigate();
|
|
44
|
+
const me = useCurrentProfile();
|
|
45
|
+
const { jamPost, jamEvent } = useJamContext();
|
|
46
|
+
const { client, openpeepsApi } = useOpenpeeps();
|
|
47
|
+
const jamStateQuery = openpeepsApi.useJamState(jamPost.id);
|
|
48
|
+
const jamActive = !!jamStateQuery.data?.active;
|
|
49
|
+
const [settings, updateSettings] = useJamLocalSettings();
|
|
50
|
+
const [audioEnabled, setAudioEnabled] = useState(true);
|
|
51
|
+
const [videoEnabled, setVideoEnabled] = useState(false);
|
|
52
|
+
const [audioDeviceId, setAudioDeviceId] = useState('');
|
|
53
|
+
const [videoDeviceId, setVideoDeviceId] = useState('');
|
|
54
|
+
const [error, setError] = useState();
|
|
55
|
+
const [submitting, setSubmitting] = useState(false);
|
|
56
|
+
const videoRef = useRef(null);
|
|
57
|
+
const audioDevices = useMediaDevices({ kind: 'audioinput' });
|
|
58
|
+
const videoDevices = useMediaDevices({ kind: 'videoinput' });
|
|
59
|
+
// Video preview only — mic state is persisted for join but not acquired here,
|
|
60
|
+
// mirroring Svelte's separate CameraSelectorAndSwitch track management.
|
|
61
|
+
const trackOptions = useMemo(() => ({
|
|
62
|
+
audio: false,
|
|
63
|
+
video: videoEnabled
|
|
64
|
+
? videoDeviceId
|
|
65
|
+
? { deviceId: videoDeviceId }
|
|
66
|
+
: true
|
|
67
|
+
: false,
|
|
68
|
+
}), [videoEnabled, videoDeviceId]);
|
|
69
|
+
const onPreviewError = useCallback((err) => {
|
|
70
|
+
setError(err.message);
|
|
71
|
+
}, []);
|
|
72
|
+
const tracks = usePreviewTracks(trackOptions, onPreviewError);
|
|
73
|
+
const videoTrack = tracks?.find((track) => track.kind === Track.Kind.Video);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const el = videoRef.current;
|
|
76
|
+
if (!videoTrack || !el)
|
|
77
|
+
return;
|
|
78
|
+
videoTrack.attach(el);
|
|
79
|
+
return () => {
|
|
80
|
+
videoTrack.detach(el);
|
|
81
|
+
};
|
|
82
|
+
}, [videoTrack]);
|
|
83
|
+
// Apply / remove the greenscreen blur on the preview track to mirror Svelte's
|
|
84
|
+
// lobby `BlurSwitch`.
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!videoTrack)
|
|
87
|
+
return;
|
|
88
|
+
let cancelled = false;
|
|
89
|
+
if (settings.blur) {
|
|
90
|
+
void import('./blurProcessor.js').then(({ createBlurProcessor }) => {
|
|
91
|
+
if (cancelled)
|
|
92
|
+
return;
|
|
93
|
+
void videoTrack
|
|
94
|
+
.setProcessor(createBlurProcessor())
|
|
95
|
+
.catch(() => undefined);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
void videoTrack.stopProcessor().catch(() => undefined);
|
|
100
|
+
}
|
|
101
|
+
return () => {
|
|
102
|
+
cancelled = true;
|
|
103
|
+
};
|
|
104
|
+
}, [videoTrack, settings.blur]);
|
|
105
|
+
const showVideo = videoTrack?.mediaStreamTrack?.readyState === 'live';
|
|
106
|
+
if (!canAccessJamLobby(me, jamPost.id)) {
|
|
107
|
+
return _jsx(JamGuestForm, {});
|
|
108
|
+
}
|
|
109
|
+
const exitLobby = () => {
|
|
110
|
+
if (window.confirm(t('jams.lobby.exitLobbyBody', { defaultValue: '' }))) {
|
|
111
|
+
navigate('/jams');
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const handleJoin = async () => {
|
|
115
|
+
setSubmitting(true);
|
|
116
|
+
setError(undefined);
|
|
117
|
+
try {
|
|
118
|
+
const res = await client.jams.token({
|
|
119
|
+
pathParameters: { id: jamPost.id },
|
|
120
|
+
});
|
|
121
|
+
if ('error' in res) {
|
|
122
|
+
setError(apiErrorMessage(res.error, t, t('jams.lobby.tokenError', {
|
|
123
|
+
defaultValue: 'Failed to get jam token',
|
|
124
|
+
})));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const { token, livekitUrl } = res.data;
|
|
128
|
+
onJoin({
|
|
129
|
+
token,
|
|
130
|
+
livekitUrl,
|
|
131
|
+
choices: {
|
|
132
|
+
username: (me ? profileName(me) : '') ?? '',
|
|
133
|
+
audioEnabled,
|
|
134
|
+
videoEnabled,
|
|
135
|
+
audioDeviceId,
|
|
136
|
+
videoDeviceId,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
setError(apiErrorMessage(err, t, t('jams.lobby.tokenError', {
|
|
142
|
+
defaultValue: 'Failed to get jam token',
|
|
143
|
+
})));
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
setSubmitting(false);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return (_jsx("div", { className: "mx-auto flex h-full w-full max-w-lg items-center justify-center p-4", children: _jsxs("div", { className: "bg-surface-50 w-full rounded-md border p-4", children: [_jsxs("div", { className: "flex items-center justify-between border-b p-2", children: [_jsx("h2", { className: "text-lg", children: t('jams.lobby.readyTitle', { defaultValue: 'Ready to join' }) }), _jsx("button", { type: "button", title: t('jams.exit.title', { defaultValue: 'Leave' }), className: "bg-surface-200 flex size-8 items-center justify-center rounded-full", onClick: exitLobby, children: _jsx(X, { className: "size-4" }) })] }), _jsxs("div", { className: "flex flex-col items-center p-5", children: [_jsx("h2", { className: "my-1 text-center text-lg", children: jamEvent.name ||
|
|
150
|
+
t('jams.lobby.fallbackTitle', { defaultValue: 'Jam' }) }), _jsxs("div", { className: "relative size-64", children: [_jsx("video", { ref: videoRef, autoPlay: true, playsInline: true, muted: true, className: `size-64 rounded-xl object-cover ${showVideo ? '' : 'hidden'}` }), !showVideo ? (_jsx("div", { className: "bg-surface-100 flex size-64 items-center justify-center rounded-xl", children: _jsx("p", { className: "text-lg", children: t('jams.lobby.cameraOff', { defaultValue: 'Camera is off' }) }) })) : null] }), _jsxs("div", { className: "mt-4 flex w-full justify-center gap-2", children: [_jsx(DeviceControl, { enabled: audioEnabled, onToggle: () => setAudioEnabled((on) => !on), onLabel: `${t('jams.device.turnOn', { defaultValue: 'Turn on' })} ${t('jams.device.microphone', { defaultValue: 'microphone' })}`, offLabel: `${t('jams.device.turnOff', { defaultValue: 'Turn off' })} ${t('jams.device.microphone', { defaultValue: 'microphone' })}`, OnIcon: Mic, OffIcon: MicOff, devices: audioDevices, deviceId: audioDeviceId, onDeviceChange: setAudioDeviceId, iconOnly: true }), _jsx(SpeakerControl, { label: t('jams.device.defaultSpeaker', {
|
|
151
|
+
defaultValue: 'Default Speaker',
|
|
152
|
+
}) }), _jsx(DeviceControl, { enabled: videoEnabled, onToggle: () => setVideoEnabled((on) => !on), onLabel: `${t('jams.device.turnOn', { defaultValue: 'Turn on' })} ${t('jams.device.camera', { defaultValue: 'camera' })}`, offLabel: `${t('jams.device.turnOff', { defaultValue: 'Turn off' })} ${t('jams.device.camera', { defaultValue: 'camera' })}`, OnIcon: Video, OffIcon: VideoOff, devices: videoDevices, deviceId: videoDeviceId, onDeviceChange: setVideoDeviceId }), _jsx("button", { type: "button", title: settings.blur
|
|
153
|
+
? t('jams.blur.turnOff', { defaultValue: 'Turn off blur' })
|
|
154
|
+
: t('jams.blur.blurBackground', {
|
|
155
|
+
defaultValue: 'Blur background',
|
|
156
|
+
}), onClick: () => updateSettings({ blur: !settings.blur }), className: `flex size-11 items-center justify-center rounded-full border ${settings.blur ? 'bg-primary text-primary-foreground' : 'bg-surface-100'}`, children: _jsx(Blur, { className: "size-4" }) })] })] }), _jsxs("div", { className: "flex w-full flex-col items-center px-5 pb-4", children: [_jsx(Button, { variant: "variant-filled-primary", title: t('jams.join.submit', { defaultValue: 'Join Jam' }), loading: submitting, action: handleJoin, className: "rounded-full", children: jamActive
|
|
157
|
+
? t('jams.join.ctaJoin', { defaultValue: 'Join' })
|
|
158
|
+
: t('jams.join.ctaStart', { defaultValue: 'Start' }) }), error ? (_jsx("div", { role: "alert", className: "text-destructive mt-3 text-sm", children: error })) : null] })] }) }));
|
|
159
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface JamObserverShellProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/** Observer layout wrapper with read-only persisted chat drawer. */
|
|
6
|
+
export declare function JamObserverShell({ children }: JamObserverShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { MessageSquare } from 'lucide-react';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { JamChatDrawer } from './JamChatDrawer.js';
|
|
6
|
+
/** Observer layout wrapper with read-only persisted chat drawer. */
|
|
7
|
+
export function JamObserverShell({ children }) {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const [chatOpen, setChatOpen] = useState(false);
|
|
10
|
+
return (_jsxs("div", { className: "relative flex h-screen w-screen flex-1 overflow-hidden", children: [_jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: children }), _jsx("div", { className: "absolute bottom-4 right-4 z-20", children: _jsx("button", { type: "button", title: t('jams.drawer.chatTitle', { defaultValue: 'Chat' }), className: `lk-button ${chatOpen ? 'lk-button-active' : ''}`, onClick: () => setChatOpen((open) => !open), children: _jsx(MessageSquare, { className: "size-5" }) }) }), _jsx(JamChatDrawer, { open: chatOpen, onClose: () => setChatOpen(false), readOnly: true })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-call participant UI mirroring the Svelte `VideoCall`: a full-screen column
|
|
3
|
+
* with network/recording indicators, a mode-based participant layout (alone /
|
|
4
|
+
* one-on-one / grid / screen-sharing), an optional side drawer (chat or people)
|
|
5
|
+
* and the responsive footer toolbar.
|
|
6
|
+
*/
|
|
7
|
+
export declare function JamParticipantConference(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { ConnectionStateToast, RoomAudioRenderer, isTrackReference, useLocalParticipant, useRoomContext, useTracks, } from '@livekit/components-react';
|
|
4
|
+
import { LocalVideoTrack, Track } from 'livekit-client';
|
|
5
|
+
import { truncateText } from '@openpeepshq/common';
|
|
6
|
+
import { JamChatDrawer } from './JamChatDrawer.js';
|
|
7
|
+
import { JamDetailsDrawer } from './JamDetailsDrawer.js';
|
|
8
|
+
import { useJamContext } from './JamContext.js';
|
|
9
|
+
import { JamEventsProvider } from './JamEventsContext.js';
|
|
10
|
+
import { audioOutputSupported } from './constants.js';
|
|
11
|
+
import { JamFooter } from './JamFooter.js';
|
|
12
|
+
import { JamPeopleDrawer } from './JamPeopleDrawer.js';
|
|
13
|
+
import { JamNetworkQuality, JamRecordingIndicator } from './JamRoomIndicators.js';
|
|
14
|
+
import { JamVideoLayout } from './JamVideoLayout.js';
|
|
15
|
+
import { useJamLocalSettings } from './jamLocalSettings.js';
|
|
16
|
+
function JamParticipantConferenceInner() {
|
|
17
|
+
const room = useRoomContext();
|
|
18
|
+
const { jamEvent } = useJamContext();
|
|
19
|
+
const [drawer, setDrawer] = useState(null);
|
|
20
|
+
const [settings, updateSettings] = useJamLocalSettings();
|
|
21
|
+
const { cameraTrack } = useLocalParticipant();
|
|
22
|
+
const tracks = useTracks([
|
|
23
|
+
{ source: Track.Source.Camera, withPlaceholder: true },
|
|
24
|
+
{ source: Track.Source.ScreenShare, withPlaceholder: false },
|
|
25
|
+
], { onlySubscribed: false });
|
|
26
|
+
const cameraTracks = tracks.filter((track) => track.source === Track.Source.Camera);
|
|
27
|
+
const screenShareTracks = tracks.filter((track) => isTrackReference(track) &&
|
|
28
|
+
track.publication.source === Track.Source.ScreenShare &&
|
|
29
|
+
!track.publication.isMuted);
|
|
30
|
+
// Apply the speaker chosen in the lobby once we are in the room.
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!settings.speakerDeviceId || !audioOutputSupported)
|
|
33
|
+
return;
|
|
34
|
+
void room
|
|
35
|
+
.switchActiveDevice('audiooutput', settings.speakerDeviceId, true)
|
|
36
|
+
.catch(() => undefined);
|
|
37
|
+
// Only re-apply when the room changes, not on every settings update.
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
}, [room]);
|
|
40
|
+
// Mute/unmute remote audio mirroring Svelte's speaker toggle.
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
document.querySelectorAll('audio').forEach((audio) => {
|
|
43
|
+
audio.muted = !settings.speakerEnabled;
|
|
44
|
+
if (settings.speakerEnabled)
|
|
45
|
+
audio.volume = 1;
|
|
46
|
+
});
|
|
47
|
+
}, [settings.speakerEnabled]);
|
|
48
|
+
// Keep the published camera track's blur processor in sync with the setting,
|
|
49
|
+
// mirroring the Svelte `switchBackground` behaviour.
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const track = cameraTrack?.track;
|
|
52
|
+
if (!(track instanceof LocalVideoTrack))
|
|
53
|
+
return;
|
|
54
|
+
let cancelled = false;
|
|
55
|
+
if (settings.blur) {
|
|
56
|
+
void import('./blurProcessor.js').then(({ createBlurProcessor }) => {
|
|
57
|
+
if (cancelled)
|
|
58
|
+
return;
|
|
59
|
+
void track.setProcessor(createBlurProcessor()).catch(() => undefined);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
void track.stopProcessor().catch(() => undefined);
|
|
64
|
+
}
|
|
65
|
+
return () => {
|
|
66
|
+
cancelled = true;
|
|
67
|
+
};
|
|
68
|
+
}, [cameraTrack, settings.blur]);
|
|
69
|
+
const toggleDrawer = (next) => setDrawer((current) => (current === next ? null : next));
|
|
70
|
+
return (_jsxs("div", { className: "bg-surface-50 relative flex h-screen w-screen flex-col overflow-hidden", children: [_jsx(JamNetworkQuality, {}), _jsx(JamRecordingIndicator, {}), _jsxs("div", { className: "relative flex w-full flex-1 overflow-hidden p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "flex items-center md:hidden", children: _jsx("h1", { className: "font-semibold", title: jamEvent.name, children: truncateText(jamEvent.name, 40) }) }), _jsx(JamVideoLayout, { cameraTracks: cameraTracks, screenShareTracks: screenShareTracks, observer: false })] }), _jsxs("div", { className: "max-h-full overflow-y-auto md:flex-shrink-0", children: [_jsx(JamChatDrawer, { open: drawer === 'chat', onClose: () => setDrawer(null) }), _jsx(JamPeopleDrawer, { open: drawer === 'people', onClose: () => setDrawer(null) }), _jsx(JamDetailsDrawer, { open: drawer === 'details', onClose: () => setDrawer(null) })] })] }), _jsx("div", { className: "bg-surface-50 w-full flex-shrink-0 md:h-20 md:p-2", children: _jsx(JamFooter, { chatOpen: drawer === 'chat', onToggleChat: () => toggleDrawer('chat'), peopleOpen: drawer === 'people', onTogglePeople: () => toggleDrawer('people'), detailsOpen: drawer === 'details', onToggleDetails: () => toggleDrawer('details'), speakerDeviceId: settings.speakerDeviceId, speakerEnabled: settings.speakerEnabled, onSpeakerChange: (speakerDeviceId) => updateSettings({ speakerDeviceId }), onToggleSpeaker: () => updateSettings({ speakerEnabled: !settings.speakerEnabled }), blur: settings.blur, onToggleBlur: () => updateSettings({ blur: !settings.blur }) }) }), _jsx(ConnectionStateToast, {})] }));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* In-call participant UI mirroring the Svelte `VideoCall`: a full-screen column
|
|
74
|
+
* with network/recording indicators, a mode-based participant layout (alone /
|
|
75
|
+
* one-on-one / grid / screen-sharing), an optional side drawer (chat or people)
|
|
76
|
+
* and the responsive footer toolbar.
|
|
77
|
+
*/
|
|
78
|
+
export function JamParticipantConference() {
|
|
79
|
+
return (_jsxs(JamEventsProvider, { children: [_jsx(JamParticipantConferenceInner, {}), _jsx(RoomAudioRenderer, {})] }));
|
|
80
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface JamPeopleDrawerProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* In-room participants list with mic / raised-hand / moderator indicators, plus
|
|
7
|
+
* a moderator-only waiting-room admit section. Mirrors the Svelte
|
|
8
|
+
* `PeopleDrawer` (which folds in `JamWaitingCard`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function JamPeopleDrawer({ open, onClose }: JamPeopleDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { AudioLines, Hand, Mic, MicOff, Search, UserRoundCheck, X, } from 'lucide-react';
|
|
4
|
+
import { matchesQuery, profileName } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useParticipants, useRoomContext } from '@livekit/components-react';
|
|
6
|
+
import { Button, Input } from '@openpeepshq/react-ui';
|
|
7
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
8
|
+
import { useT } from '../../i18n/index.js';
|
|
9
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
10
|
+
import { Avatar } from '../profile/index.js';
|
|
11
|
+
import { useJamContext } from './JamContext.js';
|
|
12
|
+
import { parseParticipantMetadata } from './jamEventActions.js';
|
|
13
|
+
import { useRaisedHands } from './useJamHands.js';
|
|
14
|
+
/**
|
|
15
|
+
* In-room participants list with mic / raised-hand / moderator indicators, plus
|
|
16
|
+
* a moderator-only waiting-room admit section. Mirrors the Svelte
|
|
17
|
+
* `PeopleDrawer` (which folds in `JamWaitingCard`).
|
|
18
|
+
*/
|
|
19
|
+
export function JamPeopleDrawer({ open, onClose }) {
|
|
20
|
+
const t = useT();
|
|
21
|
+
const room = useRoomContext();
|
|
22
|
+
const me = useCurrentProfile();
|
|
23
|
+
const { jamPost, jam } = useJamContext();
|
|
24
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
25
|
+
const participants = useParticipants();
|
|
26
|
+
const raisedHands = useRaisedHands(room);
|
|
27
|
+
const isModerator = !!me && jam.moderators.includes(me.id);
|
|
28
|
+
const hasWaitingRoom = !!jam.waitingRoom;
|
|
29
|
+
const waitingRoom = openpeepsApi.useWaitingRoomStream(isModerator && hasWaitingRoom ? jamPost.id : '');
|
|
30
|
+
const admitParticipant = openpeepsApi.admitParticipantAction();
|
|
31
|
+
const [query, setQuery] = useState('');
|
|
32
|
+
const [admittingId, setAdmittingId] = useState(null);
|
|
33
|
+
const listedParticipants = useMemo(() => participants.filter((participant) => {
|
|
34
|
+
const metadata = parseParticipantMetadata(participant.metadata);
|
|
35
|
+
if (metadata.observer)
|
|
36
|
+
return false;
|
|
37
|
+
return !query || matchesQuery(metadata.profile, query);
|
|
38
|
+
}), [participants, query]);
|
|
39
|
+
const waitingProfiles = useMemo(() => {
|
|
40
|
+
if (!waitingRoom)
|
|
41
|
+
return [];
|
|
42
|
+
return Object.values(waitingRoom).filter((profile) => !!profile &&
|
|
43
|
+
typeof profile === 'object' &&
|
|
44
|
+
'id' in profile &&
|
|
45
|
+
(!query || matchesQuery(profile, query)));
|
|
46
|
+
}, [waitingRoom, query]);
|
|
47
|
+
if (!open)
|
|
48
|
+
return null;
|
|
49
|
+
const admit = async (profile) => {
|
|
50
|
+
setAdmittingId(profile.id);
|
|
51
|
+
try {
|
|
52
|
+
await admitParticipant({ id: jamPost.id, profileId: profile.id });
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setAdmittingId(null);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
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.drawer.peopleTitle', { defaultValue: 'People' }) }), _jsx("button", { type: "button", title: t('jams.drawer.close', { defaultValue: 'Close' }), className: "text-neutral-400", onClick: onClose, children: _jsx(X, {}) })] }), _jsx("div", { className: "px-2", children: _jsxs("div", { className: "relative", children: [_jsx(Search, { className: "text-muted-foreground absolute left-3 top-1/2 size-4 -translate-y-1/2" }), _jsx(Input, { className: "pl-9", value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('jams.drawer.searchPeoplePlaceholder', {
|
|
59
|
+
defaultValue: 'Search for people',
|
|
60
|
+
}) })] }) }), _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.people.inJam', { defaultValue: 'In jam' }) }), _jsxs("div", { className: "mt-1 flex flex-col gap-2", children: [listedParticipants.map((participant) => {
|
|
61
|
+
const profile = parseParticipantMetadata(participant.metadata).profile;
|
|
62
|
+
const handUp = raisedHands.has(participant.identity);
|
|
63
|
+
const micOn = participant.isMicrophoneEnabled;
|
|
64
|
+
const speaking = participant.isSpeaking;
|
|
65
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(Avatar, { profile: profile, size: 2 }), _jsx("span", { className: "truncate text-sm", children: (jam.moderators.includes(participant.identity)
|
|
66
|
+
? '* '
|
|
67
|
+
: '') +
|
|
68
|
+
(profile ? profileName(profile) : participant.identity) })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [handUp ? _jsx(Hand, { className: "size-4" }) : null, !micOn ? (_jsx(MicOff, { className: "text-muted-foreground size-4" })) : speaking ? (_jsx(AudioLines, { className: "text-primary size-4" })) : (_jsx(Mic, { className: "size-4" }))] })] }, participant.identity));
|
|
69
|
+
}), listedParticipants.length === 0 ? (_jsx("p", { className: "text-muted-foreground py-4 text-center text-sm", children: t('jams.people.noParticipants', {
|
|
70
|
+
defaultValue: 'No participants found',
|
|
71
|
+
}) })) : null] })] }), isModerator && hasWaitingRoom && waitingProfiles.length > 0 ? (_jsxs("div", { children: [_jsx("h4", { className: "text-muted-foreground text-xs font-semibold uppercase", children: t('jams.people.inWaitingRoom', {
|
|
72
|
+
defaultValue: 'In waiting room',
|
|
73
|
+
}) }), _jsx("div", { className: "mt-1 flex flex-col gap-2", children: waitingProfiles.map((profile) => (_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(Avatar, { profile: profile, size: 2 }), _jsx("span", { className: "truncate text-sm", children: profileName(profile) })] }), _jsx(Button, { variant: "variant-ringed-surface", compact: true, action: () => admit(profile), disabled: admittingId === profile.id, title: t('jams.waitingRoom.admitParticipant', {
|
|
74
|
+
defaultValue: 'Admit',
|
|
75
|
+
}), children: _jsx(UserRoundCheck, { className: "size-4" }) })] }, profile.id))) })] })) : null] })] }));
|
|
76
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface JamReactionMenuProps {
|
|
2
|
+
onSelect: (emoji: string) => void | Promise<void>;
|
|
3
|
+
mobile?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Reaction picker mirroring the Svelte `ReactionMenu`: a quick row of default
|
|
7
|
+
* emojis (with the preferred skin tone applied) and recently used emojis, a
|
|
8
|
+
* skin-tone selector, and an "all emojis" view backed by the
|
|
9
|
+
* `emoji-picker-element` web component. Preferences persist via
|
|
10
|
+
* {@link useJamReactionPreferences}.
|
|
11
|
+
*/
|
|
12
|
+
export declare function JamReactionMenu({ onSelect, mobile, }: JamReactionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { ChevronLeft, SmilePlus } from 'lucide-react';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { emojis } from './constants.js';
|
|
6
|
+
import { SKIN_TONE_OPTIONS, addRecentEmoji, applySkinToneToDefault, applySkinToneToRecentEmojis, getSkinToneEmoji, hideEmojiPickerSkinToneSelector, isDefaultEmoji, syncEmojiPickerSkinTone, } from './reactionEmojis.js';
|
|
7
|
+
import { useJamReactionPreferences } from './jamReactionPreferences.js';
|
|
8
|
+
/**
|
|
9
|
+
* Reaction picker mirroring the Svelte `ReactionMenu`: a quick row of default
|
|
10
|
+
* emojis (with the preferred skin tone applied) and recently used emojis, a
|
|
11
|
+
* skin-tone selector, and an "all emojis" view backed by the
|
|
12
|
+
* `emoji-picker-element` web component. Preferences persist via
|
|
13
|
+
* {@link useJamReactionPreferences}.
|
|
14
|
+
*/
|
|
15
|
+
export function JamReactionMenu({ onSelect, mobile = false, }) {
|
|
16
|
+
const t = useT();
|
|
17
|
+
const [preferences, updatePreferences] = useJamReactionPreferences();
|
|
18
|
+
const { skinTone, recentEmojis } = preferences;
|
|
19
|
+
const [showAllEmojis, setShowAllEmojis] = useState(false);
|
|
20
|
+
const [showSkinToneSelector, setShowSkinToneSelector] = useState(false);
|
|
21
|
+
const pickerRef = useRef(null);
|
|
22
|
+
const defaultEmojis = emojis.map((emoji) => applySkinToneToDefault(emoji, skinTone));
|
|
23
|
+
const recentDisplayEmojis = recentEmojis.filter((emoji) => !isDefaultEmoji(emoji));
|
|
24
|
+
const selectedSkinToneEmoji = getSkinToneEmoji(skinTone);
|
|
25
|
+
// Register the custom element and sync the preferred skin tone once.
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
let cancelled = false;
|
|
28
|
+
void import('emoji-picker-element').then(() => {
|
|
29
|
+
if (!cancelled)
|
|
30
|
+
void syncEmojiPickerSkinTone(skinTone);
|
|
31
|
+
});
|
|
32
|
+
return () => {
|
|
33
|
+
cancelled = true;
|
|
34
|
+
};
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
}, []);
|
|
37
|
+
const handlePickerEmojiClick = useCallback((event) => {
|
|
38
|
+
const emoji = event.detail?.unicode;
|
|
39
|
+
if (!emoji)
|
|
40
|
+
return;
|
|
41
|
+
void onSelect(emoji);
|
|
42
|
+
if (!isDefaultEmoji(emoji)) {
|
|
43
|
+
updatePreferences((current) => ({
|
|
44
|
+
...current,
|
|
45
|
+
recentEmojis: addRecentEmoji(current.recentEmojis, emoji),
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
setShowAllEmojis(false);
|
|
49
|
+
}, [onSelect, updatePreferences]);
|
|
50
|
+
// When the picker is shown, sync the skin tone, hide its built-in skin-tone
|
|
51
|
+
// selector, and listen for emoji clicks (a CustomEvent, so not a JSX prop).
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const picker = pickerRef.current;
|
|
54
|
+
if (!showAllEmojis || !picker)
|
|
55
|
+
return;
|
|
56
|
+
void syncEmojiPickerSkinTone(skinTone).then(() => {
|
|
57
|
+
hideEmojiPickerSkinToneSelector(picker);
|
|
58
|
+
});
|
|
59
|
+
picker.addEventListener('emoji-click', handlePickerEmojiClick);
|
|
60
|
+
return () => {
|
|
61
|
+
picker.removeEventListener('emoji-click', handlePickerEmojiClick);
|
|
62
|
+
};
|
|
63
|
+
}, [showAllEmojis, skinTone, handlePickerEmojiClick]);
|
|
64
|
+
const handleSetSkinTone = async (tone) => {
|
|
65
|
+
updatePreferences((current) => ({
|
|
66
|
+
...current,
|
|
67
|
+
skinTone: tone,
|
|
68
|
+
recentEmojis: applySkinToneToRecentEmojis(current.recentEmojis, tone),
|
|
69
|
+
}));
|
|
70
|
+
await syncEmojiPickerSkinTone(tone);
|
|
71
|
+
setShowSkinToneSelector(false);
|
|
72
|
+
};
|
|
73
|
+
const openAllEmojis = async () => {
|
|
74
|
+
setShowSkinToneSelector(false);
|
|
75
|
+
await syncEmojiPickerSkinTone(skinTone);
|
|
76
|
+
setShowAllEmojis(true);
|
|
77
|
+
};
|
|
78
|
+
return (_jsx("div", { className: `bg-surface-200 rounded-2xl p-2 ${mobile ? 'w-full' : 'md:w-max'}`, children: showAllEmojis ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "mb-2", children: _jsxs("button", { type: "button", title: t('jams.reactions.backToQuickReactions'), className: "flex items-center gap-1 p-1 text-sm", onClick: () => setShowAllEmojis(false), children: [_jsx(ChevronLeft, { className: "size-4" }), t('jams.reactions.backToQuickReactions')] }) }), _jsx("emoji-picker", { ref: pickerRef })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col gap-y-1 md:flex-row md:flex-nowrap md:items-center md:gap-x-1", children: [_jsx("div", { className: "flex flex-wrap items-center gap-x-1 md:flex-nowrap", children: defaultEmojis.map((emoji) => (_jsx("button", { type: "button", title: emoji, className: "shrink-0 p-2 text-lg", onClick: () => void onSelect(emoji), children: emoji }, emoji))) }), _jsxs("div", { className: "flex flex-wrap items-center gap-x-1 md:flex-nowrap", children: [_jsx("div", { className: "bg-surface-400 mx-1 h-8 w-px shrink-0 self-center max-md:hidden", "aria-hidden": "true" }), recentDisplayEmojis.length > 0 ? (_jsxs(_Fragment, { children: [recentDisplayEmojis.map((emoji) => (_jsx("button", { type: "button", title: emoji, className: "shrink-0 p-2 text-lg", onClick: () => void onSelect(emoji), children: emoji }, emoji))), _jsx("div", { className: "bg-surface-400 mx-1 h-8 w-px shrink-0 self-center", "aria-hidden": "true" })] })) : null, _jsx("button", { type: "button", title: t('jams.reactions.skinToneTitle'), className: `shrink-0 rounded p-2 text-lg ${showSkinToneSelector ? 'bg-surface-400' : ''}`, onClick: () => setShowSkinToneSelector((open) => !open), children: selectedSkinToneEmoji }), _jsx("button", { type: "button", title: t('jams.reactions.allEmojisTitle'), className: "shrink-0 p-2", onClick: () => void openAllEmojis(), children: _jsx(SmilePlus, { className: "size-5" }) })] })] }), showSkinToneSelector ? (_jsx("div", { className: "border-surface-300 mt-2 flex gap-1 border-t pt-2", children: SKIN_TONE_OPTIONS.map((option) => (_jsx("button", { type: "button", title: t('jams.reactions.skinToneTitle'), className: `rounded p-1 text-lg ${skinTone === option.tone ? 'bg-surface-400' : ''}`, onClick: () => void handleSetSkinTone(option.tone), children: option.emoji }, option.tone))) })) : null] })) }));
|
|
79
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LocalUserChoices } from '@livekit/components-react';
|
|
2
|
+
export interface JamRequestJoinProps {
|
|
3
|
+
onJoin: (params: {
|
|
4
|
+
token: string;
|
|
5
|
+
livekitUrl: string;
|
|
6
|
+
choices: LocalUserChoices;
|
|
7
|
+
}) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function JamRequestJoin({ onJoin }: JamRequestJoinProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
4
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
5
|
+
import { useT } from '../../i18n/index.js';
|
|
6
|
+
import { useJamContext } from './JamContext.js';
|
|
7
|
+
function JamWaitingRoomListener({ onJoin, }) {
|
|
8
|
+
const { jamPost } = useJamContext();
|
|
9
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
10
|
+
const tokenResponse = openpeepsApi.useJoinWaitingRoomStream(jamPost.id);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (tokenResponse?.token && tokenResponse.livekitUrl) {
|
|
13
|
+
onJoin({
|
|
14
|
+
token: tokenResponse.token,
|
|
15
|
+
livekitUrl: tokenResponse.livekitUrl,
|
|
16
|
+
choices: {
|
|
17
|
+
audioEnabled: true,
|
|
18
|
+
videoEnabled: true,
|
|
19
|
+
username: '',
|
|
20
|
+
audioDeviceId: '',
|
|
21
|
+
videoDeviceId: '',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, [tokenResponse, onJoin]);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
export function JamRequestJoin({ onJoin }) {
|
|
29
|
+
const t = useT();
|
|
30
|
+
const [requested, setRequested] = useState(false);
|
|
31
|
+
return (_jsx("div", { className: "mx-auto flex w-full max-w-md flex-col items-center gap-4 p-4", children: requested ? (_jsxs(_Fragment, { children: [_jsx(JamWaitingRoomListener, { onJoin: onJoin }), _jsx("p", { className: "text-muted-foreground text-center text-sm", children: t('jams.join.waitingForModerator', {
|
|
32
|
+
defaultValue: 'Waiting for a moderator to admit you…',
|
|
33
|
+
}) })] })) : (_jsx(Button, { variant: "variant-filled-primary", action: () => setRequested(true), children: t('jams.join.requestToJoin', { defaultValue: 'Request to join' }) })) }));
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '@livekit/components-styles';
|
|
2
|
+
import './livekit-light-theme.css';
|
|
3
|
+
import type { LocalUserChoices } from '@livekit/components-react';
|
|
4
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
5
|
+
export interface JamRoomProps {
|
|
6
|
+
jamPost: PublicPost;
|
|
7
|
+
/** When true, connect immediately as observer without a lobby. */
|
|
8
|
+
observer?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Top-level React port of `core/jams/room/Room.svelte`. Decides whether to
|
|
12
|
+
* render the lobby, the live video call, an "access denied / jam not active"
|
|
13
|
+
* screen, or — for observers — auto-connects via the join token.
|
|
14
|
+
*
|
|
15
|
+
* Drop this into a route or page; everything below it lives inside the
|
|
16
|
+
* `<JamProvider>`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function JamRoom({ jamPost, observer }: JamRoomProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/** Convenience helper for callers that have a `PublicPost` of any type. */
|
|
20
|
+
export declare function isJamPost(post: PublicPost): boolean;
|
|
21
|
+
export type { LocalUserChoices };
|