@100mslive/react-native-room-kit 1.0.0 → 1.0.1
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/README.md +1 -1
- package/lib/commonjs/HMSInstanceSetup.js +2 -2
- package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
- package/lib/commonjs/HMSPrebuilt.js +5 -7
- package/lib/commonjs/HMSPrebuilt.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +3 -3
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Chevron/index.js +5 -1
- package/lib/commonjs/Icons/Chevron/index.js.map +1 -1
- package/lib/commonjs/Icons/Leave/index.js +5 -1
- package/lib/commonjs/Icons/Leave/index.js.map +1 -1
- package/lib/commonjs/Icons/WelcomeHand/assets/welcome-hand.png +0 -0
- package/lib/commonjs/Icons/WelcomeHand/assets/welcome-hand@2x.png +0 -0
- package/lib/commonjs/Icons/WelcomeHand/assets/welcome-hand@3x.png +0 -0
- package/lib/commonjs/Icons/WelcomeHand/index.js +30 -0
- package/lib/commonjs/Icons/WelcomeHand/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +11 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/AnimatedFooter.js +2 -2
- package/lib/commonjs/components/AnimatedFooter.js.map +1 -1
- package/lib/commonjs/components/AnimatedHLSFooter.js +2 -2
- package/lib/commonjs/components/AnimatedHLSFooter.js.map +1 -1
- package/lib/commonjs/components/AnimatedHeader.js +2 -2
- package/lib/commonjs/components/AnimatedHeader.js.map +1 -1
- package/lib/commonjs/components/AvatarView.js +2 -2
- package/lib/commonjs/components/AvatarView.js.map +1 -1
- package/lib/commonjs/components/BackButton.js +2 -2
- package/lib/commonjs/components/BackButton.js.map +1 -1
- package/lib/commonjs/components/BottomSheet.js +2 -2
- package/lib/commonjs/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChangeNameModalContent.js +25 -6
- package/lib/commonjs/components/ChangeNameModalContent.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatBanner.js +2 -2
- package/lib/commonjs/components/Chat/ChatBanner.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js +3 -4
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js +3 -4
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterItem.js +3 -4
- package/lib/commonjs/components/Chat/ChatFilterItem.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterView.js +3 -4
- package/lib/commonjs/components/Chat/ChatFilterView.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatList.js +3 -4
- package/lib/commonjs/components/Chat/ChatList.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatMessage.js +3 -4
- package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -1
- package/lib/commonjs/components/Chat/PinnedMessage.js +2 -2
- package/lib/commonjs/components/Chat/PinnedMessage.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js +2 -2
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js +7 -7
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js +3 -4
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatView.js +3 -4
- package/lib/commonjs/components/ChatAndParticipants/ChatView.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ParticipantsView.js +15 -14
- package/lib/commonjs/components/ChatAndParticipants/ParticipantsView.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +2 -2
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/EndRoomModalContent.js +2 -2
- package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
- package/lib/commonjs/components/Footer.js +4 -5
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/FullScreenVideoView.js +2 -2
- package/lib/commonjs/components/FullScreenVideoView.js.map +1 -1
- package/lib/commonjs/components/GridView.js +3 -4
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/HLSFooter.js +2 -2
- package/lib/commonjs/components/HLSFooter.js.map +1 -1
- package/lib/commonjs/components/HLSView.js +2 -2
- package/lib/commonjs/components/HLSView.js.map +1 -1
- package/lib/commonjs/components/HMSBaseButton.js +2 -2
- package/lib/commonjs/components/HMSBaseButton.js.map +1 -1
- package/lib/commonjs/components/HMSChat.js +2 -2
- package/lib/commonjs/components/HMSChat.js.map +1 -1
- package/lib/commonjs/components/HMSDangerButton.js +4 -3
- package/lib/commonjs/components/HMSDangerButton.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessage.js +3 -4
- package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessageList.js +2 -2
- package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -1
- package/lib/commonjs/components/HMSHLSNotStarted.js +2 -2
- package/lib/commonjs/components/HMSHLSNotStarted.js.map +1 -1
- package/lib/commonjs/components/HMSHLSStreamLoading.js +6 -4
- package/lib/commonjs/components/HMSHLSStreamLoading.js.map +1 -1
- package/lib/commonjs/components/HMSHandRaiseNotification.js +2 -2
- package/lib/commonjs/components/HMSHandRaiseNotification.js.map +1 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js +4 -5
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/components/HMSLiveIndicator.js +5 -6
- package/lib/commonjs/components/HMSLiveIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js +2 -2
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js.map +1 -1
- package/lib/commonjs/components/HMSLocalVideoView.js +2 -2
- package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -1
- package/lib/commonjs/components/HMSManageAudioOutput.js +2 -2
- package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -1
- package/lib/commonjs/components/HMSManageCameraRotation.js +2 -2
- package/lib/commonjs/components/HMSManageCameraRotation.js.map +1 -1
- package/lib/commonjs/components/HMSManageLeave.js +4 -3
- package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
- package/lib/commonjs/components/HMSManageLocalAudio.js +2 -2
- package/lib/commonjs/components/HMSManageLocalAudio.js.map +1 -1
- package/lib/commonjs/components/HMSManageLocalVideo.js +2 -2
- package/lib/commonjs/components/HMSManageLocalVideo.js.map +1 -1
- package/lib/commonjs/components/HMSManageRaiseHand.js +23 -11
- package/lib/commonjs/components/HMSManageRaiseHand.js.map +1 -1
- package/lib/commonjs/components/HMSMeetingEnded.js +2 -2
- package/lib/commonjs/components/HMSMeetingEnded.js.map +1 -1
- package/lib/commonjs/components/HMSNotification.js +2 -2
- package/lib/commonjs/components/HMSNotification.js.map +1 -1
- package/lib/commonjs/components/HMSNotifications.js +2 -2
- package/lib/commonjs/components/HMSNotifications.js.map +1 -1
- package/lib/commonjs/components/HMSOverlayChatView.js +2 -2
- package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewEditName.js +2 -2
- package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +5 -4
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewJoinButton.js +10 -5
- package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js +2 -2
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewPeersList.js +2 -2
- package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewSubtitle.js +2 -2
- package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTile.js +3 -3
- package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTitle.js +2 -2
- package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/HMSPrimaryButton.js +2 -2
- package/lib/commonjs/components/HMSPrimaryButton.js.map +1 -1
- package/lib/commonjs/components/HMSRecordingIndicator.js +6 -3
- package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSRoleChangeDeclinedNotification.js +2 -2
- package/lib/commonjs/components/HMSRoleChangeDeclinedNotification.js.map +1 -1
- package/lib/commonjs/components/HMSRoomOptions.js +2 -2
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/HMSSendMessageInput.js +2 -2
- package/lib/commonjs/components/HMSSendMessageInput.js.map +1 -1
- package/lib/commonjs/components/HMSTextInput.js +5 -5
- package/lib/commonjs/components/HMSTextInput.js.map +1 -1
- package/lib/commonjs/components/HMSVideoView.js +2 -2
- package/lib/commonjs/components/HMSVideoView.js.map +1 -1
- package/lib/commonjs/components/Header.js +4 -6
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/LocalPeerRegularVideoView.js +2 -2
- package/lib/commonjs/components/LocalPeerRegularVideoView.js.map +1 -1
- package/lib/commonjs/components/LocalPeerScreenshareView.js +2 -2
- package/lib/commonjs/components/LocalPeerScreenshareView.js.map +1 -1
- package/lib/commonjs/components/Meeting.js +2 -2
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js +2 -2
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/MiniView.js +2 -2
- package/lib/commonjs/components/MiniView.js.map +1 -1
- package/lib/commonjs/components/Modals.js +2 -2
- package/lib/commonjs/components/Modals.js.map +1 -1
- package/lib/commonjs/components/OverlayContainer.js +2 -2
- package/lib/commonjs/components/OverlayContainer.js.map +1 -1
- package/lib/commonjs/components/OverlayedViews.js +3 -4
- package/lib/commonjs/components/OverlayedViews.js.map +1 -1
- package/lib/commonjs/components/PIPView.js +24 -18
- package/lib/commonjs/components/PIPView.js.map +1 -1
- package/lib/commonjs/components/PaginationDots.js +3 -4
- package/lib/commonjs/components/PaginationDots.js.map +1 -1
- package/lib/commonjs/components/Participants/MultiRoleParticipantsList.js +65 -0
- package/lib/commonjs/components/Participants/MultiRoleParticipantsList.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsAccordian.js +60 -0
- package/lib/commonjs/components/Participants/ParticipantsAccordian.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsAccordianExpanded.js +25 -0
- package/lib/commonjs/components/Participants/ParticipantsAccordianExpanded.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsGroupFooter.js +61 -0
- package/lib/commonjs/components/Participants/ParticipantsGroupFooter.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsGroupHeader.js +31 -31
- package/lib/commonjs/components/Participants/ParticipantsGroupHeader.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsGroupOptions.js +3 -4
- package/lib/commonjs/components/Participants/ParticipantsGroupOptions.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsItem.js +12 -21
- package/lib/commonjs/components/Participants/ParticipantsItem.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsItemOption.js +3 -4
- package/lib/commonjs/components/Participants/ParticipantsItemOption.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js +4 -5
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsList.js +157 -22
- package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsListFooter.js +43 -0
- package/lib/commonjs/components/Participants/ParticipantsListFooter.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsSeachInput.js +4 -4
- package/lib/commonjs/components/Participants/ParticipantsSeachInput.js.map +1 -1
- package/lib/commonjs/components/Participants/index.js +11 -0
- package/lib/commonjs/components/Participants/index.js.map +1 -1
- package/lib/commonjs/components/ParticipantsCount.js +3 -4
- package/lib/commonjs/components/ParticipantsCount.js.map +1 -1
- package/lib/commonjs/components/PeerDisplayView.js +1 -2
- package/lib/commonjs/components/PeerDisplayView.js.map +1 -1
- package/lib/commonjs/components/PeerMinimizedView.js +3 -4
- package/lib/commonjs/components/PeerMinimizedView.js.map +1 -1
- package/lib/commonjs/components/PeerRTCStatsContainer.js +3 -4
- package/lib/commonjs/components/PeerRTCStatsContainer.js.map +1 -1
- package/lib/commonjs/components/PeerRTCStatsView.js +1 -2
- package/lib/commonjs/components/PeerRTCStatsView.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/AvatarView.js +4 -5
- package/lib/commonjs/components/PeerVideoTile/AvatarView.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/HMSFullScreenButton.js +2 -2
- package/lib/commonjs/components/PeerVideoTile/HMSFullScreenButton.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js +2 -2
- package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js +12 -7
- package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerMetadata.js +22 -12
- package/lib/commonjs/components/PeerVideoTile/PeerMetadata.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerNameAndNetwork.js +2 -2
- package/lib/commonjs/components/PeerVideoTile/PeerNameAndNetwork.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +26 -12
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/VideoView.js +3 -4
- package/lib/commonjs/components/PeerVideoTile/VideoView.js.map +1 -1
- package/lib/commonjs/components/PressableIcon.js +2 -2
- package/lib/commonjs/components/PressableIcon.js.map +1 -1
- package/lib/commonjs/components/Preview.js +5 -1
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/components/PreviewForRoleChangeModal.js +4 -10
- package/lib/commonjs/components/PreviewForRoleChangeModal.js.map +1 -1
- package/lib/commonjs/components/ReconnectionView.js +3 -4
- package/lib/commonjs/components/ReconnectionView.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +49 -13
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js +1 -1
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/commonjs/components/StatusBar.js +2 -2
- package/lib/commonjs/components/StatusBar.js.map +1 -1
- package/lib/commonjs/components/StopRecordingModalContent.js +2 -2
- package/lib/commonjs/components/StopRecordingModalContent.js.map +1 -1
- package/lib/commonjs/components/StreamingQualityModalContent.js +2 -2
- package/lib/commonjs/components/StreamingQualityModalContent.js.map +1 -1
- package/lib/commonjs/components/Tile.js +1 -2
- package/lib/commonjs/components/Tile.js.map +1 -1
- package/lib/commonjs/components/TilesContainer.js +1 -2
- package/lib/commonjs/components/TilesContainer.js.map +1 -1
- package/lib/commonjs/components/UnmountAfterDelay.js +3 -4
- package/lib/commonjs/components/UnmountAfterDelay.js.map +1 -1
- package/lib/commonjs/components/WebrtcView.js +5 -5
- package/lib/commonjs/components/WebrtcView.js.map +1 -1
- package/lib/commonjs/components/WelcomeInMeeting.js +30 -9
- package/lib/commonjs/components/WelcomeInMeeting.js.map +1 -1
- package/lib/commonjs/components/styles.js +1 -2
- package/lib/commonjs/components/styles.js.map +1 -1
- package/lib/commonjs/hooks-sdk.js +46 -1
- package/lib/commonjs/hooks-sdk.js.map +1 -1
- package/lib/commonjs/hooks-util.js +133 -119
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +6 -5
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +20 -4
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/index.js +1 -2
- package/lib/commonjs/redux/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +3 -4
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/redux/reducers/chatWindow.js +1 -2
- package/lib/commonjs/redux/reducers/chatWindow.js.map +1 -1
- package/lib/commonjs/redux/reducers/hmsStates.js +192 -22
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/redux/reducers/index.js +1 -2
- package/lib/commonjs/redux/reducers/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/message.js +3 -4
- package/lib/commonjs/redux/reducers/message.js.map +1 -1
- package/lib/commonjs/redux/reducers/userState.js +3 -4
- package/lib/commonjs/redux/reducers/userState.js.map +1 -1
- package/lib/commonjs/types.js +1 -2
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/dimension.js +2 -4
- package/lib/commonjs/utils/dimension.js.map +1 -1
- package/lib/commonjs/utils/functions.js.map +1 -1
- package/lib/commonjs/utils/theme.js +5 -10
- package/lib/commonjs/utils/theme.js.map +1 -1
- package/lib/commonjs/utils/types.js +13 -23
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils.js +1 -2
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/HMSPrebuilt.js +2 -3
- package/lib/module/HMSPrebuilt.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +1 -1
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Chevron/index.js +5 -1
- package/lib/module/Icons/Chevron/index.js.map +1 -1
- package/lib/module/Icons/Leave/index.js +5 -1
- package/lib/module/Icons/Leave/index.js.map +1 -1
- package/lib/module/Icons/WelcomeHand/assets/welcome-hand.png +0 -0
- package/lib/module/Icons/WelcomeHand/assets/welcome-hand@2x.png +0 -0
- package/lib/module/Icons/WelcomeHand/assets/welcome-hand@3x.png +0 -0
- package/lib/module/Icons/WelcomeHand/index.js +22 -0
- package/lib/module/Icons/WelcomeHand/index.js.map +1 -0
- package/lib/module/Icons/index.js +1 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/ChangeNameModalContent.js +25 -6
- package/lib/module/components/ChangeNameModalContent.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js +4 -3
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ParticipantsView.js +13 -12
- package/lib/module/components/ChatAndParticipants/ParticipantsView.js.map +1 -1
- package/lib/module/components/Footer.js +1 -1
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/HMSDangerButton.js +2 -1
- package/lib/module/components/HMSDangerButton.js.map +1 -1
- package/lib/module/components/HMSHLSStreamLoading.js +5 -3
- package/lib/module/components/HMSHLSStreamLoading.js.map +1 -1
- package/lib/module/components/HMSKeyboardAvoidingView.js +3 -4
- package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/module/components/HMSLiveIndicator.js +3 -3
- package/lib/module/components/HMSLiveIndicator.js.map +1 -1
- package/lib/module/components/HMSManageLeave.js +2 -1
- package/lib/module/components/HMSManageLeave.js.map +1 -1
- package/lib/module/components/HMSManageRaiseHand.js +22 -10
- package/lib/module/components/HMSManageRaiseHand.js.map +1 -1
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js +3 -2
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
- package/lib/module/components/HMSPreviewJoinButton.js +9 -4
- package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/module/components/HMSPreviewTile.js +1 -1
- package/lib/module/components/HMSPreviewTile.js.map +1 -1
- package/lib/module/components/HMSRecordingIndicator.js +4 -1
- package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/module/components/HMSTextInput.js +3 -3
- package/lib/module/components/HMSTextInput.js.map +1 -1
- package/lib/module/components/PIPView.js +21 -13
- package/lib/module/components/PIPView.js.map +1 -1
- package/lib/module/components/Participants/MultiRoleParticipantsList.js +56 -0
- package/lib/module/components/Participants/MultiRoleParticipantsList.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsAccordian.js +51 -0
- package/lib/module/components/Participants/ParticipantsAccordian.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsAccordianExpanded.js +16 -0
- package/lib/module/components/Participants/ParticipantsAccordianExpanded.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsGroupFooter.js +53 -0
- package/lib/module/components/Participants/ParticipantsGroupFooter.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsGroupHeader.js +28 -27
- package/lib/module/components/Participants/ParticipantsGroupHeader.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsGroupOptions.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsItem.js +10 -18
- package/lib/module/components/Participants/ParticipantsItem.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsItemOptions.js +1 -1
- package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsList.js +156 -21
- package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsListFooter.js +35 -0
- package/lib/module/components/Participants/ParticipantsListFooter.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsSeachInput.js +2 -2
- package/lib/module/components/Participants/ParticipantsSeachInput.js.map +1 -1
- package/lib/module/components/Participants/index.js +1 -0
- package/lib/module/components/Participants/index.js.map +1 -1
- package/lib/module/components/PeerVideoTile/AvatarView.js +1 -1
- package/lib/module/components/PeerVideoTile/AvatarView.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js +11 -6
- package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerMetadata.js +21 -11
- package/lib/module/components/PeerVideoTile/PeerMetadata.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +22 -6
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/module/components/Preview.js +6 -2
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/components/PreviewForRoleChangeModal.js +1 -6
- package/lib/module/components/PreviewForRoleChangeModal.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +49 -13
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/RoomSettingsModalDebugModeContent.js +1 -1
- package/lib/module/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/module/components/WebrtcView.js +2 -1
- package/lib/module/components/WebrtcView.js.map +1 -1
- package/lib/module/components/WelcomeInMeeting.js +29 -8
- package/lib/module/components/WelcomeInMeeting.js.map +1 -1
- package/lib/module/hooks-sdk.js +46 -1
- package/lib/module/hooks-sdk.js.map +1 -1
- package/lib/module/hooks-util.js +135 -122
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +4 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +14 -1
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +191 -20
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/utils/functions.js.map +1 -1
- package/lib/module/utils/types.js +1 -0
- package/lib/module/utils/types.js.map +1 -1
- package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
- package/lib/typescript/Icons/Chevron/index.d.ts +1 -1
- package/lib/typescript/Icons/Chevron/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Leave/index.d.ts.map +1 -1
- package/lib/typescript/Icons/WelcomeHand/index.d.ts +7 -0
- package/lib/typescript/Icons/WelcomeHand/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +1 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/ChangeNameModalContent.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsHeader.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ParticipantsView.d.ts.map +1 -1
- package/lib/typescript/components/HMSDangerButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSHLSStreamLoading.d.ts.map +1 -1
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageRaiseHand.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSRecordingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/PIPView.d.ts +2 -1
- package/lib/typescript/components/PIPView.d.ts.map +1 -1
- package/lib/typescript/components/Participants/MultiRoleParticipantsList.d.ts +7 -0
- package/lib/typescript/components/Participants/MultiRoleParticipantsList.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsAccordian.d.ts +11 -0
- package/lib/typescript/components/Participants/ParticipantsAccordian.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsAccordianExpanded.d.ts +9 -0
- package/lib/typescript/components/Participants/ParticipantsAccordianExpanded.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsGroupFooter.d.ts +9 -0
- package/lib/typescript/components/Participants/ParticipantsGroupFooter.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsGroupHeader.d.ts +6 -3
- package/lib/typescript/components/Participants/ParticipantsGroupHeader.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsGroupOptions.d.ts +0 -2
- package/lib/typescript/components/Participants/ParticipantsGroupOptions.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsItem.d.ts +3 -3
- package/lib/typescript/components/Participants/ParticipantsItem.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts +2 -2
- package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsList.d.ts +3 -4
- package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsListFooter.d.ts +6 -0
- package/lib/typescript/components/Participants/ParticipantsListFooter.d.ts.map +1 -0
- package/lib/typescript/components/Participants/index.d.ts +1 -0
- package/lib/typescript/components/Participants/index.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerAudioIndicator.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerMetadata.d.ts +1 -0
- package/lib/typescript/components/PeerVideoTile/PeerMetadata.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/components/PreviewForRoleChangeModal.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
- package/lib/typescript/components/WelcomeInMeeting.d.ts.map +1 -1
- package/lib/typescript/hooks-sdk.d.ts +4 -0
- package/lib/typescript/hooks-sdk.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +9 -19
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +4 -1
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +13 -0
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts +16 -3
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +1 -1
- package/lib/typescript/utils/functions.d.ts +0 -1
- package/lib/typescript/utils/functions.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +1 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/HMSPrebuilt.tsx +3 -6
- package/src/HMSRoomSetup.tsx +1 -1
- package/src/Icons/Chevron/index.tsx +9 -2
- package/src/Icons/Leave/index.tsx +7 -1
- package/src/Icons/WelcomeHand/assets/welcome-hand.png +0 -0
- package/src/Icons/WelcomeHand/assets/welcome-hand@2x.png +0 -0
- package/src/Icons/WelcomeHand/assets/welcome-hand@3x.png +0 -0
- package/src/Icons/WelcomeHand/index.tsx +27 -0
- package/src/Icons/index.ts +1 -0
- package/src/components/ChangeNameModalContent.tsx +28 -9
- package/src/components/ChatAndParticipants/ChatAndParticipantsHeader.tsx +6 -3
- package/src/components/ChatAndParticipants/ParticipantsView.tsx +21 -13
- package/src/components/Footer.tsx +1 -1
- package/src/components/HMSDangerButton.tsx +2 -1
- package/src/components/HMSHLSStreamLoading.tsx +9 -3
- package/src/components/HMSKeyboardAvoidingView.tsx +3 -3
- package/src/components/HMSLiveIndicator.tsx +3 -3
- package/src/components/HMSManageLeave.tsx +2 -1
- package/src/components/HMSManageRaiseHand.tsx +20 -13
- package/src/components/HMSPreviewHLSLiveIndicator.tsx +3 -2
- package/src/components/HMSPreviewJoinButton.tsx +15 -4
- package/src/components/HMSPreviewTile.tsx +1 -1
- package/src/components/HMSRecordingIndicator.tsx +3 -1
- package/src/components/HMSTextInput.tsx +3 -3
- package/src/components/PIPView.tsx +34 -13
- package/src/components/Participants/MultiRoleParticipantsList.tsx +70 -0
- package/src/components/Participants/ParticipantsAccordian.tsx +70 -0
- package/src/components/Participants/ParticipantsAccordianExpanded.tsx +27 -0
- package/src/components/Participants/ParticipantsGroupFooter.tsx +65 -0
- package/src/components/Participants/ParticipantsGroupHeader.tsx +37 -37
- package/src/components/Participants/ParticipantsGroupOptions.tsx +1 -6
- package/src/components/Participants/ParticipantsItem.tsx +16 -33
- package/src/components/Participants/ParticipantsItemOptions.tsx +3 -3
- package/src/components/Participants/ParticipantsList.tsx +197 -34
- package/src/components/Participants/ParticipantsListFooter.tsx +45 -0
- package/src/components/Participants/ParticipantsSeachInput.tsx +2 -2
- package/src/components/Participants/index.ts +1 -0
- package/src/components/PeerVideoTile/AvatarView.tsx +1 -1
- package/src/components/PeerVideoTile/PeerAudioIndicator.tsx +11 -6
- package/src/components/PeerVideoTile/PeerMetadata.tsx +21 -12
- package/src/components/PeerVideoTile/PeerVideoTileView.tsx +25 -8
- package/src/components/Preview.tsx +23 -9
- package/src/components/PreviewForRoleChangeModal.tsx +1 -6
- package/src/components/RoomSettingsModalContent.tsx +44 -9
- package/src/components/RoomSettingsModalDebugModeContent.tsx +1 -1
- package/src/components/WebrtcView.tsx +10 -1
- package/src/components/WelcomeInMeeting.tsx +33 -5
- package/src/hooks-sdk.ts +58 -0
- package/src/hooks-util.ts +229 -193
- package/src/redux/actionTypes.ts +4 -1
- package/src/redux/actions/index.ts +17 -1
- package/src/redux/reducers/hmsStates.ts +269 -36
- package/src/utils/functions.ts +0 -1
- package/src/utils/types.ts +2 -0
- package/lib/commonjs/assets/welcome.png +0 -0
- package/lib/module/assets/welcome.png +0 -0
- package/src/assets/welcome.png +0 -0
|
@@ -23,8 +23,11 @@ type ActionType =
|
|
|
23
23
|
| SetLayoutConfig
|
|
24
24
|
| SetRoleChangeRequest
|
|
25
25
|
| AddParticipant
|
|
26
|
+
| AddParticipants
|
|
26
27
|
| RemoveParticipant
|
|
28
|
+
| RemoveParticipants
|
|
27
29
|
| AddUpdateParticipant
|
|
30
|
+
| ReplaceParticipantsList
|
|
28
31
|
| SetActiveSpeakers
|
|
29
32
|
| SetReconnecting;
|
|
30
33
|
|
|
@@ -92,16 +95,32 @@ type AddParticipant = {
|
|
|
92
95
|
participant: HMSPeer;
|
|
93
96
|
};
|
|
94
97
|
|
|
98
|
+
type AddParticipants = {
|
|
99
|
+
type: HmsStateActionTypes.ADD_PARTICIPANTS;
|
|
100
|
+
participants: HMSPeer[];
|
|
101
|
+
};
|
|
102
|
+
|
|
95
103
|
type RemoveParticipant = {
|
|
96
104
|
type: HmsStateActionTypes.REMOVE_PARTICIPANT;
|
|
97
105
|
participant: HMSPeer;
|
|
98
106
|
};
|
|
99
107
|
|
|
108
|
+
type RemoveParticipants = {
|
|
109
|
+
type: HmsStateActionTypes.REMOVE_PARTICIPANTS;
|
|
110
|
+
participants: HMSPeer[];
|
|
111
|
+
};
|
|
112
|
+
|
|
100
113
|
type AddUpdateParticipant = {
|
|
101
|
-
type: HmsStateActionTypes.
|
|
114
|
+
type: HmsStateActionTypes.UPDATE_PARTICIPANT;
|
|
102
115
|
participant: HMSPeer;
|
|
103
116
|
};
|
|
104
117
|
|
|
118
|
+
type ReplaceParticipantsList = {
|
|
119
|
+
type: HmsStateActionTypes.REPLACE_PARTICIPANTS_LIST;
|
|
120
|
+
roleName: string;
|
|
121
|
+
participants: HMSPeer[];
|
|
122
|
+
};
|
|
123
|
+
|
|
105
124
|
type SetActiveSpeakers = {
|
|
106
125
|
type: HmsStateActionTypes.SET_ACTIVE_SPEAKERS;
|
|
107
126
|
activeSpeakers: HMSSpeaker[];
|
|
@@ -120,7 +139,7 @@ type IntialStateType = {
|
|
|
120
139
|
roomLocallyMuted: boolean;
|
|
121
140
|
room: HMSRoom | null;
|
|
122
141
|
localPeer: HMSLocalPeer | null;
|
|
123
|
-
|
|
142
|
+
groupedParticipants: Record<string, (HMSPeer | HMSLocalPeer)[]>;
|
|
124
143
|
activeSpeakers: HMSSpeaker[];
|
|
125
144
|
roles: HMSRole[];
|
|
126
145
|
previewPeersList: HMSPeer[];
|
|
@@ -136,7 +155,7 @@ const INITIAL_STATE: IntialStateType = {
|
|
|
136
155
|
roomLocallyMuted: false,
|
|
137
156
|
room: null,
|
|
138
157
|
localPeer: null,
|
|
139
|
-
|
|
158
|
+
groupedParticipants: {},
|
|
140
159
|
activeSpeakers: [],
|
|
141
160
|
roles: [],
|
|
142
161
|
previewPeersList: [],
|
|
@@ -155,12 +174,70 @@ const hmsStatesReducer = (
|
|
|
155
174
|
room: action.room,
|
|
156
175
|
};
|
|
157
176
|
case HmsStateActionTypes.SET_LOCAL_PEER_STATE: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
177
|
+
let updatedGroupedParticipants = state.groupedParticipants;
|
|
178
|
+
|
|
179
|
+
if (action.localPeer !== null) {
|
|
180
|
+
const savedLocalPeer = Object.values(state.groupedParticipants)
|
|
181
|
+
.flat()
|
|
182
|
+
.find(
|
|
183
|
+
(participant) => participant.peerID === action.localPeer?.peerID
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
// update peer or check if role change happened
|
|
187
|
+
if (savedLocalPeer) {
|
|
188
|
+
const previousRoleName = savedLocalPeer.role?.name!;
|
|
189
|
+
const currentRoleName = action.localPeer.role?.name!;
|
|
190
|
+
|
|
191
|
+
const roleChanged = previousRoleName !== currentRoleName;
|
|
192
|
+
|
|
193
|
+
if (roleChanged) {
|
|
194
|
+
const previousList = state.groupedParticipants[previousRoleName];
|
|
195
|
+
const currentList = state.groupedParticipants[currentRoleName];
|
|
196
|
+
|
|
197
|
+
updatedGroupedParticipants = {
|
|
198
|
+
...state.groupedParticipants,
|
|
199
|
+
// add to new list
|
|
200
|
+
[currentRoleName]: Array.isArray(currentList)
|
|
201
|
+
? [action.localPeer, ...currentList]
|
|
202
|
+
: [action.localPeer],
|
|
203
|
+
// delete from old list
|
|
204
|
+
[previousRoleName]: Array.isArray(previousList)
|
|
205
|
+
? previousList.filter(
|
|
206
|
+
(peer) => peer.peerID !== action.localPeer?.peerID
|
|
207
|
+
)
|
|
208
|
+
: [],
|
|
209
|
+
};
|
|
210
|
+
} else {
|
|
211
|
+
const participants = state.groupedParticipants[currentRoleName];
|
|
212
|
+
|
|
213
|
+
updatedGroupedParticipants = {
|
|
214
|
+
...state.groupedParticipants,
|
|
215
|
+
[currentRoleName]: Array.isArray(participants)
|
|
216
|
+
? participants.map((participant) =>
|
|
217
|
+
participant.peerID === action.localPeer?.peerID
|
|
218
|
+
? action.localPeer
|
|
219
|
+
: participant
|
|
220
|
+
)
|
|
221
|
+
: [action.localPeer],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// add peer
|
|
226
|
+
else {
|
|
227
|
+
const localPeerRoleName = action.localPeer.role?.name;
|
|
228
|
+
|
|
229
|
+
if (localPeerRoleName) {
|
|
230
|
+
const participants = state.groupedParticipants[localPeerRoleName];
|
|
231
|
+
|
|
232
|
+
updatedGroupedParticipants = {
|
|
233
|
+
...state.groupedParticipants,
|
|
234
|
+
[localPeerRoleName]: Array.isArray(participants)
|
|
235
|
+
? [action.localPeer, ...participants]
|
|
236
|
+
: [action.localPeer],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
164
241
|
|
|
165
242
|
return {
|
|
166
243
|
...state,
|
|
@@ -169,21 +246,21 @@ const hmsStatesReducer = (
|
|
|
169
246
|
isLocalVideoMuted: action.localPeer?.videoTrack?.isMute(),
|
|
170
247
|
|
|
171
248
|
// Adding or updating local peer in participants list
|
|
172
|
-
|
|
173
|
-
action.localPeer !== null
|
|
174
|
-
? participantsHasLocalPeer
|
|
175
|
-
? state.participants.map((participant) =>
|
|
176
|
-
participant.peerID === action.localPeer?.peerID
|
|
177
|
-
? action.localPeer
|
|
178
|
-
: participant
|
|
179
|
-
)
|
|
180
|
-
: [action.localPeer, ...state.participants]
|
|
181
|
-
: state.participants,
|
|
249
|
+
groupedParticipants: updatedGroupedParticipants,
|
|
182
250
|
};
|
|
183
251
|
}
|
|
184
252
|
case HmsStateActionTypes.ADD_PARTICIPANT: {
|
|
253
|
+
const participantRoleName = action.participant.role?.name;
|
|
254
|
+
|
|
255
|
+
if (!participantRoleName) {
|
|
256
|
+
return state;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const participants = state.groupedParticipants[participantRoleName];
|
|
260
|
+
|
|
185
261
|
if (
|
|
186
|
-
|
|
262
|
+
Array.isArray(participants) &&
|
|
263
|
+
participants.findIndex(
|
|
187
264
|
(participant) => participant.peerID === action.participant.peerID
|
|
188
265
|
) >= 0
|
|
189
266
|
) {
|
|
@@ -192,44 +269,200 @@ const hmsStatesReducer = (
|
|
|
192
269
|
|
|
193
270
|
return {
|
|
194
271
|
...state,
|
|
195
|
-
|
|
272
|
+
groupedParticipants: {
|
|
273
|
+
...state.groupedParticipants,
|
|
274
|
+
[participantRoleName]: Array.isArray(participants)
|
|
275
|
+
? [...participants, action.participant]
|
|
276
|
+
: [action.participant],
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
case HmsStateActionTypes.ADD_PARTICIPANTS: {
|
|
281
|
+
const participantsToAdd = new Map<string, (HMSPeer | HMSLocalPeer)[]>();
|
|
282
|
+
|
|
283
|
+
const participants = Object.values(state.groupedParticipants).flat();
|
|
284
|
+
|
|
285
|
+
action.participants.forEach((peerToAdd) => {
|
|
286
|
+
// check if `peerToAdd` already exists
|
|
287
|
+
const exists =
|
|
288
|
+
participants.findIndex(
|
|
289
|
+
(participant) => participant.peerID === peerToAdd.peerID
|
|
290
|
+
) >= 0;
|
|
291
|
+
|
|
292
|
+
// if not exists, push to existing list or create new against the role
|
|
293
|
+
if (!exists) {
|
|
294
|
+
const list = participantsToAdd.get(peerToAdd.role?.name!);
|
|
295
|
+
|
|
296
|
+
if (list) {
|
|
297
|
+
list.push(peerToAdd);
|
|
298
|
+
} else {
|
|
299
|
+
participantsToAdd.set(peerToAdd.role?.name!, [peerToAdd]);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
if (participantsToAdd.size === 0) {
|
|
305
|
+
return state;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
let updatedGroupedParticipants = { ...state.groupedParticipants };
|
|
309
|
+
|
|
310
|
+
participantsToAdd.forEach((list, roleName) => {
|
|
311
|
+
const oldList = updatedGroupedParticipants[roleName];
|
|
312
|
+
updatedGroupedParticipants[roleName] = Array.isArray(oldList)
|
|
313
|
+
? [...oldList, ...list]
|
|
314
|
+
: list;
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
return {
|
|
318
|
+
...state,
|
|
319
|
+
groupedParticipants: updatedGroupedParticipants,
|
|
196
320
|
};
|
|
197
321
|
}
|
|
198
322
|
case HmsStateActionTypes.REMOVE_PARTICIPANT: {
|
|
323
|
+
const participantRoleName = action.participant.role?.name;
|
|
324
|
+
|
|
325
|
+
if (!participantRoleName) {
|
|
326
|
+
return state;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
const participants = state.groupedParticipants[participantRoleName];
|
|
330
|
+
|
|
199
331
|
if (
|
|
200
|
-
|
|
332
|
+
Array.isArray(participants) &&
|
|
333
|
+
participants.findIndex(
|
|
201
334
|
(participant) => participant.peerID === action.participant.peerID
|
|
202
335
|
) >= 0
|
|
203
336
|
) {
|
|
204
337
|
return {
|
|
205
338
|
...state,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
339
|
+
groupedParticipants: {
|
|
340
|
+
...state.groupedParticipants,
|
|
341
|
+
[participantRoleName]: participants.filter(
|
|
342
|
+
(participant) => participant.peerID !== action.participant.peerID
|
|
343
|
+
),
|
|
344
|
+
},
|
|
209
345
|
};
|
|
210
346
|
}
|
|
211
347
|
|
|
212
348
|
return state;
|
|
213
349
|
}
|
|
214
|
-
case HmsStateActionTypes.
|
|
215
|
-
|
|
216
|
-
|
|
350
|
+
case HmsStateActionTypes.REMOVE_PARTICIPANTS: {
|
|
351
|
+
const participantsToRemove = new Map<
|
|
352
|
+
string,
|
|
353
|
+
(HMSPeer | HMSLocalPeer)[]
|
|
354
|
+
>();
|
|
355
|
+
|
|
356
|
+
const participants = Object.values(state.groupedParticipants).flat();
|
|
357
|
+
|
|
358
|
+
action.participants.forEach((peerToAdd) => {
|
|
359
|
+
// check if `peerToAdd` already exists
|
|
360
|
+
const exists =
|
|
361
|
+
participants.findIndex(
|
|
362
|
+
(participant) => participant.peerID === peerToAdd.peerID
|
|
363
|
+
) >= 0;
|
|
364
|
+
|
|
365
|
+
// if exists, push to existing list or create new against the role
|
|
366
|
+
if (exists) {
|
|
367
|
+
const list = participantsToRemove.get(peerToAdd.role?.name!);
|
|
368
|
+
|
|
369
|
+
if (list) {
|
|
370
|
+
list.push(peerToAdd);
|
|
371
|
+
} else {
|
|
372
|
+
participantsToRemove.set(peerToAdd.role?.name!, [peerToAdd]);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
if (participantsToRemove.size === 0) {
|
|
378
|
+
return state;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
let updatedGroupedParticipants = { ...state.groupedParticipants };
|
|
382
|
+
|
|
383
|
+
participantsToRemove.forEach((list, roleName) => {
|
|
384
|
+
const oldList = updatedGroupedParticipants[roleName];
|
|
385
|
+
updatedGroupedParticipants[roleName] = Array.isArray(oldList)
|
|
386
|
+
? oldList.filter((participant) => {
|
|
387
|
+
const notExists =
|
|
388
|
+
list.findIndex(
|
|
389
|
+
(peerToRemove) => peerToRemove.peerID === participant.peerID
|
|
390
|
+
) < 0;
|
|
391
|
+
|
|
392
|
+
// if `participant` is not in `removedPeers` list
|
|
393
|
+
// then keep it, otherwise remove it
|
|
394
|
+
return notExists;
|
|
395
|
+
})
|
|
396
|
+
: [];
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
return {
|
|
400
|
+
...state,
|
|
401
|
+
groupedParticipants: updatedGroupedParticipants,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
case HmsStateActionTypes.UPDATE_PARTICIPANT: {
|
|
405
|
+
const previousParticipant = Object.values(state.groupedParticipants)
|
|
406
|
+
.flat()
|
|
407
|
+
.find(
|
|
217
408
|
(participant) => participant.peerID === action.participant.peerID
|
|
218
|
-
)
|
|
219
|
-
|
|
409
|
+
);
|
|
410
|
+
|
|
411
|
+
if (!previousParticipant) {
|
|
412
|
+
return state;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const previousRoleName = previousParticipant.role?.name!;
|
|
416
|
+
const currentRoleName = action.participant.role?.name!;
|
|
417
|
+
|
|
418
|
+
// check if role change
|
|
419
|
+
if (previousRoleName !== currentRoleName) {
|
|
420
|
+
const previousRoleList = state.groupedParticipants[previousRoleName];
|
|
421
|
+
const currentRoleList = state.groupedParticipants[currentRoleName];
|
|
422
|
+
|
|
220
423
|
return {
|
|
221
424
|
...state,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
425
|
+
groupedParticipants: {
|
|
426
|
+
...state.groupedParticipants,
|
|
427
|
+
// - add to new
|
|
428
|
+
[currentRoleName]: Array.isArray(currentRoleList)
|
|
429
|
+
? [...currentRoleList, action.participant]
|
|
430
|
+
: [action.participant],
|
|
431
|
+
// - delete from old
|
|
432
|
+
[previousRoleName]: Array.isArray(previousRoleList)
|
|
433
|
+
? previousRoleList.filter(
|
|
434
|
+
(p) => p.peerID !== action.participant.peerID
|
|
435
|
+
)
|
|
436
|
+
: [],
|
|
437
|
+
},
|
|
227
438
|
};
|
|
228
439
|
}
|
|
229
440
|
|
|
441
|
+
// update existing
|
|
442
|
+
|
|
443
|
+
const currentList = state.groupedParticipants[currentRoleName];
|
|
444
|
+
|
|
445
|
+
return {
|
|
446
|
+
...state,
|
|
447
|
+
groupedParticipants: {
|
|
448
|
+
...state.groupedParticipants,
|
|
449
|
+
[currentRoleName]: Array.isArray(currentList)
|
|
450
|
+
? currentList.map((p) =>
|
|
451
|
+
p.peerID === action.participant.peerID
|
|
452
|
+
? action.participant
|
|
453
|
+
: p
|
|
454
|
+
)
|
|
455
|
+
: [action.participant],
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
case HmsStateActionTypes.REPLACE_PARTICIPANTS_LIST: {
|
|
230
460
|
return {
|
|
231
461
|
...state,
|
|
232
|
-
|
|
462
|
+
groupedParticipants: {
|
|
463
|
+
...state.groupedParticipants,
|
|
464
|
+
[action.roleName]: action.participants
|
|
465
|
+
},
|
|
233
466
|
};
|
|
234
467
|
}
|
|
235
468
|
case HmsStateActionTypes.SET_ROLES_STATE:
|
package/src/utils/functions.ts
CHANGED
package/src/utils/types.ts
CHANGED
|
Binary file
|
|
Binary file
|
package/src/assets/welcome.png
DELETED
|
Binary file
|