@ohos-ports/stacksjs-stx 0.2.287-beta.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 (946) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +1042 -0
  3. package/dist/a11y.d.ts +256 -0
  4. package/dist/a11y.js +671 -0
  5. package/dist/analytics.d.ts +40 -0
  6. package/dist/analytics.js +159 -0
  7. package/dist/analyzer.d.ts +68 -0
  8. package/dist/analyzer.js +240 -0
  9. package/dist/animation.d.ts +123 -0
  10. package/dist/animation.js +688 -0
  11. package/dist/app-shell.d.ts +76 -0
  12. package/dist/app-shell.js +209 -0
  13. package/dist/app.d.ts +65 -0
  14. package/dist/app.js +79 -0
  15. package/dist/appearance-bootstrap.d.ts +54 -0
  16. package/dist/appearance-bootstrap.js +92 -0
  17. package/dist/asset-roots.d.ts +32 -0
  18. package/dist/asset-roots.js +7 -0
  19. package/dist/assets.d.ts +21 -0
  20. package/dist/assets.js +155 -0
  21. package/dist/ast.d.ts +265 -0
  22. package/dist/ast.js +630 -0
  23. package/dist/async-components.d.ts +123 -0
  24. package/dist/async-components.js +428 -0
  25. package/dist/auth.d.ts +13 -0
  26. package/dist/auth.js +12 -0
  27. package/dist/broadcasting.d.ts +77 -0
  28. package/dist/broadcasting.js +103 -0
  29. package/dist/browser-composables.d.ts +348 -0
  30. package/dist/browser-composables.js +606 -0
  31. package/dist/browser-core-imports.d.ts +12 -0
  32. package/dist/browser-core-imports.js +28 -0
  33. package/dist/build-assets.d.ts +32 -0
  34. package/dist/build-assets.js +29 -0
  35. package/dist/build-externalize-repeated.d.ts +34 -0
  36. package/dist/build-externalize-repeated.js +101 -0
  37. package/dist/build-externalize.d.ts +73 -0
  38. package/dist/build-externalize.js +80 -0
  39. package/dist/build-id.d.ts +57 -0
  40. package/dist/build-id.js +25 -0
  41. package/dist/build-message.d.ts +81 -0
  42. package/dist/build-message.js +65 -0
  43. package/dist/build-mode-detector.d.ts +26 -0
  44. package/dist/build-mode-detector.js +50 -0
  45. package/dist/build-optimizer.d.ts +101 -0
  46. package/dist/build-optimizer.js +433 -0
  47. package/dist/build-views.d.ts +56 -0
  48. package/dist/build-views.js +180 -0
  49. package/dist/build.d.ts +31 -0
  50. package/dist/build.js +34 -0
  51. package/dist/builtins/attrs.d.ts +49 -0
  52. package/dist/builtins/attrs.js +39 -0
  53. package/dist/builtins/drawer.d.ts +24 -0
  54. package/dist/builtins/drawer.js +37 -0
  55. package/dist/builtins/escape.d.ts +12 -0
  56. package/dist/builtins/escape.js +3 -0
  57. package/dist/builtins/icon.d.ts +45 -0
  58. package/dist/builtins/icon.js +100 -0
  59. package/dist/builtins/image-delivery.d.ts +16 -0
  60. package/dist/builtins/image-delivery.js +115 -0
  61. package/dist/builtins/image-placeholder.d.ts +78 -0
  62. package/dist/builtins/image-placeholder.js +137 -0
  63. package/dist/builtins/index.d.ts +26 -0
  64. package/dist/builtins/index.js +34 -0
  65. package/dist/builtins/modal.d.ts +26 -0
  66. package/dist/builtins/modal.js +38 -0
  67. package/dist/builtins/safe-image.d.ts +44 -0
  68. package/dist/builtins/safe-image.js +45 -0
  69. package/dist/builtins/stx-image.d.ts +29 -0
  70. package/dist/builtins/stx-image.js +222 -0
  71. package/dist/builtins/stx-link.d.ts +11 -0
  72. package/dist/builtins/stx-link.js +35 -0
  73. package/dist/builtins/stx-loading-indicator.d.ts +13 -0
  74. package/dist/builtins/stx-loading-indicator.js +35 -0
  75. package/dist/builtins/suspense.d.ts +30 -0
  76. package/dist/builtins/suspense.js +24 -0
  77. package/dist/builtins/toast.d.ts +19 -0
  78. package/dist/builtins/toast.js +42 -0
  79. package/dist/builtins/tooltip.d.ts +18 -0
  80. package/dist/builtins/tooltip.js +106 -0
  81. package/dist/builtins/transition-group.d.ts +27 -0
  82. package/dist/builtins/transition-group.js +22 -0
  83. package/dist/bun-shim.js +496 -0
  84. package/dist/bundle-analyzer/collector.d.ts +66 -0
  85. package/dist/bundle-analyzer/collector.js +233 -0
  86. package/dist/bundle-analyzer/index.d.ts +98 -0
  87. package/dist/bundle-analyzer/index.js +82 -0
  88. package/dist/bundle-analyzer/report.d.ts +39 -0
  89. package/dist/bundle-analyzer/report.js +318 -0
  90. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  91. package/dist/bundle-analyzer/treemap.js +594 -0
  92. package/dist/bundle-analyzer.js +499 -0
  93. package/dist/caching.d.ts +69 -0
  94. package/dist/caching.js +135 -0
  95. package/dist/chunk-0y46fbkx.js +3 -0
  96. package/dist/chunk-122tyfre.js +2 -0
  97. package/dist/chunk-19nfvxfw.js +43 -0
  98. package/dist/chunk-1kah92n2.js +3 -0
  99. package/dist/chunk-1kms3b9d.js +2 -0
  100. package/dist/chunk-1q4y74mh.js +1194 -0
  101. package/dist/chunk-248e84r1.js +4 -0
  102. package/dist/chunk-24ps8kft.js +2 -0
  103. package/dist/chunk-2et5hxfv.js +2 -0
  104. package/dist/chunk-2r1rd8f0.js +2 -0
  105. package/dist/chunk-2tk1zkrz.js +2 -0
  106. package/dist/chunk-38ejahd9.js +3 -0
  107. package/dist/chunk-3zv4wz87.js +2 -0
  108. package/dist/chunk-4122k1bh.js +2 -0
  109. package/dist/chunk-45az9zht.js +2 -0
  110. package/dist/chunk-4qr85f07.js +2 -0
  111. package/dist/chunk-4ww3znrr.js +15 -0
  112. package/dist/chunk-54st8g2j.js +397 -0
  113. package/dist/chunk-58f0mthg.js +3 -0
  114. package/dist/chunk-5a19dhx5.js +2 -0
  115. package/dist/chunk-5kk8gsj2.js +3 -0
  116. package/dist/chunk-5w1e3yxs.js +499 -0
  117. package/dist/chunk-6gdycmxr.js +2 -0
  118. package/dist/chunk-6hmnaza7.js +4473 -0
  119. package/dist/chunk-71t0yan0.js +5 -0
  120. package/dist/chunk-74cv4ta1.js +3 -0
  121. package/dist/chunk-74v15e8z.js +2 -0
  122. package/dist/chunk-7b329e5v.js +3 -0
  123. package/dist/chunk-7q9mwh4v.js +84 -0
  124. package/dist/chunk-866y9d8b.js +8169 -0
  125. package/dist/chunk-8fwerspy.js +2 -0
  126. package/dist/chunk-8mjdpr94.js +147 -0
  127. package/dist/chunk-92mj1t26.js +60 -0
  128. package/dist/chunk-9b22663r.js +2 -0
  129. package/dist/chunk-9hjdgm4d.js +2 -0
  130. package/dist/chunk-9n0gvfrg.js +4 -0
  131. package/dist/chunk-9wr7zcad.js +18 -0
  132. package/dist/chunk-9y0g8kzt.js +358 -0
  133. package/dist/chunk-a0nfbmeh.js +3 -0
  134. package/dist/chunk-acn1b56m.js +1280 -0
  135. package/dist/chunk-awkq3xfx.js +2 -0
  136. package/dist/chunk-b6ej2fdf.js +1814 -0
  137. package/dist/chunk-b8rrnqry.js +2 -0
  138. package/dist/chunk-bfqfs07m.js +3022 -0
  139. package/dist/chunk-bs6kapy7.js +2 -0
  140. package/dist/chunk-btav940g.js +2 -0
  141. package/dist/chunk-bz820epz.js +3 -0
  142. package/dist/chunk-ccspd3mc.js +2 -0
  143. package/dist/chunk-csbgwaa5.js +2 -0
  144. package/dist/chunk-d8t4sjsp.js +2 -0
  145. package/dist/chunk-dap191q2.js +2 -0
  146. package/dist/chunk-de7fye10.js +4 -0
  147. package/dist/chunk-dgrt76d2.js +2 -0
  148. package/dist/chunk-dhh5q7qt.js +3 -0
  149. package/dist/chunk-dsffsqnt.js +2 -0
  150. package/dist/chunk-dtq7y5ym.js +2 -0
  151. package/dist/chunk-fed3xsp9.js +3 -0
  152. package/dist/chunk-ferav3bw.js +19 -0
  153. package/dist/chunk-fvhm8psm.js +3 -0
  154. package/dist/chunk-g4vpzv6b.js +2 -0
  155. package/dist/chunk-g9csmj0s.js +2 -0
  156. package/dist/chunk-gtcrpmz1.js +2 -0
  157. package/dist/chunk-h4xh8cms.js +4 -0
  158. package/dist/chunk-h8yqsz9m.js +2 -0
  159. package/dist/chunk-hcq5dw7a.js +2 -0
  160. package/dist/chunk-hm0xha6c.js +12 -0
  161. package/dist/chunk-hpybjwwf.js +8 -0
  162. package/dist/chunk-jegt35zh.js +2 -0
  163. package/dist/chunk-jr3jp3ev.js +8 -0
  164. package/dist/chunk-k56rjjc0.js +24 -0
  165. package/dist/chunk-kdh37tp8.js +194 -0
  166. package/dist/chunk-kxzb4et3.js +29 -0
  167. package/dist/chunk-mf4n3x1j.js +14 -0
  168. package/dist/chunk-mkd9kjgb.js +3 -0
  169. package/dist/chunk-mxfh1nxg.js +2 -0
  170. package/dist/chunk-n3ggrhb3.js +3 -0
  171. package/dist/chunk-nkb3scg6.js +8 -0
  172. package/dist/chunk-nnd4wq8j.js +231 -0
  173. package/dist/chunk-nsp1cw38.js +11 -0
  174. package/dist/chunk-nx5qkm8k.js +30 -0
  175. package/dist/chunk-p3242nck.js +2 -0
  176. package/dist/chunk-p98kfh94.js +2 -0
  177. package/dist/chunk-pkaabd8h.js +3 -0
  178. package/dist/chunk-pzm13sdc.js +3 -0
  179. package/dist/chunk-q4p5k2p3.js +2 -0
  180. package/dist/chunk-q9n5swx7.js +3 -0
  181. package/dist/chunk-qc1f74ek.js +3 -0
  182. package/dist/chunk-qpyjak7z.js +2 -0
  183. package/dist/chunk-qr82je1m.js +22 -0
  184. package/dist/chunk-qy73j6m4.js +288 -0
  185. package/dist/chunk-qzkhpsam.js +505 -0
  186. package/dist/chunk-r3ayvdz3.js +2 -0
  187. package/dist/chunk-r7r66978.js +2 -0
  188. package/dist/chunk-rbb7dvja.js +30 -0
  189. package/dist/chunk-refwkt87.js +71 -0
  190. package/dist/chunk-rj4kajww.js +2 -0
  191. package/dist/chunk-rp4rjjmf.js +2 -0
  192. package/dist/chunk-se0p17c2.js +898 -0
  193. package/dist/chunk-sj9pmene.js +2 -0
  194. package/dist/chunk-sscwkffs.js +2 -0
  195. package/dist/chunk-svpqxn2c.js +2 -0
  196. package/dist/chunk-t6nseeb9.js +351 -0
  197. package/dist/chunk-t8y1ggdy.js +2 -0
  198. package/dist/chunk-tndhnk9e.js +2 -0
  199. package/dist/chunk-v5e1gxwm.js +3 -0
  200. package/dist/chunk-vqxmxgaj.js +4 -0
  201. package/dist/chunk-vrrax298.js +2 -0
  202. package/dist/chunk-w3ycm4na.js +3 -0
  203. package/dist/chunk-wcm80anz.js +321 -0
  204. package/dist/chunk-wrzwgkbx.js +22 -0
  205. package/dist/chunk-x650vjcp.js +302 -0
  206. package/dist/chunk-xgnc1wy6.js +116 -0
  207. package/dist/chunk-xpp135ad.js +11 -0
  208. package/dist/chunk-xttsqmkm.js +216 -0
  209. package/dist/chunk-y11cxbxd.js +3757 -0
  210. package/dist/chunk-y7m2dpd3.js +341 -0
  211. package/dist/chunk-y98jsjqq.js +2 -0
  212. package/dist/chunk-ya386h70.js +2 -0
  213. package/dist/chunk-ydrz60kr.js +2 -0
  214. package/dist/chunk-ypmqf7tm.js +4 -0
  215. package/dist/chunk-z4jhj5e5.js +28 -0
  216. package/dist/chunk-zg75gjns.js +2 -0
  217. package/dist/chunk-zqqx1qaj.js +2 -0
  218. package/dist/cli-flags.d.ts +34 -0
  219. package/dist/cli-flags.js +20 -0
  220. package/dist/cli.js +174 -0
  221. package/dist/client/directive.d.ts +17 -0
  222. package/dist/client/directive.js +14 -0
  223. package/dist/client/index.d.ts +7 -0
  224. package/dist/client/index.js +2 -0
  225. package/dist/client-helpers.d.ts +317 -0
  226. package/dist/client-helpers.js +312 -0
  227. package/dist/client-script-bundler.d.ts +103 -0
  228. package/dist/client-script-bundler.js +390 -0
  229. package/dist/client-script.d.ts +215 -0
  230. package/dist/client-script.js +865 -0
  231. package/dist/client.d.ts +21 -0
  232. package/dist/client.js +73 -0
  233. package/dist/codemod.d.ts +33 -0
  234. package/dist/codemod.js +244 -0
  235. package/dist/color-mode-boot.d.ts +92 -0
  236. package/dist/color-mode-boot.js +72 -0
  237. package/dist/component-client-factories.d.ts +33 -0
  238. package/dist/component-client-factories.js +77 -0
  239. package/dist/component-hmr.d.ts +107 -0
  240. package/dist/component-hmr.js +585 -0
  241. package/dist/component-library.d.ts +38 -0
  242. package/dist/component-library.js +994 -0
  243. package/dist/component-processing.d.ts +198 -0
  244. package/dist/component-processing.js +677 -0
  245. package/dist/component-registry.d.ts +127 -0
  246. package/dist/component-registry.js +90 -0
  247. package/dist/component-renderer.d.ts +52 -0
  248. package/dist/component-renderer.js +790 -0
  249. package/dist/components/StxImage.stx +12 -0
  250. package/dist/components/StxLink.stx +18 -0
  251. package/dist/components.d.ts +28 -0
  252. package/dist/components.js +213 -0
  253. package/dist/composable-loader.d.ts +62 -0
  254. package/dist/composable-loader.js +190 -0
  255. package/dist/composables/index.d.ts +417 -0
  256. package/dist/composables/index.js +222 -0
  257. package/dist/composables/use-battery.d.ts +46 -0
  258. package/dist/composables/use-battery.js +101 -0
  259. package/dist/composables/use-broadcast-channel.d.ts +59 -0
  260. package/dist/composables/use-broadcast-channel.js +80 -0
  261. package/dist/composables/use-channel.d.ts +67 -0
  262. package/dist/composables/use-channel.js +124 -0
  263. package/dist/composables/use-clipboard.d.ts +30 -0
  264. package/dist/composables/use-clipboard.js +90 -0
  265. package/dist/composables/use-color-mode.d.ts +67 -0
  266. package/dist/composables/use-color-mode.js +152 -0
  267. package/dist/composables/use-cookie.d.ts +59 -0
  268. package/dist/composables/use-cookie.js +86 -0
  269. package/dist/composables/use-device-orientation.d.ts +116 -0
  270. package/dist/composables/use-device-orientation.js +181 -0
  271. package/dist/composables/use-event-listener.d.ts +35 -0
  272. package/dist/composables/use-event-listener.js +27 -0
  273. package/dist/composables/use-event-source.d.ts +90 -0
  274. package/dist/composables/use-event-source.js +166 -0
  275. package/dist/composables/use-eye-dropper.d.ts +117 -0
  276. package/dist/composables/use-eye-dropper.js +142 -0
  277. package/dist/composables/use-fetch.d.ts +59 -0
  278. package/dist/composables/use-fetch.js +273 -0
  279. package/dist/composables/use-form.d.ts +91 -0
  280. package/dist/composables/use-form.js +112 -0
  281. package/dist/composables/use-fullscreen.d.ts +47 -0
  282. package/dist/composables/use-fullscreen.js +110 -0
  283. package/dist/composables/use-geolocation.d.ts +62 -0
  284. package/dist/composables/use-geolocation.js +101 -0
  285. package/dist/composables/use-idle.d.ts +102 -0
  286. package/dist/composables/use-idle.js +182 -0
  287. package/dist/composables/use-intersection-observer.d.ts +83 -0
  288. package/dist/composables/use-intersection-observer.js +168 -0
  289. package/dist/composables/use-keyboard.d.ts +100 -0
  290. package/dist/composables/use-keyboard.js +224 -0
  291. package/dist/composables/use-media-query.d.ts +56 -0
  292. package/dist/composables/use-media-query.js +62 -0
  293. package/dist/composables/use-meta.d.ts +35 -0
  294. package/dist/composables/use-meta.js +48 -0
  295. package/dist/composables/use-mouse.d.ts +65 -0
  296. package/dist/composables/use-mouse.js +286 -0
  297. package/dist/composables/use-mutation-observer.d.ts +101 -0
  298. package/dist/composables/use-mutation-observer.js +129 -0
  299. package/dist/composables/use-network.d.ts +40 -0
  300. package/dist/composables/use-network.js +85 -0
  301. package/dist/composables/use-notification.d.ts +98 -0
  302. package/dist/composables/use-notification.js +94 -0
  303. package/dist/composables/use-permissions.d.ts +119 -0
  304. package/dist/composables/use-permissions.js +132 -0
  305. package/dist/composables/use-query.d.ts +48 -0
  306. package/dist/composables/use-query.js +0 -0
  307. package/dist/composables/use-resize-observer.d.ts +60 -0
  308. package/dist/composables/use-resize-observer.js +157 -0
  309. package/dist/composables/use-router.d.ts +80 -0
  310. package/dist/composables/use-router.js +105 -0
  311. package/dist/composables/use-scroll-lock.d.ts +13 -0
  312. package/dist/composables/use-scroll-lock.js +55 -0
  313. package/dist/composables/use-share.d.ts +74 -0
  314. package/dist/composables/use-share.js +104 -0
  315. package/dist/composables/use-speech.d.ts +117 -0
  316. package/dist/composables/use-speech.js +294 -0
  317. package/dist/composables/use-storage.d.ts +69 -0
  318. package/dist/composables/use-storage.js +196 -0
  319. package/dist/composables/use-text-selection.d.ts +121 -0
  320. package/dist/composables/use-text-selection.js +205 -0
  321. package/dist/composables/use-timer.d.ts +92 -0
  322. package/dist/composables/use-timer.js +193 -0
  323. package/dist/composables/use-utilities.d.ts +103 -0
  324. package/dist/composables/use-utilities.js +176 -0
  325. package/dist/composables/use-wake-lock.d.ts +85 -0
  326. package/dist/composables/use-wake-lock.js +122 -0
  327. package/dist/composables/use-websocket.d.ts +70 -0
  328. package/dist/composables/use-websocket.js +165 -0
  329. package/dist/composables/use-window.d.ts +84 -0
  330. package/dist/composables/use-window.js +163 -0
  331. package/dist/composables.d.ts +287 -0
  332. package/dist/composables.js +562 -0
  333. package/dist/composition-api.d.ts +197 -0
  334. package/dist/composition-api.js +199 -0
  335. package/dist/compression.d.ts +30 -0
  336. package/dist/compression.js +107 -0
  337. package/dist/computed.d.ts +138 -0
  338. package/dist/computed.js +382 -0
  339. package/dist/conditionals.d.ts +48 -0
  340. package/dist/conditionals.js +626 -0
  341. package/dist/config.d.ts +77 -0
  342. package/dist/config.js +828 -0
  343. package/dist/cookie-serialize.d.ts +40 -0
  344. package/dist/cookie-serialize.js +18 -0
  345. package/dist/craft-bridge.d.ts +525 -0
  346. package/dist/craft-bridge.js +511 -0
  347. package/dist/craft-compiler.d.ts +245 -0
  348. package/dist/craft-compiler.js +810 -0
  349. package/dist/craft-components.d.ts +739 -0
  350. package/dist/craft-components.js +1074 -0
  351. package/dist/craft-entry.d.ts +6 -0
  352. package/dist/craft-entry.js +9 -0
  353. package/dist/craft-ssr.d.ts +147 -0
  354. package/dist/craft-ssr.js +559 -0
  355. package/dist/craft.js +9 -0
  356. package/dist/csp.d.ts +295 -0
  357. package/dist/csp.js +220 -0
  358. package/dist/csrf.d.ts +38 -0
  359. package/dist/csrf.js +38 -0
  360. package/dist/custom-directives.d.ts +5 -0
  361. package/dist/custom-directives.js +136 -0
  362. package/dist/database.d.ts +391 -0
  363. package/dist/database.js +5 -0
  364. package/dist/defer.d.ts +28 -0
  365. package/dist/defer.js +156 -0
  366. package/dist/deploy/config-generators.d.ts +75 -0
  367. package/dist/deploy/config-generators.js +214 -0
  368. package/dist/deploy/index.d.ts +88 -0
  369. package/dist/deploy/index.js +203 -0
  370. package/dist/deploy/netlify.d.ts +109 -0
  371. package/dist/deploy/netlify.js +167 -0
  372. package/dist/desktop.d.ts +16 -0
  373. package/dist/desktop.js +1 -0
  374. package/dist/dev-server/index.d.ts +22 -0
  375. package/dist/dev-server/index.js +7 -0
  376. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  377. package/dist/dev-server/keyboard-shortcuts.js +81 -0
  378. package/dist/dev-server/native-window.d.ts +59 -0
  379. package/dist/dev-server/native-window.js +91 -0
  380. package/dist/dev-server/port-utils.d.ts +27 -0
  381. package/dist/dev-server/port-utils.js +40 -0
  382. package/dist/dev-server/serve-app.d.ts +15 -0
  383. package/dist/dev-server/serve-app.js +727 -0
  384. package/dist/dev-server/serve-file.d.ts +3 -0
  385. package/dist/dev-server/serve-file.js +443 -0
  386. package/dist/dev-server/serve-markdown.d.ts +3 -0
  387. package/dist/dev-server/serve-markdown.js +284 -0
  388. package/dist/dev-server/serve-multi.d.ts +5 -0
  389. package/dist/dev-server/serve-multi.js +596 -0
  390. package/dist/dev-server/terminal-colors.d.ts +56 -0
  391. package/dist/dev-server/terminal-colors.js +45 -0
  392. package/dist/dev-server/theme-selector.d.ts +32 -0
  393. package/dist/dev-server/theme-selector.js +111 -0
  394. package/dist/dev-server/ts-css.d.ts +108 -0
  395. package/dist/dev-server/ts-css.js +438 -0
  396. package/dist/dev-server/types.d.ts +99 -0
  397. package/dist/dev-server/types.js +43 -0
  398. package/dist/dev-server.d.ts +6 -0
  399. package/dist/dev-server.js +4 -0
  400. package/dist/devtools.d.ts +182 -0
  401. package/dist/devtools.js +593 -0
  402. package/dist/directive-api.d.ts +154 -0
  403. package/dist/directive-api.js +355 -0
  404. package/dist/docs.d.ts +56 -0
  405. package/dist/docs.js +567 -0
  406. package/dist/doctor.d.ts +29 -0
  407. package/dist/doctor.js +123 -0
  408. package/dist/document-shell.d.ts +218 -0
  409. package/dist/document-shell.js +338 -0
  410. package/dist/dynamic-components.d.ts +23 -0
  411. package/dist/dynamic-components.js +197 -0
  412. package/dist/edge-runtime.d.ts +193 -0
  413. package/dist/edge-runtime.js +525 -0
  414. package/dist/env.d.ts +3 -0
  415. package/dist/env.js +9 -0
  416. package/dist/error-boundaries.d.ts +78 -0
  417. package/dist/error-boundaries.js +281 -0
  418. package/dist/error-handling.d.ts +14 -0
  419. package/dist/error-handling.js +1 -0
  420. package/dist/errors/codes.d.ts +92 -0
  421. package/dist/errors/codes.js +97 -0
  422. package/dist/errors/formatter.d.ts +84 -0
  423. package/dist/errors/formatter.js +196 -0
  424. package/dist/errors/index.d.ts +12 -0
  425. package/dist/errors/index.js +44 -0
  426. package/dist/errors/logger.d.ts +135 -0
  427. package/dist/errors/logger.js +250 -0
  428. package/dist/errors/sanitizer.d.ts +73 -0
  429. package/dist/errors/sanitizer.js +181 -0
  430. package/dist/errors/types.d.ts +92 -0
  431. package/dist/errors/types.js +86 -0
  432. package/dist/events.d.ts +145 -0
  433. package/dist/events.js +396 -0
  434. package/dist/expressions.d.ts +180 -0
  435. package/dist/expressions.js +719 -0
  436. package/dist/find-body-tag.d.ts +50 -0
  437. package/dist/find-body-tag.js +57 -0
  438. package/dist/formatter.d.ts +19 -0
  439. package/dist/formatter.js +265 -0
  440. package/dist/forms-validation.d.ts +189 -0
  441. package/dist/forms-validation.js +421 -0
  442. package/dist/forms.d.ts +224 -0
  443. package/dist/forms.js +729 -0
  444. package/dist/fragment-container.d.ts +57 -0
  445. package/dist/fragment-container.js +123 -0
  446. package/dist/framework-composables.d.ts +73 -0
  447. package/dist/framework-composables.js +126 -0
  448. package/dist/head-injection.d.ts +61 -0
  449. package/dist/head-injection.js +28 -0
  450. package/dist/head.d.ts +282 -0
  451. package/dist/head.js +231 -0
  452. package/dist/heatmap.d.ts +206 -0
  453. package/dist/heatmap.js +566 -0
  454. package/dist/hot-reload.d.ts +87 -0
  455. package/dist/hot-reload.js +373 -0
  456. package/dist/html-masking.d.ts +125 -0
  457. package/dist/html-masking.js +196 -0
  458. package/dist/hydration-runtime.d.ts +44 -0
  459. package/dist/hydration-runtime.js +195 -0
  460. package/dist/hydration.d.ts +135 -0
  461. package/dist/hydration.js +654 -0
  462. package/dist/i18n.d.ts +342 -0
  463. package/dist/i18n.js +678 -0
  464. package/dist/image-optimization/auto-sibling.d.ts +42 -0
  465. package/dist/image-optimization/auto-sibling.js +88 -0
  466. package/dist/image-optimization/build-plugin.d.ts +54 -0
  467. package/dist/image-optimization/build-plugin.js +241 -0
  468. package/dist/image-optimization/component.d.ts +46 -0
  469. package/dist/image-optimization/component.js +244 -0
  470. package/dist/image-optimization/directive.d.ts +30 -0
  471. package/dist/image-optimization/directive.js +203 -0
  472. package/dist/image-optimization/index.d.ts +156 -0
  473. package/dist/image-optimization/index.js +54 -0
  474. package/dist/image-optimization/processor.d.ts +140 -0
  475. package/dist/image-optimization/processor.js +262 -0
  476. package/dist/image-optimization/serve.d.ts +54 -0
  477. package/dist/image-optimization/serve.js +102 -0
  478. package/dist/import-rebase.d.ts +16 -0
  479. package/dist/import-rebase.js +16 -0
  480. package/dist/imported-signals.d.ts +43 -0
  481. package/dist/imported-signals.js +35 -0
  482. package/dist/includes.d.ts +171 -0
  483. package/dist/includes.js +764 -0
  484. package/dist/index.d.ts +365 -0
  485. package/dist/index.js +202 -0
  486. package/dist/init.d.ts +39 -0
  487. package/dist/init.js +505 -0
  488. package/dist/inline-assets.d.ts +28 -0
  489. package/dist/inline-assets.js +82 -0
  490. package/dist/interactive.d.ts +14 -0
  491. package/dist/interactive.js +383 -0
  492. package/dist/internal-markdown.d.ts +22 -0
  493. package/dist/internal-markdown.js +141 -0
  494. package/dist/island-chunking.d.ts +48 -0
  495. package/dist/island-chunking.js +52 -0
  496. package/dist/isolated-build.d.ts +12 -0
  497. package/dist/isolated-build.js +18 -0
  498. package/dist/js-ts.d.ts +10 -0
  499. package/dist/js-ts.js +60 -0
  500. package/dist/jsx-runtime.d.ts +92 -0
  501. package/dist/jsx-runtime.js +289 -0
  502. package/dist/keep-alive.d.ts +108 -0
  503. package/dist/keep-alive.js +421 -0
  504. package/dist/layout-types.d.ts +45 -0
  505. package/dist/layout-types.js +56 -0
  506. package/dist/lazy-loader.d.ts +90 -0
  507. package/dist/lazy-loader.js +245 -0
  508. package/dist/lazy-module.d.ts +11 -0
  509. package/dist/lazy-module.js +18 -0
  510. package/dist/loading-indicator.d.ts +50 -0
  511. package/dist/loading-indicator.js +322 -0
  512. package/dist/loops.d.ts +91 -0
  513. package/dist/loops.js +690 -0
  514. package/dist/manifest.d.ts +41 -0
  515. package/dist/manifest.js +31 -0
  516. package/dist/markdown-view.d.ts +25 -0
  517. package/dist/markdown-view.js +39 -0
  518. package/dist/markdown.d.ts +10 -0
  519. package/dist/markdown.js +68 -0
  520. package/dist/media/client/blur-up.d.ts +66 -0
  521. package/dist/media/client/blur-up.js +217 -0
  522. package/dist/media/client/index.d.ts +93 -0
  523. package/dist/media/client/index.js +53 -0
  524. package/dist/media/client/lazy-load.d.ts +74 -0
  525. package/dist/media/client/lazy-load.js +283 -0
  526. package/dist/media/client/upload-handler.d.ts +80 -0
  527. package/dist/media/client/upload-handler.js +354 -0
  528. package/dist/media/image/component.d.ts +60 -0
  529. package/dist/media/image/component.js +574 -0
  530. package/dist/media/image/directive.d.ts +23 -0
  531. package/dist/media/image/directive.js +160 -0
  532. package/dist/media/image/editing.d.ts +212 -0
  533. package/dist/media/image/editing.js +193 -0
  534. package/dist/media/image/index.d.ts +142 -0
  535. package/dist/media/image/index.js +80 -0
  536. package/dist/media/image/placeholder.d.ts +89 -0
  537. package/dist/media/image/placeholder.js +188 -0
  538. package/dist/media/image/processor/cache.d.ts +53 -0
  539. package/dist/media/image/processor/cache.js +51 -0
  540. package/dist/media/image/processor/index.d.ts +11 -0
  541. package/dist/media/image/processor/index.js +3 -0
  542. package/dist/media/image/processor/optimizer.d.ts +24 -0
  543. package/dist/media/image/processor/optimizer.js +202 -0
  544. package/dist/media/image/processor/responsive.d.ts +28 -0
  545. package/dist/media/image/processor/responsive.js +162 -0
  546. package/dist/media/image/srcset.d.ts +157 -0
  547. package/dist/media/image/srcset.js +194 -0
  548. package/dist/media/index.d.ts +331 -0
  549. package/dist/media/index.js +198 -0
  550. package/dist/media/manager/embed.d.ts +25 -0
  551. package/dist/media/manager/embed.js +253 -0
  552. package/dist/media/protected/component.d.ts +33 -0
  553. package/dist/media/protected/component.js +235 -0
  554. package/dist/media/protected/index.d.ts +47 -0
  555. package/dist/media/protected/index.js +20 -0
  556. package/dist/media/protected/signature.d.ts +72 -0
  557. package/dist/media/protected/signature.js +205 -0
  558. package/dist/media/shared/cache.d.ts +76 -0
  559. package/dist/media/shared/cache.js +132 -0
  560. package/dist/media/shared/hash.d.ts +31 -0
  561. package/dist/media/shared/hash.js +35 -0
  562. package/dist/media/shared/index.d.ts +7 -0
  563. package/dist/media/shared/index.js +2 -0
  564. package/dist/media/types.d.ts +1477 -0
  565. package/dist/media/types.js +0 -0
  566. package/dist/media/upload/component.d.ts +9 -0
  567. package/dist/media/upload/component.js +320 -0
  568. package/dist/media/upload/index.d.ts +8 -0
  569. package/dist/media/upload/index.js +1 -0
  570. package/dist/media/video/directive.d.ts +23 -0
  571. package/dist/media/video/directive.js +142 -0
  572. package/dist/media/video/index.d.ts +76 -0
  573. package/dist/media/video/index.js +583 -0
  574. package/dist/media/video/processor/cache.d.ts +55 -0
  575. package/dist/media/video/processor/cache.js +52 -0
  576. package/dist/media/video/processor/index.d.ts +12 -0
  577. package/dist/media/video/processor/index.js +4 -0
  578. package/dist/media/video/processor/streaming.d.ts +26 -0
  579. package/dist/media/video/processor/streaming.js +197 -0
  580. package/dist/media/video/processor/thumbnail.d.ts +35 -0
  581. package/dist/media/video/processor/thumbnail.js +134 -0
  582. package/dist/media/video/processor/transcoder.d.ts +19 -0
  583. package/dist/media/video/processor/transcoder.js +283 -0
  584. package/dist/menubar.d.ts +65 -0
  585. package/dist/menubar.js +99 -0
  586. package/dist/method-spoofing.d.ts +20 -0
  587. package/dist/method-spoofing.js +17 -0
  588. package/dist/middleware.d.ts +112 -0
  589. package/dist/middleware.js +40 -0
  590. package/dist/misc-directives.d.ts +55 -0
  591. package/dist/misc-directives.js +328 -0
  592. package/dist/native-build.d.ts +88 -0
  593. package/dist/native-build.js +575 -0
  594. package/dist/owned-routes.d.ts +42 -0
  595. package/dist/owned-routes.js +26 -0
  596. package/dist/page-action.d.ts +73 -0
  597. package/dist/page-action.js +91 -0
  598. package/dist/page-meta.d.ts +38 -0
  599. package/dist/page-meta.js +16 -0
  600. package/dist/page-response.d.ts +120 -0
  601. package/dist/page-response.js +117 -0
  602. package/dist/parser/directive-parser.d.ts +119 -0
  603. package/dist/parser/directive-parser.js +249 -0
  604. package/dist/parser/expression-parser.d.ts +58 -0
  605. package/dist/parser/expression-parser.js +358 -0
  606. package/dist/parser/index.d.ts +13 -0
  607. package/dist/parser/index.js +23 -0
  608. package/dist/parser/tokenizer.d.ts +77 -0
  609. package/dist/parser/tokenizer.js +534 -0
  610. package/dist/partial-hydration.d.ts +123 -0
  611. package/dist/partial-hydration.js +427 -0
  612. package/dist/performance-utils.d.ts +318 -0
  613. package/dist/performance-utils.js +466 -0
  614. package/dist/placeholder.d.ts +54 -0
  615. package/dist/placeholder.js +35 -0
  616. package/dist/plugin-system.d.ts +301 -0
  617. package/dist/plugin-system.js +214 -0
  618. package/dist/plugin.d.ts +3 -0
  619. package/dist/plugin.js +174 -0
  620. package/dist/precompiler.d.ts +43 -0
  621. package/dist/precompiler.js +670 -0
  622. package/dist/process.d.ts +16 -0
  623. package/dist/process.js +879 -0
  624. package/dist/production-build.d.ts +163 -0
  625. package/dist/production-build.js +596 -0
  626. package/dist/production-builder.d.ts +42 -0
  627. package/dist/production-builder.js +146 -0
  628. package/dist/production-server.d.ts +19 -0
  629. package/dist/production-server.js +208 -0
  630. package/dist/prop-sentinels.d.ts +31 -0
  631. package/dist/prop-sentinels.js +7 -0
  632. package/dist/props.d.ts +216 -0
  633. package/dist/props.js +224 -0
  634. package/dist/public-env.d.ts +29 -0
  635. package/dist/public-env.js +19 -0
  636. package/dist/pwa/audit.d.ts +42 -0
  637. package/dist/pwa/audit.js +255 -0
  638. package/dist/pwa/directives.d.ts +38 -0
  639. package/dist/pwa/directives.js +332 -0
  640. package/dist/pwa/icons.d.ts +42 -0
  641. package/dist/pwa/icons.js +109 -0
  642. package/dist/pwa/index.d.ts +104 -0
  643. package/dist/pwa/index.js +47 -0
  644. package/dist/pwa/inject.d.ts +32 -0
  645. package/dist/pwa/inject.js +102 -0
  646. package/dist/pwa/manifest.d.ts +104 -0
  647. package/dist/pwa/manifest.js +186 -0
  648. package/dist/pwa/offline.d.ts +8 -0
  649. package/dist/pwa/offline.js +259 -0
  650. package/dist/pwa/precache.d.ts +35 -0
  651. package/dist/pwa/precache.js +116 -0
  652. package/dist/pwa/service-worker.d.ts +33 -0
  653. package/dist/pwa/service-worker.js +860 -0
  654. package/dist/pwa/workbox-strategies.d.ts +100 -0
  655. package/dist/pwa/workbox-strategies.js +167 -0
  656. package/dist/pwa/workbox.d.ts +51 -0
  657. package/dist/pwa/workbox.js +382 -0
  658. package/dist/pwa.d.ts +52 -0
  659. package/dist/pwa.js +236 -0
  660. package/dist/reactive-bindings.d.ts +47 -0
  661. package/dist/reactive-bindings.js +268 -0
  662. package/dist/reactive-tracking.d.ts +81 -0
  663. package/dist/reactive-tracking.js +49 -0
  664. package/dist/reactive.d.ts +117 -0
  665. package/dist/reactive.js +593 -0
  666. package/dist/reactivity.d.ts +206 -0
  667. package/dist/reactivity.js +574 -0
  668. package/dist/release.d.ts +1 -0
  669. package/dist/release.js +1 -0
  670. package/dist/render-memo.d.ts +40 -0
  671. package/dist/render-memo.js +33 -0
  672. package/dist/render.d.ts +54 -0
  673. package/dist/render.js +153 -0
  674. package/dist/resolve-stx-targets.d.ts +49 -0
  675. package/dist/resolve-stx-targets.js +38 -0
  676. package/dist/route-middleware.d.ts +2 -0
  677. package/dist/route-middleware.js +17 -0
  678. package/dist/route-types.d.ts +134 -0
  679. package/dist/route-types.js +24 -0
  680. package/dist/router.d.ts +9 -0
  681. package/dist/router.js +9 -0
  682. package/dist/routes.d.ts +6 -0
  683. package/dist/routes.js +14 -0
  684. package/dist/runtime-globals.d.ts +236 -0
  685. package/dist/runtime-globals.js +230 -0
  686. package/dist/runtime-injection.d.ts +113 -0
  687. package/dist/runtime-injection.js +156 -0
  688. package/dist/runtime.d.ts +140 -0
  689. package/dist/runtime.js +94 -0
  690. package/dist/safe-evaluator.d.ts +165 -0
  691. package/dist/safe-evaluator.js +461 -0
  692. package/dist/scaffolding.d.ts +113 -0
  693. package/dist/scaffolding.js +897 -0
  694. package/dist/screenshot.d.ts +22 -0
  695. package/dist/screenshot.js +100 -0
  696. package/dist/script-classifier.d.ts +41 -0
  697. package/dist/script-classifier.js +51 -0
  698. package/dist/script-emit.d.ts +50 -0
  699. package/dist/script-emit.js +11 -0
  700. package/dist/script-json.d.ts +36 -0
  701. package/dist/script-json.js +6 -0
  702. package/dist/script-validation.d.ts +26 -0
  703. package/dist/script-validation.js +179 -0
  704. package/dist/seo.d.ts +225 -0
  705. package/dist/seo.js +486 -0
  706. package/dist/serve.d.ts +44 -0
  707. package/dist/serve.js +233 -0
  708. package/dist/server-bindings.d.ts +39 -0
  709. package/dist/server-bindings.js +171 -0
  710. package/dist/server-components.d.ts +138 -0
  711. package/dist/server-components.js +427 -0
  712. package/dist/sfc-template.d.ts +17 -0
  713. package/dist/sfc-template.js +32 -0
  714. package/dist/signal-processing.d.ts +222 -0
  715. package/dist/signal-processing.js +1081 -0
  716. package/dist/signals-api.d.ts +459 -0
  717. package/dist/signals-api.js +172 -0
  718. package/dist/signals.d.ts +41 -0
  719. package/dist/signals.js +8233 -0
  720. package/dist/site-builder/build.d.ts +18 -0
  721. package/dist/site-builder/build.js +252 -0
  722. package/dist/site-builder/i18n.d.ts +104 -0
  723. package/dist/site-builder/i18n.js +150 -0
  724. package/dist/site-builder/index.d.ts +27 -0
  725. package/dist/site-builder/index.js +16 -0
  726. package/dist/site-builder/robots.d.ts +2 -0
  727. package/dist/site-builder/robots.js +26 -0
  728. package/dist/site-builder/router.d.ts +10 -0
  729. package/dist/site-builder/router.js +27 -0
  730. package/dist/site-builder/seo.d.ts +8 -0
  731. package/dist/site-builder/seo.js +67 -0
  732. package/dist/site-builder/sitemap.d.ts +10 -0
  733. package/dist/site-builder/sitemap.js +26 -0
  734. package/dist/site-builder/theme.d.ts +12 -0
  735. package/dist/site-builder/theme.js +38 -0
  736. package/dist/site-builder/types.d.ts +74 -0
  737. package/dist/site-builder/types.js +0 -0
  738. package/dist/site-url.d.ts +46 -0
  739. package/dist/site-url.js +70 -0
  740. package/dist/slots.d.ts +129 -0
  741. package/dist/slots.js +286 -0
  742. package/dist/source-maps.d.ts +98 -0
  743. package/dist/source-maps.js +350 -0
  744. package/dist/source-signature.d.ts +45 -0
  745. package/dist/source-signature.js +20 -0
  746. package/dist/spa-nav.d.ts +49 -0
  747. package/dist/spa-nav.js +12 -0
  748. package/dist/spa-shell.d.ts +21 -0
  749. package/dist/spa-shell.js +34 -0
  750. package/dist/ssg.d.ts +357 -0
  751. package/dist/ssg.js +94 -0
  752. package/dist/ssr.d.ts +116 -0
  753. package/dist/ssr.js +339 -0
  754. package/dist/state-dir.d.ts +36 -0
  755. package/dist/state-dir.js +22 -0
  756. package/dist/state-management.d.ts +299 -0
  757. package/dist/state-management.js +519 -0
  758. package/dist/store-imports.d.ts +47 -0
  759. package/dist/store-imports.js +16 -0
  760. package/dist/store-loader.d.ts +15 -0
  761. package/dist/store-loader.js +111 -0
  762. package/dist/stores-client.d.ts +70 -0
  763. package/dist/stores-client.js +132 -0
  764. package/dist/story/addons.d.ts +123 -0
  765. package/dist/story/addons.js +261 -0
  766. package/dist/story/analytics.d.ts +163 -0
  767. package/dist/story/analytics.js +235 -0
  768. package/dist/story/auto-stories.d.ts +38 -0
  769. package/dist/story/auto-stories.js +158 -0
  770. package/dist/story/bookmarks.d.ts +102 -0
  771. package/dist/story/bookmarks.js +277 -0
  772. package/dist/story/bun-test.d.ts +45 -0
  773. package/dist/story/bun-test.js +102 -0
  774. package/dist/story/cli.d.ts +132 -0
  775. package/dist/story/cli.js +155 -0
  776. package/dist/story/collect/analyzer.d.ts +33 -0
  777. package/dist/story/collect/analyzer.js +305 -0
  778. package/dist/story/collect/index.d.ts +31 -0
  779. package/dist/story/collect/index.js +27 -0
  780. package/dist/story/collect/parser.d.ts +17 -0
  781. package/dist/story/collect/parser.js +129 -0
  782. package/dist/story/collect/scanner.d.ts +17 -0
  783. package/dist/story/collect/scanner.js +101 -0
  784. package/dist/story/collect/tree.d.ts +24 -0
  785. package/dist/story/collect/tree.js +110 -0
  786. package/dist/story/commands/build.d.ts +19 -0
  787. package/dist/story/commands/build.js +172 -0
  788. package/dist/story/commands/dev.d.ts +23 -0
  789. package/dist/story/commands/dev.js +78 -0
  790. package/dist/story/commands/index.d.ts +9 -0
  791. package/dist/story/commands/index.js +3 -0
  792. package/dist/story/commands/preview.d.ts +21 -0
  793. package/dist/story/commands/preview.js +56 -0
  794. package/dist/story/compiled-output.d.ts +27 -0
  795. package/dist/story/compiled-output.js +151 -0
  796. package/dist/story/composition.d.ts +47 -0
  797. package/dist/story/composition.js +261 -0
  798. package/dist/story/config-watcher.d.ts +33 -0
  799. package/dist/story/config-watcher.js +67 -0
  800. package/dist/story/config.d.ts +29 -0
  801. package/dist/story/config.js +64 -0
  802. package/dist/story/context.d.ts +27 -0
  803. package/dist/story/context.js +27 -0
  804. package/dist/story/controls/index.d.ts +54 -0
  805. package/dist/story/controls/index.js +320 -0
  806. package/dist/story/desktop-preview.d.ts +34 -0
  807. package/dist/story/desktop-preview.js +105 -0
  808. package/dist/story/docs-generator.d.ts +30 -0
  809. package/dist/story/docs-generator.js +187 -0
  810. package/dist/story/errors.d.ts +47 -0
  811. package/dist/story/errors.js +239 -0
  812. package/dist/story/figma-export.d.ts +169 -0
  813. package/dist/story/figma-export.js +224 -0
  814. package/dist/story/generator.d.ts +21 -0
  815. package/dist/story/generator.js +165 -0
  816. package/dist/story/hmr.d.ts +62 -0
  817. package/dist/story/hmr.js +131 -0
  818. package/dist/story/hot-swap.d.ts +46 -0
  819. package/dist/story/hot-swap.js +207 -0
  820. package/dist/story/index.d.ts +99 -0
  821. package/dist/story/index.js +49 -0
  822. package/dist/story/interactions.d.ts +53 -0
  823. package/dist/story/interactions.js +225 -0
  824. package/dist/story/keyboard-shortcuts.d.ts +39 -0
  825. package/dist/story/keyboard-shortcuts.js +345 -0
  826. package/dist/story/output.d.ts +115 -0
  827. package/dist/story/output.js +153 -0
  828. package/dist/story/performance.d.ts +129 -0
  829. package/dist/story/performance.js +252 -0
  830. package/dist/story/presets.d.ts +123 -0
  831. package/dist/story/presets.js +289 -0
  832. package/dist/story/props-validation.d.ts +45 -0
  833. package/dist/story/props-validation.js +215 -0
  834. package/dist/story/renderer.d.ts +69 -0
  835. package/dist/story/renderer.js +209 -0
  836. package/dist/story/search-index.d.ts +47 -0
  837. package/dist/story/search-index.js +106 -0
  838. package/dist/story/search.d.ts +56 -0
  839. package/dist/story/search.js +140 -0
  840. package/dist/story/server.d.ts +31 -0
  841. package/dist/story/server.js +965 -0
  842. package/dist/story/setup.d.ts +56 -0
  843. package/dist/story/setup.js +78 -0
  844. package/dist/story/snapshots.d.ts +65 -0
  845. package/dist/story/snapshots.js +171 -0
  846. package/dist/story/testing.d.ts +83 -0
  847. package/dist/story/testing.js +164 -0
  848. package/dist/story/theme.d.ts +68 -0
  849. package/dist/story/theme.js +170 -0
  850. package/dist/story/ts-css.d.ts +29 -0
  851. package/dist/story/ts-css.js +189 -0
  852. package/dist/story/types.d.ts +342 -0
  853. package/dist/story/types.js +0 -0
  854. package/dist/story/ui/code-panel.d.ts +43 -0
  855. package/dist/story/ui/code-panel.js +175 -0
  856. package/dist/story/ui/controls-panel.d.ts +25 -0
  857. package/dist/story/ui/controls-panel.js +168 -0
  858. package/dist/story/ui/index.d.ts +8 -0
  859. package/dist/story/ui/index.js +4 -0
  860. package/dist/story/ui/navigation.d.ts +55 -0
  861. package/dist/story/ui/navigation.js +250 -0
  862. package/dist/story/ui/preview.d.ts +46 -0
  863. package/dist/story/ui/preview.js +251 -0
  864. package/dist/story/visual-testing.d.ts +45 -0
  865. package/dist/story/visual-testing.js +248 -0
  866. package/dist/streaming.d.ts +238 -0
  867. package/dist/streaming.js +537 -0
  868. package/dist/strict-lint.d.ts +52 -0
  869. package/dist/strict-lint.js +269 -0
  870. package/dist/strip-literals.d.ts +40 -0
  871. package/dist/strip-literals.js +149 -0
  872. package/dist/stx-virtual-ts.d.ts +358 -0
  873. package/dist/stx-virtual-ts.js +670 -0
  874. package/dist/stx.d.ts +924 -0
  875. package/dist/style-scoping.d.ts +42 -0
  876. package/dist/style-scoping.js +82 -0
  877. package/dist/suspense.d.ts +98 -0
  878. package/dist/suspense.js +398 -0
  879. package/dist/teleport.d.ts +31 -0
  880. package/dist/teleport.js +109 -0
  881. package/dist/template-compiler.d.ts +33 -0
  882. package/dist/template-compiler.js +68 -0
  883. package/dist/template-hydrator.d.ts +28 -0
  884. package/dist/template-hydrator.js +95 -0
  885. package/dist/template-tag-balance.d.ts +32 -0
  886. package/dist/template-tag-balance.js +93 -0
  887. package/dist/testing.d.ts +330 -0
  888. package/dist/testing.js +588 -0
  889. package/dist/theme-tokens.d.ts +88 -0
  890. package/dist/theme-tokens.js +71 -0
  891. package/dist/transitions.d.ts +99 -0
  892. package/dist/transitions.js +443 -0
  893. package/dist/ts-css-config.d.ts +71 -0
  894. package/dist/ts-css-config.js +44 -0
  895. package/dist/type-checker.d.ts +85 -0
  896. package/dist/type-checker.js +581 -0
  897. package/dist/typecheck.d.ts +70 -0
  898. package/dist/typecheck.js +365 -0
  899. package/dist/types/component-types.d.ts +248 -0
  900. package/dist/types/component-types.js +0 -0
  901. package/dist/types/config-types.d.ts +938 -0
  902. package/dist/types/config-types.js +0 -0
  903. package/dist/types/context-types.d.ts +122 -0
  904. package/dist/types/context-types.js +0 -0
  905. package/dist/types/csp-types.d.ts +83 -0
  906. package/dist/types/csp-types.js +0 -0
  907. package/dist/types/directive-types.d.ts +315 -0
  908. package/dist/types/directive-types.js +3 -0
  909. package/dist/types/index.d.ts +20 -0
  910. package/dist/types/index.js +1 -0
  911. package/dist/types/pwa-types.d.ts +338 -0
  912. package/dist/types/pwa-types.js +0 -0
  913. package/dist/types.d.ts +27 -0
  914. package/dist/types.js +1 -0
  915. package/dist/typescript-templates.d.ts +156 -0
  916. package/dist/typescript-templates.js +386 -0
  917. package/dist/unresolved-identifiers.d.ts +52 -0
  918. package/dist/unresolved-identifiers.js +148 -0
  919. package/dist/utils.d.ts +112 -0
  920. package/dist/utils.js +1170 -0
  921. package/dist/validator.d.ts +80 -0
  922. package/dist/validator.js +171 -0
  923. package/dist/variable-extractor.d.ts +142 -0
  924. package/dist/variable-extractor.js +1306 -0
  925. package/dist/view-composers.d.ts +171 -0
  926. package/dist/view-composers.js +29 -0
  927. package/dist/virtual-scrolling.d.ts +127 -0
  928. package/dist/virtual-scrolling.js +454 -0
  929. package/dist/visual-editor.d.ts +185 -0
  930. package/dist/visual-editor.js +735 -0
  931. package/dist/visual-testing.d.ts +135 -0
  932. package/dist/visual-testing.js +126 -0
  933. package/dist/vue-template.d.ts +39 -0
  934. package/dist/vue-template.js +476 -0
  935. package/dist/web-components/css-scoping.d.ts +64 -0
  936. package/dist/web-components/css-scoping.js +210 -0
  937. package/dist/web-components/index.d.ts +29 -0
  938. package/dist/web-components/index.js +13 -0
  939. package/dist/web-components/reactive-generator.d.ts +72 -0
  940. package/dist/web-components/reactive-generator.js +484 -0
  941. package/dist/web-components.d.ts +253 -0
  942. package/dist/web-components.js +1466 -0
  943. package/dist/x-element.d.ts +42 -0
  944. package/dist/x-element.js +301 -0
  945. package/package.json +107 -0
  946. package/stx.d.ts +924 -0
