@stream-io/video-react-native-sdk 2.0.0-beta.0 → 2.0.0-beta.2
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 +95 -0
- package/README.md +15 -0
- package/android/build.gradle +7 -1
- package/android/src/main/java/com/streamvideo/reactnative/audio/AudioDeviceManager.kt +110 -58
- package/android/src/main/java/com/streamvideo/reactnative/audio/CommunicationModeKeepAlive.kt +247 -0
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +16 -5
- package/dist/commonjs/components/Call/CallContent/CallContent.js +1 -1
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +78 -7
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +3 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js +3 -2
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +4 -3
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js +10 -10
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/CallLeftIndicator.js +3 -3
- package/dist/commonjs/components/Call/RingingCallContent/CallLeftIndicator.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/CallPreparingIndicator.js +3 -3
- package/dist/commonjs/components/Call/RingingCallContent/CallPreparingIndicator.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +3 -2
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +7 -14
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +3 -2
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamEnded.js +4 -3
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamEnded.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js +3 -3
- package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -1
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js +9 -4
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +4 -3
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +27 -4
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/commonjs/components/utility/ScreenShareOverlay.js +4 -3
- package/dist/commonjs/components/utility/ScreenShareOverlay.js.map +1 -1
- package/dist/commonjs/i18n/Streami18n.js +77 -0
- package/dist/commonjs/i18n/Streami18n.js.map +1 -0
- package/dist/commonjs/i18n/TranslationContext.js +52 -0
- package/dist/commonjs/i18n/TranslationContext.js.map +1 -0
- package/dist/commonjs/i18n/index.js +85 -0
- package/dist/commonjs/i18n/index.js.map +1 -0
- package/dist/commonjs/i18n/keys.js +2 -0
- package/dist/commonjs/i18n/keys.js.map +1 -0
- package/dist/commonjs/i18n/runtimeDefaults.js +24 -0
- package/dist/commonjs/i18n/runtimeDefaults.js.map +1 -0
- package/dist/commonjs/i18n/types.js +6 -0
- package/dist/commonjs/i18n/types.js.map +1 -0
- package/dist/commonjs/i18n/useStreami18n.js +61 -0
- package/dist/commonjs/i18n/useStreami18n.js.map +1 -0
- package/dist/commonjs/index.js +18 -5
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/modules/encryption/EncryptionManager.js +305 -0
- package/dist/commonjs/modules/encryption/EncryptionManager.js.map +1 -0
- package/dist/commonjs/modules/encryption/eventMapping.js +143 -0
- package/dist/commonjs/modules/encryption/eventMapping.js.map +1 -0
- package/dist/commonjs/modules/encryption/index.js +13 -0
- package/dist/commonjs/modules/encryption/index.js.map +1 -0
- package/dist/commonjs/modules/encryption/parity.js +6 -0
- package/dist/commonjs/modules/encryption/parity.js.map +1 -0
- package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js +6 -2
- package/dist/commonjs/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
- package/dist/commonjs/providers/StreamVideo.js +28 -12
- package/dist/commonjs/providers/StreamVideo.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +46 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +29 -4
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/commonjs/utils/internal/iosPipTrack.js +41 -0
- package/dist/commonjs/utils/internal/iosPipTrack.js.map +1 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +6 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/internal/ringingCallLifecycle.js +142 -0
- package/dist/commonjs/utils/internal/ringingCallLifecycle.js.map +1 -0
- package/dist/commonjs/utils/push/internal/utils.js +4 -0
- package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +80 -9
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +3 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/Lobby/JoinCallButton.js +3 -2
- package/dist/module/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +4 -3
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/Lobby/LobbyFooter.js +10 -10
- package/dist/module/components/Call/Lobby/LobbyFooter.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/CallLeftIndicator.js +2 -2
- package/dist/module/components/Call/RingingCallContent/CallLeftIndicator.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/CallPreparingIndicator.js +2 -2
- package/dist/module/components/Call/RingingCallContent/CallPreparingIndicator.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js +3 -2
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +7 -14
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +3 -2
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamPlayer/LivestreamEnded.js +4 -3
- package/dist/module/components/Livestream/LivestreamPlayer/LivestreamEnded.js.map +1 -1
- package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js +2 -2
- package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -1
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js +9 -4
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLobby.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +4 -3
- package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +28 -5
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/module/components/utility/ScreenShareOverlay.js +4 -3
- package/dist/module/components/utility/ScreenShareOverlay.js.map +1 -1
- package/dist/module/i18n/Streami18n.js +73 -0
- package/dist/module/i18n/Streami18n.js.map +1 -0
- package/dist/module/i18n/TranslationContext.js +48 -0
- package/dist/module/i18n/TranslationContext.js.map +1 -0
- package/dist/module/i18n/index.js +20 -0
- package/dist/module/i18n/index.js.map +1 -0
- package/dist/module/i18n/keys.js +2 -0
- package/dist/module/i18n/keys.js.map +1 -0
- package/dist/module/i18n/runtimeDefaults.js +20 -0
- package/dist/module/i18n/runtimeDefaults.js.map +1 -0
- package/dist/module/i18n/types.js +4 -0
- package/dist/module/i18n/types.js.map +1 -0
- package/dist/module/i18n/useStreami18n.js +56 -0
- package/dist/module/i18n/useStreami18n.js.map +1 -0
- package/dist/module/index.js +6 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/modules/encryption/EncryptionManager.js +301 -0
- package/dist/module/modules/encryption/EncryptionManager.js.map +1 -0
- package/dist/module/modules/encryption/eventMapping.js +135 -0
- package/dist/module/modules/encryption/eventMapping.js.map +1 -0
- package/dist/module/modules/encryption/index.js +4 -0
- package/dist/module/modules/encryption/index.js.map +1 -0
- package/dist/module/modules/encryption/parity.js +4 -0
- package/dist/module/modules/encryption/parity.js.map +1 -0
- package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js +6 -2
- package/dist/module/providers/NoiseCancellation/NoiseCancellationProvider.js.map +1 -1
- package/dist/module/providers/StreamVideo.js +29 -14
- package/dist/module/providers/StreamVideo.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +46 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +29 -4
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/module/utils/internal/iosPipTrack.js +35 -0
- package/dist/module/utils/internal/iosPipTrack.js.map +1 -0
- package/dist/module/utils/internal/registerSDKGlobals.js +6 -0
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/internal/ringingCallLifecycle.js +134 -0
- package/dist/module/utils/internal/ringingCallLifecycle.js.map +1 -0
- package/dist/module/utils/push/internal/utils.js +4 -0
- package/dist/module/utils/push/internal/utils.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +12 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/JoinCallButton.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/LobbyFooter.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/LivestreamPlayer/LivestreamEnded.d.ts.map +1 -1
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLobby.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts +11 -0
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts.map +1 -1
- package/dist/typescript/components/utility/ScreenShareOverlay.d.ts.map +1 -1
- package/dist/typescript/i18n/Streami18n.d.ts +61 -0
- package/dist/typescript/i18n/Streami18n.d.ts.map +1 -0
- package/dist/typescript/i18n/TranslationContext.d.ts +31 -0
- package/dist/typescript/i18n/TranslationContext.d.ts.map +1 -0
- package/dist/typescript/i18n/index.d.ts +17 -0
- package/dist/typescript/i18n/index.d.ts.map +1 -0
- package/dist/typescript/i18n/keys.d.ts +38 -0
- package/dist/typescript/i18n/keys.d.ts.map +1 -0
- package/dist/typescript/i18n/runtimeDefaults.d.ts +18 -0
- package/dist/typescript/i18n/runtimeDefaults.d.ts.map +1 -0
- package/dist/typescript/i18n/types.d.ts +46 -0
- package/dist/typescript/i18n/types.d.ts.map +1 -0
- package/dist/typescript/i18n/useStreami18n.d.ts +20 -0
- package/dist/typescript/i18n/useStreami18n.d.ts.map +1 -0
- package/dist/typescript/index.d.ts +2 -1
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/modules/encryption/EncryptionManager.d.ts +190 -0
- package/dist/typescript/modules/encryption/EncryptionManager.d.ts.map +1 -0
- package/dist/typescript/modules/encryption/eventMapping.d.ts +38 -0
- package/dist/typescript/modules/encryption/eventMapping.d.ts.map +1 -0
- package/dist/typescript/modules/encryption/index.d.ts +2 -0
- package/dist/typescript/modules/encryption/index.d.ts.map +1 -0
- package/dist/typescript/modules/encryption/parity.d.ts +55 -0
- package/dist/typescript/modules/encryption/parity.d.ts.map +1 -0
- package/dist/typescript/providers/NoiseCancellation/NoiseCancellationProvider.d.ts.map +1 -1
- package/dist/typescript/providers/StreamVideo.d.ts +17 -4
- package/dist/typescript/providers/StreamVideo.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +33 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +67 -0
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/internal/iosPipTrack.d.ts +9 -0
- package/dist/typescript/utils/internal/iosPipTrack.d.ts.map +1 -0
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/internal/ringingCallLifecycle.d.ts +27 -0
- package/dist/typescript/utils/internal/ringingCallLifecycle.d.ts.map +1 -0
- package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/ios/RTCViewPip.swift +33 -8
- package/ios/RTCViewPipManager.mm +1 -0
- package/package.json +17 -13
- package/src/components/Call/CallContent/CallContent.tsx +1 -1
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +92 -10
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +13 -0
- package/src/components/Call/Lobby/JoinCallButton.tsx +5 -2
- package/src/components/Call/Lobby/Lobby.tsx +6 -3
- package/src/components/Call/Lobby/LobbyFooter.tsx +15 -10
- package/src/components/Call/RingingCallContent/CallLeftIndicator.tsx +2 -2
- package/src/components/Call/RingingCallContent/CallPreparingIndicator.tsx +2 -2
- package/src/components/Call/RingingCallContent/IncomingCall.tsx +2 -2
- package/src/components/Call/RingingCallContent/OutgoingCall.tsx +7 -14
- package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +5 -8
- package/src/components/Livestream/LivestreamPlayer/LivestreamEnded.tsx +11 -3
- package/src/components/Livestream/LivestreamTopView/LiveIndicator.tsx +2 -2
- package/src/components/Livestream/ViewerLivestream/ViewerLobby.tsx +23 -10
- package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +15 -6
- package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +58 -5
- package/src/components/utility/ScreenShareOverlay.tsx +7 -3
- package/src/i18n/Streami18n.ts +71 -0
- package/src/i18n/TranslationContext.tsx +55 -0
- package/src/i18n/index.ts +22 -0
- package/src/i18n/keys.ts +42 -0
- package/src/i18n/runtimeDefaults.ts +17 -0
- package/src/i18n/types.ts +78 -0
- package/src/i18n/useStreami18n.ts +66 -0
- package/src/index.ts +6 -1
- package/src/modules/call-manager/native-module.d.ts +14 -0
- package/src/modules/encryption/EncryptionManager.ts +360 -0
- package/src/modules/encryption/eventMapping.ts +151 -0
- package/src/modules/encryption/index.ts +1 -0
- package/src/modules/encryption/parity.ts +83 -0
- package/src/providers/NoiseCancellation/NoiseCancellationProvider.tsx +8 -4
- package/src/providers/StreamVideo.tsx +39 -28
- package/src/utils/StreamVideoRN/index.ts +51 -1
- package/src/utils/StreamVideoRN/types.ts +68 -0
- package/src/utils/internal/callingx/callingx.ts +37 -2
- package/src/utils/internal/iosPipTrack.ts +39 -0
- package/src/utils/internal/registerSDKGlobals.ts +2 -0
- package/src/utils/internal/ringingCallLifecycle.ts +148 -0
- package/src/utils/push/internal/utils.ts +4 -0
- package/src/version.ts +1 -1
- package/dist/commonjs/translations/en.json +0 -32
- package/dist/commonjs/translations/index.js +0 -12
- package/dist/commonjs/translations/index.js.map +0 -1
- package/dist/module/translations/en.json +0 -32
- package/dist/module/translations/index.js +0 -7
- package/dist/module/translations/index.js.map +0 -1
- package/dist/typescript/translations/index.d.ts +0 -35
- package/dist/typescript/translations/index.d.ts.map +0 -1
- package/src/translations/en.json +0 -32
- package/src/translations/index.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_icons","_contexts","_videoReactBindings","_jsxRuntime","e","__esModule","default","ScreenShareOverlay","call","useCall","t","useI18n","theme","colors","typefaces","variants","iconSizes","screenshareOverlay","useTheme","onStopScreenshareHandler","screenShare","disable","jsxs","View","style","styles","container","backgroundColor","sheetTertiary","children","jsx","Text","text","subtitleBold","color","textPrimary","Pressable","onPress","pressed","button","sheetSecondary","opacity","buttonIcon","height","xs","width","StopScreenShare","size","iconPrimary","buttonText","exports","StyleSheet","create","flex","alignItems","justifyContent","marginTop","padding","borderRadius","flexDirection","marginLeft","includeFontPadding"],"sourceRoot":"../../../../src","sources":["components/utility/ScreenShareOverlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_icons","_contexts","_videoReactBindings","_i18n","_jsxRuntime","e","__esModule","default","ScreenShareOverlay","call","useCall","t","useI18n","theme","colors","typefaces","variants","iconSizes","screenshareOverlay","useTheme","onStopScreenshareHandler","screenShare","disable","jsxs","View","style","styles","container","backgroundColor","sheetTertiary","children","jsx","Text","text","subtitleBold","color","textPrimary","Pressable","onPress","pressed","button","sheetSecondary","opacity","buttonIcon","height","xs","width","StopScreenShare","size","iconPrimary","buttonText","exports","StyleSheet","create","flex","alignItems","justifyContent","marginTop","padding","borderRadius","flexDirection","marginLeft","includeFontPadding"],"sourceRoot":"../../../../src","sources":["components/utility/ScreenShareOverlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAAqC,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMG,kBAAkB,GAAGA,CAAC,CAA0B,CAAC,KAAK;EACjE,MAAMC,IAAI,GAAG,IAAAC,2BAAO,EAAC,CAAC;EACtB,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,aAAO,EAAC,CAAC;EACvB,MAAM;IACJC,KAAK,EAAE;MACLC,MAAM;MACNC,SAAS;MACTC,QAAQ,EAAE;QAAEC;MAAU,CAAC;MACvBC;IACF;EACF,CAAC,GAAG,IAAAC,kBAAQ,EAAC,CAAC;EAEd,MAAMC,wBAAwB,GAAG,MAAAA,CAAA,KAAY;IAC3C;IACA,MAAMX,IAAI,EAAEY,WAAW,CAACC,OAA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AACV,KAAK,EAAErB,MAAM,CAACmC;QAAY,CAAE;MAAC,CAC9D,CAAC,eACP,IAAA7C,WAAA,CAAA2B,GAAA,EAAChC,YAAA,CAAAiC,IAAI;QACHP,KAAK,EAAE,CACLC,MAAM,CAACwB,UAAU,EACjB;UAAEf,KAAK,EAAErB,MAAM,CAACsB;QAAY,CAAC,EAC7BlB,kBAAkB,CAACgC,UAAU,CAC7B;QAAApB,QAAA,EAEDnB,CAAC,CAAC,wCAAwC,EAAE,qBAAqB;MAAC,CAC/D,CAAC;IAAA,CACE,CAAC;EAAA,CACR,CAAC;AAEX,CAAC;AAACwC,OAAA,CAAA3C,kBAAA,GAAAA,kBAAA;AAEF,MAAMkB,MAAM,GAAG0B,uBAAU,CAACC,MAAM,CAAC;EAC/B1B,SAAS,EAAE;IACT2B,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDvB,IAAI,EAAE,CAAC,CAAC;EACRO,MAAM,EAAE;IACNiB,SAAS,EAAE,EAAE;IACbC,OAAO,EAAE,CAAC;IACVC,YAAY,EAAE,CAAC;IACfC,aAAa,EAAE,KAAK;IACpBJ,cAAc,EAAE,QAAQ;IACxBD,UAAU,EAAE;EACd,CAAC;EACDZ,UAAU,EAAE,CAAC,CAAC;EACdO,UAAU,EAAE;IACVW,UAAU,EAAE,CAAC;IACbC,kBAAkB,EAAE;EACtB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Streami18n = void 0;
|
|
7
|
+
var _i18n = require("@stream-io/i18n");
|
|
8
|
+
var _runtimeDefaults = require("./runtimeDefaults");
|
|
9
|
+
/**
|
|
10
|
+
* Options for {@link Streami18n}.
|
|
11
|
+
*
|
|
12
|
+
* Core's options, narrowed to this SDK's catalog so `translationsForLanguage` is key-checked.
|
|
13
|
+
* `runtimeDefaults` is *merged* over the SDK's own rather than replacing it, so supplying it adds to
|
|
14
|
+
* what the SDK ships.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Wrapper around [i18next](https://www.i18next.com/) for this SDK's translations. Pass an instance
|
|
19
|
+
* to `<StreamVideo i18nInstance={…}>` to control the language and the copy.
|
|
20
|
+
*
|
|
21
|
+
* The implementation lives in `@stream-io/i18n`, shared with the web SDK and with Chat. This
|
|
22
|
+
* subclass exists even though {@link runtimeDefaults} is currently empty: its job is to bind the
|
|
23
|
+
* two type parameters, so `new Streami18n()` and its `t` are checked against *this* package's
|
|
24
|
+
* catalog rather than against core's `Record<string, string>` fallback, which would accept any key.
|
|
25
|
+
*
|
|
26
|
+
* ## Overriding some of the English copy
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const i18n = new Streami18n({
|
|
30
|
+
* translationsForLanguage: {
|
|
31
|
+
* 'common.you.label': 'Jij',
|
|
32
|
+
* },
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* ## Adding a language
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import 'dayjs/locale/nl';
|
|
40
|
+
*
|
|
41
|
+
* const i18n = new Streami18n({ language: 'nl' });
|
|
42
|
+
* i18n.registerTranslation('nl', {
|
|
43
|
+
* 'common.join.label': 'Deelnemen',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* No dayjs locale file defines `calendar` — that field belongs to the calendar plugin — so a
|
|
48
|
+
* language whose relative dates must read natively needs the locale import *and* a `calendar`
|
|
49
|
+
* config passed as the third argument.
|
|
50
|
+
*
|
|
51
|
+
* Type your dictionary as `TranslationDictionary` to turn a typo or a key removed in a later major
|
|
52
|
+
* into a compile error. A **partial dictionary is safe**: any key you leave out renders the English
|
|
53
|
+
* copy that ships inline at each call site, never a raw dotted path — so there is no need to
|
|
54
|
+
* translate everything before shipping a language.
|
|
55
|
+
*
|
|
56
|
+
* Hermes ships a partial ICU, so `Intl.PluralRules` has no data for most locales and every count
|
|
57
|
+
* would select the `_other` form. Import `intl-pluralrules` before anything else in your entry
|
|
58
|
+
* file; core warns when it is missing.
|
|
59
|
+
*
|
|
60
|
+
* Reactivity goes through `i18n.state`, a `StateStore`. `setLanguage()` returns nothing — the new
|
|
61
|
+
* `t` is published to that store, which the provider subscribes to.
|
|
62
|
+
*/
|
|
63
|
+
class Streami18n extends _i18n.Streami18n {
|
|
64
|
+
constructor(options = {}) {
|
|
65
|
+
super({
|
|
66
|
+
...options,
|
|
67
|
+
// Merged, not replaced. Spreading `options` over a literal would let an integrator supplying
|
|
68
|
+
// one entry silently drop the SDK's own bundled data, which then renders as raw keys.
|
|
69
|
+
runtimeDefaults: {
|
|
70
|
+
..._runtimeDefaults.runtimeDefaults,
|
|
71
|
+
...options.runtimeDefaults
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.Streami18n = Streami18n;
|
|
77
|
+
//# sourceMappingURL=Streami18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_runtimeDefaults","Streami18n","CoreStreami18n","constructor","options","runtimeDefaults","exports"],"sourceRoot":"../../../src","sources":["i18n/Streami18n.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,UAAU,SAASC,gBAAc,CAAiC;EAC7EC,WAAWA,CAACC,OAA0B,GAAG,CAAC,CAAC,EAAE;IAC3C,KAAK,CAAC;MACJ,GAAGA,OAAO;MACV;MACA;MACAC,eAAe,EAAE;QAAE,GAAGA,gCAAe;QAAE,GAAGD,OAAO,CAACC;MAAgB;IACpE,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAL,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useI18n = exports.TranslationProvider = exports.TranslationContext = void 0;
|
|
7
|
+
var _i18n = require("@stream-io/i18n");
|
|
8
|
+
var _react = require("@stream-io/i18n/react");
|
|
9
|
+
/**
|
|
10
|
+
* The `t` in force before i18next has initialized, and the context's default.
|
|
11
|
+
*
|
|
12
|
+
* Core's factory, instantiated against this SDK's catalog so it is typed exactly like the real `t`.
|
|
13
|
+
* It honours the inline `defaultValue` each prose call site passes, which is what stops raw dotted
|
|
14
|
+
* keys flashing on the first frame.
|
|
15
|
+
*/
|
|
16
|
+
const defaultTranslatorFunction = (0, _i18n.createDefaultTranslatorFunction)();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Built from the shared factory in `@stream-io/i18n/react`.
|
|
20
|
+
*
|
|
21
|
+
* A **default value** is supplied rather than making the hook throw, and that is deliberate: it
|
|
22
|
+
* matches what `useI18n` did before this module existed, so a component rendered outside the
|
|
23
|
+
* provider keeps showing correct English instead of crashing. Chat's React Native SDK throws
|
|
24
|
+
* instead; hence core exposes this as a factory rather than one exported context.
|
|
25
|
+
*/
|
|
26
|
+
const {
|
|
27
|
+
TranslationContext,
|
|
28
|
+
TranslationProvider,
|
|
29
|
+
useTranslationContext
|
|
30
|
+
} = (0, _react.createTranslationContext)({
|
|
31
|
+
defaultValue: {
|
|
32
|
+
t: defaultTranslatorFunction,
|
|
33
|
+
tDateTimeParser: _i18n.defaultDateTimeParser
|
|
34
|
+
},
|
|
35
|
+
displayName: 'StreamVideoTranslationContext'
|
|
36
|
+
});
|
|
37
|
+
exports.TranslationProvider = TranslationProvider;
|
|
38
|
+
exports.TranslationContext = TranslationContext;
|
|
39
|
+
/**
|
|
40
|
+
* Reads `t` and `tDateTimeParser` from the closest provider.
|
|
41
|
+
*
|
|
42
|
+
* Works outside a provider too — the default translator renders each call site's inline English.
|
|
43
|
+
*
|
|
44
|
+
* The name is `useI18n` rather than core's `useTranslationContext` because ~500 call sites across
|
|
45
|
+
* the video SDKs already import it; renaming them is churn with no payoff.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* const { t } = useI18n();
|
|
49
|
+
* const label = t('common.join.label', 'Join');
|
|
50
|
+
*/
|
|
51
|
+
const useI18n = exports.useI18n = useTranslationContext;
|
|
52
|
+
//# sourceMappingURL=TranslationContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_react","defaultTranslatorFunction","createDefaultTranslatorFunction","TranslationContext","TranslationProvider","useTranslationContext","createTranslationContext","defaultValue","t","tDateTimeParser","defaultDateTimeParser","displayName","exports","useI18n"],"sourceRoot":"../../../src","sources":["i18n/TranslationContext.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,yBAAyB,GAC7B,IAAAC,qCAA+B,EAAC,CAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;EAAEC,kBAAkB;EAAEC,mBAAmB;EAAEC;AAAsB,CAAC,GACtE,IAAAC,+BAAwB,EAA0B;EAChDC,YAAY,EAAE;IACZC,CAAC,EAAEP,yBAAyB;IAC5BQ,eAAe,EAAEC;EACnB,CAAC;EACDC,WAAW,EAAE;AACf,CAAC,CAAC;AAACC,OAAA,CAAAR,mBAAA,GAAAA,mBAAA;AAAAQ,OAAA,CAAAT,kBAAA,GAAAA,kBAAA;AAIL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,OAAO,GAAAD,OAAA,CAAAC,OAAA,GAAGR,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
asDynamicKey: true,
|
|
8
|
+
defaultDateTimeParser: true,
|
|
9
|
+
getDateString: true,
|
|
10
|
+
predefinedFormatters: true
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "asDynamicKey", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _i18n.asDynamicKey;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "defaultDateTimeParser", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _i18n.defaultDateTimeParser;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "getDateString", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _i18n.getDateString;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "predefinedFormatters", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _i18n.predefinedFormatters;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var _Streami18n = require("./Streami18n");
|
|
37
|
+
Object.keys(_Streami18n).forEach(function (key) {
|
|
38
|
+
if (key === "default" || key === "__esModule") return;
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
40
|
+
if (key in exports && exports[key] === _Streami18n[key]) return;
|
|
41
|
+
Object.defineProperty(exports, key, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _Streami18n[key];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var _TranslationContext = require("./TranslationContext");
|
|
49
|
+
Object.keys(_TranslationContext).forEach(function (key) {
|
|
50
|
+
if (key === "default" || key === "__esModule") return;
|
|
51
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
52
|
+
if (key in exports && exports[key] === _TranslationContext[key]) return;
|
|
53
|
+
Object.defineProperty(exports, key, {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () {
|
|
56
|
+
return _TranslationContext[key];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
var _types = require("./types");
|
|
61
|
+
Object.keys(_types).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _types[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _useStreami18n = require("./useStreami18n");
|
|
73
|
+
Object.keys(_useStreami18n).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
76
|
+
if (key in exports && exports[key] === _useStreami18n[key]) return;
|
|
77
|
+
Object.defineProperty(exports, key, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return _useStreami18n[key];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
var _i18n = require("@stream-io/i18n");
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_Streami18n","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_TranslationContext","_types","_useStreami18n","_i18n"],"sourceRoot":"../../../src","sources":["i18n/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,mBAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,mBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,mBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,mBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,MAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,MAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,MAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,cAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,cAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,cAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,cAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AAaA,IAAAY,KAAA,GAAAhB,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["i18n/keys.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.runtimeDefaults = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* The SDK's bundled translation data: the keys that cannot carry an inline `defaultValue` at their
|
|
9
|
+
* call site. `Streami18n` layers it under *every* language, so a partial dictionary never knocks
|
|
10
|
+
* these out.
|
|
11
|
+
*
|
|
12
|
+
* Empty, and that is the intended steady state. The four lookups this SDK resolved from a runtime
|
|
13
|
+
* value — the only candidates for an entry here — are written as `switch` statements over literal
|
|
14
|
+
* `t()` calls instead, so every branch carries its own English copy inline and the codegen reads it
|
|
15
|
+
* straight off the call site. Nothing is left without a default. `timestamp.*` / `duration.*`
|
|
16
|
+
* formatter expressions would also live here; this SDK has none yet.
|
|
17
|
+
*
|
|
18
|
+
* Adding an entry later needs no wiring. `Streami18n` already spreads this into the core options and
|
|
19
|
+
* `scripts/generate-i18n-keys.mts` already reads this path, so a new key reaches `keys.ts` on the
|
|
20
|
+
* next `build-translations` run — where a key nothing references, or one that shadows an inline
|
|
21
|
+
* default, fails a codegen guard.
|
|
22
|
+
*/
|
|
23
|
+
const runtimeDefaults = exports.runtimeDefaults = {};
|
|
24
|
+
//# sourceMappingURL=runtimeDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["runtimeDefaults","exports"],"sourceRoot":"../../../src","sources":["i18n/runtimeDefaults.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["i18n/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useStreami18n = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@stream-io/i18n/react");
|
|
9
|
+
var _Streami18n = require("./Streami18n");
|
|
10
|
+
/**
|
|
11
|
+
* Resolves the translation context value: creates or adopts a {@link Streami18n} instance,
|
|
12
|
+
* registers the supplied dictionaries, initializes it and keeps `t` fresh across language changes.
|
|
13
|
+
*
|
|
14
|
+
* `init()` and the store subscription belong to `useStreami18nState` in `@stream-io/i18n/react`,
|
|
15
|
+
* shared with the web SDK.
|
|
16
|
+
*/
|
|
17
|
+
const useStreami18n = ({
|
|
18
|
+
i18nInstance,
|
|
19
|
+
language,
|
|
20
|
+
translations
|
|
21
|
+
}) => {
|
|
22
|
+
// Lazy `useState`, not `useMemo`: `new Streami18n()` is a real allocation with identity that must
|
|
23
|
+
// survive a re-render, and this repo lints `react-hooks/purity` as an error — `useMemo` is a
|
|
24
|
+
// cache React is free to drop, so constructing there is a purity violation. A later change to
|
|
25
|
+
// `i18nInstance` is ignored on purpose; swapping the instance mid-tree is not a supported move.
|
|
26
|
+
const [i18n] = (0, _react.useState)(() => {
|
|
27
|
+
const instance = i18nInstance ?? new _Streami18n.Streami18n({
|
|
28
|
+
language
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Registered here rather than in an effect. `useStreami18nState` calls `init()` from its own
|
|
32
|
+
// effect, which runs *before* any effect declared below it in this hook — so a dictionary
|
|
33
|
+
// registered in an effect would arrive after i18next was already initialized, and the first
|
|
34
|
+
// `init()` would warn that the language has no dictionary.
|
|
35
|
+
if (translations) {
|
|
36
|
+
for (const [code, dictionary] of Object.entries(translations)) {
|
|
37
|
+
instance.registerTranslation(code, dictionary);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return instance;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// No `onInitError` handler: core already logs a warning and leaves the instance usable, with `t`
|
|
44
|
+
// still rendering each call site's inline English. Pass one only to surface init failures
|
|
45
|
+
// somewhere other than the console.
|
|
46
|
+
const translators = (0, _react2.useStreami18nState)(i18n);
|
|
47
|
+
(0, _react.useEffect)(() => {
|
|
48
|
+
// Guarded on the current value: `setLanguage` re-runs the formatter factories and a full
|
|
49
|
+
// i18next `changeLanguage`, and the first render already constructed the instance with
|
|
50
|
+
// `language`. Undefined means "leave whatever the instance was configured with".
|
|
51
|
+
if (!language || i18n.currentLanguage === language) return;
|
|
52
|
+
i18n.setLanguage(language);
|
|
53
|
+
}, [i18n, language]);
|
|
54
|
+
|
|
55
|
+
// Returned as-is: `useStreami18nState` already caches this object and only produces a new one
|
|
56
|
+
// when `t` or `tDateTimeParser` actually changes, so wrapping it in a `useMemo` would add a
|
|
57
|
+
// second cache over a stable value.
|
|
58
|
+
return translators;
|
|
59
|
+
};
|
|
60
|
+
exports.useStreami18n = useStreami18n;
|
|
61
|
+
//# sourceMappingURL=useStreami18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_react2","_Streami18n","useStreami18n","i18nInstance","language","translations","i18n","useState","instance","Streami18n","code","dictionary","Object","entries","registerTranslation","translators","useStreami18nState","useEffect","currentLanguage","setLanguage","exports"],"sourceRoot":"../../../src","sources":["i18n/useStreami18n.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,aAAa,GAAGA,CAAC;EAC5BC,YAAY;EACZC,QAAQ;EACRC;AACmB,CAAC,KAA8B;EAClD;EACA;EACA;EACA;EACA,MAAM,CAACC,IAAI,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAM;IAC5B,MAAMC,QAAQ,GAAGL,YAAY,IAAI,IAAIM,sBAAU,CAAC;MAAEL;IAAS,CAAC,CAAC;;IAE7D;IACA;IACA;IACA;IACA,IAAIC,YAAY,EAAE;MAChB,KAAK,MAAM,CAACK,IAAI,EAAEC,UAAU,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACR,YAAY,CAAC,EAAE;QAC7DG,QAAQ,CAACM,mBAAmB,CAACJ,IAAI,EAAEC,UAAU,CAAC;MAChD;IACF;IAEA,OAAOH,QAAQ;EACjB,CAAC,CAAC;;EAEF;EACA;EACA;EACA,MAAMO,WAAW,GAAG,IAAAC,0BAAkB,EAACV,IAAI,CAAC;EAE5C,IAAAW,gBAAS,EAAC,MAAM;IACd;IACA;IACA;IACA,IAAI,CAACb,QAAQ,IAAIE,IAAI,CAACY,eAAe,KAAKd,QAAQ,EAAE;IACpDE,IAAI,CAACa,WAAW,CAACf,QAAQ,CAAC;EAC5B,CAAC,EAAE,CAACE,IAAI,EAAEF,QAAQ,CAAC,CAAC;;EAEpB;EACA;EACA;EACA,OAAOW,WAAW;AACpB,CAAC;AAACK,OAAA,CAAAlB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -5,8 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
StreamVideo: true,
|
|
8
|
-
StreamCall: true
|
|
8
|
+
StreamCall: true,
|
|
9
|
+
EncryptionManager: true
|
|
9
10
|
};
|
|
11
|
+
Object.defineProperty(exports, "EncryptionManager", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _encryption.EncryptionManager;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
10
17
|
Object.defineProperty(exports, "StreamCall", {
|
|
11
18
|
enumerable: true,
|
|
12
19
|
get: function () {
|
|
@@ -112,15 +119,15 @@ Object.keys(_utils).forEach(function (key) {
|
|
|
112
119
|
}
|
|
113
120
|
});
|
|
114
121
|
});
|
|
115
|
-
var
|
|
116
|
-
Object.keys(
|
|
122
|
+
var _i18n = require("./i18n");
|
|
123
|
+
Object.keys(_i18n).forEach(function (key) {
|
|
117
124
|
if (key === "default" || key === "__esModule") return;
|
|
118
125
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
119
|
-
if (key in exports && exports[key] ===
|
|
126
|
+
if (key in exports && exports[key] === _i18n[key]) return;
|
|
120
127
|
Object.defineProperty(exports, key, {
|
|
121
128
|
enumerable: true,
|
|
122
129
|
get: function () {
|
|
123
|
-
return
|
|
130
|
+
return _i18n[key];
|
|
124
131
|
}
|
|
125
132
|
});
|
|
126
133
|
});
|
|
@@ -138,6 +145,7 @@ Object.keys(_callManager).forEach(function (key) {
|
|
|
138
145
|
});
|
|
139
146
|
var _StreamVideo = require("./providers/StreamVideo");
|
|
140
147
|
var _StreamCall = require("./providers/StreamCall");
|
|
148
|
+
var _encryption = require("./modules/encryption");
|
|
141
149
|
var _NoiseCancellation = require("./providers/NoiseCancellation");
|
|
142
150
|
Object.keys(_NoiseCancellation).forEach(function (key) {
|
|
143
151
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -171,5 +179,10 @@ _Logger.default.enable(`${_Logger.default.ROOT_PREFIX}:(WARN|ERROR)`);
|
|
|
171
179
|
// Overriding 'StreamVideo' and 'StreamCall' from '@stream-io/video-react-bindings'
|
|
172
180
|
// Explicitly re-exporting to resolve ambiguity.
|
|
173
181
|
|
|
182
|
+
// Overriding 'EncryptionManager' from '@stream-io/video-client' with the React
|
|
183
|
+
// Native implementation, which is backed by the native WebRTC transform. React
|
|
184
|
+
// Native Web is not supported: `isSupported()` returns false there rather than
|
|
185
|
+
// falling back to the web manager.
|
|
186
|
+
|
|
174
187
|
(0, _setClientDetails.setClientDetails)();
|
|
175
188
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_setClientDetails","require","_reactNativeWebrtc","_Logger","_interopRequireDefault","_reactNative","_registerSDKGlobals","_videoClient","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_videoReactBindings","_components","_contexts","_hooks","_theme","_utils","
|
|
1
|
+
{"version":3,"names":["_setClientDetails","require","_reactNativeWebrtc","_Logger","_interopRequireDefault","_reactNative","_registerSDKGlobals","_videoClient","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_videoReactBindings","_components","_contexts","_hooks","_theme","_utils","_i18n","_callManager","_StreamVideo","_StreamCall","_encryption","_NoiseCancellation","e","__esModule","default","Platform","OS","registerGlobals","registerSDKGlobals","Logger","enable","ROOT_PREFIX","setClientDetails"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEAA,OAAA;AAEAA,OAAA;AAEAA,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACAA,OAAA;AAaA,IAAAM,YAAA,GAAAN,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAF,YAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,YAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,YAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,mBAAA,GAAAnB,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAW,mBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,mBAAA,CAAAT,GAAA;EAAAH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