@100mslive/roomkit-react 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -0
- package/dist/Accordion/Accordion.d.ts +964 -0
- package/dist/Accordion/index.d.ts +979 -0
- package/dist/ActiveSpeakerView-H3VYXANB.js +39 -0
- package/dist/ActiveSpeakerView-H3VYXANB.js.map +7 -0
- package/dist/ActiveSpeakerView-REZLWPPI.css +11 -0
- package/dist/ActiveSpeakerView-REZLWPPI.css.map +7 -0
- package/dist/AudioLevel/AudioLevel.d.ts +8 -0
- package/dist/AudioLevel/index.d.ts +1 -0
- package/dist/Avatar/Avatar.d.ts +487 -0
- package/dist/Avatar/getAvatarBg.d.ts +7 -0
- package/dist/Avatar/index.d.ts +1 -0
- package/dist/Button/Button.d.ts +488 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts +958 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Collapsible/Collapsible.d.ts +1434 -0
- package/dist/Collapsible/index.d.ts +1 -0
- package/dist/Divider/Divider.d.ts +958 -0
- package/dist/Divider/index.d.ts +1 -0
- package/dist/Dropdown/Dropdown.d.ts +5728 -0
- package/dist/Dropdown/index.d.ts +1 -0
- package/dist/Fieldset/Fieldset.d.ts +477 -0
- package/dist/Fieldset/index.d.ts +1 -0
- package/dist/Footer/Footer.d.ts +3834 -0
- package/dist/Footer/index.d.ts +1 -0
- package/dist/HLSView-3RDXRV7Y.js +689 -0
- package/dist/HLSView-3RDXRV7Y.js.map +7 -0
- package/dist/HLSView-6BVBCQM7.css +11 -0
- package/dist/HLSView-6BVBCQM7.css.map +7 -0
- package/dist/IconButton/IconButton.d.ts +479 -0
- package/dist/IconButton/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +2917 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Label/Label.d.ts +479 -0
- package/dist/Label/index.d.ts +1 -0
- package/dist/Layout/Box.d.ts +477 -0
- package/dist/Layout/Flex.d.ts +482 -0
- package/dist/Layout/index.d.ts +2 -0
- package/dist/Link/Link.d.ts +489 -0
- package/dist/Link/index.d.ts +2 -0
- package/dist/Loading/Loading.d.ts +14 -0
- package/dist/Loading/index.d.ts +1 -0
- package/dist/Modal/Dialog.d.ts +3826 -0
- package/dist/Modal/DialogContent.d.ts +3343 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Pagination/StyledPagination.d.ts +1918 -0
- package/dist/Pagination/index.d.ts +1 -0
- package/dist/PinnedTrackView-453PELNU.js +70 -0
- package/dist/PinnedTrackView-453PELNU.js.map +7 -0
- package/dist/PinnedTrackView-QQ5FDXJX.css +11 -0
- package/dist/PinnedTrackView-QQ5FDXJX.css.map +7 -0
- package/dist/Popover/index.d.ts +1436 -0
- package/dist/Progress/index.d.ts +957 -0
- package/dist/QRCode/QRCode.d.ts +3 -0
- package/dist/QRCode/index.d.ts +1 -0
- package/dist/RadioGroup/RadioGroup.d.ts +1435 -0
- package/dist/RadioGroup/index.d.ts +1 -0
- package/dist/ReactSelect/ReactSelect.d.ts +4778 -0
- package/dist/ReactSelect/index.d.ts +1 -0
- package/dist/Select/Select.d.ts +1437 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/Slider/Slider.d.ts +488 -0
- package/dist/Slider/index.d.ts +1 -0
- package/dist/Stats/Stats.d.ts +19 -0
- package/dist/Stats/StyledStats.d.ts +2872 -0
- package/dist/Stats/formatBytes.d.ts +1 -0
- package/dist/Stats/index.d.ts +1 -0
- package/dist/Switch/Switch.d.ts +482 -0
- package/dist/Switch/index.d.ts +1 -0
- package/dist/Tabs/Tabs.d.ts +1912 -0
- package/dist/Tabs/index.d.ts +1 -0
- package/dist/Text/Text.d.ts +605 -0
- package/dist/Text/index.d.ts +1 -0
- package/dist/Theme/ThemeProvider.d.ts +397 -0
- package/dist/Theme/base.config.d.ts +417 -0
- package/dist/Theme/index.d.ts +3 -0
- package/dist/Theme/stitches.config.d.ts +4702 -0
- package/dist/Theme/themes.d.ts +64 -0
- package/dist/Theme/useSSR.d.ts +6 -0
- package/dist/TileMenu/StyledMenuTile.d.ts +3351 -0
- package/dist/TileMenu/TileMenu.d.ts +6 -0
- package/dist/TileMenu/index.d.ts +1 -0
- package/dist/Toast/Toast.d.ts +2881 -0
- package/dist/Toast/index.d.ts +1 -0
- package/dist/Tooltip/Tooltip.d.ts +14 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/Video/Video.d.ts +499 -0
- package/dist/Video/index.d.ts +1 -0
- package/dist/VideoList/StyledVideoList.d.ts +1438 -0
- package/dist/VideoList/index.d.ts +2 -0
- package/dist/VideoList/videoListUtils.d.ts +1 -0
- package/dist/VideoTile/StyledVideoTile.d.ts +4309 -0
- package/dist/VideoTile/index.d.ts +1 -0
- package/dist/VirtualBackground-LHYBWUT5.js +158 -0
- package/dist/VirtualBackground-LHYBWUT5.js.map +7 -0
- package/dist/chunk-7YUYZ64D.js +6843 -0
- package/dist/chunk-7YUYZ64D.js.map +7 -0
- package/dist/chunk-HCAGFNXW.js +8270 -0
- package/dist/chunk-HCAGFNXW.js.map +7 -0
- package/dist/chunk-KYYP6ZVK.js +907 -0
- package/dist/chunk-KYYP6ZVK.js.map +7 -0
- package/dist/chunk-ULXGBUSC.js +65 -0
- package/dist/chunk-ULXGBUSC.js.map +7 -0
- package/dist/chunk-XRJXE6UO.js +243 -0
- package/dist/chunk-XRJXE6UO.js.map +7 -0
- package/dist/conference-IDNRO4WK.js +3812 -0
- package/dist/conference-IDNRO4WK.js.map +7 -0
- package/dist/conference-KN6OKGDU.css +11 -0
- package/dist/conference-KN6OKGDU.css.map +7 -0
- package/dist/fixtures/chats.d.ts +4 -0
- package/dist/fixtures/peers.d.ts +3 -0
- package/dist/fixtures/tracks.d.ts +2 -0
- package/dist/index.cjs.css +11 -0
- package/dist/index.cjs.css.map +7 -0
- package/dist/index.cjs.js +22987 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.css +11 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +133 -0
- package/dist/index.js.map +7 -0
- package/dist/meta.cjs.json +13085 -0
- package/dist/meta.esbuild.json +13693 -0
- package/dist/transcription-BTSB7FZH.js +356 -0
- package/dist/transcription-BTSB7FZH.js.map +7 -0
- package/dist/utils/animations.d.ts +92 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/styles.d.ts +21 -0
- package/package.json +116 -0
- package/src/Accordion/Accordion.stories.tsx +50 -0
- package/src/Accordion/Accordion.tsx +88 -0
- package/src/Accordion/index.ts +8 -0
- package/src/AudioLevel/AudioLevel.tsx +34 -0
- package/src/AudioLevel/index.ts +1 -0
- package/src/Avatar/Avatar.stories.tsx +33 -0
- package/src/Avatar/Avatar.tsx +55 -0
- package/src/Avatar/getAvatarBg.ts +46 -0
- package/src/Avatar/index.ts +1 -0
- package/src/Button/Button.mdx +43 -0
- package/src/Button/Button.stories.tsx +52 -0
- package/src/Button/Button.tsx +144 -0
- package/src/Button/index.tsx +1 -0
- package/src/Chat/Chat.mdx +39 -0
- package/src/Chat/Chat.stories.tsx +39 -0
- package/src/Checkbox/Checkbox.stories.tsx +61 -0
- package/src/Checkbox/Checkbox.tsx +33 -0
- package/src/Checkbox/index.tsx +1 -0
- package/src/Collapsible/Collapsible.tsx +34 -0
- package/src/Collapsible/index.tsx +1 -0
- package/src/Divider/Divider.tsx +45 -0
- package/src/Divider/HorizontalDivider.stories.tsx +34 -0
- package/src/Divider/VerticalDivider.stories.tsx +40 -0
- package/src/Divider/index.ts +1 -0
- package/src/Dropdown/Dropdown.stories.tsx +94 -0
- package/src/Dropdown/Dropdown.tsx +142 -0
- package/src/Dropdown/index.tsx +1 -0
- package/src/Fieldset/Fieldset.stories.tsx +29 -0
- package/src/Fieldset/Fieldset.tsx +11 -0
- package/src/Fieldset/index.tsx +1 -0
- package/src/Footer/Footer.stories.tsx +61 -0
- package/src/Footer/Footer.tsx +47 -0
- package/src/Footer/index.tsx +1 -0
- package/src/IconButton/IconButton.tsx +45 -0
- package/src/IconButton/index.tsx +1 -0
- package/src/Icons/Icons.stories.mdx +10 -0
- package/src/Icons/IconsList.jsx +17 -0
- package/src/Input/Input.stories.tsx +25 -0
- package/src/Input/Input.tsx +105 -0
- package/src/Input/PasswordInput.stories.tsx +53 -0
- package/src/Input/index.tsx +1 -0
- package/src/Introduction/Integrating.stories.mdx +100 -0
- package/src/Introduction/Introduction.stories.mdx +9 -0
- package/src/Label/Label.tsx +8 -0
- package/src/Label/index.ts +1 -0
- package/src/Layout/Box.tsx +3 -0
- package/src/Layout/Flex.tsx +76 -0
- package/src/Layout/index.tsx +2 -0
- package/src/Link/Link.stories.tsx +18 -0
- package/src/Link/Link.tsx +54 -0
- package/src/Link/index.tsx +2 -0
- package/src/Loading/Loading.mdx +15 -0
- package/src/Loading/Loading.stories.tsx +37 -0
- package/src/Loading/Loading.tsx +33 -0
- package/src/Loading/index.ts +1 -0
- package/src/Modal/Dialog.mdx +19 -0
- package/src/Modal/Dialog.stories.tsx +68 -0
- package/src/Modal/Dialog.tsx +26 -0
- package/src/Modal/DialogContent.tsx +63 -0
- package/src/Modal/index.ts +1 -0
- package/src/Pagination/StyledPagination.stories.tsx +80 -0
- package/src/Pagination/StyledPagination.tsx +68 -0
- package/src/Pagination/index.tsx +1 -0
- package/src/Popover/Popover.mdx +9 -0
- package/src/Popover/Popover.stories.tsx +95 -0
- package/src/Popover/index.tsx +26 -0
- package/src/Prebuilt/App.jsx +273 -0
- package/src/Prebuilt/AppContext.jsx +21 -0
- package/src/Prebuilt/IconButton.jsx +19 -0
- package/src/Prebuilt/Prebuilt.stories.tsx +20 -0
- package/src/Prebuilt/common/PeersSorter.js +89 -0
- package/src/Prebuilt/common/constants.js +208 -0
- package/src/Prebuilt/common/hooks.js +47 -0
- package/src/Prebuilt/common/roles.js +4 -0
- package/src/Prebuilt/common/useSortedPeers.js +28 -0
- package/src/Prebuilt/common/utils.js +91 -0
- package/src/Prebuilt/components/AppData/AppData.jsx +189 -0
- package/src/Prebuilt/components/AppData/useAppConfig.js +7 -0
- package/src/Prebuilt/components/AppData/useAppLayout.js +6 -0
- package/src/Prebuilt/components/AppData/useChatState.js +18 -0
- package/src/Prebuilt/components/AppData/useSidepane.js +49 -0
- package/src/Prebuilt/components/AppData/useUISettings.js +164 -0
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +16 -0
- package/src/Prebuilt/components/AudioVideoToggle.jsx +67 -0
- package/src/Prebuilt/components/AuthToken.jsx +133 -0
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +96 -0
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +46 -0
- package/src/Prebuilt/components/Chat/Chat.jsx +155 -0
- package/src/Prebuilt/components/Chat/ChatBody.jsx +370 -0
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +150 -0
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +67 -0
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +162 -0
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +30 -0
- package/src/Prebuilt/components/Chat/useUnreadCount.js +17 -0
- package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +80 -0
- package/src/Prebuilt/components/Connection/TileConnection.jsx +40 -0
- package/src/Prebuilt/components/Connection/connectionQualityUtils.js +39 -0
- package/src/Prebuilt/components/EmojiReaction.jsx +138 -0
- package/src/Prebuilt/components/ErrorBoundary.jsx +105 -0
- package/src/Prebuilt/components/FirstPersonDisplay.jsx +50 -0
- package/src/Prebuilt/components/Footer/ChatToggle.jsx +27 -0
- package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +104 -0
- package/src/Prebuilt/components/Footer/StreamingFooter.jsx +71 -0
- package/src/Prebuilt/components/Footer.jsx +8 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +11 -0
- package/src/Prebuilt/components/GoLiveButton.jsx +45 -0
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +21 -0
- package/src/Prebuilt/components/HMSVideo/FullscreenButton.jsx +18 -0
- package/src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.jsx +35 -0
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +82 -0
- package/src/Prebuilt/components/HMSVideo/HMSVIdeoUtils.js +27 -0
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +11 -0
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +13 -0
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +77 -0
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +31 -0
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +39 -0
- package/src/Prebuilt/components/HMSVideo/index.js +19 -0
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +217 -0
- package/src/Prebuilt/components/Header/AmbientMusic.jsx +88 -0
- package/src/Prebuilt/components/Header/ConferencingHeader.jsx +29 -0
- package/src/Prebuilt/components/Header/Header.jsx +8 -0
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +41 -0
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +91 -0
- package/src/Prebuilt/components/Header/ParticipantList.jsx +337 -0
- package/src/Prebuilt/components/Header/StreamActions.jsx +225 -0
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +55 -0
- package/src/Prebuilt/components/Header/index.jsx +1 -0
- package/src/Prebuilt/components/HlsStatsOverlay.jsx +101 -0
- package/src/Prebuilt/components/Image.jsx +7 -0
- package/src/Prebuilt/components/Input/KeyboardInputManager.js +107 -0
- package/src/Prebuilt/components/LeaveRoom.jsx +202 -0
- package/src/Prebuilt/components/MetaActions.jsx +45 -0
- package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +139 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +92 -0
- package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +67 -0
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +106 -0
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +29 -0
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +225 -0
- package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +90 -0
- package/src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx +38 -0
- package/src/Prebuilt/components/Notifications/InitErrorModal.jsx +39 -0
- package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +25 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +151 -0
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +45 -0
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +67 -0
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +69 -0
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx +51 -0
- package/src/Prebuilt/components/Notifications/TrackNotifications.jsx +19 -0
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx +49 -0
- package/src/Prebuilt/components/Notifications/index.jsx +1 -0
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +82 -0
- package/src/Prebuilt/components/PIP/PIPManager.js +296 -0
- package/src/Prebuilt/components/PIP/SetupMediaSession.js +60 -0
- package/src/Prebuilt/components/PIP/index.jsx +11 -0
- package/src/Prebuilt/components/PIP/pip.test.js +72 -0
- package/src/Prebuilt/components/PIP/pipUtils.js +183 -0
- package/src/Prebuilt/components/Pagination.jsx +29 -0
- package/src/Prebuilt/components/Playlist/Playlist.jsx +129 -0
- package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +172 -0
- package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +51 -0
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +95 -0
- package/src/Prebuilt/components/PostLeave.jsx +76 -0
- package/src/Prebuilt/components/Preview/PreviewContainer.jsx +51 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.jsx +196 -0
- package/src/Prebuilt/components/Preview/PreviewName.jsx +37 -0
- package/src/Prebuilt/components/RoleChangeModal.jsx +185 -0
- package/src/Prebuilt/components/RoleChangeRequestModal.jsx +26 -0
- package/src/Prebuilt/components/ScreenShare.jsx +45 -0
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +45 -0
- package/src/Prebuilt/components/ScreenshareHintModal.jsx +37 -0
- package/src/Prebuilt/components/ScreenshareTile.jsx +91 -0
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +220 -0
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +91 -0
- package/src/Prebuilt/components/Settings/NotificationSettings.jsx +61 -0
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +171 -0
- package/src/Prebuilt/components/Settings/StartRecording.jsx +130 -0
- package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +40 -0
- package/src/Prebuilt/components/Settings/common.js +15 -0
- package/src/Prebuilt/components/ShareMenuIcon.jsx +26 -0
- package/src/Prebuilt/components/StatsForNerds.jsx +250 -0
- package/src/Prebuilt/components/Streaming/Common.jsx +132 -0
- package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +226 -0
- package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +24 -0
- package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +336 -0
- package/src/Prebuilt/components/Streaming/ResolutionInput.jsx +88 -0
- package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +76 -0
- package/src/Prebuilt/components/TileMenu.jsx +275 -0
- package/src/Prebuilt/components/Toast/Toast.jsx +17 -0
- package/src/Prebuilt/components/Toast/ToastBatcher.js +57 -0
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +134 -0
- package/src/Prebuilt/components/Toast/ToastContainer.jsx +30 -0
- package/src/Prebuilt/components/Toast/ToastManager.js +44 -0
- package/src/Prebuilt/components/VideoList.jsx +101 -0
- package/src/Prebuilt/components/VideoTile.jsx +177 -0
- package/src/Prebuilt/components/conference.jsx +164 -0
- package/src/Prebuilt/components/gridView.jsx +85 -0
- package/src/Prebuilt/components/hooks/useDropdownList.jsx +23 -0
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +6 -0
- package/src/Prebuilt/components/hooks/useFeatures.js +22 -0
- package/src/Prebuilt/components/hooks/useFullscreen.js +43 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +52 -0
- package/src/Prebuilt/components/hooks/useNavigation.js +19 -0
- package/src/Prebuilt/components/hooks/usePlaylist.js +25 -0
- package/src/Prebuilt/components/hooks/usePlaylistMusic.js +35 -0
- package/src/Prebuilt/components/hooks/useScreenshareAudio.js +28 -0
- package/src/Prebuilt/components/hooks/useSetPinnedMessage.js +38 -0
- package/src/Prebuilt/components/hooks/useSkipPreview.jsx +20 -0
- package/src/Prebuilt/components/hooks/useUserPreferences.jsx +25 -0
- package/src/Prebuilt/components/init/Init.jsx +58 -0
- package/src/Prebuilt/components/init/initUtils.js +90 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +29 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +108 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +31 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +32 -0
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +233 -0
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +89 -0
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +85 -0
- package/src/Prebuilt/components/peerTileUtils.jsx +27 -0
- package/src/Prebuilt/hms.js +7 -0
- package/src/Prebuilt/images/first_person.png +0 -0
- package/src/Prebuilt/index.d.ts +15 -0
- package/src/Prebuilt/index.js +2 -0
- package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +34 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +141 -0
- package/src/Prebuilt/layouts/HLSView.jsx +290 -0
- package/src/Prebuilt/layouts/InsetView.jsx +222 -0
- package/src/Prebuilt/layouts/NonPublisherView.jsx +51 -0
- package/src/Prebuilt/layouts/PDFView.jsx +122 -0
- package/src/Prebuilt/layouts/PinnedTrackView.jsx +59 -0
- package/src/Prebuilt/layouts/SidePane.jsx +51 -0
- package/src/Prebuilt/layouts/WaitingView.jsx +51 -0
- package/src/Prebuilt/layouts/WhiteboardView.jsx +66 -0
- package/src/Prebuilt/layouts/mainGridView.jsx +98 -0
- package/src/Prebuilt/layouts/mainView.jsx +113 -0
- package/src/Prebuilt/layouts/screenShareView.jsx +185 -0
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +132 -0
- package/src/Prebuilt/plugins/RemoteStopScreenshare.jsx +18 -0
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +90 -0
- package/src/Prebuilt/plugins/VirtualBackground/vbutils.js +66 -0
- package/src/Prebuilt/plugins/confetti.jsx +60 -0
- package/src/Prebuilt/plugins/transcription/Transcriber.js +216 -0
- package/src/Prebuilt/plugins/transcription/TranscriptionButton.jsx +138 -0
- package/src/Prebuilt/plugins/transcription/index.jsx +1 -0
- package/src/Prebuilt/plugins/whiteboard/PusherCommunicationProvider.js +110 -0
- package/src/Prebuilt/plugins/whiteboard/README.md +29 -0
- package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +43 -0
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.css +12 -0
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.jsx +11 -0
- package/src/Prebuilt/plugins/whiteboard/WhiteboardEvents.js +8 -0
- package/src/Prebuilt/plugins/whiteboard/index.js +3 -0
- package/src/Prebuilt/plugins/whiteboard/useMultiplayerState.js +212 -0
- package/src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js +47 -0
- package/src/Prebuilt/primitives/DialogContent.jsx +280 -0
- package/src/Prebuilt/primitives/DropdownTrigger.jsx +46 -0
- package/src/Prebuilt/services/FeatureFlags.jsx +47 -0
- package/src/Prebuilt/services/tokenService.js +49 -0
- package/src/Progress/index.tsx +17 -0
- package/src/QRCode/QRCode.mdx +9 -0
- package/src/QRCode/QRCode.stories.tsx +29 -0
- package/src/QRCode/QRCode.tsx +6 -0
- package/src/QRCode/index.tsx +1 -0
- package/src/RadioGroup/RadioGroup.stories.tsx +32 -0
- package/src/RadioGroup/RadioGroup.tsx +33 -0
- package/src/RadioGroup/index.tsx +1 -0
- package/src/ReactSelect/ReactSelect.stories.tsx +83 -0
- package/src/ReactSelect/ReactSelect.tsx +97 -0
- package/src/ReactSelect/index.ts +1 -0
- package/src/Select/Select.stories.tsx +33 -0
- package/src/Select/Select.tsx +63 -0
- package/src/Select/index.ts +1 -0
- package/src/Slider/Slider.stories.tsx +21 -0
- package/src/Slider/Slider.tsx +70 -0
- package/src/Slider/index.ts +1 -0
- package/src/Stats/Stats.tsx +211 -0
- package/src/Stats/StyledStats.tsx +57 -0
- package/src/Stats/formatBytes.ts +19 -0
- package/src/Stats/index.tsx +1 -0
- package/src/Switch/Switch.mdx +11 -0
- package/src/Switch/Switch.stories.tsx +46 -0
- package/src/Switch/Switch.tsx +52 -0
- package/src/Switch/index.ts +1 -0
- package/src/Tabs/Tabs.stories.tsx +77 -0
- package/src/Tabs/Tabs.tsx +41 -0
- package/src/Tabs/index.tsx +1 -0
- package/src/Text/Text.stories.tsx +21 -0
- package/src/Text/Text.tsx +149 -0
- package/src/Text/index.tsx +1 -0
- package/src/Theme/Theme.stories.mdx +8 -0
- package/src/Theme/ThemeProvider.tsx +104 -0
- package/src/Theme/ThemeStory.jsx +58 -0
- package/src/Theme/base.config.ts +264 -0
- package/src/Theme/index.tsx +3 -0
- package/src/Theme/stitches.config.ts +100 -0
- package/src/Theme/themes.ts +70 -0
- package/src/Theme/useSSR.tsx +24 -0
- package/src/TileMenu/StyledMenuTile.tsx +101 -0
- package/src/TileMenu/TileMenu.tsx +96 -0
- package/src/TileMenu/index.tsx +1 -0
- package/src/Toast/AppToast.stories.tsx +56 -0
- package/src/Toast/Toast.mdx +19 -0
- package/src/Toast/Toast.stories.tsx +57 -0
- package/src/Toast/Toast.tsx +168 -0
- package/src/Toast/index.tsx +1 -0
- package/src/Tooltip/Tooltip.stories.tsx +62 -0
- package/src/Tooltip/Tooltip.tsx +79 -0
- package/src/Tooltip/index.ts +1 -0
- package/src/Video/UseVideo.mdx +22 -0
- package/src/Video/UseVideo.stories.tsx +26 -0
- package/src/Video/Video.mdx +24 -0
- package/src/Video/Video.stories.tsx +27 -0
- package/src/Video/Video.tsx +61 -0
- package/src/Video/index.tsx +1 -0
- package/src/VideoList/StyledVideoList.tsx +39 -0
- package/src/VideoList/VideoList.stories.tsx +92 -0
- package/src/VideoList/index.tsx +2 -0
- package/src/VideoList/videoListUtils.tsx +20 -0
- package/src/VideoTile/StyledVideoTile.tsx +148 -0
- package/src/VideoTile/VideoTile.mdx +28 -0
- package/src/VideoTile/VideoTile.stories.tsx +32 -0
- package/src/VideoTile/index.tsx +1 -0
- package/src/fixtures/chats.ts +25 -0
- package/src/fixtures/peers.ts +24 -0
- package/src/fixtures/tracks.ts +11 -0
- package/src/index.ts +38 -0
- package/src/store/SetupFakeStore.ts +33 -0
- package/src/store/StorybookSDK.ts +229 -0
- package/src/utils/animations.ts +90 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/styles.ts +22 -0
@@ -0,0 +1,196 @@
|
|
1
|
+
import React, { Fragment, Suspense, useCallback, useEffect, useState } from 'react';
|
2
|
+
import {
|
3
|
+
selectIsLocalVideoEnabled,
|
4
|
+
selectLocalPeer,
|
5
|
+
selectVideoTrackByID,
|
6
|
+
useAVToggle,
|
7
|
+
useHMSStore,
|
8
|
+
usePreviewJoin,
|
9
|
+
} from '@100mslive/react-sdk';
|
10
|
+
import { SettingsIcon } from '@100mslive/react-icons';
|
11
|
+
import {
|
12
|
+
Avatar,
|
13
|
+
Flex,
|
14
|
+
flexCenter,
|
15
|
+
Loading,
|
16
|
+
styled,
|
17
|
+
StyledVideoTile,
|
18
|
+
Text,
|
19
|
+
textEllipsis,
|
20
|
+
useBorderAudioLevel,
|
21
|
+
useTheme,
|
22
|
+
Video,
|
23
|
+
} from '../../../';
|
24
|
+
import { useHMSPrebuiltContext } from '../../AppContext';
|
25
|
+
import IconButton from '../../IconButton';
|
26
|
+
import { AudioVideoToggle } from '../AudioVideoToggle';
|
27
|
+
import TileConnection from '../Connection/TileConnection';
|
28
|
+
import SettingsModal from '../Settings/SettingsModal';
|
29
|
+
import PreviewName from './PreviewName';
|
30
|
+
import { useAuthToken, useUISettings } from '../AppData/useUISettings';
|
31
|
+
import { defaultPreviewPreference, UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
|
32
|
+
import { UI_SETTINGS } from '../../common/constants';
|
33
|
+
|
34
|
+
const VirtualBackground = React.lazy(() => import('../../plugins/VirtualBackground/VirtualBackground'));
|
35
|
+
|
36
|
+
const PreviewJoin = ({ onJoin, skipPreview, initialName, asRole }) => {
|
37
|
+
const [previewPreference, setPreviewPreference] = useUserPreferences(
|
38
|
+
UserPreferencesKeys.PREVIEW,
|
39
|
+
defaultPreviewPreference,
|
40
|
+
);
|
41
|
+
const authToken = useAuthToken();
|
42
|
+
const [name, setName] = useState(initialName || previewPreference.name);
|
43
|
+
const { isLocalAudioEnabled, isLocalVideoEnabled } = useAVToggle();
|
44
|
+
const [previewError, setPreviewError] = useState(false);
|
45
|
+
const { endPoints } = useHMSPrebuiltContext();
|
46
|
+
const { enableJoin, preview, join } = usePreviewJoin({
|
47
|
+
name,
|
48
|
+
token: authToken,
|
49
|
+
initEndpoint: endPoints?.init,
|
50
|
+
initialSettings: {
|
51
|
+
isAudioMuted: skipPreview || previewPreference.isAudioMuted,
|
52
|
+
isVideoMuted: skipPreview || previewPreference.isVideoMuted,
|
53
|
+
speakerAutoSelectionBlacklist: ['Yeti Stereo Microphone'],
|
54
|
+
},
|
55
|
+
captureNetworkQualityInPreview: true,
|
56
|
+
handleError: (_, method) => {
|
57
|
+
if (method === 'preview') {
|
58
|
+
setPreviewError(true);
|
59
|
+
}
|
60
|
+
},
|
61
|
+
asRole,
|
62
|
+
});
|
63
|
+
const savePreferenceAndJoin = useCallback(() => {
|
64
|
+
setPreviewPreference({
|
65
|
+
name,
|
66
|
+
isAudioMuted: !isLocalAudioEnabled,
|
67
|
+
isVideoMuted: !isLocalVideoEnabled,
|
68
|
+
});
|
69
|
+
join();
|
70
|
+
onJoin && onJoin();
|
71
|
+
}, [join, isLocalAudioEnabled, isLocalVideoEnabled, name, setPreviewPreference, onJoin]);
|
72
|
+
useEffect(() => {
|
73
|
+
if (authToken) {
|
74
|
+
if (skipPreview) {
|
75
|
+
savePreferenceAndJoin();
|
76
|
+
} else {
|
77
|
+
preview();
|
78
|
+
}
|
79
|
+
}
|
80
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
81
|
+
}, [authToken, skipPreview]);
|
82
|
+
return (
|
83
|
+
<Container>
|
84
|
+
<Text variant="h4" css={{ wordBreak: 'break-word', textAlign: 'center' }}>
|
85
|
+
Get Started
|
86
|
+
</Text>
|
87
|
+
<Text css={{ c: '$textMedEmp', my: '$6', textAlign: 'center' }} variant="body1">
|
88
|
+
Setup your audio and video before joining
|
89
|
+
</Text>
|
90
|
+
<Flex
|
91
|
+
align="center"
|
92
|
+
justify="center"
|
93
|
+
css={{
|
94
|
+
'@sm': { width: '100%' },
|
95
|
+
flexDirection: 'column',
|
96
|
+
}}
|
97
|
+
>
|
98
|
+
<PreviewTile name={name} error={previewError} />
|
99
|
+
<PreviewControls enableJoin={enableJoin} savePreferenceAndJoin={savePreferenceAndJoin} />
|
100
|
+
<PreviewName name={name} onChange={setName} enableJoin={enableJoin} onJoin={savePreferenceAndJoin} />
|
101
|
+
</Flex>
|
102
|
+
</Container>
|
103
|
+
);
|
104
|
+
};
|
105
|
+
|
106
|
+
const Container = styled('div', {
|
107
|
+
width: '100%',
|
108
|
+
...flexCenter,
|
109
|
+
flexDirection: 'column',
|
110
|
+
px: '$10',
|
111
|
+
});
|
112
|
+
|
113
|
+
const PreviewTile = ({ name, error }) => {
|
114
|
+
const localPeer = useHMSStore(selectLocalPeer);
|
115
|
+
const borderAudioRef = useBorderAudioLevel(localPeer?.audioTrack);
|
116
|
+
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
|
117
|
+
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
118
|
+
const trackSelector = selectVideoTrackByID(localPeer?.videoTrack);
|
119
|
+
const track = useHMSStore(trackSelector);
|
120
|
+
|
121
|
+
const {
|
122
|
+
aspectRatio: { width, height },
|
123
|
+
} = useTheme();
|
124
|
+
return (
|
125
|
+
<StyledVideoTile.Container
|
126
|
+
css={{
|
127
|
+
bg: '$surfaceDefault',
|
128
|
+
aspectRatio: width / height,
|
129
|
+
width: 'unset',
|
130
|
+
height: 'min(360px, 60vh)',
|
131
|
+
mt: '$12',
|
132
|
+
'@sm': {
|
133
|
+
height: 'unset',
|
134
|
+
width: 'min(360px, 100%)',
|
135
|
+
maxWidth: '100%',
|
136
|
+
},
|
137
|
+
}}
|
138
|
+
ref={borderAudioRef}
|
139
|
+
>
|
140
|
+
{localPeer ? (
|
141
|
+
<>
|
142
|
+
<TileConnection name={name} peerId={localPeer.id} hideLabel={true} />
|
143
|
+
<Video
|
144
|
+
mirror={track?.facingMode !== 'environment' && mirrorLocalVideo}
|
145
|
+
trackId={localPeer.videoTrack}
|
146
|
+
data-testid="preview_tile"
|
147
|
+
/>
|
148
|
+
{!isVideoOn ? (
|
149
|
+
<StyledVideoTile.AvatarContainer>
|
150
|
+
<Avatar name={name} data-testid="preview_avatar_tile" />
|
151
|
+
<Text css={{ ...textEllipsis('75%') }} variant="body2">
|
152
|
+
{name}
|
153
|
+
</Text>
|
154
|
+
</StyledVideoTile.AvatarContainer>
|
155
|
+
) : null}
|
156
|
+
</>
|
157
|
+
) : !error ? (
|
158
|
+
<Loading size={100} />
|
159
|
+
) : null}
|
160
|
+
</StyledVideoTile.Container>
|
161
|
+
);
|
162
|
+
};
|
163
|
+
|
164
|
+
const PreviewControls = () => {
|
165
|
+
return (
|
166
|
+
<Flex
|
167
|
+
justify="between"
|
168
|
+
css={{
|
169
|
+
width: '100%',
|
170
|
+
mt: '$8',
|
171
|
+
}}
|
172
|
+
>
|
173
|
+
<Flex css={{ gap: '$4' }}>
|
174
|
+
<AudioVideoToggle compact />
|
175
|
+
<Suspense fallback="">
|
176
|
+
<VirtualBackground />
|
177
|
+
</Suspense>
|
178
|
+
</Flex>
|
179
|
+
<PreviewSettings />
|
180
|
+
</Flex>
|
181
|
+
);
|
182
|
+
};
|
183
|
+
|
184
|
+
const PreviewSettings = React.memo(() => {
|
185
|
+
const [open, setOpen] = useState(false);
|
186
|
+
return (
|
187
|
+
<Fragment>
|
188
|
+
<IconButton data-testid="preview_setting_btn" onClick={() => setOpen(value => !value)}>
|
189
|
+
<SettingsIcon />
|
190
|
+
</IconButton>
|
191
|
+
{open && <SettingsModal open={open} onOpenChange={setOpen} />}
|
192
|
+
</Fragment>
|
193
|
+
);
|
194
|
+
});
|
195
|
+
|
196
|
+
export default PreviewJoin;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Button, Input, styled } from '../../../';
|
3
|
+
import { isStreamingKit } from '../../common/utils';
|
4
|
+
|
5
|
+
const PreviewName = ({ name, onChange, onJoin, enableJoin }) => {
|
6
|
+
const formSubmit = e => {
|
7
|
+
e.preventDefault();
|
8
|
+
};
|
9
|
+
return (
|
10
|
+
<Form onSubmit={formSubmit}>
|
11
|
+
<Input
|
12
|
+
required
|
13
|
+
id="name"
|
14
|
+
css={{ w: '100%' }}
|
15
|
+
value={name}
|
16
|
+
onChange={e => onChange(e.target.value)}
|
17
|
+
placeholder="Enter your name"
|
18
|
+
autoFocus
|
19
|
+
autoComplete="name"
|
20
|
+
/>
|
21
|
+
<Button type="submit" disabled={!name || !enableJoin} onClick={onJoin}>
|
22
|
+
{isStreamingKit() ? 'Join Studio' : 'Join Room'}
|
23
|
+
</Button>
|
24
|
+
</Form>
|
25
|
+
);
|
26
|
+
};
|
27
|
+
|
28
|
+
const Form = styled('form', {
|
29
|
+
width: '100%',
|
30
|
+
display: 'flex',
|
31
|
+
alignItems: 'center',
|
32
|
+
gap: '$4',
|
33
|
+
mt: '$10',
|
34
|
+
mb: '$10',
|
35
|
+
});
|
36
|
+
|
37
|
+
export default PreviewName;
|
@@ -0,0 +1,185 @@
|
|
1
|
+
import React, { forwardRef, useRef, useState } from 'react';
|
2
|
+
import { selectPeerByID, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
3
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@100mslive/react-icons';
|
4
|
+
import { Button } from '../../Button';
|
5
|
+
import { Checkbox } from '../../Checkbox';
|
6
|
+
import { Dropdown } from '../../Dropdown';
|
7
|
+
import { Label } from '../../Label';
|
8
|
+
import { Box, Flex } from '../../Layout';
|
9
|
+
import { Dialog } from '../../Modal';
|
10
|
+
import { Text } from '../../Text';
|
11
|
+
import { Tooltip } from '../../Tooltip';
|
12
|
+
import { useDropdownSelection } from './hooks/useDropdownSelection';
|
13
|
+
import { useFilteredRoles } from '../common/hooks';
|
14
|
+
import { textEllipsis } from '../../utils';
|
15
|
+
|
16
|
+
const PeerName = forwardRef(({ children, maxWidth, ...rest }, ref) => (
|
17
|
+
<Text
|
18
|
+
{...rest}
|
19
|
+
ref={ref}
|
20
|
+
as="strong"
|
21
|
+
variant="body2"
|
22
|
+
css={{
|
23
|
+
...textEllipsis(maxWidth),
|
24
|
+
display: 'inline-block',
|
25
|
+
fontWeight: '$semiBold',
|
26
|
+
c: 'inherit',
|
27
|
+
}}
|
28
|
+
>
|
29
|
+
{children}
|
30
|
+
</Text>
|
31
|
+
));
|
32
|
+
|
33
|
+
export const RoleChangeModal = ({ peerId, onOpenChange }) => {
|
34
|
+
const peer = useHMSStore(selectPeerByID(peerId));
|
35
|
+
const roles = useFilteredRoles();
|
36
|
+
const [selectedRole, setRole] = useState(peer?.roleName);
|
37
|
+
const [requestPermission, setRequestPermission] = useState(true);
|
38
|
+
const hmsActions = useHMSActions();
|
39
|
+
const [open, setOpen] = useState(false);
|
40
|
+
const selectionBg = useDropdownSelection();
|
41
|
+
const [peerNameRef, setPeerNameRef] = useState();
|
42
|
+
const ref = useRef();
|
43
|
+
if (!peer) {
|
44
|
+
return null;
|
45
|
+
}
|
46
|
+
|
47
|
+
const peerNameMaxWidth = 200;
|
48
|
+
return (
|
49
|
+
<Dialog.Root defaultOpen onOpenChange={onOpenChange}>
|
50
|
+
<Dialog.Portal>
|
51
|
+
<Dialog.Overlay />
|
52
|
+
<Dialog.Content css={{ width: 'min(400px,80%)', p: '$10' }}>
|
53
|
+
<Dialog.Title css={{ p: 0 }} asChild>
|
54
|
+
<Text as="h6" variant="h6">
|
55
|
+
Change Role
|
56
|
+
</Text>
|
57
|
+
</Dialog.Title>
|
58
|
+
<Dialog.Description asChild>
|
59
|
+
<Text
|
60
|
+
variant="body2"
|
61
|
+
css={{
|
62
|
+
mt: '$4',
|
63
|
+
mb: '$8',
|
64
|
+
c: '$textMedEmp',
|
65
|
+
display: 'flex',
|
66
|
+
flexWrap: 'wrap',
|
67
|
+
columnGap: '4px',
|
68
|
+
}}
|
69
|
+
>
|
70
|
+
Change the role of
|
71
|
+
{peerNameRef && peerNameRef.clientWidth === peerNameMaxWidth ? (
|
72
|
+
<Tooltip title={peer.name} side="top">
|
73
|
+
<PeerName ref={setPeerNameRef} maxWidth={peerNameMaxWidth}>
|
74
|
+
{peer.name}
|
75
|
+
</PeerName>
|
76
|
+
</Tooltip>
|
77
|
+
) : (
|
78
|
+
<PeerName ref={setPeerNameRef} maxWidth={peerNameMaxWidth}>
|
79
|
+
{peer.name}
|
80
|
+
</PeerName>
|
81
|
+
)}
|
82
|
+
to
|
83
|
+
</Text>
|
84
|
+
</Dialog.Description>
|
85
|
+
<Flex
|
86
|
+
align="center"
|
87
|
+
css={{
|
88
|
+
w: '100%',
|
89
|
+
mb: '$10',
|
90
|
+
}}
|
91
|
+
>
|
92
|
+
<Box
|
93
|
+
css={{
|
94
|
+
position: 'relative',
|
95
|
+
flex: '1 1 0',
|
96
|
+
minWidth: 0,
|
97
|
+
}}
|
98
|
+
>
|
99
|
+
<Dropdown.Root open={open} onOpenChange={setOpen} css={{ width: '100%' }}>
|
100
|
+
<Dropdown.Trigger
|
101
|
+
data-testid="open_role_selection_dropdown"
|
102
|
+
asChild
|
103
|
+
css={{
|
104
|
+
border: '1px solid $borderLight',
|
105
|
+
bg: '$surfaceLight',
|
106
|
+
r: '$1',
|
107
|
+
p: '$6 $9',
|
108
|
+
}}
|
109
|
+
ref={ref}
|
110
|
+
>
|
111
|
+
<Flex align="center" justify="between" css={{ width: '100%' }}>
|
112
|
+
<Text>{selectedRole}</Text>
|
113
|
+
{open ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
114
|
+
</Flex>
|
115
|
+
</Dropdown.Trigger>
|
116
|
+
<Dropdown.Portal>
|
117
|
+
<Dropdown.Content
|
118
|
+
align="start"
|
119
|
+
sideOffset={8}
|
120
|
+
css={{ zIndex: 1000, width: ref.current?.clientWidth }}
|
121
|
+
>
|
122
|
+
{roles.map(role => {
|
123
|
+
return (
|
124
|
+
<Dropdown.Item
|
125
|
+
data-testid={role}
|
126
|
+
key={role}
|
127
|
+
onSelect={() => setRole(role)}
|
128
|
+
css={{
|
129
|
+
px: '$9',
|
130
|
+
bg: role === selectedRole ? selectionBg : undefined,
|
131
|
+
}}
|
132
|
+
>
|
133
|
+
{role}
|
134
|
+
</Dropdown.Item>
|
135
|
+
);
|
136
|
+
})}
|
137
|
+
</Dropdown.Content>
|
138
|
+
</Dropdown.Portal>
|
139
|
+
</Dropdown.Root>
|
140
|
+
</Box>
|
141
|
+
</Flex>
|
142
|
+
{!peer.isLocal && (
|
143
|
+
<Flex justify="between" css={{ w: '100%', mb: '$10' }}>
|
144
|
+
<Label htmlFor="requestRoleChangePermission" css={{ cursor: 'pointer' }}>
|
145
|
+
Request Permission
|
146
|
+
</Label>
|
147
|
+
<Checkbox.Root
|
148
|
+
checked={requestPermission}
|
149
|
+
onCheckedChange={value => setRequestPermission(value)}
|
150
|
+
id="requestRoleChangePermission"
|
151
|
+
data-testid="force_role_change_checkbox"
|
152
|
+
>
|
153
|
+
<Checkbox.Indicator>
|
154
|
+
<CheckIcon width={16} height={16} />
|
155
|
+
</Checkbox.Indicator>
|
156
|
+
</Checkbox.Root>
|
157
|
+
</Flex>
|
158
|
+
)}
|
159
|
+
<Flex justify="center" align="center" css={{ width: '100%', gap: '$md' }}>
|
160
|
+
<Box css={{ width: '50%' }}>
|
161
|
+
<Dialog.Close css={{ width: '100%', p: '$4 $8' }} asChild>
|
162
|
+
<Button variant="standard" outlined css={{ width: '100%' }} data-testid="cancel_button">
|
163
|
+
Cancel
|
164
|
+
</Button>
|
165
|
+
</Dialog.Close>
|
166
|
+
</Box>
|
167
|
+
<Box css={{ width: '50%' }}>
|
168
|
+
<Button
|
169
|
+
data-testid="change_button"
|
170
|
+
variant="primary"
|
171
|
+
css={{ width: '100%' }}
|
172
|
+
onClick={async () => {
|
173
|
+
await hmsActions.changeRole(peerId, selectedRole, peer.isLocal ? true : !requestPermission);
|
174
|
+
onOpenChange(false);
|
175
|
+
}}
|
176
|
+
>
|
177
|
+
Change
|
178
|
+
</Button>
|
179
|
+
</Box>
|
180
|
+
</Flex>
|
181
|
+
</Dialog.Content>
|
182
|
+
</Dialog.Portal>
|
183
|
+
</Dialog.Root>
|
184
|
+
);
|
185
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { selectRoleChangeRequest, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
3
|
+
import { RequestDialog } from '../primitives/DialogContent';
|
4
|
+
import { useIsHeadless } from './AppData/useUISettings';
|
5
|
+
|
6
|
+
export const RoleChangeRequestModal = () => {
|
7
|
+
const hmsActions = useHMSActions();
|
8
|
+
const isHeadless = useIsHeadless();
|
9
|
+
const roleChangeRequest = useHMSStore(selectRoleChangeRequest);
|
10
|
+
|
11
|
+
if (!roleChangeRequest?.role || isHeadless) {
|
12
|
+
return null;
|
13
|
+
}
|
14
|
+
|
15
|
+
return (
|
16
|
+
<RequestDialog
|
17
|
+
title="Role Change Request"
|
18
|
+
onOpenChange={value => !value && hmsActions.rejectChangeRole(roleChangeRequest)}
|
19
|
+
body={`${roleChangeRequest?.requestedBy?.name} has requested you to change your role to ${roleChangeRequest?.role?.name}.`}
|
20
|
+
onAction={() => {
|
21
|
+
hmsActions.acceptChangeRole(roleChangeRequest);
|
22
|
+
}}
|
23
|
+
actionText="Accept"
|
24
|
+
/>
|
25
|
+
);
|
26
|
+
};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import React, { Fragment } from 'react';
|
2
|
+
import { selectIsAllowedToPublish, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
|
3
|
+
import { ShareScreenIcon } from '@100mslive/react-icons';
|
4
|
+
import { ShareScreenOptions } from './pdfAnnotator/shareScreenOptions';
|
5
|
+
import { Box, Flex } from '../../Layout';
|
6
|
+
import { Tooltip } from '../../Tooltip';
|
7
|
+
import { ScreenShareButton } from './ShareMenuIcon';
|
8
|
+
import { useUISettings } from './AppData/useUISettings';
|
9
|
+
import { isScreenshareSupported } from '../common/utils';
|
10
|
+
import { UI_SETTINGS } from '../common/constants';
|
11
|
+
|
12
|
+
export const ScreenshareToggle = ({ css = {} }) => {
|
13
|
+
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
14
|
+
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
15
|
+
|
16
|
+
const { amIScreenSharing, screenShareVideoTrackId: video, toggleScreenShare } = useScreenShare();
|
17
|
+
const isVideoScreenshare = amIScreenSharing && !!video;
|
18
|
+
if (!isAllowedToPublish.screen || !isScreenshareSupported()) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
|
22
|
+
return (
|
23
|
+
<Fragment>
|
24
|
+
<Flex direction="row">
|
25
|
+
<ScreenShareButton
|
26
|
+
variant="standard"
|
27
|
+
key="ShareScreen"
|
28
|
+
active={!isVideoScreenshare}
|
29
|
+
css={css}
|
30
|
+
disabled={isAudioOnly}
|
31
|
+
onClick={() => {
|
32
|
+
toggleScreenShare();
|
33
|
+
}}
|
34
|
+
>
|
35
|
+
<Tooltip title={`${!isVideoScreenshare ? 'Start' : 'Stop'} screen sharing`}>
|
36
|
+
<Box>
|
37
|
+
<ShareScreenIcon />
|
38
|
+
</Box>
|
39
|
+
</Tooltip>
|
40
|
+
</ScreenShareButton>
|
41
|
+
<ShareScreenOptions />
|
42
|
+
</Flex>
|
43
|
+
</Fragment>
|
44
|
+
);
|
45
|
+
};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useHMSActions } from '@100mslive/react-sdk';
|
3
|
+
import { CrossIcon, ShareScreenIcon } from '@100mslive/react-icons';
|
4
|
+
import { Button } from '../../Button';
|
5
|
+
import { Flex } from '../../Layout';
|
6
|
+
import { Text } from '../../Text';
|
7
|
+
|
8
|
+
export const ScreenshareDisplay = () => {
|
9
|
+
const hmsActions = useHMSActions();
|
10
|
+
|
11
|
+
return (
|
12
|
+
<Flex
|
13
|
+
direction="column"
|
14
|
+
align="center"
|
15
|
+
justify="center"
|
16
|
+
css={{
|
17
|
+
position: 'relative',
|
18
|
+
overflow: 'hidden',
|
19
|
+
w: '37.5rem',
|
20
|
+
maxWidth: '80%',
|
21
|
+
h: '100%',
|
22
|
+
r: '$3',
|
23
|
+
m: '0 auto',
|
24
|
+
color: '$textPrimary',
|
25
|
+
bg: '$surfaceDefault',
|
26
|
+
textAlign: 'center',
|
27
|
+
}}
|
28
|
+
>
|
29
|
+
<ShareScreenIcon width={48} height={48} />
|
30
|
+
<Text variant="h5" css={{ m: '$8 0' }}>
|
31
|
+
You are sharing your screen
|
32
|
+
</Text>
|
33
|
+
<Button
|
34
|
+
variant="danger"
|
35
|
+
onClick={async () => {
|
36
|
+
await hmsActions.setScreenShareEnabled(false);
|
37
|
+
}}
|
38
|
+
data-testid="stop_screen_share_btn"
|
39
|
+
>
|
40
|
+
<CrossIcon width={18} height={18} />
|
41
|
+
Stop screen share
|
42
|
+
</Button>
|
43
|
+
</Flex>
|
44
|
+
);
|
45
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useHMSActions } from '@100mslive/react-sdk';
|
3
|
+
import { Button } from '../../Button';
|
4
|
+
import { Dialog } from '../../Modal';
|
5
|
+
import { DialogContent, DialogRow } from '../primitives/DialogContent';
|
6
|
+
|
7
|
+
export const ScreenShareHintModal = ({ onClose }) => {
|
8
|
+
const hmsActions = useHMSActions();
|
9
|
+
return (
|
10
|
+
<Dialog.Root defaultOpen onOpenChange={value => !value && onClose()}>
|
11
|
+
<DialogContent title="AudioOnly Screenshare">
|
12
|
+
<img
|
13
|
+
src="https://images.app.100ms.live/share-audio.png"
|
14
|
+
alt="AudioOnly Screenshare instructions"
|
15
|
+
width="100%"
|
16
|
+
/>
|
17
|
+
<DialogRow justify="end">
|
18
|
+
<Button
|
19
|
+
variant="primary"
|
20
|
+
onClick={() => {
|
21
|
+
hmsActions
|
22
|
+
.setScreenShareEnabled(true, {
|
23
|
+
audioOnly: true,
|
24
|
+
displaySurface: 'browser',
|
25
|
+
})
|
26
|
+
.catch(console.error);
|
27
|
+
onClose();
|
28
|
+
}}
|
29
|
+
data-testid="audio_screenshare_continue"
|
30
|
+
>
|
31
|
+
Continue
|
32
|
+
</Button>
|
33
|
+
</DialogRow>
|
34
|
+
</DialogContent>
|
35
|
+
</Dialog.Root>
|
36
|
+
);
|
37
|
+
};
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
2
|
+
import { useFullscreen } from 'react-use';
|
3
|
+
import screenfull from 'screenfull';
|
4
|
+
import {
|
5
|
+
selectLocalPeerID,
|
6
|
+
selectPeerByID,
|
7
|
+
selectScreenShareAudioByPeerID,
|
8
|
+
selectScreenShareByPeerID,
|
9
|
+
useHMSStore,
|
10
|
+
} from '@100mslive/react-sdk';
|
11
|
+
import { ExpandIcon, ShrinkIcon } from '@100mslive/react-icons';
|
12
|
+
import { VideoTileStats } from '../../Stats';
|
13
|
+
import { Video } from '../../Video';
|
14
|
+
import { StyledVideoTile } from '../../VideoTile';
|
15
|
+
import { getVideoTileLabel } from './peerTileUtils';
|
16
|
+
import TileMenu from './TileMenu';
|
17
|
+
import { useIsHeadless, useUISettings } from './AppData/useUISettings';
|
18
|
+
import { UI_SETTINGS } from '../common/constants';
|
19
|
+
|
20
|
+
const labelStyles = {
|
21
|
+
position: 'unset',
|
22
|
+
width: '100%',
|
23
|
+
textAlign: 'center',
|
24
|
+
transform: 'none',
|
25
|
+
mt: '$2',
|
26
|
+
flexShrink: 0,
|
27
|
+
};
|
28
|
+
|
29
|
+
const Tile = ({ peerId, width = '100%', height = '100%' }) => {
|
30
|
+
const isLocal = useHMSStore(selectLocalPeerID) === peerId;
|
31
|
+
const track = useHMSStore(selectScreenShareByPeerID(peerId));
|
32
|
+
const peer = useHMSStore(selectPeerByID(peerId));
|
33
|
+
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
34
|
+
const isHeadless = useIsHeadless();
|
35
|
+
const [isMouseHovered, setIsMouseHovered] = useState(false);
|
36
|
+
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
37
|
+
const label = getVideoTileLabel({
|
38
|
+
peerName: peer.name,
|
39
|
+
isLocal: false,
|
40
|
+
track,
|
41
|
+
});
|
42
|
+
const fullscreenRef = useRef(null);
|
43
|
+
// fullscreen is for desired state
|
44
|
+
const [fullscreen, setFullscreen] = useState(false);
|
45
|
+
// isFullscreen is for true state
|
46
|
+
const isFullscreen = useFullscreen(fullscreenRef, fullscreen, {
|
47
|
+
onClose: () => setFullscreen(false),
|
48
|
+
});
|
49
|
+
const isFullScreenSupported = screenfull.isEnabled;
|
50
|
+
const audioTrack = useHMSStore(selectScreenShareAudioByPeerID(peer?.id));
|
51
|
+
return (
|
52
|
+
<StyledVideoTile.Root css={{ width, height }} data-testid="screenshare_tile">
|
53
|
+
{peer ? (
|
54
|
+
<StyledVideoTile.Container
|
55
|
+
transparentBg
|
56
|
+
ref={fullscreenRef}
|
57
|
+
css={{ flexDirection: 'column' }}
|
58
|
+
onMouseEnter={() => setIsMouseHovered(true)}
|
59
|
+
onMouseLeave={() => {
|
60
|
+
setIsMouseHovered(false);
|
61
|
+
}}
|
62
|
+
>
|
63
|
+
{showStatsOnTiles ? (
|
64
|
+
<VideoTileStats audioTrackID={audioTrack?.id} videoTrackID={track?.id} peerID={peerId} isLocal={isLocal} />
|
65
|
+
) : null}
|
66
|
+
{isFullScreenSupported && !isHeadless ? (
|
67
|
+
<StyledVideoTile.FullScreenButton onClick={() => setFullscreen(!fullscreen)}>
|
68
|
+
{isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
|
69
|
+
</StyledVideoTile.FullScreenButton>
|
70
|
+
) : null}
|
71
|
+
{track ? (
|
72
|
+
<Video
|
73
|
+
screenShare={true}
|
74
|
+
mirror={peer.isLocal && track?.source === 'regular'}
|
75
|
+
attach={!isAudioOnly}
|
76
|
+
trackId={track.id}
|
77
|
+
/>
|
78
|
+
) : null}
|
79
|
+
<StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
|
80
|
+
{isMouseHovered && !isHeadless && !peer?.isLocal ? (
|
81
|
+
<TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
|
82
|
+
) : null}
|
83
|
+
</StyledVideoTile.Container>
|
84
|
+
) : null}
|
85
|
+
</StyledVideoTile.Root>
|
86
|
+
);
|
87
|
+
};
|
88
|
+
|
89
|
+
const ScreenshareTile = React.memo(Tile);
|
90
|
+
|
91
|
+
export default ScreenshareTile;
|