@stream-io/video-react-sdk 1.43.2 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -19
- package/dist/css/embedded.css +2592 -1498
- package/dist/css/embedded.css.map +1 -1
- package/dist/css/styles.css +2388 -1222
- package/dist/css/styles.css.map +1 -1
- package/dist/embedded.cjs.js +535 -476
- package/dist/embedded.cjs.js.map +1 -1
- package/dist/esm/index.js +10 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/components/Avatar/Avatar.js +13 -5
- package/dist/esm/src/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/src/components/Badge/Badge.js +21 -0
- package/dist/esm/src/components/Badge/Badge.js.map +1 -0
- package/dist/esm/src/components/Button/Button.js +10 -0
- package/dist/esm/src/components/Button/Button.js.map +1 -0
- package/dist/esm/src/components/Button/CompositeButton.js +10 -17
- package/dist/esm/src/components/Button/CompositeButton.js.map +1 -1
- package/dist/esm/src/components/Button/IconButton.js +3 -9
- package/dist/esm/src/components/Button/IconButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/AcceptCallButton.js +3 -2
- package/dist/esm/src/components/CallControls/AcceptCallButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/CallControls.js +3 -0
- package/dist/esm/src/components/CallControls/CallControls.js.map +1 -1
- package/dist/esm/src/components/CallControls/CancelCallButton.js +11 -6
- package/dist/esm/src/components/CallControls/CancelCallButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/ReactionsButton.js +7 -3
- package/dist/esm/src/components/CallControls/ReactionsButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/RecordCallButton.js +17 -11
- package/dist/esm/src/components/CallControls/RecordCallButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/ScreenShareButton.js +11 -4
- package/dist/esm/src/components/CallControls/ScreenShareButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/ToggleAudioButton.js +28 -17
- package/dist/esm/src/components/CallControls/ToggleAudioButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/ToggleAudioOutputButton.js +9 -4
- package/dist/esm/src/components/CallControls/ToggleAudioOutputButton.js.map +1 -1
- package/dist/esm/src/components/CallControls/ToggleVideoButton.js +32 -23
- package/dist/esm/src/components/CallControls/ToggleVideoButton.js.map +1 -1
- package/dist/esm/src/components/CallParticipantsList/BlockedUserListing.js +3 -3
- package/dist/esm/src/components/CallParticipantsList/BlockedUserListing.js.map +1 -1
- package/dist/esm/src/components/CallParticipantsList/CallParticipantListHeader.js +8 -3
- package/dist/esm/src/components/CallParticipantsList/CallParticipantListHeader.js.map +1 -1
- package/dist/esm/src/components/CallParticipantsList/CallParticipantListingItem.js +20 -7
- package/dist/esm/src/components/CallParticipantsList/CallParticipantListingItem.js.map +1 -1
- package/dist/esm/src/components/CallParticipantsList/CallParticipantsList.js +8 -5
- package/dist/esm/src/components/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/esm/src/components/CallParticipantsList/EmptyParticipantSearchList.js +5 -2
- package/dist/esm/src/components/CallParticipantsList/EmptyParticipantSearchList.js.map +1 -1
- package/dist/esm/src/components/CallRecordingList/CallRecordingListHeader.js +7 -3
- package/dist/esm/src/components/CallRecordingList/CallRecordingListHeader.js.map +1 -1
- package/dist/esm/src/components/DeviceSettings/DeviceAudioPreviewItem.js +1 -1
- package/dist/esm/src/components/DeviceSettings/DeviceAudioPreviewItem.js.map +1 -1
- package/dist/esm/src/components/DeviceSettings/DeviceSelector.js +1 -1
- package/dist/esm/src/components/DeviceSettings/DeviceSelector.js.map +1 -1
- package/dist/esm/src/components/DeviceSettings/DeviceSelectorAudio.js +2 -2
- package/dist/esm/src/components/DeviceSettings/DeviceSelectorAudio.js.map +1 -1
- package/dist/esm/src/components/DeviceSettings/DeviceSettings.js +8 -5
- package/dist/esm/src/components/DeviceSettings/DeviceSettings.js.map +1 -1
- package/dist/esm/src/components/DeviceSettings/SpeakerTest.js +10 -4
- package/dist/esm/src/components/DeviceSettings/SpeakerTest.js.map +1 -1
- package/dist/esm/src/components/DropdownSelect/DropdownSelect.js +1 -1
- package/dist/esm/src/components/DropdownSelect/DropdownSelect.js.map +1 -1
- package/dist/esm/src/components/Menu/GenericMenu.js +2 -1
- package/dist/esm/src/components/Menu/GenericMenu.js.map +1 -1
- package/dist/esm/src/components/Menu/MenuToggle.js +3 -0
- package/dist/esm/src/components/Menu/MenuToggle.js.map +1 -1
- package/dist/esm/src/components/Notification/MicCaptureErrorNotification.js +6 -3
- package/dist/esm/src/components/Notification/MicCaptureErrorNotification.js.map +1 -1
- package/dist/esm/src/components/Notification/Notification.js +12 -3
- package/dist/esm/src/components/Notification/Notification.js.map +1 -1
- package/dist/esm/src/components/Notification/PermissionNotification.js +2 -2
- package/dist/esm/src/components/Notification/PermissionNotification.js.map +1 -1
- package/dist/esm/src/components/Notification/RecordingInProgressNotification.js +7 -3
- package/dist/esm/src/components/Notification/RecordingInProgressNotification.js.map +1 -1
- package/dist/esm/src/components/Notification/SpeakingWhileMutedNotification.js +7 -2
- package/dist/esm/src/components/Notification/SpeakingWhileMutedNotification.js.map +1 -1
- package/dist/esm/src/components/Permissions/PermissionRequests.js +13 -12
- package/dist/esm/src/components/Permissions/PermissionRequests.js.map +1 -1
- package/dist/esm/src/components/RingingCall/RingingCall.js +38 -14
- package/dist/esm/src/components/RingingCall/RingingCall.js.map +1 -1
- package/dist/esm/src/components/RingingCall/RingingCallControls.js +7 -3
- package/dist/esm/src/components/RingingCall/RingingCallControls.js.map +1 -1
- package/dist/esm/src/components/Search/SearchInput.js +1 -1
- package/dist/esm/src/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/src/components/StreamTheme/StreamTheme.js +2 -2
- package/dist/esm/src/components/StreamTheme/StreamTheme.js.map +1 -1
- package/dist/esm/src/components/Tooltip/Tooltip.js +8 -8
- package/dist/esm/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/src/components/VideoPreview/VideoPreview.js +36 -5
- package/dist/esm/src/components/VideoPreview/VideoPreview.js.map +1 -1
- package/dist/esm/src/core/components/CallLayout/LivestreamLayout.js +38 -12
- package/dist/esm/src/core/components/CallLayout/LivestreamLayout.js.map +1 -1
- package/dist/esm/src/core/components/CallLayout/PaginatedGridLayout.js +9 -5
- package/dist/esm/src/core/components/CallLayout/PaginatedGridLayout.js.map +1 -1
- package/dist/esm/src/core/components/CallLayout/PipLayout/Grid.js +9 -6
- package/dist/esm/src/core/components/CallLayout/PipLayout/Grid.js.map +1 -1
- package/dist/esm/src/core/components/CallLayout/PipLayout/Pip.js +9 -6
- package/dist/esm/src/core/components/CallLayout/PipLayout/Pip.js.map +1 -1
- package/dist/esm/src/core/components/CallLayout/SpeakerLayout.js +11 -6
- package/dist/esm/src/core/components/CallLayout/SpeakerLayout.js.map +1 -1
- package/dist/esm/src/core/components/ParticipantView/ConnectionQualityIndicator.js +25 -0
- package/dist/esm/src/core/components/ParticipantView/ConnectionQualityIndicator.js.map +1 -0
- package/dist/esm/src/core/components/ParticipantView/DefaultParticipantViewUI.js +17 -13
- package/dist/esm/src/core/components/ParticipantView/DefaultParticipantViewUI.js.map +1 -1
- package/dist/esm/src/core/components/ParticipantView/ParticipantActionsContextMenu.js +13 -8
- package/dist/esm/src/core/components/ParticipantView/ParticipantActionsContextMenu.js.map +1 -1
- package/dist/esm/src/core/components/StreamVideo/StreamVideo.js +24 -3
- package/dist/esm/src/core/components/StreamVideo/StreamVideo.js.map +1 -1
- package/dist/esm/src/core/components/Video/BaseVideoPlaceholder.js +3 -13
- package/dist/esm/src/core/components/Video/BaseVideoPlaceholder.js.map +1 -1
- package/dist/esm/src/core/components/Video/DefaultPictureInPicturePlaceholder.js +4 -2
- package/dist/esm/src/core/components/Video/DefaultPictureInPicturePlaceholder.js.map +1 -1
- package/dist/esm/src/core/components/Video/DefaultVideoPlaceholder.js +4 -2
- package/dist/esm/src/core/components/Video/DefaultVideoPlaceholder.js.map +1 -1
- package/dist/esm/src/embedded/EmbeddedClientProvider.js +7 -4
- package/dist/esm/src/embedded/EmbeddedClientProvider.js.map +1 -1
- package/dist/esm/src/embedded/call/CallControls.js +10 -6
- package/dist/esm/src/embedded/call/CallControls.js.map +1 -1
- package/dist/esm/src/embedded/call/CallHeader.js +10 -7
- package/dist/esm/src/embedded/call/CallHeader.js.map +1 -1
- package/dist/esm/src/embedded/call/CallLayout.js +8 -5
- package/dist/esm/src/embedded/call/CallLayout.js.map +1 -1
- package/dist/esm/src/embedded/call/CallStateRouter.js +7 -4
- package/dist/esm/src/embedded/call/CallStateRouter.js.map +1 -1
- package/dist/esm/src/embedded/hooks/useLayout.js +7 -4
- package/dist/esm/src/embedded/hooks/useLayout.js.map +1 -1
- package/dist/esm/src/embedded/livestream/host/HostLayout.js +12 -7
- package/dist/esm/src/embedded/livestream/host/HostLayout.js.map +1 -1
- package/dist/esm/src/embedded/livestream/host/HostStateRouter.js +12 -7
- package/dist/esm/src/embedded/livestream/host/HostStateRouter.js.map +1 -1
- package/dist/esm/src/embedded/livestream/viewer/ViewerLayout.js +9 -6
- package/dist/esm/src/embedded/livestream/viewer/ViewerLayout.js.map +1 -1
- package/dist/esm/src/embedded/livestream/viewer/ViewerLobby.js +12 -9
- package/dist/esm/src/embedded/livestream/viewer/ViewerLobby.js.map +1 -1
- package/dist/esm/src/embedded/livestream/viewer/ViewerStateRouter.js +7 -4
- package/dist/esm/src/embedded/livestream/viewer/ViewerStateRouter.js.map +1 -1
- package/dist/esm/src/embedded/shared/BlurToggleButton/BlurToggleButton.js +13 -9
- package/dist/esm/src/embedded/shared/BlurToggleButton/BlurToggleButton.js.map +1 -1
- package/dist/esm/src/embedded/shared/CallDuration/CallDuration.js +40 -0
- package/dist/esm/src/embedded/shared/CallDuration/CallDuration.js.map +1 -0
- package/dist/esm/src/embedded/shared/CallFeedback/CallEndedScreen.js +8 -6
- package/dist/esm/src/embedded/shared/CallFeedback/CallEndedScreen.js.map +1 -1
- package/dist/esm/src/embedded/shared/CallFeedback/RatingScreen.js +26 -2
- package/dist/esm/src/embedded/shared/CallFeedback/RatingScreen.js.map +1 -1
- package/dist/esm/src/embedded/shared/CallFeedback/StarRating.js +12 -6
- package/dist/esm/src/embedded/shared/CallFeedback/StarRating.js.map +1 -1
- package/dist/esm/src/embedded/shared/CallFeedback/ThankYouScreen.js +8 -6
- package/dist/esm/src/embedded/shared/CallFeedback/ThankYouScreen.js.map +1 -1
- package/dist/esm/src/embedded/shared/ConnectionNotification/ConnectionNotification.js +15 -14
- package/dist/esm/src/embedded/shared/ConnectionNotification/ConnectionNotification.js.map +1 -1
- package/dist/esm/src/embedded/shared/EmbeddedParticipantViewUI/EmbeddedParticipantViewUI.js +4 -0
- package/dist/esm/src/embedded/shared/EmbeddedParticipantViewUI/EmbeddedParticipantViewUI.js.map +1 -1
- package/dist/esm/src/embedded/shared/JoinError/JoinError.js +8 -6
- package/dist/esm/src/embedded/shared/JoinError/JoinError.js.map +1 -1
- package/dist/esm/src/embedded/shared/Lobby/DeviceControls.js +11 -7
- package/dist/esm/src/embedded/shared/Lobby/DeviceControls.js.map +1 -1
- package/dist/esm/src/embedded/shared/Lobby/DisabledDeviceButton.js +6 -4
- package/dist/esm/src/embedded/shared/Lobby/DisabledDeviceButton.js.map +1 -1
- package/dist/esm/src/embedded/shared/Lobby/Lobby.js +10 -9
- package/dist/esm/src/embedded/shared/Lobby/Lobby.js.map +1 -1
- package/dist/esm/src/embedded/shared/Lobby/ToggleCameraButton.js +6 -4
- package/dist/esm/src/embedded/shared/Lobby/ToggleCameraButton.js.map +1 -1
- package/dist/esm/src/embedded/shared/Lobby/ToggleMicButton.js +8 -6
- package/dist/esm/src/embedded/shared/Lobby/ToggleMicButton.js.map +1 -1
- package/dist/esm/src/embedded/shared/Lobby/VideoPreviewFallbacks.js +11 -9
- package/dist/esm/src/embedded/shared/Lobby/VideoPreviewFallbacks.js.map +1 -1
- package/dist/esm/src/embedded/shared/ViewersCount/ViewersCount.js +6 -4
- package/dist/esm/src/embedded/shared/ViewersCount/ViewersCount.js.map +1 -1
- package/dist/esm/src/hooks/useDeviceList.js +4 -2
- package/dist/esm/src/hooks/useDeviceList.js.map +1 -1
- package/dist/esm/src/i18n/Streami18n.js +58 -0
- package/dist/esm/src/i18n/Streami18n.js.map +1 -0
- package/dist/esm/src/i18n/TranslationContext.js +42 -0
- package/dist/esm/src/i18n/TranslationContext.js.map +1 -0
- package/dist/esm/src/i18n/runtimeDefaults.js +20 -0
- package/dist/esm/src/i18n/runtimeDefaults.js.map +1 -0
- package/dist/esm/src/i18n/useStreami18n.js +49 -0
- package/dist/esm/src/i18n/useStreami18n.js.map +1 -0
- package/dist/esm/src/wrappers/LivestreamPlayer/LivestreamPlayer.js +4 -0
- package/dist/esm/src/wrappers/LivestreamPlayer/LivestreamPlayer.js.map +1 -1
- package/dist/index.cjs.js +559 -623
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/src/components/Avatar/Avatar.d.ts +9 -4
- package/dist/src/components/Badge/Badge.d.ts +23 -0
- package/dist/src/components/Badge/index.d.ts +1 -0
- package/dist/src/components/Button/Button.d.ts +16 -0
- package/dist/src/components/Button/CompositeButton.d.ts +6 -3
- package/dist/src/components/Button/IconButton.d.ts +7 -7
- package/dist/src/components/Button/index.d.ts +2 -2
- package/dist/src/components/CallControls/CancelCallButton.d.ts +3 -1
- package/dist/src/components/CallControls/ToggleAudioButton.d.ts +3 -3
- package/dist/src/components/CallControls/ToggleAudioOutputButton.d.ts +2 -2
- package/dist/src/components/CallControls/ToggleVideoButton.d.ts +3 -3
- package/dist/src/components/CallControls/index.d.ts +0 -1
- package/dist/src/components/Menu/GenericMenu.d.ts +1 -0
- package/dist/src/components/Notification/Notification.d.ts +2 -1
- package/dist/src/components/StreamTheme/StreamTheme.d.ts +2 -1
- package/dist/src/components/VideoPreview/VideoPreview.d.ts +6 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/core/components/ParticipantView/ConnectionQualityIndicator.d.ts +10 -0
- package/dist/src/core/components/ParticipantView/index.d.ts +1 -0
- package/dist/src/core/components/StreamVideo/StreamVideo.d.ts +18 -2
- package/dist/src/embedded/shared/CallDuration/CallDuration.d.ts +9 -0
- package/dist/src/embedded/shared/index.d.ts +1 -0
- package/dist/src/i18n/Streami18n.d.ts +56 -0
- package/dist/src/i18n/TranslationContext.d.ts +30 -0
- package/dist/src/i18n/index.d.ts +16 -0
- package/dist/src/i18n/keys.d.ts +164 -0
- package/dist/src/i18n/runtimeDefaults.d.ts +17 -0
- package/dist/src/i18n/types.d.ts +45 -0
- package/dist/src/i18n/useStreami18n.d.ts +19 -0
- package/index.ts +1 -1
- package/package.json +18 -13
- package/src/components/Avatar/Avatar.tsx +53 -19
- package/src/components/Badge/Badge.tsx +48 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Button/Button.tsx +49 -0
- package/src/components/Button/CompositeButton.tsx +82 -73
- package/src/components/Button/IconButton.tsx +19 -29
- package/src/components/Button/index.ts +2 -2
- package/src/components/CallControls/AcceptCallButton.tsx +3 -1
- package/src/components/CallControls/CancelCallButton.tsx +32 -24
- package/src/components/CallControls/ReactionsButton.tsx +7 -3
- package/src/components/CallControls/RecordCallButton.tsx +50 -23
- package/src/components/CallControls/ScreenShareButton.tsx +27 -6
- package/src/components/CallControls/ToggleAudioButton.tsx +62 -61
- package/src/components/CallControls/ToggleAudioOutputButton.tsx +7 -4
- package/src/components/CallControls/ToggleVideoButton.tsx +66 -66
- package/src/components/CallControls/index.ts +0 -1
- package/src/components/CallParticipantsList/BlockedUserListing.tsx +9 -2
- package/src/components/CallParticipantsList/CallParticipantListHeader.tsx +10 -3
- package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +33 -8
- package/src/components/CallParticipantsList/CallParticipantsList.tsx +21 -5
- package/src/components/CallParticipantsList/EmptyParticipantSearchList.tsx +2 -2
- package/src/components/CallRecordingList/CallRecordingListHeader.tsx +11 -3
- package/src/components/DeviceSettings/DeviceAudioPreviewItem.tsx +3 -1
- package/src/components/DeviceSettings/DeviceSelector.tsx +1 -1
- package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +2 -7
- package/src/components/DeviceSettings/DeviceSettings.tsx +14 -5
- package/src/components/DeviceSettings/SpeakerTest.tsx +7 -2
- package/src/components/DropdownSelect/DropdownSelect.tsx +3 -1
- package/src/components/Menu/GenericMenu.tsx +4 -0
- package/src/components/Notification/MicCaptureErrorNotification.tsx +7 -2
- package/src/components/Notification/Notification.tsx +20 -4
- package/src/components/Notification/PermissionNotification.tsx +2 -0
- package/src/components/Notification/RecordingInProgressNotification.tsx +5 -6
- package/src/components/Notification/SpeakingWhileMutedNotification.tsx +8 -2
- package/src/components/Permissions/PermissionRequests.tsx +50 -43
- package/src/components/RingingCall/RingingCall.tsx +40 -14
- package/src/components/RingingCall/RingingCallControls.tsx +2 -1
- package/src/components/Search/SearchInput.tsx +2 -3
- package/src/components/StreamTheme/StreamTheme.tsx +3 -1
- package/src/components/Tooltip/Tooltip.tsx +3 -10
- package/src/components/VideoPreview/VideoPreview.tsx +50 -5
- package/src/components/index.ts +1 -1
- package/src/core/components/CallLayout/LivestreamLayout.tsx +48 -18
- package/src/core/components/CallLayout/PaginatedGridLayout.tsx +14 -0
- package/src/core/components/CallLayout/PipLayout/Grid.tsx +10 -2
- package/src/core/components/CallLayout/PipLayout/Pip.tsx +6 -2
- package/src/core/components/CallLayout/SpeakerLayout.tsx +27 -0
- package/src/core/components/CallLayout/partcipantFilter.test.ts +38 -31
- package/src/core/components/ParticipantView/ConnectionQualityIndicator.tsx +54 -0
- package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +60 -27
- package/src/core/components/ParticipantView/ParticipantActionsContextMenu.tsx +63 -22
- package/src/core/components/ParticipantView/index.ts +1 -0
- package/src/core/components/StreamVideo/StreamVideo.tsx +39 -4
- package/src/core/components/Video/BaseVideoPlaceholder.tsx +13 -30
- package/src/core/components/Video/DefaultPictureInPicturePlaceholder.tsx +5 -2
- package/src/core/components/Video/DefaultVideoPlaceholder.tsx +2 -2
- package/src/embedded/call/CallControls.tsx +9 -18
- package/src/embedded/call/CallHeader.tsx +3 -12
- package/src/embedded/call/CallLayout.tsx +1 -1
- package/src/embedded/livestream/host/HostLayout.tsx +26 -20
- package/src/embedded/livestream/host/HostStateRouter.tsx +12 -8
- package/src/embedded/livestream/viewer/ViewerLayout.tsx +8 -11
- package/src/embedded/livestream/viewer/ViewerLobby.tsx +31 -15
- package/src/embedded/shared/BlurToggleButton/BlurToggleButton.tsx +18 -12
- package/src/embedded/shared/CallDuration/CallDuration.tsx +32 -0
- package/src/embedded/shared/CallFeedback/CallEndedScreen.tsx +27 -13
- package/src/embedded/shared/CallFeedback/RatingScreen.tsx +20 -12
- package/src/embedded/shared/CallFeedback/StarRating.tsx +10 -3
- package/src/embedded/shared/CallFeedback/ThankYouScreen.tsx +6 -3
- package/src/embedded/shared/ConnectionNotification/ConnectionNotification.tsx +21 -14
- package/src/embedded/shared/JoinError/JoinError.tsx +7 -6
- package/src/embedded/shared/Lobby/DeviceControls.tsx +25 -3
- package/src/embedded/shared/Lobby/Lobby.tsx +19 -22
- package/src/embedded/shared/Lobby/ToggleMicButton.tsx +10 -3
- package/src/embedded/shared/Lobby/VideoPreviewFallbacks.tsx +4 -2
- package/src/embedded/shared/index.ts +1 -0
- package/src/hooks/useDeviceList.tsx +2 -2
- package/src/i18n/Streami18n.ts +67 -0
- package/src/i18n/TranslationContext.tsx +55 -0
- package/src/i18n/index.ts +22 -0
- package/src/i18n/keys.ts +169 -0
- package/src/i18n/runtimeDefaults.ts +17 -0
- package/src/i18n/types.ts +78 -0
- package/src/i18n/useStreami18n.ts +66 -0
- package/src/utilities/filter.test.ts +132 -124
- package/src/utilities/normalizeString.test.ts +50 -48
- package/dist/embedded-CallStatsLatencyChart-CpL1M_s0.cjs.js +0 -59
- package/dist/embedded-CallStatsLatencyChart-CpL1M_s0.cjs.js.map +0 -1
- package/dist/esm/src/components/Button/TextButton.js +0 -8
- package/dist/esm/src/components/Button/TextButton.js.map +0 -1
- package/dist/esm/src/components/CallControls/CallStatsButton.js +0 -18
- package/dist/esm/src/components/CallControls/CallStatsButton.js.map +0 -1
- package/dist/esm/src/components/CallStats/CallStats.js +0 -180
- package/dist/esm/src/components/CallStats/CallStats.js.map +0 -1
- package/dist/esm/src/components/CallStats/CallStatsLatencyChart.js +0 -57
- package/dist/esm/src/components/CallStats/CallStatsLatencyChart.js.map +0 -1
- package/dist/esm/src/translations/en.json.js +0 -177
- package/dist/esm/src/translations/en.json.js.map +0 -1
- package/dist/esm/src/translations/index.js +0 -6
- package/dist/esm/src/translations/index.js.map +0 -1
- package/dist/latency-chart-CpL1M_s0.cjs.js +0 -59
- package/dist/latency-chart-CpL1M_s0.cjs.js.map +0 -1
- package/dist/src/components/Button/TextButton.d.ts +0 -2
- package/dist/src/components/CallControls/CallStatsButton.d.ts +0 -4
- package/dist/src/components/CallStats/CallStats.d.ts +0 -22
- package/dist/src/components/CallStats/CallStatsLatencyChart.d.ts +0 -7
- package/dist/src/components/CallStats/index.d.ts +0 -1
- package/dist/src/translations/index.d.ts +0 -146
- package/src/components/Button/TextButton.tsx +0 -12
- package/src/components/CallControls/CallStatsButton.tsx +0 -37
- package/src/components/CallStats/CallStats.tsx +0 -439
- package/src/components/CallStats/CallStatsLatencyChart.tsx +0 -76
- package/src/components/CallStats/index.ts +0 -1
- package/src/translations/en.json +0 -154
- package/src/translations/index.ts +0 -3
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Streami18n as CoreStreami18n } from '@stream-io/i18n';
|
|
2
|
+
import type { Streami18nOptions as CoreStreami18nOptions } from '@stream-io/i18n';
|
|
3
|
+
|
|
4
|
+
import { runtimeDefaults } from './runtimeDefaults';
|
|
5
|
+
import type { BundledKey, TranslationCatalog } from './types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Options for {@link Streami18n}.
|
|
9
|
+
*
|
|
10
|
+
* Core's options, narrowed to this SDK's catalog so `translationsForLanguage` is key-checked.
|
|
11
|
+
* `runtimeDefaults` is *merged* over the SDK's own rather than replacing it, so supplying it adds to
|
|
12
|
+
* what the SDK ships.
|
|
13
|
+
*/
|
|
14
|
+
export type Streami18nOptions = CoreStreami18nOptions<TranslationCatalog>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Wrapper around [i18next](https://www.i18next.com/) for this SDK's translations. Pass an instance
|
|
18
|
+
* to `<StreamVideo i18nInstance={…}>` to control the language and the copy.
|
|
19
|
+
*
|
|
20
|
+
* The implementation lives in `@stream-io/i18n`, shared with the React Native SDK and with Chat.
|
|
21
|
+
* What this subclass adds is what is this package's own: its bundled translation data, and the two
|
|
22
|
+
* type parameters — core cannot supply either, because the key catalog is generated from *this*
|
|
23
|
+
* package's `t()` call sites.
|
|
24
|
+
*
|
|
25
|
+
* ## Overriding some of the English copy
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const i18n = new Streami18n({
|
|
29
|
+
* translationsForLanguage: {
|
|
30
|
+
* 'common.participants.label': 'People',
|
|
31
|
+
* },
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* ## Adding a language
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* import 'dayjs/locale/nl';
|
|
39
|
+
*
|
|
40
|
+
* const i18n = new Streami18n({ language: 'nl' });
|
|
41
|
+
* i18n.registerTranslation('nl', {
|
|
42
|
+
* 'callControls.cancelCallButton.leaveCall.title': 'Verlaten',
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* No dayjs locale file defines `calendar` — that field belongs to the calendar plugin — so a
|
|
47
|
+
* language whose relative dates must read natively needs the locale import *and* a `calendar`
|
|
48
|
+
* config passed as the third argument.
|
|
49
|
+
*
|
|
50
|
+
* Type your dictionary as `TranslationDictionary` to turn a typo or a key removed in a later major
|
|
51
|
+
* into a compile error. A **partial dictionary is safe**: any key you leave out renders the English
|
|
52
|
+
* copy that ships inline at each call site, never a raw dotted path — so there is no need to
|
|
53
|
+
* translate everything before shipping a language.
|
|
54
|
+
*
|
|
55
|
+
* Reactivity goes through `i18n.state`, a `StateStore`. `setLanguage()` returns nothing — the new
|
|
56
|
+
* `t` is published to that store, which the provider subscribes to.
|
|
57
|
+
*/
|
|
58
|
+
export class Streami18n extends CoreStreami18n<TranslationCatalog, BundledKey> {
|
|
59
|
+
constructor(options: Streami18nOptions = {}) {
|
|
60
|
+
super({
|
|
61
|
+
...options,
|
|
62
|
+
// Merged, not replaced. Spreading `options` over a literal would let an integrator supplying
|
|
63
|
+
// one entry silently drop the SDK's own bundled data, which then renders as raw keys.
|
|
64
|
+
runtimeDefaults: { ...runtimeDefaults, ...options.runtimeDefaults },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDefaultTranslatorFunction,
|
|
3
|
+
defaultDateTimeParser,
|
|
4
|
+
} from '@stream-io/i18n';
|
|
5
|
+
import { createTranslationContext } from '@stream-io/i18n/react';
|
|
6
|
+
|
|
7
|
+
import type { StreamTFunction, TDateTimeParser } from './types';
|
|
8
|
+
|
|
9
|
+
export type TranslationContextValue = {
|
|
10
|
+
t: StreamTFunction;
|
|
11
|
+
tDateTimeParser: TDateTimeParser;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The `t` in force before i18next has initialized, and the context's default.
|
|
16
|
+
*
|
|
17
|
+
* Core's factory, instantiated against this SDK's catalog so it is typed exactly like the real `t`.
|
|
18
|
+
* It honours the inline `defaultValue` each prose call site passes, which is what stops raw dotted
|
|
19
|
+
* keys flashing on the first frame.
|
|
20
|
+
*/
|
|
21
|
+
const defaultTranslatorFunction =
|
|
22
|
+
createDefaultTranslatorFunction() as StreamTFunction;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Built from the shared factory in `@stream-io/i18n/react`.
|
|
26
|
+
*
|
|
27
|
+
* A **default value** is supplied rather than making the hook throw, and that is deliberate: it
|
|
28
|
+
* matches what `useI18n` did before this module existed, and it is what lets the `embedded/`
|
|
29
|
+
* components — which are used standalone, outside any provider — render correct English instead of
|
|
30
|
+
* crashing. Chat's React Native SDK throws instead; hence core exposes this as a factory.
|
|
31
|
+
*/
|
|
32
|
+
const { TranslationContext, TranslationProvider, useTranslationContext } =
|
|
33
|
+
createTranslationContext<TranslationContextValue>({
|
|
34
|
+
defaultValue: {
|
|
35
|
+
t: defaultTranslatorFunction,
|
|
36
|
+
tDateTimeParser: defaultDateTimeParser,
|
|
37
|
+
},
|
|
38
|
+
displayName: 'StreamVideoTranslationContext',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { TranslationContext, TranslationProvider };
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Reads `t` and `tDateTimeParser` from the closest provider.
|
|
45
|
+
*
|
|
46
|
+
* Works outside a provider too — the default translator renders each call site's inline English.
|
|
47
|
+
*
|
|
48
|
+
* The name is `useI18n` rather than core's `useTranslationContext` because ~500 call sites in this
|
|
49
|
+
* SDK already import it; renaming them is churn with no payoff.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const { t } = useI18n();
|
|
53
|
+
* const label = t('callControls.cancelCallButton.leaveCall.title', 'Leave call');
|
|
54
|
+
*/
|
|
55
|
+
export const useI18n = useTranslationContext;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './Streami18n';
|
|
2
|
+
export * from './TranslationContext';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './useStreami18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Core helpers re-exported so an integrator never needs a direct dependency on `@stream-io/i18n`:
|
|
8
|
+
* that package is an implementation detail of this SDK, and a second copy resolved from their
|
|
9
|
+
* `node_modules` would register dayjs plugins on the wrong module.
|
|
10
|
+
*
|
|
11
|
+
* - `asDynamicKey` — brands a runtime-resolved string as a translation key, the one sanctioned way
|
|
12
|
+
* past the compile-time key check.
|
|
13
|
+
* - `getDateString` — the timestamp renderer, for a custom component formatting dates itself.
|
|
14
|
+
* - `predefinedFormatters` — the built-in i18next formatters, to spread over when adding one.
|
|
15
|
+
* - `defaultDateTimeParser` — the dayjs-backed parser, with the required plugins already applied.
|
|
16
|
+
*/
|
|
17
|
+
export {
|
|
18
|
+
asDynamicKey,
|
|
19
|
+
defaultDateTimeParser,
|
|
20
|
+
getDateString,
|
|
21
|
+
predefinedFormatters,
|
|
22
|
+
} from '@stream-io/i18n';
|
package/src/i18n/keys.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// AUTO-GENERATED — do not edit by hand.
|
|
2
|
+
// Regenerate with `yarn build-translations`. CI fails if this file is out of sync.
|
|
3
|
+
//
|
|
4
|
+
// Type-only: no runtime value is emitted, so this adds nothing to the bundle.
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Every translation entry shipped with the SDK, mapped to its English copy.
|
|
8
|
+
*
|
|
9
|
+
* Plural entries appear as `<key>_one` / `<key>_other`; call sites use the bare `<key>` and
|
|
10
|
+
* pass `count`.
|
|
11
|
+
*/
|
|
12
|
+
export type TranslationCatalog = {
|
|
13
|
+
'callControls.blurToggleButton.applying.label': 'Applying...';
|
|
14
|
+
'callControls.blurToggleButton.blurBackground.label': 'Blur background';
|
|
15
|
+
'callControls.blurToggleButton.disableBlur.label': 'Disable blur';
|
|
16
|
+
'callControls.cancelCallButton.endCallForAll.label': 'End call for all';
|
|
17
|
+
'callControls.cancelCallButton.leaveCall.title': 'Leave call';
|
|
18
|
+
'callControls.reactionsButton.reactions.title': 'Reactions';
|
|
19
|
+
'callControls.recordCallButton.confirmEndRecording.description': 'Are you sure you want end the recording?';
|
|
20
|
+
'callControls.recordCallButton.endRecording.title': 'End recording';
|
|
21
|
+
'callControls.recordCallButton.recordCall.title': 'Record call';
|
|
22
|
+
'callControls.recordCallButton.waitingRecordingStart.title': 'Waiting for recording to start...';
|
|
23
|
+
'callControls.recordCallButton.waitingRecordingStop.title': 'Waiting for recording to stop...';
|
|
24
|
+
'callControls.screenShareButton.awaitingApproval.text': 'Awaiting for an approval to share screen.';
|
|
25
|
+
'callControls.screenShareButton.permissionGranted.text': 'You can now share your screen.';
|
|
26
|
+
'callControls.screenShareButton.permissionRevoked.text': 'You can no longer share your screen.';
|
|
27
|
+
'callControls.screenShareButton.shareScreen.title': 'Share screen';
|
|
28
|
+
'callControls.toggleAudioButton.awaitingApproval.text': 'Awaiting for an approval to speak.';
|
|
29
|
+
'callControls.toggleAudioButton.checkBrowserAudioPermissions.title': 'Check your browser audio permissions';
|
|
30
|
+
'callControls.toggleAudioButton.checkBrowserMicPermissions.title': 'Check your browser mic permissions';
|
|
31
|
+
'callControls.toggleAudioButton.mic.title': 'Mic';
|
|
32
|
+
'callControls.toggleAudioButton.microphonePausedBySystem.title': 'Microphone is paused by your system';
|
|
33
|
+
'callControls.toggleAudioButton.noPermissionToShareAudio.title': 'You have no permission to share your audio';
|
|
34
|
+
'callControls.toggleAudioButton.permissionGranted.text': 'You can now speak.';
|
|
35
|
+
'callControls.toggleAudioButton.permissionRevoked.text': 'You can no longer speak.';
|
|
36
|
+
'callControls.toggleAudioOutputButton.speakers.title': 'Speakers';
|
|
37
|
+
'callControls.toggleVideoButton.awaitingApproval.text': 'Awaiting for an approval to share your video.';
|
|
38
|
+
'callControls.toggleVideoButton.cameraPausedBySystem.title': 'Camera is paused by your system';
|
|
39
|
+
'callControls.toggleVideoButton.checkBrowserVideoPermissions.title': 'Check your browser video permissions';
|
|
40
|
+
'callControls.toggleVideoButton.noPermissionToShareVideo.title': 'You have no permission to share your video';
|
|
41
|
+
'callControls.toggleVideoButton.permissionGranted.text': 'You can now share your video.';
|
|
42
|
+
'callControls.toggleVideoButton.permissionRevoked.text': 'You can no longer share your video.';
|
|
43
|
+
'callControls.toggleVideoButton.video.title': 'Video';
|
|
44
|
+
'callControls.toggleVideoButton.videoPublishingDisabled.title': 'Video publishing is disabled by the system';
|
|
45
|
+
'callFeedback.callEndedScreen.callEnded.title': 'Call ended';
|
|
46
|
+
'callFeedback.callEndedScreen.helpUsImprove.text': 'Help us improve';
|
|
47
|
+
'callFeedback.callEndedScreen.leaveFeedback.label': 'Leave feedback';
|
|
48
|
+
'callFeedback.callEndedScreen.leftByMistake.text': 'Left by mistake?';
|
|
49
|
+
'callFeedback.callEndedScreen.rejoinCall.label': 'Rejoin call';
|
|
50
|
+
'callFeedback.ratingScreen.feedbackMessage.ariaLabel': 'Feedback message';
|
|
51
|
+
'callFeedback.ratingScreen.shareYourFeedback.title': 'Share your feedback';
|
|
52
|
+
'callFeedback.ratingScreen.submitFeedback.label': 'Submit feedback';
|
|
53
|
+
'callFeedback.ratingScreen.tellUsAboutExperience.placeholder': 'Tell us about your experience...';
|
|
54
|
+
'callFeedback.starRating.howWasCallQuality.text': 'How was your call quality?';
|
|
55
|
+
'callFeedback.starRating.rateStars.ariaLabel_one': 'Rate {{ count }} star';
|
|
56
|
+
'callFeedback.starRating.rateStars.ariaLabel_other': 'Rate {{ count }} stars';
|
|
57
|
+
'callFeedback.thankYouScreen.feedbackHelpsImprove.text': 'Your feedback helps improve call quality.';
|
|
58
|
+
'callFeedback.thankYouScreen.thankYou.title': 'Thank you!';
|
|
59
|
+
'callLayout.paginatedGridLayout.nextPage.ariaLabel': 'Next page';
|
|
60
|
+
'callLayout.paginatedGridLayout.previousPage.ariaLabel': 'Previous page';
|
|
61
|
+
'callLayout.speakerLayout.scrollParticipantsDown.ariaLabel': 'Scroll participants down';
|
|
62
|
+
'callLayout.speakerLayout.scrollParticipantsLeft.ariaLabel': 'Scroll participants left';
|
|
63
|
+
'callLayout.speakerLayout.scrollParticipantsRight.ariaLabel': 'Scroll participants right';
|
|
64
|
+
'callLayout.speakerLayout.scrollParticipantsUp.ariaLabel': 'Scroll participants up';
|
|
65
|
+
'callRecordingList.callRecordings.title': 'Call Recordings';
|
|
66
|
+
'callRecordingList.refresh.title': 'Refresh';
|
|
67
|
+
'common.allow.label': 'Allow';
|
|
68
|
+
'common.cancel.label': 'Cancel';
|
|
69
|
+
'common.default.label': 'Default';
|
|
70
|
+
'common.dismiss.label': 'Dismiss';
|
|
71
|
+
'common.live.label': 'Live';
|
|
72
|
+
'common.microphone.label': 'Microphone';
|
|
73
|
+
'common.noCameraFound.text': 'No camera found';
|
|
74
|
+
'common.participants.label': 'Participants';
|
|
75
|
+
'common.presentingYourScreen.text': 'You are presenting your screen';
|
|
76
|
+
'common.revoke.label': 'Revoke';
|
|
77
|
+
'common.speaker.label': 'Speaker';
|
|
78
|
+
'common.toggleMenu.ariaLabel': 'Toggle menu';
|
|
79
|
+
'common.tryAgain.label': 'Try again';
|
|
80
|
+
'common.videoDisabled.text': 'Video is disabled';
|
|
81
|
+
'common.waitingForPermission.title': 'Waiting for permission';
|
|
82
|
+
'connectionNotification.failedToRestore.text': 'Failed to restore connection. Please try again.';
|
|
83
|
+
'connectionNotification.joining.text': 'Joining';
|
|
84
|
+
'connectionNotification.migrating.text': 'Migrating...';
|
|
85
|
+
'connectionNotification.offline.text': 'You are offline. Check your internet connection.';
|
|
86
|
+
'connectionNotification.reconnecting.text': 'Reconnecting...';
|
|
87
|
+
'deviceSettings.selectCamera.title': 'Select a Camera';
|
|
88
|
+
'deviceSettings.selectMic.title': 'Select a Mic';
|
|
89
|
+
'deviceSettings.selectSpeakers.title': 'Select Speakers';
|
|
90
|
+
'deviceSettings.speakerTest.stopTest.label': 'Stop test';
|
|
91
|
+
'deviceSettings.speakerTest.testSpeaker.label': 'Test speaker';
|
|
92
|
+
'deviceSettings.toggleDeviceMenu.title': 'Toggle device menu';
|
|
93
|
+
'joinError.couldNotConnect.text': "We couldn't connect to the server. Please check your connection and try again.";
|
|
94
|
+
'joinError.failedToJoin.title': 'Failed to join the call';
|
|
95
|
+
'livestream.backstage.participantsJoinedEarly.text_one': '{{ formattedCount }} participant joined early';
|
|
96
|
+
'livestream.backstage.participantsJoinedEarly.text_other': '{{ formattedCount }} participants joined early';
|
|
97
|
+
'livestream.backstage.startsAt.text': 'Livestream starts at {{ time }}';
|
|
98
|
+
'livestream.backstage.startsSoon.text': 'Livestream starts soon';
|
|
99
|
+
'livestreamHost.backstage.text': 'Backstage';
|
|
100
|
+
'livestreamHost.endLive.label': 'End Live';
|
|
101
|
+
'livestreamHost.endStream.title': 'End Stream';
|
|
102
|
+
'livestreamHost.enterBackstage.label': 'Enter Backstage';
|
|
103
|
+
'livestreamHost.goLive.label': 'Go Live';
|
|
104
|
+
'livestreamHost.prepareLivestream.title': 'Prepare your livestream';
|
|
105
|
+
'livestreamHost.readyToGoLive.title': 'Ready to go live';
|
|
106
|
+
'livestreamHost.startStream.title': 'Start Stream';
|
|
107
|
+
'livestreamViewer.lobby.joinAutomatically.text': 'Join automatically when stream starts';
|
|
108
|
+
'livestreamViewer.lobby.joinStream.label': 'Join Stream';
|
|
109
|
+
'livestreamViewer.lobby.streamReady.title': 'Stream is ready!';
|
|
110
|
+
'livestreamViewer.lobby.waitingForStart.title': 'Waiting for the livestream to start';
|
|
111
|
+
'lobby.deviceControls.permissionNeeded.label': 'Permission needed';
|
|
112
|
+
'lobby.join.label': 'Join';
|
|
113
|
+
'lobby.setUpYourCall.title': 'Set up your call before joining';
|
|
114
|
+
'lobby.videoPreviewFallbacks.grantBrowserPermission.text': 'Please grant your browser permission to access your camera and microphone.';
|
|
115
|
+
'notification.micCaptureError.text': 'Your microphone is not capturing audio. Please check your setup.';
|
|
116
|
+
'notification.recordingInProgress.text': 'Recording in progress...';
|
|
117
|
+
'notification.speakingWhileMuted.text': 'You are muted. Unmute to speak.';
|
|
118
|
+
'participantList.anonymousCount.text': ', and ({{ anonymousCount }}) anonymous';
|
|
119
|
+
'participantList.cameraOff.title': 'Camera off';
|
|
120
|
+
'participantList.cameraOn.title': 'Camera on';
|
|
121
|
+
'participantList.me.text': 'Me';
|
|
122
|
+
'participantList.microphoneOff.title': 'Microphone off';
|
|
123
|
+
'participantList.microphoneOn.title': 'Microphone on';
|
|
124
|
+
'participantList.muteAll.label': 'Mute all';
|
|
125
|
+
'participantList.noParticipantsFound.text': 'No participants found';
|
|
126
|
+
'participantList.pinned.title': 'Pinned';
|
|
127
|
+
'participantList.unknown.text': 'Unknown';
|
|
128
|
+
'participantView.actionsMenu.allowAudio.label': 'Allow audio';
|
|
129
|
+
'participantView.actionsMenu.allowScreenSharing.label': 'Allow screen sharing';
|
|
130
|
+
'participantView.actionsMenu.allowVideo.label': 'Allow video';
|
|
131
|
+
'participantView.actionsMenu.block.label': 'Block';
|
|
132
|
+
'participantView.actionsMenu.disableAudio.label': 'Disable audio';
|
|
133
|
+
'participantView.actionsMenu.disableScreenSharing.label': 'Disable screen sharing';
|
|
134
|
+
'participantView.actionsMenu.disableVideo.label': 'Disable video';
|
|
135
|
+
'participantView.actionsMenu.enterFullscreen.label': 'Enter fullscreen';
|
|
136
|
+
'participantView.actionsMenu.enterPip.label': 'Enter picture-in-picture';
|
|
137
|
+
'participantView.actionsMenu.kick.label': 'Kick';
|
|
138
|
+
'participantView.actionsMenu.leaveFullscreen.label': 'Leave fullscreen';
|
|
139
|
+
'participantView.actionsMenu.leavePip.label': 'Leave picture-in-picture';
|
|
140
|
+
'participantView.actionsMenu.muteAudio.label': 'Mute audio';
|
|
141
|
+
'participantView.actionsMenu.muteScreenShareAudio.label': 'Mute screen share audio';
|
|
142
|
+
'participantView.actionsMenu.pin.label': 'Pin';
|
|
143
|
+
'participantView.actionsMenu.pinForEveryone.label': 'Pin for everyone';
|
|
144
|
+
'participantView.actionsMenu.turnOffScreenShare.label': 'Turn off screen share';
|
|
145
|
+
'participantView.actionsMenu.turnOffVideo.label': 'Turn off video';
|
|
146
|
+
'participantView.actionsMenu.unpinForEveryone.label': 'Unpin for everyone';
|
|
147
|
+
'participantView.audioBlocked.description': 'Click or tap to play audio';
|
|
148
|
+
'participantView.audioBlocked.title': 'Audio is blocked by your system';
|
|
149
|
+
'participantView.audioConnecting.title': 'Audio is connecting...';
|
|
150
|
+
'participantView.connectionQuality.poor.text': 'Poor connection quality. Please check your internet connection.';
|
|
151
|
+
'participantView.moreOptions.title': 'More options';
|
|
152
|
+
'participantView.stopScreenSharing.label': 'Stop Screen Sharing';
|
|
153
|
+
'participantView.unpin.label': 'Unpin';
|
|
154
|
+
'participantView.videoConnecting.title': 'Video is connecting...';
|
|
155
|
+
'participantView.videoPausedInsufficientBandwidth.title': 'Video paused due to insufficient bandwidth';
|
|
156
|
+
'permissions.requestingCamera.text': '{{ userName }} is requesting to share their camera';
|
|
157
|
+
'permissions.requestingPermission.text': '{{ userName }} is requesting permission: {{ permission }}';
|
|
158
|
+
'permissions.requestingScreenShare.text': '{{ userName }} is requesting to present their screen';
|
|
159
|
+
'permissions.requestingToSpeak.text': '{{ userName }} is requesting to speak';
|
|
160
|
+
'ringingCall.callingState.joined.text': 'Joined';
|
|
161
|
+
'ringingCall.callingState.joining.text': 'Joining';
|
|
162
|
+
'ringingCall.callingState.left.text': 'Left call';
|
|
163
|
+
'ringingCall.callingState.migrating.text': 'Migrating';
|
|
164
|
+
'ringingCall.callingState.offline.text': 'No internet connection';
|
|
165
|
+
'ringingCall.callingState.reconnecting.text': 'Re-connecting';
|
|
166
|
+
'ringingCall.callingState.reconnectingFailed.text': 'Failed';
|
|
167
|
+
'ringingCall.callingState.ringing.text': 'Ringing';
|
|
168
|
+
'videoPlaceholder.videoPlayingInPopup.text': 'Video is playing in a popup';
|
|
169
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SDK's bundled translation data: the keys that cannot carry an inline `defaultValue` at their
|
|
3
|
+
* call site. `Streami18n` layers it under *every* language, so a partial dictionary never knocks
|
|
4
|
+
* these out.
|
|
5
|
+
*
|
|
6
|
+
* Empty, and that is the intended steady state. The four lookups this SDK resolved from a runtime
|
|
7
|
+
* value — the only candidates for an entry here — are written as `switch` statements over literal
|
|
8
|
+
* `t()` calls instead, so every branch carries its own English copy inline and the codegen reads it
|
|
9
|
+
* straight off the call site. Nothing is left without a default. `timestamp.*` / `duration.*`
|
|
10
|
+
* formatter expressions would also live here; this SDK has none yet.
|
|
11
|
+
*
|
|
12
|
+
* Adding an entry later needs no wiring. `Streami18n` already spreads this into the core options and
|
|
13
|
+
* `scripts/generate-i18n-keys.mts` already reads this path, so a new key reaches `keys.ts` on the
|
|
14
|
+
* next `build-translations` run — where a key nothing references, or one that shadows an inline
|
|
15
|
+
* default, fails a codegen guard.
|
|
16
|
+
*/
|
|
17
|
+
export const runtimeDefaults = {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Streami18nState as CoreStreami18nState,
|
|
3
|
+
LooseTranslationDictionaryOf,
|
|
4
|
+
RelativeTimeCatalog,
|
|
5
|
+
StreamTFunctionFor,
|
|
6
|
+
TranslationDictionaryOf,
|
|
7
|
+
TranslationKeyOf,
|
|
8
|
+
} from '@stream-io/i18n';
|
|
9
|
+
|
|
10
|
+
import type { TranslationCatalog as GeneratedCatalog } from './keys';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The SDK's i18n types, instantiated from the generic helpers in `@stream-io/i18n`.
|
|
14
|
+
*
|
|
15
|
+
* The derivations live in core so both video SDKs (and Chat) share one implementation; the *catalog*
|
|
16
|
+
* stays here, because it is generated from this package's own `t()` call sites. That split is why
|
|
17
|
+
* core's helpers are generic over the catalog rather than driven by module augmentation — two
|
|
18
|
+
* catalogs have to be able to coexist in one TypeScript program, which a monorepo typechecking the
|
|
19
|
+
* web and React Native SDKs in one pass does.
|
|
20
|
+
*
|
|
21
|
+
* `relativeTime.*` is intersected in because it is core's copy, not ours: `timestampFormatter`
|
|
22
|
+
* renders "Today" / "3d ago" through `t()`, and without these keys in the catalog an integrator
|
|
23
|
+
* could not type a dictionary that translates them.
|
|
24
|
+
*/
|
|
25
|
+
export type TranslationCatalog = GeneratedCatalog & RelativeTimeCatalog;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Keys resolved from bundled data rather than from an inline `defaultValue`.
|
|
29
|
+
*
|
|
30
|
+
* `never`, because `runtimeDefaults.ts` is empty — every key this SDK uses is written literally
|
|
31
|
+
* with its English copy at the call site. `timestamp.*` / `duration.*` are matched by prefix inside
|
|
32
|
+
* core and need no entry here.
|
|
33
|
+
*
|
|
34
|
+
* **It must never become `string`.** `string` collapses the prose overload in `StreamTFunctionFor`,
|
|
35
|
+
* which silently disables all key checking: every `t('typo.key', 'copy')` would compile. Widen it
|
|
36
|
+
* only to a literal prefix template (`` `foo.${string}` ``) when a real bundled key appears.
|
|
37
|
+
*/
|
|
38
|
+
export type BundledKey = never;
|
|
39
|
+
|
|
40
|
+
export type TranslationKey = TranslationKeyOf<TranslationCatalog>;
|
|
41
|
+
export type TranslationDictionary = TranslationDictionaryOf<TranslationCatalog>;
|
|
42
|
+
export type LooseTranslationDictionary =
|
|
43
|
+
LooseTranslationDictionaryOf<TranslationCatalog>;
|
|
44
|
+
export type StreamTFunction = StreamTFunctionFor<
|
|
45
|
+
TranslationCatalog,
|
|
46
|
+
BundledKey
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The value held by `Streami18n.state`, parameterized for this SDK's catalog.
|
|
51
|
+
*
|
|
52
|
+
* Exported because `state` is public: a consumer subscribing to it needs to name the type for a
|
|
53
|
+
* module-scope selector. Core's default-parameterized `Streami18nState` is not a substitute — `t` is
|
|
54
|
+
* contravariant in its key parameter, so that one is not assignable to this.
|
|
55
|
+
*/
|
|
56
|
+
export type Streami18nState = CoreStreami18nState<
|
|
57
|
+
TranslationCatalog,
|
|
58
|
+
BundledKey
|
|
59
|
+
>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Re-exported so an integrator can type a formatter, a locale config or a date parser without
|
|
63
|
+
* taking a direct dependency on `@stream-io/i18n`.
|
|
64
|
+
*/
|
|
65
|
+
export type {
|
|
66
|
+
CustomFormatters,
|
|
67
|
+
DateTimeParserModule,
|
|
68
|
+
DayjsLocaleConfig,
|
|
69
|
+
DurationFormatterOptions,
|
|
70
|
+
DynamicTranslationKey,
|
|
71
|
+
FormatterFactory,
|
|
72
|
+
LooseTranslateFunction,
|
|
73
|
+
PredefinedFormatters,
|
|
74
|
+
TDateTimeParser,
|
|
75
|
+
TDateTimeParserInput,
|
|
76
|
+
TDateTimeParserOutput,
|
|
77
|
+
TimestampFormatterOptions,
|
|
78
|
+
} from '@stream-io/i18n';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useStreami18nState } from '@stream-io/i18n/react';
|
|
3
|
+
|
|
4
|
+
import { Streami18n } from './Streami18n';
|
|
5
|
+
import type { TranslationContextValue } from './TranslationContext';
|
|
6
|
+
import type { LooseTranslationDictionary } from './types';
|
|
7
|
+
|
|
8
|
+
export type UseStreami18nParams = {
|
|
9
|
+
/** An instance the integrator configured. One is created when absent. */
|
|
10
|
+
i18nInstance?: Streami18n;
|
|
11
|
+
/** The language the SDK's copy renders in. Changing it switches languages in place. */
|
|
12
|
+
language?: string;
|
|
13
|
+
/** Dictionaries to register, keyed by language code. Partial dictionaries are safe. */
|
|
14
|
+
translations?: Record<string, LooseTranslationDictionary>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the translation context value: creates or adopts a {@link Streami18n} instance,
|
|
19
|
+
* registers the supplied dictionaries, initializes it and keeps `t` fresh across language changes.
|
|
20
|
+
*
|
|
21
|
+
* `init()` and the store subscription belong to `useStreami18nState` in `@stream-io/i18n/react`,
|
|
22
|
+
* shared with the React Native SDK.
|
|
23
|
+
*/
|
|
24
|
+
export const useStreami18n = ({
|
|
25
|
+
i18nInstance,
|
|
26
|
+
language,
|
|
27
|
+
translations,
|
|
28
|
+
}: UseStreami18nParams): TranslationContextValue => {
|
|
29
|
+
// Lazy `useState`, not `useMemo`: `new Streami18n()` is a real allocation with identity that must
|
|
30
|
+
// survive a re-render, and this repo lints `react-hooks/purity` as an error — `useMemo` is a
|
|
31
|
+
// cache React is free to drop, so constructing there is a purity violation. A later change to
|
|
32
|
+
// `i18nInstance` is ignored on purpose; swapping the instance mid-tree is not a supported move.
|
|
33
|
+
const [i18n] = useState(() => {
|
|
34
|
+
const instance = i18nInstance ?? new Streami18n({ language });
|
|
35
|
+
|
|
36
|
+
// Registered here rather than in an effect. `useStreami18nState` calls `init()` from its own
|
|
37
|
+
// effect, which runs *before* any effect declared below it in this hook — so a dictionary
|
|
38
|
+
// registered in an effect would arrive after i18next was already initialized, and the first
|
|
39
|
+
// `init()` would warn that the language has no dictionary.
|
|
40
|
+
if (translations) {
|
|
41
|
+
for (const [code, dictionary] of Object.entries(translations)) {
|
|
42
|
+
instance.registerTranslation(code, dictionary);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return instance;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// No `onInitError` handler: core already logs a warning and leaves the instance usable, with `t`
|
|
50
|
+
// still rendering each call site's inline English. Pass one only to surface init failures
|
|
51
|
+
// somewhere other than the console.
|
|
52
|
+
const translators = useStreami18nState(i18n);
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
// Guarded on the current value: `setLanguage` re-runs the formatter factories and a full
|
|
56
|
+
// i18next `changeLanguage`, and the first render already constructed the instance with
|
|
57
|
+
// `language`. Undefined means "leave whatever the instance was configured with".
|
|
58
|
+
if (!language || i18n.currentLanguage === language) return;
|
|
59
|
+
i18n.setLanguage(language);
|
|
60
|
+
}, [i18n, language]);
|
|
61
|
+
|
|
62
|
+
// Returned as-is: `useStreami18nState` already caches this object and only produces a new one
|
|
63
|
+
// when `t` or `tDateTimeParser` actually changes, so wrapping it in a `useMemo` would add a
|
|
64
|
+
// second cache over a stable value.
|
|
65
|
+
return translators;
|
|
66
|
+
};
|