react-isoform 0.0.0-stage → 0.1.0

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 (353) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +104 -2
  3. package/android/build.gradle +212 -0
  4. package/android/consumer-rules.pro +10 -0
  5. package/android/src/audio/java/com/isoform/IsoAudioControls.kt +531 -0
  6. package/android/src/audio/java/com/isoform/IsoAudioView.kt +328 -0
  7. package/android/src/audio/java/com/isoform/IsoAudioViewManager.kt +88 -0
  8. package/android/src/camera/AndroidManifest.xml +6 -0
  9. package/android/src/camera/java/com/isoform/IsoCamera.kt +99 -0
  10. package/android/src/camera/java/com/isoform/IsoCameraController.kt +232 -0
  11. package/android/src/camera/java/com/isoform/IsoCameraLifecycle.kt +26 -0
  12. package/android/src/camera/java/com/isoform/IsoCameraView.kt +392 -0
  13. package/android/src/camera/java/com/isoform/IsoCameraViewManager.kt +76 -0
  14. package/android/src/cameraCodes/java/com/isoform/IsoCodeScanner.kt +90 -0
  15. package/android/src/cameraCodesOff/java/com/isoform/IsoCodeScanner.kt +17 -0
  16. package/android/src/cameraVideo/AndroidManifest.xml +4 -0
  17. package/android/src/cameraVideo/java/com/isoform/IsoCameraRecorder.kt +83 -0
  18. package/android/src/cameraVideoOff/java/com/isoform/IsoCameraRecorder.kt +22 -0
  19. package/android/src/datePicker/java/com/isoform/IsoDatePicker.kt +724 -0
  20. package/android/src/datePicker/java/com/isoform/IsoDatePickerView.kt +137 -0
  21. package/android/src/datePicker/java/com/isoform/IsoDatePickerViewManager.kt +56 -0
  22. package/android/src/image/java/com/isoform/IsoImageModule.kt +33 -0
  23. package/android/src/image/java/com/isoform/IsoImagePipeline.kt +516 -0
  24. package/android/src/image/java/com/isoform/IsoImageView.kt +573 -0
  25. package/android/src/image/java/com/isoform/IsoImageViewManager.kt +119 -0
  26. package/android/src/main/AndroidManifest.xml +4 -0
  27. package/android/src/main/java/com/isoform/IsoformPackage.kt +52 -0
  28. package/android/src/mediaSession/AndroidManifest.xml +18 -0
  29. package/android/src/mediaSession/java/com/isoform/IsoMediaService.kt +21 -0
  30. package/android/src/mediaSession/java/com/isoform/IsoMediaSession.kt +92 -0
  31. package/android/src/mediaSessionOff/java/com/isoform/IsoMediaSession.kt +18 -0
  32. package/android/src/modal/java/com/isoform/IsoModal.kt +182 -0
  33. package/android/src/modal/java/com/isoform/IsoModalView.kt +137 -0
  34. package/android/src/modal/java/com/isoform/IsoModalViewManager.kt +70 -0
  35. package/android/src/pdf/java/com/isoform/IsoPdfDocument.kt +157 -0
  36. package/android/src/pdf/java/com/isoform/IsoPdfEngine.kt +161 -0
  37. package/android/src/pdf/java/com/isoform/IsoPdfIcons.kt +76 -0
  38. package/android/src/pdf/java/com/isoform/IsoPdfReader.kt +176 -0
  39. package/android/src/pdf/java/com/isoform/IsoPdfView.kt +372 -0
  40. package/android/src/pdf/java/com/isoform/IsoPdfViewManager.kt +100 -0
  41. package/android/src/pdf/java/com/isoform/IsoPdfViewer.kt +849 -0
  42. package/android/src/sheet/java/com/isoform/IsoSheet.kt +247 -0
  43. package/android/src/sheet/java/com/isoform/IsoSheetView.kt +188 -0
  44. package/android/src/sheet/java/com/isoform/IsoSheetViewManager.kt +76 -0
  45. package/android/src/video/java/com/isoform/IsoVideoControls.kt +921 -0
  46. package/android/src/video/java/com/isoform/IsoVideoPlaylistPanel.kt +247 -0
  47. package/android/src/video/java/com/isoform/IsoVideoView.kt +324 -0
  48. package/android/src/video/java/com/isoform/IsoVideoViewManager.kt +84 -0
  49. package/babel.js +133 -0
  50. package/dist/adapters/react-dom/adapter.d.ts +3 -0
  51. package/dist/adapters/react-dom/adapter.js +108 -0
  52. package/dist/adapters/react-dom/camera/CameraElement.d.ts +15 -0
  53. package/dist/adapters/react-dom/camera/CameraElement.js +293 -0
  54. package/dist/adapters/react-dom/camera/LazyCamera.d.ts +4 -0
  55. package/dist/adapters/react-dom/camera/LazyCamera.js +21 -0
  56. package/dist/adapters/react-dom/camera/webCamera.d.ts +27 -0
  57. package/dist/adapters/react-dom/camera/webCamera.js +51 -0
  58. package/dist/adapters/react-dom/css/sheet.d.ts +43 -0
  59. package/dist/adapters/react-dom/css/sheet.js +183 -0
  60. package/dist/adapters/react-dom/datePicker/DatePicker.d.ts +19 -0
  61. package/dist/adapters/react-dom/datePicker/DatePicker.js +31 -0
  62. package/dist/adapters/react-dom/image/Image.d.ts +23 -0
  63. package/dist/adapters/react-dom/image/Image.js +256 -0
  64. package/dist/adapters/react-dom/media/audio/AudioControls.d.ts +44 -0
  65. package/dist/adapters/react-dom/media/audio/AudioControls.js +53 -0
  66. package/dist/adapters/react-dom/media/audio/AudioElement.d.ts +18 -0
  67. package/dist/adapters/react-dom/media/audio/AudioElement.js +139 -0
  68. package/dist/adapters/react-dom/media/audio/LazyAudio.d.ts +3 -0
  69. package/dist/adapters/react-dom/media/audio/LazyAudio.js +22 -0
  70. package/dist/adapters/react-dom/media/audio/audioStyles.d.ts +3 -0
  71. package/dist/adapters/react-dom/media/audio/audioStyles.js +52 -0
  72. package/dist/adapters/react-dom/media/index.d.ts +4 -0
  73. package/dist/adapters/react-dom/media/index.js +10 -0
  74. package/dist/adapters/react-dom/media/pdf/LazyPdf.d.ts +4 -0
  75. package/dist/adapters/react-dom/media/pdf/LazyPdf.js +22 -0
  76. package/dist/adapters/react-dom/media/pdf/PdfElement.d.ts +20 -0
  77. package/dist/adapters/react-dom/media/pdf/PdfElement.js +622 -0
  78. package/dist/adapters/react-dom/media/pdf/PdfPage.d.ts +31 -0
  79. package/dist/adapters/react-dom/media/pdf/PdfPage.js +154 -0
  80. package/dist/adapters/react-dom/media/pdf/PdfThumbnails.d.ts +12 -0
  81. package/dist/adapters/react-dom/media/pdf/PdfThumbnails.js +56 -0
  82. package/dist/adapters/react-dom/media/pdf/PdfToolbar.d.ts +82 -0
  83. package/dist/adapters/react-dom/media/pdf/PdfToolbar.js +92 -0
  84. package/dist/adapters/react-dom/media/pdf/pdfDocument.d.ts +90 -0
  85. package/dist/adapters/react-dom/media/pdf/pdfDocument.js +118 -0
  86. package/dist/adapters/react-dom/media/pdf/pdfStyles.d.ts +3 -0
  87. package/dist/adapters/react-dom/media/pdf/pdfStyles.js +107 -0
  88. package/dist/adapters/react-dom/media/pdf/pdfjs.d.ts +12 -0
  89. package/dist/adapters/react-dom/media/pdf/pdfjs.js +31 -0
  90. package/dist/adapters/react-dom/media/pdf/readAloud.d.ts +27 -0
  91. package/dist/adapters/react-dom/media/pdf/readAloud.js +136 -0
  92. package/dist/adapters/react-dom/media/pdf/search.d.ts +48 -0
  93. package/dist/adapters/react-dom/media/pdf/search.js +57 -0
  94. package/dist/adapters/react-dom/media/shared/Playlist.d.ts +21 -0
  95. package/dist/adapters/react-dom/media/shared/Playlist.js +240 -0
  96. package/dist/adapters/react-dom/media/shared/Track.d.ts +21 -0
  97. package/dist/adapters/react-dom/media/shared/Track.js +47 -0
  98. package/dist/adapters/react-dom/media/shared/controlStyles.d.ts +3 -0
  99. package/dist/adapters/react-dom/media/shared/controlStyles.js +46 -0
  100. package/dist/adapters/react-dom/media/shared/helpers.d.ts +22 -0
  101. package/dist/adapters/react-dom/media/shared/helpers.js +46 -0
  102. package/dist/adapters/react-dom/media/shared/icons.d.ts +49 -0
  103. package/dist/adapters/react-dom/media/shared/icons.js +52 -0
  104. package/dist/adapters/react-dom/media/shared/playlistHandle.d.ts +13 -0
  105. package/dist/adapters/react-dom/media/shared/playlistHandle.js +17 -0
  106. package/dist/adapters/react-dom/media/shared/withPlaylist.d.ts +4 -0
  107. package/dist/adapters/react-dom/media/shared/withPlaylist.js +24 -0
  108. package/dist/adapters/react-dom/media/video/LazyVideo.d.ts +4 -0
  109. package/dist/adapters/react-dom/media/video/LazyVideo.js +22 -0
  110. package/dist/adapters/react-dom/media/video/VideoControls.d.ts +43 -0
  111. package/dist/adapters/react-dom/media/video/VideoControls.js +89 -0
  112. package/dist/adapters/react-dom/media/video/VideoElement.d.ts +19 -0
  113. package/dist/adapters/react-dom/media/video/VideoElement.js +161 -0
  114. package/dist/adapters/react-dom/media/video/fullscreen.d.ts +17 -0
  115. package/dist/adapters/react-dom/media/video/fullscreen.js +43 -0
  116. package/dist/adapters/react-dom/media/video/pictureInPicture.d.ts +11 -0
  117. package/dist/adapters/react-dom/media/video/pictureInPicture.js +34 -0
  118. package/dist/adapters/react-dom/media/video/videoStyles.d.ts +3 -0
  119. package/dist/adapters/react-dom/media/video/videoStyles.js +49 -0
  120. package/dist/adapters/react-dom/modal/LazyModal.d.ts +8 -0
  121. package/dist/adapters/react-dom/modal/LazyModal.js +22 -0
  122. package/dist/adapters/react-dom/modal/Modal.d.ts +16 -0
  123. package/dist/adapters/react-dom/modal/Modal.js +101 -0
  124. package/dist/adapters/react-dom/normalize/domProps.d.ts +9 -0
  125. package/dist/adapters/react-dom/normalize/domProps.js +279 -0
  126. package/dist/adapters/react-dom/normalize/props.d.ts +5 -0
  127. package/dist/adapters/react-dom/normalize/props.js +258 -0
  128. package/dist/adapters/react-dom/normalize/style.d.ts +14 -0
  129. package/dist/adapters/react-dom/normalize/style.js +165 -0
  130. package/dist/adapters/react-dom/primitives.d.ts +6 -0
  131. package/dist/adapters/react-dom/primitives.js +37 -0
  132. package/dist/adapters/react-dom/sheet/LazySheet.d.ts +7 -0
  133. package/dist/adapters/react-dom/sheet/LazySheet.js +26 -0
  134. package/dist/adapters/react-dom/sheet/SheetElement.d.ts +17 -0
  135. package/dist/adapters/react-dom/sheet/SheetElement.js +223 -0
  136. package/dist/adapters/react-dom/sheet/sheetStyles.d.ts +3 -0
  137. package/dist/adapters/react-dom/sheet/sheetStyles.js +36 -0
  138. package/dist/adapters/react-dom/svg/elements.d.ts +5 -0
  139. package/dist/adapters/react-dom/svg/elements.js +32 -0
  140. package/dist/adapters/react-dom/themeToggle.bench.d.ts +2 -0
  141. package/dist/adapters/react-dom/themeToggle.bench.js +111 -0
  142. package/dist/adapters/react-native/adapter.d.ts +24 -0
  143. package/dist/adapters/react-native/adapter.js +356 -0
  144. package/dist/adapters/react-native/animatedHost.d.ts +21 -0
  145. package/dist/adapters/react-native/animatedHost.js +84 -0
  146. package/dist/adapters/react-native/animation.d.ts +63 -0
  147. package/dist/adapters/react-native/animation.js +340 -0
  148. package/dist/adapters/react-native/breakpoint.bench.d.ts +2 -0
  149. package/dist/adapters/react-native/breakpoint.bench.js +112 -0
  150. package/dist/adapters/react-native/camera/Camera.d.ts +12 -0
  151. package/dist/adapters/react-native/camera/Camera.disabled.d.ts +8 -0
  152. package/dist/adapters/react-native/camera/Camera.disabled.js +14 -0
  153. package/dist/adapters/react-native/camera/Camera.js +103 -0
  154. package/dist/adapters/react-native/camera/native/IsoCameraViewNativeComponent.d.ts +83 -0
  155. package/dist/adapters/react-native/camera/native/IsoCameraViewNativeComponent.js +6 -0
  156. package/dist/adapters/react-native/datePicker/DatePicker.d.ts +16 -0
  157. package/dist/adapters/react-native/datePicker/DatePicker.disabled.d.ts +10 -0
  158. package/dist/adapters/react-native/datePicker/DatePicker.disabled.js +13 -0
  159. package/dist/adapters/react-native/datePicker/DatePicker.js +43 -0
  160. package/dist/adapters/react-native/datePicker/native/IsoDatePickerViewNativeComponent.d.ts +35 -0
  161. package/dist/adapters/react-native/datePicker/native/IsoDatePickerViewNativeComponent.js +13 -0
  162. package/dist/adapters/react-native/image/Image.d.ts +26 -0
  163. package/dist/adapters/react-native/image/Image.disabled.d.ts +7 -0
  164. package/dist/adapters/react-native/image/Image.disabled.js +7 -0
  165. package/dist/adapters/react-native/image/Image.js +56 -0
  166. package/dist/adapters/react-native/image/PlainImage.d.ts +18 -0
  167. package/dist/adapters/react-native/image/PlainImage.js +18 -0
  168. package/dist/adapters/react-native/image/imageCache.d.ts +4 -0
  169. package/dist/adapters/react-native/image/imageCache.js +17 -0
  170. package/dist/adapters/react-native/image/native/IsoImageViewNativeComponent.d.ts +86 -0
  171. package/dist/adapters/react-native/image/native/IsoImageViewNativeComponent.js +14 -0
  172. package/dist/adapters/react-native/image/native/NativeIsoImageModule.d.ts +17 -0
  173. package/dist/adapters/react-native/image/native/NativeIsoImageModule.js +9 -0
  174. package/dist/adapters/react-native/media/audio/Audio.d.ts +19 -0
  175. package/dist/adapters/react-native/media/audio/Audio.disabled.d.ts +8 -0
  176. package/dist/adapters/react-native/media/audio/Audio.disabled.js +16 -0
  177. package/dist/adapters/react-native/media/audio/Audio.js +40 -0
  178. package/dist/adapters/react-native/media/audio/native/IsoAudioViewNativeComponent.d.ts +77 -0
  179. package/dist/adapters/react-native/media/audio/native/IsoAudioViewNativeComponent.js +6 -0
  180. package/dist/adapters/react-native/media/index.d.ts +4 -0
  181. package/dist/adapters/react-native/media/index.js +9 -0
  182. package/dist/adapters/react-native/media/pdf/Pdf.d.ts +19 -0
  183. package/dist/adapters/react-native/media/pdf/Pdf.disabled.d.ts +9 -0
  184. package/dist/adapters/react-native/media/pdf/Pdf.disabled.js +16 -0
  185. package/dist/adapters/react-native/media/pdf/Pdf.js +46 -0
  186. package/dist/adapters/react-native/media/pdf/native/IsoPdfViewNativeComponent.d.ts +77 -0
  187. package/dist/adapters/react-native/media/pdf/native/IsoPdfViewNativeComponent.js +6 -0
  188. package/dist/adapters/react-native/media/shared/Playlist.d.ts +18 -0
  189. package/dist/adapters/react-native/media/shared/Playlist.js +242 -0
  190. package/dist/adapters/react-native/media/video/Video.d.ts +25 -0
  191. package/dist/adapters/react-native/media/video/Video.disabled.d.ts +9 -0
  192. package/dist/adapters/react-native/media/video/Video.disabled.js +16 -0
  193. package/dist/adapters/react-native/media/video/Video.js +46 -0
  194. package/dist/adapters/react-native/media/video/native/IsoVideoViewNativeComponent.d.ts +87 -0
  195. package/dist/adapters/react-native/media/video/native/IsoVideoViewNativeComponent.js +6 -0
  196. package/dist/adapters/react-native/miss.bench.d.ts +2 -0
  197. package/dist/adapters/react-native/miss.bench.js +78 -0
  198. package/dist/adapters/react-native/modal/Modal.d.ts +18 -0
  199. package/dist/adapters/react-native/modal/Modal.disabled.d.ts +7 -0
  200. package/dist/adapters/react-native/modal/Modal.disabled.js +7 -0
  201. package/dist/adapters/react-native/modal/Modal.js +71 -0
  202. package/dist/adapters/react-native/modal/PlainModal.d.ts +16 -0
  203. package/dist/adapters/react-native/modal/PlainModal.js +26 -0
  204. package/dist/adapters/react-native/modal/native/IsoModalViewNativeComponent.d.ts +35 -0
  205. package/dist/adapters/react-native/modal/native/IsoModalViewNativeComponent.js +14 -0
  206. package/dist/adapters/react-native/normalize.d.ts +13 -0
  207. package/dist/adapters/react-native/normalize.js +221 -0
  208. package/dist/adapters/react-native/pseudo.d.ts +27 -0
  209. package/dist/adapters/react-native/pseudo.js +39 -0
  210. package/dist/adapters/react-native/sheet/BottomSheet.d.ts +12 -0
  211. package/dist/adapters/react-native/sheet/BottomSheet.disabled.d.ts +8 -0
  212. package/dist/adapters/react-native/sheet/BottomSheet.disabled.js +14 -0
  213. package/dist/adapters/react-native/sheet/BottomSheet.js +89 -0
  214. package/dist/adapters/react-native/sheet/native/IsoSheetViewNativeComponent.d.ts +40 -0
  215. package/dist/adapters/react-native/sheet/native/IsoSheetViewNativeComponent.js +14 -0
  216. package/dist/adapters/react-native/styleHost.d.ts +21 -0
  217. package/dist/adapters/react-native/styleHost.js +72 -0
  218. package/dist/adapters/react-native/svg/Svg.d.ts +5 -0
  219. package/dist/adapters/react-native/svg/Svg.disabled.d.ts +5 -0
  220. package/dist/adapters/react-native/svg/Svg.disabled.js +18 -0
  221. package/dist/adapters/react-native/svg/Svg.js +60 -0
  222. package/dist/adapters/react-native/transition.d.ts +41 -0
  223. package/dist/adapters/react-native/transition.js +145 -0
  224. package/dist/adapters/react-native/transitionHost.d.ts +11 -0
  225. package/dist/adapters/react-native/transitionHost.js +147 -0
  226. package/dist/adapters/react-native/windowWidth.d.ts +15 -0
  227. package/dist/adapters/react-native/windowWidth.js +49 -0
  228. package/dist/cache/lru.d.ts +11 -0
  229. package/dist/cache/lru.js +32 -0
  230. package/dist/config/index.d.ts +239 -0
  231. package/dist/config/index.js +161 -0
  232. package/dist/core/adapter.d.ts +72 -0
  233. package/dist/core/adapter.js +2 -0
  234. package/dist/core/builder.d.ts +95 -0
  235. package/dist/core/builder.js +431 -0
  236. package/dist/core/camera.d.ts +142 -0
  237. package/dist/core/camera.js +43 -0
  238. package/dist/core/cameraRequests.d.ts +18 -0
  239. package/dist/core/cameraRequests.js +44 -0
  240. package/dist/core/conditions.d.ts +54 -0
  241. package/dist/core/conditions.js +123 -0
  242. package/dist/core/datePicker.d.ts +92 -0
  243. package/dist/core/datePicker.js +92 -0
  244. package/dist/core/dev.d.ts +5 -0
  245. package/dist/core/dev.js +18 -0
  246. package/dist/core/engine.d.ts +62 -0
  247. package/dist/core/engine.js +26 -0
  248. package/dist/core/flatten.d.ts +6 -0
  249. package/dist/core/flatten.js +22 -0
  250. package/dist/core/image.d.ts +246 -0
  251. package/dist/core/image.js +171 -0
  252. package/dist/core/inline.d.ts +33 -0
  253. package/dist/core/inline.js +25 -0
  254. package/dist/core/keyframes.d.ts +40 -0
  255. package/dist/core/keyframes.js +38 -0
  256. package/dist/core/media.d.ts +118 -0
  257. package/dist/core/media.js +2 -0
  258. package/dist/core/modal.d.ts +76 -0
  259. package/dist/core/modal.js +35 -0
  260. package/dist/core/modules.d.ts +7 -0
  261. package/dist/core/modules.js +9 -0
  262. package/dist/core/pdf.d.ts +133 -0
  263. package/dist/core/pdf.js +2 -0
  264. package/dist/core/playlist.d.ts +97 -0
  265. package/dist/core/playlist.js +58 -0
  266. package/dist/core/primitives.d.ts +410 -0
  267. package/dist/core/primitives.js +2 -0
  268. package/dist/core/proxy.d.ts +2 -0
  269. package/dist/core/proxy.js +25 -0
  270. package/dist/core/sheet.d.ts +95 -0
  271. package/dist/core/sheet.js +71 -0
  272. package/dist/core/style/types.d.ts +88 -0
  273. package/dist/core/style/types.js +2 -0
  274. package/dist/core/svg.d.ts +121 -0
  275. package/dist/core/svg.js +76 -0
  276. package/dist/core/testing/benchHarness.d.ts +42 -0
  277. package/dist/core/testing/benchHarness.js +75 -0
  278. package/dist/core/types.d.ts +222 -0
  279. package/dist/core/types.js +2 -0
  280. package/dist/hash/optimizedHash.d.ts +10 -0
  281. package/dist/hash/optimizedHash.js +63 -0
  282. package/dist/hash/stringHash.d.ts +6 -0
  283. package/dist/hash/stringHash.js +17 -0
  284. package/dist/hash/trackReads.d.ts +20 -0
  285. package/dist/hash/trackReads.js +49 -0
  286. package/dist/index.d.ts +31 -0
  287. package/dist/index.js +21 -0
  288. package/dist/jsx-dev-runtime.d.ts +7 -0
  289. package/dist/jsx-dev-runtime.js +13 -0
  290. package/dist/jsx-runtime.d.ts +19 -0
  291. package/dist/jsx-runtime.js +25 -0
  292. package/dist/providers/index.d.ts +2 -0
  293. package/dist/providers/index.js +5 -0
  294. package/dist/providers/index.native.d.ts +2 -0
  295. package/dist/providers/index.native.js +5 -0
  296. package/dist/theme/index.d.ts +46 -0
  297. package/dist/theme/index.js +51 -0
  298. package/dist/theme/store/helpers.d.ts +50 -0
  299. package/dist/theme/store/helpers.js +116 -0
  300. package/dist/theme/store/index.d.ts +196 -0
  301. package/dist/theme/store/index.js +259 -0
  302. package/dist/theme/variables.d.ts +23 -0
  303. package/dist/theme/variables.js +127 -0
  304. package/ios/audio/IsoAudioCard.swift +471 -0
  305. package/ios/audio/IsoAudioPlayer.swift +326 -0
  306. package/ios/audio/IsoAudioView.mm +173 -0
  307. package/ios/camera/IsoCamera.swift +682 -0
  308. package/ios/camera/IsoCameraView.mm +206 -0
  309. package/ios/datePicker/IsoDatePicker.swift +826 -0
  310. package/ios/datePicker/IsoDatePickerView.mm +118 -0
  311. package/ios/datePicker/IsoWheelView.swift +190 -0
  312. package/ios/image/IsoImage.swift +568 -0
  313. package/ios/image/IsoImageModule.mm +45 -0
  314. package/ios/image/IsoImagePipeline.swift +612 -0
  315. package/ios/image/IsoImageView.mm +173 -0
  316. package/ios/mediaSession/IsoNowPlaying.swift +150 -0
  317. package/ios/mediaSessionOff/IsoNowPlaying.swift +18 -0
  318. package/ios/modal/IsoModal.swift +301 -0
  319. package/ios/modal/IsoModalView.mm +132 -0
  320. package/ios/pdf/IsoPdfSupport.swift +247 -0
  321. package/ios/pdf/IsoPdfToolbar.swift +403 -0
  322. package/ios/pdf/IsoPdfView.mm +194 -0
  323. package/ios/pdf/IsoPdfViewer.swift +547 -0
  324. package/ios/shared/IsoAudioSession.swift +42 -0
  325. package/ios/sheet/IsoSheet.swift +259 -0
  326. package/ios/sheet/IsoSheetView.mm +143 -0
  327. package/ios/stubs/audio/IsoAudioViewStub.mm +32 -0
  328. package/ios/stubs/camera/IsoCameraViewStub.mm +32 -0
  329. package/ios/stubs/datePicker/IsoDatePickerViewStub.mm +32 -0
  330. package/ios/stubs/image/IsoImageViewStub.mm +62 -0
  331. package/ios/stubs/modal/IsoModalViewStub.mm +32 -0
  332. package/ios/stubs/pdf/IsoPdfViewStub.mm +32 -0
  333. package/ios/stubs/sheet/IsoSheetViewStub.mm +32 -0
  334. package/ios/stubs/video/IsoVideoViewStub.mm +32 -0
  335. package/ios/video/IsoVideoControls.swift +569 -0
  336. package/ios/video/IsoVideoFullscreen.swift +280 -0
  337. package/ios/video/IsoVideoPlayer.swift +421 -0
  338. package/ios/video/IsoVideoPlaylistPanel.swift +360 -0
  339. package/ios/video/IsoVideoView.mm +187 -0
  340. package/isoform.podspec +132 -0
  341. package/metro.js +81 -0
  342. package/package.json +180 -4
  343. package/react-native.config.js +12 -0
  344. package/scripts/setup-ios.js +85 -0
  345. package/src/adapters/react-native/camera/native/IsoCameraViewNativeComponent.ts +79 -0
  346. package/src/adapters/react-native/datePicker/native/IsoDatePickerViewNativeComponent.ts +44 -0
  347. package/src/adapters/react-native/image/native/IsoImageViewNativeComponent.ts +90 -0
  348. package/src/adapters/react-native/image/native/NativeIsoImageModule.ts +24 -0
  349. package/src/adapters/react-native/media/audio/native/IsoAudioViewNativeComponent.ts +69 -0
  350. package/src/adapters/react-native/media/pdf/native/IsoPdfViewNativeComponent.ts +71 -0
  351. package/src/adapters/react-native/media/video/native/IsoVideoViewNativeComponent.ts +74 -0
  352. package/src/adapters/react-native/modal/native/IsoModalViewNativeComponent.ts +47 -0
  353. package/src/adapters/react-native/sheet/native/IsoSheetViewNativeComponent.ts +50 -0
