@100mslive/react-native-room-kit 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/HMSContainer.js +26 -5
- package/lib/commonjs/HMSContainer.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +6 -8
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Chat/assets/chat-on.png +0 -0
- package/lib/commonjs/Icons/Chat/assets/chat-on@2x.png +0 -0
- package/lib/commonjs/Icons/Chat/assets/chat-on@3x.png +0 -0
- package/lib/commonjs/Icons/Chat/index.js +4 -3
- package/lib/commonjs/Icons/Chat/index.js.map +1 -1
- package/lib/commonjs/Icons/NoEntry/assets/no-entry.png +0 -0
- package/lib/commonjs/Icons/NoEntry/assets/no-entry@2x.png +0 -0
- package/lib/commonjs/Icons/NoEntry/assets/no-entry@3x.png +0 -0
- package/lib/commonjs/Icons/NoEntry/index.js +33 -0
- package/lib/commonjs/Icons/NoEntry/index.js.map +1 -0
- package/lib/commonjs/Icons/PauseCircle/assets/pause-circle.png +0 -0
- package/lib/commonjs/Icons/PauseCircle/assets/pause-circle@2x.png +0 -0
- package/lib/commonjs/Icons/PauseCircle/assets/pause-circle@3x.png +0 -0
- package/lib/commonjs/Icons/PauseCircle/index.js +29 -0
- package/lib/commonjs/Icons/PauseCircle/index.js.map +1 -0
- package/lib/commonjs/Icons/Pin/assets/unpin.png +0 -0
- package/lib/commonjs/Icons/Pin/assets/unpin@2x.png +0 -0
- package/lib/commonjs/Icons/Pin/assets/unpin@3x.png +0 -0
- package/lib/commonjs/Icons/Pin/index.js +2 -1
- package/lib/commonjs/Icons/Pin/index.js.map +1 -1
- package/lib/commonjs/Icons/Recording/assets/recording-pause.png +0 -0
- package/lib/commonjs/Icons/Recording/assets/recording-pause@2x.png +0 -0
- package/lib/commonjs/Icons/Recording/assets/recording-pause@3x.png +0 -0
- package/lib/commonjs/Icons/Recording/index.js.map +1 -1
- package/lib/commonjs/Icons/index.js +22 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterBottomSheet.js +36 -0
- package/lib/commonjs/components/Chat/ChatFilterBottomSheet.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js +90 -23
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterItem.js +10 -7
- package/lib/commonjs/components/Chat/ChatFilterItem.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterView.js +54 -45
- package/lib/commonjs/components/Chat/ChatFilterView.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatList.js +13 -6
- package/lib/commonjs/components/Chat/ChatList.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatMessage.js +79 -7
- package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatMoreActionsModal.js +61 -0
- package/lib/commonjs/components/Chat/ChatMoreActionsModal.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatMoreActionsSheetView.js +63 -0
- package/lib/commonjs/components/Chat/ChatMoreActionsSheetView.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatMoreActionsView.js +83 -0
- package/lib/commonjs/components/Chat/ChatMoreActionsView.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatPaused.js +86 -0
- package/lib/commonjs/components/Chat/ChatPaused.js.map +1 -0
- package/lib/commonjs/components/Chat/MessageOptionsBottomSheet.js +34 -0
- package/lib/commonjs/components/Chat/MessageOptionsBottomSheet.js.map +1 -0
- package/lib/commonjs/components/Chat/MessageOptionsBottomSheetView.js +66 -0
- package/lib/commonjs/components/Chat/MessageOptionsBottomSheetView.js.map +1 -0
- package/lib/commonjs/components/Chat/MessageOptionsView.js +188 -0
- package/lib/commonjs/components/Chat/MessageOptionsView.js.map +1 -0
- package/lib/commonjs/components/Chat/PeerBlockedFromChat.js +47 -0
- package/lib/commonjs/components/Chat/PeerBlockedFromChat.js.map +1 -0
- package/lib/commonjs/components/Chat/PinnedMessages.js +297 -0
- package/lib/commonjs/components/Chat/PinnedMessages.js.map +1 -0
- package/lib/commonjs/components/Chat/index.js +4 -4
- package/lib/commonjs/components/Chat/index.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js +21 -2
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js +3 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatView.js +21 -2
- package/lib/commonjs/components/ChatAndParticipants/ChatView.js.map +1 -1
- package/lib/commonjs/components/EndRoomModalContent.js +6 -9
- package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/HLSView.js +8 -6
- package/lib/commonjs/components/HLSView.js.map +1 -1
- package/lib/commonjs/components/HMSBaseButton.js +10 -2
- package/lib/commonjs/components/HMSBaseButton.js.map +1 -1
- package/lib/commonjs/components/HMSDangerButton.js +4 -2
- package/lib/commonjs/components/HMSDangerButton.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessage.js +86 -1
- 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/HMSHandRaiseNotification.js +6 -3
- package/lib/commonjs/components/HMSHandRaiseNotification.js.map +1 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js +5 -1
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/components/HMSLiveIndicator.js +2 -6
- package/lib/commonjs/components/HMSLiveIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSLiveViewerCount.js +8 -7
- package/lib/commonjs/components/HMSLiveViewerCount.js.map +1 -1
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js +2 -1
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js.map +1 -1
- package/lib/commonjs/components/HMSNotification.js +31 -4
- package/lib/commonjs/components/HMSNotification.js.map +1 -1
- package/lib/commonjs/components/HMSNotifications.js +9 -2
- package/lib/commonjs/components/HMSNotifications.js.map +1 -1
- package/lib/commonjs/components/HMSOverlayChatView.js +44 -2
- package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +2 -6
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSPrimaryButton.js +4 -2
- package/lib/commonjs/components/HMSPrimaryButton.js.map +1 -1
- package/lib/commonjs/components/HMSRecordingIndicator.js +11 -16
- package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/HMSTerminalErrorNotification.js +6 -2
- package/lib/commonjs/components/HMSTerminalErrorNotification.js.map +1 -1
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/LeaveRoomBottomSheet.js +3 -6
- package/lib/commonjs/components/LeaveRoomBottomSheet.js.map +1 -1
- package/lib/commonjs/components/Meeting.js +3 -0
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/Modals.js +9 -12
- package/lib/commonjs/components/Modals.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js +5 -1
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js.map +1 -1
- package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/commonjs/components/Preview.js +14 -1
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/components/PreviewForRoleChangeModal.js +5 -4
- package/lib/commonjs/components/PreviewForRoleChangeModal.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +15 -6
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js +2 -4
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/commonjs/components/WebrtcView.js.map +1 -1
- package/lib/commonjs/hooks-sdk-selectors.js +16 -1
- package/lib/commonjs/hooks-sdk-selectors.js.map +1 -1
- package/lib/commonjs/hooks-sdk.js +27 -1
- package/lib/commonjs/hooks-sdk.js.map +1 -1
- package/lib/commonjs/hooks-util-selectors.js +3 -3
- package/lib/commonjs/hooks-util-selectors.js.map +1 -1
- package/lib/commonjs/hooks-util.js +410 -64
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +16 -3
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +44 -4
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +41 -1
- 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 +21 -8
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/redux/reducers/message.js +17 -4
- package/lib/commonjs/redux/reducers/message.js.map +1 -1
- package/lib/commonjs/types.js +4 -2
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/types.js +3 -0
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils.js +2 -2
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/HMSContainer.js +23 -3
- package/lib/module/HMSContainer.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +7 -9
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Chat/assets/chat-on.png +0 -0
- package/lib/module/Icons/Chat/assets/chat-on@2x.png +0 -0
- package/lib/module/Icons/Chat/assets/chat-on@3x.png +0 -0
- package/lib/module/Icons/Chat/index.js +4 -3
- package/lib/module/Icons/Chat/index.js.map +1 -1
- package/lib/module/Icons/NoEntry/assets/no-entry.png +0 -0
- package/lib/module/Icons/NoEntry/assets/no-entry@2x.png +0 -0
- package/lib/module/Icons/NoEntry/assets/no-entry@3x.png +0 -0
- package/lib/module/Icons/NoEntry/index.js +25 -0
- package/lib/module/Icons/NoEntry/index.js.map +1 -0
- package/lib/module/Icons/PauseCircle/assets/pause-circle.png +0 -0
- package/lib/module/Icons/PauseCircle/assets/pause-circle@2x.png +0 -0
- package/lib/module/Icons/PauseCircle/assets/pause-circle@3x.png +0 -0
- package/lib/module/Icons/PauseCircle/index.js +21 -0
- package/lib/module/Icons/PauseCircle/index.js.map +1 -0
- package/lib/module/Icons/Pin/assets/unpin.png +0 -0
- package/lib/module/Icons/Pin/assets/unpin@2x.png +0 -0
- package/lib/module/Icons/Pin/assets/unpin@3x.png +0 -0
- package/lib/module/Icons/Pin/index.js +2 -1
- package/lib/module/Icons/Pin/index.js.map +1 -1
- package/lib/module/Icons/Recording/assets/recording-pause.png +0 -0
- package/lib/module/Icons/Recording/assets/recording-pause@2x.png +0 -0
- package/lib/module/Icons/Recording/assets/recording-pause@3x.png +0 -0
- package/lib/module/Icons/Recording/index.js.map +1 -1
- package/lib/module/Icons/index.js +2 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/BottomSheet.js.map +1 -1
- package/lib/module/components/Chat/ChatFilterBottomSheet.js +28 -0
- package/lib/module/components/Chat/ChatFilterBottomSheet.js.map +1 -0
- package/lib/module/components/Chat/ChatFilterBottomSheetOpener.js +93 -26
- package/lib/module/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -1
- package/lib/module/components/Chat/ChatFilterItem.js +11 -8
- package/lib/module/components/Chat/ChatFilterItem.js.map +1 -1
- package/lib/module/components/Chat/ChatFilterView.js +55 -46
- package/lib/module/components/Chat/ChatFilterView.js.map +1 -1
- package/lib/module/components/Chat/ChatList.js +14 -7
- package/lib/module/components/Chat/ChatList.js.map +1 -1
- package/lib/module/components/Chat/ChatMessage.js +81 -9
- package/lib/module/components/Chat/ChatMessage.js.map +1 -1
- package/lib/module/components/Chat/ChatMoreActionsModal.js +53 -0
- package/lib/module/components/Chat/ChatMoreActionsModal.js.map +1 -0
- package/lib/module/components/Chat/ChatMoreActionsSheetView.js +55 -0
- package/lib/module/components/Chat/ChatMoreActionsSheetView.js.map +1 -0
- package/lib/module/components/Chat/ChatMoreActionsView.js +75 -0
- package/lib/module/components/Chat/ChatMoreActionsView.js.map +1 -0
- package/lib/module/components/Chat/ChatPaused.js +77 -0
- package/lib/module/components/Chat/ChatPaused.js.map +1 -0
- package/lib/module/components/Chat/MessageOptionsBottomSheet.js +26 -0
- package/lib/module/components/Chat/MessageOptionsBottomSheet.js.map +1 -0
- package/lib/module/components/Chat/MessageOptionsBottomSheetView.js +58 -0
- package/lib/module/components/Chat/MessageOptionsBottomSheetView.js.map +1 -0
- package/lib/module/components/Chat/MessageOptionsView.js +180 -0
- package/lib/module/components/Chat/MessageOptionsView.js.map +1 -0
- package/lib/module/components/Chat/PeerBlockedFromChat.js +38 -0
- package/lib/module/components/Chat/PeerBlockedFromChat.js.map +1 -0
- package/lib/module/components/Chat/PinnedMessages.js +288 -0
- package/lib/module/components/Chat/PinnedMessages.js.map +1 -0
- package/lib/module/components/Chat/index.js +1 -1
- package/lib/module/components/Chat/index.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js +24 -5
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js +3 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatView.js +22 -3
- package/lib/module/components/ChatAndParticipants/ChatView.js.map +1 -1
- package/lib/module/components/EndRoomModalContent.js +6 -9
- package/lib/module/components/EndRoomModalContent.js.map +1 -1
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/GridView.js.map +1 -1
- package/lib/module/components/HLSView.js +9 -7
- package/lib/module/components/HLSView.js.map +1 -1
- package/lib/module/components/HMSBaseButton.js +10 -2
- package/lib/module/components/HMSBaseButton.js.map +1 -1
- package/lib/module/components/HMSDangerButton.js +4 -2
- package/lib/module/components/HMSDangerButton.js.map +1 -1
- package/lib/module/components/HMSHLSMessage.js +88 -3
- package/lib/module/components/HMSHLSMessage.js.map +1 -1
- package/lib/module/components/HMSHLSMessageList.js +2 -2
- package/lib/module/components/HMSHLSMessageList.js.map +1 -1
- package/lib/module/components/HMSHandRaiseNotification.js +6 -3
- package/lib/module/components/HMSHandRaiseNotification.js.map +1 -1
- package/lib/module/components/HMSKeyboardAvoidingView.js +6 -2
- package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
- package/lib/module/components/HMSLiveIndicator.js +2 -6
- package/lib/module/components/HMSLiveIndicator.js.map +1 -1
- package/lib/module/components/HMSLiveViewerCount.js +8 -7
- package/lib/module/components/HMSLiveViewerCount.js.map +1 -1
- package/lib/module/components/HMSLocalScreenshareNotification.js +2 -1
- package/lib/module/components/HMSLocalScreenshareNotification.js.map +1 -1
- package/lib/module/components/HMSNotification.js +32 -5
- package/lib/module/components/HMSNotification.js.map +1 -1
- package/lib/module/components/HMSNotifications.js +9 -2
- package/lib/module/components/HMSNotifications.js.map +1 -1
- package/lib/module/components/HMSOverlayChatView.js +45 -3
- package/lib/module/components/HMSOverlayChatView.js.map +1 -1
- package/lib/module/components/HMSPreviewEditName.js.map +1 -1
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js +2 -6
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
- package/lib/module/components/HMSPrimaryButton.js +4 -2
- package/lib/module/components/HMSPrimaryButton.js.map +1 -1
- package/lib/module/components/HMSRecordingIndicator.js +11 -16
- package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/module/components/HMSRoomOptions.js.map +1 -1
- package/lib/module/components/HMSTerminalErrorNotification.js +6 -2
- package/lib/module/components/HMSTerminalErrorNotification.js.map +1 -1
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/LeaveRoomBottomSheet.js +3 -6
- package/lib/module/components/LeaveRoomBottomSheet.js.map +1 -1
- package/lib/module/components/Meeting.js +4 -1
- package/lib/module/components/Meeting.js.map +1 -1
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/Modals.js +10 -13
- package/lib/module/components/Modals.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsItemOptions.js +5 -1
- package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -1
- package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/module/components/Preview.js +13 -2
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/components/PreviewForRoleChangeModal.js +5 -4
- package/lib/module/components/PreviewForRoleChangeModal.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +16 -7
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/RoomSettingsModalDebugModeContent.js +3 -5
- package/lib/module/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/module/components/WebrtcView.js.map +1 -1
- package/lib/module/hooks-sdk-selectors.js +12 -0
- package/lib/module/hooks-sdk-selectors.js.map +1 -1
- package/lib/module/hooks-sdk.js +23 -1
- package/lib/module/hooks-sdk.js.map +1 -1
- package/lib/module/hooks-util-selectors.js +3 -3
- package/lib/module/hooks-util-selectors.js.map +1 -1
- package/lib/module/hooks-util.js +400 -65
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +16 -3
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +36 -2
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +41 -1
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/redux/reducers/chatWindow.js +1 -2
- package/lib/module/redux/reducers/chatWindow.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +21 -8
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/redux/reducers/message.js +17 -4
- package/lib/module/redux/reducers/message.js.map +1 -1
- package/lib/module/types.js +4 -2
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/types.js +3 -0
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils.js +2 -2
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/HMSContainer.d.ts +1 -1
- package/lib/typescript/HMSContainer.d.ts.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Chat/index.d.ts +1 -0
- package/lib/typescript/Icons/Chat/index.d.ts.map +1 -1
- package/lib/typescript/Icons/NoEntry/index.d.ts +7 -0
- package/lib/typescript/Icons/NoEntry/index.d.ts.map +1 -0
- package/lib/typescript/Icons/PauseCircle/index.d.ts +7 -0
- package/lib/typescript/Icons/PauseCircle/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Pin/index.d.ts +1 -0
- package/lib/typescript/Icons/Pin/index.d.ts.map +1 -1
- package/lib/typescript/Icons/index.d.ts +2 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatFilterBottomSheet.d.ts +3 -0
- package/lib/typescript/components/Chat/ChatFilterBottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatFilterBottomSheetOpener.d.ts +1 -0
- package/lib/typescript/components/Chat/ChatFilterBottomSheetOpener.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatFilterItem.d.ts +1 -0
- package/lib/typescript/components/Chat/ChatFilterItem.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatFilterView.d.ts +1 -0
- package/lib/typescript/components/Chat/ChatFilterView.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatList.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatMessage.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatMoreActionsModal.d.ts +7 -0
- package/lib/typescript/components/Chat/ChatMoreActionsModal.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatMoreActionsSheetView.d.ts +6 -0
- package/lib/typescript/components/Chat/ChatMoreActionsSheetView.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatMoreActionsView.d.ts +7 -0
- package/lib/typescript/components/Chat/ChatMoreActionsView.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatPaused.d.ts +10 -0
- package/lib/typescript/components/Chat/ChatPaused.d.ts.map +1 -0
- package/lib/typescript/components/Chat/MessageOptionsBottomSheet.d.ts +3 -0
- package/lib/typescript/components/Chat/MessageOptionsBottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/Chat/MessageOptionsBottomSheetView.d.ts +6 -0
- package/lib/typescript/components/Chat/MessageOptionsBottomSheetView.d.ts.map +1 -0
- package/lib/typescript/components/Chat/MessageOptionsView.d.ts +7 -0
- package/lib/typescript/components/Chat/MessageOptionsView.d.ts.map +1 -0
- package/lib/typescript/components/Chat/PeerBlockedFromChat.d.ts +9 -0
- package/lib/typescript/components/Chat/PeerBlockedFromChat.d.ts.map +1 -0
- package/lib/typescript/components/Chat/PinnedMessages.d.ts +8 -0
- package/lib/typescript/components/Chat/PinnedMessages.d.ts.map +1 -0
- package/lib/typescript/components/Chat/index.d.ts +1 -1
- package/lib/typescript/components/Chat/index.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsHeader.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsView.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatView.d.ts.map +1 -1
- package/lib/typescript/components/EndRoomModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/GridView.d.ts.map +1 -1
- package/lib/typescript/components/HMSBaseButton.d.ts +1 -0
- package/lib/typescript/components/HMSBaseButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSDangerButton.d.ts +1 -0
- package/lib/typescript/components/HMSDangerButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSHLSMessage.d.ts +1 -1
- package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
- package/lib/typescript/components/HMSHandRaiseNotification.d.ts.map +1 -1
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/components/HMSLiveIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSLiveViewerCount.d.ts.map +1 -1
- package/lib/typescript/components/HMSLocalScreenshareNotification.d.ts.map +1 -1
- package/lib/typescript/components/HMSNotification.d.ts +2 -1
- package/lib/typescript/components/HMSNotification.d.ts.map +1 -1
- package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
- package/lib/typescript/components/HMSOverlayChatView.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewEditName.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSPrimaryButton.d.ts +1 -0
- package/lib/typescript/components/HMSPrimaryButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSRecordingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
- package/lib/typescript/components/HMSTerminalErrorNotification.d.ts.map +1 -1
- package/lib/typescript/components/Header.d.ts.map +1 -1
- package/lib/typescript/components/LeaveRoomBottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/Meeting.d.ts.map +1 -1
- package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
- package/lib/typescript/components/Modals.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts.map +1 -1
- package/lib/typescript/components/PeerSettingsModalContent.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/RoomSettingsModalDebugModeContent.d.ts.map +1 -1
- package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
- package/lib/typescript/hooks-sdk-selectors.d.ts +3 -0
- package/lib/typescript/hooks-sdk-selectors.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-selectors.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +35 -3
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +9 -2
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +37 -3
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +7 -2
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +7 -2
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/chatWindow.d.ts +1 -1
- package/lib/typescript/redux/reducers/chatWindow.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +7 -2
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/message.d.ts +3 -2
- package/lib/typescript/redux/reducers/message.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +26 -5
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +3 -0
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +179 -179
- package/src/HMSContainer.tsx +26 -5
- package/src/HMSRoomSetup.tsx +9 -9
- package/src/Icons/Chat/assets/chat-on.png +0 -0
- package/src/Icons/Chat/assets/chat-on@2x.png +0 -0
- package/src/Icons/Chat/assets/chat-on@3x.png +0 -0
- package/src/Icons/Chat/index.tsx +19 -6
- package/src/Icons/NoEntry/assets/no-entry.png +0 -0
- package/src/Icons/NoEntry/assets/no-entry@2x.png +0 -0
- package/src/Icons/NoEntry/assets/no-entry@3x.png +0 -0
- package/src/Icons/NoEntry/index.tsx +33 -0
- package/src/Icons/PauseCircle/assets/pause-circle.png +0 -0
- package/src/Icons/PauseCircle/assets/pause-circle@2x.png +0 -0
- package/src/Icons/PauseCircle/assets/pause-circle@3x.png +0 -0
- package/src/Icons/PauseCircle/index.tsx +27 -0
- package/src/Icons/Pin/assets/unpin.png +0 -0
- package/src/Icons/Pin/assets/unpin@2x.png +0 -0
- package/src/Icons/Pin/assets/unpin@3x.png +0 -0
- package/src/Icons/Pin/index.tsx +13 -3
- package/src/Icons/Recording/assets/recording-pause.png +0 -0
- package/src/Icons/Recording/assets/recording-pause@2x.png +0 -0
- package/src/Icons/Recording/assets/recording-pause@3x.png +0 -0
- package/src/Icons/Recording/index.tsx +2 -2
- package/src/Icons/index.ts +2 -0
- package/src/components/BottomSheet.tsx +13 -3
- package/src/components/Chat/ChatFilterBottomSheet.tsx +35 -0
- package/src/components/Chat/ChatFilterBottomSheetOpener.tsx +170 -42
- package/src/components/Chat/ChatFilterItem.tsx +8 -4
- package/src/components/Chat/ChatFilterView.tsx +102 -75
- package/src/components/Chat/ChatList.tsx +18 -6
- package/src/components/Chat/ChatMessage.tsx +111 -7
- package/src/components/Chat/ChatMoreActionsModal.tsx +75 -0
- package/src/components/Chat/ChatMoreActionsSheetView.tsx +77 -0
- package/src/components/Chat/ChatMoreActionsView.tsx +84 -0
- package/src/components/Chat/ChatPaused.tsx +103 -0
- package/src/components/Chat/MessageOptionsBottomSheet.tsx +33 -0
- package/src/components/Chat/MessageOptionsBottomSheetView.tsx +82 -0
- package/src/components/Chat/MessageOptionsView.tsx +248 -0
- package/src/components/Chat/PeerBlockedFromChat.tsx +49 -0
- package/src/components/Chat/PinnedMessages.tsx +422 -0
- package/src/components/Chat/index.ts +1 -1
- package/src/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.tsx +4 -1
- package/src/components/ChatAndParticipants/ChatAndParticipantsHeader.tsx +48 -12
- package/src/components/ChatAndParticipants/ChatAndParticipantsView.tsx +9 -1
- package/src/components/ChatAndParticipants/ChatView.tsx +37 -5
- package/src/components/EndRoomModalContent.tsx +11 -14
- package/src/components/Footer.tsx +3 -1
- package/src/components/GridView.tsx +17 -8
- package/src/components/HLSView.tsx +45 -45
- package/src/components/HMSBaseButton.tsx +17 -2
- package/src/components/HMSDangerButton.tsx +3 -0
- package/src/components/HMSHLSMessage.tsx +130 -13
- package/src/components/HMSHLSMessageList.tsx +2 -2
- package/src/components/HMSHandRaiseNotification.tsx +17 -10
- package/src/components/HMSKeyboardAvoidingView.tsx +6 -1
- package/src/components/HMSLiveIndicator.tsx +9 -13
- package/src/components/HMSLiveViewerCount.tsx +21 -20
- package/src/components/HMSLocalScreenshareNotification.tsx +1 -0
- package/src/components/HMSNotification.tsx +56 -13
- package/src/components/HMSNotifications.tsx +12 -2
- package/src/components/HMSOverlayChatView.tsx +74 -17
- package/src/components/HMSPreviewEditName.tsx +3 -1
- package/src/components/HMSPreviewHLSLiveIndicator.tsx +2 -6
- package/src/components/HMSPrimaryButton.tsx +3 -0
- package/src/components/HMSRecordingIndicator.tsx +8 -22
- package/src/components/HMSRoomOptions.tsx +4 -1
- package/src/components/HMSTerminalErrorNotification.tsx +15 -10
- package/src/components/Header.tsx +4 -1
- package/src/components/LeaveRoomBottomSheet.tsx +13 -11
- package/src/components/Meeting.tsx +4 -0
- package/src/components/MeetingScreenContent.tsx +24 -21
- package/src/components/Modals.tsx +23 -25
- package/src/components/Participants/ParticipantsItemOptions.tsx +12 -7
- package/src/components/PeerSettingsModalContent.tsx +3 -1
- package/src/components/PeerVideoTile/PeerVideoTileView.tsx +3 -1
- package/src/components/Preview.tsx +15 -2
- package/src/components/PreviewForRoleChangeModal.tsx +4 -3
- package/src/components/RoomSettingsModalContent.tsx +62 -18
- package/src/components/RoomSettingsModalDebugModeContent.tsx +2 -5
- package/src/components/WebrtcView.tsx +6 -2
- package/src/hooks-sdk-selectors.tsx +19 -0
- package/src/hooks-sdk.ts +37 -0
- package/src/hooks-util-selectors.tsx +2 -3
- package/src/hooks-util.ts +580 -90
- package/src/redux/actionTypes.ts +22 -2
- package/src/redux/actions/index.ts +41 -4
- package/src/redux/reducers/appState.ts +54 -5
- package/src/redux/reducers/chatWindow.ts +2 -2
- package/src/redux/reducers/hmsStates.ts +36 -13
- package/src/redux/reducers/message.ts +20 -6
- package/src/types.ts +36 -6
- package/src/utils/types.ts +3 -0
- package/src/utils.ts +2 -2
- package/lib/commonjs/components/Chat/PinnedMessage.js +0 -81
- package/lib/commonjs/components/Chat/PinnedMessage.js.map +0 -1
- package/lib/module/components/Chat/PinnedMessage.js +0 -72
- package/lib/module/components/Chat/PinnedMessage.js.map +0 -1
- package/lib/typescript/components/Chat/PinnedMessage.d.ts +0 -3
- package/lib/typescript/components/Chat/PinnedMessage.d.ts.map +0 -1
- package/src/components/Chat/PinnedMessage.tsx +0 -89
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useStartRecording = exports.useShowLandscapeLayout = exports.useShowChatAndParticipants = exports.useShouldGoLive = exports.useSendMessage = exports.useSavePropsToStore = exports.usePortraitChatViewVisible = exports.usePipAspectRatio = exports.usePIPListener = exports.useOffStageParticipants = exports.useModalType = exports.useLeaveMethods = exports.useLandscapeChatViewVisible = exports.useKeyboardState = exports.useIsHLSViewer = exports.useHMSSessionStoreListeners = exports.useHMSSessionStore = exports.useHMSRoomTypography = exports.useHMSRoomTheme = exports.useHMSRoomStyleSheet = exports.useHMSRoomStyle = exports.useHMSRoomColorPalette = exports.useHMSRoleChangeRequest = exports.useHMSRemovedFromRoomUpdate = exports.useHMSReconnection = exports.useHMSPIPRoomLeave = exports.useHMSNetworkQualityUpdate = exports.useHMSMessages = exports.useHMSListeners = exports.useHMSLayoutConfig = exports.useHMSInstance = exports.useHMSConfig = exports.useHMSConferencingScreenConfig = exports.useHMSChatLayoutConfig = exports.useHMSChangeTrackStateRequest = exports.useHMSActiveSpeakerUpdates = exports.useFilteredParticipants = exports.useFetchHMSRoles = exports.useEnableAutoPip = exports.useDisableAutoPip = exports.useBackButtonPress = exports.useAutoPip = exports.useAndroidSoftInputAdjustResize = exports.isPublishingAllowed = exports.clearPendingModalTasks = exports.clearConfig = void 0;
|
|
6
|
+
exports.useStartRecording = exports.useShowLandscapeLayout = exports.useShowChatAndParticipants = exports.useShouldGoLive = exports.useSetDefaultChatRecipient = exports.useSendMessage = exports.useSavePropsToStore = exports.usePortraitChatViewVisible = exports.usePipAspectRatio = exports.usePIPListener = exports.useOffStageParticipants = exports.useModalType = exports.useLeaveMethods = exports.useLandscapeChatViewVisible = exports.useKeyboardState = exports.useIsPeerBlocked = exports.useIsMessagePinned = exports.useIsLocalPeerBlockedFromChat = exports.useIsHLSViewer = exports.useIsAllowedToSendMessage = exports.useHMSSessionStoreListeners = exports.useHMSSessionStore = exports.useHMSRoomTypography = exports.useHMSRoomTheme = exports.useHMSRoomStyleSheet = exports.useHMSRoomStyle = exports.useHMSRoomColorPalette = exports.useHMSRoleChangeRequest = exports.useHMSRemovedFromRoomUpdate = exports.useHMSReconnection = exports.useHMSPIPRoomLeave = exports.useHMSNetworkQualityUpdate = exports.useHMSMessages = exports.useHMSMessagePinningActions = exports.useHMSListeners = exports.useHMSLayoutConfig = exports.useHMSInstance = exports.useHMSConfig = exports.useHMSConferencingScreenConfig = exports.useHMSChatState = exports.useHMSChatRecipientSelector = exports.useHMSChatLayoutConfig = exports.useHMSChangeTrackStateRequest = exports.useHMSCanDisableChat = exports.useHMSActiveSpeakerUpdates = exports.useFilteredParticipants = exports.useFetchHMSRoles = exports.useEnableAutoPip = exports.useDisableAutoPip = exports.useBlockPeerActions = exports.useBackButtonPress = exports.useAutoPip = exports.useAndroidSoftInputAdjustResize = exports.useAllowPinningMessage = exports.useAllowBlockingPeerFromChat = exports.isPublishingAllowed = exports.clearPendingModalTasks = exports.clearConfig = void 0;
|
|
7
7
|
var _reactNativeHms = require("@100mslive/react-native-hms");
|
|
8
8
|
var _reactNativeSimpleToast = _interopRequireDefault(require("react-native-simple-toast"));
|
|
9
9
|
var _react = require("react");
|
|
@@ -20,6 +20,7 @@ var _hooksUtilSelectors = require("./hooks-util-selectors");
|
|
|
20
20
|
var _HMSManager = require("./modules/HMSManager");
|
|
21
21
|
var _theme = require("./utils/theme");
|
|
22
22
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
23
|
+
var _hooksSdk = require("./hooks-sdk");
|
|
23
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
25
|
const useHMSListeners = setPeerTrackNodes => {
|
|
25
26
|
const hmsInstance = useHMSInstance();
|
|
@@ -61,7 +62,7 @@ const useHMSPeersUpdate = (hmsInstance, updateLocalPeer, setPeerTrackNodes) => {
|
|
|
61
62
|
// const inMeeting = useSelector(
|
|
62
63
|
// (state: RootState) => state.app.meetingState === MeetingState.IN_MEETING
|
|
63
64
|
// );
|
|
64
|
-
|
|
65
|
+
const hmsActions = (0, _hooksSdk.useHMSActions)();
|
|
65
66
|
(0, _react.useEffect)(() => {
|
|
66
67
|
const peerUpdateHandler = ({
|
|
67
68
|
peer,
|
|
@@ -109,6 +110,7 @@ const useHMSPeersUpdate = (hmsInstance, updateLocalPeer, setPeerTrackNodes) => {
|
|
|
109
110
|
const fullScreenPeerTrackNode = reduxState.app.fullScreenPeerTrackNode;
|
|
110
111
|
const miniviewPeerTrackNode = reduxState.app.miniviewPeerTrackNode;
|
|
111
112
|
const localPeerTrackNode = reduxState.app.localPeerTrackNode;
|
|
113
|
+
const initialRole = reduxState.app.initialRole;
|
|
112
114
|
|
|
113
115
|
// Currently Applied Layout config
|
|
114
116
|
const currentLayoutConfig = (0, _hooksUtilSelectors.selectLayoutConfigForRole)(reduxState.hmsStates.layoutConfig, peer.role || null);
|
|
@@ -163,12 +165,36 @@ const useHMSPeersUpdate = (hmsInstance, updateLocalPeer, setPeerTrackNodes) => {
|
|
|
163
165
|
// - TODO: update local localPeer state
|
|
164
166
|
// - Pass this updated data to Meeting component -> DisplayView component
|
|
165
167
|
updateLocalPeer();
|
|
168
|
+
if (type === _reactNativeHms.HMSPeerUpdate.ROLE_CHANGED) {
|
|
169
|
+
const parsedLocalPeerMetadata = (0, _functions.parseMetadata)(peer.metadata);
|
|
170
|
+
if (parsedLocalPeerMetadata.prevRole !== initialRole) {
|
|
171
|
+
const newMetadata = {
|
|
172
|
+
...parsedLocalPeerMetadata,
|
|
173
|
+
prevRole: initialRole === null || initialRole === void 0 ? void 0 : initialRole.name
|
|
174
|
+
};
|
|
175
|
+
hmsActions.changeMetadata(newMetadata).then(r => {
|
|
176
|
+
console.log('Metadata changed successfully', r);
|
|
177
|
+
}).catch(e => {
|
|
178
|
+
console.log('Metadata change failed', e);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
166
182
|
return;
|
|
167
183
|
}
|
|
168
184
|
if (type === _reactNativeHms.HMSPeerUpdate.ROLE_CHANGED) {
|
|
169
185
|
var _peer$role2, _peer$role3, _peer$role4, _peer$role5, _peer$role6, _peer$role7, _peer$role8, _peer$role9, _peer$role10;
|
|
170
186
|
dispatch((0, _actions.addUpdateParticipant)(peer));
|
|
171
187
|
|
|
188
|
+
// saving current role in peer metadata,
|
|
189
|
+
// so that when peer is removed from stage, we can assign previous role to it.
|
|
190
|
+
// if (localPeerRoleName) {
|
|
191
|
+
// const newMetadata = {
|
|
192
|
+
// ...localPeerMetadata,
|
|
193
|
+
// prevRole: localPeerRoleName,
|
|
194
|
+
// };
|
|
195
|
+
// await hmsActions.changeMetadata(newMetadata);
|
|
196
|
+
// }
|
|
197
|
+
|
|
172
198
|
// Handling regular tiles list
|
|
173
199
|
if (((_peer$role2 = peer.role) === null || _peer$role2 === void 0 || (_peer$role2 = _peer$role2.publishSettings) === null || _peer$role2 === void 0 ? void 0 : _peer$role2.allowed) === undefined || (_peer$role3 = peer.role) !== null && _peer$role3 !== void 0 && (_peer$role3 = _peer$role3.publishSettings) !== null && _peer$role3 !== void 0 && _peer$role3.allowed && ((_peer$role4 = peer.role) === null || _peer$role4 === void 0 || (_peer$role4 = _peer$role4.publishSettings) === null || _peer$role4 === void 0 ? void 0 : _peer$role4.allowed.length) < 1) {
|
|
174
200
|
setPeerTrackNodes(prevPeerTrackNodes => {
|
|
@@ -633,6 +659,7 @@ const useHMSRoleChangeRequest = (callback, deps) => {
|
|
|
633
659
|
};
|
|
634
660
|
exports.useHMSRoleChangeRequest = useHMSRoleChangeRequest;
|
|
635
661
|
const useHMSSessionStoreListeners = gridViewRef => {
|
|
662
|
+
const store = (0, _reactRedux.useStore)();
|
|
636
663
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
637
664
|
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
638
665
|
const sessionStoreListenersRef = (0, _react.useRef)([]);
|
|
@@ -644,21 +671,79 @@ const useHMSSessionStoreListeners = gridViewRef => {
|
|
|
644
671
|
const addSessionStoreListeners = () => {
|
|
645
672
|
// Handle 'spotlight' key values
|
|
646
673
|
const handleSpotlightIdChange = id => {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
674
|
+
if (id === null || id === undefined || typeof id === 'string') {
|
|
675
|
+
var _gridViewRef$current;
|
|
676
|
+
// set value to the state to rerender the component to reflect changes
|
|
677
|
+
dispatch((0, _actions.saveUserData)({
|
|
678
|
+
spotlightTrackId: id
|
|
679
|
+
}));
|
|
680
|
+
// Scroll to start of the list
|
|
681
|
+
(_gridViewRef$current = gridViewRef.current) === null || _gridViewRef$current === void 0 || (_gridViewRef$current = _gridViewRef$current.getRegularTilesFlatlistRef().current) === null || _gridViewRef$current === void 0 || _gridViewRef$current.scrollToOffset({
|
|
682
|
+
animated: true,
|
|
683
|
+
offset: 0
|
|
684
|
+
});
|
|
685
|
+
}
|
|
657
686
|
};
|
|
658
687
|
|
|
659
|
-
// Handle '
|
|
660
|
-
const
|
|
661
|
-
|
|
688
|
+
// Handle 'pinnedMessages' key values
|
|
689
|
+
const handlePinnedMessagesChange = data => {
|
|
690
|
+
if (Array.isArray(data)) {
|
|
691
|
+
dispatch((0, _actions.addPinnedMessages)(data));
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
// Handle 'chatState' key values
|
|
696
|
+
const handleChatStateChange = data => {
|
|
697
|
+
try {
|
|
698
|
+
var _reduxState$hmsStates3;
|
|
699
|
+
if (typeof data !== 'object' || Array.isArray(data) || data === null) {
|
|
700
|
+
throw new Error('`data` is a falsy value');
|
|
701
|
+
}
|
|
702
|
+
if (!('enabled' in data)) {
|
|
703
|
+
throw new Error("`data` doesn't have `enabled` property");
|
|
704
|
+
}
|
|
705
|
+
const parsedData = data;
|
|
706
|
+
const reduxState = store.getState();
|
|
707
|
+
const currentChatState = reduxState.app.chatState;
|
|
708
|
+
if (parsedData.enabled === (currentChatState === null || currentChatState === void 0 ? void 0 : currentChatState.enabled)) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
const currentLayoutConfig = (0, _hooksUtilSelectors.selectLayoutConfigForRole)(reduxState.hmsStates.layoutConfig, ((_reduxState$hmsStates3 = reduxState.hmsStates.localPeer) === null || _reduxState$hmsStates3 === void 0 ? void 0 : _reduxState$hmsStates3.role) ?? null);
|
|
712
|
+
const chatLayoutConfig = (0, _hooksUtilSelectors.selectChatLayoutConfig)(currentLayoutConfig);
|
|
713
|
+
const isAllowedToSendMessage = ((chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.private_chat_enabled) || (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.public_chat_enabled) || (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.roles_whitelist) && (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.roles_whitelist.length) > 0) ?? false;
|
|
714
|
+
(0, _reactRedux.batch)(() => {
|
|
715
|
+
if (isAllowedToSendMessage && (
|
|
716
|
+
// Only show notification when allowed to send message, AND
|
|
717
|
+
!parsedData.enabled ||
|
|
718
|
+
// Chat is Paused, OR
|
|
719
|
+
currentChatState && parsedData.enabled !== currentChatState.enabled) // current Chat state is different from previous state
|
|
720
|
+
) {
|
|
721
|
+
dispatch((0, _actions.addNotification)({
|
|
722
|
+
id: `chat-state-enabled-${Math.random().toString(16).slice(2)}`,
|
|
723
|
+
icon: parsedData.enabled ? 'chat-on' : 'chat-off',
|
|
724
|
+
type: _types2.NotificationTypes.INFO,
|
|
725
|
+
title: `Chat ${parsedData.enabled ? 'Resumed' : 'Paused'}`,
|
|
726
|
+
message: `Chat ${parsedData.enabled ? 'resumed' : 'paused'} ${parsedData.updatedBy ? `by ${parsedData.updatedBy.userName}` : ''}`
|
|
727
|
+
}));
|
|
728
|
+
}
|
|
729
|
+
dispatch((0, _actions.setChatState)(parsedData));
|
|
730
|
+
});
|
|
731
|
+
} catch (error) {
|
|
732
|
+
dispatch((0, _actions.setChatState)(null));
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
// Handle 'chatPeerBlacklist' key values
|
|
737
|
+
const handleChatPeerBlacklistChange = data => {
|
|
738
|
+
// Whenever list changes :
|
|
739
|
+
// - check if local peer is blocked or unblocked
|
|
740
|
+
// - filter out messages of blocked peers
|
|
741
|
+
if (Array.isArray(data)) {
|
|
742
|
+
(0, _reactRedux.batch)(() => {
|
|
743
|
+
dispatch((0, _actions.setChatPeerBlacklist)(data));
|
|
744
|
+
dispatch((0, _actions.filterOutMsgsFromBlockedPeers)(data));
|
|
745
|
+
});
|
|
746
|
+
}
|
|
662
747
|
};
|
|
663
748
|
|
|
664
749
|
// Getting value for 'spotlight' key by using `get` method on HMSSessionStore instance
|
|
@@ -667,20 +752,32 @@ const useHMSSessionStoreListeners = gridViewRef => {
|
|
|
667
752
|
handleSpotlightIdChange(data);
|
|
668
753
|
}).catch(error => console.log('Session Store get `spotlight` key value error: ', error));
|
|
669
754
|
|
|
670
|
-
// Getting value for '
|
|
671
|
-
hmsSessionStore.get('
|
|
672
|
-
console.log('Session Store get `
|
|
673
|
-
|
|
674
|
-
}).catch(error => console.log('Session Store get `
|
|
755
|
+
// Getting value for 'pinnedMessages' key by using `get` method on HMSSessionStore instance
|
|
756
|
+
hmsSessionStore.get('pinnedMessages').then(data => {
|
|
757
|
+
console.log('Session Store get `pinnedMessages` key value success: ', data);
|
|
758
|
+
handlePinnedMessagesChange(data);
|
|
759
|
+
}).catch(error => console.log('Session Store get `pinnedMessages` key value error: ', error));
|
|
760
|
+
|
|
761
|
+
// Getting value for 'chatState' key by using `get` method on HMSSessionStore instance
|
|
762
|
+
hmsSessionStore.get('chatState').then(data => {
|
|
763
|
+
console.log('Session Store get `chatState` key value success: ', data);
|
|
764
|
+
handleChatStateChange(data);
|
|
765
|
+
}).catch(error => console.log('Session Store get `chatState` key value error: ', error));
|
|
766
|
+
|
|
767
|
+
// Getting value for 'chatPeerBlacklist' key by using `get` method on HMSSessionStore instance
|
|
768
|
+
hmsSessionStore.get('chatPeerBlacklist').then(data => {
|
|
769
|
+
console.log('Session Store get `chatPeerBlacklist` key value success: ', data);
|
|
770
|
+
handleChatPeerBlacklistChange(data);
|
|
771
|
+
}).catch(error => console.log('Session Store get `chatPeerBlacklist` key value error: ', error));
|
|
675
772
|
|
|
676
773
|
// let lastSpotlightValue: HMSSessionStoreValue = null;
|
|
677
774
|
// let lastPinnedMessageValue: HMSSessionStoreValue = null;
|
|
678
775
|
|
|
679
|
-
// Add subscription for `spotlight` & `
|
|
680
|
-
const subscription = hmsSessionStore.addKeyChangeListener(['spotlight', '
|
|
776
|
+
// Add subscription for `spotlight`, `pinnedMessages`, `chatState` & `chatPeerBlacklist` keys updates on Session Store
|
|
777
|
+
const subscription = hmsSessionStore.addKeyChangeListener(['spotlight', 'pinnedMessages', 'chatState', 'chatPeerBlacklist'], (error, data) => {
|
|
681
778
|
// If error occurs, handle error and return early
|
|
682
779
|
if (error !== null) {
|
|
683
|
-
console.log('`spotlight` & `
|
|
780
|
+
console.log('`spotlight`, `pinnedMessages`, `chatState` & `chatPeerBlacklist` key listener Error -> ', error);
|
|
684
781
|
return;
|
|
685
782
|
}
|
|
686
783
|
|
|
@@ -690,44 +787,21 @@ const useHMSSessionStoreListeners = gridViewRef => {
|
|
|
690
787
|
case 'spotlight':
|
|
691
788
|
{
|
|
692
789
|
handleSpotlightIdChange(data.value);
|
|
693
|
-
|
|
694
|
-
// Showing Toast message if value has actually changed
|
|
695
|
-
// if (
|
|
696
|
-
// data.value !== lastSpotlightValue &&
|
|
697
|
-
// (data.value || lastSpotlightValue)
|
|
698
|
-
// ) {
|
|
699
|
-
// Toast.showWithGravity(
|
|
700
|
-
// `SessionStore: \`spotlight\` key's value changed to ${data.value}`,
|
|
701
|
-
// Toast.LONG,
|
|
702
|
-
// Toast.TOP
|
|
703
|
-
// );
|
|
704
|
-
// }
|
|
705
|
-
|
|
706
|
-
// lastSpotlightValue = data.value;
|
|
707
790
|
break;
|
|
708
791
|
}
|
|
709
|
-
case '
|
|
792
|
+
case 'pinnedMessages':
|
|
710
793
|
{
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
// Toast.showWithGravity(
|
|
723
|
-
// `SessionStore: \`pinnedMessage\` key's value changed to ${data.value}`,
|
|
724
|
-
// Toast.LONG,
|
|
725
|
-
// Toast.TOP
|
|
726
|
-
// );
|
|
727
|
-
// }, 1500);
|
|
728
|
-
// }
|
|
729
|
-
|
|
730
|
-
// lastPinnedMessageValue = data.value;
|
|
794
|
+
handlePinnedMessagesChange(data.value);
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
797
|
+
case 'chatState':
|
|
798
|
+
{
|
|
799
|
+
handleChatStateChange(data.value);
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
802
|
+
case 'chatPeerBlacklist':
|
|
803
|
+
{
|
|
804
|
+
handleChatPeerBlacklistChange(data.value);
|
|
731
805
|
break;
|
|
732
806
|
}
|
|
733
807
|
}
|
|
@@ -745,7 +819,7 @@ const useHMSSessionStoreListeners = gridViewRef => {
|
|
|
745
819
|
// if (toastTimeoutId !== null) clearTimeout(toastTimeoutId);
|
|
746
820
|
};
|
|
747
821
|
}
|
|
748
|
-
}, [hmsSessionStore]);
|
|
822
|
+
}, [store, hmsSessionStore]);
|
|
749
823
|
};
|
|
750
824
|
exports.useHMSSessionStoreListeners = useHMSSessionStoreListeners;
|
|
751
825
|
const useHMSSessionStore = () => {
|
|
@@ -1401,14 +1475,13 @@ const useLeaveMethods = () => {
|
|
|
1401
1475
|
|
|
1402
1476
|
const onLeave = reduxStore.getState().user.onLeave;
|
|
1403
1477
|
if (typeof onLeave === 'function') {
|
|
1478
|
+
dispatch((0, _actions.changeMeetingState)(_types2.MeetingState.EXITED));
|
|
1404
1479
|
onLeave(reason);
|
|
1405
|
-
dispatch((0, _actions.clearStore)());
|
|
1406
1480
|
} else if (navigation && typeof navigation.canGoBack === 'function' && navigation.canGoBack()) {
|
|
1481
|
+
dispatch((0, _actions.changeMeetingState)(_types2.MeetingState.EXITED));
|
|
1407
1482
|
navigation.goBack();
|
|
1408
|
-
dispatch((0, _actions.clearStore)());
|
|
1409
1483
|
} else {
|
|
1410
1484
|
// Otherwise default action is to show "Meeting Ended" screen
|
|
1411
|
-
dispatch((0, _actions.clearStore)()); // TODO: We need different clearStore for MeetingEnded
|
|
1412
1485
|
dispatch((0, _actions.changeMeetingState)(_types2.MeetingState.MEETING_ENDED));
|
|
1413
1486
|
}
|
|
1414
1487
|
} catch (e) {
|
|
@@ -1532,7 +1605,7 @@ const useSendMessage = () => {
|
|
|
1532
1605
|
const chatWindowState = reduxStore.getState().chatWindow;
|
|
1533
1606
|
const message = chatWindowState.typedMessage;
|
|
1534
1607
|
const sendingTo = chatWindowState.sendTo;
|
|
1535
|
-
if (message.length <= 0) return;
|
|
1608
|
+
if (message.length <= 0 || !sendingTo) return;
|
|
1536
1609
|
const hmsMessageRecipient = new _reactNativeHms.HMSMessageRecipient({
|
|
1537
1610
|
recipientType: 'publishSettings' in sendingTo ? _reactNativeHms.HMSMessageRecipientType.ROLES : 'peerID' in sendingTo ? _reactNativeHms.HMSMessageRecipientType.PEER : _reactNativeHms.HMSMessageRecipientType.BROADCAST,
|
|
1538
1611
|
recipientPeer: 'peerID' in sendingTo ? sendingTo : undefined,
|
|
@@ -1585,6 +1658,45 @@ const useSendMessage = () => {
|
|
|
1585
1658
|
};
|
|
1586
1659
|
};
|
|
1587
1660
|
exports.useSendMessage = useSendMessage;
|
|
1661
|
+
const useHMSCanDisableChat = () => {
|
|
1662
|
+
return useHMSChatLayoutConfig(chatLayoutConfig => {
|
|
1663
|
+
var _chatLayoutConfig$rea;
|
|
1664
|
+
return (chatLayoutConfig === null || chatLayoutConfig === void 0 || (_chatLayoutConfig$rea = chatLayoutConfig.real_time_controls) === null || _chatLayoutConfig$rea === void 0 ? void 0 : _chatLayoutConfig$rea.can_disable_chat) ?? false;
|
|
1665
|
+
});
|
|
1666
|
+
};
|
|
1667
|
+
exports.useHMSCanDisableChat = useHMSCanDisableChat;
|
|
1668
|
+
const useHMSChatRecipientSelector = () => {
|
|
1669
|
+
const roles = (0, _reactRedux.useSelector)(state => state.hmsStates.roles);
|
|
1670
|
+
const defaultChatRecipient = (0, _react.useMemo)(() => ({
|
|
1671
|
+
privateChat: false,
|
|
1672
|
+
publicChat: false,
|
|
1673
|
+
roles: []
|
|
1674
|
+
}), []);
|
|
1675
|
+
const chatLayoutConfig = useHMSChatLayoutConfig(_chatLayoutConfig => _chatLayoutConfig);
|
|
1676
|
+
const rolesWhitelist = chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.roles_whitelist;
|
|
1677
|
+
const whitelistedRoles = (0, _react.useMemo)(() => {
|
|
1678
|
+
if (!rolesWhitelist) {
|
|
1679
|
+
return defaultChatRecipient.roles;
|
|
1680
|
+
}
|
|
1681
|
+
return rolesWhitelist.map(roleStr => roles.find(role => role.name === roleStr)).filter(role => !!role);
|
|
1682
|
+
}, [roles, rolesWhitelist, defaultChatRecipient]);
|
|
1683
|
+
const privateChat = (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.private_chat_enabled) ?? defaultChatRecipient.privateChat;
|
|
1684
|
+
const publicChat = (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.public_chat_enabled) ?? defaultChatRecipient.publicChat;
|
|
1685
|
+
if (chatLayoutConfig) {
|
|
1686
|
+
return {
|
|
1687
|
+
privateChat,
|
|
1688
|
+
publicChat,
|
|
1689
|
+
roles: whitelistedRoles
|
|
1690
|
+
};
|
|
1691
|
+
}
|
|
1692
|
+
return defaultChatRecipient;
|
|
1693
|
+
};
|
|
1694
|
+
exports.useHMSChatRecipientSelector = useHMSChatRecipientSelector;
|
|
1695
|
+
const useIsAllowedToSendMessage = () => {
|
|
1696
|
+
const chatRecipients = useHMSChatRecipientSelector();
|
|
1697
|
+
return chatRecipients.privateChat || chatRecipients.publicChat || chatRecipients.roles.length > 0;
|
|
1698
|
+
};
|
|
1699
|
+
exports.useIsAllowedToSendMessage = useIsAllowedToSendMessage;
|
|
1588
1700
|
const useHMSChatLayoutConfig = (selector, equalityFn) => {
|
|
1589
1701
|
return useHMSLayoutConfig(layoutConfig => {
|
|
1590
1702
|
const chatConfig = (0, _hooksUtilSelectors.selectChatLayoutConfig)(layoutConfig);
|
|
@@ -1679,7 +1791,7 @@ const useStartRecording = () => {
|
|
|
1679
1791
|
dispatch((0, _actions.addNotification)({
|
|
1680
1792
|
id: Math.random().toString(16).slice(2),
|
|
1681
1793
|
type: _types2.NotificationTypes.ERROR,
|
|
1682
|
-
|
|
1794
|
+
title: error.message
|
|
1683
1795
|
}));
|
|
1684
1796
|
});
|
|
1685
1797
|
});
|
|
@@ -1689,6 +1801,156 @@ const useStartRecording = () => {
|
|
|
1689
1801
|
};
|
|
1690
1802
|
};
|
|
1691
1803
|
exports.useStartRecording = useStartRecording;
|
|
1804
|
+
const useHMSChatState = () => {
|
|
1805
|
+
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
1806
|
+
const localPeerName = (0, _reactRedux.useSelector)(state => {
|
|
1807
|
+
var _state$hmsStates$loca4;
|
|
1808
|
+
return (_state$hmsStates$loca4 = state.hmsStates.localPeer) === null || _state$hmsStates$loca4 === void 0 ? void 0 : _state$hmsStates$loca4.name;
|
|
1809
|
+
});
|
|
1810
|
+
const localPeerID = (0, _reactRedux.useSelector)(state => {
|
|
1811
|
+
var _state$hmsStates$loca5;
|
|
1812
|
+
return (_state$hmsStates$loca5 = state.hmsStates.localPeer) === null || _state$hmsStates$loca5 === void 0 ? void 0 : _state$hmsStates$loca5.peerID;
|
|
1813
|
+
});
|
|
1814
|
+
const localPeerUserID = (0, _reactRedux.useSelector)(state => {
|
|
1815
|
+
var _state$hmsStates$loca6;
|
|
1816
|
+
return (_state$hmsStates$loca6 = state.hmsStates.localPeer) === null || _state$hmsStates$loca6 === void 0 ? void 0 : _state$hmsStates$loca6.customerUserID;
|
|
1817
|
+
});
|
|
1818
|
+
const _chatState = (0, _reactRedux.useSelector)(state => state.app.chatState);
|
|
1819
|
+
const chatState = (0, _react.useMemo)(() => _chatState || {
|
|
1820
|
+
enabled: true
|
|
1821
|
+
}, [_chatState]);
|
|
1822
|
+
const setChatState = (0, _react.useCallback)(async enabled => {
|
|
1823
|
+
// If instance of HMSSessionStore is available
|
|
1824
|
+
if (hmsSessionStore) {
|
|
1825
|
+
try {
|
|
1826
|
+
const value = {
|
|
1827
|
+
enabled,
|
|
1828
|
+
updatedBy: {
|
|
1829
|
+
peerID: localPeerID ?? null,
|
|
1830
|
+
userID: localPeerUserID ?? null,
|
|
1831
|
+
userName: localPeerName ?? ''
|
|
1832
|
+
},
|
|
1833
|
+
updatedAt: Date.now()
|
|
1834
|
+
};
|
|
1835
|
+
// set `value` on `session` with key 'chatState'
|
|
1836
|
+
const response = await hmsSessionStore.set(value, 'chatState');
|
|
1837
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
1838
|
+
} catch (error) {
|
|
1839
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
}, [localPeerName, hmsSessionStore, localPeerUserID, localPeerID]);
|
|
1843
|
+
return {
|
|
1844
|
+
chatState,
|
|
1845
|
+
setChatState
|
|
1846
|
+
};
|
|
1847
|
+
};
|
|
1848
|
+
exports.useHMSChatState = useHMSChatState;
|
|
1849
|
+
const useIsMessagePinned = message => {
|
|
1850
|
+
return (0, _reactRedux.useSelector)(state => message ? state.messages.pinnedMessages.findIndex(pinnedMessage => pinnedMessage.id === message.messageId) >= 0 : false);
|
|
1851
|
+
};
|
|
1852
|
+
exports.useIsMessagePinned = useIsMessagePinned;
|
|
1853
|
+
const useHMSMessagePinningActions = () => {
|
|
1854
|
+
const store = (0, _reactRedux.useStore)();
|
|
1855
|
+
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
1856
|
+
const pinMessage = (0, _react.useCallback)(async message => {
|
|
1857
|
+
let messages = message;
|
|
1858
|
+
if (!Array.isArray(messages)) {
|
|
1859
|
+
messages = [messages];
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
// If instance of HMSSessionStore is available
|
|
1863
|
+
if (hmsSessionStore) {
|
|
1864
|
+
try {
|
|
1865
|
+
var _reduxState$hmsStates4;
|
|
1866
|
+
const reduxState = store.getState();
|
|
1867
|
+
const localPeerName = (_reduxState$hmsStates4 = reduxState.hmsStates.localPeer) === null || _reduxState$hmsStates4 === void 0 ? void 0 : _reduxState$hmsStates4.name;
|
|
1868
|
+
const pinnedMessages = reduxState.messages.pinnedMessages;
|
|
1869
|
+
let payload = messages.map(message => {
|
|
1870
|
+
var _message$sender2, _message$sender3;
|
|
1871
|
+
return {
|
|
1872
|
+
authorId: ((_message$sender2 = message.sender) === null || _message$sender2 === void 0 ? void 0 : _message$sender2.customerUserID) ?? '',
|
|
1873
|
+
id: message.messageId,
|
|
1874
|
+
pinnedBy: localPeerName ?? '',
|
|
1875
|
+
text: `${(_message$sender3 = message.sender) === null || _message$sender3 === void 0 ? void 0 : _message$sender3.name}: ${message.message}`
|
|
1876
|
+
};
|
|
1877
|
+
});
|
|
1878
|
+
let updatedPinnedMessages = [...pinnedMessages, ...payload];
|
|
1879
|
+
if (updatedPinnedMessages.length > 3) {
|
|
1880
|
+
updatedPinnedMessages = updatedPinnedMessages.slice(updatedPinnedMessages.length - 3);
|
|
1881
|
+
}
|
|
1882
|
+
const response = await hmsSessionStore.set(updatedPinnedMessages, 'pinnedMessages');
|
|
1883
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
1884
|
+
} catch (error) {
|
|
1885
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
1886
|
+
return Promise.reject(error);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
}, [hmsSessionStore]);
|
|
1890
|
+
const unpinMessage = (0, _react.useCallback)(async message => {
|
|
1891
|
+
let messages = message;
|
|
1892
|
+
if (!Array.isArray(messages)) {
|
|
1893
|
+
messages = [messages];
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
// If instance of HMSSessionStore is available
|
|
1897
|
+
if (hmsSessionStore) {
|
|
1898
|
+
try {
|
|
1899
|
+
const pinnedMessages = store.getState().messages.pinnedMessages;
|
|
1900
|
+
const messageIdsToUnpin = messages.map(msg => 'messageId' in msg ? msg.messageId : msg.id);
|
|
1901
|
+
const updatedPinnedMessages = pinnedMessages.filter(pinnedMessage => !messageIdsToUnpin.includes(pinnedMessage.id));
|
|
1902
|
+
const response = await hmsSessionStore.set(updatedPinnedMessages, 'pinnedMessages');
|
|
1903
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
1904
|
+
} catch (error) {
|
|
1905
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
1906
|
+
return Promise.reject(error);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
}, [hmsSessionStore]);
|
|
1910
|
+
return {
|
|
1911
|
+
pinMessage,
|
|
1912
|
+
unpinMessage
|
|
1913
|
+
};
|
|
1914
|
+
};
|
|
1915
|
+
exports.useHMSMessagePinningActions = useHMSMessagePinningActions;
|
|
1916
|
+
const useSetDefaultChatRecipient = () => {
|
|
1917
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
1918
|
+
const localPeerRoleName = (0, _reactRedux.useSelector)(state => {
|
|
1919
|
+
var _state$hmsStates$loca7;
|
|
1920
|
+
return (_state$hmsStates$loca7 = state.hmsStates.localPeer) === null || _state$hmsStates$loca7 === void 0 || (_state$hmsStates$loca7 = _state$hmsStates$loca7.role) === null || _state$hmsStates$loca7 === void 0 ? void 0 : _state$hmsStates$loca7.name;
|
|
1921
|
+
});
|
|
1922
|
+
const {
|
|
1923
|
+
privateChat,
|
|
1924
|
+
publicChat,
|
|
1925
|
+
roles: whitelistedRoles
|
|
1926
|
+
} = useHMSChatRecipientSelector();
|
|
1927
|
+
(0, _react.useEffect)(() => {
|
|
1928
|
+
if (publicChat) {
|
|
1929
|
+
dispatch({
|
|
1930
|
+
type: 'SET_SENDTO',
|
|
1931
|
+
sendTo: _types.ChatBroadcastFilter
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
// If Role is enabled, Select a role
|
|
1935
|
+
else if (Array.isArray(whitelistedRoles) && whitelistedRoles.length > 0) {
|
|
1936
|
+
const roleObj = whitelistedRoles.length === 1 ? whitelistedRoles[0] : whitelistedRoles.filter(whitelistRole => whitelistRole.name !== localPeerRoleName)[0];
|
|
1937
|
+
if (roleObj) {
|
|
1938
|
+
dispatch({
|
|
1939
|
+
type: 'SET_SENDTO',
|
|
1940
|
+
sendTo: roleObj
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
// If private is enabled, Select None
|
|
1945
|
+
else if (privateChat) {
|
|
1946
|
+
dispatch({
|
|
1947
|
+
type: 'SET_SENDTO',
|
|
1948
|
+
sendTo: null
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
}, [privateChat, publicChat, whitelistedRoles, localPeerRoleName, dispatch]);
|
|
1952
|
+
};
|
|
1953
|
+
exports.useSetDefaultChatRecipient = useSetDefaultChatRecipient;
|
|
1692
1954
|
const useAndroidSoftInputAdjustResize = () => {
|
|
1693
1955
|
const currentSoftInputRef = (0, _react.useRef)(null);
|
|
1694
1956
|
(0, _react.useEffect)(() => {
|
|
@@ -1757,4 +2019,88 @@ const useKeyboardState = () => {
|
|
|
1757
2019
|
};
|
|
1758
2020
|
};
|
|
1759
2021
|
exports.useKeyboardState = useKeyboardState;
|
|
2022
|
+
const useAllowPinningMessage = () => {
|
|
2023
|
+
return useHMSChatLayoutConfig(config => (config === null || config === void 0 ? void 0 : config.allow_pinning_messages) ?? false);
|
|
2024
|
+
};
|
|
2025
|
+
exports.useAllowPinningMessage = useAllowPinningMessage;
|
|
2026
|
+
const useIsLocalPeerBlockedFromChat = () => {
|
|
2027
|
+
return (0, _reactRedux.useSelector)(state => {
|
|
2028
|
+
var _state$hmsStates$loca8;
|
|
2029
|
+
const chatPeerBlacklist = state.app.chatPeerBlacklist;
|
|
2030
|
+
const localPeerUserId = (_state$hmsStates$loca8 = state.hmsStates.localPeer) === null || _state$hmsStates$loca8 === void 0 ? void 0 : _state$hmsStates$loca8.customerUserID;
|
|
2031
|
+
return localPeerUserId ? chatPeerBlacklist.includes(localPeerUserId) : false;
|
|
2032
|
+
});
|
|
2033
|
+
};
|
|
2034
|
+
exports.useIsLocalPeerBlockedFromChat = useIsLocalPeerBlockedFromChat;
|
|
2035
|
+
const useIsPeerBlocked = peer => {
|
|
2036
|
+
return (0, _reactRedux.useSelector)(state => {
|
|
2037
|
+
const chatPeerBlacklist = state.app.chatPeerBlacklist;
|
|
2038
|
+
const localPeerUserId = peer === null || peer === void 0 ? void 0 : peer.customerUserID;
|
|
2039
|
+
return localPeerUserId ? chatPeerBlacklist.includes(localPeerUserId) : false;
|
|
2040
|
+
});
|
|
2041
|
+
};
|
|
2042
|
+
exports.useIsPeerBlocked = useIsPeerBlocked;
|
|
2043
|
+
const useBlockPeerActions = () => {
|
|
2044
|
+
const store = (0, _reactRedux.useStore)();
|
|
2045
|
+
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
2046
|
+
const {
|
|
2047
|
+
unpinMessage
|
|
2048
|
+
} = useHMSMessagePinningActions();
|
|
2049
|
+
const blockPeer = (0, _react.useCallback)(async peer => {
|
|
2050
|
+
// If instance of HMSSessionStore is available
|
|
2051
|
+
if (hmsSessionStore) {
|
|
2052
|
+
try {
|
|
2053
|
+
const reduxState = store.getState();
|
|
2054
|
+
const chatPeerBlacklist = reduxState.app.chatPeerBlacklist;
|
|
2055
|
+
const pinnedMessages = reduxState.messages.pinnedMessages;
|
|
2056
|
+
if (peer.customerUserID && !chatPeerBlacklist.includes(peer.customerUserID)) {
|
|
2057
|
+
let updatedChatPeerBlacklist = [...chatPeerBlacklist, peer.customerUserID];
|
|
2058
|
+
const response = await hmsSessionStore.set(updatedChatPeerBlacklist, 'chatPeerBlacklist');
|
|
2059
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
2060
|
+
|
|
2061
|
+
// Unpin messages from sent by the peer
|
|
2062
|
+
const msgsToUnpin = pinnedMessages.filter(pinnedMessage => pinnedMessage.authorId === peer.customerUserID);
|
|
2063
|
+
if (msgsToUnpin.length > 0) {
|
|
2064
|
+
await unpinMessage(msgsToUnpin);
|
|
2065
|
+
}
|
|
2066
|
+
return response;
|
|
2067
|
+
}
|
|
2068
|
+
return Promise.reject('Peer is already blocked!');
|
|
2069
|
+
} catch (error) {
|
|
2070
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
2071
|
+
return Promise.reject(error);
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
}, [hmsSessionStore, unpinMessage]);
|
|
2075
|
+
const unblockPeer = (0, _react.useCallback)(async peer => {
|
|
2076
|
+
// If instance of HMSSessionStore is available
|
|
2077
|
+
if (hmsSessionStore) {
|
|
2078
|
+
try {
|
|
2079
|
+
const chatPeerBlacklist = store.getState().app.chatPeerBlacklist;
|
|
2080
|
+
if (peer.customerUserID && chatPeerBlacklist.includes(peer.customerUserID)) {
|
|
2081
|
+
const updatedChatPeerBlacklist = chatPeerBlacklist.filter(peerUserId => peerUserId !== peer.customerUserID);
|
|
2082
|
+
const response = await hmsSessionStore.set(updatedChatPeerBlacklist, 'chatPeerBlacklist');
|
|
2083
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
2084
|
+
return response;
|
|
2085
|
+
}
|
|
2086
|
+
return Promise.reject('Peer is already unblocked!');
|
|
2087
|
+
} catch (error) {
|
|
2088
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
2089
|
+
return Promise.reject(error);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}, [hmsSessionStore]);
|
|
2093
|
+
return {
|
|
2094
|
+
blockPeer,
|
|
2095
|
+
unblockPeer
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
2098
|
+
exports.useBlockPeerActions = useBlockPeerActions;
|
|
2099
|
+
const useAllowBlockingPeerFromChat = () => {
|
|
2100
|
+
return useHMSChatLayoutConfig(config => {
|
|
2101
|
+
var _config$real_time_con;
|
|
2102
|
+
return (config === null || config === void 0 || (_config$real_time_con = config.real_time_controls) === null || _config$real_time_con === void 0 ? void 0 : _config$real_time_con.can_block_user) ?? false;
|
|
2103
|
+
});
|
|
2104
|
+
};
|
|
2105
|
+
exports.useAllowBlockingPeerFromChat = useAllowBlockingPeerFromChat;
|
|
1760
2106
|
//# sourceMappingURL=hooks-util.js.map
|