react-native-ensys-camera-x 1.0.7
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/CustomCamera.podspec +20 -0
- package/LICENSE +20 -0
- package/README.md +833 -0
- package/android/build.gradle +135 -0
- package/android/consumer-rules.pro +47 -0
- package/android/src/main/AndroidManifest.xml +72 -0
- package/android/src/main/java/android/print/PdfPrint.java +51 -0
- package/android/src/main/java/com/customcamera/AnimatedImageViewManager.kt +199 -0
- package/android/src/main/java/com/customcamera/AudioPlayerView.kt +322 -0
- package/android/src/main/java/com/customcamera/AudioRecorder.kt +506 -0
- package/android/src/main/java/com/customcamera/BarcodeScannerActivity.kt +361 -0
- package/android/src/main/java/com/customcamera/BlurBackgroundView.kt +199 -0
- package/android/src/main/java/com/customcamera/CacheCleanupManager.kt +386 -0
- package/android/src/main/java/com/customcamera/CameraAspectRatioMode.kt +77 -0
- package/android/src/main/java/com/customcamera/CameraAsset.kt +211 -0
- package/android/src/main/java/com/customcamera/CameraTheme.kt +479 -0
- package/android/src/main/java/com/customcamera/CompressionCacheStore.kt +504 -0
- package/android/src/main/java/com/customcamera/CompressionFileNameUtils.kt +7 -0
- package/android/src/main/java/com/customcamera/CompressionProfile.kt +195 -0
- package/android/src/main/java/com/customcamera/CustomCameraActivity.kt +7291 -0
- package/android/src/main/java/com/customcamera/CustomCameraFileProvider.kt +9 -0
- package/android/src/main/java/com/customcamera/CustomCameraModule.kt +2479 -0
- package/android/src/main/java/com/customcamera/CustomCameraPackage.kt +53 -0
- package/android/src/main/java/com/customcamera/DisplayUtils.kt +9 -0
- package/android/src/main/java/com/customcamera/DocumentPreviewView.kt +846 -0
- package/android/src/main/java/com/customcamera/DrawingView.kt +214 -0
- package/android/src/main/java/com/customcamera/EmojiPickerData.kt +228 -0
- package/android/src/main/java/com/customcamera/FilterStripAdapter.kt +158 -0
- package/android/src/main/java/com/customcamera/GifSupport.kt +215 -0
- package/android/src/main/java/com/customcamera/GlobalAudioPlayer.kt +320 -0
- package/android/src/main/java/com/customcamera/ImageExporter.kt +1394 -0
- package/android/src/main/java/com/customcamera/ImageFormatSupport.kt +163 -0
- package/android/src/main/java/com/customcamera/Localization.kt +206 -0
- package/android/src/main/java/com/customcamera/MediaAdapters.kt +758 -0
- package/android/src/main/java/com/customcamera/MediaCacheManager.kt +782 -0
- package/android/src/main/java/com/customcamera/MediaExportFormats.kt +201 -0
- package/android/src/main/java/com/customcamera/MediaFileIo.kt +310 -0
- package/android/src/main/java/com/customcamera/MediaMetadataStore.kt +494 -0
- package/android/src/main/java/com/customcamera/MediaPreviewEditor.kt +14865 -0
- package/android/src/main/java/com/customcamera/MediaPublisher.kt +423 -0
- package/android/src/main/java/com/customcamera/MediaStorageWorkflow.kt +722 -0
- package/android/src/main/java/com/customcamera/MediaStoreRepository.kt +378 -0
- package/android/src/main/java/com/customcamera/MediaThumbnailView.kt +286 -0
- package/android/src/main/java/com/customcamera/MediaUtils.kt +37 -0
- package/android/src/main/java/com/customcamera/NativeVideoViewManager.kt +845 -0
- package/android/src/main/java/com/customcamera/OfficeDocumentConverter.kt +2791 -0
- package/android/src/main/java/com/customcamera/PendingCaptureCrops.kt +88 -0
- package/android/src/main/java/com/customcamera/PowerPointPreview.kt +4077 -0
- package/android/src/main/java/com/customcamera/RecentPickerStore.kt +74 -0
- package/android/src/main/java/com/customcamera/SecureFileEraser.kt +411 -0
- package/android/src/main/java/com/customcamera/SecureKeyModule.kt +88 -0
- package/android/src/main/java/com/customcamera/SecureMediaDeleter.kt +493 -0
- package/android/src/main/java/com/customcamera/StickerPickerData.kt +107 -0
- package/android/src/main/java/com/customcamera/SvgDrawable.kt +175 -0
- package/android/src/main/java/com/customcamera/SvgIconViewManager.kt +77 -0
- package/android/src/main/java/com/customcamera/TextEntryController.kt +553 -0
- package/android/src/main/java/com/customcamera/ThumbnailLoader.kt +455 -0
- package/android/src/main/java/com/customcamera/UploadService.kt +909 -0
- package/android/src/main/java/com/customcamera/VideoEditUtils.kt +210 -0
- package/android/src/main/java/com/customcamera/VideoRotationTranscoder.kt +1992 -0
- package/android/src/main/java/com/customcamera/gif/AnimatedGifEncoder.kt +473 -0
- package/android/src/main/java/com/customcamera/gif/GifDecoder.kt +690 -0
- package/android/src/main/java/com/customcamera/gif/GifFramesDrawable.kt +160 -0
- package/android/src/main/java/com/customcamera/gif/GifHttp.kt +112 -0
- package/android/src/main/java/com/customcamera/gif/GifImageLoader.kt +186 -0
- package/android/src/main/java/com/customcamera/gif/GifModels.kt +74 -0
- package/android/src/main/java/com/customcamera/gif/GifProvider.kt +49 -0
- package/android/src/main/java/com/customcamera/gif/GifProviders.kt +27 -0
- package/android/src/main/java/com/customcamera/gif/GifRepository.kt +124 -0
- package/android/src/main/java/com/customcamera/gif/GifSafety.kt +33 -0
- package/android/src/main/java/com/customcamera/gif/GiphyGifProvider.kt +146 -0
- package/android/src/main/java/com/customcamera/gif/LZWEncoder.kt +258 -0
- package/android/src/main/java/com/customcamera/gif/NeuQuant.kt +435 -0
- package/android/src/main/java/com/customcamera/gif/TenorGifProvider.kt +147 -0
- package/android/src/main/res/drawable/bg_brush_selected.xml +5 -0
- package/android/src/main/res/drawable/bg_color_swatch.xml +5 -0
- package/android/src/main/res/drawable/bg_editor_toolbar.xml +6 -0
- package/android/src/main/res/drawable/bg_icon_circle.xml +5 -0
- package/android/src/main/res/drawable/bg_icon_circle_light.xml +5 -0
- package/android/src/main/res/drawable/bg_mode_tab_active.xml +6 -0
- package/android/src/main/res/drawable/bg_pill.xml +6 -0
- package/android/src/main/res/drawable/bg_recording_dot.xml +6 -0
- package/android/src/main/res/drawable/bg_selection_badge.xml +8 -0
- package/android/src/main/res/drawable/bg_send_button.xml +5 -0
- package/android/src/main/res/drawable/bg_shutter_inner.xml +5 -0
- package/android/src/main/res/drawable/bg_shutter_recording.xml +6 -0
- package/android/src/main/res/drawable/bg_shutter_ring.xml +8 -0
- package/android/src/main/res/drawable/bg_shutter_video_idle.xml +5 -0
- package/android/src/main/res/drawable/bg_thumbnail.xml +9 -0
- package/android/src/main/res/drawable/ic_aspect_ratio.xml +17 -0
- package/android/src/main/res/drawable/ic_audio.xml +10 -0
- package/android/src/main/res/drawable/ic_back.xml +10 -0
- package/android/src/main/res/drawable/ic_brush_medium.xml +12 -0
- package/android/src/main/res/drawable/ic_brush_thick.xml +12 -0
- package/android/src/main/res/drawable/ic_brush_thin.xml +12 -0
- package/android/src/main/res/drawable/ic_check.xml +17 -0
- package/android/src/main/res/drawable/ic_chevron_down.xml +10 -0
- package/android/src/main/res/drawable/ic_chevron_up.xml +13 -0
- package/android/src/main/res/drawable/ic_clear_drawing.xml +10 -0
- package/android/src/main/res/drawable/ic_close.xml +10 -0
- package/android/src/main/res/drawable/ic_cover.xml +9 -0
- package/android/src/main/res/drawable/ic_crop.xml +10 -0
- package/android/src/main/res/drawable/ic_delete.xml +9 -0
- package/android/src/main/res/drawable/ic_document.xml +10 -0
- package/android/src/main/res/drawable/ic_done.xml +10 -0
- package/android/src/main/res/drawable/ic_download.xml +10 -0
- package/android/src/main/res/drawable/ic_emoji.xml +10 -0
- package/android/src/main/res/drawable/ic_filter.xml +10 -0
- package/android/src/main/res/drawable/ic_flash_auto.xml +7 -0
- package/android/src/main/res/drawable/ic_flash_off.xml +23 -0
- package/android/src/main/res/drawable/ic_flash_on.xml +16 -0
- package/android/src/main/res/drawable/ic_flip.xml +15 -0
- package/android/src/main/res/drawable/ic_gallery.xml +10 -0
- package/android/src/main/res/drawable/ic_gif.xml +24 -0
- package/android/src/main/res/drawable/ic_lock.xml +19 -0
- package/android/src/main/res/drawable/ic_lock_open.xml +22 -0
- package/android/src/main/res/drawable/ic_marker.xml +10 -0
- package/android/src/main/res/drawable/ic_more_vert.xml +18 -0
- package/android/src/main/res/drawable/ic_overlay_close.xml +19 -0
- package/android/src/main/res/drawable/ic_overlay_resize.xml +18 -0
- package/android/src/main/res/drawable/ic_pause.xml +10 -0
- package/android/src/main/res/drawable/ic_photo_mode.xml +10 -0
- package/android/src/main/res/drawable/ic_play.xml +10 -0
- package/android/src/main/res/drawable/ic_redo.xml +10 -0
- package/android/src/main/res/drawable/ic_rotate.xml +9 -0
- package/android/src/main/res/drawable/ic_send.xml +10 -0
- package/android/src/main/res/drawable/ic_share.xml +10 -0
- package/android/src/main/res/drawable/ic_stat_upload.xml +10 -0
- package/android/src/main/res/drawable/ic_sticker.xml +24 -0
- package/android/src/main/res/drawable/ic_text.xml +10 -0
- package/android/src/main/res/drawable/ic_text_align_center.xml +11 -0
- package/android/src/main/res/drawable/ic_text_align_left.xml +11 -0
- package/android/src/main/res/drawable/ic_text_align_right.xml +11 -0
- package/android/src/main/res/drawable/ic_text_bg.xml +11 -0
- package/android/src/main/res/drawable/ic_trim.xml +23 -0
- package/android/src/main/res/drawable/ic_undo.xml +10 -0
- package/android/src/main/res/drawable/ic_video_mode.xml +10 -0
- package/android/src/main/res/drawable/ic_video_note.xml +13 -0
- package/android/src/main/res/drawable/ic_volume_off.xml +9 -0
- package/android/src/main/res/drawable/ic_volume_on.xml +9 -0
- package/android/src/main/res/drawable/sticker_heart.xml +9 -0
- package/android/src/main/res/drawable/sticker_smile.xml +9 -0
- package/android/src/main/res/drawable/sticker_star.xml +9 -0
- package/android/src/main/res/drawable/sticker_thumbsup.xml +9 -0
- package/android/src/main/res/values/colors.xml +34 -0
- package/android/src/main/res/values/ids.xml +15 -0
- package/android/src/main/res/values/strings.xml +15 -0
- package/android/src/main/res/values/styles.xml +20 -0
- package/android/src/main/res/xml/file_paths.xml +34 -0
- package/ios/CustomCamera.h +5 -0
- package/ios/CustomCamera.mm +214 -0
- package/lib/module/AudioPlayerContext.js +233 -0
- package/lib/module/AudioPlayerContext.js.map +1 -0
- package/lib/module/CameraPreview.js +304 -0
- package/lib/module/CameraPreview.js.map +1 -0
- package/lib/module/NativeAnimatedImageView.js +41 -0
- package/lib/module/NativeAnimatedImageView.js.map +1 -0
- package/lib/module/NativeAudioPlayerView.js +33 -0
- package/lib/module/NativeAudioPlayerView.js.map +1 -0
- package/lib/module/NativeBlurView.js +35 -0
- package/lib/module/NativeBlurView.js.map +1 -0
- package/lib/module/NativeCustomCamera.js +128 -0
- package/lib/module/NativeCustomCamera.js.map +1 -0
- package/lib/module/NativeCustomCamera.web.js +143 -0
- package/lib/module/NativeCustomCamera.web.js.map +1 -0
- package/lib/module/NativeCustomVideoView.js +5 -0
- package/lib/module/NativeCustomVideoView.js.map +1 -0
- package/lib/module/NativeDocumentPreviewView.js +156 -0
- package/lib/module/NativeDocumentPreviewView.js.map +1 -0
- package/lib/module/NativeMediaThumbnailView.js +110 -0
- package/lib/module/NativeMediaThumbnailView.js.map +1 -0
- package/lib/module/NativeSvgIcon.js +32 -0
- package/lib/module/NativeSvgIcon.js.map +1 -0
- package/lib/module/ResponsivePreviewContainer.js +171 -0
- package/lib/module/ResponsivePreviewContainer.js.map +1 -0
- package/lib/module/accessibility.js +61 -0
- package/lib/module/accessibility.js.map +1 -0
- package/lib/module/config.js +352 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/cpuOptimization.js +296 -0
- package/lib/module/cpuOptimization.js.map +1 -0
- package/lib/module/db/DatabaseManager.js +191 -0
- package/lib/module/db/DatabaseManager.js.map +1 -0
- package/lib/module/db/MediaMapper.js +284 -0
- package/lib/module/db/MediaMapper.js.map +1 -0
- package/lib/module/db/MediaRepository.js +242 -0
- package/lib/module/db/MediaRepository.js.map +1 -0
- package/lib/module/db/index.js +41 -0
- package/lib/module/db/index.js.map +1 -0
- package/lib/module/db/migrations.js +180 -0
- package/lib/module/db/migrations.js.map +1 -0
- package/lib/module/db/react-native-sqlcipher.d.js +2 -0
- package/lib/module/db/react-native-sqlcipher.d.js.map +1 -0
- package/lib/module/db/secureKey.js +87 -0
- package/lib/module/db/secureKey.js.map +1 -0
- package/lib/module/db/types.js +57 -0
- package/lib/module/db/types.js.map +1 -0
- package/lib/module/db/useMediaDatabase.js +123 -0
- package/lib/module/db/useMediaDatabase.js.map +1 -0
- package/lib/module/defaultIcons.js +2259 -0
- package/lib/module/defaultIcons.js.map +1 -0
- package/lib/module/deviceCapabilities.js +408 -0
- package/lib/module/deviceCapabilities.js.map +1 -0
- package/lib/module/errors.js +267 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/iconConfig.js +796 -0
- package/lib/module/iconConfig.js.map +1 -0
- package/lib/module/icons.js +514 -0
- package/lib/module/icons.js.map +1 -0
- package/lib/module/index.js +251 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/jest-globals.d.js +2 -0
- package/lib/module/jest-globals.d.js.map +1 -0
- package/lib/module/library/MediaLibrary.js +107 -0
- package/lib/module/library/MediaLibrary.js.map +1 -0
- package/lib/module/library/MediaLibraryScreen.js +2597 -0
- package/lib/module/library/MediaLibraryScreen.js.map +1 -0
- package/lib/module/library/components/AudioPreview.js +74 -0
- package/lib/module/library/components/AudioPreview.js.map +1 -0
- package/lib/module/library/components/DocumentPreview.js +331 -0
- package/lib/module/library/components/DocumentPreview.js.map +1 -0
- package/lib/module/library/components/ExpandableFab.js +343 -0
- package/lib/module/library/components/ExpandableFab.js.map +1 -0
- package/lib/module/library/components/FileTiles.js +251 -0
- package/lib/module/library/components/FileTiles.js.map +1 -0
- package/lib/module/library/components/ImagePreview.js +70 -0
- package/lib/module/library/components/ImagePreview.js.map +1 -0
- package/lib/module/library/components/MediaMetadataHeader.js +175 -0
- package/lib/module/library/components/MediaMetadataHeader.js.map +1 -0
- package/lib/module/library/components/RecordAudioScreen.js +816 -0
- package/lib/module/library/components/RecordAudioScreen.js.map +1 -0
- package/lib/module/library/components/VideoPreview.js +453 -0
- package/lib/module/library/components/VideoPreview.js.map +1 -0
- package/lib/module/library/components/ViewerCounter.js +55 -0
- package/lib/module/library/components/ViewerCounter.js.map +1 -0
- package/lib/module/library/compressionEstimate.js +507 -0
- package/lib/module/library/compressionEstimate.js.map +1 -0
- package/lib/module/library/fileMetadata.js +196 -0
- package/lib/module/library/fileMetadata.js.map +1 -0
- package/lib/module/library/index.js +42 -0
- package/lib/module/library/index.js.map +1 -0
- package/lib/module/library/libraryIconRegistry.js +69 -0
- package/lib/module/library/libraryIconRegistry.js.map +1 -0
- package/lib/module/library/libraryIcons.js +858 -0
- package/lib/module/library/libraryIcons.js.map +1 -0
- package/lib/module/library/localizedFormat.js +181 -0
- package/lib/module/library/localizedFormat.js.map +1 -0
- package/lib/module/library/palette.js +225 -0
- package/lib/module/library/palette.js.map +1 -0
- package/lib/module/library/responsive.js +53 -0
- package/lib/module/library/responsive.js.map +1 -0
- package/lib/module/locales.js +416 -0
- package/lib/module/locales.js.map +1 -0
- package/lib/module/localization.js +1064 -0
- package/lib/module/localization.js.map +1 -0
- package/lib/module/logger.js +20 -0
- package/lib/module/logger.js.map +1 -0
- package/lib/module/lowMemoryCache.js +206 -0
- package/lib/module/lowMemoryCache.js.map +1 -0
- package/lib/module/mediaHistory.js +33 -0
- package/lib/module/mediaHistory.js.map +1 -0
- package/lib/module/mediaStorageService.js +402 -0
- package/lib/module/mediaStorageService.js.map +1 -0
- package/lib/module/memory.js +79 -0
- package/lib/module/memory.js.map +1 -0
- package/lib/module/nativeActions.js +307 -0
- package/lib/module/nativeActions.js.map +1 -0
- package/lib/module/nativeComponentSupport.js +61 -0
- package/lib/module/nativeComponentSupport.js.map +1 -0
- package/lib/module/networkPerformance.js +24 -0
- package/lib/module/networkPerformance.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performance.js +104 -0
- package/lib/module/performance.js.map +1 -0
- package/lib/module/performanceMonitor.js +155 -0
- package/lib/module/performanceMonitor.js.map +1 -0
- package/lib/module/permissions.js +370 -0
- package/lib/module/permissions.js.map +1 -0
- package/lib/module/rendering.js +40 -0
- package/lib/module/rendering.js.map +1 -0
- package/lib/module/security.js +18 -0
- package/lib/module/security.js.map +1 -0
- package/lib/module/state.js +266 -0
- package/lib/module/state.js.map +1 -0
- package/lib/module/storage.js +400 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/theme.js +390 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +115 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/validation.js +288 -0
- package/lib/module/validation.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/AudioPlayerContext.d.ts +27 -0
- package/lib/typescript/src/AudioPlayerContext.d.ts.map +1 -0
- package/lib/typescript/src/CameraPreview.d.ts +13 -0
- package/lib/typescript/src/CameraPreview.d.ts.map +1 -0
- package/lib/typescript/src/NativeAnimatedImageView.d.ts +33 -0
- package/lib/typescript/src/NativeAnimatedImageView.d.ts.map +1 -0
- package/lib/typescript/src/NativeAudioPlayerView.d.ts +12 -0
- package/lib/typescript/src/NativeAudioPlayerView.d.ts.map +1 -0
- package/lib/typescript/src/NativeBlurView.d.ts +12 -0
- package/lib/typescript/src/NativeBlurView.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomCamera.d.ts +167 -0
- package/lib/typescript/src/NativeCustomCamera.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomCamera.web.d.ts +47 -0
- package/lib/typescript/src/NativeCustomCamera.web.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomVideoView.d.ts +30 -0
- package/lib/typescript/src/NativeCustomVideoView.d.ts.map +1 -0
- package/lib/typescript/src/NativeDocumentPreviewView.d.ts +48 -0
- package/lib/typescript/src/NativeDocumentPreviewView.d.ts.map +1 -0
- package/lib/typescript/src/NativeMediaThumbnailView.d.ts +54 -0
- package/lib/typescript/src/NativeMediaThumbnailView.d.ts.map +1 -0
- package/lib/typescript/src/NativeSvgIcon.d.ts +25 -0
- package/lib/typescript/src/NativeSvgIcon.d.ts.map +1 -0
- package/lib/typescript/src/ResponsivePreviewContainer.d.ts +92 -0
- package/lib/typescript/src/ResponsivePreviewContainer.d.ts.map +1 -0
- package/lib/typescript/src/accessibility.d.ts +20 -0
- package/lib/typescript/src/accessibility.d.ts.map +1 -0
- package/lib/typescript/src/config.d.ts +145 -0
- package/lib/typescript/src/config.d.ts.map +1 -0
- package/lib/typescript/src/cpuOptimization.d.ts +63 -0
- package/lib/typescript/src/cpuOptimization.d.ts.map +1 -0
- package/lib/typescript/src/db/DatabaseManager.d.ts +48 -0
- package/lib/typescript/src/db/DatabaseManager.d.ts.map +1 -0
- package/lib/typescript/src/db/MediaMapper.d.ts +77 -0
- package/lib/typescript/src/db/MediaMapper.d.ts.map +1 -0
- package/lib/typescript/src/db/MediaRepository.d.ts +66 -0
- package/lib/typescript/src/db/MediaRepository.d.ts.map +1 -0
- package/lib/typescript/src/db/index.d.ts +23 -0
- package/lib/typescript/src/db/index.d.ts.map +1 -0
- package/lib/typescript/src/db/migrations.d.ts +31 -0
- package/lib/typescript/src/db/migrations.d.ts.map +1 -0
- package/lib/typescript/src/db/secureKey.d.ts +10 -0
- package/lib/typescript/src/db/secureKey.d.ts.map +1 -0
- package/lib/typescript/src/db/types.d.ts +115 -0
- package/lib/typescript/src/db/types.d.ts.map +1 -0
- package/lib/typescript/src/db/useMediaDatabase.d.ts +41 -0
- package/lib/typescript/src/db/useMediaDatabase.d.ts.map +1 -0
- package/lib/typescript/src/defaultIcons.d.ts +139 -0
- package/lib/typescript/src/defaultIcons.d.ts.map +1 -0
- package/lib/typescript/src/deviceCapabilities.d.ts +92 -0
- package/lib/typescript/src/deviceCapabilities.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts +95 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/iconConfig.d.ts +176 -0
- package/lib/typescript/src/iconConfig.d.ts.map +1 -0
- package/lib/typescript/src/icons.d.ts +217 -0
- package/lib/typescript/src/icons.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +104 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/library/MediaLibrary.d.ts +57 -0
- package/lib/typescript/src/library/MediaLibrary.d.ts.map +1 -0
- package/lib/typescript/src/library/MediaLibraryScreen.d.ts +51 -0
- package/lib/typescript/src/library/MediaLibraryScreen.d.ts.map +1 -0
- package/lib/typescript/src/library/components/AudioPreview.d.ts +6 -0
- package/lib/typescript/src/library/components/AudioPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/DocumentPreview.d.ts +10 -0
- package/lib/typescript/src/library/components/DocumentPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ExpandableFab.d.ts +39 -0
- package/lib/typescript/src/library/components/ExpandableFab.d.ts.map +1 -0
- package/lib/typescript/src/library/components/FileTiles.d.ts +8 -0
- package/lib/typescript/src/library/components/FileTiles.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ImagePreview.d.ts +5 -0
- package/lib/typescript/src/library/components/ImagePreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts +16 -0
- package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts.map +1 -0
- package/lib/typescript/src/library/components/RecordAudioScreen.d.ts +8 -0
- package/lib/typescript/src/library/components/RecordAudioScreen.d.ts.map +1 -0
- package/lib/typescript/src/library/components/VideoPreview.d.ts +20 -0
- package/lib/typescript/src/library/components/VideoPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ViewerCounter.d.ts +13 -0
- package/lib/typescript/src/library/components/ViewerCounter.d.ts.map +1 -0
- package/lib/typescript/src/library/compressionEstimate.d.ts +313 -0
- package/lib/typescript/src/library/compressionEstimate.d.ts.map +1 -0
- package/lib/typescript/src/library/fileMetadata.d.ts +33 -0
- package/lib/typescript/src/library/fileMetadata.d.ts.map +1 -0
- package/lib/typescript/src/library/index.d.ts +40 -0
- package/lib/typescript/src/library/index.d.ts.map +1 -0
- package/lib/typescript/src/library/libraryIconRegistry.d.ts +35 -0
- package/lib/typescript/src/library/libraryIconRegistry.d.ts.map +1 -0
- package/lib/typescript/src/library/libraryIcons.d.ts +85 -0
- package/lib/typescript/src/library/libraryIcons.d.ts.map +1 -0
- package/lib/typescript/src/library/localizedFormat.d.ts +49 -0
- package/lib/typescript/src/library/localizedFormat.d.ts.map +1 -0
- package/lib/typescript/src/library/palette.d.ts +104 -0
- package/lib/typescript/src/library/palette.d.ts.map +1 -0
- package/lib/typescript/src/library/responsive.d.ts +15 -0
- package/lib/typescript/src/library/responsive.d.ts.map +1 -0
- package/lib/typescript/src/locales.d.ts +103 -0
- package/lib/typescript/src/locales.d.ts.map +1 -0
- package/lib/typescript/src/localization.d.ts +1051 -0
- package/lib/typescript/src/localization.d.ts.map +1 -0
- package/lib/typescript/src/logger.d.ts +4 -0
- package/lib/typescript/src/logger.d.ts.map +1 -0
- package/lib/typescript/src/lowMemoryCache.d.ts +64 -0
- package/lib/typescript/src/lowMemoryCache.d.ts.map +1 -0
- package/lib/typescript/src/mediaHistory.d.ts +3 -0
- package/lib/typescript/src/mediaHistory.d.ts.map +1 -0
- package/lib/typescript/src/mediaStorageService.d.ts +155 -0
- package/lib/typescript/src/mediaStorageService.d.ts.map +1 -0
- package/lib/typescript/src/memory.d.ts +21 -0
- package/lib/typescript/src/memory.d.ts.map +1 -0
- package/lib/typescript/src/nativeActions.d.ts +174 -0
- package/lib/typescript/src/nativeActions.d.ts.map +1 -0
- package/lib/typescript/src/nativeComponentSupport.d.ts +30 -0
- package/lib/typescript/src/nativeComponentSupport.d.ts.map +1 -0
- package/lib/typescript/src/networkPerformance.d.ts +12 -0
- package/lib/typescript/src/networkPerformance.d.ts.map +1 -0
- package/lib/typescript/src/performance.d.ts +32 -0
- package/lib/typescript/src/performance.d.ts.map +1 -0
- package/lib/typescript/src/performanceMonitor.d.ts +45 -0
- package/lib/typescript/src/performanceMonitor.d.ts.map +1 -0
- package/lib/typescript/src/permissions.d.ts +132 -0
- package/lib/typescript/src/permissions.d.ts.map +1 -0
- package/lib/typescript/src/rendering.d.ts +9 -0
- package/lib/typescript/src/rendering.d.ts.map +1 -0
- package/lib/typescript/src/security.d.ts +6 -0
- package/lib/typescript/src/security.d.ts.map +1 -0
- package/lib/typescript/src/state.d.ts +102 -0
- package/lib/typescript/src/state.d.ts.map +1 -0
- package/lib/typescript/src/storage.d.ts +117 -0
- package/lib/typescript/src/storage.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +15 -0
- package/lib/typescript/src/theme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +802 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +50 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/validation.d.ts +52 -0
- package/lib/typescript/src/validation.d.ts.map +1 -0
- package/package.json +204 -0
- package/react-native.config.js +17 -0
- package/src/AudioPlayerContext.tsx +220 -0
- package/src/CameraPreview.tsx +352 -0
- package/src/NativeAnimatedImageView.tsx +71 -0
- package/src/NativeAudioPlayerView.tsx +39 -0
- package/src/NativeBlurView.tsx +40 -0
- package/src/NativeCustomCamera.ts +305 -0
- package/src/NativeCustomCamera.web.ts +192 -0
- package/src/NativeCustomVideoView.ts +30 -0
- package/src/NativeDocumentPreviewView.tsx +196 -0
- package/src/NativeMediaThumbnailView.tsx +167 -0
- package/src/NativeSvgIcon.tsx +46 -0
- package/src/ResponsivePreviewContainer.tsx +227 -0
- package/src/accessibility.ts +80 -0
- package/src/config.ts +406 -0
- package/src/cpuOptimization.ts +365 -0
- package/src/db/DatabaseManager.ts +212 -0
- package/src/db/MediaMapper.ts +377 -0
- package/src/db/MediaRepository.ts +313 -0
- package/src/db/index.ts +73 -0
- package/src/db/migrations.ts +222 -0
- package/src/db/react-native-sqlcipher.d.ts +76 -0
- package/src/db/secureKey.ts +100 -0
- package/src/db/types.ts +123 -0
- package/src/db/useMediaDatabase.ts +191 -0
- package/src/defaultIcons.tsx +2390 -0
- package/src/deviceCapabilities.ts +438 -0
- package/src/errors.ts +350 -0
- package/src/iconConfig.tsx +962 -0
- package/src/icons.tsx +788 -0
- package/src/index.tsx +763 -0
- package/src/jest-globals.d.ts +9 -0
- package/src/library/MediaLibrary.tsx +141 -0
- package/src/library/MediaLibraryScreen.tsx +3003 -0
- package/src/library/components/AudioPreview.tsx +73 -0
- package/src/library/components/DocumentPreview.tsx +361 -0
- package/src/library/components/ExpandableFab.tsx +342 -0
- package/src/library/components/FileTiles.tsx +252 -0
- package/src/library/components/ImagePreview.tsx +72 -0
- package/src/library/components/MediaMetadataHeader.tsx +208 -0
- package/src/library/components/RecordAudioScreen.tsx +845 -0
- package/src/library/components/VideoPreview.tsx +478 -0
- package/src/library/components/ViewerCounter.tsx +71 -0
- package/src/library/compressionEstimate.ts +662 -0
- package/src/library/fileMetadata.ts +212 -0
- package/src/library/index.ts +66 -0
- package/src/library/libraryIconRegistry.tsx +86 -0
- package/src/library/libraryIcons.tsx +928 -0
- package/src/library/localizedFormat.ts +207 -0
- package/src/library/palette.ts +281 -0
- package/src/library/responsive.ts +49 -0
- package/src/locales.ts +381 -0
- package/src/localization.ts +1947 -0
- package/src/logger.ts +20 -0
- package/src/lowMemoryCache.ts +218 -0
- package/src/mediaHistory.ts +42 -0
- package/src/mediaStorageService.ts +546 -0
- package/src/memory.ts +102 -0
- package/src/nativeActions.ts +422 -0
- package/src/nativeComponentSupport.ts +60 -0
- package/src/networkPerformance.ts +30 -0
- package/src/performance.ts +137 -0
- package/src/performanceMonitor.ts +219 -0
- package/src/permissions.ts +403 -0
- package/src/rendering.ts +47 -0
- package/src/security.ts +19 -0
- package/src/state.ts +333 -0
- package/src/storage.ts +453 -0
- package/src/theme.tsx +467 -0
- package/src/types.ts +946 -0
- package/src/utils.ts +177 -0
- package/src/validation.ts +372 -0
|
@@ -0,0 +1,1051 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
export interface CameraTranslations {
|
|
4
|
+
all: string;
|
|
5
|
+
photos: string;
|
|
6
|
+
videos: string;
|
|
7
|
+
documents: string;
|
|
8
|
+
cancel: string;
|
|
9
|
+
done: string;
|
|
10
|
+
ok: string;
|
|
11
|
+
use: string;
|
|
12
|
+
trim: string;
|
|
13
|
+
selectCover: string;
|
|
14
|
+
add: string;
|
|
15
|
+
addMore: string;
|
|
16
|
+
/** The "Add more" button on the editor's media strip, `+` prefix included. */
|
|
17
|
+
addMorePlus: string;
|
|
18
|
+
/** Position of the visible item in a multi-item preview, e.g. `2/5`. */
|
|
19
|
+
mediaCounter: string;
|
|
20
|
+
/** The selected trim range under a video, e.g. `0:03 – 0:12`. */
|
|
21
|
+
trimRangeLabel: string;
|
|
22
|
+
/** A zero timestamp, shown before a clip's duration is known. */
|
|
23
|
+
durationZero: string;
|
|
24
|
+
/**
|
|
25
|
+
* File-size units. `{0}` is the number, already formatted with the active
|
|
26
|
+
* language's digits and decimal separator — translate only the unit itself.
|
|
27
|
+
*/
|
|
28
|
+
fileSizeBytes: string;
|
|
29
|
+
fileSizeKb: string;
|
|
30
|
+
fileSizeMb: string;
|
|
31
|
+
fileSizeGb: string;
|
|
32
|
+
/**
|
|
33
|
+
* Date pattern for the gallery's day headers, in Android `SimpleDateFormat`
|
|
34
|
+
* syntax. Month and day names come from the active language automatically;
|
|
35
|
+
* override this only to change field order, e.g. `dd MMM yyyy`.
|
|
36
|
+
*/
|
|
37
|
+
dateFormatPattern: string;
|
|
38
|
+
openSettings: string;
|
|
39
|
+
close: string;
|
|
40
|
+
back: string;
|
|
41
|
+
send: string;
|
|
42
|
+
save: string;
|
|
43
|
+
delete: string;
|
|
44
|
+
deleteFile: string;
|
|
45
|
+
clear: string;
|
|
46
|
+
clearFilter: string;
|
|
47
|
+
/** Filter-picker "None" label while a filter is active; `{0}` = filter name. */
|
|
48
|
+
filterClearSuffix: string;
|
|
49
|
+
audio: string;
|
|
50
|
+
document: string;
|
|
51
|
+
openingCamera: string;
|
|
52
|
+
initializingCamera: string;
|
|
53
|
+
gallery: string;
|
|
54
|
+
selectedCount: string;
|
|
55
|
+
openGallery: string;
|
|
56
|
+
openWith: string;
|
|
57
|
+
libraryEmptyTitle: string;
|
|
58
|
+
libraryEmptyMessage: string;
|
|
59
|
+
/** `ACTION_SEND` chooser title on Android (the native share-sheet header). */
|
|
60
|
+
share: string;
|
|
61
|
+
photoMode: string;
|
|
62
|
+
videoMode: string;
|
|
63
|
+
recording: string;
|
|
64
|
+
shutterCapture: string;
|
|
65
|
+
shutterHoldToRecord: string;
|
|
66
|
+
holdForVideo: string;
|
|
67
|
+
slideUpToLock: string;
|
|
68
|
+
slideToCancel: string;
|
|
69
|
+
cancelRecording: string;
|
|
70
|
+
releaseToCancel: string;
|
|
71
|
+
recordingLocked: string;
|
|
72
|
+
flashOn: string;
|
|
73
|
+
flashOff: string;
|
|
74
|
+
switchCamera: string;
|
|
75
|
+
toggleFlashlight: string;
|
|
76
|
+
pointCameraAtBarcode: string;
|
|
77
|
+
closeScanner: string;
|
|
78
|
+
permissionRequiredTitle: string;
|
|
79
|
+
permissionRequiredMessage: string;
|
|
80
|
+
/**
|
|
81
|
+
* Permissions are requested just-in-time, one feature at a time: the camera on launch, the
|
|
82
|
+
* gallery on the first gallery open, the microphone on the first video recording. Each of
|
|
83
|
+
* those has its own "permanently denied" copy so the message names only what is missing.
|
|
84
|
+
*/
|
|
85
|
+
permissionCameraRequiredMessage: string;
|
|
86
|
+
permissionMediaRequiredTitle: string;
|
|
87
|
+
permissionMediaRequiredMessage: string;
|
|
88
|
+
/**
|
|
89
|
+
* Native pre-permission rationale shown BEFORE the camera's system permission dialog.
|
|
90
|
+
* Its whole purpose is to steer the user to the persistent "While using the app" grant
|
|
91
|
+
* rather than the one-time "Only this time" option — the latter is revoked on process
|
|
92
|
+
* death / reboot and forces a re-prompt on the next cold start.
|
|
93
|
+
*/
|
|
94
|
+
permissionRationaleCameraPersistentMessage: string;
|
|
95
|
+
/** Positive button on the native pre-permission rationale ("Continue"). */
|
|
96
|
+
permissionContinue: string;
|
|
97
|
+
/**
|
|
98
|
+
* Default rationale texts for the JS-side `PermissionsAndroid` flow
|
|
99
|
+
* (`requestCameraPermission` / `requestStoragePermission` /
|
|
100
|
+
* `requestMicrophonePermission`). The native in-camera permission dialogs use
|
|
101
|
+
* the `permission*Required*` keys above; these cover hosts that request
|
|
102
|
+
* permission ahead of time through the exported helpers.
|
|
103
|
+
*/
|
|
104
|
+
permissionRationaleCameraTitle: string;
|
|
105
|
+
permissionRationaleCameraMessage: string;
|
|
106
|
+
permissionRationaleStorageTitle: string;
|
|
107
|
+
permissionRationaleStorageMessage: string;
|
|
108
|
+
permissionRationaleMicrophoneTitle: string;
|
|
109
|
+
permissionRationaleMicrophoneMessage: string;
|
|
110
|
+
/** Positive button on the JS permission rationale. */
|
|
111
|
+
permissionGrant: string;
|
|
112
|
+
/** Negative button on the JS permission rationale. */
|
|
113
|
+
permissionDeny: string;
|
|
114
|
+
cameraUnavailable: string;
|
|
115
|
+
cameraNotFound: string;
|
|
116
|
+
cameraInitializationFailed: string;
|
|
117
|
+
cameraPermissionDenied: string;
|
|
118
|
+
cameraPermissionRequired: string;
|
|
119
|
+
tapToScan: string;
|
|
120
|
+
preparingVideo: string;
|
|
121
|
+
selectionTooShort: string;
|
|
122
|
+
trimming: string;
|
|
123
|
+
trimFailed: string;
|
|
124
|
+
cropping: string;
|
|
125
|
+
cropFailed: string;
|
|
126
|
+
savingCover: string;
|
|
127
|
+
couldNotSetCover: string;
|
|
128
|
+
coverUpdated: string;
|
|
129
|
+
saving: string;
|
|
130
|
+
savedToGallery: string;
|
|
131
|
+
failedToSaveMedia: string;
|
|
132
|
+
sending: string;
|
|
133
|
+
failedToSendMedia: string;
|
|
134
|
+
couldNotSaveEditsSendingOriginal: string;
|
|
135
|
+
sendFailed: string;
|
|
136
|
+
sendFailedWithMessage: string;
|
|
137
|
+
addTextTitle: string;
|
|
138
|
+
addTextButton: string;
|
|
139
|
+
typeTextHint: string;
|
|
140
|
+
sizeLabel: string;
|
|
141
|
+
drawOnImage: string;
|
|
142
|
+
preparing: string;
|
|
143
|
+
couldNotPrepareEditsForCropping: string;
|
|
144
|
+
useTwoFingersToResizeOrRotate: string;
|
|
145
|
+
operationTimedOut: string;
|
|
146
|
+
audioMuted: string;
|
|
147
|
+
audioOn: string;
|
|
148
|
+
compressVideo: string;
|
|
149
|
+
originalVideo: string;
|
|
150
|
+
/** The overflow menu's compression row on a still preview, the counterpart of `compressVideo`. */
|
|
151
|
+
compressImage: string;
|
|
152
|
+
/** The still menu's first row: send the image at its original size. */
|
|
153
|
+
originalImage: string;
|
|
154
|
+
/**
|
|
155
|
+
* The overflow menu's quality-strategy row, and its accessibility label. Governs what BOTH
|
|
156
|
+
* Compress and Save As produce; its applied value is one of the three `profile*` names below.
|
|
157
|
+
*/
|
|
158
|
+
compressionProfile: string;
|
|
159
|
+
/**
|
|
160
|
+
* The default quality strategy: the balance of size, quality, speed and RAM chosen for the
|
|
161
|
+
* device it runs on.
|
|
162
|
+
*/
|
|
163
|
+
profileRecommended: string;
|
|
164
|
+
/**
|
|
165
|
+
* Result message when no re-encode of a still came out smaller than the original — there is
|
|
166
|
+
* nothing left to compress, so the original is kept. Not an error.
|
|
167
|
+
*/
|
|
168
|
+
compressionAlreadyMinimal: string;
|
|
169
|
+
/**
|
|
170
|
+
* A compression dropdown row plus the size it is expected to produce; `{0}` = the row's
|
|
171
|
+
* label, `{1}` = the formatted size. The tilde marks it as an estimate.
|
|
172
|
+
*/
|
|
173
|
+
compressEstimatedSize: string;
|
|
174
|
+
/**
|
|
175
|
+
* The "Original video" / "Original image" row plus its real file size; `{0}` = label,
|
|
176
|
+
* `{1}` = formatted size.
|
|
177
|
+
*/
|
|
178
|
+
compressOriginalSize: string;
|
|
179
|
+
/**
|
|
180
|
+
* Two formatted sizes as one span, for a compression row whose output is predicted as a range
|
|
181
|
+
* rather than a single figure; `{0}` = the low end, `{1}` = the high end.
|
|
182
|
+
*
|
|
183
|
+
* A clip is re-encoded at a TARGET bit rate, which the encoder spends around rather than hits
|
|
184
|
+
* exactly, so its predicted size is honestly a band ("5.8 – 7.1 MB"). The low end drops the unit
|
|
185
|
+
* when both ends share one, so translations should keep `{0}` unit-less. Wrapped by
|
|
186
|
+
* `compressOriginalSize`, since the band already reads as an approximation and does not also take
|
|
187
|
+
* the tilde.
|
|
188
|
+
*/
|
|
189
|
+
compressSizeRange: string;
|
|
190
|
+
/**
|
|
191
|
+
* The message shown when a compression finishes; `{0}` = the formatted output size, `{1}` = whole
|
|
192
|
+
* percent smaller than the original.
|
|
193
|
+
*
|
|
194
|
+
* A STILL quotes its two REAL files (the copy just written and the source it came from): a still
|
|
195
|
+
* is a byte-target search that lands on the size the menu quoted, so the measured figure is right.
|
|
196
|
+
* A CLIP is quoted PROPORTIONALLY instead — the original with the chosen percent removed, and the
|
|
197
|
+
* chosen percent as the saving — because a video transcode copies the audio + container through
|
|
198
|
+
* untouched, so its produced file stays well above the picked level at 70–99% and reads as the
|
|
199
|
+
* wrong size; the menu quotes that same proportion, so the two agree and "N% smaller" always means
|
|
200
|
+
* "N% of the original removed". Neither comes from the tilde-marked estimate ladder. A translation
|
|
201
|
+
* must keep both placeholders.
|
|
202
|
+
*/
|
|
203
|
+
compressedToSize: string;
|
|
204
|
+
/**
|
|
205
|
+
* The same message without a saving; `{0}` = the compressed file's formatted size. Used when the
|
|
206
|
+
* original's size cannot be measured, and when the copy did not actually come out smaller —
|
|
207
|
+
* quoting "0% smaller" in either case would state something untrue.
|
|
208
|
+
*/
|
|
209
|
+
compressedToSizeOnly: string;
|
|
210
|
+
/** Shown when a compression could not produce a usable file. */
|
|
211
|
+
compressionFailed: string;
|
|
212
|
+
/**
|
|
213
|
+
* The compression progress overlay: a single centred line counting the ESTIMATED time
|
|
214
|
+
* remaining down to one second; `{0}` = whole seconds left.
|
|
215
|
+
*/
|
|
216
|
+
compressingSecondsLeft: string;
|
|
217
|
+
/**
|
|
218
|
+
* The line that replaces the countdown when the encode outlives its estimate, shown until it
|
|
219
|
+
* finishes rather than letting the count run past zero. Shared by compressions and "Export By"
|
|
220
|
+
* conversions, whose tails are equally unmeasurable.
|
|
221
|
+
*/
|
|
222
|
+
finalizingCompression: string;
|
|
223
|
+
/**
|
|
224
|
+
* The compression dropdown row and the applied-value badge, labelled as a QUALITY level;
|
|
225
|
+
* `{0}` = the percentage of the original quality kept (5..99, lower = stronger compression).
|
|
226
|
+
*/
|
|
227
|
+
compressActiveLabel: string;
|
|
228
|
+
/**
|
|
229
|
+
* Deprecated: the compression rows now read as a quality level via `compressActiveLabel`. Kept
|
|
230
|
+
* for backward compatibility with hosts that still translate it; no longer shown by the plugin.
|
|
231
|
+
*/
|
|
232
|
+
compressSmallerByPercent: string;
|
|
233
|
+
/**
|
|
234
|
+
* Accessibility suffix for the currently selected row of a menu/dropdown;
|
|
235
|
+
* `{0}` = the row's label.
|
|
236
|
+
*/
|
|
237
|
+
selectedOption: string;
|
|
238
|
+
/**
|
|
239
|
+
* The preview header's "⋮" overflow button, which holds both output settings (compression and
|
|
240
|
+
* format conversion). Used as its accessibility label while neither is applied — once one is,
|
|
241
|
+
* the button announces the applied value via `compressActiveDesc` / `exportActiveDesc` instead.
|
|
242
|
+
*/
|
|
243
|
+
moreOptions: string;
|
|
244
|
+
/** The overflow menu's row for format conversion, and its label while none is applied. */
|
|
245
|
+
exportBy: string;
|
|
246
|
+
/** Overflow-button accessibility label once a format is applied; `{0}` = format name. */
|
|
247
|
+
exportActiveDesc: string;
|
|
248
|
+
/** The menu's first row: send the media in the format it already is. */
|
|
249
|
+
originalFormat: string;
|
|
250
|
+
/**
|
|
251
|
+
* Retained for translation bundles that already carry it. The conversion no longer shows a
|
|
252
|
+
* static label: it counts the remaining time down with `convertingSecondsLeft`, exactly as a
|
|
253
|
+
* compression does.
|
|
254
|
+
*/
|
|
255
|
+
exportingMedia: string;
|
|
256
|
+
/**
|
|
257
|
+
* The "Export By" progress overlay — the same single centred countdown line the compression
|
|
258
|
+
* overlay shows, phrased for a format conversion; `{0}` = whole seconds left. When the encode
|
|
259
|
+
* outlives its estimate this hands over to `finalizingCompression`, which both jobs share.
|
|
260
|
+
*/
|
|
261
|
+
convertingSecondsLeft: string;
|
|
262
|
+
exportFailed: string;
|
|
263
|
+
/** Result toast; `{0}` = format name. */
|
|
264
|
+
exportedTo: string;
|
|
265
|
+
/** Result toast with size; `{0}` = format name, `{1}` = formatted file size. */
|
|
266
|
+
exportedToFormat: string;
|
|
267
|
+
/**
|
|
268
|
+
* Result toast when the target container cannot carry the source's audio codec
|
|
269
|
+
* (WebM takes only Vorbis/Opus); `{0}` and `{1}` are both the format name.
|
|
270
|
+
*/
|
|
271
|
+
exportedAudioDropped: string;
|
|
272
|
+
/** Confirmation body shown before exporting an animated GIF, which flattens it. */
|
|
273
|
+
convertGifExportMessage: string;
|
|
274
|
+
/** Confirmation body shown before compressing an animated GIF, which flattens it. */
|
|
275
|
+
convertGifCompressMessage: string;
|
|
276
|
+
/** Confirmation title shown before flattening an animated GIF into a still. */
|
|
277
|
+
convertGifTitle: string;
|
|
278
|
+
/** Negative button on that confirmation: keep the animated GIF as-is. */
|
|
279
|
+
keepAnimation: string;
|
|
280
|
+
/** Positive button on that confirmation: flatten the GIF to a still image. */
|
|
281
|
+
convertToImage: string;
|
|
282
|
+
clearAppliedFilter: string;
|
|
283
|
+
toggleAudio: string;
|
|
284
|
+
trimVideo: string;
|
|
285
|
+
rotate90Degrees: string;
|
|
286
|
+
/** Content description of the Crop screen's aspect-ratio button (next to Rotate). */
|
|
287
|
+
cropAspectRatio: string;
|
|
288
|
+
/**
|
|
289
|
+
* Crop aspect-ratio option that locks nothing, letting the crop box take any shape.
|
|
290
|
+
* The other options are the image's own shape (`aspectRatioOriginal`) and plain numeric
|
|
291
|
+
* ratios ("1:1", "4:3", …), which are the same in every language and so are not keys.
|
|
292
|
+
*/
|
|
293
|
+
cropAspectFree: string;
|
|
294
|
+
noStickersAvailable: string;
|
|
295
|
+
noEmojisAvailable: string;
|
|
296
|
+
filterClearLabel: string;
|
|
297
|
+
emptyFile: string;
|
|
298
|
+
previewTruncated: string;
|
|
299
|
+
unsupportedPreviewKind: string;
|
|
300
|
+
fileNotPreviewableText: string;
|
|
301
|
+
couldNotOpenPdf: string;
|
|
302
|
+
cannotOpenDocumentStream: string;
|
|
303
|
+
couldNotReadFile: string;
|
|
304
|
+
webViewUnavailable: string;
|
|
305
|
+
notDecodableImage: string;
|
|
306
|
+
couldNotDecodeImage: string;
|
|
307
|
+
documentPreviewUnavailable: string;
|
|
308
|
+
filterNone: string;
|
|
309
|
+
filterAuto: string;
|
|
310
|
+
filterGray: string;
|
|
311
|
+
filterNegative: string;
|
|
312
|
+
filterBright: string;
|
|
313
|
+
filterContrast: string;
|
|
314
|
+
filterSharpen: string;
|
|
315
|
+
filterFilm: string;
|
|
316
|
+
filterTint: string;
|
|
317
|
+
filterVignette: string;
|
|
318
|
+
filterSoft: string;
|
|
319
|
+
filterDark: string;
|
|
320
|
+
filterLight: string;
|
|
321
|
+
filterDesaturate: string;
|
|
322
|
+
filterEnhance: string;
|
|
323
|
+
filterCinematic: string;
|
|
324
|
+
filterBW: string;
|
|
325
|
+
filterSepia: string;
|
|
326
|
+
filterVintage: string;
|
|
327
|
+
filterCool: string;
|
|
328
|
+
filterWarm: string;
|
|
329
|
+
filterSaturate: string;
|
|
330
|
+
filterFade: string;
|
|
331
|
+
filterVivid: string;
|
|
332
|
+
filterNormal75: string;
|
|
333
|
+
categoryClassic: string;
|
|
334
|
+
categoryFaces: string;
|
|
335
|
+
categoryLove: string;
|
|
336
|
+
categoryCelebration: string;
|
|
337
|
+
categoryAnimals: string;
|
|
338
|
+
categoryFood: string;
|
|
339
|
+
categoryVibes: string;
|
|
340
|
+
categorySmileys: string;
|
|
341
|
+
categoryPeople: string;
|
|
342
|
+
categoryAnimalsAndNature: string;
|
|
343
|
+
categoryFoodAndDrink: string;
|
|
344
|
+
categoryActivities: string;
|
|
345
|
+
categoryTravelAndPlaces: string;
|
|
346
|
+
categoryObjects: string;
|
|
347
|
+
categorySymbols: string;
|
|
348
|
+
categoryFlags: string;
|
|
349
|
+
categoryRecent: string;
|
|
350
|
+
uploadProgressTitle: string;
|
|
351
|
+
uploadProgressDescription: string;
|
|
352
|
+
uploadStatusTitle: string;
|
|
353
|
+
uploadStatusDescription: string;
|
|
354
|
+
uploadInterruptedTitle: string;
|
|
355
|
+
uploadInterruptedMessage: string;
|
|
356
|
+
uploadRetrying: string;
|
|
357
|
+
uploadCompletedTitle: string;
|
|
358
|
+
uploadCompletedMessage: string;
|
|
359
|
+
uploadFailedTitle: string;
|
|
360
|
+
uploadFailedMessage: string;
|
|
361
|
+
uploadingFileProgress: string;
|
|
362
|
+
preparingFilesProgress: string;
|
|
363
|
+
uploadingMediaTitle: string;
|
|
364
|
+
validationSelectionLimitNonNegativeInteger: string;
|
|
365
|
+
validationInitialCameraInvalid: string;
|
|
366
|
+
validationMediaTypesInvalid: string;
|
|
367
|
+
validationHoldToRecordDelayInvalid: string;
|
|
368
|
+
validationMinRecordDurationInvalid: string;
|
|
369
|
+
validationUrisMustBeArray: string;
|
|
370
|
+
validationUrisCannotBeEmpty: string;
|
|
371
|
+
validationTooManyFiles: string;
|
|
372
|
+
validationInvalidUriAtIndex: string;
|
|
373
|
+
validationAlbumNameRequired: string;
|
|
374
|
+
validationAlbumNameTooLong: string;
|
|
375
|
+
validationAlbumNameInvalidCharacters: string;
|
|
376
|
+
validationCaptionMustBeString: string;
|
|
377
|
+
validationCaptionTooLong: string;
|
|
378
|
+
validationDelayMustBeNumber: string;
|
|
379
|
+
validationDelayCannotBeNegative: string;
|
|
380
|
+
validationDelayTooLong: string;
|
|
381
|
+
validationStartTimeInvalid: string;
|
|
382
|
+
validationEndTimeInvalid: string;
|
|
383
|
+
validationStartBeforeEnd: string;
|
|
384
|
+
validationTrimDurationTooLong: string;
|
|
385
|
+
validationUploadUrlRequired: string;
|
|
386
|
+
validationUploadUrlInvalid: string;
|
|
387
|
+
validationFileTooLarge: string;
|
|
388
|
+
validationAlbumIdRequired: string;
|
|
389
|
+
validationAlbumIdTooLong: string;
|
|
390
|
+
validationDegreesMustBeNumber: string;
|
|
391
|
+
validationDegreesInvalid: string;
|
|
392
|
+
validationWidthPositive: string;
|
|
393
|
+
validationHeightPositive: string;
|
|
394
|
+
validationXNumber: string;
|
|
395
|
+
validationYNumber: string;
|
|
396
|
+
validationFilterTypeInvalid: string;
|
|
397
|
+
validationFlashModeInvalid: string;
|
|
398
|
+
validationFaceEffectInvalid: string;
|
|
399
|
+
validationThemeInvalid: string;
|
|
400
|
+
errorCameraPermission: string;
|
|
401
|
+
errorPleaseEnableCameraPermission: string;
|
|
402
|
+
errorMicrophonePermission: string;
|
|
403
|
+
/** Shown when the mic is declined at record time — the clip is recorded silently, not blocked. */
|
|
404
|
+
errorMicrophoneDeniedSilentVideo: string;
|
|
405
|
+
errorStoragePermission: string;
|
|
406
|
+
/** Shown when the gallery permission is declined; the camera itself stays usable. */
|
|
407
|
+
errorGalleryPermission: string;
|
|
408
|
+
errorInvalidUri: string;
|
|
409
|
+
errorFileNotFound: string;
|
|
410
|
+
errorFileTooLarge: string;
|
|
411
|
+
errorOperationCancelled: string;
|
|
412
|
+
errorCameraUnavailable: string;
|
|
413
|
+
errorInsufficientStorage: string;
|
|
414
|
+
/** Refusal shown when a recording is started with too little free space to be worth beginning. */
|
|
415
|
+
errorStorageFullVideo: string;
|
|
416
|
+
/** Shown when a recording ends early because the volume filled up. What was recorded is kept. */
|
|
417
|
+
noticeStorageFullStopped: string;
|
|
418
|
+
/** Title of the blocking dialog raised when low storage ends a recording in flight. */
|
|
419
|
+
storageAlmostFullTitle: string;
|
|
420
|
+
/** Body of that dialog. The clip is already finalized by the time it is shown. */
|
|
421
|
+
storageAlmostFullMessage: string;
|
|
422
|
+
/** Title of the blocking dialog raised when low MEMORY ends a recording in flight. */
|
|
423
|
+
memoryCriticalTitle: string;
|
|
424
|
+
/** Body of that dialog. The clip is already finalized by the time it is shown. */
|
|
425
|
+
memoryCriticalMessage: string;
|
|
426
|
+
/** Sole button on that dialog; advances to the editor with the recorded clip. */
|
|
427
|
+
next: string;
|
|
428
|
+
/** Shown when the encoder failed and the clip could not be saved at all. */
|
|
429
|
+
errorRecordingFailed: string;
|
|
430
|
+
errorNetworkUnavailable: string;
|
|
431
|
+
errorUploadFailed: string;
|
|
432
|
+
/** Shown when a photo/video picked from the gallery can't be opened in the editor. */
|
|
433
|
+
errorMediaLoadFailed: string;
|
|
434
|
+
errorUnknown: string;
|
|
435
|
+
statusReady: string;
|
|
436
|
+
statusProcessingWithProgress: string;
|
|
437
|
+
statusProcessing: string;
|
|
438
|
+
statusSuccess: string;
|
|
439
|
+
statusUnknown: string;
|
|
440
|
+
/** Camera flash "auto" label (fixes pre-existing default without interface member). */
|
|
441
|
+
flashAuto: string;
|
|
442
|
+
unknown: string;
|
|
443
|
+
untitled: string;
|
|
444
|
+
preview: string;
|
|
445
|
+
media: string;
|
|
446
|
+
image: string;
|
|
447
|
+
video: string;
|
|
448
|
+
deleteConfirmTitle: string;
|
|
449
|
+
deleteConfirmMessage: string;
|
|
450
|
+
notSecurelyErasedTitle: string;
|
|
451
|
+
notSecurelyErasedMessage: string;
|
|
452
|
+
deleteMedia: string;
|
|
453
|
+
shareMedia: string;
|
|
454
|
+
toolFilter: string;
|
|
455
|
+
toolCrop: string;
|
|
456
|
+
toolText: string;
|
|
457
|
+
toolEmoji: string;
|
|
458
|
+
toolGrid: string;
|
|
459
|
+
emoji: string;
|
|
460
|
+
stickers: string;
|
|
461
|
+
toolGif: string;
|
|
462
|
+
gifPickerTitle: string;
|
|
463
|
+
gifSearchPlaceholder: string;
|
|
464
|
+
gifTrending: string;
|
|
465
|
+
gifCategories: string;
|
|
466
|
+
noGifsFound: string;
|
|
467
|
+
gifLoadError: string;
|
|
468
|
+
gifOfflineError: string;
|
|
469
|
+
gifNotConfigured: string;
|
|
470
|
+
gifRateLimited: string;
|
|
471
|
+
gifLoading: string;
|
|
472
|
+
deleteGif: string;
|
|
473
|
+
categoryGestures: string;
|
|
474
|
+
playVideo: string;
|
|
475
|
+
pauseVideo: string;
|
|
476
|
+
deleteSticker: string;
|
|
477
|
+
closeEditor: string;
|
|
478
|
+
download: string;
|
|
479
|
+
selectedVideo: string;
|
|
480
|
+
selectedPhoto: string;
|
|
481
|
+
removeSelectedItem: string;
|
|
482
|
+
addMoreMedia: string;
|
|
483
|
+
compressingPleaseWait: string;
|
|
484
|
+
compressingEllipsis: string;
|
|
485
|
+
selectFilterTitle: string;
|
|
486
|
+
filterAccessibilityLabel: string;
|
|
487
|
+
closeFilters: string;
|
|
488
|
+
recordAudio: string;
|
|
489
|
+
browseAudio: string;
|
|
490
|
+
camera: string;
|
|
491
|
+
closeActionsMenu: string;
|
|
492
|
+
openActionsMenu: string;
|
|
493
|
+
micPermanentlyDenied: string;
|
|
494
|
+
micPermissionDenied: string;
|
|
495
|
+
micPermissionRequestFailed: string;
|
|
496
|
+
failedToStartRecording: string;
|
|
497
|
+
micPermissionNotGranted: string;
|
|
498
|
+
recordingTooShort: string;
|
|
499
|
+
failedToSaveRecording: string;
|
|
500
|
+
requestingPermission: string;
|
|
501
|
+
allowMicAccess: string;
|
|
502
|
+
recordingError: string;
|
|
503
|
+
tryAgain: string;
|
|
504
|
+
pausedBadge: string;
|
|
505
|
+
paused: string;
|
|
506
|
+
tapToStartRecording: string;
|
|
507
|
+
discard: string;
|
|
508
|
+
pause: string;
|
|
509
|
+
resume: string;
|
|
510
|
+
savingRecording: string;
|
|
511
|
+
micRationaleMessage: string;
|
|
512
|
+
unknownSize: string;
|
|
513
|
+
noAppToOpenFile: string;
|
|
514
|
+
couldNotOpenFile: string;
|
|
515
|
+
pageCountSingular: string;
|
|
516
|
+
pageCountPlural: string;
|
|
517
|
+
fileCouldNotBePreviewed: string;
|
|
518
|
+
noInAppPreview: string;
|
|
519
|
+
openNamed: string;
|
|
520
|
+
open: string;
|
|
521
|
+
opening: string;
|
|
522
|
+
compressing: string;
|
|
523
|
+
errorProcessPhoto: string;
|
|
524
|
+
errorCapturePhoto: string;
|
|
525
|
+
uploadErrorCouldNotOpenStream: string;
|
|
526
|
+
uploadErrorCouldNotOpenFile: string;
|
|
527
|
+
uploadErrorServerCode: string;
|
|
528
|
+
uploadErrorNetwork: string;
|
|
529
|
+
powerPointPresentationTitle: string;
|
|
530
|
+
couldNotOpenPresentation: string;
|
|
531
|
+
couldNotReadPowerPoint: string;
|
|
532
|
+
couldNotOpenDocument: string;
|
|
533
|
+
couldNotConvertDocument: string;
|
|
534
|
+
officeBinaryPreviewNote: string;
|
|
535
|
+
unableToExtractBinaryText: string;
|
|
536
|
+
openInOfficeAppNote: string;
|
|
537
|
+
previewTruncatedRowsCols: string;
|
|
538
|
+
previewTruncatedRows: string;
|
|
539
|
+
previewTruncatedChapters: string;
|
|
540
|
+
previewTruncatedNotice: string;
|
|
541
|
+
powerPointNoSlides: string;
|
|
542
|
+
unknownDate: string;
|
|
543
|
+
aspectRatioOriginal: string;
|
|
544
|
+
aspectRatioFull: string;
|
|
545
|
+
aspectRatioOriginalShort: string;
|
|
546
|
+
gifBadge: string;
|
|
547
|
+
textFontSample: string;
|
|
548
|
+
slideNumberLabel: string;
|
|
549
|
+
docTypePowerpoint: string;
|
|
550
|
+
docTypeWord: string;
|
|
551
|
+
docTypeExcel: string;
|
|
552
|
+
docTypeOffice: string;
|
|
553
|
+
compressActiveDesc: string;
|
|
554
|
+
convertGifMessage: string;
|
|
555
|
+
convertGifCropMessage: string;
|
|
556
|
+
couldNotDecodeImageGeneric: string;
|
|
557
|
+
memoryWarningMessage: string;
|
|
558
|
+
savingEdits: string;
|
|
559
|
+
textCancel: string;
|
|
560
|
+
textFont: string;
|
|
561
|
+
textAlignment: string;
|
|
562
|
+
textBackground: string;
|
|
563
|
+
textDone: string;
|
|
564
|
+
gifSearchHint: string;
|
|
565
|
+
addingGif: string;
|
|
566
|
+
gifLoadFailed: string;
|
|
567
|
+
gifOffline: string;
|
|
568
|
+
gifTimeout: string;
|
|
569
|
+
gifServerError: string;
|
|
570
|
+
gifNoResults: string;
|
|
571
|
+
mediaDetails: string;
|
|
572
|
+
photoDetails: string;
|
|
573
|
+
videoDetails: string;
|
|
574
|
+
metaFileName: string;
|
|
575
|
+
metaFileType: string;
|
|
576
|
+
metaFileSize: string;
|
|
577
|
+
metaDuration: string;
|
|
578
|
+
metaResolution: string;
|
|
579
|
+
metaDate: string;
|
|
580
|
+
metaPath: string;
|
|
581
|
+
pixelsUnit: string;
|
|
582
|
+
viewDetails: string;
|
|
583
|
+
fileTypeGeneric: string;
|
|
584
|
+
audioTypeGeneric: string;
|
|
585
|
+
play: string;
|
|
586
|
+
toggleVideoControls: string;
|
|
587
|
+
seekBackward: string;
|
|
588
|
+
seekForward: string;
|
|
589
|
+
}
|
|
590
|
+
export type CameraTranslationKey = keyof CameraTranslations;
|
|
591
|
+
export type CameraTranslationFunction = (key: CameraTranslationKey, ...args: Array<string | number | boolean | null | undefined>) => string | undefined | null;
|
|
592
|
+
export type CameraTranslationMap = Partial<Record<CameraTranslationKey, string | undefined | null>>;
|
|
593
|
+
/**
|
|
594
|
+
* Translations for many languages at once, keyed by language identifier.
|
|
595
|
+
*
|
|
596
|
+
* Keys are BCP-47 tags in whatever spelling the host already uses — `fr`,
|
|
597
|
+
* `pt-BR`, `zh_CN`, `zh-Hant` all work, and lookup is case- and
|
|
598
|
+
* separator-insensitive. Register the whole set once and switch languages with
|
|
599
|
+
* {@link setCameraLanguage}.
|
|
600
|
+
*
|
|
601
|
+
* ```ts
|
|
602
|
+
* const bundles: CameraTranslationBundles = {
|
|
603
|
+
* fr: { send: 'Envoyer', cancel: 'Annuler' },
|
|
604
|
+
* ar: { send: 'إرسال', cancel: 'إلغاء' },
|
|
605
|
+
* };
|
|
606
|
+
* ```
|
|
607
|
+
*/
|
|
608
|
+
export type CameraTranslationBundles = Record<string, CameraTranslationMap>;
|
|
609
|
+
/**
|
|
610
|
+
* Whatever a host's `subscribe` happens to hand back. Functions, RN's
|
|
611
|
+
* `EmitterSubscription` (`remove`), and Rx-style subscriptions (`unsubscribe`)
|
|
612
|
+
* are all accepted so the provider can usually be a one-line adapter over an
|
|
613
|
+
* i18n library the host already has; returning nothing is fine too.
|
|
614
|
+
*/
|
|
615
|
+
export type CameraLanguageSubscription = (() => void) | {
|
|
616
|
+
remove: () => void;
|
|
617
|
+
} | {
|
|
618
|
+
unsubscribe: () => void;
|
|
619
|
+
} | null | undefined | void;
|
|
620
|
+
/**
|
|
621
|
+
* A live view of the host app's active language. Bind one once at startup and
|
|
622
|
+
* every plugin surface — React Native screens *and* the native Android camera —
|
|
623
|
+
* follows the host from then on, with no further calls on language change.
|
|
624
|
+
*
|
|
625
|
+
* The host stays the single source of truth: the plugin only reads this, never
|
|
626
|
+
* the device locale, and keeps no language state of its own beyond the last
|
|
627
|
+
* value read here.
|
|
628
|
+
*
|
|
629
|
+
* ```ts
|
|
630
|
+
* configureCameraPlugin({
|
|
631
|
+
* language: {
|
|
632
|
+
* get: () => i18n.language,
|
|
633
|
+
* subscribe: (onChange) => {
|
|
634
|
+
* i18n.on('languageChanged', onChange);
|
|
635
|
+
* return () => i18n.off('languageChanged', onChange);
|
|
636
|
+
* },
|
|
637
|
+
* },
|
|
638
|
+
* translations: myBundles,
|
|
639
|
+
* });
|
|
640
|
+
* ```
|
|
641
|
+
*/
|
|
642
|
+
export interface CameraLanguageProvider {
|
|
643
|
+
/**
|
|
644
|
+
* The host's language right now, as a BCP-47 tag. Called on bind and on every
|
|
645
|
+
* change notification, so it must be cheap and must not throw for a missing
|
|
646
|
+
* language — return `null`/`''` instead, which means "shipped English".
|
|
647
|
+
*/
|
|
648
|
+
get(): string | null | undefined;
|
|
649
|
+
/**
|
|
650
|
+
* Registers a change listener and returns a way to remove it. The callback may
|
|
651
|
+
* be handed the new tag (i18next's `languageChanged` does) or called bare, in
|
|
652
|
+
* which case the plugin re-reads {@link CameraLanguageProvider.get}.
|
|
653
|
+
*
|
|
654
|
+
* Return the unsubscriber so a re-bind or teardown can release the listener;
|
|
655
|
+
* the plugin only ever holds one subscription per provider.
|
|
656
|
+
*/
|
|
657
|
+
subscribe(callback: (locale?: string | null) => void): CameraLanguageSubscription;
|
|
658
|
+
}
|
|
659
|
+
export interface CameraLocalizationConfig {
|
|
660
|
+
/**
|
|
661
|
+
* The host app's currently active language, as a BCP-47 tag (`'fr'`,
|
|
662
|
+
* `'pt-BR'`, `'zh-Hans'`, `'ar'`). This is the only thing the plugin needs in
|
|
663
|
+
* order to pick a bundle and decide text direction — there is no language
|
|
664
|
+
* selector and no language list inside the plugin.
|
|
665
|
+
*
|
|
666
|
+
* A bound {@link CameraLocalizationConfig.languageProvider} outranks this: the
|
|
667
|
+
* provider is re-read after the config is applied, so the two cannot drift.
|
|
668
|
+
*/
|
|
669
|
+
locale?: string;
|
|
670
|
+
/**
|
|
671
|
+
* A live view of the host's language, for one-time automatic synchronization.
|
|
672
|
+
* Configure it once and the plugin follows every later host language change on
|
|
673
|
+
* its own — no repeated {@link setCameraLanguage} calls.
|
|
674
|
+
*
|
|
675
|
+
* Binding is by object identity, so passing the same provider again re-reads it
|
|
676
|
+
* without stacking a second listener, and replacing it releases the old
|
|
677
|
+
* subscription. Pass `null` to detach and go back to manual switching.
|
|
678
|
+
*
|
|
679
|
+
* Unlike every other field here, a provider is *not* cleared by an omitted key
|
|
680
|
+
* in {@link setCameraLocalization} — a binding made once at startup survives a
|
|
681
|
+
* later config replace.
|
|
682
|
+
*/
|
|
683
|
+
languageProvider?: CameraLanguageProvider | null;
|
|
684
|
+
/**
|
|
685
|
+
* The host's own translate function. Called with a plugin translation key; return
|
|
686
|
+
* a string to use it, or a falsy value to fall through to `bundles`, then to
|
|
687
|
+
* English. Errors thrown here are swallowed and treated as "not translated".
|
|
688
|
+
*/
|
|
689
|
+
translate?: CameraTranslationFunction;
|
|
690
|
+
/** Overrides for the active language only. Highest priority of all sources. */
|
|
691
|
+
translations?: CameraTranslationMap;
|
|
692
|
+
/**
|
|
693
|
+
* Translations for every language the host supports, keyed by locale. Register
|
|
694
|
+
* once at startup; from then on a bound
|
|
695
|
+
* {@link CameraLocalizationConfig.languageProvider} picks the right bundle
|
|
696
|
+
* automatically, or call {@link setCameraLanguage} on each change manually.
|
|
697
|
+
*/
|
|
698
|
+
bundles?: CameraTranslationBundles;
|
|
699
|
+
/** Language used when the active one has no translation for a key. Defaults to `'en'`. */
|
|
700
|
+
fallbackLocale?: string;
|
|
701
|
+
/**
|
|
702
|
+
* Force text direction. Normally omit this: direction is derived from `locale`
|
|
703
|
+
* (Arabic, Persian, Hebrew, Urdu, … are right-to-left), and falls back to the
|
|
704
|
+
* app-level `I18nManager.isRTL` when no locale is set.
|
|
705
|
+
*/
|
|
706
|
+
isRtl?: boolean;
|
|
707
|
+
}
|
|
708
|
+
export interface CameraLocalizationProviderProps extends Omit<CameraLocalizationConfig, 'locale'> {
|
|
709
|
+
children: ReactNode;
|
|
710
|
+
/**
|
|
711
|
+
* The host app's active language identifier. Changing it re-renders every
|
|
712
|
+
* plugin surface and re-pushes translations to the native camera — no restart.
|
|
713
|
+
*
|
|
714
|
+
* A non-string value is treated purely as a cache-busting token, which keeps
|
|
715
|
+
* hosts working that pass a revision number here. Omit it entirely when a
|
|
716
|
+
* `languageProvider` is bound: the provider is then the authority and this
|
|
717
|
+
* component needs no re-render to follow a language change.
|
|
718
|
+
*/
|
|
719
|
+
locale?: string | number;
|
|
720
|
+
/**
|
|
721
|
+
* Optional host-controlled invalidation token for non-locale i18n changes.
|
|
722
|
+
*/
|
|
723
|
+
version?: string | number;
|
|
724
|
+
}
|
|
725
|
+
export declare const defaultTranslations: CameraTranslations;
|
|
726
|
+
export declare const cameraLocalizationKeys: readonly (keyof CameraTranslations)[];
|
|
727
|
+
/**
|
|
728
|
+
* True when a value looks like a {@link CameraLanguageProvider} rather than a
|
|
729
|
+
* language tag. Lets a single `language` option accept either one.
|
|
730
|
+
*/
|
|
731
|
+
export declare function isCameraLanguageProvider(value: unknown): value is CameraLanguageProvider;
|
|
732
|
+
declare class LocalizationManagerImpl {
|
|
733
|
+
private translateFn?;
|
|
734
|
+
private hostTranslations?;
|
|
735
|
+
private bundles;
|
|
736
|
+
private fallbackLocale;
|
|
737
|
+
private locale;
|
|
738
|
+
private explicitIsRtl?;
|
|
739
|
+
private translations;
|
|
740
|
+
private isRtl;
|
|
741
|
+
private listeners;
|
|
742
|
+
/**
|
|
743
|
+
* The host's language authority, when one is bound. Held by identity so a
|
|
744
|
+
* re-bind of the same object is recognized as a no-op.
|
|
745
|
+
*/
|
|
746
|
+
private languageProvider?;
|
|
747
|
+
/** Releases {@link languageProvider}'s subscription. One at a time, always. */
|
|
748
|
+
private releaseProviderSubscription?;
|
|
749
|
+
/**
|
|
750
|
+
* Binds the host app's language provider — the plugin's language authority for
|
|
751
|
+
* as long as it stays bound.
|
|
752
|
+
*
|
|
753
|
+
* Leak- and duplicate-safe by construction: the previous subscription is always
|
|
754
|
+
* released before a new one is taken, and re-binding the *same* provider object
|
|
755
|
+
* only re-reads it, so a startup path that runs more than once (Fast Refresh, a
|
|
756
|
+
* remount, a second `configureCameraPlugin`) cannot stack listeners.
|
|
757
|
+
*
|
|
758
|
+
* @param options.resolve `false` for callers that are about to
|
|
759
|
+
* {@link LocalizationManagerImpl.resolve} anyway, keeping a config change to a
|
|
760
|
+
* single re-render and a single native push.
|
|
761
|
+
*/
|
|
762
|
+
bindLanguageProvider(provider?: CameraLanguageProvider | null, options?: {
|
|
763
|
+
resolve?: boolean;
|
|
764
|
+
}): void;
|
|
765
|
+
/** Detaches the bound provider, if any. The active language is left as-is. */
|
|
766
|
+
unbindLanguageProvider(): void;
|
|
767
|
+
/**
|
|
768
|
+
* Re-reads the bound provider and republishes if its language moved. The manual
|
|
769
|
+
* escape hatch for a host whose provider cannot notify.
|
|
770
|
+
*/
|
|
771
|
+
syncLanguageFromProvider(): void;
|
|
772
|
+
/** The bound provider, for hosts that need to check whether auto-sync is on. */
|
|
773
|
+
getLanguageProvider(): CameraLanguageProvider | undefined;
|
|
774
|
+
private releaseLanguageProvider;
|
|
775
|
+
private readProviderLocale;
|
|
776
|
+
/**
|
|
777
|
+
* Pulls the provider's language into `locale`. Returns whether it moved, which
|
|
778
|
+
* is what lets callers skip a redundant re-render and native push.
|
|
779
|
+
*/
|
|
780
|
+
private adoptProviderLocale;
|
|
781
|
+
private handleProviderLanguageChange;
|
|
782
|
+
/**
|
|
783
|
+
* Re-asserts a bound provider's language over any `locale` a config carried, so
|
|
784
|
+
* the host stays the single source of truth even when the two disagree.
|
|
785
|
+
*/
|
|
786
|
+
private assertLanguageAuthority;
|
|
787
|
+
/**
|
|
788
|
+
* Replaces the whole localization configuration. Anything omitted is cleared,
|
|
789
|
+
* which is what makes `setCameraLocalization({})` a reset.
|
|
790
|
+
*
|
|
791
|
+
* A bound language provider is the one exception: it is only touched when the
|
|
792
|
+
* config actually carries a `languageProvider` key. Otherwise a screen that
|
|
793
|
+
* pushes its own bundles would silently switch off auto-sync that was set up at
|
|
794
|
+
* startup. Pass `languageProvider: null` to detach on purpose.
|
|
795
|
+
*/
|
|
796
|
+
setLocalization(config?: CameraLocalizationConfig): void;
|
|
797
|
+
/**
|
|
798
|
+
* Merges a partial configuration into the current one. Use this to add bundles
|
|
799
|
+
* or change the language without re-sending everything else.
|
|
800
|
+
*/
|
|
801
|
+
updateLocalization(config?: CameraLocalizationConfig): void;
|
|
802
|
+
/**
|
|
803
|
+
* Switches the active language, keeping registered bundles and callbacks.
|
|
804
|
+
*
|
|
805
|
+
* Remains available as a manual fallback while a provider is bound; the next
|
|
806
|
+
* change the provider reports simply wins, since the host owns the language.
|
|
807
|
+
*/
|
|
808
|
+
setLanguage(locale?: string | null): void;
|
|
809
|
+
/**
|
|
810
|
+
* Rebuilds the resolved translation table and text direction, pushes both to
|
|
811
|
+
* the native camera, and notifies every subscribed component.
|
|
812
|
+
*
|
|
813
|
+
* Priority, lowest to highest: shipped English defaults, locale bundles along
|
|
814
|
+
* the fallback chain, the host's translate callback, then explicit overrides.
|
|
815
|
+
*/
|
|
816
|
+
private resolve;
|
|
817
|
+
subscribe(listener: () => void): () => void;
|
|
818
|
+
getString(key: CameraTranslationKey, ...args: Array<string | number | boolean | null | undefined>): string;
|
|
819
|
+
getIsRtl(): boolean;
|
|
820
|
+
/** The active language, or `''` when the host has not set one. */
|
|
821
|
+
getLocale(): string;
|
|
822
|
+
/** The language used to fill gaps in the active one. `'en'` unless changed. */
|
|
823
|
+
getFallbackLocale(): string;
|
|
824
|
+
/** Every locale the host has registered a bundle for. */
|
|
825
|
+
getAvailableLocales(): string[];
|
|
826
|
+
getTextAlign(): 'left' | 'right';
|
|
827
|
+
getFlexDirection(): 'row' | 'row-reverse';
|
|
828
|
+
getTranslations(): CameraTranslations;
|
|
829
|
+
private notifyListeners;
|
|
830
|
+
}
|
|
831
|
+
export declare const LocalizationManager: LocalizationManagerImpl;
|
|
832
|
+
/**
|
|
833
|
+
* Hands the host app's language and translations to the plugin. This is the
|
|
834
|
+
* single integration point — call it once at startup, and either bind a
|
|
835
|
+
* `languageProvider` so later switches are picked up automatically or call
|
|
836
|
+
* {@link setCameraLanguage} on each change.
|
|
837
|
+
*
|
|
838
|
+
* ```ts
|
|
839
|
+
* setCameraLocalization({
|
|
840
|
+
* bundles: myBundles,
|
|
841
|
+
* // Bound once; every later host language change follows automatically.
|
|
842
|
+
* languageProvider: {
|
|
843
|
+
* get: () => i18n.language,
|
|
844
|
+
* subscribe: (onChange) => {
|
|
845
|
+
* i18n.on('languageChanged', onChange);
|
|
846
|
+
* return () => i18n.off('languageChanged', onChange);
|
|
847
|
+
* },
|
|
848
|
+
* },
|
|
849
|
+
* translate: (key) => i18n.t(`camera.${key}`),
|
|
850
|
+
* });
|
|
851
|
+
* ```
|
|
852
|
+
*
|
|
853
|
+
* Every field is optional and omitted fields are cleared, so `{}` restores the
|
|
854
|
+
* shipped English strings — with one deliberate exception: a language provider
|
|
855
|
+
* bound by {@link setCameraLanguageProvider} is kept unless the config explicitly
|
|
856
|
+
* carries `languageProvider`, so automatic synchronization set up once at startup
|
|
857
|
+
* cannot be switched off by a later config push.
|
|
858
|
+
*/
|
|
859
|
+
export declare function setCameraLocalization(config?: CameraLocalizationConfig): void;
|
|
860
|
+
/**
|
|
861
|
+
* Merges into the current configuration instead of replacing it. Handy for
|
|
862
|
+
* registering more bundles later, or changing one field on its own.
|
|
863
|
+
*/
|
|
864
|
+
export declare function updateCameraLocalization(config?: CameraLocalizationConfig): void;
|
|
865
|
+
/**
|
|
866
|
+
* Turns on one-time automatic language synchronization: bind the host app's
|
|
867
|
+
* language once and every plugin surface follows it from then on.
|
|
868
|
+
*
|
|
869
|
+
* On each host language change the plugin re-resolves its translation table,
|
|
870
|
+
* re-renders every React Native screen and component, and pushes the new
|
|
871
|
+
* translations, locale, and RTL direction across the bridge to the native Android
|
|
872
|
+
* camera and editor — no further calls needed.
|
|
873
|
+
*
|
|
874
|
+
* Safe to call more than once: the same provider object re-binds without stacking
|
|
875
|
+
* a listener, a different one releases the previous subscription first, and `null`
|
|
876
|
+
* detaches (after which {@link setCameraLanguage} is the way to switch).
|
|
877
|
+
*
|
|
878
|
+
* ```ts
|
|
879
|
+
* // i18next
|
|
880
|
+
* setCameraLanguageProvider({
|
|
881
|
+
* get: () => i18n.language,
|
|
882
|
+
* subscribe: (onChange) => {
|
|
883
|
+
* i18n.on('languageChanged', onChange);
|
|
884
|
+
* return () => i18n.off('languageChanged', onChange);
|
|
885
|
+
* },
|
|
886
|
+
* });
|
|
887
|
+
*
|
|
888
|
+
* // a plain store / context
|
|
889
|
+
* setCameraLanguageProvider({
|
|
890
|
+
* get: () => store.getState().language,
|
|
891
|
+
* subscribe: (onChange) => store.subscribe(onChange),
|
|
892
|
+
* });
|
|
893
|
+
* ```
|
|
894
|
+
*/
|
|
895
|
+
export declare function setCameraLanguageProvider(provider?: CameraLanguageProvider | null): void;
|
|
896
|
+
/** Turns automatic synchronization back off. The active language is kept. */
|
|
897
|
+
export declare function clearCameraLanguageProvider(): void;
|
|
898
|
+
/**
|
|
899
|
+
* Re-reads the bound language provider and republishes if it moved. Only needed
|
|
900
|
+
* for a host whose language can change without notifying — normally the
|
|
901
|
+
* subscription covers this.
|
|
902
|
+
*/
|
|
903
|
+
export declare function syncCameraLanguage(): void;
|
|
904
|
+
/** The bound language provider, or `undefined` when auto-sync is off. */
|
|
905
|
+
export declare function getCameraLanguageProvider(): CameraLanguageProvider | undefined;
|
|
906
|
+
/**
|
|
907
|
+
* Switches the plugin to the host's newly selected language — the manual
|
|
908
|
+
* alternative to {@link setCameraLanguageProvider}, and still supported.
|
|
909
|
+
*
|
|
910
|
+
* Registered bundles and the host's translate callback are kept, so this is the
|
|
911
|
+
* one call to make from a language-change handler. Text direction is re-derived
|
|
912
|
+
* from the tag, so Arabic and Persian flip the plugin to RTL automatically. Open
|
|
913
|
+
* plugin screens and the native camera update immediately — no restart.
|
|
914
|
+
*
|
|
915
|
+
* ```ts
|
|
916
|
+
* i18n.on('languageChanged', setCameraLanguage);
|
|
917
|
+
* ```
|
|
918
|
+
*/
|
|
919
|
+
export declare function setCameraLanguage(locale?: string | null | CameraLanguageProvider): void;
|
|
920
|
+
/** Registers (or replaces) translations for one or more languages. */
|
|
921
|
+
export declare function registerCameraTranslations(bundles: CameraTranslationBundles): void;
|
|
922
|
+
/** The plugin's active language, or `''` when the host has not set one. */
|
|
923
|
+
export declare function getCameraLocale(): string;
|
|
924
|
+
/** Whether plugin UI is currently laid out right-to-left. */
|
|
925
|
+
export declare function getCameraIsRtl(): boolean;
|
|
926
|
+
export declare function CameraLocalizationProvider({ children, translate, translations, bundles, fallbackLocale, isRtl, locale, languageProvider, version, }: CameraLocalizationProviderProps): React.FunctionComponentElement<React.ProviderProps<{
|
|
927
|
+
t: (key: CameraTranslationKey, ...args: Array<string | number | boolean | null | undefined>) => string;
|
|
928
|
+
/** The host's active language, or `''` when it has not set one. */
|
|
929
|
+
locale: string;
|
|
930
|
+
isRtl: boolean;
|
|
931
|
+
direction: string;
|
|
932
|
+
textAlign: "left" | "right";
|
|
933
|
+
flexDirection: "row" | "row-reverse";
|
|
934
|
+
rtlStyle: <T extends object>(ltr: T, rtl: T) => T;
|
|
935
|
+
writingDirectionStyle: {
|
|
936
|
+
readonly writingDirection: "rtl" | "ltr";
|
|
937
|
+
readonly textAlign: "left" | "right";
|
|
938
|
+
};
|
|
939
|
+
layoutDirectionStyle: {
|
|
940
|
+
readonly direction: "rtl" | "ltr";
|
|
941
|
+
};
|
|
942
|
+
/** Row/text styles that follow the active language's direction. */
|
|
943
|
+
styles: Readonly<{
|
|
944
|
+
row: {
|
|
945
|
+
flexDirection: "row";
|
|
946
|
+
};
|
|
947
|
+
text: {
|
|
948
|
+
writingDirection: "ltr";
|
|
949
|
+
textAlign: "left";
|
|
950
|
+
};
|
|
951
|
+
}> | Readonly<{
|
|
952
|
+
row: {
|
|
953
|
+
flexDirection: "row-reverse";
|
|
954
|
+
};
|
|
955
|
+
text: {
|
|
956
|
+
writingDirection: "rtl";
|
|
957
|
+
textAlign: "right";
|
|
958
|
+
};
|
|
959
|
+
}>;
|
|
960
|
+
translations: CameraTranslations;
|
|
961
|
+
} | null>>;
|
|
962
|
+
export declare function useCameraLocalization(): {
|
|
963
|
+
t: (key: CameraTranslationKey, ...args: Array<string | number | boolean | null | undefined>) => string;
|
|
964
|
+
/** The host's active language, or `''` when it has not set one. */
|
|
965
|
+
locale: string;
|
|
966
|
+
isRtl: boolean;
|
|
967
|
+
direction: string;
|
|
968
|
+
textAlign: "left" | "right";
|
|
969
|
+
flexDirection: "row" | "row-reverse";
|
|
970
|
+
rtlStyle: <T extends object>(ltr: T, rtl: T) => T;
|
|
971
|
+
writingDirectionStyle: {
|
|
972
|
+
readonly writingDirection: "rtl" | "ltr";
|
|
973
|
+
readonly textAlign: "left" | "right";
|
|
974
|
+
};
|
|
975
|
+
layoutDirectionStyle: {
|
|
976
|
+
readonly direction: "rtl" | "ltr";
|
|
977
|
+
};
|
|
978
|
+
/** Row/text styles that follow the active language's direction. */
|
|
979
|
+
styles: Readonly<{
|
|
980
|
+
row: {
|
|
981
|
+
flexDirection: "row";
|
|
982
|
+
};
|
|
983
|
+
text: {
|
|
984
|
+
writingDirection: "ltr";
|
|
985
|
+
textAlign: "left";
|
|
986
|
+
};
|
|
987
|
+
}> | Readonly<{
|
|
988
|
+
row: {
|
|
989
|
+
flexDirection: "row-reverse";
|
|
990
|
+
};
|
|
991
|
+
text: {
|
|
992
|
+
writingDirection: "rtl";
|
|
993
|
+
textAlign: "right";
|
|
994
|
+
};
|
|
995
|
+
}>;
|
|
996
|
+
translations: CameraTranslations;
|
|
997
|
+
};
|
|
998
|
+
export declare function useCameraLocalizationContext(): {
|
|
999
|
+
t: (key: CameraTranslationKey, ...args: Array<string | number | boolean | null | undefined>) => string;
|
|
1000
|
+
/** The host's active language, or `''` when it has not set one. */
|
|
1001
|
+
locale: string;
|
|
1002
|
+
isRtl: boolean;
|
|
1003
|
+
direction: string;
|
|
1004
|
+
textAlign: "left" | "right";
|
|
1005
|
+
flexDirection: "row" | "row-reverse";
|
|
1006
|
+
rtlStyle: <T extends object>(ltr: T, rtl: T) => T;
|
|
1007
|
+
writingDirectionStyle: {
|
|
1008
|
+
readonly writingDirection: "rtl" | "ltr";
|
|
1009
|
+
readonly textAlign: "left" | "right";
|
|
1010
|
+
};
|
|
1011
|
+
layoutDirectionStyle: {
|
|
1012
|
+
readonly direction: "rtl" | "ltr";
|
|
1013
|
+
};
|
|
1014
|
+
/** Row/text styles that follow the active language's direction. */
|
|
1015
|
+
styles: Readonly<{
|
|
1016
|
+
row: {
|
|
1017
|
+
flexDirection: "row";
|
|
1018
|
+
};
|
|
1019
|
+
text: {
|
|
1020
|
+
writingDirection: "ltr";
|
|
1021
|
+
textAlign: "left";
|
|
1022
|
+
};
|
|
1023
|
+
}> | Readonly<{
|
|
1024
|
+
row: {
|
|
1025
|
+
flexDirection: "row-reverse";
|
|
1026
|
+
};
|
|
1027
|
+
text: {
|
|
1028
|
+
writingDirection: "rtl";
|
|
1029
|
+
textAlign: "right";
|
|
1030
|
+
};
|
|
1031
|
+
}>;
|
|
1032
|
+
translations: CameraTranslations;
|
|
1033
|
+
};
|
|
1034
|
+
/** Row/text styles for the active language. Prefer the hook inside components. */
|
|
1035
|
+
export declare function getRtlAwareStyles(): {
|
|
1036
|
+
row: ViewStyle;
|
|
1037
|
+
text: TextStyle;
|
|
1038
|
+
};
|
|
1039
|
+
/**
|
|
1040
|
+
* Direction-aware styles that re-read the active language on every access.
|
|
1041
|
+
*
|
|
1042
|
+
* Defined with getters rather than a plain object: the language can change at
|
|
1043
|
+
* any time, and a value captured at module load would keep an Arabic UI
|
|
1044
|
+
* left-to-right until the app restarted.
|
|
1045
|
+
*/
|
|
1046
|
+
export declare const rtlAwareStyles: {
|
|
1047
|
+
readonly row: ViewStyle;
|
|
1048
|
+
readonly text: TextStyle;
|
|
1049
|
+
};
|
|
1050
|
+
export {};
|
|
1051
|
+
//# sourceMappingURL=localization.d.ts.map
|