@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,76 @@
|
|
|
1
|
+
import { jamEventSchema } from '@openpeepshq/common/types';
|
|
2
|
+
import { uuidv7 } from 'uuidv7';
|
|
3
|
+
const encoder = new TextEncoder();
|
|
4
|
+
export function parseParticipantMetadata(metadata) {
|
|
5
|
+
if (!metadata)
|
|
6
|
+
return {};
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(metadata);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Toggle the local participant's raised-hand flag via participant metadata,
|
|
16
|
+
* mirroring the Svelte `toggleHand` action.
|
|
17
|
+
*/
|
|
18
|
+
export async function toggleHand(room) {
|
|
19
|
+
const current = parseParticipantMetadata(room.localParticipant.metadata);
|
|
20
|
+
const next = {
|
|
21
|
+
...current,
|
|
22
|
+
handRaised: current.handRaised ? undefined : new Date().toISOString(),
|
|
23
|
+
};
|
|
24
|
+
await room.localParticipant.setMetadata(JSON.stringify(next));
|
|
25
|
+
}
|
|
26
|
+
/** Publish + persist a join/leave attendance event (mirrors Svelte). */
|
|
27
|
+
export async function sendAttendance(room, persistEvent, type) {
|
|
28
|
+
return sendJamEvent(room, persistEvent, type, type === 'join' ? '👋' : '🚶');
|
|
29
|
+
}
|
|
30
|
+
export async function sendJamEvent(room, persistEvent, type, content) {
|
|
31
|
+
const metadata = JSON.parse(room.localParticipant.metadata || '{}');
|
|
32
|
+
const newEvent = {
|
|
33
|
+
id: uuidv7(),
|
|
34
|
+
type,
|
|
35
|
+
jamId: room.name,
|
|
36
|
+
content,
|
|
37
|
+
createdAt: new Date().toISOString(),
|
|
38
|
+
updatedAt: new Date().toISOString(),
|
|
39
|
+
profileId: metadata?.profile?.id ?? '',
|
|
40
|
+
};
|
|
41
|
+
const encodedMessages = encoder.encode(JSON.stringify(newEvent));
|
|
42
|
+
await persistEvent(newEvent, { id: room.name || '' });
|
|
43
|
+
await room.localParticipant.publishData(encodedMessages, { reliable: false });
|
|
44
|
+
return newEvent;
|
|
45
|
+
}
|
|
46
|
+
export async function sendReaction(room, emoji, persistEvent) {
|
|
47
|
+
const metadata = JSON.parse(room.localParticipant.metadata || '{}');
|
|
48
|
+
const newEvent = {
|
|
49
|
+
id: uuidv7(),
|
|
50
|
+
type: 'reaction',
|
|
51
|
+
jamId: room.name,
|
|
52
|
+
content: emoji,
|
|
53
|
+
createdAt: new Date().toISOString(),
|
|
54
|
+
updatedAt: new Date().toISOString(),
|
|
55
|
+
profileId: metadata.profile?.id ?? '',
|
|
56
|
+
};
|
|
57
|
+
const encodedMessages = encoder.encode(JSON.stringify(newEvent));
|
|
58
|
+
await room.localParticipant.publishData(encodedMessages, {
|
|
59
|
+
reliable: false,
|
|
60
|
+
topic: 'reactions',
|
|
61
|
+
});
|
|
62
|
+
void persistEvent(newEvent, { id: eventJamId(newEvent) });
|
|
63
|
+
return newEvent;
|
|
64
|
+
}
|
|
65
|
+
function eventJamId(event) {
|
|
66
|
+
return event.jamId || '';
|
|
67
|
+
}
|
|
68
|
+
export function parseJamEventPayload(payload) {
|
|
69
|
+
try {
|
|
70
|
+
const receivedPacket = new TextDecoder().decode(payload);
|
|
71
|
+
return jamEventSchema.parse(JSON.parse(receivedPacket));
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locally persisted jam preferences (speaker device + background blur), the
|
|
3
|
+
* React counterpart to the Svelte `jamSettingsStore`. Kept in `localStorage`
|
|
4
|
+
* so the lobby and the room agree on the chosen output device and blur state.
|
|
5
|
+
*/
|
|
6
|
+
export interface JamLocalSettings {
|
|
7
|
+
speakerDeviceId: string;
|
|
8
|
+
speakerEnabled: boolean;
|
|
9
|
+
blur: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const getJamLocalSettings: () => JamLocalSettings;
|
|
12
|
+
export declare const setJamLocalSettings: (patch: Partial<JamLocalSettings>) => void;
|
|
13
|
+
/** Reactive accessor for the persisted jam settings. */
|
|
14
|
+
export declare function useJamLocalSettings(): [
|
|
15
|
+
JamLocalSettings,
|
|
16
|
+
(patch: Partial<JamLocalSettings>) => void
|
|
17
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
2
|
+
const STORAGE_KEY = 'openpeeps:jam-settings';
|
|
3
|
+
const defaults = {
|
|
4
|
+
speakerDeviceId: '',
|
|
5
|
+
speakerEnabled: true,
|
|
6
|
+
blur: false,
|
|
7
|
+
};
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
let cache;
|
|
10
|
+
const read = () => {
|
|
11
|
+
if (cache)
|
|
12
|
+
return cache;
|
|
13
|
+
if (typeof window === 'undefined') {
|
|
14
|
+
cache = defaults;
|
|
15
|
+
return defaults;
|
|
16
|
+
}
|
|
17
|
+
let value = defaults;
|
|
18
|
+
try {
|
|
19
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
20
|
+
value = raw ? { ...defaults, ...JSON.parse(raw) } : defaults;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
value = defaults;
|
|
24
|
+
}
|
|
25
|
+
cache = value;
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
export const getJamLocalSettings = () => read();
|
|
29
|
+
export const setJamLocalSettings = (patch) => {
|
|
30
|
+
const next = { ...read(), ...patch };
|
|
31
|
+
cache = next;
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
try {
|
|
34
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// ignore quota / unavailable storage
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
listeners.forEach((listener) => listener());
|
|
41
|
+
};
|
|
42
|
+
const subscribe = (listener) => {
|
|
43
|
+
listeners.add(listener);
|
|
44
|
+
return () => {
|
|
45
|
+
listeners.delete(listener);
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** Reactive accessor for the persisted jam settings. */
|
|
49
|
+
export function useJamLocalSettings() {
|
|
50
|
+
const settings = useSyncExternalStore(subscribe, read, () => defaults);
|
|
51
|
+
const update = useCallback((patch) => setJamLocalSettings(patch), []);
|
|
52
|
+
return [settings, update];
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locally persisted reaction-picker preferences (preferred skin tone + recently
|
|
3
|
+
* used emojis), the React counterpart to the Svelte `jamReactionPreferencesStore`.
|
|
4
|
+
*/
|
|
5
|
+
export interface JamReactionPreferences {
|
|
6
|
+
skinTone: number;
|
|
7
|
+
recentEmojis: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare const getJamReactionPreferences: () => JamReactionPreferences;
|
|
10
|
+
export declare const setJamReactionPreferences: (update: Partial<JamReactionPreferences> | ((current: JamReactionPreferences) => JamReactionPreferences)) => void;
|
|
11
|
+
/** Reactive accessor for the persisted reaction preferences. */
|
|
12
|
+
export declare function useJamReactionPreferences(): [
|
|
13
|
+
JamReactionPreferences,
|
|
14
|
+
(update: Partial<JamReactionPreferences> | ((current: JamReactionPreferences) => JamReactionPreferences)) => void
|
|
15
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
2
|
+
const STORAGE_KEY = 'jam-reaction-preferences';
|
|
3
|
+
const defaults = {
|
|
4
|
+
skinTone: 5,
|
|
5
|
+
recentEmojis: [],
|
|
6
|
+
};
|
|
7
|
+
const listeners = new Set();
|
|
8
|
+
let cache;
|
|
9
|
+
const read = () => {
|
|
10
|
+
if (cache)
|
|
11
|
+
return cache;
|
|
12
|
+
if (typeof window === 'undefined') {
|
|
13
|
+
cache = defaults;
|
|
14
|
+
return defaults;
|
|
15
|
+
}
|
|
16
|
+
let value = defaults;
|
|
17
|
+
try {
|
|
18
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
19
|
+
value = raw ? { ...defaults, ...JSON.parse(raw) } : defaults;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
value = defaults;
|
|
23
|
+
}
|
|
24
|
+
cache = value;
|
|
25
|
+
return value;
|
|
26
|
+
};
|
|
27
|
+
export const getJamReactionPreferences = () => read();
|
|
28
|
+
export const setJamReactionPreferences = (update) => {
|
|
29
|
+
const current = read();
|
|
30
|
+
const next = typeof update === 'function' ? update(current) : { ...current, ...update };
|
|
31
|
+
cache = next;
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
try {
|
|
34
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// ignore quota / unavailable storage
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
listeners.forEach((listener) => listener());
|
|
41
|
+
};
|
|
42
|
+
const subscribe = (listener) => {
|
|
43
|
+
listeners.add(listener);
|
|
44
|
+
return () => {
|
|
45
|
+
listeners.delete(listener);
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** Reactive accessor for the persisted reaction preferences. */
|
|
49
|
+
export function useJamReactionPreferences() {
|
|
50
|
+
const preferences = useSyncExternalStore(subscribe, read, () => defaults);
|
|
51
|
+
const update = useCallback((patch) => setJamReactionPreferences(patch), []);
|
|
52
|
+
return [preferences, update];
|
|
53
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JamEvent } from '@openpeepshq/common/types';
|
|
2
|
+
/** Mirrors Svelte `calculateRecordingState` in jams/helpers.ts. */
|
|
3
|
+
export declare const calculateRecordingState: (persistedEvents: JamEvent[], sessionEvents: JamEvent[]) => {
|
|
4
|
+
isRecording: boolean;
|
|
5
|
+
recordingStart: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const useJamRecordingState: () => {
|
|
8
|
+
isRecording: boolean;
|
|
9
|
+
recordingStart: string | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { getUniqueBy } from '@openpeepshq/common';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useJamContext } from './JamContext.js';
|
|
5
|
+
import { useJamEventsContext } from './JamEventsContext.js';
|
|
6
|
+
/** Mirrors Svelte `calculateRecordingState` in jams/helpers.ts. */
|
|
7
|
+
export const calculateRecordingState = (persistedEvents, sessionEvents) => {
|
|
8
|
+
const events = getUniqueBy([...persistedEvents, ...sessionEvents], (event) => event.id).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
9
|
+
const lastRecordingStart = events.find((event) => event.type === 'recordStart');
|
|
10
|
+
const lastRecordingStop = events.find((event) => event.type === 'recordStop');
|
|
11
|
+
const isRecording = !!lastRecordingStart &&
|
|
12
|
+
(!lastRecordingStop ||
|
|
13
|
+
lastRecordingStart.createdAt > lastRecordingStop.createdAt) &&
|
|
14
|
+
(Date.now() - new Date(lastRecordingStart.createdAt).getTime()) / 60_000 <
|
|
15
|
+
60;
|
|
16
|
+
const recordingStart = isRecording ? lastRecordingStart.createdAt : undefined;
|
|
17
|
+
return { isRecording, recordingStart };
|
|
18
|
+
};
|
|
19
|
+
export const useJamRecordingState = () => {
|
|
20
|
+
const { jamPost } = useJamContext();
|
|
21
|
+
const { sessionEvents } = useJamEventsContext();
|
|
22
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
23
|
+
const eventsQuery = openpeepsApi.useJamEvents(jamPost.id);
|
|
24
|
+
return useMemo(() => calculateRecordingState(eventsQuery.data ?? [], sessionEvents), [eventsQuery.data, sessionEvents]);
|
|
25
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const SKIN_TONE_MODIFIERS: string[];
|
|
2
|
+
export declare const SKIN_TONE_OPTIONS: readonly [{
|
|
3
|
+
readonly tone: 0;
|
|
4
|
+
readonly emoji: "🖐️";
|
|
5
|
+
}, {
|
|
6
|
+
readonly tone: 1;
|
|
7
|
+
readonly emoji: "🖐🏻";
|
|
8
|
+
}, {
|
|
9
|
+
readonly tone: 2;
|
|
10
|
+
readonly emoji: "🖐🏼";
|
|
11
|
+
}, {
|
|
12
|
+
readonly tone: 3;
|
|
13
|
+
readonly emoji: "🖐🏽";
|
|
14
|
+
}, {
|
|
15
|
+
readonly tone: 4;
|
|
16
|
+
readonly emoji: "🖐🏾";
|
|
17
|
+
}, {
|
|
18
|
+
readonly tone: 5;
|
|
19
|
+
readonly emoji: "🖐🏿";
|
|
20
|
+
}];
|
|
21
|
+
export declare function stripSkinTone(emoji: string): string;
|
|
22
|
+
export declare function supportsSkinTone(emoji: string): boolean;
|
|
23
|
+
export declare function applySkinTone(emoji: string, skinTone: number): string;
|
|
24
|
+
export declare function applySkinToneToDefault(emoji: string, skinTone: number): string;
|
|
25
|
+
export declare function applySkinToneToRecentEmojis(recentEmojis: string[], skinTone: number): string[];
|
|
26
|
+
export declare function isDefaultEmoji(emoji: string): boolean;
|
|
27
|
+
export declare function addRecentEmoji(recentEmojis: string[], emoji: string): string[];
|
|
28
|
+
export declare function getSkinToneEmoji(tone: number): string;
|
|
29
|
+
export declare function syncEmojiPickerSkinTone(skinTone: number): Promise<void>;
|
|
30
|
+
export declare function hideEmojiPickerSkinToneSelector(picker: HTMLElement): void;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { emojis } from './constants.js';
|
|
2
|
+
const SKIN_TONE_PATTERN = /[\u{1F3FB}-\u{1F3FF}]/u;
|
|
3
|
+
export const SKIN_TONE_MODIFIERS = [
|
|
4
|
+
'',
|
|
5
|
+
'\u{1F3FB}',
|
|
6
|
+
'\u{1F3FC}',
|
|
7
|
+
'\u{1F3FD}',
|
|
8
|
+
'\u{1F3FE}',
|
|
9
|
+
'\u{1F3FF}',
|
|
10
|
+
];
|
|
11
|
+
export const SKIN_TONE_OPTIONS = [
|
|
12
|
+
{ tone: 0, emoji: '🖐️' },
|
|
13
|
+
{ tone: 1, emoji: '🖐🏻' },
|
|
14
|
+
{ tone: 2, emoji: '🖐🏼' },
|
|
15
|
+
{ tone: 3, emoji: '🖐🏽' },
|
|
16
|
+
{ tone: 4, emoji: '🖐🏾' },
|
|
17
|
+
{ tone: 5, emoji: '🖐🏿' },
|
|
18
|
+
];
|
|
19
|
+
const defaultBaseEmojis = emojis.map(stripSkinTone);
|
|
20
|
+
const skinToneCapableDefaults = new Set(emojis.filter((emoji) => SKIN_TONE_PATTERN.test(emoji)).map(stripSkinTone));
|
|
21
|
+
export function stripSkinTone(emoji) {
|
|
22
|
+
return emoji.replace(SKIN_TONE_PATTERN, '');
|
|
23
|
+
}
|
|
24
|
+
export function supportsSkinTone(emoji) {
|
|
25
|
+
const base = stripSkinTone(emoji);
|
|
26
|
+
return SKIN_TONE_PATTERN.test(emoji) || skinToneCapableDefaults.has(base);
|
|
27
|
+
}
|
|
28
|
+
export function applySkinTone(emoji, skinTone) {
|
|
29
|
+
if (!supportsSkinTone(emoji)) {
|
|
30
|
+
return emoji;
|
|
31
|
+
}
|
|
32
|
+
const base = stripSkinTone(emoji);
|
|
33
|
+
return base + (SKIN_TONE_MODIFIERS[skinTone] ?? '');
|
|
34
|
+
}
|
|
35
|
+
export function applySkinToneToDefault(emoji, skinTone) {
|
|
36
|
+
const base = stripSkinTone(emoji);
|
|
37
|
+
if (!skinToneCapableDefaults.has(base)) {
|
|
38
|
+
return base;
|
|
39
|
+
}
|
|
40
|
+
return applySkinTone(emoji, skinTone);
|
|
41
|
+
}
|
|
42
|
+
export function applySkinToneToRecentEmojis(recentEmojis, skinTone) {
|
|
43
|
+
return recentEmojis.map((emoji) => applySkinTone(emoji, skinTone));
|
|
44
|
+
}
|
|
45
|
+
export function isDefaultEmoji(emoji) {
|
|
46
|
+
return defaultBaseEmojis.includes(stripSkinTone(emoji));
|
|
47
|
+
}
|
|
48
|
+
export function addRecentEmoji(recentEmojis, emoji) {
|
|
49
|
+
const withoutDuplicate = recentEmojis.filter((item) => item !== emoji);
|
|
50
|
+
return [emoji, ...withoutDuplicate].slice(0, 3);
|
|
51
|
+
}
|
|
52
|
+
export function getSkinToneEmoji(tone) {
|
|
53
|
+
return (SKIN_TONE_OPTIONS.find((option) => option.tone === tone)?.emoji ??
|
|
54
|
+
SKIN_TONE_OPTIONS[0].emoji);
|
|
55
|
+
}
|
|
56
|
+
let emojiPickerDatabase;
|
|
57
|
+
export async function syncEmojiPickerSkinTone(skinTone) {
|
|
58
|
+
const { default: Database } = await import('emoji-picker-element/database');
|
|
59
|
+
if (!emojiPickerDatabase) {
|
|
60
|
+
emojiPickerDatabase = new Database();
|
|
61
|
+
}
|
|
62
|
+
await emojiPickerDatabase.setPreferredSkinTone(skinTone);
|
|
63
|
+
}
|
|
64
|
+
export function hideEmojiPickerSkinToneSelector(picker) {
|
|
65
|
+
const root = picker.shadowRoot;
|
|
66
|
+
if (!root || root.querySelector('[data-hide-skintone]')) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const style = document.createElement('style');
|
|
70
|
+
style.setAttribute('data-hide-skintone', '');
|
|
71
|
+
style.textContent = '.skintone-button-wrapper { display: none !important; }';
|
|
72
|
+
root.appendChild(style);
|
|
73
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Room } from 'livekit-client';
|
|
2
|
+
/**
|
|
3
|
+
* Set of participant identities currently raising their hand, kept in sync with
|
|
4
|
+
* `ParticipantMetadataChanged` / connect / disconnect room events. Mirrors the
|
|
5
|
+
* Svelte `participantHandRaisedStore`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useRaisedHands(room: Room): Set<string>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { RoomEvent } from 'livekit-client';
|
|
3
|
+
import { parseParticipantMetadata } from './jamEventActions.js';
|
|
4
|
+
const computeRaisedHands = (room) => {
|
|
5
|
+
const raised = new Set();
|
|
6
|
+
const participants = [
|
|
7
|
+
room.localParticipant,
|
|
8
|
+
...room.remoteParticipants.values(),
|
|
9
|
+
];
|
|
10
|
+
for (const participant of participants) {
|
|
11
|
+
if (parseParticipantMetadata(participant.metadata).handRaised) {
|
|
12
|
+
raised.add(participant.identity);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return raised;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Set of participant identities currently raising their hand, kept in sync with
|
|
19
|
+
* `ParticipantMetadataChanged` / connect / disconnect room events. Mirrors the
|
|
20
|
+
* Svelte `participantHandRaisedStore`.
|
|
21
|
+
*/
|
|
22
|
+
export function useRaisedHands(room) {
|
|
23
|
+
const [hands, setHands] = useState(() => computeRaisedHands(room));
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const update = () => setHands(computeRaisedHands(room));
|
|
26
|
+
update();
|
|
27
|
+
room
|
|
28
|
+
.on(RoomEvent.ParticipantMetadataChanged, update)
|
|
29
|
+
.on(RoomEvent.ParticipantConnected, update)
|
|
30
|
+
.on(RoomEvent.ParticipantDisconnected, update);
|
|
31
|
+
return () => {
|
|
32
|
+
room
|
|
33
|
+
.off(RoomEvent.ParticipantMetadataChanged, update)
|
|
34
|
+
.off(RoomEvent.ParticipantConnected, update)
|
|
35
|
+
.off(RoomEvent.ParticipantDisconnected, update);
|
|
36
|
+
};
|
|
37
|
+
}, [room]);
|
|
38
|
+
return hands;
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getTheme } from '@openpeepshq/common/lib';
|
|
2
|
+
import { useCurrentProfileSettings } from '../layout/IdentityContext.js';
|
|
3
|
+
import { useServerInfo } from '../server-data/context.js';
|
|
4
|
+
/** LiveKit theme name matching the user's OpenPeeps light/dark preference. */
|
|
5
|
+
export const useJamLiveKitTheme = () => {
|
|
6
|
+
const serverInfo = useServerInfo();
|
|
7
|
+
const profileSettings = useCurrentProfileSettings();
|
|
8
|
+
const userTheme = getTheme(serverInfo.communityConfig, profileSettings);
|
|
9
|
+
return userTheme.dark ? 'default' : 'light';
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PartialQueryObserverResult } from '@openpeepshq/react-ui';
|
|
3
|
+
export interface AccessDeniedProps {
|
|
4
|
+
queries: PartialQueryObserverResult<unknown>[];
|
|
5
|
+
message?: string;
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
/** Shown for non–access-denied failures (e.g. not found). */
|
|
8
|
+
fallbackError?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Mirrors Svelte `AccessDenied.svelte`: distinguish capability failures from
|
|
12
|
+
* other query errors and render the appropriate UI.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AccessDenied({ queries, message, errorMessage, fallbackError, }: AccessDeniedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { EyeOff } from 'lucide-react';
|
|
3
|
+
import { useT } from '../../i18n/index.js';
|
|
4
|
+
const isAccessDeniedError = (queries) => {
|
|
5
|
+
const failed = queries.find((q) => q.isError || (!q.isPending && !q.isSuccess));
|
|
6
|
+
if (!failed?.error || typeof failed.error !== 'object')
|
|
7
|
+
return false;
|
|
8
|
+
const err = failed.error;
|
|
9
|
+
const status = err.status ?? err.statusCode;
|
|
10
|
+
return status === 401 || status === 403;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Mirrors Svelte `AccessDenied.svelte`: distinguish capability failures from
|
|
14
|
+
* other query errors and render the appropriate UI.
|
|
15
|
+
*/
|
|
16
|
+
export function AccessDenied({ queries, message, errorMessage = 'An error occurred.', fallbackError, }) {
|
|
17
|
+
const t = useT();
|
|
18
|
+
const deniedMessage = message ??
|
|
19
|
+
t('visibility.accessDenied', {
|
|
20
|
+
defaultValue: 'You do not have access to this content.',
|
|
21
|
+
});
|
|
22
|
+
if (isAccessDeniedError(queries)) {
|
|
23
|
+
return (_jsxs("span", { className: "flex flex-col items-center justify-center gap-2 p-6", children: [_jsx(EyeOff, { className: "size-12" }), _jsx("p", { children: deniedMessage })] }));
|
|
24
|
+
}
|
|
25
|
+
if (fallbackError)
|
|
26
|
+
return _jsx(_Fragment, { children: fallbackError });
|
|
27
|
+
return _jsx("p", { className: "p-6 text-center", children: errorMessage });
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type LoaderProps } from '@openpeepshq/react-ui';
|
|
3
|
+
export interface AccessDeniedLoaderProps extends Omit<LoaderProps, 'error'> {
|
|
4
|
+
/** @deprecated Use `fallbackError` — custom UI for non–access-denied errors. */
|
|
5
|
+
accessDenied?: ReactNode;
|
|
6
|
+
accessDeniedMessage?: string;
|
|
7
|
+
/** Shown for non–access-denied failures (e.g. profile not found). */
|
|
8
|
+
fallbackError?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Translation of @openpeepshq/svelte/components/layout/AccessDeniedLoader.svelte.
|
|
12
|
+
*
|
|
13
|
+
* Like {@link Loader} but renders {@link AccessDenied} in place of the default
|
|
14
|
+
* error UI, distinguishing capability failures from other query errors.
|
|
15
|
+
*/
|
|
16
|
+
export declare function AccessDeniedLoader({ accessDenied, accessDeniedMessage, fallbackError, queries, ...props }: AccessDeniedLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Loader } from '@openpeepshq/react-ui';
|
|
3
|
+
import { AccessDenied } from './AccessDenied.js';
|
|
4
|
+
/**
|
|
5
|
+
* Translation of @openpeepshq/svelte/components/layout/AccessDeniedLoader.svelte.
|
|
6
|
+
*
|
|
7
|
+
* Like {@link Loader} but renders {@link AccessDenied} in place of the default
|
|
8
|
+
* error UI, distinguishing capability failures from other query errors.
|
|
9
|
+
*/
|
|
10
|
+
export function AccessDeniedLoader({ accessDenied, accessDeniedMessage, fallbackError, queries = [], ...props }) {
|
|
11
|
+
return (_jsx(Loader, { ...props, queries: queries, error: accessDenied ?? (_jsx(AccessDenied, { queries: queries, message: accessDeniedMessage, fallbackError: fallbackError })) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface AuthLayoutProps {
|
|
3
|
+
description?: ReactNode;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
noRedirect?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Called when the auth layer wants to redirect the user — defaults to
|
|
8
|
+
* `window.location.assign(url)`. Pass your router's navigate to avoid full
|
|
9
|
+
* reloads.
|
|
10
|
+
*/
|
|
11
|
+
navigate?: (url: string) => void;
|
|
12
|
+
/** Forwarded as `?redirect=...` after login. */
|
|
13
|
+
redirectTo?: string | null;
|
|
14
|
+
/** True when `?payment=` is present in the URL. */
|
|
15
|
+
hasPayment?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Translation of @openpeepshq/svelte/components/layout/Auth.svelte. Renders the
|
|
19
|
+
* standard auth split-pane shell and triggers a redirect once an authenticated
|
|
20
|
+
* profile is detected.
|
|
21
|
+
*/
|
|
22
|
+
export declare function AuthLayout({ description, children, noRedirect, navigate, redirectTo, hasPayment, }: AuthLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { getTheme, isStripeActive } from '@openpeepshq/common';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { useServerInfo } from '../server-data/index.js';
|
|
6
|
+
import { useCurrentProfileSettings } from './IdentityContext.js';
|
|
7
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
8
|
+
import { useCredentialsStore } from '../../contexts/credentialsStore/index.js';
|
|
9
|
+
import { useHasAuthToken } from '../../contexts/openpeeps/hooks/useHasAuthToken.js';
|
|
10
|
+
/**
|
|
11
|
+
* Translation of @openpeepshq/svelte/components/layout/Auth.svelte. Renders the
|
|
12
|
+
* standard auth split-pane shell and triggers a redirect once an authenticated
|
|
13
|
+
* profile is detected.
|
|
14
|
+
*/
|
|
15
|
+
export function AuthLayout({ description, children, noRedirect = false, navigate, redirectTo, hasPayment = false, }) {
|
|
16
|
+
const serverInfo = useServerInfo();
|
|
17
|
+
const profileSettings = useCurrentProfileSettings();
|
|
18
|
+
const t = useT();
|
|
19
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
20
|
+
const { credentialsStore } = useCredentialsStore();
|
|
21
|
+
const hasToken = useHasAuthToken();
|
|
22
|
+
const userTheme = getTheme(serverInfo.communityConfig, profileSettings);
|
|
23
|
+
const stripeEnabled = !!serverInfo.payments?.stripe?.paidMembership?.enabled;
|
|
24
|
+
const tagLine = serverInfo.communityConfig?.info?.tagLine;
|
|
25
|
+
const profileQuery = openpeepsApi.useCurrentProfile?.();
|
|
26
|
+
// Mirror Auth.svelte: only check payment status for a signed-in user on a
|
|
27
|
+
// Stripe-enabled community, otherwise the request 401s for guests.
|
|
28
|
+
const paymentQuery = openpeepsApi.usePaymentStatus({
|
|
29
|
+
enabled: hasToken && stripeEnabled && !noRedirect,
|
|
30
|
+
});
|
|
31
|
+
const go = (url) => {
|
|
32
|
+
if (navigate)
|
|
33
|
+
navigate(url);
|
|
34
|
+
else if (typeof window !== 'undefined')
|
|
35
|
+
window.location.assign(url);
|
|
36
|
+
};
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (noRedirect)
|
|
39
|
+
return;
|
|
40
|
+
let cancelled = false;
|
|
41
|
+
(async () => {
|
|
42
|
+
const creds = await credentialsStore.get();
|
|
43
|
+
if (!creds?.token)
|
|
44
|
+
return;
|
|
45
|
+
if (stripeEnabled && paymentQuery?.isSuccess) {
|
|
46
|
+
if (isStripeActive(paymentQuery.data)) {
|
|
47
|
+
if (cancelled)
|
|
48
|
+
return;
|
|
49
|
+
if (hasPayment)
|
|
50
|
+
go('/welcome');
|
|
51
|
+
else if (!profileQuery?.isFetching &&
|
|
52
|
+
profileQuery?.isSuccess &&
|
|
53
|
+
profileQuery.data?.type === 'local') {
|
|
54
|
+
go(redirectTo || '/feeds/local');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else if (!profileQuery?.isFetching &&
|
|
59
|
+
profileQuery?.isSuccess &&
|
|
60
|
+
profileQuery.data?.type === 'local') {
|
|
61
|
+
if (cancelled)
|
|
62
|
+
return;
|
|
63
|
+
go(redirectTo || '/feeds/local');
|
|
64
|
+
}
|
|
65
|
+
})();
|
|
66
|
+
return () => {
|
|
67
|
+
cancelled = true;
|
|
68
|
+
};
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
+
}, [
|
|
71
|
+
noRedirect,
|
|
72
|
+
stripeEnabled,
|
|
73
|
+
hasPayment,
|
|
74
|
+
redirectTo,
|
|
75
|
+
profileQuery?.isFetching,
|
|
76
|
+
profileQuery?.isSuccess,
|
|
77
|
+
profileQuery?.data,
|
|
78
|
+
paymentQuery?.isSuccess,
|
|
79
|
+
paymentQuery?.data,
|
|
80
|
+
]);
|
|
81
|
+
return (_jsxs("div", { className: "h-screen w-full overflow-hidden md:flex md:h-full", children: [_jsx("div", { className: "flex-1", children: userTheme.backgroundAuth && (_jsx("img", { src: userTheme.backgroundAuth, alt: "Authentication background", className: "hidden h-full w-full object-cover md:block" })) }), _jsx("div", { className: "bg-card flex h-full w-full flex-1 justify-center overflow-y-auto md:h-auto", children: _jsxs("div", { className: "mx-auto h-fit space-y-4 p-4 md:mx-10 md:w-[60%]", children: [userTheme.logoSmall && (_jsx("img", { src: userTheme.logoSmall, alt: "logo", className: "mb-6 h-6 md:h-10" })), description ?? (_jsx("p", { className: "text-sm md:text-lg", children: tagLine || t('auth.tagline') })), _jsx("div", { children: children })] }) })] }));
|
|
82
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AuthorizationData, ProfileSettings, ProfileWithMeta, PublicAccount } from '@openpeepshq/common';
|
|
2
|
+
export interface IdentityContextValue {
|
|
3
|
+
profile?: ProfileWithMeta;
|
|
4
|
+
account?: PublicAccount;
|
|
5
|
+
profileSettings?: ProfileSettings;
|
|
6
|
+
}
|
|
7
|
+
export declare const IdentityContext: import("react").Context<IdentityContextValue>;
|
|
8
|
+
export declare const useIdentity: () => IdentityContextValue;
|
|
9
|
+
export declare const useCurrentProfile: () => ProfileWithMeta | undefined;
|
|
10
|
+
export declare const useCurrentAccount: () => {
|
|
11
|
+
id: string;
|
|
12
|
+
email: string;
|
|
13
|
+
emailValidated: boolean;
|
|
14
|
+
} | undefined;
|
|
15
|
+
export declare const useCurrentProfileSettings: () => ProfileSettings | undefined;
|
|
16
|
+
/** Profile + account from context and scopes from the stored JWT (mirrors Svelte `getCurrentAuthData`). */
|
|
17
|
+
export declare const useAuthData: () => AuthorizationData;
|