@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
|
@@ -7,29 +7,17 @@ const styles_1 = require("@mui/material/styles");
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
9
|
const system_1 = require("@mui/system");
|
|
10
|
-
const ScrollContainer_1 = tslib_1.__importDefault(require("../../shared/ScrollContainer"));
|
|
11
|
-
const DefaultDrawerContent_1 = tslib_1.__importDefault(require("./DefaultDrawerContent"));
|
|
12
|
-
const DefaultHeaderContent_1 = tslib_1.__importDefault(require("./DefaultHeaderContent"));
|
|
13
10
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
|
+
const NavigationMenuDrawer_1 = tslib_1.__importDefault(require("./NavigationMenuDrawer"));
|
|
14
12
|
const PREFIX = 'SCNavigationMenuIconButton';
|
|
15
13
|
const classes = {
|
|
16
|
-
root: `${PREFIX}-root
|
|
17
|
-
logo: `${PREFIX}-logo`,
|
|
18
|
-
drawerRoot: `${PREFIX}-drawer-root`,
|
|
19
|
-
drawerHeader: `${PREFIX}-drawer-header`,
|
|
20
|
-
drawerHeaderAction: `${PREFIX}-drawer-header-action`,
|
|
21
|
-
drawerContent: `${PREFIX}-drawer-content`
|
|
14
|
+
root: `${PREFIX}-root`
|
|
22
15
|
};
|
|
23
16
|
const Root = (0, styles_1.styled)(material_1.IconButton, {
|
|
24
17
|
name: PREFIX,
|
|
25
18
|
slot: 'Root',
|
|
26
19
|
overridesResolver: (props, styles) => styles.root
|
|
27
20
|
})(({ theme }) => ({}));
|
|
28
|
-
const DrawerRoot = (0, styles_1.styled)(material_1.Drawer, {
|
|
29
|
-
name: PREFIX,
|
|
30
|
-
slot: 'Root',
|
|
31
|
-
overridesResolver: (props, styles) => styles.drawerRoot
|
|
32
|
-
})(({ theme }) => ({}));
|
|
33
21
|
/**
|
|
34
22
|
* > API documentation for the Community-JS Navigation Menu Icon Button component. Learn about the available props and the CSS API.
|
|
35
23
|
|
|
@@ -49,10 +37,6 @@ const DrawerRoot = (0, styles_1.styled)(material_1.Drawer, {
|
|
|
49
37
|
|Rule Name|Global class|Description|
|
|
50
38
|
|---|---|---|
|
|
51
39
|
|root|.SCNavigationMenuIconButton-root|Styles applied to the root element.|
|
|
52
|
-
|drawerRoot|.SCNavigationMenuIconButton-drawer-root|Styles applied to the drawer root element.|
|
|
53
|
-
|drawerHeader|.SCNavigationMenuIconButton-drawer-header|Styles applied to the drawer header.|
|
|
54
|
-
|drawerHeaderAction|.SCNavigationMenuIconButton-drawer-header-action|Styles applied to the drawer header action element.|
|
|
55
|
-
|drawerContent|.SCNavigationMenuIconButton-drawer-content|Styles applied to the drawer content.|
|
|
56
40
|
|
|
57
41
|
* @param inProps
|
|
58
42
|
*/
|
|
@@ -63,7 +47,7 @@ function NavigationMenuIconButton(inProps) {
|
|
|
63
47
|
props: inProps,
|
|
64
48
|
name: PREFIX
|
|
65
49
|
});
|
|
66
|
-
const { className = null, DrawerProps = {
|
|
50
|
+
const { className = null, DrawerProps = {}, onMenuIconClick = null, showDrawer = true } = props, rest = tslib_1.__rest(props, ["className", "DrawerProps", "onMenuIconClick", "showDrawer"]);
|
|
67
51
|
// STATE
|
|
68
52
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
69
53
|
// CONTEXT
|
|
@@ -79,6 +63,6 @@ function NavigationMenuIconButton(inProps) {
|
|
|
79
63
|
if (!preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value && !((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
80
64
|
return null;
|
|
81
65
|
}
|
|
82
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick:
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick: onMenuIconClick !== null && onMenuIconClick !== void 0 ? onMenuIconClick : handleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "menu" }) })), showDrawer && (0, jsx_runtime_1.jsx)(NavigationMenuDrawer_1.default, Object.assign({ open: Boolean(anchorEl), onClose: handleClose }, DrawerProps))] }));
|
|
83
67
|
}
|
|
84
68
|
exports.default = NavigationMenuIconButton;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import NavigationMenuIconButton, { NavigationMenuIconButtonProps } from './NavigationMenuIconButton';
|
|
2
2
|
import DefaultHeaderContent from './DefaultHeaderContent';
|
|
3
3
|
import DefaultDrawerContent from './DefaultDrawerContent';
|
|
4
|
+
import NavigationMenuDrawer, { NavigationMenuDrawerProps } from './NavigationMenuDrawer';
|
|
4
5
|
export default NavigationMenuIconButton;
|
|
5
|
-
export { NavigationMenuIconButtonProps, DefaultDrawerContent as NavigationMenuContent, DefaultHeaderContent as NavigationMenuHeader };
|
|
6
|
+
export { NavigationMenuIconButtonProps, DefaultDrawerContent as NavigationMenuContent, DefaultHeaderContent as NavigationMenuHeader, NavigationMenuDrawer, NavigationMenuDrawerProps };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavigationMenuHeader = exports.NavigationMenuContent = void 0;
|
|
3
|
+
exports.NavigationMenuDrawer = exports.NavigationMenuHeader = exports.NavigationMenuContent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const NavigationMenuIconButton_1 = tslib_1.__importDefault(require("./NavigationMenuIconButton"));
|
|
6
6
|
const DefaultHeaderContent_1 = tslib_1.__importDefault(require("./DefaultHeaderContent"));
|
|
7
7
|
exports.NavigationMenuHeader = DefaultHeaderContent_1.default;
|
|
8
8
|
const DefaultDrawerContent_1 = tslib_1.__importDefault(require("./DefaultDrawerContent"));
|
|
9
9
|
exports.NavigationMenuContent = DefaultDrawerContent_1.default;
|
|
10
|
+
const NavigationMenuDrawer_1 = tslib_1.__importDefault(require("./NavigationMenuDrawer"));
|
|
11
|
+
exports.NavigationMenuDrawer = NavigationMenuDrawer_1.default;
|
|
10
12
|
exports.default = NavigationMenuIconButton_1.default;
|
|
@@ -10,6 +10,9 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
10
10
|
const system_1 = require("@mui/system");
|
|
11
11
|
const react_intl_1 = require("react-intl");
|
|
12
12
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
13
|
+
const Errors_1 = require("../../constants/Errors");
|
|
14
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
15
|
+
const types_1 = require("@selfcommunity/types");
|
|
13
16
|
const PREFIX = 'SCNavigationSettingsIconButton';
|
|
14
17
|
const classes = {
|
|
15
18
|
root: `${PREFIX}-root`,
|
|
@@ -37,7 +40,9 @@ const PREFERENCES = [
|
|
|
37
40
|
react_core_1.SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED,
|
|
38
41
|
react_core_1.SCPreferences.CONFIGURATIONS_POST_TYPE_ENABLED,
|
|
39
42
|
react_core_1.SCPreferences.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED,
|
|
40
|
-
react_core_1.SCPreferences.ADDONS_LOYALTY_POINTS_COLLECTION
|
|
43
|
+
react_core_1.SCPreferences.ADDONS_LOYALTY_POINTS_COLLECTION,
|
|
44
|
+
react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_ENABLED,
|
|
45
|
+
react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_HIDDEN
|
|
41
46
|
];
|
|
42
47
|
/**
|
|
43
48
|
* > API documentation for the Community-JS Navigation Settings Icon Button component. Learn about the available props and the CSS API.
|
|
@@ -74,6 +79,7 @@ function NavigationSettingsIconButton(inProps) {
|
|
|
74
79
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
75
80
|
// MEMO
|
|
76
81
|
const isAdmin = (0, react_1.useMemo)(() => react_core_1.UserUtils.isAdmin(scUserContext.user), [scUserContext.user]);
|
|
82
|
+
const isCommunityCreator = (0, react_1.useMemo)(() => react_core_1.UserUtils.isCommunityCreator(scUserContext.user), [scUserContext.user]);
|
|
77
83
|
const isModerator = (0, react_1.useMemo)(() => react_core_1.UserUtils.isModerator(scUserContext.user), [scUserContext.user]);
|
|
78
84
|
// HOOKS
|
|
79
85
|
const theme = (0, material_1.useTheme)();
|
|
@@ -94,7 +100,7 @@ function NavigationSettingsIconButton(inProps) {
|
|
|
94
100
|
setAnchorEl(null);
|
|
95
101
|
};
|
|
96
102
|
/**
|
|
97
|
-
* Fetches
|
|
103
|
+
* Fetches platform url
|
|
98
104
|
* @param query
|
|
99
105
|
*/
|
|
100
106
|
const fetchPlatform = (query) => {
|
|
@@ -103,6 +109,27 @@ function NavigationSettingsIconButton(inProps) {
|
|
|
103
109
|
window.open(platformUrl, '_blank').focus();
|
|
104
110
|
});
|
|
105
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* Handles preferences update
|
|
114
|
+
*/
|
|
115
|
+
const handlePreferencesUpdate = () => {
|
|
116
|
+
api_services_1.PreferenceService.getAllPreferences().then((preferences) => {
|
|
117
|
+
const prefs = preferences['results'].reduce((obj, p) => (Object.assign(Object.assign({}, obj), { [`${p.section}.${p.name}`]: p })), {});
|
|
118
|
+
scPreferences.setPreferences(prefs);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Updates onBoarding dynamic preference
|
|
123
|
+
*/
|
|
124
|
+
const showOnBoarding = () => {
|
|
125
|
+
api_services_1.PreferenceService.updatePreferences({ [`${types_1.SCPreferenceName.ONBOARDING_HIDDEN}`]: false })
|
|
126
|
+
.then(() => {
|
|
127
|
+
handlePreferencesUpdate();
|
|
128
|
+
})
|
|
129
|
+
.catch((e) => {
|
|
130
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
131
|
+
});
|
|
132
|
+
};
|
|
106
133
|
const handleLogout = () => {
|
|
107
134
|
scUserContext.logout();
|
|
108
135
|
};
|
|
@@ -121,6 +148,9 @@ function NavigationSettingsIconButton(inProps) {
|
|
|
121
148
|
...(isAdmin
|
|
122
149
|
? [
|
|
123
150
|
(0, jsx_runtime_1.jsx)(material_1.Divider, {}, "admin_divider"),
|
|
151
|
+
isCommunityCreator &&
|
|
152
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_ENABLED] &&
|
|
153
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_HIDDEN] && ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ className: classes.item }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ onClick: showOnBoarding }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationSettingsIconButton.onboarding", defaultMessage: "ui.navigationSettingsIconButton.onboarding" }), (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "magic_wand" }) })] })) }), "onboarding")),
|
|
124
154
|
(0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ className: classes.item }, { children: (0, jsx_runtime_1.jsx)(material_1.ListItemButton, Object.assign({ onClick: () => fetchPlatform('') }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationSettingsIconButton.platform", defaultMessage: "ui.navigationSettingsIconButton.platform" }) })) }), "platform")
|
|
125
155
|
]
|
|
126
156
|
: []),
|
|
@@ -149,6 +179,9 @@ function NavigationSettingsIconButton(inProps) {
|
|
|
149
179
|
...(isAdmin
|
|
150
180
|
? [
|
|
151
181
|
(0, jsx_runtime_1.jsx)(material_1.Divider, {}, "platform_divider"),
|
|
182
|
+
isCommunityCreator &&
|
|
183
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_ENABLED] &&
|
|
184
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_HIDDEN] && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.item, onClick: showOnBoarding }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationSettingsIconButton.onboarding", defaultMessage: "ui.navigationSettingsIconButton.onboarding" }), (0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "magic_wand" }) })] }), "onboarding")),
|
|
152
185
|
(0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ className: classes.item, onClick: () => fetchPlatform('') }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.navigationSettingsIconButton.platform", defaultMessage: "ui.navigationSettingsIconButton.platform" }) }), "platform")
|
|
153
186
|
]
|
|
154
187
|
: []),
|
|
@@ -34,6 +34,11 @@ export interface NavigationToolbarProps extends ToolbarProps {
|
|
|
34
34
|
* Component for Navigation Menu Icon Button
|
|
35
35
|
*/
|
|
36
36
|
NavigationMenuIconButtonComponent?: (inProps: NavigationMenuIconButtonProps) => JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* Props to spread to the NavigationMenuIconButtonComponent
|
|
39
|
+
* @default {}
|
|
40
|
+
*/
|
|
41
|
+
NavigationMenuIconButtonComponentProps?: NavigationMenuIconButtonProps;
|
|
37
42
|
/**
|
|
38
43
|
* Component for Navigation Settings
|
|
39
44
|
*/
|
|
@@ -98,7 +98,7 @@ function NavigationToolbar(inProps) {
|
|
|
98
98
|
props: inProps,
|
|
99
99
|
name: constants_1.PREFIX
|
|
100
100
|
});
|
|
101
|
-
const { value = '', className = '', disableSearch = false, disableComposer = false, SearchAutocompleteProps = {}, startActions = null, endActions = null, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton_1.default, NavigationMenuIconButtonComponent = NavigationMenuIconButton_1.default, children = null, NotificationMenuProps = {}, ComposerIconButtonProps = {}, onOpenNotificationMenu, onCloseNotificationMenu } = props, rest = tslib_1.__rest(props, ["value", "className", "disableSearch", "disableComposer", "SearchAutocompleteProps", "startActions", "endActions", "NavigationSettingsIconButtonComponent", "NavigationMenuIconButtonComponent", "children", "NotificationMenuProps", "ComposerIconButtonProps", "onOpenNotificationMenu", "onCloseNotificationMenu"]);
|
|
101
|
+
const { value = '', className = '', disableSearch = false, disableComposer = false, SearchAutocompleteProps = {}, startActions = null, endActions = null, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton_1.default, NavigationMenuIconButtonComponentProps = {}, NavigationMenuIconButtonComponent = NavigationMenuIconButton_1.default, children = null, NotificationMenuProps = {}, ComposerIconButtonProps = {}, onOpenNotificationMenu, onCloseNotificationMenu } = props, rest = tslib_1.__rest(props, ["value", "className", "disableSearch", "disableComposer", "SearchAutocompleteProps", "startActions", "endActions", "NavigationSettingsIconButtonComponent", "NavigationMenuIconButtonComponentProps", "NavigationMenuIconButtonComponent", "children", "NotificationMenuProps", "ComposerIconButtonProps", "onOpenNotificationMenu", "onCloseNotificationMenu"]);
|
|
102
102
|
// CONTEXT
|
|
103
103
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
104
104
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
@@ -144,10 +144,10 @@ function NavigationToolbar(inProps) {
|
|
|
144
144
|
(preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.explore, { [classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {})) }), "aria-label": "Explore", to: scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {}), component: react_core_1.Link }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "explore" }) }))), groupsEnabled && scUserContext.user && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.groups, {
|
|
145
145
|
[classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {})) ||
|
|
146
146
|
value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {}))
|
|
147
|
-
}), "aria-label": "Groups", to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {}), component: react_core_1.Link }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "groups" }) }))), eventsEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.events, {
|
|
147
|
+
}), "aria-label": "Groups", to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_SUBSCRIBED_ROUTE_NAME, {}), component: react_core_1.Link }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "groups" }) }))), eventsEnabled && (scUserContext.user || preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY]) && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.events, {
|
|
148
148
|
[classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}))
|
|
149
149
|
}), "aria-label": "Groups", to: scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, {}), component: react_core_1.Link }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "CalendarIcon" }) })))] })));
|
|
150
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsx)(NavigationMenuIconButtonComponent, {}), (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO], alt: "logo" }) })), !scUserContext.user && !preferences[react_core_1.SCPreferences.ADDONS_CLOSED_COMMUNITY] && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "inherit", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.SIGNUP_ROUTE_NAME, {}), className: classes.register }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.appBar.navigation.register", defaultMessage: "ui.appBar.navigation.register" }) }))), preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED] && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) })) }))) : ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) }))) })), _children, (preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch ? ((0, jsx_runtime_1.jsx)(SearchAutocomplete_1.default, Object.assign({ className: classes.search, blurOnSelect: true }, SearchAutocompleteProps))) : ((0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.search })), startActions, scUserContext.user ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showComposer && (0, jsx_runtime_1.jsx)(ComposerIconButton_1.default, Object.assign({ className: classes.composer }, ComposerIconButtonProps)), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: scUserContext.user.username }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, scUserContext.user), "aria-label": "Profile", className: classes.profile }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: scUserContext.user.username, src: scUserContext.user.avatar }) })) })), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.notification, {
|
|
150
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [(0, jsx_runtime_1.jsx)(NavigationMenuIconButtonComponent, Object.assign({}, NavigationMenuIconButtonComponentProps)), (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO], alt: "logo" }) })), !scUserContext.user && !preferences[react_core_1.SCPreferences.ADDONS_CLOSED_COMMUNITY] && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "inherit", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.SIGNUP_ROUTE_NAME, {}), className: classes.register }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.appBar.navigation.register", defaultMessage: "ui.appBar.navigation.register" }) }))), preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED] && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_TEXT] }, { children: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) })) }))) : ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL], className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE], alt: "custom_item" }) }))) })), _children, (preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch ? ((0, jsx_runtime_1.jsx)(SearchAutocomplete_1.default, Object.assign({ className: classes.search, blurOnSelect: true }, SearchAutocompleteProps))) : ((0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.search })), startActions, scUserContext.user ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showComposer && (0, jsx_runtime_1.jsx)(ComposerIconButton_1.default, Object.assign({ className: classes.composer }, ComposerIconButtonProps)), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: scUserContext.user.username }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, scUserContext.user), "aria-label": "Profile", className: classes.profile }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: scUserContext.user.username, src: scUserContext.user.avatar }) })) })), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.notification, {
|
|
151
151
|
[classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}))
|
|
152
152
|
}), "aria-label": "Notification", onClick: handleOpenNotificationMenu }, { children: (0, jsx_runtime_1.jsx)(material_1.Badge, Object.assign({ badgeContent: scUserContext.user.unseen_notification_banners_counter + scUserContext.user.unseen_interactions_counter, color: "secondary" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "notifications_active" }) })) })), (0, jsx_runtime_1.jsx)(NotificationMenu_1.default, Object.assign({ className: classes.notificationsMenu, id: "notification-menu", anchorEl: anchorNotification, open: Boolean(anchorNotification), onClose: handleCloseNotificationMenu, onClick: handleCloseNotificationMenu, transformOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'bottom' } }, NotificationMenuProps))] }), privateMessagingEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: (0, classnames_1.default)(classes.messages, {
|
|
153
153
|
[classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, {}))
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
export interface OnBoardingActionsButtonProps extends IconButtonProps {
|
|
3
|
+
isExpanded: boolean;
|
|
4
|
+
onExpandChange: () => void;
|
|
5
|
+
onHideOnBoarding: () => void;
|
|
6
|
+
}
|
|
7
|
+
export default function OnBoardingActionsButton(inProps: OnBoardingActionsButtonProps): JSX.Element;
|
|
@@ -0,0 +1,84 @@
|
|
|
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 classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
|
+
const system_1 = require("@mui/system");
|
|
10
|
+
const react_intl_1 = require("react-intl");
|
|
11
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
12
|
+
const Errors_1 = require("../../constants/Errors");
|
|
13
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
14
|
+
const types_1 = require("@selfcommunity/types");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const classes = {
|
|
17
|
+
root: `${constants_1.PREFIX}-actions-button-root`,
|
|
18
|
+
drawerRoot: `${constants_1.PREFIX}-actions-drawer-root`,
|
|
19
|
+
menuRoot: `${constants_1.PREFIX}-actions-menu-root`,
|
|
20
|
+
paper: `${constants_1.PREFIX}-actions-paper`,
|
|
21
|
+
item: `${constants_1.PREFIX}-actions-item`
|
|
22
|
+
};
|
|
23
|
+
const Root = (0, styles_1.styled)(material_1.IconButton, {
|
|
24
|
+
name: constants_1.PREFIX,
|
|
25
|
+
slot: 'Root',
|
|
26
|
+
overridesResolver: (props, styles) => styles.root
|
|
27
|
+
})(() => ({}));
|
|
28
|
+
const SwipeableDrawerRoot = (0, styles_1.styled)(material_1.SwipeableDrawer, {
|
|
29
|
+
name: constants_1.PREFIX,
|
|
30
|
+
slot: 'Root',
|
|
31
|
+
overridesResolver: (props, styles) => styles.drawerRoot
|
|
32
|
+
})(() => ({}));
|
|
33
|
+
const MenuRoot = (0, styles_1.styled)(material_1.Menu, {
|
|
34
|
+
name: constants_1.PREFIX,
|
|
35
|
+
slot: 'Root',
|
|
36
|
+
overridesResolver: (props, styles) => styles.menuRoot
|
|
37
|
+
})(() => ({}));
|
|
38
|
+
function OnBoardingActionsButton(inProps) {
|
|
39
|
+
// PROPS
|
|
40
|
+
const props = (0, system_1.useThemeProps)({
|
|
41
|
+
props: inProps,
|
|
42
|
+
name: constants_1.PREFIX
|
|
43
|
+
});
|
|
44
|
+
const { className = null, isExpanded, onExpandChange, onHideOnBoarding } = props, rest = tslib_1.__rest(props, ["className", "isExpanded", "onExpandChange", "onHideOnBoarding"]);
|
|
45
|
+
// STATE
|
|
46
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
47
|
+
const theme = (0, material_1.useTheme)();
|
|
48
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
49
|
+
// HANDLERS
|
|
50
|
+
const handleOpen = (event) => {
|
|
51
|
+
setAnchorEl(event.currentTarget);
|
|
52
|
+
};
|
|
53
|
+
const handleClose = () => {
|
|
54
|
+
setAnchorEl(null);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Updates onBoarding dynamic preference
|
|
58
|
+
*/
|
|
59
|
+
const hideOnBoarding = () => {
|
|
60
|
+
api_services_1.PreferenceService.updatePreferences({ [`${types_1.SCPreferenceName.ONBOARDING_HIDDEN}`]: true })
|
|
61
|
+
.then(() => {
|
|
62
|
+
onHideOnBoarding();
|
|
63
|
+
})
|
|
64
|
+
.catch((e) => {
|
|
65
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const renderList = () => {
|
|
69
|
+
if (isMobile) {
|
|
70
|
+
return [
|
|
71
|
+
isExpanded ? ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ className: classes.item }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ onClick: onExpandChange }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "expand_less" }) }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.actionsMenu.view.less", defaultMessage: "ui.onBoardingWidget.actionsMenu.view.less" })] })) }), "expand_less")) : ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ className: classes.item }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ onClick: onExpandChange }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "expand_more" }) }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.actionsMenu.view.more", defaultMessage: "ui.onBoardingWidget.actionsMenu.view.more" })] })) }), "expand_more")),
|
|
72
|
+
(0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ className: classes.item }, { children: (0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ onClick: hideOnBoarding }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.actionsMenu.close", defaultMessage: "ui.onBoardingWidget.actionsMenu.close" })] })) }), "close")
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return [
|
|
77
|
+
isExpanded ? ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.item, onClick: onExpandChange }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "expand_less" }) }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.actionsMenu.view.less", defaultMessage: "ui.onBoardingWidget.actionsMenu.view.less" })] }), "expand_less")) : ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.item, onClick: onExpandChange }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "expand_more" }) }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.actionsMenu.view.more", defaultMessage: "ui.onBoardingWidget.actionsMenu.view.more" })] }), "expand_more")),
|
|
78
|
+
(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.item, onClick: hideOnBoarding }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.actionsMenu.close", defaultMessage: "ui.onBoardingWidget.actionsMenu.close" })] }), "close")
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "more_vert" }) })), isMobile ? ((0, jsx_runtime_1.jsx)(SwipeableDrawerRoot, Object.assign({ onClick: () => setAnchorEl(null), className: classes.drawerRoot, anchor: "bottom", open: Boolean(anchorEl), onClose: handleClose, onOpen: handleOpen, PaperProps: { className: classes.paper }, disableSwipeToOpen: true }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: renderList() }) }))) : ((0, jsx_runtime_1.jsx)(MenuRoot, Object.assign({ onClick: () => setAnchorEl(null), className: classes.menuRoot, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, PaperProps: { className: classes.paper } }, { children: renderList() })))] }));
|
|
83
|
+
}
|
|
84
|
+
exports.default = OnBoardingActionsButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StartStepParams } from '@selfcommunity/api-services';
|
|
2
|
-
import { SCFeedObjectType } from '@selfcommunity/types';
|
|
2
|
+
import { SCFeedObjectType, SCOnBoardingStepType } from '@selfcommunity/types';
|
|
3
3
|
import { VirtualScrollerItemProps } from '../../types/virtualScroller';
|
|
4
4
|
export interface OnBoardingWidgetProps extends VirtualScrollerItemProps {
|
|
5
5
|
/**
|
|
@@ -23,6 +23,10 @@ export interface OnBoardingWidgetProps extends VirtualScrollerItemProps {
|
|
|
23
23
|
* @default false
|
|
24
24
|
*/
|
|
25
25
|
forceExpanded?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The initial step to display
|
|
28
|
+
*/
|
|
29
|
+
initialStep?: SCOnBoardingStepType;
|
|
26
30
|
}
|
|
27
31
|
declare const OnBoardingWidget: (inProps: OnBoardingWidgetProps) => JSX.Element;
|
|
28
32
|
export default OnBoardingWidget;
|
|
@@ -24,9 +24,11 @@ const utils_1 = require("@selfcommunity/utils");
|
|
|
24
24
|
const types_1 = require("@selfcommunity/types");
|
|
25
25
|
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
26
26
|
const notistack_1 = require("notistack");
|
|
27
|
-
const constants_2 = require("../PlatformWidget/constants");
|
|
28
27
|
const header_1 = tslib_1.__importDefault(require("../../assets/onBoarding/header"));
|
|
29
28
|
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
29
|
+
const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
|
|
30
|
+
const PubSub_1 = require("../../constants/PubSub");
|
|
31
|
+
const ActionsButton_1 = tslib_1.__importDefault(require("./ActionsButton"));
|
|
30
32
|
const classes = {
|
|
31
33
|
root: `${constants_1.PREFIX}-root`,
|
|
32
34
|
content: `${constants_1.PREFIX}-content`,
|
|
@@ -35,7 +37,9 @@ const classes = {
|
|
|
35
37
|
intro: `${constants_1.PREFIX}-intro`,
|
|
36
38
|
steps: `${constants_1.PREFIX}-steps`,
|
|
37
39
|
stepsMobile: `${constants_1.PREFIX}-steps-mobile`,
|
|
38
|
-
stepContent: `${constants_1.PREFIX}-step-content
|
|
40
|
+
stepContent: `${constants_1.PREFIX}-step-content`,
|
|
41
|
+
dialogRoot: `${constants_1.PREFIX}-dialog-root`,
|
|
42
|
+
dialogContent: `${constants_1.PREFIX}-dialog-content`
|
|
39
43
|
};
|
|
40
44
|
const Root = (0, styles_1.styled)(Widget_1.default, {
|
|
41
45
|
name: constants_1.PREFIX,
|
|
@@ -47,19 +51,24 @@ const AccordionRoot = (0, styles_1.styled)(material_1.Accordion, {
|
|
|
47
51
|
slot: 'AccordionRoot',
|
|
48
52
|
overridesResolver: (props, styles) => styles.accordionRoot
|
|
49
53
|
})(() => ({}));
|
|
54
|
+
const DialogRoot = (0, styles_1.styled)(BaseDialog_1.default, {
|
|
55
|
+
name: constants_1.PREFIX,
|
|
56
|
+
slot: 'Root',
|
|
57
|
+
overridesResolver: (props, styles) => styles.dialogRoot
|
|
58
|
+
})(({ theme }) => ({}));
|
|
50
59
|
const OnBoardingWidget = (inProps) => {
|
|
51
60
|
// PROPS
|
|
52
61
|
const props = (0, system_1.useThemeProps)({
|
|
53
62
|
props: inProps,
|
|
54
63
|
name: constants_1.PREFIX
|
|
55
64
|
});
|
|
56
|
-
const { className, GenerateContentsParams = {}, onGeneratedContent = null, onHeightChange, onStateChange, forceExpanded = false } = props, rest = tslib_1.__rest(props, ["className", "GenerateContentsParams", "onGeneratedContent", "onHeightChange", "onStateChange", "forceExpanded"]);
|
|
65
|
+
const { className, GenerateContentsParams = {}, onGeneratedContent = null, onHeightChange, onStateChange, forceExpanded = false, initialStep } = props, rest = tslib_1.__rest(props, ["className", "GenerateContentsParams", "onGeneratedContent", "onHeightChange", "onStateChange", "forceExpanded", "initialStep"]);
|
|
57
66
|
// STATE
|
|
58
67
|
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
59
68
|
const [initialized, setInitialized] = (0, react_1.useState)(false);
|
|
60
69
|
const [steps, setSteps] = (0, react_1.useState)([]);
|
|
61
70
|
const nextStep = (0, react_1.useMemo)(() => {
|
|
62
|
-
const step = steps === null || steps === void 0 ? void 0 : steps.find((step) => step.status === 'in_progress' || step.status === 'not_started');
|
|
71
|
+
const step = steps === null || steps === void 0 ? void 0 : steps.find((step) => (initialStep ? step.step === initialStep : step.status === 'in_progress' || step.status === 'not_started'));
|
|
63
72
|
return step || (steps === null || steps === void 0 ? void 0 : steps[0]);
|
|
64
73
|
}, [steps]);
|
|
65
74
|
const allStepsDone = (0, react_1.useMemo)(() => {
|
|
@@ -71,7 +80,9 @@ const OnBoardingWidget = (inProps) => {
|
|
|
71
80
|
const prevContentsStep = (0, react_core_1.usePreviousValue)(currentContentsStep);
|
|
72
81
|
const currentCategoriesStep = steps === null || steps === void 0 ? void 0 : steps.find((s) => s.step === types_1.SCOnBoardingStepType.CATEGORIES);
|
|
73
82
|
const prevCategoriesStep = (0, react_core_1.usePreviousValue)(currentCategoriesStep);
|
|
74
|
-
const [
|
|
83
|
+
const [showNoCategoriesModal, setShowNoCategoriesModal] = (0, react_1.useState)(false);
|
|
84
|
+
const [showCategoriesWarningModal, setShowWarningCategoriesModal] = (0, react_1.useState)(false);
|
|
85
|
+
const [isGenerating, setIsGenerating] = (0, react_1.useState)(false);
|
|
75
86
|
// CONTEXT
|
|
76
87
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
77
88
|
const isAdmin = (0, react_1.useMemo)(() => react_core_1.UserUtils.isCommunityCreator(scUserContext.user), [scUserContext.user]);
|
|
@@ -79,8 +90,11 @@ const OnBoardingWidget = (inProps) => {
|
|
|
79
90
|
const scPreferencesContext = (0, react_core_1.useSCPreferences)();
|
|
80
91
|
const scThemeContext = (0, react_core_1.useSCTheme)();
|
|
81
92
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
82
|
-
const
|
|
83
|
-
|
|
93
|
+
const showOnBoarding = (0, react_1.useMemo)(() => scPreferencesContext.preferences &&
|
|
94
|
+
react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_ENABLED in scPreferencesContext.preferences &&
|
|
95
|
+
react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_HIDDEN in scPreferencesContext.preferences &&
|
|
96
|
+
scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_ENABLED].value &&
|
|
97
|
+
!scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_ONBOARDING_HIDDEN].value, [scPreferencesContext.preferences]);
|
|
84
98
|
// HOOKS
|
|
85
99
|
const theme = (0, material_1.useTheme)();
|
|
86
100
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
@@ -112,10 +126,30 @@ const OnBoardingWidget = (inProps) => {
|
|
|
112
126
|
}
|
|
113
127
|
s.step === types_1.SCOnBoardingStepType.APPEARANCE && handlePreferencesUpdate();
|
|
114
128
|
});
|
|
129
|
+
/**
|
|
130
|
+
* Fetches platform url
|
|
131
|
+
*/
|
|
132
|
+
function fetchPlatform(query) {
|
|
133
|
+
api_services_1.http
|
|
134
|
+
.request({
|
|
135
|
+
url: api_services_1.Endpoints.Platform.url(),
|
|
136
|
+
method: api_services_1.Endpoints.Platform.method,
|
|
137
|
+
params: {
|
|
138
|
+
next: query
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
.then((res) => {
|
|
142
|
+
const platformUrl = res.data.platform_url;
|
|
143
|
+
window.open(platformUrl, '_blank').focus();
|
|
144
|
+
})
|
|
145
|
+
.catch((error) => {
|
|
146
|
+
console.log(error);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
115
149
|
const showSuccessAlert = (step) => {
|
|
116
150
|
setIsGenerating(false);
|
|
117
151
|
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.onBoardingWidget.step.${step.step}.success`, defaultMessage: `ui.onBoardingWidget.step.${step.step}.success` }), {
|
|
118
|
-
action: (snackbarId) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [step.step === types_1.SCOnBoardingStepType.CATEGORIES && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ sx: { textTransform: 'uppercase', color: 'white' }, size: "small", variant: "text",
|
|
152
|
+
action: (snackbarId) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [step.step === types_1.SCOnBoardingStepType.CATEGORIES && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ sx: { textTransform: 'uppercase', color: 'white' }, size: "small", variant: "text", onClick: () => fetchPlatform('/contents/interests/') }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.step.categories.success.link", defaultMessage: "ui.onBoardingWidget.step.categories.success.link" }) }))), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ sx: { color: 'white' }, onClick: () => (0, notistack_1.closeSnackbar)(snackbarId) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }))] })),
|
|
119
153
|
variant: 'success',
|
|
120
154
|
autoHideDuration: 7000
|
|
121
155
|
});
|
|
@@ -146,19 +180,26 @@ const OnBoardingWidget = (inProps) => {
|
|
|
146
180
|
};
|
|
147
181
|
const generateContent = (stepId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
148
182
|
if (!isLoading && !categories.length) {
|
|
149
|
-
|
|
183
|
+
setShowNoCategoriesModal(true);
|
|
184
|
+
}
|
|
185
|
+
else if (stepId === types_1.SCOnBoardingStepIdType.CATEGORIES) {
|
|
186
|
+
setShowWarningCategoriesModal(true);
|
|
150
187
|
}
|
|
151
188
|
else {
|
|
152
|
-
yield
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
189
|
+
yield startStep(stepId);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
const startStep = (stepId) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
193
|
+
showCategoriesWarningModal && setShowWarningCategoriesModal(false);
|
|
194
|
+
try {
|
|
195
|
+
yield api_services_1.OnBoardingService.startAStep(stepId, GenerateContentsParams);
|
|
196
|
+
setIsGenerating(true);
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
200
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
201
|
+
variant: 'error',
|
|
202
|
+
autoHideDuration: 3000
|
|
162
203
|
});
|
|
163
204
|
}
|
|
164
205
|
});
|
|
@@ -169,6 +210,17 @@ const OnBoardingWidget = (inProps) => {
|
|
|
169
210
|
scThemeContext.setTheme((0, react_core_1.getTheme)(scContext.settings.theme, prefs));
|
|
170
211
|
});
|
|
171
212
|
};
|
|
213
|
+
const handleCategoriesClick = () => {
|
|
214
|
+
fetchPlatform('/contents/interests/');
|
|
215
|
+
setShowNoCategoriesModal(false);
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Notify when a category info changes
|
|
219
|
+
* @param data
|
|
220
|
+
*/
|
|
221
|
+
function notifyCategoryChanges(data) {
|
|
222
|
+
data && pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.CATEGORY}.${PubSub_1.SCCategoryEventType.EDIT}`, data);
|
|
223
|
+
}
|
|
172
224
|
// EFFECTS
|
|
173
225
|
(0, react_1.useEffect)(() => {
|
|
174
226
|
if (prevContentsStep &&
|
|
@@ -204,6 +256,22 @@ const OnBoardingWidget = (inProps) => {
|
|
|
204
256
|
return () => clearInterval(intervalId);
|
|
205
257
|
}
|
|
206
258
|
}, [scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user, isGenerating, isAdmin]);
|
|
259
|
+
/**
|
|
260
|
+
* updates categories info when generating category content
|
|
261
|
+
*/
|
|
262
|
+
(0, react_1.useEffect)(() => {
|
|
263
|
+
const categoryStep = steps.find((step) => step.step === types_1.SCOnBoardingStepType.CATEGORIES);
|
|
264
|
+
if ((categoryStep === null || categoryStep === void 0 ? void 0 : categoryStep.status) === types_1.SCOnBoardingStepStatusType.IN_PROGRESS && categoryStep.results.length !== 0) {
|
|
265
|
+
categoryStep.results.forEach((c) => {
|
|
266
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
267
|
+
// @ts-ignore
|
|
268
|
+
const isAlreadyNotified = prevCategoriesStep === null || prevCategoriesStep === void 0 ? void 0 : prevCategoriesStep.results.some((result) => result.id === c.id);
|
|
269
|
+
if (!isAlreadyNotified) {
|
|
270
|
+
notifyCategoryChanges(c);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}, [steps, prevCategoriesStep]);
|
|
207
275
|
/**
|
|
208
276
|
* Render _step content section
|
|
209
277
|
*/
|
|
@@ -234,10 +302,10 @@ const OnBoardingWidget = (inProps) => {
|
|
|
234
302
|
}
|
|
235
303
|
return content;
|
|
236
304
|
};
|
|
237
|
-
if (!isAdmin) {
|
|
305
|
+
if (!isAdmin || !showOnBoarding) {
|
|
238
306
|
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
239
307
|
}
|
|
240
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(AccordionRoot, Object.assign({ defaultExpanded: true,
|
|
308
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(AccordionRoot, Object.assign({ defaultExpanded: true, className: classes.accordionRoot, expanded: expanded }, { children: [(0, jsx_runtime_1.jsx)(material_1.AccordionSummary, Object.assign({ expandIcon: (0, jsx_runtime_1.jsx)(ActionsButton_1.default, { isExpanded: expanded, onExpandChange: handleExpand, onHideOnBoarding: handlePreferencesUpdate }), "aria-controls": "accordion", id: "onBoarding-accordion" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: expanded ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isMobile ? ((0, jsx_runtime_1.jsx)(material_1.CardMedia, { className: classes.logo, component: "img", src: header_1.default })) : ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "h4" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ color: "secondary", fontSize: "medium" }, { children: "ai_stars" })), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.accordion.expanded.title.mobile", defaultMessage: "ui.onBoardingWidget.accordion.expanded.title.mobile", values: {
|
|
241
309
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
242
310
|
// @ts-ignore
|
|
243
311
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks })
|
|
@@ -254,7 +322,12 @@ const OnBoardingWidget = (inProps) => {
|
|
|
254
322
|
b: (chunks) => (0, jsx_runtime_1.jsx)("strong", { children: chunks }),
|
|
255
323
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
256
324
|
// @ts-ignore
|
|
257
|
-
|
|
258
|
-
|
|
325
|
+
// eslint-disable-next-line prettier/prettier
|
|
326
|
+
icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ color: "secondary", fontSize: "medium" }, { children: chunks }))
|
|
327
|
+
} }) }))) }) })), (0, jsx_runtime_1.jsx)(material_1.AccordionDetails, { children: (0, jsx_runtime_1.jsx)(Widget_1.default, Object.assign({ className: classes.content, elevation: 0 }, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ className: isMobile ? classes.stepsMobile : classes.steps }, { children: steps === null || steps === void 0 ? void 0 : steps.map((step) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", label: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.onBoardingWidget.${step.step}`, defaultMessage: `ui.onBoardingWidget.${step.step}` }), ' ', step.status === types_1.SCOnBoardingStepStatusType.COMPLETED && ((0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ color: (step === null || step === void 0 ? void 0 : step.status) === types_1.SCOnBoardingStepStatusType.COMPLETED && (step === null || step === void 0 ? void 0 : step.step) !== (_step === null || _step === void 0 ? void 0 : _step.step) ? 'success' : 'inherit' }, { children: "check" })))] }), onClick: () => handleChange(step), variant: step.step === (_step === null || _step === void 0 ? void 0 : _step.step) ? 'filled' : 'outlined', color: step.status === types_1.SCOnBoardingStepStatusType.COMPLETED ? 'success' : 'default' })) : ((0, jsx_runtime_1.jsxs)(material_1.ListItemButton, Object.assign({ onClick: () => handleChange(step), selected: (step === null || step === void 0 ? void 0 : step.step) === (_step === null || _step === void 0 ? void 0 : _step.step) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { edge: "start", checked: step.status === types_1.SCOnBoardingStepStatusType.COMPLETED, tabIndex: -1, disableRipple: true, inputProps: { 'aria-labelledby': step.step }, size: 'small' }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.onBoardingWidget.${step.step}`, defaultMessage: `ui.onBoardingWidget.${step.step}` }) })] }))) }, step.id))) })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.stepContent }, { children: [(0, jsx_runtime_1.jsx)(material_1.Fade, Object.assign({ in: true, timeout: 2400 }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { children: getStepContent() }) })), showNoCategoriesModal && ((0, jsx_runtime_1.jsx)(BaseDialog_1.default, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.no.categories", defaultMessage: "ui.onBoardingWidget.ai.no.categories" }), DialogContentProps: { dividers: false }, open: showNoCategoriesModal, onClose: () => setShowNoCategoriesModal(false), actions: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", onClick: () => setShowNoCategoriesModal(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.no.categories.cancel", defaultMessage: "ui.onBoardingWidget.ai.no.categories.cancel" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "primary", onClick: handleCategoriesClick, startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "edit" })) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.no.categories.link", defaultMessage: "ui.onBoardingWidget.ai.no.categories.link" }) })) }))), showCategoriesWarningModal && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.categories.warning.title", defaultMessage: "ui.onBoardingWidget.ai.categories.warning.title" }), DialogContentProps: { dividers: false }, open: showCategoriesWarningModal, onClose: () => setShowWarningCategoriesModal(false), actions: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", color: "primary", onClick: () => setShowWarningCategoriesModal(false) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.categories.warning.button.close", defaultMessage: "ui.onBoardingWidget.ai.categories.warning.button.close" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "contained", color: "secondary", onClick: () => startStep(types_1.SCOnBoardingStepIdType.CATEGORIES), endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "magic_wand" })) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.categories.warning.button.generate", defaultMessage: "ui.onBoardingWidget.ai.categories.warning.button.generate" }) }))] }) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.dialogContent }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.categories.warning.info", defaultMessage: "ui.onBoardingWidget.ai.categories.warning.info" }), (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.onBoardingWidget.ai.categories.warning.confirm", defaultMessage: "ui.onBoardingWidget.ai.categories.warning.confirm", values: {
|
|
328
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
329
|
+
// @ts-ignore
|
|
330
|
+
b: (chunks) => (0, jsx_runtime_1.jsx)("b", { children: chunks })
|
|
331
|
+
} })] })) })))] }))] })) })) })] })) })));
|
|
259
332
|
};
|
|
260
333
|
exports.default = OnBoardingWidget;
|