@selfcommunity/react-ui 0.10.5-alpha.1 → 0.10.5-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/assets/deafultCover.d.ts +2 -0
- package/lib/cjs/assets/deafultCover.js +3 -0
- package/lib/cjs/assets/liveStream/event.d.ts +2 -0
- package/lib/cjs/assets/liveStream/event.js +3 -0
- package/lib/cjs/assets/liveStream/live.d.ts +2 -0
- package/lib/cjs/assets/liveStream/live.js +3 -0
- package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +44 -0
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +91 -0
- package/lib/cjs/components/CreateLiveStreamButton/index.d.ts +3 -0
- package/lib/cjs/components/CreateLiveStreamButton/index.js +5 -0
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +49 -0
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +103 -0
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +47 -0
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +188 -0
- package/lib/cjs/components/CreateLiveStreamDialog/constants.d.ts +1 -0
- package/lib/cjs/components/CreateLiveStreamDialog/constants.js +4 -0
- package/lib/cjs/components/CreateLiveStreamDialog/index.d.ts +3 -0
- package/lib/cjs/components/CreateLiveStreamDialog/index.js +5 -0
- package/lib/cjs/components/CreateLiveStreamDialog/types.d.ts +8 -0
- package/lib/cjs/components/CreateLiveStreamDialog/types.js +13 -0
- package/lib/cjs/components/Editor/Editor.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
- package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
- package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/cjs/components/Editor/plugins/AutoLinkPlugin.js +8 -2
- package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/cjs/components/EventForm/EventAddress.d.ts +4 -2
- package/lib/cjs/components/EventForm/EventAddress.js +54 -8
- package/lib/cjs/components/EventForm/EventForm.d.ts +12 -1
- package/lib/cjs/components/EventForm/EventForm.js +51 -13
- package/lib/cjs/components/EventForm/types.d.ts +7 -6
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +2 -2
- package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/cjs/components/EventMembersWidget/types.d.ts +1 -1
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/cjs/components/Feed/Feed.d.ts +2 -2
- package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/LiveStream/LiveStream.d.ts +79 -0
- package/lib/cjs/components/LiveStream/LiveStream.js +143 -0
- package/lib/cjs/components/LiveStream/Skeleton.d.ts +46 -0
- package/lib/cjs/components/LiveStream/Skeleton.js +92 -0
- package/lib/cjs/components/LiveStream/constants.d.ts +1 -0
- package/lib/cjs/components/LiveStream/constants.js +4 -0
- package/lib/cjs/components/LiveStream/index.d.ts +4 -0
- package/lib/cjs/components/LiveStream/index.js +8 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +192 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.d.ts +47 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +75 -0
- package/lib/cjs/components/LiveStreamForm/constants.d.ts +15 -0
- package/lib/cjs/components/LiveStreamForm/constants.js +18 -0
- package/lib/cjs/components/LiveStreamForm/index.d.ts +3 -0
- package/lib/cjs/components/LiveStreamForm/index.js +5 -0
- package/lib/cjs/components/LiveStreamForm/types.d.ts +11 -0
- package/lib/cjs/components/LiveStreamForm/types.js +2 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.d.ts +85 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +199 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +29 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +62 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.d.ts +10 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +76 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +21 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +33 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.d.ts +17 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.js +13 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +77 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +137 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +8 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +28 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +65 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +30 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +215 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +39 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +55 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +251 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +5 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +32 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +19 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.js +35 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +31 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +26 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +151 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +3 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +6 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.js +5 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.d.ts +7 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +195 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +27 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.js +82 -0
- package/lib/cjs/components/LiveStreamRoom/constants.d.ts +21 -0
- package/lib/cjs/components/LiveStreamRoom/constants.js +24 -0
- package/lib/cjs/components/LiveStreamRoom/index.d.ts +3 -0
- package/lib/cjs/components/LiveStreamRoom/index.js +5 -0
- package/lib/cjs/components/LiveStreamRoom/types.d.ts +22 -0
- package/lib/cjs/components/LiveStreamRoom/types.js +8 -0
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +16 -0
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +12 -3
- package/lib/cjs/components/Notification/LiveStream/LiveStream.d.ts +15 -0
- package/lib/cjs/components/Notification/LiveStream/LiveStream.js +75 -0
- package/lib/cjs/components/Notification/LiveStream/index.d.ts +3 -0
- package/lib/cjs/components/Notification/LiveStream/index.js +5 -0
- package/lib/cjs/components/Notification/Notification.js +5 -1
- package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +5 -5
- package/lib/cjs/components/PlatformWidget/constants.d.ts +4 -0
- package/lib/cjs/components/PlatformWidget/constants.js +5 -1
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -1
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +4 -0
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +6 -2
- package/lib/cjs/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
- package/lib/cjs/components/UserLiveStreamWidget/Skeleton.js +28 -0
- package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
- package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.js +133 -0
- package/lib/cjs/components/UserLiveStreamWidget/constants.d.ts +1 -0
- package/lib/cjs/components/UserLiveStreamWidget/constants.js +4 -0
- package/lib/cjs/components/UserLiveStreamWidget/index.d.ts +4 -0
- package/lib/cjs/components/UserLiveStreamWidget/index.js +8 -0
- package/lib/cjs/constants/LiveStream.d.ts +3 -0
- package/lib/cjs/constants/LiveStream.js +6 -0
- package/lib/cjs/index.d.ts +12 -1
- package/lib/cjs/index.js +33 -6
- package/lib/cjs/shared/CopyTextArea/index.d.ts +2 -2
- package/lib/cjs/shared/CopyTextArea/index.js +8 -2
- package/lib/cjs/shared/EventInfoDetails/index.js +10 -1
- package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/cjs/shared/LiveStreamInfoDetails/index.d.ts +17 -0
- package/lib/cjs/shared/LiveStreamInfoDetails/index.js +53 -0
- package/lib/cjs/shared/Media/File/PreviewComponent.js +3 -4
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/cjs/shared/Media/Link/DisplayComponent.js +1 -4
- package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
- package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
- package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.js +14 -0
- package/lib/cjs/shared/UpScalingTierBadge/index.d.ts +7 -0
- package/lib/cjs/shared/UpScalingTierBadge/index.js +63 -0
- package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/cjs/types/composer.d.ts +1 -1
- package/lib/cjs/types/liveStream.d.ts +5 -0
- package/lib/cjs/types/liveStream.js +9 -0
- package/lib/cjs/utils/liveStream.d.ts +4 -0
- package/lib/cjs/utils/liveStream.js +25 -0
- package/lib/esm/assets/deafultCover.d.ts +2 -0
- package/lib/esm/assets/deafultCover.js +1 -0
- package/lib/esm/assets/liveStream/event.d.ts +2 -0
- package/lib/esm/assets/liveStream/event.js +1 -0
- package/lib/esm/assets/liveStream/live.d.ts +2 -0
- package/lib/esm/assets/liveStream/live.js +1 -0
- package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +44 -0
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +88 -0
- package/lib/esm/components/CreateLiveStreamButton/index.d.ts +3 -0
- package/lib/esm/components/CreateLiveStreamButton/index.js +2 -0
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +49 -0
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +100 -0
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +47 -0
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +183 -0
- package/lib/esm/components/CreateLiveStreamDialog/constants.d.ts +1 -0
- package/lib/esm/components/CreateLiveStreamDialog/constants.js +1 -0
- package/lib/esm/components/CreateLiveStreamDialog/index.d.ts +3 -0
- package/lib/esm/components/CreateLiveStreamDialog/index.js +2 -0
- package/lib/esm/components/CreateLiveStreamDialog/types.d.ts +8 -0
- package/lib/esm/components/CreateLiveStreamDialog/types.js +10 -0
- package/lib/esm/components/Editor/Editor.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
- package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
- package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/esm/components/Editor/plugins/AutoLinkPlugin.js +8 -2
- package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/esm/components/EventForm/EventAddress.d.ts +4 -2
- package/lib/esm/components/EventForm/EventAddress.js +54 -8
- package/lib/esm/components/EventForm/EventForm.d.ts +12 -1
- package/lib/esm/components/EventForm/EventForm.js +51 -13
- package/lib/esm/components/EventForm/types.d.ts +7 -6
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +2 -2
- package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/esm/components/EventMembersWidget/types.d.ts +1 -1
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/esm/components/Feed/Feed.d.ts +2 -2
- package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/LiveStream/LiveStream.d.ts +79 -0
- package/lib/esm/components/LiveStream/LiveStream.js +140 -0
- package/lib/esm/components/LiveStream/Skeleton.d.ts +46 -0
- package/lib/esm/components/LiveStream/Skeleton.js +89 -0
- package/lib/esm/components/LiveStream/constants.d.ts +1 -0
- package/lib/esm/components/LiveStream/constants.js +1 -0
- package/lib/esm/components/LiveStream/index.d.ts +4 -0
- package/lib/esm/components/LiveStream/index.js +4 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +189 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.d.ts +47 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +71 -0
- package/lib/esm/components/LiveStreamForm/constants.d.ts +15 -0
- package/lib/esm/components/LiveStreamForm/constants.js +15 -0
- package/lib/esm/components/LiveStreamForm/index.d.ts +3 -0
- package/lib/esm/components/LiveStreamForm/index.js +2 -0
- package/lib/esm/components/LiveStreamForm/types.d.ts +11 -0
- package/lib/esm/components/LiveStreamForm/types.js +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.d.ts +85 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +196 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +29 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +58 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.d.ts +10 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +73 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +21 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.d.ts +17 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.js +9 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +77 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +134 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +6 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +28 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +60 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +30 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +212 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +36 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +55 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +245 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +5 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +29 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +19 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.js +30 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +26 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +147 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +3 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +3 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.js +2 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.d.ts +7 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +191 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +27 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.js +74 -0
- package/lib/esm/components/LiveStreamRoom/constants.d.ts +21 -0
- package/lib/esm/components/LiveStreamRoom/constants.js +21 -0
- package/lib/esm/components/LiveStreamRoom/index.d.ts +3 -0
- package/lib/esm/components/LiveStreamRoom/index.js +2 -0
- package/lib/esm/components/LiveStreamRoom/types.d.ts +22 -0
- package/lib/esm/components/LiveStreamRoom/types.js +4 -0
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +16 -0
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +12 -3
- package/lib/esm/components/Notification/LiveStream/LiveStream.d.ts +15 -0
- package/lib/esm/components/Notification/LiveStream/LiveStream.js +72 -0
- package/lib/esm/components/Notification/LiveStream/index.d.ts +3 -0
- package/lib/esm/components/Notification/LiveStream/index.js +2 -0
- package/lib/esm/components/Notification/Notification.js +5 -1
- package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +5 -5
- package/lib/esm/components/PlatformWidget/constants.d.ts +4 -0
- package/lib/esm/components/PlatformWidget/constants.js +4 -0
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -1
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +4 -0
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +6 -2
- package/lib/esm/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
- package/lib/esm/components/UserLiveStreamWidget/Skeleton.js +24 -0
- package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
- package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.js +130 -0
- package/lib/esm/components/UserLiveStreamWidget/constants.d.ts +1 -0
- package/lib/esm/components/UserLiveStreamWidget/constants.js +1 -0
- package/lib/esm/components/UserLiveStreamWidget/index.d.ts +4 -0
- package/lib/esm/components/UserLiveStreamWidget/index.js +4 -0
- package/lib/esm/constants/LiveStream.d.ts +3 -0
- package/lib/esm/constants/LiveStream.js +3 -0
- package/lib/esm/index.d.ts +12 -1
- package/lib/esm/index.js +13 -2
- package/lib/esm/shared/CopyTextArea/index.d.ts +2 -2
- package/lib/esm/shared/CopyTextArea/index.js +8 -2
- package/lib/esm/shared/EventInfoDetails/index.js +13 -4
- package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/esm/shared/LiveStreamInfoDetails/index.d.ts +17 -0
- package/lib/esm/shared/LiveStreamInfoDetails/index.js +50 -0
- package/lib/esm/shared/Media/File/PreviewComponent.js +3 -4
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/esm/shared/Media/Link/DisplayComponent.js +1 -4
- package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/esm/shared/StickyBox/index.d.ts +4 -4
- package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
- package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.js +10 -0
- package/lib/esm/shared/UpScalingTierBadge/index.d.ts +7 -0
- package/lib/esm/shared/UpScalingTierBadge/index.js +60 -0
- package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/esm/types/composer.d.ts +1 -1
- package/lib/esm/types/liveStream.d.ts +5 -0
- package/lib/esm/types/liveStream.js +6 -0
- package/lib/esm/utils/liveStream.d.ts +4 -0
- package/lib/esm/utils/liveStream.js +18 -0
- package/lib/umd/653.js +2 -0
- package/lib/umd/react-ui.js +1 -19
- package/lib/umd/react-ui.js.LICENSE.txt +2 -0
- package/package.json +22 -8
- package/lib/umd/314.js +0 -2
- /package/lib/umd/{314.js.LICENSE.txt → 653.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PREFIX = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const styles_1 = require("@mui/material/styles");
|
|
8
|
+
const system_1 = require("@mui/system");
|
|
9
|
+
const types_1 = require("@selfcommunity/types");
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const react_intl_1 = require("react-intl");
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
15
|
+
const UpScalingTierBadge_1 = tslib_1.__importDefault(require("../../shared/UpScalingTierBadge"));
|
|
16
|
+
exports.PREFIX = 'SCLiveStreamFormSettings';
|
|
17
|
+
const classes = {
|
|
18
|
+
root: `${exports.PREFIX}-root`,
|
|
19
|
+
switch: `${exports.PREFIX}-switch`,
|
|
20
|
+
switchLabel: `${exports.PREFIX}-switch-Label`,
|
|
21
|
+
accessView: `${exports.PREFIX}-access-view`,
|
|
22
|
+
accessViewIcon: `${exports.PREFIX}-access-view-icon`
|
|
23
|
+
};
|
|
24
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
25
|
+
name: exports.PREFIX,
|
|
26
|
+
slot: 'Root'
|
|
27
|
+
})(({ theme }) => ({}));
|
|
28
|
+
/**
|
|
29
|
+
*> API documentation for the Community-JS LiveStreamSettingsForm component. Learn about the available props and the CSS API.
|
|
30
|
+
*
|
|
31
|
+
#### Import
|
|
32
|
+
```jsx
|
|
33
|
+
import {LiveStreamSettingsForm} from '@selfcommunity/react-ui';
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Component Name
|
|
37
|
+
The name `LiveStreamSettingsForm` can be used when providing style overrides in the theme.
|
|
38
|
+
|
|
39
|
+
#### CSS
|
|
40
|
+
|
|
41
|
+
|Rule Name|Global class|Description|
|
|
42
|
+
|---|---|---|
|
|
43
|
+
|root|.SCLiveStreamForm-root|Styles applied to the root element.|
|
|
44
|
+
|switch|.SCLiveStreamForm-switch|Styles applied to the switch element.|
|
|
45
|
+
|switchLabel|.SCLiveStreamForm-switch-label|Styles applied to the switchLabel element.|
|
|
46
|
+
|accessView|.SCLiveStreamForm-access-view|Styles applied to the access view.|
|
|
47
|
+
|
|
48
|
+
* @param inProps
|
|
49
|
+
*/
|
|
50
|
+
function LiveStreamSettingsForm(inProps) {
|
|
51
|
+
var _a;
|
|
52
|
+
//PROPS
|
|
53
|
+
const props = (0, system_1.useThemeProps)({
|
|
54
|
+
props: inProps,
|
|
55
|
+
name: exports.PREFIX
|
|
56
|
+
});
|
|
57
|
+
const { className, settings = constants_1.LIVESTREAM_DEFAULT_SETTINGS, onChange } = props, rest = tslib_1.__rest(props, ["className", "settings", "onChange"]);
|
|
58
|
+
// CONTEXT
|
|
59
|
+
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
60
|
+
const { preferences } = (0, react_core_1.useSCPreferences)();
|
|
61
|
+
const authUserId = (0, react_1.useMemo)(() => (scUserContext.user ? scUserContext.user.id : null), [scUserContext.user]);
|
|
62
|
+
const isCommunityOwner = (0, react_1.useMemo)(() => authUserId === 1, [authUserId]);
|
|
63
|
+
const isEnterpriseTier = (0, react_1.useMemo)(() => preferences &&
|
|
64
|
+
react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
|
|
65
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
|
|
66
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_1.SCCommunitySubscriptionTier.ENTERPRISE, [preferences]);
|
|
67
|
+
const isEnterpriseFeaturesVisible = (0, react_1.useMemo)(() => Boolean(isEnterpriseTier || isCommunityOwner), [isEnterpriseTier, isCommunityOwner]);
|
|
68
|
+
/**
|
|
69
|
+
* Renders root object
|
|
70
|
+
*/
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.muteParticipants), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['muteParticipants']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipants) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.muteParticipants", defaultMessage: "ui.liveStreamForm.muteParticipants" }) }))] })), isEnterpriseFeaturesVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableVideo), disabled: !isEnterpriseTier, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) })), (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen), disabled: !isEnterpriseTier, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableShareScreen']: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableShareScreen", defaultMessage: "ui.liveStreamForm.disableShareScreen" }) })), (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['hideParticipantsList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.hideParticipantsList", defaultMessage: "ui.liveStreamForm.hideParticipantsList" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.showInProfile), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['showInProfile']: !(settings === null || settings === void 0 ? void 0 : settings.showInProfile) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.showInProfile", defaultMessage: "ui.liveStreamForm.showInProfile" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ className: classes.accessView }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, Object.assign({ id: "viewLabel" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ name: "view", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : types_1.SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: selected === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${selected}`, defaultMessage: `ui.liveStreamForm.view.${selected}` })] }));
|
|
73
|
+
} }, { children: Object.values(types_1.SCLiveStreamViewType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) })] }) }), f))) }))] }))] })));
|
|
74
|
+
}
|
|
75
|
+
exports.default = LiveStreamSettingsForm;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SCLiveStreamViewType } from '@selfcommunity/types';
|
|
2
|
+
export declare const PREFIX = "SCLiveStreamForm";
|
|
3
|
+
/**
|
|
4
|
+
* Default live stream settings
|
|
5
|
+
*/
|
|
6
|
+
export declare const LIVESTREAM_DEFAULT_SETTINGS: {
|
|
7
|
+
muteParticipants: boolean;
|
|
8
|
+
hideParticipantsList: boolean;
|
|
9
|
+
automaticallyNotifyFollowers: boolean;
|
|
10
|
+
disableVideo: boolean;
|
|
11
|
+
disableChat: boolean;
|
|
12
|
+
disableShareScreen: boolean;
|
|
13
|
+
showInProfile: boolean;
|
|
14
|
+
view: SCLiveStreamViewType;
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LIVESTREAM_DEFAULT_SETTINGS = exports.PREFIX = void 0;
|
|
4
|
+
const types_1 = require("@selfcommunity/types");
|
|
5
|
+
exports.PREFIX = 'SCLiveStreamForm';
|
|
6
|
+
/**
|
|
7
|
+
* Default live stream settings
|
|
8
|
+
*/
|
|
9
|
+
exports.LIVESTREAM_DEFAULT_SETTINGS = {
|
|
10
|
+
muteParticipants: true,
|
|
11
|
+
hideParticipantsList: false,
|
|
12
|
+
automaticallyNotifyFollowers: false,
|
|
13
|
+
disableVideo: true,
|
|
14
|
+
disableChat: false,
|
|
15
|
+
disableShareScreen: true,
|
|
16
|
+
showInProfile: true,
|
|
17
|
+
view: types_1.SCLiveStreamViewType.SPEAKER
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type InitialFieldState = {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
slug?: string;
|
|
5
|
+
settings?: Record<string, any>;
|
|
6
|
+
cover?: string | ArrayBuffer;
|
|
7
|
+
coverFile?: string | Blob;
|
|
8
|
+
isSubmitting: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type FieldStateKeys = keyof InitialFieldState;
|
|
11
|
+
export type FieldStateValues = InitialFieldState[FieldStateKeys];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
import { SCLiveStreamType } from '@selfcommunity/types';
|
|
3
|
+
import { LocalUserChoices } from '@livekit/components-react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { ConnectionDetails } from './types';
|
|
6
|
+
import { LiveStreamVideoConferenceProps } from './LiveStreamVideoConference';
|
|
7
|
+
import '@livekit/components-styles';
|
|
8
|
+
export interface LiveStreamRoomProps extends BoxProps {
|
|
9
|
+
/**
|
|
10
|
+
* Overrides or extends the styles applied to the component.
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Event Object
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
liveStream?: SCLiveStreamType;
|
|
19
|
+
/**
|
|
20
|
+
* Id of the liveStream for filter the feed
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
liveStreamId?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Element to be inserted before title
|
|
26
|
+
*/
|
|
27
|
+
startPrejoinContent?: React.ReactNode | null;
|
|
28
|
+
/**
|
|
29
|
+
* Element to be inserted after title
|
|
30
|
+
*/
|
|
31
|
+
endPrejoinContent?: React.ReactNode | null;
|
|
32
|
+
/**
|
|
33
|
+
* Show title of livestream in prejoin
|
|
34
|
+
*/
|
|
35
|
+
showPrejoinTitle?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Show description of livestream in prejoin
|
|
38
|
+
*/
|
|
39
|
+
showPrejoinDescription?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* ConnectionDetails Object
|
|
42
|
+
* @default null
|
|
43
|
+
*/
|
|
44
|
+
presetConnectionDetails?: ConnectionDetails;
|
|
45
|
+
/**
|
|
46
|
+
* LocalUserChoices Object
|
|
47
|
+
* @default null
|
|
48
|
+
*/
|
|
49
|
+
presetPreJoinChoices?: LocalUserChoices;
|
|
50
|
+
/**
|
|
51
|
+
* Props to spread to LiveStreamVideoConference Component
|
|
52
|
+
* @default {}
|
|
53
|
+
*/
|
|
54
|
+
LiveStreamVideoConferenceComponentProps?: LiveStreamVideoConferenceProps;
|
|
55
|
+
/**
|
|
56
|
+
* Any other properties
|
|
57
|
+
*/
|
|
58
|
+
[p: string]: any;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
*> API documentation for the Community-JS LiveStreamRoom component. Learn about the available props and the CSS API.
|
|
62
|
+
*
|
|
63
|
+
#### Import
|
|
64
|
+
```jsx
|
|
65
|
+
import {LiveStreamRoom} from '@selfcommunity/react-ui';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### Component Name
|
|
69
|
+
The name `LiveStreamRoom` can be used when providing style overrides in the theme.
|
|
70
|
+
|
|
71
|
+
#### CSS
|
|
72
|
+
|
|
73
|
+
|Rule Name|Global class|Description|
|
|
74
|
+
|---|---|---|
|
|
75
|
+
|root|.SCLiveStreamRoom-root|Styles applied to the root element.|
|
|
76
|
+
|title|.SCLiveStreamRoom-title|Styles applied to the title element.|
|
|
77
|
+
|description|.SCLiveStreamRoom-description|Styles applied to the description element.|
|
|
78
|
+
|content|.SCLiveStreamRoom-content|Styles applied to the content.|
|
|
79
|
+
|prejoin|.SCLiveStreamRoom-prejoin|Styles applied to the prejoin.|
|
|
80
|
+
|conference|.SCLiveStreamRoom-conference|Styles applied to the conference.|
|
|
81
|
+
|error|.SCLiveStreamRoom-error|Styles applied to the error elements.|
|
|
82
|
+
|
|
83
|
+
* @param inProps
|
|
84
|
+
*/
|
|
85
|
+
export default function LiveStreamRoom(inProps: LiveStreamRoomProps): JSX.Element;
|
|
@@ -0,0 +1,199 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const system_1 = require("@mui/system");
|
|
8
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
9
|
+
const types_1 = require("@selfcommunity/types");
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
11
|
+
const react_intl_1 = require("react-intl");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const LiveStreamVideoConference_1 = tslib_1.__importDefault(require("./LiveStreamVideoConference"));
|
|
15
|
+
require("@livekit/components-styles");
|
|
16
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
17
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
18
|
+
const Errors_1 = require("../../constants/Errors");
|
|
19
|
+
const PreJoin_1 = require("./LiveStreamVideoConference/PreJoin");
|
|
20
|
+
const LiveStreamProvider_1 = require("./LiveStreamVideoConference/LiveStreamProvider");
|
|
21
|
+
const notistack_1 = require("notistack");
|
|
22
|
+
const DialogContent_1 = tslib_1.__importDefault(require("@mui/material/DialogContent"));
|
|
23
|
+
const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
|
|
24
|
+
const CopyTextArea_1 = tslib_1.__importDefault(require("../../shared/CopyTextArea"));
|
|
25
|
+
const classes = {
|
|
26
|
+
root: `${constants_1.PREFIX}-root`,
|
|
27
|
+
content: `${constants_1.PREFIX}-content`,
|
|
28
|
+
title: `${constants_1.PREFIX}-title`,
|
|
29
|
+
description: `${constants_1.PREFIX}-description`,
|
|
30
|
+
endConferenceWrap: `${constants_1.PREFIX}-end-conference-wrap`,
|
|
31
|
+
btnBackHome: `${constants_1.PREFIX}-btn-back-home`,
|
|
32
|
+
startPrejoinContent: `${constants_1.PREFIX}-start-prejoin-content`,
|
|
33
|
+
preJoin: `${constants_1.PREFIX}-prejoin`,
|
|
34
|
+
preJoinLoading: `${constants_1.PREFIX}-prejoin-loading`,
|
|
35
|
+
prejoinLoader: `${constants_1.PREFIX}-prejoin-loader`,
|
|
36
|
+
preJoinAlert: `${constants_1.PREFIX}-prejoin-alert`,
|
|
37
|
+
shareLink: `${constants_1.PREFIX}-share-link`,
|
|
38
|
+
endPrejoinContent: `${constants_1.PREFIX}-end-prejoin-content`,
|
|
39
|
+
endPrejoinContentBox: `${constants_1.PREFIX}-end-prejoin-content-box`,
|
|
40
|
+
conference: `${constants_1.PREFIX}-conference`,
|
|
41
|
+
error: `${constants_1.PREFIX}-error`
|
|
42
|
+
};
|
|
43
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
44
|
+
name: constants_1.PREFIX,
|
|
45
|
+
slot: 'Root'
|
|
46
|
+
})(({ theme }) => ({}));
|
|
47
|
+
const DialogRoot = (0, styles_1.styled)(BaseDialog_1.default, {
|
|
48
|
+
name: constants_1.PREFIX,
|
|
49
|
+
slot: 'Root',
|
|
50
|
+
overridesResolver: (props, styles) => styles.dialogRoot
|
|
51
|
+
})(({ theme }) => ({}));
|
|
52
|
+
/**
|
|
53
|
+
*> API documentation for the Community-JS LiveStreamRoom component. Learn about the available props and the CSS API.
|
|
54
|
+
*
|
|
55
|
+
#### Import
|
|
56
|
+
```jsx
|
|
57
|
+
import {LiveStreamRoom} from '@selfcommunity/react-ui';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Component Name
|
|
61
|
+
The name `LiveStreamRoom` can be used when providing style overrides in the theme.
|
|
62
|
+
|
|
63
|
+
#### CSS
|
|
64
|
+
|
|
65
|
+
|Rule Name|Global class|Description|
|
|
66
|
+
|---|---|---|
|
|
67
|
+
|root|.SCLiveStreamRoom-root|Styles applied to the root element.|
|
|
68
|
+
|title|.SCLiveStreamRoom-title|Styles applied to the title element.|
|
|
69
|
+
|description|.SCLiveStreamRoom-description|Styles applied to the description element.|
|
|
70
|
+
|content|.SCLiveStreamRoom-content|Styles applied to the content.|
|
|
71
|
+
|prejoin|.SCLiveStreamRoom-prejoin|Styles applied to the prejoin.|
|
|
72
|
+
|conference|.SCLiveStreamRoom-conference|Styles applied to the conference.|
|
|
73
|
+
|error|.SCLiveStreamRoom-error|Styles applied to the error elements.|
|
|
74
|
+
|
|
75
|
+
* @param inProps
|
|
76
|
+
*/
|
|
77
|
+
function LiveStreamRoom(inProps) {
|
|
78
|
+
var _a, _b, _c, _d, _e, _f;
|
|
79
|
+
//PROPS
|
|
80
|
+
const props = (0, system_1.useThemeProps)({
|
|
81
|
+
props: inProps,
|
|
82
|
+
name: constants_1.PREFIX
|
|
83
|
+
});
|
|
84
|
+
const { id = `live_stream_room_object_${props.liveStreamId ? props.liveStreamId : props.liveStream ? props.liveStream.id : ''}`, liveStreamId = null, liveStream = null, className, showPrejoinTitle = true, showPrejoinDescription = false, startPrejoinContent, endPrejoinContent, presetConnectionDetails, presetPreJoinChoices, LiveStreamVideoConferenceComponentProps = { options: { codec: 'vp8', hq: false } } } = props, rest = tslib_1.__rest(props, ["id", "liveStreamId", "liveStream", "className", "showPrejoinTitle", "showPrejoinDescription", "startPrejoinContent", "endPrejoinContent", "presetConnectionDetails", "presetPreJoinChoices", "LiveStreamVideoConferenceComponentProps"]);
|
|
85
|
+
// CONTEXT
|
|
86
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
87
|
+
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
88
|
+
const { preferences, features } = (0, react_core_1.useSCPreferences)();
|
|
89
|
+
// STATE
|
|
90
|
+
const { scLiveStream } = (0, react_core_1.useSCFetchLiveStream)({ id: liveStreamId, liveStream });
|
|
91
|
+
const [preJoinChoices, setPreJoinChoices] = (0, react_1.useState)(presetPreJoinChoices);
|
|
92
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
93
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
94
|
+
const preJoinDefaults = (0, react_1.useMemo)(() => {
|
|
95
|
+
var _a, _b, _c;
|
|
96
|
+
return {
|
|
97
|
+
username: ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) || '',
|
|
98
|
+
videoEnabled: ((_b = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo) === false,
|
|
99
|
+
audioEnabled: ((_c = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipants) === false
|
|
100
|
+
};
|
|
101
|
+
}, [scUserContext.user, scLiveStream]);
|
|
102
|
+
const [connectionDetails, setConnectionDetails] = (0, react_1.useState)(presetConnectionDetails);
|
|
103
|
+
const liveStreamEnabled = (0, react_1.useMemo)(() => preferences &&
|
|
104
|
+
features &&
|
|
105
|
+
features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
|
|
106
|
+
react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
|
|
107
|
+
preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [preferences, features]);
|
|
108
|
+
const scPreferencesContext = (0, react_1.useContext)(react_core_1.SCPreferencesContext);
|
|
109
|
+
const appUrl = (0, react_1.useMemo)(() => scPreferencesContext.preferences && scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_APP_URL].value, [scPreferencesContext.preferences]);
|
|
110
|
+
// INTL
|
|
111
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
112
|
+
// MESSAGES
|
|
113
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
114
|
+
// HANDLERS
|
|
115
|
+
/**
|
|
116
|
+
* Handle PreJoin Submit
|
|
117
|
+
*/
|
|
118
|
+
const handlePreJoinSubmit = (0, react_1.useCallback)((values) => {
|
|
119
|
+
if (scLiveStream || !loading) {
|
|
120
|
+
setLoading(true);
|
|
121
|
+
setError(null);
|
|
122
|
+
toggleAttrDisabledPrejoinActions(true);
|
|
123
|
+
api_services_1.LiveStreamService.join(scLiveStream.id)
|
|
124
|
+
.then((data) => {
|
|
125
|
+
setPreJoinChoices(values);
|
|
126
|
+
setConnectionDetails(Object.assign(Object.assign({}, data), { participantName: scUserContext.user.username }));
|
|
127
|
+
toggleAttrDisabledPrejoinActions(false);
|
|
128
|
+
setLoading(false);
|
|
129
|
+
})
|
|
130
|
+
.catch((error) => {
|
|
131
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
132
|
+
if (error.response &&
|
|
133
|
+
error.response.data &&
|
|
134
|
+
typeof error.response.data === 'object' &&
|
|
135
|
+
error.response.data.errors &&
|
|
136
|
+
error.response.data.errors.length) {
|
|
137
|
+
let _msg = ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.connect.error.generic", defaultMessage: "'ui.liveStreamRoom.connect.error.generic", values: { link: (...chunks) => (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: '/' }, { children: chunks })) } }));
|
|
138
|
+
if (error.response.data.errors[0].code) {
|
|
139
|
+
const _error = `ui.liveStreamRoom.connect.error.${(0, utils_1.camelCase)(error.response.data.errors[0].code)}`;
|
|
140
|
+
_msg = ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: _error, defaultMessage: _error, values: {
|
|
141
|
+
link: (...chunks) => ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ style: { color: '#FFF' }, to: error.response.data.errors[0].code !== types_1.SCLiveStreamConnectionDetailsErrorType.PARTICIPATE_THE_EVENT_TO_JOIN_LIVE_STREAM &&
|
|
142
|
+
scLiveStream.event
|
|
143
|
+
? scRoutingContext.url(react_core_1.SCRoutes.EVENTS_ROUTE_NAME, scLiveStream.event)
|
|
144
|
+
: '/' }, { children: chunks })))
|
|
145
|
+
} }));
|
|
146
|
+
if (error.response.data.errors[0].code !== types_1.SCLiveStreamConnectionDetailsErrorType.WAITING_HOST_TO_START_LIVE_STREAM &&
|
|
147
|
+
error.response.data.errors[0].code !== types_1.SCLiveStreamConnectionDetailsErrorType.PARTICIPANTS_LIMIT_REACHED) {
|
|
148
|
+
setError(_msg);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
setTimeout(() => toggleAttrDisabledPrejoinActions(false), 10000);
|
|
152
|
+
}
|
|
153
|
+
enqueueSnackbar(_msg, { variant: 'error', autoHideDuration: 5000 });
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
enqueueSnackbar(_msg, { variant: 'error' });
|
|
157
|
+
setError(_msg);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
setLoading(false);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}, [scUserContext.user, setPreJoinChoices, setConnectionDetails, scLiveStream, setError, loading]);
|
|
164
|
+
/**
|
|
165
|
+
* Handle disable controls button
|
|
166
|
+
*/
|
|
167
|
+
const toggleAttrDisabledPrejoinActions = (0, react_1.useCallback)((disabled) => {
|
|
168
|
+
const container = document.querySelector('.lk-prejoin');
|
|
169
|
+
if (container) {
|
|
170
|
+
const buttons = container.querySelectorAll('button.lk-button');
|
|
171
|
+
buttons.forEach((button) => {
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
173
|
+
// @ts-ignore
|
|
174
|
+
button.disabled = disabled;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}, []);
|
|
178
|
+
/**
|
|
179
|
+
* Handle PreJoin Error
|
|
180
|
+
*/
|
|
181
|
+
const handlePreJoinError = (0, react_1.useCallback)((e) => console.error(e), []);
|
|
182
|
+
/**
|
|
183
|
+
* User must be authenticated
|
|
184
|
+
*/
|
|
185
|
+
if (!scLiveStream || !scUserContext.user || !liveStreamEnabled) {
|
|
186
|
+
return (0, jsx_runtime_1.jsx)(material_1.CircularProgress, {});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Renders root object
|
|
190
|
+
*/
|
|
191
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: scLiveStream.closed_at_by_host ? ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ open: true, maxWidth: 'md', fullWidth: true }, { children: (0, jsx_runtime_1.jsxs)(DialogContent_1.default, Object.assign({ className: classes.endConferenceWrap }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.conference.closed", defaultMessage: "ui.liveStreamRoom.conference.closed" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: "secondary", component: react_core_1.Link, to: '/', className: classes.btnBackHome }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.button.backHome", defaultMessage: "ui.liveStreamRoom.button.backHome" }) }))] })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startPrejoinContent && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title) && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "h4", className: classes.title, alignContent: 'center' }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title }))), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: (0, classnames_1.default)(classes.preJoin, { [classes.preJoinLoading]: loading || error }) }, { children: [(0, jsx_runtime_1.jsx)(LiveStreamProvider_1.LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: (0, jsx_runtime_1.jsx)(PreJoin_1.PreJoin, { defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError, joinLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.joinRoom', defaultMessage: 'ui.liveStreamRoom.preJoin.joinRoom' }), micLabel: intl.formatMessage({
|
|
192
|
+
id: 'ui.liveStreamRoom.preJoin.microphone',
|
|
193
|
+
defaultMessage: 'ui.liveStreamRoom.preJoin.microphone'
|
|
194
|
+
}), camLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.camera', defaultMessage: 'ui.liveStreamRoom.preJoin.camera' }), userLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.username', defaultMessage: 'ui.liveStreamRoom.preJoin.username' }) }) })), loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.prejoinLoader }, { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.endPrejoinContent }, { children: [Boolean(scUserContext.user &&
|
|
195
|
+
scUserContext.user.id !== scLiveStream.host.id &&
|
|
196
|
+
scLiveStream &&
|
|
197
|
+
(((_a = scLiveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipants) || (scLiveStream && ((_b = scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo)))) && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ sx: { width: '47%' }, spacing: 1, className: classes.endPrejoinContentBox }, { children: [scLiveStream && (((_c = scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipants) || ((_d = scLiveStream.settings) === null || _d === void 0 ? void 0 : _d.disableVideo)) && ((0, jsx_runtime_1.jsxs)(material_1.Alert, Object.assign({ variant: "filled", severity: "info", className: classes.preJoinAlert }, { children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: (0, jsx_runtime_1.jsx)("b", { children: "Info" }) }), ((_e = scLiveStream.settings) === null || _e === void 0 ? void 0 : _e.muteParticipants) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["-", ' ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.hostDisableMicrophone", defaultMessage: "ui.liveStreamRoom.hostDisableMicrophone" }), (0, jsx_runtime_1.jsx)("br", {})] })), ((_f = scLiveStream.settings) === null || _f === void 0 ? void 0 : _f.disableVideo) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["- ", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.hostDisableVideo", defaultMessage: "ui.liveStreamRoom.hostDisableVideo" })] }))] }))), (0, jsx_runtime_1.jsx)(CopyTextArea_1.default, { className: classes.shareLink, value: `${appUrl}${scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream)}`, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.shareLink", defaultMessage: "ui.liveStreamRoom.shareLink" }) }), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description) && ((0, jsx_runtime_1.jsxs)(material_1.Alert, Object.assign({ variant: "filled", severity: "info", className: classes.description }, { children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.description", defaultMessage: "ui.liveStreamRoom.description" }) }) }), scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description] })))] }))), endPrejoinContent] }))] })) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.conference }, { children: (0, jsx_runtime_1.jsx)(LiveStreamProvider_1.LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: (0, jsx_runtime_1.jsx)(LiveStreamVideoConference_1.default, Object.assign({ connectionDetails: connectionDetails, userChoices: preJoinChoices }, LiveStreamVideoConferenceComponentProps)) })) }))) }))) })));
|
|
198
|
+
}
|
|
199
|
+
exports.default = LiveStreamRoom;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Track } from 'livekit-client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** @public */
|
|
4
|
+
export type ControlBarControls = {
|
|
5
|
+
microphone?: boolean;
|
|
6
|
+
camera?: boolean;
|
|
7
|
+
chat?: boolean;
|
|
8
|
+
screenShare?: boolean;
|
|
9
|
+
leave?: boolean;
|
|
10
|
+
settings?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export interface ControlBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
onDeviceError?: (error: {
|
|
14
|
+
source: Track.Source;
|
|
15
|
+
error: Error;
|
|
16
|
+
}) => void;
|
|
17
|
+
variation?: 'minimal' | 'verbose' | 'textOnly';
|
|
18
|
+
controls?: ControlBarControls;
|
|
19
|
+
/**
|
|
20
|
+
* If `true`, the user's device choices will be persisted.
|
|
21
|
+
* This will enable the user to have the same device choices when they rejoin the room.
|
|
22
|
+
*/
|
|
23
|
+
saveUserChoices?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The `ControlBar` prefab gives the user the basic user interface to control their
|
|
27
|
+
* media devices (camera, microphone and screen share), open the `Chat` and leave the room.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ControlBar({ variation, controls, saveUserChoices, onDeviceError, ...props }: ControlBarProps): JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ControlBar = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const livekit_client_1 = require("livekit-client");
|
|
7
|
+
const React = tslib_1.__importStar(require("react"));
|
|
8
|
+
const components_core_1 = require("@livekit/components-core");
|
|
9
|
+
const components_react_1 = require("@livekit/components-react");
|
|
10
|
+
const TrackToggle_1 = require("./TrackToggle");
|
|
11
|
+
const material_1 = require("@mui/material");
|
|
12
|
+
const SettingsMenuToggle_1 = require("./SettingsMenuToggle");
|
|
13
|
+
const DisconnectButton_1 = require("./DisconnectButton");
|
|
14
|
+
const utils_1 = require("./utils");
|
|
15
|
+
/**
|
|
16
|
+
* The `ControlBar` prefab gives the user the basic user interface to control their
|
|
17
|
+
* media devices (camera, microphone and screen share), open the `Chat` and leave the room.
|
|
18
|
+
*/
|
|
19
|
+
function ControlBar(_a) {
|
|
20
|
+
var _b, _c, _d, _e, _f;
|
|
21
|
+
var { variation, controls, saveUserChoices = true, onDeviceError } = _a, props = tslib_1.__rest(_a, ["variation", "controls", "saveUserChoices", "onDeviceError"]);
|
|
22
|
+
const [isChatOpen, setIsChatOpen] = React.useState(false);
|
|
23
|
+
const layoutContext = (0, components_react_1.useMaybeLayoutContext)();
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
if (((_a = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.widget.state) === null || _a === void 0 ? void 0 : _a.showChat) !== undefined) {
|
|
27
|
+
setIsChatOpen((_b = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.widget.state) === null || _b === void 0 ? void 0 : _b.showChat);
|
|
28
|
+
}
|
|
29
|
+
}, [(_b = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.widget.state) === null || _b === void 0 ? void 0 : _b.showChat]);
|
|
30
|
+
const isTooLittleSpace = (0, material_1.useMediaQuery)(`(max-width: ${isChatOpen ? 1000 : 760}px)`);
|
|
31
|
+
const defaultVariation = isTooLittleSpace ? 'minimal' : 'verbose';
|
|
32
|
+
variation !== null && variation !== void 0 ? variation : (variation = defaultVariation);
|
|
33
|
+
const visibleControls = Object.assign({ leave: true }, controls);
|
|
34
|
+
const localPermissions = (0, components_react_1.useLocalParticipantPermissions)();
|
|
35
|
+
if (!localPermissions) {
|
|
36
|
+
visibleControls.camera = false;
|
|
37
|
+
visibleControls.chat = false;
|
|
38
|
+
visibleControls.microphone = false;
|
|
39
|
+
visibleControls.screenShare = false;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
(_c = visibleControls.camera) !== null && _c !== void 0 ? _c : (visibleControls.camera = localPermissions.canPublish);
|
|
43
|
+
(_d = visibleControls.microphone) !== null && _d !== void 0 ? _d : (visibleControls.microphone = localPermissions.canPublish);
|
|
44
|
+
(_e = visibleControls.screenShare) !== null && _e !== void 0 ? _e : (visibleControls.screenShare = localPermissions.canPublish);
|
|
45
|
+
(_f = visibleControls.chat) !== null && _f !== void 0 ? _f : (visibleControls.chat = localPermissions.canPublishData && (controls === null || controls === void 0 ? void 0 : controls.chat));
|
|
46
|
+
}
|
|
47
|
+
const showIcon = React.useMemo(() => variation === 'minimal' || variation === 'verbose', [variation]);
|
|
48
|
+
const showText = React.useMemo(() => variation === 'textOnly' || variation === 'verbose', [variation]);
|
|
49
|
+
const browserSupportsScreenSharing = (0, components_core_1.supportsScreenSharing)();
|
|
50
|
+
const [isScreenShareEnabled, setIsScreenShareEnabled] = React.useState(false);
|
|
51
|
+
const onScreenShareChange = React.useCallback((enabled) => {
|
|
52
|
+
setIsScreenShareEnabled(enabled);
|
|
53
|
+
}, [setIsScreenShareEnabled]);
|
|
54
|
+
const htmlProps = (0, utils_1.mergeProps)({ className: 'lk-control-bar' }, props);
|
|
55
|
+
const { saveAudioInputEnabled, saveVideoInputEnabled, saveAudioInputDeviceId, saveVideoInputDeviceId } = (0, components_react_1.usePersistentUserChoices)({
|
|
56
|
+
preventSave: !saveUserChoices
|
|
57
|
+
});
|
|
58
|
+
const microphoneOnChange = React.useCallback((enabled, isUserInitiated) => (isUserInitiated ? saveAudioInputEnabled(enabled) : null), [saveAudioInputEnabled]);
|
|
59
|
+
const cameraOnChange = React.useCallback((enabled, isUserInitiated) => (isUserInitiated ? saveVideoInputEnabled(enabled) : null), [saveVideoInputEnabled]);
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, htmlProps, { children: [visibleControls.microphone && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group" }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.Microphone, showIcon: showIcon, onChange: microphoneOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.Microphone, error }) }, { children: showText && 'Microphone' })) }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { kind: "audioinput", onActiveDeviceChange: (_kind, deviceId) => saveAudioInputDeviceId(deviceId !== null && deviceId !== void 0 ? deviceId : '') }) }))] }))), visibleControls.camera && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group" }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.Camera, showIcon: showIcon, onChange: cameraOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.Camera, error }) }, { children: showText && 'Camera' })) }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { kind: "videoinput", onActiveDeviceChange: (_kind, deviceId) => saveVideoInputDeviceId(deviceId !== null && deviceId !== void 0 ? deviceId : '') }) }))] }))), visibleControls.screenShare && browserSupportsScreenSharing && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.ScreenShare, captureOptions: { audio: true, selfBrowserSurface: 'include', surfaceSwitching: 'exclude' }, showIcon: showIcon, onChange: onScreenShareChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.ScreenShare, error }) }, { children: showText && (isScreenShareEnabled ? 'Stop screen share' : 'Share screen') })) })), visibleControls.chat && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_react_1.ChatToggle, { children: [showIcon && (0, jsx_runtime_1.jsx)(components_react_1.ChatIcon, {}), showText && 'Chat'] }) })), visibleControls.settings && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(SettingsMenuToggle_1.SettingsMenuToggle, { children: [showIcon && (0, jsx_runtime_1.jsx)(components_react_1.GearIcon, {}), showText && 'Settings'] }) })), visibleControls.leave && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(DisconnectButton_1.DisconnectButton, { children: [showIcon && (0, jsx_runtime_1.jsx)(components_react_1.LeaveIcon, {}), showText && 'Leave'] }) })), (0, jsx_runtime_1.jsx)(components_react_1.StartMediaButton, {})] })));
|
|
61
|
+
}
|
|
62
|
+
exports.ControlBar = ControlBar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface DisconnectButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
stopTracks?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The `DisconnectButton` is a basic html button with the added ability to disconnect from a LiveKit room.
|
|
8
|
+
* Normally this is the big red button that allows end users to leave the video or audio call.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DisconnectButton: (props: DisconnectButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactNode;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisconnectButton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
7
|
+
const components_react_1 = require("@livekit/components-react");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
10
|
+
const LiveStreamProvider_1 = require("./LiveStreamProvider");
|
|
11
|
+
const react_intl_1 = require("react-intl");
|
|
12
|
+
const material_1 = require("@mui/material");
|
|
13
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
14
|
+
const ConfirmDialog_1 = tslib_1.__importDefault(require("../../../shared/ConfirmDialog/ConfirmDialog"));
|
|
15
|
+
/**
|
|
16
|
+
* The `DisconnectButton` is a basic html button with the added ability to disconnect from a LiveKit room.
|
|
17
|
+
* Normally this is the big red button that allows end users to leave the video or audio call.
|
|
18
|
+
*/
|
|
19
|
+
exports.DisconnectButton =
|
|
20
|
+
/* @__PURE__ */ React.forwardRef(function DisconnectButton(props, ref) {
|
|
21
|
+
// CONTEXT
|
|
22
|
+
const { liveStream } = (0, LiveStreamProvider_1.useLiveStream)();
|
|
23
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
24
|
+
// STATE
|
|
25
|
+
const [closeLive, setCloseLive] = (0, react_1.useState)(false);
|
|
26
|
+
const [openConfirmDialog, setOpenConfirmDialog] = (0, react_1.useState)(false);
|
|
27
|
+
const [isUpdating, setIsUpdating] = (0, react_1.useState)(false);
|
|
28
|
+
const { buttonProps } = (0, components_react_1.useDisconnectButton)(props);
|
|
29
|
+
const { onClick } = buttonProps, rest = tslib_1.__rest(buttonProps, ["onClick"]);
|
|
30
|
+
/**
|
|
31
|
+
* Intercept fist leave action
|
|
32
|
+
*/
|
|
33
|
+
const handleOnLeave = (0, react_1.useCallback)(() => {
|
|
34
|
+
if (liveStream && scUserContext.user.id === liveStream.host.id) {
|
|
35
|
+
setOpenConfirmDialog(true);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
39
|
+
}
|
|
40
|
+
}, [setOpenConfirmDialog, liveStream, scUserContext.user]);
|
|
41
|
+
/**
|
|
42
|
+
* Control close live
|
|
43
|
+
*/
|
|
44
|
+
const handleChangeCloseLive = (0, react_1.useCallback)((event) => {
|
|
45
|
+
setCloseLive(event.target.checked);
|
|
46
|
+
}, [closeLive]);
|
|
47
|
+
/**
|
|
48
|
+
* Perform set liveStream as closed
|
|
49
|
+
*/
|
|
50
|
+
const performCloseLiveStream = (0, react_1.useMemo)(() => () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const res = yield api_services_1.LiveStreamApiClient.close(liveStream.id);
|
|
52
|
+
if (res.status >= 300) {
|
|
53
|
+
return Promise.reject(res);
|
|
54
|
+
}
|
|
55
|
+
return yield Promise.resolve(res.data);
|
|
56
|
+
}), [liveStream]);
|
|
57
|
+
/**
|
|
58
|
+
* Perform patch liveStream before leave the live
|
|
59
|
+
*/
|
|
60
|
+
const handleLeaveAction = () => {
|
|
61
|
+
if (!isUpdating && liveStream && scUserContext.user.id === liveStream.host.id && closeLive) {
|
|
62
|
+
setIsUpdating(true);
|
|
63
|
+
performCloseLiveStream()
|
|
64
|
+
.then(() => {
|
|
65
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
66
|
+
})
|
|
67
|
+
.catch((error) => {
|
|
68
|
+
console.error(error);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", Object.assign({ ref: ref }, rest, { onClick: handleOnLeave }, { children: props.children })), openConfirmDialog && ((0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { open: openConfirmDialog, title: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), content: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.live.terminate", defaultMessage: "ui.liveStreamRoom.live.terminate" }), (0, jsx_runtime_1.jsx)(material_1.FormGroup, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: closeLive, onChange: handleChangeCloseLive, inputProps: { 'aria-label': 'controlled' } }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.live.terminatePermanently", defaultMessage: "ui.liveStreamRoom.live.terminatePermanently" }) }) })] }), onConfirm: handleLeaveAction, isUpdating: isUpdating, onClose: () => setOpenConfirmDialog(false) }))] }));
|
|
76
|
+
});
|