@stacksjs/stx 0.2.413 → 0.2.414

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 (345) hide show
  1. package/dist/appearance-bootstrap.js +1 -1
  2. package/dist/binding-manifest.d.ts +1 -1
  3. package/dist/bundle-analyzer.js +20 -20
  4. package/dist/chunk-020xyn9q.js +3 -0
  5. package/dist/chunk-04jhmfbz.js +2 -0
  6. package/dist/chunk-10957mcb.js +2 -0
  7. package/dist/chunk-1098mas0.js +2 -0
  8. package/dist/chunk-169n1vpx.js +12 -0
  9. package/dist/chunk-1b6t12hd.js +2 -0
  10. package/dist/chunk-1chw8xsw.js +2 -0
  11. package/dist/chunk-1xdzcy9d.js +14 -0
  12. package/dist/chunk-2ce7f416.js +2 -0
  13. package/dist/chunk-2gr351s0.js +7 -0
  14. package/dist/chunk-2mkcjw08.js +2 -0
  15. package/dist/chunk-2v8wztd5.js +2 -0
  16. package/dist/chunk-340a824p.js +2 -0
  17. package/dist/chunk-39g1134q.js +2 -0
  18. package/dist/chunk-3c74vag1.js +2 -0
  19. package/dist/chunk-3kthfs03.js +3 -0
  20. package/dist/chunk-3qn1wcdg.js +2 -0
  21. package/dist/chunk-3s2vnqcf.js +2 -0
  22. package/dist/chunk-48bwk47q.js +2 -0
  23. package/dist/chunk-4bjravgk.js +2 -0
  24. package/dist/chunk-4jjme6a5.js +2 -0
  25. package/dist/chunk-5g3y8kym.js +2 -0
  26. package/dist/chunk-5gsxpaqk.js +2 -0
  27. package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
  28. package/dist/chunk-69mc2np8.js +2785 -0
  29. package/dist/chunk-6cfa3g0r.js +2 -0
  30. package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
  31. package/dist/chunk-6hc5vz20.js +3 -0
  32. package/dist/chunk-6q6g76vg.js +499 -0
  33. package/dist/{chunk-bwjxk1dw.js → chunk-6sgswrqw.js} +29 -29
  34. package/dist/chunk-6y8hnymb.js +2 -0
  35. package/dist/chunk-74j18qk0.js +930 -0
  36. package/dist/chunk-752hw7cd.js +4 -0
  37. package/dist/{chunk-kgd8kchy.js → chunk-765e1s44.js} +11 -76
  38. package/dist/chunk-7gkv67ky.js +4 -0
  39. package/dist/chunk-7z2ra0yf.js +2 -0
  40. package/dist/chunk-866n724v.js +2 -0
  41. package/dist/chunk-8nhshfz6.js +5 -0
  42. package/dist/chunk-92ps1xpk.js +2 -0
  43. package/dist/chunk-9g27ybyr.js +3 -0
  44. package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
  45. package/dist/{chunk-24zher49.js → chunk-9vrja6vp.js} +4 -4
  46. package/dist/chunk-9xrbve19.js +2 -0
  47. package/dist/chunk-a688m6js.js +3 -0
  48. package/dist/chunk-afhxw2t8.js +2 -0
  49. package/dist/chunk-ak1cgcah.js +5 -0
  50. package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
  51. package/dist/chunk-apg16xcn.js +2 -0
  52. package/dist/chunk-b52s5z0c.js +2 -0
  53. package/dist/chunk-b84h16er.js +61 -0
  54. package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
  55. package/dist/chunk-bmt7w2pk.js +2 -0
  56. package/dist/chunk-btmhj5t7.js +2 -0
  57. package/dist/chunk-ce1sejr3.js +3 -0
  58. package/dist/chunk-cg8hg6cs.js +3 -0
  59. package/dist/{chunk-4f9zyfdw.js → chunk-czxt605c.js} +4 -5
  60. package/dist/chunk-d44b9ktb.js +4 -0
  61. package/dist/chunk-daz5aqcf.js +24 -0
  62. package/dist/chunk-dgdm3hy3.js +2 -0
  63. package/dist/chunk-dvgv8nry.js +11 -0
  64. package/dist/chunk-dx7n22ed.js +2 -0
  65. package/dist/chunk-e57rhf65.js +3 -0
  66. package/dist/chunk-eed4fwps.js +3 -0
  67. package/dist/chunk-ej9j6k1q.js +3 -0
  68. package/dist/chunk-et0rr8c7.js +3 -0
  69. package/dist/chunk-f46qsp4m.js +4 -0
  70. package/dist/chunk-f6az0xj5.js +2 -0
  71. package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
  72. package/dist/chunk-fjs0a8h7.js +2 -0
  73. package/dist/chunk-fr2txj8q.js +829 -0
  74. package/dist/{chunk-xssw417m.js → chunk-ft4p6d28.js} +14 -14
  75. package/dist/chunk-fyzajkrx.js +2 -0
  76. package/dist/chunk-fzapbw9p.js +3 -0
  77. package/dist/chunk-g578mcb0.js +194 -0
  78. package/dist/chunk-gawrg4gb.js +216 -0
  79. package/dist/chunk-gw07qmjk.js +2 -0
  80. package/dist/chunk-h0atqq82.js +32 -0
  81. package/dist/chunk-h6zsqb9r.js +3 -0
  82. package/dist/{chunk-2snqdnk9.js → chunk-h85hrwkq.js} +13 -13
  83. package/dist/chunk-hbxz85wy.js +2 -0
  84. package/dist/chunk-hjg3ndgh.js +2 -0
  85. package/dist/chunk-hkxsewzk.js +2 -0
  86. package/dist/chunk-hrbbbtbn.js +2 -0
  87. package/dist/chunk-j03revz2.js +8 -0
  88. package/dist/chunk-j9qcrwbg.js +2 -0
  89. package/dist/chunk-jk4njz0w.js +2 -0
  90. package/dist/chunk-jmabeqfq.js +2 -0
  91. package/dist/chunk-jt0n43mk.js +2 -0
  92. package/dist/chunk-kjbv8a3m.js +2 -0
  93. package/dist/chunk-m1vdghnx.js +2 -0
  94. package/dist/chunk-m4sk62wb.js +5 -0
  95. package/dist/chunk-md8rqn48.js +30 -0
  96. package/dist/chunk-mepdnezf.js +17 -0
  97. package/dist/chunk-mhq0pjws.js +2 -0
  98. package/dist/chunk-mp6hy8g4.js +2 -0
  99. package/dist/chunk-ngc2wke4.js +3 -0
  100. package/dist/chunk-nn2vstke.js +2 -0
  101. package/dist/chunk-p2v2a68k.js +2 -0
  102. package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
  103. package/dist/chunk-pdt69hpb.js +2 -0
  104. package/dist/chunk-pgzvyrv6.js +29 -0
  105. package/dist/chunk-pj1wg7jg.js +2 -0
  106. package/dist/chunk-pqxzp1bb.js +3 -0
  107. package/dist/chunk-px7fvbj6.js +3 -0
  108. package/dist/chunk-q4c06e8x.js +20 -0
  109. package/dist/chunk-q6vrb2pe.js +2 -0
  110. package/dist/chunk-q7qchkvk.js +2 -0
  111. package/dist/chunk-q9bdh4s5.js +8 -0
  112. package/dist/chunk-qet5gc6s.js +2033 -0
  113. package/dist/chunk-qz519eyp.js +2 -0
  114. package/dist/chunk-r3f9jcf7.js +5 -0
  115. package/dist/chunk-rs4v4fha.js +4 -0
  116. package/dist/chunk-s2x4wcrz.js +2 -0
  117. package/dist/chunk-s5xezjps.js +3 -0
  118. package/dist/chunk-scezfp0w.js +30 -0
  119. package/dist/chunk-sd321bn3.js +2 -0
  120. package/dist/{chunk-smcj3442.js → chunk-sd47dzs0.js} +79 -79
  121. package/dist/chunk-se7mwqd1.js +2 -0
  122. package/dist/chunk-shr559s7.js +3 -0
  123. package/dist/chunk-syaw6b75.js +2 -0
  124. package/dist/chunk-t4hzprsm.js +3 -0
  125. package/dist/{chunk-pv3d7sfn.js → chunk-t61vdbje.js} +89 -89
  126. package/dist/chunk-tfexmdkt.js +3 -0
  127. package/dist/chunk-thyt8ed8.js +6 -0
  128. package/dist/chunk-v091jft4.js +12 -0
  129. package/dist/chunk-v4vaqxrf.js +33 -0
  130. package/dist/chunk-vgvtnwxa.js +4 -0
  131. package/dist/chunk-x0q32ees.js +3 -0
  132. package/dist/chunk-x5bpeb4a.js +2 -0
  133. package/dist/chunk-x72tv2cg.js +3 -0
  134. package/dist/chunk-xfp7k0v8.js +64 -0
  135. package/dist/chunk-xtdw3692.js +6 -0
  136. package/dist/chunk-y1cmjvk3.js +43 -0
  137. package/dist/chunk-y5310237.js +311 -0
  138. package/dist/chunk-ya0qecph.js +27 -0
  139. package/dist/chunk-yazk54jr.js +8 -0
  140. package/dist/chunk-ydjfar14.js +2 -0
  141. package/dist/chunk-ym95v4nc.js +3 -0
  142. package/dist/chunk-ynvdvbat.js +18 -0
  143. package/dist/chunk-yvx1ap9b.js +3 -0
  144. package/dist/chunk-z0g9jvv0.js +40 -0
  145. package/dist/chunk-z6d0jmjb.js +2 -0
  146. package/dist/{chunk-8sdhs0zk.js → chunk-zhxdpzga.js} +4 -4
  147. package/dist/cli.js +110 -110
  148. package/dist/craft-entry.js +7 -7
  149. package/dist/craft.js +7 -7
  150. package/dist/database.js +2 -2
  151. package/dist/image-optimization/component.js +4 -4
  152. package/dist/media/image/component.js +5 -5
  153. package/dist/media/protected/component.js +2 -2
  154. package/dist/media/video/index.js +4 -4
  155. package/dist/native/bridge/protocol.d.ts +325 -0
  156. package/dist/native/bridge/protocol.js +219 -0
  157. package/dist/native/cli.d.ts +24 -0
  158. package/dist/native/cli.js +52 -0
  159. package/dist/native/compiler/bundle.d.ts +41 -0
  160. package/dist/native/compiler/bundle.js +90 -0
  161. package/dist/native/compiler/client-script.d.ts +8 -0
  162. package/dist/native/compiler/client-script.js +31 -0
  163. package/dist/native/compiler/codegen.d.ts +10 -0
  164. package/dist/native/compiler/codegen.js +145 -0
  165. package/dist/native/compiler/headwind-to-style.d.ts +395 -0
  166. package/dist/native/compiler/headwind-to-style.js +1163 -0
  167. package/dist/native/compiler/html-to-ir.d.ts +41 -0
  168. package/dist/native/compiler/html-to-ir.js +411 -0
  169. package/dist/native/compiler/icons.d.ts +220 -0
  170. package/dist/native/compiler/icons.js +208 -0
  171. package/dist/native/compiler/ir.d.ts +234 -0
  172. package/dist/native/compiler/ir.js +15 -0
  173. package/dist/native/compiler/parser.d.ts +88 -0
  174. package/dist/native/compiler/parser.js +753 -0
  175. package/dist/native/compiler/render-screen.d.ts +26 -0
  176. package/dist/native/compiler/render-screen.js +31 -0
  177. package/dist/native/components/primitives.d.ts +291 -0
  178. package/dist/native/components/primitives.js +22 -0
  179. package/dist/native/hot-reload/client.d.ts +62 -0
  180. package/dist/native/hot-reload/client.js +324 -0
  181. package/dist/native/index.d.ts +90 -0
  182. package/dist/native/index.js +34 -0
  183. package/dist/native/primitives/ActivityIndicator.stx +5 -0
  184. package/dist/native/primitives/Button.stx +5 -0
  185. package/dist/native/primitives/DatePicker.stx +5 -0
  186. package/dist/native/primitives/FlatList.stx +5 -0
  187. package/dist/native/primitives/Image.stx +5 -0
  188. package/dist/native/primitives/ImageBackground.stx +5 -0
  189. package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
  190. package/dist/native/primitives/Modal.stx +5 -0
  191. package/dist/native/primitives/Picker.stx +5 -0
  192. package/dist/native/primitives/Pressable.stx +5 -0
  193. package/dist/native/primitives/RefreshControl.stx +5 -0
  194. package/dist/native/primitives/SafeAreaView.stx +5 -0
  195. package/dist/native/primitives/ScrollView.stx +5 -0
  196. package/dist/native/primitives/SectionList.stx +5 -0
  197. package/dist/native/primitives/Slider.stx +5 -0
  198. package/dist/native/primitives/StatusBar.stx +5 -0
  199. package/dist/native/primitives/Switch.stx +5 -0
  200. package/dist/native/primitives/Text.stx +5 -0
  201. package/dist/native/primitives/TextInput.stx +5 -0
  202. package/dist/native/primitives/TouchableHighlight.stx +5 -0
  203. package/dist/native/primitives/TouchableOpacity.stx +5 -0
  204. package/dist/native/primitives/View.stx +5 -0
  205. package/dist/native/runtime/craft.d.ts +75 -0
  206. package/dist/native/runtime/craft.js +0 -0
  207. package/dist/native/runtime/entry.d.ts +1 -0
  208. package/dist/native/runtime/entry.js +3 -0
  209. package/dist/native/runtime/index.d.ts +45 -0
  210. package/dist/native/runtime/index.js +165 -0
  211. package/dist/native/runtime/native-host.d.ts +33 -0
  212. package/dist/native/runtime/native-host.js +184 -0
  213. package/dist/native/runtime/screen.d.ts +43 -0
  214. package/dist/native/runtime/screen.js +808 -0
  215. package/dist/pwa/service-worker.js +1 -1
  216. package/dist/pwa/workbox.js +1 -1
  217. package/dist/pwa.js +8 -8
  218. package/dist/site-url.d.ts +1 -1
  219. package/dist/ssg.js +53 -53
  220. package/dist/visual-testing.js +42 -42
  221. package/dist/web-components/reactive-generator.js +2 -2
  222. package/package.json +9 -5
  223. package/dist/chunk-0btmm4m2.js +0 -147
  224. package/dist/chunk-0c2h69k2.js +0 -4
  225. package/dist/chunk-0d0qeqvv.js +0 -2
  226. package/dist/chunk-0psndabd.js +0 -2
  227. package/dist/chunk-0qv8yf53.js +0 -2
  228. package/dist/chunk-0vkxyvsd.js +0 -2
  229. package/dist/chunk-0we9nw1d.js +0 -3
  230. package/dist/chunk-0xqdmemy.js +0 -3
  231. package/dist/chunk-0y46fbkx.js +0 -3
  232. package/dist/chunk-158wqccn.js +0 -4422
  233. package/dist/chunk-1cyxbb8y.js +0 -16
  234. package/dist/chunk-1enwnh2a.js +0 -2
  235. package/dist/chunk-213pzm0d.js +0 -3
  236. package/dist/chunk-21hzqyja.js +0 -12
  237. package/dist/chunk-266t58b8.js +0 -5
  238. package/dist/chunk-27fgag95.js +0 -4
  239. package/dist/chunk-2a9n102n.js +0 -2
  240. package/dist/chunk-2eqzrczk.js +0 -2
  241. package/dist/chunk-2ke37m54.js +0 -14
  242. package/dist/chunk-35ds08e7.js +0 -3
  243. package/dist/chunk-3mtwkjcg.js +0 -2
  244. package/dist/chunk-4xr8zwkp.js +0 -2
  245. package/dist/chunk-58v77x2c.js +0 -2
  246. package/dist/chunk-5mhq8605.js +0 -2
  247. package/dist/chunk-5se8xt9e.js +0 -64
  248. package/dist/chunk-5zh0h080.js +0 -2
  249. package/dist/chunk-62435225.js +0 -2
  250. package/dist/chunk-6kdrncsx.js +0 -30
  251. package/dist/chunk-6n2rr3x7.js +0 -2
  252. package/dist/chunk-6xk87qf2.js +0 -30
  253. package/dist/chunk-72rwcbp6.js +0 -3
  254. package/dist/chunk-76w34xne.js +0 -3
  255. package/dist/chunk-7ekd7zj9.js +0 -2
  256. package/dist/chunk-7pr3wdd5.js +0 -3
  257. package/dist/chunk-7rxvafwc.js +0 -24
  258. package/dist/chunk-7tnwfa7w.js +0 -8
  259. package/dist/chunk-8c5je0wf.js +0 -2
  260. package/dist/chunk-8dz6nyvx.js +0 -2
  261. package/dist/chunk-98zj3fv2.js +0 -7
  262. package/dist/chunk-9e8t0twa.js +0 -3
  263. package/dist/chunk-9fqp72ze.js +0 -5
  264. package/dist/chunk-anydpa34.js +0 -3
  265. package/dist/chunk-ay6zjq8v.js +0 -3
  266. package/dist/chunk-az4v4ard.js +0 -3
  267. package/dist/chunk-ba5erggg.js +0 -2
  268. package/dist/chunk-bnagrdz6.js +0 -2
  269. package/dist/chunk-by8wghtf.js +0 -2
  270. package/dist/chunk-cd7h4q51.js +0 -2
  271. package/dist/chunk-cjmv8hgp.js +0 -33
  272. package/dist/chunk-cthf912y.js +0 -2
  273. package/dist/chunk-cxbpmwq5.js +0 -4
  274. package/dist/chunk-d3sy16qn.js +0 -2
  275. package/dist/chunk-dh6s7mrj.js +0 -1199
  276. package/dist/chunk-dm2nzg7a.js +0 -2
  277. package/dist/chunk-e2sgcnxc.js +0 -2
  278. package/dist/chunk-e3b7jj74.js +0 -2
  279. package/dist/chunk-ec4wq2sv.js +0 -6
  280. package/dist/chunk-ekzg97dn.js +0 -29
  281. package/dist/chunk-epjt342x.js +0 -2
  282. package/dist/chunk-eqe26g14.js +0 -18
  283. package/dist/chunk-ev0v1yma.js +0 -2
  284. package/dist/chunk-f53psr2y.js +0 -5
  285. package/dist/chunk-f8p69dsg.js +0 -3
  286. package/dist/chunk-f95drhdb.js +0 -194
  287. package/dist/chunk-ff5a6hvb.js +0 -17
  288. package/dist/chunk-fs5fy4h8.js +0 -2
  289. package/dist/chunk-fzsygce3.js +0 -2
  290. package/dist/chunk-g465x63k.js +0 -2
  291. package/dist/chunk-g708ekh1.js +0 -2
  292. package/dist/chunk-gcr9e83g.js +0 -11
  293. package/dist/chunk-gdmyrsr8.js +0 -4
  294. package/dist/chunk-gkms2ngq.js +0 -2
  295. package/dist/chunk-gnfywmgs.js +0 -7
  296. package/dist/chunk-hpf8kq7e.js +0 -2
  297. package/dist/chunk-j4x3faf8.js +0 -2
  298. package/dist/chunk-jkavtw9f.js +0 -2
  299. package/dist/chunk-kg1rdena.js +0 -3
  300. package/dist/chunk-km91wx0v.js +0 -2
  301. package/dist/chunk-kmsyvaex.js +0 -8
  302. package/dist/chunk-mrahwn5v.js +0 -8
  303. package/dist/chunk-nk3czvnk.js +0 -2
  304. package/dist/chunk-nmw4eewb.js +0 -2
  305. package/dist/chunk-nq5zxrk0.js +0 -4
  306. package/dist/chunk-ny67c03k.js +0 -3
  307. package/dist/chunk-p4wdxp2c.js +0 -2
  308. package/dist/chunk-pcxp4r9n.js +0 -3
  309. package/dist/chunk-pdyeaxc1.js +0 -2
  310. package/dist/chunk-pf06ded4.js +0 -2
  311. package/dist/chunk-pfs0gpzm.js +0 -2
  312. package/dist/chunk-pshdwq44.js +0 -2
  313. package/dist/chunk-pwgv84pn.js +0 -32
  314. package/dist/chunk-pwsnafp3.js +0 -4367
  315. package/dist/chunk-q9n5swx7.js +0 -3
  316. package/dist/chunk-qr346wnp.js +0 -2
  317. package/dist/chunk-r02hke04.js +0 -2
  318. package/dist/chunk-ranshpyc.js +0 -3
  319. package/dist/chunk-rn194bhp.js +0 -20
  320. package/dist/chunk-rn1hgyc8.js +0 -930
  321. package/dist/chunk-s7z5dp70.js +0 -43
  322. package/dist/chunk-s8jd13nb.js +0 -3
  323. package/dist/chunk-sn7exv0n.js +0 -2
  324. package/dist/chunk-t1tdjjht.js +0 -216
  325. package/dist/chunk-t6qx04s8.js +0 -499
  326. package/dist/chunk-t6y6gyps.js +0 -2
  327. package/dist/chunk-tjfs7cc3.js +0 -2
  328. package/dist/chunk-tkyrk66a.js +0 -3
  329. package/dist/chunk-tntv9hvq.js +0 -2
  330. package/dist/chunk-v3nwkveg.js +0 -12
  331. package/dist/chunk-vd4cb5xr.js +0 -2
  332. package/dist/chunk-vkhdce50.js +0 -2
  333. package/dist/chunk-w183av08.js +0 -2
  334. package/dist/chunk-w2m02njv.js +0 -2
  335. package/dist/chunk-wpjrcrs5.js +0 -2
  336. package/dist/chunk-wqmppf6b.js +0 -3
  337. package/dist/chunk-wtb9fxdy.js +0 -2
  338. package/dist/chunk-xmzygmcz.js +0 -3
  339. package/dist/chunk-xsng1mtq.js +0 -3
  340. package/dist/chunk-xxzefj4j.js +0 -2
  341. package/dist/chunk-yq8x8bxq.js +0 -47
  342. package/dist/chunk-ytma76qe.js +0 -3
  343. package/dist/chunk-yw1m115e.js +0 -2
  344. package/dist/chunk-z64a924m.js +0 -2
  345. package/dist/chunk-zcz9rs6p.js +0 -3
