@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,191 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
import { persistedStore } from './createStore.js';
|
|
3
|
+
const defaultVisibility = (publicContent) => publicContent ? 'public' : 'local';
|
|
4
|
+
export const defaultNewEvent = (publicContent = false) => ({
|
|
5
|
+
type: 'event',
|
|
6
|
+
visibility: defaultVisibility(publicContent),
|
|
7
|
+
data: {
|
|
8
|
+
type: 'event',
|
|
9
|
+
start: new Date().toISOString(),
|
|
10
|
+
wholeDay: false,
|
|
11
|
+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
12
|
+
jam: {
|
|
13
|
+
type: 'video-call',
|
|
14
|
+
moderators: [],
|
|
15
|
+
videoEnabled: true,
|
|
16
|
+
speakers: [],
|
|
17
|
+
presenters: [],
|
|
18
|
+
audience: [],
|
|
19
|
+
waitingRoom: false,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
mentions: [],
|
|
23
|
+
});
|
|
24
|
+
export const defaultNewNote = (publicContent = false) => ({
|
|
25
|
+
type: 'note',
|
|
26
|
+
visibility: defaultVisibility(publicContent),
|
|
27
|
+
data: { type: 'note', content: '' },
|
|
28
|
+
mentions: [],
|
|
29
|
+
});
|
|
30
|
+
export const defaultNewQuestion = (publicContent = false) => ({
|
|
31
|
+
type: 'question',
|
|
32
|
+
visibility: defaultVisibility(publicContent),
|
|
33
|
+
data: {
|
|
34
|
+
type: 'question',
|
|
35
|
+
content: '',
|
|
36
|
+
options: [
|
|
37
|
+
{ type: 'note', content: '' },
|
|
38
|
+
{ type: 'note', content: '' },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
mentions: [],
|
|
42
|
+
});
|
|
43
|
+
export const defaultNewArticle = (publicContent = false) => ({
|
|
44
|
+
type: 'article',
|
|
45
|
+
visibility: defaultVisibility(publicContent),
|
|
46
|
+
data: { type: 'article', content: '' },
|
|
47
|
+
});
|
|
48
|
+
export const eventSanitizer = (publicContent = false) => {
|
|
49
|
+
const def = defaultNewEvent(publicContent);
|
|
50
|
+
return (event) => {
|
|
51
|
+
if (event.type !== 'event' || event.data.type !== 'event')
|
|
52
|
+
return def;
|
|
53
|
+
return {
|
|
54
|
+
type: 'event',
|
|
55
|
+
visibility: event.visibility,
|
|
56
|
+
data: {
|
|
57
|
+
type: 'event',
|
|
58
|
+
start: event.data.start,
|
|
59
|
+
wholeDay: event.data.wholeDay,
|
|
60
|
+
timeZone: event.data.timeZone,
|
|
61
|
+
jam: event.data.jam,
|
|
62
|
+
url: event.data.url,
|
|
63
|
+
physicalLocation: event.data.physicalLocation,
|
|
64
|
+
image: event.data.image,
|
|
65
|
+
name: event.data.name,
|
|
66
|
+
content: event.data.content,
|
|
67
|
+
end: event.data.end,
|
|
68
|
+
attendeeListPublic: event.data.attendeeListPublic,
|
|
69
|
+
...(event.data.maxAttendees != null
|
|
70
|
+
? { maxAttendees: event.data.maxAttendees }
|
|
71
|
+
: {}),
|
|
72
|
+
},
|
|
73
|
+
mentions: event.mentions,
|
|
74
|
+
audience: event.audience,
|
|
75
|
+
groupId: event.groupId,
|
|
76
|
+
inReplyToId: event.inReplyToId,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
let initialized;
|
|
81
|
+
const ensureInitialized = (publicContent = false) => {
|
|
82
|
+
if (initialized)
|
|
83
|
+
return initialized;
|
|
84
|
+
const jam = persistedStore('new-jam-state', defaultNewEvent(publicContent));
|
|
85
|
+
const event = persistedStore('new-event-state', defaultNewEvent(publicContent));
|
|
86
|
+
const article = persistedStore('new-article-state', defaultNewArticle(publicContent));
|
|
87
|
+
const note = persistedStore('new-note-state', defaultNewNote(publicContent));
|
|
88
|
+
const question = persistedStore('new-question-state', defaultNewQuestion(publicContent));
|
|
89
|
+
initialized = {
|
|
90
|
+
get jam() {
|
|
91
|
+
return jam.get();
|
|
92
|
+
},
|
|
93
|
+
set jam(v) {
|
|
94
|
+
jam.set(v);
|
|
95
|
+
},
|
|
96
|
+
resetNewJamState: () => jam.reset(),
|
|
97
|
+
get event() {
|
|
98
|
+
return event.get();
|
|
99
|
+
},
|
|
100
|
+
set event(v) {
|
|
101
|
+
event.set(v);
|
|
102
|
+
},
|
|
103
|
+
resetNewEventState: () => event.reset(),
|
|
104
|
+
get article() {
|
|
105
|
+
return article.get();
|
|
106
|
+
},
|
|
107
|
+
set article(v) {
|
|
108
|
+
article.set(v);
|
|
109
|
+
},
|
|
110
|
+
resetNewArticleState: () => article.reset(),
|
|
111
|
+
get note() {
|
|
112
|
+
return note.get();
|
|
113
|
+
},
|
|
114
|
+
set note(v) {
|
|
115
|
+
note.set(v);
|
|
116
|
+
},
|
|
117
|
+
resetNewNoteState: () => note.reset(),
|
|
118
|
+
get question() {
|
|
119
|
+
return question.get();
|
|
120
|
+
},
|
|
121
|
+
set question(v) {
|
|
122
|
+
question.set(v);
|
|
123
|
+
},
|
|
124
|
+
resetNewQuestionState: () => question.reset(),
|
|
125
|
+
};
|
|
126
|
+
// wire subscribe so React `useNewPostStores` can re-render on writes
|
|
127
|
+
internalStores = { jam, event, article, note, question };
|
|
128
|
+
return initialized;
|
|
129
|
+
};
|
|
130
|
+
let internalStores;
|
|
131
|
+
export const initializeNewPostStores = (publicContent = false) => {
|
|
132
|
+
ensureInitialized(publicContent);
|
|
133
|
+
};
|
|
134
|
+
export const getNewPostStores = () => ensureInitialized();
|
|
135
|
+
export const useNewPostStores = () => {
|
|
136
|
+
ensureInitialized();
|
|
137
|
+
// Subscribe to all five sub-stores so any write triggers a re-render.
|
|
138
|
+
useSyncExternalStore((l) => {
|
|
139
|
+
const subs = [
|
|
140
|
+
internalStores.jam.subscribe(l),
|
|
141
|
+
internalStores.event.subscribe(l),
|
|
142
|
+
internalStores.article.subscribe(l),
|
|
143
|
+
internalStores.note.subscribe(l),
|
|
144
|
+
internalStores.question.subscribe(l),
|
|
145
|
+
];
|
|
146
|
+
return () => subs.forEach((u) => u());
|
|
147
|
+
}, () => null, () => null);
|
|
148
|
+
return initialized;
|
|
149
|
+
};
|
|
150
|
+
const defaultReplyData = (inReplyToId) => ({
|
|
151
|
+
type: 'note',
|
|
152
|
+
visibility: 'public',
|
|
153
|
+
data: { type: 'note', content: '' },
|
|
154
|
+
inReplyToId,
|
|
155
|
+
mentions: [],
|
|
156
|
+
});
|
|
157
|
+
const replyStores = new Map();
|
|
158
|
+
/** Persisted draft store for a reply to a specific post. */
|
|
159
|
+
export const getReplyStore = (inReplyToId) => {
|
|
160
|
+
const existing = replyStores.get(inReplyToId);
|
|
161
|
+
if (existing)
|
|
162
|
+
return existing;
|
|
163
|
+
const store = persistedStore(`reply-data-${inReplyToId}`, defaultReplyData(inReplyToId));
|
|
164
|
+
replyStores.set(inReplyToId, store);
|
|
165
|
+
return store;
|
|
166
|
+
};
|
|
167
|
+
export const resetReplyData = (inReplyToId) => {
|
|
168
|
+
getReplyStore(inReplyToId).reset();
|
|
169
|
+
};
|
|
170
|
+
export const useReplyStore = (inReplyToId) => {
|
|
171
|
+
const store = getReplyStore(inReplyToId);
|
|
172
|
+
useSyncExternalStore(store.subscribe, store.get, store.get);
|
|
173
|
+
return store;
|
|
174
|
+
};
|
|
175
|
+
export const resetStore = (type) => {
|
|
176
|
+
const stores = getNewPostStores();
|
|
177
|
+
switch (type) {
|
|
178
|
+
case 'event':
|
|
179
|
+
case 'note':
|
|
180
|
+
stores.resetNewEventState();
|
|
181
|
+
return;
|
|
182
|
+
case 'question':
|
|
183
|
+
stores.resetNewQuestionState();
|
|
184
|
+
return;
|
|
185
|
+
case 'article':
|
|
186
|
+
stores.resetNewArticleState();
|
|
187
|
+
return;
|
|
188
|
+
default:
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { PageHeader } from './types';
|
|
3
|
+
export declare const pageHeaderStore: import("./createStore").ReactStore<PageHeader | undefined>;
|
|
4
|
+
export declare const usePageHeader: () => PageHeader | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Mount-scoped page header. Equivalent to `setPageHeader` from
|
|
7
|
+
* @openpeepshq/svelte (which used `onMount` + cleanup).
|
|
8
|
+
*
|
|
9
|
+
* Accepts primitives so deps stay stable across renders without forcing
|
|
10
|
+
* callers to memoize. The value is refreshed whenever any of `title`,
|
|
11
|
+
* `actions`, or `testId` changes. Cleanup runs in the same useLayoutEffect
|
|
12
|
+
* so unmount clears before the next page's layout effect sets its header
|
|
13
|
+
* (a separate useEffect cleanup would run after paint and wipe the new page).
|
|
14
|
+
*/
|
|
15
|
+
export declare const useSetPageHeader: (title?: ReactNode, actions?: ReactNode, testId?: string) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
import { createStore, useStore } from './createStore.js';
|
|
3
|
+
export const pageHeaderStore = createStore(undefined);
|
|
4
|
+
export const usePageHeader = () => useStore(pageHeaderStore);
|
|
5
|
+
/**
|
|
6
|
+
* Mount-scoped page header. Equivalent to `setPageHeader` from
|
|
7
|
+
* @openpeepshq/svelte (which used `onMount` + cleanup).
|
|
8
|
+
*
|
|
9
|
+
* Accepts primitives so deps stay stable across renders without forcing
|
|
10
|
+
* callers to memoize. The value is refreshed whenever any of `title`,
|
|
11
|
+
* `actions`, or `testId` changes. Cleanup runs in the same useLayoutEffect
|
|
12
|
+
* so unmount clears before the next page's layout effect sets its header
|
|
13
|
+
* (a separate useEffect cleanup would run after paint and wipe the new page).
|
|
14
|
+
*/
|
|
15
|
+
export const useSetPageHeader = (title, actions, testId) => {
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
pageHeaderStore.set({ title, actions, testId });
|
|
18
|
+
return () => {
|
|
19
|
+
pageHeaderStore.set(undefined);
|
|
20
|
+
};
|
|
21
|
+
}, [title, actions, testId]);
|
|
22
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PlusButtonActions } from './types';
|
|
2
|
+
export declare const plusButtonStore: import("./createStore").ReactStore<PlusButtonActions>;
|
|
3
|
+
export declare const usePlusButton: () => PlusButtonActions;
|
|
4
|
+
/** Mount-scoped helper — mirrors `setPlusButtonActions` from @openpeepshq/svelte. */
|
|
5
|
+
export declare const useSetPlusButtonActions: (actions: PlusButtonActions) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { createStore, useStore } from './createStore.js';
|
|
3
|
+
export const plusButtonStore = createStore(undefined);
|
|
4
|
+
export const usePlusButton = () => useStore(plusButtonStore);
|
|
5
|
+
/** Mount-scoped helper — mirrors `setPlusButtonActions` from @openpeepshq/svelte. */
|
|
6
|
+
export const useSetPlusButtonActions = (actions) => {
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
plusButtonStore.set(actions);
|
|
9
|
+
return () => {
|
|
10
|
+
plusButtonStore.set(undefined);
|
|
11
|
+
};
|
|
12
|
+
}, [actions]);
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconType } from '@openpeepshq/react-ui';
|
|
3
|
+
import type { PostCreationData } from '@openpeepshq/common';
|
|
4
|
+
export interface Crumb {
|
|
5
|
+
text: string;
|
|
6
|
+
link?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PageHeader {
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Optional `data-testid` to render on the title element. Lets pages keep their
|
|
13
|
+
* existing Playwright selectors after migrating their body `<h1>` into the
|
|
14
|
+
* shared chevron header bar.
|
|
15
|
+
*/
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PlusButtonAction {
|
|
19
|
+
action: string | (() => Promise<unknown> | unknown);
|
|
20
|
+
icon?: IconType;
|
|
21
|
+
title?: string;
|
|
22
|
+
}
|
|
23
|
+
export type PlusButtonActions = PlusButtonAction | PlusButtonAction[] | undefined;
|
|
24
|
+
export interface NewPostsState {
|
|
25
|
+
jam: PostCreationData;
|
|
26
|
+
resetNewJamState: () => void;
|
|
27
|
+
event: PostCreationData;
|
|
28
|
+
resetNewEventState: () => void;
|
|
29
|
+
article: PostCreationData;
|
|
30
|
+
resetNewArticleState: () => void;
|
|
31
|
+
note: PostCreationData;
|
|
32
|
+
resetNewNoteState: () => void;
|
|
33
|
+
question: PostCreationData;
|
|
34
|
+
resetNewQuestionState: () => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the URL to the HLS master playlist for a given storage id. Lives
|
|
3
|
+
* outside the API subtree (`/media/streaming/...`), so callers must supply
|
|
4
|
+
* the origin the source URL was served from rather than the API base URL.
|
|
5
|
+
*/
|
|
6
|
+
export declare const vodMasterPlaylistUrl: (storageId: string, origin: string) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the URL to the HLS master playlist for a given storage id. Lives
|
|
3
|
+
* outside the API subtree (`/media/streaming/...`), so callers must supply
|
|
4
|
+
* the origin the source URL was served from rather than the API base URL.
|
|
5
|
+
*/
|
|
6
|
+
export const vodMasterPlaylistUrl = (storageId, origin) => `${origin.replace(/\/$/, '')}/media/streaming/${storageId}/hls.m3u8`;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openpeepshq/react",
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"react-native": "./dist/react-native.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./pwa": "./dist/pwa/index.js",
|
|
14
|
+
"./pwa-vite": "./dist/pwa/vite.js",
|
|
15
|
+
"./service-worker": "./src/pwa/sw.ts",
|
|
16
|
+
"./*": "./dist/*/index.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"/dist",
|
|
20
|
+
"/src/pwa/sw.ts",
|
|
21
|
+
"/src/pwa/sw-types.ts",
|
|
22
|
+
"/src/pwa/navigationUrl.ts"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@livekit/components-react": "^2.9.21",
|
|
26
|
+
"@livekit/components-styles": "^1.1.6",
|
|
27
|
+
"@tanstack/react-query": "^5.0.0",
|
|
28
|
+
"@videojs/react": "^10.0.0-beta.24",
|
|
29
|
+
"emoji-picker-element": "^1.29.1",
|
|
30
|
+
"heic2any": "^0.0.4",
|
|
31
|
+
"i18next": "^24.2.3",
|
|
32
|
+
"i18next-http-backend": "^3.0.2",
|
|
33
|
+
"js-base64": "^3.7.7",
|
|
34
|
+
"livekit-client": "^2.1.2",
|
|
35
|
+
"lucide-react": "^0.469.0",
|
|
36
|
+
"marked": "^15.0.6",
|
|
37
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
38
|
+
"react-dom": "^18.3.1 || ^19.0.0",
|
|
39
|
+
"react-easy-crop": "^5.5.7",
|
|
40
|
+
"react-i18next": "^15.4.1",
|
|
41
|
+
"uuidv7": "^1.0.2",
|
|
42
|
+
"zod": "^4.4.3",
|
|
43
|
+
"@openpeepshq/client": "^0.1.36",
|
|
44
|
+
"@openpeepshq/greenscreen": "^0.1.0",
|
|
45
|
+
"@openpeepshq/common": "^0.1.43",
|
|
46
|
+
"@openpeepshq/react-ui": "^0.1.2"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
50
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^22.13.1",
|
|
54
|
+
"@types/react": "19.2.14",
|
|
55
|
+
"@types/react-dom": "19.2.3",
|
|
56
|
+
"concurrently": "^9.1.2",
|
|
57
|
+
"eslint": "^9.19.0",
|
|
58
|
+
"tsc-alias": "^1.8.10",
|
|
59
|
+
"typescript": "^5.7.3",
|
|
60
|
+
"vitest": "^2.1.8",
|
|
61
|
+
"@openpeepshq/fetch-client": "^0.1.6"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"lint": "prettier --check . && ESLINT_USE_FLAT_CONFIG=false eslint .",
|
|
65
|
+
"format": "prettier --write .",
|
|
66
|
+
"clean": "rm -rf tsconfig.tsbuildinfo dist",
|
|
67
|
+
"build": "tsc && tsc-alias",
|
|
68
|
+
"build:watch": "tsc && tsc-alias && (concurrently \"tsc -w\" \"tsc-alias -w\")",
|
|
69
|
+
"test": "vitest",
|
|
70
|
+
"test:run": "vitest run"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Router path helpers treat strings with a scheme as relative pathnames
|
|
3
|
+
* (e.g. `https://host/posts/1` → `/https:/host/posts/1`). Convert same-origin
|
|
4
|
+
* absolute URLs to path+search+hash before handing them to a router navigate.
|
|
5
|
+
*/
|
|
6
|
+
export const toRouterPath = (
|
|
7
|
+
url: string,
|
|
8
|
+
origin: string = typeof window !== 'undefined' ? window.location.origin : '',
|
|
9
|
+
): string => {
|
|
10
|
+
if (!url || !origin) return url;
|
|
11
|
+
try {
|
|
12
|
+
if (!(url.startsWith('http://') || url.startsWith('https://'))) {
|
|
13
|
+
return url;
|
|
14
|
+
}
|
|
15
|
+
const parsed = new URL(url);
|
|
16
|
+
if (parsed.origin !== origin) return url;
|
|
17
|
+
return `${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
18
|
+
} catch {
|
|
19
|
+
return url;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Path after the `goto:` prefix (supports absolute or relative targets). */
|
|
24
|
+
export const parseGotoAction = (action: string): string => {
|
|
25
|
+
if (!action.startsWith('goto:')) return '/';
|
|
26
|
+
return action.slice('goto:'.length) || '/';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Resolve a `goto:` action to an absolute URL for openWindow / Client.navigate,
|
|
31
|
+
* and a same-origin router path for in-page NAVIGATE_TO messages.
|
|
32
|
+
*/
|
|
33
|
+
export const resolveGotoTarget = (
|
|
34
|
+
action: string,
|
|
35
|
+
origin: string,
|
|
36
|
+
basePath: string = '/',
|
|
37
|
+
): { absoluteUrl: string; routerPath: string } => {
|
|
38
|
+
const gotoPath = parseGotoAction(action);
|
|
39
|
+
|
|
40
|
+
let absoluteUrl: string;
|
|
41
|
+
if (gotoPath.startsWith('http://') || gotoPath.startsWith('https://')) {
|
|
42
|
+
absoluteUrl = gotoPath;
|
|
43
|
+
} else {
|
|
44
|
+
const normalizedBase =
|
|
45
|
+
basePath === '/'
|
|
46
|
+
? ''
|
|
47
|
+
: basePath.endsWith('/')
|
|
48
|
+
? basePath.slice(0, -1)
|
|
49
|
+
: basePath;
|
|
50
|
+
const normalizedRel = gotoPath.startsWith('/') ? gotoPath : `/${gotoPath}`;
|
|
51
|
+
absoluteUrl = new URL(
|
|
52
|
+
`${normalizedBase}${normalizedRel}`,
|
|
53
|
+
origin,
|
|
54
|
+
).toString();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
absoluteUrl,
|
|
59
|
+
routerPath: toRouterPath(absoluteUrl, origin),
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message types exchanged between the page and the OpenPeeps service worker.
|
|
3
|
+
*/
|
|
4
|
+
export type SWMessageFromPage =
|
|
5
|
+
| { type: 'SKIP_WAITING' }
|
|
6
|
+
| { type: 'INVALIDATE_QUERIES_PORT' }
|
|
7
|
+
| { type: 'GET_PENDING_DEEPLINK' };
|
|
8
|
+
|
|
9
|
+
export type SWMessageToPage = { type: 'NAVIGATE_TO'; url: string };
|
package/src/pwa/sw.ts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/// <reference no-default-lib="true" />
|
|
2
|
+
/// <reference lib="esnext" />
|
|
3
|
+
/// <reference lib="webworker" />
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @openpeepshq/react PWA service worker.
|
|
7
|
+
*
|
|
8
|
+
* Framework-agnostic worker referenced from vite-plugin-pwa via
|
|
9
|
+
* `injectManifest`:
|
|
10
|
+
*
|
|
11
|
+
* VitePWA({
|
|
12
|
+
* strategies: 'injectManifest',
|
|
13
|
+
* srcDir: 'node_modules/@openpeepshq/react/dist/pwa',
|
|
14
|
+
* filename: 'sw.js',
|
|
15
|
+
* ...
|
|
16
|
+
* })
|
|
17
|
+
*
|
|
18
|
+
* It supports:
|
|
19
|
+
* - SKIP_WAITING from the page
|
|
20
|
+
* - INVALIDATE_QUERIES_PORT bridge so the page can refetch after a push
|
|
21
|
+
* - GET_PENDING_DEEPLINK fallback for iOS notification clicks
|
|
22
|
+
* - push event → showNotification + setAppBadge + invalidate queries
|
|
23
|
+
* - notificationclick `goto:` action → focus matching client / open window
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import type { NotificationOptionsType, PushMessage } from '@openpeepshq/common';
|
|
27
|
+
import { resolveGotoTarget } from './navigationUrl';
|
|
28
|
+
|
|
29
|
+
const PUSH_BASE_INVALIDATE_KEYS = [
|
|
30
|
+
['profiles', 'current', 'notifications', 'stats'],
|
|
31
|
+
['profiles', 'current', 'notifications'],
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
const dedupeQueryKeys = (
|
|
35
|
+
keys: readonly (readonly string[])[],
|
|
36
|
+
): (readonly string[])[] => {
|
|
37
|
+
const seen = new Set<string>();
|
|
38
|
+
return keys.filter((key) => {
|
|
39
|
+
const serialized = JSON.stringify(key);
|
|
40
|
+
if (seen.has(serialized)) return false;
|
|
41
|
+
seen.add(serialized);
|
|
42
|
+
return true;
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
declare const self: ServiceWorkerGlobalScope;
|
|
47
|
+
|
|
48
|
+
const log = (level: string, ...args: unknown[]) =>
|
|
49
|
+
console.log(`serviceWorker - ${level}`, ...args);
|
|
50
|
+
|
|
51
|
+
// `BASE_URL` is replaced at build time by vite-plugin-pwa or rolldown injection.
|
|
52
|
+
// We fall back to `self.registration.scope` at runtime when not present.
|
|
53
|
+
const base = (() => {
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
+
const fromEnv = (self as any).__OPENPEEPS_BASE__ as string | undefined;
|
|
56
|
+
if (fromEnv) return fromEnv;
|
|
57
|
+
try {
|
|
58
|
+
return new URL(self.registration.scope).pathname;
|
|
59
|
+
} catch {
|
|
60
|
+
return '/';
|
|
61
|
+
}
|
|
62
|
+
})();
|
|
63
|
+
|
|
64
|
+
let refreshPort: MessagePort | undefined;
|
|
65
|
+
let pendingDeepLink: string | undefined;
|
|
66
|
+
|
|
67
|
+
self.addEventListener('message', (event) => {
|
|
68
|
+
const data = event.data as { type?: string } | undefined;
|
|
69
|
+
if (data?.type === 'SKIP_WAITING') {
|
|
70
|
+
void self.skipWaiting();
|
|
71
|
+
}
|
|
72
|
+
if (data?.type === 'INVALIDATE_QUERIES_PORT') {
|
|
73
|
+
refreshPort = event.ports[0];
|
|
74
|
+
}
|
|
75
|
+
if (data?.type === 'GET_PENDING_DEEPLINK') {
|
|
76
|
+
if (pendingDeepLink) {
|
|
77
|
+
try {
|
|
78
|
+
(event.source as Client | null)?.postMessage({
|
|
79
|
+
type: 'NAVIGATE_TO',
|
|
80
|
+
url: pendingDeepLink,
|
|
81
|
+
});
|
|
82
|
+
} finally {
|
|
83
|
+
pendingDeepLink = undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
self.addEventListener('push', (event) => {
|
|
90
|
+
event.waitUntil(
|
|
91
|
+
(async () => {
|
|
92
|
+
const message: PushMessage =
|
|
93
|
+
((await event?.data?.json()) as PushMessage) ?? ({} as PushMessage);
|
|
94
|
+
|
|
95
|
+
const { notification, notificationStats } = message;
|
|
96
|
+
|
|
97
|
+
if (refreshPort) {
|
|
98
|
+
refreshPort.postMessage({
|
|
99
|
+
keys: dedupeQueryKeys([
|
|
100
|
+
...PUSH_BASE_INVALIDATE_KEYS,
|
|
101
|
+
...(notification?.invalidateQueries ?? []),
|
|
102
|
+
]),
|
|
103
|
+
notificationStats,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (
|
|
108
|
+
notificationStats?.unseen !== undefined &&
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
|
+
typeof (self.navigator as any).setAppBadge === 'function'
|
|
111
|
+
) {
|
|
112
|
+
try {
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
114
|
+
await (self.navigator as any).setAppBadge(notificationStats.unseen);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
log('warn', 'setAppBadge failed', err);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (notification) {
|
|
121
|
+
await self.registration.showNotification(
|
|
122
|
+
notification.title ?? '',
|
|
123
|
+
notification.options,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
})(),
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
self.addEventListener('notificationclick', (event) => {
|
|
131
|
+
const action =
|
|
132
|
+
event.action ||
|
|
133
|
+
(event.notification as unknown as NotificationOptionsType)?.actions?.[0]
|
|
134
|
+
?.action ||
|
|
135
|
+
'';
|
|
136
|
+
|
|
137
|
+
event.notification.close();
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
|
|
140
|
+
if (!action.startsWith('goto:')) return;
|
|
141
|
+
|
|
142
|
+
const origin = self.location.origin;
|
|
143
|
+
// Absolute URL for openWindow / Client.navigate; path-only for in-page
|
|
144
|
+
// NAVIGATE_TO — React Router treats scheme URLs as relative pathnames.
|
|
145
|
+
const { absoluteUrl, routerPath } = resolveGotoTarget(
|
|
146
|
+
action,
|
|
147
|
+
origin,
|
|
148
|
+
base ?? '/',
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
pendingDeepLink = routerPath;
|
|
152
|
+
|
|
153
|
+
event.waitUntil(
|
|
154
|
+
self.clients
|
|
155
|
+
.matchAll({ type: 'window', includeUncontrolled: true })
|
|
156
|
+
.then(async (clientList) => {
|
|
157
|
+
for (const client of clientList) {
|
|
158
|
+
if (
|
|
159
|
+
client.url &&
|
|
160
|
+
client.url.startsWith(origin) &&
|
|
161
|
+
'focus' in client
|
|
162
|
+
) {
|
|
163
|
+
try {
|
|
164
|
+
try {
|
|
165
|
+
(client as WindowClient).postMessage({
|
|
166
|
+
type: 'NAVIGATE_TO',
|
|
167
|
+
url: routerPath,
|
|
168
|
+
});
|
|
169
|
+
} catch {
|
|
170
|
+
// ignore
|
|
171
|
+
}
|
|
172
|
+
if (client.url !== absoluteUrl && 'navigate' in client) {
|
|
173
|
+
const c = await (client as WindowClient)
|
|
174
|
+
.navigate(absoluteUrl)
|
|
175
|
+
.catch(() => undefined);
|
|
176
|
+
return (c ?? client).focus();
|
|
177
|
+
}
|
|
178
|
+
return client.focus();
|
|
179
|
+
} catch {
|
|
180
|
+
// try next candidate
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (self.clients.openWindow) {
|
|
186
|
+
await self.clients.openWindow(absoluteUrl).catch(() => undefined);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const start = Date.now();
|
|
190
|
+
const timeoutMs = 3000;
|
|
191
|
+
const intervalMs = 300;
|
|
192
|
+
|
|
193
|
+
async function tryNotifyClient(): Promise<void> {
|
|
194
|
+
const list = await self.clients.matchAll({
|
|
195
|
+
type: 'window',
|
|
196
|
+
includeUncontrolled: true,
|
|
197
|
+
});
|
|
198
|
+
for (const c of list) {
|
|
199
|
+
if (c.url && c.url.startsWith(origin)) {
|
|
200
|
+
try {
|
|
201
|
+
(c as WindowClient).postMessage({
|
|
202
|
+
type: 'NAVIGATE_TO',
|
|
203
|
+
url: routerPath,
|
|
204
|
+
});
|
|
205
|
+
} catch {
|
|
206
|
+
// ignore
|
|
207
|
+
}
|
|
208
|
+
try {
|
|
209
|
+
await c.focus();
|
|
210
|
+
} catch {
|
|
211
|
+
// ignore
|
|
212
|
+
}
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (Date.now() - start < timeoutMs) {
|
|
217
|
+
await new Promise((r) => setTimeout(r, intervalMs));
|
|
218
|
+
return tryNotifyClient();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return tryNotifyClient();
|
|
223
|
+
})
|
|
224
|
+
.catch(() => undefined),
|
|
225
|
+
);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
export {};
|