@stacksjs/stx 0.2.413 → 0.2.415
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.
- package/dist/appearance-bootstrap.js +1 -1
- package/dist/binding-manifest.d.ts +1 -1
- package/dist/builtins/image-delivery.js +19 -11
- package/dist/bundle-analyzer.js +20 -20
- package/dist/chunk-020xyn9q.js +3 -0
- package/dist/chunk-04jhmfbz.js +2 -0
- package/dist/chunk-0pnj3zt2.js +2 -0
- package/dist/{chunk-bwjxk1dw.js → chunk-0zaess6f.js} +29 -29
- package/dist/chunk-1098mas0.js +2 -0
- package/dist/chunk-169n1vpx.js +12 -0
- package/dist/chunk-18vmfkcc.js +2 -0
- package/dist/chunk-1b6t12hd.js +2 -0
- package/dist/chunk-1xdzcy9d.js +14 -0
- package/dist/chunk-1zs30k3y.js +2 -0
- package/dist/chunk-2ce7f416.js +2 -0
- package/dist/chunk-340a824p.js +2 -0
- package/dist/chunk-393341w7.js +2 -0
- package/dist/chunk-39g1134q.js +2 -0
- package/dist/chunk-3efw27as.js +2785 -0
- package/dist/chunk-3kthfs03.js +3 -0
- package/dist/chunk-3qn1wcdg.js +2 -0
- package/dist/chunk-3s2vnqcf.js +2 -0
- package/dist/chunk-42wbs8vq.js +17 -0
- package/dist/chunk-4bjravgk.js +2 -0
- package/dist/chunk-5gsxpaqk.js +2 -0
- package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
- package/dist/chunk-6cfa3g0r.js +2 -0
- package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
- package/dist/chunk-6hc5vz20.js +3 -0
- package/dist/chunk-6q6g76vg.js +499 -0
- package/dist/chunk-74j18qk0.js +930 -0
- package/dist/chunk-752hw7cd.js +4 -0
- package/dist/{chunk-kgd8kchy.js → chunk-765e1s44.js} +11 -76
- package/dist/chunk-7gkv67ky.js +4 -0
- package/dist/chunk-7z2ra0yf.js +2 -0
- package/dist/chunk-8eqrwj1k.js +20 -0
- package/dist/chunk-8nhshfz6.js +5 -0
- package/dist/chunk-92ps1xpk.js +2 -0
- package/dist/chunk-96k8s808.js +3 -0
- package/dist/chunk-9amp82bx.js +7 -0
- package/dist/chunk-9g27ybyr.js +3 -0
- package/dist/chunk-9p9qkbtg.js +3 -0
- package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
- package/dist/{chunk-24zher49.js → chunk-9vrja6vp.js} +4 -4
- package/dist/chunk-9xrbve19.js +2 -0
- package/dist/chunk-a688m6js.js +3 -0
- package/dist/chunk-ak1cgcah.js +5 -0
- package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
- package/dist/chunk-amtr3rmf.js +11 -0
- package/dist/chunk-atws6p5s.js +2 -0
- package/dist/chunk-b84h16er.js +61 -0
- package/dist/chunk-b98be3yp.js +32 -0
- package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
- package/dist/chunk-ce1sejr3.js +3 -0
- package/dist/chunk-cg8hg6cs.js +3 -0
- package/dist/{chunk-4f9zyfdw.js → chunk-czxt605c.js} +4 -5
- package/dist/chunk-dd8cja4h.js +2 -0
- package/dist/chunk-dgdm3hy3.js +2 -0
- package/dist/chunk-e9hs7kk6.js +12 -0
- package/dist/chunk-eed4fwps.js +3 -0
- package/dist/chunk-ej9j6k1q.js +3 -0
- package/dist/chunk-et0rr8c7.js +3 -0
- package/dist/chunk-f1sxycmv.js +2 -0
- package/dist/chunk-f46qsp4m.js +4 -0
- package/dist/chunk-fbcv4fes.js +2 -0
- package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
- package/dist/chunk-fjs0a8h7.js +2 -0
- package/dist/chunk-fpfzm238.js +2 -0
- package/dist/chunk-fr2txj8q.js +829 -0
- package/dist/{chunk-xssw417m.js → chunk-ft4p6d28.js} +14 -14
- package/dist/chunk-fyzajkrx.js +2 -0
- package/dist/chunk-fzapbw9p.js +3 -0
- package/dist/chunk-g03s93qr.js +3 -0
- package/dist/chunk-g186znp9.js +33 -0
- package/dist/chunk-gawrg4gb.js +216 -0
- package/dist/chunk-gc1drn2p.js +2 -0
- package/dist/chunk-gea5hf0v.js +2 -0
- package/dist/chunk-gqv3ta5d.js +2 -0
- package/dist/chunk-h6kp2m9r.js +2 -0
- package/dist/chunk-h6zsqb9r.js +3 -0
- package/dist/{chunk-2snqdnk9.js → chunk-h85hrwkq.js} +13 -13
- package/dist/chunk-hbxz85wy.js +2 -0
- package/dist/chunk-hepd9qgx.js +6 -0
- package/dist/chunk-hhnw2sn3.js +2 -0
- package/dist/chunk-hjg3ndgh.js +2 -0
- package/dist/chunk-hk1mj4tz.js +2 -0
- package/dist/{chunk-smcj3442.js → chunk-hkrmcbwy.js} +79 -79
- package/dist/chunk-hn9pkyv8.js +2 -0
- package/dist/chunk-hpgr4qgp.js +2 -0
- package/dist/chunk-hrbbbtbn.js +2 -0
- package/dist/chunk-j03revz2.js +8 -0
- package/dist/chunk-j9qcrwbg.js +2 -0
- package/dist/chunk-jk4njz0w.js +2 -0
- package/dist/chunk-jmabeqfq.js +2 -0
- package/dist/chunk-jnkrn913.js +4 -0
- package/dist/chunk-jp10q90g.js +2 -0
- package/dist/chunk-jt0n43mk.js +2 -0
- package/dist/chunk-kjbv8a3m.js +2 -0
- package/dist/chunk-m1vdghnx.js +2 -0
- package/dist/chunk-m4sk62wb.js +5 -0
- package/dist/chunk-md8rqn48.js +30 -0
- package/dist/chunk-mp6hy8g4.js +2 -0
- package/dist/chunk-nc8my58s.js +2 -0
- package/dist/chunk-ngc2wke4.js +3 -0
- package/dist/chunk-nn2vstke.js +2 -0
- package/dist/chunk-nppdrf0x.js +2 -0
- package/dist/chunk-p2v2a68k.js +2 -0
- package/dist/chunk-pazfr1a1.js +2 -0
- package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
- package/dist/chunk-pdb5fw3r.js +2 -0
- package/dist/chunk-pdt69hpb.js +2 -0
- package/dist/chunk-pgzvyrv6.js +29 -0
- package/dist/chunk-px7fvbj6.js +3 -0
- package/dist/chunk-q6vrb2pe.js +2 -0
- package/dist/chunk-q7qchkvk.js +2 -0
- package/dist/chunk-q9bdh4s5.js +8 -0
- package/dist/chunk-qghxz7jm.js +194 -0
- package/dist/chunk-r3f9jcf7.js +5 -0
- package/dist/chunk-re8b5r9x.js +3 -0
- package/dist/chunk-s5xezjps.js +3 -0
- package/dist/chunk-sd321bn3.js +2 -0
- package/dist/chunk-shr559s7.js +3 -0
- package/dist/chunk-t4hzprsm.js +3 -0
- package/dist/chunk-t5pvq5mx.js +2 -0
- package/dist/{chunk-pv3d7sfn.js → chunk-t61vdbje.js} +89 -89
- package/dist/chunk-tafqyf2g.js +2033 -0
- package/dist/chunk-tfexmdkt.js +3 -0
- package/dist/chunk-thyt8ed8.js +6 -0
- package/dist/chunk-v91p6ekp.js +24 -0
- package/dist/chunk-vgvtnwxa.js +4 -0
- package/dist/chunk-w72qx0eb.js +2 -0
- package/dist/chunk-wfy1zq53.js +30 -0
- package/dist/chunk-wzx0164n.js +18 -0
- package/dist/chunk-x0q32ees.js +3 -0
- package/dist/chunk-xfp7k0v8.js +64 -0
- package/dist/chunk-xtvf6n6f.js +4 -0
- package/dist/chunk-xwzvfqcb.js +2 -0
- package/dist/chunk-y1cmjvk3.js +43 -0
- package/dist/chunk-y5310237.js +311 -0
- package/dist/chunk-ya0qecph.js +27 -0
- package/dist/chunk-yazk54jr.js +8 -0
- package/dist/chunk-ydjfar14.js +2 -0
- package/dist/chunk-ym95v4nc.js +3 -0
- package/dist/chunk-z0g9jvv0.js +40 -0
- package/dist/chunk-z23kaxq6.js +2 -0
- package/dist/chunk-z8xn5ta3.js +2 -0
- package/dist/{chunk-8sdhs0zk.js → chunk-zhxdpzga.js} +4 -4
- package/dist/cli.js +110 -110
- package/dist/craft-entry.js +7 -7
- package/dist/craft.js +7 -7
- package/dist/database.js +2 -2
- package/dist/image-optimization/component.js +4 -4
- package/dist/media/image/component.js +5 -5
- package/dist/media/protected/component.js +2 -2
- package/dist/media/video/index.js +4 -4
- package/dist/native/bridge/protocol.d.ts +325 -0
- package/dist/native/bridge/protocol.js +219 -0
- package/dist/native/cli.d.ts +24 -0
- package/dist/native/cli.js +52 -0
- package/dist/native/compiler/bundle.d.ts +41 -0
- package/dist/native/compiler/bundle.js +90 -0
- package/dist/native/compiler/client-script.d.ts +8 -0
- package/dist/native/compiler/client-script.js +31 -0
- package/dist/native/compiler/codegen.d.ts +10 -0
- package/dist/native/compiler/codegen.js +145 -0
- package/dist/native/compiler/headwind-to-style.d.ts +395 -0
- package/dist/native/compiler/headwind-to-style.js +1163 -0
- package/dist/native/compiler/html-to-ir.d.ts +41 -0
- package/dist/native/compiler/html-to-ir.js +411 -0
- package/dist/native/compiler/icons.d.ts +220 -0
- package/dist/native/compiler/icons.js +208 -0
- package/dist/native/compiler/ir.d.ts +234 -0
- package/dist/native/compiler/ir.js +15 -0
- package/dist/native/compiler/parser.d.ts +88 -0
- package/dist/native/compiler/parser.js +753 -0
- package/dist/native/compiler/render-screen.d.ts +26 -0
- package/dist/native/compiler/render-screen.js +31 -0
- package/dist/native/components/primitives.d.ts +291 -0
- package/dist/native/components/primitives.js +22 -0
- package/dist/native/hot-reload/client.d.ts +62 -0
- package/dist/native/hot-reload/client.js +324 -0
- package/dist/native/index.d.ts +90 -0
- package/dist/native/index.js +34 -0
- package/dist/native/primitives/ActivityIndicator.stx +5 -0
- package/dist/native/primitives/Button.stx +5 -0
- package/dist/native/primitives/DatePicker.stx +5 -0
- package/dist/native/primitives/FlatList.stx +5 -0
- package/dist/native/primitives/Image.stx +5 -0
- package/dist/native/primitives/ImageBackground.stx +5 -0
- package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
- package/dist/native/primitives/Modal.stx +5 -0
- package/dist/native/primitives/Picker.stx +5 -0
- package/dist/native/primitives/Pressable.stx +5 -0
- package/dist/native/primitives/RefreshControl.stx +5 -0
- package/dist/native/primitives/SafeAreaView.stx +5 -0
- package/dist/native/primitives/ScrollView.stx +5 -0
- package/dist/native/primitives/SectionList.stx +5 -0
- package/dist/native/primitives/Slider.stx +5 -0
- package/dist/native/primitives/StatusBar.stx +5 -0
- package/dist/native/primitives/Switch.stx +5 -0
- package/dist/native/primitives/Text.stx +5 -0
- package/dist/native/primitives/TextInput.stx +5 -0
- package/dist/native/primitives/TouchableHighlight.stx +5 -0
- package/dist/native/primitives/TouchableOpacity.stx +5 -0
- package/dist/native/primitives/View.stx +5 -0
- package/dist/native/runtime/craft.d.ts +75 -0
- package/dist/native/runtime/craft.js +0 -0
- package/dist/native/runtime/entry.d.ts +1 -0
- package/dist/native/runtime/entry.js +3 -0
- package/dist/native/runtime/index.d.ts +45 -0
- package/dist/native/runtime/index.js +165 -0
- package/dist/native/runtime/native-host.d.ts +33 -0
- package/dist/native/runtime/native-host.js +184 -0
- package/dist/native/runtime/screen.d.ts +43 -0
- package/dist/native/runtime/screen.js +808 -0
- package/dist/pwa/service-worker.js +1 -1
- package/dist/pwa/workbox.js +1 -1
- package/dist/pwa.js +8 -8
- package/dist/site-url.d.ts +1 -1
- package/dist/ssg.js +53 -53
- package/dist/visual-testing.js +42 -42
- package/dist/web-components/reactive-generator.js +2 -2
- package/package.json +9 -5
- package/dist/chunk-0btmm4m2.js +0 -147
- package/dist/chunk-0c2h69k2.js +0 -4
- package/dist/chunk-0d0qeqvv.js +0 -2
- package/dist/chunk-0psndabd.js +0 -2
- package/dist/chunk-0qv8yf53.js +0 -2
- package/dist/chunk-0vkxyvsd.js +0 -2
- package/dist/chunk-0we9nw1d.js +0 -3
- package/dist/chunk-0xqdmemy.js +0 -3
- package/dist/chunk-0y46fbkx.js +0 -3
- package/dist/chunk-158wqccn.js +0 -4422
- package/dist/chunk-1cyxbb8y.js +0 -16
- package/dist/chunk-1enwnh2a.js +0 -2
- package/dist/chunk-213pzm0d.js +0 -3
- package/dist/chunk-21hzqyja.js +0 -12
- package/dist/chunk-266t58b8.js +0 -5
- package/dist/chunk-27fgag95.js +0 -4
- package/dist/chunk-2a9n102n.js +0 -2
- package/dist/chunk-2eqzrczk.js +0 -2
- package/dist/chunk-2ke37m54.js +0 -14
- package/dist/chunk-35ds08e7.js +0 -3
- package/dist/chunk-3mtwkjcg.js +0 -2
- package/dist/chunk-4xr8zwkp.js +0 -2
- package/dist/chunk-58v77x2c.js +0 -2
- package/dist/chunk-5mhq8605.js +0 -2
- package/dist/chunk-5se8xt9e.js +0 -64
- package/dist/chunk-5zh0h080.js +0 -2
- package/dist/chunk-62435225.js +0 -2
- package/dist/chunk-6kdrncsx.js +0 -30
- package/dist/chunk-6n2rr3x7.js +0 -2
- package/dist/chunk-6xk87qf2.js +0 -30
- package/dist/chunk-72rwcbp6.js +0 -3
- package/dist/chunk-76w34xne.js +0 -3
- package/dist/chunk-7ekd7zj9.js +0 -2
- package/dist/chunk-7pr3wdd5.js +0 -3
- package/dist/chunk-7rxvafwc.js +0 -24
- package/dist/chunk-7tnwfa7w.js +0 -8
- package/dist/chunk-8c5je0wf.js +0 -2
- package/dist/chunk-8dz6nyvx.js +0 -2
- package/dist/chunk-98zj3fv2.js +0 -7
- package/dist/chunk-9e8t0twa.js +0 -3
- package/dist/chunk-9fqp72ze.js +0 -5
- package/dist/chunk-anydpa34.js +0 -3
- package/dist/chunk-ay6zjq8v.js +0 -3
- package/dist/chunk-az4v4ard.js +0 -3
- package/dist/chunk-ba5erggg.js +0 -2
- package/dist/chunk-bnagrdz6.js +0 -2
- package/dist/chunk-by8wghtf.js +0 -2
- package/dist/chunk-cd7h4q51.js +0 -2
- package/dist/chunk-cjmv8hgp.js +0 -33
- package/dist/chunk-cthf912y.js +0 -2
- package/dist/chunk-cxbpmwq5.js +0 -4
- package/dist/chunk-d3sy16qn.js +0 -2
- package/dist/chunk-dh6s7mrj.js +0 -1199
- package/dist/chunk-dm2nzg7a.js +0 -2
- package/dist/chunk-e2sgcnxc.js +0 -2
- package/dist/chunk-e3b7jj74.js +0 -2
- package/dist/chunk-ec4wq2sv.js +0 -6
- package/dist/chunk-ekzg97dn.js +0 -29
- package/dist/chunk-epjt342x.js +0 -2
- package/dist/chunk-eqe26g14.js +0 -18
- package/dist/chunk-ev0v1yma.js +0 -2
- package/dist/chunk-f53psr2y.js +0 -5
- package/dist/chunk-f8p69dsg.js +0 -3
- package/dist/chunk-f95drhdb.js +0 -194
- package/dist/chunk-ff5a6hvb.js +0 -17
- package/dist/chunk-fs5fy4h8.js +0 -2
- package/dist/chunk-fzsygce3.js +0 -2
- package/dist/chunk-g465x63k.js +0 -2
- package/dist/chunk-g708ekh1.js +0 -2
- package/dist/chunk-gcr9e83g.js +0 -11
- package/dist/chunk-gdmyrsr8.js +0 -4
- package/dist/chunk-gkms2ngq.js +0 -2
- package/dist/chunk-gnfywmgs.js +0 -7
- package/dist/chunk-hpf8kq7e.js +0 -2
- package/dist/chunk-j4x3faf8.js +0 -2
- package/dist/chunk-jkavtw9f.js +0 -2
- package/dist/chunk-kg1rdena.js +0 -3
- package/dist/chunk-km91wx0v.js +0 -2
- package/dist/chunk-kmsyvaex.js +0 -8
- package/dist/chunk-mrahwn5v.js +0 -8
- package/dist/chunk-nk3czvnk.js +0 -2
- package/dist/chunk-nmw4eewb.js +0 -2
- package/dist/chunk-nq5zxrk0.js +0 -4
- package/dist/chunk-ny67c03k.js +0 -3
- package/dist/chunk-p4wdxp2c.js +0 -2
- package/dist/chunk-pcxp4r9n.js +0 -3
- package/dist/chunk-pdyeaxc1.js +0 -2
- package/dist/chunk-pf06ded4.js +0 -2
- package/dist/chunk-pfs0gpzm.js +0 -2
- package/dist/chunk-pshdwq44.js +0 -2
- package/dist/chunk-pwgv84pn.js +0 -32
- package/dist/chunk-pwsnafp3.js +0 -4367
- package/dist/chunk-q9n5swx7.js +0 -3
- package/dist/chunk-qr346wnp.js +0 -2
- package/dist/chunk-r02hke04.js +0 -2
- package/dist/chunk-ranshpyc.js +0 -3
- package/dist/chunk-rn194bhp.js +0 -20
- package/dist/chunk-rn1hgyc8.js +0 -930
- package/dist/chunk-s7z5dp70.js +0 -43
- package/dist/chunk-s8jd13nb.js +0 -3
- package/dist/chunk-sn7exv0n.js +0 -2
- package/dist/chunk-t1tdjjht.js +0 -216
- package/dist/chunk-t6qx04s8.js +0 -499
- package/dist/chunk-t6y6gyps.js +0 -2
- package/dist/chunk-tjfs7cc3.js +0 -2
- package/dist/chunk-tkyrk66a.js +0 -3
- package/dist/chunk-tntv9hvq.js +0 -2
- package/dist/chunk-v3nwkveg.js +0 -12
- package/dist/chunk-vd4cb5xr.js +0 -2
- package/dist/chunk-vkhdce50.js +0 -2
- package/dist/chunk-w183av08.js +0 -2
- package/dist/chunk-w2m02njv.js +0 -2
- package/dist/chunk-wpjrcrs5.js +0 -2
- package/dist/chunk-wqmppf6b.js +0 -3
- package/dist/chunk-wtb9fxdy.js +0 -2
- package/dist/chunk-xmzygmcz.js +0 -3
- package/dist/chunk-xsng1mtq.js +0 -3
- package/dist/chunk-xxzefj4j.js +0 -2
- package/dist/chunk-yq8x8bxq.js +0 -47
- package/dist/chunk-ytma76qe.js +0 -3
- package/dist/chunk-yw1m115e.js +0 -2
- package/dist/chunk-z64a924m.js +0 -2
- package/dist/chunk-zcz9rs6p.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
3
|
-
${
|
|
2
|
+
function r(t,i){let e=i.pwa?.manifest?.themeColor||"#4f46e5";return`<div class="stx-pwa-install" style="display:none;">
|
|
3
|
+
${t}
|
|
4
4
|
</div>
|
|
5
5
|
<script>
|
|
6
6
|
(function() {
|
|
@@ -44,7 +44,7 @@ function H(j,z){let k=z.pwa?.manifest?.themeColor||"#4f46e5";return`<div class="
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
})();
|
|
47
|
-
</script>`}function
|
|
47
|
+
</script>`}function p(t,i){let e=i.pwa?.updates,a=e?.message||"A new version is available. Reload to update?",n=e?.autoReload||!1,s=t.trim().length>0,o=`
|
|
48
48
|
<div class="stx-pwa-update-banner" style="
|
|
49
49
|
position: fixed;
|
|
50
50
|
bottom: 0;
|
|
@@ -62,7 +62,7 @@ function H(j,z){let k=z.pwa?.manifest?.themeColor||"#4f46e5";return`<div class="
|
|
|
62
62
|
transform: translateY(100%);
|
|
63
63
|
transition: transform 0.3s ease;
|
|
64
64
|
">
|
|
65
|
-
<span style="font-size: 14px;">${
|
|
65
|
+
<span style="font-size: 14px;">${a}</span>
|
|
66
66
|
<div style="display: flex; gap: 12px;">
|
|
67
67
|
<button data-pwa-dismiss style="
|
|
68
68
|
background: transparent;
|
|
@@ -84,13 +84,13 @@ function H(j,z){let k=z.pwa?.manifest?.themeColor||"#4f46e5";return`<div class="
|
|
|
84
84
|
font-size: 14px;
|
|
85
85
|
">Update Now</button>
|
|
86
86
|
</div>
|
|
87
|
-
</div>`;return`${
|
|
87
|
+
</div>`;return`${s?`<div class="stx-pwa-update" style="display:none;">${t}</div>`:o}
|
|
88
88
|
<script>
|
|
89
89
|
(function() {
|
|
90
90
|
const updateContainer = document.querySelector('.stx-pwa-update, .stx-pwa-update-banner');
|
|
91
91
|
const dismissBtn = updateContainer?.querySelector('[data-pwa-dismiss]');
|
|
92
92
|
const reloadBtn = updateContainer?.querySelector('[data-pwa-reload], button');
|
|
93
|
-
const autoReload = ${
|
|
93
|
+
const autoReload = ${n};
|
|
94
94
|
let newWorker = null;
|
|
95
95
|
|
|
96
96
|
function showUpdate() {
|
|
@@ -155,7 +155,7 @@ else {
|
|
|
155
155
|
// Also listen for custom event
|
|
156
156
|
window.addEventListener('pwa-update-available', showUpdate);
|
|
157
157
|
})();
|
|
158
|
-
</script>`}function
|
|
158
|
+
</script>`}function d(t,i){let e=t.trim().length>0,a=`
|
|
159
159
|
<div class="stx-offline-indicator" style="
|
|
160
160
|
position: fixed;
|
|
161
161
|
top: 16px;
|
|
@@ -178,7 +178,7 @@ else {
|
|
|
178
178
|
<circle cx="12" cy="20" r="1"/>
|
|
179
179
|
</svg>
|
|
180
180
|
<span>You are offline</span>
|
|
181
|
-
</div>`;return`${
|
|
181
|
+
</div>`;return`${e?`<div class="stx-offline-indicator" style="display:none;">${t}</div>`:`
|
|
182
182
|
<div class="stx-offline-indicator" style="
|
|
183
183
|
position: fixed;
|
|
184
184
|
top: 16px;
|
|
@@ -216,15 +216,15 @@ else {
|
|
|
216
216
|
window.addEventListener('offline', updateStatus);
|
|
217
217
|
updateStatus();
|
|
218
218
|
})();
|
|
219
|
-
</script>`}function
|
|
220
|
-
${
|
|
219
|
+
</script>`}function l(t,i){let e=i.pwa?.push,a=e?.vapidPublicKey||"",n=e?.subscriptionEndpoint||"/api/push/subscribe";return`<div class="stx-pwa-push" style="display:none;">
|
|
220
|
+
${t}
|
|
221
221
|
</div>
|
|
222
222
|
<script>
|
|
223
223
|
(function() {
|
|
224
224
|
const pushContainer = document.querySelector('.stx-pwa-push');
|
|
225
225
|
const pushBtn = pushContainer?.querySelector('button, [data-pwa-push]') || pushContainer;
|
|
226
|
-
const vapidKey = '${
|
|
227
|
-
const endpoint = '${
|
|
226
|
+
const vapidKey = '${a}';
|
|
227
|
+
const endpoint = '${n}';
|
|
228
228
|
|
|
229
229
|
async function checkPushSupport() {
|
|
230
230
|
if (!('serviceWorker' in navigator) || !('PushManager' in window)) {
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var jc={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Bc={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Fc={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},zc={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},dr=[jc,Bc,Fc,zc];function od(t){return[...t,...dr]}
|
|
302
|
+
export{jc,Bc,Fc,zc,dr,od};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fa,ga,ma,ha,ya,ba,va,wa,xa,Sa,ml}from"./chunk-6h38kkjf.js";export{fa as createIslandRegistry,ml as default,Sa as generateIslandManifest,ma as generatePartialHydrationCSS,ba as hydrateAll,ya as hydrateByStrategy,ha as hydrateIsland,va as isHydrated,wa as onHydrated,ga as processPartialHydrationDirectives,xa as processStaticDirectives};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import i from"path";var _t=".stx",s="STX_DIR",e=null;function xo(t){e=t?.trim()||null}function un(){return process.env[s]?.trim()||e||_t}function o(t=process.cwd(),...n){let r=un();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function dn(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==_t&&!n.startsWith(`${_t}/`))return t;let r=n.slice(_t.length+1);return r?i.join(un(),r):un()}
|
|
3
|
+
export{_t,xo,un,o,dn};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{le}from"./chunk-3efw27as.js";import{de,S,Ke}from"./chunk-ngc2wke4.js";import{z}from"./chunk-b98be3yp.js";import{Y,Ce}from"./chunk-czxt605c.js";import{Pe,se,C,ie,ai,kr,ci,Mt}from"./chunk-wfy1zq53.js";import{Wr}from"./chunk-hepd9qgx.js";import{Nt}from"./chunk-9g27ybyr.js";import J from"fs";import M from"path";var{serve:ae}=globalThis.Bun;import k from"zlib";import{promisify as q}from"util";var Q=q(k.brotliCompress),Z=q(k.gzip),K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[s,...i]=a.trim().split(";"),l=s.trim().toLowerCase();if(!l)continue;let m=1;for(let f of i){let x=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(f);if(!x)continue;let g=Number.parseFloat(x[1]);if(Number.isFinite(g))m=g}e.set(l,m)}return e}function oe(t){if(!t)return null;let e=re(t),a=e.get("*"),s=(i)=>e.get(i)??a??0;if(s("br")>0)return"br";if(s("gzip")>0)return"gzip";return null}async function Ot(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let s=oe(t.headers.get("accept-encoding"));if(!s)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let l=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:W(e.headers)});if(i.length<(a.threshold??te))return l();try{let m=s==="br"?await Q(i,{params:{[k.constants.BROTLI_PARAM_QUALITY]:a.quality??5,[k.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Z(i);if(m.length>=i.length)return l();let f=W(e.headers);return f.set("Content-Encoding",s),f.set("Content-Length",String(m.length)),new Response(m,{status:e.status,statusText:e.statusText,headers:f})}catch{return l()}}function W(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class D{now;entries=new z(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let s,i=async()=>{let r=s??await a();return r.headers.set("Cache-Control","private, no-store"),r.headers.set("Vary",C(r.headers.get("Vary")).Vary),r};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let l=new URL(t.url),m=`${l.origin}${l.pathname}${l.search}|${se(t)?"fragment":"document"}`,f=this.entries.get(m),x=(r)=>{let T=new Headers(r.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-r.created)/1000)))),new Response(r.body.slice(0),{headers:T})},g=f?(this.now()-f.created)/1000:1/0;if(f&&g<e.maxAge)return x(f);let b=this.generation,B=async()=>{let r=await a();s=r;let T=(r.headers.get("Vary")??"").toLowerCase().split(",").map((R)=>R.trim()).filter(Boolean);if(r.status!==200||r.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(r.headers.get("Cache-Control")??"")||T.some((R)=>R!=="x-stx-router"&&R!=="accept-encoding"))return null;let L=await r.clone().arrayBuffer();if(L.byteLength>1048576)return null;r.headers.set("Vary",C(r.headers.get("Vary")).Vary);let n={body:L,headers:Array.from(r.headers.entries()),created:this.now(),path:l.pathname};if(this.generation===b)this.entries.set(m,n);return n},v=this.pending.get(m);if(!v){if(this.pending.size>=1000)return i();v=B().finally(()=>{if(this.pending.get(m)===v)this.pending.delete(m)}),this.pending.set(m,v)}if(f&&g<e.maxAge+(e.swr??0))return v.catch(()=>{}),x(f);let E=await v;return E?x(E):i()}}var ce={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function ll(t={}){let e=M.resolve(t.outputDir||".output"),a=t.port??3000,s=ai(e);if(!s)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${s.routes.length} routes...`);let i=Nt(s.routeRules),l=new D,m=Wr(e,s.apiRoutes??[]),f=Bun.file(M.join(e,"server/runtime-config.json")),x=t.runtimeConfig??(await f.exists()?await f.json():void 0),g=x?S(x):void 0,b=new Map,B=new Map,v=new Map,E=new Map;for(let n of s.routes)try{let R=M.join(e,n.compiledPath),c=JSON.parse(await Bun.file(R).text());if(g)c.html=Ke(c.html,g);b.set(n.pattern,c),v.set(n.pattern,Ce(c.html)),E.set(n.pattern,le(c.html));let N=M.join(e,n.fragmentPath);if(await Bun.file(N).exists()){let A=await Bun.file(N).text();B.set(n.pattern,g?Ke(A,g):A)}}catch(R){console.warn(`[stx] Failed to load route ${n.pattern}:`,R)}let r=new Map,T=[];for(let n of s.routes)if(n.hasParams){let{regex:R,params:c}=Y(n.pattern);T.push({regex:R,route:n,paramNames:c})}else r.set(n.pattern,n);let L=ae({port:a,async fetch(n){return Ot(n,await de(g??S(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let N=await m(n);if(N)return N;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=M.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=M.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${M.sep}`))try{if(J.existsSync(u)&&J.statSync(u).isFile()){let h=M.extname(u).toLowerCase(),j=ce[h]||"application/octet-stream",_=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":j,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=se(n),y=null,G={};if(y=r.get(c)||null,!y)for(let{regex:p,route:d,paramNames:u}of T){let o=c.match(p);if(o){y=d,u.forEach((h,j)=>{G[h]=o[j+1]});break}}if(!y){let p=r.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let O=i(c),U=Object.keys(O).length>0;return l.respond(n,O.cache,async()=>{let p=b.get(y.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=B.get(y.pattern);if(o){let h=v.get(y.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(y.pattern)?{"X-STX-Runtime":E.get(y.pattern)?"true":"false"}:{},...h?{"X-STX-Layout":h.layout,"X-STX-Layout-Group":h.group}:{},...C(),...O.cache?{}:{"Cache-Control":Pe}}})}}let d=kr(n.method),u=b.get(y.pattern);if(!u){let o=r.get("/500")||null;if(o){let h=b.get(o.pattern);if(h)return new Response(h.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(y.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...C(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:h,redirect:j,cookies:_,status:H,headers:I}=await Mt(u,{params:G,request:n,method:n.method,__stx_strict_hydration:U,__stx_runtime_config:g});if(j)return ci(j,_,I);if(h&&h.length>0){let{renderStreamingPage:P,streamToResponse:F}=await import("./chunk-gc1drn2p.js"),X=new Headers({...C(),...I,"Cache-Control":"private, no-store"});for(let V of _??[])X.append("Set-Cookie",V);if(A&&!d){let V=Ce(o);X.set("X-STX-Fragment","true"),X.set("X-STX-Runtime",le(o)?"true":"false"),X.set("X-STX-Layout",V.layout),X.set("X-STX-Layout-Group",V.group)}return F(P(A&&!d?ie(o,s.routerContainer||"main"):o,h,{timeoutMs:30000}),{status:H??u.status??200,headers:X})}let w=new Headers({"Content-Type":"text/html",...C(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of _??[])w.append("Set-Cookie",P);for(let[P,F]of Object.entries(I??{}))w.set(P,F);if(w.set("Vary",C(w.get("Vary")).Vary),A&&!d){let P=Ce(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",le(o)?"true":"false"),w.set("X-STX-Layout",P.layout),w.set("X-STX-Layout-Group",P.group),new Response(ie(o,s.routerContainer||"main"),{status:H??u.status??200,headers:w})}return new Response(o,{status:H??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),U)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${L.port}`),console.log(`[stx] Serving ${s.routes.length} routes (${b.size} pre-loaded)`),{port:L.port,stop:()=>{l.invalidate(),L.stop()},invalidate:(n)=>l.invalidate(n)}}
|
|
3
|
+
export{Ot,ll};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{m}from"./chunk-ce1sejr3.js";import{R,Pt}from"./chunk-8nhshfz6.js";import{y,ze,N,i}from"./chunk-3efw27as.js";import{ce,mt,ht}from"./chunk-42wbs8vq.js";import{De,Xt,Q}from"./chunk-f46qsp4m.js";import _ from"path";var g=new Map,v=new Map,P=["composables","functions"];function E(n){let t=_.basename(n,".ts");return t==="index"||t==="types"||n.endsWith(".d.ts")}async function G(n){if(n)return _.resolve(n);let t=`<default>:${process.cwd()}`,l=v.get(t);if(l!==void 0)return l;let s=await J();if(s!==null)v.set(t,s);return s}async function J(){let n=await i(),t=n.root||process.cwd(),l=n.composablesDir;if(l)return _.resolve(t,l);for(let s of P){let r=_.resolve(t,s);try{let c=new Bun.Glob("**/*.ts");for await(let a of c.scan({cwd:r,absolute:!0}))if(!E(a))return r}catch{}}return null}async function j(n){let t=Array.isArray(n)?n:n?[_.resolve(n)]:(await i())._layerComposableDirs??[await G()].filter((s)=>!!s),l=new Map;for(let s of t){let r=new Bun.Glob("**/*.ts");try{for await(let c of r.scan({cwd:s,absolute:!0})){let a=_.relative(s,c);if(!E(c)&&!l.has(a))l.set(a,c)}}catch{}}return{key:t.join("\x00"),files:[...l.values()].sort()}}async function Mr(n){let{files:t}=await j(n),l=N({loader:"ts",target:"browser",define:y()}),s=[];for(let r of t)try{let c=await Bun.file(r).text(),a=l.scan(c).exports.filter((d)=>d!=="default");if(a.length>0)s.push({file:r,names:a})}catch{}return s}function T(n,t){return new RegExp(`\\b${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(n)}function z(n,t,l){let s=new Map;for(let{file:d,names:f}of n)for(let u of f)if(!s.has(u))s.set(u,d);let r=(d)=>{let f=[];for(let[u,w]of s)if(T(d,u))f.push(w);return f},c=new Set,a=l.flatMap(r);while(a.length>0){let d=[];for(let f of a){if(c.has(f))continue;c.add(f);for(let u of r(t.get(f)??""))if(!c.has(u))d.push(u)}a=d}return c}async function bl(n,t,l){let{key:s,files:r}=await j(n);if(!s)return null;let c=()=>[...new Set([...r,...r.flatMap((e)=>ce(e))])],a=De(c());if(r.length===0)return Q(g,s,a,""),null;r.sort();let d=N({loader:"ts",target:"browser",define:y()}),f=new Map,u=[];for(let e of r)try{let o=await Bun.file(e).text();f.set(e,o);let h=d.scan(o).exports.filter((p)=>p!=="default");if(h.length>0)u.push({file:e,names:h})}catch{f.set(e,"")}let w=t===void 0?new Set(r):z(u,f,l?[t,...l]:[t]);if(w.size===0)return null;let B=r.filter((e)=>w.has(e)),x=`${s}\x00${B.join("\x00")}`,M=Xt(g,x,a);if(M!==void 0)return M||null;let S=[],b=new Set,D=new Set;for(let e of B)try{let o=f.get(e)??await Bun.file(e).text(),h=_.basename(e,".ts");for(let p of o.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(p[1])D.add(p[1]);try{for(let p of d.scan(o).exports)if(p!=="default")b.add(p)}catch{}if(o=R(o),mt(o))o=await ht(o,e,{projectRoot:process.cwd(),externalizeUserModules:!1}),o=ze(o);o=Pt(o),o=o.replace(/^export\s+(default\s+)?/gm,""),o=d.transformSync(o),S.push(`// Composable: ${h}
|
|
3
|
+
${o.trim()}`)}catch(o){console.warn(`[stx] Failed to load composable ${e}:`,o)}if(S.length===0||b.size===0)return Q(g,x,a,""),null;let F=[...b].map((e)=>` try { if (!(${JSON.stringify(e)} in __c)) __c[${JSON.stringify(e)}] = ${e}; } catch (e) {}`).join(`
|
|
4
|
+
`),k=JSON.stringify([...b]),C=S.join(`
|
|
5
|
+
|
|
6
|
+
`),O=m.filter((e)=>!D.has(e)&&new RegExp(`\\b${e}\\b`).test(C)).map((e)=>`var ${e} = __stx[${JSON.stringify(e)}];`).join(`
|
|
7
|
+
`),I=JSON.stringify(new Bun.CryptoHasher("md5").update(`${k}\x00${C}`).digest("hex").slice(0,12)),A=`;(function(){
|
|
8
|
+
var __bundles = window.__stxComposableBundles || (window.__stxComposableBundles = {});
|
|
9
|
+
if (__bundles[${I}]) return;
|
|
10
|
+
__bundles[${I}] = true;
|
|
11
|
+
var __published = window.__stxComposableGlobals || (window.__stxComposableGlobals = {});
|
|
12
|
+
window.__composables = window.__composables || {};
|
|
13
|
+
var __c = window.__composables;
|
|
14
|
+
var __stx = window.stx || {};
|
|
15
|
+
${O}
|
|
16
|
+
${C}
|
|
17
|
+
${F}
|
|
18
|
+
var __names = ${k};
|
|
19
|
+
for (var __i = 0; __i < __names.length; __i++) {
|
|
20
|
+
var __n = __names[__i];
|
|
21
|
+
if (!(__n in __c) || __published[__n]) continue;
|
|
22
|
+
var __takenByBuiltin = !!(window.stx && __n in window.stx);
|
|
23
|
+
if (__takenByBuiltin || __n in window) {
|
|
24
|
+
console.warn('[stx] composable "' + __n + '" is not available as a bare identifier: '
|
|
25
|
+
+ (__takenByBuiltin ? 'a built-in of that name already exists' : 'window already defines that property')
|
|
26
|
+
+ '. Rename it, or use: import { ' + __n + ' } from "@composables"');
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
window[__n] = __c[__n];
|
|
30
|
+
__published[__n] = true;
|
|
31
|
+
}
|
|
32
|
+
})();`;return a=De(c()),Q(g,x,a,A),A}function vl(){g.clear(),v.clear()}
|
|
33
|
+
export{Mr,bl,vl};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function pi(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function fi(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
|
|
3
|
+
<div class="virtual-item ${t.itemClass||""}"
|
|
4
|
+
style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
|
|
5
|
+
data-index="${a}">
|
|
6
|
+
${H}
|
|
7
|
+
</div>`}let L=e.length*t.itemHeight;return`
|
|
8
|
+
<div id="${n}"
|
|
9
|
+
class="virtual-list-container ${t.containerClass||""}"
|
|
10
|
+
style="position: relative; height: ${t.containerHeight}px; overflow-y: auto;"
|
|
11
|
+
data-item-height="${t.itemHeight}"
|
|
12
|
+
data-total-items="${e.length}"
|
|
13
|
+
data-overscan="${h}">
|
|
14
|
+
<div class="virtual-list-viewport ${t.viewportClass||""}"
|
|
15
|
+
style="position: relative; height: ${L}px; width: 100%;">
|
|
16
|
+
${S}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<script data-virtual-list="${n}">
|
|
20
|
+
(function() {
|
|
21
|
+
const container = document.getElementById('${n}');
|
|
22
|
+
if (!container) return;
|
|
23
|
+
|
|
24
|
+
const viewport = container.querySelector('.virtual-list-viewport');
|
|
25
|
+
const itemHeight = ${t.itemHeight};
|
|
26
|
+
const totalItems = ${e.length};
|
|
27
|
+
const overscan = ${h};
|
|
28
|
+
const containerHeight = ${t.containerHeight};
|
|
29
|
+
const items = ${JSON.stringify(e)};
|
|
30
|
+
const template = ${JSON.stringify(g.trim())};
|
|
31
|
+
|
|
32
|
+
let lastStartIndex = 0;
|
|
33
|
+
|
|
34
|
+
function renderItems(scrollTop) {
|
|
35
|
+
const startIndex = Math.max(0, Math.floor(scrollTop / itemHeight) - overscan);
|
|
36
|
+
const visibleCount = Math.ceil(containerHeight / itemHeight);
|
|
37
|
+
const endIndex = Math.min(totalItems - 1, startIndex + visibleCount + overscan * 2);
|
|
38
|
+
|
|
39
|
+
if (startIndex === lastStartIndex) return;
|
|
40
|
+
lastStartIndex = startIndex;
|
|
41
|
+
|
|
42
|
+
// Clear and re-render
|
|
43
|
+
viewport.innerHTML = '';
|
|
44
|
+
|
|
45
|
+
for (let i = startIndex; i <= endIndex; i++) {
|
|
46
|
+
const item = items[i];
|
|
47
|
+
const div = document.createElement('div');
|
|
48
|
+
div.className = 'virtual-item ${t.itemClass||""}';
|
|
49
|
+
div.style.cssText = 'position: absolute; top: ' + (i * itemHeight) + 'px; height: ' + itemHeight + 'px; width: 100%;';
|
|
50
|
+
div.dataset.index = i;
|
|
51
|
+
|
|
52
|
+
let html = template
|
|
53
|
+
.replace(/\\{\\{\\s*item\\s*\\}\\}/g, typeof item === 'object' ? JSON.stringify(item) : String(item))
|
|
54
|
+
.replace(/\\{\\{\\s*item\\.(\\w+)\\s*\\}\\}/g, (_, prop) => {
|
|
55
|
+
return typeof item === 'object' && item !== null ? String(item[prop] ?? '') : '';
|
|
56
|
+
})
|
|
57
|
+
.replace(/\\{\\{\\s*index\\s*\\}\\}/g, String(i));
|
|
58
|
+
|
|
59
|
+
div.innerHTML = html;
|
|
60
|
+
viewport.appendChild(div);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
container.addEventListener('scroll', function() {
|
|
65
|
+
requestAnimationFrame(() => renderItems(container.scrollTop));
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Expose API
|
|
69
|
+
container.__virtualList = {
|
|
70
|
+
scrollToIndex: function(index) {
|
|
71
|
+
container.scrollTop = index * itemHeight;
|
|
72
|
+
},
|
|
73
|
+
refresh: function() {
|
|
74
|
+
renderItems(container.scrollTop);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
})();
|
|
78
|
+
</script>
|
|
79
|
+
`})}function la(){return`
|
|
80
|
+
.virtual-list-container {
|
|
81
|
+
position: relative;
|
|
82
|
+
overflow-y: auto;
|
|
83
|
+
overflow-x: hidden;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.virtual-list-container::-webkit-scrollbar {
|
|
87
|
+
width: 8px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.virtual-list-container::-webkit-scrollbar-track {
|
|
91
|
+
background: rgba(0, 0, 0, 0.1);
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.virtual-list-container::-webkit-scrollbar-thumb {
|
|
96
|
+
background: rgba(0, 0, 0, 0.3);
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.virtual-list-container::-webkit-scrollbar-thumb:hover {
|
|
101
|
+
background: rgba(0, 0, 0, 0.5);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.virtual-list-viewport {
|
|
105
|
+
position: relative;
|
|
106
|
+
width: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.virtual-item {
|
|
110
|
+
position: absolute;
|
|
111
|
+
left: 0;
|
|
112
|
+
right: 0;
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Loading placeholder for items */
|
|
117
|
+
.virtual-item-placeholder {
|
|
118
|
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
119
|
+
background-size: 200% 100%;
|
|
120
|
+
animation: virtual-shimmer 1.5s infinite;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes virtual-shimmer {
|
|
124
|
+
0% { background-position: 200% 0; }
|
|
125
|
+
100% { background-position: -200% 0; }
|
|
126
|
+
}
|
|
127
|
+
`}function ua(v,c){let l=null,u=()=>{if(!l)l=pi(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function da(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=fi(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
|
+
// Infinite scroll detection
|
|
129
|
+
container.addEventListener('scroll', function() {
|
|
130
|
+
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
131
|
+
const threshold = ${n.threshold};
|
|
132
|
+
const totalHeight = viewport.offsetHeight;
|
|
133
|
+
|
|
134
|
+
if (scrollBottom >= totalHeight - threshold) {
|
|
135
|
+
container.dispatchEvent(new CustomEvent('loadmore', { bubbles: true }));
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
</script>`),`
|
|
139
|
+
<div id="${f}" class="infinite-list-wrapper">
|
|
140
|
+
${h}
|
|
141
|
+
<div class="infinite-list-loading" style="display: none;">
|
|
142
|
+
${x}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
`})}function pa(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
|
|
146
|
+
<div class="virtual-grid-item"
|
|
147
|
+
style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
|
|
148
|
+
data-index="${I}">
|
|
149
|
+
${p}
|
|
150
|
+
</div>`}return`
|
|
151
|
+
<div id="${n}"
|
|
152
|
+
class="virtual-grid-container"
|
|
153
|
+
style="position: relative; height: ${t.containerHeight}px; overflow-y: auto;">
|
|
154
|
+
<div class="virtual-grid-viewport"
|
|
155
|
+
style="position: relative; height: ${h}px; width: 100%;">
|
|
156
|
+
${a}
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
<script data-virtual-grid="${n}">
|
|
160
|
+
(function() {
|
|
161
|
+
const container = document.getElementById('${n}');
|
|
162
|
+
if (!container) return;
|
|
163
|
+
|
|
164
|
+
const viewport = container.querySelector('.virtual-grid-viewport');
|
|
165
|
+
const columns = ${t.columns};
|
|
166
|
+
const rowHeight = ${t.rowHeight};
|
|
167
|
+
const gap = ${t.gap||0};
|
|
168
|
+
const totalItems = ${e.length};
|
|
169
|
+
const overscan = ${y};
|
|
170
|
+
const containerHeight = ${t.containerHeight};
|
|
171
|
+
const items = ${JSON.stringify(e)};
|
|
172
|
+
const template = ${JSON.stringify(g.trim())};
|
|
173
|
+
|
|
174
|
+
let lastStartRow = 0;
|
|
175
|
+
|
|
176
|
+
function renderItems(scrollTop) {
|
|
177
|
+
const startRow = Math.max(0, Math.floor(scrollTop / (rowHeight + gap)) - overscan);
|
|
178
|
+
const visibleRowCount = Math.ceil(containerHeight / (rowHeight + gap));
|
|
179
|
+
const endRow = Math.min(Math.ceil(totalItems / columns) - 1, startRow + visibleRowCount + overscan * 2);
|
|
180
|
+
|
|
181
|
+
if (startRow === lastStartRow) return;
|
|
182
|
+
lastStartRow = startRow;
|
|
183
|
+
|
|
184
|
+
viewport.innerHTML = '';
|
|
185
|
+
|
|
186
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
187
|
+
for (let col = 0; col < columns; col++) {
|
|
188
|
+
const index = row * columns + col;
|
|
189
|
+
if (index >= totalItems) break;
|
|
190
|
+
|
|
191
|
+
const item = items[index];
|
|
192
|
+
const div = document.createElement('div');
|
|
193
|
+
div.className = 'virtual-grid-item';
|
|
194
|
+
div.style.cssText = 'position: absolute; top: ' + (row * (rowHeight + gap)) + 'px; left: ' + (col * (100 / columns)) + '%; width: calc(' + (100 / columns) + '% - ' + gap + 'px); height: ' + rowHeight + 'px;';
|
|
195
|
+
div.dataset.index = index;
|
|
196
|
+
|
|
197
|
+
let html = template
|
|
198
|
+
.replace(/\\{\\{\\s*item\\s*\\}\\}/g, typeof item === 'object' ? JSON.stringify(item) : String(item))
|
|
199
|
+
.replace(/\\{\\{\\s*item\\.(\\w+)\\s*\\}\\}/g, (_, prop) => {
|
|
200
|
+
return typeof item === 'object' && item !== null ? String(item[prop] ?? '') : '';
|
|
201
|
+
})
|
|
202
|
+
.replace(/\\{\\{\\s*index\\s*\\}\\}/g, String(index));
|
|
203
|
+
|
|
204
|
+
div.innerHTML = html;
|
|
205
|
+
viewport.appendChild(div);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
container.addEventListener('scroll', function() {
|
|
211
|
+
requestAnimationFrame(() => renderItems(container.scrollTop));
|
|
212
|
+
});
|
|
213
|
+
})();
|
|
214
|
+
</script>
|
|
215
|
+
`})}var gl={createVirtualList:pi,processVirtualListDirectives:fi,processInfiniteListDirectives:da,processVirtualGridDirectives:pa,generateVirtualListCSS:la,useVirtualList:ua};
|
|
216
|
+
export{pi,fi,la,ua,da,pa,gl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Kl,mi,_a,Gl,Jl,Yl,Zl,Ql,Ra,Aa,eu,tu,nu,ru}from"./chunk-qghxz7jm.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{_a as SUSPENSE_RESOLVER_RUNTIME,mi as buildSuspenseResolveScript,Ql as createStreamRenderer,Yl as extractStreamBoundaries,ru as generateHydrationRuntime,Aa as islandDirective,tu as processSectionDirectives,Jl as processStreamDirectives,eu as registerStreamingDirectives,Gl as renderStreamingPage,Kl as streamTemplate,Zl as streamTemplateSimple,nu as streamToResponse,Ra as streamingSuspenseDirective};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pa,lu,uu,du,pu,Ia,Da,fu,gu,mu,hu,Zt,Qt,Dn}from"./chunk-re8b5r9x.js";import{he}from"./chunk-et0rr8c7.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{pu as __setSignalsGeneratorsForTest,he as cacheEngineFingerprint,Qt as cacheTemplate,Zt as checkCache,hu as clearDevCaches,Da as getCachedRouterScript,Ia as getCachedSignalsRuntime,fu as getServeClientAsset,mu as getServeModuleBundle,Dn as hashFilePath,uu as invalidateFileCache,du as invalidateFileCacheByDir,lu as readFileCached,gu as registerServeModuleBundle,Pa as templateCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Jc}from"./chunk-xtvf6n6f.js";import"./chunk-wfy1zq53.js";import"./chunk-765e1s44.js";import"./chunk-hepd9qgx.js";import"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{Jc as buildForProduction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{St,as,Ki,dc}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{dc as declareBareLoopHead,St as parseLoopBinding,Ki as processLoops,as as reportDeferredLoopWarnings};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function it(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function pr(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function ot(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Ls(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function Ee(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function js(e){console.log(` ${O("\u2139")} ${e}`)}function Bs(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function fr(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function at(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Fs(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function ct(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
|
|
3
|
+
export{it,pr,ot,Ls,Ee,js,Bs,fr,at,Fs,ct};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
${
|
|
4
|
-
</div>`:` <div class="stx-error-boundary-content" data-boundary-content="${
|
|
5
|
-
${
|
|
2
|
+
var u=0;function y(){return`eb-${++u}-${Date.now().toString(36)}`}var s=/<!--stx-render-failed:([a-z-]+)-->/g;function b(e){return e.replace(s,"")}function k(e,o={},n){let r=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return e.replace(r,(a,t,l,i)=>{let d=y(),c=f(t||"");return p(d,l.trim(),i.trim(),c)})}function f(e){let o={},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,r;while((r=n.exec(e))!==null){let a=r[1],t=r[2]||r[3]||r[4];switch(a){case"id":o.id=t;break;case"logErrors":o.logErrors=t==="true";break}}return o}function p(e,o,n,r){let a=r.logErrors!==!1,t=s.test(o);s.lastIndex=0;let l=t?` <div class="stx-error-boundary-fallback" data-boundary-fallback="${e}">
|
|
3
|
+
${n}
|
|
4
|
+
</div>`:` <div class="stx-error-boundary-content" data-boundary-content="${e}">
|
|
5
|
+
${b(o)}
|
|
6
6
|
</div>
|
|
7
|
-
<div class="stx-error-boundary-fallback" data-boundary-fallback="${
|
|
8
|
-
${
|
|
7
|
+
<div class="stx-error-boundary-fallback" data-boundary-fallback="${e}" style="display: none;">
|
|
8
|
+
${n}
|
|
9
9
|
</div>`;return`
|
|
10
|
-
<div class="stx-error-boundary" data-boundary-id="${
|
|
11
|
-
${
|
|
10
|
+
<div class="stx-error-boundary" data-boundary-id="${e}" data-has-error="${t}">
|
|
11
|
+
${l}
|
|
12
12
|
</div>
|
|
13
13
|
<script>
|
|
14
14
|
(function() {
|
|
15
|
-
const boundaryId = '${
|
|
16
|
-
const logErrors = ${
|
|
15
|
+
const boundaryId = '${e}';
|
|
16
|
+
const logErrors = ${a};
|
|
17
17
|
const boundary = document.querySelector('[data-boundary-id="' + boundaryId + '"]');
|
|
18
18
|
const contentEl = document.querySelector('[data-boundary-content="' + boundaryId + '"]');
|
|
19
19
|
const fallbackEl = document.querySelector('[data-boundary-fallback="' + boundaryId + '"]');
|
|
@@ -121,7 +121,7 @@ ${T}
|
|
|
121
121
|
};
|
|
122
122
|
})();
|
|
123
123
|
</script>
|
|
124
|
-
`}async function
|
|
124
|
+
`}async function E(e,o,n){try{return await e()}catch(r){if(n)n(r instanceof Error?r:Error(String(r)));else console.error("[stx:errorBoundary] SSR Error:",r);return o}}function h(e,o={}){let n=o.onError?(r)=>o.onError(r,{timestamp:Date.now(),boundaryId:"ssr"}):void 0;return(r)=>E(r,e,n)}function g(){return`
|
|
125
125
|
/* STX Error Boundary Styles */
|
|
126
126
|
.stx-error-boundary {
|
|
127
127
|
position: relative;
|
|
@@ -165,7 +165,7 @@ ${T}
|
|
|
165
165
|
color: #fecaca;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
`}function
|
|
168
|
+
`}function w(){return`
|
|
169
169
|
// STX Error Boundary Runtime
|
|
170
170
|
(function() {
|
|
171
171
|
if (typeof window === 'undefined') return;
|
|
@@ -230,4 +230,4 @@ ${T}
|
|
|
230
230
|
|
|
231
231
|
console.log('[stx] Error boundary runtime initialized');
|
|
232
232
|
})();
|
|
233
|
-
`}export{
|
|
233
|
+
`}export{h as createErrorBoundary,g as generateErrorBoundaryCSS,w as generateErrorBoundaryRuntime,k as processErrorBoundaryDirectives,b as stripRenderFailedMarkers,E as withErrorBoundary};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Y}from"./chunk-czxt605c.js";import{de,S}from"./chunk-ngc2wke4.js";import{fo}from"./chunk-ak1cgcah.js";import{o}from"./chunk-fzapbw9p.js";import v from"fs";import m from"path";import{pathToFileURL as O}from"url";var E=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],P=new Set;function yt(s,l={}){let i=m.resolve(s,l.dir??"server/api"),a=[],f=new Map;if(!v.existsSync(i))return a;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:i})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let u=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=u.pop(),c=n.lastIndexOf("."),d=c>=0?n.slice(c+1):"get",g=d.toUpperCase();if(!E.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${E.map((A)=>A.toLowerCase()).join(", ")}`);if(c>=0)n=n.slice(0,c);if(n!=="index")u.push(n);let r=new Set,h=u.map((A,I)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&I!==u.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,x=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(x))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(x)} and ${e}`);f.set(x,e);let R=m.join(i,e);P.add(m.resolve(R)),P.add(v.realpathSync(R)),a.push({pattern:w,method:g,filePath:R})}return a.sort((e,p)=>{let u=e.pattern.split("/"),n=p.pattern.split("/"),c=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(u.length,n.length);d++){let g=c(n[d])-c(u[d]);if(g)return g}return e.pattern.localeCompare(p.pattern)||e.method.localeCompare(p.method)})}async function Vr(s,l){let i=o(s,"api-types.d.ts"),a=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of l){let e=`./${m.relative(m.dirname(i),t.filePath).replace(/\\/g,"/")}`,{params:p}=Y(t.pattern);a.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${p.map((u)=>`${JSON.stringify(u)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}a.push(" }","}","export {}","");let f=a.join(`
|
|
3
|
+
`);if(!await Bun.file(i).exists()||await Bun.file(i).text()!==f)await Bun.write(i,f);return i}async function Ur(s,l,i={}){let a=yt(s,i);await Vr(s,a);let f=[];for(let t of a){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
+
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function j(s,l){let i=s.map((a)=>({route:a,...Y(a.pattern)}));return async(a)=>{let f=new URL(a.url).pathname,t=i.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=a.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(a,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function Wr(s,l){return j(l,async(i)=>(await import(O(m.resolve(s,i.filePath)).href)).default)}async function Eu(s,l){if(!l)return async()=>null;let i=l===!0?{}:l,a=yt(s,i);return await Vr(s,a),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=yt(s,i);await Vr(s,t);let{loadStxConfig:e}=await import("./chunk-hpgr4qgp.js"),p=S((await e(s)).runtimeConfig);return await de(p,()=>j(t,async(u)=>{let n=await Bun.build({entrypoints:[u.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
|
+
`));let c=n.outputs.find((d)=>d.kind==="entry-point");if(!c||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${u.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await c.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function qr(s,l,i){if(fo(s))return!0;let a=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(a.test(m.basename(s)))return!0;try{if(a.test(m.basename(v.realpathSync(s))))return!0}catch{}if(P.has(m.resolve(s)))return!0;if(!i)return!1;let f=m.resolve(l,typeof i==="object"?i.dir??"server/api":"server/api"),t=(p)=>{try{return v.realpathSync(p)}catch{return m.resolve(p)}},e=t(s);return[f,m.resolve(l,"server"),m.resolve(l,".output/server")].some((p)=>{let u=t(p);return e===u||e.startsWith(`${u}${m.sep}`)})}
|
|
6
|
+
export{yt,Vr,Ur,Wr,Eu,qr};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{d,os,qi,Xi,fc,gc,mc,hc,yc,bc,Ve,N,Ue,vc,qn,wc,so,xc,We,n,Xn,io,g,K,ju}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{K as clearComponentCache,xc as componentClientSignalNames,os as convertToCommonJS,g as createDetailedErrorMessage,yc as extractDirectiveNames,qi as extractScriptFromTemplate,d as extractVariables,n as fileExists,ju as getComponentCacheStats,gc as getPositionInfo,N as getSharedTranspiler,io as getSourceLineInfo,hc as hasDirectives,Xi as hasVariables,wc as isHydrateTrigger,bc as isJavaScriptScript,We as renderComponentWithSlot,Xn as resolveTemplatePath,vc as scopeOnRootElement,Ve as shouldTranspileTypeScript,so as slotContentHasExpressions,Ue as transpileTypeScript,qn as userComponentFileExists,mc as validateDirective,fc as validateTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rn,Qa,ts}from"./chunk-3efw27as.js";import"./chunk-752hw7cd.js";import"./chunk-shr559s7.js";import"./chunk-ak1cgcah.js";import"./chunk-9amp82bx.js";import"./chunk-b98be3yp.js";import"./chunk-ngc2wke4.js";import"./chunk-xfp7k0v8.js";import"./chunk-m4sk62wb.js";import{ke}from"./chunk-z0g9jvv0.js";import"./chunk-8nhshfz6.js";import"./chunk-7gkv67ky.js";import"./chunk-ce1sejr3.js";import"./chunk-czxt605c.js";export{ke as freeIdentifiers,ts as processComponents,Qa as processESImports,rn as rendersAsElement};
|