@@ -0,0 +1,26 @@
1
+ import type { STXDocument } from './ir';
2
+ import type { TranslationDiagnostic } from './html-to-ir';
3
+ /**
4
+ * Where the native primitive components live, for an app's stx config.
5
+ *
6
+ * Resolved by looking, because the answer differs between running from source,
7
+ * the per-module build and the bundled CLI. A path that is merely plausible
8
+ * would fail only in the built binary, which is the one users run.
9
+ */
10
+ export declare function nativePrimitivesDir(): string;
11
+ /**
12
+ * Render a screen's source with stx and translate it to the native IR.
13
+ */
14
+ export declare function compileScreenSource(source: string, filePath: string, options?: CompileScreenOptions): Promise<CompiledScreen>;
15
+ /** The same, reading the screen off disk. */
16
+ export declare function compileScreenFile(filePath: string, options?: CompileScreenOptions): Promise<CompiledScreen>;
17
+ export declare interface CompileScreenOptions {
18
+ componentsDir?: string
19
+ root?: string
20
+ context?: Record<string, unknown>
21
+ }
22
+ export declare interface CompiledScreen {
23
+ document: STXDocument
24
+ diagnostics: TranslationDiagnostic[]
25
+ html: string
26
+ }
@@ -0,0 +1,31 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { processDirectives } from "../../process.js";
4
+ import { translateHtmlToDocument } from "./html-to-ir.js";
5
+ import { extractClientScript } from "./client-script.js";
6
+ export function nativePrimitivesDir() {
7
+ const candidates = [
8
+ path.join(import.meta.dir, "..", "primitives"),
9
+ path.join(import.meta.dir, "native", "primitives")
10
+ ];
11
+ for (const candidate of candidates)
12
+ if (existsSync(path.join(candidate, "View.stx")))
13
+ return candidate;
14
+ return candidates[0];
15
+ }
16
+ export async function compileScreenSource(source, filePath, options = {}) {
17
+ const root = options.root ?? path.dirname(filePath), config = {
18
+ root,
19
+ componentsDir: options.componentsDir ?? path.join(root, "components"),
20
+ buildMode: "serve",
21
+ cache: !1,
22
+ _pluginComponentDirs: [nativePrimitivesDir()]
23
+ }, html = await processDirectives(source, options.context ?? {}, filePath, config, new Set), { document, diagnostics } = await translateHtmlToDocument(html, {
24
+ source: filePath,
25
+ script: extractClientScript(source)
26
+ });
27
+ return { document, diagnostics, html };
28
+ }
29
+ export async function compileScreenFile(filePath, options = {}) {
30
+ return compileScreenSource(await Bun.file(filePath).text(), filePath, options);
31
+ }
@@ -0,0 +1,291 @@
1
+ import type { STXStyle } from '../compiler/ir';
2
+ /** Maps STX component names to native implementations */
3
+ export declare const ComponentRegistry: {
4
+ View: 'View';
5
+ ScrollView: 'ScrollView';
6
+ SafeAreaView: 'SafeAreaView';
7
+ KeyboardAvoidingView: 'KeyboardAvoidingView';
8
+ Text: 'Text';
9
+ TextInput: 'TextInput';
10
+ Button: 'Button';
11
+ TouchableOpacity: 'TouchableOpacity';
12
+ TouchableHighlight: 'TouchableHighlight';
13
+ Pressable: 'Pressable';
14
+ Switch: 'Switch';
15
+ Slider: 'Slider';
16
+ Image: 'Image';
17
+ ImageBackground: 'ImageBackground';
18
+ FlatList: 'FlatList';
19
+ SectionList: 'SectionList';
20
+ Modal: 'Modal';
21
+ ActivityIndicator: 'ActivityIndicator';
22
+ StatusBar: 'StatusBar';
23
+ RefreshControl: 'RefreshControl'
24
+ };
25
+ // ============================================================================
26
+ // Base Types
27
+ // ============================================================================
28
+ export declare interface BaseProps {
29
+ key?: string
30
+ style?: STXStyle
31
+ class?: string
32
+ testID?: string
33
+ accessibilityLabel?: string
34
+ accessibilityHint?: string
35
+ accessibilityRole?: AccessibilityRole
36
+ }
37
+ // ============================================================================
38
+ // Layout Components
39
+ // ============================================================================
40
+ export declare interface ViewProps extends BaseProps {
41
+ onPress?: () => void
42
+ onLongPress?: () => void
43
+ onLayout?: (event: LayoutEvent) => void
44
+ pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only'
45
+ }
46
+ export declare interface ScrollViewProps extends ViewProps {
47
+ horizontal?: boolean
48
+ showsHorizontalScrollIndicator?: boolean
49
+ showsVerticalScrollIndicator?: boolean
50
+ bounces?: boolean
51
+ onScroll?: (event: ScrollEvent) => void
52
+ onScrollEndDrag?: () => void
53
+ onMomentumScrollEnd?: () => void
54
+ contentContainerStyle?: STXStyle
55
+ keyboardDismissMode?: 'none' | 'on-drag' | 'interactive'
56
+ refreshControl?: RefreshControlProps
57
+ pagingEnabled?: boolean
58
+ scrollEnabled?: boolean
59
+ }
60
+ export declare interface SafeAreaViewProps extends ViewProps {
61
+ edges?: Array<'top' | 'right' | 'bottom' | 'left'>
62
+ }
63
+ export declare interface KeyboardAvoidingViewProps extends ViewProps {
64
+ behavior?: 'height' | 'position' | 'padding'
65
+ keyboardVerticalOffset?: number
66
+ }
67
+ // ============================================================================
68
+ // Text Components
69
+ // ============================================================================
70
+ export declare interface TextProps extends BaseProps {
71
+ numberOfLines?: number
72
+ ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip'
73
+ selectable?: boolean
74
+ onPress?: () => void
75
+ onLongPress?: () => void
76
+ }
77
+ export declare interface TextInputProps extends BaseProps {
78
+ value?: string
79
+ defaultValue?: string
80
+ placeholder?: string
81
+ placeholderTextColor?: string
82
+ onChangeText?: (text: string) => void
83
+ onFocus?: () => void
84
+ onBlur?: () => void
85
+ onSubmitEditing?: () => void
86
+ keyboardType?: KeyboardType
87
+ returnKeyType?: ReturnKeyType
88
+ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters'
89
+ autoCorrect?: boolean
90
+ autoFocus?: boolean
91
+ secureTextEntry?: boolean
92
+ maxLength?: number
93
+ multiline?: boolean
94
+ editable?: boolean
95
+ selectionColor?: string
96
+ }
97
+ // ============================================================================
98
+ // Interactive Components
99
+ // ============================================================================
100
+ export declare interface ButtonProps extends BaseProps {
101
+ title?: string
102
+ onPress?: () => void
103
+ disabled?: boolean
104
+ color?: string
105
+ }
106
+ export declare interface TouchableOpacityProps extends ViewProps {
107
+ activeOpacity?: number
108
+ disabled?: boolean
109
+ }
110
+ export declare interface TouchableHighlightProps extends ViewProps {
111
+ underlayColor?: string
112
+ activeOpacity?: number
113
+ disabled?: boolean
114
+ onShowUnderlay?: () => void
115
+ onHideUnderlay?: () => void
116
+ }
117
+ export declare interface PressableProps extends ViewProps {
118
+ disabled?: boolean
119
+ onPressIn?: () => void
120
+ onPressOut?: () => void
121
+ hitSlop?: number | { top?: number; right?: number; bottom?: number; left?: number }
122
+ pressRetentionOffset?: number | { top?: number; right?: number; bottom?: number; left?: number }
123
+ android_ripple?: {
124
+ color?: string
125
+ borderless?: boolean
126
+ radius?: number
127
+ }
128
+ }
129
+ export declare interface SwitchProps extends BaseProps {
130
+ value?: boolean
131
+ onValueChange?: (value: boolean) => void
132
+ disabled?: boolean
133
+ trackColor?: { false?: string; true?: string }
134
+ thumbColor?: string
135
+ ios_backgroundColor?: string
136
+ }
137
+ export declare interface SliderProps extends BaseProps {
138
+ value?: number
139
+ minimumValue?: number
140
+ maximumValue?: number
141
+ step?: number
142
+ onValueChange?: (value: number) => void
143
+ onSlidingComplete?: (value: number) => void
144
+ disabled?: boolean
145
+ minimumTrackTintColor?: string
146
+ maximumTrackTintColor?: string
147
+ thumbTintColor?: string
148
+ }
149
+ // ============================================================================
150
+ // Media Components
151
+ // ============================================================================
152
+ export declare interface ImageProps extends BaseProps {
153
+ source: ImageSource
154
+ resizeMode?: 'cover' | 'contain' | 'stretch' | 'center' | 'repeat'
155
+ onLoad?: () => void
156
+ onLoadStart?: () => void
157
+ onLoadEnd?: () => void
158
+ onError?: (error: Error) => void
159
+ blurRadius?: number
160
+ fadeDuration?: number
161
+ defaultSource?: ImageSource
162
+ }
163
+ export declare interface ImageBackgroundProps extends ImageProps {
164
+ imageStyle?: STXStyle
165
+ }
166
+ // ============================================================================
167
+ // List Components
168
+ // ============================================================================
169
+ export declare interface FlatListProps<T> extends ScrollViewProps {
170
+ data: T[]
171
+ renderItem: (info: { item: T; index: number }) => unknown
172
+ keyExtractor?: (item: T, index: number) => string
173
+ ItemSeparatorComponent?: () => unknown
174
+ ListHeaderComponent?: () => unknown
175
+ ListFooterComponent?: () => unknown
176
+ ListEmptyComponent?: () => unknown
177
+ numColumns?: number
178
+ initialNumToRender?: number
179
+ maxToRenderPerBatch?: number
180
+ windowSize?: number
181
+ onEndReached?: () => void
182
+ onEndReachedThreshold?: number
183
+ inverted?: boolean
184
+ }
185
+ export declare interface SectionListProps<T> extends ScrollViewProps {
186
+ sections: Array<{ title?: string; data: T[] }>
187
+ renderItem: (info: { item: T; index: number; section: { title?: string; data: T[] } }) => unknown
188
+ renderSectionHeader?: (info: { section: { title?: string; data: T[] } }) => unknown
189
+ keyExtractor?: (item: T, index: number) => string
190
+ }
191
+ // ============================================================================
192
+ // Overlay Components
193
+ // ============================================================================
194
+ export declare interface ModalProps extends BaseProps {
195
+ visible?: boolean
196
+ animationType?: 'none' | 'slide' | 'fade'
197
+ presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'
198
+ transparent?: boolean
199
+ onRequestClose?: () => void
200
+ onShow?: () => void
201
+ onDismiss?: () => void
202
+ statusBarTranslucent?: boolean
203
+ }
204
+ export declare interface ActivityIndicatorProps extends BaseProps {
205
+ animating?: boolean
206
+ color?: string
207
+ size?: 'small' | 'large' | number
208
+ hidesWhenStopped?: boolean
209
+ }
210
+ // ============================================================================
211
+ // Utility Components
212
+ // ============================================================================
213
+ export declare interface StatusBarProps {
214
+ barStyle?: 'default' | 'light-content' | 'dark-content'
215
+ backgroundColor?: string
216
+ hidden?: boolean
217
+ animated?: boolean
218
+ translucent?: boolean
219
+ }
220
+ export declare interface RefreshControlProps {
221
+ refreshing: boolean
222
+ onRefresh: () => void
223
+ tintColor?: string
224
+ title?: string
225
+ titleColor?: string
226
+ progressBackgroundColor?: string
227
+ progressViewOffset?: number
228
+ }
229
+ // ============================================================================
230
+ // Event Types
231
+ // ============================================================================
232
+ export declare interface LayoutEvent {
233
+ nativeEvent: {
234
+ layout: {
235
+ x: number
236
+ y: number
237
+ width: number
238
+ height: number
239
+ }
240
+ }
241
+ }
242
+ export declare interface ScrollEvent {
243
+ nativeEvent: {
244
+ contentOffset: { x: number; y: number }
245
+ contentSize: { width: number; height: number }
246
+ layoutMeasurement: { width: number; height: number }
247
+ }
248
+ }
249
+ export type AccessibilityRole = | 'none'
250
+ | 'button'
251
+ | 'link'
252
+ | 'search'
253
+ | 'image'
254
+ | 'text'
255
+ | 'adjustable'
256
+ | 'header'
257
+ | 'summary'
258
+ | 'alert'
259
+ | 'checkbox'
260
+ | 'combobox'
261
+ | 'menu'
262
+ | 'menubar'
263
+ | 'menuitem'
264
+ | 'progressbar'
265
+ | 'radio'
266
+ | 'radiogroup'
267
+ | 'scrollbar'
268
+ | 'spinbutton'
269
+ | 'switch'
270
+ | 'tab'
271
+ | 'tablist'
272
+ | 'timer'
273
+ | 'toolbar';
274
+ export type KeyboardType = | 'default'
275
+ | 'email-address'
276
+ | 'numeric'
277
+ | 'phone-pad'
278
+ | 'number-pad'
279
+ | 'decimal-pad'
280
+ | 'url'
281
+ | 'web-search'
282
+ | 'visible-password';
283
+ export type ReturnKeyType = | 'done'
284
+ | 'go'
285
+ | 'next'
286
+ | 'search'
287
+ | 'send'
288
+ | 'default';
289
+ export type ImageSource = | { uri: string; width?: number; height?: number; headers?: Record<string, string> }
290
+ | number // require('./image.png');
291
+ export type ComponentName = keyof typeof ComponentRegistry;
@@ -0,0 +1,22 @@
1
+ export const ComponentRegistry = {
2
+ View: "View",
3
+ ScrollView: "ScrollView",
4
+ SafeAreaView: "SafeAreaView",
5
+ KeyboardAvoidingView: "KeyboardAvoidingView",
6
+ Text: "Text",
7
+ TextInput: "TextInput",
8
+ Button: "Button",
9
+ TouchableOpacity: "TouchableOpacity",
10
+ TouchableHighlight: "TouchableHighlight",
11
+ Pressable: "Pressable",
12
+ Switch: "Switch",
13
+ Slider: "Slider",
14
+ Image: "Image",
15
+ ImageBackground: "ImageBackground",
16
+ FlatList: "FlatList",
17
+ SectionList: "SectionList",
18
+ Modal: "Modal",
19
+ ActivityIndicator: "ActivityIndicator",
20
+ StatusBar: "StatusBar",
21
+ RefreshControl: "RefreshControl"
22
+ };
@@ -0,0 +1,62 @@
1
+ import type { STXDocument } from '../compiler/ir';
2
+ export type { HotReloadMessage, HotReloadState, HotReloadCallback, ErrorOverlayOptions };
3
+ /**
4
+ * Get or create the hot reload client
5
+ */
6
+ export declare function getHotReloadClient(serverUrl?: string): HotReloadClient;
7
+ /**
8
+ * Get or create the error overlay
9
+ */
10
+ export declare function getErrorOverlay(): ErrorOverlay;
11
+ /**
12
+ * Initialize hot reload (call this in dev mode)
13
+ */
14
+ export declare function initHotReload(serverUrl?: string): HotReloadClient;
15
+ // ============================================================================
16
+ // Types
17
+ // ============================================================================
18
+ declare interface HotReloadMessage {
19
+ type: 'HOT_RELOAD' | 'FULL_RELOAD' | 'ERROR'
20
+ payload: {
21
+ changedFiles?: string[]
22
+ document?: STXDocument
23
+ preserveState?: boolean
24
+ error?: string
25
+ }
26
+ }
27
+ declare interface HotReloadState {
28
+ state: Record<string, unknown>
29
+ scrollPositions: Map<string, { x: number; y: number }>
30
+ focusedKey: string | null
31
+ inputValues: Map<string, string>
32
+ }
33
+ // ============================================================================
34
+ // Error Overlay
35
+ // ============================================================================
36
+ declare interface ErrorOverlayOptions {
37
+ error: Error | string
38
+ source?: string
39
+ line?: number
40
+ column?: number
41
+ }
42
+ // eslint-disable-next-line pickier/no-unused-vars
43
+ declare type HotReloadCallback = (document: STXDocument) => void;
44
+ // ============================================================================
45
+ // Hot Reload Client
46
+ // ============================================================================
47
+ declare class HotReloadClient {
48
+ constructor(serverUrl?: string);
49
+ connect(): void;
50
+ disconnect(): void;
51
+ get connected(): boolean;
52
+ onReload(callback: HotReloadCallback): () => void;
53
+ send(type: string, payload: unknown): void;
54
+ }
55
+ declare class ErrorOverlay {
56
+ show(options: ErrorOverlayOptions): void;
57
+ hide(): void;
58
+ }
59
+ // ============================================================================
60
+ // Exports
61
+ // ============================================================================
62
+ export { HotReloadClient, ErrorOverlay };