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,88 @@
1
+ import type { CSSProperties } from 'react';
2
+ /** A length: a number (px on the web, dp on native) or a CSS string (`'1rem'`, `'50%'`). */
3
+ type Length = number | string;
4
+ /**
5
+ * One item of a React Native-style `transform` array, e.g. `{ translateX: 10 }`
6
+ * or `{ rotate: '45deg' }`. The CSS string form (`'translateX(10px) rotate(45deg)'`)
7
+ * is also accepted by `transform`.
8
+ */
9
+ export type TransformItem = Record<string, number | string | undefined>;
10
+ /**
11
+ * React Native style aliases. They work on both platforms, but exist only for
12
+ * compatibility: prefer the standard CSS name given in each description.
13
+ */
14
+ export interface LegacyRNStyle {
15
+ /** Left and right padding. @deprecated Use `paddingInline`. */
16
+ paddingHorizontal?: Length;
17
+ /** Top and bottom padding. @deprecated Use `paddingBlock`. */
18
+ paddingVertical?: Length;
19
+ /** Left and right margin. @deprecated Use `marginInline`. */
20
+ marginHorizontal?: Length;
21
+ /** Top and bottom margin. @deprecated Use `marginBlock`. */
22
+ marginVertical?: Length;
23
+ /** Shadow color. @deprecated Use `boxShadow` (e.g. `'0 4px 10px rgba(0,0,0,.1)'`). */
24
+ shadowColor?: string;
25
+ /** Shadow offset. @deprecated Use `boxShadow`. */
26
+ shadowOffset?: {
27
+ /** Horizontal offset, in px. */
28
+ width: number;
29
+ /** Vertical offset, in px. */
30
+ height: number;
31
+ };
32
+ /** Shadow opacity, from `0` to `1`. @deprecated Use `boxShadow`. */
33
+ shadowOpacity?: number;
34
+ /** Shadow blur radius, in px. @deprecated Use `boxShadow`. */
35
+ shadowRadius?: number;
36
+ /** Android shadow depth. @deprecated Use `boxShadow` (still applied on Android). */
37
+ elevation?: number;
38
+ /**
39
+ * How an image fits its box. @deprecated Use `objectFit`.
40
+ * - `'cover'`: fills the box, cropping the overflow.
41
+ * - `'contain'`: fits inside the box, keeping the whole image visible.
42
+ * - `'stretch'`: fills the box, distorting the image.
43
+ * - `'center'`: centered at its natural size (scaled down if needed).
44
+ */
45
+ resizeMode?: 'cover' | 'contain' | 'stretch' | 'center';
46
+ /** Recolors a monochrome image (icons) with this color. @platform native — ignored on the web. */
47
+ tintColor?: string;
48
+ /**
49
+ * Vertical alignment of the text inside a multiline input.
50
+ * @platform native — ignored on the web (Android only on native).
51
+ * - `'auto'`: platform default.
52
+ * - `'top'`: at the top.
53
+ * - `'bottom'`: at the bottom.
54
+ * - `'center'`: in the middle.
55
+ */
56
+ textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center';
57
+ /** Adds the font's extra top/bottom padding to the text (Android default `true`). @platform native — ignored on the web. */
58
+ includeFontPadding?: boolean;
59
+ }
60
+ /**
61
+ * CSS custom properties (`'--brand-color': '#0af'`).
62
+ * @platform web — ignored on native.
63
+ */
64
+ interface CssVariables {
65
+ [key: `--${string}`]: string | number | undefined;
66
+ }
67
+ /**
68
+ * The universal isoform style: **full CSS** (`React.CSSProperties`) plus the
69
+ * legacy React Native aliases ({@link LegacyRNStyle}).
70
+ *
71
+ * - A number is a length in px (dp on native), except for unitless properties
72
+ * (`opacity`, `flex`, `zIndex`, `fontWeight`, `aspectRatio`…).
73
+ * - A string is a CSS value (`'1rem'`, `'50%'`, `'calc(100% - 8px)'`), used as-is on
74
+ * the web and converted on native when possible (unsupported values are dropped
75
+ * with a development warning).
76
+ */
77
+ export type IsoStyle = Omit<CSSProperties, 'transform'> & LegacyRNStyle & CssVariables & {
78
+ /** Transformations: a CSS string (`'translateX(10px) rotate(45deg)'`) or a React Native array of {@link TransformItem}. */
79
+ transform?: CSSProperties['transform'] | TransformItem[];
80
+ };
81
+ /**
82
+ * What the `style` prop of any component accepts: a style object, a falsy value
83
+ * (ignored, handy for `cond && style`) or a (nested) array of those, merged in
84
+ * order (last wins).
85
+ */
86
+ export type StyleInput = IsoStyle | false | null | undefined | readonly StyleInput[];
87
+ export {};
88
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,121 @@
1
+ /**
2
+ * SVG primitives: `engine('Svg')`, `engine('Path')`… Web: the browser's own SVG
3
+ * elements. iOS and Android: `react-native-svg`. Names that clash with other
4
+ * primitives or common libraries (`Text`, `Image`, `LinearGradient`, `Symbol`…)
5
+ * carry the `Svg` prefix.
6
+ */
7
+ /** One SVG primitive: the `react-native-svg` export and the DOM tag behind it. */
8
+ export interface SvgElement {
9
+ /** Export of `react-native-svg` (`'Path'`, `'LinearGradient'`…). */
10
+ native: string;
11
+ /** SVG tag on the web (`'path'`, `'linearGradient'`…). */
12
+ dom: string;
13
+ }
14
+ /** Every SVG primitive, by its isoform name. */
15
+ export declare const SVG_ELEMENTS: {
16
+ readonly Svg: {
17
+ readonly native: "Svg";
18
+ readonly dom: "svg";
19
+ };
20
+ readonly G: {
21
+ readonly native: "G";
22
+ readonly dom: "g";
23
+ };
24
+ readonly Path: {
25
+ readonly native: "Path";
26
+ readonly dom: "path";
27
+ };
28
+ readonly Circle: {
29
+ readonly native: "Circle";
30
+ readonly dom: "circle";
31
+ };
32
+ readonly Rect: {
33
+ readonly native: "Rect";
34
+ readonly dom: "rect";
35
+ };
36
+ readonly Ellipse: {
37
+ readonly native: "Ellipse";
38
+ readonly dom: "ellipse";
39
+ };
40
+ readonly Line: {
41
+ readonly native: "Line";
42
+ readonly dom: "line";
43
+ };
44
+ readonly Polyline: {
45
+ readonly native: "Polyline";
46
+ readonly dom: "polyline";
47
+ };
48
+ readonly Polygon: {
49
+ readonly native: "Polygon";
50
+ readonly dom: "polygon";
51
+ };
52
+ readonly TSpan: {
53
+ readonly native: "TSpan";
54
+ readonly dom: "tspan";
55
+ };
56
+ readonly Defs: {
57
+ readonly native: "Defs";
58
+ readonly dom: "defs";
59
+ };
60
+ readonly Stop: {
61
+ readonly native: "Stop";
62
+ readonly dom: "stop";
63
+ };
64
+ readonly SvgText: {
65
+ readonly native: "Text";
66
+ readonly dom: "text";
67
+ };
68
+ readonly SvgImage: {
69
+ readonly native: "Image";
70
+ readonly dom: "image";
71
+ };
72
+ readonly SvgLinearGradient: {
73
+ readonly native: "LinearGradient";
74
+ readonly dom: "linearGradient";
75
+ };
76
+ readonly SvgRadialGradient: {
77
+ readonly native: "RadialGradient";
78
+ readonly dom: "radialGradient";
79
+ };
80
+ readonly SvgClipPath: {
81
+ readonly native: "ClipPath";
82
+ readonly dom: "clipPath";
83
+ };
84
+ readonly SvgMask: {
85
+ readonly native: "Mask";
86
+ readonly dom: "mask";
87
+ };
88
+ readonly SvgPattern: {
89
+ readonly native: "Pattern";
90
+ readonly dom: "pattern";
91
+ };
92
+ readonly SvgSymbol: {
93
+ readonly native: "Symbol";
94
+ readonly dom: "symbol";
95
+ };
96
+ readonly SvgUse: {
97
+ readonly native: "Use";
98
+ readonly dom: "use";
99
+ };
100
+ };
101
+ /** Name of an SVG primitive (`'Svg'`, `'Path'`, `'SvgLinearGradient'`…). */
102
+ export type SvgElementName = keyof typeof SVG_ELEMENTS;
103
+ /** SVG presentation properties: CSS on the web, props of the element on native. */
104
+ export declare const SVG_PRESENTATION: Set<string>;
105
+ /** A flat style split into the native element's props and what stays in `style`. */
106
+ export interface SvgStyleSplit {
107
+ /** Presentation props (`fill`, `stroke`…), applied to the element. */
108
+ props: Record<string, unknown>;
109
+ /** The rest: layout of the `<Svg>` box (only the root keeps a style). */
110
+ style: Record<string, unknown>;
111
+ }
112
+ /**
113
+ * Native: moves the style into the element's props, as the web's CSS would apply it.
114
+ * The root `Svg` keeps its box style (size, margin, background…) and passes the
115
+ * presentation keys down as props, so the shapes inherit them. A shape has no box:
116
+ * every key of its style becomes a prop (`fill`, `opacity`, `transform`…).
117
+ * @param style The flattened style.
118
+ * @param root Whether the element is the root `Svg`.
119
+ */
120
+ export declare function splitSvgStyle(style: Record<string, unknown>, root: boolean): SvgStyleSplit;
121
+ //# sourceMappingURL=svg.d.ts.map
@@ -0,0 +1,76 @@
1
+ /**
2
+ * SVG primitives: `engine('Svg')`, `engine('Path')`… Web: the browser's own SVG
3
+ * elements. iOS and Android: `react-native-svg`. Names that clash with other
4
+ * primitives or common libraries (`Text`, `Image`, `LinearGradient`, `Symbol`…)
5
+ * carry the `Svg` prefix.
6
+ */
7
+ /** Every SVG primitive, by its isoform name. */
8
+ export const SVG_ELEMENTS = {
9
+ Svg: { native: 'Svg', dom: 'svg' },
10
+ G: { native: 'G', dom: 'g' },
11
+ Path: { native: 'Path', dom: 'path' },
12
+ Circle: { native: 'Circle', dom: 'circle' },
13
+ Rect: { native: 'Rect', dom: 'rect' },
14
+ Ellipse: { native: 'Ellipse', dom: 'ellipse' },
15
+ Line: { native: 'Line', dom: 'line' },
16
+ Polyline: { native: 'Polyline', dom: 'polyline' },
17
+ Polygon: { native: 'Polygon', dom: 'polygon' },
18
+ TSpan: { native: 'TSpan', dom: 'tspan' },
19
+ Defs: { native: 'Defs', dom: 'defs' },
20
+ Stop: { native: 'Stop', dom: 'stop' },
21
+ SvgText: { native: 'Text', dom: 'text' },
22
+ SvgImage: { native: 'Image', dom: 'image' },
23
+ SvgLinearGradient: { native: 'LinearGradient', dom: 'linearGradient' },
24
+ SvgRadialGradient: { native: 'RadialGradient', dom: 'radialGradient' },
25
+ SvgClipPath: { native: 'ClipPath', dom: 'clipPath' },
26
+ SvgMask: { native: 'Mask', dom: 'mask' },
27
+ SvgPattern: { native: 'Pattern', dom: 'pattern' },
28
+ SvgSymbol: { native: 'Symbol', dom: 'symbol' },
29
+ SvgUse: { native: 'Use', dom: 'use' },
30
+ };
31
+ /** SVG presentation properties: CSS on the web, props of the element on native. */
32
+ export const SVG_PRESENTATION = new Set([
33
+ 'color',
34
+ 'fill',
35
+ 'fillOpacity',
36
+ 'fillRule',
37
+ 'stroke',
38
+ 'strokeWidth',
39
+ 'strokeOpacity',
40
+ 'strokeLinecap',
41
+ 'strokeLinejoin',
42
+ 'strokeDasharray',
43
+ 'strokeDashoffset',
44
+ 'strokeMiterlimit',
45
+ 'stopColor',
46
+ 'stopOpacity',
47
+ 'clipRule',
48
+ 'vectorEffect',
49
+ 'fontSize',
50
+ 'fontFamily',
51
+ 'fontWeight',
52
+ 'fontStyle',
53
+ 'letterSpacing',
54
+ 'textAnchor',
55
+ ]);
56
+ /** `'2px'` → `2` (react-native-svg wants plain numbers); anything else unchanged. */
57
+ const PX = /^-?\d*\.?\d+px$/;
58
+ const plain = (value) => (typeof value === 'string' && PX.test(value) ? parseFloat(value) : value);
59
+ /**
60
+ * Native: moves the style into the element's props, as the web's CSS would apply it.
61
+ * The root `Svg` keeps its box style (size, margin, background…) and passes the
62
+ * presentation keys down as props, so the shapes inherit them. A shape has no box:
63
+ * every key of its style becomes a prop (`fill`, `opacity`, `transform`…).
64
+ * @param style The flattened style.
65
+ * @param root Whether the element is the root `Svg`.
66
+ */
67
+ export function splitSvgStyle(style, root) {
68
+ const props = {};
69
+ const rest = {};
70
+ for (const key of Object.keys(style)) {
71
+ const target = !root || SVG_PRESENTATION.has(key) ? props : rest;
72
+ target[key] = target === props ? plain(style[key]) : style[key];
73
+ }
74
+ return { props, style: rest };
75
+ }
76
+ //# sourceMappingURL=svg.js.map
@@ -0,0 +1,42 @@
1
+ /** Statistics for one variant, in milliseconds per call of the measured function. */
2
+ export interface Stats {
3
+ /** Median of the samples. The number to compare: robust to GC pauses and JIT noise. */
4
+ median: number;
5
+ /** Fastest sample: the lower bound once the noise is gone. */
6
+ min: number;
7
+ /** 90th percentile: how bad the slow samples get. */
8
+ p90: number;
9
+ }
10
+ export interface CompareOptions {
11
+ /** Calls of each variant inside one timed sample. */
12
+ iterations: number;
13
+ /** Number of timed samples per variant. Default 15. */
14
+ samples?: number;
15
+ /** Untimed calls per variant before sampling (lets the JIT settle). Default `iterations`. */
16
+ warmup?: number;
17
+ }
18
+ /**
19
+ * Times several variants against each other.
20
+ *
21
+ * The variants run **round-robin, starting at a different one each round**, so JIT warm-up,
22
+ * GC and CPU throttling hit all of them equally instead of penalising whichever ran first.
23
+ * That was the flaw of the previous benchmark: a plain component (no builder at all) swung
24
+ * between 40 ms and 82 ms purely by run order, which hid any real difference.
25
+ */
26
+ export declare function compare(variants: Record<string, () => void>, options: CompareOptions): Record<string, Stats>;
27
+ export interface Row {
28
+ label: string;
29
+ stats: Stats;
30
+ /** Extra deterministic counters (compiles, renders…), printed beside the timing. */
31
+ counters?: Record<string, number>;
32
+ }
33
+ /** Prints a table. `control` is subtracted so the numbers show the cost the library adds. */
34
+ export declare function report(title: string, rows: Row[], options?: {
35
+ control?: string;
36
+ controls?: Record<string, string>;
37
+ per?: number;
38
+ unit?: string;
39
+ }): void;
40
+ /** Writes everything reported so far to `$BENCH_OUT/<name>.json` (a CI artifact), when `BENCH_OUT` is set. */
41
+ export declare function flushResults(name: string): void;
42
+ //# sourceMappingURL=benchHarness.d.ts.map
@@ -0,0 +1,75 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ const percentile = (sorted, p) => sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * p))];
4
+ /**
5
+ * Times several variants against each other.
6
+ *
7
+ * The variants run **round-robin, starting at a different one each round**, so JIT warm-up,
8
+ * GC and CPU throttling hit all of them equally instead of penalising whichever ran first.
9
+ * That was the flaw of the previous benchmark: a plain component (no builder at all) swung
10
+ * between 40 ms and 82 ms purely by run order, which hid any real difference.
11
+ */
12
+ export function compare(variants, options) {
13
+ const { iterations, samples = 15, warmup = iterations } = options;
14
+ const names = Object.keys(variants);
15
+ const timings = Object.fromEntries(names.map((n) => [n, []]));
16
+ for (const name of names)
17
+ for (let i = 0; i < warmup; i++)
18
+ variants[name]();
19
+ for (let s = 0; s < samples; s++) {
20
+ for (let k = 0; k < names.length; k++) {
21
+ const name = names[(s + k) % names.length];
22
+ const fn = variants[name];
23
+ const start = process.hrtime.bigint();
24
+ for (let i = 0; i < iterations; i++)
25
+ fn();
26
+ timings[name].push(Number(process.hrtime.bigint() - start) / 1e6 / iterations);
27
+ }
28
+ }
29
+ const out = {};
30
+ for (const name of names) {
31
+ const sorted = [...timings[name]].sort((a, b) => a - b);
32
+ out[name] = { median: percentile(sorted, 0.5), min: sorted[0], p90: percentile(sorted, 0.9) };
33
+ }
34
+ return out;
35
+ }
36
+ const results = {};
37
+ /** Prints a table. `control` is subtracted so the numbers show the cost the library adds. */
38
+ export function report(title, rows, options = {}) {
39
+ const { control, controls = {}, per = 1, unit = 'ms' } = options;
40
+ const medianOf = (label) => (label ? rows.find((r) => r.label === label)?.stats.median ?? 0 : 0);
41
+ /** A row is compared with its own control when it has one (same props, no library), else the shared one. */
42
+ const controlOf = (label) => controls[label] ?? control;
43
+ console.log(`\n[bench] ${title}`);
44
+ for (const row of rows) {
45
+ const base = medianOf(controlOf(row.label));
46
+ const own = row.stats.median - base;
47
+ const scale = unit === 'µs' ? 1000 : 1;
48
+ const parts = [
49
+ `${(row.stats.median).toFixed(3)} ms/iter (min ${row.stats.min.toFixed(3)}, p90 ${row.stats.p90.toFixed(3)})`,
50
+ ];
51
+ const isControl = row.label === control || Object.values(controls).includes(row.label);
52
+ if (controlOf(row.label) && !isControl)
53
+ parts.push(`+${((own * scale) / per).toFixed(2)} ${unit}/item over control`);
54
+ if (row.counters)
55
+ parts.push(Object.entries(row.counters).map(([k, v]) => `${k}=${v}`).join(' '));
56
+ console.log(`[bench] ${row.label.padEnd(34)} ${parts.join(' | ')}`);
57
+ }
58
+ results[title] = rows.map((r) => ({
59
+ label: r.label,
60
+ medianMs: r.stats.median,
61
+ minMs: r.stats.min,
62
+ p90Ms: r.stats.p90,
63
+ overControlMs: controlOf(r.label) && !(r.label === control || Object.values(controls).includes(r.label)) ? r.stats.median - medianOf(controlOf(r.label)) : undefined,
64
+ counters: r.counters,
65
+ }));
66
+ }
67
+ /** Writes everything reported so far to `$BENCH_OUT/<name>.json` (a CI artifact), when `BENCH_OUT` is set. */
68
+ export function flushResults(name) {
69
+ const dir = process.env.BENCH_OUT;
70
+ if (!dir)
71
+ return;
72
+ fs.mkdirSync(dir, { recursive: true });
73
+ fs.writeFileSync(path.join(dir, `${name}.json`), JSON.stringify(results, null, 2));
74
+ }
75
+ //# sourceMappingURL=benchHarness.js.map
@@ -0,0 +1,222 @@
1
+ import type { ComponentPropsWithRef, ComponentType, ForwardRefExoticComponent } from 'react';
2
+ import type { IsoStyle } from './style/types';
3
+ /**
4
+ * Platform names.
5
+ * - `'ios'`: iOS.
6
+ * - `'android'`: Android.
7
+ * - `'web'`: the web (React DOM).
8
+ * - `'native'`: any platform that is not the web (iOS and Android).
9
+ */
10
+ export type Platform = 'ios' | 'android' | 'web' | 'native';
11
+ /**
12
+ * Platform condition for `when()`: `'platform:ios'`, `'platform:android'`,
13
+ * `'platform:web'` or `'platform:native'` (iOS and Android).
14
+ */
15
+ export type PlatformCondition = `platform:${Platform}`;
16
+ /** Context passed to style functions and condition functions. */
17
+ export interface BaseStyleContext<P> {
18
+ /** The active theme (`EngineTheme`), as set by `configure({ theme })` / `updateTheme`. */
19
+ theme: EngineTheme;
20
+ /** The props the component was rendered with (including the custom ones declared in `engine<…, P>`). */
21
+ props: P;
22
+ /** The current platform (`'ios' | 'android' | 'web'`, or a custom adapter name). May be absent before resolution. */
23
+ platform?: string;
24
+ }
25
+ /** Same as {@link BaseStyleContext}, but the platform is always resolved. */
26
+ export interface StyleContext<P> extends BaseStyleContext<P> {
27
+ /** The current platform (`'ios' | 'android' | 'web'`, or a custom adapter name). */
28
+ platform: string;
29
+ }
30
+ /**
31
+ * Prop conditions for `when()`, derived from the component's custom props `P`:
32
+ * - boolean prop `disabled` → `'props:disabled'` (when `true`), `'props:disabled=true'`, `'props:disabled=false'`;
33
+ * - string/number prop `variant: 'primary' | 'ghost'` → `'props:variant'` (when truthy),
34
+ * `'props:variant=primary'`, `'props:variant=ghost'`.
35
+ * Props of other types (objects, functions) produce no condition.
36
+ */
37
+ export type PropConditionKeys<P> = P extends Record<string, any> ? {
38
+ [K in keyof P]-?: NonNullable<P[K]> extends string | number | boolean ? NonNullable<P[K]> extends boolean ? `props:${string & K}` | `props:${string & K}=true` | `props:${string & K}=false` : `props:${string & K}` | `props:${string & K}=${NonNullable<P[K]> extends string | number ? NonNullable<P[K]> : never}` : never;
39
+ }[keyof P] : never;
40
+ /**
41
+ * Interaction state names. They are not evaluated booleans: the style inside
42
+ * `when('state:hover', …)` is compiled as a variant (a CSS pseudo-class on the
43
+ * web, component state on native).
44
+ * - `'hover'`: pointer over the element (see {@link HoverState}).
45
+ * - `'focus'`: the element has focus. Native: only for `Input`.
46
+ * - `'focus-visible'`: focus that came from the keyboard (web); on native, same as `'focus'`.
47
+ * - `'pressed'`: while being pressed (`:active` on the web). Native: only for `Pressable`.
48
+ */
49
+ export type StateName = HoverState | 'focus' | 'focus-visible' | 'pressed';
50
+ /**
51
+ * Pointer hover state.
52
+ * @platform web — touch screens have no hover, so it is ignored on native.
53
+ */
54
+ export type HoverState = 'hover';
55
+ /**
56
+ * State condition for `when()`: `'state:hover'`, `'state:focus'`,
57
+ * `'state:focus-visible'` or `'state:pressed'`. Accepts only `{ style }`.
58
+ */
59
+ export type StateCondition = `state:${StateName}`;
60
+ /**
61
+ * Pseudo-elements that work on BOTH platforms (`when('::before', { style })`).
62
+ * - `'::before'`: content before the element. Web: CSS. Native: a generated child
63
+ * (`Text` when `content` is set, otherwise a `View`).
64
+ * - `'::after'`: content after the element (same rules as `'::before'`).
65
+ * - `'::placeholder'`: an `Input`'s placeholder. Native: becomes `placeholderTextColor` (uses `color`).
66
+ * - `'::selection'`: selected text. Native: becomes the `Input`'s `selectionColor` (uses `backgroundColor`).
67
+ * - `'::first-letter'`: the first letter of a text. Native: only for a `Text` with plain-string children.
68
+ */
69
+ export type UniversalPseudoName = '::before' | '::after' | '::placeholder' | '::selection' | '::first-letter';
70
+ /**
71
+ * Pseudo-elements that only exist on the web.
72
+ * @platform web — ignored on native (with a development warning).
73
+ * - `'::first-line'`: the first line of a text block.
74
+ * - `'::marker'`: the bullet/number of a list item.
75
+ * - `'::scrollbar'`: the whole scrollbar (`::-webkit-scrollbar`: Chrome, Edge, Safari).
76
+ * - `'::scrollbar-thumb'`: the draggable part of the scrollbar.
77
+ * - `'::scrollbar-track'`: the scrollbar's background track.
78
+ */
79
+ export type WebOnlyPseudoName = '::first-line' | '::marker' | '::scrollbar' | '::scrollbar-thumb' | '::scrollbar-track';
80
+ /** Any pseudo-element accepted by `when()`: {@link UniversalPseudoName} or {@link WebOnlyPseudoName}. */
81
+ export type PseudoName = UniversalPseudoName | WebOnlyPseudoName;
82
+ /**
83
+ * Breakpoint names usable in `when()`. Mobile-first: `when('breakpoints:md', …)` applies
84
+ * from the `md` width **and up** (like a CSS `@media (min-width: …)`).
85
+ *
86
+ * Only the keys matter here (the `unknown` values are placeholders); the actual
87
+ * widths come from `configure({ breakpoints })`, which defaults to
88
+ * `{ sm: 480, md: 768, lg: 1024, xl: 1280 }`.
89
+ *
90
+ * Web: compiled to `@media` rules. Native: re-evaluated with `useWindowDimensions`.
91
+ *
92
+ * To type your own names, augment this interface (and set the widths in `configure`):
93
+ * ```ts
94
+ * declare module 'react-isoform' {
95
+ * interface IsoBreakpointNames { tablet: unknown }
96
+ * }
97
+ * configure({ breakpoints: { tablet: 600 } });
98
+ * ```
99
+ */
100
+ export interface IsoBreakpointNames {
101
+ /** Small: large phones and up (default `480px`). */
102
+ sm: unknown;
103
+ /** Medium: tablets in portrait and up (default `768px`). */
104
+ md: unknown;
105
+ /** Large: tablets in landscape, small laptops and up (default `1024px`). */
106
+ lg: unknown;
107
+ /** Extra large: desktops and wide screens (default `1280px`). */
108
+ xl: unknown;
109
+ }
110
+ /** A configured breakpoint name (`'sm' | 'md' | 'lg' | 'xl'` plus any augmented ones). */
111
+ export type BreakpointName = Extract<keyof IsoBreakpointNames, string>;
112
+ /**
113
+ * Breakpoint condition for `when()`: `'breakpoints:md'` applies from `md` and up.
114
+ * Accepts only `{ style }`. See {@link BreakpointRangeCondition} for ranges.
115
+ */
116
+ export type BreakpointCondition = `breakpoints:${BreakpointName}`;
117
+ /**
118
+ * The valid (ascending) ranges between the default breakpoints. Only these are
119
+ * suggested, so autocomplete never offers an invalid one such as `'lg..sm'`.
120
+ * - `'sm..md'`: from 480px up to (not including) 768px.
121
+ * - `'sm..lg'`: from 480px up to (not including) 1024px.
122
+ * - `'sm..xl'`: from 480px up to (not including) 1280px.
123
+ * - `'md..lg'`: from 768px up to (not including) 1024px.
124
+ * - `'md..xl'`: from 768px up to (not including) 1280px.
125
+ * - `'lg..xl'`: from 1024px up to (not including) 1280px.
126
+ */
127
+ export type DefaultBreakpointRange = 'sm..md' | 'sm..lg' | 'sm..xl' | 'md..lg' | 'md..xl' | 'lg..xl';
128
+ /**
129
+ * Breakpoint range conditions for `when()`:
130
+ * - `'breakpoints:<md'`: below `md` (from 0 up to, but not including, `md`);
131
+ * - `'breakpoints:md..lg'`: from `md` up to, but not including, `lg` (the first must be the smaller one).
132
+ *
133
+ * Autocomplete suggests `<name` for every breakpoint and the valid ranges between
134
+ * the defaults ({@link DefaultBreakpointRange}). Ranges with your own names
135
+ * (`'breakpoints:tablet..desktop'`) are accepted too, they are just not suggested.
136
+ */
137
+ export type BreakpointRangeCondition = `breakpoints:<${BreakpointName}` | `breakpoints:${DefaultBreakpointRange}`;
138
+ /**
139
+ * Every string condition suggested by `when()`. Each kind has its own prefix,
140
+ * so a condition always reads unambiguously:
141
+ * - {@link PlatformCondition}: `'platform:ios'`, `'platform:web'`, `'platform:native'`…;
142
+ * - {@link StateCondition}: `'state:hover'`, `'state:pressed'`…;
143
+ * - {@link BreakpointCondition}: `'breakpoints:md'`;
144
+ * - {@link BreakpointRangeCondition}: `'breakpoints:<md'`, `'breakpoints:md..lg'`;
145
+ * - {@link PropConditionKeys}: `'props:disabled'`, `'props:variant=primary'`…;
146
+ * - {@link PseudoName}: `'::before'`, `'::placeholder'`… (the CSS syntax).
147
+ */
148
+ export type ConditionString<P> = PlatformCondition | StateCondition | BreakpointCondition | BreakpointRangeCondition | PropConditionKeys<P> | PseudoName;
149
+ /** A condition computed at render time: return `true` to apply the rule. */
150
+ export type ConditionFn<Ctx> = (ctx: Ctx) => boolean;
151
+ /**
152
+ * Anything `when()` accepts as its first argument:
153
+ * - a {@link ConditionString} (platform, state, pseudo-element, breakpoint or prop);
154
+ * - a {@link ConditionFn} `(ctx) => boolean`;
155
+ * - a plain `boolean` (`true` always applies, `false` never does);
156
+ * - any other string: ranges with your own breakpoint names (`'breakpoints:tablet..desktop'`); unknown conditions warn in development.
157
+ */
158
+ export type Condition<P, Ctx = BaseStyleContext<P>> = ConditionString<P> | ConditionFn<Ctx> | boolean | (string & NonNullable<unknown>);
159
+ /** The `style` prop type of component `C` (without style functions such as `Pressable`'s `({ pressed }) => …`). */
160
+ export type ExtractStyle<C extends ComponentType<any>> = ComponentPropsWithRef<C> extends {
161
+ style?: infer S;
162
+ } ? Exclude<S, (...args: any[]) => any> : never;
163
+ /** The style type accepted by component `C`; falls back to {@link IsoStyle} when it cannot be inferred. */
164
+ export type ComponentStyle<C extends ComponentType<any>> = [ExtractStyle<C>] extends [never] ? IsoStyle : ExtractStyle<C>;
165
+ /** A static style for component `C` (an object, or anything its `style` prop accepts). */
166
+ export type StyleObject<C extends ComponentType<any>> = ComponentStyle<C>;
167
+ /**
168
+ * What a style function returns: only the OBJECT form of the style (no arrays,
169
+ * `false` or `null`). Returning a union with those types would make TypeScript
170
+ * widen literals (`flexDirection: 'row'` would become `string`).
171
+ */
172
+ export type ObjectStyle<C extends ComponentType<any>> = Exclude<Extract<ComponentStyle<C>, object>, readonly any[]>;
173
+ /** A style computed from `{ theme, props, platform }` at render time. */
174
+ export type StyleFn<C extends ComponentType<any>, P> = (ctx: StyleContext<P>) => ObjectStyle<C>;
175
+ /** A style given either as an object ({@link StyleObject}) or as a function ({@link StyleFn}). */
176
+ export type StyleOrFn<C extends ComponentType<any>, P> = StyleObject<C> | StyleFn<C, P>;
177
+ /**
178
+ * A component created by `engine()`. It renders `C` with the accumulated rules
179
+ * and exposes chainable methods to add more. Each method returns a NEW
180
+ * component; the original is never changed.
181
+ */
182
+ export interface BaseEngineComponent<C extends ComponentType<any>, P extends object = {}> extends ForwardRefExoticComponent<ComponentPropsWithRef<C> & P> {
183
+ /**
184
+ * Applies props (including `style`) only when `condition` is true.
185
+ *
186
+ * @param condition A platform (`'platform:ios'`, `'platform:web'`…), a state
187
+ * (`'state:hover'`, `'state:pressed'`…), a breakpoint (`'breakpoints:md'`,
188
+ * `'breakpoints:<md'`, `'breakpoints:sm..lg'`), a prop (`'props:disabled'`,
189
+ * `'props:variant=primary'`), a pseudo-element (`'::before'`…), a function
190
+ * `(ctx) => boolean` or a boolean.
191
+ * @param attrs The props to apply, or a function of `{ theme, props, platform }` returning them.
192
+ * @returns A new component with the rule added.
193
+ */
194
+ when(condition: Condition<P, StyleContext<P>>, attrs: Partial<ComponentPropsWithRef<C> & P> | ((ctx: StyleContext<P>) => Partial<ComponentPropsWithRef<C> & P>)): EngineComponent<C, P>;
195
+ /**
196
+ * Applies props unconditionally (e.g. a default `accessibilityRole` or `type`).
197
+ * @returns A new component with the props added.
198
+ */
199
+ attrs(attrs: Partial<ComponentPropsWithRef<C> & P>): EngineComponent<C, P>;
200
+ /**
201
+ * Adds a style: an object, or a function of `{ theme, props, platform }`.
202
+ * Later styles override earlier ones (last wins).
203
+ * @returns A new component with the style added.
204
+ */
205
+ style(s: StyleFn<C, P>): EngineComponent<C, P>;
206
+ style(s: StyleObject<C>): EngineComponent<C, P>;
207
+ /** Clones the current rules into a new component, to build a variation without touching the original. */
208
+ extend(): EngineComponent<C, P>;
209
+ }
210
+ /**
211
+ * The public type of an `engine()` component: {@link BaseEngineComponent} plus
212
+ * internal markers used by the type system.
213
+ */
214
+ export type EngineComponent<C extends ComponentType<any>, P extends object = {}> = BaseEngineComponent<C, P> & {
215
+ /** Internal marker: identifies an engine component. */
216
+ __engine: true;
217
+ /** Internal: the underlying component `C` (type-level only). */
218
+ __component: C;
219
+ /** Internal: the custom props `P` (type-level only). */
220
+ __props: P;
221
+ };
222
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,10 @@
1
+ import { BaseStyleContext } from "../core/types";
2
+ /**
3
+ * Cache key of a style computation for one platform and one set of props.
4
+ *
5
+ * `keys` are the props the style rules actually **read** (see `trackReads`): only those can change the
6
+ * result, so only those are hashed. A `testID`, an `onPress` closure or any prop the style never looks at
7
+ * no longer fragments the cache. With `keys = null` (a rule enumerated all the props) every prop counts.
8
+ */
9
+ export declare function optimizedHash<P extends object>(ctx: BaseStyleContext<P>, keys?: ReadonlySet<string> | null): string;
10
+ //# sourceMappingURL=optimizedHash.d.ts.map