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,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AudioPreview — a messaging-app-style preview for an audio asset in the full-screen viewer.
|
|
3
|
+
*
|
|
4
|
+
* Audio has no pixel frame, so this is a card: the shared MediaMetadataHeader (file name, size,
|
|
5
|
+
* date, time, duration — identical chrome to the document strip) above a NATIVE audio transport
|
|
6
|
+
* (play/pause, scrubber, elapsed/total time) driven by MediaPlayer through NativeAudioPlayerView.
|
|
7
|
+
* No third-party playback or preview library is used — the controls and duration come from the
|
|
8
|
+
* native Android layer; the card chrome is RN.
|
|
9
|
+
*/
|
|
10
|
+
import { useMemo } from 'react';
|
|
11
|
+
import { View, StyleSheet } from 'react-native';
|
|
12
|
+
import type { CameraAsset } from '../../types';
|
|
13
|
+
import { NativeAudioPlayerView } from '../../NativeAudioPlayerView';
|
|
14
|
+
import { useCameraLocalization } from '../../localization';
|
|
15
|
+
import { MediaMetadataHeader } from './MediaMetadataHeader';
|
|
16
|
+
|
|
17
|
+
// ── Responsive scaling — shared with the whole app (portrait-normalized + clamped) ──
|
|
18
|
+
import { ms } from '../responsive';
|
|
19
|
+
import { useLibraryPalette, type LibraryPalette } from '../palette';
|
|
20
|
+
|
|
21
|
+
export const AudioPreview = ({
|
|
22
|
+
asset,
|
|
23
|
+
active,
|
|
24
|
+
}: {
|
|
25
|
+
asset: CameraAsset;
|
|
26
|
+
active: boolean;
|
|
27
|
+
}) => {
|
|
28
|
+
const { t } = useCameraLocalization();
|
|
29
|
+
const palette = useLibraryPalette();
|
|
30
|
+
const styles = useMemo(() => makeStyles(palette), [palette]);
|
|
31
|
+
const previewUri = asset.documentUri || asset.uri;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<View style={styles.wrap}>
|
|
35
|
+
<View style={styles.container}>
|
|
36
|
+
<MediaMetadataHeader asset={asset} showDuration fallbackName={t('audio')} />
|
|
37
|
+
<View style={styles.card}>
|
|
38
|
+
{/* Native transport: play/pause + scrubber + elapsed/total time. */}
|
|
39
|
+
<NativeAudioPlayerView
|
|
40
|
+
src={previewUri}
|
|
41
|
+
active={active}
|
|
42
|
+
tintColor={palette.primary}
|
|
43
|
+
style={styles.player}
|
|
44
|
+
/>
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const makeStyles = (palette: LibraryPalette) =>
|
|
52
|
+
StyleSheet.create({
|
|
53
|
+
wrap: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
width: '100%',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
},
|
|
58
|
+
container: {
|
|
59
|
+
backgroundColor: palette.surface,
|
|
60
|
+
borderRadius: ms(20),
|
|
61
|
+
borderWidth: 1,
|
|
62
|
+
borderColor: palette.hairline,
|
|
63
|
+
paddingHorizontal: ms(12),
|
|
64
|
+
paddingVertical: ms(14),
|
|
65
|
+
},
|
|
66
|
+
card: {
|
|
67
|
+
width: '100%',
|
|
68
|
+
},
|
|
69
|
+
player: {
|
|
70
|
+
width: '100%',
|
|
71
|
+
height: ms(64),
|
|
72
|
+
},
|
|
73
|
+
});
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocumentPreview — in-app document preview for a document asset in the full-screen viewer.
|
|
3
|
+
*
|
|
4
|
+
* Rendered DIRECTLY inside the viewer slide through NativeDocumentPreviewView — no external
|
|
5
|
+
* app, no third-party preview library. PDF uses PdfRenderer; TXT/JSON/XML native text views;
|
|
6
|
+
* PPT/PPTX use the dedicated native PowerPoint extractor/formatter/Canvas viewer. DOCX/XLSX/
|
|
7
|
+
* ODT/ODS/RTF/CSV/EPUB are parsed natively (OOXML/ODF/RTF/EPUB structure) into layout-faithful
|
|
8
|
+
* HTML shown by a locked-down WebView. The viewer's paging, counter and close chrome are
|
|
9
|
+
* untouched: this component only fills its slide.
|
|
10
|
+
*
|
|
11
|
+
* Formats with no parser (binary-era DOC/XLS, Apple PAGES, archives, …) — and any file the
|
|
12
|
+
* native layer reports it cannot actually render — fall back to the informational card (type
|
|
13
|
+
* glyph + extension badge, file name, extension, human-readable size) with an "Open" button
|
|
14
|
+
* handing non-PowerPoint files to an external viewer via ACTION_VIEW as the last resort.
|
|
15
|
+
*/
|
|
16
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
17
|
+
import { View, Text, Pressable, StyleSheet } from 'react-native';
|
|
18
|
+
import type { CameraAsset } from '../../types';
|
|
19
|
+
import { openDocument } from '../../nativeActions';
|
|
20
|
+
import {
|
|
21
|
+
getDocumentPreviewKind,
|
|
22
|
+
isNativeDocumentPreviewAvailable,
|
|
23
|
+
NativeDocumentPreviewView,
|
|
24
|
+
} from '../../NativeDocumentPreviewView';
|
|
25
|
+
import { useCameraLocalization } from '../../localization';
|
|
26
|
+
import { RenderIcon } from '../../icons';
|
|
27
|
+
|
|
28
|
+
// ── Responsive scaling — shared with the whole app (portrait-normalized + clamped) ──
|
|
29
|
+
import { ms, fs } from '../responsive';
|
|
30
|
+
import { useLibraryPalette, type LibraryPalette } from '../palette';
|
|
31
|
+
|
|
32
|
+
function baseNameOf(value?: string): string | null {
|
|
33
|
+
if (!value) return null;
|
|
34
|
+
const withoutQuery = value.split(/[?#]/)[0] ?? '';
|
|
35
|
+
const segments = withoutQuery.split(/[\\/]/);
|
|
36
|
+
let candidate = segments[segments.length - 1] ?? '';
|
|
37
|
+
try {
|
|
38
|
+
candidate = decodeURIComponent(candidate);
|
|
39
|
+
} catch {
|
|
40
|
+
// Keep the raw segment if it is malformed.
|
|
41
|
+
}
|
|
42
|
+
candidate = candidate.trim();
|
|
43
|
+
return candidate.length > 0 ? candidate : null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function fileNameFromUri(uri?: string): string | null {
|
|
47
|
+
const base = baseNameOf(uri);
|
|
48
|
+
if (!base) return null;
|
|
49
|
+
const dot = base.lastIndexOf('.');
|
|
50
|
+
return dot > 0 && dot < base.length - 1 ? base : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function extensionOf(fileName?: string, mimeType?: string): string {
|
|
54
|
+
if (fileName) {
|
|
55
|
+
const dot = fileName.lastIndexOf('.');
|
|
56
|
+
if (dot >= 0 && dot < fileName.length - 1) {
|
|
57
|
+
return fileName.slice(dot + 1).toUpperCase();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (mimeType) {
|
|
61
|
+
const slash = mimeType.lastIndexOf('/');
|
|
62
|
+
if (slash >= 0) return mimeType.slice(slash + 1).toUpperCase();
|
|
63
|
+
}
|
|
64
|
+
return 'FILE';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function formatSize(bytes?: number): string | null {
|
|
68
|
+
if (bytes === undefined || bytes === null || bytes <= 0) return null;
|
|
69
|
+
const units = ['B', 'KB', 'MB', 'GB'];
|
|
70
|
+
let value = bytes;
|
|
71
|
+
let unit = 0;
|
|
72
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
73
|
+
value /= 1024;
|
|
74
|
+
unit += 1;
|
|
75
|
+
}
|
|
76
|
+
const rounded = value >= 10 || unit === 0 ? Math.round(value) : Math.round(value * 10) / 10;
|
|
77
|
+
return `${rounded} ${units[unit]}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function isPowerPointExtension(ext: string): boolean {
|
|
81
|
+
return ['PPT', 'PPTX', 'PPS', 'PPSX', 'POT', 'POTX'].includes(ext);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const DocumentPreview = ({
|
|
85
|
+
asset,
|
|
86
|
+
active = true,
|
|
87
|
+
}: {
|
|
88
|
+
asset: CameraAsset;
|
|
89
|
+
/**
|
|
90
|
+
* False while this document's page is off-screen in the paging viewer — pauses expensive
|
|
91
|
+
* native work (PDF page rasterization), mirroring the audio/video cells' `active` gate.
|
|
92
|
+
*/
|
|
93
|
+
active?: boolean;
|
|
94
|
+
}) => {
|
|
95
|
+
const { t } = useCameraLocalization();
|
|
96
|
+
const palette = useLibraryPalette();
|
|
97
|
+
const styles = useMemo(() => makeStyles(palette), [palette]);
|
|
98
|
+
const [opening, setOpening] = useState(false);
|
|
99
|
+
const [error, setError] = useState<string | null>(null);
|
|
100
|
+
// Set when the native layer reports the file can't actually be rendered (corrupt PDF,
|
|
101
|
+
// binary bytes in a ".txt", missing WebView, …) — drops this asset to the info card.
|
|
102
|
+
const [renderFailed, setRenderFailed] = useState(false);
|
|
103
|
+
|
|
104
|
+
const [resolvedAsset, setResolvedAsset] = useState<CameraAsset>(asset);
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
let cancelled = false;
|
|
108
|
+
|
|
109
|
+
const loadResolvedAsset = async () => {
|
|
110
|
+
try {
|
|
111
|
+
const refreshed = await import('../fileMetadata').then((mod) => mod.refreshAssetMetadata(asset));
|
|
112
|
+
if (!cancelled) setResolvedAsset(await refreshed);
|
|
113
|
+
} catch {
|
|
114
|
+
if (!cancelled) setResolvedAsset(asset);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
loadResolvedAsset();
|
|
119
|
+
|
|
120
|
+
return () => {
|
|
121
|
+
cancelled = true;
|
|
122
|
+
};
|
|
123
|
+
}, [asset]);
|
|
124
|
+
|
|
125
|
+
const resolvedName =
|
|
126
|
+
fileNameFromUri(resolvedAsset.documentUri) ??
|
|
127
|
+
fileNameFromUri(resolvedAsset.uri) ??
|
|
128
|
+
baseNameOf(resolvedAsset.fileName) ??
|
|
129
|
+
t('document');
|
|
130
|
+
const ext = extensionOf(resolvedName, resolvedAsset.mimeType);
|
|
131
|
+
const name = resolvedName;
|
|
132
|
+
const sizeLabel = formatSize(resolvedAsset.size) ?? t('unknownSize');
|
|
133
|
+
const isPowerPoint = isPowerPointExtension(ext);
|
|
134
|
+
|
|
135
|
+
// A recycled/re-sourced cell must never keep the previous document's failure state.
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
setRenderFailed(false);
|
|
138
|
+
}, [asset.documentUri, asset.uri]);
|
|
139
|
+
|
|
140
|
+
const handleOpen = useCallback(async () => {
|
|
141
|
+
if (opening) return;
|
|
142
|
+
setError(null);
|
|
143
|
+
setOpening(true);
|
|
144
|
+
try {
|
|
145
|
+
const launched = await openDocument(previewUri, resolvedAsset.mimeType ?? '');
|
|
146
|
+
if (!launched) {
|
|
147
|
+
setError(t('noAppToOpenFile'));
|
|
148
|
+
}
|
|
149
|
+
} catch {
|
|
150
|
+
setError(t('couldNotOpenFile'));
|
|
151
|
+
} finally {
|
|
152
|
+
setOpening(false);
|
|
153
|
+
}
|
|
154
|
+
}, [resolvedAsset.documentUri, resolvedAsset.uri, resolvedAsset.mimeType, opening, t]);
|
|
155
|
+
|
|
156
|
+
const handlePreviewError = useCallback(() => setRenderFailed(true), []);
|
|
157
|
+
|
|
158
|
+
const previewUri = resolvedAsset.documentUri || resolvedAsset.uri;
|
|
159
|
+
const kind = getDocumentPreviewKind(
|
|
160
|
+
previewUri ? baseNameOf(previewUri) ?? resolvedAsset.fileName : resolvedAsset.fileName,
|
|
161
|
+
resolvedAsset.mimeType
|
|
162
|
+
);
|
|
163
|
+
const canPreviewInApp =
|
|
164
|
+
kind !== null && !renderFailed && isNativeDocumentPreviewAvailable();
|
|
165
|
+
|
|
166
|
+
if (canPreviewInApp) {
|
|
167
|
+
return (
|
|
168
|
+
<View style={styles.previewWrap}>
|
|
169
|
+
{/* The native document surface. Scrolls vertically (PDF pages / long text), which
|
|
170
|
+
coexists with the viewer's horizontal paging: sideways swipes still change slides. */}
|
|
171
|
+
<View style={styles.previewSurface}>
|
|
172
|
+
<NativeDocumentPreviewView
|
|
173
|
+
src={previewUri}
|
|
174
|
+
kind={kind}
|
|
175
|
+
active={active}
|
|
176
|
+
onPreviewError={handlePreviewError}
|
|
177
|
+
style={styles.previewNative}
|
|
178
|
+
/>
|
|
179
|
+
</View>
|
|
180
|
+
</View>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<View style={styles.wrap}>
|
|
186
|
+
<View style={styles.card}>
|
|
187
|
+
<View style={styles.iconBadge}>
|
|
188
|
+
<RenderIcon name="document" size={ms(46)} color={palette.isDark ? palette.accentPeriwinkle : palette.accentIndigo} strokeWidth={2} />
|
|
189
|
+
<View style={styles.extBadge}>
|
|
190
|
+
<Text style={styles.extBadgeText} numberOfLines={1}>
|
|
191
|
+
{ext}
|
|
192
|
+
</Text>
|
|
193
|
+
</View>
|
|
194
|
+
</View>
|
|
195
|
+
|
|
196
|
+
<Text style={styles.name} numberOfLines={2} ellipsizeMode="middle">
|
|
197
|
+
{name}
|
|
198
|
+
</Text>
|
|
199
|
+
|
|
200
|
+
<View style={styles.metaRow}>
|
|
201
|
+
<Text style={styles.metaText}>{ext}</Text>
|
|
202
|
+
<View style={styles.metaDot} />
|
|
203
|
+
<Text style={styles.metaText}>{sizeLabel}</Text>
|
|
204
|
+
</View>
|
|
205
|
+
|
|
206
|
+
<Text style={styles.noPreviewText}>
|
|
207
|
+
{renderFailed
|
|
208
|
+
? t('fileCouldNotBePreviewed')
|
|
209
|
+
: t('noInAppPreview')}
|
|
210
|
+
</Text>
|
|
211
|
+
|
|
212
|
+
{!isPowerPoint ? (
|
|
213
|
+
<Pressable
|
|
214
|
+
style={({ pressed }) => [
|
|
215
|
+
styles.openButton,
|
|
216
|
+
pressed && styles.openButtonPressed,
|
|
217
|
+
opening && styles.openButtonDisabled,
|
|
218
|
+
]}
|
|
219
|
+
onPress={handleOpen}
|
|
220
|
+
disabled={opening}
|
|
221
|
+
accessibilityRole="button"
|
|
222
|
+
accessibilityLabel={t('openNamed', name)}
|
|
223
|
+
>
|
|
224
|
+
<Text style={styles.openButtonText}>
|
|
225
|
+
{opening ? t('opening') : t('open')}
|
|
226
|
+
</Text>
|
|
227
|
+
</Pressable>
|
|
228
|
+
) : null}
|
|
229
|
+
|
|
230
|
+
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
231
|
+
</View>
|
|
232
|
+
</View>
|
|
233
|
+
);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const makeStyles = (palette: LibraryPalette) =>
|
|
237
|
+
StyleSheet.create({
|
|
238
|
+
// ── Inline native preview ─────────────────────────────────────────
|
|
239
|
+
previewWrap: {
|
|
240
|
+
flex: 1,
|
|
241
|
+
width: '100%',
|
|
242
|
+
},
|
|
243
|
+
// The file strip's own styles now live in MediaMetadataHeader (shared with the
|
|
244
|
+
// image/video/audio previews).
|
|
245
|
+
previewSurface: {
|
|
246
|
+
flex: 1,
|
|
247
|
+
borderRadius: ms(14),
|
|
248
|
+
// Clips the square-cornered native surface (RecyclerView/WebView/ScrollView) to the
|
|
249
|
+
// rounded frame.
|
|
250
|
+
overflow: 'hidden',
|
|
251
|
+
backgroundColor: palette.surface,
|
|
252
|
+
borderWidth: 1,
|
|
253
|
+
borderColor: palette.hairline,
|
|
254
|
+
},
|
|
255
|
+
previewNative: {
|
|
256
|
+
flex: 1,
|
|
257
|
+
width: '100%',
|
|
258
|
+
height: '100%',
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
// ── Info card (unsupported formats / render failures) ────────────
|
|
262
|
+
wrap: {
|
|
263
|
+
flex: 1,
|
|
264
|
+
width: '100%',
|
|
265
|
+
alignItems: 'center',
|
|
266
|
+
justifyContent: 'center',
|
|
267
|
+
},
|
|
268
|
+
card: {
|
|
269
|
+
width: '86%',
|
|
270
|
+
maxWidth: ms(360),
|
|
271
|
+
backgroundColor: palette.surface,
|
|
272
|
+
borderRadius: ms(20),
|
|
273
|
+
borderWidth: 1,
|
|
274
|
+
borderColor: palette.hairline,
|
|
275
|
+
paddingVertical: ms(28),
|
|
276
|
+
paddingHorizontal: ms(22),
|
|
277
|
+
alignItems: 'center',
|
|
278
|
+
},
|
|
279
|
+
iconBadge: {
|
|
280
|
+
width: ms(88),
|
|
281
|
+
height: ms(88),
|
|
282
|
+
borderRadius: ms(22),
|
|
283
|
+
backgroundColor: palette.surfaceRaised,
|
|
284
|
+
alignItems: 'center',
|
|
285
|
+
justifyContent: 'center',
|
|
286
|
+
marginBottom: ms(18),
|
|
287
|
+
},
|
|
288
|
+
extBadge: {
|
|
289
|
+
position: 'absolute',
|
|
290
|
+
bottom: -ms(6),
|
|
291
|
+
paddingHorizontal: ms(8),
|
|
292
|
+
paddingVertical: ms(2),
|
|
293
|
+
borderRadius: ms(6),
|
|
294
|
+
backgroundColor: palette.primary,
|
|
295
|
+
maxWidth: ms(72),
|
|
296
|
+
},
|
|
297
|
+
extBadgeText: {
|
|
298
|
+
color: palette.white,
|
|
299
|
+
fontSize: fs(10),
|
|
300
|
+
fontWeight: '800',
|
|
301
|
+
letterSpacing: 0.5,
|
|
302
|
+
},
|
|
303
|
+
name: {
|
|
304
|
+
color: palette.textBright,
|
|
305
|
+
fontSize: fs(16),
|
|
306
|
+
fontWeight: '700',
|
|
307
|
+
textAlign: 'center',
|
|
308
|
+
marginBottom: ms(8),
|
|
309
|
+
},
|
|
310
|
+
metaRow: {
|
|
311
|
+
flexDirection: 'row',
|
|
312
|
+
alignItems: 'center',
|
|
313
|
+
marginBottom: ms(14),
|
|
314
|
+
},
|
|
315
|
+
metaText: {
|
|
316
|
+
color: palette.textFaded,
|
|
317
|
+
fontSize: fs(12.5),
|
|
318
|
+
fontWeight: '500',
|
|
319
|
+
},
|
|
320
|
+
metaDot: {
|
|
321
|
+
width: ms(3),
|
|
322
|
+
height: ms(3),
|
|
323
|
+
borderRadius: ms(2),
|
|
324
|
+
backgroundColor: palette.textDim,
|
|
325
|
+
marginHorizontal: ms(8),
|
|
326
|
+
},
|
|
327
|
+
noPreviewText: {
|
|
328
|
+
color: palette.textSteel,
|
|
329
|
+
fontSize: fs(12),
|
|
330
|
+
fontWeight: '500',
|
|
331
|
+
textAlign: 'center',
|
|
332
|
+
marginBottom: ms(18),
|
|
333
|
+
},
|
|
334
|
+
openButton: {
|
|
335
|
+
minWidth: ms(150),
|
|
336
|
+
paddingVertical: ms(12),
|
|
337
|
+
paddingHorizontal: ms(28),
|
|
338
|
+
borderRadius: ms(14),
|
|
339
|
+
backgroundColor: palette.primary,
|
|
340
|
+
alignItems: 'center',
|
|
341
|
+
justifyContent: 'center',
|
|
342
|
+
},
|
|
343
|
+
openButtonPressed: {
|
|
344
|
+
backgroundColor: palette.accentIndigoDeep,
|
|
345
|
+
},
|
|
346
|
+
openButtonDisabled: {
|
|
347
|
+
opacity: 0.6,
|
|
348
|
+
},
|
|
349
|
+
openButtonText: {
|
|
350
|
+
color: palette.white,
|
|
351
|
+
fontSize: fs(14.5),
|
|
352
|
+
fontWeight: '700',
|
|
353
|
+
},
|
|
354
|
+
errorText: {
|
|
355
|
+
color: palette.accentSalmon,
|
|
356
|
+
fontSize: fs(12),
|
|
357
|
+
fontWeight: '500',
|
|
358
|
+
marginTop: ms(14),
|
|
359
|
+
textAlign: 'center',
|
|
360
|
+
},
|
|
361
|
+
});
|