@openpeepshq/react 0.2.5 → 0.2.6
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/dist/components/CapabilityMatrix.d.ts +24 -0
- package/dist/components/CapabilityMatrix.js +51 -0
- package/dist/components/RelationCapabilitiesEditor.d.ts +1 -0
- package/dist/components/RelationCapabilitiesEditor.js +138 -0
- package/dist/components/RoleCapabilityMatrix.d.ts +10 -0
- package/dist/components/RoleCapabilityMatrix.js +100 -0
- package/dist/components/accounts/SignUpLoginModal.js +7 -5
- package/dist/components/configuration/ConfigMenuButton.d.ts +3 -1
- package/dist/components/configuration/ConfigMenuButton.js +2 -2
- package/dist/components/configuration/ConfigurationList.js +7 -4
- package/dist/components/configuration/ConfigurationValueEditor.js +2 -2
- package/dist/components/conversations/ConversationParticipantsModal.d.ts +7 -0
- package/dist/components/conversations/ConversationParticipantsModal.js +10 -0
- package/dist/components/conversations/CreateNewConversation.js +9 -7
- package/dist/components/conversations/MessageInThread.js +4 -1
- package/dist/components/conversations/index.d.ts +2 -0
- package/dist/components/conversations/index.js +1 -0
- package/dist/components/form/ImageEditModal.js +4 -4
- package/dist/components/form/LocationInput.js +2 -2
- package/dist/components/form/TimeZoneSelect.d.ts +7 -0
- package/dist/components/form/TimeZoneSelect.js +7 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/groups/ChangeGroupRolesModal.js +15 -4
- package/dist/components/groups/ConfirmGroupExitModal.js +4 -2
- package/dist/components/groups/ConfirmMemberRemovalModal.js +4 -2
- package/dist/components/groups/DeleteGroupModal.js +4 -2
- package/dist/components/groups/GroupAvatar.d.ts +2 -1
- package/dist/components/groups/GroupAvatar.js +9 -12
- package/dist/components/groups/GroupCapabilityMatrix.d.ts +6 -0
- package/dist/components/groups/GroupCapabilityMatrix.js +12 -0
- package/dist/components/groups/GroupCard.js +2 -2
- package/dist/components/groups/GroupFeed.js +2 -1
- package/dist/components/groups/GroupForm.d.ts +11 -1
- package/dist/components/groups/GroupForm.js +14 -67
- package/dist/components/groups/GroupMembersList.js +25 -17
- package/dist/components/groups/GroupOptionsMenu.js +13 -10
- package/dist/components/groups/index.d.ts +3 -1
- package/dist/components/groups/index.js +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +3 -0
- package/dist/components/jams/CreateNewJam.js +5 -127
- package/dist/components/jams/JamCallParticipant.d.ts +7 -1
- package/dist/components/jams/JamCallParticipant.js +28 -38
- package/dist/components/jams/JamCapacityGate.d.ts +2 -1
- package/dist/components/jams/JamCapacityGate.js +2 -2
- package/dist/components/jams/JamChatDrawer.js +12 -47
- package/dist/components/jams/JamChatMessage.d.ts +3 -2
- package/dist/components/jams/JamChatMessage.js +13 -4
- package/dist/components/jams/JamConference.js +4 -3
- package/dist/components/jams/JamContext.d.ts +8 -3
- package/dist/components/jams/JamContext.js +4 -7
- package/dist/components/jams/JamDetailsDrawer.js +11 -8
- package/dist/components/jams/JamEventsContext.d.ts +3 -1
- package/dist/components/jams/JamEventsContext.js +1 -3
- package/dist/components/jams/JamFooter.js +12 -78
- package/dist/components/jams/JamGuestForm.js +0 -1
- package/dist/components/jams/JamLobby.d.ts +2 -6
- package/dist/components/jams/JamLobby.js +11 -57
- package/dist/components/jams/JamObserverShell.js +1 -1
- package/dist/components/jams/JamParticipantConference.js +5 -2
- package/dist/components/jams/JamPeopleDrawer.js +5 -41
- package/dist/components/jams/JamRequestJoin.d.ts +2 -6
- package/dist/components/jams/JamRequestJoin.js +3 -21
- package/dist/components/jams/JamRoom.d.ts +2 -1
- package/dist/components/jams/JamRoom.js +13 -175
- package/dist/components/jams/JamToolbarButton.js +2 -2
- package/dist/components/jams/JamVideoCall.d.ts +3 -2
- package/dist/components/jams/JamVideoCall.js +1 -1
- package/dist/components/jams/JamVideoLayout.d.ts +2 -2
- package/dist/components/jams/JamVideoLayout.js +81 -26
- package/dist/components/jams/LeaveCloseButton.js +2 -1
- package/dist/components/jams/LiveJamsSection.js +1 -1
- package/dist/components/jams/disconnectReason.d.ts +6 -0
- package/dist/components/jams/disconnectReason.js +19 -0
- package/dist/components/jams/jamEventActions.d.ts +3 -0
- package/dist/components/jams/jamEventActions.js +10 -0
- package/dist/components/jams/jamRecordingState.d.ts +6 -0
- package/dist/components/jams/jamRecordingState.js +15 -1
- package/dist/components/jams/reactionEmojis.d.ts +1 -28
- package/dist/components/jams/reactionEmojis.js +1 -55
- package/dist/components/jams/speakerLayout.d.ts +19 -0
- package/dist/components/jams/speakerLayout.js +33 -0
- package/dist/components/jams/useJamSpotlight.d.ts +14 -0
- package/dist/components/jams/useJamSpotlight.js +72 -0
- package/dist/components/layout/Auth.js +20 -3
- package/dist/components/layout/IdentityContext.js +7 -1
- package/dist/components/layout/OpenpeepsThemeProvider.d.ts +15 -0
- package/dist/components/layout/OpenpeepsThemeProvider.js +13 -3
- package/dist/components/layout/ProfileProvider.d.ts +2 -2
- package/dist/components/layout/ProfileProvider.js +15 -32
- package/dist/components/layout/Root.js +1 -1
- package/dist/components/layout/useProfileIdentity.d.ts +59 -0
- package/dist/components/layout/useProfileIdentity.js +38 -0
- package/dist/components/markdown/OpenpeepsMarkdown.js +2 -9
- package/dist/components/markdown/classes.d.ts +2 -2
- package/dist/components/markdown/classes.js +2 -2
- package/dist/components/markdown/staticRender.d.ts +2 -0
- package/dist/components/navigation/ContentHeader.js +1 -1
- package/dist/components/navigation/FooterMobile.js +4 -1
- package/dist/components/navigation/HeaderMobile.js +6 -2
- package/dist/components/navigation/MobileMenuItem.d.ts +3 -1
- package/dist/components/navigation/MobileMenuItem.js +6 -4
- package/dist/components/navigation/PlusButton.js +1 -1
- package/dist/components/navigation/SideBar.js +5 -1
- package/dist/components/notifications/NotificationHeaderActions.js +3 -1
- package/dist/components/notifications/NotificationsList.js +28 -16
- package/dist/components/notifications/TypedNotification.js +50 -6
- package/dist/components/post/CompactReplyParent.d.ts +7 -0
- package/dist/components/post/CompactReplyParent.js +121 -0
- package/dist/components/post/EventViewSwitch.d.ts +1 -0
- package/dist/components/post/EventViewSwitch.js +15 -0
- package/dist/components/post/Feed.d.ts +3 -1
- package/dist/components/post/Feed.js +11 -5
- package/dist/components/post/FeedFormatSwitch.d.ts +1 -0
- package/dist/components/post/FeedFormatSwitch.js +16 -0
- package/dist/components/post/FeedPost.js +9 -19
- package/dist/components/post/FeedPostContent.js +8 -1
- package/dist/components/post/FullPostLayout.js +8 -11
- package/dist/components/post/PinnedPost.js +1 -1
- package/dist/components/post/feed/events/EventsCalendar.d.ts +7 -0
- package/dist/components/post/feed/events/EventsCalendar.js +54 -0
- package/dist/components/post/feed/events/EventsView.d.ts +10 -0
- package/dist/components/post/feed/events/EventsView.js +9 -0
- package/dist/components/post/feed/events/eventCalendar.d.ts +36 -0
- package/dist/components/post/feed/events/eventCalendar.js +145 -0
- package/dist/components/post/feed/threaded/ThreadedFeed.d.ts +1 -4
- package/dist/components/post/feed/threaded/ThreadedFeed.js +5 -2
- package/dist/components/post/helpers.js +3 -1
- package/dist/components/post/index.d.ts +11 -0
- package/dist/components/post/index.js +6 -0
- package/dist/components/post/pieces/Attachments.js +19 -13
- package/dist/components/post/pieces/AudioAttachment.d.ts +13 -0
- package/dist/components/post/pieces/AudioAttachment.js +93 -0
- package/dist/components/post/pieces/EventLocation.d.ts +2 -1
- package/dist/components/post/pieces/EventLocation.js +13 -9
- package/dist/components/post/pieces/EventMenu.d.ts +2 -1
- package/dist/components/post/pieces/EventMenu.js +26 -26
- package/dist/components/post/pieces/EventOccurrenceList.d.ts +10 -0
- package/dist/components/post/pieces/EventOccurrenceList.js +49 -0
- package/dist/components/post/pieces/EventRsvpButton.d.ts +3 -1
- package/dist/components/post/pieces/EventRsvpButton.js +15 -37
- package/dist/components/post/pieces/EventRsvpList.d.ts +12 -0
- package/dist/components/post/pieces/EventRsvpList.js +108 -0
- package/dist/components/post/pieces/EventRsvpScopeDialog.d.ts +16 -0
- package/dist/components/post/pieces/EventRsvpScopeDialog.js +92 -0
- package/dist/components/post/pieces/FeedPostStats.js +5 -4
- package/dist/components/post/pieces/FeedThreadPreview.d.ts +9 -0
- package/dist/components/post/pieces/FeedThreadPreview.js +37 -0
- package/dist/components/post/pieces/GalleryModal.js +8 -5
- package/dist/components/post/pieces/PollContent.js +8 -4
- package/dist/components/post/pieces/PostActions.js +2 -2
- package/dist/components/post/pieces/PostMenu.js +17 -1
- package/dist/components/post/pieces/ShareMenu.js +11 -16
- package/dist/components/post/pieces/VideoPlayer.js +1 -1
- package/dist/components/post/pieces/modals/DeletePostModal.js +6 -2
- package/dist/components/post/pieces/modals/ReactionsModal.js +2 -3
- package/dist/components/post/post-form/ArticleForm.js +2 -14
- package/dist/components/post/post-form/AttachmentCard.js +18 -7
- package/dist/components/post/post-form/ComposeAttachments.d.ts +1 -0
- package/dist/components/post/post-form/ComposeAttachments.js +30 -7
- package/dist/components/post/post-form/DescriptionEditModal.js +2 -2
- package/dist/components/post/post-form/EditPostModal.js +9 -7
- package/dist/components/post/post-form/EventForm.d.ts +2 -1
- package/dist/components/post/post-form/EventForm.js +41 -61
- package/dist/components/post/post-form/EventTypeSwitcher.d.ts +1 -1
- package/dist/components/post/post-form/EventTypeSwitcher.js +15 -134
- package/dist/components/post/post-form/NewPostModal.js +14 -9
- package/dist/components/post/post-form/NewPostModalContext.js +6 -2
- package/dist/components/post/post-form/OpenpeepsMarkdownInput.js +1 -1
- package/dist/components/post/post-form/PollComposerFields.js +7 -5
- package/dist/components/post/post-form/PostAudienceSelector.js +4 -2
- package/dist/components/post/post-form/PostTypeSwitcher.d.ts +5 -2
- package/dist/components/post/post-form/PostTypeSwitcher.js +19 -1
- package/dist/components/post/post-form/ReplyModal.js +13 -9
- package/dist/components/post/post-form/ReplyModalContext.d.ts +5 -8
- package/dist/components/post/post-form/ReplyModalContext.js +9 -12
- package/dist/components/post/post-form/audienceChoices.d.ts +4 -6
- package/dist/components/post/post-form/audienceChoices.js +12 -63
- package/dist/components/post/types/Article.js +3 -1
- package/dist/components/post/types/Event.js +13 -2
- package/dist/components/post/types/article/FullArticle.js +5 -1
- package/dist/components/post/types/event/CardEvent.d.ts +2 -1
- package/dist/components/post/types/event/CardEvent.js +16 -10
- package/dist/components/post/types/event/FullEvent.js +78 -44
- package/dist/components/preview-link/local/PostPreview.js +3 -2
- package/dist/components/profile/Avatar.d.ts +3 -3
- package/dist/components/profile/Avatar.js +15 -15
- package/dist/components/profile/FollowUnfollowButton.d.ts +2 -1
- package/dist/components/profile/FollowUnfollowButton.js +8 -15
- package/dist/components/profile/ProfileActivitySummary.d.ts +5 -0
- package/dist/components/profile/ProfileActivitySummary.js +41 -0
- package/dist/components/profile/ProfileCard.js +3 -1
- package/dist/components/profile/ProfileHeader.js +7 -1
- package/dist/components/profile/ProfilePageAction.js +46 -4
- package/dist/components/profile/ProfilePostsAndReplies.d.ts +4 -3
- package/dist/components/profile/ProfilePostsAndReplies.js +8 -5
- package/dist/components/profile/ProfileSelector.js +2 -2
- package/dist/components/profile/ProfileWithActionCard.d.ts +3 -1
- package/dist/components/profile/ProfileWithActionCard.js +2 -2
- package/dist/components/profile/ReportProfileOrPostModal.js +7 -7
- package/dist/components/profile/index.d.ts +2 -0
- package/dist/components/profile/index.js +1 -0
- package/dist/components/profile/profileFieldDisplay.d.ts +8 -0
- package/dist/components/profile/profileFieldDisplay.js +36 -0
- package/dist/components/registry/PluginRegistryProvider.d.ts +1 -0
- package/dist/components/registry/PluginRegistryProvider.js +6 -1
- package/dist/components/registry/PluginSlot.js +1 -1
- package/dist/components/server-data/context.d.ts +18 -1
- package/dist/contexts/openpeeps/helpers.js +12 -1
- package/dist/contexts/openpeeps/hooks/accounts.js +42 -1
- package/dist/contexts/openpeeps/hooks/admin.d.ts +10065 -4
- package/dist/contexts/openpeeps/hooks/admin.js +17 -0
- package/dist/contexts/openpeeps/hooks/auth.d.ts +2 -1
- package/dist/contexts/openpeeps/hooks/conversations.d.ts +12 -10140
- package/dist/contexts/openpeeps/hooks/conversations.js +8 -2
- package/dist/contexts/openpeeps/hooks/groups.d.ts +15 -3
- package/dist/contexts/openpeeps/hooks/jams.d.ts +7273 -606
- package/dist/contexts/openpeeps/hooks/jams.js +20 -5
- package/dist/contexts/openpeeps/hooks/other.d.ts +18 -1
- package/dist/contexts/openpeeps/hooks/posts.d.ts +64999 -11998
- package/dist/contexts/openpeeps/hooks/profiles.d.ts +49 -7101
- package/dist/contexts/openpeeps/hooks/profiles.js +24 -4
- package/dist/contexts/openpeeps/hooks/search.d.ts +13 -9948
- package/dist/contexts/openpeeps/index.js +18 -9
- package/dist/hooks/auth/useAuthForms.d.ts +25 -0
- package/dist/hooks/auth/useAuthForms.js +101 -0
- package/dist/hooks/community/useCommunityInfoPages.d.ts +10 -0
- package/dist/hooks/community/useCommunityInfoPages.js +18 -0
- package/dist/hooks/conversations/useCreateConversation.d.ts +14 -2
- package/dist/hooks/events/useEventComposer.d.ts +10965 -0
- package/dist/hooks/events/useEventComposer.js +164 -0
- package/dist/hooks/events/useEventForm.d.ts +108 -0
- package/dist/hooks/events/useEventForm.js +154 -0
- package/dist/hooks/events/useEventMenu.d.ts +9 -0
- package/dist/hooks/events/useEventMenu.js +47 -0
- package/dist/hooks/events/useEventRsvp.d.ts +99 -0
- package/dist/hooks/events/useEventRsvp.js +111 -0
- package/dist/hooks/events/useEventTypeSwitcher.d.ts +102 -0
- package/dist/hooks/events/useEventTypeSwitcher.js +160 -0
- package/dist/hooks/events/useEventsCalendar.d.ts +19822 -0
- package/dist/hooks/events/useEventsCalendar.js +89 -0
- package/dist/hooks/groups/useEditGroup.d.ts +87 -0
- package/dist/hooks/groups/useEditGroup.js +80 -0
- package/dist/hooks/groups/useGroupTemplateSelection.d.ts +22 -0
- package/dist/hooks/groups/useGroupTemplateSelection.js +67 -0
- package/dist/hooks/groups/useNewGroup.d.ts +152 -0
- package/dist/hooks/groups/useNewGroup.js +75 -0
- package/dist/hooks/index.d.ts +58 -0
- package/dist/hooks/index.js +36 -0
- package/dist/hooks/jams/useCreateNewJamForm.d.ts +543 -0
- package/dist/hooks/jams/useCreateNewJamForm.js +140 -0
- package/dist/hooks/jams/useJamChat.d.ts +78 -0
- package/dist/hooks/jams/useJamChat.js +64 -0
- package/dist/hooks/jams/useJamDetails.d.ts +9921 -0
- package/dist/hooks/jams/useJamDetails.js +74 -0
- package/dist/hooks/jams/useJamFooterControls.d.ts +27 -0
- package/dist/hooks/jams/useJamFooterControls.js +92 -0
- package/dist/hooks/jams/useJamLobby.d.ts +105 -0
- package/dist/hooks/jams/useJamLobby.js +61 -0
- package/dist/hooks/jams/useJamParticipant.d.ts +11 -0
- package/dist/hooks/jams/useJamParticipant.js +49 -0
- package/dist/hooks/jams/useJamPeople.d.ts +79 -0
- package/dist/hooks/jams/useJamPeople.js +63 -0
- package/dist/hooks/jams/useJamRoom.d.ts +19934 -0
- package/dist/hooks/jams/useJamRoom.js +216 -0
- package/dist/hooks/jams/useJamStage.d.ts +21 -0
- package/dist/hooks/jams/useJamStage.js +48 -0
- package/dist/hooks/jams/useLeaveCloseJam.d.ts +2 -1
- package/dist/hooks/jams/useLeaveCloseJam.js +3 -3
- package/dist/hooks/posts/replyOpener.d.ts +9 -0
- package/dist/hooks/posts/replyOpener.js +12 -0
- package/dist/hooks/posts/useArticleComposer.d.ts +10879 -0
- package/dist/hooks/posts/useArticleComposer.js +112 -0
- package/dist/hooks/posts/useFeedPostActions.d.ts +3 -1
- package/dist/hooks/posts/useFeedPostActions.js +21 -10
- package/dist/hooks/posts/useFeedPostPresentation.d.ts +19827 -0
- package/dist/hooks/posts/useFeedPostPresentation.js +39 -0
- package/dist/hooks/posts/usePostDetailTitle.d.ts +9906 -0
- package/dist/hooks/posts/usePostDetailTitle.js +32 -0
- package/dist/hooks/posts/usePostThreads.d.ts +6 -0
- package/dist/hooks/posts/usePostThreads.js +17 -0
- package/dist/hooks/posts/useShareMenu.d.ts +14 -0
- package/dist/hooks/posts/useShareMenu.js +24 -0
- package/dist/hooks/profile/useFollowProfile.d.ts +8 -0
- package/dist/hooks/profile/useFollowProfile.js +21 -0
- package/dist/hooks/settings/useAccessTokens.d.ts +61 -0
- package/dist/hooks/settings/useAccessTokens.js +128 -0
- package/dist/hooks/settings/useFeedFormatPreference.d.ts +8 -0
- package/dist/hooks/settings/useFeedFormatPreference.js +35 -0
- package/dist/hooks/settings/useLanguagePreference.d.ts +11 -0
- package/dist/hooks/settings/useLanguagePreference.js +55 -0
- package/dist/hooks/settings/useNotificationPreferences.d.ts +26 -0
- package/dist/hooks/settings/useNotificationPreferences.js +79 -0
- package/dist/hooks/settings/usePushEnabledDevices.d.ts +111 -0
- package/dist/hooks/settings/usePushEnabledDevices.js +63 -0
- package/dist/hooks/settings/useThemePreference.d.ts +7 -0
- package/dist/hooks/settings/useThemePreference.js +27 -0
- package/dist/hooks/settings/useTimezonePreference.d.ts +14 -0
- package/dist/hooks/settings/useTimezonePreference.js +52 -0
- package/dist/hooks/useResolvedFeedFormat.d.ts +16 -0
- package/dist/hooks/useResolvedFeedFormat.js +20 -0
- package/dist/i18n/I18nProvider.js +21 -15
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/index.js +26 -0
- package/dist/lib/analyticsClicks.d.ts +1 -1
- package/dist/lib/analyticsClicks.js +4 -10
- package/dist/lib/audienceChoices.d.ts +14 -0
- package/dist/lib/audienceChoices.js +50 -0
- package/dist/lib/audienceSetting.d.ts +6 -0
- package/dist/lib/audienceSetting.js +18 -0
- package/dist/lib/capabilityMatrix.d.ts +76 -0
- package/dist/lib/capabilityMatrix.js +274 -0
- package/dist/lib/configuration/helpers.d.ts +12 -0
- package/dist/lib/configuration/helpers.js +38 -2
- package/dist/lib/groupCapabilityMatrix.d.ts +12 -0
- package/dist/lib/groupCapabilityMatrix.js +17 -0
- package/dist/lib/groupFormErrors.d.ts +15 -0
- package/dist/lib/groupFormErrors.js +61 -0
- package/dist/lib/initialsAvatar.d.ts +7 -0
- package/dist/lib/initialsAvatar.js +23 -0
- package/dist/lib/notificationBadge.d.ts +6 -2
- package/dist/lib/notificationBadge.js +17 -0
- package/dist/lib/reactionEmojis.d.ts +28 -0
- package/dist/lib/reactionEmojis.js +55 -0
- package/dist/navigation/targets.d.ts +2 -1
- package/dist/pages/About.js +4 -7
- package/dist/pages/CodeOfConduct.js +4 -5
- package/dist/pages/Explore.js +2 -2
- package/dist/pages/PostDetail.js +11 -20
- package/dist/pages/Profile.js +9 -2
- package/dist/pages/Tags.d.ts +1 -1
- package/dist/pages/Tags.js +48 -6
- package/dist/pages/Tags.test.d.ts +1 -0
- package/dist/pages/Tags.test.js +75 -0
- package/dist/pages/Welcome.js +1 -1
- package/dist/pages/admin/Analytics.d.ts +1 -0
- package/dist/pages/admin/Analytics.js +1 -0
- package/dist/pages/admin/ConfigEditor.js +4 -8
- package/dist/pages/admin/Configuration.js +18 -2
- package/dist/pages/admin/ConfigurationCommunity.js +1 -1
- package/dist/pages/admin/ConfigurationCommunityFeed.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityFeed.js +69 -0
- package/dist/pages/admin/ConfigurationCommunityTimezone.d.ts +1 -0
- package/dist/pages/admin/ConfigurationCommunityTimezone.js +69 -0
- package/dist/pages/admin/ConfigurationPluginPage.d.ts +1 -0
- package/dist/pages/admin/ConfigurationPluginPage.js +21 -0
- package/dist/pages/admin/ConfigurationSso.d.ts +1 -0
- package/dist/pages/admin/ConfigurationSso.js +104 -0
- package/dist/pages/admin/ConfigurationSsoNew.d.ts +1 -0
- package/dist/pages/admin/ConfigurationSsoNew.js +44 -0
- package/dist/pages/admin/Dashboard.js +65 -20
- package/dist/pages/admin/Db.js +2 -2
- package/dist/pages/admin/GroupMembers.js +6 -39
- package/dist/pages/admin/Groups.js +4 -2
- package/dist/pages/admin/Invites.js +9 -4
- package/dist/pages/admin/MemberDetail.d.ts +1 -0
- package/dist/pages/admin/MemberDetail.js +66 -0
- package/dist/pages/admin/Members.js +39 -10
- package/dist/pages/admin/Plugins.d.ts +1 -0
- package/dist/pages/admin/Plugins.js +208 -0
- package/dist/pages/admin/Reports.js +17 -17
- package/dist/pages/admin/analytics/AnalyticsLayout.js +30 -5
- package/dist/pages/admin/analytics/Content.js +6 -6
- package/dist/pages/admin/analytics/Engagement.js +10 -10
- package/dist/pages/admin/analytics/Groups.js +5 -13
- package/dist/pages/admin/analytics/Members.js +10 -2
- package/dist/pages/admin/analytics/Overview.js +10 -10
- package/dist/pages/admin/analytics/PluginPage.d.ts +1 -0
- package/dist/pages/admin/analytics/PluginPage.js +26 -0
- package/dist/pages/admin/analytics/analyticsPluginTabs.d.ts +4 -0
- package/dist/pages/admin/analytics/analyticsPluginTabs.js +25 -0
- package/dist/pages/admin/community/CommunityRoles.js +107 -58
- package/dist/pages/admin/community/CommunityTheme.js +1 -1
- package/dist/pages/admin/community/useCommunityConfig.d.ts +6 -2
- package/dist/pages/admin/components/AdminGroupCard.js +1 -1
- package/dist/pages/admin/components/InviteWithEmailModal.js +5 -5
- package/dist/pages/admin/components/InviteWithLinkModal.d.ts +0 -1
- package/dist/pages/admin/components/InviteWithLinkModal.js +45 -14
- package/dist/pages/admin/components/ProfileRowActions.js +19 -13
- package/dist/pages/admin/components/RestoreBackupModal.js +6 -2
- package/dist/pages/admin/components/RestoreTestBackupModal.js +6 -4
- package/dist/pages/admin/components/ServerStatusSection.d.ts +5 -0
- package/dist/pages/admin/components/ServerStatusSection.js +62 -0
- package/dist/pages/admin/components/inviteQr.d.ts +8 -0
- package/dist/pages/admin/components/inviteQr.js +72 -0
- package/dist/pages/admin/components/serverStatusFormat.d.ts +3 -0
- package/dist/pages/admin/components/serverStatusFormat.js +32 -0
- package/dist/pages/admin/configurationPluginPages.d.ts +4 -0
- package/dist/pages/admin/configurationPluginPages.js +26 -0
- package/dist/pages/admin/configurationSsoShared.d.ts +307 -0
- package/dist/pages/admin/configurationSsoShared.js +192 -0
- package/dist/pages/articles/Edit.js +6 -40
- package/dist/pages/articles/Index.js +2 -1
- package/dist/pages/articles/New.js +6 -39
- package/dist/pages/auth/Closed.js +4 -2
- package/dist/pages/auth/Login.js +55 -21
- package/dist/pages/auth/Register.js +25 -9
- package/dist/pages/auth/RequestResetPassword.js +4 -4
- package/dist/pages/auth/ResetPassword.js +4 -4
- package/dist/pages/conversations/Index.js +19 -6
- package/dist/pages/conversations/Info.js +40 -3
- package/dist/pages/conversations/Show.js +29 -20
- package/dist/pages/events/Edit.js +11 -52
- package/dist/pages/events/Index.js +7 -4
- package/dist/pages/events/My.js +2 -2
- package/dist/pages/events/New.js +6 -57
- package/dist/pages/feeds/Bookmarks.js +4 -2
- package/dist/pages/feeds/Local.js +2 -1
- package/dist/pages/feeds/My.js +2 -1
- package/dist/pages/groups/Edit.js +11 -41
- package/dist/pages/groups/EditInfo.d.ts +1 -0
- package/dist/pages/groups/EditInfo.js +22 -0
- package/dist/pages/groups/EditRoles.d.ts +1 -0
- package/dist/pages/groups/EditRoles.js +29 -0
- package/dist/pages/groups/New.js +6 -58
- package/dist/pages/groups/Show.js +2 -2
- package/dist/pages/index.d.ts +13 -0
- package/dist/pages/index.js +13 -0
- package/dist/pages/jams/Event.js +3 -1
- package/dist/pages/jams/Index.js +3 -1
- package/dist/pages/payment/Success.js +2 -2
- package/dist/pages/settings/AccessTokens.js +10 -104
- package/dist/pages/settings/Account.js +43 -2
- package/dist/pages/settings/Billing.js +11 -7
- package/dist/pages/settings/Blocked.d.ts +1 -0
- package/dist/pages/settings/Blocked.js +29 -0
- package/dist/pages/settings/Feed.d.ts +1 -0
- package/dist/pages/settings/Feed.js +36 -0
- package/dist/pages/settings/Index.js +1 -1
- package/dist/pages/settings/Language.js +9 -44
- package/dist/pages/settings/NotificationPreferences.js +16 -68
- package/dist/pages/settings/PublicProfile.js +9 -0
- package/dist/pages/settings/PushEnabledDevices.js +10 -43
- package/dist/pages/settings/Theme.js +5 -21
- package/dist/pages/settings/Timezone.d.ts +1 -0
- package/dist/pages/settings/Timezone.js +19 -0
- package/dist/pwa/PwaProvider.d.ts +3 -2
- package/dist/pwa/PwaProvider.js +19 -2
- package/dist/pwa/pageReload.d.ts +12 -0
- package/dist/pwa/pageReload.js +30 -0
- package/dist/pwa/registration.js +3 -0
- package/dist/pwa/staleAppReload.d.ts +33 -0
- package/dist/pwa/staleAppReload.js +123 -0
- package/dist/pwa/useServiceWorker.d.ts +1 -1
- package/dist/pwa/useServiceWorker.js +15 -1
- package/dist/react-native.d.ts +46 -0
- package/dist/react-native.js +33 -0
- package/dist/stores/eventView.d.ts +10 -0
- package/dist/stores/eventView.js +14 -0
- package/dist/stores/feedFormat.d.ts +7 -0
- package/dist/stores/feedFormat.js +14 -0
- package/dist/stores/index.d.ts +3 -0
- package/dist/stores/index.js +2 -0
- package/dist/stores/newPosts.d.ts +78 -12
- package/package.json +10 -6
- package/dist/lib/groupCapabilityHelpers.d.ts +0 -24
- package/dist/lib/groupCapabilityHelpers.js +0 -119
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { useParams } from 'react-router-dom';
|
|
4
|
-
import {
|
|
4
|
+
import { Info } from 'lucide-react';
|
|
5
|
+
import { useT, useOpenpeeps, useSetPageHeader, usePostViewFlush, adjustUnseenCounts, useNavigate, } from '../../index.js';
|
|
5
6
|
import { canCreatePost } from '@openpeepshq/common';
|
|
6
|
-
import { Avatar, MessageInThread, ProfileCard, useAuthData, useCurrentProfile, useToast, } from '../../components/index.js';
|
|
7
|
-
import { Button,
|
|
7
|
+
import { Avatar, ConversationParticipantsModal, MessageInThread, OpenpeepsMarkdownInput, ProfileCard, useAuthData, useCurrentProfile, useToast, } from '../../components/index.js';
|
|
8
|
+
import { Button, LoadingSpinner } from '@openpeepshq/react-ui';
|
|
8
9
|
const MAX_LENGTH = 500;
|
|
9
10
|
export function ConversationShow() {
|
|
10
11
|
const t = useT();
|
|
@@ -13,7 +14,6 @@ export function ConversationShow() {
|
|
|
13
14
|
const me = useCurrentProfile();
|
|
14
15
|
const authData = useAuthData();
|
|
15
16
|
const toast = useToast();
|
|
16
|
-
const canCreate = canCreatePost(authData, 'note', 'direct');
|
|
17
17
|
const endRef = useRef(null);
|
|
18
18
|
const conversationQuery = openpeepsApi.useConversation(id);
|
|
19
19
|
const createMessage = openpeepsApi.createConversationPostAction({ id });
|
|
@@ -22,11 +22,27 @@ export function ConversationShow() {
|
|
|
22
22
|
const messages = conversationQuery.data ?? [];
|
|
23
23
|
const lastMessage = messages[messages.length - 1];
|
|
24
24
|
const participants = lastMessage?.audience?.filter((a) => a.id !== me?.id) ?? [];
|
|
25
|
+
const hasLeft = lastMessage?.profile?.id === me?.id &&
|
|
26
|
+
!lastMessage?.audience?.some((p) => p.id === me?.id);
|
|
27
|
+
const canCreate = canCreatePost(authData, 'note', 'direct') && !hasLeft;
|
|
25
28
|
const multipleParticipants = participants.length > 1;
|
|
26
|
-
const
|
|
29
|
+
const [participantsOpen, setParticipantsOpen] = useState(false);
|
|
30
|
+
const participantNames = participants.length > 0
|
|
27
31
|
? participants.map((p) => p.displayName || `@${p.handle}`).join(', ')
|
|
28
32
|
: t('conversations.title', { defaultValue: 'Conversation' });
|
|
29
|
-
|
|
33
|
+
const openParticipantsLabel = t('conversations.participants.openList', {
|
|
34
|
+
defaultValue: 'View participants',
|
|
35
|
+
});
|
|
36
|
+
const headerTitle = useMemo(() => {
|
|
37
|
+
if (!multipleParticipants)
|
|
38
|
+
return participantNames;
|
|
39
|
+
return (_jsx("button", { type: "button", className: "min-w-0 truncate text-left text-xl font-semibold", onClick: () => setParticipantsOpen(true), title: openParticipantsLabel, "aria-haspopup": "dialog", "data-testid": "conversation-participants-open", children: participantNames }));
|
|
40
|
+
}, [multipleParticipants, participantNames, openParticipantsLabel]);
|
|
41
|
+
const navigate = useNavigate();
|
|
42
|
+
const headerActions = useMemo(() => (_jsx("button", { type: "button", onClick: () => navigate({ type: 'conversation', id, view: 'info' }), title: t('conversations.info.title', {
|
|
43
|
+
defaultValue: 'Conversation info',
|
|
44
|
+
}), className: "text-muted-foreground hover:text-foreground rounded-md p-1.5", children: _jsx(Info, { size: 18 }) })), [id, navigate, t]);
|
|
45
|
+
useSetPageHeader(headerTitle, headerActions);
|
|
30
46
|
const [text, setText] = useState('');
|
|
31
47
|
const [sending, setSending] = useState(false);
|
|
32
48
|
const send = async () => {
|
|
@@ -83,18 +99,11 @@ export function ConversationShow() {
|
|
|
83
99
|
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
84
100
|
}
|
|
85
101
|
const overLimit = text.length > MAX_LENGTH;
|
|
86
|
-
return (_jsxs("div", { className: "flex h-[calc(100vh-8rem)] flex-col", children: [_jsx("header", { className: "border-b", children: participants.length === 1 && participants[0] ? (_jsx(ProfileCard, { profile: participants[0], showAction: false })) : (_jsxs("
|
|
87
|
-
.map((p) => p.displayName || `@${p.handle}`)
|
|
88
|
-
.join(', ') })] })) }), _jsxs("div", { role: "log", "aria-live": "polite", "aria-label": t('conversations.messageLog', {
|
|
102
|
+
return (_jsxs("div", { className: "flex h-[calc(100vh-8rem)] flex-col", children: [_jsx("header", { className: "border-b", children: participants.length === 1 && participants[0] ? (_jsx(ProfileCard, { profile: participants[0], showAction: false })) : multipleParticipants ? (_jsxs("button", { type: "button", className: "flex w-full min-w-0 items-center gap-2 p-3 text-left", onClick: () => setParticipantsOpen(true), title: openParticipantsLabel, "aria-haspopup": "dialog", children: [_jsx("div", { className: "flex shrink-0 -space-x-2", children: participants.slice(0, 4).map((p) => (_jsx(Avatar, { profile: p, size: 2.25, borderless: true }, p.id))) }), _jsx("div", { className: "min-w-0 truncate text-sm font-medium", children: participantNames })] })) : null }), _jsx(ConversationParticipantsModal, { open: participantsOpen, onOpenChange: setParticipantsOpen, participants: participants }), _jsxs("div", { role: "log", "aria-live": "polite", "aria-label": t('conversations.messageLog', {
|
|
89
103
|
defaultValue: 'Messages',
|
|
90
|
-
}), className: "flex-1 overflow-y-auto px-3", children: [messages.map((m, index) => (_jsx(MessageInThread, { previous: messages[index - 1], message: m, multipleParticipants: multipleParticipants, conversationRootId: id }, m.id))), _jsx("div", { ref: endRef })] }), canCreate && (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
send();
|
|
96
|
-
}
|
|
97
|
-
} }), _jsx(Button, { title: "Send", variant: "default", action: send, disabled: sending || !text.trim() || overLimit, children: sending
|
|
98
|
-
? t('common.sending', { defaultValue: 'Sending…' })
|
|
99
|
-
: t('common.send', { defaultValue: 'Send' }) })] }), _jsxs("span", { className: `pt-1 text-right text-[10px] ${overLimit ? 'text-error' : 'text-muted-foreground'}`, children: [text.length, " / ", MAX_LENGTH] })] }) }))] }));
|
|
104
|
+
}), className: "flex-1 overflow-y-auto px-3", children: [messages.map((m, index) => (_jsx(MessageInThread, { previous: messages[index - 1], message: m, multipleParticipants: multipleParticipants, conversationRootId: id }, m.id))), _jsx("div", { ref: endRef })] }), canCreate && (_jsxs("footer", { className: "space-y-2 border-t p-3", children: [_jsx(OpenpeepsMarkdownInput, { rows: 3, value: text, onChange: setText, maxLength: MAX_LENGTH, placeholder: t('conversations.placeholder', {
|
|
105
|
+
defaultValue: 'Write a message…',
|
|
106
|
+
}) }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { title: "Send", variant: "default", action: send, disabled: sending || !text.trim() || overLimit, children: sending
|
|
107
|
+
? t('common.sending', { defaultValue: 'Sending…' })
|
|
108
|
+
: t('common.send', { defaultValue: 'Send' }) }) })] }))] }));
|
|
100
109
|
}
|
|
@@ -1,61 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useT,
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useParams, useSearchParams } from 'react-router-dom';
|
|
4
|
+
import { parseOccurrenceQuery, truncateText } from '@openpeepshq/common/lib';
|
|
5
|
+
import { useT, useSetPageHeader } from '../../index.js';
|
|
6
|
+
import { useEditEvent } from '../../hooks/events/useEventComposer.js';
|
|
6
7
|
import { EventForm } from '../../components/index.js';
|
|
7
8
|
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
8
9
|
export function EditEvent() {
|
|
9
10
|
const t = useT();
|
|
10
|
-
const navigate = useNavigate();
|
|
11
11
|
const { eventId = '' } = useParams();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const [loadedEventId, setLoadedEventId] = useState(null);
|
|
17
|
-
const [submitting, setSubmitting] = useState(false);
|
|
18
|
-
const [error, setError] = useState(null);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (postQuery.data?.type === 'event' &&
|
|
21
|
-
postQuery.data.id !== loadedEventId) {
|
|
22
|
-
setPostData({
|
|
23
|
-
visibility: postQuery.data.visibility,
|
|
24
|
-
type: 'event',
|
|
25
|
-
groupId: postQuery.data.groupId ?? undefined,
|
|
26
|
-
audience: postQuery.data.audience ?? undefined,
|
|
27
|
-
data: postQuery.data.data,
|
|
28
|
-
});
|
|
29
|
-
setLoadedEventId(postQuery.data.id);
|
|
30
|
-
}
|
|
31
|
-
}, [loadedEventId, postQuery.data]);
|
|
32
|
-
const event = postData?.data.type === 'event' ? postData.data : null;
|
|
33
|
-
const eventName = postQuery.data?.data?.name;
|
|
34
|
-
const submit = useCallback(async () => {
|
|
35
|
-
if (!postData || !event)
|
|
36
|
-
return;
|
|
37
|
-
setError(null);
|
|
38
|
-
if (!event.start) {
|
|
39
|
-
setError(t('events.validation.startRequired', {
|
|
40
|
-
defaultValue: 'Start date is required',
|
|
41
|
-
}));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
setSubmitting(true);
|
|
45
|
-
try {
|
|
46
|
-
await updatePost(normalizeEventDataForSave(event));
|
|
47
|
-
navigate(`/posts/${eventId}`);
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
setError(err.message);
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
setSubmitting(false);
|
|
54
|
-
}
|
|
55
|
-
}, [event, eventId, navigate, postData, t, updatePost]);
|
|
56
|
-
const headerActions = useMemo(() => (_jsx(Button, { title: t('events.update.title', { defaultValue: 'Update event' }), variant: "default", action: submit, disabled: submitting || !event?.start, children: submitting
|
|
12
|
+
const [searchParams] = useSearchParams();
|
|
13
|
+
const occurrence = parseOccurrenceQuery(searchParams.get('occurrence'));
|
|
14
|
+
const { postQuery, postData, setPostData, eventName, canSubmit, submitting, error, clearError, submit, } = useEditEvent(eventId, occurrence);
|
|
15
|
+
const headerActions = useMemo(() => (_jsx(Button, { title: t('events.update.title', { defaultValue: 'Update event' }), variant: "default", action: submit, disabled: submitting || !canSubmit, children: submitting
|
|
57
16
|
? t('common.saving', { defaultValue: 'Saving…' })
|
|
58
|
-
: t('events.update.title', { defaultValue: 'Update event' }) })), [
|
|
17
|
+
: t('events.update.title', { defaultValue: 'Update event' }) })), [canSubmit, submit, submitting, t]);
|
|
59
18
|
useSetPageHeader(eventName
|
|
60
19
|
? `${t('events.edit', { defaultValue: 'Edit event' })} ${truncateText(eventName)}`
|
|
61
20
|
: t('events.edit', { defaultValue: 'Edit event' }), headerActions);
|
|
@@ -65,5 +24,5 @@ export function EditEvent() {
|
|
|
65
24
|
if (!postQuery.data || !postData) {
|
|
66
25
|
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('events.notFound', { defaultValue: 'Event not found' }) }));
|
|
67
26
|
}
|
|
68
|
-
return (_jsxs("div", { className: "pb-12", children: [_jsx(EventForm, { postData: postData, onChange: setPostData, isEdit: true }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss:
|
|
27
|
+
return (_jsxs("div", { className: "pb-12", children: [_jsx(EventForm, { postData: postData, onChange: setPostData, isEdit: true, occurrenceEdit: !!occurrence }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: clearError, children: error }) })) : null] }));
|
|
69
28
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
3
|
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
4
5
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
5
|
-
import { EventsFeed, NewEventButton, useCurrentProfile, useDefaultVisibility, } from '../../components/index.js';
|
|
6
|
+
import { EventsFeed, EventsView, NewEventButton, useCurrentProfile, useDefaultVisibility, } from '../../components/index.js';
|
|
7
|
+
import { PopupMenu, PopupMenuButton } from '@openpeepshq/react-ui';
|
|
6
8
|
export function EventsIndex() {
|
|
7
9
|
const t = useT();
|
|
8
10
|
const navigate = useNavigate();
|
|
@@ -13,10 +15,11 @@ export function EventsIndex() {
|
|
|
13
15
|
const upcomingQuery = openpeepsApi.useUpcomingEventsFeed();
|
|
14
16
|
const pastQuery = openpeepsApi.usePastEventsFeed();
|
|
15
17
|
const activeQuery = tab === 'upcoming' ? upcomingQuery : pastQuery;
|
|
16
|
-
|
|
18
|
+
const headerActions = useMemo(() => (_jsx(PopupMenu, { icon: MoreHorizontal, compact: true, children: _jsx(PopupMenuButton, { icon: ChevronRight, title: t('navigation.myEvents', { defaultValue: 'My events' }), text: t('navigation.myEvents', { defaultValue: 'My events' }), action: "/events/my" }) })), [t]);
|
|
19
|
+
useSetPageHeader(t('navigation.events', { defaultValue: 'Events' }), headerActions, 'events-page-heading');
|
|
17
20
|
return (_jsxs("div", { className: "p-4", children: [_jsx(NewEventButton, { visibility: visibility, currentProfile: currentProfile, onNavigate: () => navigate('/events/new'), showButton: false }), _jsxs("nav", { "aria-label": t('events.feed.label', {
|
|
18
21
|
defaultValue: 'Event timeframe',
|
|
19
|
-
}), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsFeed, { query: activeQuery })] }));
|
|
22
|
+
}), className: "border-border mb-4 flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsView, { query: activeQuery, agenda: tab, list: _jsx(EventsFeed, { query: activeQuery }) })] }));
|
|
20
23
|
}
|
|
21
24
|
function TabButton({ active, onClick, children, }) {
|
|
22
25
|
return (_jsx("button", { type: "button", onClick: onClick, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: children }));
|
package/dist/pages/events/My.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
4
|
-
import { Feed } from '../../components/index.js';
|
|
4
|
+
import { EventsView, Feed } from '../../components/index.js';
|
|
5
5
|
export function EventsMy() {
|
|
6
6
|
const t = useT();
|
|
7
7
|
const { openpeepsApi } = useOpenpeeps();
|
|
@@ -17,7 +17,7 @@ export function EventsMy() {
|
|
|
17
17
|
useSetPageHeader(t('navigation.myEvents', { defaultValue: 'My events' }));
|
|
18
18
|
return (_jsxs("div", { children: [_jsxs("nav", { "aria-label": t('events.feed.label', {
|
|
19
19
|
defaultValue: 'Event timeframe',
|
|
20
|
-
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'current', onClick: () => setTab('current'), children: t('events.feed.current', { defaultValue: 'Now' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(Feed, { query: activeQuery })] }));
|
|
20
|
+
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: tab === 'upcoming', onClick: () => setTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: tab === 'current', onClick: () => setTab('current'), children: t('events.feed.current', { defaultValue: 'Now' }) }), _jsx(TabButton, { active: tab === 'past', onClick: () => setTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsView, { query: activeQuery, agenda: tab, list: _jsx(Feed, { query: activeQuery, formatSwitch: false }) })] }));
|
|
21
21
|
}
|
|
22
22
|
function TabButton({ active, onClick, children, }) {
|
|
23
23
|
return (_jsx("button", { type: "button", onClick: onClick, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: children }));
|
package/dist/pages/events/New.js
CHANGED
|
@@ -1,66 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { EventForm
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useT, useSetPageHeader } from '../../index.js';
|
|
4
|
+
import { useNewEvent } from '../../hooks/events/useEventComposer.js';
|
|
5
|
+
import { EventForm } from '../../components/index.js';
|
|
6
6
|
import { Button, Toast } from '@openpeepshq/react-ui';
|
|
7
|
-
import { normalizeEventDataForSave } from '@openpeepshq/common/lib';
|
|
8
7
|
export function NewEvent() {
|
|
9
8
|
const t = useT();
|
|
10
|
-
const
|
|
11
|
-
const serverInfo = useServerInfo();
|
|
12
|
-
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
-
const createPost = openpeepsApi.createPostAction();
|
|
14
|
-
const stores = getNewPostStores();
|
|
15
|
-
const sanitize = useMemo(() => eventSanitizer(serverInfo.publicContent), [serverInfo.publicContent]);
|
|
16
|
-
const [postData, setPostData] = useState(() => sanitize(stores.event));
|
|
17
|
-
const [submitting, setSubmitting] = useState(false);
|
|
18
|
-
const [error, setError] = useState(null);
|
|
19
|
-
const event = postData.data.type === 'event' ? postData.data : null;
|
|
20
|
-
const canSubmit = !!event?.start &&
|
|
21
|
-
!!event?.name?.trim() &&
|
|
22
|
-
!(postData.visibility === 'direct' && !postData.audience?.length);
|
|
23
|
-
const submit = useCallback(async () => {
|
|
24
|
-
setError(null);
|
|
25
|
-
if (!event?.start) {
|
|
26
|
-
setError(t('events.validation.startRequired', {
|
|
27
|
-
defaultValue: 'Start date is required',
|
|
28
|
-
}));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (!event.name?.trim()) {
|
|
32
|
-
setError(t('events.validation.nameRequired', {
|
|
33
|
-
defaultValue: 'Event name is required',
|
|
34
|
-
}));
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (postData.visibility === 'direct' && !postData.audience?.length) {
|
|
38
|
-
setError('Choose at least one recipient for a direct event.');
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
setSubmitting(true);
|
|
42
|
-
try {
|
|
43
|
-
const created = await createPost({
|
|
44
|
-
...postData,
|
|
45
|
-
type: 'event',
|
|
46
|
-
data: normalizeEventDataForSave(event),
|
|
47
|
-
});
|
|
48
|
-
stores.resetNewEventState();
|
|
49
|
-
navigate(`/posts/${created.id}`);
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
setError(err.message);
|
|
53
|
-
}
|
|
54
|
-
finally {
|
|
55
|
-
setSubmitting(false);
|
|
56
|
-
}
|
|
57
|
-
}, [createPost, event, navigate, postData, stores, t]);
|
|
9
|
+
const { postData, setPostData, canSubmit, submitting, error, clearError, submit, } = useNewEvent();
|
|
58
10
|
const headerActions = useMemo(() => (_jsx(Button, { title: t('events.create.title', { defaultValue: 'Create Event' }), variant: "default", action: submit, disabled: submitting || !canSubmit, "data-testid": "events-create-submit", children: submitting
|
|
59
11
|
? t('common.submitting', { defaultValue: 'Creating…' })
|
|
60
12
|
: t('events.create.title', { defaultValue: 'Create Event' }) })), [canSubmit, submit, submitting, t]);
|
|
61
13
|
useSetPageHeader(t('events.create.title', { defaultValue: 'Create Event' }), headerActions);
|
|
62
|
-
return (_jsxs("div", { className: "pb-12", children: [_jsx(EventForm, { postData: postData, onChange: (
|
|
63
|
-
setPostData(data);
|
|
64
|
-
stores.event = data;
|
|
65
|
-
} }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error }) })) : null] }));
|
|
14
|
+
return (_jsxs("div", { className: "pb-12", children: [_jsx(EventForm, { postData: postData, onChange: setPostData }), error ? (_jsx("div", { className: "px-3", children: _jsx(Toast, { variant: "error", onDismiss: clearError, children: error }) })) : null] }));
|
|
66
15
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
3
3
|
import { Feed } from '../../components/index.js';
|
|
4
|
+
import { useFeedListParams } from '../../hooks/index.js';
|
|
4
5
|
export function FeedsBookmarks() {
|
|
5
6
|
const t = useT();
|
|
6
7
|
const { openpeepsApi } = useOpenpeeps();
|
|
7
|
-
|
|
8
|
+
// Bookmarks can be replies; threaded would hide them.
|
|
9
|
+
const query = openpeepsApi.useBookmarkedPosts(useFeedListParams({ format: 'linear' }));
|
|
8
10
|
useSetPageHeader(t('navigation.bookmarks', { defaultValue: 'Bookmarks' }));
|
|
9
|
-
return _jsx(Feed, { query: query });
|
|
11
|
+
return _jsx(Feed, { query: query, formatSwitch: false });
|
|
10
12
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
3
3
|
import { Feed, useDefaultVisibility, useNewNotePlusButton, useServerInfo, PluginSlot, } from '../../components/index.js';
|
|
4
|
+
import { useFeedListParams } from '../../hooks/index.js';
|
|
4
5
|
export function FeedsLocal() {
|
|
5
6
|
const t = useT();
|
|
6
7
|
const { openpeepsApi } = useOpenpeeps();
|
|
7
8
|
const serverInfo = useServerInfo();
|
|
8
9
|
const visibility = useDefaultVisibility();
|
|
9
10
|
useNewNotePlusButton({ visibility });
|
|
10
|
-
const query = openpeepsApi.useLocalFeed();
|
|
11
|
+
const query = openpeepsApi.useLocalFeed(useFeedListParams());
|
|
11
12
|
const pinnedPostId = serverInfo.communityConfig?.content?.pinnedPost;
|
|
12
13
|
useSetPageHeader(t('navigation.community', { defaultValue: 'Community' }), undefined, 'feeds-community-heading');
|
|
13
14
|
return (_jsxs(_Fragment, { children: [_jsx(PluginSlot, { name: "plugins.header", className: "p-4 pb-0" }), _jsx(Feed, { query: query, pinnedPostId: pinnedPostId ?? undefined })] }));
|
package/dist/pages/feeds/My.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
3
3
|
import { Feed, useDefaultVisibility, useNewNotePlusButton, } from '../../components/index.js';
|
|
4
|
+
import { useFeedListParams } from '../../hooks/index.js';
|
|
4
5
|
export function FeedsMy() {
|
|
5
6
|
const t = useT();
|
|
6
7
|
const { openpeepsApi } = useOpenpeeps();
|
|
7
8
|
const visibility = useDefaultVisibility();
|
|
8
9
|
useNewNotePlusButton({ visibility });
|
|
9
|
-
const query = openpeepsApi.useMyFeed();
|
|
10
|
+
const query = openpeepsApi.useMyFeed(useFeedListParams());
|
|
10
11
|
useSetPageHeader(t('navigation.myFeed', { defaultValue: 'My feed' }));
|
|
11
12
|
return _jsx(Feed, { query: query });
|
|
12
13
|
}
|
|
@@ -1,57 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { checkGroupCapabilities } from '@openpeepshq/common/lib';
|
|
3
|
+
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
4
|
+
import { useParams } from 'react-router-dom';
|
|
4
5
|
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
5
|
-
import {
|
|
6
|
-
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
6
|
+
import { ConfigMenuButton, useAuthData } from '../../components/index.js';
|
|
7
7
|
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
8
8
|
export function EditGroup() {
|
|
9
9
|
const t = useT();
|
|
10
|
-
const navigate = useNavigate();
|
|
11
10
|
const { handle: handleParam = '' } = useParams();
|
|
12
11
|
const handle = routeHandleParam(handleParam);
|
|
13
12
|
const { openpeepsApi } = useOpenpeeps();
|
|
13
|
+
const authData = useAuthData();
|
|
14
14
|
const groupQuery = openpeepsApi.useGroupByHandle(handle);
|
|
15
|
-
const updateGroup = openpeepsApi.updateGroupAction();
|
|
16
15
|
useSetPageHeader(t('groups.edit.title', { defaultValue: 'Edit group' }));
|
|
17
|
-
|
|
18
|
-
const [submitting, setSubmitting] = useState(false);
|
|
19
|
-
const [error, setError] = useState(null);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (groupQuery.data) {
|
|
22
|
-
const { handle, avatar, header, displayName, description, rules, capabilities, } = groupQuery.data;
|
|
23
|
-
setGroupData({
|
|
24
|
-
handle,
|
|
25
|
-
avatar,
|
|
26
|
-
header,
|
|
27
|
-
displayName,
|
|
28
|
-
description,
|
|
29
|
-
rules,
|
|
30
|
-
capabilities,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}, [groupQuery.data]);
|
|
34
|
-
if (groupQuery.isLoading || !groupData) {
|
|
16
|
+
if (groupQuery.isLoading) {
|
|
35
17
|
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
36
18
|
}
|
|
37
19
|
if (!groupQuery.data) {
|
|
38
20
|
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('groups.notFound', { defaultValue: 'Group not found' }) }));
|
|
39
21
|
}
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
navigate(`/groups/@${updated.handle}`);
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
setError(err.message);
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
setSubmitting(false);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, onChange: setGroupData, isEdit: true }), error && (_jsx(Toast, { variant: "error", onDismiss: () => setError(null), children: error })), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
55
|
-
? t('common.saving', { defaultValue: 'Saving…' })
|
|
56
|
-
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
22
|
+
const group = groupQuery.data;
|
|
23
|
+
const base = `/groups/@${group.handle}`;
|
|
24
|
+
const canEdit = checkGroupCapabilities(authData, ['core-groups-update'], group).success;
|
|
25
|
+
const canEditCapabilities = checkGroupCapabilities(authData, ['core-groups-updateCapabilities'], group).success;
|
|
26
|
+
return (_jsxs("nav", { "aria-label": t('groups.edit.title', { defaultValue: 'Edit group' }), className: "p-4", children: [canEdit ? (_jsx(ConfigMenuButton, { translationPrefix: "groups.edit.info", action: `${base}/edit/info`, testId: "group-edit-info-link" })) : null, canEditCapabilities ? (_jsx(ConfigMenuButton, { translationPrefix: "groups.edit.roles", action: `${base}/edit/roles`, testId: "group-edit-roles-link" })) : null] }));
|
|
57
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditGroupInfo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { useT, useSetPageHeader } from '../../index.js';
|
|
4
|
+
import { GroupForm } from '../../components/index.js';
|
|
5
|
+
import { useEditGroup } from '../../hooks/index.js';
|
|
6
|
+
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
7
|
+
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
8
|
+
export function EditGroupInfo() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const { handle: handleParam = '' } = useParams();
|
|
11
|
+
const { groupQuery, groupData, setGroupData, submitting, error, clearError, fieldErrors, submit, } = useEditGroup(routeHandleParam(handleParam), { section: 'info' });
|
|
12
|
+
useSetPageHeader(t('groups.edit.info.title', { defaultValue: 'Group information' }));
|
|
13
|
+
if (groupQuery.isLoading || !groupData) {
|
|
14
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
15
|
+
}
|
|
16
|
+
if (!groupQuery.data) {
|
|
17
|
+
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('groups.notFound', { defaultValue: 'Group not found' }) }));
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, fieldErrors: fieldErrors, isEdit: true, sections: ['info'], onChange: setGroupData }), error && (_jsx(Toast, { variant: "error", onDismiss: clearError, children: error })), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
20
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
21
|
+
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditGroupRoles(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useParams } from 'react-router-dom';
|
|
3
|
+
import { useT, useSetPageHeader } from '../../index.js';
|
|
4
|
+
import { GroupForm } from '../../components/index.js';
|
|
5
|
+
import { useEditGroup } from '../../hooks/index.js';
|
|
6
|
+
import { Button, LoadingSpinner, Toast } from '@openpeepshq/react-ui';
|
|
7
|
+
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
8
|
+
export function EditGroupRoles() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const { handle: handleParam = '' } = useParams();
|
|
11
|
+
const { groupQuery, groupData, setGroupData, submitting, error, clearError, canEditCapabilities, submit, } = useEditGroup(routeHandleParam(handleParam), { section: 'roles' });
|
|
12
|
+
useSetPageHeader(t('groups.edit.roles.title', {
|
|
13
|
+
defaultValue: 'Roles & capabilities',
|
|
14
|
+
}));
|
|
15
|
+
if (groupQuery.isLoading || !groupData) {
|
|
16
|
+
return (_jsx("div", { className: "text-muted-foreground flex h-32 items-center justify-center text-sm", children: _jsx(LoadingSpinner, {}) }));
|
|
17
|
+
}
|
|
18
|
+
if (!groupQuery.data) {
|
|
19
|
+
return (_jsx("div", { className: "p-8 text-center text-2xl", children: t('groups.notFound', { defaultValue: 'Group not found' }) }));
|
|
20
|
+
}
|
|
21
|
+
if (!canEditCapabilities) {
|
|
22
|
+
return (_jsx("div", { className: "p-8 text-center text-sm", children: t('groups.edit.rolesForbidden', {
|
|
23
|
+
defaultValue: 'You do not have permission to edit roles and capabilities.',
|
|
24
|
+
}) }));
|
|
25
|
+
}
|
|
26
|
+
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, isEdit: true, sections: ['roles'], onChange: setGroupData }), error && (_jsx(Toast, { variant: "error", onDismiss: clearError, children: error })), _jsx(Button, { title: "Save", variant: "default", action: submit, disabled: submitting, children: submitting
|
|
27
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
28
|
+
: t('common.save', { defaultValue: 'Save' }) })] }));
|
|
29
|
+
}
|
package/dist/pages/groups/New.js
CHANGED
|
@@ -1,68 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useT, useOpenpeeps, useSetPageHeader } from '../../index.js';
|
|
6
|
-
import { GroupForm, ProfilesInput, useCurrentProfile, useServerInfo, } from '../../components/index.js';
|
|
2
|
+
import { useT, useSetPageHeader } from '../../index.js';
|
|
3
|
+
import { GroupForm, ProfilesInput, useCurrentProfile } from '../../components/index.js';
|
|
4
|
+
import { useNewGroup } from '../../hooks/index.js';
|
|
7
5
|
import { Button, Label, Toast } from '@openpeepshq/react-ui';
|
|
8
6
|
export function NewGroup() {
|
|
9
7
|
const t = useT();
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
const { openpeepsApi } = useOpenpeeps();
|
|
12
|
-
const createGroup = openpeepsApi.createGroupAction();
|
|
13
|
-
const { publicContent } = useServerInfo();
|
|
14
8
|
const me = useCurrentProfile();
|
|
15
|
-
const
|
|
9
|
+
const { groupData, setGroupData, members, setMembers, submitting, error, clearError, fieldErrors, submit, } = useNewGroup();
|
|
16
10
|
useSetPageHeader(t('groups.new.title', { defaultValue: 'Create group' }), undefined, 'groups-create-page-title');
|
|
17
|
-
|
|
18
|
-
displayName: '',
|
|
19
|
-
handle: '',
|
|
20
|
-
description: '',
|
|
21
|
-
rules: '',
|
|
22
|
-
capabilities: publicContent
|
|
23
|
-
? groupCapabilityTemplates.defaultGroup.capabilities
|
|
24
|
-
: groupCapabilityTemplates.defaultGroupClosedCommunity.capabilities,
|
|
25
|
-
}));
|
|
26
|
-
const [submitting, setSubmitting] = useState(false);
|
|
27
|
-
const [error, setError] = useState(null);
|
|
28
|
-
const submit = async () => {
|
|
29
|
-
setError(null);
|
|
30
|
-
let data = groupData;
|
|
31
|
-
if (data.handle.length === 0) {
|
|
32
|
-
if (!data.displayName) {
|
|
33
|
-
setError(t('handle.validation.error', {
|
|
34
|
-
defaultValue: 'A handle or display name is required',
|
|
35
|
-
}));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
data = {
|
|
39
|
-
...data,
|
|
40
|
-
handle: data
|
|
41
|
-
.displayName.toLowerCase()
|
|
42
|
-
.replaceAll(' ', '_')
|
|
43
|
-
.replace(/[^a-zA-Z0-9_]/g, '')
|
|
44
|
-
.trim()
|
|
45
|
-
.slice(0, 16),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
setSubmitting(true);
|
|
49
|
-
try {
|
|
50
|
-
const group = (await createGroup({
|
|
51
|
-
...data,
|
|
52
|
-
members,
|
|
53
|
-
}));
|
|
54
|
-
navigate(`/groups/@${group.handle}`);
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
setError(err.message);
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
setSubmitting(false);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, onChange: setGroupData }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "group-members", children: t('groups.form.members', { defaultValue: 'Members' }) }), _jsx(ProfilesInput, { value: members, onChange: setMembers, banlist: me ? [me] : [], placeholder: t('groups.form.membersPlaceholder', {
|
|
11
|
+
return (_jsxs("div", { className: "space-y-4 p-4 pb-12", children: [_jsx(GroupForm, { groupData: groupData, fieldErrors: fieldErrors, onChange: setGroupData }), _jsxs("div", { className: "space-y-2 px-1", children: [_jsx(Label, { htmlFor: "group-members", children: t('groups.form.members', { defaultValue: 'Members' }) }), _jsx(ProfilesInput, { value: members, onChange: setMembers, banlist: me ? [me] : [], placeholder: t('groups.form.membersPlaceholder', {
|
|
64
12
|
defaultValue: 'Add members to this group',
|
|
65
|
-
}) })] }), error && (_jsx(Toast, { variant: "error", testId: "groups-duplicate-handle-error", onDismiss:
|
|
13
|
+
}) })] }), error && (_jsx(Toast, { variant: "error", testId: "groups-duplicate-handle-error", onDismiss: clearError, children: error })), _jsx(Button, { title: "Create group", variant: "default", action: submit, disabled: submitting, "data-testid": "groups-create-submit", children: submitting
|
|
66
14
|
? t('common.submitting', { defaultValue: 'Creating…' })
|
|
67
15
|
: t('common.submit', { defaultValue: 'Create group' }) })] }));
|
|
68
16
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useNavigate, useParams } from 'react-router-dom';
|
|
4
4
|
import { useT, useOpenpeeps } from '../../index.js';
|
|
5
|
-
import { Feed, GroupFeed, GroupHeader, NewEventButton, PostMarkdown, useCurrentProfile, } from '../../components/index.js';
|
|
5
|
+
import { EventsView, Feed, GroupFeed, GroupHeader, NewEventButton, PostMarkdown, useCurrentProfile, } from '../../components/index.js';
|
|
6
6
|
import { routeHandleParam } from '../../lib/routeHandles.js';
|
|
7
7
|
import { LoadingSpinner } from '@openpeepshq/react-ui';
|
|
8
8
|
export function GroupShow() {
|
|
@@ -57,7 +57,7 @@ export function GroupShow() {
|
|
|
57
57
|
window.history.replaceState(null, '', `${window.location.pathname}#description`);
|
|
58
58
|
}, testId: "groups-tab-description", children: t('groups.sections.description', { defaultValue: 'Description' }) })] }), tab === 'posts' && _jsx(GroupFeed, { group: group }), tab === 'events' && (_jsxs("div", { children: [_jsx(NewEventButton, { visibility: "group", currentProfile: currentProfile, group: group, onNavigate: () => navigate('/events/new') }), _jsxs("nav", { "aria-label": t('groups.eventsTabs.label', {
|
|
59
59
|
defaultValue: 'Event timeframe',
|
|
60
|
-
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: eventsTab === 'upcoming', onClick: () => setEventsTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: eventsTab === 'past', onClick: () => setEventsTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(Feed, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents })] })), tab === 'description' && (_jsxs("div", { className: "space-y-2 p-4", children: [_jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Description" }), _jsx(PostMarkdown, { source: group.description || 'No description yet' })] }), _jsxs("section", { className: "space-y-2 border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Details" }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: "Created" }), _jsx("p", { children: new Date(group.createdAt).toLocaleDateString() })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.visibility.title') }), _jsx("p", { children: t(`groups.visibility.${visibilityValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanJoin.title') }), _jsx("p", { children: t(`groups.whoCanJoin.${whoCanJoinValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanPost.title') }), _jsxs("p", { children: [t(`groups.whoCanPost.${whoCanPostValue}.description`), ".", ' ', t(`groups.whoCanPostEvents.${whoCanPostEventsValue}.description`)] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.postsVisibility.title') }), _jsx("p", { children: t(`groups.postsVisibility.${postsVisibilityValue}.description`) })] })] }), _jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Rules" }), _jsx(PostMarkdown, { source: group.rules || 'No rules yet' })] })] }))] }));
|
|
60
|
+
}), className: "border-border flex border-b", children: [_jsx(TabButton, { active: eventsTab === 'upcoming', onClick: () => setEventsTab('upcoming'), children: t('events.feed.upcoming', { defaultValue: 'Upcoming' }) }), _jsx(TabButton, { active: eventsTab === 'past', onClick: () => setEventsTab('past'), children: t('events.feed.past', { defaultValue: 'Past' }) })] }), _jsx(EventsView, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents, agenda: eventsTab, list: _jsx(Feed, { query: eventsTab === 'upcoming' ? upcomingEvents : pastEvents, formatSwitch: false }) })] })), tab === 'description' && (_jsxs("div", { className: "space-y-2 p-4", children: [_jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Description" }), _jsx(PostMarkdown, { source: group.description || 'No description yet' })] }), _jsxs("section", { className: "space-y-2 border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Details" }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: "Created" }), _jsx("p", { children: new Date(group.createdAt).toLocaleDateString() })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.visibility.title') }), _jsx("p", { children: t(`groups.visibility.${visibilityValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanJoin.title') }), _jsx("p", { children: t(`groups.whoCanJoin.${whoCanJoinValue}.description`) })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.whoCanPost.title') }), _jsxs("p", { children: [t(`groups.whoCanPost.${whoCanPostValue}.description`), ".", ' ', t(`groups.whoCanPostEvents.${whoCanPostEventsValue}.description`)] })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold", children: t('groups.postsVisibility.title') }), _jsx("p", { children: t(`groups.postsVisibility.${postsVisibilityValue}.description`) })] })] }), _jsxs("section", { className: "border-b py-2", children: [_jsx("h3", { className: "text-lg font-semibold", children: "Rules" }), _jsx(PostMarkdown, { source: group.rules || 'No rules yet' })] })] }))] }));
|
|
61
61
|
}
|
|
62
62
|
function TabButton({ active, onClick, children, testId, }) {
|
|
63
63
|
return (_jsx("button", { type: "button", onClick: onClick, "data-testid": testId, className: `px-4 py-2 text-sm ${active ? 'border-primary border-b-2 font-semibold' : 'text-muted-foreground hover:text-foreground'}`, children: children }));
|