@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,138 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { Eye } from 'lucide-react';
|
|
4
|
+
import { hasAdminSidebarAccess } from '@openpeepshq/common/lib';
|
|
5
|
+
import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, Label, } from '@openpeepshq/react-ui';
|
|
6
|
+
import { eventSanitizer, useNewPostStores } from '../../stores/index.js';
|
|
7
|
+
import { useNavigate } from '../../contexts/router/index.js';
|
|
8
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
9
|
+
import { useT } from '../../i18n/index.js';
|
|
10
|
+
import { useServerInfo } from '../server-data/index.js';
|
|
11
|
+
import { useAuthData, useCurrentProfile } from '../layout/IdentityContext.js';
|
|
12
|
+
import { Avatar, ProfilesInput } from '../profile/index.js';
|
|
13
|
+
import { PostAudienceSelector } from '../post/post-form/PostAudienceSelector.js';
|
|
14
|
+
import { buildAudienceChoices } from '../post/post-form/audienceChoices.js';
|
|
15
|
+
export function CreateNewJamModal({ onClose }) {
|
|
16
|
+
const t = useT();
|
|
17
|
+
const navigate = useNavigate();
|
|
18
|
+
const me = useCurrentProfile();
|
|
19
|
+
const authData = useAuthData();
|
|
20
|
+
const serverInfo = useServerInfo();
|
|
21
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
22
|
+
const createPost = openpeepsApi.createPostAction();
|
|
23
|
+
const newPostStores = useNewPostStores();
|
|
24
|
+
const sanitize = useMemo(() => eventSanitizer(serverInfo.publicContent), [serverInfo.publicContent]);
|
|
25
|
+
const [postData, setPostData] = useState(() => sanitize(newPostStores.jam));
|
|
26
|
+
const [audienceOpen, setAudienceOpen] = useState(false);
|
|
27
|
+
const [submitting, setSubmitting] = useState(false);
|
|
28
|
+
const [error, setError] = useState(null);
|
|
29
|
+
const profilesQuery = openpeepsApi.useProfiles();
|
|
30
|
+
const event = postData.data;
|
|
31
|
+
const isAdmin = hasAdminSidebarAccess(me?.roles ?? []);
|
|
32
|
+
const audienceChoices = useMemo(() => buildAudienceChoices('event', authData, t, {
|
|
33
|
+
publicContent: serverInfo.publicContent,
|
|
34
|
+
showDirect: true,
|
|
35
|
+
}), [authData, t, serverInfo.publicContent]);
|
|
36
|
+
const visibilityDescription = audienceChoices.find((c) => c.value === postData.visibility)?.description ??
|
|
37
|
+
t(`visibility.event.${postData.visibility}.description`, {
|
|
38
|
+
defaultValue: '',
|
|
39
|
+
});
|
|
40
|
+
const selectedGroupName = useMemo(() => me?.memberships?.find((m) => m.group.id === postData.groupId)?.group
|
|
41
|
+
.displayName, [me?.memberships, postData.groupId]);
|
|
42
|
+
// Persist the in-progress draft like the Svelte modal's `onchange` does, so
|
|
43
|
+
// reopening the modal restores what was entered.
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
newPostStores.jam = postData;
|
|
46
|
+
}, [postData, newPostStores]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (event.jam && event.jam.moderators.length === 0 && me?.id) {
|
|
49
|
+
setPostData((prev) => {
|
|
50
|
+
const ev = prev.data;
|
|
51
|
+
if (!ev.jam)
|
|
52
|
+
return prev;
|
|
53
|
+
return {
|
|
54
|
+
...prev,
|
|
55
|
+
data: {
|
|
56
|
+
...ev,
|
|
57
|
+
jam: { ...ev.jam, moderators: [me.id] },
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}, [me?.id, event.jam]);
|
|
63
|
+
const patchEvent = (patch) => {
|
|
64
|
+
setPostData((prev) => ({
|
|
65
|
+
...prev,
|
|
66
|
+
data: { ...prev.data, ...patch },
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
const handleModeratorsChange = (profiles) => {
|
|
70
|
+
if (!event.jam)
|
|
71
|
+
return;
|
|
72
|
+
patchEvent({
|
|
73
|
+
jam: { ...event.jam, moderators: profiles.map((p) => p.id) },
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
const moderatorIds = event.jam?.moderators ?? [];
|
|
77
|
+
const allProfiles = profilesQuery.data ?? [];
|
|
78
|
+
const selectedModerators = allProfiles.filter((p) => moderatorIds.includes(p.id));
|
|
79
|
+
const directAudience = postData.audience ?? [];
|
|
80
|
+
const handleCreate = async () => {
|
|
81
|
+
setError(null);
|
|
82
|
+
setSubmitting(true);
|
|
83
|
+
try {
|
|
84
|
+
let payload = {
|
|
85
|
+
...postData,
|
|
86
|
+
type: 'event',
|
|
87
|
+
data: {
|
|
88
|
+
...postData.data,
|
|
89
|
+
start: new Date().toISOString(),
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
if (payload.visibility === 'direct') {
|
|
93
|
+
const audience = payload.audience ?? [];
|
|
94
|
+
const includesMe = audience.some((p) => p.id === me?.id);
|
|
95
|
+
payload = {
|
|
96
|
+
...payload,
|
|
97
|
+
audience: includesMe ? audience : [...audience, ...(me ? [me] : [])],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
newPostStores.jam = payload;
|
|
101
|
+
const created = await createPost(payload);
|
|
102
|
+
newPostStores.resetNewJamState();
|
|
103
|
+
onClose();
|
|
104
|
+
navigate(`/events/${created.id}/jam`);
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
setError(err.message);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
setSubmitting(false);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const handleSchedule = () => {
|
|
114
|
+
newPostStores.event = postData;
|
|
115
|
+
newPostStores.resetNewJamState();
|
|
116
|
+
onClose();
|
|
117
|
+
navigate('/events/new');
|
|
118
|
+
};
|
|
119
|
+
return (_jsxs(_Fragment, { children: [_jsx(Dialog, { open: true, onOpenChange: (next) => !next && onClose(), children: _jsxs(DialogContent, { className: "max-h-[85vh] max-w-lg overflow-y-auto", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: t('jams.create.title') }) }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "jam-name", children: t('jams.form.name') }), _jsx(Input, { id: "jam-name", value: event.name ?? '', onChange: (e) => patchEvent({ name: e.target.value }) })] }), _jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Eye, { className: "text-muted-foreground size-4" }), _jsx(Label, { children: t('visibility.event.title') })] }), _jsxs("button", { type: "button", className: "hover:bg-surface-100 flex w-full items-center gap-2 rounded-md border p-3 text-left text-sm", onClick: () => setAudienceOpen(true), children: [_jsx("span", { className: "flex-1", children: visibilityDescription }), postData.visibility === 'group' && selectedGroupName ? (_jsx("span", { className: "text-primary truncate text-sm", children: selectedGroupName })) : null, postData.visibility === 'direct' ? (_jsxs("span", { className: "flex items-center", children: [directAudience.slice(0, 5).map((profile) => (_jsx(Avatar, { profile: profile, size: 1.5, borderless: true, containerClassName: "-ml-2" }, profile.id))), directAudience.length > 5 ? (_jsxs("span", { className: "ml-1 text-sm", children: ["+", directAudience.length - 5] })) : null] })) : null] }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('events.form.visibilityNotChangeable') })] }), _jsxs("label", { className: "flex items-start gap-2", children: [_jsx("input", { type: "checkbox", className: "mt-1", checked: event.jam?.waitingRoom ?? false, onChange: (e) => event.jam &&
|
|
120
|
+
patchEvent({
|
|
121
|
+
jam: { ...event.jam, waitingRoom: e.target.checked },
|
|
122
|
+
}) }), _jsxs("span", { className: "flex flex-col", children: [_jsx("span", { className: "text-sm", children: t('events.form.jamWaitingRoom') }), _jsx("span", { className: "text-muted-foreground text-xs", children: t('events.form.jamWaitingRoomDescription') })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { children: t('events.form.jamModerators') }), _jsx(ProfilesInput, { value: selectedModerators, onChange: handleModeratorsChange, placeholder: t('events.form.jamModeratorsDescription', {
|
|
123
|
+
defaultValue: 'Click to select jam moderators',
|
|
124
|
+
}) })] })] }), error ? _jsx("p", { className: "text-error text-sm", children: error }) : null, _jsxs(DialogFooter, { children: [isAdmin ? (_jsx(Button, { variant: "variant-ringed-primary", action: handleSchedule, children: t('jams.createFlow.schedule') })) : null, _jsx(Button, { variant: "variant-filled-primary", disabled: submitting, action: handleCreate, children: t('jams.start.submit') })] })] }) }), _jsx(PostAudienceSelector, { open: audienceOpen, onClose: () => setAudienceOpen(false), type: "event", visibility: postData.visibility, groupId: postData.groupId ?? undefined, audience: postData.audience ?? [], showDirect: true, onConfirm: (settings) => {
|
|
125
|
+
const audience = settings.audience;
|
|
126
|
+
const includesMe = audience?.some((p) => p.id === me?.id);
|
|
127
|
+
setPostData((prev) => ({
|
|
128
|
+
...prev,
|
|
129
|
+
visibility: settings.visibility,
|
|
130
|
+
groupId: settings.groupId ?? undefined,
|
|
131
|
+
audience: settings.visibility === 'direct'
|
|
132
|
+
? includesMe
|
|
133
|
+
? (audience ?? undefined)
|
|
134
|
+
: [...(audience ?? []), ...(me ? [me] : [])]
|
|
135
|
+
: undefined,
|
|
136
|
+
}));
|
|
137
|
+
} })] }));
|
|
138
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface CreateNewJamContextValue {
|
|
3
|
+
openCreateJam: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function CreateNewJamProvider({ children }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useCreateNewJam(): CreateNewJamContextValue;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useState, } from 'react';
|
|
3
|
+
import { CreateNewJamModal } from './CreateNewJam.js';
|
|
4
|
+
const CreateNewJamContext = createContext(null);
|
|
5
|
+
export function CreateNewJamProvider({ children }) {
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const openCreateJam = useCallback(() => setOpen(true), []);
|
|
8
|
+
return (_jsxs(CreateNewJamContext.Provider, { value: { openCreateJam }, children: [children, open ? _jsx(CreateNewJamModal, { onClose: () => setOpen(false) }) : null] }));
|
|
9
|
+
}
|
|
10
|
+
export function useCreateNewJam() {
|
|
11
|
+
const ctx = useContext(CreateNewJamContext);
|
|
12
|
+
if (!ctx) {
|
|
13
|
+
throw new Error('useCreateNewJam must be used within CreateNewJamProvider');
|
|
14
|
+
}
|
|
15
|
+
return ctx;
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import animateEmoji from './animateEmoji.js';
|
|
4
|
+
export function JamAnimatedEmoji({ emoji }) {
|
|
5
|
+
const elementRef = useRef(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (elementRef.current) {
|
|
8
|
+
animateEmoji(elementRef.current);
|
|
9
|
+
}
|
|
10
|
+
}, [emoji]);
|
|
11
|
+
return (_jsx("div", { ref: elementRef, className: "pointer-events-none absolute bottom-0 right-1/3 size-16 bg-transparent pt-3 text-center text-4xl md:size-24 md:pt-4 md:text-6xl", style: { alignSelf: 'center' }, children: emoji }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type TrackReferenceOrPlaceholder } from '@livekit/components-react';
|
|
2
|
+
export interface JamCallParticipantProps {
|
|
3
|
+
/** Camera track reference (or placeholder when the camera is off). */
|
|
4
|
+
trackRef: TrackReferenceOrPlaceholder;
|
|
5
|
+
/** Tailwind size classes for the tile (e.g. `size-full`, `size-40 md:size-52`). */
|
|
6
|
+
size: string;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Single participant tile mirroring the Svelte `CallParticipant`: the camera
|
|
11
|
+
* video (or an avatar fallback when the camera is off/muted), the participant
|
|
12
|
+
* overlay and any active reactions. Audio playback is handled globally by
|
|
13
|
+
* `RoomAudioRenderer`, so no per-tile audio element is needed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function JamCallParticipant({ trackRef, size, compact, }: JamCallParticipantProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { TrackRefContext, VideoTrack, isTrackReference, useIsSpeaking, useRoomContext, } from '@livekit/components-react';
|
|
4
|
+
import { AudioLines, Ellipsis, Hand, Mic, MicOff } from 'lucide-react';
|
|
5
|
+
import { PopupMenu, PopupMenuButton } from '@openpeepshq/react-ui';
|
|
6
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
7
|
+
import { useT } from '../../i18n/index.js';
|
|
8
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
9
|
+
import { useToast } from '../layout/ToastProvider.js';
|
|
10
|
+
import { Avatar } from '../profile/index.js';
|
|
11
|
+
import { JamAnimatedEmoji } from './JamAnimatedEmoji.js';
|
|
12
|
+
import { useJamContext } from './JamContext.js';
|
|
13
|
+
import { useJamEventsContext } from './JamEventsContext.js';
|
|
14
|
+
import { parseParticipantMetadata } from './jamEventActions.js';
|
|
15
|
+
import { useRaisedHands } from './useJamHands.js';
|
|
16
|
+
function JamParticipantReactions({ identity, isLocal, }) {
|
|
17
|
+
const { ownReactions, reactionsForParticipant } = useJamEventsContext();
|
|
18
|
+
const reactions = isLocal ? ownReactions : reactionsForParticipant(identity);
|
|
19
|
+
return (_jsx(_Fragment, { children: reactions.map((reaction) => (_jsx(JamAnimatedEmoji, { emoji: reaction.content ?? '' }, reaction.id))) }));
|
|
20
|
+
}
|
|
21
|
+
/** Moderator-only menu to mute a remote participant. Mirrors the Svelte
|
|
22
|
+
* `CallParticipant` mute control and the React Native action sheet. */
|
|
23
|
+
function JamParticipantModeratorMenu({ trackRef, }) {
|
|
24
|
+
const t = useT();
|
|
25
|
+
const { jamPost } = useJamContext();
|
|
26
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
27
|
+
const { success, error } = useToast();
|
|
28
|
+
const muteParticipant = openpeepsApi.muteJamParticipantAction({
|
|
29
|
+
id: jamPost.id,
|
|
30
|
+
});
|
|
31
|
+
const participant = trackRef.participant;
|
|
32
|
+
const handleMute = async () => {
|
|
33
|
+
const audioPublication = participant
|
|
34
|
+
.getTrackPublications()
|
|
35
|
+
.find((pub) => pub.track?.kind === 'audio');
|
|
36
|
+
if (!audioPublication)
|
|
37
|
+
return;
|
|
38
|
+
try {
|
|
39
|
+
await muteParticipant({
|
|
40
|
+
identity: participant.identity,
|
|
41
|
+
trackSid: audioPublication.trackSid,
|
|
42
|
+
});
|
|
43
|
+
success(t('jams.participants.muteSuccess', {
|
|
44
|
+
defaultValue: 'Participant muted successfully',
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
error(t('jams.participants.muteError', {
|
|
49
|
+
defaultValue: 'Failed to mute participant',
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return (_jsx(PopupMenu, { icon: Ellipsis, className: "bg-surface-100 text-foreground", iconSize: 16, title: t('jams.participants.title', { defaultValue: 'Participants' }), children: _jsx(PopupMenuButton, { title: t('jams.participants.muteParticipant', {
|
|
54
|
+
defaultValue: 'Mute Participant',
|
|
55
|
+
}), text: t('jams.participants.muteParticipant', {
|
|
56
|
+
defaultValue: 'Mute Participant',
|
|
57
|
+
}), icon: MicOff, action: handleMute }) }));
|
|
58
|
+
}
|
|
59
|
+
/** Overlay mirroring the Svelte `ParticipantOverlay`: raised hand + mic state
|
|
60
|
+
* indicators on top, name (with moderator `*` prefix) at the bottom. */
|
|
61
|
+
function JamParticipantOverlay({ trackRef, compact, }) {
|
|
62
|
+
const participant = trackRef.participant;
|
|
63
|
+
const room = useRoomContext();
|
|
64
|
+
const me = useCurrentProfile();
|
|
65
|
+
const { jam } = useJamContext();
|
|
66
|
+
const raisedHands = useRaisedHands(room);
|
|
67
|
+
const speaking = useIsSpeaking(participant);
|
|
68
|
+
const micOn = participant.isMicrophoneEnabled;
|
|
69
|
+
const handUp = raisedHands.has(participant.identity);
|
|
70
|
+
const handRaiseSound = useRef(null);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!handRaiseSound.current) {
|
|
73
|
+
handRaiseSound.current = new Audio('/audio/click-notification.wav');
|
|
74
|
+
handRaiseSound.current.volume = 0.5;
|
|
75
|
+
}
|
|
76
|
+
}, []);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (handUp) {
|
|
79
|
+
void handRaiseSound.current?.play().catch(() => { });
|
|
80
|
+
}
|
|
81
|
+
}, [handUp]);
|
|
82
|
+
const profile = parseParticipantMetadata(participant.metadata).profile;
|
|
83
|
+
const isModerator = jam.moderators.includes(participant.identity);
|
|
84
|
+
const viewerIsModerator = !!me && jam.moderators.includes(me.id);
|
|
85
|
+
const iconSize = compact ? 'size-3' : 'size-3 md:size-4';
|
|
86
|
+
return (_jsxs("div", { className: `absolute right-0 top-0 flex h-full w-full flex-col justify-between ${compact ? '' : 'md:p-3'}`, children: [_jsxs("div", { className: "flex w-full items-start justify-between", children: [_jsxs("div", { className: "flex items-center gap-1", children: [handUp ? (_jsx("div", { className: "bg-surface-50/70 rounded-full p-2", children: _jsx(Hand, { className: iconSize }) })) : null, viewerIsModerator && !participant.isLocal ? (_jsx(JamParticipantModeratorMenu, { trackRef: trackRef })) : null] }), _jsx("div", { className: `bg-surface-100 text-foreground rounded-full p-2 ${micOn && speaking ? 'text-primary-500' : ''}`, children: !micOn ? (_jsx(MicOff, { className: iconSize })) : speaking ? (_jsx(AudioLines, { className: iconSize })) : (_jsx(Mic, { className: iconSize })) })] }), _jsx("div", { className: "flex w-full items-end justify-between", children: _jsx("div", { className: `bg-surface-100 text-foreground block max-w-full truncate rounded-lg p-1 ${compact ? 'text-xs' : 'text-sm'}`, children: profile
|
|
87
|
+
? (isModerator ? '* ' : '') +
|
|
88
|
+
(profile.displayName || `@${profile.handle}`)
|
|
89
|
+
: '' }) })] }));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Single participant tile mirroring the Svelte `CallParticipant`: the camera
|
|
93
|
+
* video (or an avatar fallback when the camera is off/muted), the participant
|
|
94
|
+
* overlay and any active reactions. Audio playback is handled globally by
|
|
95
|
+
* `RoomAudioRenderer`, so no per-tile audio element is needed.
|
|
96
|
+
*/
|
|
97
|
+
export function JamCallParticipant({ trackRef, size, compact = false, }) {
|
|
98
|
+
const participant = trackRef.participant;
|
|
99
|
+
const profile = parseParticipantMetadata(participant.metadata).profile;
|
|
100
|
+
return (_jsx("div", { className: `${size} bg-surface-50 relative rounded-xl border`, children: _jsxs(TrackRefContext.Provider, { value: trackRef, children: [_jsx("div", { className: "size-full overflow-hidden rounded-xl", children: isTrackReference(trackRef) && !trackRef.publication.isMuted ? (_jsx(VideoTrack, { trackRef: trackRef, className: "size-full object-cover" })) : (_jsx("div", { className: "relative flex size-full items-center justify-center", children: _jsx(Avatar, { profile: profile, size: 5, borderless: true }) })) }), _jsx(JamParticipantOverlay, { trackRef: trackRef, compact: compact }), _jsx(JamParticipantReactions, { identity: participant.identity, isLocal: participant.isLocal })] }) }));
|
|
101
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
export interface JamCapacityGateProps {
|
|
3
|
+
jamPost: PublicPost;
|
|
4
|
+
reason: 'full' | 'rsvp-required' | 'removed';
|
|
5
|
+
eventName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const JamCapacityGate: ({ jamPost, reason, eventName, }: JamCapacityGateProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isCapacityEvent } from '@openpeepshq/common/lib';
|
|
3
|
+
import { useT } from '../../i18n/index.js';
|
|
4
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
5
|
+
import { EventRsvpButton } from '../post/pieces/EventRsvpButton.js';
|
|
6
|
+
export const JamCapacityGate = ({ jamPost, reason, eventName, }) => {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const me = useCurrentProfile();
|
|
9
|
+
const eventData = jamPost.data?.type === 'event' ? jamPost.data : undefined;
|
|
10
|
+
const showRsvp = reason === 'rsvp-required' &&
|
|
11
|
+
!!me &&
|
|
12
|
+
!!eventData &&
|
|
13
|
+
isCapacityEvent(eventData);
|
|
14
|
+
const message = reason === 'full'
|
|
15
|
+
? t('error.eventAtCapacity', { defaultValue: 'This event is full.' })
|
|
16
|
+
: reason === 'removed'
|
|
17
|
+
? t('events.rsvp.removedMessage', {
|
|
18
|
+
defaultValue: 'The organizer has removed you from this event.',
|
|
19
|
+
})
|
|
20
|
+
: t('error.jamRsvpRequired', {
|
|
21
|
+
defaultValue: 'You must RSVP yes to join this event.',
|
|
22
|
+
});
|
|
23
|
+
return (_jsx("div", { className: "mx-auto flex h-full w-full items-center justify-center p-4", children: _jsxs("div", { className: "w-full max-w-md space-y-5 text-center", children: [eventName ? _jsx("h3", { className: "text-lg", children: eventName }) : null, _jsxs("div", { className: "bg-surface-100 flex w-full flex-col items-center justify-center space-y-4 rounded border p-4", children: [_jsx("p", { className: "text-sm", children: message }), showRsvp ? (_jsx("div", { className: "w-full px-2", children: _jsx(EventRsvpButton, { post: jamPost }) })) : null, _jsx("a", { href: `/posts/${jamPost.id}`, className: "text-primary text-sm underline", children: t('jams.room.viewEvent', { defaultValue: 'View event' }) }), !me ? (_jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx("a", { href: `/auth/login?redirect=${encodeURIComponent(window.location.pathname)}`, className: "bg-primary text-primary-foreground rounded px-4 py-2 text-sm", children: t('navigation.logIn', { defaultValue: 'Log in' }) }), _jsxs("span", { className: "text-muted-foreground text-sm", children: [t('navigation.haveAccount', {
|
|
24
|
+
defaultValue: 'Already have an account?',
|
|
25
|
+
}), ' ', _jsx("a", { href: "/auth/register", className: "underline", children: t('navigation.joinCommunity', {
|
|
26
|
+
defaultValue: 'Join the community',
|
|
27
|
+
}) })] })] })) : (_jsx("a", { href: "/jams", className: "bg-primary text-primary-foreground rounded px-4 py-2 text-sm", children: t('jams.discover.checkOtherJams', {
|
|
28
|
+
defaultValue: 'Check other jams',
|
|
29
|
+
}) }))] })] }) }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { Loader, SendHorizontal, X } from 'lucide-react';
|
|
4
|
+
import { dateSorter } 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
|
+
import { useJamEventsContext } from './JamEventsContext.js';
|
|
9
|
+
import { JamChatMessage } from './JamChatMessage.js';
|
|
10
|
+
function mergeJamEvents(persisted, sessionEvents) {
|
|
11
|
+
const seen = new Set();
|
|
12
|
+
const merged = [];
|
|
13
|
+
for (const event of [...persisted, ...sessionEvents]) {
|
|
14
|
+
if (seen.has(event.id))
|
|
15
|
+
continue;
|
|
16
|
+
seen.add(event.id);
|
|
17
|
+
merged.push(event);
|
|
18
|
+
}
|
|
19
|
+
return merged
|
|
20
|
+
.filter((event) => event.type !== 'reaction')
|
|
21
|
+
.sort(dateSorter());
|
|
22
|
+
}
|
|
23
|
+
export function JamChatDrawer({ open, onClose, readOnly = false, }) {
|
|
24
|
+
const t = useT();
|
|
25
|
+
const { jamPost } = useJamContext();
|
|
26
|
+
const { sessionEvents, sendMessage } = useJamEventsContext();
|
|
27
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
28
|
+
const eventsQuery = openpeepsApi.useInfiniteJamEvents(jamPost.id, 100);
|
|
29
|
+
const [newMessage, setNewMessage] = useState('');
|
|
30
|
+
const [isSending, setIsSending] = useState(false);
|
|
31
|
+
const endRef = useRef(null);
|
|
32
|
+
const topSentinelRef = useRef(null);
|
|
33
|
+
const textareaRef = useRef(null);
|
|
34
|
+
const scrollContainerRef = useRef(null);
|
|
35
|
+
const messages = useMemo(() => {
|
|
36
|
+
const persisted = (eventsQuery.data?.pages ?? []).flat();
|
|
37
|
+
return mergeJamEvents(persisted, sessionEvents);
|
|
38
|
+
}, [eventsQuery.data, sessionEvents]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!open)
|
|
41
|
+
return;
|
|
42
|
+
const timeout = window.setTimeout(() => {
|
|
43
|
+
endRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
44
|
+
}, 300);
|
|
45
|
+
return () => window.clearTimeout(timeout);
|
|
46
|
+
}, [open, messages.length]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const el = topSentinelRef.current;
|
|
49
|
+
if (!el || !open)
|
|
50
|
+
return;
|
|
51
|
+
const observer = new IntersectionObserver((entries) => {
|
|
52
|
+
const entry = entries[0];
|
|
53
|
+
if (entry?.isIntersecting &&
|
|
54
|
+
eventsQuery.hasNextPage &&
|
|
55
|
+
!eventsQuery.isFetchingNextPage) {
|
|
56
|
+
void eventsQuery.fetchNextPage();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
observer.observe(el);
|
|
60
|
+
return () => observer.disconnect();
|
|
61
|
+
}, [eventsQuery, open]);
|
|
62
|
+
const handleSendMessage = async () => {
|
|
63
|
+
if (!newMessage.trim() || readOnly)
|
|
64
|
+
return;
|
|
65
|
+
setIsSending(true);
|
|
66
|
+
try {
|
|
67
|
+
await sendMessage(newMessage);
|
|
68
|
+
setNewMessage('');
|
|
69
|
+
endRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
70
|
+
window.setTimeout(() => textareaRef.current?.focus(), 25);
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
setIsSending(false);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
if (!open) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
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.chatTitle', { defaultValue: 'Chat' }) }), _jsx("button", { type: "button", title: t('jams.drawer.close', { defaultValue: 'Close' }), className: "text-neutral-400", onClick: onClose, children: _jsx(X, {}) })] }), _jsxs("div", { ref: scrollContainerRef, className: "z-10 box-content flex w-full flex-1 flex-col overflow-y-scroll", children: [_jsxs("div", { className: "mb-0 flex-grow space-y-4 px-2 pb-4 md:mb-6", children: [_jsx("div", { ref: topSentinelRef, className: "h-1" }), eventsQuery.isFetchingNextPage && (_jsx("div", { className: "flex justify-center py-2", children: _jsx(Loader, { className: "size-4 animate-spin" }) })), messages.length === 0 && !eventsQuery.isLoading ? (_jsx("p", { className: "mt-4 text-center text-neutral-400", children: t('jams.chat.noMessages', { defaultValue: 'No messages yet' }) })) : (messages.map((message) => (_jsx(JamChatMessage, { message: message }, message.id))))] }), _jsx("div", { ref: endRef, className: "pb-4" })] }), !readOnly && (_jsxs("div", { className: "bg-surface-50 sticky bottom-0 flex w-full items-center gap-x-2 p-2", children: [_jsx("textarea", { ref: textareaRef, disabled: isSending, value: newMessage, rows: 1, onChange: (event) => setNewMessage(event.target.value), onKeyDown: (event) => {
|
|
80
|
+
if (!(event.shiftKey || event.ctrlKey || event.altKey) &&
|
|
81
|
+
event.key === 'Enter') {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
void handleSendMessage();
|
|
84
|
+
}
|
|
85
|
+
}, className: "bg-surface-50 w-full resize-none border-none outline-none", placeholder: t('jams.chat.messagePlaceholder', {
|
|
86
|
+
defaultValue: 'Send a message…',
|
|
87
|
+
}) }), _jsx("button", { type: "button", title: t('jams.chat.sendTitle', { defaultValue: 'Send message' }), disabled: isSending, onClick: () => void handleSendMessage(), children: isSending ? (_jsx(Loader, { className: "size-4 animate-spin" })) : (_jsx(SendHorizontal, {})) })] }))] }));
|
|
88
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { truncateText } from '@openpeepshq/common';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { OpenpeepsMarkdown } from '../markdown/OpenpeepsMarkdown.js';
|
|
5
|
+
import { Avatar } from '../profile/Avatar.js';
|
|
6
|
+
import { UpdatingDate } from '@openpeepshq/react-ui';
|
|
7
|
+
const attendance = ['join', 'leave', 'start', 'close'];
|
|
8
|
+
const attendanceMap = {
|
|
9
|
+
join: 'joined',
|
|
10
|
+
leave: 'left',
|
|
11
|
+
start: 'started',
|
|
12
|
+
close: 'closed',
|
|
13
|
+
};
|
|
14
|
+
export function JamChatMessage({ message }) {
|
|
15
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
16
|
+
const profileQuery = openpeepsApi.useProfile(message.profileId || 'unknown');
|
|
17
|
+
const profile = profileQuery.data;
|
|
18
|
+
if (!message.profileId) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (profileQuery.isLoading) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (!profile) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
if (message.type === 'message') {
|
|
28
|
+
return (_jsx("div", { className: "flex items-center justify-between", children: _jsxs("div", { className: "grid w-full grid-cols-5 gap-x-1", children: [_jsx("div", { className: "col-span-1 flex w-full justify-center", children: _jsx(Avatar, { profile: profile, borderless: true, size: 2 }) }), _jsxs("div", { className: "col-span-4 w-full", children: [_jsxs("div", { className: "flex w-full gap-x-1", children: [_jsx("h4", { className: "hidden md:flex", children: truncateText(profile.displayName || `@${profile.handle}`, 20) }), _jsx("h4", { className: "flex md:hidden", children: truncateText(profile.displayName || `@${profile.handle}`, 10) }), _jsx("p", { className: "break-words text-sm text-neutral-500", children: _jsx(UpdatingDate, { date: message.createdAt }) })] }), _jsx(OpenpeepsMarkdown, { source: message.content ?? '', linkPreviewMode: "none" })] })] }) }));
|
|
29
|
+
}
|
|
30
|
+
if (attendance.includes(message.type)) {
|
|
31
|
+
const label = attendanceMap[message.type] ?? message.type;
|
|
32
|
+
return (_jsx("div", { className: "flex items-center justify-center", children: _jsxs("span", { className: "text-center text-sm text-neutral-500", children: [profile.displayName || `@${profile.handle}`, " ", label, " the jam", ' ', _jsx(UpdatingDate, { date: message.createdAt })] }) }));
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-call jam UI built from LiveKit layout primitives plus OpenPeeps persisted
|
|
3
|
+
* chat and reaction overlays. Participants get a full conference layout with the
|
|
4
|
+
* footer control bar (mic/camera/devices/screen-share/reactions/hand/record/
|
|
5
|
+
* chat/people/leave) and a people drawer that includes waiting-room admission;
|
|
6
|
+
* observers get a read-only grid.
|
|
7
|
+
*/
|
|
8
|
+
export declare function JamConference(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RoomAudioRenderer, isTrackReference, useTracks, } from '@livekit/components-react';
|
|
3
|
+
import { Track } from 'livekit-client';
|
|
4
|
+
import { useJamObserver } from './JamContext.js';
|
|
5
|
+
import { JamParticipantConference } from './JamParticipantConference.js';
|
|
6
|
+
import { JamEventsProvider } from './JamEventsContext.js';
|
|
7
|
+
import { JamObserverShell } from './JamObserverShell.js';
|
|
8
|
+
import { JamVideoLayout } from './JamVideoLayout.js';
|
|
9
|
+
function JamObserverConference() {
|
|
10
|
+
const tracks = useTracks([
|
|
11
|
+
{ source: Track.Source.Camera, withPlaceholder: true },
|
|
12
|
+
{ source: Track.Source.ScreenShare, withPlaceholder: false },
|
|
13
|
+
], { onlySubscribed: true });
|
|
14
|
+
// Observers join hidden and must not see their own (camera-less) tile,
|
|
15
|
+
// mirroring the Svelte `participantListStore` observer branch.
|
|
16
|
+
const cameraTracks = tracks.filter((track) => track.source === Track.Source.Camera && !track.participant.isLocal);
|
|
17
|
+
const screenShareTracks = tracks.filter((track) => isTrackReference(track) &&
|
|
18
|
+
track.publication.source === Track.Source.ScreenShare &&
|
|
19
|
+
!track.publication.isMuted);
|
|
20
|
+
return (_jsx(JamObserverShell, { children: _jsx("div", { className: "min-h-0 flex-1", children: _jsx(JamVideoLayout, { cameraTracks: cameraTracks, screenShareTracks: screenShareTracks, observer: true }) }) }));
|
|
21
|
+
}
|
|
22
|
+
function JamObserverRoom() {
|
|
23
|
+
return (_jsxs(JamEventsProvider, { children: [_jsx(JamObserverConference, {}), _jsx(RoomAudioRenderer, {})] }));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* In-call jam UI built from LiveKit layout primitives plus OpenPeeps persisted
|
|
27
|
+
* chat and reaction overlays. Participants get a full conference layout with the
|
|
28
|
+
* footer control bar (mic/camera/devices/screen-share/reactions/hand/record/
|
|
29
|
+
* chat/people/leave) and a people drawer that includes waiting-room admission;
|
|
30
|
+
* observers get a read-only grid.
|
|
31
|
+
*/
|
|
32
|
+
export function JamConference() {
|
|
33
|
+
const observer = useJamObserver();
|
|
34
|
+
if (observer) {
|
|
35
|
+
return _jsx(JamObserverRoom, {});
|
|
36
|
+
}
|
|
37
|
+
return _jsx(JamParticipantConference, {});
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Event, Jam, PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
export interface JamContextValue {
|
|
3
|
+
jamPost: PublicPost;
|
|
4
|
+
jam: Jam;
|
|
5
|
+
jamEvent: Event;
|
|
6
|
+
observer: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface JamProviderProps {
|
|
9
|
+
jamPost: PublicPost;
|
|
10
|
+
observer?: boolean;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Provides the current jam, post and observer flag to descendants. Mirrors
|
|
15
|
+
* the Svelte `setJamContext` / `setObserverContext` pair.
|
|
16
|
+
*/
|
|
17
|
+
export declare function JamProvider({ jamPost, observer, children, }: JamProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function useJamContext(): JamContextValue;
|
|
19
|
+
/** Returns just the observer flag without throwing if no provider exists. */
|
|
20
|
+
export declare function useJamObserver(): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
import { jamFromEvent } from '@openpeepshq/common/lib';
|
|
4
|
+
const JamContext = createContext(null);
|
|
5
|
+
/**
|
|
6
|
+
* Provides the current jam, post and observer flag to descendants. Mirrors
|
|
7
|
+
* the Svelte `setJamContext` / `setObserverContext` pair.
|
|
8
|
+
*/
|
|
9
|
+
export function JamProvider({ jamPost, observer = false, children, }) {
|
|
10
|
+
const jam = jamFromEvent(jamPost);
|
|
11
|
+
const jamEvent = jamPost.data;
|
|
12
|
+
return (_jsx(JamContext.Provider, { value: { jamPost, jam, jamEvent, observer }, children: children }));
|
|
13
|
+
}
|
|
14
|
+
export function useJamContext() {
|
|
15
|
+
const ctx = useContext(JamContext);
|
|
16
|
+
if (!ctx) {
|
|
17
|
+
throw new Error('useJamContext must be used inside a <JamProvider>');
|
|
18
|
+
}
|
|
19
|
+
return ctx;
|
|
20
|
+
}
|
|
21
|
+
/** Returns just the observer flag without throwing if no provider exists. */
|
|
22
|
+
export function useJamObserver() {
|
|
23
|
+
return useContext(JamContext)?.observer ?? false;
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface JamDetailsDrawerProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Jam details side menu (joining info + moderator observer link), styled like
|
|
7
|
+
* the chat / people drawers. Replaces the previous floating info popover.
|
|
8
|
+
*/
|
|
9
|
+
export declare const JamDetailsDrawer: ({ open, onClose }: JamDetailsDrawerProps) => import("react/jsx-runtime").JSX.Element | null;
|