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.
Files changed (506) hide show
  1. package/CustomCamera.podspec +20 -0
  2. package/LICENSE +20 -0
  3. package/README.md +833 -0
  4. package/android/build.gradle +135 -0
  5. package/android/consumer-rules.pro +47 -0
  6. package/android/src/main/AndroidManifest.xml +72 -0
  7. package/android/src/main/java/android/print/PdfPrint.java +51 -0
  8. package/android/src/main/java/com/customcamera/AnimatedImageViewManager.kt +199 -0
  9. package/android/src/main/java/com/customcamera/AudioPlayerView.kt +322 -0
  10. package/android/src/main/java/com/customcamera/AudioRecorder.kt +506 -0
  11. package/android/src/main/java/com/customcamera/BarcodeScannerActivity.kt +361 -0
  12. package/android/src/main/java/com/customcamera/BlurBackgroundView.kt +199 -0
  13. package/android/src/main/java/com/customcamera/CacheCleanupManager.kt +386 -0
  14. package/android/src/main/java/com/customcamera/CameraAspectRatioMode.kt +77 -0
  15. package/android/src/main/java/com/customcamera/CameraAsset.kt +211 -0
  16. package/android/src/main/java/com/customcamera/CameraTheme.kt +479 -0
  17. package/android/src/main/java/com/customcamera/CompressionCacheStore.kt +504 -0
  18. package/android/src/main/java/com/customcamera/CompressionFileNameUtils.kt +7 -0
  19. package/android/src/main/java/com/customcamera/CompressionProfile.kt +195 -0
  20. package/android/src/main/java/com/customcamera/CustomCameraActivity.kt +7291 -0
  21. package/android/src/main/java/com/customcamera/CustomCameraFileProvider.kt +9 -0
  22. package/android/src/main/java/com/customcamera/CustomCameraModule.kt +2479 -0
  23. package/android/src/main/java/com/customcamera/CustomCameraPackage.kt +53 -0
  24. package/android/src/main/java/com/customcamera/DisplayUtils.kt +9 -0
  25. package/android/src/main/java/com/customcamera/DocumentPreviewView.kt +846 -0
  26. package/android/src/main/java/com/customcamera/DrawingView.kt +214 -0
  27. package/android/src/main/java/com/customcamera/EmojiPickerData.kt +228 -0
  28. package/android/src/main/java/com/customcamera/FilterStripAdapter.kt +158 -0
  29. package/android/src/main/java/com/customcamera/GifSupport.kt +215 -0
  30. package/android/src/main/java/com/customcamera/GlobalAudioPlayer.kt +320 -0
  31. package/android/src/main/java/com/customcamera/ImageExporter.kt +1394 -0
  32. package/android/src/main/java/com/customcamera/ImageFormatSupport.kt +163 -0
  33. package/android/src/main/java/com/customcamera/Localization.kt +206 -0
  34. package/android/src/main/java/com/customcamera/MediaAdapters.kt +758 -0
  35. package/android/src/main/java/com/customcamera/MediaCacheManager.kt +782 -0
  36. package/android/src/main/java/com/customcamera/MediaExportFormats.kt +201 -0
  37. package/android/src/main/java/com/customcamera/MediaFileIo.kt +310 -0
  38. package/android/src/main/java/com/customcamera/MediaMetadataStore.kt +494 -0
  39. package/android/src/main/java/com/customcamera/MediaPreviewEditor.kt +14865 -0
  40. package/android/src/main/java/com/customcamera/MediaPublisher.kt +423 -0
  41. package/android/src/main/java/com/customcamera/MediaStorageWorkflow.kt +722 -0
  42. package/android/src/main/java/com/customcamera/MediaStoreRepository.kt +378 -0
  43. package/android/src/main/java/com/customcamera/MediaThumbnailView.kt +286 -0
  44. package/android/src/main/java/com/customcamera/MediaUtils.kt +37 -0
  45. package/android/src/main/java/com/customcamera/NativeVideoViewManager.kt +845 -0
  46. package/android/src/main/java/com/customcamera/OfficeDocumentConverter.kt +2791 -0
  47. package/android/src/main/java/com/customcamera/PendingCaptureCrops.kt +88 -0
  48. package/android/src/main/java/com/customcamera/PowerPointPreview.kt +4077 -0
  49. package/android/src/main/java/com/customcamera/RecentPickerStore.kt +74 -0
  50. package/android/src/main/java/com/customcamera/SecureFileEraser.kt +411 -0
  51. package/android/src/main/java/com/customcamera/SecureKeyModule.kt +88 -0
  52. package/android/src/main/java/com/customcamera/SecureMediaDeleter.kt +493 -0
  53. package/android/src/main/java/com/customcamera/StickerPickerData.kt +107 -0
  54. package/android/src/main/java/com/customcamera/SvgDrawable.kt +175 -0
  55. package/android/src/main/java/com/customcamera/SvgIconViewManager.kt +77 -0
  56. package/android/src/main/java/com/customcamera/TextEntryController.kt +553 -0
  57. package/android/src/main/java/com/customcamera/ThumbnailLoader.kt +455 -0
  58. package/android/src/main/java/com/customcamera/UploadService.kt +909 -0
  59. package/android/src/main/java/com/customcamera/VideoEditUtils.kt +210 -0
  60. package/android/src/main/java/com/customcamera/VideoRotationTranscoder.kt +1992 -0
  61. package/android/src/main/java/com/customcamera/gif/AnimatedGifEncoder.kt +473 -0
  62. package/android/src/main/java/com/customcamera/gif/GifDecoder.kt +690 -0
  63. package/android/src/main/java/com/customcamera/gif/GifFramesDrawable.kt +160 -0
  64. package/android/src/main/java/com/customcamera/gif/GifHttp.kt +112 -0
  65. package/android/src/main/java/com/customcamera/gif/GifImageLoader.kt +186 -0
  66. package/android/src/main/java/com/customcamera/gif/GifModels.kt +74 -0
  67. package/android/src/main/java/com/customcamera/gif/GifProvider.kt +49 -0
  68. package/android/src/main/java/com/customcamera/gif/GifProviders.kt +27 -0
  69. package/android/src/main/java/com/customcamera/gif/GifRepository.kt +124 -0
  70. package/android/src/main/java/com/customcamera/gif/GifSafety.kt +33 -0
  71. package/android/src/main/java/com/customcamera/gif/GiphyGifProvider.kt +146 -0
  72. package/android/src/main/java/com/customcamera/gif/LZWEncoder.kt +258 -0
  73. package/android/src/main/java/com/customcamera/gif/NeuQuant.kt +435 -0
  74. package/android/src/main/java/com/customcamera/gif/TenorGifProvider.kt +147 -0
  75. package/android/src/main/res/drawable/bg_brush_selected.xml +5 -0
  76. package/android/src/main/res/drawable/bg_color_swatch.xml +5 -0
  77. package/android/src/main/res/drawable/bg_editor_toolbar.xml +6 -0
  78. package/android/src/main/res/drawable/bg_icon_circle.xml +5 -0
  79. package/android/src/main/res/drawable/bg_icon_circle_light.xml +5 -0
  80. package/android/src/main/res/drawable/bg_mode_tab_active.xml +6 -0
  81. package/android/src/main/res/drawable/bg_pill.xml +6 -0
  82. package/android/src/main/res/drawable/bg_recording_dot.xml +6 -0
  83. package/android/src/main/res/drawable/bg_selection_badge.xml +8 -0
  84. package/android/src/main/res/drawable/bg_send_button.xml +5 -0
  85. package/android/src/main/res/drawable/bg_shutter_inner.xml +5 -0
  86. package/android/src/main/res/drawable/bg_shutter_recording.xml +6 -0
  87. package/android/src/main/res/drawable/bg_shutter_ring.xml +8 -0
  88. package/android/src/main/res/drawable/bg_shutter_video_idle.xml +5 -0
  89. package/android/src/main/res/drawable/bg_thumbnail.xml +9 -0
  90. package/android/src/main/res/drawable/ic_aspect_ratio.xml +17 -0
  91. package/android/src/main/res/drawable/ic_audio.xml +10 -0
  92. package/android/src/main/res/drawable/ic_back.xml +10 -0
  93. package/android/src/main/res/drawable/ic_brush_medium.xml +12 -0
  94. package/android/src/main/res/drawable/ic_brush_thick.xml +12 -0
  95. package/android/src/main/res/drawable/ic_brush_thin.xml +12 -0
  96. package/android/src/main/res/drawable/ic_check.xml +17 -0
  97. package/android/src/main/res/drawable/ic_chevron_down.xml +10 -0
  98. package/android/src/main/res/drawable/ic_chevron_up.xml +13 -0
  99. package/android/src/main/res/drawable/ic_clear_drawing.xml +10 -0
  100. package/android/src/main/res/drawable/ic_close.xml +10 -0
  101. package/android/src/main/res/drawable/ic_cover.xml +9 -0
  102. package/android/src/main/res/drawable/ic_crop.xml +10 -0
  103. package/android/src/main/res/drawable/ic_delete.xml +9 -0
  104. package/android/src/main/res/drawable/ic_document.xml +10 -0
  105. package/android/src/main/res/drawable/ic_done.xml +10 -0
  106. package/android/src/main/res/drawable/ic_download.xml +10 -0
  107. package/android/src/main/res/drawable/ic_emoji.xml +10 -0
  108. package/android/src/main/res/drawable/ic_filter.xml +10 -0
  109. package/android/src/main/res/drawable/ic_flash_auto.xml +7 -0
  110. package/android/src/main/res/drawable/ic_flash_off.xml +23 -0
  111. package/android/src/main/res/drawable/ic_flash_on.xml +16 -0
  112. package/android/src/main/res/drawable/ic_flip.xml +15 -0
  113. package/android/src/main/res/drawable/ic_gallery.xml +10 -0
  114. package/android/src/main/res/drawable/ic_gif.xml +24 -0
  115. package/android/src/main/res/drawable/ic_lock.xml +19 -0
  116. package/android/src/main/res/drawable/ic_lock_open.xml +22 -0
  117. package/android/src/main/res/drawable/ic_marker.xml +10 -0
  118. package/android/src/main/res/drawable/ic_more_vert.xml +18 -0
  119. package/android/src/main/res/drawable/ic_overlay_close.xml +19 -0
  120. package/android/src/main/res/drawable/ic_overlay_resize.xml +18 -0
  121. package/android/src/main/res/drawable/ic_pause.xml +10 -0
  122. package/android/src/main/res/drawable/ic_photo_mode.xml +10 -0
  123. package/android/src/main/res/drawable/ic_play.xml +10 -0
  124. package/android/src/main/res/drawable/ic_redo.xml +10 -0
  125. package/android/src/main/res/drawable/ic_rotate.xml +9 -0
  126. package/android/src/main/res/drawable/ic_send.xml +10 -0
  127. package/android/src/main/res/drawable/ic_share.xml +10 -0
  128. package/android/src/main/res/drawable/ic_stat_upload.xml +10 -0
  129. package/android/src/main/res/drawable/ic_sticker.xml +24 -0
  130. package/android/src/main/res/drawable/ic_text.xml +10 -0
  131. package/android/src/main/res/drawable/ic_text_align_center.xml +11 -0
  132. package/android/src/main/res/drawable/ic_text_align_left.xml +11 -0
  133. package/android/src/main/res/drawable/ic_text_align_right.xml +11 -0
  134. package/android/src/main/res/drawable/ic_text_bg.xml +11 -0
  135. package/android/src/main/res/drawable/ic_trim.xml +23 -0
  136. package/android/src/main/res/drawable/ic_undo.xml +10 -0
  137. package/android/src/main/res/drawable/ic_video_mode.xml +10 -0
  138. package/android/src/main/res/drawable/ic_video_note.xml +13 -0
  139. package/android/src/main/res/drawable/ic_volume_off.xml +9 -0
  140. package/android/src/main/res/drawable/ic_volume_on.xml +9 -0
  141. package/android/src/main/res/drawable/sticker_heart.xml +9 -0
  142. package/android/src/main/res/drawable/sticker_smile.xml +9 -0
  143. package/android/src/main/res/drawable/sticker_star.xml +9 -0
  144. package/android/src/main/res/drawable/sticker_thumbsup.xml +9 -0
  145. package/android/src/main/res/values/colors.xml +34 -0
  146. package/android/src/main/res/values/ids.xml +15 -0
  147. package/android/src/main/res/values/strings.xml +15 -0
  148. package/android/src/main/res/values/styles.xml +20 -0
  149. package/android/src/main/res/xml/file_paths.xml +34 -0
  150. package/ios/CustomCamera.h +5 -0
  151. package/ios/CustomCamera.mm +214 -0
  152. package/lib/module/AudioPlayerContext.js +233 -0
  153. package/lib/module/AudioPlayerContext.js.map +1 -0
  154. package/lib/module/CameraPreview.js +304 -0
  155. package/lib/module/CameraPreview.js.map +1 -0
  156. package/lib/module/NativeAnimatedImageView.js +41 -0
  157. package/lib/module/NativeAnimatedImageView.js.map +1 -0
  158. package/lib/module/NativeAudioPlayerView.js +33 -0
  159. package/lib/module/NativeAudioPlayerView.js.map +1 -0
  160. package/lib/module/NativeBlurView.js +35 -0
  161. package/lib/module/NativeBlurView.js.map +1 -0
  162. package/lib/module/NativeCustomCamera.js +128 -0
  163. package/lib/module/NativeCustomCamera.js.map +1 -0
  164. package/lib/module/NativeCustomCamera.web.js +143 -0
  165. package/lib/module/NativeCustomCamera.web.js.map +1 -0
  166. package/lib/module/NativeCustomVideoView.js +5 -0
  167. package/lib/module/NativeCustomVideoView.js.map +1 -0
  168. package/lib/module/NativeDocumentPreviewView.js +156 -0
  169. package/lib/module/NativeDocumentPreviewView.js.map +1 -0
  170. package/lib/module/NativeMediaThumbnailView.js +110 -0
  171. package/lib/module/NativeMediaThumbnailView.js.map +1 -0
  172. package/lib/module/NativeSvgIcon.js +32 -0
  173. package/lib/module/NativeSvgIcon.js.map +1 -0
  174. package/lib/module/ResponsivePreviewContainer.js +171 -0
  175. package/lib/module/ResponsivePreviewContainer.js.map +1 -0
  176. package/lib/module/accessibility.js +61 -0
  177. package/lib/module/accessibility.js.map +1 -0
  178. package/lib/module/config.js +352 -0
  179. package/lib/module/config.js.map +1 -0
  180. package/lib/module/cpuOptimization.js +296 -0
  181. package/lib/module/cpuOptimization.js.map +1 -0
  182. package/lib/module/db/DatabaseManager.js +191 -0
  183. package/lib/module/db/DatabaseManager.js.map +1 -0
  184. package/lib/module/db/MediaMapper.js +284 -0
  185. package/lib/module/db/MediaMapper.js.map +1 -0
  186. package/lib/module/db/MediaRepository.js +242 -0
  187. package/lib/module/db/MediaRepository.js.map +1 -0
  188. package/lib/module/db/index.js +41 -0
  189. package/lib/module/db/index.js.map +1 -0
  190. package/lib/module/db/migrations.js +180 -0
  191. package/lib/module/db/migrations.js.map +1 -0
  192. package/lib/module/db/react-native-sqlcipher.d.js +2 -0
  193. package/lib/module/db/react-native-sqlcipher.d.js.map +1 -0
  194. package/lib/module/db/secureKey.js +87 -0
  195. package/lib/module/db/secureKey.js.map +1 -0
  196. package/lib/module/db/types.js +57 -0
  197. package/lib/module/db/types.js.map +1 -0
  198. package/lib/module/db/useMediaDatabase.js +123 -0
  199. package/lib/module/db/useMediaDatabase.js.map +1 -0
  200. package/lib/module/defaultIcons.js +2259 -0
  201. package/lib/module/defaultIcons.js.map +1 -0
  202. package/lib/module/deviceCapabilities.js +408 -0
  203. package/lib/module/deviceCapabilities.js.map +1 -0
  204. package/lib/module/errors.js +267 -0
  205. package/lib/module/errors.js.map +1 -0
  206. package/lib/module/iconConfig.js +796 -0
  207. package/lib/module/iconConfig.js.map +1 -0
  208. package/lib/module/icons.js +514 -0
  209. package/lib/module/icons.js.map +1 -0
  210. package/lib/module/index.js +251 -0
  211. package/lib/module/index.js.map +1 -0
  212. package/lib/module/jest-globals.d.js +2 -0
  213. package/lib/module/jest-globals.d.js.map +1 -0
  214. package/lib/module/library/MediaLibrary.js +107 -0
  215. package/lib/module/library/MediaLibrary.js.map +1 -0
  216. package/lib/module/library/MediaLibraryScreen.js +2597 -0
  217. package/lib/module/library/MediaLibraryScreen.js.map +1 -0
  218. package/lib/module/library/components/AudioPreview.js +74 -0
  219. package/lib/module/library/components/AudioPreview.js.map +1 -0
  220. package/lib/module/library/components/DocumentPreview.js +331 -0
  221. package/lib/module/library/components/DocumentPreview.js.map +1 -0
  222. package/lib/module/library/components/ExpandableFab.js +343 -0
  223. package/lib/module/library/components/ExpandableFab.js.map +1 -0
  224. package/lib/module/library/components/FileTiles.js +251 -0
  225. package/lib/module/library/components/FileTiles.js.map +1 -0
  226. package/lib/module/library/components/ImagePreview.js +70 -0
  227. package/lib/module/library/components/ImagePreview.js.map +1 -0
  228. package/lib/module/library/components/MediaMetadataHeader.js +175 -0
  229. package/lib/module/library/components/MediaMetadataHeader.js.map +1 -0
  230. package/lib/module/library/components/RecordAudioScreen.js +816 -0
  231. package/lib/module/library/components/RecordAudioScreen.js.map +1 -0
  232. package/lib/module/library/components/VideoPreview.js +453 -0
  233. package/lib/module/library/components/VideoPreview.js.map +1 -0
  234. package/lib/module/library/components/ViewerCounter.js +55 -0
  235. package/lib/module/library/components/ViewerCounter.js.map +1 -0
  236. package/lib/module/library/compressionEstimate.js +507 -0
  237. package/lib/module/library/compressionEstimate.js.map +1 -0
  238. package/lib/module/library/fileMetadata.js +196 -0
  239. package/lib/module/library/fileMetadata.js.map +1 -0
  240. package/lib/module/library/index.js +42 -0
  241. package/lib/module/library/index.js.map +1 -0
  242. package/lib/module/library/libraryIconRegistry.js +69 -0
  243. package/lib/module/library/libraryIconRegistry.js.map +1 -0
  244. package/lib/module/library/libraryIcons.js +858 -0
  245. package/lib/module/library/libraryIcons.js.map +1 -0
  246. package/lib/module/library/localizedFormat.js +181 -0
  247. package/lib/module/library/localizedFormat.js.map +1 -0
  248. package/lib/module/library/palette.js +225 -0
  249. package/lib/module/library/palette.js.map +1 -0
  250. package/lib/module/library/responsive.js +53 -0
  251. package/lib/module/library/responsive.js.map +1 -0
  252. package/lib/module/locales.js +416 -0
  253. package/lib/module/locales.js.map +1 -0
  254. package/lib/module/localization.js +1064 -0
  255. package/lib/module/localization.js.map +1 -0
  256. package/lib/module/logger.js +20 -0
  257. package/lib/module/logger.js.map +1 -0
  258. package/lib/module/lowMemoryCache.js +206 -0
  259. package/lib/module/lowMemoryCache.js.map +1 -0
  260. package/lib/module/mediaHistory.js +33 -0
  261. package/lib/module/mediaHistory.js.map +1 -0
  262. package/lib/module/mediaStorageService.js +402 -0
  263. package/lib/module/mediaStorageService.js.map +1 -0
  264. package/lib/module/memory.js +79 -0
  265. package/lib/module/memory.js.map +1 -0
  266. package/lib/module/nativeActions.js +307 -0
  267. package/lib/module/nativeActions.js.map +1 -0
  268. package/lib/module/nativeComponentSupport.js +61 -0
  269. package/lib/module/nativeComponentSupport.js.map +1 -0
  270. package/lib/module/networkPerformance.js +24 -0
  271. package/lib/module/networkPerformance.js.map +1 -0
  272. package/lib/module/package.json +1 -0
  273. package/lib/module/performance.js +104 -0
  274. package/lib/module/performance.js.map +1 -0
  275. package/lib/module/performanceMonitor.js +155 -0
  276. package/lib/module/performanceMonitor.js.map +1 -0
  277. package/lib/module/permissions.js +370 -0
  278. package/lib/module/permissions.js.map +1 -0
  279. package/lib/module/rendering.js +40 -0
  280. package/lib/module/rendering.js.map +1 -0
  281. package/lib/module/security.js +18 -0
  282. package/lib/module/security.js.map +1 -0
  283. package/lib/module/state.js +266 -0
  284. package/lib/module/state.js.map +1 -0
  285. package/lib/module/storage.js +400 -0
  286. package/lib/module/storage.js.map +1 -0
  287. package/lib/module/theme.js +390 -0
  288. package/lib/module/theme.js.map +1 -0
  289. package/lib/module/types.js +4 -0
  290. package/lib/module/types.js.map +1 -0
  291. package/lib/module/utils.js +115 -0
  292. package/lib/module/utils.js.map +1 -0
  293. package/lib/module/validation.js +288 -0
  294. package/lib/module/validation.js.map +1 -0
  295. package/lib/typescript/package.json +1 -0
  296. package/lib/typescript/src/AudioPlayerContext.d.ts +27 -0
  297. package/lib/typescript/src/AudioPlayerContext.d.ts.map +1 -0
  298. package/lib/typescript/src/CameraPreview.d.ts +13 -0
  299. package/lib/typescript/src/CameraPreview.d.ts.map +1 -0
  300. package/lib/typescript/src/NativeAnimatedImageView.d.ts +33 -0
  301. package/lib/typescript/src/NativeAnimatedImageView.d.ts.map +1 -0
  302. package/lib/typescript/src/NativeAudioPlayerView.d.ts +12 -0
  303. package/lib/typescript/src/NativeAudioPlayerView.d.ts.map +1 -0
  304. package/lib/typescript/src/NativeBlurView.d.ts +12 -0
  305. package/lib/typescript/src/NativeBlurView.d.ts.map +1 -0
  306. package/lib/typescript/src/NativeCustomCamera.d.ts +167 -0
  307. package/lib/typescript/src/NativeCustomCamera.d.ts.map +1 -0
  308. package/lib/typescript/src/NativeCustomCamera.web.d.ts +47 -0
  309. package/lib/typescript/src/NativeCustomCamera.web.d.ts.map +1 -0
  310. package/lib/typescript/src/NativeCustomVideoView.d.ts +30 -0
  311. package/lib/typescript/src/NativeCustomVideoView.d.ts.map +1 -0
  312. package/lib/typescript/src/NativeDocumentPreviewView.d.ts +48 -0
  313. package/lib/typescript/src/NativeDocumentPreviewView.d.ts.map +1 -0
  314. package/lib/typescript/src/NativeMediaThumbnailView.d.ts +54 -0
  315. package/lib/typescript/src/NativeMediaThumbnailView.d.ts.map +1 -0
  316. package/lib/typescript/src/NativeSvgIcon.d.ts +25 -0
  317. package/lib/typescript/src/NativeSvgIcon.d.ts.map +1 -0
  318. package/lib/typescript/src/ResponsivePreviewContainer.d.ts +92 -0
  319. package/lib/typescript/src/ResponsivePreviewContainer.d.ts.map +1 -0
  320. package/lib/typescript/src/accessibility.d.ts +20 -0
  321. package/lib/typescript/src/accessibility.d.ts.map +1 -0
  322. package/lib/typescript/src/config.d.ts +145 -0
  323. package/lib/typescript/src/config.d.ts.map +1 -0
  324. package/lib/typescript/src/cpuOptimization.d.ts +63 -0
  325. package/lib/typescript/src/cpuOptimization.d.ts.map +1 -0
  326. package/lib/typescript/src/db/DatabaseManager.d.ts +48 -0
  327. package/lib/typescript/src/db/DatabaseManager.d.ts.map +1 -0
  328. package/lib/typescript/src/db/MediaMapper.d.ts +77 -0
  329. package/lib/typescript/src/db/MediaMapper.d.ts.map +1 -0
  330. package/lib/typescript/src/db/MediaRepository.d.ts +66 -0
  331. package/lib/typescript/src/db/MediaRepository.d.ts.map +1 -0
  332. package/lib/typescript/src/db/index.d.ts +23 -0
  333. package/lib/typescript/src/db/index.d.ts.map +1 -0
  334. package/lib/typescript/src/db/migrations.d.ts +31 -0
  335. package/lib/typescript/src/db/migrations.d.ts.map +1 -0
  336. package/lib/typescript/src/db/secureKey.d.ts +10 -0
  337. package/lib/typescript/src/db/secureKey.d.ts.map +1 -0
  338. package/lib/typescript/src/db/types.d.ts +115 -0
  339. package/lib/typescript/src/db/types.d.ts.map +1 -0
  340. package/lib/typescript/src/db/useMediaDatabase.d.ts +41 -0
  341. package/lib/typescript/src/db/useMediaDatabase.d.ts.map +1 -0
  342. package/lib/typescript/src/defaultIcons.d.ts +139 -0
  343. package/lib/typescript/src/defaultIcons.d.ts.map +1 -0
  344. package/lib/typescript/src/deviceCapabilities.d.ts +92 -0
  345. package/lib/typescript/src/deviceCapabilities.d.ts.map +1 -0
  346. package/lib/typescript/src/errors.d.ts +95 -0
  347. package/lib/typescript/src/errors.d.ts.map +1 -0
  348. package/lib/typescript/src/iconConfig.d.ts +176 -0
  349. package/lib/typescript/src/iconConfig.d.ts.map +1 -0
  350. package/lib/typescript/src/icons.d.ts +217 -0
  351. package/lib/typescript/src/icons.d.ts.map +1 -0
  352. package/lib/typescript/src/index.d.ts +104 -0
  353. package/lib/typescript/src/index.d.ts.map +1 -0
  354. package/lib/typescript/src/library/MediaLibrary.d.ts +57 -0
  355. package/lib/typescript/src/library/MediaLibrary.d.ts.map +1 -0
  356. package/lib/typescript/src/library/MediaLibraryScreen.d.ts +51 -0
  357. package/lib/typescript/src/library/MediaLibraryScreen.d.ts.map +1 -0
  358. package/lib/typescript/src/library/components/AudioPreview.d.ts +6 -0
  359. package/lib/typescript/src/library/components/AudioPreview.d.ts.map +1 -0
  360. package/lib/typescript/src/library/components/DocumentPreview.d.ts +10 -0
  361. package/lib/typescript/src/library/components/DocumentPreview.d.ts.map +1 -0
  362. package/lib/typescript/src/library/components/ExpandableFab.d.ts +39 -0
  363. package/lib/typescript/src/library/components/ExpandableFab.d.ts.map +1 -0
  364. package/lib/typescript/src/library/components/FileTiles.d.ts +8 -0
  365. package/lib/typescript/src/library/components/FileTiles.d.ts.map +1 -0
  366. package/lib/typescript/src/library/components/ImagePreview.d.ts +5 -0
  367. package/lib/typescript/src/library/components/ImagePreview.d.ts.map +1 -0
  368. package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts +16 -0
  369. package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts.map +1 -0
  370. package/lib/typescript/src/library/components/RecordAudioScreen.d.ts +8 -0
  371. package/lib/typescript/src/library/components/RecordAudioScreen.d.ts.map +1 -0
  372. package/lib/typescript/src/library/components/VideoPreview.d.ts +20 -0
  373. package/lib/typescript/src/library/components/VideoPreview.d.ts.map +1 -0
  374. package/lib/typescript/src/library/components/ViewerCounter.d.ts +13 -0
  375. package/lib/typescript/src/library/components/ViewerCounter.d.ts.map +1 -0
  376. package/lib/typescript/src/library/compressionEstimate.d.ts +313 -0
  377. package/lib/typescript/src/library/compressionEstimate.d.ts.map +1 -0
  378. package/lib/typescript/src/library/fileMetadata.d.ts +33 -0
  379. package/lib/typescript/src/library/fileMetadata.d.ts.map +1 -0
  380. package/lib/typescript/src/library/index.d.ts +40 -0
  381. package/lib/typescript/src/library/index.d.ts.map +1 -0
  382. package/lib/typescript/src/library/libraryIconRegistry.d.ts +35 -0
  383. package/lib/typescript/src/library/libraryIconRegistry.d.ts.map +1 -0
  384. package/lib/typescript/src/library/libraryIcons.d.ts +85 -0
  385. package/lib/typescript/src/library/libraryIcons.d.ts.map +1 -0
  386. package/lib/typescript/src/library/localizedFormat.d.ts +49 -0
  387. package/lib/typescript/src/library/localizedFormat.d.ts.map +1 -0
  388. package/lib/typescript/src/library/palette.d.ts +104 -0
  389. package/lib/typescript/src/library/palette.d.ts.map +1 -0
  390. package/lib/typescript/src/library/responsive.d.ts +15 -0
  391. package/lib/typescript/src/library/responsive.d.ts.map +1 -0
  392. package/lib/typescript/src/locales.d.ts +103 -0
  393. package/lib/typescript/src/locales.d.ts.map +1 -0
  394. package/lib/typescript/src/localization.d.ts +1051 -0
  395. package/lib/typescript/src/localization.d.ts.map +1 -0
  396. package/lib/typescript/src/logger.d.ts +4 -0
  397. package/lib/typescript/src/logger.d.ts.map +1 -0
  398. package/lib/typescript/src/lowMemoryCache.d.ts +64 -0
  399. package/lib/typescript/src/lowMemoryCache.d.ts.map +1 -0
  400. package/lib/typescript/src/mediaHistory.d.ts +3 -0
  401. package/lib/typescript/src/mediaHistory.d.ts.map +1 -0
  402. package/lib/typescript/src/mediaStorageService.d.ts +155 -0
  403. package/lib/typescript/src/mediaStorageService.d.ts.map +1 -0
  404. package/lib/typescript/src/memory.d.ts +21 -0
  405. package/lib/typescript/src/memory.d.ts.map +1 -0
  406. package/lib/typescript/src/nativeActions.d.ts +174 -0
  407. package/lib/typescript/src/nativeActions.d.ts.map +1 -0
  408. package/lib/typescript/src/nativeComponentSupport.d.ts +30 -0
  409. package/lib/typescript/src/nativeComponentSupport.d.ts.map +1 -0
  410. package/lib/typescript/src/networkPerformance.d.ts +12 -0
  411. package/lib/typescript/src/networkPerformance.d.ts.map +1 -0
  412. package/lib/typescript/src/performance.d.ts +32 -0
  413. package/lib/typescript/src/performance.d.ts.map +1 -0
  414. package/lib/typescript/src/performanceMonitor.d.ts +45 -0
  415. package/lib/typescript/src/performanceMonitor.d.ts.map +1 -0
  416. package/lib/typescript/src/permissions.d.ts +132 -0
  417. package/lib/typescript/src/permissions.d.ts.map +1 -0
  418. package/lib/typescript/src/rendering.d.ts +9 -0
  419. package/lib/typescript/src/rendering.d.ts.map +1 -0
  420. package/lib/typescript/src/security.d.ts +6 -0
  421. package/lib/typescript/src/security.d.ts.map +1 -0
  422. package/lib/typescript/src/state.d.ts +102 -0
  423. package/lib/typescript/src/state.d.ts.map +1 -0
  424. package/lib/typescript/src/storage.d.ts +117 -0
  425. package/lib/typescript/src/storage.d.ts.map +1 -0
  426. package/lib/typescript/src/theme.d.ts +15 -0
  427. package/lib/typescript/src/theme.d.ts.map +1 -0
  428. package/lib/typescript/src/types.d.ts +802 -0
  429. package/lib/typescript/src/types.d.ts.map +1 -0
  430. package/lib/typescript/src/utils.d.ts +50 -0
  431. package/lib/typescript/src/utils.d.ts.map +1 -0
  432. package/lib/typescript/src/validation.d.ts +52 -0
  433. package/lib/typescript/src/validation.d.ts.map +1 -0
  434. package/package.json +204 -0
  435. package/react-native.config.js +17 -0
  436. package/src/AudioPlayerContext.tsx +220 -0
  437. package/src/CameraPreview.tsx +352 -0
  438. package/src/NativeAnimatedImageView.tsx +71 -0
  439. package/src/NativeAudioPlayerView.tsx +39 -0
  440. package/src/NativeBlurView.tsx +40 -0
  441. package/src/NativeCustomCamera.ts +305 -0
  442. package/src/NativeCustomCamera.web.ts +192 -0
  443. package/src/NativeCustomVideoView.ts +30 -0
  444. package/src/NativeDocumentPreviewView.tsx +196 -0
  445. package/src/NativeMediaThumbnailView.tsx +167 -0
  446. package/src/NativeSvgIcon.tsx +46 -0
  447. package/src/ResponsivePreviewContainer.tsx +227 -0
  448. package/src/accessibility.ts +80 -0
  449. package/src/config.ts +406 -0
  450. package/src/cpuOptimization.ts +365 -0
  451. package/src/db/DatabaseManager.ts +212 -0
  452. package/src/db/MediaMapper.ts +377 -0
  453. package/src/db/MediaRepository.ts +313 -0
  454. package/src/db/index.ts +73 -0
  455. package/src/db/migrations.ts +222 -0
  456. package/src/db/react-native-sqlcipher.d.ts +76 -0
  457. package/src/db/secureKey.ts +100 -0
  458. package/src/db/types.ts +123 -0
  459. package/src/db/useMediaDatabase.ts +191 -0
  460. package/src/defaultIcons.tsx +2390 -0
  461. package/src/deviceCapabilities.ts +438 -0
  462. package/src/errors.ts +350 -0
  463. package/src/iconConfig.tsx +962 -0
  464. package/src/icons.tsx +788 -0
  465. package/src/index.tsx +763 -0
  466. package/src/jest-globals.d.ts +9 -0
  467. package/src/library/MediaLibrary.tsx +141 -0
  468. package/src/library/MediaLibraryScreen.tsx +3003 -0
  469. package/src/library/components/AudioPreview.tsx +73 -0
  470. package/src/library/components/DocumentPreview.tsx +361 -0
  471. package/src/library/components/ExpandableFab.tsx +342 -0
  472. package/src/library/components/FileTiles.tsx +252 -0
  473. package/src/library/components/ImagePreview.tsx +72 -0
  474. package/src/library/components/MediaMetadataHeader.tsx +208 -0
  475. package/src/library/components/RecordAudioScreen.tsx +845 -0
  476. package/src/library/components/VideoPreview.tsx +478 -0
  477. package/src/library/components/ViewerCounter.tsx +71 -0
  478. package/src/library/compressionEstimate.ts +662 -0
  479. package/src/library/fileMetadata.ts +212 -0
  480. package/src/library/index.ts +66 -0
  481. package/src/library/libraryIconRegistry.tsx +86 -0
  482. package/src/library/libraryIcons.tsx +928 -0
  483. package/src/library/localizedFormat.ts +207 -0
  484. package/src/library/palette.ts +281 -0
  485. package/src/library/responsive.ts +49 -0
  486. package/src/locales.ts +381 -0
  487. package/src/localization.ts +1947 -0
  488. package/src/logger.ts +20 -0
  489. package/src/lowMemoryCache.ts +218 -0
  490. package/src/mediaHistory.ts +42 -0
  491. package/src/mediaStorageService.ts +546 -0
  492. package/src/memory.ts +102 -0
  493. package/src/nativeActions.ts +422 -0
  494. package/src/nativeComponentSupport.ts +60 -0
  495. package/src/networkPerformance.ts +30 -0
  496. package/src/performance.ts +137 -0
  497. package/src/performanceMonitor.ts +219 -0
  498. package/src/permissions.ts +403 -0
  499. package/src/rendering.ts +47 -0
  500. package/src/security.ts +19 -0
  501. package/src/state.ts +333 -0
  502. package/src/storage.ts +453 -0
  503. package/src/theme.tsx +467 -0
  504. package/src/types.ts +946 -0
  505. package/src/utils.ts +177 -0
  506. package/src/validation.ts +372 -0
