@selfcommunity/react-ui 0.8.0-embeds.17 → 0.8.0-live.41
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/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/cjs/components/Categories/Categories.js +22 -0
- package/lib/cjs/components/CategoriesPopularWidget/CategoriesPopularWidget.js +21 -0
- package/lib/cjs/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +21 -0
- package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +1 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +2 -2
- package/lib/cjs/components/CreateEventButton/CreateEventButton.js +4 -4
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +49 -0
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +94 -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 +51 -0
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +123 -0
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +46 -0
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +166 -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/EditEventButton/EditEventButton.js +1 -1
- 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/MentionsPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/cjs/components/Event/Event.js +1 -1
- package/lib/cjs/components/EventForm/EventForm.d.ts +7 -12
- package/lib/cjs/components/EventForm/EventForm.js +55 -55
- package/lib/cjs/components/EventForm/types.d.ts +5 -5
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +48 -0
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +56 -0
- package/lib/cjs/components/EventFormDialog/constants.d.ts +1 -0
- package/lib/cjs/components/EventFormDialog/constants.js +4 -0
- package/lib/cjs/components/EventFormDialog/index.d.ts +3 -0
- package/lib/cjs/components/EventFormDialog/index.js +5 -0
- package/lib/cjs/components/EventHeader/EventHeader.js +3 -7
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +6 -4
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.d.ts +41 -0
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +253 -0
- package/lib/cjs/components/EventMediaWidget/Skeleton.d.ts +2 -0
- package/lib/cjs/components/EventMediaWidget/Skeleton.js +28 -0
- package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +17 -0
- package/lib/cjs/components/EventMediaWidget/TriggerButton.js +66 -0
- package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +7 -0
- package/lib/cjs/components/EventMediaWidget/asUploadButton.js +25 -0
- package/lib/cjs/components/EventMediaWidget/constants.d.ts +1 -0
- package/lib/cjs/components/EventMediaWidget/constants.js +4 -0
- package/lib/cjs/components/EventMediaWidget/index.d.ts +4 -0
- package/lib/cjs/components/EventMediaWidget/index.js +8 -0
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.d.ts +3 -0
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +18 -13
- package/lib/cjs/components/EventMembersWidget/types.d.ts +1 -1
- package/lib/cjs/components/Events/Events.js +15 -6
- package/lib/cjs/components/Events/LocationEventsFilter.d.ts +14 -0
- package/lib/cjs/components/Events/LocationEventsFilter.js +45 -0
- package/lib/cjs/components/Events/PastEventsFilter.js +1 -2
- package/lib/cjs/components/Feed/Feed.d.ts +2 -2
- package/lib/cjs/components/Feed/Feed.js +3 -2
- package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
- package/lib/cjs/components/GroupActionsMenu/index.d.ts +57 -0
- package/lib/cjs/components/GroupActionsMenu/index.js +157 -0
- package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +6 -0
- package/lib/cjs/components/GroupHeader/GroupHeader.js +8 -4
- package/lib/cjs/components/Groups/Groups.js +26 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +156 -0
- package/lib/cjs/components/LiveStreamForm/constants.d.ts +1 -0
- package/lib/cjs/components/LiveStreamForm/constants.js +4 -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 +10 -0
- package/lib/cjs/components/LiveStreamForm/types.js +2 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.d.ts +48 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +123 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +69 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +186 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +4 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +31 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +4 -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/constants.d.ts +5 -0
- package/lib/cjs/components/LiveStreamRoom/constants.js +8 -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/DefaultDrawerContent.js +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +47 -0
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +39 -0
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +9 -20
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.js +4 -20
- package/lib/cjs/components/NavigationMenuIconButton/index.d.ts +2 -1
- package/lib/cjs/components/NavigationMenuIconButton/index.js +3 -1
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +35 -2
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +5 -0
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +3 -3
- package/lib/cjs/components/OnBoardingWidget/ActionsButton.d.ts +7 -0
- package/lib/cjs/components/OnBoardingWidget/ActionsButton.js +84 -0
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.d.ts +5 -1
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +96 -23
- package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +23 -16
- package/lib/cjs/components/OnBoardingWidget/Steps/Invite/Invite.js +56 -12
- package/lib/cjs/components/PlatformWidget/constants.d.ts +0 -4
- package/lib/cjs/components/PlatformWidget/constants.js +1 -5
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +1 -3
- package/lib/cjs/constants/GroupActionsMenu.d.ts +5 -0
- package/lib/cjs/constants/GroupActionsMenu.js +8 -0
- package/lib/cjs/constants/LiveStream.d.ts +3 -0
- package/lib/cjs/constants/LiveStream.js +6 -0
- package/lib/cjs/constants/PubSub.d.ts +8 -1
- package/lib/cjs/constants/PubSub.js +9 -1
- package/lib/cjs/index.d.ts +15 -4
- package/lib/cjs/index.js +35 -9
- package/lib/cjs/shared/EventActionsMenu/index.d.ts +1 -1
- package/lib/cjs/shared/EventActionsMenu/index.js +11 -15
- package/lib/cjs/shared/EventInfoDetails/index.js +3 -3
- package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/cjs/shared/InfiniteScroll/index.js +4 -4
- package/lib/cjs/shared/Lightbox/BaseLightbox.d.ts +19 -0
- package/lib/cjs/shared/Lightbox/BaseLightbox.js +35 -0
- package/lib/cjs/shared/Lightbox/Lightbox.d.ts +31 -17
- package/lib/cjs/shared/Lightbox/Lightbox.js +16 -19
- package/lib/cjs/shared/Lightbox/constants.d.ts +1 -0
- package/lib/cjs/shared/Lightbox/constants.js +4 -0
- package/lib/cjs/shared/Lightbox/index.d.ts +4 -2
- package/lib/cjs/shared/Lightbox/index.js +4 -1
- package/lib/cjs/shared/Media/File/DisplayComponent.js +23 -6
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/cjs/shared/Media/Link/DisplayComponent.js +5 -5
- package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/cjs/shared/MediaChunkUploader/index.js +13 -11
- package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
- package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/cjs/types/composer.d.ts +1 -1
- package/lib/cjs/utils/events.d.ts +2 -0
- package/lib/cjs/utils/events.js +10 -0
- package/lib/cjs/utils/hash.d.ts +2 -1
- package/lib/cjs/utils/liveStream.d.ts +4 -0
- package/lib/cjs/utils/liveStream.js +25 -0
- package/lib/cjs/utils/widget.d.ts +1 -0
- package/lib/cjs/utils/widget.js +14 -0
- package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/esm/components/Categories/Categories.js +23 -1
- package/lib/esm/components/CategoriesPopularWidget/CategoriesPopularWidget.js +22 -1
- package/lib/esm/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +22 -1
- package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +2 -2
- package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +2 -2
- package/lib/esm/components/CreateEventButton/CreateEventButton.js +4 -4
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +49 -0
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +91 -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 +51 -0
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +120 -0
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +46 -0
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +163 -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/EditEventButton/EditEventButton.js +1 -1
- 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/MentionsPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/esm/components/Event/Event.js +1 -1
- package/lib/esm/components/EventForm/EventForm.d.ts +7 -12
- package/lib/esm/components/EventForm/EventForm.js +56 -56
- package/lib/esm/components/EventForm/types.d.ts +5 -5
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +48 -0
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +53 -0
- package/lib/esm/components/EventFormDialog/constants.d.ts +1 -0
- package/lib/esm/components/EventFormDialog/constants.js +1 -0
- package/lib/esm/components/EventFormDialog/index.d.ts +3 -0
- package/lib/esm/components/EventFormDialog/index.js +2 -0
- package/lib/esm/components/EventHeader/EventHeader.js +3 -7
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +6 -4
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.d.ts +41 -0
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +250 -0
- package/lib/esm/components/EventMediaWidget/Skeleton.d.ts +2 -0
- package/lib/esm/components/EventMediaWidget/Skeleton.js +22 -0
- package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +17 -0
- package/lib/esm/components/EventMediaWidget/TriggerButton.js +64 -0
- package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +7 -0
- package/lib/esm/components/EventMediaWidget/asUploadButton.js +23 -0
- package/lib/esm/components/EventMediaWidget/constants.d.ts +1 -0
- package/lib/esm/components/EventMediaWidget/constants.js +1 -0
- package/lib/esm/components/EventMediaWidget/index.d.ts +4 -0
- package/lib/esm/components/EventMediaWidget/index.js +4 -0
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.d.ts +3 -0
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +18 -13
- package/lib/esm/components/EventMembersWidget/types.d.ts +1 -1
- package/lib/esm/components/Events/Events.js +16 -7
- package/lib/esm/components/Events/LocationEventsFilter.d.ts +14 -0
- package/lib/esm/components/Events/LocationEventsFilter.js +41 -0
- package/lib/esm/components/Events/PastEventsFilter.js +1 -2
- package/lib/esm/components/Feed/Feed.d.ts +2 -2
- package/lib/esm/components/Feed/Feed.js +4 -3
- package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
- package/lib/esm/components/GroupActionsMenu/index.d.ts +57 -0
- package/lib/esm/components/GroupActionsMenu/index.js +154 -0
- package/lib/esm/components/GroupHeader/GroupHeader.d.ts +6 -0
- package/lib/esm/components/GroupHeader/GroupHeader.js +9 -5
- package/lib/esm/components/Groups/Groups.js +27 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +153 -0
- package/lib/esm/components/LiveStreamForm/constants.d.ts +1 -0
- package/lib/esm/components/LiveStreamForm/constants.js +1 -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 +10 -0
- package/lib/esm/components/LiveStreamForm/types.js +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.d.ts +48 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +120 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +69 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +183 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +4 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +28 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +1 -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/constants.d.ts +5 -0
- package/lib/esm/components/LiveStreamRoom/constants.js +5 -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/DefaultDrawerContent.js +2 -2
- package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +47 -0
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +36 -0
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +9 -20
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +6 -22
- package/lib/esm/components/NavigationMenuIconButton/index.d.ts +2 -1
- package/lib/esm/components/NavigationMenuIconButton/index.js +2 -1
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +38 -5
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +5 -0
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +3 -3
- package/lib/esm/components/OnBoardingWidget/ActionsButton.d.ts +7 -0
- package/lib/esm/components/OnBoardingWidget/ActionsButton.js +81 -0
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.d.ts +5 -1
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +99 -26
- package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +24 -17
- package/lib/esm/components/OnBoardingWidget/Steps/Invite/Invite.js +59 -14
- package/lib/esm/components/PlatformWidget/constants.d.ts +0 -4
- package/lib/esm/components/PlatformWidget/constants.js +0 -4
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +1 -3
- package/lib/esm/constants/GroupActionsMenu.d.ts +5 -0
- package/lib/esm/constants/GroupActionsMenu.js +5 -0
- package/lib/esm/constants/LiveStream.d.ts +3 -0
- package/lib/esm/constants/LiveStream.js +3 -0
- package/lib/esm/constants/PubSub.d.ts +8 -1
- package/lib/esm/constants/PubSub.js +8 -0
- package/lib/esm/index.d.ts +15 -4
- package/lib/esm/index.js +17 -7
- package/lib/esm/shared/EventActionsMenu/index.d.ts +1 -1
- package/lib/esm/shared/EventActionsMenu/index.js +11 -15
- package/lib/esm/shared/EventInfoDetails/index.js +3 -3
- package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/esm/shared/InfiniteScroll/index.js +4 -4
- package/lib/esm/shared/Lightbox/BaseLightbox.d.ts +19 -0
- package/lib/esm/shared/Lightbox/BaseLightbox.js +33 -0
- package/lib/esm/shared/Lightbox/Lightbox.d.ts +31 -17
- package/lib/esm/shared/Lightbox/Lightbox.js +15 -19
- package/lib/esm/shared/Lightbox/constants.d.ts +1 -0
- package/lib/esm/shared/Lightbox/constants.js +1 -0
- package/lib/esm/shared/Lightbox/index.d.ts +4 -2
- package/lib/esm/shared/Lightbox/index.js +3 -1
- package/lib/esm/shared/Media/File/DisplayComponent.js +23 -6
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/esm/shared/Media/Link/DisplayComponent.js +5 -5
- package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/esm/shared/MediaChunkUploader/index.js +14 -12
- package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/esm/shared/StickyBox/index.d.ts +4 -4
- package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/esm/types/composer.d.ts +1 -1
- package/lib/esm/utils/events.d.ts +2 -0
- package/lib/esm/utils/events.js +6 -0
- package/lib/esm/utils/hash.d.ts +2 -1
- package/lib/esm/utils/liveStream.d.ts +4 -0
- package/lib/esm/utils/liveStream.js +18 -0
- package/lib/esm/utils/widget.d.ts +1 -0
- package/lib/esm/utils/widget.js +14 -0
- package/lib/umd/245.js +1 -0
- package/lib/umd/43.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/lib/umd/react-ui.js.LICENSE.txt +2 -0
- package/package.json +22 -10
- package/lib/cjs/shared/Media/File/Lightbox/index.d.ts +0 -28
- package/lib/cjs/shared/Media/File/Lightbox/index.js +0 -37
- package/lib/esm/shared/Media/File/Lightbox/index.d.ts +0 -28
- package/lib/esm/shared/Media/File/Lightbox/index.js +0 -34
- package/lib/umd/99.js +0 -2
- /package/lib/umd/{99.js.LICENSE.txt → 43.js.LICENSE.txt} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { SCEventLocationType, SCEventRecurrenceType } from '@selfcommunity/types';
|
|
2
|
-
export
|
|
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
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type InitialFieldState = Geolocation & {
|
|
14
14
|
imageOriginal: string | ArrayBuffer;
|
|
15
15
|
imageOriginalFile: string | Blob;
|
|
16
16
|
startDate: Date | null;
|
|
@@ -23,5 +23,5 @@ export declare type InitialFieldState = Geolocation & {
|
|
|
23
23
|
isPublic: boolean;
|
|
24
24
|
isSubmitting: boolean;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type FieldStateKeys = keyof InitialFieldState;
|
|
27
|
+
export type FieldStateValues = InitialFieldState[FieldStateKeys];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
2
|
+
import { EventFormProps } from '../EventForm';
|
|
3
|
+
export interface EventFormDialogProps extends BaseDialogProps {
|
|
4
|
+
/**
|
|
5
|
+
* Overrides or extends the styles applied to the component.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Open dialog
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* On dialog close callback function
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Props to spread to EventForm component
|
|
21
|
+
* @default {}
|
|
22
|
+
*/
|
|
23
|
+
EventFormComponentProps?: EventFormProps;
|
|
24
|
+
/**
|
|
25
|
+
* Any other properties
|
|
26
|
+
*/
|
|
27
|
+
[p: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
*> API documentation for the Community-JS EventFormDialog component. Learn about the available props and the CSS API.
|
|
31
|
+
*
|
|
32
|
+
#### Import
|
|
33
|
+
```jsx
|
|
34
|
+
import {EventFormDialog} from '@selfcommunity/react-ui';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Component Name
|
|
38
|
+
The name `SCEventFormDialog` can be used when providing style overrides in the theme.
|
|
39
|
+
|
|
40
|
+
#### CSS
|
|
41
|
+
|
|
42
|
+
|Rule Name|Global class|Description|
|
|
43
|
+
|---|---|---|
|
|
44
|
+
|root|.SCEventFormDialog-root|Styles applied to the root element.|
|
|
45
|
+
|
|
46
|
+
* @param inProps
|
|
47
|
+
*/
|
|
48
|
+
export default function EventFormDialog(inProps: EventFormDialogProps): JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const system_1 = require("@mui/system");
|
|
7
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const EventForm_1 = tslib_1.__importDefault(require("../EventForm"));
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const classes = {
|
|
14
|
+
root: `${constants_1.PREFIX}-root`
|
|
15
|
+
};
|
|
16
|
+
const Root = (0, styles_1.styled)(BaseDialog_1.default, {
|
|
17
|
+
name: constants_1.PREFIX,
|
|
18
|
+
slot: 'Root'
|
|
19
|
+
})(() => ({}));
|
|
20
|
+
/**
|
|
21
|
+
*> API documentation for the Community-JS EventFormDialog component. Learn about the available props and the CSS API.
|
|
22
|
+
*
|
|
23
|
+
#### Import
|
|
24
|
+
```jsx
|
|
25
|
+
import {EventFormDialog} from '@selfcommunity/react-ui';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### Component Name
|
|
29
|
+
The name `SCEventFormDialog` can be used when providing style overrides in the theme.
|
|
30
|
+
|
|
31
|
+
#### CSS
|
|
32
|
+
|
|
33
|
+
|Rule Name|Global class|Description|
|
|
34
|
+
|---|---|---|
|
|
35
|
+
|root|.SCEventFormDialog-root|Styles applied to the root element.|
|
|
36
|
+
|
|
37
|
+
* @param inProps
|
|
38
|
+
*/
|
|
39
|
+
function EventFormDialog(inProps) {
|
|
40
|
+
//PROPS
|
|
41
|
+
const props = (0, system_1.useThemeProps)({
|
|
42
|
+
props: inProps,
|
|
43
|
+
name: constants_1.PREFIX
|
|
44
|
+
});
|
|
45
|
+
const { className, open = true, onClose, EventFormComponentProps = {} } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "EventFormComponentProps"]);
|
|
46
|
+
const handleSuccess = (0, react_1.useCallback)((event) => {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = EventFormComponentProps.onSuccess) === null || _a === void 0 ? void 0 : _a.call(EventFormComponentProps, event);
|
|
49
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
50
|
+
}, [onClose, EventFormComponentProps]);
|
|
51
|
+
/**
|
|
52
|
+
* Renders root object
|
|
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 })) })));
|
|
55
|
+
}
|
|
56
|
+
exports.default = EventFormDialog;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCEventFormDialog";
|
|
@@ -15,6 +15,7 @@ const PubSub_1 = require("../../constants/PubSub");
|
|
|
15
15
|
const Bullet_1 = tslib_1.__importDefault(require("../../shared/Bullet"));
|
|
16
16
|
const Calendar_1 = tslib_1.__importDefault(require("../../shared/Calendar"));
|
|
17
17
|
const EventActionsMenu_1 = tslib_1.__importDefault(require("../../shared/EventActionsMenu"));
|
|
18
|
+
const events_1 = require("../../utils/events");
|
|
18
19
|
const EditEventButton_1 = tslib_1.__importDefault(require("../EditEventButton"));
|
|
19
20
|
const EventInviteButton_1 = tslib_1.__importDefault(require("../EventInviteButton"));
|
|
20
21
|
const EventSubscribeButton_1 = tslib_1.__importDefault(require("../EventSubscribeButton"));
|
|
@@ -95,12 +96,7 @@ function EventHeader(inProps) {
|
|
|
95
96
|
const updatesSubscription = (0, react_1.useRef)(null);
|
|
96
97
|
// CONST
|
|
97
98
|
const isEventAdmin = (0, react_1.useMemo)(() => scUserContext.user && (scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id) === scUserContext.user.id, [scUserContext.user, scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id]);
|
|
98
|
-
const isEventFinished = (0, react_1.useMemo)(() =>
|
|
99
|
-
if (scEvent && !scEvent.running) {
|
|
100
|
-
return new Date().getTime() > new Date(scEvent.end_date || scEvent.start_date).getTime();
|
|
101
|
-
}
|
|
102
|
-
return false;
|
|
103
|
-
}, [scEvent]);
|
|
99
|
+
const isEventFinished = (0, react_1.useMemo)(() => (0, events_1.checkEventFinished)(scEvent), [scEvent]);
|
|
104
100
|
/**
|
|
105
101
|
* Subscriber for pubsub callback
|
|
106
102
|
*/
|
|
@@ -176,6 +172,6 @@ function EventHeader(inProps) {
|
|
|
176
172
|
month: 'long'
|
|
177
173
|
}),
|
|
178
174
|
hour: intl.formatDate(scEvent.start_date, { hour: 'numeric', minute: 'numeric' })
|
|
179
|
-
} })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scEvent.name })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.visibility }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.public", defaultMessage: "ui.eventHeader.visibility.public" })] }))) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.private", defaultMessage: "ui.eventHeader.visibility.private" })] }))) }), (0, jsx_runtime_1.jsx)(Bullet_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: scEvent.location === types_1.SCEventLocationType.PERSON ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.live" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.online", defaultMessage: "ui.eventHeader.location.online" })) }))] })), (0, jsx_runtime_1.jsx)(User_1.default, { className: classes.planner, userId: scEvent.managed_by.id, secondary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.user.manager", defaultMessage: "ui.eventHeader.user.manager" }), elevation: 0, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isEventAdmin ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.multiActions }, { children: [(0, jsx_runtime_1.jsx)(EventInviteButton_1.default, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, disabled: isEventFinished }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [!isMobile && ((0, jsx_runtime_1.jsx)(EditEventButton_1.default, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data), disabled: isEventFinished })), (0, jsx_runtime_1.jsx)(EventActionsMenu_1.default, Object.assign({ event: scEvent, onEditSuccess: (data) => setSCEvent(data) }, EventActionsProps))] })] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(EventSubscribeButton_1.default, Object.assign({
|
|
175
|
+
} })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scEvent.name })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.visibility }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "public" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.public", defaultMessage: "ui.eventHeader.visibility.public" })] }))) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "private" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.visibility.private", defaultMessage: "ui.eventHeader.visibility.private" })] }))) }), (0, jsx_runtime_1.jsx)(Bullet_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.visibilityItem }, { children: scEvent.location === types_1.SCEventLocationType.PERSON ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.live", defaultMessage: "ui.eventHeader.location.live" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.location.online", defaultMessage: "ui.eventHeader.location.online" })) }))] })), (0, jsx_runtime_1.jsx)(User_1.default, { className: classes.planner, userId: scEvent.managed_by.id, secondary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventHeader.user.manager", defaultMessage: "ui.eventHeader.user.manager" }), elevation: 0, actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isEventAdmin ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.multiActions }, { children: [(0, jsx_runtime_1.jsx)(EventInviteButton_1.default, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, disabled: isEventFinished }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [!isMobile && ((0, jsx_runtime_1.jsx)(EditEventButton_1.default, { size: isMobile ? 'small' : 'medium', event: scEvent, eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data), disabled: isEventFinished })), (0, jsx_runtime_1.jsx)(EventActionsMenu_1.default, Object.assign({ event: scEvent, onEditSuccess: (data) => setSCEvent(data) }, EventActionsProps))] })] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(EventSubscribeButton_1.default, Object.assign({ eventId: scEvent.id, onSubscribe: handleSubscribe }, EventSubscribeButtonProps, { disabled: isEventFinished })), (0, jsx_runtime_1.jsx)(EventActionsMenu_1.default, Object.assign({ eventId: scEvent.id, onEditSuccess: (data) => setSCEvent(data) }, EventActionsProps))] })) }) })] }))] })));
|
|
180
176
|
}
|
|
181
177
|
exports.default = EventHeader;
|
|
@@ -5,15 +5,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
7
7
|
const types_1 = require("@selfcommunity/types");
|
|
8
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
8
9
|
const react_1 = require("react");
|
|
9
10
|
const react_intl_1 = require("react-intl");
|
|
11
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
10
12
|
const EventInfoDetails_1 = tslib_1.__importDefault(require("../../shared/EventInfoDetails"));
|
|
11
13
|
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
12
14
|
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
|
|
13
15
|
const constants_1 = require("./constants");
|
|
14
16
|
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
15
|
-
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
16
|
-
const PubSub_1 = require("../../constants/PubSub");
|
|
17
17
|
const classes = {
|
|
18
18
|
root: `${constants_1.PREFIX}-root`,
|
|
19
19
|
content: `${constants_1.PREFIX}-content`,
|
|
@@ -68,8 +68,10 @@ function EventInfoWidget(inProps) {
|
|
|
68
68
|
const handleToggleSummary = (0, react_1.useCallback)(() => {
|
|
69
69
|
setExpanded(!expanded);
|
|
70
70
|
}, [expanded]);
|
|
71
|
-
const
|
|
72
|
-
|
|
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]);
|
|
72
|
+
const showInfo = (0, react_1.useMemo)(() => ((scEvent === null || scEvent === void 0 ? void 0 : scEvent.privacy) === types_1.SCEventPrivacyType.PUBLIC && hasGeolocationOrLink) ||
|
|
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
|
+
hasGeolocationOrLink), [scEvent]);
|
|
73
75
|
const description = (0, react_1.useMemo)(() => (expanded ? scEvent === null || scEvent === void 0 ? void 0 : scEvent.description : getTruncatedText(scEvent === null || scEvent === void 0 ? void 0 : scEvent.description, 220)), [expanded, scEvent]);
|
|
74
76
|
/**
|
|
75
77
|
* Subscriber for pubsub callback
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
3
|
+
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
4
|
+
import { WidgetProps } from '../Widget';
|
|
5
|
+
export interface EventMediaWidgetProps extends WidgetProps {
|
|
6
|
+
/**
|
|
7
|
+
* Event Object
|
|
8
|
+
* @default null
|
|
9
|
+
*/
|
|
10
|
+
event?: SCEventType;
|
|
11
|
+
/**
|
|
12
|
+
* Id of event object
|
|
13
|
+
* @default null
|
|
14
|
+
*/
|
|
15
|
+
eventId?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Feed API Query Params
|
|
18
|
+
* @default [{'limit': 20, 'offset': 0}]
|
|
19
|
+
*/
|
|
20
|
+
endpointQueryParams?: Record<string, string | number>;
|
|
21
|
+
/**
|
|
22
|
+
* Caching strategies
|
|
23
|
+
* @default CacheStrategies.CACHE_FIRST
|
|
24
|
+
*/
|
|
25
|
+
cacheStrategy?: CacheStrategies;
|
|
26
|
+
/**
|
|
27
|
+
* Props to spread to users suggestion dialog
|
|
28
|
+
* @default {}
|
|
29
|
+
*/
|
|
30
|
+
dialogProps?: BaseDialogProps;
|
|
31
|
+
/**
|
|
32
|
+
* Limit results
|
|
33
|
+
* @default 10
|
|
34
|
+
*/
|
|
35
|
+
limit?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Other props
|
|
38
|
+
*/
|
|
39
|
+
[p: string]: any;
|
|
40
|
+
}
|
|
41
|
+
export default function EventMediaWidget(inProps: EventMediaWidgetProps): JSX.Element;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const lab_1 = require("@mui/lab");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const styles_1 = require("@mui/material/styles");
|
|
8
|
+
const system_1 = require("@mui/system");
|
|
9
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
12
|
+
const react_1 = require("react");
|
|
13
|
+
const react_intl_1 = require("react-intl");
|
|
14
|
+
const Errors_1 = require("../../constants/Errors");
|
|
15
|
+
const Pagination_1 = require("../../constants/Pagination");
|
|
16
|
+
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
17
|
+
const ConfirmDialog_1 = tslib_1.__importDefault(require("../../shared/ConfirmDialog/ConfirmDialog"));
|
|
18
|
+
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
19
|
+
const InfiniteScroll_1 = tslib_1.__importDefault(require("../../shared/InfiniteScroll"));
|
|
20
|
+
const Lightbox_1 = require("../../shared/Lightbox");
|
|
21
|
+
const widget_1 = require("../../utils/widget");
|
|
22
|
+
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
|
|
23
|
+
const constants_1 = require("./constants");
|
|
24
|
+
const Skeleton_1 = tslib_1.__importStar(require("./Skeleton"));
|
|
25
|
+
const TriggerButton_1 = tslib_1.__importDefault(require("./TriggerButton"));
|
|
26
|
+
const messages = (0, react_intl_1.defineMessages)({
|
|
27
|
+
title: {
|
|
28
|
+
id: 'ui.eventMediaWidget.title',
|
|
29
|
+
defaultMessage: 'ui.eventMediaWidget.title'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const MEDIAS_TO_SHOW = 9;
|
|
33
|
+
const classes = {
|
|
34
|
+
root: `${constants_1.PREFIX}-root`,
|
|
35
|
+
header: `${constants_1.PREFIX}-header`,
|
|
36
|
+
grid: `${constants_1.PREFIX}-grid`,
|
|
37
|
+
media: `${constants_1.PREFIX}-media`,
|
|
38
|
+
mediaLayer: `${constants_1.PREFIX}-media-layer`,
|
|
39
|
+
countHiddenMediaWrapper: `${constants_1.PREFIX}-count-hidden-media-wrapper`,
|
|
40
|
+
countHiddenMedia: `${constants_1.PREFIX}-count-hidden-media`,
|
|
41
|
+
content: `${constants_1.PREFIX}-content`,
|
|
42
|
+
actions: `${constants_1.PREFIX}-actions`,
|
|
43
|
+
dialogRoot: `${constants_1.PREFIX}-dialog-root`,
|
|
44
|
+
dialogInfiniteScroll: `${constants_1.PREFIX}-dialog-infinite-scroll`,
|
|
45
|
+
dialogMediaWrapper: `${constants_1.PREFIX}-dialog-media-wrapper`,
|
|
46
|
+
dialogButtonWrapper: `${constants_1.PREFIX}-dialog-button-wrapper`,
|
|
47
|
+
dialogLoadingButton: `${constants_1.PREFIX}-dialog-loading-button`,
|
|
48
|
+
endMessage: `${constants_1.PREFIX}-end-message`
|
|
49
|
+
};
|
|
50
|
+
const Root = (0, styles_1.styled)(Widget_1.default, {
|
|
51
|
+
name: constants_1.PREFIX,
|
|
52
|
+
slot: 'Root',
|
|
53
|
+
overridesResolver: (_props, styles) => styles.root,
|
|
54
|
+
shouldForwardProp: (prop) => prop !== 'showPadding'
|
|
55
|
+
})(() => ({}));
|
|
56
|
+
const DialogRoot = (0, styles_1.styled)(BaseDialog_1.default, {
|
|
57
|
+
name: constants_1.PREFIX,
|
|
58
|
+
slot: 'DialogRoot',
|
|
59
|
+
overridesResolver: (_props, styles) => styles.dialogRoot,
|
|
60
|
+
shouldForwardProp: (prop) => prop !== 'loading'
|
|
61
|
+
})(() => ({}));
|
|
62
|
+
function EventMediaWidget(inProps) {
|
|
63
|
+
// PROPS
|
|
64
|
+
const props = (0, system_1.useThemeProps)({
|
|
65
|
+
props: inProps,
|
|
66
|
+
name: constants_1.PREFIX
|
|
67
|
+
});
|
|
68
|
+
// CONST
|
|
69
|
+
const { event, eventId, limit = Pagination_1.DEFAULT_PAGINATION_LIMIT, endpointQueryParams = {
|
|
70
|
+
limit,
|
|
71
|
+
offset: Pagination_1.DEFAULT_PAGINATION_OFFSET
|
|
72
|
+
}, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, dialogProps } = props, rest = tslib_1.__rest(props, ["event", "eventId", "limit", "endpointQueryParams", "cacheStrategy", "dialogProps"]);
|
|
73
|
+
// HOOKS
|
|
74
|
+
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
75
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
76
|
+
const theme = (0, material_1.useTheme)();
|
|
77
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
78
|
+
// STATE
|
|
79
|
+
const [state, dispatch] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
|
|
80
|
+
isLoadingNext: false,
|
|
81
|
+
next: null,
|
|
82
|
+
cacheKey: react_core_1.SCCache.getWidgetStateCacheKey(react_core_1.SCCache.EVENT_MEDIA_STATE_CACHE_PREFIX_KEY, event ? event.id : eventId),
|
|
83
|
+
cacheStrategy,
|
|
84
|
+
visibleItems: limit
|
|
85
|
+
}, widget_1.stateWidgetInitializer);
|
|
86
|
+
const [medias, setMedias] = (0, react_1.useState)(state.results);
|
|
87
|
+
const [mediasCount, setMediasCount] = (0, react_1.useState)(state.count);
|
|
88
|
+
const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
|
|
89
|
+
const [openDialogConfirm, setOpenDialogConfirm] = (0, react_1.useState)(false);
|
|
90
|
+
const [mediaId, setMediaId] = (0, react_1.useState)(null);
|
|
91
|
+
const [preview, setPreview] = (0, react_1.useState)(-1);
|
|
92
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
93
|
+
const [showSkeleton, setShowSkeleton] = (0, react_1.useState)(null);
|
|
94
|
+
// CONTEXT
|
|
95
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
96
|
+
// CONSTS
|
|
97
|
+
const hasAllow = (0, react_1.useMemo)(() => { var _a; return ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === (scEvent === null || scEvent === void 0 ? void 0 : scEvent.managed_by.id); }, [scUserContext, scEvent]);
|
|
98
|
+
const countHiddenMedia = (0, react_1.useMemo)(() => mediasCount - MEDIAS_TO_SHOW, [mediasCount]);
|
|
99
|
+
const _fetchNext = (0, react_1.useCallback)((index) => {
|
|
100
|
+
if (mediasCount > medias.length && index >= 6 && !state.isLoadingNext && state.next) {
|
|
101
|
+
setPreview(index);
|
|
102
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
103
|
+
api_services_1.http
|
|
104
|
+
.request({
|
|
105
|
+
url: state.next,
|
|
106
|
+
method: api_services_1.Endpoints.GetEventPhotoGallery.method
|
|
107
|
+
})
|
|
108
|
+
.then((res) => {
|
|
109
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
110
|
+
setMedias((prev) => [...prev, ...res.data.results]);
|
|
111
|
+
setMediasCount(res.data.count);
|
|
112
|
+
})
|
|
113
|
+
.catch((error) => {
|
|
114
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
115
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, [state.next, state.isLoadingNext, medias, mediasCount, dispatch, setPreview]);
|
|
119
|
+
const handleOpenLightbox = (0, react_1.useCallback)((index) => {
|
|
120
|
+
setPreview(index);
|
|
121
|
+
}, [setPreview]);
|
|
122
|
+
const handleCloseLightbox = (0, react_1.useCallback)(() => {
|
|
123
|
+
setPreview(-1);
|
|
124
|
+
}, [setPreview]);
|
|
125
|
+
const handleToggleDialogOpen = (0, react_1.useCallback)(() => {
|
|
126
|
+
setOpenDialog((prev) => !prev);
|
|
127
|
+
}, [setOpenDialog]);
|
|
128
|
+
const handleNext = (0, react_1.useCallback)(() => {
|
|
129
|
+
setShowSkeleton('dialog');
|
|
130
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
131
|
+
api_services_1.http
|
|
132
|
+
.request({
|
|
133
|
+
url: state.next,
|
|
134
|
+
method: api_services_1.Endpoints.GetEventPhotoGallery.method
|
|
135
|
+
})
|
|
136
|
+
.then((res) => {
|
|
137
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
138
|
+
setMedias((prev) => [...prev, ...res.data.results]);
|
|
139
|
+
setMediasCount(res.data.count);
|
|
140
|
+
setShowSkeleton(null);
|
|
141
|
+
})
|
|
142
|
+
.catch((error) => {
|
|
143
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
144
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
145
|
+
});
|
|
146
|
+
}, [state.next, state.isLoadingNext, state.initialized, dispatch, setMedias, setMediasCount, setShowSkeleton]);
|
|
147
|
+
const handleRemoveMedia = (0, react_1.useCallback)((id) => {
|
|
148
|
+
if (hasAllow) {
|
|
149
|
+
setMediaId(id);
|
|
150
|
+
setOpenDialogConfirm(true);
|
|
151
|
+
}
|
|
152
|
+
}, [setMediaId, setOpenDialogConfirm]);
|
|
153
|
+
const handleConfirmAction = (0, react_1.useCallback)(() => {
|
|
154
|
+
setLoading(true);
|
|
155
|
+
api_services_1.http
|
|
156
|
+
.request({
|
|
157
|
+
url: api_services_1.Endpoints.RemoveMediasFromEventPhotoGallery.url({ id: scEvent.id }),
|
|
158
|
+
method: api_services_1.Endpoints.RemoveMediasFromEventPhotoGallery.method,
|
|
159
|
+
data: { medias: [mediaId] }
|
|
160
|
+
})
|
|
161
|
+
.then(() => {
|
|
162
|
+
setMedias((prev) => prev.filter((media) => media.id !== mediaId));
|
|
163
|
+
setMediasCount((prev) => prev - 1);
|
|
164
|
+
setMediaId(null);
|
|
165
|
+
setLoading(false);
|
|
166
|
+
setOpenDialogConfirm(false);
|
|
167
|
+
})
|
|
168
|
+
.catch((error) => {
|
|
169
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
170
|
+
});
|
|
171
|
+
}, [scEvent, mediaId, setMedias, setLoading, setOpenDialogConfirm, dispatch, setMediasCount]);
|
|
172
|
+
const handleCloseAction = (0, react_1.useCallback)(() => {
|
|
173
|
+
setMediaId(null);
|
|
174
|
+
setOpenDialogConfirm(false);
|
|
175
|
+
}, [setMediaId, setOpenDialogConfirm]);
|
|
176
|
+
const handleAddMedia = (0, react_1.useCallback)((media) => {
|
|
177
|
+
setShowSkeleton('widget');
|
|
178
|
+
api_services_1.http
|
|
179
|
+
.request({
|
|
180
|
+
url: api_services_1.Endpoints.AddMediaToEventPhotoGallery.url({ id: scEvent.id }),
|
|
181
|
+
method: api_services_1.Endpoints.AddMediaToEventPhotoGallery.method,
|
|
182
|
+
data: { media: media.id }
|
|
183
|
+
})
|
|
184
|
+
.then((res) => {
|
|
185
|
+
setMedias((prev) => [res.data, ...prev]);
|
|
186
|
+
setMediasCount((prev) => prev + 1);
|
|
187
|
+
setShowSkeleton(null);
|
|
188
|
+
})
|
|
189
|
+
.catch((error) => {
|
|
190
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
191
|
+
});
|
|
192
|
+
}, [scEvent, setMedias, setMediasCount, setShowSkeleton]);
|
|
193
|
+
// EFFECTS
|
|
194
|
+
(0, react_1.useEffect)(() => {
|
|
195
|
+
let _t;
|
|
196
|
+
if (scUserContext.user &&
|
|
197
|
+
scEvent &&
|
|
198
|
+
!state.initialized &&
|
|
199
|
+
Boolean((eventId !== undefined && scEvent.id === eventId) || (event && scEvent.id === event.id))) {
|
|
200
|
+
_t = setTimeout(_initComponent);
|
|
201
|
+
return () => {
|
|
202
|
+
clearTimeout(_t);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}, [scUserContext.user, scEvent, state.initialized]);
|
|
206
|
+
(0, react_1.useEffect)(() => {
|
|
207
|
+
if (state.initialized && scEvent && Boolean((eventId !== undefined && scEvent.id !== eventId) || (event && scEvent.id !== event.id))) {
|
|
208
|
+
dispatch({ type: widget_1.actionWidgetTypes.RESET, payload: {} });
|
|
209
|
+
}
|
|
210
|
+
}, [state.initialized, scEvent, eventId, event]);
|
|
211
|
+
/**
|
|
212
|
+
* Initialize component
|
|
213
|
+
* Fetch data only if the component is not initialized and it is not loading data
|
|
214
|
+
*/
|
|
215
|
+
const _initComponent = (0, react_1.useCallback)(() => {
|
|
216
|
+
if (!state.isLoadingNext) {
|
|
217
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
218
|
+
api_services_1.EventService.getEventPhotoGallery(scEvent.id, Object.assign({}, endpointQueryParams))
|
|
219
|
+
.then((payload) => {
|
|
220
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
|
|
221
|
+
setMedias(payload.results);
|
|
222
|
+
setMediasCount(payload.count);
|
|
223
|
+
})
|
|
224
|
+
.catch((error) => {
|
|
225
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
226
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}, [state.isLoadingNext, scEvent, eventId, dispatch, setMedias, setMediasCount]);
|
|
230
|
+
(0, react_1.useEffect)(() => {
|
|
231
|
+
if (isMobile && openDialog && state.next) {
|
|
232
|
+
handleNext();
|
|
233
|
+
}
|
|
234
|
+
}, [isMobile, openDialog, state.next]);
|
|
235
|
+
// RENDER
|
|
236
|
+
if (!scEvent ||
|
|
237
|
+
!state.initialized ||
|
|
238
|
+
(scEvent && ((eventId !== undefined && scEvent.id !== eventId) || (event && scEvent.id !== event.id))) ||
|
|
239
|
+
(state.isLoadingNext && !state.initialized)) {
|
|
240
|
+
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
241
|
+
}
|
|
242
|
+
if (state.initialized && state.count === 0 && !hasAllow) {
|
|
243
|
+
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
244
|
+
}
|
|
245
|
+
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: {
|
|
246
|
+
background: `url(${media.image}) no-repeat center`
|
|
247
|
+
}, 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" }) })) })) }))), openDialog && ((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: {
|
|
248
|
+
background: `url(${media.image}) no-repeat center`
|
|
249
|
+
}, 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: {
|
|
250
|
+
color: (theme) => (mediaId === media.id ? 'transparent' : theme.palette.common.white)
|
|
251
|
+
} }, { 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))] })) })) }))), openDialogConfirm && ((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 }))] })));
|
|
252
|
+
}
|
|
253
|
+
exports.default = EventMediaWidget;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventMediaSkeleton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
|
|
8
|
+
const styles_1 = require("@mui/material/styles");
|
|
9
|
+
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const classes = {
|
|
12
|
+
root: `${constants_1.PREFIX}-skeleton-root`,
|
|
13
|
+
grid: `${constants_1.PREFIX}-grid`,
|
|
14
|
+
media: `${constants_1.PREFIX}-media`
|
|
15
|
+
};
|
|
16
|
+
const Root = (0, styles_1.styled)(Widget_1.default, {
|
|
17
|
+
name: constants_1.PREFIX,
|
|
18
|
+
slot: 'SkeletonRoot',
|
|
19
|
+
overridesResolver: (_props, styles) => styles.skeletonRoot
|
|
20
|
+
})(() => ({}));
|
|
21
|
+
function EventMediaWidgetSkeleton() {
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardHeader, { title: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", width: "50px", height: "23px" }) }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.CardContent, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.grid }, { children: Array.from(Array(9)).map((_, i) => ((0, jsx_runtime_1.jsx)(EventMediaSkeleton, {}, i))) })) })] })));
|
|
23
|
+
}
|
|
24
|
+
exports.default = EventMediaWidgetSkeleton;
|
|
25
|
+
function EventMediaSkeleton() {
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rectangular", animation: "wave", width: "100%", className: classes.media });
|
|
27
|
+
}
|
|
28
|
+
exports.EventMediaSkeleton = EventMediaSkeleton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LoadingButtonProps } from '@mui/lab';
|
|
3
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
4
|
+
export interface TriggerIconButtonProps extends LoadingButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* Callback triggered when a media is added
|
|
7
|
+
* @param media
|
|
8
|
+
*/
|
|
9
|
+
onAdd?: (media: SCMediaType) => void | null;
|
|
10
|
+
/**
|
|
11
|
+
* Prop to change shape
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
isSquare?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<TriggerIconButtonProps, "id" | "role" | "className" | "style" | "classes" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "variant" | "name" | "type" | "href" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "action" | "loading" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon" | "loadingIndicator" | "loadingPosition" | "onAdd" | "isSquare"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export default _default;
|