@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
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const chunked_uploady_1 = require("@rpldy/chunked-uploady");
|
|
5
|
+
const uploady_1 = require("@rpldy/uploady");
|
|
5
6
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
6
7
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
7
|
-
const
|
|
8
|
-
const hash_1 = require("../../utils/hash");
|
|
8
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
9
9
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
10
10
|
const react_intl_1 = require("react-intl");
|
|
11
|
-
const common_1 = tslib_1.__importDefault(require("../../messages/common"));
|
|
12
|
-
const utils_1 = require("@selfcommunity/utils");
|
|
13
11
|
const Errors_1 = require("../../constants/Errors");
|
|
12
|
+
const common_1 = tslib_1.__importDefault(require("../../messages/common"));
|
|
13
|
+
const hash_1 = require("../../utils/hash");
|
|
14
14
|
exports.default = (props) => {
|
|
15
15
|
// PROPS
|
|
16
16
|
const { type = null, onSuccess = null, onProgress = null, onError = null } = props;
|
|
@@ -55,7 +55,7 @@ exports.default = (props) => {
|
|
|
55
55
|
// @ts-ignore
|
|
56
56
|
reader.readAsDataURL(item.file);
|
|
57
57
|
}
|
|
58
|
-
chunkStateRef.current.setChunk({ id: item.id, [
|
|
58
|
+
chunkStateRef.current.setChunk({ id: item.id, ['upload_id']: null, completed: 0, name: item.file.name });
|
|
59
59
|
});
|
|
60
60
|
(0, uploady_1.useItemProgressListener)((item) => {
|
|
61
61
|
chunkStateRef.current.setChunk({ id: item.id, completed: item.completed });
|
|
@@ -102,7 +102,7 @@ exports.default = (props) => {
|
|
|
102
102
|
sendOptions: {
|
|
103
103
|
paramName: 'image',
|
|
104
104
|
method: api_services_1.Endpoints.ComposerChunkUploadMedia.method,
|
|
105
|
-
formatServerResponse: (response, status,
|
|
105
|
+
formatServerResponse: (response, status, _headers) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
106
106
|
if (status === 401) {
|
|
107
107
|
yield refreshSession();
|
|
108
108
|
}
|
|
@@ -111,7 +111,7 @@ exports.default = (props) => {
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
if (chunkStateRef.current.chunks[data.item.id].upload_id) {
|
|
114
|
-
res.sendOptions.params = { [
|
|
114
|
+
res.sendOptions.params = { ['upload_id']: chunkStateRef.current.chunks[data.item.id].upload_id };
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
117
117
|
chunkStateRef.current.setChunk({ id: data.item.id, type: type || data.sendOptions.paramName });
|
|
@@ -120,12 +120,14 @@ exports.default = (props) => {
|
|
|
120
120
|
});
|
|
121
121
|
(0, chunked_uploady_1.useChunkFinishListener)((data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
122
122
|
const _data = yield data.uploadData.response.data;
|
|
123
|
-
chunkStateRef.current.setChunk({ id: data.item.id, [
|
|
123
|
+
chunkStateRef.current.setChunk({ id: data.item.id, ['upload_id']: _data.upload_id });
|
|
124
124
|
}));
|
|
125
125
|
(0, chunked_uploady_1.useRequestPreSend)(({ items, options }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
-
const destination = ['JWT', 'OAuth'].includes(scContext.settings.session.type)
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
const destination = ['JWT', 'OAuth'].includes(scContext.settings.session.type)
|
|
127
|
+
? {
|
|
128
|
+
headers: { Authorization: `Bearer ${scContext.settings.session.authToken.accessToken}` }
|
|
129
|
+
}
|
|
130
|
+
: {};
|
|
129
131
|
if (items.length == 0) {
|
|
130
132
|
return Promise.resolve({ options, destination });
|
|
131
133
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextFieldProps } from '@mui/material';
|
|
2
2
|
import { SCMetadataType } from '@selfcommunity/types';
|
|
3
|
-
export
|
|
3
|
+
export type MetadataFieldProps = TextFieldProps & {
|
|
4
4
|
metadata: SCMetadataType;
|
|
5
5
|
};
|
|
6
6
|
declare const MetadataField: (props: MetadataFieldProps) => JSX.Element;
|
|
@@ -32,18 +32,18 @@ import React from 'react';
|
|
|
32
32
|
/**
|
|
33
33
|
* Types/interfaces
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
35
|
+
export type UseStickyBoxProps = {
|
|
36
36
|
offsetTop?: number;
|
|
37
37
|
offsetBottom?: number;
|
|
38
38
|
bottom?: boolean;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type StickyBoxProps = UseStickyBoxProps & {
|
|
41
41
|
style?: React.CSSProperties;
|
|
42
42
|
className?: string;
|
|
43
43
|
children?: React.ReactNode;
|
|
44
44
|
};
|
|
45
|
-
export
|
|
46
|
-
export
|
|
45
|
+
export type useStickyBox = <T = any>(options?: UseStickyBoxProps) => React.RefCallback<T>;
|
|
46
|
+
export type StickyBoxComponent = React.FunctionComponent<StickyBoxProps>;
|
|
47
47
|
/**
|
|
48
48
|
* useStickyBox
|
|
49
49
|
* @param offsetTop
|
|
@@ -10,6 +10,6 @@ export interface ComposerLayerProps {
|
|
|
10
10
|
onSave: (value: any) => void;
|
|
11
11
|
defaultValue: any;
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export type ComposerContentType = Omit<SCFeedPostType, 'id' | 'last_activity_at' | 'added_at' | 'slug' | 'summary' | 'deleted' | 'collapsed' | 'comment_count' | 'share_count' | 'view_count' | 'vote_count' | 'follower_count' | 'reaction' | 'reactions_count' | 'flag_count' | 'type'> & {
|
|
14
14
|
title?: string;
|
|
15
15
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkEventFinished = void 0;
|
|
4
|
+
function checkEventFinished(event) {
|
|
5
|
+
if (event && !event.running) {
|
|
6
|
+
return new Date().getTime() > new Date(event.end_date || event.start_date).getTime();
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
exports.checkEventFinished = checkEventFinished;
|
package/lib/cjs/utils/hash.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { BatchFile } from '@rpldy/shared';
|
|
2
|
+
export declare const md5: (file: BatchFile['file'], chunkSize: number, callback: (arg: any) => void) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.randomString = exports.generateRoomId = exports.decodePassphrase = exports.encodePassphrase = void 0;
|
|
4
|
+
function encodePassphrase(passphrase) {
|
|
5
|
+
return encodeURIComponent(passphrase);
|
|
6
|
+
}
|
|
7
|
+
exports.encodePassphrase = encodePassphrase;
|
|
8
|
+
function decodePassphrase(base64String) {
|
|
9
|
+
return decodeURIComponent(base64String);
|
|
10
|
+
}
|
|
11
|
+
exports.decodePassphrase = decodePassphrase;
|
|
12
|
+
function generateRoomId() {
|
|
13
|
+
return `${randomString(4)}-${randomString(4)}`;
|
|
14
|
+
}
|
|
15
|
+
exports.generateRoomId = generateRoomId;
|
|
16
|
+
function randomString(length) {
|
|
17
|
+
let result = '';
|
|
18
|
+
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
19
|
+
const charactersLength = characters.length;
|
|
20
|
+
for (let i = 0; i < length; i++) {
|
|
21
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
exports.randomString = randomString;
|
package/lib/cjs/utils/widget.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.actionWidgetTypes = {
|
|
|
18
18
|
LOAD_PREVIOUS_FAILURE: '_load_previous_failure',
|
|
19
19
|
SET_RESULTS: '_set_results',
|
|
20
20
|
SET_VISIBLE_ITEMS: '_set_visible_items',
|
|
21
|
+
INITIALIZE: '_initialize',
|
|
21
22
|
RESET: '_reset'
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
@@ -56,6 +57,19 @@ function dataWidgetReducer(state, action) {
|
|
|
56
57
|
case exports.actionWidgetTypes.RESET:
|
|
57
58
|
_state = { isLoadingNext: false, next: null, results: [], count: 0, errorLoadNext: null, initialized: false };
|
|
58
59
|
break;
|
|
60
|
+
case exports.actionWidgetTypes.INITIALIZE:
|
|
61
|
+
_state = {
|
|
62
|
+
cacheKey: action.payload.cacheKey ? action.payload.cacheKey : null,
|
|
63
|
+
count: action.payload.count ? action.payload.count : 0,
|
|
64
|
+
results: action.payload.results ? action.payload.results : [],
|
|
65
|
+
next: action.payload.next ? action.payload.next : null,
|
|
66
|
+
previous: action.payload.previous ? action.payload.previous : null,
|
|
67
|
+
isLoadingNext: action.payload.isLoadingNext ? action.payload.isLoadingNext : false,
|
|
68
|
+
isLoadingPrevious: action.payload.isLoadingPrevious ? action.payload.isLoadingPrevious : false,
|
|
69
|
+
visibleItems: action.payload.visibleItems ? action.payload.visibleItems : null,
|
|
70
|
+
initialized: false
|
|
71
|
+
};
|
|
72
|
+
break;
|
|
59
73
|
}
|
|
60
74
|
utils_1.LRUCache.set(_state.cacheKey, _state);
|
|
61
75
|
return _state;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BottomNavigationProps as MuiBottomNavigationProps } from '@mui/material';
|
|
2
|
-
export
|
|
2
|
+
export type BottomNavigationProps = MuiBottomNavigationProps;
|
|
3
3
|
/**
|
|
4
4
|
* > API documentation for the Community-JS Bottom Navigation component. Learn about the available props and the CSS API.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { Box, Grid, TextField, Typography } from '@mui/material';
|
|
6
6
|
import { CategoryService, Endpoints } from '@selfcommunity/api-services';
|
|
@@ -14,6 +14,8 @@ import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
|
14
14
|
import { Logger, sortByAttr } from '@selfcommunity/utils';
|
|
15
15
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
16
16
|
import { PREFIX } from './constants';
|
|
17
|
+
import PubSub from 'pubsub-js';
|
|
18
|
+
import { SCCategoryEventType, SCTopicType } from '../../constants/PubSub';
|
|
17
19
|
const classes = {
|
|
18
20
|
root: `${PREFIX}-root`,
|
|
19
21
|
filters: `${PREFIX}-filter`,
|
|
@@ -71,6 +73,7 @@ export default function Categories(inProps) {
|
|
|
71
73
|
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
72
74
|
// REFS
|
|
73
75
|
const isMountedRef = useIsComponentMountedRef();
|
|
76
|
+
const updatesSubscription = useRef(null);
|
|
74
77
|
/**
|
|
75
78
|
* Fetches categories list
|
|
76
79
|
*/
|
|
@@ -102,6 +105,25 @@ export default function Categories(inProps) {
|
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
107
|
}, [contentAvailability, authUserId, prefetchedCategories.length]);
|
|
108
|
+
/**
|
|
109
|
+
* Subscriber for pubsub callback
|
|
110
|
+
*/
|
|
111
|
+
const onEditCategoryHandler = useCallback((_msg, edited) => {
|
|
112
|
+
setCategories((prev) => {
|
|
113
|
+
return prev.map((c) => (c.id === edited.id ? Object.assign(Object.assign({}, c), edited) : c));
|
|
114
|
+
});
|
|
115
|
+
}, [categories]);
|
|
116
|
+
/**
|
|
117
|
+
* On mount, subscribe to receive event updates (only edit)
|
|
118
|
+
*/
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (categories) {
|
|
121
|
+
updatesSubscription.current = PubSub.subscribe(`${SCTopicType.CATEGORY}.${SCCategoryEventType.EDIT}`, onEditCategoryHandler);
|
|
122
|
+
}
|
|
123
|
+
return () => {
|
|
124
|
+
updatesSubscription.current && PubSub.unsubscribe(updatesSubscription.current);
|
|
125
|
+
};
|
|
126
|
+
}, [categories]);
|
|
105
127
|
/**
|
|
106
128
|
* Get categories filtered
|
|
107
129
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React, { useContext, useEffect, useMemo, useReducer, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { Button, CardContent, List, ListItem, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
6
6
|
import { CategoryService, Endpoints, http } from '@selfcommunity/api-services';
|
|
@@ -18,6 +18,8 @@ import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
|
18
18
|
import { SCCache, SCPreferences, SCPreferencesContext, SCUserContext } from '@selfcommunity/react-core';
|
|
19
19
|
import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
|
|
20
20
|
import { PREFIX } from './constants';
|
|
21
|
+
import PubSub from 'pubsub-js';
|
|
22
|
+
import { SCCategoryEventType, SCTopicType } from '../../constants/PubSub';
|
|
21
23
|
const classes = {
|
|
22
24
|
root: `${PREFIX}-root`,
|
|
23
25
|
title: `${PREFIX}-title`,
|
|
@@ -87,6 +89,8 @@ export default function CategoriesPopularWidget(inProps) {
|
|
|
87
89
|
// HOOKS
|
|
88
90
|
const theme = useTheme();
|
|
89
91
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
92
|
+
// REFS
|
|
93
|
+
const updatesSubscription = useRef(null);
|
|
90
94
|
/**
|
|
91
95
|
* Initialize component
|
|
92
96
|
* Fetch data only if the component is not initialized and it is not loading data
|
|
@@ -104,6 +108,23 @@ export default function CategoriesPopularWidget(inProps) {
|
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
}, [state.isLoadingNext, state.initialized, limit, dispatch]);
|
|
111
|
+
/**
|
|
112
|
+
* Subscriber for pubsub callback
|
|
113
|
+
*/
|
|
114
|
+
const onEditCategoryHandler = useCallback((_msg, edited) => {
|
|
115
|
+
const _categories = [...state.results];
|
|
116
|
+
const updatedCategories = _categories.map((c) => (c.id === edited.id ? Object.assign(Object.assign({}, c), edited) : c));
|
|
117
|
+
dispatch({ type: actionWidgetTypes.SET_RESULTS, payload: { results: updatedCategories } });
|
|
118
|
+
}, [dispatch, state.results]);
|
|
119
|
+
/**
|
|
120
|
+
* On mount, subscribe to receive event updates (only edit)
|
|
121
|
+
*/
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
updatesSubscription.current = PubSub.subscribe(`${SCTopicType.CATEGORY}.${SCCategoryEventType.EDIT}`, onEditCategoryHandler);
|
|
124
|
+
return () => {
|
|
125
|
+
updatesSubscription.current && PubSub.unsubscribe(updatesSubscription.current);
|
|
126
|
+
};
|
|
127
|
+
}, [onEditCategoryHandler]);
|
|
107
128
|
// EFFECTS
|
|
108
129
|
useEffect(() => {
|
|
109
130
|
var _a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React, { useEffect, useMemo, useReducer, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { Button, CardContent, List, ListItem, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
6
6
|
import { Endpoints, http, SuggestionService } from '@selfcommunity/api-services';
|
|
@@ -18,6 +18,8 @@ import BaseDialog from '../../shared/BaseDialog';
|
|
|
18
18
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
19
19
|
import InfiniteScroll from '../../shared/InfiniteScroll';
|
|
20
20
|
import { PREFIX } from './constants';
|
|
21
|
+
import PubSub from 'pubsub-js';
|
|
22
|
+
import { SCCategoryEventType, SCTopicType } from '../../constants/PubSub';
|
|
21
23
|
const classes = {
|
|
22
24
|
root: `${PREFIX}-root`,
|
|
23
25
|
title: `${PREFIX}-title`,
|
|
@@ -83,6 +85,8 @@ export default function CategoriesSuggestionWidget(inProps) {
|
|
|
83
85
|
// HOOKS
|
|
84
86
|
const theme = useTheme();
|
|
85
87
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
88
|
+
// REFS
|
|
89
|
+
const updatesSubscription = useRef(null);
|
|
86
90
|
/**
|
|
87
91
|
* Initialize component
|
|
88
92
|
* Fetch data only if the component is not initialized and it is not loading data
|
|
@@ -100,6 +104,23 @@ export default function CategoriesSuggestionWidget(inProps) {
|
|
|
100
104
|
});
|
|
101
105
|
}
|
|
102
106
|
}, [state.isLoadingNext, state.initialized, limit, dispatch]);
|
|
107
|
+
/**
|
|
108
|
+
* Subscriber for pubsub callback
|
|
109
|
+
*/
|
|
110
|
+
const onEditCategoryHandler = useCallback((_msg, edited) => {
|
|
111
|
+
const _categories = [...state.results];
|
|
112
|
+
const updatedCategories = _categories.map((c) => (c.id === edited.id ? Object.assign(Object.assign({}, c), edited) : c));
|
|
113
|
+
dispatch({ type: actionWidgetTypes.SET_RESULTS, payload: { results: updatedCategories } });
|
|
114
|
+
}, [dispatch, state.results]);
|
|
115
|
+
/**
|
|
116
|
+
* On mount, subscribe to receive event updates (only edit)
|
|
117
|
+
*/
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
updatesSubscription.current = PubSub.subscribe(`${SCTopicType.CATEGORY}.${SCCategoryEventType.EDIT}`, onEditCategoryHandler);
|
|
120
|
+
return () => {
|
|
121
|
+
updatesSubscription.current && PubSub.unsubscribe(updatesSubscription.current);
|
|
122
|
+
};
|
|
123
|
+
}, [onEditCategoryHandler]);
|
|
103
124
|
// EFFECTS
|
|
104
125
|
useEffect(() => {
|
|
105
126
|
let _t;
|
|
@@ -5,7 +5,7 @@ import { ToggleButton, ToggleButtonGroup } from '@mui/material';
|
|
|
5
5
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { FormattedMessage } from 'react-intl';
|
|
8
|
-
import { SCPreferences, UserUtils, useSCPreferences, useSCUser
|
|
8
|
+
import { SCPreferences, UserUtils, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
9
9
|
import { COMPOSER_TYPE_DISCUSSION, COMPOSER_TYPE_POLL, COMPOSER_TYPE_POST } from '../../../constants/Composer';
|
|
10
10
|
import { PREFIX } from '../constants';
|
|
11
11
|
const classes = {
|
|
@@ -35,5 +35,5 @@ export default function ComposerTypeButtonGroup(props) {
|
|
|
35
35
|
const handleChange = useCallback((event, value) => {
|
|
36
36
|
onChange && onChange(value);
|
|
37
37
|
}, [onChange]);
|
|
38
|
-
return _jsxs(Root, Object.assign({ className: classNames(classes.root, className), onChange: handleChange, exclusive: true, value: value }, rest, { children: [hasPostType && _jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POST }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.post", defaultMessage: "ui.composer.typeSwitch.post" }) })), hasDiscussionType && _jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_DISCUSSION }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.discussion", defaultMessage: "ui.composer.typeSwitch.discussion" }) })), hasPollType && _jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POLL }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.poll", defaultMessage: "ui.composer.typeSwitch.poll" }) }))] }));
|
|
38
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className), onChange: handleChange, exclusive: true, value: value }, rest, { children: [hasPostType && (_jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POST }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.post", defaultMessage: "ui.composer.typeSwitch.post" }) }))), hasDiscussionType && (_jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_DISCUSSION }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.discussion", defaultMessage: "ui.composer.typeSwitch.discussion" }) }))), hasPostType && hasPollType && (_jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POLL }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.poll", defaultMessage: "ui.composer.typeSwitch.poll" }) })))] })));
|
|
39
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from '@mui/material/Button/Button';
|
|
2
|
-
import {
|
|
2
|
+
import { EventFormDialogProps } from '../EventFormDialog';
|
|
3
3
|
export interface CreateEventButtonProps extends ButtonProps {
|
|
4
4
|
/**
|
|
5
5
|
* Overrides or extends the styles applied to the component.
|
|
@@ -10,7 +10,7 @@ export interface CreateEventButtonProps extends ButtonProps {
|
|
|
10
10
|
* Props to spread to CreateGroup component
|
|
11
11
|
* @default empty object
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
EventFormDialogComponentProps?: EventFormDialogProps;
|
|
14
14
|
/**
|
|
15
15
|
* Any other properties
|
|
16
16
|
*/
|
|
@@ -7,7 +7,7 @@ import { SCPreferences, SCUserContext, useSCPreferences } from '@selfcommunity/r
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import React, { useContext, useMemo } from 'react';
|
|
9
9
|
import { FormattedMessage } from 'react-intl';
|
|
10
|
-
import
|
|
10
|
+
import EventFormDialog from '../EventFormDialog';
|
|
11
11
|
import { SCFeatureName } from '@selfcommunity/types';
|
|
12
12
|
const PREFIX = 'SCCreateEventButton';
|
|
13
13
|
const classes = {
|
|
@@ -38,13 +38,13 @@ const Root = styled(Button, {
|
|
|
38
38
|
* @param inProps
|
|
39
39
|
*/
|
|
40
40
|
export default function CreateEventButton(inProps) {
|
|
41
|
-
var _a;
|
|
41
|
+
var _a, _b;
|
|
42
42
|
//PROPS
|
|
43
43
|
const props = useThemeProps({
|
|
44
44
|
props: inProps,
|
|
45
45
|
name: PREFIX
|
|
46
46
|
});
|
|
47
|
-
const { className,
|
|
47
|
+
const { className, EventFormDialogComponentProps = {}, children } = props, rest = __rest(props, ["className", "EventFormDialogComponentProps", "children"]);
|
|
48
48
|
// CONTEXT
|
|
49
49
|
const scUserContext = useContext(SCUserContext);
|
|
50
50
|
// STATE
|
|
@@ -76,5 +76,5 @@ export default function CreateEventButton(inProps) {
|
|
|
76
76
|
/**
|
|
77
77
|
* Renders root object
|
|
78
78
|
*/
|
|
79
|
-
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClick, variant: "contained", color: "secondary", startIcon: !
|
|
79
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClick, variant: "contained", color: "secondary", startIcon: !((_b = EventFormDialogComponentProps.EventFormComponentProps) === null || _b === void 0 ? void 0 : _b.event) && _jsx(Icon, Object.assign({ fontSize: "small" }, { children: "add" })) }, rest, { children: children !== null && children !== void 0 ? children : _jsx(FormattedMessage, { id: "ui.createEventButton", defaultMessage: "ui.createEventButton" }) })), open && _jsx(EventFormDialog, Object.assign({}, EventFormDialogComponentProps, { open: true, onClose: handleClick }))] }));
|
|
80
80
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material/Button/Button';
|
|
2
|
+
import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
|
|
3
|
+
import { CreateLiveStreamDialogProps } from '../CreateLiveStreamDialog';
|
|
4
|
+
export interface CreateLiveStreamButtonProps extends ButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* Overrides or extends the styles applied to the component.
|
|
7
|
+
* @default null
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Props to spread to CreateGroup component
|
|
12
|
+
* @default empty object
|
|
13
|
+
*/
|
|
14
|
+
CreateLiveStreamDialogComponentProps?: CreateLiveStreamDialogProps;
|
|
15
|
+
/**
|
|
16
|
+
* On click callback function
|
|
17
|
+
* @default null
|
|
18
|
+
*/
|
|
19
|
+
onButtonClick?: (event: any, reason: any) => void;
|
|
20
|
+
/**
|
|
21
|
+
* On success callback function
|
|
22
|
+
* @default null
|
|
23
|
+
*/
|
|
24
|
+
onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Any other properties
|
|
27
|
+
*/
|
|
28
|
+
[p: string]: any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
*> API documentation for the Community-JS CreateLiveStreamButton component. Learn about the available props and the CSS API.
|
|
32
|
+
*
|
|
33
|
+
#### Import
|
|
34
|
+
```jsx
|
|
35
|
+
import {CreateLiveStreamButton} from '@selfcommunity/react-ui';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Component Name
|
|
39
|
+
The name `SCCreateLiveStreamButton` can be used when providing style overrides in the theme.
|
|
40
|
+
|
|
41
|
+
#### CSS
|
|
42
|
+
|
|
43
|
+
|Rule Name|Global class|Description|
|
|
44
|
+
|---|---|---|
|
|
45
|
+
|root|.SCCreateLivestreamButton-root|Styles applied to the root element.|
|
|
46
|
+
|
|
47
|
+
* @param inProps
|
|
48
|
+
*/
|
|
49
|
+
export default function CreateLiveStreamButton(inProps: CreateLiveStreamButtonProps): JSX.Element;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, Icon } from '@mui/material';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { useThemeProps } from '@mui/system';
|
|
6
|
+
import { SCUserContext, useSCPreferences } from '@selfcommunity/react-core';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import React, { useContext, useMemo } from 'react';
|
|
9
|
+
import { FormattedMessage } from 'react-intl';
|
|
10
|
+
import CreateLivestreamDialog from '../CreateLiveStreamDialog';
|
|
11
|
+
const PREFIX = 'SCCreateLivestreamButton';
|
|
12
|
+
const classes = {
|
|
13
|
+
root: `${PREFIX}-root`
|
|
14
|
+
};
|
|
15
|
+
const Root = styled(Button, {
|
|
16
|
+
name: PREFIX,
|
|
17
|
+
slot: 'Root',
|
|
18
|
+
overridesResolver: (props, styles) => styles.root
|
|
19
|
+
})(() => ({}));
|
|
20
|
+
/**
|
|
21
|
+
*> API documentation for the Community-JS CreateLiveStreamButton component. Learn about the available props and the CSS API.
|
|
22
|
+
*
|
|
23
|
+
#### Import
|
|
24
|
+
```jsx
|
|
25
|
+
import {CreateLiveStreamButton} from '@selfcommunity/react-ui';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### Component Name
|
|
29
|
+
The name `SCCreateLiveStreamButton` can be used when providing style overrides in the theme.
|
|
30
|
+
|
|
31
|
+
#### CSS
|
|
32
|
+
|
|
33
|
+
|Rule Name|Global class|Description|
|
|
34
|
+
|---|---|---|
|
|
35
|
+
|root|.SCCreateLivestreamButton-root|Styles applied to the root element.|
|
|
36
|
+
|
|
37
|
+
* @param inProps
|
|
38
|
+
*/
|
|
39
|
+
export default function CreateLiveStreamButton(inProps) {
|
|
40
|
+
var _a;
|
|
41
|
+
//PROPS
|
|
42
|
+
const props = useThemeProps({
|
|
43
|
+
props: inProps,
|
|
44
|
+
name: PREFIX
|
|
45
|
+
});
|
|
46
|
+
const { className, CreateLiveStreamDialogComponentProps = {}, onSuccess, children } = props, rest = __rest(props, ["className", "CreateLiveStreamDialogComponentProps", "onSuccess", "children"]);
|
|
47
|
+
// CONTEXT
|
|
48
|
+
const scUserContext = useContext(SCUserContext);
|
|
49
|
+
// STATE
|
|
50
|
+
const [open, setOpen] = React.useState(false);
|
|
51
|
+
// CONST
|
|
52
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
53
|
+
const { preferences, features } = useSCPreferences();
|
|
54
|
+
// TODO
|
|
55
|
+
const liveStreamEnabled = true;
|
|
56
|
+
/* const liveStreamEnabled = useMemo(
|
|
57
|
+
() =>
|
|
58
|
+
preferences &&
|
|
59
|
+
features &&
|
|
60
|
+
features.includes(SCFeatureName.LIVE_STREAM) &&
|
|
61
|
+
SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
|
|
62
|
+
preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value,
|
|
63
|
+
[preferences, features]
|
|
64
|
+
); */
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
const canCreateLiveStream = useMemo(() => true /* scUserContext?.user?.permission?.create_livestream */, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
|
|
68
|
+
/**
|
|
69
|
+
* Handle close
|
|
70
|
+
*/
|
|
71
|
+
const handleClose = () => {
|
|
72
|
+
setOpen((o) => !o);
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Handle close
|
|
76
|
+
*/
|
|
77
|
+
const handleSuccess = (data) => {
|
|
78
|
+
onSuccess && onSuccess(data);
|
|
79
|
+
setOpen((o) => !o);
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* If there's no authUserId, component is hidden.
|
|
83
|
+
*/
|
|
84
|
+
if (!liveStreamEnabled || !canCreateLiveStream || !authUserId) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Renders root object
|
|
89
|
+
*/
|
|
90
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: _jsx(Icon, { children: "photo_camera" }) }, rest, { children: children !== null && children !== void 0 ? children : _jsx(FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && _jsx(CreateLivestreamDialog, Object.assign({ open: true, onClose: handleClose, onSuccess: handleSuccess }, CreateLiveStreamDialogComponentProps))] }));
|
|
91
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
|
|
2
|
+
import { BaseDialogProps } from '../../shared/BaseDialog';
|
|
3
|
+
export interface CreateLiveStreamDialogProps extends BaseDialogProps {
|
|
4
|
+
/**
|
|
5
|
+
* Overrides or extends the styles applied to the component.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Open dialog
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
open?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* On dialog close callback function
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* On success callback function
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Any other properties
|
|
26
|
+
*/
|
|
27
|
+
[p: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
*> API documentation for the Community-JS CreateLiveStreamDialog component. Learn about the available props and the CSS API.
|
|
31
|
+
*
|
|
32
|
+
#### Import
|
|
33
|
+
```jsx
|
|
34
|
+
import {CreateLivestreamDialog} from '@selfcommunity/react-ui';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Component Name
|
|
38
|
+
The name `SCCreateLivestreamDialog` can be used when providing style overrides in the theme.
|
|
39
|
+
|
|
40
|
+
#### CSS
|
|
41
|
+
|
|
42
|
+
|Rule Name|Global class|Description|
|
|
43
|
+
|---|---|---|
|
|
44
|
+
|root|.SCCreateLivestreamDialog-root|Styles applied to the root element.|
|
|
45
|
+
|content|.SCCreateLivestreamDialog-content|Styles applied to the content element.|
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
* @param inProps
|
|
50
|
+
*/
|
|
51
|
+
export default function CreateLiveStreamDialog(inProps: CreateLiveStreamDialogProps): JSX.Element;
|