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,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { View, Text, TouchableOpacity, StyleSheet, DeviceEventEmitter } from 'react-native';
|
|
5
|
+
import NativeCustomCamera from './NativeCustomCamera';
|
|
6
|
+
import { useCameraTheme } from "./theme.js";
|
|
7
|
+
import { useCameraLocalization } from "./localization.js";
|
|
8
|
+
import { RenderIcon } from "./icons.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const defaultState = {
|
|
11
|
+
isPlaying: false,
|
|
12
|
+
uri: null,
|
|
13
|
+
title: '',
|
|
14
|
+
position: 0,
|
|
15
|
+
duration: 0,
|
|
16
|
+
didComplete: false
|
|
17
|
+
};
|
|
18
|
+
const AudioPlayerContext = /*#__PURE__*/createContext({
|
|
19
|
+
state: defaultState,
|
|
20
|
+
play: async () => {},
|
|
21
|
+
pause: async () => {},
|
|
22
|
+
resume: async () => {},
|
|
23
|
+
seek: async () => {},
|
|
24
|
+
stop: async () => {}
|
|
25
|
+
});
|
|
26
|
+
export const useGlobalAudioPlayer = () => useContext(AudioPlayerContext);
|
|
27
|
+
export const GlobalAudioPlayerProvider = ({
|
|
28
|
+
children
|
|
29
|
+
}) => {
|
|
30
|
+
const [state, setState] = useState(defaultState);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const progressSub = DeviceEventEmitter.addListener('onAudioProgress', ev => {
|
|
33
|
+
setState(prev => ({
|
|
34
|
+
...prev,
|
|
35
|
+
position: ev.position,
|
|
36
|
+
duration: ev.duration
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
const stateSub = DeviceEventEmitter.addListener('onAudioStateChange', ev => {
|
|
40
|
+
setState(prev => {
|
|
41
|
+
if (ev.didComplete) {
|
|
42
|
+
// Auto-hide when playback finishes
|
|
43
|
+
NativeCustomCamera.stopAudio();
|
|
44
|
+
return defaultState;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
...prev,
|
|
48
|
+
isPlaying: ev.isPlaying ?? prev.isPlaying,
|
|
49
|
+
uri: ev.uri ?? prev.uri,
|
|
50
|
+
title: ev.title ?? prev.title,
|
|
51
|
+
duration: ev.duration ?? prev.duration
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const closeSub = DeviceEventEmitter.addListener('onAudioClose', () => {
|
|
56
|
+
setState(defaultState);
|
|
57
|
+
});
|
|
58
|
+
return () => {
|
|
59
|
+
progressSub.remove();
|
|
60
|
+
stateSub.remove();
|
|
61
|
+
closeSub.remove();
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
64
|
+
const play = async (uri, title) => {
|
|
65
|
+
await NativeCustomCamera.playAudio(uri, title);
|
|
66
|
+
};
|
|
67
|
+
const pause = async () => {
|
|
68
|
+
await NativeCustomCamera.pauseAudio();
|
|
69
|
+
};
|
|
70
|
+
const resume = async () => {
|
|
71
|
+
await NativeCustomCamera.resumeAudio();
|
|
72
|
+
};
|
|
73
|
+
const seek = async ms => {
|
|
74
|
+
await NativeCustomCamera.seekAudio(ms);
|
|
75
|
+
};
|
|
76
|
+
const stop = async () => {
|
|
77
|
+
await NativeCustomCamera.stopAudio();
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/_jsx(AudioPlayerContext.Provider, {
|
|
80
|
+
value: {
|
|
81
|
+
state,
|
|
82
|
+
play,
|
|
83
|
+
pause,
|
|
84
|
+
resume,
|
|
85
|
+
seek,
|
|
86
|
+
stop
|
|
87
|
+
},
|
|
88
|
+
children: children
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
export const GlobalMiniAudioPlayer = ({
|
|
92
|
+
onExpandPlayer
|
|
93
|
+
}) => {
|
|
94
|
+
const {
|
|
95
|
+
state,
|
|
96
|
+
pause,
|
|
97
|
+
resume,
|
|
98
|
+
stop
|
|
99
|
+
} = useGlobalAudioPlayer();
|
|
100
|
+
const theme = useCameraTheme();
|
|
101
|
+
const {
|
|
102
|
+
t,
|
|
103
|
+
isRtl,
|
|
104
|
+
textAlign
|
|
105
|
+
} = useCameraLocalization();
|
|
106
|
+
const audioTheme = theme.components.audioPlayer;
|
|
107
|
+
const styles = useMemo(() => createMiniPlayerStyles(theme), [theme]);
|
|
108
|
+
const showMiniPlayer = state.uri !== null && !state.didComplete;
|
|
109
|
+
const handleToggle = () => {
|
|
110
|
+
if (state.isPlaying) {
|
|
111
|
+
pause();
|
|
112
|
+
} else {
|
|
113
|
+
resume();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
if (!showMiniPlayer) return null;
|
|
117
|
+
return /*#__PURE__*/_jsx(View, {
|
|
118
|
+
style: [styles.miniPlayerWrap, {
|
|
119
|
+
paddingBottom: theme.spacing.lg
|
|
120
|
+
}],
|
|
121
|
+
children: /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
122
|
+
style: [styles.miniPlayerContainer, {
|
|
123
|
+
backgroundColor: audioTheme.containerBackground,
|
|
124
|
+
borderRadius: audioTheme.borderRadius,
|
|
125
|
+
borderColor: audioTheme.borderColor,
|
|
126
|
+
shadowColor: audioTheme.shadow.color,
|
|
127
|
+
shadowOpacity: audioTheme.shadow.opacity,
|
|
128
|
+
shadowRadius: audioTheme.shadow.radius,
|
|
129
|
+
shadowOffset: audioTheme.shadow.offset
|
|
130
|
+
}],
|
|
131
|
+
activeOpacity: audioTheme.activeOpacity,
|
|
132
|
+
onPress: () => state.uri && onExpandPlayer?.(state.uri),
|
|
133
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
134
|
+
style: [styles.progressTrack, {
|
|
135
|
+
backgroundColor: audioTheme.progressTrackBackground,
|
|
136
|
+
justifyContent: isRtl ? 'flex-end' : 'flex-start'
|
|
137
|
+
}],
|
|
138
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
139
|
+
style: [styles.progressFill, {
|
|
140
|
+
width: `${state.duration > 0 ? state.position / state.duration * 100 : 0}%`,
|
|
141
|
+
backgroundColor: audioTheme.progressFillBackground
|
|
142
|
+
}]
|
|
143
|
+
})
|
|
144
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
145
|
+
style: [styles.contentRow, {
|
|
146
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
147
|
+
}],
|
|
148
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
149
|
+
onPress: handleToggle,
|
|
150
|
+
style: [styles.iconBtn, {
|
|
151
|
+
backgroundColor: audioTheme.iconButtonBackground
|
|
152
|
+
}],
|
|
153
|
+
children: /*#__PURE__*/_jsx(RenderIcon, {
|
|
154
|
+
name: state.isPlaying ? 'pause' : 'play',
|
|
155
|
+
size: audioTheme.playIconSize,
|
|
156
|
+
color: audioTheme.iconColor
|
|
157
|
+
})
|
|
158
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
159
|
+
style: [styles.title, {
|
|
160
|
+
color: audioTheme.titleColor,
|
|
161
|
+
textAlign
|
|
162
|
+
}],
|
|
163
|
+
numberOfLines: 1,
|
|
164
|
+
children: state.title || t('audio')
|
|
165
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
166
|
+
onPress: stop,
|
|
167
|
+
style: [styles.iconBtn, {
|
|
168
|
+
backgroundColor: audioTheme.iconButtonBackground
|
|
169
|
+
}],
|
|
170
|
+
children: /*#__PURE__*/_jsx(RenderIcon, {
|
|
171
|
+
name: "close",
|
|
172
|
+
size: audioTheme.closeIconSize,
|
|
173
|
+
color: audioTheme.iconColor
|
|
174
|
+
})
|
|
175
|
+
})]
|
|
176
|
+
})]
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Builds every mini-audio-player style from the active theme. Components never
|
|
183
|
+
* hardcode sizing/typography/spacing — they all flow from
|
|
184
|
+
* `theme.components.audioPlayer` (see src/types.ts / src/theme.tsx).
|
|
185
|
+
*/
|
|
186
|
+
const createMiniPlayerStyles = theme => {
|
|
187
|
+
const ap = theme.components.audioPlayer;
|
|
188
|
+
return StyleSheet.create({
|
|
189
|
+
miniPlayerWrap: {
|
|
190
|
+
width: '100%'
|
|
191
|
+
},
|
|
192
|
+
miniPlayerContainer: {
|
|
193
|
+
overflow: 'hidden',
|
|
194
|
+
elevation: ap.containerElevation,
|
|
195
|
+
borderWidth: ap.containerBorderWidth
|
|
196
|
+
},
|
|
197
|
+
progressTrack: {
|
|
198
|
+
height: ap.progressTrackHeight,
|
|
199
|
+
width: '100%',
|
|
200
|
+
// A row so the caller can pin the fill to the reading-direction start edge
|
|
201
|
+
// with justifyContent; RN's own RTL flip needs I18nManager (app restart),
|
|
202
|
+
// which the plugin deliberately does not depend on.
|
|
203
|
+
flexDirection: 'row'
|
|
204
|
+
},
|
|
205
|
+
progressFill: {
|
|
206
|
+
height: '100%'
|
|
207
|
+
},
|
|
208
|
+
contentRow: {
|
|
209
|
+
flexDirection: 'row',
|
|
210
|
+
alignItems: 'center',
|
|
211
|
+
paddingHorizontal: ap.contentPaddingHorizontal,
|
|
212
|
+
paddingVertical: ap.contentPaddingVertical
|
|
213
|
+
},
|
|
214
|
+
iconBtn: {
|
|
215
|
+
width: ap.iconButtonSize,
|
|
216
|
+
height: ap.iconButtonSize,
|
|
217
|
+
borderRadius: ap.iconButtonRadius,
|
|
218
|
+
justifyContent: 'center',
|
|
219
|
+
alignItems: 'center'
|
|
220
|
+
},
|
|
221
|
+
iconText: {
|
|
222
|
+
fontSize: ap.iconTextSize,
|
|
223
|
+
fontWeight: ap.iconTextWeight
|
|
224
|
+
},
|
|
225
|
+
title: {
|
|
226
|
+
flex: 1,
|
|
227
|
+
fontSize: ap.titleFontSize,
|
|
228
|
+
fontWeight: ap.titleFontWeight,
|
|
229
|
+
marginHorizontal: ap.titleMarginHorizontal
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
//# sourceMappingURL=AudioPlayerContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useEffect","useMemo","useState","View","Text","TouchableOpacity","StyleSheet","DeviceEventEmitter","NativeCustomCamera","useCameraTheme","useCameraLocalization","RenderIcon","jsx","_jsx","jsxs","_jsxs","defaultState","isPlaying","uri","title","position","duration","didComplete","AudioPlayerContext","state","play","pause","resume","seek","stop","useGlobalAudioPlayer","GlobalAudioPlayerProvider","children","setState","progressSub","addListener","ev","prev","stateSub","stopAudio","closeSub","remove","playAudio","pauseAudio","resumeAudio","ms","seekAudio","Provider","value","GlobalMiniAudioPlayer","onExpandPlayer","theme","t","isRtl","textAlign","audioTheme","components","audioPlayer","styles","createMiniPlayerStyles","showMiniPlayer","handleToggle","style","miniPlayerWrap","paddingBottom","spacing","lg","miniPlayerContainer","backgroundColor","containerBackground","borderRadius","borderColor","shadowColor","shadow","color","shadowOpacity","opacity","shadowRadius","radius","shadowOffset","offset","activeOpacity","onPress","progressTrack","progressTrackBackground","justifyContent","progressFill","width","progressFillBackground","contentRow","flexDirection","iconBtn","iconButtonBackground","name","size","playIconSize","iconColor","titleColor","numberOfLines","closeIconSize","ap","create","overflow","elevation","containerElevation","borderWidth","containerBorderWidth","height","progressTrackHeight","alignItems","paddingHorizontal","contentPaddingHorizontal","paddingVertical","contentPaddingVertical","iconButtonSize","iconButtonRadius","iconText","fontSize","iconTextSize","fontWeight","iconTextWeight","flex","titleFontSize","titleFontWeight","marginHorizontal","titleMarginHorizontal"],"sourceRoot":"..\\..\\src","sources":["AudioPlayerContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAiC,OAAO;AACxG,SAASC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,kBAAkB,QAAQ,cAAc;AAC3F,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,cAAc,QAAQ,YAAS;AAExC,SAASC,qBAAqB,QAAQ,mBAAgB;AACtD,SAASC,UAAU,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAoBrC,MAAMC,YAAwB,GAAG;EAC/BC,SAAS,EAAE,KAAK;EAChBC,GAAG,EAAE,IAAI;EACTC,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,CAAC;EACXC,QAAQ,EAAE,CAAC;EACXC,WAAW,EAAE;A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aAAa,EAAE;IACjB,CAAC;IACDJ,YAAY,EAAE;MACZqB,MAAM,EAAE;IACV,CAAC;IACDlB,UAAU,EAAE;MACVC,aAAa,EAAE,KAAK;MACpBmB,UAAU,EAAE,QAAQ;MACpBC,iBAAiB,EAAEV,EAAE,CAACW,wBAAwB;MAC9CC,eAAe,EAAEZ,EAAE,CAACa;IACtB,CAAC;IACDtB,OAAO,EAAE;MACPJ,KAAK,EAAEa,EAAE,CAACc,cAAc;MACxBP,MAAM,EAAEP,EAAE,CAACc,cAAc;MACzB5C,YAAY,EAAE8B,EAAE,CAACe,gBAAgB;MACjC9B,cAAc,EAAE,QAAQ;MACxBwB,UAAU,EAAE;IACd,CAAC;IACDO,QAAQ,EAAE;MACRC,QAAQ,EAAEjB,EAAE,CAACkB,YAAY;MACzBC,UAAU,EAAEnB,EAAE,CAACoB;IACjB,CAAC;IACDrG,KAAK,EAAE;MACLsG,IAAI,EAAE,CAAC;MACPJ,QAAQ,EAAEjB,EAAE,CAACsB,aAAa;MAC1BH,UAAU,EAAEnB,EAAE,CAACuB,eAAe;MAC9BC,gBAAgB,EAAExB,EAAE,CAACyB;IACvB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
4
|
+
import { View, StyleSheet, TouchableOpacity, Text, ActivityIndicator, Dimensions } from 'react-native';
|
|
5
|
+
import { openCameraPicker } from "./index.js";
|
|
6
|
+
import { ResponsivePreviewContainer, calcPreviewDimensions } from "./ResponsivePreviewContainer.js";
|
|
7
|
+
import { useCameraTheme } from "./theme.js";
|
|
8
|
+
import { useCameraLocalization } from "./localization.js";
|
|
9
|
+
import { RenderIcon } from "./icons.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
/** Stable camera-preview aspect ratio locked once for the lifetime of this
|
|
12
|
+
* component instance. All captures share this value so every asset arrives
|
|
13
|
+
* at EditingScreen with identical framing metadata. */
|
|
14
|
+
const LOCKED_ASPECT_RATIO = (() => {
|
|
15
|
+
const {
|
|
16
|
+
width: w,
|
|
17
|
+
height: h
|
|
18
|
+
} = Dimensions.get('window');
|
|
19
|
+
const {
|
|
20
|
+
aspectRatio
|
|
21
|
+
} = calcPreviewDimensions(w, h);
|
|
22
|
+
return aspectRatio;
|
|
23
|
+
})();
|
|
24
|
+
export const CameraPreview = ({
|
|
25
|
+
onCapture,
|
|
26
|
+
onClose,
|
|
27
|
+
aspectRatio = LOCKED_ASPECT_RATIO,
|
|
28
|
+
selectionLimit
|
|
29
|
+
}) => {
|
|
30
|
+
const [isCapturing, setIsCapturing] = useState(false);
|
|
31
|
+
const [showNativeCamera, setShowNativeCamera] = useState(false);
|
|
32
|
+
const [mediaType, setMediaType] = useState('photo');
|
|
33
|
+
const theme = useCameraTheme();
|
|
34
|
+
const {
|
|
35
|
+
t,
|
|
36
|
+
isRtl,
|
|
37
|
+
writingDirectionStyle
|
|
38
|
+
} = useCameraLocalization();
|
|
39
|
+
|
|
40
|
+
// Every render recomputes preview dimensions from the STABLE locked
|
|
41
|
+
// aspect ratio; no stale per-capture state can drift.
|
|
42
|
+
const {
|
|
43
|
+
width: previewW,
|
|
44
|
+
height: previewH
|
|
45
|
+
} = useMemo(() => {
|
|
46
|
+
const {
|
|
47
|
+
width: screenW,
|
|
48
|
+
height: screenH
|
|
49
|
+
} = Dimensions.get('window');
|
|
50
|
+
return calcPreviewDimensions(screenW, screenH);
|
|
51
|
+
}, []);
|
|
52
|
+
const handleCaptureFromNativeCamera = useCallback(async () => {
|
|
53
|
+
try {
|
|
54
|
+
setIsCapturing(true);
|
|
55
|
+
setShowNativeCamera(true);
|
|
56
|
+
const result = await openCameraPicker({
|
|
57
|
+
mediaTypes: mediaType,
|
|
58
|
+
selectionLimit: selectionLimit ?? 0
|
|
59
|
+
});
|
|
60
|
+
if (!result.cancelled && result.assets && result.assets.length > 0) {
|
|
61
|
+
const capturedWidth = previewW;
|
|
62
|
+
const capturedHeight = previewH;
|
|
63
|
+
const processedAssets = result.assets.map(asset => ({
|
|
64
|
+
id: asset.id || Date.now().toString(),
|
|
65
|
+
uri: asset.uri || '',
|
|
66
|
+
type: asset.type || 'photo',
|
|
67
|
+
width: capturedWidth,
|
|
68
|
+
height: capturedHeight,
|
|
69
|
+
fileName: asset.fileName || (asset.type === 'video' ? `video_${Date.now()}.mp4` : `photo_${Date.now()}.jpg`),
|
|
70
|
+
dateTaken: asset.dateTaken || Date.now(),
|
|
71
|
+
// Use the native capture's previewAspectRatio (set by CustomCameraActivity)
|
|
72
|
+
// which reflects the actual aspect ratio used during capture (including FULL mode),
|
|
73
|
+
// rather than the fixed LOCKED_ASPECT_RATIO. This ensures the editor uses the
|
|
74
|
+
// exact same framing as the capture screen.
|
|
75
|
+
previewAspectRatio: asset.previewAspectRatio ?? aspectRatio,
|
|
76
|
+
needsThumbnail: asset.needsThumbnail || false,
|
|
77
|
+
mimeType: asset.mimeType,
|
|
78
|
+
caption: asset.caption,
|
|
79
|
+
duration: asset.duration,
|
|
80
|
+
size: asset.size,
|
|
81
|
+
location: asset.location
|
|
82
|
+
}));
|
|
83
|
+
onCapture(processedAssets);
|
|
84
|
+
}
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.error('Error capturing from native camera:', error);
|
|
87
|
+
} finally {
|
|
88
|
+
setIsCapturing(false);
|
|
89
|
+
setShowNativeCamera(false);
|
|
90
|
+
}
|
|
91
|
+
}, [previewW, previewH, mediaType, onCapture, aspectRatio]);
|
|
92
|
+
const cameraPreviewTheme = theme.components.cameraPreview;
|
|
93
|
+
const styles = useMemo(() => createCameraPreviewStyles(theme), [theme]);
|
|
94
|
+
if (showNativeCamera) {
|
|
95
|
+
return /*#__PURE__*/_jsxs(ResponsivePreviewContainer, {
|
|
96
|
+
width: previewW,
|
|
97
|
+
height: previewH,
|
|
98
|
+
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
99
|
+
size: "large",
|
|
100
|
+
color: cameraPreviewTheme.loadingText
|
|
101
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
102
|
+
style: [styles.loadingText, writingDirectionStyle, {
|
|
103
|
+
color: cameraPreviewTheme.loadingText
|
|
104
|
+
}],
|
|
105
|
+
children: t('openingCamera')
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return /*#__PURE__*/_jsxs(ResponsivePreviewContainer, {
|
|
110
|
+
width: previewW,
|
|
111
|
+
height: previewH,
|
|
112
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
113
|
+
style: [styles.cameraPlaceholder, {
|
|
114
|
+
backgroundColor: cameraPreviewTheme.background
|
|
115
|
+
}],
|
|
116
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
117
|
+
style: [styles.cameraOverlay, {
|
|
118
|
+
backgroundColor: cameraPreviewTheme.overlay
|
|
119
|
+
}]
|
|
120
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
121
|
+
style: [styles.cameraPlaceholderText, writingDirectionStyle, {
|
|
122
|
+
color: cameraPreviewTheme.placeholderText
|
|
123
|
+
}],
|
|
124
|
+
children: mediaType === 'photo' ? t('photoMode') : t('videoMode')
|
|
125
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
126
|
+
style: [styles.modeIndicator, isRtl ? styles.modeIndicatorRtl : styles.modeIndicatorLtr, {
|
|
127
|
+
backgroundColor: cameraPreviewTheme.modeIndicatorBackground
|
|
128
|
+
}],
|
|
129
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
130
|
+
style: styles.modeIndicatorContent,
|
|
131
|
+
children: /*#__PURE__*/_jsx(RenderIcon, {
|
|
132
|
+
name: mediaType === 'photo' ? 'camera' : 'video',
|
|
133
|
+
size: cameraPreviewTheme.modeIndicatorIconSize,
|
|
134
|
+
color: cameraPreviewTheme.modeIndicatorText
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
139
|
+
style: [styles.controlsContainer, {
|
|
140
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
141
|
+
}],
|
|
142
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
143
|
+
style: [styles.controlButton, {
|
|
144
|
+
backgroundColor: cameraPreviewTheme.controlButtonBackground
|
|
145
|
+
}],
|
|
146
|
+
disabled: isCapturing,
|
|
147
|
+
accessibilityLabel: t('toggleFlashlight'),
|
|
148
|
+
children: /*#__PURE__*/_jsx(RenderIcon, {
|
|
149
|
+
name: "flash_auto",
|
|
150
|
+
size: cameraPreviewTheme.controlIconSize,
|
|
151
|
+
color: cameraPreviewTheme.controlButtonText
|
|
152
|
+
})
|
|
153
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
154
|
+
style: [styles.captureButton, {
|
|
155
|
+
backgroundColor: cameraPreviewTheme.captureButtonBackground
|
|
156
|
+
}, isCapturing && styles.captureButtonDisabled],
|
|
157
|
+
onPress: handleCaptureFromNativeCamera,
|
|
158
|
+
disabled: isCapturing,
|
|
159
|
+
accessibilityLabel: mediaType === 'photo' ? t('photoMode') : t('videoMode'),
|
|
160
|
+
children: isCapturing ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
161
|
+
color: cameraPreviewTheme.controlButtonText,
|
|
162
|
+
size: "small"
|
|
163
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
164
|
+
style: [styles.captureButtonInner, {
|
|
165
|
+
borderColor: cameraPreviewTheme.captureButtonInnerBorder
|
|
166
|
+
}]
|
|
167
|
+
})
|
|
168
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
169
|
+
style: [styles.controlButton, {
|
|
170
|
+
backgroundColor: cameraPreviewTheme.controlButtonBackground
|
|
171
|
+
}],
|
|
172
|
+
disabled: isCapturing,
|
|
173
|
+
accessibilityLabel: mediaType === 'photo' ? t('videoMode') : t('photoMode'),
|
|
174
|
+
onPress: () => setMediaType(mediaType === 'photo' ? 'video' : 'photo'),
|
|
175
|
+
children: /*#__PURE__*/_jsx(RenderIcon, {
|
|
176
|
+
name: mediaType === 'photo' ? 'video' : 'camera',
|
|
177
|
+
size: cameraPreviewTheme.controlIconSize,
|
|
178
|
+
color: cameraPreviewTheme.controlButtonText
|
|
179
|
+
})
|
|
180
|
+
})]
|
|
181
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
182
|
+
style: [styles.closeButton, isRtl ? styles.closeButtonRtl : styles.closeButtonLtr, {
|
|
183
|
+
backgroundColor: cameraPreviewTheme.closeButtonBackground
|
|
184
|
+
}],
|
|
185
|
+
onPress: onClose,
|
|
186
|
+
accessibilityLabel: t('close'),
|
|
187
|
+
children: /*#__PURE__*/_jsx(RenderIcon, {
|
|
188
|
+
name: "close",
|
|
189
|
+
size: cameraPreviewTheme.closeIconSize,
|
|
190
|
+
color: cameraPreviewTheme.closeButtonText
|
|
191
|
+
})
|
|
192
|
+
})]
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Builds every CameraPreview style from the active theme. Components never
|
|
198
|
+
* hardcode sizing/typography/spacing — they all flow from `theme.components.cameraPreview`,
|
|
199
|
+
* `theme.typography`, and `theme.spacing` (see src/types.ts / src/theme.tsx).
|
|
200
|
+
*/
|
|
201
|
+
const createCameraPreviewStyles = theme => {
|
|
202
|
+
const cp = theme.components.cameraPreview;
|
|
203
|
+
const spacing = theme.spacing;
|
|
204
|
+
const weights = theme.typography.fontWeights;
|
|
205
|
+
return StyleSheet.create({
|
|
206
|
+
cameraPlaceholder: {
|
|
207
|
+
width: '100%',
|
|
208
|
+
height: '100%',
|
|
209
|
+
justifyContent: 'center',
|
|
210
|
+
alignItems: 'center',
|
|
211
|
+
position: 'relative'
|
|
212
|
+
},
|
|
213
|
+
cameraOverlay: {
|
|
214
|
+
...StyleSheet.absoluteFill
|
|
215
|
+
},
|
|
216
|
+
cameraPlaceholderText: {
|
|
217
|
+
fontSize: cp.placeholderTextSize,
|
|
218
|
+
fontWeight: weights.semibold,
|
|
219
|
+
marginBottom: spacing.sm,
|
|
220
|
+
zIndex: 1
|
|
221
|
+
},
|
|
222
|
+
loadingText: {
|
|
223
|
+
marginTop: spacing.lg,
|
|
224
|
+
fontSize: cp.loadingTextSize
|
|
225
|
+
},
|
|
226
|
+
controlsContainer: {
|
|
227
|
+
position: 'absolute',
|
|
228
|
+
bottom: cp.controlsBottomInset,
|
|
229
|
+
left: 0,
|
|
230
|
+
right: 0,
|
|
231
|
+
flexDirection: 'row',
|
|
232
|
+
justifyContent: 'space-between',
|
|
233
|
+
alignItems: 'center',
|
|
234
|
+
paddingHorizontal: cp.controlsPaddingHorizontal
|
|
235
|
+
},
|
|
236
|
+
controlButton: {
|
|
237
|
+
width: cp.controlButtonSize,
|
|
238
|
+
height: cp.controlButtonSize,
|
|
239
|
+
borderRadius: cp.controlButtonSize / 2,
|
|
240
|
+
justifyContent: 'center',
|
|
241
|
+
alignItems: 'center'
|
|
242
|
+
},
|
|
243
|
+
controlButtonText: {
|
|
244
|
+
fontSize: cp.controlButtonTextSize
|
|
245
|
+
},
|
|
246
|
+
captureButton: {
|
|
247
|
+
width: cp.captureButtonSize,
|
|
248
|
+
height: cp.captureButtonSize,
|
|
249
|
+
borderRadius: cp.captureButtonSize / 2,
|
|
250
|
+
justifyContent: 'center',
|
|
251
|
+
alignItems: 'center'
|
|
252
|
+
},
|
|
253
|
+
captureButtonDisabled: {
|
|
254
|
+
opacity: cp.disabledOpacity
|
|
255
|
+
},
|
|
256
|
+
captureButtonInner: {
|
|
257
|
+
width: cp.captureButtonInnerSize,
|
|
258
|
+
height: cp.captureButtonInnerSize,
|
|
259
|
+
borderRadius: cp.captureButtonInnerSize / 2,
|
|
260
|
+
borderWidth: cp.captureButtonBorderWidth
|
|
261
|
+
},
|
|
262
|
+
closeButton: {
|
|
263
|
+
position: 'absolute',
|
|
264
|
+
top: cp.topInset,
|
|
265
|
+
width: cp.closeButtonSize,
|
|
266
|
+
height: cp.closeButtonSize,
|
|
267
|
+
borderRadius: cp.closeButtonSize / 2,
|
|
268
|
+
justifyContent: 'center',
|
|
269
|
+
alignItems: 'center'
|
|
270
|
+
},
|
|
271
|
+
closeButtonLtr: {
|
|
272
|
+
right: cp.sideInset
|
|
273
|
+
},
|
|
274
|
+
closeButtonRtl: {
|
|
275
|
+
left: cp.sideInset
|
|
276
|
+
},
|
|
277
|
+
closeButtonText: {
|
|
278
|
+
fontSize: cp.closeButtonTextSize,
|
|
279
|
+
fontWeight: weights.bold
|
|
280
|
+
},
|
|
281
|
+
modeIndicator: {
|
|
282
|
+
position: 'absolute',
|
|
283
|
+
top: cp.topInset,
|
|
284
|
+
paddingHorizontal: cp.modeIndicatorPaddingHorizontal,
|
|
285
|
+
paddingVertical: cp.modeIndicatorPaddingVertical,
|
|
286
|
+
borderRadius: cp.modeIndicatorRadius,
|
|
287
|
+
zIndex: 1
|
|
288
|
+
},
|
|
289
|
+
modeIndicatorLtr: {
|
|
290
|
+
left: cp.sideInset
|
|
291
|
+
},
|
|
292
|
+
modeIndicatorRtl: {
|
|
293
|
+
right: cp.sideInset
|
|
294
|
+
},
|
|
295
|
+
modeIndicatorContent: {
|
|
296
|
+
flexDirection: 'row',
|
|
297
|
+
alignItems: 'center'
|
|
298
|
+
},
|
|
299
|
+
modeIndicatorText: {
|
|
300
|
+
fontSize: cp.modeIndicatorTextSize
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
//# sourceMappingURL=CameraPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useMemo","useCallback","View","StyleSheet","TouchableOpacity","Text","ActivityIndicator","Dimensions","openCameraPicker","ResponsivePreviewContainer","calcPreviewDimensions","useCameraTheme","useCameraLocalization","RenderIcon","jsx","_jsx","jsxs","_jsxs","LOCKED_ASPECT_RATIO","width","w","height","h","get","aspectRatio","CameraPreview","onCapture","onClose","selectionLimit","isCapturing","setIsCapturing","showNativeCamera","setShowNativeCamera","mediaType","setMediaType","theme","t","isRtl","writingDirectionStyle","previewW","previewH","screenW","screenH","handleCaptureFromNativeCamera","result","mediaTypes","cancelled","assets","length","capturedWidth","capturedHeight","processedAssets","map","asset","id","Date","now","toString","uri","type","fileName","dateTaken","previewAspectRatio","needsThumbnail","mimeType","caption","duration","size","location","error","console","cameraPreviewTheme","components","cameraPreview","styles","createCameraPreviewStyles","children","color","loadingText","style","cameraPlaceholder","backgroundColor","background","cameraOverlay","overlay","cameraPlaceholderText","placeholderText","modeIndicator","modeIndicatorRtl","modeIndicatorLtr","modeIndicatorBackground","modeIndicatorContent","name","modeIndicatorIconSize","modeIndicatorText","controlsContainer","flexDirection","controlButton","controlButtonBackground","disabled","accessibilityLabel","controlIconSize","controlButtonText","captureButton","captureButtonBackground","captureButtonDisabled","onPress","captureButtonInner","borderColor","captureButtonInnerBorder","closeButton","closeButtonRtl","closeButtonLtr","closeButtonBackground","closeIconSize","closeButtonText","cp","spacing","weights","typography","fontWeights","create","justifyContent","alignItems","position","absoluteFill","fontSize","placeholderTextSize","fontWeight","semibold","marginBottom","sm","zIndex","marginTop","lg","loadingTextSize","bottom","controlsBottomInset","left","right","paddingHorizontal","controlsPaddingHorizontal","controlButtonSize","borderRadius","controlButtonTextSize","captureButtonSize","opacity","disabledOpacity","captureButtonInnerSize","borderWidth","captureButtonBorderWidth","top","topInset","closeButtonSize","sideInset","closeButtonTextSize","bold","modeIndicatorPaddingHorizontal","paddingVertical","modeIndicatorPaddingVertical","modeIndicatorRadius","modeIndicatorTextSize"],"sourceRoot":"..\\..\\src","sources":["CameraPreview.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAC7D,SACEC,IAAI,EACJC,UAAU,EACVC,gBAAgB,EAChBC,IAAI,EACJC,iBAAiB,EACj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3C,gBAAgB,EAAE;MAChBiD,IAAI,EAAEtB,EAAE,CAACsC;IACX,CAAC;IACDlE,gBAAgB,EAAE;MAChBmD,KAAK,EAAEvB,EAAE,CAACsC;IACZ,CAAC;IACD/D,oBAAoB,EAAE;MACpBK,aAAa,EAAE,KAAK;MACpB2B,UAAU,EAAE;IACd,CAAC;IACD7B,iBAAiB,EAAE;MACjBgC,QAAQ,EAAEV,EAAE,CAAC6C;IACf;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Image } from 'react-native';
|
|
4
|
+
import { resolveNativeComponent, toImageSourceUri } from "./nativeComponentSupport.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
// Native animated-image view (Android). ReactNative's own <Image> renders only a static first
|
|
7
|
+
// frame for a GIF on Android unless the host app adds Fresco's animated-gif decoder — a
|
|
8
|
+
// dependency every consumer of this library would otherwise have to add themselves.
|
|
9
|
+
const NativeAnimatedImageComponent = resolveNativeComponent('NativeAnimatedImageView');
|
|
10
|
+
|
|
11
|
+
/** True when native animated-image playback is available on this platform/build. */
|
|
12
|
+
export const isNativeAnimatedImageAvailable = () => NativeAnimatedImageComponent !== null;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Renders an animated image (GIF), animating where the platform supports it.
|
|
16
|
+
*
|
|
17
|
+
* The fallback is a plain `<Image>` rather than an empty view: iOS animates GIFs through
|
|
18
|
+
* `<Image>` natively, and on any other target the still frame is the correct degraded result.
|
|
19
|
+
* Either way the underlying file is only ever read, never rewritten.
|
|
20
|
+
*/
|
|
21
|
+
export const NativeAnimatedImageView = props => {
|
|
22
|
+
if (NativeAnimatedImageComponent) {
|
|
23
|
+
return /*#__PURE__*/_jsx(NativeAnimatedImageComponent, {
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
// ViewProps is a superset of ImageProps, so forward only the props an <Image> accepts
|
|
28
|
+
// rather than spreading the rest.
|
|
29
|
+
return /*#__PURE__*/_jsx(Image, {
|
|
30
|
+
style: props.style,
|
|
31
|
+
testID: props.testID
|
|
32
|
+
// Bare filesystem paths — what the media database stores — need a scheme before Fresco
|
|
33
|
+
// will load them at all.
|
|
34
|
+
,
|
|
35
|
+
source: {
|
|
36
|
+
uri: toImageSourceUri(props.src)
|
|
37
|
+
},
|
|
38
|
+
resizeMode: props.resizeMode ?? 'contain'
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=NativeAnimatedImageView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","resolveNativeComponent","toImageSourceUri","jsx","_jsx","NativeAnimatedImageComponent","isNativeAnimatedImageAvailable","NativeAnimatedImageView","props","style","testID","source","uri","src","resizeMode"],"sourceRoot":"..\\..\\src","sources":["NativeAnimatedImageView.tsx"],"mappings":";;AACA,SACEA,KAAK,QAIA,cAAc;AACrB,SACEC,sBAAsB,EACtBC,gBAAgB,QACX,6BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAuBlC;AACA;AACA;AACA,MAAMC,4BAA4B,GAChCJ,sBAAsB,CACpB,yBACF,CAAC;;AAEH;AACA,OAAO,MAAMK,8BAA8B,GAAGA,CAAA,KAC5CD,4BAA4B,KAAK,IAAI;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,uBAAyD,GACpEC,KAAK,IACF;EACH,IAAIH,4BAA4B,EAAE;IAChC,oBAAOD,IAAA,CAACC,4BAA4B;MAAA,GAAKG;IAAK,CAAG,CAAC;EACpD;EACA;EACA;EACA,oBACEJ,IAAA,CAACJ,KAAK;IACJS,KAAK,EAAED,KAAK,CAACC,KAAM;IACnBC,MAAM,EAAEF,KAAK,CAACE;IACd;IACA;IAAA;IACAC,MAAM,EAAE;MAAEC,GAAG,EAAEV,gBAAgB,CAACM,KAAK,CAACK,GAAG;IAAE,CAAE;IAC7CC,UAAU,EAAEN,KAAK,CAACM,UAAU,IAAI;EAAU,CAC3C,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform, requireNativeComponent, View } from 'react-native';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
// Native (Android) audio transport built on MediaPlayer — play/pause, a scrubbable
|
|
6
|
+
// progress bar and elapsed/total time, all drawn natively with no third-party
|
|
7
|
+
// playback or preview library. Resolved lazily and platform-guarded so non-Android
|
|
8
|
+
// targets (or an app without the native view registered) fall back to a plain view.
|
|
9
|
+
let NativeAudioComponent = null;
|
|
10
|
+
if (Platform.OS === 'android') {
|
|
11
|
+
try {
|
|
12
|
+
NativeAudioComponent = requireNativeComponent('CustomAudioPlayer');
|
|
13
|
+
} catch {
|
|
14
|
+
NativeAudioComponent = null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const NativeAudioPlayerView = props => {
|
|
18
|
+
if (NativeAudioComponent) {
|
|
19
|
+
return /*#__PURE__*/_jsx(NativeAudioComponent, {
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const {
|
|
24
|
+
src,
|
|
25
|
+
active,
|
|
26
|
+
tintColor,
|
|
27
|
+
...rest
|
|
28
|
+
} = props;
|
|
29
|
+
return /*#__PURE__*/_jsx(View, {
|
|
30
|
+
...rest
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=NativeAudioPlayerView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","requireNativeComponent","View","jsx","_jsx","NativeAudioComponent","OS","NativeAudioPlayerView","props","src","active","tintColor","rest"],"sourceRoot":"..\\..\\src","sources":["NativeAudioPlayerView.tsx"],"mappings":";;AACA,SACEA,QAAQ,EACRC,sBAAsB,EACtBC,IAAI,QAEC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWtB;AACA;AACA;AACA;AACA,IAAIC,oBAAsE,GACxE,IAAI;AACN,IAAIL,QAAQ,CAACM,EAAE,KAAK,SAAS,EAAE;EAC7B,IAAI;IACFD,oBAAoB,GAClBJ,sBAAsB,CAA6B,mBAAmB,CAAC;EAC3E,CAAC,CAAC,MAAM;IACNI,oBAAoB,GAAG,IAAI;EAC7B;AACF;AAEA,OAAO,MAAME,qBAAqD,GAAIC,KAAK,IAAK;EAC9E,IAAIH,oBAAoB,EAAE;IACxB,oBAAOD,IAAA,CAACC,oBAAoB;MAAA,GAAKG;IAAK,CAAG,CAAC;EAC5C;EACA,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAK,CAAC,GAAGJ,KAAK;EACjD,oBAAOJ,IAAA,CAACF,IAAI;IAAA,GAAKU;EAAI,CAAG,CAAC;AAC3B,CAAC","ignoreList":[]}
|