@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
|
@@ -0,0 +1,166 @@
|
|
|
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 react_1 = require("react");
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
|
|
9
|
+
const constants_1 = require("../constants");
|
|
10
|
+
const system_1 = require("@mui/system");
|
|
11
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
|
+
const types_1 = require("../types");
|
|
13
|
+
const notistack_1 = require("notistack");
|
|
14
|
+
const react_intl_1 = require("react-intl");
|
|
15
|
+
const classes = {
|
|
16
|
+
root: `${constants_1.PREFIX}-root`,
|
|
17
|
+
options: `${constants_1.PREFIX}-options`,
|
|
18
|
+
actions: `${constants_1.PREFIX}-actions`
|
|
19
|
+
};
|
|
20
|
+
const Root = (0, styles_1.styled)(material_1.Container, {
|
|
21
|
+
name: constants_1.PREFIX,
|
|
22
|
+
slot: 'Root'
|
|
23
|
+
})(({ theme }) => ({
|
|
24
|
+
[`& .${classes.options}`]: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
alignItems: 'center'
|
|
28
|
+
},
|
|
29
|
+
[`& .${classes.actions}`]: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
justifyContent: 'flex-end',
|
|
32
|
+
alignItems: 'flex-end',
|
|
33
|
+
marginTop: theme.spacing(4)
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
// Styled components
|
|
37
|
+
const OptionCard = (0, styles_1.styled)(material_1.Paper, {
|
|
38
|
+
shouldForwardProp: (prop) => prop !== 'selected'
|
|
39
|
+
})(({ theme, selected }) => ({
|
|
40
|
+
maxWidth: '300px',
|
|
41
|
+
padding: theme.spacing(3),
|
|
42
|
+
margin: theme.spacing(0, 3),
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
transition: theme.transitions.create(['background-color', 'box-shadow'], {
|
|
45
|
+
duration: theme.transitions.duration.short
|
|
46
|
+
}),
|
|
47
|
+
backgroundColor: selected ? theme.palette.grey[100] : theme.palette.background.paper,
|
|
48
|
+
'&:hover': {
|
|
49
|
+
backgroundColor: theme.palette.grey[50],
|
|
50
|
+
boxShadow: theme.shadows[2]
|
|
51
|
+
},
|
|
52
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
53
|
+
[`& > div`]: {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
justifyContent: 'space-between',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
marginBottom: 2,
|
|
58
|
+
maxWidth: '300px'
|
|
59
|
+
},
|
|
60
|
+
[`& ul`]: {
|
|
61
|
+
marginTop: theme.spacing(2),
|
|
62
|
+
padding: 0,
|
|
63
|
+
listStyle: 'none'
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
const RadioIndicator = (0, styles_1.styled)(material_1.Radio, {
|
|
67
|
+
shouldForwardProp: (prop) => prop !== 'selected'
|
|
68
|
+
})(({ theme, selected }) => ({
|
|
69
|
+
width: 16,
|
|
70
|
+
height: 16,
|
|
71
|
+
borderRadius: '50%',
|
|
72
|
+
border: `2px solid ${selected ? theme.palette.secondary.main : theme.palette.grey[300]}`,
|
|
73
|
+
backgroundColor: selected ? theme.palette.secondary.main : 'transparent',
|
|
74
|
+
transition: theme.transitions.create(['border-color', 'background-color'], {
|
|
75
|
+
duration: theme.transitions.duration.shortest
|
|
76
|
+
})
|
|
77
|
+
}));
|
|
78
|
+
const FeatureItem = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
79
|
+
display: 'flex',
|
|
80
|
+
alignItems: 'flex-start',
|
|
81
|
+
gap: theme.spacing(1.5),
|
|
82
|
+
marginBottom: theme.spacing(2),
|
|
83
|
+
'&:last-child': {
|
|
84
|
+
marginBottom: 0
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
/**
|
|
88
|
+
*> API documentation for the Community-JS LiveStreamSelector component. Learn about the available props and the CSS API.
|
|
89
|
+
*
|
|
90
|
+
#### Import
|
|
91
|
+
```jsx
|
|
92
|
+
import {LiveStreamSelector} from '@selfcommunity/react-ui';
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Component Name
|
|
96
|
+
The name `SCLiveStreamSelector` can be used when providing style overrides in the theme.
|
|
97
|
+
|
|
98
|
+
#### CSS
|
|
99
|
+
|
|
100
|
+
|Rule Name|Global class|Description|
|
|
101
|
+
|---|---|---|
|
|
102
|
+
|root|.SCCreateLivestreamDialog-root|Styles applied to the root element.|
|
|
103
|
+
|
|
104
|
+
* @param inProps
|
|
105
|
+
*/
|
|
106
|
+
function LiveStreamSelector(inProps) {
|
|
107
|
+
//PROPS
|
|
108
|
+
const props = (0, system_1.useThemeProps)({
|
|
109
|
+
props: inProps,
|
|
110
|
+
name: constants_1.PREFIX
|
|
111
|
+
});
|
|
112
|
+
const { className, liveSelected, onLiveSelected, onNext } = props, rest = tslib_1.__rest(props, ["className", "liveSelected", "onLiveSelected", "onNext"]);
|
|
113
|
+
// CONTEXT
|
|
114
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
115
|
+
// STATE
|
|
116
|
+
const [selectedOption, setSelectedOption] = (0, react_1.useState)(liveSelected);
|
|
117
|
+
const options = [
|
|
118
|
+
{
|
|
119
|
+
title: 'Schedule a live event',
|
|
120
|
+
type: types_1.LiveStreamType.EVENT_LIVE,
|
|
121
|
+
features: [
|
|
122
|
+
'Schedule a live room or stream in your event space',
|
|
123
|
+
'Allow your members to RSVP, add to calendar, and receive event reminders',
|
|
124
|
+
'Automatically post the event recording to your space',
|
|
125
|
+
'Allow your members to host the event'
|
|
126
|
+
],
|
|
127
|
+
icons: [(0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" })]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: 'Start a live stream',
|
|
131
|
+
type: types_1.LiveStreamType.DIRECT_LIVE,
|
|
132
|
+
features: [
|
|
133
|
+
'Best for webinars, Q&As, AMAs, and for presentations',
|
|
134
|
+
'Up to 100 people',
|
|
135
|
+
'Only co-hosts can talk to each other with audio/video',
|
|
136
|
+
'View-only participants can only chat or be promoted to the stage'
|
|
137
|
+
],
|
|
138
|
+
icons: [(0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" })]
|
|
139
|
+
}
|
|
140
|
+
];
|
|
141
|
+
const handleOptionSelect = (type) => {
|
|
142
|
+
setSelectedOption(type);
|
|
143
|
+
onLiveSelected(type);
|
|
144
|
+
};
|
|
145
|
+
const handleNext = () => {
|
|
146
|
+
if (!selectedOption) {
|
|
147
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error", defaultMessage: "ui.common.error" }), {
|
|
148
|
+
variant: 'error',
|
|
149
|
+
autoHideDuration: 3000
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
onNext && onNext(selectedOption);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), maxWidth: "lg", sx: { py: 4 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", component: "h1", align: "center", gutterBottom: true, sx: { mb: 4, fontWeight: 500 } }, { children: "How do you want to go live?" })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.options }, { children: options.map((option, index) => ((0, jsx_runtime_1.jsxs)(OptionCard, Object.assign({ selected: selectedOption === option.type, onClick: () => handleOptionSelect(option.type), elevation: 0, role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
157
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
158
|
+
handleOptionSelect(index);
|
|
159
|
+
e.preventDefault();
|
|
160
|
+
}
|
|
161
|
+
}, theme: undefined }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", component: "h2", sx: { fontWeight: 500 } }, { children: option.title })), (0, jsx_runtime_1.jsx)(RadioIndicator, { selected: selectedOption === option.type, theme: undefined })] }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: "ul" }, { children: option.features.map((feature, featureIndex) => {
|
|
162
|
+
const _Icon = option.icons[featureIndex];
|
|
163
|
+
return ((0, jsx_runtime_1.jsxs)(FeatureItem, Object.assign({ component: "li" }, { children: [_Icon, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "text.secondary", sx: { flex: 1 } }, { children: feature }))] }), featureIndex));
|
|
164
|
+
}) }))] }), index))) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ disabled: !selectedOption, variant: "contained", onClick: handleNext, color: "secondary" }, { children: "Next" })) }))] })));
|
|
165
|
+
}
|
|
166
|
+
exports.default = LiveStreamSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCCreateLiveStreamDialog";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiveStreamType = exports.CreateLiveStreamStep = void 0;
|
|
4
|
+
var CreateLiveStreamStep;
|
|
5
|
+
(function (CreateLiveStreamStep) {
|
|
6
|
+
CreateLiveStreamStep["SELECT_TYPE"] = "_select_type";
|
|
7
|
+
CreateLiveStreamStep["CREATE_LIVE"] = "_create_live";
|
|
8
|
+
})(CreateLiveStreamStep = exports.CreateLiveStreamStep || (exports.CreateLiveStreamStep = {}));
|
|
9
|
+
var LiveStreamType;
|
|
10
|
+
(function (LiveStreamType) {
|
|
11
|
+
LiveStreamType["EVENT_LIVE"] = "_event_live";
|
|
12
|
+
LiveStreamType["DIRECT_LIVE"] = "_direct_live";
|
|
13
|
+
})(LiveStreamType = exports.LiveStreamType || (exports.LiveStreamType = {}));
|
|
@@ -55,6 +55,6 @@ function EditEventButton(inProps) {
|
|
|
55
55
|
/**
|
|
56
56
|
* Renders root object
|
|
57
57
|
*/
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ variant: "outlined", className: (0, classnames_1.default)(classes.root, className),
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ variant: "outlined", className: (0, classnames_1.default)(classes.root, className), EventFormDialogComponentProps: { EventFormComponentProps: { event: scEvent, onSuccess: handleSuccess } } }, rest, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editEventButton", defaultMessage: "ui.editEventButton" }) })));
|
|
59
59
|
}
|
|
60
60
|
exports.default = EditEventButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
|
|
2
2
|
import { SCCategoryType } from '@selfcommunity/types';
|
|
3
3
|
import { DOMConversionMap } from 'lexical/LexicalNode';
|
|
4
|
-
export
|
|
4
|
+
export type SerializedHashtagNode = Spread<{
|
|
5
5
|
category: SCCategoryType;
|
|
6
6
|
type: 'hashtag';
|
|
7
7
|
version: 1;
|
|
@@ -12,16 +12,16 @@ function convertHashtagElement(domNode) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
class HashtagNode extends lexical_1.TextNode {
|
|
15
|
-
constructor(category, text, key) {
|
|
16
|
-
super(text !== null && text !== void 0 ? text : `#${category.name}`, key);
|
|
17
|
-
this.__category = category;
|
|
18
|
-
}
|
|
19
15
|
static getType() {
|
|
20
16
|
return 'hashtag';
|
|
21
17
|
}
|
|
22
18
|
static clone(node) {
|
|
23
19
|
return new HashtagNode(node.__category, node.__text, node.__key);
|
|
24
20
|
}
|
|
21
|
+
constructor(category, text, key) {
|
|
22
|
+
super(text !== null && text !== void 0 ? text : `#${category.name}`, key);
|
|
23
|
+
this.__category = category;
|
|
24
|
+
}
|
|
25
25
|
createDOM(config) {
|
|
26
26
|
const tag = 'hashtag';
|
|
27
27
|
const dom = document.createElement(tag);
|
|
@@ -12,7 +12,7 @@ export interface ImagePayload {
|
|
|
12
12
|
declare function convertImageElement(domNode: any): {
|
|
13
13
|
node: ImageNode;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type SerializedImageNode = Spread<{
|
|
16
16
|
altText: string;
|
|
17
17
|
maxWidth: number | string;
|
|
18
18
|
src: string;
|
|
@@ -107,18 +107,18 @@ function convertImageElement(domNode) {
|
|
|
107
107
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
108
108
|
// @ts-ignore
|
|
109
109
|
class ImageNode extends lexical_1.DecoratorNode {
|
|
110
|
-
constructor(src, altText, maxWidth, key) {
|
|
111
|
-
super(key);
|
|
112
|
-
this.__src = src;
|
|
113
|
-
this.__altText = altText;
|
|
114
|
-
this.__maxWidth = maxWidth;
|
|
115
|
-
}
|
|
116
110
|
static getType() {
|
|
117
111
|
return 'image';
|
|
118
112
|
}
|
|
119
113
|
static clone(node) {
|
|
120
114
|
return new ImageNode(node.__src, node.__altText, node.__maxWidth, node.__key);
|
|
121
115
|
}
|
|
116
|
+
constructor(src, altText, maxWidth, key) {
|
|
117
|
+
super(key);
|
|
118
|
+
this.__src = src;
|
|
119
|
+
this.__altText = altText;
|
|
120
|
+
this.__maxWidth = maxWidth;
|
|
121
|
+
}
|
|
122
122
|
setWidthAndHeight(width, height) {
|
|
123
123
|
const writable = this.getWritable();
|
|
124
124
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
|
|
2
2
|
import { SCUserType } from '@selfcommunity/types';
|
|
3
3
|
import { DOMConversionMap } from 'lexical/LexicalNode';
|
|
4
|
-
export
|
|
4
|
+
export type SerializedMentionNode = Spread<{
|
|
5
5
|
user: SCUserType;
|
|
6
6
|
type: 'mention';
|
|
7
7
|
version: 1;
|
|
@@ -25,16 +25,16 @@ function convertMentionElement(domNode) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
class MentionNode extends lexical_1.TextNode {
|
|
28
|
-
constructor(user, text, key) {
|
|
29
|
-
super(text !== null && text !== void 0 ? text : `@${user.username}`, key);
|
|
30
|
-
this.__user = user;
|
|
31
|
-
}
|
|
32
28
|
static getType() {
|
|
33
29
|
return 'mention';
|
|
34
30
|
}
|
|
35
31
|
static clone(node) {
|
|
36
32
|
return new MentionNode(node.__user, node.__text, node.__key);
|
|
37
33
|
}
|
|
34
|
+
constructor(user, text, key) {
|
|
35
|
+
super(text !== null && text !== void 0 ? text : `@${user.username}`, key);
|
|
36
|
+
this.__user = user;
|
|
37
|
+
}
|
|
38
38
|
createDOM(config) {
|
|
39
39
|
const tag = 'mention';
|
|
40
40
|
const dom = document.createElement(tag);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { LexicalEditor } from 'lexical';
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
|
|
10
|
+
type ErrorBoundaryProps = {
|
|
11
11
|
children: JSX.Element;
|
|
12
12
|
onError: (error: Error) => void;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type ErrorBoundaryType = React.ComponentClass<ErrorBoundaryProps> | React.FC<ErrorBoundaryProps>;
|
|
15
15
|
export declare function useDecorators(editor: LexicalEditor, ErrorBoundary: ErrorBoundaryType): Array<JSX.Element>;
|
|
16
16
|
export {};
|
|
@@ -108,7 +108,7 @@ function Event(inProps) {
|
|
|
108
108
|
});
|
|
109
109
|
const { id = `event_object_${props.eventId ? props.eventId : props.event ? props.event.id : ''}`, eventId = null, event = null, className = null, template = event_1.SCEventTemplateType.SNIPPET, hideInProgress = false, hideEventParticipants = false, hideEventPlanner = false, actions, EventParticipantsButtonComponentProps = {}, EventSkeletonComponentProps = {} } = props, rest = tslib_1.__rest(props, ["id", "eventId", "event", "className", "template", "hideInProgress", "hideEventParticipants", "hideEventPlanner", "actions", "EventParticipantsButtonComponentProps", "EventSkeletonComponentProps"]);
|
|
110
110
|
// STATE
|
|
111
|
-
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
111
|
+
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event, autoSubscribe: false });
|
|
112
112
|
const inProgress = (0, react_1.useMemo)(() => scEvent && scEvent.active && scEvent.running, [scEvent]);
|
|
113
113
|
// CONTEXT
|
|
114
114
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
1
2
|
import { SCEventType } from '@selfcommunity/types';
|
|
2
|
-
|
|
3
|
-
export interface EventFormProps extends BaseDialogProps {
|
|
3
|
+
export interface EventFormProps extends BoxProps {
|
|
4
4
|
/**
|
|
5
5
|
* Overrides or extends the styles applied to the component.
|
|
6
6
|
* @default null
|
|
7
7
|
*/
|
|
8
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
9
|
/**
|
|
20
10
|
* Event Object
|
|
21
11
|
* @default null
|
|
@@ -26,6 +16,11 @@ export interface EventFormProps extends BaseDialogProps {
|
|
|
26
16
|
* @default null
|
|
27
17
|
*/
|
|
28
18
|
onSuccess?: (data: SCEventType) => void;
|
|
19
|
+
/**
|
|
20
|
+
* On error callback function
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
onError?: (error: any) => void;
|
|
29
24
|
/**
|
|
30
25
|
* Any other properties
|
|
31
26
|
*/
|
|
@@ -21,7 +21,6 @@ const react_intl_1 = require("react-intl");
|
|
|
21
21
|
const Errors_1 = require("../../constants/Errors");
|
|
22
22
|
const Event_1 = require("../../constants/Event");
|
|
23
23
|
const PubSub_1 = require("../../constants/PubSub");
|
|
24
|
-
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
25
24
|
const constants_1 = require("./constants");
|
|
26
25
|
const EventAddress_1 = tslib_1.__importDefault(require("./EventAddress"));
|
|
27
26
|
const UploadEventCover_1 = tslib_1.__importDefault(require("./UploadEventCover"));
|
|
@@ -74,11 +73,12 @@ const classes = {
|
|
|
74
73
|
name: `${constants_1.PREFIX}-name`,
|
|
75
74
|
description: `${constants_1.PREFIX}-description`,
|
|
76
75
|
content: `${constants_1.PREFIX}-content`,
|
|
76
|
+
actions: `${constants_1.PREFIX}-actions`,
|
|
77
77
|
privacySection: `${constants_1.PREFIX}-privacy-section`,
|
|
78
78
|
privacySectionInfo: `${constants_1.PREFIX}-privacy-section-info`,
|
|
79
79
|
error: `${constants_1.PREFIX}-error`
|
|
80
80
|
};
|
|
81
|
-
const Root = (0, styles_1.styled)(
|
|
81
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
82
82
|
name: constants_1.PREFIX,
|
|
83
83
|
slot: 'Root'
|
|
84
84
|
})(() => ({}));
|
|
@@ -120,7 +120,7 @@ function EventForm(inProps) {
|
|
|
120
120
|
props: inProps,
|
|
121
121
|
name: constants_1.PREFIX
|
|
122
122
|
});
|
|
123
|
-
const { className,
|
|
123
|
+
const { className, onSuccess, onError, event = null } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "event"]);
|
|
124
124
|
// CONTEXT
|
|
125
125
|
const scContext = (0, react_core_1.useSCContext)();
|
|
126
126
|
// INTL
|
|
@@ -221,10 +221,9 @@ function EventForm(inProps) {
|
|
|
221
221
|
}
|
|
222
222
|
eventService
|
|
223
223
|
.then((data) => {
|
|
224
|
-
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
|
|
225
224
|
notifyChanges(data);
|
|
226
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
227
225
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
226
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
|
|
228
227
|
})
|
|
229
228
|
.catch((e) => {
|
|
230
229
|
const _error = (0, api_services_1.formatHttpErrorCode)(e);
|
|
@@ -238,8 +237,9 @@ function EventForm(inProps) {
|
|
|
238
237
|
}
|
|
239
238
|
setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
|
|
240
239
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
240
|
+
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
241
241
|
});
|
|
242
|
-
}, [field, privateEnabled, visibilityEnabled]);
|
|
242
|
+
}, [field, privateEnabled, visibilityEnabled, onSuccess, onError]);
|
|
243
243
|
const handleChange = (0, react_1.useCallback)((event) => {
|
|
244
244
|
const { name, value } = event.target;
|
|
245
245
|
setField((prev) => (Object.assign(Object.assign({}, prev), { [name]: value })));
|
|
@@ -284,56 +284,56 @@ function EventForm(inProps) {
|
|
|
284
284
|
/**
|
|
285
285
|
* Renders root object
|
|
286
286
|
*/
|
|
287
|
-
return ((0, jsx_runtime_1.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
(field.recurring !== types_1.SCEventRecurrenceType.NEVER && !field.endDate && !field.endTime) ||
|
|
295
|
-
Object.keys(error).length !== 0 ||
|
|
296
|
-
field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ||
|
|
297
|
-
field.description.length > Event_1.EVENT_DESCRIPTION_MAX_LENGTH, 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" })) })) }, rest, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { 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 }) })), (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: {
|
|
298
|
-
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Event_1.EVENT_TITLE_MAX_LENGTH - field.name.length }))
|
|
299
|
-
}, 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 }, { 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: {
|
|
300
|
-
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" }) }) }))) }) })))
|
|
301
|
-
}, slotProps: {
|
|
302
|
-
toolbar: {
|
|
303
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
304
|
-
// @ts-ignore
|
|
305
|
-
toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
|
|
306
|
-
}
|
|
307
|
-
}, onChange: (value) => handleChangeDateTime(value, 'startDate') }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
|
|
308
|
-
textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startTime)}`, 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: "access_time" }) }) }))) }) })))
|
|
309
|
-
}, slotProps: {
|
|
310
|
-
toolbar: {
|
|
311
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
312
|
-
// @ts-ignore
|
|
313
|
-
toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.title", defaultMessage: "ui.eventForm.time.title" })
|
|
314
|
-
}
|
|
315
|
-
}, onChange: (value) => handleChangeDateTime(value, 'startTime') })] })) })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ className: classes.frequency }, { children: [field.recurring !== types_1.SCEventRecurrenceType.NEVER && (0, jsx_runtime_1.jsx)(material_1.InputLabel, Object.assign({ id: "recurring" }, { children: `${intl.formatMessage(messages.frequency)}` })), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ name: "recurring", label: field.recurring !== types_1.SCEventRecurrenceType.NEVER && `${intl.formatMessage(messages.frequency)}`, labelId: "recurring", value: field.recurring, onChange: handleChange, displayEmpty: true, renderValue: (selected) => {
|
|
316
|
-
if (!selected) {
|
|
317
|
-
return (0, jsx_runtime_1.jsx)("em", { children: `${intl.formatMessage(messages.frequencyPlaceholder)}` });
|
|
318
|
-
}
|
|
319
|
-
return ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.frequency.${selected}.placeholder`, defaultMessage: `ui.eventForm.frequency.${selected}.placeholder` }));
|
|
320
|
-
}, 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 }, { children: [(0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileDatePicker, { className: classes.picker, disablePast: true, 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: {
|
|
321
|
-
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" }) }) }))) }) })))
|
|
322
|
-
}, onChange: (value) => handleChangeDateTime(value, 'endDate'), shouldDisableDate: shouldDisabledDate }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
|
|
323
|
-
textField: (params) => {
|
|
324
|
-
var _a;
|
|
325
|
-
return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, 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: "access_time" }) }) }))) }), error: Boolean(error['endDateError']), helperText: ((_a = error['endDateError']) === null || _a === void 0 ? void 0 : _a.error) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.error.invalid", defaultMessage: "ui.eventForm.time.end.error.invalid" })) : null })));
|
|
326
|
-
}
|
|
327
|
-
}, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisabledTime })] })) })), (0, jsx_runtime_1.jsx)(EventAddress_1.default, { forwardGeolocationData: handleGeoData, event: event !== null && event !== void 0 ? event : null }), 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: {
|
|
328
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
287
|
+
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 }) })), (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: {
|
|
288
|
+
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Event_1.EVENT_TITLE_MAX_LENGTH - field.name.length }))
|
|
289
|
+
}, 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 }, { 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: {
|
|
290
|
+
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" }) }) }))) }) })))
|
|
291
|
+
}, slotProps: {
|
|
292
|
+
toolbar: {
|
|
293
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
329
294
|
// @ts-ignore
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
295
|
+
toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
|
|
296
|
+
}
|
|
297
|
+
}, onChange: (value) => handleChangeDateTime(value, 'startDate') }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
|
|
298
|
+
textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startTime)}`, 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: "access_time" }) }) }))) }) })))
|
|
299
|
+
}, slotProps: {
|
|
300
|
+
toolbar: {
|
|
301
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
|
|
333
302
|
// @ts-ignore
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
303
|
+
toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.title", defaultMessage: "ui.eventForm.time.title" })
|
|
304
|
+
}
|
|
305
|
+
}, onChange: (value) => handleChangeDateTime(value, 'startTime') })] })) })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ className: classes.frequency }, { children: [field.recurring !== types_1.SCEventRecurrenceType.NEVER && (0, jsx_runtime_1.jsx)(material_1.InputLabel, Object.assign({ id: "recurring" }, { children: `${intl.formatMessage(messages.frequency)}` })), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ name: "recurring", label: field.recurring !== types_1.SCEventRecurrenceType.NEVER && `${intl.formatMessage(messages.frequency)}`, labelId: "recurring", value: field.recurring, onChange: handleChange, displayEmpty: true, renderValue: (selected) => {
|
|
306
|
+
if (!selected) {
|
|
307
|
+
return (0, jsx_runtime_1.jsx)("em", { children: `${intl.formatMessage(messages.frequencyPlaceholder)}` });
|
|
308
|
+
}
|
|
309
|
+
return ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.frequency.${selected}.placeholder`, defaultMessage: `ui.eventForm.frequency.${selected}.placeholder` }));
|
|
310
|
+
}, 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 }, { children: [(0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileDatePicker, { className: classes.picker, disablePast: true, 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: {
|
|
311
|
+
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" }) }) }))) }) })))
|
|
312
|
+
}, onChange: (value) => handleChangeDateTime(value, 'endDate'), shouldDisableDate: shouldDisabledDate }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
|
|
313
|
+
textField: (params) => {
|
|
314
|
+
var _a;
|
|
315
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, 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: "access_time" }) }) }))) }), error: Boolean(error['endDateError']), helperText: ((_a = error['endDateError']) === null || _a === void 0 ? void 0 : _a.error) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.error.invalid", defaultMessage: "ui.eventForm.time.end.error.invalid" })) : null })));
|
|
316
|
+
}
|
|
317
|
+
}, onChange: (value) => handleChangeDateTime(value, 'endTime'), shouldDisableTime: shouldDisabledTime })] })) })), (0, jsx_runtime_1.jsx)(EventAddress_1.default, { forwardGeolocationData: handleGeoData, event: event !== null && event !== void 0 ? event : null }), 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: {
|
|
318
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
319
|
+
// @ts-ignore
|
|
320
|
+
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
321
|
+
} })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.privacy.private.info", defaultMessage: "ui.eventForm.private.public.info", values: {
|
|
322
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
323
|
+
// @ts-ignore
|
|
324
|
+
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
325
|
+
} })) }))] }))), (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: {
|
|
326
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) ? Event_1.EVENT_DESCRIPTION_MAX_LENGTH - field.description.length : Event_1.EVENT_DESCRIPTION_MAX_LENGTH })))
|
|
327
|
+
}, error: Boolean(((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > Event_1.EVENT_DESCRIPTION_MAX_LENGTH), helperText: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.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 }), (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 ||
|
|
328
|
+
!field.startDate ||
|
|
329
|
+
!field.startTime ||
|
|
330
|
+
!field.endDate ||
|
|
331
|
+
!field.endTime ||
|
|
332
|
+
(field.location === types_1.SCEventLocationType.ONLINE && !field.link) ||
|
|
333
|
+
(field.location === types_1.SCEventLocationType.PERSON && !field.geolocation) ||
|
|
334
|
+
(field.recurring !== types_1.SCEventRecurrenceType.NEVER && !field.endDate && !field.endTime) ||
|
|
335
|
+
Object.keys(error).length !== 0 ||
|
|
336
|
+
field.name.length > Event_1.EVENT_TITLE_MAX_LENGTH ||
|
|
337
|
+
field.description.length > Event_1.EVENT_DESCRIPTION_MAX_LENGTH, 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" })) })) }))] }))] })));
|
|
338
338
|
}
|
|
339
339
|
exports.default = EventForm;
|