@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,201 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { AtSign, Megaphone, MessageSquare, Repeat, Reply, Users, } from 'lucide-react';
|
|
3
|
+
import { profileName, groupName } from '@openpeepshq/common';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { UpdatingDate } from '@openpeepshq/react-ui';
|
|
6
|
+
import { NotificationWrapper } from './NotificationWrapper.js';
|
|
7
|
+
import { ConversationMessageBubble } from '../conversations/ConversationMessageBubble.js';
|
|
8
|
+
import { FeedPost } from '../post/FeedPost.js';
|
|
9
|
+
import { CardEvent } from '../post/types/event/CardEvent.js';
|
|
10
|
+
import { GroupAvatar } from '../groups/GroupAvatar.js';
|
|
11
|
+
const JAM_TYPES = new Set(['jamStarted', 'jamSpeaker', 'jamModerator']);
|
|
12
|
+
function MentionNotification({ notification, }) {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const profile = notification.senderProfile;
|
|
15
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [_jsx(AtSign, { className: "size-4" }), t('notification.mention.text', {
|
|
16
|
+
defaultValue: '{{profileName}} mentioned you',
|
|
17
|
+
profileName: profileName(profile),
|
|
18
|
+
})] }), notification.post ? _jsx(FeedPost, { post: notification.post }) : null] }) }));
|
|
19
|
+
}
|
|
20
|
+
function ReplyNotification({ notification, }) {
|
|
21
|
+
const t = useT();
|
|
22
|
+
const profile = notification.senderProfile;
|
|
23
|
+
const replyPost = notification.data
|
|
24
|
+
?.replyPost;
|
|
25
|
+
const target = replyPost ?? notification.post;
|
|
26
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${target?.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [_jsx(Reply, { className: "size-4" }), t('notification.reply.text', {
|
|
27
|
+
defaultValue: '{{profileName}} replied to you',
|
|
28
|
+
profileName: profileName(profile),
|
|
29
|
+
})] }), target ? _jsx(FeedPost, { post: target }) : null] }) }));
|
|
30
|
+
}
|
|
31
|
+
function ReactionNotification({ notification, }) {
|
|
32
|
+
const t = useT();
|
|
33
|
+
const profile = notification.senderProfile;
|
|
34
|
+
const reaction = notification.data?.reaction;
|
|
35
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [_jsx("span", { children: reaction }), t('notification.reaction.text', {
|
|
36
|
+
defaultValue: '{{profileName}} reacted to your post',
|
|
37
|
+
profileName: profileName(profile),
|
|
38
|
+
})] }), notification.post ? _jsx(FeedPost, { post: notification.post }) : null] }) }));
|
|
39
|
+
}
|
|
40
|
+
function RepostNotification({ notification, }) {
|
|
41
|
+
const t = useT();
|
|
42
|
+
const profile = notification.senderProfile;
|
|
43
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [_jsx(Repeat, { className: "size-4" }), t('notification.repost.text', {
|
|
44
|
+
defaultValue: '{{profileName}} reposted your post',
|
|
45
|
+
profileName: profileName(profile),
|
|
46
|
+
})] }), notification.post ? _jsx(FeedPost, { post: notification.post }) : null] }) }));
|
|
47
|
+
}
|
|
48
|
+
function FollowNotification({ notification, }) {
|
|
49
|
+
const t = useT();
|
|
50
|
+
const profile = notification.senderProfile;
|
|
51
|
+
// A follow notification can arrive without a resolved sender profile (e.g.
|
|
52
|
+
// the profile was deleted or hasn't been hydrated). Reading `profile.handle`
|
|
53
|
+
// then threw and blanked the whole notifications page, so fall back to the
|
|
54
|
+
// generic renderer which handles a missing sender gracefully.
|
|
55
|
+
if (!profile) {
|
|
56
|
+
return _jsx(GenericNotification, { notification: notification });
|
|
57
|
+
}
|
|
58
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, children: _jsx("a", { href: `/@${profile.handle}`, className: "block w-full px-4", children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("p", { className: "text-base", children: t('notification.follow.text', {
|
|
59
|
+
defaultValue: '{{profileName}} followed you',
|
|
60
|
+
profileName: profileName(profile),
|
|
61
|
+
}) }), _jsx("span", { className: "text-muted-foreground ml-1 text-sm", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] }) }) }));
|
|
62
|
+
}
|
|
63
|
+
function DirectMessageNotification({ notification, }) {
|
|
64
|
+
const t = useT();
|
|
65
|
+
const profile = notification.senderProfile;
|
|
66
|
+
const conversationStart = notification.data?.conversationStart;
|
|
67
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, children: _jsxs("a", { href: `/conversations/${conversationStart?.id ?? notification.post?.id}`, className: "block w-full px-4", children: [_jsxs("p", { className: "flex items-center gap-2 text-sm font-semibold", children: [_jsx(MessageSquare, { className: "size-4" }), t('notification.directMessage.text', {
|
|
68
|
+
defaultValue: '{{profileName}} sent you a message',
|
|
69
|
+
profileName: profileName(profile),
|
|
70
|
+
})] }), notification.post ? (_jsxs(_Fragment, { children: [_jsx(ConversationMessageBubble, { message: notification.post }), _jsx("div", { className: "text-muted-foreground mt-2 text-xs", children: _jsx(UpdatingDate, { date: notification.post.createdAt }) })] })) : null] }) }));
|
|
71
|
+
}
|
|
72
|
+
function AnnouncementNotification({ notification, }) {
|
|
73
|
+
const t = useT();
|
|
74
|
+
const profile = notification.senderProfile;
|
|
75
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [_jsx(Megaphone, { className: "size-4" }), t('notification.announcement.text', {
|
|
76
|
+
defaultValue: '{{profileName}} made an announcement',
|
|
77
|
+
profileName: profileName(profile),
|
|
78
|
+
})] }), notification.post ? _jsx(FeedPost, { post: notification.post }) : null] }) }));
|
|
79
|
+
}
|
|
80
|
+
function PollVoteNotification({ notification, }) {
|
|
81
|
+
const t = useT();
|
|
82
|
+
const profile = notification.senderProfile;
|
|
83
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsx("p", { className: "mb-2 text-sm font-semibold", children: t('notification.pollVote.text', {
|
|
84
|
+
defaultValue: '{{profileName}} voted on your poll',
|
|
85
|
+
profileName: profileName(profile),
|
|
86
|
+
}) }), notification.post ? _jsx(FeedPost, { post: notification.post }) : null] }) }));
|
|
87
|
+
}
|
|
88
|
+
function RsvpNotification({ notification, }) {
|
|
89
|
+
const t = useT();
|
|
90
|
+
const profile = notification.senderProfile;
|
|
91
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsx("p", { className: "mb-2 text-sm font-semibold", children: t('notification.rsvp.text', {
|
|
92
|
+
defaultValue: '{{profileName}} responded to your event',
|
|
93
|
+
profileName: profileName(profile),
|
|
94
|
+
}) }), notification.post ? _jsx(FeedPost, { post: notification.post }) : null] }) }));
|
|
95
|
+
}
|
|
96
|
+
function GroupAvatarThumb({ group }) {
|
|
97
|
+
return _jsx(GroupAvatar, { group: group, size: 2.5, borderless: true });
|
|
98
|
+
}
|
|
99
|
+
function NewGroupInvitationNotification({ notification, }) {
|
|
100
|
+
const t = useT();
|
|
101
|
+
const profile = notification.senderProfile;
|
|
102
|
+
const group = notification.group;
|
|
103
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-surface-500 size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.newGroupInvitation.text', {
|
|
104
|
+
defaultValue: 'You were invited to',
|
|
105
|
+
}), ' ', _jsx("a", { href: `/groups/@${group.handle}`, className: "font-semibold", children: groupName(group) }), _jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] })] }) }));
|
|
106
|
+
}
|
|
107
|
+
function NewGroupMemberNotification({ notification, }) {
|
|
108
|
+
const t = useT();
|
|
109
|
+
const profile = notification.senderProfile;
|
|
110
|
+
const group = notification.group;
|
|
111
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-surface-500 size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.newGroupMember.text', {
|
|
112
|
+
defaultValue: '{{profileName}} joined',
|
|
113
|
+
profileName: profileName(profile),
|
|
114
|
+
}), ' ', _jsx("a", { href: `/groups/@${group.handle}`, className: "font-semibold", children: groupName(group) }), _jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] })] }) }));
|
|
115
|
+
}
|
|
116
|
+
function GroupMemberExitNotification({ notification, }) {
|
|
117
|
+
const t = useT();
|
|
118
|
+
const profile = notification.senderProfile;
|
|
119
|
+
const group = notification.group;
|
|
120
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("div", { className: "w-full px-4 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-4", children: [_jsx(Users, { className: "text-surface-500 size-8" }), _jsx(GroupAvatarThumb, { group: group })] }), _jsxs("p", { className: "text-sm", children: [t('notification.groupMemberExit.text', {
|
|
121
|
+
defaultValue: '{{profileName}} left {{groupName}}',
|
|
122
|
+
profileName: profileName(profile),
|
|
123
|
+
groupName: groupName(group),
|
|
124
|
+
}), _jsx("span", { className: "text-muted-foreground ml-2 text-xs", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] })] }) }));
|
|
125
|
+
}
|
|
126
|
+
function NewProfileNotification({ notification, }) {
|
|
127
|
+
const t = useT();
|
|
128
|
+
const profile = notification.senderProfile;
|
|
129
|
+
if (!profile) {
|
|
130
|
+
return _jsx(GenericNotification, { notification: notification });
|
|
131
|
+
}
|
|
132
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, children: _jsx("a", { href: `/@${profile.handle}`, className: "block w-full px-4", children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("p", { className: "text-base", children: t('notification.newProfile.text', {
|
|
133
|
+
defaultValue: '{{profileName}} joined the community',
|
|
134
|
+
profileName: profileName(profile),
|
|
135
|
+
}) }), _jsx("span", { className: "text-muted-foreground ml-1 text-sm", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] }) }) }));
|
|
136
|
+
}
|
|
137
|
+
function NewGroupPostNotification({ notification, }) {
|
|
138
|
+
const t = useT();
|
|
139
|
+
const profile = notification.senderProfile;
|
|
140
|
+
const post = notification.post;
|
|
141
|
+
const group = (notification.group ?? post?.group);
|
|
142
|
+
if (!post || !group) {
|
|
143
|
+
return _jsx(GenericNotification, { notification: notification });
|
|
144
|
+
}
|
|
145
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, showProfile: false, children: _jsxs("a", { href: `/posts/${post.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [_jsx(Users, { className: "size-4" }), t('notification.newGroupPost.text', {
|
|
146
|
+
defaultValue: 'New post in {{groupName}}',
|
|
147
|
+
groupName: groupName(group),
|
|
148
|
+
})] }), _jsx(FeedPost, { post: post, inGroup: true })] }) }));
|
|
149
|
+
}
|
|
150
|
+
function JamNotification({ notification, }) {
|
|
151
|
+
const t = useT();
|
|
152
|
+
const profile = notification.senderProfile;
|
|
153
|
+
const name = profileName(profile);
|
|
154
|
+
const message = t(`notification.${notification.type}.text`, {
|
|
155
|
+
defaultValue: `${name} — ${notification.type}`,
|
|
156
|
+
profileName: name,
|
|
157
|
+
groupName: notification.group?.displayName,
|
|
158
|
+
});
|
|
159
|
+
return (_jsx(NotificationWrapper, { profile: profile, seen: notification.seen, isGroup: !!notification.group, children: _jsxs("a", { href: `/posts/${notification.post?.id}`, className: "block w-full px-4 py-2", children: [_jsxs("p", { className: "mb-2 flex items-center gap-2 text-sm font-semibold", children: [message, _jsx("span", { className: "text-muted-foreground text-xs font-normal", children: _jsx(UpdatingDate, { date: notification.createdAt }) })] }), notification.post ? _jsx(CardEvent, { post: notification.post }) : null] }) }));
|
|
160
|
+
}
|
|
161
|
+
function GenericNotification({ notification, }) {
|
|
162
|
+
const t = useT();
|
|
163
|
+
const sender = notification.senderProfile;
|
|
164
|
+
if (!sender) {
|
|
165
|
+
return (_jsx("div", { className: "text-muted-foreground border-b px-4 py-5 text-sm", children: t(`notification.${notification.type}.text`, {
|
|
166
|
+
defaultValue: notification.type,
|
|
167
|
+
}) }));
|
|
168
|
+
}
|
|
169
|
+
const name = profileName(sender);
|
|
170
|
+
const message = t(`notification.${notification.type}.text`, {
|
|
171
|
+
defaultValue: `${name} — ${notification.type}`,
|
|
172
|
+
profileName: name,
|
|
173
|
+
groupName: notification.group?.displayName,
|
|
174
|
+
});
|
|
175
|
+
return (_jsx(NotificationWrapper, { profile: sender, seen: notification.seen, isGroup: !!notification.group, children: notification.post ? (_jsx("a", { href: `/posts/${notification.post.id}`, className: "block w-full px-4", children: _jsx("p", { className: "text-base", children: message }) })) : (_jsx("a", { href: `/@${sender.handle}`, className: "block w-full px-4", children: _jsx("p", { className: "text-base", children: message }) })) }));
|
|
176
|
+
}
|
|
177
|
+
const TYPED = {
|
|
178
|
+
mention: MentionNotification,
|
|
179
|
+
reply: ReplyNotification,
|
|
180
|
+
reaction: ReactionNotification,
|
|
181
|
+
repost: RepostNotification,
|
|
182
|
+
follow: FollowNotification,
|
|
183
|
+
directMessage: DirectMessageNotification,
|
|
184
|
+
announcement: AnnouncementNotification,
|
|
185
|
+
pollVote: PollVoteNotification,
|
|
186
|
+
rsvp: RsvpNotification,
|
|
187
|
+
groupAdded: NewGroupInvitationNotification,
|
|
188
|
+
groupMemberJoined: NewGroupMemberNotification,
|
|
189
|
+
groupMemberLeft: GroupMemberExitNotification,
|
|
190
|
+
newProfile: NewProfileNotification,
|
|
191
|
+
newGroupPost: NewGroupPostNotification,
|
|
192
|
+
};
|
|
193
|
+
export function TypedNotification({ notification, }) {
|
|
194
|
+
if (JAM_TYPES.has(notification.type) && notification.post) {
|
|
195
|
+
return _jsx(JamNotification, { notification: notification });
|
|
196
|
+
}
|
|
197
|
+
const Component = TYPED[notification.type];
|
|
198
|
+
if (Component)
|
|
199
|
+
return _jsx(Component, { notification: notification });
|
|
200
|
+
return _jsx(GenericNotification, { notification: notification });
|
|
201
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { NotificationItem } from './NotificationItem';
|
|
2
|
+
export type { NotificationItemProps } from './NotificationItem';
|
|
3
|
+
export { TypedNotification } from './TypedNotification';
|
|
4
|
+
export { NotificationWrapper } from './NotificationWrapper';
|
|
5
|
+
export { NotificationsList } from './NotificationsList';
|
|
6
|
+
export type { NotificationsListProps } from './NotificationsList';
|
|
7
|
+
export { NotificationHeaderActions } from './NotificationHeaderActions';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { NotificationItem } from './NotificationItem.js';
|
|
2
|
+
export { TypedNotification } from './TypedNotification.js';
|
|
3
|
+
export { NotificationWrapper } from './NotificationWrapper.js';
|
|
4
|
+
export { NotificationsList } from './NotificationsList.js';
|
|
5
|
+
export { NotificationHeaderActions } from './NotificationHeaderActions.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PublicPost, SuccessFailureResponse } from '@openpeepshq/common/types';
|
|
2
|
+
import type { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
3
|
+
export type FeedQuery = UseInfiniteQueryResult<InfiniteData<PublicPost[], unknown>, SuccessFailureResponse>;
|
|
4
|
+
export interface FeedProps {
|
|
5
|
+
query: FeedQuery;
|
|
6
|
+
/** When true, hides the "posted in group" banner because we're already there. */
|
|
7
|
+
inGroup?: boolean;
|
|
8
|
+
/** When set, the post with this id is rendered first (pinned). */
|
|
9
|
+
pinnedPostId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Translation of `@openpeepshq/svelte/components/core/post/feed/chronological/Feed.svelte`.
|
|
13
|
+
* Wires a TanStack `useInfiniteQuery` result to an IntersectionObserver-backed
|
|
14
|
+
* loader and renders each post as a `<FeedPost>`.
|
|
15
|
+
*
|
|
16
|
+
* The Svelte version also has a `<PinnedPost>` component that fetches the
|
|
17
|
+
* pinned post by id; here we filter it out of the chronological list and
|
|
18
|
+
* leave the actual pinned rendering to a future port.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Feed({ query, inGroup, pinnedPostId }: FeedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useMemo } from 'react';
|
|
3
|
+
import { Rss } from 'lucide-react';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { FeedPost } from './FeedPost.js';
|
|
6
|
+
import { PinnedPost } from './PinnedPost.js';
|
|
7
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
8
|
+
/**
|
|
9
|
+
* Translation of `@openpeepshq/svelte/components/core/post/feed/chronological/Feed.svelte`.
|
|
10
|
+
* Wires a TanStack `useInfiniteQuery` result to an IntersectionObserver-backed
|
|
11
|
+
* loader and renders each post as a `<FeedPost>`.
|
|
12
|
+
*
|
|
13
|
+
* The Svelte version also has a `<PinnedPost>` component that fetches the
|
|
14
|
+
* pinned post by id; here we filter it out of the chronological list and
|
|
15
|
+
* leave the actual pinned rendering to a future port.
|
|
16
|
+
*/
|
|
17
|
+
export function Feed({ query, inGroup = false, pinnedPostId }) {
|
|
18
|
+
const t = useT();
|
|
19
|
+
const sentinelRef = useRef(null);
|
|
20
|
+
const posts = useMemo(() => {
|
|
21
|
+
const flat = (query.data?.pages ?? []).flat();
|
|
22
|
+
const seen = new Set();
|
|
23
|
+
const out = [];
|
|
24
|
+
for (const p of flat) {
|
|
25
|
+
if (seen.has(p.id))
|
|
26
|
+
continue;
|
|
27
|
+
if (pinnedPostId && p.id === pinnedPostId)
|
|
28
|
+
continue;
|
|
29
|
+
seen.add(p.id);
|
|
30
|
+
out.push(p);
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}, [query.data, pinnedPostId]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const el = sentinelRef.current;
|
|
36
|
+
if (!el)
|
|
37
|
+
return;
|
|
38
|
+
const observer = new IntersectionObserver((entries) => {
|
|
39
|
+
const entry = entries[0];
|
|
40
|
+
if (!entry)
|
|
41
|
+
return;
|
|
42
|
+
if (entry.isIntersecting &&
|
|
43
|
+
query.hasNextPage &&
|
|
44
|
+
!query.isFetchingNextPage) {
|
|
45
|
+
void query.fetchNextPage();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
observer.observe(el);
|
|
49
|
+
return () => observer.disconnect();
|
|
50
|
+
}, [
|
|
51
|
+
query.hasNextPage,
|
|
52
|
+
query.isFetchingNextPage,
|
|
53
|
+
query.fetchNextPage,
|
|
54
|
+
query.data?.pages,
|
|
55
|
+
]);
|
|
56
|
+
if (query.isLoading) {
|
|
57
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
58
|
+
}
|
|
59
|
+
if (posts.length === 0 && !pinnedPostId) {
|
|
60
|
+
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 posts yet.' }) })] }));
|
|
61
|
+
}
|
|
62
|
+
return (_jsxs("div", { className: "relative", children: [pinnedPostId ? (_jsx(PinnedPost, { pinnedPostId: pinnedPostId, inGroup: inGroup })) : null, posts.map((post) => (_jsx("a", { href: `/posts/${post.repost ? post.repost.id : post.id}`, className: "block", children: _jsx(FeedPost, { post: post, inGroup: inGroup, showReplyTo: true }) }, post.id))), _jsx("div", { ref: sentinelRef, "aria-hidden": "true", className: "h-8" }), query.isFetchingNextPage && (_jsx("div", { className: "text-muted-foreground flex justify-center py-4 text-sm", children: _jsx(LoadingSpinner, {}) }))] }));
|
|
63
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
3
|
+
export interface FeedPostProps {
|
|
4
|
+
post: PublicPost;
|
|
5
|
+
deleteCallback?: () => void;
|
|
6
|
+
noReactionHeader?: boolean;
|
|
7
|
+
inGroup?: boolean;
|
|
8
|
+
showReplyTo?: boolean;
|
|
9
|
+
/** Optional override for the body (used when threading). */
|
|
10
|
+
content?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Single post card for the chronological feed:
|
|
14
|
+
* shows a small reaction/reply/group banner, the author header, the body,
|
|
15
|
+
* stats and actions. The body component dispatches on `post.type`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function FeedPost({ post, deleteCallback, noReactionHeader, inGroup, showReplyTo, content, }: FeedPostProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { usePostViewRef } from '../../lib/postViewCounter.js';
|
|
3
|
+
import { isUnreadPostForViewer } from '../../lib/postUnread.js';
|
|
4
|
+
import { useCurrentProfile } from '../layout/IdentityContext.js';
|
|
5
|
+
import { FeedPostContent } from './FeedPostContent.js';
|
|
6
|
+
import { PostInfoHeader } from './pieces/PostInfoHeader.js';
|
|
7
|
+
import { PostReactionHeader } from './pieces/PostReactionHeader.js';
|
|
8
|
+
import { FeedPostStats } from './pieces/FeedPostStats.js';
|
|
9
|
+
import { PostActions } from './pieces/PostActions.js';
|
|
10
|
+
import { ThreadPost } from './feed/threaded/ThreadPost.js';
|
|
11
|
+
import { UnreadPostIndicator } from './pieces/UnreadPostIndicator.js';
|
|
12
|
+
/**
|
|
13
|
+
* Single post card for the chronological feed:
|
|
14
|
+
* shows a small reaction/reply/group banner, the author header, the body,
|
|
15
|
+
* stats and actions. The body component dispatches on `post.type`.
|
|
16
|
+
*/
|
|
17
|
+
export function FeedPost({ post, deleteCallback, noReactionHeader = false, inGroup = false, showReplyTo = false, content, }) {
|
|
18
|
+
const me = useCurrentProfile();
|
|
19
|
+
const displayedPost = post.repost ?? post;
|
|
20
|
+
const isUnread = isUnreadPostForViewer(displayedPost, me?.id);
|
|
21
|
+
const postViewRef = usePostViewRef(displayedPost.id, {
|
|
22
|
+
groupId: displayedPost.groupId,
|
|
23
|
+
adjustUnread: isUnread,
|
|
24
|
+
});
|
|
25
|
+
const hasReactionHeader = !noReactionHeader &&
|
|
26
|
+
(!!post.repost || !!post.inReplyToId || (!!post.groupId && !inGroup));
|
|
27
|
+
const hasStats = !!(displayedPost?.repostCount ||
|
|
28
|
+
displayedPost?.reactions?.length ||
|
|
29
|
+
displayedPost?.replyCount);
|
|
30
|
+
return (_jsxs("div", { ref: postViewRef, className: "relative min-w-0 border-b p-4", children: [_jsx(UnreadPostIndicator, { show: isUnread }), hasReactionHeader && (_jsx(PostReactionHeader, { post: post, inGroup: inGroup, deleteCallback: deleteCallback })), displayedPost.replyTo && showReplyTo && (_jsx("a", { href: `/posts/${displayedPost.replyTo.id}`, children: _jsx(ThreadPost, { post: displayedPost.replyTo, isParent: true, noActions: true, noMenu: true }) })), _jsxs("div", { children: [_jsx(PostInfoHeader, { post: displayedPost, showMenu: !hasReactionHeader, deleteCallback: deleteCallback }), _jsx("div", { className: "min-w-0 pb-2", children: content ?? _jsx(FeedPostContent, { post: displayedPost }) }), hasStats && _jsx(FeedPostStats, { post: displayedPost })] }), _jsx(PostActions, { post: displayedPost })] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FeedArticle } from './types/Article.js';
|
|
3
|
+
import { FeedEvent } from './types/Event.js';
|
|
4
|
+
import { FeedNote } from './types/Note.js';
|
|
5
|
+
import { FeedPoll } from './types/Poll.js';
|
|
6
|
+
export function FeedPostContent({ post }) {
|
|
7
|
+
if (post.deletedAt) {
|
|
8
|
+
return (_jsx("div", { className: "text-sm text-gray-500", children: "This post has been deleted." }));
|
|
9
|
+
}
|
|
10
|
+
switch (post.type) {
|
|
11
|
+
case 'note':
|
|
12
|
+
return _jsx(FeedNote, { post: post });
|
|
13
|
+
case 'question':
|
|
14
|
+
return _jsx(FeedPoll, { post: post });
|
|
15
|
+
case 'event':
|
|
16
|
+
return _jsx(FeedEvent, { post: post });
|
|
17
|
+
case 'article':
|
|
18
|
+
return _jsx(FeedArticle, { post: post });
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PublicPost } from '@openpeepshq/common/types';
|
|
2
|
+
export interface FullPostLayoutProps {
|
|
3
|
+
post: PublicPost;
|
|
4
|
+
deleteCallback?: () => void;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function FullPostLayout({ post, deleteCallback, children, }: FullPostLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef, useEffect } from 'react';
|
|
3
|
+
import { buildThreads } from '@openpeepshq/common/lib';
|
|
4
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
5
|
+
import { useT } from '../../i18n/index.js';
|
|
6
|
+
import { FeedPost } from './FeedPost.js';
|
|
7
|
+
import { ThreadedFeed } from './feed/threaded/ThreadedFeed.js';
|
|
8
|
+
import { ReplyBox } from './ReplyBox.js';
|
|
9
|
+
export function FullPostLayout({ post, deleteCallback, children, }) {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const contextQuery = openpeepsApi.usePostContext(post.id);
|
|
13
|
+
const postRef = useRef(null);
|
|
14
|
+
const ancestryThread = useMemo(() => (contextQuery.data ? buildThreads(contextQuery.data.ancestors)[0] : undefined), [contextQuery.data]);
|
|
15
|
+
const descendentThreads = useMemo(() => (contextQuery.data && buildThreads(contextQuery.data.descendants)) || [], [contextQuery.data]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
postRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
18
|
+
}, [post.id]);
|
|
19
|
+
if (contextQuery.isLoading) {
|
|
20
|
+
return (_jsx("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: t('common.loading', { defaultValue: 'Loading…' }) }));
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs(_Fragment, { children: [ancestryThread ? _jsx(ThreadedFeed, { thread: ancestryThread, isAncestors: true }) : null, _jsx("div", { ref: postRef, children: children ?? (_jsx(FeedPost, { post: post, deleteCallback: deleteCallback, noReactionHeader: true })) }), _jsx(ReplyBox, { post: post }), descendentThreads.map((thread) => (_jsx(ThreadedFeed, { thread: thread, isDescendants: true }, thread.id))), _jsx("div", { className: "h-[70vh]" })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OpenpeepsMarkdown, OpenpeepsMarkdown as PostMarkdown } from '../markdown/index.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type GroupWithMeta, type ProfileWithMeta, type VisibilityType } from '@openpeepshq/common';
|
|
2
|
+
export interface NewEventButtonProps {
|
|
3
|
+
visibility: VisibilityType;
|
|
4
|
+
currentProfile?: ProfileWithMeta;
|
|
5
|
+
group?: GroupWithMeta;
|
|
6
|
+
onNavigate?: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to render the inline button. The Svelte app only exposes the
|
|
9
|
+
* action through the floating plus button, so the events page passes
|
|
10
|
+
* `false` and relies solely on the plus-button registration below.
|
|
11
|
+
*/
|
|
12
|
+
showButton?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function NewEventButton({ visibility, currentProfile, group, onNavigate, showButton, }: NewEventButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { CalendarPlus } from 'lucide-react';
|
|
4
|
+
import { canCreatePost, } from '@openpeepshq/common';
|
|
5
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
6
|
+
import { useT } from '../../i18n/index.js';
|
|
7
|
+
import { getNewPostStores, useSetPlusButtonActions } from '../../stores/index.js';
|
|
8
|
+
import { useAuthData } from '../layout/IdentityContext.js';
|
|
9
|
+
export function NewEventButton({ visibility, currentProfile, group, onNavigate, showButton = true, }) {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const authData = useAuthData();
|
|
12
|
+
const stores = getNewPostStores();
|
|
13
|
+
const profile = currentProfile ?? authData.profile;
|
|
14
|
+
const canPost = !!profile && canCreatePost(authData, 'event', visibility, group);
|
|
15
|
+
const openNewEvent = useCallback(() => {
|
|
16
|
+
stores.event = {
|
|
17
|
+
...stores.event,
|
|
18
|
+
visibility,
|
|
19
|
+
groupId: group?.id,
|
|
20
|
+
};
|
|
21
|
+
if (onNavigate) {
|
|
22
|
+
onNavigate();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
window.location.assign('/events/new');
|
|
26
|
+
}, [stores, visibility, group?.id, onNavigate]);
|
|
27
|
+
const plusActions = useMemo(() => canPost
|
|
28
|
+
? {
|
|
29
|
+
title: t('events.form.title', { defaultValue: 'New event' }),
|
|
30
|
+
icon: CalendarPlus,
|
|
31
|
+
action: openNewEvent,
|
|
32
|
+
}
|
|
33
|
+
: undefined, [canPost, t, openNewEvent]);
|
|
34
|
+
useSetPlusButtonActions(plusActions);
|
|
35
|
+
if (!canPost || !showButton) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (_jsx("div", { className: "mb-4 p-4 pb-0", children: _jsxs(Button, { title: t('events.form.title', { defaultValue: 'New event' }), variant: "variant-filled-primary", action: openNewEvent, "data-testid": "events-new-event-button", children: [_jsx(CalendarPlus, { className: "mr-1 size-4" }), t('events.form.title', { defaultValue: 'New event' })] }) }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type GroupWithMeta, type ProfileWithMeta, type VisibilityType } from '@openpeepshq/common';
|
|
2
|
+
export interface NewNoteButtonProps {
|
|
3
|
+
visibility: VisibilityType;
|
|
4
|
+
currentProfile?: ProfileWithMeta;
|
|
5
|
+
group?: GroupWithMeta;
|
|
6
|
+
/** When false, only registers the floating plus button (no inline feed button). */
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Registers the layout plus button for creating a note (no UI). */
|
|
10
|
+
export declare function useNewNotePlusButton({ visibility, currentProfile, group, }: Omit<NewNoteButtonProps, 'inline'>): {
|
|
11
|
+
canPost: boolean;
|
|
12
|
+
openNewPost: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function NewNoteButton({ visibility, currentProfile, group, inline, }: NewNoteButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Plus } from 'lucide-react';
|
|
4
|
+
import { canCreatePost, } from '@openpeepshq/common';
|
|
5
|
+
import { Button } from '@openpeepshq/react-ui';
|
|
6
|
+
import { useT } from '../../i18n/index.js';
|
|
7
|
+
import { useSetPlusButtonActions } from '../../stores/index.js';
|
|
8
|
+
import { useAuthData } from '../layout/IdentityContext.js';
|
|
9
|
+
import { useNewPostModal } from './post-form/NewPostModalContext.js';
|
|
10
|
+
/** Registers the layout plus button for creating a note (no UI). */
|
|
11
|
+
export function useNewNotePlusButton({ visibility, currentProfile, group, }) {
|
|
12
|
+
const t = useT();
|
|
13
|
+
const authData = useAuthData();
|
|
14
|
+
const { openNewPost } = useNewPostModal();
|
|
15
|
+
const profile = currentProfile ?? authData.profile;
|
|
16
|
+
const canPost = !!profile && canCreatePost(authData, 'note', visibility, group);
|
|
17
|
+
const plusActions = useMemo(() => canPost
|
|
18
|
+
? {
|
|
19
|
+
title: t('posts.form.title', { defaultValue: 'New post' }),
|
|
20
|
+
icon: Plus,
|
|
21
|
+
action: () => openNewPost({ visibility, group }),
|
|
22
|
+
}
|
|
23
|
+
: undefined, [canPost, t, openNewPost, visibility, group]);
|
|
24
|
+
useSetPlusButtonActions(plusActions);
|
|
25
|
+
return { canPost, openNewPost: () => openNewPost({ visibility, group }) };
|
|
26
|
+
}
|
|
27
|
+
export function NewNoteButton({ visibility, currentProfile, group, inline = false, }) {
|
|
28
|
+
const t = useT();
|
|
29
|
+
const { canPost, openNewPost } = useNewNotePlusButton({
|
|
30
|
+
visibility,
|
|
31
|
+
currentProfile,
|
|
32
|
+
group,
|
|
33
|
+
});
|
|
34
|
+
if (!canPost || !inline) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return (_jsx("div", { className: "mb-4", children: _jsxs(Button, { title: t('posts.form.title', { defaultValue: 'New post' }), variant: "variant-filled-primary", action: openNewPost, "data-testid": "posts-new-post-button", children: [_jsx(Plus, { className: "mr-1 size-4" }), t('posts.form.newNote', { defaultValue: 'New post' })] }) }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Pin } from 'lucide-react';
|
|
3
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
4
|
+
import { useT } from '../../i18n/index.js';
|
|
5
|
+
import { FeedPost } from './FeedPost.js';
|
|
6
|
+
export function PinnedPost({ pinnedPostId, inGroup = false }) {
|
|
7
|
+
const t = useT();
|
|
8
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
9
|
+
const postQuery = openpeepsApi.usePost(pinnedPostId);
|
|
10
|
+
const post = postQuery.data;
|
|
11
|
+
if (postQuery.isLoading || !post)
|
|
12
|
+
return null;
|
|
13
|
+
const href = `/posts/${post.repost ? post.repost.id : post.id}`;
|
|
14
|
+
return (_jsxs("a", { href: href, className: "bg-surface-300 block", children: [_jsxs("div", { className: "px-5 pt-3 text-sm", children: [_jsx(Pin, { className: "mr-1 inline-block size-4" }), t('feed.pinned', { defaultValue: 'Pinned post' })] }), _jsx(FeedPost, { post: post, inGroup: inGroup })] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useOpenpeeps } from '../../contexts/openpeeps/index.js';
|
|
3
|
+
import { useT } from '../../i18n/index.js';
|
|
4
|
+
import { FullNote } from './types/note/FullNote.js';
|
|
5
|
+
import { FullArticle } from './types/article/FullArticle.js';
|
|
6
|
+
import { FullPoll } from './types/poll/FullPoll.js';
|
|
7
|
+
import { FullEvent } from './types/event/FullEvent.js';
|
|
8
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
9
|
+
export function PostDetail({ postId }) {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
+
const postQuery = openpeepsApi.usePost(postId);
|
|
13
|
+
const post = postQuery.data;
|
|
14
|
+
if (postQuery.isLoading) {
|
|
15
|
+
return (_jsx("div", { className: "flex h-32 items-center justify-center text-sm text-muted-foreground", children: _jsx(LoadingSpinner, {}) }));
|
|
16
|
+
}
|
|
17
|
+
if (!post) {
|
|
18
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx("p", { className: "text-2xl font-bold", children: t('post.notFound', { defaultValue: 'Post not found' }) }) }));
|
|
19
|
+
}
|
|
20
|
+
switch (post.type) {
|
|
21
|
+
case 'article':
|
|
22
|
+
return _jsx(FullArticle, { post: post });
|
|
23
|
+
case 'event':
|
|
24
|
+
return _jsx(FullEvent, { post: post });
|
|
25
|
+
case 'question':
|
|
26
|
+
return _jsx(FullPoll, { post: post });
|
|
27
|
+
case 'note':
|
|
28
|
+
default:
|
|
29
|
+
return _jsx(FullNote, { post: post });
|
|
30
|
+
}
|
|
31
|
+
}
|