@selfcommunity/react-ui 0.10.5-alpha.0 → 0.10.5-alpha.10
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/lib/cjs/assets/deafultCover.d.ts +2 -0
- package/lib/cjs/assets/deafultCover.js +3 -0
- package/lib/cjs/assets/liveStream/event.d.ts +2 -0
- package/lib/cjs/assets/liveStream/event.js +3 -0
- package/lib/cjs/assets/liveStream/live.d.ts +2 -0
- package/lib/cjs/assets/liveStream/live.js +3 -0
- package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +44 -0
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +92 -0
- package/lib/cjs/components/CreateLiveStreamButton/index.d.ts +3 -0
- package/lib/cjs/components/CreateLiveStreamButton/index.js +5 -0
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +49 -0
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +103 -0
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +47 -0
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +188 -0
- package/lib/cjs/components/CreateLiveStreamDialog/constants.d.ts +1 -0
- package/lib/cjs/components/CreateLiveStreamDialog/constants.js +4 -0
- package/lib/cjs/components/CreateLiveStreamDialog/index.d.ts +3 -0
- package/lib/cjs/components/CreateLiveStreamDialog/index.js +5 -0
- package/lib/cjs/components/CreateLiveStreamDialog/types.d.ts +8 -0
- package/lib/cjs/components/CreateLiveStreamDialog/types.js +13 -0
- package/lib/cjs/components/Editor/Editor.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
- package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
- package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/cjs/components/Editor/plugins/AutoLinkPlugin.js +8 -2
- package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/cjs/components/EventForm/EventAddress.d.ts +4 -2
- package/lib/cjs/components/EventForm/EventAddress.js +55 -8
- package/lib/cjs/components/EventForm/EventForm.d.ts +12 -1
- package/lib/cjs/components/EventForm/EventForm.js +64 -16
- package/lib/cjs/components/EventForm/types.d.ts +7 -6
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +2 -2
- package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/cjs/components/EventMembersWidget/types.d.ts +1 -1
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/cjs/components/Feed/Feed.d.ts +2 -2
- package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/LiveStream/LiveStream.d.ts +79 -0
- package/lib/cjs/components/LiveStream/LiveStream.js +143 -0
- package/lib/cjs/components/LiveStream/Skeleton.d.ts +46 -0
- package/lib/cjs/components/LiveStream/Skeleton.js +92 -0
- package/lib/cjs/components/LiveStream/constants.d.ts +1 -0
- package/lib/cjs/components/LiveStream/constants.js +4 -0
- package/lib/cjs/components/LiveStream/index.d.ts +4 -0
- package/lib/cjs/components/LiveStream/index.js +8 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +192 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.d.ts +47 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +80 -0
- package/lib/cjs/components/LiveStreamForm/constants.d.ts +15 -0
- package/lib/cjs/components/LiveStreamForm/constants.js +18 -0
- package/lib/cjs/components/LiveStreamForm/index.d.ts +3 -0
- package/lib/cjs/components/LiveStreamForm/index.js +5 -0
- package/lib/cjs/components/LiveStreamForm/types.d.ts +11 -0
- package/lib/cjs/components/LiveStreamForm/types.js +2 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.d.ts +85 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +199 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +29 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +62 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.d.ts +10 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +76 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +21 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +33 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.d.ts +17 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.js +13 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +77 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +137 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +8 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +28 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +65 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +30 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +215 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +39 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +55 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +251 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +5 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +32 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +19 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.js +35 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +31 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +26 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +151 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +3 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +6 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.js +5 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.d.ts +7 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +195 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +27 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.js +82 -0
- package/lib/cjs/components/LiveStreamRoom/constants.d.ts +21 -0
- package/lib/cjs/components/LiveStreamRoom/constants.js +24 -0
- package/lib/cjs/components/LiveStreamRoom/index.d.ts +3 -0
- package/lib/cjs/components/LiveStreamRoom/index.js +5 -0
- package/lib/cjs/components/LiveStreamRoom/types.d.ts +22 -0
- package/lib/cjs/components/LiveStreamRoom/types.js +8 -0
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +16 -0
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +12 -3
- package/lib/cjs/components/Notification/LiveStream/LiveStream.d.ts +15 -0
- package/lib/cjs/components/Notification/LiveStream/LiveStream.js +75 -0
- package/lib/cjs/components/Notification/LiveStream/index.d.ts +3 -0
- package/lib/cjs/components/Notification/LiveStream/index.js +5 -0
- package/lib/cjs/components/Notification/Notification.js +5 -1
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +5 -5
- package/lib/cjs/components/PlatformWidget/constants.d.ts +4 -0
- package/lib/cjs/components/PlatformWidget/constants.js +5 -1
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -1
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +4 -0
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +6 -2
- package/lib/cjs/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
- package/lib/cjs/components/UserLiveStreamWidget/Skeleton.js +28 -0
- package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
- package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.js +133 -0
- package/lib/cjs/components/UserLiveStreamWidget/constants.d.ts +1 -0
- package/lib/cjs/components/UserLiveStreamWidget/constants.js +4 -0
- package/lib/cjs/components/UserLiveStreamWidget/index.d.ts +4 -0
- package/lib/cjs/components/UserLiveStreamWidget/index.js +8 -0
- package/lib/cjs/constants/LiveStream.d.ts +3 -0
- package/lib/cjs/constants/LiveStream.js +6 -0
- package/lib/cjs/index.d.ts +12 -1
- package/lib/cjs/index.js +33 -6
- package/lib/cjs/shared/CopyTextArea/index.d.ts +2 -2
- package/lib/cjs/shared/CopyTextArea/index.js +8 -2
- package/lib/cjs/shared/EventInfoDetails/index.js +17 -1
- package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/cjs/shared/LiveStreamInfoDetails/index.d.ts +17 -0
- package/lib/cjs/shared/LiveStreamInfoDetails/index.js +53 -0
- package/lib/cjs/shared/Media/File/PreviewComponent.js +3 -4
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/cjs/shared/Media/Link/DisplayComponent.js +1 -4
- package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
- package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
- package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.js +14 -0
- package/lib/cjs/shared/UpScalingTierBadge/index.d.ts +7 -0
- package/lib/cjs/shared/UpScalingTierBadge/index.js +63 -0
- package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/cjs/types/composer.d.ts +1 -1
- package/lib/cjs/types/liveStream.d.ts +5 -0
- package/lib/cjs/types/liveStream.js +9 -0
- package/lib/cjs/utils/liveStream.d.ts +4 -0
- package/lib/cjs/utils/liveStream.js +25 -0
- package/lib/esm/assets/deafultCover.d.ts +2 -0
- package/lib/esm/assets/deafultCover.js +1 -0
- package/lib/esm/assets/liveStream/event.d.ts +2 -0
- package/lib/esm/assets/liveStream/event.js +1 -0
- package/lib/esm/assets/liveStream/live.d.ts +2 -0
- package/lib/esm/assets/liveStream/live.js +1 -0
- package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +44 -0
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +89 -0
- package/lib/esm/components/CreateLiveStreamButton/index.d.ts +3 -0
- package/lib/esm/components/CreateLiveStreamButton/index.js +2 -0
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +49 -0
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +100 -0
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +47 -0
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +183 -0
- package/lib/esm/components/CreateLiveStreamDialog/constants.d.ts +1 -0
- package/lib/esm/components/CreateLiveStreamDialog/constants.js +1 -0
- package/lib/esm/components/CreateLiveStreamDialog/index.d.ts +3 -0
- package/lib/esm/components/CreateLiveStreamDialog/index.js +2 -0
- package/lib/esm/components/CreateLiveStreamDialog/types.d.ts +8 -0
- package/lib/esm/components/CreateLiveStreamDialog/types.js +10 -0
- package/lib/esm/components/Editor/Editor.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
- package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
- package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/esm/components/Editor/plugins/AutoLinkPlugin.js +8 -2
- package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/esm/components/EventForm/EventAddress.d.ts +4 -2
- package/lib/esm/components/EventForm/EventAddress.js +55 -8
- package/lib/esm/components/EventForm/EventForm.d.ts +12 -1
- package/lib/esm/components/EventForm/EventForm.js +65 -17
- package/lib/esm/components/EventForm/types.d.ts +7 -6
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +2 -2
- package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/esm/components/EventMembersWidget/types.d.ts +1 -1
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/esm/components/Feed/Feed.d.ts +2 -2
- package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/LiveStream/LiveStream.d.ts +79 -0
- package/lib/esm/components/LiveStream/LiveStream.js +140 -0
- package/lib/esm/components/LiveStream/Skeleton.d.ts +46 -0
- package/lib/esm/components/LiveStream/Skeleton.js +89 -0
- package/lib/esm/components/LiveStream/constants.d.ts +1 -0
- package/lib/esm/components/LiveStream/constants.js +1 -0
- package/lib/esm/components/LiveStream/index.d.ts +4 -0
- package/lib/esm/components/LiveStream/index.js +4 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +189 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.d.ts +47 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +76 -0
- package/lib/esm/components/LiveStreamForm/constants.d.ts +15 -0
- package/lib/esm/components/LiveStreamForm/constants.js +15 -0
- package/lib/esm/components/LiveStreamForm/index.d.ts +3 -0
- package/lib/esm/components/LiveStreamForm/index.js +2 -0
- package/lib/esm/components/LiveStreamForm/types.d.ts +11 -0
- package/lib/esm/components/LiveStreamForm/types.js +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.d.ts +85 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +196 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +29 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +58 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.d.ts +10 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +73 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +21 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.d.ts +17 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.js +9 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +77 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +134 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +6 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +28 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +60 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +30 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +212 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +36 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +55 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +245 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +5 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +29 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +19 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.js +30 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +26 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +147 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +3 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +3 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.js +2 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.d.ts +7 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +191 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.js +74 -0
- package/lib/esm/components/LiveStreamRoom/constants.d.ts +21 -0
- package/lib/esm/components/LiveStreamRoom/constants.js +21 -0
- package/lib/esm/components/LiveStreamRoom/index.d.ts +3 -0
- package/lib/esm/components/LiveStreamRoom/index.js +2 -0
- package/lib/esm/components/LiveStreamRoom/types.d.ts +22 -0
- package/lib/esm/components/LiveStreamRoom/types.js +4 -0
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +16 -0
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +12 -3
- package/lib/esm/components/Notification/LiveStream/LiveStream.d.ts +15 -0
- package/lib/esm/components/Notification/LiveStream/LiveStream.js +72 -0
- package/lib/esm/components/Notification/LiveStream/index.d.ts +3 -0
- package/lib/esm/components/Notification/LiveStream/index.js +2 -0
- package/lib/esm/components/Notification/Notification.js +5 -1
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +5 -5
- package/lib/esm/components/PlatformWidget/constants.d.ts +4 -0
- package/lib/esm/components/PlatformWidget/constants.js +4 -0
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -1
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +4 -0
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +6 -2
- package/lib/esm/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
- package/lib/esm/components/UserLiveStreamWidget/Skeleton.js +24 -0
- package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
- package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.js +130 -0
- package/lib/esm/components/UserLiveStreamWidget/constants.d.ts +1 -0
- package/lib/esm/components/UserLiveStreamWidget/constants.js +1 -0
- package/lib/esm/components/UserLiveStreamWidget/index.d.ts +4 -0
- package/lib/esm/components/UserLiveStreamWidget/index.js +4 -0
- package/lib/esm/constants/LiveStream.d.ts +3 -0
- package/lib/esm/constants/LiveStream.js +3 -0
- package/lib/esm/index.d.ts +12 -1
- package/lib/esm/index.js +13 -2
- package/lib/esm/shared/CopyTextArea/index.d.ts +2 -2
- package/lib/esm/shared/CopyTextArea/index.js +8 -2
- package/lib/esm/shared/EventInfoDetails/index.js +21 -5
- package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/esm/shared/LiveStreamInfoDetails/index.d.ts +17 -0
- package/lib/esm/shared/LiveStreamInfoDetails/index.js +50 -0
- package/lib/esm/shared/Media/File/PreviewComponent.js +3 -4
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/esm/shared/Media/Link/DisplayComponent.js +1 -4
- package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/esm/shared/StickyBox/index.d.ts +4 -4
- package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
- package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.js +10 -0
- package/lib/esm/shared/UpScalingTierBadge/index.d.ts +7 -0
- package/lib/esm/shared/UpScalingTierBadge/index.js +60 -0
- package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/esm/types/composer.d.ts +1 -1
- package/lib/esm/types/liveStream.d.ts +5 -0
- package/lib/esm/types/liveStream.js +6 -0
- package/lib/esm/utils/liveStream.d.ts +4 -0
- package/lib/esm/utils/liveStream.js +18 -0
- package/lib/umd/653.js +2 -0
- package/lib/umd/react-ui.js +1 -19
- package/lib/umd/react-ui.js.LICENSE.txt +2 -0
- package/package.json +22 -8
- package/lib/umd/314.js +0 -2
- /package/lib/umd/{314.js.LICENSE.txt → 653.js.LICENSE.txt} +0 -0
|
@@ -6,19 +6,28 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
|
|
7
7
|
const styles_1 = require("@mui/material/styles");
|
|
8
8
|
const system_1 = require("@mui/system");
|
|
9
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
9
10
|
const types_1 = require("@selfcommunity/types");
|
|
10
11
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
11
12
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
13
|
const react_1 = require("react");
|
|
13
14
|
const react_intl_1 = require("react-intl");
|
|
14
|
-
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
15
15
|
const UrlTextField_1 = tslib_1.__importDefault(require("../../shared/UrlTextField"));
|
|
16
16
|
const constants_1 = require("./constants");
|
|
17
|
-
const
|
|
17
|
+
const LiveStream_1 = tslib_1.__importDefault(require("../LiveStream"));
|
|
18
|
+
const LiveStreamFormSettings_1 = tslib_1.__importDefault(require("../LiveStreamForm/LiveStreamFormSettings"));
|
|
19
|
+
const liveStream_1 = require("../../types/liveStream");
|
|
20
|
+
const constants_2 = require("../LiveStreamForm/constants");
|
|
21
|
+
const utils_1 = require("./utils");
|
|
22
|
+
const react_core_2 = require("@selfcommunity/react-core");
|
|
18
23
|
const messages = (0, react_intl_1.defineMessages)({
|
|
19
24
|
virtualPlaceholder: {
|
|
20
25
|
id: 'ui.eventForm.address.online.placeholder',
|
|
21
26
|
defaultMessage: 'ui.eventForm.address.online.placeholder'
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
id: 'ui.eventForm.name.placeholder',
|
|
30
|
+
defaultMessage: 'ui.eventForm.name.placeholder'
|
|
22
31
|
}
|
|
23
32
|
});
|
|
24
33
|
const classes = {
|
|
@@ -32,6 +41,7 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
32
41
|
slot: 'EventAddressRoot'
|
|
33
42
|
})(() => ({}));
|
|
34
43
|
function EventAddress(inProps) {
|
|
44
|
+
var _a;
|
|
35
45
|
//PROPS
|
|
36
46
|
const props = (0, system_1.useThemeProps)({
|
|
37
47
|
props: inProps,
|
|
@@ -40,18 +50,49 @@ function EventAddress(inProps) {
|
|
|
40
50
|
// INTL
|
|
41
51
|
const intl = (0, react_intl_1.useIntl)();
|
|
42
52
|
// PROPS
|
|
43
|
-
const { className,
|
|
53
|
+
const { className, locations = [types_1.SCEventLocationType.PERSON, types_1.SCEventLocationType.ONLINE, types_1.SCEventLocationType.LIVESTREAM], event, forwardGeolocationData, forwardLivestreamSettingsData } = props;
|
|
44
54
|
// STATE
|
|
45
|
-
const [location, setLocation] = (0, react_1.useState)((event === null || event === void 0 ? void 0 : event.location) ||
|
|
55
|
+
const [location, setLocation] = (0, react_1.useState)((event === null || event === void 0 ? void 0 : event.location) || locations[0]);
|
|
46
56
|
const [geolocation, setGeoLocation] = (0, react_1.useState)(event ? { description: event.geolocation } : null);
|
|
47
57
|
const [inputValue, setInputValue] = (0, react_1.useState)('');
|
|
48
58
|
const [suggestions, setSuggestions] = (0, react_1.useState)([]);
|
|
49
59
|
const [timeoutId, setTimeoutId] = (0, react_1.useState)(null);
|
|
60
|
+
const liveStream = (0, react_1.useMemo)(() => {
|
|
61
|
+
return (event.live_stream ||
|
|
62
|
+
{
|
|
63
|
+
title: (event === null || event === void 0 ? void 0 : event.name) || `${intl.formatMessage(messages.name)}`,
|
|
64
|
+
created_at: (event === null || event === void 0 ? void 0 : event.start_date) || (0, utils_1.getNewDate)(),
|
|
65
|
+
settings: constants_2.LIVESTREAM_DEFAULT_SETTINGS
|
|
66
|
+
});
|
|
67
|
+
}, [event]);
|
|
68
|
+
// CONTEXT
|
|
69
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
70
|
+
const { preferences, features } = (0, react_core_1.useSCPreferences)();
|
|
71
|
+
const isFreeTrialTier = (0, react_1.useMemo)(() => preferences &&
|
|
72
|
+
react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
|
|
73
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
|
|
74
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_1.SCCommunitySubscriptionTier.FREE_TRIAL, [preferences]);
|
|
75
|
+
const liveStreamEnabled = (0, react_1.useMemo)(() => preferences &&
|
|
76
|
+
features &&
|
|
77
|
+
features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
|
|
78
|
+
react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
|
|
79
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [preferences, features]);
|
|
80
|
+
const isInPersonTabActive = (0, react_1.useMemo)(() => locations.includes(types_1.SCEventLocationType.PERSON) || event.location === types_1.SCEventLocationType.PERSON, [locations, event]);
|
|
81
|
+
const isOnlineTabActive = (0, react_1.useMemo)(() => locations.includes(types_1.SCEventLocationType.ONLINE) || event.location === types_1.SCEventLocationType.ONLINE, [locations, event]);
|
|
82
|
+
const isLiveTabActive = (0, react_1.useMemo)(() => {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
return (liveStreamEnabled &&
|
|
85
|
+
locations.includes(types_1.SCEventLocationType.LIVESTREAM) &&
|
|
86
|
+
!isFreeTrialTier /* || (isFreeTrialTier && scUserContext?.user && scUserContext?.user.id === 1)*/ &&
|
|
87
|
+
((_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream)) ||
|
|
88
|
+
(event.live_stream && event.live_stream.created_at);
|
|
89
|
+
}, [liveStreamEnabled, (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission, event]);
|
|
50
90
|
// HOOKS
|
|
51
|
-
const { isLoaded, geocodingApiKey } = (0,
|
|
91
|
+
const { isLoaded, geocodingApiKey } = (0, react_core_2.useSCGoogleApiLoader)();
|
|
52
92
|
// HANDLERS
|
|
53
93
|
const handleChange = (_event, newValue) => {
|
|
54
94
|
setLocation(newValue);
|
|
95
|
+
forwardGeolocationData({ location: newValue });
|
|
55
96
|
};
|
|
56
97
|
const handleSelection = (_event, newValue) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
98
|
if (newValue) {
|
|
@@ -82,6 +123,9 @@ function EventAddress(inProps) {
|
|
|
82
123
|
const handleLinkChange = (event) => {
|
|
83
124
|
forwardGeolocationData({ location, link: event.target.value });
|
|
84
125
|
};
|
|
126
|
+
const handleLiveStreamSettingsChange = (settings) => {
|
|
127
|
+
forwardLivestreamSettingsData(settings);
|
|
128
|
+
};
|
|
85
129
|
(0, react_1.useEffect)(() => {
|
|
86
130
|
if (timeoutId) {
|
|
87
131
|
clearTimeout(timeoutId);
|
|
@@ -106,10 +150,13 @@ function EventAddress(inProps) {
|
|
|
106
150
|
}
|
|
107
151
|
}, [inputValue]);
|
|
108
152
|
if (!geocodingApiKey && !isLoaded) {
|
|
109
|
-
return
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
if (!isInPersonTabActive && !isOnlineTabActive && !isLiveTabActive) {
|
|
156
|
+
return null;
|
|
110
157
|
}
|
|
111
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ className: classes.tabs, value: location, onChange: handleChange, indicatorColor: "secondary", textColor: "secondary", variant: "fullWidth" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.PERSON, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.label", defaultMessage: "ui.eventForm.address.live.label" }) }), (0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.ONLINE, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "play_circle_outline" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.online.label", defaultMessage: "ui.eventForm.address.online.label" }) })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.tabContent }, { children: [location === types_1.SCEventLocationType.PERSON && ((0, jsx_runtime_1.jsx)(material_1.Autocomplete, { disabled: !geocodingApiKey, size: "small", value: geolocation, onChange: handleSelection, inputValue: inputValue, onInputChange: handleLocationChange, options: suggestions, getOptionLabel: (option) => option.description || geolocation.description, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.noResults", defaultMessage: "ui.eventForm.address.live.noResults" }), isOptionEqualToValue: (option, value) => option.description === value.description, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.placeholder", defaultMessage: "ui.eventForm.address.live.placeholder" }), variant: "outlined", fullWidth: true, InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }) })), params.InputProps.endAdornment] })) }) }))) })), location === types_1.SCEventLocationType.ONLINE && ((0, jsx_runtime_1.jsx)(UrlTextField_1.default, { size: "small", fullWidth: true, type: "url", placeholder: `${intl.formatMessage(messages.virtualPlaceholder)}`, helperText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.online.help", defaultMessage: "ui.eventForm.address.online.help" }), InputProps: {
|
|
158
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Tabs, Object.assign({ className: classes.tabs, value: location, onChange: handleChange, indicatorColor: "secondary", textColor: "secondary", variant: "fullWidth" }, { children: [isInPersonTabActive && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.PERSON, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.label", defaultMessage: "ui.eventForm.address.live.label" }) })), isOnlineTabActive && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.ONLINE, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "play_circle_outline" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.online.label", defaultMessage: "ui.eventForm.address.online.label" }) })), isLiveTabActive && ((0, jsx_runtime_1.jsx)(material_1.Tab, { value: types_1.SCEventLocationType.LIVESTREAM, classes: { root: classes.tab }, icon: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "photo_camera" }), iconPosition: "start", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.liveStream.label", defaultMessage: "ui.eventForm.address.liveStream.label" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.tabContent }, { children: [isInPersonTabActive && location === types_1.SCEventLocationType.PERSON && ((0, jsx_runtime_1.jsx)(material_1.Autocomplete, { disabled: !geocodingApiKey, size: "small", value: geolocation, onChange: handleSelection, inputValue: inputValue, onInputChange: handleLocationChange, options: suggestions, getOptionLabel: (option) => option.description || geolocation.description, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.noResults", defaultMessage: "ui.eventForm.address.live.noResults" }), isOptionEqualToValue: (option, value) => option.description === value.description, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.live.placeholder", defaultMessage: "ui.eventForm.address.live.placeholder" }), variant: "outlined", fullWidth: true, InputProps: Object.assign(Object.assign({}, params.InputProps), { endAdornment: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "add_location_alt" }) })), params.InputProps.endAdornment] })) }) }))) })), isOnlineTabActive && location === types_1.SCEventLocationType.ONLINE && ((0, jsx_runtime_1.jsx)(UrlTextField_1.default, { size: "small", fullWidth: true, type: "url", placeholder: `${intl.formatMessage(messages.virtualPlaceholder)}`, helperText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.address.online.help", defaultMessage: "ui.eventForm.address.online.help" }), InputProps: {
|
|
112
159
|
endAdornment: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "play_circle_outline" })
|
|
113
|
-
}, onChange: handleLinkChange }))] }))] })));
|
|
160
|
+
}, onChange: handleLinkChange })), isLiveTabActive && location === types_1.SCEventLocationType.LIVESTREAM && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LiveStream_1.default, { template: liveStream_1.SCLiveStreamTemplateType.SNIPPET, liveStream: liveStream, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) }), (0, jsx_runtime_1.jsx)(LiveStreamFormSettings_1.default, { settings: liveStream.settings || constants_2.LIVESTREAM_DEFAULT_SETTINGS, onChange: handleLiveStreamSettingsChange })] }))] }))] })));
|
|
114
161
|
}
|
|
115
162
|
exports.default = EventAddress;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoxProps } from '@mui/material';
|
|
2
|
-
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
+
import { SCEventLocationType, SCEventType } from '@selfcommunity/types';
|
|
3
|
+
import { EventAddressProps } from './EventAddress';
|
|
3
4
|
export interface EventFormProps extends BoxProps {
|
|
4
5
|
/**
|
|
5
6
|
* Overrides or extends the styles applied to the component.
|
|
@@ -11,6 +12,11 @@ export interface EventFormProps extends BoxProps {
|
|
|
11
12
|
* @default null
|
|
12
13
|
*/
|
|
13
14
|
event?: SCEventType;
|
|
15
|
+
/**
|
|
16
|
+
* Initial location
|
|
17
|
+
* @default SCEventLocationType.PERSON
|
|
18
|
+
*/
|
|
19
|
+
presetLocation?: SCEventLocationType;
|
|
14
20
|
/**
|
|
15
21
|
* On success callback function
|
|
16
22
|
* @default null
|
|
@@ -21,6 +27,11 @@ export interface EventFormProps extends BoxProps {
|
|
|
21
27
|
* @default null
|
|
22
28
|
*/
|
|
23
29
|
onError?: (error: any) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Props to spread to EventAddress component
|
|
32
|
+
* @default empty object
|
|
33
|
+
*/
|
|
34
|
+
EventAddressComponentProps?: Pick<EventAddressProps, 'locations'>;
|
|
24
35
|
/**
|
|
25
36
|
* Any other properties
|
|
26
37
|
*/
|
|
@@ -25,6 +25,8 @@ const constants_1 = require("./constants");
|
|
|
25
25
|
const EventAddress_1 = tslib_1.__importDefault(require("./EventAddress"));
|
|
26
26
|
const UploadEventCover_1 = tslib_1.__importDefault(require("./UploadEventCover"));
|
|
27
27
|
const utils_2 = require("./utils");
|
|
28
|
+
const constants_2 = require("../LiveStreamForm/constants");
|
|
29
|
+
const deafultCover_1 = tslib_1.__importDefault(require("../../assets/deafultCover"));
|
|
28
30
|
const messages = (0, react_intl_1.defineMessages)({
|
|
29
31
|
name: {
|
|
30
32
|
id: 'ui.eventForm.name.placeholder',
|
|
@@ -57,6 +59,10 @@ const messages = (0, react_intl_1.defineMessages)({
|
|
|
57
59
|
endTime: {
|
|
58
60
|
id: 'ui.eventForm.time.end.placeholder',
|
|
59
61
|
defaultMessage: 'ui.eventForm.time.end.placeholder'
|
|
62
|
+
},
|
|
63
|
+
pickerCancelAction: {
|
|
64
|
+
id: 'ui.eventForm.time.picker.cancel.placeholder',
|
|
65
|
+
defaultMessage: 'ui.eventForm.time.picker.cancel.placeholder'
|
|
60
66
|
}
|
|
61
67
|
});
|
|
62
68
|
const classes = {
|
|
@@ -115,13 +121,13 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
115
121
|
* @param inProps
|
|
116
122
|
*/
|
|
117
123
|
function EventForm(inProps) {
|
|
118
|
-
var _a, _b, _c;
|
|
124
|
+
var _a, _b, _c, _d, _e;
|
|
119
125
|
//PROPS
|
|
120
126
|
const props = (0, system_1.useThemeProps)({
|
|
121
127
|
props: inProps,
|
|
122
128
|
name: constants_1.PREFIX
|
|
123
129
|
});
|
|
124
|
-
const { className, onSuccess, onError, event =
|
|
130
|
+
const { className, onSuccess, onError, event, presetLocation, EventAddressComponentProps = {} } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "event", "presetLocation", "EventAddressComponentProps"]);
|
|
125
131
|
// CONTEXT
|
|
126
132
|
const scContext = (0, react_core_1.useSCContext)();
|
|
127
133
|
// INTL
|
|
@@ -129,20 +135,29 @@ function EventForm(inProps) {
|
|
|
129
135
|
const startDateTime = (0, react_1.useMemo)(() => (0, utils_2.getNewDate)(event === null || event === void 0 ? void 0 : event.start_date), [event]);
|
|
130
136
|
const endDateTime = (0, react_1.useMemo)(() => (0, utils_2.getNewDate)(event === null || event === void 0 ? void 0 : event.end_date), [event]);
|
|
131
137
|
const initialFieldState = {
|
|
138
|
+
name: (event === null || event === void 0 ? void 0 : event.name) || '',
|
|
139
|
+
description: event ? event.description : '',
|
|
132
140
|
imageOriginal: (event === null || event === void 0 ? void 0 : event.image_bigger) || '',
|
|
133
141
|
imageOriginalFile: '',
|
|
134
142
|
startDate: event ? startDateTime : (0, utils_2.getNewDate)(),
|
|
135
143
|
startTime: event ? startDateTime : (0, utils_2.getLaterHoursDate)(1),
|
|
136
144
|
endDate: (event === null || event === void 0 ? void 0 : event.end_date) ? endDateTime : (0, utils_2.getNewDate)(),
|
|
137
145
|
endTime: (event === null || event === void 0 ? void 0 : event.end_date) ? endDateTime : (0, utils_2.getLaterHoursDate)(3),
|
|
138
|
-
location: (event === null || event === void 0 ? void 0 : event.location)
|
|
146
|
+
location: (event === null || event === void 0 ? void 0 : event.location)
|
|
147
|
+
? event.location === types_1.SCEventLocationType.ONLINE && event.live_stream
|
|
148
|
+
? types_1.SCEventLocationType.LIVESTREAM
|
|
149
|
+
: types_1.SCEventLocationType.ONLINE
|
|
150
|
+
: ((_a = EventAddressComponentProps.locations) === null || _a === void 0 ? void 0 : _a.length)
|
|
151
|
+
? presetLocation in EventAddressComponentProps.locations
|
|
152
|
+
? presetLocation
|
|
153
|
+
: EventAddressComponentProps.locations[0]
|
|
154
|
+
: types_1.SCEventLocationType.PERSON,
|
|
139
155
|
geolocation: (event === null || event === void 0 ? void 0 : event.geolocation) || '',
|
|
140
156
|
lat: (event === null || event === void 0 ? void 0 : event.geolocation_lat) || null,
|
|
141
157
|
lng: (event === null || event === void 0 ? void 0 : event.geolocation_lng) || null,
|
|
142
158
|
link: (event === null || event === void 0 ? void 0 : event.link) || '',
|
|
159
|
+
liveStreamSettings: (event === null || event === void 0 ? void 0 : event.live_stream) ? event === null || event === void 0 ? void 0 : event.live_stream.settings : null,
|
|
143
160
|
recurring: (event === null || event === void 0 ? void 0 : event.recurring) || types_1.SCEventRecurrenceType.NEVER,
|
|
144
|
-
name: (event === null || event === void 0 ? void 0 : event.name) || '',
|
|
145
|
-
description: event ? event.description : '',
|
|
146
161
|
isPublic: (event === null || event === void 0 ? void 0 : event.privacy) === types_1.SCEventPrivacyType.PUBLIC || true,
|
|
147
162
|
isSubmitting: false
|
|
148
163
|
};
|
|
@@ -152,13 +167,18 @@ function EventForm(inProps) {
|
|
|
152
167
|
const [genericError, setGenericError] = (0, react_1.useState)(null);
|
|
153
168
|
// PREFERENCES
|
|
154
169
|
const scPreferences = (0, react_core_1.useSCPreferences)();
|
|
170
|
+
const liveStreamEnabled = (0, react_1.useMemo)(() => scPreferences.preferences &&
|
|
171
|
+
scPreferences.features &&
|
|
172
|
+
scPreferences.features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
|
|
173
|
+
react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in scPreferences.preferences &&
|
|
174
|
+
scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [scPreferences.preferences, scPreferences.features]);
|
|
155
175
|
const privateEnabled = (0, react_1.useMemo)(() => scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED].value, [scPreferences.preferences]);
|
|
156
176
|
const visibilityEnabled = (0, react_1.useMemo)(() => scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED].value, [scPreferences.preferences]);
|
|
157
177
|
const disablePastStartTime = (0, react_1.useMemo)(() => field.startDate.getDate() === (0, utils_2.getNewDate)().getDate(), [field]);
|
|
158
178
|
const disablePastEndTime = (0, react_1.useMemo)(() => field.endDate.getDate() === (0, utils_2.getNewDate)().getDate(), [field]);
|
|
159
179
|
const _backgroundCover = Object.assign({}, (field.imageOriginal
|
|
160
180
|
? { background: `url('${field.imageOriginal}') center / cover` }
|
|
161
|
-
: { background: `url('${
|
|
181
|
+
: { background: `url('${deafultCover_1.default}') no-repeat 0 0 / 100% 100%` }));
|
|
162
182
|
const handleChangeCover = (0, react_1.useCallback)((cover) => {
|
|
163
183
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['imageOriginalFile']: cover })));
|
|
164
184
|
const reader = new FileReader();
|
|
@@ -190,6 +210,9 @@ function EventForm(inProps) {
|
|
|
190
210
|
setField((prev) => (Object.assign(Object.assign({}, prev), data)));
|
|
191
211
|
setGenericError(null);
|
|
192
212
|
}, []);
|
|
213
|
+
const handleLiveStreamSettingsData = (0, react_1.useCallback)((data) => {
|
|
214
|
+
setField((prev) => (Object.assign(Object.assign({}, prev), { liveStreamSettings: Object.assign(Object.assign({}, prev.liveStreamSettings), data) })));
|
|
215
|
+
}, []);
|
|
193
216
|
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
194
217
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: true })));
|
|
195
218
|
setGenericError(null);
|
|
@@ -201,14 +224,21 @@ function EventForm(inProps) {
|
|
|
201
224
|
formData.append('start_date', (0, utils_2.combineDateAndTime)(field.startDate, field.startTime));
|
|
202
225
|
formData.append('recurring', field.recurring);
|
|
203
226
|
formData.append('end_date', (0, utils_2.combineDateAndTime)(field.endDate, field.endTime));
|
|
204
|
-
formData.append('location', field.location);
|
|
227
|
+
formData.append('location', field.location === types_1.SCEventLocationType.PERSON ? types_1.SCEventLocationType.PERSON : types_1.SCEventLocationType.ONLINE);
|
|
205
228
|
if (field.location === types_1.SCEventLocationType.ONLINE) {
|
|
206
229
|
formData.append('link', field.link);
|
|
230
|
+
formData.append('live_stream_settings', null);
|
|
231
|
+
}
|
|
232
|
+
else if (field.location === types_1.SCEventLocationType.LIVESTREAM) {
|
|
233
|
+
formData.append('link', '');
|
|
234
|
+
formData.append('live_stream_settings', JSON.stringify(Object.assign(Object.assign({}, constants_2.LIVESTREAM_DEFAULT_SETTINGS), field.liveStreamSettings)));
|
|
207
235
|
}
|
|
208
236
|
else if (field.location === types_1.SCEventLocationType.PERSON) {
|
|
209
237
|
formData.append('geolocation', field.geolocation);
|
|
210
238
|
formData.append('geolocation_lat', field.lat.toString());
|
|
211
239
|
formData.append('geolocation_lng', field.lng.toString());
|
|
240
|
+
formData.append('link', '');
|
|
241
|
+
formData.append('live_stream_settings', null);
|
|
212
242
|
}
|
|
213
243
|
if (privateEnabled) {
|
|
214
244
|
formData.append('privacy', field.isPublic ? types_1.SCEventPrivacyType.PUBLIC : types_1.SCEventPrivacyType.PRIVATE);
|
|
@@ -232,12 +262,18 @@ function EventForm(inProps) {
|
|
|
232
262
|
})
|
|
233
263
|
.catch((e) => {
|
|
234
264
|
const _error = (0, api_services_1.formatHttpErrorCode)(e);
|
|
235
|
-
if (
|
|
265
|
+
if (!Object.keys(_error).length) {
|
|
236
266
|
setGenericError(intl.formatMessage({
|
|
237
267
|
id: 'ui.eventForm.genericError',
|
|
238
268
|
defaultMessage: 'ui.eventForm.genericError'
|
|
239
269
|
}));
|
|
240
270
|
}
|
|
271
|
+
else if ('codeError' in _error) {
|
|
272
|
+
setGenericError(intl.formatMessage({
|
|
273
|
+
id: 'ui.eventForm.liveStream.error.monthlyMinuteLimitReached',
|
|
274
|
+
defaultMessage: 'ui.eventForm.liveStream.error.monthlyMinuteLimitReached'
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
241
277
|
else {
|
|
242
278
|
setGenericError(null);
|
|
243
279
|
}
|
|
@@ -262,7 +298,7 @@ function EventForm(inProps) {
|
|
|
262
298
|
setError(error);
|
|
263
299
|
}
|
|
264
300
|
setGenericError(null);
|
|
265
|
-
}, [setField,
|
|
301
|
+
}, [error, setField, setGenericError]);
|
|
266
302
|
const handleChangeDateTime = (0, react_1.useCallback)((value, name) => {
|
|
267
303
|
setField((prev) => (Object.assign(Object.assign({}, prev), { [name]: value })));
|
|
268
304
|
if (error[`${name}Error`]) {
|
|
@@ -274,7 +310,7 @@ function EventForm(inProps) {
|
|
|
274
310
|
setError(error);
|
|
275
311
|
}
|
|
276
312
|
setGenericError(null);
|
|
277
|
-
}, [setField,
|
|
313
|
+
}, [error, setField, setGenericError]);
|
|
278
314
|
const shouldDisableDate = (0, react_1.useCallback)((date) => {
|
|
279
315
|
let disabled = false;
|
|
280
316
|
switch (field.recurring) {
|
|
@@ -299,7 +335,9 @@ function EventForm(inProps) {
|
|
|
299
335
|
*/
|
|
300
336
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(UploadEventCover_1.default, { isCreationMode: true, onChange: handleChangeCover }) })), Boolean(error['coverError']) && (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "error" }, { children: error['coverError'] })), (0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: classes.form }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
301
337
|
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Event_1.EVENT_TITLE_MAX_LENGTH - field.name.length }))
|
|
302
|
-
}, error: Boolean(field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.name.error.maxLength", defaultMessage: "ui.eventForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.dateTime }, { children: (0, jsx_runtime_1.jsxs)(x_date_pickers_1.LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns_1.AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it_1.default : en_US_1.default
|
|
338
|
+
}, error: Boolean(field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.name.error.maxLength", defaultMessage: "ui.eventForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.dateTime }, { children: (0, jsx_runtime_1.jsxs)(x_date_pickers_1.LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns_1.AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it_1.default : en_US_1.default, localeText: {
|
|
339
|
+
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelAction)}`
|
|
340
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileDatePicker, { className: classes.picker, disablePast: true, label: field.startDate && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.placeholder", defaultMessage: "ui.eventForm.date.placeholder" }), value: field.startDate, slots: {
|
|
303
341
|
textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startDate)}`, startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "CalendarIcon" }) }) }))) }) })))
|
|
304
342
|
}, slotProps: {
|
|
305
343
|
toolbar: {
|
|
@@ -320,7 +358,9 @@ function EventForm(inProps) {
|
|
|
320
358
|
return (0, jsx_runtime_1.jsx)("em", { children: `${intl.formatMessage(messages.frequencyPlaceholder)}` });
|
|
321
359
|
}
|
|
322
360
|
return ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.frequency.${selected}.placeholder`, defaultMessage: `ui.eventForm.frequency.${selected}.placeholder` }));
|
|
323
|
-
}, startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "frequency" }) }) })) }, { children: Object.values(types_1.SCEventRecurrenceType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.frequency.${f}.placeholder`, defaultMessage: `ui.eventForm.frequency.${f}.placeholder` }) }), f))) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.dateTime }, { children: (0, jsx_runtime_1.jsxs)(x_date_pickers_1.LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns_1.AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it_1.default : en_US_1.default
|
|
361
|
+
}, startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "frequency" }) }) })) }, { children: Object.values(types_1.SCEventRecurrenceType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.frequency.${f}.placeholder`, defaultMessage: `ui.eventForm.frequency.${f}.placeholder` }) }), f))) }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.dateTime }, { children: (0, jsx_runtime_1.jsxs)(x_date_pickers_1.LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns_1.AdapterDateFns, adapterLocale: scContext.settings.locale.default === 'it' ? it_1.default : en_US_1.default, localeText: {
|
|
362
|
+
cancelButtonLabel: `${intl.formatMessage(messages.pickerCancelAction)}`
|
|
363
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileDatePicker, { className: classes.picker, minDate: field.startDate, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.end.placeholder", defaultMessage: "ui.eventForm.date.end.placeholder" }), value: field.endDate, slots: {
|
|
324
364
|
textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endDate)}`, startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "calendar_off" }) }) }))) }) })))
|
|
325
365
|
}, slotProps: {
|
|
326
366
|
toolbar: {
|
|
@@ -339,7 +379,13 @@ function EventForm(inProps) {
|
|
|
339
379
|
// @ts-ignore
|
|
340
380
|
toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.title", defaultMessage: "ui.eventForm.time.title" })
|
|
341
381
|
}
|
|
342
|
-
}, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisableTime })] })) })), (0, jsx_runtime_1.jsx)(EventAddress_1.default,
|
|
382
|
+
}, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisableTime })] })) })), (0, jsx_runtime_1.jsx)(EventAddress_1.default, Object.assign({ forwardGeolocationData: handleGeoData, forwardLivestreamSettingsData: handleLiveStreamSettingsData, event: Object.assign(Object.assign({}, event), {
|
|
383
|
+
name: field.name,
|
|
384
|
+
start_date: field.startDate,
|
|
385
|
+
location: field.location,
|
|
386
|
+
geolocation: field.geolocation,
|
|
387
|
+
live_stream: Object.assign(Object.assign({ title: field.name || `${intl.formatMessage(messages.name)}` }, (event && ((_b = event.live_stream) === null || _b === void 0 ? void 0 : _b.created_at) && { created_at: field.startDate })), { settings: field.liveStreamSettings })
|
|
388
|
+
}) }, EventAddressComponentProps)), privateEnabled && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.privacySection }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", justifyContent: "center" }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: !field.isPublic }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.private", defaultMessage: "ui.eventForm.privacy.private" })] })), (0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: field.isPublic, onChange: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['isPublic']: !field.isPublic }))), disabled: event && !field.isPublic }), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: (0, classnames_1.default)(classes.switchLabel, { [classes.active]: field.isPublic }) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.public", defaultMessage: "ui.eventForm.privacy.public" })] }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", textAlign: "center", className: classes.privacySectionInfo }, { children: field.isPublic ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.public.info", defaultMessage: "ui.eventForm.privacy.public.info", values: {
|
|
343
389
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
344
390
|
// @ts-ignores
|
|
345
391
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
@@ -348,17 +394,19 @@ function EventForm(inProps) {
|
|
|
348
394
|
// @ts-ignore
|
|
349
395
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
350
396
|
} })) }))] }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
351
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
352
|
-
}, error: Boolean(((
|
|
397
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? Event_1.EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : Event_1.EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
398
|
+
}, error: Boolean(((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.description.error.maxLength", defaultMessage: "ui.eventForm.description.error.maxLength" })) : null }), genericError && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.genericError }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
|
|
353
399
|
!field.startDate ||
|
|
354
400
|
!field.startTime ||
|
|
355
401
|
!field.endDate ||
|
|
356
402
|
!field.endTime ||
|
|
403
|
+
Boolean(genericError) ||
|
|
357
404
|
(field.location === types_1.SCEventLocationType.ONLINE && !field.link) ||
|
|
358
405
|
(field.location === types_1.SCEventLocationType.PERSON && !field.geolocation) ||
|
|
359
406
|
(field.recurring !== types_1.SCEventRecurrenceType.NEVER && !field.endDate && !field.endTime) ||
|
|
360
407
|
field.isSubmitting ||
|
|
361
408
|
field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ||
|
|
362
|
-
field.description.length > Event_1.EVENT_DESCRIPTION_MAX_LENGTH
|
|
409
|
+
field.description.length > Event_1.EVENT_DESCRIPTION_MAX_LENGTH ||
|
|
410
|
+
(field.location === types_1.SCEventLocationType.LIVESTREAM && !liveStreamEnabled), variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: event ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.edit", defaultMessage: "ui.eventForm.button.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.button.create", defaultMessage: "ui.eventForm.button.create" })) })) }))] }))] })));
|
|
363
411
|
}
|
|
364
412
|
exports.default = EventForm;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { SCEventLocationType, SCEventRecurrenceType } from '@selfcommunity/types';
|
|
2
|
-
export
|
|
1
|
+
import { SCEventLocationType, SCEventRecurrenceType, SCLiveStreamSettingsType } from '@selfcommunity/types';
|
|
2
|
+
export type Place = {
|
|
3
3
|
description: string;
|
|
4
4
|
id?: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type Geolocation = {
|
|
7
7
|
location: SCEventLocationType;
|
|
8
8
|
geolocation?: string;
|
|
9
9
|
lat?: number;
|
|
10
10
|
lng?: number;
|
|
11
11
|
link?: string;
|
|
12
|
+
liveStreamSettings?: SCLiveStreamSettingsType;
|
|
12
13
|
};
|
|
13
|
-
export
|
|
14
|
+
export type InitialFieldState = Geolocation & {
|
|
14
15
|
imageOriginal: string | ArrayBuffer;
|
|
15
16
|
imageOriginalFile: string | Blob;
|
|
16
17
|
startDate: Date | null;
|
|
@@ -23,5 +24,5 @@ export declare type InitialFieldState = Geolocation & {
|
|
|
23
24
|
isPublic: boolean;
|
|
24
25
|
isSubmitting: boolean;
|
|
25
26
|
};
|
|
26
|
-
export
|
|
27
|
-
export
|
|
27
|
+
export type FieldStateKeys = keyof InitialFieldState;
|
|
28
|
+
export type FieldStateValues = InitialFieldState[FieldStateKeys];
|
|
@@ -42,15 +42,15 @@ function EventFormDialog(inProps) {
|
|
|
42
42
|
props: inProps,
|
|
43
43
|
name: constants_1.PREFIX
|
|
44
44
|
});
|
|
45
|
-
const { className, open = true, onClose, EventFormComponentProps
|
|
45
|
+
const { className, open = true, onClose, EventFormComponentProps } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
|
|
46
46
|
const handleSuccess = (0, react_1.useCallback)((event) => {
|
|
47
47
|
var _a;
|
|
48
|
-
(_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
|
|
48
|
+
(_a = EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
|
|
49
49
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
50
50
|
}, [onClose, EventFormComponentProps]);
|
|
51
51
|
/**
|
|
52
52
|
* Renders root object
|
|
53
53
|
*/
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(EventForm_1.default, Object.assign({}, EventFormComponentProps, { onSuccess: handleSuccess })) })));
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, title: (EventFormComponentProps === null || EventFormComponentProps === void 0 ? void 0 : EventFormComponentProps.event) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title.edit", defaultMessage: "ui.eventForm.title.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.title", defaultMessage: "ui.eventForm.title" })), open: open, onClose: onClose, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsx)(EventForm_1.default, Object.assign({}, (EventFormComponentProps && EventFormComponentProps), { onSuccess: handleSuccess })) })));
|
|
55
55
|
}
|
|
56
56
|
exports.default = EventFormDialog;
|
|
@@ -68,7 +68,7 @@ function EventInfoWidget(inProps) {
|
|
|
68
68
|
const handleToggleSummary = (0, react_1.useCallback)(() => {
|
|
69
69
|
setExpanded(!expanded);
|
|
70
70
|
}, [expanded]);
|
|
71
|
-
const hasGeolocationOrLink = (0, react_1.useMemo)(() => Boolean((scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation) || (scEvent === null || scEvent === void 0 ? void 0 : scEvent.link)), [scEvent]);
|
|
71
|
+
const hasGeolocationOrLink = (0, react_1.useMemo)(() => Boolean((scEvent === null || scEvent === void 0 ? void 0 : scEvent.geolocation) || (scEvent === null || scEvent === void 0 ? void 0 : scEvent.link) || (scEvent === null || scEvent === void 0 ? void 0 : scEvent.live_stream)), [scEvent]);
|
|
72
72
|
const showInfo = (0, react_1.useMemo)(() => ((scEvent === null || scEvent === void 0 ? void 0 : scEvent.privacy) === types_1.SCEventPrivacyType.PUBLIC && hasGeolocationOrLink) ||
|
|
73
73
|
([types_1.SCEventSubscriptionStatusType.SUBSCRIBED, types_1.SCEventSubscriptionStatusType.GOING, types_1.SCEventSubscriptionStatusType.NOT_GOING].indexOf(scEvent === null || scEvent === void 0 ? void 0 : scEvent.subscription_status) > -1 &&
|
|
74
74
|
hasGeolocationOrLink), [scEvent]);
|
|
@@ -247,10 +247,10 @@ function EventMediaWidget(inProps) {
|
|
|
247
247
|
}
|
|
248
248
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, rest, { showPadding: hasAllow }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardHeader, { title: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.title", defaultMessage: "ui.eventMediaWidget.title" }) })), hasAllow && mediasCount > 0 && (0, jsx_runtime_1.jsx)(TriggerButton_1.default, { size: "small", onAdd: handleAddMedia })] })), className: classes.header }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(system_1.Box, Object.assign({ className: classes.grid }, { children: [showSkeleton === 'widget' && (0, jsx_runtime_1.jsx)(Skeleton_1.EventMediaSkeleton, {}), medias.slice(0, MEDIAS_TO_SHOW).map((media, i, array) => ((0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ onClick: () => handleOpenLightbox(i), sx: {
|
|
249
249
|
background: `url(${media.image}) no-repeat center`
|
|
250
|
-
}, className: classes.media }, { children: medias.length > array.length && i === array.length - 1 && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(system_1.Box, { className: classes.mediaLayer }), (0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ className: classes.countHiddenMediaWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.countHiddenMedia }, { children: ["+", countHiddenMedia] })) }))] })) }), media.id))), hasAllow && mediasCount === 0 && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }, { children: (0, jsx_runtime_1.jsx)(TriggerButton_1.default, { size: "large", onAdd: handleAddMedia, isSquare: true }) })))] })), preview !== -1 && (0, jsx_runtime_1.jsx)(Lightbox_1.Lightbox, { onClose: handleCloseLightbox, index: preview, medias: medias, onIndexChange: _fetchNext })] })), hasAllow && mediasCount > 0 && ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.showAll", defaultMessage: "ui.eventMediaWidget.showAll" }) })) })) }))),
|
|
250
|
+
}, className: classes.media }, { children: medias.length > array.length && i === array.length - 1 && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(system_1.Box, { className: classes.mediaLayer }), (0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ className: classes.countHiddenMediaWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.countHiddenMedia }, { children: ["+", countHiddenMedia] })) }))] })) }), media.id))), hasAllow && mediasCount === 0 && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }, { children: (0, jsx_runtime_1.jsx)(TriggerButton_1.default, { size: "large", onAdd: handleAddMedia, isSquare: true }) })))] })), preview !== -1 && (0, jsx_runtime_1.jsx)(Lightbox_1.Lightbox, { onClose: handleCloseLightbox, index: preview, medias: medias, onIndexChange: _fetchNext })] })), hasAllow && mediasCount > 0 && ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.showAll", defaultMessage: "ui.eventMediaWidget.showAll" }) })) })) }))), (0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: medias.length, height: isMobile ? '100%' : '515px', next: handleNext, hasMoreNext: Boolean(state.next), className: classes.dialogInfiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.noMoreResults", defaultMessage: "ui.eventMediaWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsxs)(system_1.Box, Object.assign({ className: classes.grid }, { children: [medias.map((media) => ((0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ sx: {
|
|
251
251
|
background: `url(${media.image}) no-repeat center`
|
|
252
252
|
}, className: classes.dialogMediaWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.dialogButtonWrapper }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ className: classes.dialogLoadingButton, loading: mediaId === media.id, size: "large", onClick: () => handleRemoveMedia(media.id), sx: {
|
|
253
253
|
color: (theme) => (mediaId === media.id ? 'transparent' : theme.palette.common.white)
|
|
254
|
-
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "inherit" }, { children: "delete" })) })) })) }), media.id))), showSkeleton === 'dialog' && Array.from(Array(countHiddenMedia)).map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton_1.EventMediaSkeleton, {}, i))] })) })) }))
|
|
254
|
+
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "inherit" }, { children: "delete" })) })) })) }), media.id))), showSkeleton === 'dialog' && Array.from(Array(countHiddenMedia)).map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton_1.EventMediaSkeleton, {}, i))] })) })) })), (0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { open: openDialogConfirm, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.dialog.title", defaultMessage: "ui.eventMediaWidget.dialog.title" }), content: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.dialog.msg", defaultMessage: "ui.eventMediaWidget.dialog.msg" }), btnConfirm: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.dialog.confirm", defaultMessage: "ui.eventMediaWidget.dialog.confirm" }), isUpdating: loading, onConfirm: handleConfirmAction, onClose: handleCloseAction })] })));
|
|
255
255
|
}
|
|
256
256
|
exports.default = EventMediaWidget;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadButtonProps } from '@rpldy/upload-button';
|
|
2
2
|
import type { ComponentType } from 'react';
|
|
3
|
-
|
|
3
|
+
type FileInputProps = {
|
|
4
4
|
accept: string;
|
|
5
5
|
};
|
|
6
6
|
declare const asUploadButton: (Component: ComponentType<any>, inputProps: FileInputProps) => import("react").ForwardRefExoticComponent<Pick<UploadButtonProps<Element>, "id" | "className" | "text" | "children" | "onClick" | "method" | "headers" | "paramName" | "params" | "forceJsonResponse" | "withCredentials" | "formatGroupParamName" | "sendWithFormData" | "formDataAllowUndefined" | "formatServerResponse" | "isSuccessfulCall" | "destination" | "fileFilter" | "autoUpload" | "clearPendingOnAdd" | "grouped" | "maxGroupSize" | "inputFieldName" | "fastAbortThreshold" | "userData" | "extraProps"> & import("react").RefAttributes<any>>;
|
|
@@ -135,6 +135,6 @@ function TabContentComponent(props) {
|
|
|
135
135
|
else if (tabValue === types_1.TabContentEnum.REQUESTS && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
136
136
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noOtherRequests", defaultMessage: "ui.eventMembersWidget.noOtherRequests" }) })));
|
|
137
137
|
}
|
|
138
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.slice(0, state.visibleItems).map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))),
|
|
138
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.slice(0, state.visibleItems).map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), (0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), onClose: handleToggleDialogOpen, open: openDialog }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: (0, jsx_runtime_1.jsx)(User_1.UserSkeleton, Object.assign({ elevation: 0 }, userProps)), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) }))] }));
|
|
139
139
|
}
|
|
140
140
|
exports.default = TabContentComponent;
|
|
@@ -135,6 +135,6 @@ function EventParticipantsButton(inProps) {
|
|
|
135
135
|
}, [setOpen]);
|
|
136
136
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleToggleDialogOpen, disabled: loading || !scEvent || scEvent.goings_counter === 0,
|
|
137
137
|
// @ts-expect-error this is needed to use followers into SCEventParticipantsButton
|
|
138
|
-
followers: followers }, rest, { children: [!hideCaption && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.participants, variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.participants", id: "ui.eventParticipantsButton.participants" }) }))), !followers.length && (loading || !scEvent) ? ((0, jsx_runtime_1.jsx)(AvatarGroupSkeleton_1.default, Object.assign({}, rest, (!participantsAvailable && { skeletonsAnimation: false })))) : ((0, jsx_runtime_1.jsx)(material_1.AvatarGroup, Object.assign({ total: followers.length, renderSurplus: renderSurplus }, { children: followers.map((c) => ((0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: c.username, src: c.avatar }, c.id))) })))] })),
|
|
138
|
+
followers: followers }, rest, { children: [!hideCaption && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.participants, variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.participants", id: "ui.eventParticipantsButton.participants" }) }))), !followers.length && (loading || !scEvent) ? ((0, jsx_runtime_1.jsx)(AvatarGroupSkeleton_1.default, Object.assign({}, rest, (!participantsAvailable && { skeletonsAnimation: false })))) : ((0, jsx_runtime_1.jsx)(material_1.AvatarGroup, Object.assign({ total: followers.length, renderSurplus: renderSurplus }, { children: followers.map((c) => ((0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: c.username, src: c.avatar }, c.id))) })))] })), (0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.dialogTitle", id: "ui.eventParticipantsButton.dialogTitle", values: { total: (scEvent === null || scEvent === void 0 ? void 0 : scEvent.goings_counter) || 0 } }), onClose: handleToggleDialogOpen, open: open }, DialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: followers.length, next: fetchFollowers, hasMoreNext: next !== null || loading, loaderNext: (0, jsx_runtime_1.jsx)(User_1.UserSkeleton, { elevation: 0 }), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventParticipantsButton.noOtherParticipants", defaultMessage: "ui.eventParticipantsButton.noOtherParticipants" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: followers.map((follower) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, { elevation: 0, user: follower }) }, follower.id))) }) })) }))] }));
|
|
139
139
|
}
|
|
140
140
|
exports.default = EventParticipantsButton;
|
|
@@ -9,11 +9,11 @@ import { StickyBoxProps } from '../../shared/StickyBox';
|
|
|
9
9
|
/**
|
|
10
10
|
* FeedSidebarProps has the same props as StickyBoxProps type
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type FeedSidebarProps = StickyBoxProps;
|
|
13
13
|
/**
|
|
14
14
|
* FeedRef props
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type FeedRef = {
|
|
17
17
|
addFeedData: (obj: any, syncPagination?: boolean) => void;
|
|
18
18
|
refresh: () => void;
|
|
19
19
|
getCurrentFeedObjectIds: () => number[];
|
|
@@ -11,7 +11,7 @@ interface FeedSkeletonMap {
|
|
|
11
11
|
*/
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type FeedSkeletonProps = React.PropsWithChildren<FeedSkeletonMap>;
|
|
15
15
|
/**
|
|
16
16
|
* > API documentation for the Community-JS Feed Skeleton component. Learn about the available props and the CSS API.
|
|
17
17
|
|
|
@@ -35,7 +35,7 @@ function Activities(props) {
|
|
|
35
35
|
feedObject,
|
|
36
36
|
feedObjectType,
|
|
37
37
|
cacheStrategy,
|
|
38
|
-
pageSize:
|
|
38
|
+
pageSize: 1,
|
|
39
39
|
orderBy: selectedActivities === feedObject_1.SCFeedObjectActivitiesType.CONNECTIONS_COMMENTS
|
|
40
40
|
? comments_1.SCCommentsOrderBy.CONNECTION_DESC
|
|
41
41
|
: selectedActivities === feedObject_1.SCFeedObjectActivitiesType.FIRST_COMMENTS
|