@@ -0,0 +1,796 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * THE centralized icon configuration for the whole plugin.
5
+ *
6
+ * The plugin renders icons on two physically different surfaces:
7
+ *
8
+ * - **`app`** — the React Native components (`RenderIcon`, the preview/viewer
9
+ * screens, audio player chrome). These are React components drawn from RN
10
+ * primitives; see `src/icons.tsx`.
11
+ * - **`camera`** — the native Android camera Activity and its media editor.
12
+ * That UI is Kotlin and *cannot* render React components, so its icons are
13
+ * Android vector drawables or inline SVG rendered by the platform parser;
14
+ * see `CameraIconName` in `src/types.ts`.
15
+ *
16
+ * Historically each surface had its own key space, with overlapping names
17
+ * (`close` meant two different things). This module puts ONE catalog of unique,
18
+ * camelCase {@link CameraIconId} keys in front of both of them: a host app
19
+ * customizes `close` once and the change lands on every surface that draws a
20
+ * close icon.
21
+ *
22
+ * Every entry is optional and every icon keeps its shipped default — omitting an
23
+ * id (or omitting the config entirely) leaves the plugin pixel-identical to its
24
+ * stock appearance.
25
+ *
26
+ * ```tsx
27
+ * import { setCameraIcons } from 'react-native-ensys-camera-x';
28
+ *
29
+ * setCameraIcons({
30
+ * close: MyCloseIcon, // a React component
31
+ * flashOn: require('./flash-on.png'), // an image
32
+ * done: { svg: '<svg viewBox="0 0 24 24">...</svg>' },
33
+ * send: { tintColor: '#25D366' }, // recolor the built-in icon
34
+ * crop: { resourceName: 'my_crop' }, // an Android drawable in your app
35
+ * });
36
+ * ```
37
+ *
38
+ * This module is intentionally side-effect free: it owns the catalog and the
39
+ * pure resolvers. The live store, the native bridge push and the public
40
+ * `setCameraIcons()` entry point live in `src/config.ts`, which is the single
41
+ * place that talks to both layers.
42
+ */
43
+ import { Image } from 'react-native';
44
+ import { createDefaultIconRegistry, DefaultFallbackIcon, DEFAULT_ICON_SIZE } from "./icons.js";
45
+ import { NativeSvgIcon } from "./NativeSvgIcon.js";
46
+
47
+ // ============================================================================
48
+ // Icon ids
49
+ // ============================================================================
50
+
51
+ /**
52
+ * Which surface an icon is drawn on. Determines which customization fields
53
+ * actually take effect for that icon — see {@link CameraIconCustomization}.
54
+ */
55
+
56
+ /**
57
+ * Every customizable icon in the plugin, as one flat set of unique keys.
58
+ *
59
+ * Ids are camelCase and deliberately distinct from the two internal key spaces
60
+ * they drive (`CameraIconKey` for the RN registry, `CameraIconName` for the
61
+ * native drawables) so there is never any doubt about which one a config object
62
+ * is addressing.
63
+ */
64
+
65
+ /** One row of {@link CAMERA_ICON_CATALOG}. */
66
+ import { jsx as _jsx } from "react/jsx-runtime";
67
+ /**
68
+ * The single source of truth: every icon id, the surfaces it drives, and the
69
+ * internal keys it maps onto.
70
+ *
71
+ * Typed as a total `Record` on purpose — adding a member to
72
+ * {@link CameraIconId} without adding its row here is a compile error, so the
73
+ * catalog can never drift out of sync with the union.
74
+ */
75
+ export const CAMERA_ICON_CATALOG = {
76
+ // ── Common controls ────────────────────────────────────────────────────
77
+ close: {
78
+ surface: 'both',
79
+ appKey: 'close',
80
+ nativeName: 'close',
81
+ description: 'Close / dismiss a screen, sheet or overlay.'
82
+ },
83
+ back: {
84
+ surface: 'both',
85
+ appKey: 'back',
86
+ nativeName: 'back',
87
+ description: 'Back arrow in headers.'
88
+ },
89
+ done: {
90
+ surface: 'both',
91
+ appKey: 'done',
92
+ nativeName: 'done',
93
+ description: 'Confirm / apply the current step (checkmark).'
94
+ },
95
+ cancel: {
96
+ surface: 'app',
97
+ appKey: 'cancel',
98
+ description: 'Cancel an action without applying it.'
99
+ },
100
+ check: {
101
+ surface: 'app',
102
+ appKey: 'check',
103
+ description: 'Generic checkmark used by list and option rows.'
104
+ },
105
+ selectionCheck: {
106
+ surface: 'camera',
107
+ nativeName: 'selectionCheck',
108
+ description: 'Checkmark badge on a selected gallery thumbnail.'
109
+ },
110
+ // ── Camera screen ──────────────────────────────────────────────────────
111
+ camera: {
112
+ surface: 'app',
113
+ appKey: 'camera',
114
+ description: 'Generic camera icon (buttons that open the camera).'
115
+ },
116
+ photo: {
117
+ surface: 'app',
118
+ appKey: 'photo',
119
+ description: 'Still photo / image media.'
120
+ },
121
+ video: {
122
+ surface: 'app',
123
+ appKey: 'video',
124
+ description: 'Video clip media.'
125
+ },
126
+ photoMode: {
127
+ surface: 'both',
128
+ appKey: 'photo_mode',
129
+ nativeName: 'photo_mode',
130
+ description: 'The "Photo" mode tab on the camera screen.'
131
+ },
132
+ videoMode: {
133
+ surface: 'both',
134
+ appKey: 'video_mode',
135
+ nativeName: 'video_mode',
136
+ description: 'The "Video" mode tab on the camera screen.'
137
+ },
138
+ flipCamera: {
139
+ surface: 'both',
140
+ appKey: 'flip',
141
+ nativeName: 'flip',
142
+ description: 'Switch between the front and back camera.'
143
+ },
144
+ flashOn: {
145
+ surface: 'both',
146
+ appKey: 'flash_on',
147
+ nativeName: 'flash_on',
148
+ description: 'Flash forced on.'
149
+ },
150
+ flashOff: {
151
+ surface: 'both',
152
+ appKey: 'flash_off',
153
+ nativeName: 'flash_off',
154
+ description: 'Flash off.'
155
+ },
156
+ flashAuto: {
157
+ surface: 'both',
158
+ appKey: 'flash_auto',
159
+ nativeName: 'flash_auto',
160
+ description: 'Flash in automatic mode.'
161
+ },
162
+ gallery: {
163
+ surface: 'both',
164
+ appKey: 'gallery',
165
+ nativeName: 'gallery',
166
+ description: 'Gallery / recent media — the bottom-left thumbnail placeholder.'
167
+ },
168
+ record: {
169
+ surface: 'app',
170
+ appKey: 'record',
171
+ description: 'Start recording (record dot).'
172
+ },
173
+ mic: {
174
+ surface: 'app',
175
+ appKey: 'mic',
176
+ description: 'Microphone — audio recording entry points.'
177
+ },
178
+ lock: {
179
+ surface: 'both',
180
+ appKey: 'lock',
181
+ nativeName: 'lock',
182
+ description: 'Locked state — hands-free recording is engaged.'
183
+ },
184
+ lockOpen: {
185
+ surface: 'both',
186
+ appKey: 'lock_open',
187
+ nativeName: 'lock_open',
188
+ description: 'The slide-to-lock rail shown while holding to record.'
189
+ },
190
+ // ── Editor tools ───────────────────────────────────────────────────────
191
+ crop: {
192
+ surface: 'both',
193
+ appKey: 'crop',
194
+ nativeName: 'crop',
195
+ description: 'Crop tool in the editor.'
196
+ },
197
+ rotate: {
198
+ surface: 'both',
199
+ appKey: 'rotate',
200
+ nativeName: 'rotate',
201
+ description: 'Rotate the image 90°.'
202
+ },
203
+ aspectRatio: {
204
+ surface: 'camera',
205
+ nativeName: 'aspect_ratio',
206
+ description: 'Aspect-ratio picker inside the crop tool.'
207
+ },
208
+ filter: {
209
+ surface: 'both',
210
+ appKey: 'filter',
211
+ nativeName: 'filter',
212
+ description: 'Colour filter strip.'
213
+ },
214
+ sticker: {
215
+ surface: 'both',
216
+ appKey: 'sticker',
217
+ nativeName: 'sticker',
218
+ description: 'Add-sticker tool.'
219
+ },
220
+ emoji: {
221
+ surface: 'both',
222
+ appKey: 'emoji',
223
+ nativeName: 'emoji',
224
+ description: 'Add-emoji tool.'
225
+ },
226
+ gif: {
227
+ surface: 'camera',
228
+ nativeName: 'gif',
229
+ description: 'Add-GIF tool.'
230
+ },
231
+ text: {
232
+ surface: 'both',
233
+ appKey: 'text',
234
+ nativeName: 'text',
235
+ description: 'Add-text tool.'
236
+ },
237
+ textBackground: {
238
+ surface: 'camera',
239
+ nativeName: 'text_bg',
240
+ description: 'Cycle the text background style while typing.'
241
+ },
242
+ textAlignLeft: {
243
+ surface: 'camera',
244
+ nativeName: 'text_align_left',
245
+ description: 'Text aligned left (text tool).'
246
+ },
247
+ textAlignCenter: {
248
+ surface: 'camera',
249
+ nativeName: 'text_align_center',
250
+ description: 'Text aligned centre (text tool).'
251
+ },
252
+ textAlignRight: {
253
+ surface: 'camera',
254
+ nativeName: 'text_align_right',
255
+ description: 'Text aligned right (text tool).'
256
+ },
257
+ draw: {
258
+ surface: 'app',
259
+ appKey: 'draw',
260
+ description: 'Freehand drawing tool.'
261
+ },
262
+ marker: {
263
+ surface: 'camera',
264
+ nativeName: 'marker',
265
+ description: 'Marker / pen tool in the native editor.'
266
+ },
267
+ brushThin: {
268
+ surface: 'camera',
269
+ nativeName: 'brush_thin',
270
+ description: 'Thin brush width.'
271
+ },
272
+ brushMedium: {
273
+ surface: 'camera',
274
+ nativeName: 'brush_medium',
275
+ description: 'Medium brush width.'
276
+ },
277
+ brushThick: {
278
+ surface: 'camera',
279
+ nativeName: 'brush_thick',
280
+ description: 'Thick brush width.'
281
+ },
282
+ clearDrawing: {
283
+ surface: 'camera',
284
+ nativeName: 'clear_drawing',
285
+ description: 'Erase every drawing stroke.'
286
+ },
287
+ undo: {
288
+ surface: 'both',
289
+ appKey: 'undo',
290
+ nativeName: 'undo',
291
+ description: 'Undo the last edit.'
292
+ },
293
+ redo: {
294
+ surface: 'both',
295
+ appKey: 'redo',
296
+ nativeName: 'redo',
297
+ description: 'Redo the last undone edit.'
298
+ },
299
+ overlayClose: {
300
+ surface: 'camera',
301
+ nativeName: 'overlay_close',
302
+ description: 'The X on a selected sticker / emoji / GIF / text overlay that deletes it.'
303
+ },
304
+ overlayResize: {
305
+ surface: 'camera',
306
+ nativeName: 'overlay_resize',
307
+ description: 'The corner handle that resizes a selected overlay.'
308
+ },
309
+ // ── Media actions & playback ───────────────────────────────────────────
310
+ play: {
311
+ surface: 'both',
312
+ appKey: 'play',
313
+ nativeName: 'play',
314
+ description: 'Play video or audio.'
315
+ },
316
+ pause: {
317
+ surface: 'both',
318
+ appKey: 'pause',
319
+ nativeName: 'pause',
320
+ description: 'Pause playback or recording.'
321
+ },
322
+ stop: {
323
+ surface: 'app',
324
+ appKey: 'stop',
325
+ description: 'Stop playback or recording.'
326
+ },
327
+ volumeOn: {
328
+ surface: 'both',
329
+ appKey: 'volume_on',
330
+ nativeName: 'volume_on',
331
+ description: 'Sound on — video audio is kept.'
332
+ },
333
+ volumeOff: {
334
+ surface: 'both',
335
+ appKey: 'volume_off',
336
+ nativeName: 'volume_off',
337
+ description: 'Sound off — video is muted.'
338
+ },
339
+ mute: {
340
+ surface: 'app',
341
+ appKey: 'mute',
342
+ description: 'Muted indicator on a media tile.'
343
+ },
344
+ trim: {
345
+ surface: 'both',
346
+ appKey: 'trim',
347
+ nativeName: 'trim',
348
+ description: 'Trim a video clip.'
349
+ },
350
+ cover: {
351
+ surface: 'both',
352
+ appKey: 'cover',
353
+ nativeName: 'cover',
354
+ description: "Pick a video's cover frame."
355
+ },
356
+ compress: {
357
+ surface: 'app',
358
+ appKey: 'compress',
359
+ description: 'Compress an image or video.'
360
+ },
361
+ export: {
362
+ surface: 'app',
363
+ appKey: 'export',
364
+ description: 'Export in another file format.'
365
+ },
366
+ send: {
367
+ surface: 'both',
368
+ appKey: 'send',
369
+ nativeName: 'send',
370
+ description: 'Send / confirm the selected media.'
371
+ },
372
+ download: {
373
+ surface: 'both',
374
+ appKey: 'download',
375
+ nativeName: 'download',
376
+ description: 'Save media to the device.'
377
+ },
378
+ share: {
379
+ surface: 'both',
380
+ appKey: 'share',
381
+ nativeName: 'share',
382
+ description: 'Share media with another app.'
383
+ },
384
+ delete: {
385
+ surface: 'both',
386
+ appKey: 'delete',
387
+ nativeName: 'delete',
388
+ description: 'Delete / remove media.'
389
+ },
390
+ trash: {
391
+ surface: 'app',
392
+ appKey: 'trash',
393
+ description: 'Dustbin shown when dragging an overlay away, and in bulk-delete bars.'
394
+ },
395
+ more: {
396
+ surface: 'app',
397
+ appKey: 'more',
398
+ description: 'Generic overflow / "more" affordance in the app UI.'
399
+ },
400
+ moreOptions: {
401
+ surface: 'camera',
402
+ nativeName: 'more_vert',
403
+ description: 'The ⋮ overflow button in the native preview header (Compress / Export By).'
404
+ },
405
+ upload: {
406
+ surface: 'app',
407
+ appKey: 'upload',
408
+ description: 'Upload media to a server.'
409
+ },
410
+ uploadStatus: {
411
+ surface: 'camera',
412
+ nativeName: 'stat_upload',
413
+ description: 'Small status-bar icon of the upload notification. Must be a plain monochrome vector.'
414
+ },
415
+ // ── Documents & audio ──────────────────────────────────────────────────
416
+ document: {
417
+ surface: 'both',
418
+ appKey: 'document',
419
+ nativeName: 'document',
420
+ description: 'Document file (PDF, DOCX, …).'
421
+ },
422
+ audio: {
423
+ surface: 'both',
424
+ appKey: 'audio',
425
+ nativeName: 'audio',
426
+ description: 'Audio file.'
427
+ },
428
+ browseAudio: {
429
+ surface: 'app',
430
+ appKey: 'browse_audio',
431
+ description: 'Browse the device for an audio file.'
432
+ },
433
+ imageVideo: {
434
+ surface: 'app',
435
+ appKey: 'image_video',
436
+ description: 'Combined image-or-video picker entry point.'
437
+ },
438
+ // ── Indicators ─────────────────────────────────────────────────────────
439
+ chevronUp: {
440
+ surface: 'both',
441
+ appKey: 'chevron_up',
442
+ nativeName: 'chevron_up',
443
+ description: 'Upward chevron — swipe-up hints and expanding panels.'
444
+ },
445
+ chevronDown: {
446
+ surface: 'camera',
447
+ nativeName: 'chevron_down',
448
+ description: 'Downward chevron — collapsing the editor colour palette.'
449
+ },
450
+ chevronRight: {
451
+ surface: 'app',
452
+ appKey: 'chevron_right',
453
+ description: 'Forward chevron on navigable rows.'
454
+ },
455
+ warning: {
456
+ surface: 'app',
457
+ appKey: 'warning',
458
+ description: 'Warning / error state.'
459
+ },
460
+ plus: {
461
+ surface: 'app',
462
+ appKey: 'plus',
463
+ description: 'Add / expand (the floating action button).'
464
+ },
465
+ minus: {
466
+ surface: 'app',
467
+ appKey: 'minus',
468
+ description: 'Remove / collapse.'
469
+ },
470
+ plusClose: {
471
+ surface: 'app',
472
+ appKey: 'plus_close',
473
+ description: 'The FAB animated plus-to-close (+ ↔ ×) morphing icon.'
474
+ },
475
+ circularSeek: {
476
+ surface: 'app',
477
+ appKey: 'circular_seek',
478
+ description: 'The video player ±10s circular seek skip rings.'
479
+ },
480
+ viewDetails: {
481
+ surface: 'app',
482
+ appKey: 'view_details',
483
+ description: 'The View Details / metadata info (i) icon on the media viewer.'
484
+ },
485
+ info: {
486
+ surface: 'app',
487
+ appKey: 'view_details',
488
+ description: 'Information icon (alias for viewDetails).'
489
+ }
490
+ };
491
+
492
+ /** Every icon id, in catalog order. Handy for docs and tests. */
493
+ export const CAMERA_ICON_IDS = Object.keys(CAMERA_ICON_CATALOG);
494
+
495
+ /** Narrowing guard for an unknown string. */
496
+ export function isCameraIconId(value) {
497
+ return Object.prototype.hasOwnProperty.call(CAMERA_ICON_CATALOG, value);
498
+ }
499
+
500
+ // ============================================================================
501
+ // Customization shapes
502
+ // ============================================================================
503
+
504
+ /**
505
+ * How one icon should be customized.
506
+ *
507
+ * Which fields take effect depends on the icon's `surface`
508
+ * ({@link CAMERA_ICON_CATALOG}):
509
+ *
510
+ * | Field | `app` surface | `camera` surface |
511
+ * | -------------- | ------------- | ---------------- |
512
+ * | `component` | ✅ | — |
513
+ * | `source` | ✅ | — |
514
+ * | `svg` | ✅ | ✅ |
515
+ * | `resourceName` | — | ✅ |
516
+ * | `tintColor` | ✅ | ✅ |
517
+ * | `size` | ✅ | — |
518
+ *
519
+ * A `both`-surface icon accepts all of them and applies each where it works,
520
+ * so `{ component: MyClose, resourceName: 'my_close' }` replaces the artwork on
521
+ * every surface at once. Anything left unset keeps the icon's shipped default.
522
+ */
523
+
524
+ /**
525
+ * A customization, or one of two shorthands: a bare React component, or a bare
526
+ * image source. `close: MyIcon` is exactly `close: { component: MyIcon }`.
527
+ */
528
+
529
+ /**
530
+ * The centralized icon configuration: a flat map of icon id → replacement.
531
+ * Every key is optional; an absent key keeps the plugin's default icon.
532
+ */
533
+
534
+ // ============================================================================
535
+ // Normalization
536
+ // ============================================================================
537
+
538
+ const CUSTOMIZATION_FIELDS = ['component', 'source', 'svg', 'resourceName', 'tintColor', 'size'];
539
+
540
+ /**
541
+ * Collapse any of the accepted shorthands into a full
542
+ * {@link CameraIconCustomization}.
543
+ *
544
+ * The three input shapes are distinguished structurally, because an image
545
+ * source is `number | object | array` and a React component is
546
+ * `function | object`:
547
+ *
548
+ * - a function, or an object carrying React's `$$typeof` brand
549
+ * (`memo`/`forwardRef` results) → a component;
550
+ * - a number (what `require('./x.png')` compiles to) or an array of sources,
551
+ * or an object with a `uri` → an image source;
552
+ * - an object mentioning any customization field → already a customization;
553
+ * - anything else → treated as an image source, which is what the remaining
554
+ * `ImageSourcePropType` variants are.
555
+ */
556
+ export function normalizeCameraIconValue(value) {
557
+ if (typeof value === 'function') {
558
+ return {
559
+ component: value
560
+ };
561
+ }
562
+ if (typeof value === 'number' || Array.isArray(value)) {
563
+ return {
564
+ source: value
565
+ };
566
+ }
567
+ if (value && typeof value === 'object') {
568
+ const record = value;
569
+ if ('$$typeof' in record) {
570
+ return {
571
+ component: value
572
+ };
573
+ }
574
+ if ('uri' in record) {
575
+ return {
576
+ source: value
577
+ };
578
+ }
579
+ if (CUSTOMIZATION_FIELDS.some(field => field in record)) {
580
+ return value;
581
+ }
582
+ }
583
+ return {
584
+ source: value
585
+ };
586
+ }
587
+
588
+ /**
589
+ * Wrap an image source in an {@link IconComponent}.
590
+ *
591
+ * The incoming `color` prop is deliberately ignored: a host-supplied PNG is
592
+ * usually already coloured, and blanket-tinting it with the current theme
593
+ * colour would flatten it. Pass `tintColor` explicitly to opt into recolouring.
594
+ */
595
+ export function createImageIconComponent(source, tintColor) {
596
+ const ImageIcon = ({
597
+ size,
598
+ style
599
+ }) => {
600
+ const edge = size ?? DEFAULT_ICON_SIZE;
601
+ return /*#__PURE__*/_jsx(Image, {
602
+ source: source,
603
+ resizeMode: "contain",
604
+ style: [{
605
+ width: edge,
606
+ height: edge
607
+ }, tintColor ? {
608
+ tintColor
609
+ } : null, style]
610
+ });
611
+ };
612
+ ImageIcon.displayName = 'CameraImageIcon';
613
+ return ImageIcon;
614
+ }
615
+
616
+ /**
617
+ * Basic structural validity check for inline SVG markup: a non-empty string
618
+ * within the native parser's size cap, with an `<svg>` root and at least one
619
+ * drawable element the parser understands (`path` / `rect` / `circle` /
620
+ * `ellipse` / `line` / `polyline` / `polygon`). Markup that fails this is
621
+ * treated as "no SVG" so the icon keeps its built-in default — the same safe
622
+ * fallback the renderers apply when parsing fails at draw time.
623
+ */
624
+ export function isRenderableSvg(svg) {
625
+ if (typeof svg !== 'string') return false;
626
+ const markup = svg.trim();
627
+ if (markup.length === 0 || markup.length > 256 * 1024) return false;
628
+ if (!/<svg[\s>]/i.test(markup)) return false;
629
+ return /<(path|rect|circle|ellipse|line|polyline|polygon)[\s/>]/i.test(markup);
630
+ }
631
+
632
+ /**
633
+ * Wrap inline SVG markup in an {@link IconComponent} for the React Native
634
+ * component surface. The markup is drawn by the library's OWN bundled native
635
+ * renderer (`CameraSvgIcon`, backed by `SvgDrawable`) — no `react-native-svg`
636
+ * and no third-party SVG library.
637
+ *
638
+ * Anything that cannot be drawn falls back to [fallback] (the icon's built-in
639
+ * default component): invalid/empty markup, a platform with no native half
640
+ * (iOS / web), or an older linked binary without the renderer. So a
641
+ * customization never leaves an empty box.
642
+ *
643
+ * `currentColor` in the markup follows the icon's tint — an explicit
644
+ * [tintColor] wins, otherwise the render-time `color` is used — while explicit
645
+ * colours inside the SVG are always preserved.
646
+ */
647
+ export function createSvgIconComponent(svg, tintColor, fallback) {
648
+ const Fallback = fallback ?? DefaultFallbackIcon;
649
+ if (!isRenderableSvg(svg)) {
650
+ return Fallback;
651
+ }
652
+ const SvgIcon = props => {
653
+ const edge = props.size ?? DEFAULT_ICON_SIZE;
654
+ const tint = tintColor ?? props.color;
655
+ return /*#__PURE__*/_jsx(NativeSvgIcon, {
656
+ svg: svg,
657
+ tintColor: tint,
658
+ style: [{
659
+ width: edge,
660
+ height: edge
661
+ }, props.style],
662
+ fallback: /*#__PURE__*/_jsx(Fallback, {
663
+ ...props
664
+ })
665
+ });
666
+ };
667
+ SvgIcon.displayName = 'CameraSvgIcon';
668
+ return SvgIcon;
669
+ }
670
+
671
+ // ============================================================================
672
+ // Projection onto the two internal layers
673
+ // ============================================================================
674
+
675
+ /**
676
+ * Project the centralized config onto the RN component registry
677
+ * (`src/icons.tsx`).
678
+ *
679
+ * Only ids with an `appKey` contribute. Artwork replacements become registry
680
+ * `overrides` — which take precedence over any registry a host also passes to
681
+ * `CameraIconProvider` — while bare `tintColor` / `size` become per-icon
682
+ * overrides that recolour or resize the *built-in* component. Ids the caller
683
+ * left out never appear, so their defaults resolve untouched.
684
+ */
685
+ export function resolveCameraIconRegistryConfig(config) {
686
+ const overrides = {};
687
+ // One shared default registry: both the returned base registry and each SVG
688
+ // icon's fallback are drawn from it, so an invalid SVG resolves to the exact
689
+ // built-in component that key ships with.
690
+ const defaultRegistry = createDefaultIconRegistry();
691
+ Object.keys(config).forEach(id => {
692
+ const entry = CAMERA_ICON_CATALOG[id];
693
+ const raw = config[id];
694
+ if (!entry?.appKey || raw === undefined || raw === null) {
695
+ return;
696
+ }
697
+ const custom = normalizeCameraIconValue(raw);
698
+ const override = {};
699
+ if (custom.component) {
700
+ override.component = custom.component;
701
+ } else if (custom.svg !== undefined && isRenderableSvg(custom.svg)) {
702
+ // Invalid/empty SVG is intentionally skipped here so the built-in default
703
+ // (still in the registry) resolves untouched — the "fall back to the
704
+ // default icon" guarantee.
705
+ override.component = createSvgIconComponent(custom.svg, custom.tintColor, defaultRegistry.get(entry.appKey));
706
+ } else if (custom.source !== undefined) {
707
+ override.component = createImageIconComponent(custom.source, custom.tintColor);
708
+ }
709
+ if (custom.tintColor !== undefined) {
710
+ override.tintColor = custom.tintColor;
711
+ }
712
+ if (custom.size !== undefined) {
713
+ override.size = custom.size;
714
+ }
715
+ if (Object.keys(override).length > 0) {
716
+ overrides[entry.appKey] = override;
717
+ }
718
+ });
719
+ return {
720
+ registry: defaultRegistry,
721
+ overrides
722
+ };
723
+ }
724
+
725
+ /**
726
+ * Project the centralized config onto the native drawable layer
727
+ * (`CameraIconConfig` in `src/types.ts`), which is serialized to the Android
728
+ * Activity by `setCameraConfig`.
729
+ *
730
+ * Only ids with a `nativeName` contribute, and only the fields the native side
731
+ * understands (`resourceName`, `tintColor`, `size`) are carried across — a
732
+ * React component cannot cross into Kotlin UI. The wire format is unchanged, so
733
+ * no native code has to know this module exists.
734
+ */
735
+ export function resolveNativeIconConfig(config) {
736
+ const overrides = {};
737
+ Object.keys(config).forEach(id => {
738
+ const entry = CAMERA_ICON_CATALOG[id];
739
+ const raw = config[id];
740
+ if (!entry?.nativeName || raw === undefined || raw === null) {
741
+ return;
742
+ }
743
+ const custom = normalizeCameraIconValue(raw);
744
+ const style = {};
745
+ if (custom.svg !== undefined) {
746
+ style.svg = custom.svg;
747
+ }
748
+ if (custom.resourceName !== undefined) {
749
+ style.resourceName = custom.resourceName;
750
+ }
751
+ if (custom.tintColor !== undefined) {
752
+ style.tintColor = custom.tintColor;
753
+ }
754
+ if (custom.size !== undefined) {
755
+ style.size = custom.size;
756
+ }
757
+ if (Object.keys(style).length > 0) {
758
+ overrides[entry.nativeName] = style;
759
+ }
760
+ });
761
+ return {
762
+ overrides
763
+ };
764
+ }
765
+
766
+ /** Merge two centralized icon configs; `override` wins per icon id. */
767
+ export function mergeCameraIconsConfig(base, override) {
768
+ if (!override) {
769
+ return base;
770
+ }
771
+ const merged = {
772
+ ...base
773
+ };
774
+ Object.keys(override).forEach(id => {
775
+ const next = override[id];
776
+ if (next === undefined) {
777
+ return;
778
+ }
779
+ const previous = merged[id];
780
+ // Two plain customization objects compose field-by-field, so
781
+ // `{ tintColor }` set now does not erase a `{ component }` set earlier.
782
+ // Any other shape (component / image source) replaces outright.
783
+ if (previous !== undefined) {
784
+ const a = normalizeCameraIconValue(previous);
785
+ const b = normalizeCameraIconValue(next);
786
+ merged[id] = {
787
+ ...a,
788
+ ...b
789
+ };
790
+ return;
791
+ }
792
+ merged[id] = next;
793
+ });
794
+ return merged;
795
+ }
796
+ //# sourceMappingURL=iconConfig.js.map