@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,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Image } from 'lucide-react';
|
|
3
|
+
import { useT } from '../../i18n/index.js';
|
|
4
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
5
|
+
import { Avatar } from '../profile/index.js';
|
|
6
|
+
import { useReplyModal } from './post-form/ReplyModalContext.js';
|
|
7
|
+
import { useSignUpLoginModal } from '../accounts/SignUpLoginModalContext.js';
|
|
8
|
+
export function ReplyBox({ post }) {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const profile = useCurrentProfile();
|
|
11
|
+
const { openReply } = useReplyModal();
|
|
12
|
+
const { openSignUpLogin } = useSignUpLoginModal();
|
|
13
|
+
const handleClick = (e) => {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
if (profile) {
|
|
17
|
+
openReply(post);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
openSignUpLogin();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs("button", { type: "button", title: profile
|
|
24
|
+
? t('posts.replyBox.reply', { defaultValue: 'Reply' })
|
|
25
|
+
: t('posts.replyBox.logInToReply', {
|
|
26
|
+
defaultValue: 'Log in to reply',
|
|
27
|
+
}), onClick: handleClick, className: "flex w-full items-center gap-x-2 border-b-2 p-5", children: [_jsx(Avatar, { profile: profile, size: 2.5 }), _jsxs("span", { className: "bg-surface-200 hover:bg-surface-300 flex h-max w-full items-center justify-between rounded-full border-b border-t p-5", children: [_jsx("span", { children: t('posts.replyBox.addReplyPlaceholder', {
|
|
28
|
+
defaultValue: 'Add a reply…',
|
|
29
|
+
}) }), _jsx(Image, { size: 24 })] })] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface VideoPlayOverlayProps {
|
|
2
|
+
video: boolean;
|
|
3
|
+
}
|
|
4
|
+
/** Mirrors Svelte `VideoPlayOverlay.svelte` — play affordance on video thumbnails. */
|
|
5
|
+
export declare const VideoPlayOverlay: ({ video }: VideoPlayOverlayProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CirclePlay } from 'lucide-react';
|
|
3
|
+
/** Mirrors Svelte `VideoPlayOverlay.svelte` — play affordance on video thumbnails. */
|
|
4
|
+
export const VideoPlayOverlay = ({ video }) => {
|
|
5
|
+
if (!video)
|
|
6
|
+
return null;
|
|
7
|
+
return (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-black/60 text-white", children: _jsx(CirclePlay, { className: "size-8" }) }) }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MediaAttachmentData } from '@openpeepshq/common';
|
|
2
|
+
export declare const isBlobUrl: (url?: string | null) => boolean;
|
|
3
|
+
export declare const revokeBlobUrl: (url?: string) => void;
|
|
4
|
+
/** Prefer a persisted server URL over a local blob preview once available. */
|
|
5
|
+
export declare const resolveAttachmentPreviewUrl: (localPreviewUrl: string | undefined, attachment?: MediaAttachmentData) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const isBlobUrl = (url) => !!url?.startsWith('blob:');
|
|
2
|
+
export const revokeBlobUrl = (url) => {
|
|
3
|
+
if (isBlobUrl(url))
|
|
4
|
+
URL.revokeObjectURL(url);
|
|
5
|
+
};
|
|
6
|
+
/** Prefer a persisted server URL over a local blob preview once available. */
|
|
7
|
+
export const resolveAttachmentPreviewUrl = (localPreviewUrl, attachment) => {
|
|
8
|
+
const candidates = [
|
|
9
|
+
attachment?.previewUrl,
|
|
10
|
+
attachment?.url,
|
|
11
|
+
localPreviewUrl,
|
|
12
|
+
].filter((url) => !!url);
|
|
13
|
+
return (candidates.find((url) => !isBlobUrl(url)) ?? candidates[0] ?? '');
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PublicPost, SuccessFailureResponse } from '@openpeepshq/common/types';
|
|
2
|
+
import type { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
3
|
+
export type EventsFeedQuery = UseInfiniteQueryResult<InfiniteData<PublicPost[], unknown>, SuccessFailureResponse>;
|
|
4
|
+
export interface EventsFeedProps {
|
|
5
|
+
query: EventsFeedQuery;
|
|
6
|
+
}
|
|
7
|
+
export declare function EventsFeed({ query }: EventsFeedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { Rss } from 'lucide-react';
|
|
4
|
+
import { useT } from '../../../../i18n/index.js';
|
|
5
|
+
import { CardEvent } from '../../types/event/CardEvent.js';
|
|
6
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
7
|
+
export function EventsFeed({ query }) {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const sentinelRef = useRef(null);
|
|
10
|
+
const posts = useMemo(() => {
|
|
11
|
+
const flat = (query.data?.pages ?? []).flat();
|
|
12
|
+
const seen = new Set();
|
|
13
|
+
return flat.filter((p) => {
|
|
14
|
+
if (seen.has(p.id))
|
|
15
|
+
return false;
|
|
16
|
+
seen.add(p.id);
|
|
17
|
+
return true;
|
|
18
|
+
});
|
|
19
|
+
}, [query.data]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const el = sentinelRef.current;
|
|
22
|
+
if (!el)
|
|
23
|
+
return;
|
|
24
|
+
const observer = new IntersectionObserver((entries) => {
|
|
25
|
+
const entry = entries[0];
|
|
26
|
+
if (!entry)
|
|
27
|
+
return;
|
|
28
|
+
if (entry.isIntersecting &&
|
|
29
|
+
query.hasNextPage &&
|
|
30
|
+
!query.isFetchingNextPage) {
|
|
31
|
+
void query.fetchNextPage();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
observer.observe(el);
|
|
35
|
+
return () => observer.disconnect();
|
|
36
|
+
}, [query]);
|
|
37
|
+
if (query.isLoading) {
|
|
38
|
+
return (_jsx("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) }));
|
|
39
|
+
}
|
|
40
|
+
if (posts.length === 0) {
|
|
41
|
+
return (_jsxs("div", { className: "flex h-96 w-full flex-col items-center justify-center gap-y-4", children: [_jsx(Rss, { className: "text-surface-300 size-20" }), _jsx("p", { className: "text-xl", children: t('feed.empty', { defaultValue: 'No events yet.' }) })] }));
|
|
42
|
+
}
|
|
43
|
+
return (_jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [posts.map((post) => (_jsx(CardEvent, { post: post }, post.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "col-span-full h-8" }), query.isFetchingNextPage ? (_jsx("div", { className: "col-span-full flex justify-center py-4 text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) })) : null] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
export interface ThreadPostProps {
|
|
3
|
+
post: PublicPost;
|
|
4
|
+
isParent?: boolean;
|
|
5
|
+
isChild?: boolean;
|
|
6
|
+
noActions?: boolean;
|
|
7
|
+
noMenu?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function ThreadPost({ post, isParent, isChild, noActions, noMenu, }: ThreadPostProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar, ProfileLink } from '../../../profile/index.js';
|
|
3
|
+
import { usePostViewRef } from '../../../../lib/postViewCounter.js';
|
|
4
|
+
import { isUnreadPostForViewer } from '../../../../lib/postUnread.js';
|
|
5
|
+
import { useCurrentProfile } from '../../../layout/IdentityContext.js';
|
|
6
|
+
import { FeedPostContent } from '../../FeedPostContent.js';
|
|
7
|
+
import { PostActions } from '../../pieces/PostActions.js';
|
|
8
|
+
import { PostMenu } from '../../pieces/PostMenu.js';
|
|
9
|
+
import { UnreadPostIndicator } from '../../pieces/UnreadPostIndicator.js';
|
|
10
|
+
import { UpdatingDate } from '@openpeepshq/react-ui';
|
|
11
|
+
export function ThreadPost({ post, isParent = false, isChild = false, noActions = false, noMenu = false, }) {
|
|
12
|
+
const me = useCurrentProfile();
|
|
13
|
+
const isUnread = isUnreadPostForViewer(post, me?.id);
|
|
14
|
+
const postViewRef = usePostViewRef(post.id, {
|
|
15
|
+
groupId: post.groupId,
|
|
16
|
+
adjustUnread: isUnread,
|
|
17
|
+
});
|
|
18
|
+
return (_jsxs("div", { ref: postViewRef, className: "relative flex flex-row gap-2 p-2", children: [_jsx(UnreadPostIndicator, { show: isUnread, className: "left-0.5 top-5" }), _jsxs("div", { className: "relative w-12 shrink-0", children: [_jsx(ProfileLink, { profile: post.profile, children: _jsx(Avatar, { profile: post.profile, size: 3 }) }), isParent ? (_jsx("div", { className: "bg-surface-300 absolute left-6 top-12 h-[calc(100%-2rem)] w-px" })) : null, isChild ? (_jsx("div", { className: "bg-surface-300 absolute left-6 top-0 h-8 w-px" })) : null] }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "bg-surface-100 rounded-xl p-2", children: [_jsxs("div", { className: "mb-2 flex items-start justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx(ProfileLink, { profile: post.profile, className: "text-sm font-semibold hover:underline", children: post.profile.displayName || `@${post.profile.handle}` }), _jsxs("span", { className: "text-muted-foreground ml-2 text-xs", children: ["@", post.profile.handle] })] }), _jsxs("div", { className: "flex shrink-0 items-start gap-2", children: [_jsx("span", { className: "text-sm font-extralight", children: _jsx(UpdatingDate, { date: post.createdAt }) }), !noMenu ? _jsx(PostMenu, { post: post }) : null] })] }), _jsx(FeedPostContent, { post: post })] }), !noActions ? _jsx(PostActions, { post: post, compact: true }) : null] })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Thread } from '@openpeepshq/common';
|
|
2
|
+
export interface ThreadedFeedProps {
|
|
3
|
+
thread: Thread;
|
|
4
|
+
pathSelector?: (thread: Thread) => Thread & {
|
|
5
|
+
depth: number;
|
|
6
|
+
};
|
|
7
|
+
isAncestors?: boolean;
|
|
8
|
+
isDescendants?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function ThreadedFeed({ thread, pathSelector, isAncestors, isDescendants, }: ThreadedFeedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { collectPath, lastLongestPathSelector } from '../../../../lib/threadHelpers.js';
|
|
4
|
+
import { ThreadPost } from './ThreadPost.js';
|
|
5
|
+
export function ThreadedFeed({ thread, pathSelector = lastLongestPathSelector, isAncestors = false, isDescendants = false, }) {
|
|
6
|
+
const postList = useMemo(() => collectPath(pathSelector(thread)), [thread, pathSelector]);
|
|
7
|
+
return (_jsx("div", { className: "w-full", children: postList.map((post, index) => (_jsx("a", { href: `/posts/${post.id}`, className: "block w-full", children: _jsx(ThreadPost, { post: post, isParent: index !== postList.length - 1 || isAncestors, isChild: index !== 0 || isDescendants }) }, post.id))) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
/** Splits a string into user-visible grapheme clusters (so emojis don't get chopped). */
|
|
3
|
+
export declare const stringToSegments: (text: string) => string[];
|
|
4
|
+
export declare const postReactionStats: (post: PublicPost) => string;
|
|
5
|
+
/** Truncates markdown to roughly the first N words, preserving links. */
|
|
6
|
+
export declare const firstNWords: (markdown: string | undefined, n: number) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Splits a string into user-visible grapheme clusters (so emojis don't get chopped). */
|
|
2
|
+
export const stringToSegments = (text) => [...new Intl.Segmenter().segment(text)].map((x) => x.segment);
|
|
3
|
+
export const postReactionStats = (post) => {
|
|
4
|
+
const uniqueEmojis = [
|
|
5
|
+
...new Set(post.reactions.map((r) => stringToSegments(r.reaction)[0])),
|
|
6
|
+
].join('');
|
|
7
|
+
return `${uniqueEmojis} ${post.reactions?.length ?? 0}`;
|
|
8
|
+
};
|
|
9
|
+
/** Truncates markdown to roughly the first N words, preserving links. */
|
|
10
|
+
export const firstNWords = (markdown, n) => {
|
|
11
|
+
if (!markdown)
|
|
12
|
+
return '';
|
|
13
|
+
const regex = /\[.*?\]\(.*?\)|(\w+)/g;
|
|
14
|
+
let wordCount = 0;
|
|
15
|
+
const out = [];
|
|
16
|
+
let match;
|
|
17
|
+
while ((match = regex.exec(markdown)) !== null) {
|
|
18
|
+
if (wordCount >= n)
|
|
19
|
+
break;
|
|
20
|
+
out.push(match[0]);
|
|
21
|
+
wordCount++;
|
|
22
|
+
}
|
|
23
|
+
return out.join(' ');
|
|
24
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export { Feed } from './Feed';
|
|
2
|
+
export type { FeedProps, FeedQuery } from './Feed';
|
|
3
|
+
export { FeedPost } from './FeedPost';
|
|
4
|
+
export type { FeedPostProps } from './FeedPost';
|
|
5
|
+
export { FeedPostContent } from './FeedPostContent';
|
|
6
|
+
export { PostDetail } from './PostDetail';
|
|
7
|
+
export type { PostDetailProps } from './PostDetail';
|
|
8
|
+
export { PostMarkdown, OpenpeepsMarkdown } from './Markdown';
|
|
9
|
+
export { PostMenu } from './pieces/PostMenu';
|
|
10
|
+
export type { PostMenuProps } from './pieces/PostMenu';
|
|
11
|
+
export { ShareMenu } from './pieces/ShareMenu';
|
|
12
|
+
export type { ShareMenuProps } from './pieces/ShareMenu';
|
|
13
|
+
export { EventMenu } from './pieces/EventMenu';
|
|
14
|
+
export type { EventMenuProps } from './pieces/EventMenu';
|
|
15
|
+
export { ReactionsModal } from './pieces/modals/ReactionsModal';
|
|
16
|
+
export { RepostModal } from './pieces/modals/RepostModal';
|
|
17
|
+
export { DeletePostModal } from './pieces/modals/DeletePostModal';
|
|
18
|
+
export { EditPostModal } from './post-form/EditPostModal';
|
|
19
|
+
export { useEditPostModal } from './post-form/EditPostModalContext';
|
|
20
|
+
export { ComposeAttachments } from './post-form/ComposeAttachments';
|
|
21
|
+
export { DescriptionEditModal } from './post-form/DescriptionEditModal';
|
|
22
|
+
export type { DescriptionEditModalProps } from './post-form/DescriptionEditModal';
|
|
23
|
+
export { OpenpeepsMarkdownInput } from './post-form/OpenpeepsMarkdownInput';
|
|
24
|
+
export type { OpenpeepsMarkdownInputProps } from './post-form/OpenpeepsMarkdownInput';
|
|
25
|
+
export { ArticleForm } from './post-form/ArticleForm';
|
|
26
|
+
export type { ArticleFormProps } from './post-form/ArticleForm';
|
|
27
|
+
export { EventForm } from './post-form/EventForm';
|
|
28
|
+
export type { EventFormProps } from './post-form/EventForm';
|
|
29
|
+
export { PreviewLink } from '../preview-link/PreviewLink';
|
|
30
|
+
export { NewNoteButton, useNewNotePlusButton } from './NewNoteButton';
|
|
31
|
+
export type { NewNoteButtonProps } from './NewNoteButton';
|
|
32
|
+
export { NewEventButton } from './NewEventButton';
|
|
33
|
+
export type { NewEventButtonProps } from './NewEventButton';
|
|
34
|
+
export { PinnedPost } from './PinnedPost';
|
|
35
|
+
export type { PinnedPostProps } from './PinnedPost';
|
|
36
|
+
export { FullPostLayout } from './FullPostLayout';
|
|
37
|
+
export type { FullPostLayoutProps } from './FullPostLayout';
|
|
38
|
+
export { ReplyBox } from './ReplyBox';
|
|
39
|
+
export type { ReplyBoxProps } from './ReplyBox';
|
|
40
|
+
export { EventsFeed } from './feed/events/EventsFeed';
|
|
41
|
+
export type { EventsFeedProps, EventsFeedQuery, } from './feed/events/EventsFeed';
|
|
42
|
+
export { ThreadedFeed } from './feed/threaded/ThreadedFeed';
|
|
43
|
+
export type { ThreadedFeedProps } from './feed/threaded/ThreadedFeed';
|
|
44
|
+
export { ThreadPost } from './feed/threaded/ThreadPost';
|
|
45
|
+
export type { ThreadPostProps } from './feed/threaded/ThreadPost';
|
|
46
|
+
export { CardEvent } from './types/event/CardEvent';
|
|
47
|
+
export type { CardEventProps } from './types/event/CardEvent';
|
|
48
|
+
export { ProfileEventRelationship } from './types/event/ProfileEventRelationship';
|
|
49
|
+
export type { ProfileEventRelationshipProps } from './types/event/ProfileEventRelationship';
|
|
50
|
+
export { ParticipantsCard } from './pieces/ParticipantsCard';
|
|
51
|
+
export type { ParticipantsCardProps } from './pieces/ParticipantsCard';
|
|
52
|
+
export { FullNote } from './types/note/FullNote';
|
|
53
|
+
export { FullArticle } from './types/article/FullArticle';
|
|
54
|
+
export { FullPoll } from './types/poll/FullPoll';
|
|
55
|
+
export { FullEvent } from './types/event/FullEvent';
|
|
56
|
+
export { PollContent } from './pieces/PollContent';
|
|
57
|
+
export type { PollContentProps } from './pieces/PollContent';
|
|
58
|
+
export { EventLocation } from './pieces/EventLocation';
|
|
59
|
+
export type { EventLocationProps } from './pieces/EventLocation';
|
|
60
|
+
export { EventRsvpButton } from './pieces/EventRsvpButton';
|
|
61
|
+
export type { EventRsvpButtonProps } from './pieces/EventRsvpButton';
|
|
62
|
+
export { useNewPostModal } from './post-form/NewPostModalContext';
|
|
63
|
+
export { useReplyModal } from './post-form/ReplyModalContext';
|
|
64
|
+
export { PostInfoHeader } from './pieces/PostInfoHeader';
|
|
65
|
+
export { PostReactionHeader } from './pieces/PostReactionHeader';
|
|
66
|
+
export { FeedPostStats } from './pieces/FeedPostStats';
|
|
67
|
+
export { PostActions } from './pieces/PostActions';
|
|
68
|
+
export { Attachments } from './pieces/Attachments';
|
|
69
|
+
export { firstNWords, postReactionStats, stringToSegments } from './helpers';
|
|
70
|
+
export { FeedNote } from './types/Note';
|
|
71
|
+
export { FeedArticle } from './types/Article';
|
|
72
|
+
export { FeedEvent } from './types/Event';
|
|
73
|
+
export { FeedPoll } from './types/Poll';
|
|
74
|
+
/**
|
|
75
|
+
* Default visibility helper. Translation of
|
|
76
|
+
* `@openpeepshq/svelte/utils/postHelpers.ts::getDefaultVisibility()`.
|
|
77
|
+
*/
|
|
78
|
+
export { useDefaultVisibility } from './visibility';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export { Feed } from './Feed.js';
|
|
2
|
+
export { FeedPost } from './FeedPost.js';
|
|
3
|
+
export { FeedPostContent } from './FeedPostContent.js';
|
|
4
|
+
export { PostDetail } from './PostDetail.js';
|
|
5
|
+
export { PostMarkdown, OpenpeepsMarkdown } from './Markdown.js';
|
|
6
|
+
export { PostMenu } from './pieces/PostMenu.js';
|
|
7
|
+
export { ShareMenu } from './pieces/ShareMenu.js';
|
|
8
|
+
export { EventMenu } from './pieces/EventMenu.js';
|
|
9
|
+
export { ReactionsModal } from './pieces/modals/ReactionsModal.js';
|
|
10
|
+
export { RepostModal } from './pieces/modals/RepostModal.js';
|
|
11
|
+
export { DeletePostModal } from './pieces/modals/DeletePostModal.js';
|
|
12
|
+
export { EditPostModal } from './post-form/EditPostModal.js';
|
|
13
|
+
export { useEditPostModal } from './post-form/EditPostModalContext.js';
|
|
14
|
+
export { ComposeAttachments } from './post-form/ComposeAttachments.js';
|
|
15
|
+
export { DescriptionEditModal } from './post-form/DescriptionEditModal.js';
|
|
16
|
+
export { OpenpeepsMarkdownInput } from './post-form/OpenpeepsMarkdownInput.js';
|
|
17
|
+
export { ArticleForm } from './post-form/ArticleForm.js';
|
|
18
|
+
export { EventForm } from './post-form/EventForm.js';
|
|
19
|
+
export { PreviewLink } from '../preview-link/PreviewLink.js';
|
|
20
|
+
export { NewNoteButton, useNewNotePlusButton } from './NewNoteButton.js';
|
|
21
|
+
export { NewEventButton } from './NewEventButton.js';
|
|
22
|
+
export { PinnedPost } from './PinnedPost.js';
|
|
23
|
+
export { FullPostLayout } from './FullPostLayout.js';
|
|
24
|
+
export { ReplyBox } from './ReplyBox.js';
|
|
25
|
+
export { EventsFeed } from './feed/events/EventsFeed.js';
|
|
26
|
+
export { ThreadedFeed } from './feed/threaded/ThreadedFeed.js';
|
|
27
|
+
export { ThreadPost } from './feed/threaded/ThreadPost.js';
|
|
28
|
+
export { CardEvent } from './types/event/CardEvent.js';
|
|
29
|
+
export { ProfileEventRelationship } from './types/event/ProfileEventRelationship.js';
|
|
30
|
+
export { ParticipantsCard } from './pieces/ParticipantsCard.js';
|
|
31
|
+
export { FullNote } from './types/note/FullNote.js';
|
|
32
|
+
export { FullArticle } from './types/article/FullArticle.js';
|
|
33
|
+
export { FullPoll } from './types/poll/FullPoll.js';
|
|
34
|
+
export { FullEvent } from './types/event/FullEvent.js';
|
|
35
|
+
export { PollContent } from './pieces/PollContent.js';
|
|
36
|
+
export { EventLocation } from './pieces/EventLocation.js';
|
|
37
|
+
export { EventRsvpButton } from './pieces/EventRsvpButton.js';
|
|
38
|
+
export { useNewPostModal } from './post-form/NewPostModalContext.js';
|
|
39
|
+
export { useReplyModal } from './post-form/ReplyModalContext.js';
|
|
40
|
+
// Sub-components are exported so callers can rebuild their own post layouts.
|
|
41
|
+
export { PostInfoHeader } from './pieces/PostInfoHeader.js';
|
|
42
|
+
export { PostReactionHeader } from './pieces/PostReactionHeader.js';
|
|
43
|
+
export { FeedPostStats } from './pieces/FeedPostStats.js';
|
|
44
|
+
export { PostActions } from './pieces/PostActions.js';
|
|
45
|
+
export { Attachments } from './pieces/Attachments.js';
|
|
46
|
+
// Helpers
|
|
47
|
+
export { firstNWords, postReactionStats, stringToSegments } from './helpers.js';
|
|
48
|
+
// Sub-component re-exports
|
|
49
|
+
export { FeedNote } from './types/Note.js';
|
|
50
|
+
export { FeedArticle } from './types/Article.js';
|
|
51
|
+
export { FeedEvent } from './types/Event.js';
|
|
52
|
+
export { FeedPoll } from './types/Poll.js';
|
|
53
|
+
/**
|
|
54
|
+
* Default visibility helper. Translation of
|
|
55
|
+
* `@openpeepshq/svelte/utils/postHelpers.ts::getDefaultVisibility()`.
|
|
56
|
+
*/
|
|
57
|
+
export { useDefaultVisibility } from './visibility.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useStaticRender } from '../../markdown/staticRender.js';
|
|
4
|
+
import { VideoPlayOverlay } from '../VideoPlayOverlay.js';
|
|
5
|
+
import { GalleryModal } from './GalleryModal.js';
|
|
6
|
+
const attachmentsOf = (post) => {
|
|
7
|
+
const data = post.data;
|
|
8
|
+
return data?.attachments ?? [];
|
|
9
|
+
};
|
|
10
|
+
const isImage = (att) => att.type === 'image' || att.meta?.mimetype?.startsWith('image/');
|
|
11
|
+
const isVideo = (att) => att.type === 'video' || att.meta?.mimetype?.startsWith('video/');
|
|
12
|
+
export function Attachments({ post }) {
|
|
13
|
+
const { enabled: staticRender } = useStaticRender();
|
|
14
|
+
const attachments = attachmentsOf(post);
|
|
15
|
+
const [galleryIndex, setGalleryIndex] = useState(null);
|
|
16
|
+
if (attachments.length === 0)
|
|
17
|
+
return null;
|
|
18
|
+
const single = attachments.length === 1;
|
|
19
|
+
const cols = single
|
|
20
|
+
? ''
|
|
21
|
+
: attachments.length === 2
|
|
22
|
+
? 'grid grid-cols-2'
|
|
23
|
+
: 'grid grid-cols-2 grid-rows-2';
|
|
24
|
+
// With a single attachment the grid has no fixed height, so the children
|
|
25
|
+
// must size to their content. Forcing `h-full` there collapses the media to
|
|
26
|
+
// zero height and the preview renders blank. Only constrain the height when
|
|
27
|
+
// there are multiple tiles sharing the grid.
|
|
28
|
+
const height = single ? '' : 'h-96 md:h-[486px]';
|
|
29
|
+
const tileClass = single ? 'w-full' : 'h-full w-full';
|
|
30
|
+
const mediaClass = single
|
|
31
|
+
? 'max-h-[600px] w-full object-contain'
|
|
32
|
+
: 'h-full w-full object-cover';
|
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: `mt-2 w-full gap-1 overflow-hidden rounded-md ${cols} ${height}`, children: attachments.map((att, idx) => {
|
|
34
|
+
const tile = (_jsx(_Fragment, { children: isImage(att) && (att.previewUrl || att.url) ? (_jsx("img", { src: att.previewUrl ?? att.url ?? '', alt: att.description ?? `attachment ${idx + 1}`, className: mediaClass })) : isVideo(att) && (att.previewUrl || att.url) ? (_jsxs("div", { className: "relative h-full w-full", children: [_jsx("img", { src: att.previewUrl ?? att.url ?? '', alt: att.description ?? `attachment ${idx + 1}`, className: mediaClass }), _jsx(VideoPlayOverlay, { video: true })] })) : (_jsxs("div", { className: "flex min-h-24 w-full flex-col items-center justify-center gap-1 p-4 text-center text-xs text-muted-foreground", children: [_jsx("span", { className: "break-all font-medium text-foreground", children: att.filename ?? att.description ?? `Attachment ${idx + 1}` }), att.meta?.mimetype ? (_jsx("span", { className: "uppercase", children: att.meta.mimetype })) : null] })) }));
|
|
35
|
+
if (staticRender) {
|
|
36
|
+
return (_jsx("div", { className: `${tileClass} overflow-hidden bg-surface-100`, children: tile }, `${att.url ?? idx}-${idx}`));
|
|
37
|
+
}
|
|
38
|
+
return (_jsx("button", { type: "button", className: `${tileClass} overflow-hidden bg-surface-100`, onClick: (e) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
setGalleryIndex(idx);
|
|
42
|
+
}, children: tile }, `${att.url ?? idx}-${idx}`));
|
|
43
|
+
}) }), galleryIndex !== null ? (_jsx(GalleryModal, { attachments: attachments, initialIndex: galleryIndex, onClose: () => setGalleryIndex(null) })) : null] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
export interface EventLocationProps {
|
|
3
|
+
post: PublicPost;
|
|
4
|
+
preview?: boolean;
|
|
5
|
+
truncate?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function EventLocation({ post, preview, truncate, }: EventLocationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ExternalLink, Link as LinkIcon, MapPin, PhoneCall, } from 'lucide-react';
|
|
3
|
+
import { getJamUrl, truncateText } from '@openpeepshq/common/lib';
|
|
4
|
+
import { useT } from '../../../i18n/index.js';
|
|
5
|
+
import { useStaticRender } from '../../markdown/staticRender.js';
|
|
6
|
+
export function EventLocation({ post, preview = true, truncate = false, }) {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { enabled: staticRender, baseUrl } = useStaticRender();
|
|
9
|
+
if (post.data?.type !== 'event')
|
|
10
|
+
return null;
|
|
11
|
+
const event = post.data;
|
|
12
|
+
const origin = staticRender
|
|
13
|
+
? baseUrl
|
|
14
|
+
: typeof window !== 'undefined'
|
|
15
|
+
? window.location.origin
|
|
16
|
+
: undefined;
|
|
17
|
+
const jamLink = getJamUrl(post.id, origin);
|
|
18
|
+
if (preview) {
|
|
19
|
+
return (_jsx("div", { className: "flex items-center gap-1 text-sm", children: event.physicalLocation ? (_jsxs(_Fragment, { children: [_jsx(MapPin, { className: "h-4 w-4 shrink-0" }), _jsx("span", { children: truncate
|
|
20
|
+
? truncateText(event.physicalLocation.text)
|
|
21
|
+
: event.physicalLocation.text })] })) : event.jam ? (_jsxs(_Fragment, { children: [_jsx(PhoneCall, { className: "h-4 w-4 shrink-0" }), _jsx("a", { href: jamLink, target: "_blank", rel: "noreferrer", className: "text-primary hover:underline", children: t('events.location.jam', { defaultValue: 'Jam Event' }) })] })) : event.url ? (_jsxs(_Fragment, { children: [_jsx(LinkIcon, { className: "h-4 w-4 shrink-0" }), _jsxs("a", { href: event.url, target: "_blank", rel: "noreferrer", className: "text-primary inline-flex items-center gap-1 hover:underline", children: [t('events.location.online', { defaultValue: 'Online' }), _jsx(ExternalLink, { className: "h-4 w-4" })] })] })) : null }));
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs("div", { className: "mt-4 flex gap-x-4", children: [_jsx("div", { className: "border-foreground/20 flex items-center justify-center rounded-md border px-4 py-1", children: event.physicalLocation ? (_jsx(MapPin, { className: "text-muted-foreground my-3", size: 24 })) : event.jam ? (_jsx(PhoneCall, { className: "text-muted-foreground my-3", size: 24 })) : event.url ? (_jsx(LinkIcon, { className: "text-muted-foreground my-3", size: 24 })) : null }), _jsx("div", { children: event.physicalLocation ? (_jsx("p", { children: truncate
|
|
24
|
+
? truncateText(event.physicalLocation.text)
|
|
25
|
+
: event.physicalLocation.text })) : event.jam ? (_jsxs(_Fragment, { children: [_jsx("p", { children: t('events.location.jam', { defaultValue: 'Jam Event' }) }), _jsx("a", { href: jamLink, target: "_blank", rel: "noreferrer", className: "text-primary mt-2 block text-sm", children: truncateText(jamLink, 30) })] })) : event.url ? (_jsxs(_Fragment, { children: [_jsx("p", { children: t('events.location.external', {
|
|
26
|
+
defaultValue: 'External Event',
|
|
27
|
+
}) }), _jsx("a", { href: event.url, target: "_blank", rel: "noreferrer", className: "text-primary mt-2 block text-sm", children: truncateText(event.url, 40) })] })) : null })] }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
export interface EventMenuProps {
|
|
3
|
+
post: PublicPost;
|
|
4
|
+
menuButton?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function EventMenu({ post, menuButton }: EventMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { CopyPlus, Pencil, Trash } from 'lucide-react';
|
|
4
|
+
import { checkPostCapabilities } from '@openpeepshq/common/lib';
|
|
5
|
+
import { PopupMenu, PopupMenuButton } from '@openpeepshq/react-ui';
|
|
6
|
+
import { useNavigate } from '../../../contexts/router/index.js';
|
|
7
|
+
import { useT } from '../../../i18n/index.js';
|
|
8
|
+
import { getNewPostStores } from '../../../stores/index.js';
|
|
9
|
+
import { useAuthData, useCurrentProfile } from '../../layout/IdentityContext.js';
|
|
10
|
+
import { useCapabilities } from '../../server-data/index.js';
|
|
11
|
+
import { DeletePostModal } from './modals/DeletePostModal.js';
|
|
12
|
+
export function EventMenu({ post, menuButton }) {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const navigate = useNavigate();
|
|
15
|
+
const me = useCurrentProfile();
|
|
16
|
+
const authData = useAuthData();
|
|
17
|
+
const capabilities = useCapabilities();
|
|
18
|
+
const [showDelete, setShowDelete] = useState(false);
|
|
19
|
+
const canDeletePost = useMemo(() => checkPostCapabilities(authData, ['core-posts-delete'], post, capabilities)
|
|
20
|
+
.success, [authData, post, capabilities]);
|
|
21
|
+
if (me?.id !== post.profile.id)
|
|
22
|
+
return null;
|
|
23
|
+
const duplicate = () => {
|
|
24
|
+
getNewPostStores().event = {
|
|
25
|
+
type: 'event',
|
|
26
|
+
visibility: post.visibility,
|
|
27
|
+
data: { ...post.data },
|
|
28
|
+
audience: post.audience,
|
|
29
|
+
groupId: post.groupId,
|
|
30
|
+
mentions: post.mentions,
|
|
31
|
+
};
|
|
32
|
+
navigate('/events/new');
|
|
33
|
+
};
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsxs(PopupMenu, { menuButton: menuButton, title: t('events.menu.title', { defaultValue: 'Event options' }), children: [_jsx(PopupMenuButton, { title: t('common.actions.edit', { defaultValue: 'Edit' }), text: t('common.actions.edit', { defaultValue: 'Edit' }), icon: Pencil, action: `/events/${post.id}/edit` }), canDeletePost ? (_jsx(PopupMenuButton, { title: t('common.actions.delete', { defaultValue: 'Delete' }), text: t('common.actions.delete', { defaultValue: 'Delete' }), icon: Trash, danger: true, action: () => setShowDelete(true) })) : null, _jsx(PopupMenuButton, { title: t('common.actions.duplicate', { defaultValue: 'Duplicate' }), text: t('common.actions.duplicate', { defaultValue: 'Duplicate' }), icon: CopyPlus, action: duplicate })] }), _jsx(DeletePostModal, { post: post, open: showDelete, onClose: () => setShowDelete(false), deleteCallback: () => window.history.back() })] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { calculateEffectiveRsvps, checkPostCapabilities, countYesRsvps, isCapacityEvent, } from '@openpeepshq/common/lib';
|
|
4
|
+
import { useOpenpeeps } from '../../../contexts/openpeeps/index.js';
|
|
5
|
+
import { useT } from '../../../i18n/index.js';
|
|
6
|
+
import { useAuthData, useCurrentProfile } from '../../layout/IdentityContext.js';
|
|
7
|
+
import { useCapabilities } from '../../server-data/index.js';
|
|
8
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
9
|
+
import { apiErrorMessage } from '../../../lib/apiErrorMessage.js';
|
|
10
|
+
export function EventRsvpButton({ post }) {
|
|
11
|
+
const t = useT();
|
|
12
|
+
const profile = useCurrentProfile();
|
|
13
|
+
const authData = useAuthData();
|
|
14
|
+
const capabilities = useCapabilities();
|
|
15
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
16
|
+
const rsvpToEvent = openpeepsApi.rsvpToEventAction({ id: post.id });
|
|
17
|
+
const [error, setError] = useState(null);
|
|
18
|
+
const eventData = post.data?.type === 'event' ? post.data : undefined;
|
|
19
|
+
const capacityEvent = eventData ? isCapacityEvent(eventData) : false;
|
|
20
|
+
const atCapacity = capacityEvent &&
|
|
21
|
+
eventData?.maxAttendees !== undefined &&
|
|
22
|
+
countYesRsvps(post) >= eventData.maxAttendees;
|
|
23
|
+
const myEvent = post.profile?.id === profile?.id;
|
|
24
|
+
const myRsvp = useMemo(() => calculateEffectiveRsvps(post).find((r) => r.profile.id === profile?.id), [post, profile?.id]);
|
|
25
|
+
const canRsvp = useMemo(() => checkPostCapabilities(authData, ['core-posts-rsvp'], post, capabilities)
|
|
26
|
+
.success, [authData, post, capabilities]);
|
|
27
|
+
if (myEvent || !profile)
|
|
28
|
+
return null;
|
|
29
|
+
if (!canRsvp && !(myRsvp && myRsvp.response !== 'no'))
|
|
30
|
+
return null;
|
|
31
|
+
const respond = async (response) => {
|
|
32
|
+
setError(null);
|
|
33
|
+
try {
|
|
34
|
+
await rsvpToEvent({ response });
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
setError(apiErrorMessage(err, t));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
if (myRsvp?.response === 'removed') {
|
|
41
|
+
return (_jsx("p", { className: "text-muted-foreground mt-4 text-center text-sm", children: t('events.rsvp.removedMessage', {
|
|
42
|
+
defaultValue: 'The organizer has removed you from this event.',
|
|
43
|
+
}) }));
|
|
44
|
+
}
|
|
45
|
+
const full = atCapacity && myRsvp?.response !== 'yes';
|
|
46
|
+
if (myRsvp && myRsvp.response !== 'no') {
|
|
47
|
+
return (_jsxs("div", { className: "w-full", children: [_jsx(Button, { variant: "variant-ringed-secondary", className: "text-error w-full", action: () => respond('no'), children: t('posts.rsvp.cancelRegistration', {
|
|
48
|
+
defaultValue: 'Cancel registration',
|
|
49
|
+
}) }), _jsx("p", { className: "mt-2 text-center text-sm", children: myRsvp.response === 'yes'
|
|
50
|
+
? t('posts.rsvp.attendingMessage', {
|
|
51
|
+
defaultValue: 'You are attending.',
|
|
52
|
+
})
|
|
53
|
+
: t('posts.rsvp.maybeMessage', {
|
|
54
|
+
defaultValue: 'You responded maybe.',
|
|
55
|
+
}) }), error ? (_jsx("p", { className: "text-error mt-2 text-center text-sm", children: error })) : null] }));
|
|
56
|
+
}
|
|
57
|
+
return (_jsxs("div", { className: "mt-4 w-full", children: [_jsxs("div", { className: "flex w-full gap-x-2", children: [_jsx(Button, { variant: "variant-filled-primary", className: "w-[70%]", disabled: full, action: () => respond('yes'), children: full
|
|
58
|
+
? t('events.rsvp.full', { defaultValue: 'Event is full' })
|
|
59
|
+
: t('posts.rsvp.register', { defaultValue: 'Register' }) }), !capacityEvent ? (_jsx(Button, { variant: "variant-ghost-primary", action: () => respond('tentative'), children: t('posts.rsvp.maybe', { defaultValue: 'Maybe' }) })) : null, _jsx(Button, { variant: "variant-ringed-primary", action: () => respond('no'), children: t('posts.rsvp.no', { defaultValue: 'No' }) })] }), error ? (_jsx("p", { className: "text-error mt-2 text-center text-sm", children: error })) : null] }));
|
|
60
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useT } from '../../../i18n/index.js';
|
|
4
|
+
import { postReactionStats } from '../helpers.js';
|
|
5
|
+
import { ReactionsModal } from './modals/ReactionsModal.js';
|
|
6
|
+
import { RepostModal } from './modals/RepostModal.js';
|
|
7
|
+
export function FeedPostStats({ post }) {
|
|
8
|
+
const t = useT();
|
|
9
|
+
const stats = post ? postReactionStats(post) : '';
|
|
10
|
+
const [modal, setModal] = useState(null);
|
|
11
|
+
const stop = (handler) => (e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
handler();
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between pb-2 text-xs text-muted-foreground", children: [_jsx("div", { children: post?.reactions?.length ? (_jsx("button", { type: "button", title: t('posts.stats.viewReactions', {
|
|
17
|
+
defaultValue: 'View reactions',
|
|
18
|
+
}), className: "hover:underline", onClick: stop(() => setModal('reactions')), children: stats })) : null }), _jsxs("div", { className: "flex w-fit items-center gap-1", children: [post?.replyCount ? (_jsx("span", { children: t('posts.stats.repliesCount', {
|
|
19
|
+
defaultValue: `${post.replyCount} replies`,
|
|
20
|
+
count: post.replyCount,
|
|
21
|
+
}) })) : null, post?.replyCount && post?.repostCount ? _jsx("span", { children: "\u00B7" }) : null, post?.repostCount ? (_jsx("button", { type: "button", title: t('posts.stats.viewReposts', {
|
|
22
|
+
defaultValue: 'View reposts',
|
|
23
|
+
}), className: "hover:underline", onClick: stop(() => setModal('reposts')), children: t('posts.stats.repostsCount', {
|
|
24
|
+
defaultValue: `${post.repostCount} reposts`,
|
|
25
|
+
count: post.repostCount,
|
|
26
|
+
}) })) : null] })] }), _jsx(ReactionsModal, { reactions: post.reactions ?? [], open: modal === 'reactions', onClose: () => setModal(null) }), _jsx(RepostModal, { post: post, open: modal === 'reposts', onClose: () => setModal(null) })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MediaAttachmentData } from '@openpeepshq/common/types';
|
|
2
|
+
export interface GalleryModalProps {
|
|
3
|
+
attachments: MediaAttachmentData[];
|
|
4
|
+
initialIndex?: number;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function GalleryModal({ attachments, initialIndex, onClose, }: GalleryModalProps): import("react/jsx-runtime").JSX.Element | null;
|