package/dist/ssg.d.ts ADDED
@@ -0,0 +1,357 @@
1
+ /**
2
+ * Static Site Generation (SSG) with Incremental Static Regeneration (ISR)
3
+ *
4
+ * Pre-renders pages at build time for optimal performance and SEO.
5
+ * Supports on-demand revalidation for dynamic content.
6
+ *
7
+ * ## Features
8
+ *
9
+ * - Build-time page generation from file-based routes
10
+ * - Dynamic route handling with getStaticPaths()
11
+ * - Incremental Static Regeneration (ISR)
12
+ * - Automatic sitemap generation
13
+ * - RSS feed generation
14
+ * - Content source integrations (Markdown, CMS, API)
15
+ * - Parallel page generation
16
+ * - Build caching for faster rebuilds
17
+ *
18
+ * ## Usage
19
+ *
20
+ * ```typescript
21
+ * import { generateStaticSite, defineStaticPaths } from 'stx/ssg'
22
+ *
23
+ * // Generate entire site
24
+ * await generateStaticSite({
25
+ * pagesDir: 'pages',
26
+ * outputDir: 'dist',
27
+ * revalidate: 3600, // ISR: revalidate every hour
28
+ * })
29
+ * ```
30
+ *
31
+ * For dynamic routes, export getStaticPaths in your template:
32
+ * ```html
33
+ * <script server>
34
+ * export async function getStaticPaths() {
35
+ * const posts = await fetchPosts()
36
+ * return posts.map(post => ({
37
+ * params: { slug: post.slug },
38
+ * props: { post }
39
+ * }))
40
+ * }
41
+ * </script>
42
+ * ```
43
+ *
44
+ * @module ssg
45
+ */
46
+ import type { StxOptions } from './types';
47
+ export interface SSGConfig {
48
+ /**
49
+ * Client-side router options, forwarded verbatim to the injected router.
50
+ *
51
+ * Read here as `options.router` when the page is generated. Previously typed
52
+ * only as an `any` cast at the call site, which let `buildApp` omit it
53
+ * without the compiler noticing — so a project that configured `container`
54
+ * or `prefetch` got the client's built-in defaults instead.
55
+ */
56
+ router?: StxOptions['router'];
57
+ /** Directory containing pages (default: 'pages') */
58
+ pagesDir?: string;
59
+ /**
60
+ * Directory `@include` resolves against. Defaults to the config's
61
+ * `partialsDir`.
62
+ *
63
+ * `pagesDir`, `publicDir` and `outputDir` were all overridable here and these
64
+ * two were not, so a caller could point the build at one directory layout and
65
+ * silently get another for its partials (stacksjs/stx#1921).
66
+ */
67
+ partialsDir?: string;
68
+ /** Directory components resolve against. Defaults to the config's `componentsDir`. */
69
+ componentsDir?: string;
70
+ /**
71
+ * Fail the build when an `@include` cannot be resolved (default: true).
72
+ *
73
+ * A failed include renders the error into the page and, before this, left the
74
+ * build reporting `Failed: 0` with exit 0 — so the only way to find it was to
75
+ * read the emitted HTML, which is exactly what nobody does when the build says
76
+ * success. An unresolvable include is not a recoverable condition in a build:
77
+ * it produces a file you would never knowingly deploy.
78
+ *
79
+ * Set `false` for the old behaviour.
80
+ */
81
+ failOnIncludeError?: boolean;
82
+ /** Output directory for generated files (default: 'dist') */
83
+ outputDir?: string;
84
+ /** Base URL for the site (default: '/') */
85
+ baseUrl?: string;
86
+ /** Site domain for absolute URLs */
87
+ domain?: string;
88
+ /** Enable ISR with revalidation time in seconds */
89
+ revalidate?: number | false;
90
+ /** Generate sitemap.xml */
91
+ sitemap?: boolean;
92
+ /**
93
+ * Routes to keep out of sitemap.xml (#1866).
94
+ *
95
+ * Strings match a URL exactly or as a `/prefix/` when they end in `/`;
96
+ * RegExps are tested against the URL. A page can also exclude itself with
97
+ * `definePageMeta({ sitemap: false })` or by declaring a `noindex` robots
98
+ * meta, which is checked without needing this list.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * sitemapExclude: ['/login', '/account/', /^\/admin/]
103
+ * ```
104
+ */
105
+ sitemapExclude?: (string | RegExp)[];
106
+ /**
107
+ * Generate robots.txt (default: true).
108
+ *
109
+ * Written from the same resolved site URL as the sitemap, with a `Sitemap:`
110
+ * line pointing at it, and a `Disallow` for every `sitemapExclude` entry —
111
+ * so the two files cannot disagree about what is public.
112
+ */
113
+ robots?: boolean | RobotsConfig;
114
+ /** Generate RSS feed */
115
+ rss?: boolean | RSSConfig;
116
+ /** Parallel page generation limit (default: 10) */
117
+ concurrency?: number;
118
+ /** Enable build caching (default: true) */
119
+ cache?: boolean;
120
+ /** Cache directory (default: `ssg-cache` inside the state directory) */
121
+ cacheDir?: string;
122
+ /** Custom content loaders */
123
+ contentLoaders?: ContentLoader[];
124
+ /** Pre-render hooks */
125
+ hooks?: SSGHooks;
126
+ /** Minify HTML output (default: true) */
127
+ minify?: boolean;
128
+ /** Generate 404 page */
129
+ generate404?: boolean;
130
+ /** Additional files to copy to output */
131
+ publicDir?: string;
132
+ /** Trailing slash behavior */
133
+ trailingSlash?: boolean;
134
+ /** Clean output directory before build */
135
+ cleanOutput?: boolean;
136
+ /**
137
+ * Extra input folded into every page's cache key.
138
+ *
139
+ * A page's key is its own file plus the dependencies collected while
140
+ * rendering it, which covers templates, components and layouts and nothing
141
+ * else. Anything build-wide — the Css config, an env var the pages read
142
+ * — is invisible to it, and a build that reports every route `Cached` and
143
+ * exits 0 gives no signal that it used the old value (#1940).
144
+ *
145
+ * Defaults to a digest of the resolved Css config. Set it to add your
146
+ * own build inputs; set it to a constant to opt out of that default.
147
+ */
148
+ cacheSalt?: string;
149
+ /**
150
+ * Per-island chunking (#1746): lift each `client="<trigger>"` island's inline
151
+ * setup script into a content-hashed chunk under `_stx/islands/` that the
152
+ * runtime fetches only on the hydration trigger. Default `false` (opt-in) —
153
+ * when off, builds are byte-identical and islands stay inline.
154
+ */
155
+ chunkIslands?: boolean;
156
+ /**
157
+ * Emit `<link rel="prefetch" as="script">` hints for `visible`/`idle` island
158
+ * chunks so they warm in cache before the trigger fires (instant hydration,
159
+ * still no inline JS). `interaction`/`media:` islands are skipped. Requires
160
+ * `chunkIslands`. Default `false` — trades some idle bandwidth for latency.
161
+ */
162
+ prefetchIslands?: boolean;
163
+ /**
164
+ * Stamp Subresource Integrity (`sha384`) on island chunks so the runtime pins
165
+ * them against tampering and a strict CSP can require SRI. Requires
166
+ * `chunkIslands`. Default `false` — only enable when chunks are served
167
+ * byte-for-byte unchanged (no CDN/proxy transform).
168
+ */
169
+ integrityIslands?: boolean;
170
+ }
171
+ /** robots.txt options for the static build (#1866). */
172
+ export interface RobotsConfig {
173
+ /** Extra paths to disallow, on top of `sitemapExclude`. */
174
+ disallow?: string[];
175
+ /** Paths to explicitly allow. Defaults to `['/']`. */
176
+ allow?: string[];
177
+ /** User agent the rules apply to. Defaults to `*`. */
178
+ userAgent?: string;
179
+ /** Emit the `Sitemap:` line (default: true when a sitemap is generated). */
180
+ sitemap?: boolean;
181
+ }
182
+ export interface RSSConfig {
183
+ title: string;
184
+ description: string;
185
+ link: string;
186
+ language?: string;
187
+ copyright?: string;
188
+ /** Function to get items for RSS feed */
189
+ getItems?: () => Promise<RSSItem[]>;
190
+ }
191
+ export interface RSSItem {
192
+ title: string;
193
+ link: string;
194
+ description?: string;
195
+ pubDate?: Date;
196
+ author?: string;
197
+ categories?: string[];
198
+ guid?: string;
199
+ }
200
+ export interface StaticPath {
201
+ /** Route parameters */
202
+ params: Record<string, string>;
203
+ /** Props to pass to the page */
204
+ props?: Record<string, unknown>;
205
+ /** Page-specific revalidation time (overrides global) */
206
+ revalidate?: number | false;
207
+ }
208
+ export interface StaticPathsResult {
209
+ paths: StaticPath[];
210
+ /** Fallback behavior for paths not returned */
211
+ fallback?: 'blocking' | 'static' | false;
212
+ }
213
+ export interface ContentLoader {
214
+ /** Name of the loader */
215
+ name: string;
216
+ /** File extensions this loader handles */
217
+ extensions: string[];
218
+ /** Load content from file */
219
+ load: (filePath: string) => Promise<ContentResult>;
220
+ }
221
+ export interface ContentResult {
222
+ /** Rendered HTML content */
223
+ content: string;
224
+ /** Frontmatter/metadata */
225
+ data: Record<string, unknown>;
226
+ /** Table of contents (for markdown) */
227
+ toc?: TocItem[];
228
+ }
229
+ export interface TocItem {
230
+ id: string;
231
+ text: string;
232
+ level: number;
233
+ children?: TocItem[];
234
+ }
235
+ export interface SSGHooks {
236
+ /** Called before build starts */
237
+ onBuildStart?: () => void | Promise<void>;
238
+ /** Called after build completes */
239
+ onBuildEnd?: (result: SSGResult) => void | Promise<void>;
240
+ /** Called before each page is rendered */
241
+ onPageStart?: (route: string) => void | Promise<void>;
242
+ /** Called after each page is rendered */
243
+ onPageEnd?: (route: string, html: string) => void | Promise<void>;
244
+ /** Called on build error */
245
+ onError?: (error: Error, route?: string) => void | Promise<void>;
246
+ }
247
+ export interface SSGResult {
248
+ /** Total pages generated */
249
+ totalPages: number;
250
+ /** Successfully generated pages */
251
+ successCount: number;
252
+ /** Failed pages */
253
+ failedCount: number;
254
+ /** Pages that were cached */
255
+ cachedCount: number;
256
+ /** Build time in milliseconds */
257
+ buildTime: number;
258
+ /** Generated sitemap path */
259
+ sitemapPath?: string;
260
+ /** Generated RSS path */
261
+ rssPath?: string;
262
+ /** Individual page results */
263
+ pages: PageResult[];
264
+ /** Errors encountered */
265
+ errors: PageError[];
266
+ /**
267
+ * Per-island chunking stats (#1746), present only when `chunkIslands` emitted
268
+ * any chunks: `count` unique (content-addressed) chunk files and `totalBytes`
269
+ * of island JS moved out of inline HTML into lazily-fetched chunks.
270
+ */
271
+ islandChunks?: {
272
+ count: number;
273
+ totalBytes: number;
274
+ };
275
+ }
276
+ export interface PageResult {
277
+ route: string;
278
+ outputPath: string;
279
+ size: number;
280
+ cached: boolean;
281
+ revalidateAt?: number;
282
+ }
283
+ export interface PageError {
284
+ route: string;
285
+ error: Error;
286
+ }
287
+ export interface ISRCache {
288
+ /** Get cached page */
289
+ get: (route: string) => Promise<CachedPage | null>;
290
+ /** Set cached page */
291
+ set: (route: string, page: CachedPage) => Promise<void>;
292
+ /** Invalidate cached page */
293
+ invalidate: (route: string) => Promise<void>;
294
+ /** Invalidate all pages matching pattern */
295
+ invalidatePattern: (pattern: RegExp) => Promise<void>;
296
+ /** Check if page needs revalidation */
297
+ needsRevalidation: (route: string) => Promise<boolean>;
298
+ }
299
+ export interface CachedPage {
300
+ html: string;
301
+ generatedAt: number;
302
+ revalidateAfter: number;
303
+ etag: string;
304
+ headers?: Record<string, string>;
305
+ }
306
+ /**
307
+ * Whether a page declares an `action` — the export that receives its own POST.
308
+ *
309
+ * Exported so the rule is testable without running a build. A page action
310
+ * cannot run in a static build: `action` receives a POST, and a static build
311
+ * produces files, so there is no server left to receive one (stacksjs/stx#1847).
312
+ */
313
+ export declare function declaresPageAction(source: string): boolean;
314
+ /**
315
+ * Generate sitemap.xml
316
+ */
317
+ /**
318
+ * Whether a generated page should stay out of sitemap.xml (#1866).
319
+ *
320
+ * Three independent ways to say no, because they are declared in three
321
+ * different places: the build config (`sitemapExclude`), the page itself
322
+ * (`definePageMeta({ sitemap: false })`), and the page's own robots meta — a
323
+ * page already marked `noindex` asking to be listed in a sitemap is a
324
+ * contradiction, and apps were adding that meta by hand precisely because the
325
+ * sitemap ignored them.
326
+ */
327
+ export declare function isExcludedFromSitemap(url: string, html: string, pageMeta: Record<string, any> | null | undefined, exclude: (string | RegExp)[]): boolean;
328
+ /**
329
+ * Generate static site
330
+ */
331
+ export declare function generateStaticSite(options?: SSGConfig): Promise<SSGResult>;
332
+ /**
333
+ * Create ISR handler for runtime revalidation
334
+ */
335
+ export declare function createISRHandler(options?: SSGConfig): {
336
+ get: (route: string) => Promise<{
337
+ html: string;
338
+ headers: Record<string, string>;
339
+ } | null>;
340
+ revalidate: (route: string) => Promise<void>;
341
+ invalidate: (route: string | RegExp) => Promise<void>;
342
+ };
343
+ /**
344
+ * Define static paths for dynamic routes (used in templates)
345
+ */
346
+ export declare function defineStaticPaths(pathsFn: () => Promise<StaticPath[]> | StaticPath[]): () => Promise<StaticPathsResult>;
347
+ /**
348
+ * Create a markdown content loader
349
+ */
350
+ export declare function createMarkdownLoader(): ContentLoader;
351
+ declare const _default: {
352
+ generateStaticSite: typeof generateStaticSite;
353
+ createISRHandler: typeof createISRHandler;
354
+ defineStaticPaths: typeof defineStaticPaths;
355
+ createMarkdownLoader: typeof createMarkdownLoader;
356
+ };
357
+ export default _default;
package/dist/ssg.js ADDED
@@ -0,0 +1,94 @@
1
+ // @bun
2
+ import{Dk as Fq,yk as Uq,zk as Iq}from"./chunk-71t0yan0.js";import{Ek as Eq,Fk as Tq,Gk as Dq}from"./chunk-58f0mthg.js";import{$k as _q,cl as zq,dl as Aq}from"./chunk-4ww3znrr.js";import{Fm as Oq,Gp as P,To as Bq,_n as l,bo as Hq,dr as n}from"./chunk-y11cxbxd.js";import"./chunk-92mj1t26.js";import"./chunk-8mjdpr94.js";import"./chunk-pkaabd8h.js";import"./chunk-xpp135ad.js";import{tt as Xq}from"./chunk-wrzwgkbx.js";import{yt as d}from"./chunk-5kk8gsj2.js";import"./chunk-38ejahd9.js";import"./chunk-ypmqf7tm.js";import"./chunk-de7fye10.js";import"./chunk-v5e1gxwm.js";import{Nu as Yq,Ou as Vq,Pu as jq,Qu as Gq,Ru as Lq,Su as Nq}from"./chunk-b6ej2fdf.js";import"./chunk-x650vjcp.js";import{gv as y}from"./chunk-qc1f74ek.js";import O from"fs";import j from"path";import{createHash as xq}from"crypto";function yq(q){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(q).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return q}}var Pq=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Cq(q){return Bun.hash(q).toString(16)}function Qq(q,Z={}){if(!q.includes('type="stx/island"'))return{html:q,chunks:[]};let $=new Map,Q=q.replace(Pq,(J,W,z,A)=>{let G=A.trim();if(!G)return J;if(/\bdata-stx-src=/.test(z))return J;if(Z.minify)G=yq(G);let X=Cq(G);if(!$.has(X))$.set(X,G);let B=Z.integrity?` data-stx-integrity="sha384-${xq("sha384").update(G).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${W}" data-stx-src="/_stx/islands/${X}.js"${B}${z}></script>`}),K=Array.from($,([J,W])=>({hash:J,code:W}));return{html:Q,chunks:K}}var gq=new Set(["visible","idle"]);function Zq(q){if(!q.includes("data-stx-src="))return q;let Z=new Map,$=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,Q;while((Q=$.exec(q))!==null)Z.set(Q[1],Q[2]);let K=new Set,J=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,W;while((W=J.exec(q))!==null)if(gq.has(Z.get(W[1])||""))K.add(W[2]);let z=q.lastIndexOf("</head>");if(K.size===0||z===-1)return q;let A=Array.from(K).filter((G)=>!q.includes(`rel="prefetch" href="${G}"`)).map((G)=>`<link rel="prefetch" href="${G}" as="script">`).join("");if(!A)return q;return q.slice(0,z)+A+q.slice(z)}var fq=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function h(q){let Z=q.trim();if(!Z)return null;let $=/^https?:\/\//i.test(Z)?Z:`https://${Z}`;try{return new URL($).origin+new URL($).pathname.replace(/\/$/,"")}catch{return null}}function mq(q){for(let Z of fq){let $=q[Z];if(!$)continue;let Q=h($);if(Q)return{url:Q,source:"env",via:Z}}return null}function $q(q){if(!q||typeof q!=="object")return null;let Z=q,$=Z.site?.url??Z.url??Z.app?.url;return typeof $==="string"?h($):null}async function dq(q){let{existsSync:Z}=await import("fs"),$=await import("path");for(let Q of["site.config.ts","site.config.js",".config/site.config.ts"]){let K=$.resolve(q,Q);if(!Z(K))continue;try{let J=await import(K),W=$q(J.default??J);if(W)return W}catch{}}return null}async function Kq(q={}){let Z=q.cwd??process.cwd(),$=q.env??process.env;if(q.explicit){let W=h(q.explicit);if(W)return{url:W,source:"option"}}let Q=$q(q.stxConfig);if(Q)return{url:Q,source:"stx.config",via:"site.url"};let K=await dq(Z);if(K)return{url:K,source:"site.config",via:"url"};let J=mq($);if(J)return J;return{url:"http://localhost",source:"fallback"}}function Wq(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}class wq{cacheDir;cache=new Map;loaded=!1;salt;constructor(q,Z=""){this.cacheDir=q,this.salt=Z}async load(){if(this.loaded)return;let q=j.join(this.cacheDir,"build-cache.json");if(await Bun.file(q).exists())try{let Z=JSON.parse(await Bun.file(q).text());for(let[$,Q]of Object.entries(Z))this.cache.set($,Q)}catch{}this.loaded=!0}async save(){await O.promises.mkdir(this.cacheDir,{recursive:!0});let q=j.join(this.cacheDir,"build-cache.json"),Z={};for(let[$,Q]of this.cache)Z[$]=Q;await Bun.write(q,JSON.stringify(Z))}getHash(q,Z){let $=O.statSync(q),Q=`${this.salt}|${q}:${$.mtimeMs}`;for(let J of Z)if(O.existsSync(J)){let W=O.statSync(J);Q+=`:${J}:${W.mtimeMs}`}let K=0;for(let J=0;J<Q.length;J++){let W=Q.charCodeAt(J);K=(K<<5)-K+W,K=K&K}return Math.abs(K).toString(36)}get(q,Z){let $=this.cache.get(q);if(!$)return null;let Q=this.getHash(Z,$.dependencies??[]);if($.hash!==Q)return this.cache.delete(q),null;return $.html}set(q,Z,$,Q){let K=this.getHash(Z,$);this.cache.set(q,{hash:K,html:Q,generatedAt:Date.now(),dependencies:$})}}class Rq{cacheDir;constructor(q){this.cacheDir=q}getFilePath(q){let Z=q.replace(/[^a-zA-Z0-9]/g,"_")+".json";return j.join(this.cacheDir,"isr",Z)}async get(q){let Z=this.getFilePath(q);if(!await Bun.file(Z).exists())return null;try{return JSON.parse(await Bun.file(Z).text())}catch{return null}}async set(q,Z){let $=this.getFilePath(q);await O.promises.mkdir(j.dirname($),{recursive:!0}),await Bun.write($,JSON.stringify(Z))}async invalidate(q){let Z=this.getFilePath(q);if(await Bun.file(Z).exists())await O.promises.unlink(Z)}async invalidatePattern(q){let Z=j.join(this.cacheDir,"isr");if(!O.existsSync(Z))return;let $=await O.promises.readdir(Z);for(let Q of $){let K=Q.replace(/_/g,"/").replace(".json","");if(q.test(K))await O.promises.unlink(j.join(Z,Q))}}async needsRevalidation(q){let Z=await this.get(q);if(!Z)return!0;return Date.now()>Z.revalidateAfter}}async function pq(q){try{let $=(await Bun.file(q).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!$)return null;let Q=$[1];if(!Q.includes("getStaticPaths"))return null;let K=Q.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!K)return null;return await Function(`
4
+ return (async function getStaticPaths() {
5
+ ${K[1]}
6
+ })()
7
+ `)()}catch(Z){return console.error(`Error extracting static paths from ${q}:`,Z),null}}async function uq(q){let Z=[];if(!q.isDynamic)Z.push({url:q.pattern,params:{}});else{let $=await pq(q.filePath);if(!$||$.paths.length===0)return console.warn(`Warning: Dynamic route ${q.pattern} has no getStaticPaths or returned empty paths`),Z;for(let Q of $.paths){let K=q.pattern;for(let[J,W]of Object.entries(Q.params))K=K.replace(`:${J}`,W).replace(`:${J}*`,W);Z.push({url:K,params:Q.params,props:Q.props,revalidate:Q.revalidate})}}return Z}async function hq(q){let Z=[q.replace(/\.stx$/,".data.ts"),q.replace(/\.stx$/,".data.js"),q+".data.ts",q+".data.js"];for(let $ of Z)if(await Bun.file($).exists())try{let Q=await import($);if(typeof Q.default==="function")return await Q.default();else if(typeof Q.default==="object")return Q.default;else if(typeof Q.getData==="function")return await Q.getData();else{let{default:K,...J}=Q;return J}}catch(Q){console.error(`Error loading data file ${$}:`,Q)}return null}async function cq(q,Z,$){let Q=q.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!Q)return null;let K=Q[1];if(!K.includes("getStaticProps"))return null;try{let J=K.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!J)return null;return await Function("params",`
8
+ return (async function getStaticProps() {
9
+ ${J[1]}
10
+ })()
11
+ `)(Z)}catch(J){return console.error(`Error executing getStaticProps in ${$}:`,J),null}}function lq(q){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(q)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(q)}async function Mq(q,Z,$={},Q,K){let J=await Bun.file(q.filePath).text(),W=await hq(q.filePath),z=await cq(J,Z,q.filePath),A={...W||{},...z||{},...$,params:Z,$route:{path:q.pattern,params:Z}},G=new Set,X=[],B={...K,...Q.partialsDir?{partialsDir:Q.partialsDir}:{},...Q.componentsDir?{componentsDir:Q.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(_)=>{X.push(`${j.relative(process.cwd(),_.templatePath)}: ${_.message}
12
+ resolved against partialsDir: ${_.partialsDir}`)}};if(lq(J))console.warn(`Warning: ${q.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let L=await P(J,A,q.filePath,B,G);for(let _ of[q.filePath,...G])for(let F of _q(_))G.add(F);if(Object.keys(Z).length>0){let _=`<script>if(window.stx)window.stx._rp=${JSON.stringify(Z)};else window.__stx_rp=${JSON.stringify(Z)};</script>`;if(L.includes("</head>"))L=L.replace("</head>",`${_}
13
+ </head>`);else L=`${_}
14
+ ${L}`}if(L=await Hq(L,{router:Q.router}),L=await Xq(L),Q.minify!==!1)return{html:nq(L),dependencies:Array.from(G),includeFailures:X};return{html:L,dependencies:Array.from(G),includeFailures:X}}function nq(q){let Z=[],$=0,Q=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,K;while((K=Q.exec(q))!==null){let W=q.slice($,K.index);Z.push(W.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let z=K[1],A=K[2],G=K[3];A=A.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),Z.push(z+A+G),$=K.index+K[0].length}let J=q.slice($);return Z.push(J.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),Z.join("").trim()}function iq(q){let Z=0;for(let $=0;$<q.length;$++){let Q=q.charCodeAt($);Z=(Z<<5)-Z+Q,Z=Z&Z}return`"${Math.abs(Z).toString(36)}"`}function sq(q,Z,$,Q){if($?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(Z))return!0;return Q.some((K)=>{if(K instanceof RegExp)return K.test(q);return K.endsWith("/")?q===K.slice(0,-1)||q.startsWith(K):q===K})}function oq(q,Z){return`<?xml version="1.0" encoding="UTF-8"?>
15
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
16
+ ${q.map((Q)=>{let K=new URL(Q.loc,Z).href,J=` <url>
17
+ <loc>${T(K)}</loc>`;if(Q.lastmod)J+=`
18
+ <lastmod>${Q.lastmod}</lastmod>`;if(Q.changefreq)J+=`
19
+ <changefreq>${Q.changefreq}</changefreq>`;if(Q.priority!==void 0)J+=`
20
+ <priority>${Q.priority}</priority>`;return J+=`
21
+ </url>`,J}).join(`
22
+ `)}
23
+ </urlset>`}function T(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function rq(q,Z){let $=Z.map((Q)=>{let K=" <item>";if(K+=`
24
+ <title>${T(Q.title)}</title>`,K+=`
25
+ <link>${T(Q.link)}</link>`,Q.description)K+=`
26
+ <description>${T(Q.description)}</description>`;if(Q.pubDate)K+=`
27
+ <pubDate>${Q.pubDate.toUTCString()}</pubDate>`;if(Q.author)K+=`
28
+ <author>${T(Q.author)}</author>`;if(Q.categories)for(let J of Q.categories)K+=`
29
+ <category>${T(J)}</category>`;if(Q.guid)K+=`
30
+ <guid>${T(Q.guid)}</guid>`;return K+=`
31
+ </item>`,K});return`<?xml version="1.0" encoding="UTF-8"?>
32
+ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
33
+ <channel>
34
+ <title>${T(q.title)}</title>
35
+ <link>${T(q.link)}</link>
36
+ <description>${T(q.description)}</description>
37
+ ${q.language?`<language>${q.language}</language>`:""}
38
+ ${q.copyright?`<copyright>${T(q.copyright)}</copyright>`:""}
39
+ <lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
40
+ <atom:link href="${q.link}/rss.xml" rel="self" type="application/rss+xml"/>
41
+ ${$.join(`
42
+ `)}
43
+ </channel>
44
+ </rss>`}async function aq(q={}){let Z=Date.now();Aq();let $=await n(process.cwd()),Q=$.build||{},K=await Kq({explicit:q.domain||Q.domain,stxConfig:$});if(K.source==="fallback"&&(q.sitemap??Q.sitemap??!0))console.warn(Wq());let J={router:q.router??$?.router??{},pagesDir:q.pagesDir||Q.pagesDir||"pages",outputDir:q.outputDir||Q.outputDir||"dist",baseUrl:q.baseUrl||Q.baseUrl||"/",domain:K.url,revalidate:q.revalidate??Q.revalidate??!1,sitemap:q.sitemap??Q.sitemap??!0,sitemapExclude:q.sitemapExclude||Q.sitemapExclude||[],robots:q.robots??Q.robots??!0,rss:q.rss??Q.rss??!1,concurrency:q.concurrency||Q.concurrency||10,cache:q.cache??Q.cache??!0,cacheDir:q.cacheDir||Q.cacheDir||d(process.cwd(),"ssg-cache"),contentLoaders:q.contentLoaders||[],hooks:q.hooks||{},minify:q.minify??Q.minify??!0,generate404:q.generate404??Q.generate404??!0,publicDir:q.publicDir||Q.publicDir||"public",trailingSlash:q.trailingSlash??Q.trailingSlash??!1,cleanOutput:q.cleanOutput??Q.cleanOutput??!0,cacheSalt:q.cacheSalt??"",partialsDir:q.partialsDir||$?.partialsDir||"",componentsDir:q.componentsDir||$?.componentsDir||"",failOnIncludeError:q.failOnIncludeError??!0,chunkIslands:q.chunkIslands===!0,prefetchIslands:q.prefetchIslands===!0,integrityIslands:q.integrityIslands===!0},W={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},z=new Set,A=0,G={},X={};await J.hooks.onBuildStart?.();try{if(J.cleanOutput&&O.existsSync(J.outputDir))await O.promises.rm(J.outputDir,{recursive:!0});await O.promises.mkdir(J.outputDir,{recursive:!0});let L=J.cacheSalt;if(!L){let{resolveUserCssConfig:Y,fingerprintConfig:N}=await import("./chunk-2tk1zkrz.js");try{L=N(await Y(process.cwd()))}catch{}}let{prepareImageDelivery:_}=await import("./chunk-mxfh1nxg.js"),F=await _(J.publicDir,J.outputDir);if(F.count>0)console.log(`Optimized ${F.count} image(s) for responsive delivery`),L=[L,F.fingerprint].filter(Boolean).join(":");let C=new wq(J.cacheDir,L);if(J.cache)await C.load();try{let{generateCss:Y}=await import("./chunk-2tk1zkrz.js");await Y('<div class="bg-black"></div>')}catch{}Yq();let kq=$?.routeMiddleware?.dir||"middleware";await jq(process.cwd(),kq);let p=Vq();if(p.length>0)console.log(`Loaded ${p.length} middleware: ${p.join(", ")}`);let bq=$?.routeMiddleware?.global||[];Fq($?.layoutsDir,d(process.cwd()));let i=l(".",{pagesDir:J.pagesDir});console.log(`Found ${i.length} routes`);let g=[];for(let Y of i){let N=await uq(Y);for(let H of N)g.push({route:Y,url:H.url,params:H.params,props:H.props,revalidate:H.revalidate??J.revalidate})}W.totalPages=g.length,console.log(`Generating ${W.totalPages} pages...`);let b=[],s=[];for(let Y=0;Y<g.length;Y+=J.concurrency)s.push(g.slice(Y,Y+J.concurrency));for(let Y of s)await Promise.all(Y.map(async(N)=>{let{route:H,url:V,params:S,props:Sq,revalidate:a}=N;try{await J.hooks.onPageStart?.(V);let w=await Bun.file(H.filePath).text(),R=JJ(w),vq=R?.middleware?Array.isArray(R.middleware)?R.middleware:[R.middleware]:[],t=[...bq,...vq];if(t.length>0){let D=Gq(V,S,R||{}),M=Lq(D,null,void 0,{isServer:!0}),E=await Nq(t,M);if(E.redirect){let U=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,x=QJ(String(U),V),k=ZJ(V,J);await O.promises.mkdir(j.dirname(k),{recursive:!0}),await Bun.write(k,x),W.successCount++,W.pages.push({route:V,outputPath:k,size:Buffer.byteLength(x),cached:!1}),b.push({loc:V,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${V} \u2192 redirect to ${U}`);return}if(E.abort){let U=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${V} \u2014 middleware aborted: ${U}`);return}}let e=w.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(e)try{if(!await Function("route",`
45
+ const validate = ${e[1]};
46
+ return validate(route);
47
+ `)({params:S})){console.warn(`Validation failed for ${V}, skipping...`);return}}catch{}let I=null,qq=!1;if(J.cache){if(I=C.get(V,H.filePath),I)qq=!0,W.cachedCount++}if(!I){let D=await Mq(H,S,Sq,J,$);if(I=D.html,J.failOnIncludeError&&D.includeFailures.length>0)throw Error(`${D.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
48
+ ${D.includeFailures.join(`
49
+ `)}
50
+ Set ssg.failOnIncludeError to false to build anyway.`);if(J.cache)C.set(V,H.filePath,D.dependencies,I)}let v;if(J.trailingSlash)v=j.join(J.outputDir,V,"index.html");else v=V==="/"?j.join(J.outputDir,"index.html"):j.join(J.outputDir,`${V}.html`);if(J.chunkIslands){let{html:D,chunks:M}=Qq(I,{integrity:J.integrityIslands,minify:J.minify});if(M.length>0){let E=j.join(J.outputDir,"_stx","islands");await O.promises.mkdir(E,{recursive:!0});for(let U of M){let x=j.join(E,`${U.hash}.js`);if(!await Bun.file(x).exists())await Bun.write(x,U.code);if(!z.has(U.hash)){z.add(U.hash);let k=Buffer.byteLength(U.code,"utf8");A+=k,G[U.hash]={bytes:k,file:`/_stx/islands/${U.hash}.js`}}}if(X[V]=M.map((U)=>U.hash),I=D,J.prefetchIslands)I=Zq(I)}}if(await O.promises.mkdir(j.dirname(v),{recursive:!0}),await Bun.write(v,I),!sq(V,I,R,J.sitemapExclude))b.push({loc:V,lastmod:new Date().toISOString().split("T")[0],priority:V==="/"?1:0.8});let Jq={route:V,outputPath:v,size:Buffer.byteLength(I,"utf8"),cached:qq};if(a!==!1)Jq.revalidateAt=Date.now()+a*1000;W.pages.push(Jq),W.successCount++,await J.hooks.onPageEnd?.(V,I)}catch(w){W.failedCount++,W.errors.push({route:V,error:w}),await J.hooks.onError?.(w,V),console.error(`Error generating ${V}:`,w)}}));let o=zq();if(o.length>0){let Y=o.map((N)=>`${N.filePath}: ${N.message}`).join(`
51
+ `);throw Error(`Client script bundling failed:
52
+ ${Y}`)}if(J.cache)await C.save();if(J.generate404){let Y=j.join(J.pagesDir,"404.stx");if(await Bun.file(Y).exists()){let N=new Set,H={...$,debug:!1,cache:!1},V=await P(await Bun.file(Y).text(),{},Y,H,N);await Bun.write(j.join(J.outputDir,"404.html"),V)}else await Bun.write(j.join(J.outputDir,"404.html"),`<!DOCTYPE html>
53
+ <html lang="en">
54
+ <head>
55
+ <meta charset="UTF-8">
56
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
57
+ <title>Page Not Found</title>
58
+ <style>
59
+ body { font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
60
+ .container { text-align: center; }
61
+ h1 { font-size: 6rem; margin: 0; color: #333; }
62
+ p { color: #666; }
63
+ a { color: #0066cc; }
64
+ </style>
65
+ </head>
66
+ <body>
67
+ <div class="container">
68
+ <h1>404</h1>
69
+ <p>Page not found</p>
70
+ <a href="/">Go home</a>
71
+ </div>
72
+ </body>
73
+ </html>`)}for(let Y of[500]){let N=j.join(J.pagesDir,`${Y}.stx`);if(await Bun.file(N).exists()){let H=new Set,V={...$,debug:!1,cache:!1},S=await P(await Bun.file(N).text(),{},N,V,H);await Bun.write(j.join(J.outputDir,`${Y}.html`),S)}}let u=j.join(J.pagesDir,"error.stx");if(await Bun.file(u).exists()){let Y=new Set,N={...$,debug:!1,cache:!1},H=await P(await Bun.file(u).text(),{},u,N,Y);await Bun.write(j.join(J.outputDir,"error.html"),H)}if(J.sitemap&&b.length>0){let Y=oq(b,J.domain),N=j.join(J.outputDir,"sitemap.xml");await Bun.write(N,Y),W.sitemapPath=N,console.log(`Generated sitemap.xml with ${b.length} URLs`)}if(J.robots!==!1){let Y=typeof J.robots==="object"?J.robots:{},N=[...J.sitemapExclude.filter((V)=>typeof V==="string"),...Y.disallow||[]],H=Bq({rules:[{userAgent:Y.userAgent||"*",allow:Y.allow||["/"],...N.length>0?{disallow:N}:{}}],...Y.sitemap!==!1&&W.sitemapPath?{sitemap:new URL("/sitemap.xml",J.domain).href}:{}});await Bun.write(j.join(J.outputDir,"robots.txt"),H),console.log("Generated robots.txt")}if(J.rss){let Y=typeof J.rss==="object"?J.rss:{title:"Site Feed",description:"Latest updates",link:J.domain},N=[];if(Y.getItems)N=await Y.getItems();let H=rq(Y,N),V=j.join(J.outputDir,"rss.xml");await Bun.write(V,H),W.rssPath=V,console.log(`Generated rss.xml with ${N.length} items`)}let f=Uq(J.outputDir);if(f.assets>0)console.log(`Externalized ${f.assets} asset(s) from ${f.pages} page(s) (${(f.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let m=Iq(J.outputDir);if(m.assets>0)console.log(`Externalized ${m.assets} repeated asset(s) from ${m.pages} page(s) (${(m.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(J.publicDir&&O.existsSync(J.publicDir))await c(J.publicDir,J.outputDir),console.log(`Copied public assets from ${J.publicDir}`);let r=Dq();if(r)await c(r,j.join(J.outputDir,Tq)),console.log(`Copied assets from ${Eq}`)}catch(L){throw await J.hooks.onError?.(L),L}if(W.buildTime=Date.now()-Z,z.size>0){W.islandChunks={count:z.size,totalBytes:A};let L={generatedChunks:z.size,totalBytes:A,chunks:G,pages:X};await Bun.write(j.join(J.outputDir,"_stx","islands-manifest.json"),JSON.stringify(L,null,2))}await J.hooks.onBuildEnd?.(W);let B=W.islandChunks?`
74
+ Island chunks: ${W.islandChunks.count} (${(W.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
75
+ Build complete!
76
+ Total: ${W.totalPages} pages
77
+ Success: ${W.successCount}
78
+ Cached: ${W.cachedCount}
79
+ Failed: ${W.failedCount}
80
+ Time: ${W.buildTime}ms${B}
81
+ `),W}async function c(q,Z){await O.promises.mkdir(Z,{recursive:!0});let $=await O.promises.readdir(q,{withFileTypes:!0});for(let Q of $){let K=j.join(q,Q.name),J=j.join(Z,Q.name);if(Q.isDirectory())await O.promises.mkdir(J,{recursive:!0}),await c(K,J);else await O.promises.copyFile(K,J)}}function tq(q={}){let Z=q.cacheDir||d(process.cwd(),"ssg-cache"),$=new Rq(Z),Q=q.revalidate||3600;return{async get(K){let J=await $.get(K);if(!J)return null;if(Date.now()>J.revalidateAfter)this.revalidate(K).catch(console.error);return{html:J.html,headers:{"Cache-Control":`public, max-age=${Q}, stale-while-revalidate=${Q*2}`,ETag:J.etag,"X-ISR-Generated":new Date(J.generatedAt).toISOString(),...J.headers}}},async revalidate(K){let W=l(".",{pagesDir:q.pagesDir||"pages"}).find((B)=>{return K.match(B.regex)!==null});if(!W){console.warn(`Route not found for revalidation: ${K}`);return}let z=K.match(W.regex),A={};if(z)W.params.forEach((B,L)=>{A[B]=z[L+1]});let G=await n(),{html:X}=await Mq(W,A,{},q,G);await $.set(K,{html:X,generatedAt:Date.now(),revalidateAfter:Date.now()+Q*1000,etag:iq(X)}),console.log(`Revalidated: ${K}`)},async invalidate(K){if(typeof K==="string")await $.invalidate(K);else await $.invalidatePattern(K)}}}function eq(q){return async()=>{return{paths:await q(),fallback:!1}}}function qJ(){return{name:"markdown",extensions:[".md",".mdx"],async load(q){let Z=await Bun.file(q).text(),$=Z.match(/^---\n([\s\S]*?)\n---/),Q={},K=Z;if($){let G=$[1];K=Z.slice($[0].length).trim();for(let X of G.split(`
82
+ `)){let B=X.indexOf(":");if(B>0){let L=X.slice(0,B).trim(),_=X.slice(B+1).trim();if(_==="true")_=!0;else if(_==="false")_=!1;else if(/^\d+$/.test(_))_=parseInt(_,10);else if(/^\d+\.\d+$/.test(_))_=parseFloat(_);else if(_.startsWith("[")&&_.endsWith("]"))_=_.slice(1,-1).split(",").map((F)=>F.trim().replace(/^['"]|['"]$/g,""));Q[L]=_}}}let J=K.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),W=[],z=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,A;while((A=z.exec(J))!==null){let G=parseInt(A[1],10),X=A[2],B=X.toLowerCase().replace(/[^a-z0-9]+/g,"-");W.push({id:B,text:X,level:G})}return{content:J,data:Q,toc:W}}}}function JJ(q){return Oq(q)}function QJ(q,Z){return`<!DOCTYPE html>
83
+ <html>
84
+ <head>
85
+ <meta charset="utf-8">
86
+ <meta http-equiv="refresh" content="0; url=${q}">
87
+ <link rel="canonical" href="${q}">
88
+ <title>Redirecting...</title>
89
+ </head>
90
+ <body>
91
+ <p>Redirecting to <a href="${q}">${q}</a>...</p>
92
+ <script>window.location.replace('${q}')</script>
93
+ </body>
94
+ </html>`}function ZJ(q,Z){if(q==="/"||q==="")return j.join(Z.outputDir,"index.html");let $=q.replace(/^\/|\/$/g,"");if(Z.trailingSlash)return j.join(Z.outputDir,$,"index.html");return j.join(Z.outputDir,`${$}.html`)}var FJ={generateStaticSite:aq,createISRHandler:tq,defineStaticPaths:eq,createMarkdownLoader:qJ};export{sq as isExcludedFromSitemap,aq as generateStaticSite,eq as defineStaticPaths,FJ as default,lq as declaresPageAction,qJ as createMarkdownLoader,tq as createISRHandler};
package/dist/ssr.d.ts ADDED
@@ -0,0 +1,116 @@
1
+ import path from 'node:path';
2
+ import type { StxOptions } from './types';
3
+ /**
4
+ * Render a STX template with server-side data
5
+ *
6
+ * @param template - Template path relative to viewsDir, or inline template string
7
+ * @param data - Data to pass to the template
8
+ * @param options - Render options
9
+ */
10
+ export declare function render(template: string, data?: Record<string, unknown>, options?: {
11
+ viewsDir?: string
12
+ layoutsDir?: string
13
+ stxOptions?: StxOptions
14
+ ctx?: RequestContext
15
+ }): Promise<Response>;
16
+ /**
17
+ * Create a STX server application
18
+ */
19
+ export declare function createApp(config?: AppConfig): StxServerApp;
20
+ /** Session data store */
21
+ export declare interface SessionData {
22
+ [key: string]: unknown
23
+ }
24
+ /** Session interface */
25
+ export declare interface Session {
26
+ id: string
27
+ data: SessionData
28
+ get<T = unknown>(key: string): T | undefined
29
+ set(key: string, value: unknown): void
30
+ delete(key: string): void
31
+ clear(): void
32
+ has(key: string): boolean
33
+ flash(key: string, value?: unknown): unknown | undefined
34
+ regenerate(): void
35
+ destroy(): void
36
+ }
37
+ /** Pluggable session store interface for production-ready backends (Redis, DB, etc.) */
38
+ export declare interface SessionStore {
39
+ get(sessionId: string): Promise<SessionData | null>
40
+ set(sessionId: string, data: SessionData, ttlSeconds: number): Promise<void>
41
+ delete(sessionId: string): Promise<void>
42
+ }
43
+ /** Request context passed to route handlers */
44
+ export declare interface RequestContext {
45
+ request: Request
46
+ url: URL
47
+ params: Record<string, string>
48
+ query: Record<string, string>
49
+ session: Session
50
+ csrfToken: string
51
+ formData: () => Promise<Record<string, string | File>>
52
+ json: <T = unknown>() => Promise<T>
53
+ cookies: Record<string, string>
54
+ setCookie: (name: string, value: string, options?: CookieOptions) => void
55
+ responseHeaders: Headers
56
+ flash: (key: string, value: unknown) => void
57
+ getFlash: (key: string) => unknown
58
+ errors: ValidationErrors
59
+ old: (key: string) => string
60
+ isAuthenticated: () => boolean
61
+ user: () => unknown
62
+ }
63
+ /** Cookie options */
64
+ export declare interface CookieOptions {
65
+ maxAge?: number
66
+ expires?: Date
67
+ path?: string
68
+ domain?: string
69
+ secure?: boolean
70
+ httpOnly?: boolean
71
+ sameSite?: 'Strict' | 'Lax' | 'None'
72
+ }
73
+ /** Validation errors */
74
+ export declare interface ValidationErrors {
75
+ [field: string]: string[]
76
+ }
77
+ /** App configuration */
78
+ export declare interface AppConfig {
79
+ viewsDir?: string
80
+ layoutsDir?: string
81
+ defaultLayout?: string
82
+ sessionSecret?: string
83
+ sessionCookieName?: string
84
+ sessionTtl?: number
85
+ stxOptions?: StxOptions
86
+ csrfCookieName?: string
87
+ csrfEnabled?: boolean
88
+ sessionStore?: SessionStore
89
+ }
90
+ /**
91
+ * Handle returned by {@link createApp} — the server application surface.
92
+ */
93
+ export declare interface StxServerApp {
94
+ fetch: (request: Request) => Promise<Response>
95
+ get: (pattern: string, handler: RouteHandler, middleware?: Middleware[]) => StxServerApp
96
+ post: (pattern: string, handler: RouteHandler, middleware?: Middleware[]) => StxServerApp
97
+ put: (pattern: string, handler: RouteHandler, middleware?: Middleware[]) => StxServerApp
98
+ delete: (pattern: string, handler: RouteHandler, middleware?: Middleware[]) => StxServerApp
99
+ patch: (pattern: string, handler: RouteHandler, middleware?: Middleware[]) => StxServerApp
100
+ use: (middleware: Middleware) => StxServerApp
101
+ render: (template: string, data?: Record<string, unknown>, ctx?: RequestContext) => Promise<Response>
102
+ redirect: (url: string, status?: 302 | 301 | 303 | 307 | 308) => Response
103
+ back: (ctx: RequestContext, errors?: ValidationErrors, oldInput?: Record<string, string>) => Response
104
+ listen: (port?: number) => ReturnType<typeof Bun.serve>
105
+ }
106
+ /** Route handler */
107
+ // eslint-disable-next-line pickier/no-unused-vars
108
+ export type RouteHandler = (ctx: RequestContext) => Response | Promise<Response>;
109
+ /** Middleware function */
110
+ export type Middleware = (ctx: RequestContext, next: () => Promise<Response>) => Response | Promise<Response>;
111
+ /** Default in-memory session store. Use a custom SessionStore (Redis, DB) for production. */
112
+ export declare class MemorySessionStore implements SessionStore {
113
+ get(sessionId: string): Promise<SessionData | null>;
114
+ set(sessionId: string, data: SessionData, ttlSeconds: number): Promise<void>;
115
+ delete(sessionId: string): Promise<void>;
116
+ }