@100mslive/react-native-room-kit 1.0.7 → 1.0.8
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/HMSRoomSetup.js +4 -1
- 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 +408 -61
- 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/message.js +17 -4
- package/lib/commonjs/redux/reducers/message.js.map +1 -1
- package/lib/commonjs/types.js +1 -0
- 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/HMSRoomSetup.js +5 -2
- 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 +398 -62
- 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/message.js +17 -4
- package/lib/module/redux/reducers/message.js.map +1 -1
- package/lib/module/types.js +1 -0
- 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/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/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 +23 -3
- 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/HMSRoomSetup.tsx +7 -2
- 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 +578 -87
- 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/message.ts +20 -6
- package/src/types.ts +35 -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 = () => {
|
|
@@ -1532,7 +1606,7 @@ const useSendMessage = () => {
|
|
|
1532
1606
|
const chatWindowState = reduxStore.getState().chatWindow;
|
|
1533
1607
|
const message = chatWindowState.typedMessage;
|
|
1534
1608
|
const sendingTo = chatWindowState.sendTo;
|
|
1535
|
-
if (message.length <= 0) return;
|
|
1609
|
+
if (message.length <= 0 || !sendingTo) return;
|
|
1536
1610
|
const hmsMessageRecipient = new _reactNativeHms.HMSMessageRecipient({
|
|
1537
1611
|
recipientType: 'publishSettings' in sendingTo ? _reactNativeHms.HMSMessageRecipientType.ROLES : 'peerID' in sendingTo ? _reactNativeHms.HMSMessageRecipientType.PEER : _reactNativeHms.HMSMessageRecipientType.BROADCAST,
|
|
1538
1612
|
recipientPeer: 'peerID' in sendingTo ? sendingTo : undefined,
|
|
@@ -1585,6 +1659,45 @@ const useSendMessage = () => {
|
|
|
1585
1659
|
};
|
|
1586
1660
|
};
|
|
1587
1661
|
exports.useSendMessage = useSendMessage;
|
|
1662
|
+
const useHMSCanDisableChat = () => {
|
|
1663
|
+
return useHMSChatLayoutConfig(chatLayoutConfig => {
|
|
1664
|
+
var _chatLayoutConfig$rea;
|
|
1665
|
+
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;
|
|
1666
|
+
});
|
|
1667
|
+
};
|
|
1668
|
+
exports.useHMSCanDisableChat = useHMSCanDisableChat;
|
|
1669
|
+
const useHMSChatRecipientSelector = () => {
|
|
1670
|
+
const roles = (0, _reactRedux.useSelector)(state => state.hmsStates.roles);
|
|
1671
|
+
const defaultChatRecipient = (0, _react.useMemo)(() => ({
|
|
1672
|
+
privateChat: false,
|
|
1673
|
+
publicChat: false,
|
|
1674
|
+
roles: []
|
|
1675
|
+
}), []);
|
|
1676
|
+
const chatLayoutConfig = useHMSChatLayoutConfig(_chatLayoutConfig => _chatLayoutConfig);
|
|
1677
|
+
const rolesWhitelist = chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.roles_whitelist;
|
|
1678
|
+
const whitelistedRoles = (0, _react.useMemo)(() => {
|
|
1679
|
+
if (!rolesWhitelist) {
|
|
1680
|
+
return defaultChatRecipient.roles;
|
|
1681
|
+
}
|
|
1682
|
+
return rolesWhitelist.map(roleStr => roles.find(role => role.name === roleStr)).filter(role => !!role);
|
|
1683
|
+
}, [roles, rolesWhitelist, defaultChatRecipient]);
|
|
1684
|
+
const privateChat = (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.private_chat_enabled) ?? defaultChatRecipient.privateChat;
|
|
1685
|
+
const publicChat = (chatLayoutConfig === null || chatLayoutConfig === void 0 ? void 0 : chatLayoutConfig.public_chat_enabled) ?? defaultChatRecipient.publicChat;
|
|
1686
|
+
if (chatLayoutConfig) {
|
|
1687
|
+
return {
|
|
1688
|
+
privateChat,
|
|
1689
|
+
publicChat,
|
|
1690
|
+
roles: whitelistedRoles
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
return defaultChatRecipient;
|
|
1694
|
+
};
|
|
1695
|
+
exports.useHMSChatRecipientSelector = useHMSChatRecipientSelector;
|
|
1696
|
+
const useIsAllowedToSendMessage = () => {
|
|
1697
|
+
const chatRecipients = useHMSChatRecipientSelector();
|
|
1698
|
+
return chatRecipients.privateChat || chatRecipients.publicChat || chatRecipients.roles.length > 0;
|
|
1699
|
+
};
|
|
1700
|
+
exports.useIsAllowedToSendMessage = useIsAllowedToSendMessage;
|
|
1588
1701
|
const useHMSChatLayoutConfig = (selector, equalityFn) => {
|
|
1589
1702
|
return useHMSLayoutConfig(layoutConfig => {
|
|
1590
1703
|
const chatConfig = (0, _hooksUtilSelectors.selectChatLayoutConfig)(layoutConfig);
|
|
@@ -1679,7 +1792,7 @@ const useStartRecording = () => {
|
|
|
1679
1792
|
dispatch((0, _actions.addNotification)({
|
|
1680
1793
|
id: Math.random().toString(16).slice(2),
|
|
1681
1794
|
type: _types2.NotificationTypes.ERROR,
|
|
1682
|
-
|
|
1795
|
+
title: error.message
|
|
1683
1796
|
}));
|
|
1684
1797
|
});
|
|
1685
1798
|
});
|
|
@@ -1689,6 +1802,156 @@ const useStartRecording = () => {
|
|
|
1689
1802
|
};
|
|
1690
1803
|
};
|
|
1691
1804
|
exports.useStartRecording = useStartRecording;
|
|
1805
|
+
const useHMSChatState = () => {
|
|
1806
|
+
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
1807
|
+
const localPeerName = (0, _reactRedux.useSelector)(state => {
|
|
1808
|
+
var _state$hmsStates$loca4;
|
|
1809
|
+
return (_state$hmsStates$loca4 = state.hmsStates.localPeer) === null || _state$hmsStates$loca4 === void 0 ? void 0 : _state$hmsStates$loca4.name;
|
|
1810
|
+
});
|
|
1811
|
+
const localPeerID = (0, _reactRedux.useSelector)(state => {
|
|
1812
|
+
var _state$hmsStates$loca5;
|
|
1813
|
+
return (_state$hmsStates$loca5 = state.hmsStates.localPeer) === null || _state$hmsStates$loca5 === void 0 ? void 0 : _state$hmsStates$loca5.peerID;
|
|
1814
|
+
});
|
|
1815
|
+
const localPeerUserID = (0, _reactRedux.useSelector)(state => {
|
|
1816
|
+
var _state$hmsStates$loca6;
|
|
1817
|
+
return (_state$hmsStates$loca6 = state.hmsStates.localPeer) === null || _state$hmsStates$loca6 === void 0 ? void 0 : _state$hmsStates$loca6.customerUserID;
|
|
1818
|
+
});
|
|
1819
|
+
const _chatState = (0, _reactRedux.useSelector)(state => state.app.chatState);
|
|
1820
|
+
const chatState = (0, _react.useMemo)(() => _chatState || {
|
|
1821
|
+
enabled: true
|
|
1822
|
+
}, [_chatState]);
|
|
1823
|
+
const setChatState = (0, _react.useCallback)(async enabled => {
|
|
1824
|
+
// If instance of HMSSessionStore is available
|
|
1825
|
+
if (hmsSessionStore) {
|
|
1826
|
+
try {
|
|
1827
|
+
const value = {
|
|
1828
|
+
enabled,
|
|
1829
|
+
updatedBy: {
|
|
1830
|
+
peerID: localPeerID ?? null,
|
|
1831
|
+
userID: localPeerUserID ?? null,
|
|
1832
|
+
userName: localPeerName ?? ''
|
|
1833
|
+
},
|
|
1834
|
+
updatedAt: Date.now()
|
|
1835
|
+
};
|
|
1836
|
+
// set `value` on `session` with key 'chatState'
|
|
1837
|
+
const response = await hmsSessionStore.set(value, 'chatState');
|
|
1838
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
1839
|
+
} catch (error) {
|
|
1840
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}, [localPeerName, hmsSessionStore, localPeerUserID, localPeerID]);
|
|
1844
|
+
return {
|
|
1845
|
+
chatState,
|
|
1846
|
+
setChatState
|
|
1847
|
+
};
|
|
1848
|
+
};
|
|
1849
|
+
exports.useHMSChatState = useHMSChatState;
|
|
1850
|
+
const useIsMessagePinned = message => {
|
|
1851
|
+
return (0, _reactRedux.useSelector)(state => message ? state.messages.pinnedMessages.findIndex(pinnedMessage => pinnedMessage.id === message.messageId) >= 0 : false);
|
|
1852
|
+
};
|
|
1853
|
+
exports.useIsMessagePinned = useIsMessagePinned;
|
|
1854
|
+
const useHMSMessagePinningActions = () => {
|
|
1855
|
+
const store = (0, _reactRedux.useStore)();
|
|
1856
|
+
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
1857
|
+
const pinMessage = (0, _react.useCallback)(async message => {
|
|
1858
|
+
let messages = message;
|
|
1859
|
+
if (!Array.isArray(messages)) {
|
|
1860
|
+
messages = [messages];
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
// If instance of HMSSessionStore is available
|
|
1864
|
+
if (hmsSessionStore) {
|
|
1865
|
+
try {
|
|
1866
|
+
var _reduxState$hmsStates4;
|
|
1867
|
+
const reduxState = store.getState();
|
|
1868
|
+
const localPeerName = (_reduxState$hmsStates4 = reduxState.hmsStates.localPeer) === null || _reduxState$hmsStates4 === void 0 ? void 0 : _reduxState$hmsStates4.name;
|
|
1869
|
+
const pinnedMessages = reduxState.messages.pinnedMessages;
|
|
1870
|
+
let payload = messages.map(message => {
|
|
1871
|
+
var _message$sender2, _message$sender3;
|
|
1872
|
+
return {
|
|
1873
|
+
authorId: ((_message$sender2 = message.sender) === null || _message$sender2 === void 0 ? void 0 : _message$sender2.customerUserID) ?? '',
|
|
1874
|
+
id: message.messageId,
|
|
1875
|
+
pinnedBy: localPeerName ?? '',
|
|
1876
|
+
text: `${(_message$sender3 = message.sender) === null || _message$sender3 === void 0 ? void 0 : _message$sender3.name}: ${message.message}`
|
|
1877
|
+
};
|
|
1878
|
+
});
|
|
1879
|
+
let updatedPinnedMessages = [...pinnedMessages, ...payload];
|
|
1880
|
+
if (updatedPinnedMessages.length > 3) {
|
|
1881
|
+
updatedPinnedMessages = updatedPinnedMessages.slice(updatedPinnedMessages.length - 3);
|
|
1882
|
+
}
|
|
1883
|
+
const response = await hmsSessionStore.set(updatedPinnedMessages, 'pinnedMessages');
|
|
1884
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
1885
|
+
} catch (error) {
|
|
1886
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
1887
|
+
return Promise.reject(error);
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
}, [hmsSessionStore]);
|
|
1891
|
+
const unpinMessage = (0, _react.useCallback)(async message => {
|
|
1892
|
+
let messages = message;
|
|
1893
|
+
if (!Array.isArray(messages)) {
|
|
1894
|
+
messages = [messages];
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
// If instance of HMSSessionStore is available
|
|
1898
|
+
if (hmsSessionStore) {
|
|
1899
|
+
try {
|
|
1900
|
+
const pinnedMessages = store.getState().messages.pinnedMessages;
|
|
1901
|
+
const messageIdsToUnpin = messages.map(msg => 'messageId' in msg ? msg.messageId : msg.id);
|
|
1902
|
+
const updatedPinnedMessages = pinnedMessages.filter(pinnedMessage => !messageIdsToUnpin.includes(pinnedMessage.id));
|
|
1903
|
+
const response = await hmsSessionStore.set(updatedPinnedMessages, 'pinnedMessages');
|
|
1904
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
1905
|
+
} catch (error) {
|
|
1906
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
1907
|
+
return Promise.reject(error);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
}, [hmsSessionStore]);
|
|
1911
|
+
return {
|
|
1912
|
+
pinMessage,
|
|
1913
|
+
unpinMessage
|
|
1914
|
+
};
|
|
1915
|
+
};
|
|
1916
|
+
exports.useHMSMessagePinningActions = useHMSMessagePinningActions;
|
|
1917
|
+
const useSetDefaultChatRecipient = () => {
|
|
1918
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
1919
|
+
const localPeerRoleName = (0, _reactRedux.useSelector)(state => {
|
|
1920
|
+
var _state$hmsStates$loca7;
|
|
1921
|
+
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;
|
|
1922
|
+
});
|
|
1923
|
+
const {
|
|
1924
|
+
privateChat,
|
|
1925
|
+
publicChat,
|
|
1926
|
+
roles: whitelistedRoles
|
|
1927
|
+
} = useHMSChatRecipientSelector();
|
|
1928
|
+
(0, _react.useEffect)(() => {
|
|
1929
|
+
if (publicChat) {
|
|
1930
|
+
dispatch({
|
|
1931
|
+
type: 'SET_SENDTO',
|
|
1932
|
+
sendTo: _types.ChatBroadcastFilter
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
// If Role is enabled, Select a role
|
|
1936
|
+
else if (Array.isArray(whitelistedRoles) && whitelistedRoles.length > 0) {
|
|
1937
|
+
const roleObj = whitelistedRoles.length === 1 ? whitelistedRoles[0] : whitelistedRoles.filter(whitelistRole => whitelistRole.name !== localPeerRoleName)[0];
|
|
1938
|
+
if (roleObj) {
|
|
1939
|
+
dispatch({
|
|
1940
|
+
type: 'SET_SENDTO',
|
|
1941
|
+
sendTo: roleObj
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
// If private is enabled, Select None
|
|
1946
|
+
else if (privateChat) {
|
|
1947
|
+
dispatch({
|
|
1948
|
+
type: 'SET_SENDTO',
|
|
1949
|
+
sendTo: null
|
|
1950
|
+
});
|
|
1951
|
+
}
|
|
1952
|
+
}, [privateChat, publicChat, whitelistedRoles, localPeerRoleName, dispatch]);
|
|
1953
|
+
};
|
|
1954
|
+
exports.useSetDefaultChatRecipient = useSetDefaultChatRecipient;
|
|
1692
1955
|
const useAndroidSoftInputAdjustResize = () => {
|
|
1693
1956
|
const currentSoftInputRef = (0, _react.useRef)(null);
|
|
1694
1957
|
(0, _react.useEffect)(() => {
|
|
@@ -1757,4 +2020,88 @@ const useKeyboardState = () => {
|
|
|
1757
2020
|
};
|
|
1758
2021
|
};
|
|
1759
2022
|
exports.useKeyboardState = useKeyboardState;
|
|
2023
|
+
const useAllowPinningMessage = () => {
|
|
2024
|
+
return useHMSChatLayoutConfig(config => (config === null || config === void 0 ? void 0 : config.allow_pinning_messages) ?? false);
|
|
2025
|
+
};
|
|
2026
|
+
exports.useAllowPinningMessage = useAllowPinningMessage;
|
|
2027
|
+
const useIsLocalPeerBlockedFromChat = () => {
|
|
2028
|
+
return (0, _reactRedux.useSelector)(state => {
|
|
2029
|
+
var _state$hmsStates$loca8;
|
|
2030
|
+
const chatPeerBlacklist = state.app.chatPeerBlacklist;
|
|
2031
|
+
const localPeerUserId = (_state$hmsStates$loca8 = state.hmsStates.localPeer) === null || _state$hmsStates$loca8 === void 0 ? void 0 : _state$hmsStates$loca8.customerUserID;
|
|
2032
|
+
return localPeerUserId ? chatPeerBlacklist.includes(localPeerUserId) : false;
|
|
2033
|
+
});
|
|
2034
|
+
};
|
|
2035
|
+
exports.useIsLocalPeerBlockedFromChat = useIsLocalPeerBlockedFromChat;
|
|
2036
|
+
const useIsPeerBlocked = peer => {
|
|
2037
|
+
return (0, _reactRedux.useSelector)(state => {
|
|
2038
|
+
const chatPeerBlacklist = state.app.chatPeerBlacklist;
|
|
2039
|
+
const localPeerUserId = peer === null || peer === void 0 ? void 0 : peer.customerUserID;
|
|
2040
|
+
return localPeerUserId ? chatPeerBlacklist.includes(localPeerUserId) : false;
|
|
2041
|
+
});
|
|
2042
|
+
};
|
|
2043
|
+
exports.useIsPeerBlocked = useIsPeerBlocked;
|
|
2044
|
+
const useBlockPeerActions = () => {
|
|
2045
|
+
const store = (0, _reactRedux.useStore)();
|
|
2046
|
+
const hmsSessionStore = (0, _reactRedux.useSelector)(state => state.user.hmsSessionStore);
|
|
2047
|
+
const {
|
|
2048
|
+
unpinMessage
|
|
2049
|
+
} = useHMSMessagePinningActions();
|
|
2050
|
+
const blockPeer = (0, _react.useCallback)(async peer => {
|
|
2051
|
+
// If instance of HMSSessionStore is available
|
|
2052
|
+
if (hmsSessionStore) {
|
|
2053
|
+
try {
|
|
2054
|
+
const reduxState = store.getState();
|
|
2055
|
+
const chatPeerBlacklist = reduxState.app.chatPeerBlacklist;
|
|
2056
|
+
const pinnedMessages = reduxState.messages.pinnedMessages;
|
|
2057
|
+
if (peer.customerUserID && !chatPeerBlacklist.includes(peer.customerUserID)) {
|
|
2058
|
+
let updatedChatPeerBlacklist = [...chatPeerBlacklist, peer.customerUserID];
|
|
2059
|
+
const response = await hmsSessionStore.set(updatedChatPeerBlacklist, 'chatPeerBlacklist');
|
|
2060
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
2061
|
+
|
|
2062
|
+
// Unpin messages from sent by the peer
|
|
2063
|
+
const msgsToUnpin = pinnedMessages.filter(pinnedMessage => pinnedMessage.authorId === peer.customerUserID);
|
|
2064
|
+
if (msgsToUnpin.length > 0) {
|
|
2065
|
+
await unpinMessage(msgsToUnpin);
|
|
2066
|
+
}
|
|
2067
|
+
return response;
|
|
2068
|
+
}
|
|
2069
|
+
return Promise.reject('Peer is already blocked!');
|
|
2070
|
+
} catch (error) {
|
|
2071
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
2072
|
+
return Promise.reject(error);
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
}, [hmsSessionStore, unpinMessage]);
|
|
2076
|
+
const unblockPeer = (0, _react.useCallback)(async peer => {
|
|
2077
|
+
// If instance of HMSSessionStore is available
|
|
2078
|
+
if (hmsSessionStore) {
|
|
2079
|
+
try {
|
|
2080
|
+
const chatPeerBlacklist = store.getState().app.chatPeerBlacklist;
|
|
2081
|
+
if (peer.customerUserID && chatPeerBlacklist.includes(peer.customerUserID)) {
|
|
2082
|
+
const updatedChatPeerBlacklist = chatPeerBlacklist.filter(peerUserId => peerUserId !== peer.customerUserID);
|
|
2083
|
+
const response = await hmsSessionStore.set(updatedChatPeerBlacklist, 'chatPeerBlacklist');
|
|
2084
|
+
console.log('setSessionMetaData Response -> ', response);
|
|
2085
|
+
return response;
|
|
2086
|
+
}
|
|
2087
|
+
return Promise.reject('Peer is already unblocked!');
|
|
2088
|
+
} catch (error) {
|
|
2089
|
+
console.log('setSessionMetaData Error -> ', error);
|
|
2090
|
+
return Promise.reject(error);
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
}, [hmsSessionStore]);
|
|
2094
|
+
return {
|
|
2095
|
+
blockPeer,
|
|
2096
|
+
unblockPeer
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
2099
|
+
exports.useBlockPeerActions = useBlockPeerActions;
|
|
2100
|
+
const useAllowBlockingPeerFromChat = () => {
|
|
2101
|
+
return useHMSChatLayoutConfig(config => {
|
|
2102
|
+
var _config$real_time_con;
|
|
2103
|
+
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;
|
|
2104
|
+
});
|
|
2105
|
+
};
|
|
2106
|
+
exports.useAllowBlockingPeerFromChat = useAllowBlockingPeerFromChat;
|
|
1760
2107
|
//# sourceMappingURL=hooks-util.js.map
|