@selfcommunity/react-ui 0.10.5-alpha.2 → 0.10.5-alpha.4
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 +92 -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/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 +59 -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/asUploadButton.d.ts +1 -1
- package/lib/cjs/components/EventMembersWidget/types.d.ts +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/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/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/asUploadButton.d.ts +1 -1
- 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 +89 -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/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 +59 -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/asUploadButton.d.ts +1 -1
- package/lib/esm/components/EventMembersWidget/types.d.ts +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/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/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/asUploadButton.d.ts +1 -1
- 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,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const react_intl_1 = require("react-intl");
|
|
8
|
+
const Popper_1 = tslib_1.__importDefault(require("@mui/material/Popper"));
|
|
9
|
+
const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
|
|
10
|
+
const notistack_1 = require("notistack");
|
|
11
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
|
+
const material_1 = require("@mui/material");
|
|
13
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
14
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const ConfirmDialog_1 = tslib_1.__importDefault(require("../../../shared/ConfirmDialog/ConfirmDialog"));
|
|
17
|
+
const components_react_1 = require("@livekit/components-react");
|
|
18
|
+
const LiveStreamProvider_1 = require("./LiveStreamProvider");
|
|
19
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
20
|
+
const Errors_1 = require("../../../constants/Errors");
|
|
21
|
+
const PREFIX = 'SCParticipantTileActionsMenu';
|
|
22
|
+
const classes = {
|
|
23
|
+
root: `${PREFIX}-root`,
|
|
24
|
+
button: `${PREFIX}-button`,
|
|
25
|
+
popperRoot: `${PREFIX}-popper-root`,
|
|
26
|
+
paper: `${PREFIX}-paper`,
|
|
27
|
+
item: `${PREFIX}-item`,
|
|
28
|
+
itemText: `${PREFIX}-item-text`,
|
|
29
|
+
subItem: `${PREFIX}-sub-item`,
|
|
30
|
+
subItemText: `${PREFIX}-sub-item-text`,
|
|
31
|
+
footerSubItems: `${PREFIX}-footer-sub-items`,
|
|
32
|
+
selectedIcon: `${PREFIX}-selected-icon`,
|
|
33
|
+
sectionBadge: `${PREFIX}-section-badge`,
|
|
34
|
+
sectionWithSelectionIcon: `${PREFIX}-section-with-selection-icon`,
|
|
35
|
+
visibilityIcons: `${PREFIX}-visibility-icons`
|
|
36
|
+
};
|
|
37
|
+
const PopperRoot = (0, styles_1.styled)(Popper_1.default, {
|
|
38
|
+
name: PREFIX,
|
|
39
|
+
slot: 'Root',
|
|
40
|
+
overridesResolver: (props, styles) => styles.popperRoot
|
|
41
|
+
})(() => ({
|
|
42
|
+
'& .SCParticipantTileActionsMenu-paper': {
|
|
43
|
+
borderRadius: 5
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
47
|
+
name: PREFIX,
|
|
48
|
+
slot: 'Root',
|
|
49
|
+
overridesResolver: (props, styles) => styles.root
|
|
50
|
+
})(({ theme }) => ({
|
|
51
|
+
display: 'inline-block',
|
|
52
|
+
'& button': {
|
|
53
|
+
color: theme.palette.common.white
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
function ContributionActionsMenu(props) {
|
|
57
|
+
// PROPS
|
|
58
|
+
const { className, participant, onRemoveParticipant, onBanParticipant, PopperProps = {} } = props, rest = tslib_1.__rest(props, ["className", "participant", "onRemoveParticipant", "onBanParticipant", "PopperProps"]);
|
|
59
|
+
// CONTEXT
|
|
60
|
+
const theme = (0, material_1.useTheme)();
|
|
61
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
62
|
+
const scContext = (0, react_1.useContext)(react_core_1.SCContext);
|
|
63
|
+
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
64
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
65
|
+
const p = (0, components_react_1.useEnsureParticipant)(participant);
|
|
66
|
+
const { liveStream } = (0, LiveStreamProvider_1.useLiveStream)();
|
|
67
|
+
// GENERAL POPPER STATE
|
|
68
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
69
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(false);
|
|
70
|
+
// CONFIRM ACTION DIALOG STATE
|
|
71
|
+
const [openConfirmDialog, setOpenConfirmDialog] = (0, react_1.useState)(false);
|
|
72
|
+
const [currentAction, setCurrentAction] = (0, react_1.useState)(null);
|
|
73
|
+
const [currentActionLoading, setCurrentActionLoading] = (0, react_1.useState)(null);
|
|
74
|
+
// CONST
|
|
75
|
+
let popperRef = (0, react_1.useRef)(null);
|
|
76
|
+
/**
|
|
77
|
+
* Handles open popup
|
|
78
|
+
*/
|
|
79
|
+
function handleOpen() {
|
|
80
|
+
if (scUserContext.user) {
|
|
81
|
+
setOpen(true);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
scContext.settings.handleAnonymousAction();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Closes popup
|
|
89
|
+
*/
|
|
90
|
+
function handleClose() {
|
|
91
|
+
if (popperRef.current && popperRef.current.contains(event.target)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
setOpen(false);
|
|
95
|
+
if (rest.onClose) {
|
|
96
|
+
rest.onClose();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Perform ban participant
|
|
101
|
+
*/
|
|
102
|
+
const performRemoveOrBanParticipant = (0, react_1.useMemo)(() => (ban = false) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const res = yield api_services_1.LiveStreamApiClient.removeParticipant(liveStream.id, { participant_id: p.identity, ban });
|
|
104
|
+
if (res.status >= 300) {
|
|
105
|
+
return Promise.reject(res);
|
|
106
|
+
}
|
|
107
|
+
return yield Promise.resolve(res.data);
|
|
108
|
+
}), [p]);
|
|
109
|
+
/**
|
|
110
|
+
* Handle action
|
|
111
|
+
*/
|
|
112
|
+
function handleAction(action) {
|
|
113
|
+
if ([constants_1.REMOVE_ROOM_USER, constants_1.BAN_ROOM_USER].indexOf(action) > -1) {
|
|
114
|
+
setCurrentAction(action);
|
|
115
|
+
setOpenConfirmDialog(true);
|
|
116
|
+
handleClose();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Perform additional operations at the end of single action
|
|
121
|
+
*/
|
|
122
|
+
function performPostConfirmAction(success) {
|
|
123
|
+
if (success) {
|
|
124
|
+
setCurrentActionLoading(null);
|
|
125
|
+
setCurrentAction(null);
|
|
126
|
+
setOpenConfirmDialog(false);
|
|
127
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.actionSuccess", defaultMessage: "ui.contributionActionMenu.actionSuccess" }), {
|
|
128
|
+
variant: 'success',
|
|
129
|
+
autoHideDuration: 3000
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
setCurrentActionLoading(null);
|
|
134
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.actionError", defaultMessage: "ui.contributionActionMenu.actionError" }), {
|
|
135
|
+
variant: 'error',
|
|
136
|
+
autoHideDuration: 3000
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Delete a contribution
|
|
142
|
+
*/
|
|
143
|
+
function handleConfirmedAction() {
|
|
144
|
+
if (p && !isLoading && !currentActionLoading) {
|
|
145
|
+
if (currentAction === constants_1.REMOVE_ROOM_USER) {
|
|
146
|
+
setCurrentActionLoading(constants_1.REMOVE_ROOM_USER);
|
|
147
|
+
performRemoveOrBanParticipant()
|
|
148
|
+
.then(() => {
|
|
149
|
+
onRemoveParticipant && onRemoveParticipant(p);
|
|
150
|
+
performPostConfirmAction(true);
|
|
151
|
+
})
|
|
152
|
+
.catch((error) => {
|
|
153
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
154
|
+
performPostConfirmAction(false);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else if (currentAction === constants_1.BAN_ROOM_USER) {
|
|
158
|
+
setCurrentActionLoading(constants_1.BAN_ROOM_USER);
|
|
159
|
+
performRemoveOrBanParticipant(true)
|
|
160
|
+
.then(() => {
|
|
161
|
+
onBanParticipant && onBanParticipant(p);
|
|
162
|
+
performPostConfirmAction(true);
|
|
163
|
+
})
|
|
164
|
+
.catch((error) => {
|
|
165
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
166
|
+
performPostConfirmAction(false);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Can authenticated ban a user in a room
|
|
173
|
+
*/
|
|
174
|
+
const canRemoveOrBanUser = (0, react_1.useMemo)(() => () => {
|
|
175
|
+
return (scUserContext.user &&
|
|
176
|
+
liveStream &&
|
|
177
|
+
p &&
|
|
178
|
+
p.identity &&
|
|
179
|
+
liveStream.host.id === scUserContext.user.id &&
|
|
180
|
+
scUserContext.user.id.toString() !== p.identity);
|
|
181
|
+
}, [scUserContext, liveStream, p]);
|
|
182
|
+
/**
|
|
183
|
+
* Renders section general
|
|
184
|
+
*/
|
|
185
|
+
function renderGeneralSection() {
|
|
186
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: canRemoveOrBanUser() && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: currentActionLoading === constants_1.REMOVE_ROOM_USER }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "person" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.removeRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.removeRoomUser" }), onClick: () => handleAction(constants_1.REMOVE_ROOM_USER), classes: { root: classes.itemText } })] })), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: currentActionLoading === constants_1.BAN_ROOM_USER }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "error" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.banRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.banRoomUser" }), onClick: () => handleAction(constants_1.BAN_ROOM_USER), classes: { root: classes.itemText } })] }))] })) }));
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Renders contribution menu content
|
|
190
|
+
*/
|
|
191
|
+
function renderContent() {
|
|
192
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(material_1.MenuList, { children: renderGeneralSection() }) }));
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Renders component only if the logged user has actions available
|
|
196
|
+
*/
|
|
197
|
+
if (!canRemoveOrBanUser()) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Renders component
|
|
202
|
+
*/
|
|
203
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ ref: (ref) => {
|
|
204
|
+
popperRef.current = ref;
|
|
205
|
+
}, "aria-haspopup": "true", onClick: handleOpen, className: classes.button, size: "small" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "expand_more" }) })), isMobile ? ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open: open, onClose: handleClose, onOpen: handleOpen, anchor: "bottom", disableSwipeToOpen: true }, { children: renderContent() }))) : ((0, jsx_runtime_1.jsx)(PopperRoot, Object.assign({ open: open, anchorEl: popperRef.current, role: undefined, transition: true, className: classes.popperRoot }, PopperProps, { placement: "right" }, { children: ({ TransitionProps, placement }) => ((0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ variant: 'outlined', className: classes.paper }, { children: (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, Object.assign({ onClickAway: handleClose }, { children: renderContent() })) })) }))) }))), openConfirmDialog && ((0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, Object.assign({ open: openConfirmDialog }, (currentAction === constants_1.REMOVE_ROOM_USER
|
|
206
|
+
? {
|
|
207
|
+
content: ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.removeRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.removeRoomUser" }))
|
|
208
|
+
}
|
|
209
|
+
: currentAction === constants_1.BAN_ROOM_USER
|
|
210
|
+
? {
|
|
211
|
+
content: ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.banRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.banRoomUser" }))
|
|
212
|
+
}
|
|
213
|
+
: {}), { onConfirm: handleConfirmedAction, isUpdating: Boolean(currentActionLoading), onClose: () => setOpenConfirmDialog(false) })))] })));
|
|
214
|
+
}
|
|
215
|
+
exports.default = ContributionActionsMenu;
|
package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SCUserType } from '@selfcommunity/types';
|
|
2
|
+
export interface ParticipantTileAvatarProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* User Object
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
user?: SCUserType;
|
|
9
|
+
/**
|
|
10
|
+
* User Object
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
participant?: any;
|
|
14
|
+
}
|
|
15
|
+
export default function ParticipantTileAvatar(inProps: ParticipantTileAvatarProps): JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const system_1 = require("@mui/system");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
|
+
const ParticipantPlaceholder_1 = tslib_1.__importDefault(require("./ParticipantPlaceholder"));
|
|
10
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
|
+
const PREFIX = 'SCParticipantTileAvatar';
|
|
12
|
+
const classes = {
|
|
13
|
+
root: `${PREFIX}-root`
|
|
14
|
+
};
|
|
15
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
16
|
+
name: PREFIX,
|
|
17
|
+
slot: 'Root',
|
|
18
|
+
overridesResolver: (props, styles) => styles.root
|
|
19
|
+
})(({ theme }) => ({
|
|
20
|
+
height: 'auto !important',
|
|
21
|
+
'& img': {
|
|
22
|
+
borderRadius: '50%',
|
|
23
|
+
width: 100,
|
|
24
|
+
height: 100
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
function ParticipantTileAvatar(inProps) {
|
|
28
|
+
// PROPS
|
|
29
|
+
const props = (0, system_1.useThemeProps)({
|
|
30
|
+
props: inProps,
|
|
31
|
+
name: PREFIX
|
|
32
|
+
});
|
|
33
|
+
const { className, user, participant } = props, rest = tslib_1.__rest(props, ["className", "user", "participant"]);
|
|
34
|
+
// CONTEXT
|
|
35
|
+
const scContext = (0, react_core_1.useSCContext)();
|
|
36
|
+
// RENDER
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: user ? ((0, jsx_runtime_1.jsx)("img", { src: `${user.avatar}` })) : participant && participant.identity ? ((0, jsx_runtime_1.jsx)("img", { src: `${scContext.settings.portal}/api/v2/avatar/${participant.identity}` })) : ((0, jsx_runtime_1.jsx)(ParticipantPlaceholder_1.default, {})) })));
|
|
38
|
+
}
|
|
39
|
+
exports.default = ParticipantTileAvatar;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { CreateLocalTracksOptions, LocalAudioTrack, LocalTrack, LocalVideoTrack } from 'livekit-client';
|
|
2
|
+
import { Track } from 'livekit-client';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import type { LocalUserChoices } from '@livekit/components-core';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the PreJoin component.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface PreJoinProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSubmit' | 'onError'> {
|
|
10
|
+
/** This function is called with the `LocalUserChoices` if validation is passed. */
|
|
11
|
+
onSubmit?: (values: LocalUserChoices) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Provide your custom validation function. Only if validation is successful the user choices are past to the onSubmit callback.
|
|
14
|
+
*/
|
|
15
|
+
onValidate?: (values: LocalUserChoices) => boolean;
|
|
16
|
+
onError?: (error: Error) => void;
|
|
17
|
+
/** Prefill the input form with initial values. */
|
|
18
|
+
defaults?: Partial<LocalUserChoices>;
|
|
19
|
+
/** Display a debug window for your convenience. */
|
|
20
|
+
debug?: boolean;
|
|
21
|
+
joinLabel?: string;
|
|
22
|
+
micLabel?: string;
|
|
23
|
+
camLabel?: string;
|
|
24
|
+
userLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* If true, user choices are persisted across sessions.
|
|
27
|
+
* @defaultValue true
|
|
28
|
+
* @alpha
|
|
29
|
+
*/
|
|
30
|
+
persistUserChoices?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** @alpha */
|
|
33
|
+
export declare function usePreviewTracks(options: CreateLocalTracksOptions, onError?: (err: Error) => void): LocalTrack<Track.Kind>[];
|
|
34
|
+
/** @public */
|
|
35
|
+
export declare function usePreviewDevice<T extends LocalVideoTrack | LocalAudioTrack>(enabled: boolean, deviceId: string, kind: 'videoinput' | 'audioinput'): {
|
|
36
|
+
selectedDevice: MediaDeviceInfo;
|
|
37
|
+
localTrack: T;
|
|
38
|
+
deviceError: Error;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The `PreJoin` prefab component is normally presented to the user before he enters a room.
|
|
42
|
+
* This component allows the user to check and select the preferred media device (camera und microphone).
|
|
43
|
+
* On submit the user decisions are returned, which can then be passed on to the `LiveKitRoom` so that the user enters the room with the correct media devices.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* This component is independent of the `LiveKitRoom` component and should not be nested within it.
|
|
47
|
+
* Because it only accesses the local media tracks this component is self-contained and works without connection to the LiveKit server.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <PreJoin />
|
|
52
|
+
* ```
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export declare function PreJoin({ defaults, onValidate, onSubmit, onError, debug, joinLabel, micLabel, camLabel, userLabel, persistUserChoices, ...htmlProps }: PreJoinProps): JSX.Element;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreJoin = exports.usePreviewDevice = exports.usePreviewTracks = 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_core_2 = require("@livekit/components-core");
|
|
10
|
+
const components_react_1 = require("@livekit/components-react");
|
|
11
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
12
|
+
const ParticipantTileAvatar_1 = tslib_1.__importDefault(require("./ParticipantTileAvatar"));
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const TrackToggle_1 = require("./TrackToggle");
|
|
15
|
+
const LiveStreamProvider_1 = require("./LiveStreamProvider");
|
|
16
|
+
/** @alpha */
|
|
17
|
+
function usePreviewTracks(options, onError) {
|
|
18
|
+
const [tracks, setTracks] = React.useState();
|
|
19
|
+
const trackLock = React.useMemo(() => new livekit_client_1.Mutex(), []);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
let needsCleanup = false;
|
|
22
|
+
let localTracks = [];
|
|
23
|
+
trackLock.lock().then((unlock) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
try {
|
|
25
|
+
if (options.audio || options.video) {
|
|
26
|
+
localTracks = yield (0, livekit_client_1.createLocalTracks)(options);
|
|
27
|
+
if (needsCleanup) {
|
|
28
|
+
localTracks.forEach((tr) => tr.stop());
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
setTracks(localTracks);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
if (onError && e instanceof Error) {
|
|
37
|
+
onError(e);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
components_core_1.log.error(e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
unlock();
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
return () => {
|
|
48
|
+
needsCleanup = true;
|
|
49
|
+
localTracks.forEach((track) => {
|
|
50
|
+
track.stop();
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
}, [JSON.stringify(options), onError, trackLock]);
|
|
54
|
+
return tracks;
|
|
55
|
+
}
|
|
56
|
+
exports.usePreviewTracks = usePreviewTracks;
|
|
57
|
+
/** @public */
|
|
58
|
+
function usePreviewDevice(enabled, deviceId, kind) {
|
|
59
|
+
const [deviceError, setDeviceError] = React.useState(null);
|
|
60
|
+
const [isCreatingTrack, setIsCreatingTrack] = React.useState(false);
|
|
61
|
+
const devices = (0, components_react_1.useMediaDevices)({ kind });
|
|
62
|
+
const [selectedDevice, setSelectedDevice] = React.useState(undefined);
|
|
63
|
+
const [localTrack, setLocalTrack] = React.useState();
|
|
64
|
+
const [localDeviceId, setLocalDeviceId] = React.useState(deviceId);
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
setLocalDeviceId(deviceId);
|
|
67
|
+
}, [deviceId]);
|
|
68
|
+
const createTrack = (deviceId, kind) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
try {
|
|
70
|
+
const track = kind === 'videoinput'
|
|
71
|
+
? yield (0, livekit_client_1.createLocalVideoTrack)({
|
|
72
|
+
deviceId: deviceId,
|
|
73
|
+
resolution: livekit_client_1.VideoPresets.h720.resolution
|
|
74
|
+
})
|
|
75
|
+
: yield (0, livekit_client_1.createLocalAudioTrack)({ deviceId });
|
|
76
|
+
const newDeviceId = yield track.getDeviceId();
|
|
77
|
+
if (newDeviceId && deviceId !== newDeviceId) {
|
|
78
|
+
prevDeviceId.current = newDeviceId;
|
|
79
|
+
setLocalDeviceId(newDeviceId);
|
|
80
|
+
}
|
|
81
|
+
setLocalTrack(track);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
if (e instanceof Error) {
|
|
85
|
+
setDeviceError(e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const switchDevice = (track, id) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
yield track.setDeviceId(id);
|
|
91
|
+
prevDeviceId.current = id;
|
|
92
|
+
});
|
|
93
|
+
const prevDeviceId = React.useRef(localDeviceId);
|
|
94
|
+
React.useEffect(() => {
|
|
95
|
+
if (enabled && !localTrack && !deviceError && !isCreatingTrack) {
|
|
96
|
+
components_core_1.log.debug('creating track', kind);
|
|
97
|
+
setIsCreatingTrack(true);
|
|
98
|
+
createTrack(localDeviceId, kind).finally(() => {
|
|
99
|
+
setIsCreatingTrack(false);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}, [enabled, localTrack, deviceError, isCreatingTrack]);
|
|
103
|
+
// switch camera device
|
|
104
|
+
React.useEffect(() => {
|
|
105
|
+
if (!localTrack) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (!enabled) {
|
|
109
|
+
components_core_1.log.debug(`muting ${kind} track`);
|
|
110
|
+
localTrack.mute().then(() => components_core_1.log.debug(localTrack.mediaStreamTrack));
|
|
111
|
+
}
|
|
112
|
+
else if ((selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.deviceId) && prevDeviceId.current !== (selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.deviceId)) {
|
|
113
|
+
components_core_1.log.debug(`switching ${kind} device from`, prevDeviceId.current, selectedDevice.deviceId);
|
|
114
|
+
switchDevice(localTrack, selectedDevice.deviceId);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
components_core_1.log.debug(`unmuting local ${kind} track`);
|
|
118
|
+
localTrack.unmute();
|
|
119
|
+
}
|
|
120
|
+
}, [localTrack, selectedDevice, enabled, kind]);
|
|
121
|
+
React.useEffect(() => {
|
|
122
|
+
return () => {
|
|
123
|
+
if (localTrack) {
|
|
124
|
+
components_core_1.log.debug(`stopping local ${kind} track`);
|
|
125
|
+
localTrack.stop();
|
|
126
|
+
localTrack.mute();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}, []);
|
|
130
|
+
React.useEffect(() => {
|
|
131
|
+
setSelectedDevice(devices === null || devices === void 0 ? void 0 : devices.find((dev) => dev.deviceId === localDeviceId));
|
|
132
|
+
}, [localDeviceId, devices]);
|
|
133
|
+
return {
|
|
134
|
+
selectedDevice,
|
|
135
|
+
localTrack,
|
|
136
|
+
deviceError
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
exports.usePreviewDevice = usePreviewDevice;
|
|
140
|
+
/**
|
|
141
|
+
* The `PreJoin` prefab component is normally presented to the user before he enters a room.
|
|
142
|
+
* This component allows the user to check and select the preferred media device (camera und microphone).
|
|
143
|
+
* On submit the user decisions are returned, which can then be passed on to the `LiveKitRoom` so that the user enters the room with the correct media devices.
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* This component is independent of the `LiveKitRoom` component and should not be nested within it.
|
|
147
|
+
* Because it only accesses the local media tracks this component is self-contained and works without connection to the LiveKit server.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```tsx
|
|
151
|
+
* <PreJoin />
|
|
152
|
+
* ```
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
function PreJoin(_a) {
|
|
156
|
+
var { defaults = {}, onValidate, onSubmit, onError, debug, joinLabel = 'Join Room', micLabel = 'Microphone', camLabel = 'Camera', userLabel = 'Username', persistUserChoices = true } = _a, htmlProps = tslib_1.__rest(_a, ["defaults", "onValidate", "onSubmit", "onError", "debug", "joinLabel", "micLabel", "camLabel", "userLabel", "persistUserChoices"]);
|
|
157
|
+
const { liveStream } = (0, LiveStreamProvider_1.useLiveStream)();
|
|
158
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
159
|
+
const [userChoices, setUserChoices] = React.useState(components_core_2.defaultUserChoices);
|
|
160
|
+
const canUseAudio = (0, react_1.useMemo)(() => { var _a; return scUserContext.user && liveStream && (liveStream.host.id === scUserContext.user.id || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipants))); }, [scUserContext, liveStream]);
|
|
161
|
+
const canUseVideo = (0, react_1.useMemo)(() => { var _a; return scUserContext.user && liveStream && (liveStream.host.id === scUserContext.user.id || (liveStream && !((_a = liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) === null || _a === void 0 ? void 0 : _a.disableVideo))); }, [scUserContext, liveStream]);
|
|
162
|
+
// TODO: Remove and pipe `defaults` object directly into `usePersistentUserChoices` once we fully switch from type `LocalUserChoices` to `UserChoices`.
|
|
163
|
+
const partialDefaults = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (defaults.audioDeviceId !== undefined && { audioDeviceId: defaults.audioDeviceId })), (defaults.videoDeviceId !== undefined && { videoDeviceId: defaults.videoDeviceId })), (defaults.audioEnabled !== undefined && { audioEnabled: defaults.audioEnabled })), (defaults.videoEnabled !== undefined && { videoEnabled: defaults.videoEnabled })), (defaults.username !== undefined && { username: defaults.username }));
|
|
164
|
+
const { userChoices: initialUserChoices, saveAudioInputDeviceId, saveAudioInputEnabled, saveVideoInputDeviceId, saveVideoInputEnabled, saveUsername } = (0, components_react_1.usePersistentUserChoices)({
|
|
165
|
+
defaults: partialDefaults,
|
|
166
|
+
preventSave: !persistUserChoices,
|
|
167
|
+
preventLoad: !persistUserChoices
|
|
168
|
+
});
|
|
169
|
+
// Initialize device settings
|
|
170
|
+
const [audioEnabled, setAudioEnabled] = React.useState(initialUserChoices.audioEnabled && canUseAudio);
|
|
171
|
+
const [videoEnabled, setVideoEnabled] = React.useState(initialUserChoices.videoEnabled && canUseVideo);
|
|
172
|
+
const [audioDeviceId, setAudioDeviceId] = React.useState(initialUserChoices.audioDeviceId);
|
|
173
|
+
const [videoDeviceId, setVideoDeviceId] = React.useState(initialUserChoices.videoDeviceId);
|
|
174
|
+
const [username, setUsername] = React.useState(initialUserChoices.username);
|
|
175
|
+
// Save user choices to persistent storage.
|
|
176
|
+
React.useEffect(() => {
|
|
177
|
+
saveAudioInputEnabled(audioEnabled && canUseAudio);
|
|
178
|
+
}, [audioEnabled, saveAudioInputEnabled, canUseAudio]);
|
|
179
|
+
React.useEffect(() => {
|
|
180
|
+
saveVideoInputEnabled(videoEnabled && canUseVideo);
|
|
181
|
+
}, [videoEnabled, saveVideoInputEnabled, canUseVideo]);
|
|
182
|
+
React.useEffect(() => {
|
|
183
|
+
saveAudioInputDeviceId(audioDeviceId);
|
|
184
|
+
}, [audioDeviceId, saveAudioInputDeviceId]);
|
|
185
|
+
React.useEffect(() => {
|
|
186
|
+
saveVideoInputDeviceId(videoDeviceId);
|
|
187
|
+
}, [videoDeviceId, saveVideoInputDeviceId]);
|
|
188
|
+
React.useEffect(() => {
|
|
189
|
+
if (scUserContext.user) {
|
|
190
|
+
saveUsername(scUserContext.user.username);
|
|
191
|
+
}
|
|
192
|
+
}, [username, saveUsername, scUserContext.user]);
|
|
193
|
+
const tracks = usePreviewTracks({
|
|
194
|
+
audio: audioEnabled ? { deviceId: initialUserChoices.audioDeviceId } : false,
|
|
195
|
+
video: videoEnabled ? { deviceId: initialUserChoices.videoDeviceId } : false
|
|
196
|
+
}, onError);
|
|
197
|
+
const videoEl = React.useRef(null);
|
|
198
|
+
const videoTrack = React.useMemo(() => tracks === null || tracks === void 0 ? void 0 : tracks.filter((track) => track.kind === livekit_client_1.Track.Kind.Video)[0], [tracks]);
|
|
199
|
+
const facingMode = React.useMemo(() => {
|
|
200
|
+
if (videoTrack) {
|
|
201
|
+
const { facingMode } = (0, livekit_client_1.facingModeFromLocalTrack)(videoTrack);
|
|
202
|
+
return facingMode;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
return 'undefined';
|
|
206
|
+
}
|
|
207
|
+
}, [videoTrack]);
|
|
208
|
+
const audioTrack = React.useMemo(() => tracks === null || tracks === void 0 ? void 0 : tracks.filter((track) => track.kind === livekit_client_1.Track.Kind.Audio)[0], [tracks]);
|
|
209
|
+
React.useEffect(() => {
|
|
210
|
+
if (videoEl.current && videoTrack) {
|
|
211
|
+
videoTrack.unmute();
|
|
212
|
+
videoTrack.attach(videoEl.current);
|
|
213
|
+
}
|
|
214
|
+
return () => {
|
|
215
|
+
videoTrack === null || videoTrack === void 0 ? void 0 : videoTrack.detach();
|
|
216
|
+
};
|
|
217
|
+
}, [videoTrack]);
|
|
218
|
+
const [isValid, setIsValid] = React.useState();
|
|
219
|
+
const handleValidation = React.useCallback((values) => {
|
|
220
|
+
if (typeof onValidate === 'function') {
|
|
221
|
+
return onValidate(values);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
return values.username !== '';
|
|
225
|
+
}
|
|
226
|
+
}, [onValidate]);
|
|
227
|
+
(0, react_1.useEffect)(() => {
|
|
228
|
+
const newUserChoices = {
|
|
229
|
+
username,
|
|
230
|
+
videoEnabled,
|
|
231
|
+
videoDeviceId,
|
|
232
|
+
audioEnabled,
|
|
233
|
+
audioDeviceId
|
|
234
|
+
};
|
|
235
|
+
setUserChoices(newUserChoices);
|
|
236
|
+
setIsValid(handleValidation(newUserChoices));
|
|
237
|
+
}, [username, scUserContext.user, videoEnabled, handleValidation, audioEnabled, audioDeviceId, videoDeviceId]);
|
|
238
|
+
function handleSubmit(event) {
|
|
239
|
+
event.preventDefault();
|
|
240
|
+
if (handleValidation(userChoices)) {
|
|
241
|
+
if (typeof onSubmit === 'function') {
|
|
242
|
+
onSubmit(userChoices);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
components_core_1.log.warn('Validation failed with: ', userChoices);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-prejoin" }, htmlProps, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-container" }, { children: [videoTrack && (0, jsx_runtime_1.jsx)("video", { ref: videoEl, width: "1280", height: "720", "data-lk-facing-mode": facingMode }), (!videoTrack || !videoEnabled) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-camera-off-note" }, { children: (0, jsx_runtime_1.jsx)(ParticipantTileAvatar_1.default, { user: scUserContext.user }) })))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group-container" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group audio" }, { children: [(0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ disabled: !canUseAudio, initialState: audioEnabled, source: livekit_client_1.Track.Source.Microphone, onChange: (enabled) => setAudioEnabled(enabled) }, { children: micLabel })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { initialSelection: audioDeviceId, kind: "audioinput", disabled: !audioTrack || !canUseAudio, tracks: { audioinput: audioTrack }, onActiveDeviceChange: (_, id) => setAudioDeviceId(id) }) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group video" }, { children: [(0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ disabled: !canUseVideo, initialState: videoEnabled, source: livekit_client_1.Track.Source.Camera, onChange: (enabled) => setVideoEnabled(enabled) }, { children: camLabel })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { initialSelection: videoDeviceId, kind: "videoinput", disabled: !videoTrack || !canUseVideo, tracks: { videoinput: videoTrack }, onActiveDeviceChange: (_, id) => setVideoDeviceId(id) }) }))] }))] })), (0, jsx_runtime_1.jsx)("form", Object.assign({ className: "lk-username-container" }, { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "lk-button lk-join-button", type: "submit", onClick: handleSubmit, disabled: !isValid }, { children: joinLabel })) })), debug && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("strong", { children: "User Choices:" }), (0, jsx_runtime_1.jsxs)("ul", Object.assign({ className: "lk-list", style: { overflow: 'hidden', maxWidth: '15rem' } }, { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Username: ", `${userChoices.username}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Video Enabled: ", `${userChoices.videoEnabled}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Audio Enabled: ", `${userChoices.audioEnabled}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Video Device: ", `${userChoices.videoDeviceId}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Audio Device: ", `${userChoices.audioDeviceId}`] })] }))] }))] })));
|
|
250
|
+
}
|
|
251
|
+
exports.PreJoin = PreJoin;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const components_react_1 = require("@livekit/components-react");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
/**
|
|
8
|
+
* RecordingIndicator
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
11
|
+
function RecordingIndicator() {
|
|
12
|
+
const isRecording = (0, components_react_1.useIsRecording)();
|
|
13
|
+
const [wasRecording, setWasRecording] = (0, react_1.useState)(false);
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
if (isRecording !== wasRecording) {
|
|
16
|
+
setWasRecording(isRecording);
|
|
17
|
+
if (isRecording) {
|
|
18
|
+
window.alert('This meeting is being recorded');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}, [isRecording]);
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
top: '0',
|
|
25
|
+
left: '0',
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%',
|
|
28
|
+
boxShadow: isRecording ? 'red 0px 0px 0px 3px inset' : 'none',
|
|
29
|
+
pointerEvents: 'none'
|
|
30
|
+
} }));
|
|
31
|
+
}
|
|
32
|
+
exports.default = RecordingIndicator;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface UseSettingsToggleProps {
|
|
3
|
+
props: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The `useSettingsToggle` hook provides state and functions for toggling the settings menu.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSettingsToggle({ props }: UseSettingsToggleProps): {
|
|
9
|
+
mergedProps: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
className: string;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
'aria-pressed': string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type SettingsMenuToggleProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
16
|
+
/**
|
|
17
|
+
* The `SettingsMenuToggle` component is a button that toggles the visibility of the `SettingsMenu` component.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SettingsMenuToggle: (props: SettingsMenuToggleProps & React.RefAttributes<HTMLButtonElement>) => React.ReactNode;
|