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,33 @@
1
+ /**
2
+ * Utility to refresh asset metadata from the actual file on disk.
3
+ * After compression/export, the file's actual size may differ from the original;
4
+ * this ensures the asset object reflects the real file being previewed.
5
+ */
6
+ import type { CameraAsset } from '../types';
7
+ /**
8
+ * Read the actual size of a file from disk using the Fetch API.
9
+ * Returns size in bytes, or undefined if it cannot be determined.
10
+ */
11
+ export declare function getFileSize(fileUri: string): Promise<number | undefined>;
12
+ /**
13
+ * Refresh an asset's metadata from the actual file on disk.
14
+ * After compression/export, this ensures size matches the real file.
15
+ *
16
+ * For images: updates size only (dimensions are already correct from capture)
17
+ * For videos: a clip flagged `sizeIsDisplayEstimate` (a compressed video) keeps its quoted
18
+ * proportional `size` untouched; otherwise prefers the recorded finalized size the native layer
19
+ * remembers for a just-recorded clip (so it matches the recording counter and the editor's
20
+ * "Original" row instead of the smaller background-cropped file), else updates size from disk.
21
+ * For audio: updates size
22
+ * For documents: updates size
23
+ *
24
+ * Note: Image dimensions from Image.getSize() can be unreliable for file:// URIs,
25
+ * so we skip dimension refresh and trust the dimensions set during capture.
26
+ */
27
+ export declare function refreshAssetMetadata(asset: CameraAsset): Promise<CameraAsset>;
28
+ /**
29
+ * Refresh metadata for multiple assets.
30
+ * Updates file sizes from the actual files on disk.
31
+ */
32
+ export declare function refreshAssetMetadataBatch(assets: CameraAsset[]): Promise<CameraAsset[]>;
33
+ //# sourceMappingURL=fileMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileMetadata.d.ts","sourceRoot":"","sources":["../../../../src/library/fileMetadata.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiB9E;AA4BD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,WAAW,CAAC,CA2HtB;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,WAAW,EAAE,GACpB,OAAO,CAAC,WAAW,EAAE,CAAC,CAKxB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * src/library — the React Native media library shell that sits on top of the
3
+ * native camera.
4
+ *
5
+ * The native side (the AAR) owns capture, the editor, previews and uploads. This
6
+ * folder is the JS app surface around it: the library grid, the category pager,
7
+ * the FAB, the full-screen viewer, the document/audio cards and the record-audio
8
+ * screen. `<CameraMediaLibrary />` is the one-element drop-in; everything else is
9
+ * exported so a host can assemble its own screen from the same pieces.
10
+ *
11
+ * Nothing here may import `../index` — that is the package barrel, and a
12
+ * barrel → screen → barrel cycle resolves to a half-initialised module at
13
+ * runtime. Import the DEFINING module instead (`../types`, `../db`, `../icons`,
14
+ * `../localization`, `../nativeActions`, …).
15
+ */
16
+ export { CameraMediaLibrary } from './MediaLibrary';
17
+ export type { CameraMediaLibraryProps } from './MediaLibrary';
18
+ export { MediaLibraryScreen } from './MediaLibraryScreen';
19
+ export type { MediaLibraryScreenProps, FilterKey as MediaLibraryFilterKey, } from './MediaLibraryScreen';
20
+ export { RecordAudioScreen } from './components/RecordAudioScreen';
21
+ export type { RecordAudioScreenProps } from './components/RecordAudioScreen';
22
+ export { ImagePreview } from './components/ImagePreview';
23
+ export { VideoPreview } from './components/VideoPreview';
24
+ export type { VideoPreviewProps } from './components/VideoPreview';
25
+ export { DocumentPreview } from './components/DocumentPreview';
26
+ export { AudioPreview } from './components/AudioPreview';
27
+ export { MediaMetadataHeader } from './components/MediaMetadataHeader';
28
+ export type { MediaMetadataHeaderProps } from './components/MediaMetadataHeader';
29
+ export { ExpandableFab } from './components/ExpandableFab';
30
+ export type { ExpandableFabProps } from './components/ExpandableFab';
31
+ export { ViewerCounter } from './components/ViewerCounter';
32
+ export type { ViewerCounterProps, ViewerCounterHandle, } from './components/ViewerCounter';
33
+ export { DocumentTile, AudioTile } from './components/FileTiles';
34
+ export { createLibraryIconRegistry, libraryIconRegistry, } from './libraryIconRegistry';
35
+ export { PlusCloseIcon, CircularSeekIcon, ViewDetailsIcon, } from './libraryIcons';
36
+ export { libraryPalette, useLibraryPalette, createPalette } from './palette';
37
+ export type { LibraryPalette } from './palette';
38
+ export { wp, hp, ms, fs, SCREEN_W, SCREEN_H, BASE_W, BASE_H } from './responsive';
39
+ export { getFileSize, refreshAssetMetadata, refreshAssetMetadataBatch, } from './fileMetadata';
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/library/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,SAAS,IAAI,qBAAqB,GACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EACV,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,EACL,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGlF,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * libraryIconRegistry — the media library shell's DEFAULT icon set.
3
+ *
4
+ * The plugin ships a complete, dependency-free default icon registry drawn from
5
+ * RN View/Text primitives (`createDefaultIconRegistry()` in ../icons). The shell
6
+ * starts from that registry — so every key still resolves to a real component —
7
+ * then replaces a handful of chrome keys with the hand-authored outline icons in
8
+ * ./libraryIcons, which is what `<CameraMediaLibrary />` renders out of the box.
9
+ *
10
+ * A host app overrides any icon by key with its own React component:
11
+ *
12
+ * ```tsx
13
+ * const icons = createLibraryIconRegistry();
14
+ * icons.set('camera', MyCameraIcon);
15
+ * <CameraIconProvider icons={icons}>…</CameraIconProvider>
16
+ * ```
17
+ *
18
+ * After that, every `<RenderIcon name="…" />` in the shell — and inside the
19
+ * plugin's own RN surface — renders those components. Adding a custom icon is a
20
+ * one-liner; no screen or component needs to change.
21
+ */
22
+ import { type IconRegistry } from '../icons';
23
+ /**
24
+ * Build a fresh registry: plugin defaults + the shell's own chrome icons.
25
+ *
26
+ * Returns a NEW Map every call, so a host can `.set()` its own overrides on the
27
+ * result without mutating anyone else's registry.
28
+ */
29
+ export declare function createLibraryIconRegistry(): IconRegistry;
30
+ /**
31
+ * Shared snapshot used by `<CameraMediaLibrary />` when the host passes no
32
+ * `icons` prop. Built once at module load and reused for the app's lifetime.
33
+ */
34
+ export declare const libraryIconRegistry: IconRegistry;
35
+ //# sourceMappingURL=libraryIconRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libraryIconRegistry.d.ts","sourceRoot":"","sources":["../../../../src/library/libraryIconRegistry.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAkBlB;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,YAAY,CA8BxD;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAA0C,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Hand-authored vector icons built ONLY from React Native primitives (View + borders +
3
+ * transforms). No third-party icon library, no react-native-svg, and no external SVG/PNG
4
+ * assets — every shape is composed from scratch so the set stays dependency-free and matches
5
+ * the app's clean, modern outline style.
6
+ *
7
+ * Every icon shares one contract — { size, color, strokeWidth } — so stroke width, sizing,
8
+ * padding and alignment stay identical across the whole set. Sizes are unitless (dp), so the
9
+ * caller scales them for different screen densities.
10
+ */
11
+ import type { FC } from 'react';
12
+ import { type ColorValue } from 'react-native';
13
+ export interface IconProps {
14
+ /** Overall square canvas size in dp. */
15
+ size?: number;
16
+ /** Stroke / fill color. */
17
+ color?: ColorValue;
18
+ /** Stroke thickness in dp — kept consistent across every icon. */
19
+ strokeWidth?: number;
20
+ style?: any;
21
+ progress?: any;
22
+ direction?: 'back' | 'forward';
23
+ label?: string;
24
+ [key: string]: any;
25
+ }
26
+ /**
27
+ * A single Plus icon that morphs into a Cross (✕) as [progress] animates 0 → 1.
28
+ * When progress is omitted or 0, renders a clean Plus (+).
29
+ *
30
+ * The glyph is two crossed strokes — a "+" — that keep their full length the whole time. As
31
+ * progress runs, the whole glyph spins 225° (a half-turn flourish, preserving the original
32
+ * animated feel) so both strokes settle at 45°, forming a crisp, perfectly symmetric "✕" at
33
+ * progress 1 and a clean "+" at progress 0. The cross is drawn entirely from RN primitives
34
+ * (two rounded bars) — no icon library, no react-native-svg, no external SVG asset. Driven
35
+ * solely by the parent's Animated.Value, so there is exactly one source of truth for the
36
+ * transition in BOTH directions (open ⇄ close) with no internal state to desync.
37
+ */
38
+ export declare const PlusCloseIcon: FC<IconProps>;
39
+ /** Outline camera: rounded body + viewfinder bump + centered lens ring. */
40
+ export declare const CameraIcon: FC<IconProps>;
41
+ /** Outline document: rounded page, folded top-right corner, two text lines. */
42
+ export declare const DocumentIcon: FC<IconProps>;
43
+ /** Browse Audio icon — a folder outline with a music note inside, representing browsing/selecting
44
+ * audio files. Minimal outline style with rounded edges, matching the Android material design
45
+ * aesthetic used throughout this icon set. */
46
+ export declare const BrowseAudioIcon: FC<IconProps>;
47
+ /** Outline microphone: capsule head, U-shaped cradle, stem + base. */
48
+ export declare const AudioIcon: FC<IconProps>;
49
+ /** Outline photo: rounded frame, sun dot top-right, mountain range from two angled strokes. */
50
+ export declare const PhotoIcon: FC<IconProps>;
51
+ /** Outline video camera: rounded body + right-pointing lens wedge (camcorder silhouette). */
52
+ export declare const VideoIcon: FC<IconProps>;
53
+ /** Outline gallery/image-video icon: photo frame with small play triangle overlay. */
54
+ export declare const ImageVideoIcon: FC<IconProps>;
55
+ /** Outline trash/delete can: rounded lid + handle, open-top body, two ribs. */
56
+ export declare const TrashIcon: FC<IconProps>;
57
+ /** Android-style share: three filled nodes joined by two arms (left → each right). */
58
+ export declare const ShareIcon: FC<IconProps>;
59
+ /**
60
+ * Circular seek skip ring icon (◀ -10s / ▶ +10s).
61
+ * Renders an open-topped circular arrow ring with directional arrowhead
62
+ * and a centered seconds label.
63
+ */
64
+ export declare const CircularSeekIcon: FC<IconProps>;
65
+ /**
66
+ * View Details / Info (ⓘ) icon.
67
+ * Renders an outlined circular badge with a centered 'i' glyph (dot + stem).
68
+ */
69
+ export declare const ViewDetailsIcon: FC<IconProps>;
70
+ /** Alias for ViewDetailsIcon */
71
+ export declare const InfoIcon: FC<IconProps>;
72
+ /**
73
+ * Compress icon — two arrows squeezing toward a centre line.
74
+ *
75
+ * The outline-set counterpart of the plugin's default `compress` glyph, drawn in the same
76
+ * "clean stroke" language as the rest of this file: one horizontal bar across the middle with a
77
+ * down-pointing arrow above it and an up-pointing arrow below, each a stem plus a two-armed
78
+ * chevron. It reads as "make this smaller" at 24 dp without any diagonal-resize ambiguity.
79
+ *
80
+ * Every stroke is a bar laid between two points, centred on their midpoint and rotated about its
81
+ * own centre, so the arms land exactly on the stems at any [size] / [strokeWidth] pair — the same
82
+ * construction {@link ShareIcon} uses for its arms.
83
+ */
84
+ export declare const CompressIcon: FC<IconProps>;
85
+ //# sourceMappingURL=libraryIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libraryIcons.d.ts","sourceRoot":"","sources":["../../../../src/library/libraryIcons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAGjF,MAAM,WAAW,SAAS;IACxB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAMD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,SAAS,CAgDvC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,SAAS,CAqDpC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,SAAS,CA2EtC,CAAC;AAEF;;+CAE+C;AAC/C,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,SAAS,CAoGzC,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,SAAS,CAwDnC,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,SAAS,CAiEnC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,SAAS,CAwCnC,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,SAAS,CAkExC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,SAAS,CA8EnC,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,SAAS,CAsDnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,SAAS,CAiE1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,SAAS,CA4DzC,CAAC;AAEF,gCAAgC;AAChC,eAAO,MAAM,QAAQ,eAAkB,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,SAAS,CAyDtC,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Locale-aware formatting for the media-library shell.
3
+ *
4
+ * Every date, time, size, duration and dimension the shell renders flows through here so the
5
+ * output follows the host's active language instead of a hardcoded `en-GB`/`en-US`. Numbers use
6
+ * the locale's own numbering system (so Arabic/Persian get their digits), size units come from the
7
+ * host-overridable `fileSizeBytes/Kb/Mb/Gb` keys, and dates/times use the locale's month names and
8
+ * 12/24-hour convention.
9
+ *
10
+ * All calls are defensive: a malformed host locale that makes `Intl` throw falls back to the
11
+ * runtime default rather than crashing a preview.
12
+ */
13
+ import type { CameraTranslationKey } from '../localization';
14
+ /** The shape of the `t` returned by `useCameraLocalization()`. */
15
+ type Translate = (key: CameraTranslationKey, ...args: Array<string | number | boolean | null | undefined>) => string;
16
+ /** Rewrite the ASCII digits in `text` into the locale's numbering system (no-op for Latin locales). */
17
+ export declare function localizeDigits(text: string, locale?: string): string;
18
+ /** Format a plain number in the locale's numbering system, without grouping separators. */
19
+ export declare function localizeNumber(value: number, locale?: string): string;
20
+ /** `1.5 MB` style, with the unit drawn from the host-overridable size keys. Null when unknown. */
21
+ export declare function formatFileSize(bytes: number | undefined | null, locale: string | undefined, t: Translate): string | null;
22
+ /**
23
+ * A low–high size span as ONE string (`5.8 – 7.1 MB`), for a figure that is honestly a band rather
24
+ * than a single number — a video re-encoded at a TARGET bit rate, which the encoder spends around
25
+ * instead of hitting exactly.
26
+ *
27
+ * The low end drops its unit whenever both ends land on the same rung, which is what the
28
+ * `compressSizeRange` key documents and what its translations are written against; that decision is
29
+ * made HERE, from the rung itself, rather than by trying to strip a unit back out of an already
30
+ * translated string. Ends on different rungs are both formatted in full (`900 KB – 1.1 MB`).
31
+ *
32
+ * Collapses to the single high figure when the band has no width left to show — the low end is
33
+ * missing, at or above the high end, or rounds to the very same number on the very same rung — so a
34
+ * row never reads `7.1 – 7.1 MB`. Null when nothing is known.
35
+ */
36
+ export declare function formatFileSizeRange(low: number | undefined | null, high: number | undefined | null, locale: string | undefined, t: Translate): string | null;
37
+ /** Localized calendar date. `month` picks the short ("Aug") or long ("August") form. Null when unknown. */
38
+ export declare function formatMediaDate(timestamp: number | undefined | null, locale: string | undefined, month?: 'short' | 'long'): string | null;
39
+ /** Localized wall-clock time; the locale decides 12- vs 24-hour. Null when unknown. */
40
+ export declare function formatMediaTime(timestamp: number | undefined | null, locale: string | undefined): string | null;
41
+ /**
42
+ * `m:ss` / `h:mm:ss` clip length with locale digits. `value` may be seconds or milliseconds
43
+ * (MediaStore's DURATION column) — the same >1000 normalization the rest of the shell uses.
44
+ */
45
+ export declare function formatMediaDuration(value: number | undefined | null, locale: string | undefined): string | null;
46
+ /** `1920 × 1080` with locale digits. Null when either side is unknown. */
47
+ export declare function formatDimensions(width: number | undefined | null, height: number | undefined | null, locale: string | undefined): string | null;
48
+ export {};
49
+ //# sourceMappingURL=localizedFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localizedFormat.d.ts","sourceRoot":"","sources":["../../../../src/library/localizedFormat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,kEAAkE;AAClE,KAAK,SAAS,GAAG,CACf,GAAG,EAAE,oBAAoB,EACzB,GAAG,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,KACzD,MAAM,CAAC;AAUZ,uGAAuG;AACvG,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBpE;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrE;AA2BD,kGAAkG;AAClG,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAChC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,CAAC,EAAE,SAAS,GACX,MAAM,GAAG,IAAI,CAIf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,CAAC,EAAE,SAAS,GACX,MAAM,GAAG,IAAI,CAiBf;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACpC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,GAAE,OAAO,GAAG,MAAgB,GAChC,MAAM,GAAG,IAAI,CAcf;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACpC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,IAAI,CAUf;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAChC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,IAAI,CAYf;AAED,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAChC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACjC,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,GAAG,IAAI,CAKf"}
@@ -0,0 +1,104 @@
1
+ import type { CameraThemeConfig } from '../types';
2
+ type ThemeColors = CameraThemeConfig['colors'];
3
+ /** Whether the active theme reads as dark (drives which shell token set is used). */
4
+ export declare const isDarkTheme: (colors?: ThemeColors) => boolean;
5
+ /** Build the shell palette from a plugin theme; the dark set = today's exact UI. */
6
+ export declare const createPalette: (colors?: ThemeColors) => {
7
+ /** True when the active theme is dark — lets a component branch layout/logic. */
8
+ isDark: boolean;
9
+ appBackground: string;
10
+ appBackgroundDeep: string;
11
+ appBackgroundDeepest: string;
12
+ surface: string;
13
+ surfaceRaised: string;
14
+ surfaceCard: string;
15
+ surfaceIndigo: string;
16
+ surfaceViolet: string;
17
+ surfacePlum: string;
18
+ surfaceNavy: string;
19
+ surfaceGreenTint: string;
20
+ surfaceAmberTint: string;
21
+ surfaceRoseTint: string;
22
+ textBright: string;
23
+ textSoft: string;
24
+ textPale: string;
25
+ textSystem: string;
26
+ textFaded: string;
27
+ textDim: string;
28
+ textSlate: string;
29
+ textSteel: string;
30
+ textGray: string;
31
+ textCharcoal: string;
32
+ navInactive: string;
33
+ hairline: string;
34
+ hairlineFaint: string;
35
+ hairlineFainter: string;
36
+ white: string;
37
+ black: string;
38
+ blackShort: string;
39
+ inkDark: string;
40
+ ink: string;
41
+ grayMid: string;
42
+ chromeDark: string;
43
+ chromeGray: string;
44
+ chromeSystem: string;
45
+ chromeSystemAlt: string;
46
+ viewerBackdrop: string;
47
+ chromeText: string;
48
+ chromeTextMuted: string;
49
+ accentGreen: string;
50
+ accentGreenDark: string;
51
+ accentMint: string;
52
+ accentTeal: string;
53
+ accentBlue: string;
54
+ accentSky: string;
55
+ accentIndigo: string;
56
+ accentIndigoDeep: string;
57
+ accentPeriwinkle: string;
58
+ accentViolet: string;
59
+ accentLavender: string;
60
+ accentPurple: string;
61
+ accentPurpleMuted: string;
62
+ accentOrange: string;
63
+ accentAmber: string;
64
+ accentRose: string;
65
+ accentSalmon: string;
66
+ whiteA12: string;
67
+ whiteA15: string;
68
+ whiteA20: string;
69
+ whiteA25: string;
70
+ whiteA30: string;
71
+ whiteA35: string;
72
+ whiteA40: string;
73
+ whiteA90: string;
74
+ rippleStrong: string;
75
+ rippleMedium: string;
76
+ scrimA22: string;
77
+ scrimA30: string;
78
+ scrimA55: string;
79
+ scrimA55Tight: string;
80
+ scrimA60: string;
81
+ scrimA70: string;
82
+ sheet85: string;
83
+ sheet95: string;
84
+ greenTintA10: string;
85
+ greenTintA18: string;
86
+ greenTintA28: string;
87
+ primary: string;
88
+ textMuted: string;
89
+ success: string;
90
+ error: string;
91
+ surfaceMuted: string;
92
+ };
93
+ export type LibraryPalette = ReturnType<typeof createPalette>;
94
+ /** Launch-time palette snapshot — used by static StyleSheet.create() styles. */
95
+ export declare const libraryPalette: LibraryPalette;
96
+ /**
97
+ * Live palette hook: re-derives the whole shell palette whenever the global
98
+ * camera theme changes. Use in components that must react to runtime
99
+ * re-theming (i.e. the persistent library shell); static one-shot styles can
100
+ * keep the launch-time `libraryPalette`.
101
+ */
102
+ export declare function useLibraryPalette(): LibraryPalette;
103
+ export {};
104
+ //# sourceMappingURL=palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../../src/library/palette.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,KAAK,WAAW,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAmB/C,qFAAqF;AACrF,eAAO,MAAM,WAAW,GAAI,SAAQ,WAAkB,KAAG,OACrB,CAAC;AAwKrC,oFAAoF;AACpF,eAAO,MAAM,aAAa,GAAI,SAAQ,WAAkB;IAiBpD,iFAAiF;;mBA7GpE,MAAM;uBACF,MAAM;0BACH,MAAM;aACnB,MAAM;mBACA,MAAM;iBACR,MAAM;mBACJ,MAAM;mBACN,MAAM;iBACR,MAAM;iBACN,MAAM;sBACD,MAAM;sBACN,MAAM;qBACP,MAAM;gBACX,MAAM;cACR,MAAM;cACN,MAAM;gBACJ,MAAM;eACP,MAAM;aACR,MAAM;eACJ,MAAM;eACN,MAAM;cACP,MAAM;kBACF,MAAM;iBACP,MAAM;cACT,MAAM;mBACD,MAAM;qBACJ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFxB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D,gFAAgF;AAChF,eAAO,MAAM,cAAc,EAAE,cAE5B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAclD"}
@@ -0,0 +1,15 @@
1
+ /** Portrait-normalized window edges (launch-time snapshot). */
2
+ export declare const SCREEN_W: number;
3
+ export declare const SCREEN_H: number;
4
+ /** Design base — standard iPhone / mid-range Android portrait canvas. */
5
+ export declare const BASE_W = 390;
6
+ export declare const BASE_H = 844;
7
+ /** Width-proportional scaling. */
8
+ export declare const wp: (size: number) => number;
9
+ /** Height-proportional scaling. */
10
+ export declare const hp: (size: number) => number;
11
+ /** Moderate scale — averages width scale with 1:1 for balanced sizing. */
12
+ export declare const ms: (size: number, factor?: number) => number;
13
+ /** Font scaling — clamped, and neutralizes the system font-size setting. */
14
+ export declare const fs: (size: number) => number;
15
+ //# sourceMappingURL=responsive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../../src/library/responsive.ts"],"names":[],"mappings":"AAoBA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,QAAyB,CAAC;AAC/C,eAAO,MAAM,QAAQ,QAAyB,CAAC;AAE/C,yEAAyE;AACzE,eAAO,MAAM,MAAM,MAAM,CAAC;AAC1B,eAAO,MAAM,MAAM,MAAM,CAAC;AAQ1B,kCAAkC;AAClC,eAAO,MAAM,EAAE,GAAI,MAAM,MAAM,WAA8B,CAAC;AAE9D,mCAAmC;AACnC,eAAO,MAAM,EAAE,GAAI,MAAM,MAAM,WAA8B,CAAC;AAE9D,0EAA0E;AAC1E,eAAO,MAAM,EAAE,GAAI,MAAM,MAAM,EAAE,eAAY,WACI,CAAC;AAElD,4EAA4E;AAC5E,eAAO,MAAM,EAAE,GAAI,MAAM,MAAM,WAG9B,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * locales.ts — the plugin's locale engine.
3
+ *
4
+ * This file is the ONLY place that knows how to interpret a language identifier.
5
+ * It is deliberately data-driven rather than language-driven: there is no list of
6
+ * "supported languages" anywhere in the plugin and no `switch (language)` branch.
7
+ * Anything that is a well-formed BCP-47 tag works, including every language the
8
+ * host app happens to support today and every one it adds later.
9
+ *
10
+ * What that means in practice:
11
+ *
12
+ * - Right-to-left is derived from the tag's *script*, either written explicitly
13
+ * (`ku-Arab`) or implied by the language subtag (`ar`, `fa`, `he`, `ur`, …).
14
+ * Adding Hebrew or Urdu to the host app needs no plugin change.
15
+ * - Region and script are peeled off one at a time to build a fallback chain,
16
+ * so `zh-Hans-CN` finds a `zh-Hans` bundle, and `pt-BR` finds a `pt` bundle.
17
+ * - Legacy and macro tags are folded onto their modern equivalents, because
18
+ * host i18n libraries disagree about them (`zh-CN` vs `zh-Hans`, `iw` vs `he`).
19
+ *
20
+ * The engine is pure and side-effect free. `localization.ts` owns the state.
21
+ */
22
+ /** Canonical shape of a parsed language identifier. */
23
+ export interface ParsedLocale {
24
+ /** Lowercase ISO-639 language subtag, e.g. `zh`. Empty for an unusable tag. */
25
+ language: string;
26
+ /** Title-case ISO-15924 script subtag, e.g. `Hans`. Empty when absent. */
27
+ script: string;
28
+ /** Uppercase ISO-3166 region subtag, e.g. `CN`. Empty when absent. */
29
+ region: string;
30
+ /** The normalized tag these three parts recombine into, e.g. `zh-Hans-CN`. */
31
+ tag: string;
32
+ }
33
+ /** The locale used whenever the host has not told us anything else. */
34
+ export declare const DEFAULT_LOCALE = "en";
35
+ /**
36
+ * ISO-15924 scripts written right-to-left.
37
+ *
38
+ * This is the primary RTL signal. A tag that names its script (`ku-Arab`,
39
+ * `pa-Arab`, `sr-Hebr`) is classified from this set alone, which is why the
40
+ * plugin needs no per-language RTL table for scripts it has never seen.
41
+ */
42
+ export declare const RTL_SCRIPTS: ReadonlySet<string>;
43
+ /**
44
+ * Languages whose default script is right-to-left.
45
+ *
46
+ * Used only when the tag does not name a script — `fa` has to resolve to RTL
47
+ * without the host having to write `fa-Arab`. Each entry is the *language*
48
+ * subtag; regions never change direction, so `ar-EG` and `ar` behave the same.
49
+ *
50
+ * Of the languages a typical host app ships, Arabic (`ar`) and Persian/Farsi
51
+ * (`fa`) are the RTL ones. The rest of this set costs nothing and means Hebrew,
52
+ * Urdu, Kurdish and friends work the day the host adds them.
53
+ */
54
+ export declare const RTL_LANGUAGES: ReadonlySet<string>;
55
+ /**
56
+ * Reduces any language identifier to a canonical BCP-47-ish tag.
57
+ *
58
+ * Accepts what hosts really pass: `en`, `en-US`, `en_us`, `EN-us`, `zh_CN`,
59
+ * `pt-BR.UTF-8`, `fa-IR`, and returns `en`, `en-US`, `en-US`, `en-US`,
60
+ * `zh-Hans-CN`, `pt-BR`, `fa-IR`. Returns an empty string for junk so callers
61
+ * can fall back rather than guess.
62
+ */
63
+ export declare function normalizeLocale(input?: string | null): string;
64
+ /** Breaks a language identifier into its language / script / region parts. */
65
+ export declare function parseLocale(input?: string | null): ParsedLocale;
66
+ /**
67
+ * True when text in this locale reads right-to-left.
68
+ *
69
+ * Script wins when present (`ku-Arab` is RTL even though bare `ku` may be
70
+ * written either way in practice); otherwise the language's default script
71
+ * decides. An unrecognised or empty tag is left-to-right, matching the
72
+ * English fallback.
73
+ */
74
+ export declare function isRtlLocale(input?: string | null): boolean;
75
+ /**
76
+ * Ordered list of tags to try for a locale, most specific first.
77
+ *
78
+ * `zh-Hans-CN` → `['zh-Hans-CN', 'zh-Hans', 'zh-CN', 'zh', 'en']`
79
+ * `pt-BR` → `['pt-BR', 'pt', 'en']`
80
+ * `fa` → `['fa', 'en']`
81
+ *
82
+ * The fallback locale is appended last and deduplicated, so a bundle registered
83
+ * under any of these spellings is found. English stays the final fallback.
84
+ */
85
+ export declare function localeFallbackChain(input?: string | null, fallbackLocale?: string): string[];
86
+ /**
87
+ * Picks the best matching key out of a locale-keyed record.
88
+ *
89
+ * Lookups are case-insensitive and separator-insensitive, so a bundle
90
+ * registered as `zh_TW`, `zh-tw` or `zh-Hant-TW` is all found by the same
91
+ * request. Returns `undefined` when nothing in the chain matches.
92
+ */
93
+ export declare function matchLocaleKey<T>(locale: string | null | undefined, entries: Readonly<Record<string, T>> | undefined, fallbackLocale?: string): string | undefined;
94
+ /**
95
+ * Merges every bundle along the fallback chain into one map.
96
+ *
97
+ * Least specific wins first and is then overwritten by more specific entries,
98
+ * so a `zh` bundle can carry the shared strings while `zh-Hant` overrides only
99
+ * the handful that differ. Missing keys simply stay missing here — the caller
100
+ * layers this on top of the shipped English defaults.
101
+ */
102
+ export declare function resolveLocaleTranslations<T extends object>(locale: string | null | undefined, bundles: Readonly<Record<string, T>> | undefined, fallbackLocale?: string): Partial<T>;
103
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/locales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAC;CACb;AAED,uEAAuE;AACvE,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAmC1C,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CAyB5C,CAAC;AAoEH;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAsC7D;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY,CAiB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAS1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,cAAc,GAAE,MAAuB,GACtC,MAAM,EAAE,CA2BV;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,EAChD,cAAc,GAAE,MAAuB,GACtC,MAAM,GAAG,SAAS,CAkBpB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EACxD,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,EAChD,cAAc,GAAE,MAAuB,GACtC,OAAO,CAAC,CAAC,CAAC,CAuBZ"}