@100mslive/roomkit-react 0.4.3-alpha.2 → 0.4.3-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/dist/Prebuilt/App.d.ts +0 -1
- package/dist/Prebuilt/AppContext.d.ts +0 -1
- package/dist/index.cjs.css +194 -219
- package/dist/index.cjs.css.map +3 -3
- package/dist/index.cjs.js +8 -56
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.css +194 -219
- package/dist/index.css.map +3 -3
- package/dist/index.js +8 -56
- package/dist/index.js.map +3 -3
- package/dist/meta.cjs.json +23 -41
- package/dist/meta.esbuild.json +23 -41
- package/package.json +8 -9
- package/src/Accordion/Accordion.tsx +0 -88
- package/src/Accordion/index.ts +0 -8
- package/src/AudioLevel/AudioLevel.tsx +0 -84
- package/src/AudioLevel/audio-level.png +0 -0
- package/src/AudioLevel/index.ts +0 -2
- package/src/AudioLevel/useBorderAudioLevel.tsx +0 -34
- package/src/Avatar/Avatar.tsx +0 -60
- package/src/Avatar/getAvatarBg.ts +0 -50
- package/src/Avatar/index.ts +0 -1
- package/src/Button/Button.tsx +0 -210
- package/src/Button/index.tsx +0 -1
- package/src/Checkbox/Checkbox.tsx +0 -35
- package/src/Checkbox/index.tsx +0 -1
- package/src/Collapsible/Collapsible.tsx +0 -34
- package/src/Collapsible/index.tsx +0 -1
- package/src/Diagnostics/AudioTest.tsx +0 -188
- package/src/Diagnostics/BrowserTest.tsx +0 -141
- package/src/Diagnostics/ConnectivityTest.tsx +0 -383
- package/src/Diagnostics/DeviceSelector.jsx +0 -71
- package/src/Diagnostics/Diagnostics.tsx +0 -190
- package/src/Diagnostics/DiagnosticsContext.ts +0 -46
- package/src/Diagnostics/VideoTest.tsx +0 -72
- package/src/Diagnostics/components.tsx +0 -70
- package/src/Diagnostics/index.ts +0 -1
- package/src/Divider/Divider.tsx +0 -45
- package/src/Divider/index.ts +0 -1
- package/src/Dropdown/Dropdown.tsx +0 -145
- package/src/Dropdown/index.tsx +0 -1
- package/src/Fieldset/Fieldset.tsx +0 -11
- package/src/Fieldset/index.tsx +0 -1
- package/src/Footer/Footer.tsx +0 -47
- package/src/Footer/index.tsx +0 -1
- package/src/IconButton/IconButton.tsx +0 -43
- package/src/IconButton/index.tsx +0 -1
- package/src/Input/Input.tsx +0 -109
- package/src/Input/index.tsx +0 -1
- package/src/Label/Label.tsx +0 -8
- package/src/Label/index.ts +0 -1
- package/src/Layout/Box.tsx +0 -3
- package/src/Layout/Flex.tsx +0 -76
- package/src/Layout/index.tsx +0 -2
- package/src/Link/Link.tsx +0 -54
- package/src/Link/index.tsx +0 -2
- package/src/Loading/Loading.tsx +0 -30
- package/src/Loading/index.ts +0 -1
- package/src/Modal/Dialog.tsx +0 -57
- package/src/Modal/DialogContent.tsx +0 -65
- package/src/Modal/index.ts +0 -1
- package/src/Pagination/StyledPagination.tsx +0 -70
- package/src/Pagination/index.tsx +0 -1
- package/src/Popover/index.tsx +0 -34
- package/src/Prebuilt/App.tsx +0 -323
- package/src/Prebuilt/AppContext.tsx +0 -34
- package/src/Prebuilt/AppStateContext.tsx +0 -95
- package/src/Prebuilt/IconButton.tsx +0 -26
- package/src/Prebuilt/common/PeersSorter.ts +0 -111
- package/src/Prebuilt/common/constants.ts +0 -151
- package/src/Prebuilt/common/hooks.ts +0 -257
- package/src/Prebuilt/common/utils.js +0 -185
- package/src/Prebuilt/components/AppData/AppData.tsx +0 -208
- package/src/Prebuilt/components/AppData/useChatState.js +0 -18
- package/src/Prebuilt/components/AppData/useSheet.ts +0 -33
- package/src/Prebuilt/components/AppData/useSidepane.js +0 -99
- package/src/Prebuilt/components/AppData/useSidepaneResetOnLayoutUpdate.tsx +0 -22
- package/src/Prebuilt/components/AppData/useUISettings.js +0 -212
- package/src/Prebuilt/components/AudioVideoToggle.tsx +0 -411
- package/src/Prebuilt/components/AuthToken.tsx +0 -148
- package/src/Prebuilt/components/CaptionIcon.tsx +0 -27
- package/src/Prebuilt/components/Chat/ArrowNavigation.tsx +0 -44
- package/src/Prebuilt/components/Chat/Chat.tsx +0 -190
- package/src/Prebuilt/components/Chat/ChatActions.tsx +0 -314
- package/src/Prebuilt/components/Chat/ChatBody.tsx +0 -493
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +0 -316
- package/src/Prebuilt/components/Chat/ChatSelector.tsx +0 -228
- package/src/Prebuilt/components/Chat/ChatSelectorContainer.tsx +0 -158
- package/src/Prebuilt/components/Chat/ChatStates.tsx +0 -73
- package/src/Prebuilt/components/Chat/EmptyChat.tsx +0 -58
- package/src/Prebuilt/components/Chat/MwebChatOption.tsx +0 -24
- package/src/Prebuilt/components/Chat/PinnedMessage.tsx +0 -140
- package/src/Prebuilt/components/Chat/StickIndicator.tsx +0 -24
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +0 -32
- package/src/Prebuilt/components/Chat/useUnreadCount.ts +0 -19
- package/src/Prebuilt/components/Chat/utils.ts +0 -11
- package/src/Prebuilt/components/ChatSettings.tsx +0 -68
- package/src/Prebuilt/components/Chip.tsx +0 -40
- package/src/Prebuilt/components/ConferenceScreen.tsx +0 -205
- package/src/Prebuilt/components/Connection/ConnectionIndicator.tsx +0 -89
- package/src/Prebuilt/components/Connection/TileConnection.tsx +0 -93
- package/src/Prebuilt/components/Connection/connectionQualityUtils.js +0 -37
- package/src/Prebuilt/components/EmojiReaction.jsx +0 -100
- package/src/Prebuilt/components/EndCallFeedback/Feedback.tsx +0 -71
- package/src/Prebuilt/components/EndCallFeedback/FeedbackForm.tsx +0 -381
- package/src/Prebuilt/components/EndCallFeedback/ThankyouView.tsx +0 -64
- package/src/Prebuilt/components/ErrorBoundary.jsx +0 -102
- package/src/Prebuilt/components/Footer/ChatToggle.tsx +0 -53
- package/src/Prebuilt/components/Footer/EmojiCard.jsx +0 -34
- package/src/Prebuilt/components/Footer/Footer.tsx +0 -115
- package/src/Prebuilt/components/Footer/PaginatedParticipants.tsx +0 -124
- package/src/Prebuilt/components/Footer/ParticipantList.tsx +0 -478
- package/src/Prebuilt/components/Footer/PollsToggle.tsx +0 -37
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +0 -183
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +0 -215
- package/src/Prebuilt/components/Footer/WhiteboardToggle.tsx +0 -52
- package/src/Prebuilt/components/FullPageProgress.tsx +0 -22
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +0 -22
- package/src/Prebuilt/components/HMSVideo/FullscreenButton.tsx +0 -13
- package/src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.tsx +0 -72
- package/src/Prebuilt/components/HMSVideo/HLSCaptionSelector.tsx +0 -15
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.tsx +0 -248
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +0 -75
- package/src/Prebuilt/components/HMSVideo/MwebHLSViewTitle.tsx +0 -86
- package/src/Prebuilt/components/HMSVideo/PlayPauseButton.tsx +0 -27
- package/src/Prebuilt/components/HMSVideo/PlayPauseSeekControls.tsx +0 -158
- package/src/Prebuilt/components/HMSVideo/PlayerContext.tsx +0 -15
- package/src/Prebuilt/components/HMSVideo/SeekControl.tsx +0 -22
- package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +0 -100
- package/src/Prebuilt/components/HMSVideo/VideoTime.tsx +0 -52
- package/src/Prebuilt/components/HMSVideo/VolumeControl.tsx +0 -70
- package/src/Prebuilt/components/HMSVideo/index.ts +0 -24
- package/src/Prebuilt/components/HMSVideo/utils.ts +0 -37
- package/src/Prebuilt/components/Header/Header.tsx +0 -52
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +0 -57
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +0 -89
- package/src/Prebuilt/components/Header/RoomDetailsHeader.tsx +0 -51
- package/src/Prebuilt/components/Header/StreamActions.tsx +0 -297
- package/src/Prebuilt/components/Header/common.jsx +0 -196
- package/src/Prebuilt/components/Header/index.tsx +0 -1
- package/src/Prebuilt/components/HlsStatsOverlay.jsx +0 -89
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.tsx +0 -167
- package/src/Prebuilt/components/Input/KeyboardInputManager.js +0 -107
- package/src/Prebuilt/components/InsetTile.tsx +0 -136
- package/src/Prebuilt/components/LayoutModeSelector.tsx +0 -112
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +0 -166
- package/src/Prebuilt/components/Leave/EndSessionContent.tsx +0 -64
- package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +0 -26
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +0 -36
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +0 -82
- package/src/Prebuilt/components/Leave/LeaveSessionContent.tsx +0 -61
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +0 -135
- package/src/Prebuilt/components/LeaveScreen.tsx +0 -71
- package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +0 -60
- package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +0 -139
- package/src/Prebuilt/components/MoreSettings/CaptionContent.tsx +0 -143
- package/src/Prebuilt/components/MoreSettings/CaptionModal.tsx +0 -37
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.tsx +0 -123
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.tsx +0 -78
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +0 -81
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.tsx +0 -26
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +0 -29
- package/src/Prebuilt/components/MoreSettings/MuteAllContent.tsx +0 -81
- package/src/Prebuilt/components/MoreSettings/MuteAllModal.tsx +0 -72
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +0 -282
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +0 -387
- package/src/Prebuilt/components/MoreSettings/constants.ts +0 -14
- package/src/Prebuilt/components/MwebLandscapePrompt.tsx +0 -81
- package/src/Prebuilt/components/Notifications/AutoplayBlockedModal.tsx +0 -39
- package/src/Prebuilt/components/Notifications/ChatNotifications.tsx +0 -34
- package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
- package/src/Prebuilt/components/Notifications/DeviceInUseError.tsx +0 -86
- package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
- package/src/Prebuilt/components/Notifications/HLSFailureModal.tsx +0 -71
- package/src/Prebuilt/components/Notifications/HandRaisedNotifications.tsx +0 -78
- package/src/Prebuilt/components/Notifications/InitErrorModal.tsx +0 -42
- package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
- package/src/Prebuilt/components/Notifications/Notifications.tsx +0 -65
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +0 -52
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.tsx +0 -144
- package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +0 -33
- package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +0 -24
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +0 -61
- package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +0 -41
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +0 -63
- package/src/Prebuilt/components/Notifications/TranscriptionNotifications.tsx +0 -58
- package/src/Prebuilt/components/Notifications/index.tsx +0 -1
- package/src/Prebuilt/components/PIP/PIPChat.tsx +0 -292
- package/src/Prebuilt/components/PIP/PIPChatOption.tsx +0 -18
- package/src/Prebuilt/components/PIP/PIPComponent.tsx +0 -90
- package/src/Prebuilt/components/PIP/PIPManager.ts +0 -335
- package/src/Prebuilt/components/PIP/PIPProvider.tsx +0 -56
- package/src/Prebuilt/components/PIP/PIPWindow.tsx +0 -13
- package/src/Prebuilt/components/PIP/SetupMediaSession.js +0 -60
- package/src/Prebuilt/components/PIP/context.ts +0 -10
- package/src/Prebuilt/components/PIP/index.jsx +0 -6
- package/src/Prebuilt/components/PIP/pip.test.js +0 -72
- package/src/Prebuilt/components/PIP/pipUtils.js +0 -183
- package/src/Prebuilt/components/PIP/usePIPChat.tsx +0 -105
- package/src/Prebuilt/components/PIP/usePIPWindow.tsx +0 -12
- package/src/Prebuilt/components/Pagination.tsx +0 -60
- package/src/Prebuilt/components/Polls/CreatePollQuiz/PollsQuizMenu.tsx +0 -248
- package/src/Prebuilt/components/Polls/CreateQuestions/CreateQuestions.jsx +0 -142
- package/src/Prebuilt/components/Polls/CreateQuestions/DeleteQuestionModal.tsx +0 -74
- package/src/Prebuilt/components/Polls/CreateQuestions/QuestionForm.tsx +0 -324
- package/src/Prebuilt/components/Polls/CreateQuestions/SavedQuestion.tsx +0 -64
- package/src/Prebuilt/components/Polls/Polls.tsx +0 -31
- package/src/Prebuilt/components/Polls/Voting/LeaderboardEntry.tsx +0 -76
- package/src/Prebuilt/components/Polls/Voting/LeaderboardSummary.tsx +0 -116
- package/src/Prebuilt/components/Polls/Voting/PeerParticipationSummary.tsx +0 -60
- package/src/Prebuilt/components/Polls/Voting/QuestionCard.jsx +0 -221
- package/src/Prebuilt/components/Polls/Voting/StandardVoting.tsx +0 -47
- package/src/Prebuilt/components/Polls/Voting/StatisticBox.tsx +0 -20
- package/src/Prebuilt/components/Polls/Voting/TimedVoting.tsx +0 -55
- package/src/Prebuilt/components/Polls/Voting/Voting.tsx +0 -143
- package/src/Prebuilt/components/Polls/Voting/useQuizSummary.tsx +0 -50
- package/src/Prebuilt/components/Polls/common/Line.tsx +0 -4
- package/src/Prebuilt/components/Polls/common/MultipleChoiceOptions.jsx +0 -115
- package/src/Prebuilt/components/Polls/common/OptionInputWithDelete.tsx +0 -38
- package/src/Prebuilt/components/Polls/common/SingleChoiceOptions.jsx +0 -140
- package/src/Prebuilt/components/Polls/common/StatusIndicator.tsx +0 -35
- package/src/Prebuilt/components/Polls/common/VoteCount.tsx +0 -15
- package/src/Prebuilt/components/Polls/common/VoteProgress.tsx +0 -18
- package/src/Prebuilt/components/Polls/common/constants.ts +0 -5
- package/src/Prebuilt/components/Polls/common/utils.ts +0 -22
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +0 -94
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +0 -292
- package/src/Prebuilt/components/Preview/PreviewScreen.tsx +0 -38
- package/src/Prebuilt/components/PreviousRoleInMetadata.tsx +0 -20
- package/src/Prebuilt/components/RaiseHand.tsx +0 -30
- package/src/Prebuilt/components/RemoveParticipant.tsx +0 -35
- package/src/Prebuilt/components/RoleChangeModal.tsx +0 -188
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +0 -75
- package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +0 -94
- package/src/Prebuilt/components/RoomDetails/Duration.tsx +0 -26
- package/src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx +0 -63
- package/src/Prebuilt/components/RoomDetails/RoomDetailsRow.tsx +0 -23
- package/src/Prebuilt/components/RoomDetails/RoomDetailsSheet.tsx +0 -45
- package/src/Prebuilt/components/ScreenShareToggle.jsx +0 -58
- package/src/Prebuilt/components/ScreenshareDisplay.tsx +0 -39
- package/src/Prebuilt/components/ScreenshareTile.tsx +0 -134
- package/src/Prebuilt/components/SecondaryTiles.tsx +0 -81
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +0 -208
- package/src/Prebuilt/components/Settings/LayoutSettings.tsx +0 -74
- package/src/Prebuilt/components/Settings/NotificationSettings.tsx +0 -66
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +0 -301
- package/src/Prebuilt/components/Settings/StartRecording.jsx +0 -101
- package/src/Prebuilt/components/Settings/SwitchWithLabel.tsx +0 -53
- package/src/Prebuilt/components/Settings/common.ts +0 -16
- package/src/Prebuilt/components/ShareMenuIcon.jsx +0 -27
- package/src/Prebuilt/components/SidePaneTabs.tsx +0 -214
- package/src/Prebuilt/components/StatsForNerds.jsx +0 -373
- package/src/Prebuilt/components/Streaming/Common.jsx +0 -143
- package/src/Prebuilt/components/Streaming/ResolutionInput.jsx +0 -88
- package/src/Prebuilt/components/TileMenu/TileMenu.tsx +0 -148
- package/src/Prebuilt/components/TileMenu/TileMenuContent.tsx +0 -393
- package/src/Prebuilt/components/TileMenu/utils.ts +0 -7
- package/src/Prebuilt/components/Toast/Toast.jsx +0 -17
- package/src/Prebuilt/components/Toast/ToastBatcher.js +0 -64
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +0 -177
- package/src/Prebuilt/components/Toast/ToastContainer.jsx +0 -30
- package/src/Prebuilt/components/Toast/ToastManager.js +0 -44
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +0 -62
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +0 -43
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +0 -155
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +0 -91
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +0 -66
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +0 -74
- package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +0 -93
- package/src/Prebuilt/components/VideoLayouts/interface.ts +0 -11
- package/src/Prebuilt/components/VideoTile.tsx +0 -203
- package/src/Prebuilt/components/VirtualBackground/VBCollection.tsx +0 -52
- package/src/Prebuilt/components/VirtualBackground/VBHandler.tsx +0 -130
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +0 -57
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -252
- package/src/Prebuilt/components/VirtualBackground/VBToggle.tsx +0 -50
- package/src/Prebuilt/components/hooks/useAudioOutputTest.tsx +0 -20
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +0 -70
- package/src/Prebuilt/components/hooks/useChatBlacklist.ts +0 -29
- package/src/Prebuilt/components/hooks/useCloseScreenshareWhiteboard.tsx +0 -17
- package/src/Prebuilt/components/hooks/useDropdownList.ts +0 -24
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +0 -3
- package/src/Prebuilt/components/hooks/useFullscreen.ts +0 -46
- package/src/Prebuilt/components/hooks/useGroupOnStageActions.tsx +0 -54
- package/src/Prebuilt/components/hooks/useMetadata.tsx +0 -56
- package/src/Prebuilt/components/hooks/usePeerOnStageActions.tsx +0 -49
- package/src/Prebuilt/components/hooks/usePinnedBy.tsx +0 -22
- package/src/Prebuilt/components/hooks/usePinnedMessages.ts +0 -78
- package/src/Prebuilt/components/hooks/usePlaylist.js +0 -25
- package/src/Prebuilt/components/hooks/usePlaylistMusic.js +0 -35
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +0 -23
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +0 -39
- package/src/Prebuilt/components/hooks/useScreenshareAudio.js +0 -28
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +0 -128
- package/src/Prebuilt/components/hooks/useUnreadPollQuizPresent.tsx +0 -17
- package/src/Prebuilt/components/hooks/useUserPreferences.jsx +0 -26
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +0 -26
- package/src/Prebuilt/components/init/Init.jsx +0 -31
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +0 -42
- package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +0 -31
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +0 -32
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +0 -211
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +0 -48
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +0 -71
- package/src/Prebuilt/components/peerTileUtils.tsx +0 -42
- package/src/Prebuilt/images/android-perm-1.png +0 -0
- package/src/Prebuilt/images/empty-chat.svg +0 -12
- package/src/Prebuilt/images/ios-perm-0.png +0 -0
- package/src/Prebuilt/images/pdf-share.png +0 -0
- package/src/Prebuilt/images/rtmp.png +0 -0
- package/src/Prebuilt/images/screen-share.png +0 -0
- package/src/Prebuilt/images/transaction_error.svg +0 -12
- package/src/Prebuilt/index.ts +0 -1
- package/src/Prebuilt/layouts/EmbedView.jsx +0 -94
- package/src/Prebuilt/layouts/HLSView.jsx +0 -794
- package/src/Prebuilt/layouts/PDFView.jsx +0 -67
- package/src/Prebuilt/layouts/Sheet.tsx +0 -14
- package/src/Prebuilt/layouts/SidePane.tsx +0 -241
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +0 -164
- package/src/Prebuilt/layouts/WaitingView.tsx +0 -52
- package/src/Prebuilt/plugins/CaptionsViewer.tsx +0 -261
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +0 -154
- package/src/Prebuilt/plugins/RemoteStopScreenshare.jsx +0 -18
- package/src/Prebuilt/plugins/transcription/Transcriber.js +0 -216
- package/src/Prebuilt/plugins/transcription/TranscriptionButton.jsx +0 -138
- package/src/Prebuilt/plugins/transcription/index.jsx +0 -1
- package/src/Prebuilt/primitives/DialogContent.jsx +0 -285
- package/src/Prebuilt/primitives/DropdownTrigger.jsx +0 -46
- package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +0 -60
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +0 -88
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +0 -10
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +0 -112
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +0 -53
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -46
- package/src/Progress/index.tsx +0 -17
- package/src/QRCode/QRCode.tsx +0 -6
- package/src/QRCode/index.tsx +0 -1
- package/src/RadioGroup/RadioGroup.tsx +0 -33
- package/src/RadioGroup/index.tsx +0 -1
- package/src/ReactSelect/ReactSelect.tsx +0 -97
- package/src/ReactSelect/index.ts +0 -1
- package/src/Select/Select.tsx +0 -63
- package/src/Select/index.ts +0 -1
- package/src/Sheet/Sheet.tsx +0 -122
- package/src/Sheet/index.ts +0 -1
- package/src/Slider/Slider.tsx +0 -70
- package/src/Slider/index.ts +0 -1
- package/src/Stats/Stats.tsx +0 -243
- package/src/Stats/StyledStats.tsx +0 -57
- package/src/Stats/formatBytes.ts +0 -19
- package/src/Stats/index.tsx +0 -2
- package/src/Stats/useQoE.ts +0 -79
- package/src/Switch/Switch.tsx +0 -52
- package/src/Switch/index.ts +0 -1
- package/src/Tabs/Tabs.tsx +0 -41
- package/src/Tabs/index.tsx +0 -1
- package/src/Text/Text.tsx +0 -149
- package/src/Text/index.tsx +0 -1
- package/src/TextArea/TextArea.tsx +0 -30
- package/src/TextArea/index.tsx +0 -1
- package/src/Theme/ThemeProvider.tsx +0 -98
- package/src/Theme/base.config.ts +0 -236
- package/src/Theme/index.tsx +0 -2
- package/src/Theme/stitches.config.ts +0 -88
- package/src/Theme/useSSR.tsx +0 -24
- package/src/TileMenu/StyledMenuTile.tsx +0 -105
- package/src/TileMenu/TileMenu.tsx +0 -98
- package/src/TileMenu/index.tsx +0 -1
- package/src/Toast/Toast.tsx +0 -170
- package/src/Toast/index.tsx +0 -1
- package/src/Tooltip/Tooltip.tsx +0 -79
- package/src/Tooltip/index.ts +0 -1
- package/src/Video/Video.tsx +0 -61
- package/src/Video/index.tsx +0 -1
- package/src/VideoList/StyledVideoList.tsx +0 -39
- package/src/VideoList/index.tsx +0 -2
- package/src/VideoList/videoListUtils.tsx +0 -20
- package/src/VideoTile/StyledVideoTile.tsx +0 -146
- package/src/VideoTile/index.tsx +0 -1
- package/src/context/DialogContext.tsx +0 -13
- package/src/fixtures/chats.ts +0 -25
- package/src/fixtures/peers.ts +0 -27
- package/src/fixtures/tracks.ts +0 -11
- package/src/hooks/useDialogContainerSelector.tsx +0 -7
- package/src/index.ts +0 -41
- package/src/store/SetupFakeStore.ts +0 -33
- package/src/store/StorybookSDK.ts +0 -231
- package/src/utils/animations.ts +0 -114
- package/src/utils/index.ts +0 -2
- package/src/utils/styles.ts +0 -22
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { useMedia } from 'react-use';
|
|
3
|
-
import data from '@emoji-mart/data/sets/14/apple.json';
|
|
4
|
-
import Picker from '@emoji-mart/react';
|
|
5
|
-
import { HMSException, selectLocalPeer, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
|
6
|
-
import { EmojiIcon, PauseCircleIcon, SendIcon, VerticalMenuIcon } from '@100mslive/react-icons';
|
|
7
|
-
import { Box, config as cssConfig, Flex, IconButton as BaseIconButton, Popover, styled, Text } from '../../..';
|
|
8
|
-
import { IconButton } from '../../../IconButton';
|
|
9
|
-
import { MoreSettings } from '../MoreSettings/MoreSettings';
|
|
10
|
-
import { RaiseHand } from '../RaiseHand';
|
|
11
|
-
// @ts-ignore: No implicit any
|
|
12
|
-
import { ToastManager } from '../Toast/ToastManager';
|
|
13
|
-
import { ChatSelectorContainer } from './ChatSelectorContainer';
|
|
14
|
-
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
15
|
-
// @ts-ignore: No implicit any
|
|
16
|
-
import { useChatDraftMessage } from '../AppData/useChatState';
|
|
17
|
-
// @ts-ignore: No implicit any
|
|
18
|
-
import { useSetSubscribedChatSelector, useSubscribeChatSelector } from '../AppData/useUISettings';
|
|
19
|
-
import { useIsPeerBlacklisted } from '../hooks/useChatBlacklist';
|
|
20
|
-
// @ts-ignore: No implicit any
|
|
21
|
-
import { useEmojiPickerStyles } from './useEmojiPickerStyles';
|
|
22
|
-
import { useDefaultChatSelection, useLandscapeHLSStream, useMobileHLSStream } from '../../common/hooks';
|
|
23
|
-
import { CHAT_MESSAGE_LIMIT } from './utils';
|
|
24
|
-
import { CHAT_SELECTOR, SESSION_STORE_KEY } from '../../common/constants';
|
|
25
|
-
|
|
26
|
-
const TextArea = styled('textarea', {
|
|
27
|
-
width: '100%',
|
|
28
|
-
bg: 'transparent',
|
|
29
|
-
color: '$on_primary_high',
|
|
30
|
-
resize: 'none',
|
|
31
|
-
lineHeight: '1rem',
|
|
32
|
-
position: 'relative',
|
|
33
|
-
fontFamily: '$sans',
|
|
34
|
-
fontSize: '100%',
|
|
35
|
-
margin: 0,
|
|
36
|
-
padding: 0,
|
|
37
|
-
top: '$3',
|
|
38
|
-
'&:focus': {
|
|
39
|
-
boxShadow: 'none',
|
|
40
|
-
outline: 'none',
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
function EmojiPicker({ onSelect }: { onSelect: (emoji: any) => void }) {
|
|
45
|
-
const [showEmoji, setShowEmoji] = useState(false);
|
|
46
|
-
const ref = useEmojiPickerStyles(showEmoji);
|
|
47
|
-
return (
|
|
48
|
-
<Popover.Root open={showEmoji} onOpenChange={setShowEmoji}>
|
|
49
|
-
<Popover.Trigger asChild css={{ appearance: 'none' }}>
|
|
50
|
-
<BaseIconButton as="div">
|
|
51
|
-
<EmojiIcon />
|
|
52
|
-
</BaseIconButton>
|
|
53
|
-
</Popover.Trigger>
|
|
54
|
-
<Popover.Portal>
|
|
55
|
-
<Popover.Content
|
|
56
|
-
alignOffset={-40}
|
|
57
|
-
sideOffset={16}
|
|
58
|
-
align="end"
|
|
59
|
-
css={{
|
|
60
|
-
p: 0,
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
<Box
|
|
64
|
-
css={{
|
|
65
|
-
minWidth: 352,
|
|
66
|
-
minHeight: 435,
|
|
67
|
-
}}
|
|
68
|
-
ref={ref}
|
|
69
|
-
>
|
|
70
|
-
<Picker onEmojiSelect={onSelect} data={data} previewPosition="none" skinPosition="search" />
|
|
71
|
-
</Box>
|
|
72
|
-
</Popover.Content>
|
|
73
|
-
</Popover.Portal>
|
|
74
|
-
</Popover.Root>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => void; children?: ReactNode }) => {
|
|
79
|
-
const hmsActions = useHMSActions();
|
|
80
|
-
const inputRef = useRef<HTMLTextAreaElement>(null);
|
|
81
|
-
const [draftMessage, setDraftMessage] = useChatDraftMessage();
|
|
82
|
-
const isMobile = useMedia(cssConfig.media.md);
|
|
83
|
-
const { elements, screenType } = useRoomLayoutConferencingScreen();
|
|
84
|
-
const message_placeholder = elements?.chat?.message_placeholder || 'Send a message';
|
|
85
|
-
const localPeer = useHMSStore(selectLocalPeer);
|
|
86
|
-
const isOverlayChat = elements?.chat?.is_overlay;
|
|
87
|
-
const canDisableChat = !!elements?.chat?.real_time_controls?.can_disable_chat;
|
|
88
|
-
const selectedPeer = useSubscribeChatSelector(CHAT_SELECTOR.PEER);
|
|
89
|
-
const [selectedRole, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
|
90
|
-
const defaultSelection = useDefaultChatSelection();
|
|
91
|
-
const selection = selectedPeer.name || selectedRole || defaultSelection;
|
|
92
|
-
const isLocalPeerBlacklisted = useIsPeerBlacklisted({ local: true });
|
|
93
|
-
const isMwebHLSStream = useMobileHLSStream();
|
|
94
|
-
const [messageLengthExceeded, setMessageLengthExceeded] = useState(false);
|
|
95
|
-
const isLandscapeHLSStream = useLandscapeHLSStream();
|
|
96
|
-
|
|
97
|
-
useEffect(() => {
|
|
98
|
-
if (!selectedPeer.id && !selectedRole && !['Everyone', ''].includes(defaultSelection)) {
|
|
99
|
-
setRoleSelector(defaultSelection);
|
|
100
|
-
} else {
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
if (!(isMobile || isLandscapeHLSStream) && !elements?.chat?.disable_autofocus) {
|
|
103
|
-
inputRef.current?.focus();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}, [defaultSelection, selectedPeer, selectedRole, setRoleSelector, isMobile, isLandscapeHLSStream, elements?.chat]);
|
|
107
|
-
|
|
108
|
-
const resetInputHeight = useCallback(() => {
|
|
109
|
-
if (inputRef.current) {
|
|
110
|
-
inputRef.current.style.height = `${Math.max(
|
|
111
|
-
32,
|
|
112
|
-
inputRef.current.value ? Math.min(inputRef.current.scrollHeight, 24 * 4) : 0,
|
|
113
|
-
)}px`;
|
|
114
|
-
}
|
|
115
|
-
}, []);
|
|
116
|
-
|
|
117
|
-
const updateInputHeight = useCallback(() => {
|
|
118
|
-
if (inputRef.current) {
|
|
119
|
-
inputRef.current.style.height = `${Math.max(32, Math.min(inputRef.current.scrollHeight, 24 * 4))}px`;
|
|
120
|
-
}
|
|
121
|
-
}, []);
|
|
122
|
-
|
|
123
|
-
const sendMessage = useCallback(async () => {
|
|
124
|
-
const message = inputRef?.current?.value;
|
|
125
|
-
if (!message || !message.trim().length) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
try {
|
|
129
|
-
if (selectedRole) {
|
|
130
|
-
await hmsActions.sendGroupMessage(message, [selectedRole]);
|
|
131
|
-
} else if (selectedPeer.id) {
|
|
132
|
-
await hmsActions.sendDirectMessage(message, selectedPeer.id);
|
|
133
|
-
} else {
|
|
134
|
-
await hmsActions.sendBroadcastMessage(message);
|
|
135
|
-
}
|
|
136
|
-
inputRef.current.value = '';
|
|
137
|
-
resetInputHeight();
|
|
138
|
-
setTimeout(() => {
|
|
139
|
-
onSend(1);
|
|
140
|
-
}, 0);
|
|
141
|
-
} catch (error) {
|
|
142
|
-
const err = error as HMSException;
|
|
143
|
-
ToastManager.addToast({
|
|
144
|
-
title: err.message.startsWith('Invalid peer') ? `${selectedPeer.name} is not in this room` : err.message,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}, [selectedRole, selectedPeer, hmsActions, onSend]);
|
|
148
|
-
|
|
149
|
-
useEffect(() => {
|
|
150
|
-
const messageElement = inputRef.current;
|
|
151
|
-
if (messageElement) {
|
|
152
|
-
messageElement.value = draftMessage;
|
|
153
|
-
updateInputHeight();
|
|
154
|
-
setMessageLengthExceeded(draftMessage.length > CHAT_MESSAGE_LIMIT);
|
|
155
|
-
}
|
|
156
|
-
}, [draftMessage]);
|
|
157
|
-
|
|
158
|
-
useEffect(() => {
|
|
159
|
-
const messageElement = inputRef.current;
|
|
160
|
-
return () => {
|
|
161
|
-
setDraftMessage(messageElement?.value || '');
|
|
162
|
-
};
|
|
163
|
-
}, [setDraftMessage]);
|
|
164
|
-
|
|
165
|
-
if (isLocalPeerBlacklisted) {
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<Box css={{ position: 'relative' }}>
|
|
171
|
-
<Flex>
|
|
172
|
-
<ChatSelectorContainer />
|
|
173
|
-
{canDisableChat && isMobile && isOverlayChat ? (
|
|
174
|
-
<Flex align="center" justify="end" css={{ mb: '$4' }} onClick={e => e.stopPropagation()}>
|
|
175
|
-
<Popover.Root>
|
|
176
|
-
<Popover.Trigger asChild>
|
|
177
|
-
<IconButton css={{ border: '1px solid $border_bright' }}>
|
|
178
|
-
<VerticalMenuIcon height="16" width="16" />
|
|
179
|
-
</IconButton>
|
|
180
|
-
</Popover.Trigger>
|
|
181
|
-
<Popover.Portal>
|
|
182
|
-
<Popover.Content
|
|
183
|
-
align="end"
|
|
184
|
-
side="top"
|
|
185
|
-
onClick={() => {
|
|
186
|
-
const chatState = {
|
|
187
|
-
enabled: false,
|
|
188
|
-
updatedBy: {
|
|
189
|
-
peerId: localPeer?.id,
|
|
190
|
-
userId: localPeer?.customerUserId,
|
|
191
|
-
userName: localPeer?.name,
|
|
192
|
-
},
|
|
193
|
-
updatedAt: Date.now(),
|
|
194
|
-
};
|
|
195
|
-
hmsActions.sessionStore.set(SESSION_STORE_KEY.CHAT_STATE, chatState);
|
|
196
|
-
}}
|
|
197
|
-
css={{
|
|
198
|
-
backgroundColor: '$surface_default',
|
|
199
|
-
display: 'flex',
|
|
200
|
-
alignItems: 'center',
|
|
201
|
-
gap: '$4',
|
|
202
|
-
borderRadius: '$1',
|
|
203
|
-
color: '$on_surface_high',
|
|
204
|
-
cursor: 'pointer',
|
|
205
|
-
'&:hover': { backgroundColor: '$surface_dim' },
|
|
206
|
-
}}
|
|
207
|
-
>
|
|
208
|
-
<PauseCircleIcon />
|
|
209
|
-
<Text variant="sm" css={{ fontWeight: '$semiBold' }}>
|
|
210
|
-
Pause Chat
|
|
211
|
-
</Text>
|
|
212
|
-
</Popover.Content>
|
|
213
|
-
</Popover.Portal>
|
|
214
|
-
</Popover.Root>
|
|
215
|
-
</Flex>
|
|
216
|
-
) : null}
|
|
217
|
-
</Flex>
|
|
218
|
-
{selection && (
|
|
219
|
-
<Flex align={inputRef.current?.scrollHeight === 32 ? 'center' : 'end'} css={{ gap: '$4', w: '100%' }}>
|
|
220
|
-
<Flex
|
|
221
|
-
align="end"
|
|
222
|
-
css={{
|
|
223
|
-
bg: isOverlayChat && isMobile ? '$surface_dim' : '$surface_default',
|
|
224
|
-
minHeight: '$16',
|
|
225
|
-
position: 'relative',
|
|
226
|
-
py: isOverlayChat && isMobile ? '$2' : '$6',
|
|
227
|
-
pl: '$8',
|
|
228
|
-
flexGrow: 1,
|
|
229
|
-
r: '$1',
|
|
230
|
-
'@md': {
|
|
231
|
-
minHeight: '$14',
|
|
232
|
-
boxSizing: 'border-box',
|
|
233
|
-
},
|
|
234
|
-
...(isLandscapeHLSStream ? { minHeight: '$14', py: 0 } : {}),
|
|
235
|
-
}}
|
|
236
|
-
>
|
|
237
|
-
{children}
|
|
238
|
-
<TextArea
|
|
239
|
-
maxLength={CHAT_MESSAGE_LIMIT + 10}
|
|
240
|
-
css={{
|
|
241
|
-
c: '$on_surface_high',
|
|
242
|
-
'&:valid ~ .send-msg': { color: '$on_surface_high' },
|
|
243
|
-
'& ~ .send-msg': { color: '$on_surface_low' },
|
|
244
|
-
'&::placeholder': { color: '$on_surface_medium' },
|
|
245
|
-
border: 'none',
|
|
246
|
-
}}
|
|
247
|
-
placeholder={message_placeholder}
|
|
248
|
-
ref={inputRef}
|
|
249
|
-
required
|
|
250
|
-
autoFocus={!(isMobile || isLandscapeHLSStream)}
|
|
251
|
-
onKeyPress={async event => {
|
|
252
|
-
if (event.key === 'Enter') {
|
|
253
|
-
if (!event.shiftKey && !messageLengthExceeded) {
|
|
254
|
-
event.preventDefault();
|
|
255
|
-
await sendMessage();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}}
|
|
259
|
-
autoComplete="off"
|
|
260
|
-
aria-autocomplete="none"
|
|
261
|
-
onChange={e => {
|
|
262
|
-
updateInputHeight();
|
|
263
|
-
setMessageLengthExceeded(e.target.value.length > CHAT_MESSAGE_LIMIT);
|
|
264
|
-
}}
|
|
265
|
-
onBlur={resetInputHeight}
|
|
266
|
-
onPaste={e => e.stopPropagation()}
|
|
267
|
-
onCut={e => e.stopPropagation()}
|
|
268
|
-
onCopy={e => e.stopPropagation()}
|
|
269
|
-
/>
|
|
270
|
-
{!isMobile && !isLandscapeHLSStream ? (
|
|
271
|
-
<EmojiPicker
|
|
272
|
-
onSelect={emoji => {
|
|
273
|
-
if (inputRef.current) {
|
|
274
|
-
inputRef.current.value += ` ${emoji.native} `;
|
|
275
|
-
}
|
|
276
|
-
}}
|
|
277
|
-
/>
|
|
278
|
-
) : null}
|
|
279
|
-
<BaseIconButton
|
|
280
|
-
className="send-msg"
|
|
281
|
-
onClick={sendMessage}
|
|
282
|
-
disabled={messageLengthExceeded}
|
|
283
|
-
css={{
|
|
284
|
-
ml: 'auto',
|
|
285
|
-
height: 'max-content',
|
|
286
|
-
mr: '$4',
|
|
287
|
-
'&:hover': { c: isMobile ? '' : '$on_surface_medium' },
|
|
288
|
-
}}
|
|
289
|
-
data-testid="send_msg_btn"
|
|
290
|
-
>
|
|
291
|
-
<SendIcon />
|
|
292
|
-
</BaseIconButton>
|
|
293
|
-
</Flex>
|
|
294
|
-
{(isMwebHLSStream || isLandscapeHLSStream) && (
|
|
295
|
-
<>
|
|
296
|
-
<Flex
|
|
297
|
-
css={{
|
|
298
|
-
alignItems: 'center',
|
|
299
|
-
}}
|
|
300
|
-
gap="2"
|
|
301
|
-
>
|
|
302
|
-
<RaiseHand css={{ bg: '$surface_default' }} />
|
|
303
|
-
<MoreSettings elements={elements} screenType={screenType} />
|
|
304
|
-
</Flex>
|
|
305
|
-
</>
|
|
306
|
-
)}
|
|
307
|
-
</Flex>
|
|
308
|
-
)}
|
|
309
|
-
{messageLengthExceeded && (
|
|
310
|
-
<Text variant="xs" css={{ color: '$alert_error_default', fontWeight: '$semiBold', mt: '$1', ml: '$7' }}>
|
|
311
|
-
Message cannot exceed 2000 characters
|
|
312
|
-
</Text>
|
|
313
|
-
)}
|
|
314
|
-
</Box>
|
|
315
|
-
);
|
|
316
|
-
};
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { useMedia } from 'react-use';
|
|
3
|
-
import {
|
|
4
|
-
HMSPeer,
|
|
5
|
-
HMSPeerType,
|
|
6
|
-
selectMessagesUnreadCountByPeerID,
|
|
7
|
-
selectMessagesUnreadCountByRole,
|
|
8
|
-
selectRemotePeers,
|
|
9
|
-
selectUnreadHMSMessagesCount,
|
|
10
|
-
useHMSStore,
|
|
11
|
-
} from '@100mslive/react-sdk';
|
|
12
|
-
import { CheckIcon, PeopleIcon } from '@100mslive/react-icons';
|
|
13
|
-
import { Box, CSS, Dropdown, Flex, HorizontalDivider, Text, Tooltip } from '../../..';
|
|
14
|
-
import { config as cssConfig } from '../../../Theme';
|
|
15
|
-
import { ParticipantSearch } from '../Footer/ParticipantList';
|
|
16
|
-
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
import { useSetSubscribedChatSelector } from '../AppData/useUISettings';
|
|
19
|
-
import { useFilteredRoles } from '../../common/hooks';
|
|
20
|
-
import { CHAT_SELECTOR } from '../../common/constants';
|
|
21
|
-
|
|
22
|
-
const ChatDotIcon = () => {
|
|
23
|
-
return <Box css={{ size: '$6', bg: '$primary_default', mx: '$2', r: '$round' }} />;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const SelectorItem = ({
|
|
27
|
-
value,
|
|
28
|
-
active,
|
|
29
|
-
onClick,
|
|
30
|
-
unreadCount,
|
|
31
|
-
icon = undefined,
|
|
32
|
-
}: {
|
|
33
|
-
value: string;
|
|
34
|
-
active: boolean;
|
|
35
|
-
onClick: () => void;
|
|
36
|
-
unreadCount: number;
|
|
37
|
-
icon?: React.JSX.Element;
|
|
38
|
-
}) => {
|
|
39
|
-
const isMobile = useMedia(cssConfig.media.md);
|
|
40
|
-
|
|
41
|
-
const Root = !isMobile
|
|
42
|
-
? Dropdown.Item
|
|
43
|
-
: ({ children, ...rest }: { children: React.ReactNode; css: CSS }) => (
|
|
44
|
-
<Flex {...rest} css={{ p: '$6 $8', ...rest.css }}>
|
|
45
|
-
{children}
|
|
46
|
-
</Flex>
|
|
47
|
-
);
|
|
48
|
-
return (
|
|
49
|
-
<Root
|
|
50
|
-
data-testid="chat_members"
|
|
51
|
-
css={{ align: 'center', px: '$10', py: '$4', bg: '$surface_default' }}
|
|
52
|
-
onClick={onClick}
|
|
53
|
-
>
|
|
54
|
-
<Text
|
|
55
|
-
variant="sm"
|
|
56
|
-
css={{ display: 'flex', alignItems: 'center', gap: '$4', fontWeight: '$semiBold', color: '$on_surface_high' }}
|
|
57
|
-
>
|
|
58
|
-
{icon}
|
|
59
|
-
{value}
|
|
60
|
-
</Text>
|
|
61
|
-
<Flex align="center" css={{ ml: 'auto', color: '$on_primary_high' }}>
|
|
62
|
-
{unreadCount > 0 && (
|
|
63
|
-
<Tooltip title={`${unreadCount} unread`}>
|
|
64
|
-
<Box css={{ mr: active ? '$3' : 0 }}>
|
|
65
|
-
<ChatDotIcon />
|
|
66
|
-
</Box>
|
|
67
|
-
</Tooltip>
|
|
68
|
-
)}
|
|
69
|
-
{active && <CheckIcon width={16} height={16} />}
|
|
70
|
-
</Flex>
|
|
71
|
-
</Root>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const SelectorHeader = React.memo(
|
|
76
|
-
({ isHorizontalDivider = true, children }: { isHorizontalDivider?: boolean; children: React.ReactNode }) => {
|
|
77
|
-
return (
|
|
78
|
-
<Box css={{ flexShrink: 0 }}>
|
|
79
|
-
{isHorizontalDivider && <HorizontalDivider space={4} />}
|
|
80
|
-
<Text
|
|
81
|
-
variant="overline"
|
|
82
|
-
css={{ p: '$4 $10', fontWeight: '$semiBold', textTransform: 'uppercase', color: '$on_surface_medium' }}
|
|
83
|
-
>
|
|
84
|
-
{children}
|
|
85
|
-
</Text>
|
|
86
|
-
</Box>
|
|
87
|
-
);
|
|
88
|
-
},
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
const Everyone = React.memo(({ active }: { active: boolean }) => {
|
|
92
|
-
const unreadCount: number = useHMSStore(selectUnreadHMSMessagesCount);
|
|
93
|
-
const [, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER);
|
|
94
|
-
const [, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
|
95
|
-
return (
|
|
96
|
-
<SelectorItem
|
|
97
|
-
value="Everyone"
|
|
98
|
-
icon={<PeopleIcon />}
|
|
99
|
-
active={active}
|
|
100
|
-
unreadCount={unreadCount}
|
|
101
|
-
onClick={() => {
|
|
102
|
-
setPeerSelector({});
|
|
103
|
-
setRoleSelector('');
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const RoleItem = React.memo(({ role, active }: { role: string; active: boolean }) => {
|
|
110
|
-
const unreadCount: number = useHMSStore(selectMessagesUnreadCountByRole(role));
|
|
111
|
-
const [, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER);
|
|
112
|
-
const [, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
|
113
|
-
return (
|
|
114
|
-
<SelectorItem
|
|
115
|
-
value={role}
|
|
116
|
-
active={active}
|
|
117
|
-
unreadCount={unreadCount}
|
|
118
|
-
onClick={() => {
|
|
119
|
-
setPeerSelector({});
|
|
120
|
-
setRoleSelector(role);
|
|
121
|
-
}}
|
|
122
|
-
/>
|
|
123
|
-
);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
const PeerItem = ({ peerId, name, active }: { name: string; peerId: string; active: boolean }) => {
|
|
127
|
-
const unreadCount: number = useHMSStore(selectMessagesUnreadCountByPeerID(peerId));
|
|
128
|
-
const [, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER);
|
|
129
|
-
const [, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
<SelectorItem
|
|
133
|
-
value={name}
|
|
134
|
-
active={active}
|
|
135
|
-
unreadCount={unreadCount}
|
|
136
|
-
onClick={() => {
|
|
137
|
-
setPeerSelector({ id: peerId, name });
|
|
138
|
-
setRoleSelector('');
|
|
139
|
-
}}
|
|
140
|
-
/>
|
|
141
|
-
);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const VirtualizedSelectItemList = ({
|
|
145
|
-
peers,
|
|
146
|
-
selectedRole,
|
|
147
|
-
selectedPeerId,
|
|
148
|
-
searchValue,
|
|
149
|
-
isPublicChatEnabled,
|
|
150
|
-
}: {
|
|
151
|
-
peers: HMSPeer[];
|
|
152
|
-
selectedRole: string;
|
|
153
|
-
selectedPeerId: string;
|
|
154
|
-
searchValue: string;
|
|
155
|
-
isPublicChatEnabled: boolean;
|
|
156
|
-
}) => {
|
|
157
|
-
const roles = useFilteredRoles();
|
|
158
|
-
const filteredPeers = useMemo(
|
|
159
|
-
() =>
|
|
160
|
-
peers.filter(
|
|
161
|
-
// search should be empty or search phrase should be included in name
|
|
162
|
-
peer =>
|
|
163
|
-
(!searchValue || peer.name.toLowerCase().includes(searchValue.toLowerCase())) &&
|
|
164
|
-
peer.type !== HMSPeerType.SIP,
|
|
165
|
-
),
|
|
166
|
-
[peers, searchValue],
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
const listItems = useMemo(() => {
|
|
170
|
-
let selectItems: React.ReactNode[] = [];
|
|
171
|
-
if (isPublicChatEnabled && !searchValue) {
|
|
172
|
-
selectItems = [<Everyone active={!selectedRole && !selectedPeerId} />];
|
|
173
|
-
}
|
|
174
|
-
if (roles.length > 0 && !searchValue) {
|
|
175
|
-
selectItems.push(<SelectorHeader isHorizontalDivider={isPublicChatEnabled}>Roles</SelectorHeader>);
|
|
176
|
-
roles.forEach(userRole =>
|
|
177
|
-
selectItems.push(<RoleItem key={userRole} active={selectedRole === userRole} role={userRole} />),
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (filteredPeers.length > 0) {
|
|
182
|
-
selectItems.push(
|
|
183
|
-
<SelectorHeader isHorizontalDivider={isPublicChatEnabled || roles.length > 0}>Participants</SelectorHeader>,
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
filteredPeers.forEach(peer =>
|
|
187
|
-
selectItems.push(
|
|
188
|
-
<PeerItem key={peer.id} name={peer.name} peerId={peer.id} active={peer.id === selectedPeerId} />,
|
|
189
|
-
),
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
return selectItems;
|
|
193
|
-
}, [isPublicChatEnabled, searchValue, selectedRole, selectedPeerId, roles, filteredPeers]);
|
|
194
|
-
|
|
195
|
-
return (
|
|
196
|
-
<Dropdown.Group css={{ overflowY: 'auto', maxHeight: '$64', bg: '$surface_default' }}>
|
|
197
|
-
{listItems.map((item, index) => (
|
|
198
|
-
<Box key={index}>{item}</Box>
|
|
199
|
-
))}
|
|
200
|
-
</Dropdown.Group>
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
export const ChatSelector = ({ role, peerId }: { role: string; peerId: string }) => {
|
|
205
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
|
206
|
-
const peers = useHMSStore(selectRemotePeers);
|
|
207
|
-
const [search, setSearch] = useState('');
|
|
208
|
-
|
|
209
|
-
const isPrivateChatEnabled = !!elements?.chat?.private_chat_enabled;
|
|
210
|
-
const isPublicChatEnabled = !!elements?.chat?.public_chat_enabled;
|
|
211
|
-
|
|
212
|
-
return (
|
|
213
|
-
<>
|
|
214
|
-
{peers.length > 0 && isPrivateChatEnabled && (
|
|
215
|
-
<Box css={{ px: '$4' }}>
|
|
216
|
-
<ParticipantSearch onSearch={setSearch} placeholder="Search for participants" />
|
|
217
|
-
</Box>
|
|
218
|
-
)}
|
|
219
|
-
<VirtualizedSelectItemList
|
|
220
|
-
selectedRole={role}
|
|
221
|
-
selectedPeerId={peerId}
|
|
222
|
-
peers={isPrivateChatEnabled ? peers : []}
|
|
223
|
-
isPublicChatEnabled={isPublicChatEnabled}
|
|
224
|
-
searchValue={search}
|
|
225
|
-
/>
|
|
226
|
-
</>
|
|
227
|
-
);
|
|
228
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useMedia } from 'react-use';
|
|
3
|
-
import { ChevronDownIcon, ChevronUpIcon, CrossIcon, GroupIcon, PersonIcon } from '@100mslive/react-icons';
|
|
4
|
-
import { Dropdown } from '../../../Dropdown';
|
|
5
|
-
import { Box, Flex } from '../../../Layout';
|
|
6
|
-
import { Sheet } from '../../../Sheet';
|
|
7
|
-
import { Text } from '../../../Text';
|
|
8
|
-
import { config as cssConfig } from '../../../Theme';
|
|
9
|
-
import { ChatSelector } from './ChatSelector';
|
|
10
|
-
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
import { useSubscribeChatSelector } from '../AppData/useUISettings';
|
|
13
|
-
import { useDefaultChatSelection, useFilteredRoles } from '../../common/hooks';
|
|
14
|
-
import { CHAT_SELECTOR } from '../../common/constants';
|
|
15
|
-
|
|
16
|
-
export const ChatSelectorContainer = () => {
|
|
17
|
-
const [open, setOpen] = useState(false);
|
|
18
|
-
const isMobile = useMedia(cssConfig.media.md);
|
|
19
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
|
20
|
-
const isPrivateChatEnabled = !!elements?.chat?.private_chat_enabled;
|
|
21
|
-
const isPublicChatEnabled = !!elements?.chat?.public_chat_enabled;
|
|
22
|
-
const roles = useFilteredRoles();
|
|
23
|
-
const selectedPeer = useSubscribeChatSelector(CHAT_SELECTOR.PEER);
|
|
24
|
-
const selectedRole = useSubscribeChatSelector(CHAT_SELECTOR.ROLE);
|
|
25
|
-
const defaultSelection = useDefaultChatSelection();
|
|
26
|
-
const selection = selectedPeer.name || selectedRole || defaultSelection;
|
|
27
|
-
|
|
28
|
-
if (!(isPrivateChatEnabled || isPublicChatEnabled || roles.length > 0) && !isPrivateChatEnabled && !selection) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
<Flex align="center" css={{ mb: '$8', flex: '1 1 0', pl: '$2' }}>
|
|
34
|
-
<Text variant="xs" css={{ color: '$on_surface_medium' }}>
|
|
35
|
-
{selection ? 'To' : 'Choose Participant'}
|
|
36
|
-
</Text>
|
|
37
|
-
|
|
38
|
-
{isMobile ? (
|
|
39
|
-
<Flex
|
|
40
|
-
align="center"
|
|
41
|
-
css={{ c: '$on_surface_medium', border: '1px solid $border_bright', r: '$0', p: '$1 $2', ml: '$6' }}
|
|
42
|
-
gap="1"
|
|
43
|
-
onClick={e => {
|
|
44
|
-
setOpen(value => !value);
|
|
45
|
-
e.stopPropagation();
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
<Text
|
|
49
|
-
variant="caption"
|
|
50
|
-
css={{
|
|
51
|
-
c: '$on_surface_high',
|
|
52
|
-
pr: '$2',
|
|
53
|
-
display: 'flex',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
gap: '$1',
|
|
56
|
-
textTransform: selection !== selectedPeer.name ? 'capitalize' : undefined,
|
|
57
|
-
}}
|
|
58
|
-
>
|
|
59
|
-
{selection === CHAT_SELECTOR.EVERYONE ? (
|
|
60
|
-
<GroupIcon width={16} height={16} />
|
|
61
|
-
) : (
|
|
62
|
-
<PersonIcon width={16} height={16} />
|
|
63
|
-
)}
|
|
64
|
-
{selection || 'Search'}
|
|
65
|
-
</Text>
|
|
66
|
-
{selection &&
|
|
67
|
-
(open ? <ChevronUpIcon width={16} height={16} /> : <ChevronDownIcon width={16} height={16} />)}
|
|
68
|
-
</Flex>
|
|
69
|
-
) : (
|
|
70
|
-
<Dropdown.Root open={open} onOpenChange={value => setOpen(value)}>
|
|
71
|
-
<Dropdown.Trigger
|
|
72
|
-
asChild
|
|
73
|
-
data-testid="participant_list_filter"
|
|
74
|
-
css={{
|
|
75
|
-
background: '$primary_default',
|
|
76
|
-
c: '$on_primary_high',
|
|
77
|
-
r: '$0',
|
|
78
|
-
p: '$1 $2',
|
|
79
|
-
ml: '$6',
|
|
80
|
-
}}
|
|
81
|
-
tabIndex={0}
|
|
82
|
-
>
|
|
83
|
-
<Flex align="center" gap="1">
|
|
84
|
-
<Text
|
|
85
|
-
variant="caption"
|
|
86
|
-
css={{
|
|
87
|
-
c: 'inherit',
|
|
88
|
-
pr: '$2',
|
|
89
|
-
display: 'flex',
|
|
90
|
-
alignItems: 'center',
|
|
91
|
-
gap: '$1',
|
|
92
|
-
textTransform: selection !== selectedPeer.name ? 'capitalize' : undefined,
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
{selection === CHAT_SELECTOR.EVERYONE ? (
|
|
96
|
-
<GroupIcon width={16} height={16} />
|
|
97
|
-
) : (
|
|
98
|
-
<PersonIcon width={16} height={16} />
|
|
99
|
-
)}
|
|
100
|
-
{selection || 'Search'}
|
|
101
|
-
</Text>
|
|
102
|
-
{selection && (
|
|
103
|
-
<ChevronDownIcon
|
|
104
|
-
style={{ transform: open ? 'rotate(180deg)' : 'rotate(0deg)', transition: 'transform 150ms ease' }}
|
|
105
|
-
width={12}
|
|
106
|
-
height={12}
|
|
107
|
-
/>
|
|
108
|
-
)}
|
|
109
|
-
</Flex>
|
|
110
|
-
</Dropdown.Trigger>
|
|
111
|
-
|
|
112
|
-
<Dropdown.Content
|
|
113
|
-
css={{
|
|
114
|
-
w: '$64',
|
|
115
|
-
overflow: 'hidden',
|
|
116
|
-
maxHeight: 'unset',
|
|
117
|
-
bg: '$surface_default',
|
|
118
|
-
}}
|
|
119
|
-
align="start"
|
|
120
|
-
sideOffset={8}
|
|
121
|
-
>
|
|
122
|
-
<ChatSelector role={selectedRole} peerId={selectedPeer.id} />
|
|
123
|
-
</Dropdown.Content>
|
|
124
|
-
</Dropdown.Root>
|
|
125
|
-
)}
|
|
126
|
-
</Flex>
|
|
127
|
-
{isMobile ? (
|
|
128
|
-
<Sheet.Root open={open} onOpenChange={value => setOpen(value)}>
|
|
129
|
-
<Sheet.Content css={{ pt: '$8' }}>
|
|
130
|
-
<Sheet.Title
|
|
131
|
-
css={{
|
|
132
|
-
display: 'flex',
|
|
133
|
-
w: '100%',
|
|
134
|
-
justifyContent: 'space-between',
|
|
135
|
-
px: '$10',
|
|
136
|
-
pb: '$4',
|
|
137
|
-
mb: '$8',
|
|
138
|
-
borderBottom: '1px solid $border_bright',
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<Text css={{ color: '$on_surface_medium', fontWeight: '$semiBold' }}>Chat with</Text>
|
|
142
|
-
<Sheet.Close css={{ color: '$on_surface_medium' }}>
|
|
143
|
-
<CrossIcon />
|
|
144
|
-
</Sheet.Close>
|
|
145
|
-
</Sheet.Title>
|
|
146
|
-
<Box
|
|
147
|
-
onClick={() => {
|
|
148
|
-
setOpen(false);
|
|
149
|
-
}}
|
|
150
|
-
>
|
|
151
|
-
<ChatSelector role={selectedRole} peerId={selectedPeer.id} />
|
|
152
|
-
</Box>
|
|
153
|
-
</Sheet.Content>
|
|
154
|
-
</Sheet.Root>
|
|
155
|
-
) : null}
|
|
156
|
-
</>
|
|
157
|
-
);
|
|
158
|
-
};
|