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,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility to refresh asset metadata from the actual file on disk.
|
|
5
|
+
* After compression/export, the file's actual size may differ from the original;
|
|
6
|
+
* this ensures the asset object reflects the real file being previewed.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { getMediaMetadata, getRecordedOriginalSize } from "../nativeActions.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Read the actual size of a file from disk using the Fetch API.
|
|
13
|
+
* Returns size in bytes, or undefined if it cannot be determined.
|
|
14
|
+
*/
|
|
15
|
+
export async function getFileSize(fileUri) {
|
|
16
|
+
try {
|
|
17
|
+
// Try to get size from content-length header
|
|
18
|
+
const response = await fetch(fileUri, {
|
|
19
|
+
method: 'HEAD'
|
|
20
|
+
});
|
|
21
|
+
const contentLength = response.headers.get('content-length');
|
|
22
|
+
if (contentLength) {
|
|
23
|
+
return parseInt(contentLength, 10);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Fallback: fetch the file and get blob size
|
|
27
|
+
const fetchResponse = await fetch(fileUri);
|
|
28
|
+
const blob = await fetchResponse.blob();
|
|
29
|
+
return blob.size;
|
|
30
|
+
} catch {
|
|
31
|
+
// If file size cannot be determined, return undefined
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Normalize a file/content URI for identity comparison: trim, percent-decode where possible, and
|
|
38
|
+
* drop a leading `file://` so `file:///data/x.mp4` and `/data/x.mp4` compare equal. Content and
|
|
39
|
+
* other schemes are left intact (only their casing/encoding normalized).
|
|
40
|
+
*/
|
|
41
|
+
function normalizeUri(uri) {
|
|
42
|
+
if (!uri) return '';
|
|
43
|
+
let s = uri.trim();
|
|
44
|
+
try {
|
|
45
|
+
s = decodeURI(s);
|
|
46
|
+
} catch {
|
|
47
|
+
// Leave the raw string if it isn't valid percent-encoding.
|
|
48
|
+
}
|
|
49
|
+
return s.replace(/^file:\/\//i, '');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* True when two URIs point at the same file (after normalization). An empty/undefined URI never
|
|
54
|
+
* matches anything.
|
|
55
|
+
*/
|
|
56
|
+
function isSameFile(a, b) {
|
|
57
|
+
const na = normalizeUri(a);
|
|
58
|
+
const nb = normalizeUri(b);
|
|
59
|
+
return na.length > 0 && na === nb;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Refresh an asset's metadata from the actual file on disk.
|
|
64
|
+
* After compression/export, this ensures size matches the real file.
|
|
65
|
+
*
|
|
66
|
+
* For images: updates size only (dimensions are already correct from capture)
|
|
67
|
+
* For videos: a clip flagged `sizeIsDisplayEstimate` (a compressed video) keeps its quoted
|
|
68
|
+
* proportional `size` untouched; otherwise prefers the recorded finalized size the native layer
|
|
69
|
+
* remembers for a just-recorded clip (so it matches the recording counter and the editor's
|
|
70
|
+
* "Original" row instead of the smaller background-cropped file), else updates size from disk.
|
|
71
|
+
* For audio: updates size
|
|
72
|
+
* For documents: updates size
|
|
73
|
+
*
|
|
74
|
+
* Note: Image dimensions from Image.getSize() can be unreliable for file:// URIs,
|
|
75
|
+
* so we skip dimension refresh and trust the dimensions set during capture.
|
|
76
|
+
*/
|
|
77
|
+
export async function refreshAssetMetadata(asset) {
|
|
78
|
+
// Use documentUri (final exported path) if available, otherwise use uri.
|
|
79
|
+
const fileUri = asset.documentUri || asset.uri;
|
|
80
|
+
if (!fileUri) {
|
|
81
|
+
return asset;
|
|
82
|
+
}
|
|
83
|
+
const updated = {
|
|
84
|
+
...asset
|
|
85
|
+
};
|
|
86
|
+
let hasUpdates = false;
|
|
87
|
+
|
|
88
|
+
// A compressed video's `size` is a DISPLAY convention: the proportional figure the compression
|
|
89
|
+
// dropdown and the completion toast quoted (`original × (1 − percent/100)`), NOT the bytes the
|
|
90
|
+
// encoder wrote (which sit above it at heavy levels because audio/container copy through). The
|
|
91
|
+
// native editor set `sizeIsDisplayEstimate` on exactly that clip. Keep `size` untouched for it —
|
|
92
|
+
// skip the metadata.size override, the recorded-original memory, and the on-disk stat — so the
|
|
93
|
+
// preview / Info panel reads as the proportion the user picked. Everything else (originals,
|
|
94
|
+
// muted/trimmed clips whose asset.size is stale, stills, gallery imports) still re-stats.
|
|
95
|
+
const keepDisplaySize = asset.type === 'video' && asset.sizeIsDisplayEstimate === true;
|
|
96
|
+
try {
|
|
97
|
+
const metadata = await getMediaMetadata(fileUri);
|
|
98
|
+
const resolvedUri = metadata?.uri || fileUri;
|
|
99
|
+
if (resolvedUri && resolvedUri !== updated.uri) {
|
|
100
|
+
updated.uri = resolvedUri;
|
|
101
|
+
hasUpdates = true;
|
|
102
|
+
}
|
|
103
|
+
if (metadata?.fileName && metadata.fileName !== updated.fileName) {
|
|
104
|
+
updated.fileName = metadata.fileName;
|
|
105
|
+
hasUpdates = true;
|
|
106
|
+
}
|
|
107
|
+
if (metadata?.mimeType && metadata.mimeType !== updated.mimeType) {
|
|
108
|
+
updated.mimeType = metadata.mimeType;
|
|
109
|
+
hasUpdates = true;
|
|
110
|
+
}
|
|
111
|
+
if (metadata?.size !== undefined && metadata.size !== updated.size && !keepDisplaySize) {
|
|
112
|
+
updated.size = metadata.size;
|
|
113
|
+
hasUpdates = true;
|
|
114
|
+
}
|
|
115
|
+
if (metadata?.width !== undefined && metadata.width !== updated.width) {
|
|
116
|
+
updated.width = metadata.width;
|
|
117
|
+
hasUpdates = true;
|
|
118
|
+
}
|
|
119
|
+
if (metadata?.height !== undefined && metadata.height !== updated.height) {
|
|
120
|
+
updated.height = metadata.height;
|
|
121
|
+
hasUpdates = true;
|
|
122
|
+
}
|
|
123
|
+
if (metadata?.duration !== undefined && metadata.duration !== updated.duration) {
|
|
124
|
+
updated.duration = metadata.duration;
|
|
125
|
+
hasUpdates = true;
|
|
126
|
+
}
|
|
127
|
+
if (metadata?.dateTaken !== undefined && metadata.dateTaken !== updated.dateTaken) {
|
|
128
|
+
updated.dateTaken = metadata.dateTaken;
|
|
129
|
+
hasUpdates = true;
|
|
130
|
+
}
|
|
131
|
+
} catch {
|
|
132
|
+
// Fall back to file-size probing if metadata cannot be read.
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// A flagged compressed video keeps its quoted display size — geometry/name/mime/date from
|
|
136
|
+
// getMediaMetadata above still applied, but no size resolution runs for it.
|
|
137
|
+
if (keepDisplaySize) {
|
|
138
|
+
return hasUpdates ? updated : asset;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// A just-recorded video's cached file is replaced in the background by a smaller aspect-cropped
|
|
142
|
+
// re-encode, so while the ORIGINAL recorded clip is what's being previewed its reported size must
|
|
143
|
+
// NOT come from a fresh stat of the file on disk (that reports the smaller cropped bytes): it must
|
|
144
|
+
// be the size the recording process finalized — the same number the recording counter approached
|
|
145
|
+
// and the native editor's "Original" row shows, remembered by the native layer keyed on the
|
|
146
|
+
// capture's media id.
|
|
147
|
+
//
|
|
148
|
+
// BUT once the user compresses (or exports) the clip, the file being previewed is a DIFFERENT,
|
|
149
|
+
// derived copy. It keeps the original asset id (so getRecordedOriginalSize would still return the
|
|
150
|
+
// recorded clip's bytes), yet its `uri`/`documentUri` now points at the compressed file while
|
|
151
|
+
// `originalUri` still points at the recorded clip. In that case the size MUST come from an honest
|
|
152
|
+
// stat of the compressed file actually on screen — never the recorded-original memory. Selecting
|
|
153
|
+
// "Original" restores uri === originalUri, so we're back to showing the recorded clip's size.
|
|
154
|
+
//
|
|
155
|
+
// Decision: trust the remembered recorded-original size ONLY when the previewed file still IS the
|
|
156
|
+
// original recorded clip (no originalUri, or the previewed uri matches it). A gallery clip, a
|
|
157
|
+
// trimmed clip, or any clip after an app restart returns 0 from native anyway and falls through to
|
|
158
|
+
// the on-disk size below.
|
|
159
|
+
const previewingDerivedCopy = !!asset.originalUri && !isSameFile(fileUri, asset.originalUri);
|
|
160
|
+
let recordedOriginal = 0;
|
|
161
|
+
if (updated.type === 'video' && updated.id && !previewingDerivedCopy) {
|
|
162
|
+
try {
|
|
163
|
+
recordedOriginal = await getRecordedOriginalSize(updated.id);
|
|
164
|
+
} catch {
|
|
165
|
+
// No native support (web/iOS) or nothing remembered — fall back to the on-disk size.
|
|
166
|
+
recordedOriginal = 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (recordedOriginal > 0) {
|
|
170
|
+
if (recordedOriginal !== updated.size) {
|
|
171
|
+
updated.size = recordedOriginal;
|
|
172
|
+
hasUpdates = true;
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
try {
|
|
176
|
+
const size = await getFileSize(fileUri);
|
|
177
|
+
if (size !== undefined && size !== updated.size) {
|
|
178
|
+
updated.size = size;
|
|
179
|
+
hasUpdates = true;
|
|
180
|
+
}
|
|
181
|
+
} catch {
|
|
182
|
+
// If size cannot be determined, keep the current value.
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return hasUpdates ? updated : asset;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Refresh metadata for multiple assets.
|
|
190
|
+
* Updates file sizes from the actual files on disk.
|
|
191
|
+
*/
|
|
192
|
+
export async function refreshAssetMetadataBatch(assets) {
|
|
193
|
+
const results = await Promise.all(assets.map(asset => refreshAssetMetadata(asset)));
|
|
194
|
+
return results;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=fileMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getMediaMetadata","getRecordedOriginalSize","getFileSize","fileUri","response","fetch","method","contentLength","headers","get","parseInt","fetchResponse","blob","size","undefined","normalizeUri","uri","s","trim","decodeURI","replace","isSameFile","a","b","na","nb","length","refreshAssetMetadata","asset","documentUri","updated","hasUpdates","keepDisplaySize","type","sizeIsDisplayEstimate","metadata","resolvedUri","fileName","mimeType","width","height","duration","dateTaken","previewingDerivedCopy","originalUri","recordedOriginal","id","refreshAssetMetadataBatch","assets","results","Promise","all","map"],"sourceRoot":"..\\..\\..\\src","sources":["library/fileMetadata.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAGA,SAASA,gBAAgB,EAAEC,uBAAuB,QAAQ,qBAAkB;;AAE5E;AACA;AACA;AACA;AACA,OAAO,eAAeC,WAAWA,CAACC,OAAe,EAA+B;EAC9E,IAAI;IACF;IACA,MAAMC,QAAQ,GAAG,MAAMC,KAAK,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AC;IACtB;EACF;EAEA,IAAIA,gBAAgB,GAAG,CAAC,EAAE;IACxB,IAAIA,gBAAgB,KAAKf,OAAO,CAACjB,IAAI,EAAE;MACrCiB,OAAO,CAACjB,IAAI,GAAGgC,gBAAgB;MAC/Bd,UAAU,GAAG,IAAI;IACnB;EACF,CAAC,MAAM;IACL,IAAI;MACF,MAAMlB,IAAI,GAAG,MAAMX,WAAW,CAACC,OAAO,CAAC;MACvC,IAAIU,IAAI,KAAKC,SAAS,IAAID,IAAI,KAAKiB,OAAO,CAACjB,IAAI,EAAE;QAC/CiB,OAAO,CAACjB,IAAI,GAAGA,IAAI;QACnBkB,UAAU,GAAG,IAAI;MACnB;IACF,CAAC,CAAC,MAAM;MACN;IAAA;EAEJ;EAEA,OAAOA,UAAU,GAAGD,OAAO,GAAGF,KAAK;AACrC;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAemB,yBAAyBA,CAC7CC,MAAqB,EACG;EACxB,MAAMC,OAAO,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC/BH,MAAM,CAACI,GAAG,CAAExB,KAAK,IAAKD,oBAAoB,CAACC,KAAK,CAAC,CACnD,CAAC;EACD,OAAOqB,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* src/library — the React Native media library shell that sits on top of the
|
|
5
|
+
* native camera.
|
|
6
|
+
*
|
|
7
|
+
* The native side (the AAR) owns capture, the editor, previews and uploads. This
|
|
8
|
+
* folder is the JS app surface around it: the library grid, the category pager,
|
|
9
|
+
* the FAB, the full-screen viewer, the document/audio cards and the record-audio
|
|
10
|
+
* screen. `<CameraMediaLibrary />` is the one-element drop-in; everything else is
|
|
11
|
+
* exported so a host can assemble its own screen from the same pieces.
|
|
12
|
+
*
|
|
13
|
+
* Nothing here may import `../index` — that is the package barrel, and a
|
|
14
|
+
* barrel → screen → barrel cycle resolves to a half-initialised module at
|
|
15
|
+
* runtime. Import the DEFINING module instead (`../types`, `../db`, `../icons`,
|
|
16
|
+
* `../localization`, `../nativeActions`, …).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// ── Screens ───────────────────────────────────────────────────────
|
|
20
|
+
export { CameraMediaLibrary } from "./MediaLibrary.js";
|
|
21
|
+
export { MediaLibraryScreen } from "./MediaLibraryScreen.js";
|
|
22
|
+
export { RecordAudioScreen } from "./components/RecordAudioScreen.js";
|
|
23
|
+
// ── Viewer slides (one per media kind) ────────────────────────────
|
|
24
|
+
export { ImagePreview } from "./components/ImagePreview.js";
|
|
25
|
+
export { VideoPreview } from "./components/VideoPreview.js";
|
|
26
|
+
export { DocumentPreview } from "./components/DocumentPreview.js";
|
|
27
|
+
export { AudioPreview } from "./components/AudioPreview.js";
|
|
28
|
+
export { MediaMetadataHeader } from "./components/MediaMetadataHeader.js";
|
|
29
|
+
// ── Chrome ────────────────────────────────────────────────────────
|
|
30
|
+
export { ExpandableFab } from "./components/ExpandableFab.js";
|
|
31
|
+
export { ViewerCounter } from "./components/ViewerCounter.js";
|
|
32
|
+
export { DocumentTile, AudioTile } from "./components/FileTiles.js";
|
|
33
|
+
|
|
34
|
+
// ── Theming / icons / scaling ─────────────────────────────────────
|
|
35
|
+
export { createLibraryIconRegistry, libraryIconRegistry } from "./libraryIconRegistry.js";
|
|
36
|
+
export { PlusCloseIcon, CircularSeekIcon, ViewDetailsIcon } from "./libraryIcons.js";
|
|
37
|
+
export { libraryPalette, useLibraryPalette, createPalette } from "./palette.js";
|
|
38
|
+
export { wp, hp, ms, fs, SCREEN_W, SCREEN_H, BASE_W, BASE_H } from "./responsive.js";
|
|
39
|
+
|
|
40
|
+
// ── Metadata helpers ──────────────────────────────────────────────
|
|
41
|
+
export { getFileSize, refreshAssetMetadata, refreshAssetMetadataBatch } from "./fileMetadata.js";
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CameraMediaLibrary","MediaLibraryScreen","RecordAudioScreen","ImagePreview","VideoPreview","DocumentPreview","AudioPreview","MediaMetadataHeader","ExpandableFab","ViewerCounter","DocumentTile","AudioTile","createLibraryIconRegistry","libraryIconRegistry","PlusCloseIcon","CircularSeekIcon","ViewDetailsIcon","libraryPalette","useLibraryPalette","createPalette","wp","hp","ms","fs","SCREEN_W","SCREEN_H","BASE_W","BASE_H","getFileSize","refreshAssetMetadata","refreshAssetMetadataBatch"],"sourceRoot":"..\\..\\..\\src","sources":["library/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,kBAAkB,QAAQ,mBAAgB;AAEnD,SAASC,kBAAkB,QAAQ,yBAAsB;AAKzD,SAASC,iBAAiB,QAAQ,mCAAgC;AAGlE;AACA,SAASC,YAAY,QAAQ,8BAA2B;AACxD,SAASC,YAAY,QAAQ,8BAA2B;AAExD,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,YAAY,QAAQ,8BAA2B;AACxD,SAASC,mBAAmB,QAAQ,qCAAkC;AAGtE;AACA,SAASC,aAAa,QAAQ,+BAA4B;AAE1D,SAASC,aAAa,QAAQ,+BAA4B;AAK1D,SAASC,YAAY,EAAEC,SAAS,QAAQ,2BAAwB;;AAEhE;AACA,SACEC,yBAAyB,EACzBC,mBAAmB,QACd,0BAAuB;AAC9B,SACEC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,QACV,mBAAgB;AACvB,SAASC,cAAc,EAAEC,iBAAiB,EAAEC,aAAa,QAAQ,cAAW;AAE5E,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,QAAQ,iBAAc;;AAEjF;AACA,SACEC,WAAW,EACXC,oBAAoB,EACpBC,yBAAyB,QACpB,mBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* libraryIconRegistry — the media library shell's DEFAULT icon set.
|
|
5
|
+
*
|
|
6
|
+
* The plugin ships a complete, dependency-free default icon registry drawn from
|
|
7
|
+
* RN View/Text primitives (`createDefaultIconRegistry()` in ../icons). The shell
|
|
8
|
+
* starts from that registry — so every key still resolves to a real component —
|
|
9
|
+
* then replaces a handful of chrome keys with the hand-authored outline icons in
|
|
10
|
+
* ./libraryIcons, which is what `<CameraMediaLibrary />` renders out of the box.
|
|
11
|
+
*
|
|
12
|
+
* A host app overrides any icon by key with its own React component:
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const icons = createLibraryIconRegistry();
|
|
16
|
+
* icons.set('camera', MyCameraIcon);
|
|
17
|
+
* <CameraIconProvider icons={icons}>…</CameraIconProvider>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* After that, every `<RenderIcon name="…" />` in the shell — and inside the
|
|
21
|
+
* plugin's own RN surface — renders those components. Adding a custom icon is a
|
|
22
|
+
* one-liner; no screen or component needs to change.
|
|
23
|
+
*/
|
|
24
|
+
import { createDefaultIconRegistry } from "../icons.js";
|
|
25
|
+
import { CameraIcon, PhotoIcon, VideoIcon, DocumentIcon, AudioIcon, BrowseAudioIcon, ImageVideoIcon, TrashIcon, ShareIcon, PlusCloseIcon, CircularSeekIcon, ViewDetailsIcon, InfoIcon, CompressIcon } from "./libraryIcons.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Build a fresh registry: plugin defaults + the shell's own chrome icons.
|
|
29
|
+
*
|
|
30
|
+
* Returns a NEW Map every call, so a host can `.set()` its own overrides on the
|
|
31
|
+
* result without mutating anyone else's registry.
|
|
32
|
+
*/
|
|
33
|
+
export function createLibraryIconRegistry() {
|
|
34
|
+
const registry = createDefaultIconRegistry();
|
|
35
|
+
|
|
36
|
+
// Override the media/chrome keys with the shell's own outline components. Each
|
|
37
|
+
// is an FC<{ size?, color?, strokeWidth? }>, structurally compatible with the
|
|
38
|
+
// plugin's IconComponent contract.
|
|
39
|
+
registry.set('camera', CameraIcon);
|
|
40
|
+
registry.set('photo', PhotoIcon);
|
|
41
|
+
registry.set('photo_mode', CameraIcon);
|
|
42
|
+
registry.set('video', VideoIcon);
|
|
43
|
+
registry.set('video_mode', VideoIcon);
|
|
44
|
+
registry.set('document', DocumentIcon);
|
|
45
|
+
registry.set('audio', AudioIcon);
|
|
46
|
+
registry.set('mic', AudioIcon);
|
|
47
|
+
registry.set('browse_audio', BrowseAudioIcon);
|
|
48
|
+
registry.set('image_video', ImageVideoIcon);
|
|
49
|
+
// Viewer bottom action bar (final preview screen): delete + share + compress.
|
|
50
|
+
registry.set('delete', TrashIcon);
|
|
51
|
+
registry.set('trash', TrashIcon);
|
|
52
|
+
registry.set('share', ShareIcon);
|
|
53
|
+
// Only ever shown for an image or a video; `createDefaultIconRegistry()` already
|
|
54
|
+
// maps this key, so a host that replaces the registry wholesale still resolves it.
|
|
55
|
+
registry.set('compress', CompressIcon);
|
|
56
|
+
// Interactive & inline icons
|
|
57
|
+
registry.set('plus_close', PlusCloseIcon);
|
|
58
|
+
registry.set('circular_seek', CircularSeekIcon);
|
|
59
|
+
registry.set('view_details', ViewDetailsIcon);
|
|
60
|
+
registry.set('info', InfoIcon);
|
|
61
|
+
return registry;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Shared snapshot used by `<CameraMediaLibrary />` when the host passes no
|
|
66
|
+
* `icons` prop. Built once at module load and reused for the app's lifetime.
|
|
67
|
+
*/
|
|
68
|
+
export const libraryIconRegistry = createLibraryIconRegistry();
|
|
69
|
+
//# sourceMappingURL=libraryIconRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDefaultIconRegistry","CameraIcon","PhotoIcon","VideoIcon","DocumentIcon","AudioIcon","BrowseAudioIcon","ImageVideoIcon","TrashIcon","ShareIcon","PlusCloseIcon","CircularSeekIcon","ViewDetailsIcon","InfoIcon","CompressIcon","createLibraryIconRegistry","registry","set","libraryIconRegistry"],"sourceRoot":"..\\..\\..\\src","sources":["library/libraryIconRegistry.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,yBAAyB,QAGpB,aAAU;AACjB,SACEC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,EACfC,QAAQ,EACRC,YAAY,QACP,mBAAgB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAA,EAAiB;EACxD,MAAMC,QAAQ,GAAGhB,yBAAyB,CAAC,CAAC;;EAE5C;EACA;EACA;EACAgB,QAAQ,CAACC,GAAG,CAAC,QAAQ,EAAEhB,UAA2B,CAAC;EACnDe,QAAQ,CAACC,GAAG,CAAC,OAAO,EAAEf,SAA0B,CAAC;EACjDc,QAAQ,CAACC,GAAG,CAAC,YAAY,EAAEhB,UAA2B,CAAC;EACvDe,QAAQ,CAACC,GAAG,CAAC,OAAO,EAAEd,SAA0B,CAAC;EACjDa,QAAQ,CAACC,GAAG,CAAC,YAAY,EAAEd,SAA0B,CAAC;EACtDa,QAAQ,CAACC,GAAG,CAAC,UAAU,EAAEb,YAA6B,CAAC;EACvDY,QAAQ,CAACC,GAAG,CAAC,OAAO,EAAEZ,SAA0B,CAAC;EACjDW,QAAQ,CAACC,GAAG,CAAC,KAAK,EAAEZ,SAA0B,CAAC;EAC/CW,QAAQ,CAACC,GAAG,CAAC,cAAc,EAAEX,eAAgC,CAAC;EAC9DU,QAAQ,CAACC,GAAG,CAAC,aAAa,EAAEV,cAA+B,CAAC;EAC5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