@@ -0,0 +1,410 @@
1
+ import type { HTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, ReactNode, SVGProps, TextareaHTMLAttributes } from 'react';
2
+ import type { StyleInput } from './style/types';
3
+ import type { AudioHandle, AudioOwnProps, VideoHandle, VideoOwnProps } from './media';
4
+ import type { PdfHandle, PdfOwnProps } from './pdf';
5
+ import type { BottomSheetHandle, BottomSheetOwnProps } from './sheet';
6
+ import type { CameraHandle, CameraOwnProps } from './camera';
7
+ import type { DatePickerOwnProps } from './datePicker';
8
+ import type { ImageHandle, ImageOwnProps, ImageSourceInput } from './image';
9
+ import type { ModalOwnProps } from './modal';
10
+ /**
11
+ * Props shared by every primitive on both platforms. Any other DOM prop
12
+ * (`href`, `onMouseEnter`, `data-*`…) is accepted through `HTMLAttributes` and
13
+ * goes straight to the element on the web; extra native props go straight to
14
+ * the React Native component.
15
+ */
16
+ export interface CommonProps {
17
+ /** Style overrides. Always wins over the `engine()` styles. Web: applied inline. */
18
+ style?: StyleInput;
19
+ /** Child elements. */
20
+ children?: ReactNode;
21
+ /** Test identifier. Web: rendered as `data-testid`. Native: `testID`. */
22
+ testID?: string;
23
+ /**
24
+ * Extra touch area around the element (a number or `{ top, left, bottom, right }`).
25
+ * @platform native — ignored on the web.
26
+ */
27
+ hitSlop?: any;
28
+ /**
29
+ * Called with the element's layout (position and size) after it is laid out.
30
+ * @platform native — ignored on the web.
31
+ */
32
+ onLayout?: (event: any) => void;
33
+ /** @deprecated Use `aria-label` (on the web it is translated to `aria-label`). */
34
+ accessibilityLabel?: string;
35
+ /** @deprecated Use `role` (on the web it is translated to `role`). */
36
+ accessibilityRole?: string;
37
+ /** @deprecated Use the `aria-*` props (on the web they are translated to `aria-disabled`, `aria-selected`…). */
38
+ accessibilityState?: {
39
+ /** The element is disabled (`aria-disabled`). */
40
+ disabled?: boolean;
41
+ /** The element is selected (`aria-selected`). */
42
+ selected?: boolean;
43
+ /** The element is checked, or partially checked with `'mixed'` (`aria-checked`). */
44
+ checked?: boolean | 'mixed';
45
+ /** The element is busy, e.g. loading (`aria-busy`). */
46
+ busy?: boolean;
47
+ /** The element is expanded, e.g. an open accordion (`aria-expanded`). */
48
+ expanded?: boolean;
49
+ };
50
+ /** @deprecated Use `aria-description`. */
51
+ accessibilityHint?: string;
52
+ }
53
+ /**
54
+ * Augment this interface to type native props the lib does not list:
55
+ * ```ts
56
+ * declare module 'react-isoform' {
57
+ * interface IsoNativeProps { collapsable?: boolean }
58
+ * }
59
+ * ```
60
+ */
61
+ export interface IsoNativeProps {
62
+ }
63
+ /** The element's DOM props, minus the ones isoform redefines (`style`, `onChange`, `autoCorrect`). */
64
+ type Dom<T extends HTMLAttributes<any>> = Omit<T, 'style' | 'onChange' | 'autoCorrect'>;
65
+ /**
66
+ * Props of `Box`: a layout container.
67
+ * Web: `<div>` with React Native defaults (flex column). Native: `View`.
68
+ */
69
+ export type BoxProps = Dom<HTMLAttributes<HTMLDivElement>> & CommonProps & IsoNativeProps;
70
+ /**
71
+ * Props of `Text`: a piece of text.
72
+ * Web: `<span>`. Native: `Text`.
73
+ */
74
+ export type TextProps = Dom<HTMLAttributes<HTMLSpanElement>> & CommonProps & IsoNativeProps & {
75
+ /** Maximum number of lines; extra text is cut with an ellipsis. Web: `-webkit-line-clamp`. */
76
+ numberOfLines?: number;
77
+ };
78
+ /**
79
+ * Props of `Pressable`: anything that reacts to a tap or click.
80
+ * Web: `<div role="button">` (focusable, Enter/Space trigger `onPress`). Native: `Pressable`.
81
+ */
82
+ export type PressableProps = Dom<HTMLAttributes<HTMLDivElement>> & CommonProps & IsoNativeProps & {
83
+ /** Called on tap (native) or on click / Enter / Space (web). */
84
+ onPress?: (event?: any) => void;
85
+ /** Called when the element is held down for a while. */
86
+ onLongPress?: (event?: any) => void;
87
+ /** Called when the press starts. Web: `pointerdown`. */
88
+ onPressIn?: (event?: any) => void;
89
+ /** Called when the press ends (release, leaving the area or cancel). Web: `pointerup` / `pointerleave` / `pointercancel`. */
90
+ onPressOut?: (event?: any) => void;
91
+ /** Disables presses. Web: also sets `aria-disabled`. */
92
+ disabled?: boolean;
93
+ };
94
+ /**
95
+ * Props of `Input`: a text field.
96
+ * Web: `<input>` (or `<textarea>` with `multiline`). Native: `TextInput`.
97
+ */
98
+ export type InputProps = Dom<InputHTMLAttributes<HTMLInputElement> & TextareaHTMLAttributes<HTMLTextAreaElement>> & CommonProps & IsoNativeProps & {
99
+ /** Called with the new text (not the event) on every change, on both platforms. */
100
+ onChangeText?: (text: string) => void;
101
+ /** Called with the raw platform event on every change. Prefer `onChangeText`. */
102
+ onChange?: (event: any) => void;
103
+ /** Allows several lines of text. Web: renders a `<textarea>`. */
104
+ multiline?: boolean;
105
+ /** Number of visible lines when `multiline` (web: `rows`). */
106
+ numberOfLines?: number;
107
+ /** Placeholder text color. Prefer `when('::placeholder', { style: { color } })`. */
108
+ placeholderTextColor?: string;
109
+ /** Called when the user submits the field (Enter on the web, the return key on native). */
110
+ onSubmitEditing?: (event?: any) => void;
111
+ /** @deprecated Use `type="password"`. */
112
+ secureTextEntry?: boolean;
113
+ /** @deprecated Use `readOnly`. */
114
+ editable?: boolean;
115
+ /** @deprecated Use `inputMode`. */
116
+ keyboardType?: string;
117
+ /** Turns autocorrection on or off (web: the `autocorrect` attribute; `'on' | 'off'` also accepted). */
118
+ autoCorrect?: boolean | string;
119
+ };
120
+ /**
121
+ * Props of `Image`: a picture. Use the web-standard `src` and `alt`.
122
+ * With the `image` module on (see {@link ImageOwnProps}): the lib's own pipeline on iOS and
123
+ * Android (caches, blurhash, crossfade, tint, blur, animated pictures) and `<img>` with the
124
+ * same props on the web. Off: React Native's `Image` and a plain `<img>` (the extra props
125
+ * that the plain image understands still apply: `contentFit`, `tintColor`, `blurRadius`).
126
+ */
127
+ export type ImageProps = Omit<Dom<ImgHTMLAttributes<HTMLImageElement>>, 'src' | 'placeholder' | keyof ImageOwnProps> & ImageOwnProps & CommonProps & IsoNativeProps & {
128
+ /** The picture: a URL, a `require('./pic.png')` or `{ uri, headers, cacheKey }`. */
129
+ src?: ImageSourceInput;
130
+ /** @deprecated Use `src`. */
131
+ source?: {
132
+ uri: string;
133
+ } | string | number;
134
+ };
135
+ /**
136
+ * Props of `Scroll`: a scrollable container.
137
+ * Web: `<div>` with `overflow: auto`. Native: `ScrollView`.
138
+ */
139
+ export type ScrollProps = Dom<HTMLAttributes<HTMLDivElement>> & CommonProps & IsoNativeProps & {
140
+ /** Scrolls sideways instead of vertically. */
141
+ horizontal?: boolean;
142
+ /** Style of the inner content container (padding, gap, alignment of the scrolled content). */
143
+ contentContainerStyle?: StyleInput;
144
+ /** Shows the vertical scrollbar. @platform native */
145
+ showsVerticalScrollIndicator?: boolean;
146
+ /** Shows the horizontal scrollbar. @platform native */
147
+ showsHorizontalScrollIndicator?: boolean;
148
+ /**
149
+ * Whether taps inside the scroll dismiss the keyboard. @platform native
150
+ * - `'always'`: taps never dismiss the keyboard and are handled by the children.
151
+ * - `'never'`: a tap outside the focused input dismisses the keyboard (default).
152
+ * - `'handled'`: the keyboard stays when a child handles the tap.
153
+ */
154
+ keyboardShouldPersistTaps?: 'always' | 'never' | 'handled';
155
+ /** Called while scrolling, with the platform scroll event. */
156
+ onScroll?: (event: any) => void;
157
+ };
158
+ /**
159
+ * A media primitive: its own props (`src`, `onPlay`…) plus the common ones.
160
+ * DOM props that clash with ours (`onPlay`, `onError`…) are omitted.
161
+ */
162
+ type Media<Own> = Omit<Dom<HTMLAttributes<HTMLElement>>, keyof Own> & Own & CommonProps & IsoNativeProps;
163
+ /**
164
+ * Props of `Video`: a video player (see {@link VideoOwnProps} for the playback props).
165
+ * Requires `configure({ modules: { video: true } })`.
166
+ */
167
+ export type VideoProps = Media<VideoOwnProps>;
168
+ /**
169
+ * Props of `Audio`: an audio player with the lib's own controls (see {@link AudioOwnProps}).
170
+ * Requires `configure({ modules: { audio: true } })`.
171
+ */
172
+ export type AudioProps = Media<AudioOwnProps>;
173
+ /**
174
+ * Props of `Pdf`: a document viewer with search, thumbnails and zoom (see {@link PdfOwnProps}).
175
+ * Requires `configure({ modules: { pdf: true } })`.
176
+ */
177
+ export type PdfProps = Media<PdfOwnProps>;
178
+ /**
179
+ * Props of `BottomSheet`: a panel that slides up from the bottom (see {@link BottomSheetOwnProps}).
180
+ * The `style` styles the sheet surface: `backgroundColor` and the top corner radius go to the
181
+ * native sheet, the rest (padding, gap…) to the content. Requires `configure({ modules: { sheet: true } })`.
182
+ */
183
+ export type BottomSheetProps = Omit<Dom<HTMLAttributes<HTMLElement>>, keyof BottomSheetOwnProps> & Omit<BottomSheetOwnProps, 'children'> & CommonProps & IsoNativeProps & {
184
+ /** The content of the sheet. */
185
+ children?: ReactNode;
186
+ };
187
+ /**
188
+ * Props of `Camera`: the live camera preview (see {@link CameraOwnProps}). The style sizes
189
+ * the preview, which fills its box (cropping, like `objectFit: 'cover'`).
190
+ * Requires `configure({ modules: { camera: true } })`.
191
+ */
192
+ export type CameraProps = Omit<Dom<HTMLAttributes<HTMLElement>>, keyof CameraOwnProps> & CameraOwnProps & CommonProps & IsoNativeProps;
193
+ /**
194
+ * Props of `DatePicker`: pick a date, a time or both (see {@link DatePickerOwnProps}).
195
+ * The style sizes the picker (native pickers have their own natural height).
196
+ * Requires `configure({ modules: { datePicker: true } })`.
197
+ */
198
+ export type DatePickerProps = Omit<Dom<HTMLAttributes<HTMLElement>>, keyof DatePickerOwnProps> & DatePickerOwnProps & CommonProps & IsoNativeProps;
199
+ /**
200
+ * Props of `Modal`: content over the whole app (see {@link ModalOwnProps}). The `style` styles
201
+ * the card: `backgroundColor`, `borderRadius` and `width`/`maxWidth` go to the native
202
+ * surface, the rest (padding, gap…) to the content. With the `modal` module off it is
203
+ * React Native's `Modal` (native only).
204
+ */
205
+ export type ModalProps = Omit<Dom<HTMLAttributes<HTMLElement>>, keyof ModalOwnProps> & Omit<ModalOwnProps, 'children'> & CommonProps & IsoNativeProps & {
206
+ /** The content of the modal. */
207
+ children?: ReactNode;
208
+ /** React Native `Modal` (module off, written the old way): no full-screen background. */
209
+ transparent?: boolean;
210
+ /** React Native `Modal` (module off): `'fullScreen'`, `'pageSheet'`, `'formSheet'` or `'overFullScreen'`. @platform ios */
211
+ presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen';
212
+ /** React Native `Modal` (module off): draws under the status bar. @platform android */
213
+ statusBarTranslucent?: boolean;
214
+ /** React Native `Modal` (module off): draws under the navigation bar. @platform android */
215
+ navigationBarTranslucent?: boolean;
216
+ /** React Native `Modal` (module off): orientations allowed while it is shown. @platform ios */
217
+ supportedOrientations?: Array<'portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right'>;
218
+ /** React Native `Modal` (module off): called once it is shown. */
219
+ onShow?: (event?: any) => void;
220
+ /** React Native `Modal` (module off): called once it is gone. Prefer `onClosed`. @platform ios */
221
+ onDismiss?: () => void;
222
+ };
223
+ /**
224
+ * Props of an SVG primitive: the element's SVG attributes (`d`, `cx`, `viewBox`, `fill`…,
225
+ * camelCase as in React) plus the common ones. Presentation attributes also work in the
226
+ * style (`fill`, `stroke`, `strokeWidth`…), so they can come from the theme and `when()`.
227
+ * Requires `configure({ modules: { svg: true } })`.
228
+ */
229
+ export type SvgElementProps<E extends SVGElement = SVGElement> = Omit<SVGProps<E>, 'style' | 'ref' | 'children'> & CommonProps & IsoNativeProps & {
230
+ /** Called on tap (native) or click (web). */
231
+ onPress?: (event?: any) => void;
232
+ };
233
+ /**
234
+ * Props of `Svg`: the drawing's root. The style sizes and places the box (`width`,
235
+ * `height`, `margin`…); presentation keys (`color`, `fill`, `stroke`…) are inherited
236
+ * by the shapes inside. Native: `react-native-svg`'s `Svg` (fills its box by default).
237
+ */
238
+ export type SvgProps = SvgElementProps<SVGSVGElement>;
239
+ /** Native-only (or legacy) components: loosely typed (any prop is accepted). */
240
+ type NativeLoose = BoxProps & {
241
+ [key: string]: any;
242
+ };
243
+ /**
244
+ * Primitive name → what its `ref` exposes, for the primitives that have methods.
245
+ * `engine('Video')` and friends get a `ref` typed with it.
246
+ */
247
+ export interface IsoPrimitiveHandles {
248
+ /** `play`, `pause`, `seekTo`, `setFullscreen` (+ `next`/`previous`/`goTo` with `items`). */
249
+ Video: VideoHandle;
250
+ /** `play`, `pause`, `seekTo` (+ `next`/`previous`/`goTo` with `items`). */
251
+ Audio: AudioHandle;
252
+ /** `goToPage`, `search`, `setZoom`… (+ `next`/`previous`/`goTo` with `items`). */
253
+ Pdf: PdfHandle;
254
+ /** `snapTo`. */
255
+ BottomSheet: BottomSheetHandle;
256
+ /** `takePhoto`, `startRecording`, `stopRecording`. */
257
+ Camera: CameraHandle;
258
+ /** `zoomTo`, `resetZoom`, `rotateTo`, `play`, `pause`, `reload` (with the `image` module on). */
259
+ Image: ImageHandle;
260
+ }
261
+ /**
262
+ * Primitive name → props. This is what `engine('Name')` accepts.
263
+ * Universal primitives come first; the rest are legacy or native-only.
264
+ */
265
+ export interface IsoPrimitives {
266
+ /** Layout container. Web: `<div>` (flex column). Native: `View`. */
267
+ Box: BoxProps;
268
+ /** Text. Web: `<span>`. Native: `Text`. */
269
+ Text: TextProps;
270
+ /** Tappable/clickable area. Web: `<div role="button">`. Native: `Pressable`. */
271
+ Pressable: PressableProps;
272
+ /** Text field. Web: `<input>` / `<textarea>`. Native: `TextInput`. */
273
+ Input: InputProps;
274
+ /**
275
+ * Picture. Web: `<img>`. Native: `Image`. With `modules.image` on: the lib's own image
276
+ * (caches, blurhash, crossfade, tint, blur, animated pictures) on every platform.
277
+ */
278
+ Image: ImageProps;
279
+ /** Scrollable container. Web: `<div>` with `overflow: auto`. Native: `ScrollView`. */
280
+ Scroll: ScrollProps;
281
+ /**
282
+ * Video player. Web: `<video>` with the lib's controls. Native: the lib's
283
+ * native player (AVPlayer on iOS, Media3 on Android).
284
+ * The `ref` is a `VideoHandle` (`play`, `pause`, `seekTo`, `setFullscreen`).
285
+ * Requires `configure({ modules: { video: true } })`.
286
+ */
287
+ Video: VideoProps;
288
+ /**
289
+ * Audio player. Web: `<audio>` with the lib's controls. Native: the lib's
290
+ * native player (AVPlayer on iOS, Media3 on Android) with a card-style UI.
291
+ * The `ref` is an `AudioHandle` (`play`, `pause`, `seekTo`).
292
+ * Requires `configure({ modules: { audio: true } })`.
293
+ */
294
+ Audio: AudioProps;
295
+ /**
296
+ * PDF viewer. Web: pdf.js (loaded on demand). iOS: PDFKit. Android: the system
297
+ * `PdfRenderer` with Jetpack Compose (basic viewer on Android older than 12).
298
+ * The `ref` is a `PdfHandle` (`goToPage`, `search`, `searchNext`, `searchPrevious`, `clearSearch`, `setZoom`).
299
+ * Requires `configure({ modules: { pdf: true } })`.
300
+ */
301
+ Pdf: PdfProps;
302
+ /**
303
+ * Bottom sheet. Web: a native `<dialog>` with drag and snapping. iOS: a SwiftUI
304
+ * sheet (`presentationDetents`). Android: a Jetpack Compose sheet.
305
+ * The `ref` is a `BottomSheetHandle` (`snapTo`).
306
+ * Requires `configure({ modules: { sheet: true } })`.
307
+ */
308
+ BottomSheet: BottomSheetProps;
309
+ /**
310
+ * Camera preview. Web: `getUserMedia` in a `<video>`. iOS: AVFoundation. Android:
311
+ * CameraX with the Jetpack Compose viewfinder. The app draws its own controls.
312
+ * The `ref` is a `CameraHandle` (`takePhoto`, `startRecording`, `stopRecording`).
313
+ * Requires `configure({ modules: { camera: true } })`.
314
+ */
315
+ Camera: CameraProps;
316
+ /**
317
+ * Date, time or both. iOS (SwiftUI) and Android (Compose): the lib's own picker, the
318
+ * same design on both. Web: the browser's `<input type="date">`.
319
+ * Controlled: pass `value` and update it in `onValueChange`.
320
+ * Requires `configure({ modules: { datePicker: true } })`.
321
+ */
322
+ DatePicker: DatePickerProps;
323
+ /**
324
+ * Root of an SVG drawing. Web: `<svg>`. Native: `react-native-svg`.
325
+ * Requires `configure({ modules: { svg: true } })` (and, on iOS/Android, `react-native-svg` installed).
326
+ */
327
+ Svg: SvgProps;
328
+ /** SVG group (`<g>`): shares presentation and `transform` with its children. */
329
+ G: SvgElementProps<SVGGElement>;
330
+ /** SVG path (`<path d="…">`). */
331
+ Path: SvgElementProps<SVGPathElement>;
332
+ /** SVG circle (`<circle cx cy r>`). */
333
+ Circle: SvgElementProps<SVGCircleElement>;
334
+ /** SVG rectangle (`<rect x y width height rx>`). */
335
+ Rect: SvgElementProps<SVGRectElement>;
336
+ /** SVG ellipse (`<ellipse cx cy rx ry>`). */
337
+ Ellipse: SvgElementProps<SVGEllipseElement>;
338
+ /** SVG line (`<line x1 y1 x2 y2>`). */
339
+ Line: SvgElementProps<SVGLineElement>;
340
+ /** SVG open shape through `points` (`<polyline>`). */
341
+ Polyline: SvgElementProps<SVGPolylineElement>;
342
+ /** SVG closed shape through `points` (`<polygon>`). */
343
+ Polygon: SvgElementProps<SVGPolygonElement>;
344
+ /** A run of text inside `SvgText` (`<tspan>`). */
345
+ TSpan: SvgElementProps<SVGTSpanElement>;
346
+ /** Definitions referenced by `id` (gradients, clip paths, masks…), not drawn (`<defs>`). */
347
+ Defs: SvgElementProps<SVGDefsElement>;
348
+ /** A color stop of a gradient (`<stop offset stopColor>`). */
349
+ Stop: SvgElementProps<SVGStopElement>;
350
+ /** SVG text (`<text>`). */
351
+ SvgText: SvgElementProps<SVGTextElement>;
352
+ /** A picture inside the drawing (`<image href>`). */
353
+ SvgImage: SvgElementProps<SVGImageElement>;
354
+ /** Linear gradient, used with `fill="url(#id)"` (`<linearGradient>`). */
355
+ SvgLinearGradient: SvgElementProps<SVGLinearGradientElement>;
356
+ /** Radial gradient, used with `fill="url(#id)"` (`<radialGradient>`). */
357
+ SvgRadialGradient: SvgElementProps<SVGRadialGradientElement>;
358
+ /** Clipping shape, used with `clipPath="url(#id)"` (`<clipPath>`). */
359
+ SvgClipPath: SvgElementProps<SVGClipPathElement>;
360
+ /** Mask, used with `mask="url(#id)"` (`<mask>`). */
361
+ SvgMask: SvgElementProps<SVGMaskElement>;
362
+ /** Repeating fill, used with `fill="url(#id)"` (`<pattern>`). */
363
+ SvgPattern: SvgElementProps<SVGPatternElement>;
364
+ /** A reusable drawing, shown with `SvgUse` (`<symbol>`). */
365
+ SvgSymbol: SvgElementProps<SVGSymbolElement>;
366
+ /** Draws a `SvgSymbol` or another element by `href="#id"` (`<use>`). */
367
+ SvgUse: SvgElementProps<SVGUseElement>;
368
+ /** @deprecated Use `Box`. */
369
+ View: BoxProps;
370
+ /** @deprecated Use `Input`. */
371
+ TextInput: InputProps;
372
+ /** @deprecated Use `Scroll`. */
373
+ ScrollView: ScrollProps;
374
+ /** @deprecated Use `Pressable` (with `when('state:pressed', { style: { opacity } })`). */
375
+ TouchableOpacity: PressableProps & {
376
+ /** Opacity while pressed (0–1). */
377
+ activeOpacity?: number;
378
+ };
379
+ /** @deprecated Use `Pressable` (with `when('state:pressed', { style: { backgroundColor } })`). */
380
+ TouchableHighlight: PressableProps & {
381
+ /** Background color shown while pressed. */
382
+ underlayColor?: string;
383
+ };
384
+ /** @deprecated Use `Pressable`. */
385
+ TouchableWithoutFeedback: PressableProps;
386
+ /** On/off toggle (React Native `Switch`). @platform native */
387
+ Switch: NativeLoose;
388
+ /** Loading spinner (React Native `ActivityIndicator`). @platform native */
389
+ ActivityIndicator: NativeLoose;
390
+ /**
391
+ * Content over the whole app. With `modules.modal` on: the lib's own modal (a centered
392
+ * dialog or full screen, the same design on iOS, Android and the web). Off: React
393
+ * Native's `Modal` (native only).
394
+ */
395
+ Modal: ModalProps;
396
+ /** Controls the system status bar (React Native `StatusBar`). @platform native */
397
+ StatusBar: NativeLoose;
398
+ /** Moves its content out of the keyboard's way (React Native `KeyboardAvoidingView`). @platform native */
399
+ KeyboardAvoidingView: NativeLoose;
400
+ /** A container with a background image (React Native `ImageBackground`). @platform native */
401
+ ImageBackground: NativeLoose;
402
+ /** Keeps content inside the device's safe area (React Native `SafeAreaView`). @platform native */
403
+ SafeAreaView: NativeLoose;
404
+ /** Virtualized list for long data (React Native `FlatList`). @platform native */
405
+ FlatList: NativeLoose;
406
+ /** Virtualized list grouped in sections (React Native `SectionList`). @platform native */
407
+ SectionList: NativeLoose;
408
+ }
409
+ export {};
410
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=primitives.js.map
@@ -0,0 +1,2 @@
1
+ export declare function makeProxy<Component extends React.ComponentType<unknown>, Output extends object>(component: Component, builder: Output): Component;
2
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1,25 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ export function makeProxy(component, builder) {
3
+ const proxy = new Proxy(component, {
4
+ get(target, prop) {
5
+ if (prop in builder) {
6
+ const original = builder[prop];
7
+ if (typeof original === 'function') {
8
+ return (...args) => {
9
+ const result = original.apply(builder, args);
10
+ if (result === builder) {
11
+ return proxy;
12
+ }
13
+ if (result instanceof builder.constructor) {
14
+ return makeProxy(result.build(), result);
15
+ }
16
+ return proxy;
17
+ };
18
+ }
19
+ }
20
+ return target[prop];
21
+ },
22
+ });
23
+ return proxy;
24
+ }
25
+ //# sourceMappingURL=proxy.js.map
@@ -0,0 +1,95 @@
1
+ /**
2
+ * `BottomSheet`: a panel that slides up from the bottom edge.
3
+ * Web: a native `<dialog>` (top layer, focus trap, Escape) with the lib's drag and snapping.
4
+ * iOS: a SwiftUI sheet (`presentationDetents`, Liquid Glass on iOS 26).
5
+ * Android: a Jetpack Compose sheet with Material-style drag, snapping and scrim.
6
+ */
7
+ /**
8
+ * A height the sheet can rest at.
9
+ * - `'fit'`: the height of the content (up to the screen).
10
+ * - `'full'`: as tall as the platform allows.
11
+ * - a number: that height, in px (dp on Android, pt on iOS).
12
+ * - `'40%'`: that share of the screen height.
13
+ */
14
+ export type SheetDetent = 'fit' | 'full' | number | `${number}%`;
15
+ /** A user-visible change of the resting height. */
16
+ export interface SheetDetentChange {
17
+ /** Index in `detents` of the height the sheet now rests at. */
18
+ index: number;
19
+ }
20
+ /** Props of `BottomSheet` besides the common ones (`style`, `testID`…). */
21
+ export interface BottomSheetOwnProps {
22
+ /** Shown (`true`) or hidden (`false`). The sheet animates in both directions. */
23
+ open: boolean;
24
+ /**
25
+ * Called when the user closes the sheet (drag down, tap on the backdrop,
26
+ * Escape on the web, back button on Android). Set your `open` state to the value.
27
+ */
28
+ onOpenChange?: (open: boolean) => void;
29
+ /**
30
+ * Heights the sheet snaps to, from the smallest to the largest. Default `['fit']`.
31
+ * Examples: `['fit']`, `['50%', 'full']`, `[240, '90%']`.
32
+ */
33
+ detents?: SheetDetent[];
34
+ /** Index in `detents` to show when it opens (and to move to while open). Default `0`. */
35
+ detent?: number;
36
+ /** Called when the sheet moves to another detent: dragged by the user or moved with `snapTo`. */
37
+ onDetentChange?: (change: SheetDetentChange) => void;
38
+ /** Whether the user can close it (drag down, backdrop, Escape, back button). Default `true`. */
39
+ dismissible?: boolean;
40
+ /**
41
+ * `true` (default): a dimmed backdrop blocks the screen behind.
42
+ * `false`: no backdrop; the screen behind stays usable (like Maps).
43
+ */
44
+ modal?: boolean;
45
+ /** Shows the small handle on top. Default `true`. */
46
+ grabber?: boolean;
47
+ /** Called after the closing animation ends (the content is then unmounted). */
48
+ onClosed?: () => void;
49
+ /** Accessible name of the sheet (`aria-label` on the web). */
50
+ label?: string;
51
+ /** The content. */
52
+ children?: unknown;
53
+ }
54
+ /** `ref` of a `BottomSheet`. */
55
+ export interface BottomSheetHandle {
56
+ /** Moves to the detent at `index` (while open). Triggers `onDetentChange`. */
57
+ snapTo(index: number): void;
58
+ }
59
+ /** A detent turned into a concrete height. */
60
+ export interface ResolvedDetent {
61
+ /** Height in px/dp/pt. */
62
+ height: number;
63
+ /** Whether it follows the content (`'fit'`). */
64
+ fit: boolean;
65
+ }
66
+ /** Default rest heights. */
67
+ export declare const DEFAULT_DETENTS: SheetDetent[];
68
+ /** How far below the top the tallest sheet stops, so the screen behind still shows (px). */
69
+ export declare const SHEET_TOP_GAP = 48;
70
+ /**
71
+ * Height of one detent.
72
+ * @param detent The detent.
73
+ * @param screen Height available to the sheet (screen minus the top gap).
74
+ * @param content Natural height of the content (`0` while unknown).
75
+ */
76
+ export declare function detentHeight(detent: SheetDetent, screen: number, content: number): number;
77
+ /**
78
+ * The detents as heights, clamped to the screen, smallest first, without duplicates.
79
+ * The order of `detents` is kept for the returned indexes (callers map back with `source`).
80
+ */
81
+ export declare function resolveDetents(detents: SheetDetent[] | undefined, screen: number, content: number): Array<ResolvedDetent & {
82
+ source: number;
83
+ }>;
84
+ /**
85
+ * Detent the sheet should rest at after a drag: the nearest one, or the next one
86
+ * in the fling's direction when the release is fast.
87
+ * @param heights Rest heights, ascending.
88
+ * @param current Height when released.
89
+ * @param velocity Upward speed in px/s (negative = moving down).
90
+ * @returns The index into `heights`, or `-1` to close.
91
+ */
92
+ export declare function settleDetent(heights: number[], current: number, velocity: number, dismissible: boolean): number;
93
+ /** Encodes the detents for the native views: `fit`, `full`, `50%` or a number of points. */
94
+ export declare const encodeDetents: (detents: SheetDetent[] | undefined) => string[];
95
+ //# sourceMappingURL=sheet.d.ts.map
@@ -0,0 +1,71 @@
1
+ /**
2
+ * `BottomSheet`: a panel that slides up from the bottom edge.
3
+ * Web: a native `<dialog>` (top layer, focus trap, Escape) with the lib's drag and snapping.
4
+ * iOS: a SwiftUI sheet (`presentationDetents`, Liquid Glass on iOS 26).
5
+ * Android: a Jetpack Compose sheet with Material-style drag, snapping and scrim.
6
+ */
7
+ /** Default rest heights. */
8
+ export const DEFAULT_DETENTS = ['fit'];
9
+ /** How far below the top the tallest sheet stops, so the screen behind still shows (px). */
10
+ export const SHEET_TOP_GAP = 48;
11
+ const PERCENT = /^(\d+(?:\.\d+)?)%$/;
12
+ /**
13
+ * Height of one detent.
14
+ * @param detent The detent.
15
+ * @param screen Height available to the sheet (screen minus the top gap).
16
+ * @param content Natural height of the content (`0` while unknown).
17
+ */
18
+ export function detentHeight(detent, screen, content) {
19
+ if (typeof detent === 'number')
20
+ return detent;
21
+ if (detent === 'full')
22
+ return screen;
23
+ if (detent === 'fit')
24
+ return content > 0 ? content : screen / 2;
25
+ const match = PERCENT.exec(detent);
26
+ return match ? (screen * Number(match[1])) / 100 : screen;
27
+ }
28
+ /**
29
+ * The detents as heights, clamped to the screen, smallest first, without duplicates.
30
+ * The order of `detents` is kept for the returned indexes (callers map back with `source`).
31
+ */
32
+ export function resolveDetents(detents, screen, content) {
33
+ const list = detents?.length ? detents : DEFAULT_DETENTS;
34
+ return list
35
+ .map((detent, source) => ({
36
+ height: Math.round(Math.min(Math.max(detentHeight(detent, screen, content), 0), screen)),
37
+ fit: detent === 'fit',
38
+ source,
39
+ }))
40
+ .sort((a, b) => a.height - b.height);
41
+ }
42
+ /**
43
+ * Detent the sheet should rest at after a drag: the nearest one, or the next one
44
+ * in the fling's direction when the release is fast.
45
+ * @param heights Rest heights, ascending.
46
+ * @param current Height when released.
47
+ * @param velocity Upward speed in px/s (negative = moving down).
48
+ * @returns The index into `heights`, or `-1` to close.
49
+ */
50
+ export function settleDetent(heights, current, velocity, dismissible) {
51
+ const FLING = 600;
52
+ if (velocity <= -FLING) {
53
+ let below = -1;
54
+ heights.forEach((h, i) => {
55
+ if (h < current - 1)
56
+ below = i;
57
+ });
58
+ return below >= 0 ? below : dismissible ? -1 : 0;
59
+ }
60
+ if (velocity >= FLING) {
61
+ const above = heights.findIndex((h) => h > current + 1);
62
+ return above >= 0 ? above : heights.length - 1;
63
+ }
64
+ // slow release: the closest rest height (closing counts as height 0)
65
+ const options = dismissible ? [0, ...heights] : heights;
66
+ const nearest = options.reduce((best, h, i) => (Math.abs(h - current) < Math.abs(options[best] - current) ? i : best), 0);
67
+ return dismissible ? nearest - 1 : nearest;
68
+ }
69
+ /** Encodes the detents for the native views: `fit`, `full`, `50%` or a number of points. */
70
+ export const encodeDetents = (detents) => (detents?.length ? detents : DEFAULT_DETENTS).map(String);
71
+ //# sourceMappingURL=sheet.js.map