@100mslive/roomkit-react 0.4.3-alpha.3 → 0.4.3-alpha.5
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 +1 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -0
- package/dist/index.cjs.css +194 -219
- package/dist/index.cjs.css.map +3 -3
- package/dist/index.cjs.js +56 -8
- 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 +56 -8
- package/dist/index.js.map +3 -3
- package/dist/meta.cjs.json +28 -36
- package/dist/meta.esbuild.json +28 -36
- 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 -318
- package/src/Prebuilt/AppContext.tsx +0 -33
- 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 -747
- 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,143 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
selectLocalPeer,
|
|
4
|
-
selectPeerNameByID,
|
|
5
|
-
selectPermissions,
|
|
6
|
-
selectPollByID,
|
|
7
|
-
useHMSActions,
|
|
8
|
-
useHMSStore,
|
|
9
|
-
} from '@100mslive/react-sdk';
|
|
10
|
-
import { ChevronLeftIcon, CrossIcon } from '@100mslive/react-icons';
|
|
11
|
-
import { Box, Button, Flex, Text } from '../../../..';
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
import { Container } from '../../Streaming/Common';
|
|
14
|
-
import { StandardView } from './StandardVoting';
|
|
15
|
-
import { TimedView } from './TimedVoting';
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import { usePollViewState } from '../../AppData/useUISettings';
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
import { getPeerResponses } from '../../../common/utils';
|
|
20
|
-
import { StatusIndicator } from '../common/StatusIndicator';
|
|
21
|
-
import { POLL_VIEWS } from '../../../common/constants';
|
|
22
|
-
|
|
23
|
-
export const Voting = ({ id, toggleVoting }: { id: string; toggleVoting: () => void }) => {
|
|
24
|
-
const actions = useHMSActions();
|
|
25
|
-
const poll = useHMSStore(selectPollByID(id));
|
|
26
|
-
const pollCreatorName = useHMSStore(selectPeerNameByID(poll?.createdBy));
|
|
27
|
-
const permissions = useHMSStore(selectPermissions);
|
|
28
|
-
const canEndActivity = !!permissions?.pollWrite;
|
|
29
|
-
const { setPollView } = usePollViewState();
|
|
30
|
-
// Sets view - linear or vertical, toggles timer indicator
|
|
31
|
-
const showSingleView = poll?.type === 'quiz' && poll.state === 'started';
|
|
32
|
-
const fetchedInitialResponses = useRef(false);
|
|
33
|
-
const [savedResponses, setSavedResponses] = useState<Record<any, any>>({});
|
|
34
|
-
const localPeer = useHMSStore(selectLocalPeer);
|
|
35
|
-
const localPeerId = localPeer?.id;
|
|
36
|
-
const customerUserId = localPeer?.customerUserId;
|
|
37
|
-
|
|
38
|
-
// To reset whenever a different poll is opened
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
fetchedInitialResponses.current = false;
|
|
41
|
-
setSavedResponses({});
|
|
42
|
-
}, [id, setSavedResponses]);
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const getResponses = async () => {
|
|
46
|
-
if (poll && actions.interactivityCenter && !fetchedInitialResponses.current) {
|
|
47
|
-
await actions.interactivityCenter.getPollResponses(poll, true);
|
|
48
|
-
fetchedInitialResponses.current = true;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
getResponses();
|
|
52
|
-
}, [poll, actions.interactivityCenter]);
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (poll?.questions) {
|
|
56
|
-
const localPeerResponses = getPeerResponses(poll.questions, localPeerId, customerUserId);
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
localPeerResponses?.forEach(response => {
|
|
59
|
-
if (response) {
|
|
60
|
-
setSavedResponses(prev => {
|
|
61
|
-
const prevCopy = { ...prev };
|
|
62
|
-
prevCopy[response[0]?.questionIndex] = { option: response[0]?.option, options: response[0]?.options };
|
|
63
|
-
return prevCopy;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}, [localPeerId, poll?.questions, id, customerUserId]);
|
|
69
|
-
|
|
70
|
-
if (!poll) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const canViewLeaderboard = poll.type === 'quiz' && poll.state === 'stopped' && !poll.anonymous;
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<Container rounded>
|
|
78
|
-
<Flex
|
|
79
|
-
align="center"
|
|
80
|
-
css={{
|
|
81
|
-
gap: '$4',
|
|
82
|
-
py: '$6',
|
|
83
|
-
px: '$8',
|
|
84
|
-
my: '$4',
|
|
85
|
-
w: '100%',
|
|
86
|
-
color: '$on_surface_high',
|
|
87
|
-
borderBottom: '1px solid $border_default',
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
<Flex
|
|
91
|
-
onClick={() => setPollView(POLL_VIEWS.CREATE_POLL_QUIZ)}
|
|
92
|
-
css={{ cursor: 'pointer', c: '$on_surface_medium', '&:hover': { color: '$on_surface_high' } }}
|
|
93
|
-
>
|
|
94
|
-
<ChevronLeftIcon />
|
|
95
|
-
</Flex>
|
|
96
|
-
<Text variant="h6">{poll.title}</Text>
|
|
97
|
-
<StatusIndicator status={poll.state} />
|
|
98
|
-
<Box
|
|
99
|
-
css={{
|
|
100
|
-
marginLeft: 'auto',
|
|
101
|
-
cursor: 'pointer',
|
|
102
|
-
'&:hover': { opacity: '0.8' },
|
|
103
|
-
height: 'fit-content',
|
|
104
|
-
}}
|
|
105
|
-
>
|
|
106
|
-
<CrossIcon onClick={toggleVoting} />
|
|
107
|
-
</Box>
|
|
108
|
-
</Flex>
|
|
109
|
-
|
|
110
|
-
<Flex direction="column" css={{ p: '$8 $10', flex: '1 1 0', overflowY: 'auto' }}>
|
|
111
|
-
{poll.state === 'started' ? (
|
|
112
|
-
<Text css={{ color: '$on_surface_medium', fontWeight: '$semiBold' }}>
|
|
113
|
-
{pollCreatorName || 'Participant'} started a {poll.type}
|
|
114
|
-
</Text>
|
|
115
|
-
) : null}
|
|
116
|
-
|
|
117
|
-
{showSingleView ? (
|
|
118
|
-
<TimedView poll={poll} localPeerResponses={savedResponses} updateSavedResponses={setSavedResponses} />
|
|
119
|
-
) : (
|
|
120
|
-
<StandardView poll={poll} localPeerResponses={savedResponses} updateSavedResponses={setSavedResponses} />
|
|
121
|
-
)}
|
|
122
|
-
</Flex>
|
|
123
|
-
<Flex
|
|
124
|
-
css={{ w: '100%', justifyContent: 'end', alignItems: 'center', p: '$8', borderTop: '1px solid $border_bright' }}
|
|
125
|
-
>
|
|
126
|
-
{poll.state === 'started' && canEndActivity && (
|
|
127
|
-
<Button
|
|
128
|
-
variant="danger"
|
|
129
|
-
css={{ fontWeight: '$semiBold', w: 'max-content' }}
|
|
130
|
-
onClick={() => actions.interactivityCenter.stopPoll(id)}
|
|
131
|
-
>
|
|
132
|
-
End {poll.type}
|
|
133
|
-
</Button>
|
|
134
|
-
)}
|
|
135
|
-
{canViewLeaderboard ? (
|
|
136
|
-
<Button css={{ fontWeight: '$semiBold', w: 'max-content' }} onClick={() => setPollView(POLL_VIEWS.RESULTS)}>
|
|
137
|
-
View Leaderboard
|
|
138
|
-
</Button>
|
|
139
|
-
) : null}
|
|
140
|
-
</Flex>
|
|
141
|
-
</Container>
|
|
142
|
-
);
|
|
143
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
HMSQuizLeaderboardResponse,
|
|
4
|
-
HMSQuizLeaderboardSummary,
|
|
5
|
-
selectPollByID,
|
|
6
|
-
useHMSActions,
|
|
7
|
-
useHMSStore,
|
|
8
|
-
} from '@100mslive/react-sdk';
|
|
9
|
-
|
|
10
|
-
export const useQuizSummary = (quizID: string) => {
|
|
11
|
-
const hmsActions = useHMSActions();
|
|
12
|
-
const quiz = useHMSStore(selectPollByID(quizID));
|
|
13
|
-
const [quizLeaderboard, setQuizLeaderboard] = useState<HMSQuizLeaderboardResponse | undefined>();
|
|
14
|
-
|
|
15
|
-
const summary: HMSQuizLeaderboardSummary = quizLeaderboard?.summary || {
|
|
16
|
-
totalUsers: 0,
|
|
17
|
-
votedUsers: 0,
|
|
18
|
-
avgScore: 0,
|
|
19
|
-
avgTime: 0,
|
|
20
|
-
correctUsers: 0,
|
|
21
|
-
};
|
|
22
|
-
const [calculations, setCalculations] = useState({ maxPossibleScore: 0, totalResponses: 0 });
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const fetchLeaderboardData = async () => {
|
|
26
|
-
if (!quizLeaderboard && quiz && !quiz?.anonymous && quiz.state === 'stopped') {
|
|
27
|
-
const leaderboardData = await hmsActions.interactivityCenter.fetchLeaderboard(quiz.id, 0, 200);
|
|
28
|
-
|
|
29
|
-
const { maxPossibleScore, totalResponses } =
|
|
30
|
-
quiz?.questions?.reduce((accumulator, question) => {
|
|
31
|
-
accumulator.maxPossibleScore += question.weight || 0;
|
|
32
|
-
accumulator.totalResponses += question?.responses?.length || 0;
|
|
33
|
-
return accumulator;
|
|
34
|
-
}, calculations) || calculations;
|
|
35
|
-
|
|
36
|
-
setQuizLeaderboard(leaderboardData);
|
|
37
|
-
setCalculations({ maxPossibleScore, totalResponses });
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
fetchLeaderboardData();
|
|
42
|
-
}, [quiz, hmsActions.interactivityCenter, quizLeaderboard, calculations]);
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
quizLeaderboard,
|
|
46
|
-
summary,
|
|
47
|
-
maxPossibleScore: calculations.maxPossibleScore,
|
|
48
|
-
totalResponses: calculations.totalResponses,
|
|
49
|
-
};
|
|
50
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { CheckCircleIcon, CheckIcon } from '@100mslive/react-icons';
|
|
4
|
-
import { Checkbox, Flex, Label, Text } from '../../../../';
|
|
5
|
-
import { OptionInputWithDelete } from './OptionInputWithDelete';
|
|
6
|
-
import { VoteCount } from './VoteCount';
|
|
7
|
-
import { VoteProgress } from './VoteProgress';
|
|
8
|
-
|
|
9
|
-
export const MultipleChoiceOptions = ({
|
|
10
|
-
questionIndex,
|
|
11
|
-
options,
|
|
12
|
-
canRespond,
|
|
13
|
-
totalResponses,
|
|
14
|
-
selectedOptions,
|
|
15
|
-
setSelectedOptions,
|
|
16
|
-
showVoteCount,
|
|
17
|
-
isQuiz,
|
|
18
|
-
correctOptionIndexes,
|
|
19
|
-
localPeerResponse,
|
|
20
|
-
isStopped,
|
|
21
|
-
}) => {
|
|
22
|
-
const handleCheckedChange = (checked, index) => {
|
|
23
|
-
const newSelected = new Set(selectedOptions);
|
|
24
|
-
if (checked) {
|
|
25
|
-
newSelected.add(index);
|
|
26
|
-
} else {
|
|
27
|
-
newSelected.delete(index);
|
|
28
|
-
}
|
|
29
|
-
setSelectedOptions(newSelected);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Flex direction="column" css={{ gap: '$md', w: '100%', mb: '$md' }}>
|
|
34
|
-
{options.map(option => {
|
|
35
|
-
return (
|
|
36
|
-
<Flex align="center" key={`${questionIndex}-${option.index}`} css={{ w: '100%', gap: '$4' }}>
|
|
37
|
-
{!isStopped || !isQuiz ? (
|
|
38
|
-
<Checkbox.Root
|
|
39
|
-
id={`${questionIndex}-${option.index}`}
|
|
40
|
-
disabled={!canRespond}
|
|
41
|
-
checked={localPeerResponse?.options?.includes(option.index)}
|
|
42
|
-
onCheckedChange={checked => handleCheckedChange(checked, option.index)}
|
|
43
|
-
css={{
|
|
44
|
-
cursor: canRespond ? 'pointer' : 'not-allowed',
|
|
45
|
-
flexShrink: 0,
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
<Checkbox.Indicator>
|
|
49
|
-
<CheckIcon width={16} height={16} />
|
|
50
|
-
</Checkbox.Indicator>
|
|
51
|
-
</Checkbox.Root>
|
|
52
|
-
) : null}
|
|
53
|
-
|
|
54
|
-
{isStopped && correctOptionIndexes?.includes(option.index) ? (
|
|
55
|
-
<Flex align="center" css={{ color: '$on_surface_high' }}>
|
|
56
|
-
<CheckCircleIcon height={20} width={20} />
|
|
57
|
-
</Flex>
|
|
58
|
-
) : null}
|
|
59
|
-
|
|
60
|
-
<Flex direction="column" css={{ flexGrow: '1' }}>
|
|
61
|
-
<Flex css={{ w: '100%' }}>
|
|
62
|
-
<Text css={{ display: 'flex', flexGrow: '1' }}>
|
|
63
|
-
<Label htmlFor={`${questionIndex}-${option.index}`} css={{ color: 'inherit' }}>
|
|
64
|
-
{option.text}
|
|
65
|
-
</Label>
|
|
66
|
-
</Text>
|
|
67
|
-
{showVoteCount && <VoteCount voteCount={option.voteCount} />}
|
|
68
|
-
</Flex>
|
|
69
|
-
{showVoteCount && <VoteProgress option={option} totalResponses={totalResponses} />}
|
|
70
|
-
</Flex>
|
|
71
|
-
|
|
72
|
-
{isStopped && isQuiz && localPeerResponse?.options.includes(option.index) ? (
|
|
73
|
-
<Text variant="sm" css={{ color: '$on_surface_medium', maxWidth: 'max-content' }}>
|
|
74
|
-
Your Answer
|
|
75
|
-
</Text>
|
|
76
|
-
) : null}
|
|
77
|
-
</Flex>
|
|
78
|
-
);
|
|
79
|
-
})}
|
|
80
|
-
</Flex>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const MultipleChoiceOptionInputs = ({ isQuiz, options, selectAnswer, handleOptionTextChange, removeOption }) => {
|
|
85
|
-
return (
|
|
86
|
-
<Flex direction="column" css={{ gap: '$md', w: '100%', mb: '$md' }}>
|
|
87
|
-
{options.map((option, index) => {
|
|
88
|
-
return (
|
|
89
|
-
<Flex align="center" key={index} css={{ w: '100%', gap: '$4' }}>
|
|
90
|
-
{isQuiz && (
|
|
91
|
-
<Checkbox.Root
|
|
92
|
-
onCheckedChange={checked => selectAnswer(checked, index)}
|
|
93
|
-
checked={option.isCorrectAnswer}
|
|
94
|
-
css={{
|
|
95
|
-
cursor: 'pointer',
|
|
96
|
-
width: '$9',
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
<Checkbox.Indicator>
|
|
100
|
-
<CheckIcon width={16} height={16} />
|
|
101
|
-
</Checkbox.Indicator>
|
|
102
|
-
</Checkbox.Root>
|
|
103
|
-
)}
|
|
104
|
-
<OptionInputWithDelete
|
|
105
|
-
index={index}
|
|
106
|
-
option={option}
|
|
107
|
-
handleOptionTextChange={handleOptionTextChange}
|
|
108
|
-
removeOption={removeOption}
|
|
109
|
-
/>
|
|
110
|
-
</Flex>
|
|
111
|
-
);
|
|
112
|
-
})}
|
|
113
|
-
</Flex>
|
|
114
|
-
);
|
|
115
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HMSPollQuestionOption } from '@100mslive/react-sdk';
|
|
3
|
-
import { TrashIcon } from '@100mslive/react-icons';
|
|
4
|
-
import { Input } from '../../../../Input';
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import IconButton from '../../../IconButton';
|
|
7
|
-
|
|
8
|
-
export const OptionInputWithDelete = ({
|
|
9
|
-
index,
|
|
10
|
-
option,
|
|
11
|
-
handleOptionTextChange,
|
|
12
|
-
removeOption,
|
|
13
|
-
}: {
|
|
14
|
-
index: number;
|
|
15
|
-
option: HMSPollQuestionOption;
|
|
16
|
-
handleOptionTextChange: (index: number, value: string) => void;
|
|
17
|
-
removeOption: (index: number) => void;
|
|
18
|
-
}) => {
|
|
19
|
-
return (
|
|
20
|
-
<>
|
|
21
|
-
<Input
|
|
22
|
-
placeholder={`Option ${index + 1}`}
|
|
23
|
-
css={{
|
|
24
|
-
w: '100%',
|
|
25
|
-
backgroundColor: '$surface_bright',
|
|
26
|
-
border: '1px solid $border_bright',
|
|
27
|
-
}}
|
|
28
|
-
value={option?.text || ''}
|
|
29
|
-
key={index}
|
|
30
|
-
onChange={event => handleOptionTextChange(index, event.target.value.trimStart())}
|
|
31
|
-
maxLength={250}
|
|
32
|
-
/>
|
|
33
|
-
<IconButton onClick={() => removeOption(index)} css={{ bg: 'transparent', border: 'none' }}>
|
|
34
|
-
<TrashIcon />
|
|
35
|
-
</IconButton>
|
|
36
|
-
</>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { CheckCircleIcon } from '@100mslive/react-icons';
|
|
4
|
-
import { Flex, Label, RadioGroup, Text } from '../../../..';
|
|
5
|
-
import { OptionInputWithDelete } from './OptionInputWithDelete';
|
|
6
|
-
import { VoteCount } from './VoteCount';
|
|
7
|
-
import { VoteProgress } from './VoteProgress';
|
|
8
|
-
|
|
9
|
-
export const SingleChoiceOptions = ({
|
|
10
|
-
questionIndex,
|
|
11
|
-
options,
|
|
12
|
-
canRespond,
|
|
13
|
-
setAnswer,
|
|
14
|
-
totalResponses,
|
|
15
|
-
showVoteCount,
|
|
16
|
-
correctOptionIndex,
|
|
17
|
-
isStopped,
|
|
18
|
-
isQuiz,
|
|
19
|
-
localPeerResponse,
|
|
20
|
-
}) => {
|
|
21
|
-
return (
|
|
22
|
-
<RadioGroup.Root value={localPeerResponse?.option} onValueChange={value => setAnswer(value)}>
|
|
23
|
-
<Flex direction="column" css={{ gap: '$md', w: '100%', mb: '$md' }}>
|
|
24
|
-
{options.map(option => {
|
|
25
|
-
return (
|
|
26
|
-
<Flex align="center" key={`${questionIndex}-${option.index}`} css={{ w: '100%', gap: '$4' }}>
|
|
27
|
-
{!isStopped || !isQuiz ? (
|
|
28
|
-
<RadioGroup.Item
|
|
29
|
-
css={{
|
|
30
|
-
background: 'none',
|
|
31
|
-
h: '$9',
|
|
32
|
-
w: '$9',
|
|
33
|
-
border: '2px solid',
|
|
34
|
-
borderColor: '$on_surface_high',
|
|
35
|
-
display: 'flex',
|
|
36
|
-
flexShrink: 0,
|
|
37
|
-
pt: '$1',
|
|
38
|
-
justifyContent: 'center',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
cursor: canRespond ? 'pointer' : 'not-allowed',
|
|
41
|
-
'&[data-state="checked"]': {
|
|
42
|
-
borderColor: '$primary_bright',
|
|
43
|
-
borderWidth: '2px',
|
|
44
|
-
},
|
|
45
|
-
}}
|
|
46
|
-
disabled={!canRespond}
|
|
47
|
-
value={option.index}
|
|
48
|
-
id={`${questionIndex}-${option.index}`}
|
|
49
|
-
>
|
|
50
|
-
<RadioGroup.Indicator
|
|
51
|
-
css={{
|
|
52
|
-
h: '80%',
|
|
53
|
-
w: '80%',
|
|
54
|
-
background: '$primary_bright',
|
|
55
|
-
borderRadius: '$round',
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
58
|
-
</RadioGroup.Item>
|
|
59
|
-
) : null}
|
|
60
|
-
|
|
61
|
-
{isStopped && correctOptionIndex === option.index && isQuiz ? (
|
|
62
|
-
<Flex css={{ color: '$on_surface_high' }}>
|
|
63
|
-
<CheckCircleIcon height={20} width={20} />
|
|
64
|
-
</Flex>
|
|
65
|
-
) : null}
|
|
66
|
-
|
|
67
|
-
<Flex direction="column" css={{ flexGrow: '1' }}>
|
|
68
|
-
<Flex css={{ w: '100%' }}>
|
|
69
|
-
<Text css={{ display: 'flex', flexGrow: '1', color: '$on_surface_high' }}>
|
|
70
|
-
<Label style={{ color: 'inherit' }} htmlFor={`${questionIndex}-${option.index}`}>
|
|
71
|
-
{option.text}
|
|
72
|
-
</Label>
|
|
73
|
-
</Text>
|
|
74
|
-
{showVoteCount && <VoteCount voteCount={option.voteCount} />}
|
|
75
|
-
</Flex>
|
|
76
|
-
{showVoteCount && <VoteProgress option={option} totalResponses={totalResponses} />}
|
|
77
|
-
</Flex>
|
|
78
|
-
{isStopped && isQuiz && localPeerResponse?.option === option.index ? (
|
|
79
|
-
<Text variant="sm" css={{ color: '$on_surface_medium', maxWidth: 'max-content' }}>
|
|
80
|
-
Your Answer
|
|
81
|
-
</Text>
|
|
82
|
-
) : null}
|
|
83
|
-
</Flex>
|
|
84
|
-
);
|
|
85
|
-
})}
|
|
86
|
-
</Flex>
|
|
87
|
-
</RadioGroup.Root>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const SingleChoiceOptionInputs = ({ isQuiz, options, selectAnswer, handleOptionTextChange, removeOption }) => {
|
|
92
|
-
const correctOptionIndex = options.findIndex(option => option.isCorrectAnswer);
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<RadioGroup.Root value={correctOptionIndex} onValueChange={selectAnswer}>
|
|
96
|
-
<Flex direction="column" css={{ gap: '$md', w: '100%', mb: '$md' }}>
|
|
97
|
-
{options.map((option, index) => {
|
|
98
|
-
return (
|
|
99
|
-
<Flex align="center" key={`option-${index}`} css={{ w: '100%', gap: '$4' }}>
|
|
100
|
-
{isQuiz && (
|
|
101
|
-
<RadioGroup.Item
|
|
102
|
-
css={{
|
|
103
|
-
background: 'none',
|
|
104
|
-
w: '$9',
|
|
105
|
-
border: '2px solid',
|
|
106
|
-
borderColor: '$on_surface_high',
|
|
107
|
-
display: 'flex',
|
|
108
|
-
justifyContent: 'center',
|
|
109
|
-
alignItems: 'center',
|
|
110
|
-
cursor: 'pointer',
|
|
111
|
-
'&[data-state="checked"]': {
|
|
112
|
-
borderColor: '$primary_bright',
|
|
113
|
-
borderWidth: '2px',
|
|
114
|
-
},
|
|
115
|
-
}}
|
|
116
|
-
value={index}
|
|
117
|
-
>
|
|
118
|
-
<RadioGroup.Indicator
|
|
119
|
-
css={{
|
|
120
|
-
h: '80%',
|
|
121
|
-
w: '80%',
|
|
122
|
-
background: '$primary_bright',
|
|
123
|
-
borderRadius: '$round',
|
|
124
|
-
}}
|
|
125
|
-
/>
|
|
126
|
-
</RadioGroup.Item>
|
|
127
|
-
)}
|
|
128
|
-
<OptionInputWithDelete
|
|
129
|
-
index={index}
|
|
130
|
-
option={option}
|
|
131
|
-
handleOptionTextChange={handleOptionTextChange}
|
|
132
|
-
removeOption={removeOption}
|
|
133
|
-
/>
|
|
134
|
-
</Flex>
|
|
135
|
-
);
|
|
136
|
-
})}
|
|
137
|
-
</Flex>
|
|
138
|
-
</RadioGroup.Root>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HMSPollState } from '@100mslive/react-sdk';
|
|
3
|
-
import { Flex, Text } from '../../../../';
|
|
4
|
-
import { PollStage } from './constants';
|
|
5
|
-
|
|
6
|
-
const statusMap: Record<HMSPollState, PollStage> = {
|
|
7
|
-
created: PollStage.DRAFT,
|
|
8
|
-
started: PollStage.LIVE,
|
|
9
|
-
stopped: PollStage.ENDED,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const StatusIndicator = ({ status }: { status?: HMSPollState }) => {
|
|
13
|
-
if (!status) return null;
|
|
14
|
-
return (
|
|
15
|
-
<Flex align="center">
|
|
16
|
-
<Flex
|
|
17
|
-
css={{
|
|
18
|
-
backgroundColor: statusMap[status] === PollStage.LIVE ? '$alert_error_default' : '$secondary_default',
|
|
19
|
-
p: '$2 $4',
|
|
20
|
-
borderRadius: '$0',
|
|
21
|
-
}}
|
|
22
|
-
>
|
|
23
|
-
<Text
|
|
24
|
-
variant="caption"
|
|
25
|
-
css={{
|
|
26
|
-
fontWeight: '$semiBold',
|
|
27
|
-
color: '$on_primary_high',
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
{statusMap[status]}
|
|
31
|
-
</Text>
|
|
32
|
-
</Flex>
|
|
33
|
-
</Flex>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Flex, Text } from '../../../../';
|
|
3
|
-
|
|
4
|
-
export const VoteCount = ({ voteCount }: { voteCount: number }) => {
|
|
5
|
-
return (
|
|
6
|
-
<Flex css={{ alignItems: 'center' }}>
|
|
7
|
-
{voteCount ? (
|
|
8
|
-
<Text variant="sm" css={{ color: '$on_surface_medium' }}>
|
|
9
|
-
{voteCount}
|
|
10
|
-
{voteCount === 1 ? 'vote' : 'votes'}
|
|
11
|
-
</Text>
|
|
12
|
-
) : null}
|
|
13
|
-
</Flex>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HMSPollQuestionOption } from '@100mslive/react-sdk';
|
|
3
|
-
import { Progress } from '../../../../';
|
|
4
|
-
|
|
5
|
-
export const VoteProgress = ({ option, totalResponses }: { option: HMSPollQuestionOption; totalResponses: number }) => {
|
|
6
|
-
const showProgress = typeof option.voteCount === 'number' && typeof totalResponses === 'number' && totalResponses > 0;
|
|
7
|
-
const progressValue = (100 * (option.voteCount || 0)) / totalResponses;
|
|
8
|
-
|
|
9
|
-
return showProgress ? (
|
|
10
|
-
<Progress.Root value={progressValue} css={{ mt: '$4' }}>
|
|
11
|
-
<Progress.Content
|
|
12
|
-
style={{
|
|
13
|
-
transform: `translateX(-${100 - progressValue}%)`,
|
|
14
|
-
}}
|
|
15
|
-
/>
|
|
16
|
-
</Progress.Root>
|
|
17
|
-
) : null;
|
|
18
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const getFormattedTime = (milliseconds: number | undefined, precise = true) => {
|
|
2
|
-
if (!milliseconds) return '-';
|
|
3
|
-
|
|
4
|
-
const totalSeconds = milliseconds / 1000;
|
|
5
|
-
const hours = Math.floor(totalSeconds / 3600);
|
|
6
|
-
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
7
|
-
const seconds = totalSeconds % 60;
|
|
8
|
-
|
|
9
|
-
let formattedTime = '';
|
|
10
|
-
if (hours) {
|
|
11
|
-
formattedTime += `${hours}h `;
|
|
12
|
-
}
|
|
13
|
-
if (minutes || hours) {
|
|
14
|
-
formattedTime += `${minutes}m `;
|
|
15
|
-
}
|
|
16
|
-
if (!precise && (hours || minutes)) {
|
|
17
|
-
return formattedTime;
|
|
18
|
-
}
|
|
19
|
-
formattedTime += `${precise ? seconds.toFixed(3) : Math.floor(seconds)}s`;
|
|
20
|
-
|
|
21
|
-
return formattedTime;
|
|
22
|
-
};
|