@stream-io/video-react-native-sdk 0.0.1-alpha.141
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/CHANGELOG.md +739 -0
- package/LICENSE +219 -0
- package/README.md +19 -0
- package/dist/__tests__/components/ActiveCall.test.d.ts +1 -0
- package/dist/__tests__/components/ActiveCall.test.js +89 -0
- package/dist/__tests__/components/ActiveCall.test.js.map +1 -0
- package/dist/__tests__/components/Avatar.test.d.ts +1 -0
- package/dist/__tests__/components/Avatar.test.js +34 -0
- package/dist/__tests__/components/Avatar.test.js.map +1 -0
- package/dist/__tests__/components/ParticipantView.test.d.ts +1 -0
- package/dist/__tests__/components/ParticipantView.test.js +66 -0
- package/dist/__tests__/components/ParticipantView.test.js.map +1 -0
- package/dist/__tests__/mocks/call.d.ts +2 -0
- package/dist/__tests__/mocks/call.js +21 -0
- package/dist/__tests__/mocks/call.js.map +1 -0
- package/dist/__tests__/mocks/client.d.ts +2 -0
- package/dist/__tests__/mocks/client.js +31 -0
- package/dist/__tests__/mocks/client.js.map +1 -0
- package/dist/__tests__/mocks/participant.d.ts +3 -0
- package/dist/__tests__/mocks/participant.js +25 -0
- package/dist/__tests__/mocks/participant.js.map +1 -0
- package/dist/__tests__/utils/RNTLTools.d.ts +15 -0
- package/dist/__tests__/utils/RNTLTools.js +54 -0
- package/dist/__tests__/utils/RNTLTools.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/jest-setup.d.ts +1 -0
- package/dist/jest-setup.js +34 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/src/components/ActiveCall.d.ts +18 -0
- package/dist/src/components/ActiveCall.js +117 -0
- package/dist/src/components/ActiveCall.js.map +1 -0
- package/dist/src/components/Avatar.d.ts +25 -0
- package/dist/src/components/Avatar.js +55 -0
- package/dist/src/components/Avatar.js.map +1 -0
- package/dist/src/components/CallControlsButton.d.ts +22 -0
- package/dist/src/components/CallControlsButton.js +43 -0
- package/dist/src/components/CallControlsButton.js.map +1 -0
- package/dist/src/components/CallControlsView.d.ts +9 -0
- package/dist/src/components/CallControlsView.js +95 -0
- package/dist/src/components/CallControlsView.js.map +1 -0
- package/dist/src/components/CallParticipantsBadge.d.ts +1 -0
- package/dist/src/components/CallParticipantsBadge.js +48 -0
- package/dist/src/components/CallParticipantsBadge.js.map +1 -0
- package/dist/src/components/CallParticipantsInfoView.d.ts +21 -0
- package/dist/src/components/CallParticipantsInfoView.js +213 -0
- package/dist/src/components/CallParticipantsInfoView.js.map +1 -0
- package/dist/src/components/CallParticipantsList.d.ts +25 -0
- package/dist/src/components/CallParticipantsList.js +124 -0
- package/dist/src/components/CallParticipantsList.js.map +1 -0
- package/dist/src/components/CallParticipantsOptions.d.ts +8 -0
- package/dist/src/components/CallParticipantsOptions.js +189 -0
- package/dist/src/components/CallParticipantsOptions.js.map +1 -0
- package/dist/src/components/CallParticipantsSpotlightView.d.ts +1 -0
- package/dist/src/components/CallParticipantsSpotlightView.js +40 -0
- package/dist/src/components/CallParticipantsSpotlightView.js.map +1 -0
- package/dist/src/components/CallParticipantsView.d.ts +1 -0
- package/dist/src/components/CallParticipantsView.js +31 -0
- package/dist/src/components/CallParticipantsView.js.map +1 -0
- package/dist/src/components/IncomingCallView.d.ts +1 -0
- package/dist/src/components/IncomingCallView.js +98 -0
- package/dist/src/components/IncomingCallView.js.map +1 -0
- package/dist/src/components/LobbyView.d.ts +1 -0
- package/dist/src/components/LobbyView.js +215 -0
- package/dist/src/components/LobbyView.js.map +1 -0
- package/dist/src/components/LocalVideoView.d.ts +34 -0
- package/dist/src/components/LocalVideoView.js +100 -0
- package/dist/src/components/LocalVideoView.js.map +1 -0
- package/dist/src/components/NetworkQualityIndicator.d.ts +8 -0
- package/dist/src/components/NetworkQualityIndicator.js +36 -0
- package/dist/src/components/NetworkQualityIndicator.js.map +1 -0
- package/dist/src/components/OutgoingCallView.d.ts +1 -0
- package/dist/src/components/OutgoingCallView.js +103 -0
- package/dist/src/components/OutgoingCallView.js.map +1 -0
- package/dist/src/components/ParticipantReaction.d.ts +7 -0
- package/dist/src/components/ParticipantReaction.js +45 -0
- package/dist/src/components/ParticipantReaction.js.map +1 -0
- package/dist/src/components/ParticipantView.d.ts +42 -0
- package/dist/src/components/ParticipantView.js +256 -0
- package/dist/src/components/ParticipantView.js.map +1 -0
- package/dist/src/components/ReactionsModal.d.ts +7 -0
- package/dist/src/components/ReactionsModal.js +65 -0
- package/dist/src/components/ReactionsModal.js.map +1 -0
- package/dist/src/components/ToggleAudioButton.d.ts +1 -0
- package/dist/src/components/ToggleAudioButton.js +78 -0
- package/dist/src/components/ToggleAudioButton.js.map +1 -0
- package/dist/src/components/ToggleVideoButton.d.ts +1 -0
- package/dist/src/components/ToggleVideoButton.js +78 -0
- package/dist/src/components/ToggleVideoButton.js.map +1 -0
- package/dist/src/components/UserInfoView.d.ts +13 -0
- package/dist/src/components/UserInfoView.js +82 -0
- package/dist/src/components/UserInfoView.js.map +1 -0
- package/dist/src/components/VideoRenderer.d.ts +65 -0
- package/dist/src/components/VideoRenderer.js +18 -0
- package/dist/src/components/VideoRenderer.js.map +1 -0
- package/dist/src/components/index.d.ts +12 -0
- package/dist/src/components/index.js +29 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/constants/A11yLabels.d.ts +20 -0
- package/dist/src/constants/A11yLabels.js +29 -0
- package/dist/src/constants/A11yLabels.js.map +1 -0
- package/dist/src/constants/index.d.ts +11 -0
- package/dist/src/constants/index.js +30 -0
- package/dist/src/constants/index.js.map +1 -0
- package/dist/src/contexts/StreamVideoContext/createStoreContext.d.ts +14 -0
- package/dist/src/contexts/StreamVideoContext/createStoreContext.js +100 -0
- package/dist/src/contexts/StreamVideoContext/createStoreContext.js.map +1 -0
- package/dist/src/contexts/StreamVideoContext/index.d.ts +30 -0
- package/dist/src/contexts/StreamVideoContext/index.js +18 -0
- package/dist/src/contexts/StreamVideoContext/index.js.map +1 -0
- package/dist/src/contexts/index.d.ts +1 -0
- package/dist/src/contexts/index.js +18 -0
- package/dist/src/contexts/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +10 -0
- package/dist/src/hooks/index.js +27 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/useCallControls.d.ts +14 -0
- package/dist/src/hooks/useCallControls.js +148 -0
- package/dist/src/hooks/useCallControls.js.map +1 -0
- package/dist/src/hooks/useCallCycleEffect.d.ts +8 -0
- package/dist/src/hooks/useCallCycleEffect.js +62 -0
- package/dist/src/hooks/useCallCycleEffect.js.map +1 -0
- package/dist/src/hooks/useCallKeep.d.ts +11 -0
- package/dist/src/hooks/useCallKeep.js +41 -0
- package/dist/src/hooks/useCallKeep.js.map +1 -0
- package/dist/src/hooks/useCreateStreamVideoClient.d.ts +33 -0
- package/dist/src/hooks/useCreateStreamVideoClient.js +40 -0
- package/dist/src/hooks/useCreateStreamVideoClient.js.map +1 -0
- package/dist/src/hooks/useIncallManager.d.ts +13 -0
- package/dist/src/hooks/useIncallManager.js +24 -0
- package/dist/src/hooks/useIncallManager.js.map +1 -0
- package/dist/src/hooks/useLocalVideoStream.d.ts +7 -0
- package/dist/src/hooks/useLocalVideoStream.js +34 -0
- package/dist/src/hooks/useLocalVideoStream.js.map +1 -0
- package/dist/src/hooks/useMutingState.d.ts +12 -0
- package/dist/src/hooks/useMutingState.js +25 -0
- package/dist/src/hooks/useMutingState.js.map +1 -0
- package/dist/src/hooks/usePermissionNotification.d.ts +18 -0
- package/dist/src/hooks/usePermissionNotification.js +33 -0
- package/dist/src/hooks/usePermissionNotification.js.map +1 -0
- package/dist/src/hooks/usePermissionRequest.d.ts +1 -0
- package/dist/src/hooks/usePermissionRequest.js +62 -0
- package/dist/src/hooks/usePermissionRequest.js.map +1 -0
- package/dist/src/hooks/usePublishMediaStreams.d.ts +6 -0
- package/dist/src/hooks/usePublishMediaStreams.js +49 -0
- package/dist/src/hooks/usePublishMediaStreams.js.map +1 -0
- package/dist/src/icons/ArrowRight.d.ts +5 -0
- package/dist/src/icons/ArrowRight.js +9 -0
- package/dist/src/icons/ArrowRight.js.map +1 -0
- package/dist/src/icons/CameraSwitch.d.ts +5 -0
- package/dist/src/icons/CameraSwitch.js +9 -0
- package/dist/src/icons/CameraSwitch.js.map +1 -0
- package/dist/src/icons/Chat.d.ts +5 -0
- package/dist/src/icons/Chat.js +9 -0
- package/dist/src/icons/Chat.js.map +1 -0
- package/dist/src/icons/Cross.d.ts +5 -0
- package/dist/src/icons/Cross.js +9 -0
- package/dist/src/icons/Cross.js.map +1 -0
- package/dist/src/icons/Mic.d.ts +5 -0
- package/dist/src/icons/Mic.js +10 -0
- package/dist/src/icons/Mic.js.map +1 -0
- package/dist/src/icons/MicOff.d.ts +5 -0
- package/dist/src/icons/MicOff.js +9 -0
- package/dist/src/icons/MicOff.js.map +1 -0
- package/dist/src/icons/Participants.d.ts +5 -0
- package/dist/src/icons/Participants.js +9 -0
- package/dist/src/icons/Participants.js.map +1 -0
- package/dist/src/icons/Phone.d.ts +5 -0
- package/dist/src/icons/Phone.js +9 -0
- package/dist/src/icons/Phone.js.map +1 -0
- package/dist/src/icons/PhoneDown.d.ts +5 -0
- package/dist/src/icons/PhoneDown.js +10 -0
- package/dist/src/icons/PhoneDown.js.map +1 -0
- package/dist/src/icons/Pin.d.ts +5 -0
- package/dist/src/icons/Pin.js +9 -0
- package/dist/src/icons/Pin.js.map +1 -0
- package/dist/src/icons/Reaction.d.ts +5 -0
- package/dist/src/icons/Reaction.js +9 -0
- package/dist/src/icons/Reaction.js.map +1 -0
- package/dist/src/icons/ScreenShare.d.ts +5 -0
- package/dist/src/icons/ScreenShare.js +40 -0
- package/dist/src/icons/ScreenShare.js.map +1 -0
- package/dist/src/icons/Settings.d.ts +5 -0
- package/dist/src/icons/Settings.js +34 -0
- package/dist/src/icons/Settings.js.map +1 -0
- package/dist/src/icons/Spotlight.d.ts +5 -0
- package/dist/src/icons/Spotlight.js +9 -0
- package/dist/src/icons/Spotlight.js.map +1 -0
- package/dist/src/icons/ThreeDots.d.ts +5 -0
- package/dist/src/icons/ThreeDots.js +11 -0
- package/dist/src/icons/ThreeDots.js.map +1 -0
- package/dist/src/icons/Video.d.ts +5 -0
- package/dist/src/icons/Video.js +9 -0
- package/dist/src/icons/Video.js.map +1 -0
- package/dist/src/icons/VideoDisabled.d.ts +5 -0
- package/dist/src/icons/VideoDisabled.js +10 -0
- package/dist/src/icons/VideoDisabled.js.map +1 -0
- package/dist/src/icons/VideoOff.d.ts +5 -0
- package/dist/src/icons/VideoOff.js +10 -0
- package/dist/src/icons/VideoOff.js.map +1 -0
- package/dist/src/icons/VideoSlash.d.ts +5 -0
- package/dist/src/icons/VideoSlash.js +10 -0
- package/dist/src/icons/VideoSlash.js.map +1 -0
- package/dist/src/icons/index.d.ts +19 -0
- package/dist/src/icons/index.js +36 -0
- package/dist/src/icons/index.js.map +1 -0
- package/dist/src/providers/MediaDevices.d.ts +9 -0
- package/dist/src/providers/MediaDevices.js +43 -0
- package/dist/src/providers/MediaDevices.js.map +1 -0
- package/dist/src/providers/StreamCall.d.ts +81 -0
- package/dist/src/providers/StreamCall.js +74 -0
- package/dist/src/providers/StreamCall.js.map +1 -0
- package/dist/src/providers/StreamVideo.d.ts +10 -0
- package/dist/src/providers/StreamVideo.js +66 -0
- package/dist/src/providers/StreamVideo.js.map +1 -0
- package/dist/src/providers/index.d.ts +2 -0
- package/dist/src/providers/index.js +19 -0
- package/dist/src/providers/index.js.map +1 -0
- package/dist/src/theme/avatar.d.ts +2 -0
- package/dist/src/theme/avatar.js +11 -0
- package/dist/src/theme/avatar.js.map +1 -0
- package/dist/src/theme/button.d.ts +2 -0
- package/dist/src/theme/button.js +11 -0
- package/dist/src/theme/button.js.map +1 -0
- package/dist/src/theme/colors.d.ts +3 -0
- package/dist/src/theme/colors.js +49 -0
- package/dist/src/theme/colors.js.map +1 -0
- package/dist/src/theme/constants.d.ts +47 -0
- package/dist/src/theme/constants.js +54 -0
- package/dist/src/theme/constants.js.map +1 -0
- package/dist/src/theme/fonts.d.ts +2 -0
- package/dist/src/theme/fonts.js +67 -0
- package/dist/src/theme/fonts.js.map +1 -0
- package/dist/src/theme/icon.d.ts +2 -0
- package/dist/src/theme/icon.js +11 -0
- package/dist/src/theme/icon.js.map +1 -0
- package/dist/src/theme/index.d.ts +2 -0
- package/dist/src/theme/index.js +26 -0
- package/dist/src/theme/index.js.map +1 -0
- package/dist/src/theme/margin.d.ts +2 -0
- package/dist/src/theme/margin.js +11 -0
- package/dist/src/theme/margin.js.map +1 -0
- package/dist/src/theme/padding.d.ts +2 -0
- package/dist/src/theme/padding.js +11 -0
- package/dist/src/theme/padding.js.map +1 -0
- package/dist/src/theme/rounded.d.ts +2 -0
- package/dist/src/theme/rounded.js +11 -0
- package/dist/src/theme/rounded.js.map +1 -0
- package/dist/src/theme/spacing.d.ts +2 -0
- package/dist/src/theme/spacing.js +11 -0
- package/dist/src/theme/spacing.js.map +1 -0
- package/dist/src/theme/types.d.ts +45 -0
- package/dist/src/theme/types.js +3 -0
- package/dist/src/theme/types.js.map +1 -0
- package/dist/src/utils/StreamVideoRN.d.ts +25 -0
- package/dist/src/utils/StreamVideoRN.js +23 -0
- package/dist/src/utils/StreamVideoRN.js.map +1 -0
- package/dist/src/utils/hooks/index.d.ts +3 -0
- package/dist/src/utils/hooks/index.js +20 -0
- package/dist/src/utils/hooks/index.js.map +1 -0
- package/dist/src/utils/hooks/useAppStateListener.d.ts +1 -0
- package/dist/src/utils/hooks/useAppStateListener.js +41 -0
- package/dist/src/utils/hooks/useAppStateListener.js.map +1 -0
- package/dist/src/utils/hooks/useDebouncedValue.d.ts +7 -0
- package/dist/src/utils/hooks/useDebouncedValue.js +22 -0
- package/dist/src/utils/hooks/useDebouncedValue.js.map +1 -0
- package/dist/src/utils/hooks/usePrevious.d.ts +1 -0
- package/dist/src/utils/hooks/usePrevious.js +13 -0
- package/dist/src/utils/hooks/usePrevious.js.map +1 -0
- package/dist/src/utils/index.d.ts +5 -0
- package/dist/src/utils/index.js +53 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/verifyAndroidBluetoothPermissions.d.ts +1 -0
- package/dist/src/utils/verifyAndroidBluetoothPermissions.js +30 -0
- package/dist/src/utils/verifyAndroidBluetoothPermissions.js.map +1 -0
- package/index.ts +22 -0
- package/package.json +70 -0
- package/src/components/ActiveCall.tsx +122 -0
- package/src/components/Avatar.tsx +88 -0
- package/src/components/CallControlsButton.tsx +72 -0
- package/src/components/CallControlsView.tsx +128 -0
- package/src/components/CallParticipantsBadge.tsx +57 -0
- package/src/components/CallParticipantsInfoView.tsx +287 -0
- package/src/components/CallParticipantsList.tsx +172 -0
- package/src/components/CallParticipantsOptions.tsx +248 -0
- package/src/components/CallParticipantsSpotlightView.tsx +53 -0
- package/src/components/CallParticipantsView.tsx +30 -0
- package/src/components/IncomingCallView.tsx +133 -0
- package/src/components/LobbyView.tsx +236 -0
- package/src/components/LocalVideoView.tsx +141 -0
- package/src/components/NetworkQualityIndicator.tsx +72 -0
- package/src/components/OutgoingCallView.tsx +133 -0
- package/src/components/ParticipantReaction.tsx +59 -0
- package/src/components/ParticipantView.tsx +315 -0
- package/src/components/ReactionsModal.tsx +90 -0
- package/src/components/ToggleAudioButton.tsx +103 -0
- package/src/components/ToggleVideoButton.tsx +103 -0
- package/src/components/UserInfoView.tsx +118 -0
- package/src/components/VideoRenderer.tsx +85 -0
- package/src/components/index.ts +12 -0
- package/src/constants/A11yLabels.ts +24 -0
- package/src/constants/index.ts +28 -0
- package/src/contexts/StreamVideoContext/createStoreContext.tsx +117 -0
- package/src/contexts/StreamVideoContext/index.tsx +37 -0
- package/src/contexts/index.ts +1 -0
- package/src/hooks/index.ts +10 -0
- package/src/hooks/useCallControls.tsx +186 -0
- package/src/hooks/useCallCycleEffect.tsx +68 -0
- package/src/hooks/useCallKeep.tsx +51 -0
- package/src/hooks/useCreateStreamVideoClient.tsx +77 -0
- package/src/hooks/useIncallManager.tsx +23 -0
- package/src/hooks/useLocalVideoStream.ts +36 -0
- package/src/hooks/useMutingState.ts +24 -0
- package/src/hooks/usePermissionNotification.tsx +53 -0
- package/src/hooks/usePermissionRequest.tsx +67 -0
- package/src/hooks/usePublishMediaStreams.ts +59 -0
- package/src/icons/ArrowRight.tsx +16 -0
- package/src/icons/CameraSwitch.tsx +14 -0
- package/src/icons/Chat.tsx +14 -0
- package/src/icons/Cross.tsx +14 -0
- package/src/icons/Mic.tsx +18 -0
- package/src/icons/MicOff.tsx +14 -0
- package/src/icons/Participants.tsx +16 -0
- package/src/icons/Phone.tsx +14 -0
- package/src/icons/PhoneDown.tsx +15 -0
- package/src/icons/Pin.tsx +16 -0
- package/src/icons/Reaction.tsx +14 -0
- package/src/icons/ScreenShare.tsx +32 -0
- package/src/icons/Settings.tsx +13 -0
- package/src/icons/Spotlight.tsx +16 -0
- package/src/icons/ThreeDots.tsx +13 -0
- package/src/icons/Video.tsx +14 -0
- package/src/icons/VideoDisabled.tsx +22 -0
- package/src/icons/VideoOff.tsx +20 -0
- package/src/icons/VideoSlash.tsx +15 -0
- package/src/icons/index.tsx +19 -0
- package/src/providers/MediaDevices.tsx +45 -0
- package/src/providers/StreamCall.tsx +136 -0
- package/src/providers/StreamVideo.tsx +50 -0
- package/src/providers/index.ts +2 -0
- package/src/theme/avatar.ts +9 -0
- package/src/theme/button.ts +9 -0
- package/src/theme/colors.ts +49 -0
- package/src/theme/constants.ts +51 -0
- package/src/theme/fonts.ts +65 -0
- package/src/theme/icon.ts +9 -0
- package/src/theme/index.ts +25 -0
- package/src/theme/margin.ts +9 -0
- package/src/theme/padding.ts +9 -0
- package/src/theme/rounded.ts +9 -0
- package/src/theme/spacing.ts +9 -0
- package/src/theme/types.ts +64 -0
- package/src/utils/StreamVideoRN.ts +35 -0
- package/src/utils/hooks/index.ts +3 -0
- package/src/utils/hooks/useAppStateListener.ts +48 -0
- package/src/utils/hooks/useDebouncedValue.ts +21 -0
- package/src/utils/hooks/usePrevious.ts +11 -0
- package/src/utils/index.ts +45 -0
- package/src/utils/verifyAndroidBluetoothPermissions.ts +31 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const ref = {
|
|
2
|
+
palette: {
|
|
3
|
+
green50: '#F6FEF9',
|
|
4
|
+
green100: '#E9F1FF',
|
|
5
|
+
green200: '#A6F2C6',
|
|
6
|
+
green300: '#79ECA9',
|
|
7
|
+
green400: '#4CE68C',
|
|
8
|
+
green500: '#20E070',
|
|
9
|
+
green600: '#19B359',
|
|
10
|
+
green700: '#138643',
|
|
11
|
+
green800: '#0D592C',
|
|
12
|
+
green900: '#062D16',
|
|
13
|
+
green950: '#041B0D',
|
|
14
|
+
blue50: '#F5FAFF',
|
|
15
|
+
blue100: '#E0F0FF',
|
|
16
|
+
blue200: '#CCDFFF',
|
|
17
|
+
blue300: '#669FFF',
|
|
18
|
+
blue400: '#337EFF',
|
|
19
|
+
blue500: '#005FFF',
|
|
20
|
+
blue600: '#004CCC',
|
|
21
|
+
blue700: '#003999',
|
|
22
|
+
blue800: '#002666',
|
|
23
|
+
blue900: '#00163D',
|
|
24
|
+
blue950: '#000D24',
|
|
25
|
+
red50: '#FFF5F5',
|
|
26
|
+
red100: '#FFE5E7',
|
|
27
|
+
red200: '#FF999F',
|
|
28
|
+
red300: '#FF666E',
|
|
29
|
+
red400: '#FF3742',
|
|
30
|
+
red500: '#FF000E',
|
|
31
|
+
red600: '#CC000B',
|
|
32
|
+
red700: '#990008',
|
|
33
|
+
red800: '#660006',
|
|
34
|
+
red900: '#330003',
|
|
35
|
+
red950: '#1F0002',
|
|
36
|
+
grey50: '#FFFFFF',
|
|
37
|
+
grey100: '#F7F7F8',
|
|
38
|
+
grey200: '#E9EAED',
|
|
39
|
+
grey300: '#DBDDE1',
|
|
40
|
+
grey400: '#B4B7BB',
|
|
41
|
+
grey500: '#72767E',
|
|
42
|
+
grey600: '#4C525C',
|
|
43
|
+
grey700: '#272A30',
|
|
44
|
+
grey800: '#1C1E22',
|
|
45
|
+
grey900: '#121416',
|
|
46
|
+
grey950: '#080707',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const { palette } = ref;
|
|
51
|
+
export { palette };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { FontStyle, FontTypes } from './types';
|
|
3
|
+
|
|
4
|
+
export const fonts: Record<FontTypes, FontStyle> = Platform.select({
|
|
5
|
+
ios: {
|
|
6
|
+
heading4: {
|
|
7
|
+
fontSize: 34,
|
|
8
|
+
fontWeight: '400',
|
|
9
|
+
},
|
|
10
|
+
heading5: {
|
|
11
|
+
fontSize: 24,
|
|
12
|
+
fontWeight: '400',
|
|
13
|
+
},
|
|
14
|
+
heading6: {
|
|
15
|
+
fontSize: 20,
|
|
16
|
+
fontWeight: '500',
|
|
17
|
+
},
|
|
18
|
+
subtitle: {
|
|
19
|
+
fontSize: 16,
|
|
20
|
+
fontWeight: '400',
|
|
21
|
+
},
|
|
22
|
+
subtitleBold: {
|
|
23
|
+
fontSize: 16,
|
|
24
|
+
fontWeight: '500',
|
|
25
|
+
},
|
|
26
|
+
bodyBold: {
|
|
27
|
+
fontSize: 16,
|
|
28
|
+
fontWeight: '600',
|
|
29
|
+
},
|
|
30
|
+
caption: {
|
|
31
|
+
fontSize: 10,
|
|
32
|
+
fontWeight: '400',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
default: {
|
|
36
|
+
heading4: {
|
|
37
|
+
fontSize: 34,
|
|
38
|
+
fontWeight: '400',
|
|
39
|
+
},
|
|
40
|
+
heading5: {
|
|
41
|
+
fontSize: 24,
|
|
42
|
+
fontWeight: '400',
|
|
43
|
+
},
|
|
44
|
+
heading6: {
|
|
45
|
+
fontSize: 20,
|
|
46
|
+
fontWeight: '500',
|
|
47
|
+
},
|
|
48
|
+
subtitle: {
|
|
49
|
+
fontSize: 16,
|
|
50
|
+
fontWeight: '400',
|
|
51
|
+
},
|
|
52
|
+
subtitleBold: {
|
|
53
|
+
fontSize: 16,
|
|
54
|
+
fontWeight: '500',
|
|
55
|
+
},
|
|
56
|
+
bodyBold: {
|
|
57
|
+
fontSize: 16,
|
|
58
|
+
fontWeight: '600',
|
|
59
|
+
},
|
|
60
|
+
caption: {
|
|
61
|
+
fontSize: 10,
|
|
62
|
+
fontWeight: '400',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { colors } from './colors';
|
|
2
|
+
import { fonts } from './fonts';
|
|
3
|
+
import { padding } from './padding';
|
|
4
|
+
import { margin } from './margin';
|
|
5
|
+
import { Theme } from './types';
|
|
6
|
+
import { icon } from './icon';
|
|
7
|
+
import { button } from './button';
|
|
8
|
+
import { avatar } from './avatar';
|
|
9
|
+
import { spacing } from './spacing';
|
|
10
|
+
import { rounded } from './rounded';
|
|
11
|
+
|
|
12
|
+
const { light, dark } = colors;
|
|
13
|
+
|
|
14
|
+
export const theme: Theme = {
|
|
15
|
+
light,
|
|
16
|
+
dark,
|
|
17
|
+
fonts,
|
|
18
|
+
padding,
|
|
19
|
+
margin,
|
|
20
|
+
icon,
|
|
21
|
+
button,
|
|
22
|
+
avatar,
|
|
23
|
+
spacing,
|
|
24
|
+
rounded,
|
|
25
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type ColorScheme = {
|
|
4
|
+
primary: string;
|
|
5
|
+
error: string;
|
|
6
|
+
info: string;
|
|
7
|
+
static_black: string;
|
|
8
|
+
static_white: string;
|
|
9
|
+
static_overlay: string;
|
|
10
|
+
static_grey: string;
|
|
11
|
+
disabled: string;
|
|
12
|
+
text_low_emphasis: string;
|
|
13
|
+
text_high_emphasis: string;
|
|
14
|
+
controls_bg: string;
|
|
15
|
+
borders: string;
|
|
16
|
+
overlay: string;
|
|
17
|
+
overlay_dark: string;
|
|
18
|
+
bars: string;
|
|
19
|
+
content_bg: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ColorType = Record<'light' | 'dark', ColorScheme>;
|
|
23
|
+
|
|
24
|
+
export type FontTypes =
|
|
25
|
+
| 'heading4'
|
|
26
|
+
| 'heading5'
|
|
27
|
+
| 'heading6'
|
|
28
|
+
| 'subtitle'
|
|
29
|
+
| 'subtitleBold'
|
|
30
|
+
| 'caption'
|
|
31
|
+
| 'bodyBold';
|
|
32
|
+
export type FontStyle = {
|
|
33
|
+
fontSize: TextStyle['fontSize'];
|
|
34
|
+
fontWeight: TextStyle['fontWeight'];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type FontsScheme = Record<FontTypes, FontStyle>;
|
|
38
|
+
|
|
39
|
+
type SizingTypes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
40
|
+
|
|
41
|
+
export type PaddingScheme = Record<SizingTypes, number>;
|
|
42
|
+
|
|
43
|
+
export type MarginScheme = Record<SizingTypes, number>;
|
|
44
|
+
|
|
45
|
+
export type IconScheme = Record<SizingTypes, StyleProp<ViewStyle>>;
|
|
46
|
+
|
|
47
|
+
export type ButtonScheme = Record<SizingTypes, StyleProp<ViewStyle>>;
|
|
48
|
+
|
|
49
|
+
export type AvatarScheme = Record<SizingTypes, number>;
|
|
50
|
+
|
|
51
|
+
export type SpacingScheme = Record<SizingTypes, number>;
|
|
52
|
+
|
|
53
|
+
export type RoundedScheme = Record<SizingTypes, number>;
|
|
54
|
+
|
|
55
|
+
export type Theme = ColorType & {
|
|
56
|
+
fonts: FontsScheme;
|
|
57
|
+
padding: PaddingScheme;
|
|
58
|
+
margin: MarginScheme;
|
|
59
|
+
icon: IconScheme;
|
|
60
|
+
button: ButtonScheme;
|
|
61
|
+
avatar: AvatarScheme;
|
|
62
|
+
spacing: SpacingScheme;
|
|
63
|
+
rounded: RoundedScheme;
|
|
64
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StreamReaction } from '@stream-io/video-client';
|
|
2
|
+
import { defaultEmojiReactions } from '../constants';
|
|
3
|
+
|
|
4
|
+
type StreamReactionType = StreamReaction & {
|
|
5
|
+
icon: string | JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type StreamVideoConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* Reactions that are to be supported in the app.
|
|
11
|
+
*
|
|
12
|
+
* Note: This is an array of reactions that is rendered in the Reaction list.
|
|
13
|
+
*/
|
|
14
|
+
supportedReactions: StreamReactionType[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const DEFAULT_STREAM_VIDEO_CONFIG = {
|
|
18
|
+
supportedReactions: defaultEmojiReactions,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class StreamVideoRN {
|
|
22
|
+
/**
|
|
23
|
+
* Global config for StreamVideoRN.
|
|
24
|
+
*/
|
|
25
|
+
static config: StreamVideoConfig = DEFAULT_STREAM_VIDEO_CONFIG;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set global config for StreamVideoRN allows you to set wished CDN hosts for resizing images.
|
|
29
|
+
* This function accepts an config object that will be merged with the default config.
|
|
30
|
+
* @example StreamVideoRN.setConfig({ onOpenCallParticipantsInfoView: () => {} });
|
|
31
|
+
*/
|
|
32
|
+
static setConfig(config: Partial<StreamVideoConfig>) {
|
|
33
|
+
this.config = { ...this.config, ...config };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { AppState, AppStateStatus } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export const useAppStateListener = (
|
|
5
|
+
onForeground?: () => void,
|
|
6
|
+
onBackground?: () => void,
|
|
7
|
+
) => {
|
|
8
|
+
const appStateRef = useRef(AppState.currentState);
|
|
9
|
+
const onForegroundRef = useRef(onForeground);
|
|
10
|
+
const onBackgroundRef = useRef(onBackground);
|
|
11
|
+
|
|
12
|
+
// setting refs to avoid passing the functions as dependencies to useEffect
|
|
13
|
+
onForegroundRef.current = onForeground;
|
|
14
|
+
onBackgroundRef.current = onBackground;
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const handleAppStateChange = (nextAppState: AppStateStatus) => {
|
|
18
|
+
const prevAppState = appStateRef.current;
|
|
19
|
+
if (
|
|
20
|
+
prevAppState.match(/inactive|background/) &&
|
|
21
|
+
nextAppState === 'active'
|
|
22
|
+
) {
|
|
23
|
+
onForegroundRef.current?.();
|
|
24
|
+
} else if (
|
|
25
|
+
prevAppState === 'active' &&
|
|
26
|
+
nextAppState.match(/inactive|background/)
|
|
27
|
+
) {
|
|
28
|
+
onBackgroundRef.current?.();
|
|
29
|
+
}
|
|
30
|
+
appStateRef.current = nextAppState;
|
|
31
|
+
};
|
|
32
|
+
const subscription = AppState.addEventListener(
|
|
33
|
+
'change',
|
|
34
|
+
handleAppStateChange,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return () => {
|
|
38
|
+
// Following if-else logic is to support RN >= 0.65 and RN < 0.65 versions.
|
|
39
|
+
// https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#:~:text=EventEmitter%23removeSubscription%20is%20now%20deprecated.%20(cb6cbd12f8%20by%20%40yungsters)
|
|
40
|
+
if (subscription?.remove) {
|
|
41
|
+
subscription.remove();
|
|
42
|
+
} else {
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
AppState.removeEventListener('change', handleAppStateChange);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* this is a custom hook that takes a value and a delay and returns a debounced value
|
|
5
|
+
* @param {T} value
|
|
6
|
+
* @param {number} delay
|
|
7
|
+
* @returns {T}
|
|
8
|
+
*/
|
|
9
|
+
export function useDebouncedValue<T>(value: T, delay: number): T {
|
|
10
|
+
const [debouncedValue, setDebouncedValue] = useState<T>(value);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
14
|
+
|
|
15
|
+
return () => {
|
|
16
|
+
clearTimeout(timer);
|
|
17
|
+
};
|
|
18
|
+
}, [value, delay]);
|
|
19
|
+
|
|
20
|
+
return debouncedValue;
|
|
21
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { theme } from '../theme';
|
|
2
|
+
|
|
3
|
+
// Utility to join strings with commas and 'and'
|
|
4
|
+
export const generateCallTitle = (
|
|
5
|
+
memberUserIds: string[],
|
|
6
|
+
totalMembersToShow?: number,
|
|
7
|
+
) => {
|
|
8
|
+
const supportedAmountOfMemberUserIds = memberUserIds.slice(
|
|
9
|
+
0,
|
|
10
|
+
totalMembersToShow,
|
|
11
|
+
);
|
|
12
|
+
if (
|
|
13
|
+
totalMembersToShow &&
|
|
14
|
+
supportedAmountOfMemberUserIds.length < totalMembersToShow
|
|
15
|
+
) {
|
|
16
|
+
return supportedAmountOfMemberUserIds.join(' and ');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const allMembersExceptLast = supportedAmountOfMemberUserIds.slice(0, -1);
|
|
20
|
+
const lastMember = supportedAmountOfMemberUserIds.slice(-1)[0];
|
|
21
|
+
return `${allMembersExceptLast.join(', ')}, and ${lastMember}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Utility to truncate long strings
|
|
25
|
+
export const generateParticipantTitle = (memberUserId: string) => {
|
|
26
|
+
return memberUserId.length > 15
|
|
27
|
+
? memberUserId.slice(0, 15) + '...'
|
|
28
|
+
: memberUserId;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Utility to get initials of a name
|
|
32
|
+
export const getInitialsOfName = (name: string) => {
|
|
33
|
+
const names = name.split(' ');
|
|
34
|
+
let initials = names[0].substring(0, 1).toUpperCase();
|
|
35
|
+
if (names.length > 1) {
|
|
36
|
+
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
|
37
|
+
}
|
|
38
|
+
return initials;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const muteStatusColor = (status: boolean) => {
|
|
42
|
+
return status ? theme.light.overlay_dark : theme.light.static_white;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export * from './StreamVideoRN';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Platform, PermissionsAndroid } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const verifyAndroidBluetoothPermissions = async () => {
|
|
4
|
+
const shouldCheckForPermissions = Number(Platform.Version) >= 31;
|
|
5
|
+
if (!shouldCheckForPermissions) return true;
|
|
6
|
+
const getCheckPermissionPromise = () => {
|
|
7
|
+
return PermissionsAndroid.check(
|
|
8
|
+
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
const hasPermission = await getCheckPermissionPromise();
|
|
12
|
+
if (!hasPermission) {
|
|
13
|
+
const getRequestPermissionPromise = async () => {
|
|
14
|
+
const result = await PermissionsAndroid.request(
|
|
15
|
+
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
|
|
16
|
+
{
|
|
17
|
+
buttonNegative: 'Deny',
|
|
18
|
+
buttonNeutral: 'Ask Me Later',
|
|
19
|
+
buttonPositive: 'Allow',
|
|
20
|
+
message:
|
|
21
|
+
'Permissions are required to route audio to bluetooth devices.',
|
|
22
|
+
title: 'Bluetooth connect Access',
|
|
23
|
+
},
|
|
24
|
+
).then((status) => status === PermissionsAndroid.RESULTS.GRANTED);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
const granted = await getRequestPermissionPromise();
|
|
28
|
+
return granted;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
};
|