@stacksjs/stx 0.2.674 → 0.2.676
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/{chunk-szevd7d5.js → chunk-028e9fty.js} +2 -2
- package/dist/{chunk-rr527jt6.js → chunk-078qg8r5.js} +2 -2
- package/dist/chunk-0gk78x3r.js +2 -0
- package/dist/{chunk-fw413k9q.js → chunk-1b9thkg5.js} +2 -2
- package/dist/chunk-1e73whqh.js +2 -0
- package/dist/chunk-1rztwjdj.js +130 -0
- package/dist/{chunk-srq9fqq8.js → chunk-245sas8r.js} +38 -38
- package/dist/chunk-248a88mc.js +2 -0
- package/dist/chunk-2nqtmp8c.js +2 -0
- package/dist/chunk-2pga7zzb.js +4 -0
- package/dist/{chunk-bkkpq8dx.js → chunk-304dbbsw.js} +10 -10
- package/dist/{chunk-z22zy22p.js → chunk-34e8e8te.js} +2 -2
- package/dist/{chunk-md2jn67b.js → chunk-374nhgyf.js} +2 -2
- package/dist/chunk-3bfegbpw.js +2 -0
- package/dist/chunk-3gdt16xa.js +2 -0
- package/dist/chunk-3wsm9g9c.js +2 -0
- package/dist/chunk-3xx9d934.js +2 -0
- package/dist/{chunk-ham5x7ts.js → chunk-4fhbh04h.js} +4 -4
- package/dist/{chunk-5vt48yce.js → chunk-4jnv2v5e.js} +9 -9
- package/dist/chunk-4rk5qnqf.js +24 -0
- package/dist/chunk-526mf3fr.js +4 -0
- package/dist/chunk-54zkkxmb.js +2 -0
- package/dist/{chunk-kdebh22m.js → chunk-551s7ha0.js} +10 -10
- package/dist/chunk-5v7vm8cv.js +14 -0
- package/dist/{chunk-rdr09efy.js → chunk-5z0q3qv3.js} +5 -5
- package/dist/{chunk-6sjtyd0k.js → chunk-5z8mq37c.js} +4 -4
- package/dist/{chunk-ce6zddpf.js → chunk-6beg47t4.js} +2 -2
- package/dist/{chunk-trz8z4j4.js → chunk-6bwca55g.js} +37 -37
- package/dist/chunk-6kam8r5y.js +2 -0
- package/dist/{chunk-tddnb5bv.js → chunk-6ycyaf5g.js} +2 -2
- package/dist/chunk-707sx5sk.js +20 -0
- package/dist/chunk-78d5tn4r.js +2 -0
- package/dist/{chunk-pb6erpj3.js → chunk-78x52gz3.js} +5 -5
- package/dist/{chunk-zp79zkkd.js → chunk-78yjmbbs.js} +2 -2
- package/dist/{chunk-v21bhhjb.js → chunk-7j7h1eg3.js} +1 -1
- package/dist/{chunk-zmg1peyg.js → chunk-8aq07a1j.js} +3 -3
- package/dist/chunk-8p92r2sc.js +2 -0
- package/dist/chunk-909ymsjz.js +2 -0
- package/dist/{chunk-r7fdw2v5.js → chunk-97h9ga3b.js} +3 -3
- package/dist/chunk-9859r1d5.js +2 -0
- package/dist/{chunk-25zmy8q6.js → chunk-9wdd7eq6.js} +2 -2
- package/dist/{chunk-p6qd7ad0.js → chunk-a2zb5fgg.js} +2 -2
- package/dist/chunk-arh1qgmp.js +2 -0
- package/dist/chunk-b18x0v21.js +2 -0
- package/dist/chunk-b23vscaq.js +2 -0
- package/dist/{chunk-4b9s7wgy.js → chunk-be2rswkw.js} +2 -2
- package/dist/{chunk-qz5b8ed4.js → chunk-bh19ezq0.js} +5 -5
- package/dist/chunk-bm42rsaa.js +2 -0
- package/dist/{chunk-cbjabv1w.js → chunk-bpj387yx.js} +6 -6
- package/dist/chunk-c4enpsj8.js +2 -0
- package/dist/chunk-cdbaanmx.js +2 -0
- package/dist/chunk-cfm6a679.js +2 -0
- package/dist/chunk-cs8wq7nv.js +2 -0
- package/dist/{chunk-hegfgw27.js → chunk-cxgremn0.js} +5 -5
- package/dist/chunk-d2xf5hh9.js +2 -0
- package/dist/{chunk-rym0309c.js → chunk-d4ch6exz.js} +3 -3
- package/dist/chunk-dda8pdya.js +2 -0
- package/dist/{chunk-7adznted.js → chunk-dera8fmc.js} +2 -2
- package/dist/chunk-dmd7mgjw.js +3 -0
- package/dist/chunk-ds91e0fe.js +2 -0
- package/dist/{chunk-hgry3mjd.js → chunk-dxh45gve.js} +1 -1
- package/dist/chunk-e492je6q.js +2 -0
- package/dist/{chunk-7j1zgrnf.js → chunk-ehzd1yc6.js} +9 -9
- package/dist/chunk-etz2dmec.js +2 -0
- package/dist/{chunk-4s8zacxg.js → chunk-f26n6y9p.js} +4 -4
- package/dist/{chunk-4w6baw62.js → chunk-fbrgz3s8.js} +2 -2
- package/dist/chunk-fd72t30s.js +2 -0
- package/dist/{chunk-sqn3y9qt.js → chunk-fdvfzknd.js} +2 -2
- package/dist/chunk-ft3f9nj0.js +2 -0
- package/dist/{chunk-dgc1a3yt.js → chunk-fzc98qgn.js} +7 -7
- package/dist/{chunk-s0vtjyyj.js → chunk-g12ht81a.js} +2 -2
- package/dist/chunk-g6gqja52.js +2 -0
- package/dist/{chunk-hb3edeq9.js → chunk-ga5kjf9b.js} +6 -6
- package/dist/chunk-ggwvnpwj.js +2 -0
- package/dist/{chunk-hsmcbh0p.js → chunk-ghm9f13q.js} +5 -5
- package/dist/chunk-gx6wxmbv.js +2 -0
- package/dist/chunk-gz5rvwgx.js +2 -0
- package/dist/chunk-hamk3dky.js +2 -0
- package/dist/{chunk-vayhx642.js → chunk-haz2ezyk.js} +2 -2
- package/dist/chunk-hh58k0nh.js +3 -0
- package/dist/chunk-hqj28381.js +3 -0
- package/dist/chunk-j60jye3e.js +25 -0
- package/dist/chunk-jjet6qxq.js +2 -0
- package/dist/chunk-jk7chxkt.js +2 -0
- package/dist/{chunk-d09q93yf.js → chunk-jv021x8e.js} +2 -2
- package/dist/{chunk-pg2v1pb5.js → chunk-k06n5bjp.js} +3 -3
- package/dist/{chunk-35ezh7de.js → chunk-k72jqz6a.js} +3 -3
- package/dist/chunk-kn34esxw.js +2 -0
- package/dist/chunk-kqbpkg8n.js +2 -0
- package/dist/{chunk-aet1pgw7.js → chunk-krcd3039.js} +74 -74
- package/dist/{chunk-asezs2n3.js → chunk-kxj8e1gd.js} +6 -6
- package/dist/{chunk-5zhp87wv.js → chunk-mabja59q.js} +2 -2
- package/dist/chunk-mf19qxgv.js +3 -0
- package/dist/chunk-mjsebtg6.js +2 -0
- package/dist/{chunk-fd49fahd.js → chunk-mn47s2ef.js} +5 -5
- package/dist/{chunk-nj343mw2.js → chunk-mq915g3j.js} +5 -5
- package/dist/chunk-n63r9b4f.js +2 -0
- package/dist/{chunk-j6m8xqh3.js → chunk-n8wvqnfc.js} +2 -2
- package/dist/chunk-n94ts3t9.js +21 -0
- package/dist/{chunk-w7t2cfgy.js → chunk-p27ptd9f.js} +65 -65
- package/dist/{chunk-t0k16vqv.js → chunk-p9az13b2.js} +2 -2
- package/dist/chunk-pwn0j1vq.js +2 -0
- package/dist/chunk-q1jcf6vm.js +2 -0
- package/dist/{chunk-am2w363p.js → chunk-q3gactm1.js} +4 -4
- package/dist/chunk-q3nnaxf9.js +2 -0
- package/dist/{chunk-w3d98907.js → chunk-q4rejyd2.js} +2 -2
- package/dist/{chunk-hz4x7h0n.js → chunk-qbzqary0.js} +5 -5
- package/dist/{chunk-a4p18ybc.js → chunk-qr7a378v.js} +3 -3
- package/dist/{chunk-bsajk82t.js → chunk-qwdcts9w.js} +19 -19
- package/dist/chunk-rc79yyqx.js +2 -0
- package/dist/{chunk-yx3dpdwc.js → chunk-rfc5pdv2.js} +3 -3
- package/dist/chunk-rnws0dh3.js +2 -0
- package/dist/chunk-rxxajm31.js +31 -0
- package/dist/{chunk-thceyzj6.js → chunk-rza1p6e4.js} +2 -2
- package/dist/chunk-s73z8zss.js +11 -0
- package/dist/chunk-s8qe247r.js +2 -0
- package/dist/{chunk-d1a86qx8.js → chunk-sptewgky.js} +1 -1
- package/dist/{chunk-mwnhdsbp.js → chunk-sqh3tvtw.js} +2 -2
- package/dist/{chunk-6s7tvmqp.js → chunk-sr3hmrah.js} +2 -2
- package/dist/chunk-sswy3tfc.js +2 -0
- package/dist/chunk-swxznm5v.js +2 -0
- package/dist/{chunk-9dtbvjpp.js → chunk-tmqrbs98.js} +31 -20
- package/dist/chunk-tst8p27s.js +12 -0
- package/dist/chunk-tz09earb.js +2 -0
- package/dist/{chunk-fbmth6xv.js → chunk-vay5v6sj.js} +13 -13
- package/dist/{chunk-ck2e3e47.js → chunk-vd5w1jaz.js} +3 -3
- package/dist/chunk-vewt3464.js +2 -0
- package/dist/{chunk-xghcsg3f.js → chunk-vg1pg6yt.js} +1 -1
- package/dist/{chunk-s2wptfm1.js → chunk-wav0xbnb.js} +2 -2
- package/dist/chunk-whzvx5w5.js +2 -0
- package/dist/chunk-wk1gt95z.js +2 -0
- package/dist/{chunk-t9kxhe46.js → chunk-wr1gm35v.js} +1 -1
- package/dist/{chunk-faakv1p6.js → chunk-wscnjtss.js} +2 -2
- package/dist/{chunk-t79jfpv6.js → chunk-x4q4bx3q.js} +2 -2
- package/dist/chunk-x63f2ywm.js +2 -0
- package/dist/{chunk-y1pcdeg9.js → chunk-x7wr720m.js} +5 -5
- package/dist/chunk-xk7cp691.js +2 -0
- package/dist/chunk-xna6b7km.js +2 -0
- package/dist/{chunk-v6peecfp.js → chunk-xnx06qqt.js} +2 -2
- package/dist/chunk-xw4rm5zj.js +2 -0
- package/dist/{chunk-5qtthtg3.js → chunk-y34tyrpb.js} +7 -7
- package/dist/chunk-yar7fwrb.js +2 -0
- package/dist/{chunk-2zzc7006.js → chunk-yn9kvsk1.js} +2 -2
- package/dist/chunk-yt33wzqk.js +2 -0
- package/dist/chunk-z35ftpqp.js +421 -0
- package/dist/{chunk-4bgjrrvz.js → chunk-z7ghjs7w.js} +1 -1
- package/dist/chunk-zq7xbc1k.js +2 -0
- package/dist/cli.js +22 -22
- package/dist/client/signals-for-runtime.js +16 -5
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/headwind-to-style.js +13 -1
- package/dist/native/compiler/html-to-ir.d.ts +2 -0
- package/dist/native/compiler/html-to-ir.js +9 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/compiler/render-screen.js +4 -3
- package/dist/native/compiler/style-config.d.ts +3 -0
- package/dist/native/compiler/style-config.js +5 -0
- package/dist/native/components/primitives.d.ts +2 -0
- package/dist/native/event-names.js +2 -0
- package/dist/native/prop-names.js +1 -0
- package/dist/native/runtime/craft-bridge.js +15 -8
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.js +75 -16
- package/dist/ssg-static-paths.d.ts +12 -0
- package/dist/ssg-static-paths.js +62 -0
- package/dist/ssg.d.ts +2 -4
- package/dist/ssg.js +43 -47
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-0jwdcqj8.js +0 -2
- package/dist/chunk-0mwdq478.js +0 -2
- package/dist/chunk-0nfqgv4n.js +0 -4
- package/dist/chunk-1y6egkty.js +0 -2
- package/dist/chunk-280p4q7a.js +0 -2
- package/dist/chunk-2881tcqt.js +0 -2
- package/dist/chunk-2a775q7x.js +0 -2
- package/dist/chunk-2asdbd5e.js +0 -2
- package/dist/chunk-34yj93hh.js +0 -2
- package/dist/chunk-40tswfe7.js +0 -21
- package/dist/chunk-41de209e.js +0 -2
- package/dist/chunk-506mv7hb.js +0 -3
- package/dist/chunk-5s1ay9mv.js +0 -2
- package/dist/chunk-7kznee1g.js +0 -2
- package/dist/chunk-7mvz972c.js +0 -12
- package/dist/chunk-80zgyaqe.js +0 -2
- package/dist/chunk-84tqb1rn.js +0 -2
- package/dist/chunk-8azm7nha.js +0 -2
- package/dist/chunk-902qnyg0.js +0 -2
- package/dist/chunk-9n6jwcpb.js +0 -2
- package/dist/chunk-a6y8td0d.js +0 -2
- package/dist/chunk-a7kt1ts4.js +0 -2
- package/dist/chunk-a81y8g40.js +0 -2
- package/dist/chunk-aft1zc84.js +0 -2
- package/dist/chunk-bawq4fqy.js +0 -31
- package/dist/chunk-bdp2r0v4.js +0 -2
- package/dist/chunk-brtvm8mb.js +0 -2
- package/dist/chunk-bvzr9zqt.js +0 -2
- package/dist/chunk-cbvgtf3m.js +0 -2
- package/dist/chunk-cfydbaeq.js +0 -2
- package/dist/chunk-dq8c3h4n.js +0 -2
- package/dist/chunk-e36pne7n.js +0 -2
- package/dist/chunk-e62qfexp.js +0 -2
- package/dist/chunk-eq5jzaj5.js +0 -2
- package/dist/chunk-f9zyf9n6.js +0 -421
- package/dist/chunk-fb7t1nn9.js +0 -24
- package/dist/chunk-fr39emcz.js +0 -2
- package/dist/chunk-fsq13amm.js +0 -2
- package/dist/chunk-fxh12vqd.js +0 -2
- package/dist/chunk-gcc9fa33.js +0 -2
- package/dist/chunk-h6t2ney6.js +0 -2
- package/dist/chunk-hvtzw1jh.js +0 -2
- package/dist/chunk-j8g5cvvm.js +0 -2
- package/dist/chunk-jzjpyyw2.js +0 -2
- package/dist/chunk-k1b8x73j.js +0 -2
- package/dist/chunk-nw9bdk2n.js +0 -2
- package/dist/chunk-p4jkswz8.js +0 -2
- package/dist/chunk-p4r90vqf.js +0 -2
- package/dist/chunk-p8bgy5tt.js +0 -2
- package/dist/chunk-pqqe2b6m.js +0 -11
- package/dist/chunk-q6nwcav4.js +0 -2
- package/dist/chunk-qmqavdz2.js +0 -2
- package/dist/chunk-qpw72bty.js +0 -2
- package/dist/chunk-qwnh1kj6.js +0 -2
- package/dist/chunk-qy9m6qdn.js +0 -2
- package/dist/chunk-qychcdsm.js +0 -2
- package/dist/chunk-rj3w1ama.js +0 -2
- package/dist/chunk-rv39s5az.js +0 -20
- package/dist/chunk-sf0r963g.js +0 -2
- package/dist/chunk-ss820yys.js +0 -2
- package/dist/chunk-t4j9g2vh.js +0 -2
- package/dist/chunk-trh7s6k3.js +0 -130
- package/dist/chunk-ttemwrbx.js +0 -2
- package/dist/chunk-twqzn21x.js +0 -14
- package/dist/chunk-v14rq8b4.js +0 -3
- package/dist/chunk-vdxg7e1y.js +0 -4
- package/dist/chunk-vq513cxx.js +0 -2
- package/dist/chunk-vvq8xe3n.js +0 -2
- package/dist/chunk-w8t31bn9.js +0 -2
- package/dist/chunk-x1kz4d7j.js +0 -2
- package/dist/chunk-xaa36b0x.js +0 -3
- package/dist/chunk-xcsyqwxf.js +0 -25
- package/dist/chunk-xn9jrjzh.js +0 -2
- package/dist/chunk-z97bwx8m.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,a}from"./chunk-
|
|
2
|
+
import{t,a}from"./chunk-qwdcts9w.js";import{n,gn,m}from"./chunk-z35ftpqp.js";import{Ze}from"./chunk-f26n6y9p.js";import{Zr,Qr}from"./chunk-y34tyrpb.js";import{xa,yo,Jr,Yr}from"./chunk-q3gactm1.js";import{ba,va}from"./chunk-d4ch6exz.js";import{bt}from"./chunk-3hxd5td3.js";import{sn,Ta,sr,or}from"./chunk-mf19qxgv.js";import{f}from"./chunk-b7e07ybq.js";import{As}from"./chunk-mabja59q.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,r={}){let{duration:o,delay:l,ease:s,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -37,7 +37,7 @@ else {
|
|
|
37
37
|
});
|
|
38
38
|
})();
|
|
39
39
|
</script>
|
|
40
|
-
`}function at(e){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((
|
|
40
|
+
`}function at(e){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((o)=>o.test(e))}function ot(e=0.1,r="0px"){return`
|
|
41
41
|
<script data-stx-scoped data-stx-run="always">
|
|
42
42
|
// Intersection Observer for scroll animations
|
|
43
43
|
(function() {
|
|
@@ -195,7 +195,7 @@ else {
|
|
|
195
195
|
transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
|
|
196
196
|
}
|
|
197
197
|
</style>
|
|
198
|
-
`}function ct(e,r,
|
|
198
|
+
`}function ct(e,r,o={}){let{staggerDelay:l=50,sequence:s=!1}=o;return`
|
|
199
199
|
<script data-stx-scoped data-stx-run="always">
|
|
200
200
|
// Animation Group: ${e}
|
|
201
201
|
(function() {
|
|
@@ -232,18 +232,18 @@ else {
|
|
|
232
232
|
}
|
|
233
233
|
})();
|
|
234
234
|
</script>
|
|
235
|
-
`}var De={name:"transition",handler:(e,r,
|
|
236
|
-
style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},Pe={name:"scrollAnimate",handler:(e,r,
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,r,
|
|
235
|
+
`}var De={name:"transition",handler:(e,r,o,l)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let s=r[0],c=r.length>1?Number.parseInt(r[1],10)||B.duration:B.duration,d=r.length>2?r[2]||B.ease:B.ease,p=r.length>3?Number.parseInt(r[3],10)||B.delay:B.delay,u=r.length>4?r[4]||B.direction:B.direction,g=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=nt(s,{duration:c,delay:p,ease:d,direction:u}),h="stx-transition",v="";if(s==="fade")v="stx-fade";else if(s==="slide")v="stx-slide";else if(s==="scale")v="stx-scale";else if(s==="flip")v="stx-flip";else if(s==="rotate")v="stx-rotate";return`<div id="${g}" class="${h} ${v} ${u==="out"?"stx-out":""}"
|
|
236
|
+
style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},Pe={name:"scrollAnimate",handler:(e,r,o,l)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let s=r[0],c=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",p=r.length>3?Number.parseFloat(r[3])||0.2:0.2,u=r.length>4?Number.parseInt(r[4],10)||0:0,g=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,h="stx-transition stx-observe stx-out";if(s==="fade")h+=" stx-fade";else if(s==="slide-up"||s==="slide")h+=" stx-from-bottom";else if(s==="slide-down")h+=" stx-from-top";else if(s==="slide-left")h+=" stx-from-right";else if(s==="slide-right")h+=" stx-from-left";else if(s==="scale")h+=" stx-scale";else if(s.includes("-"))h+=` stx-${s}`;else h+=` stx-${s}`;return`<div id="${g}" class="${h}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},ke={name:"animationGroup",handler:(e,r,o,l)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let s=r[0],c=r.slice(1).map((g)=>g.startsWith("#")||g.startsWith(".")?g:`#${g}`),d=o.staggerDelay||50,p=o.sequence||!0,u=ct(s,c,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,r,o,l)=>{let s=r.length>0?r[0].toLowerCase()==="true":!0,c=it();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function pa(e,r,o,l){let s=e;if(l.animation?.enabled===!1)return s;let c=o.includes("test")&&o.includes("animation");if(!at(s)&&!c)return s;if(!s.includes('<style id="stx-animation-base">')){let p=lt();s=s.replace("</head>",`${p}
|
|
238
238
|
</head>`)}if(s.includes("stx-observe")){if(!s.includes("Intersection Observer for scroll animations")){let u=ot(),g=s.lastIndexOf("</body>");if(g!==-1)s=s.slice(0,g)+u+`
|
|
239
|
-
`+s.slice(g)}}return s}async function dt(e,r,
|
|
239
|
+
`+s.slice(g)}}return s}async function dt(e,r,o,l){let s=r[0]?.replace(/['"]/g,"")||"main",c=Ze();if(s!=="main")c=c.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${c}</script>`}var _e={name:"stxRouter",handler:dt,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var ut={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Re(e){let r=e.heatmap;if(!r?.enabled)return"";let o={...ut,...r};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
241
241
|
<script>
|
|
242
242
|
(function() {
|
|
243
243
|
'use strict';
|
|
244
244
|
|
|
245
245
|
// Configuration
|
|
246
|
-
var config = ${JSON.stringify({trackMouse:
|
|
246
|
+
var config = ${JSON.stringify({trackMouse:o.trackMouse,trackClicks:o.trackClicks,trackScroll:o.trackScroll,samplingRate:o.samplingRate,honorDnt:o.honorDnt,endpoint:o.endpoint,batchSize:o.batchSize,maxDataPoints:o.maxDataPoints,sessionTimeout:o.sessionTimeout,persistData:o.persistData,storagePrefix:o.storagePrefix,captureAttributes:o.captureAttributes,ignoreSelectors:o.ignoreSelectors,zones:o.zones,debugOverlay:o.debugOverlay,minViewportWidth:o.minViewportWidth,maxViewportWidth:o.maxViewportWidth})};
|
|
247
247
|
|
|
248
248
|
// Check Do Not Track
|
|
249
249
|
if (config.honorDnt && navigator.doNotTrack === '1') {
|
|
@@ -619,9 +619,9 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
623
|
-
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let g=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[g]=y}return{data:c,content:s.trim()}}function
|
|
624
|
-
`),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),
|
|
622
|
+
`}function fa(e,r){let o=Re(r);if(!o)return e;let l=e.lastIndexOf("</body>");if(l!==-1)return e.slice(0,l)+o+e.slice(l);return e+o}var Oe={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,o,l)=>{let s=o.__stx_config||{};if(r.length>0){let c=pt(r.join(" "));s.heatmap={...s.heatmap,...c,enabled:!0}}return Re(s)}};function pt(e){let r={},o=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let l of o){let[s,c]=l.split("="),d=c?.replace(/["']/g,"");switch(s){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ee(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function er(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,o=e.match(r);if(!o)return{data:{},content:e.trim()};let l=o[1],s=e.slice(o[0].length),c={};for(let d of l.split(`
|
|
623
|
+
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let g=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[g]=y}return{data:c,content:s.trim()}}function Je(e,r={}){let{gfm:o=!0,breaks:l=!1}=r,s=e,c=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,h,v)=>{let b=c.length,x=h?` class="language-${J(h)}"`:"";return c.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),s=s.replace(/`([^`]*)`/g,(y,h)=>`<code>${J(h)}</code>`),s=s.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),s=s.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),s=s.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),s=s.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),s=s.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),s=s.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),s=s.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),s=s.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/__(.+?)__/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),o)s=s.replace(/~~(.+?)~~/g,"<del>$1</del>");if(s=s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,h,v)=>`<img src="${Ee(v)?J(v):""}" alt="${J(h)}" />`),s=s.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,h,v)=>`<a href="${Ee(v)?J(v):""}">${h}</a>`),s=s.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),s=s.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),s=s.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
624
|
+
`),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),o)s=s.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,h,v)=>{let x=`<tr>${h.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,P=v.trim().split(`
|
|
625
625
|
`).map((S)=>`<tr>${S.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<td>${J(k)}</td>`).join("")}</tr>`).join(`
|
|
626
626
|
`);return`<table>
|
|
627
627
|
<thead>
|
|
@@ -630,15 +630,15 @@ ${x}
|
|
|
630
630
|
<tbody>
|
|
631
631
|
${P}
|
|
632
632
|
</tbody>
|
|
633
|
-
</table>`});if(
|
|
633
|
+
</table>`});if(o)s=s.replace(/<li>\s*\[\s*\]\s*/g,'<li><input type="checkbox" disabled /> '),s=s.replace(/<li>\s*\[x\]\s*/gi,'<li><input type="checkbox" checked disabled /> ');let d=s.split(`
|
|
634
634
|
`),p=[],u=!1,g=[];for(let y of d){let h=y.trim();if(/^<(?:h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|th|td|hr|div|p)/.test(h)||/^\0CODEBLOCK\d+\0$/.test(h)||h===""){if(u&&g.length>0)p.push(`<p>${g.join(l?`<br />
|
|
635
635
|
`:`
|
|
636
636
|
`)}</p>`),g=[],u=!1;p.push(y)}else u=!0,g.push(h)}if(u&&g.length>0)p.push(`<p>${g.join(l?`<br />
|
|
637
637
|
`:`
|
|
638
638
|
`)}</p>`);if(s=p.join(`
|
|
639
639
|
`),l)s=s.replace(/\n/g,`<br />
|
|
640
|
-
`);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function
|
|
641
|
-
`||k==="\r"||k===" "||k===void 0)h++;v=S+9}else{if(h--,h===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(p,b+12);s.push({fullMatch:P,options:g,content:x,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:g,index:y}of s)try{let h={};if(u)u.split(",").forEach((x)=>{let P=x.trim();if(P)h[P]=!0});let v={gfm:h.gfm??!0,breaks:h.breaks??!1},b=
|
|
640
|
+
`);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function ga(e,r,o=""){let l=e,s=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),g=u?u[1]:"",y=p+d[0].length,h=1,v=y,b=-1;while(h>0&&v<e.length){let S=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==p){let k=e[S+9];if(k==="("||k===`
|
|
641
|
+
`||k==="\r"||k===" "||k===void 0)h++;v=S+9}else{if(h--,h===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(p,b+12);s.push({fullMatch:P,options:g,content:x,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:g,index:y}of s)try{let h={};if(u)u.split(",").forEach((x)=>{let P=x.trim();if(P)h[P]=!0});let v={gfm:h.gfm??!0,breaks:h.breaks??!1},b=Je(g.trim(),v);l=l.split(p).join(b)}catch(h){let v=h instanceof Error?h.message:String(h),b=m("Markdown Directive",`Error processing markdown: ${v}`,o,e,y,p);l=l.split(p).join(b)}return l}async function Ie(e,r,o,l){let s={gfm:!0,breaks:!1};return r.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),Je(e.trim(),s)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],mt=[1,1.5,2,3],te=["avif","webp","jpeg"],gt={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function pe(e,r=Z,o={},l){return r.sort((s,c)=>s-c).map((s)=>`${re(e,{...o,w:s,fm:l})} ${s}w`).join(", ")}function Te(e,r,o=mt,l={},s){return o.sort((c,d)=>c-d).map((c)=>{let d=Math.round(r*c);return`${re(e,{...l,w:d,dpr:c,fm:s})} ${c}x`}).join(", ")}function me(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let l=Object.entries(e).map(([s,c])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((s,c)=>s.numericBp-c.numericBp).map(({bp:s,size:c})=>`(max-width: ${s}) ${c}`);return l.push(r),l.join(", ")}function re(e,r={}){let o=Object.entries(r).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(o.length===0)return e;let l=o.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),s=e.includes("?")?"&":"?";return`${e}${s}${l}`}function ge(e){return gt[e]||"application/octet-stream"}var ft={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},he=`
|
|
642
642
|
.stx-img-placeholder {
|
|
643
643
|
position: relative;
|
|
644
644
|
overflow: hidden;
|
|
@@ -667,7 +667,7 @@ ${P}
|
|
|
667
667
|
filter: blur(0);
|
|
668
668
|
transform: scale(1);
|
|
669
669
|
}
|
|
670
|
-
`.trim();async function ht(){try{return await import("ts-images")}catch{return null}}async function yt(e,r={}){let
|
|
670
|
+
`.trim();async function ht(){try{return await import("ts-images")}catch{return null}}async function yt(e,r={}){let o={...ft,...r},l=await ht();if(l)try{return await vt(e,o,l)}catch(s){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${s}`)}return xt(e,o)}async function vt(e,r,o){let{generatePlaceholder:l,generateThumbHash:s}=o,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[r.strategy]||"blur";if(r.strategy==="thumbhash")return{dataURL:(await s(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await l(e,{width:r.width,height:r.height,quality:r.quality,blurLevel:r.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:r.strategy,dominantColor:p.dominantColor,css:p.css}}function xt(e,r){let o=r.width||20,l=r.height||o,s="#e5e7eb",c=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${l}" viewBox="0 0 ${o} ${l}"><rect fill="#e5e7eb" width="${o}" height="${l}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,width:o,height:l,aspectRatio:o/l,originalWidth:0,originalHeight:0,strategy:r.strategy,dominantColor:"#e5e7eb"}}function Me(e,r,o={}){let l=o.transitionDuration||300,s=o.easing||"ease-out";return`
|
|
671
671
|
#${e} {
|
|
672
672
|
--stx-img-transition-duration: ${l}ms;
|
|
673
673
|
--stx-img-transition-easing: ${s};
|
|
@@ -684,8 +684,8 @@ ${P}
|
|
|
684
684
|
#${e}.stx-img-loaded img {
|
|
685
685
|
opacity: 1;
|
|
686
686
|
}
|
|
687
|
-
`.trim()}var fe=new Map;async function Ne(e,r={}){let
|
|
688
|
-
`):void 0,script:tt}}async function $t(e,r,
|
|
687
|
+
`.trim()}var fe=new Map;async function Ne(e,r={}){let o=`${e}:${JSON.stringify(r)}`;if(fe.has(o))return fe.get(o);let l=await yt(e,r);return fe.set(o,l),l}async function wt(){try{return await import("./chunk-sswy3tfc.js")}catch(e){if(!je)console.warn("[stx-media] Image processor not available, some features disabled:",e),je=!0;return null}}var je=!1,ye=80,oe="async",le="lazy",Ve=!1;async function ae(e,r={}){let o=r,l=e;if(l.process&&!l.skipOptimization){if(o.tsImagesConfig?.enabled&&!o.isDev)return Dt(l,o)}if(o.processedResult?.processed)return xe(e,o.processedResult,r);if(o.responsiveVariants)return We(e,o.responsiveVariants,r);let{src:s,alt:c,width:d,height:p,sizes:u,widths:g=Z,dpr:y,formats:h=te,quality:v=ye,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":le,decoding:E=oe,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:L}=e,{class:W,style:T,id:V}=e,_=e.data||{},{isDev:z=!1,baseUrl:G=""}=r;if(z&&!r.optimize)return Ct(e);let F,O,H=V||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{F=await Ne(s,{strategy:x,...P}),O=Me(H,F,P)}catch{}let ne=y!==void 0&&d!==void 0,X;if(ne)X=St(e,H,F,r);else X=await $t(e,H,F,r);let ee;if(A){let Ce=h.includes("webp")?"webp":h[0],rt=pe(s,g,{...b,q:v},Ce),st=typeof u==="object"?me(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ie=[];if(!Ve&&x!=="none")ie.push(he),Ve=!0;if(O)ie.push(O);let tt=S?Le(H):void 0;return{html:X,preloadLink:ee,css:ie.length>0?ie.join(`
|
|
688
|
+
`):void 0,script:tt}}async function $t(e,r,o,l){let{src:s,alt:c,width:d,height:p,sizes:u,widths:g=Z,formats:y=te,quality:h=ye,params:v={},lazy:b=!0,priority:x=!1,loading:P=x?"eager":le,decoding:S=oe,fetchpriority:A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,L=e.data||{},W=typeof u==="object"?me(u):u||"100vw",T=[];for(let z of y){let G=pe(s,g,{...v,q:h},z),F=ge(z);if(b&&!x)T.push(` <source type="${F}" data-srcset="${G}" data-sizes="${W}" />`);else T.push(` <source type="${F}" srcset="${G}" sizes="${W}" />`)}let V=ve({src:re(s,{...v,q:h}),alt:c,width:d,height:p,loading:x?void 0:P,decoding:S,fetchpriority:x?"high":A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w,className:ze(C,o),style:be(D,k,E,o),lazy:b&&!x,data:L}),_;if(o){let z=`background-image: url('${o.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${r}" class="stx-img-placeholder" style="${z}">
|
|
689
689
|
<picture>
|
|
690
690
|
${T.join(`
|
|
691
691
|
`)}
|
|
@@ -695,9 +695,9 @@ ${T.join(`
|
|
|
695
695
|
${T.join(`
|
|
696
696
|
`)}
|
|
697
697
|
<img ${V} />
|
|
698
|
-
</picture>`;return _}function St(e,r,
|
|
698
|
+
</picture>`;return _}function St(e,r,o,l){let{src:s,alt:c,width:d,height:p,dpr:u=[1,2,3],quality:g=ye,params:y={},lazy:h=!0,priority:v=!1,loading:b=v?"eager":le,decoding:x=oe,fetchpriority:P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:E}=e,{class:I,style:w}=e,C=e.data||{},D=typeof d==="number"?d:Number.parseInt(String(d),10),L=Te(s,D,u,{...y,q:g}),W=ve({src:re(s,{...y,w:D,q:g}),alt:c,width:d,height:p,loading:v?void 0:b,decoding:x,fetchpriority:v?"high":P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:E,className:ze(I,o),style:be(w,S,A,o),lazy:h&&!v,data:C}),T=h&&!v?`data-srcset="${L}"`:`srcset="${L}"`;if(o){let V=`background-image: url('${o.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${r}" class="stx-img-placeholder" style="${V}">
|
|
699
699
|
<img ${W} ${T} />
|
|
700
|
-
</div>`}return`<img ${r?`id="${r}" `:""}${W} ${T} />`}function Ct(e){let{src:r,alt:
|
|
700
|
+
</div>`}return`<img ${r?`id="${r}" `:""}${W} ${T} />`}function Ct(e){let{src:r,alt:o,width:l,height:s,loading:c=le,decoding:d=oe,fetchpriority:p,objectFit:u,objectPosition:g,crossorigin:y,referrerpolicy:h,priority:v=!1}=e,{class:b,style:x,id:P}=e,S=e.data||{};return{html:`<img ${ve({src:r,alt:o,width:l,height:s,loading:v?"eager":c,decoding:d,fetchpriority:v?"high":p,objectFit:u,objectPosition:g,crossorigin:y,referrerpolicy:h,className:b,style:be(x,u,g),id:P,data:S})} />`}}function ve(e){let r=[];if(e.lazy)r.push(`data-src="${U(e.src)}"`),r.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else r.push(`src="${U(e.src)}"`);if(r.push(`alt="${U(e.alt)}"`),e.width)r.push(`width="${e.width}"`);if(e.height)r.push(`height="${e.height}"`);if(e.loading)r.push(`loading="${e.loading}"`);if(e.decoding)r.push(`decoding="${e.decoding}"`);if(e.fetchpriority)r.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)r.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)r.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)r.push(`class="${U(e.className)}"`);if(e.style)r.push(`style="${U(e.style)}"`);if(e.id)r.push(`id="${U(e.id)}"`);if(e.data)for(let[o,l]of Object.entries(e.data))r.push(`data-${o}="${U(l)}"`);if(e.lazy)r.push("data-stx-lazy");return r.join(" ")}function ze(e,r){let o=[];if(e)o.push(e);if(r)o.push("stx-img-blur");return o.join(" ")||""}function be(e,r,o,l){let s=[];if(r)s.push(`object-fit: ${r}`);if(o)s.push(`object-position: ${o}`);if(l)s.push("opacity: 0; transition: opacity 300ms ease-out");if(e)s.push(e);return s.join("; ")}function U(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Le(e){return`
|
|
701
701
|
(function() {
|
|
702
702
|
const container = document.getElementById('${e}');
|
|
703
703
|
if (!container) return;
|
|
@@ -734,7 +734,7 @@ ${T.join(`
|
|
|
734
734
|
|
|
735
735
|
observer.observe(container);
|
|
736
736
|
})();
|
|
737
|
-
`.trim()}async function Dt(e,r){let
|
|
737
|
+
`.trim()}async function Dt(e,r){let o=await wt();if(!o)return ae({...e,process:!1},r);let l=r.tsImagesConfig;if(e.responsiveWidths&&e.responsiveWidths.length>0||e.widths&&e.widths.length>0||!e.width&&!e.dpr){let c=await o.generateResponsiveVariants(e.src,e,l);if(c)return We(e,c,r)}else{let c=await o.processImage(e.src,e,l);if(c.processed)return xe(e,c,r)}return ae({...e,process:!1},r)}async function xe(e,r,o){let{alt:l,width:s,height:c,lazy:d=!0,priority:p=!1,objectFit:u,objectPosition:g,crossorigin:y,referrerpolicy:h}=e,{class:v,style:b}=e,x=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,P=e.data||{},S=r.variants||[],A=S.find((O)=>O.format==="jpeg")||S.find((O)=>O.format==="webp")||S[0],k=A?.url||e.src,E=S.filter((O)=>O.format===(A?.format||"jpeg")).map((O)=>`${O.url} ${O.width}w`).join(", "),I=new Map;for(let O of S){if(!I.has(O.format))I.set(O.format,[]);I.get(O.format).push(O)}let w=[],C=["avif","webp","jpeg","png"];for(let O of C){let H=I.get(O);if(H&&H.length>0){let ne=H.map((ee)=>`${ee.url} ${ee.width}w`).join(", "),X=ge(O);if(d&&!p)w.push(` <source type="${X}" data-srcset="${ne}" />`);else w.push(` <source type="${X}" srcset="${ne}" />`)}}let D=[];if(d&&!p){if(D.push(`data-src="${U(k)}"`),D.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),E)D.push(`data-srcset="${E}"`)}else if(D.push(`src="${U(k)}"`),E)D.push(`srcset="${E}"`);D.push(`alt="${U(l)}"`);let L=s||r.originalWidth,W=c||r.originalHeight;if(L)D.push(`width="${L}"`);if(W)D.push(`height="${W}"`);if(!p)D.push(`loading="${d?"lazy":"eager"}"`);if(D.push('decoding="async"'),p)D.push('fetchpriority="high"');if(y)D.push(`crossorigin="${y}"`);if(h)D.push(`referrerpolicy="${h}"`);let T=[];if(u)T.push(`object-fit: ${u}`);if(g)T.push(`object-position: ${g}`);if(r.placeholder&&d)T.push("opacity: 0; transition: opacity 300ms ease-out");if(b)T.push(b);if(T.length>0)D.push(`style="${T.join("; ")}"`);let V=[];if(v)V.push(v);if(r.placeholder)V.push("stx-img-blur");if(V.length>0)D.push(`class="${V.join(" ")}"`);if(d&&!p)D.push("data-stx-lazy");for(let[O,H]of Object.entries(P))D.push(`data-${O}="${U(H)}"`);let _;if(r.placeholder||r.dominantColor&&e.useDominantColor){let O=r.placeholder?`background-image: url('${r.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${r.dominantColor};`;_=`<div id="${x}" class="stx-img-placeholder" style="${O}">
|
|
738
738
|
<picture>
|
|
739
739
|
${w.join(`
|
|
740
740
|
`)}
|
|
@@ -745,10 +745,10 @@ ${w.join(`
|
|
|
745
745
|
`)}
|
|
746
746
|
<img ${D.join(" ")} />
|
|
747
747
|
</picture>`;let z=[];if(r.placeholder)z.push(he);let G=d?Le(x):void 0,F;if(p&&E)F=`<link rel="preload" as="image" imagesrcset="${E}" />`;return{html:_,preloadLink:F,css:z.length>0?z.join(`
|
|
748
|
-
`):void 0,script:G}}async function We(e,r,
|
|
748
|
+
`):void 0,script:G}}async function We(e,r,o){let l={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[s,c]of Object.entries(r.byFormat))if(c)l.variants.push(...c);return xe(e,l,o)}function Pt(){return bt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,o,l)=>{let{src:s,alt:c,options:d}=kt(e,r,o);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:s,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=o.__isDev||!1,g=await ae(p,{isDev:u}),y=g.html;if(g.preloadLink)y=g.preloadLink+`
|
|
749
749
|
`+y;if(g.css)y+=`
|
|
750
750
|
<style>${g.css}</style>`;if(g.script)y+=`
|
|
751
|
-
<script>${g.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function kt(e,r,
|
|
751
|
+
<script>${g.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function kt(e,r,o){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let l=e.trim();if(l.startsWith("@img(")||l.startsWith("("))l=l.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=At(l),c=we(s[0],o)||"",d=we(s[1],o)||"",p={};if(s[2]){let u=we(s[2],o);if(typeof u==="object"&&u!==null)p=u;else if(typeof s[2]==="string")try{p=JSON.parse(s[2])}catch{}}return{src:c,alt:d,options:p}}function At(e){let r=[],o="",l=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],g=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&g!=="\\"){if(!l)l=!0,s=u;else if(u===s)l=!1,s="";else o+=u;continue}if(!l){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(o.trim()),o="";continue}}o+=u}if(o.trim())r.push(o.trim());return r}function we(e,r){if(typeof e!=="string")return e;let o=e.trim();if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))return o.slice(1,-1);if(!o.startsWith("/")&&!o.startsWith(".")&&!o.startsWith("http")&&!o.startsWith("{")){let l=r[o];if(l!==void 0)return l}if(o.startsWith("{")||o.startsWith("["))try{return JSON.parse(o)}catch{}return o}var Fe=Pt();async function He(){try{return await import("./chunk-2nqtmp8c.js")}catch(e){if(!qe)console.warn("[stx-media] Video processor not available, some features disabled:",e),qe=!0;return null}}var qe=!1,Ue=!0,Be="metadata",_t="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function ce(e,r={}){let o=r,l=e;if(l.process&&!l.skipProcessing){if(o.tsVideosConfig?.enabled&&!o.isDev)return Tt(l,o)}if(o.processedResult?.processed)return Ge(e,o.processedResult,r);let s;if(l.generatePoster&&l.src&&!e.poster)s=await Mt(l,o);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:g=Ue,autoplay:y=!1,muted:h=!1,loop:v=!1,preload:b=Be,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||p,{class:L,style:W}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return Ot(e,r);if(A&&A!=="video")return Rt(c||"",A,e);let V=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${T}"`];if(g)_.push("controls");if(y)_.push("autoplay");if(h)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(E)_.push(`height="${E}"`);if(L)_.push(`class="${M(L)}"`);if(W)_.push(`style="${M(W)}"`);let z=V.map((O)=>` <source ${P?`data-src="${M(O.src)}"`:`src="${M(O.src)}"`} type="${O.type}"${O.media?` media="${O.media}"`:""} />`).join(`
|
|
752
752
|
`),G=`<video ${_.join(" ")}>
|
|
753
753
|
${z}
|
|
754
754
|
Your browser does not support the video tag.
|
|
@@ -787,9 +787,9 @@ ${z}
|
|
|
787
787
|
|
|
788
788
|
observer.observe(video);
|
|
789
789
|
})();
|
|
790
|
-
`.trim();return{html:G,script:F}}function Rt(e,r,
|
|
790
|
+
`.trim();return{html:G,script:F}}function Rt(e,r,o){let{width:l=640,height:s=360}=o,{class:c,style:d}=o,p=o.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,u,g=null;switch(r){case"youtube":g=Et(e),u=g?`https://www.youtube-nocookie.com/embed/${g}`:e;break;case"vimeo":g=It(e),u=g?`https://player.vimeo.com/video/${g}`:e;break;case"dailymotion":g=e.split("/").pop()||"",u=`https://www.dailymotion.com/embed/video/${g}`;break;case"twitch":g=e.split("/").pop()||"",u=`https://player.twitch.tv/?video=${g}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:u=e}let y=[`id="${p}"`,`src="${M(u)}"`,`width="${l}"`,`height="${s}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(c)y.push(`class="${M(c)}"`);if(d)y.push(`style="${M(d)}"`);if(o.lazy)y.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
|
|
791
791
|
<iframe ${y.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
|
|
792
|
-
</div>`}}function Ot(e,r={}){let{src:
|
|
792
|
+
</div>`}}function Ot(e,r={}){let{src:o,sources:l=[],poster:s,controls:c=!0,autoplay:d=!1,muted:p=!1,loop:u=!1,preload:g="metadata",playsinline:y=!0,lazy:h=!0,width:v,height:b}=e,{class:x,style:P}=e,S=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,A={src:l.length>0?l:o,autoplay:d,loop:u,muted:p,playsinline:y,preload:g,poster:s,controls:c,title:e.title},k=["position: relative",v?`width: ${typeof v==="number"?v+"px":v}`:"width: 100%",b?`height: ${typeof b==="number"?b+"px":b}`:"",P||""].filter(Boolean).join("; "),E=`
|
|
793
793
|
<div
|
|
794
794
|
id="${S}"
|
|
795
795
|
class="ts-video-player${x?" "+M(x):""}"
|
|
@@ -956,7 +956,7 @@ else {
|
|
|
956
956
|
.ts-video-player__play-button svg {
|
|
957
957
|
margin-left: 4px;
|
|
958
958
|
}
|
|
959
|
-
`.trim();return{html:E,script:I,css:w}}function
|
|
959
|
+
`.trim();return{html:E,script:I,css:w}}function Ke(e){switch(e.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function Et(e){let r=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let o of r){let l=e.match(o);if(l)return l[1]}return null}function It(e){let r=e.match(/vimeo\.com\/(\d+)/);return r?r[1]:null}function M(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}async function Tt(e,r){let o=await He();if(!o)return ce({...e,process:!1},r);let l=r.tsVideosConfig,s=await o.processVideo(e.src,e,l,e.onProcessProgress);if(s.processed)return Ge(e,s,r);return ce({...e,process:!1},r)}async function Mt(e,r){let o=await He();if(!o||!e.src)return;let l=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},s=r.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await o.generatePoster(e.src,l,s.outputDir,s.baseUrl||"/videos"))?.url}function Ge(e,r,o){let{controls:l=Ue,autoplay:s=!1,muted:c=!1,loop:d=!1,preload:p=Be,playsinline:u=!0,lazy:g=!0,width:y,height:h,crossorigin:v,disablePictureInPicture:b=!1,disableRemotePlayback:x=!1}=e,{class:P,style:S}=e,A=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,k=e.src,E=Ke(k);if(r.transcoded)k=r.transcoded.url,E="video/mp4";let I=r.streaming?.hls||r.streaming?.dash;if(I){if(r.streaming?.hls)k=r.streaming.hls.manifestUrl,E="application/x-mpegURL";else if(r.streaming?.dash)k=r.streaming.dash.manifestUrl,E="application/dash+xml"}let w=r.poster?.url||e.poster,C=[`id="${A}"`];if(l)C.push("controls");if(s)C.push("autoplay");if(c)C.push("muted");if(d)C.push("loop");if(u)C.push("playsinline");if(b)C.push("disablepictureinpicture");if(x)C.push("disableremoteplayback");if(v)C.push(`crossorigin="${v}"`);if(g){if(C.push(`data-preload="${p}"`),C.push('preload="none"'),w)C.push(`data-poster="${M(w)}"`);C.push("data-stx-lazy")}else if(C.push(`preload="${p}"`),w)C.push(`poster="${M(w)}"`);let D=y||r.metadata?.width,L=h||r.metadata?.height;if(D)C.push(`width="${D}"`);if(L)C.push(`height="${L}"`);if(P)C.push(`class="${M(P)}"`);if(S)C.push(`style="${M(S)}"`);let T=` <source ${g?`data-src="${M(k)}"`:`src="${M(k)}"`} type="${E}" />`,V=`<video ${C.join(" ")}>
|
|
960
960
|
${T}
|
|
961
961
|
Your browser does not support the video tag.
|
|
962
962
|
</video>`;if(r.spriteSheet)V=`<div class="stx-video-wrapper" data-sprite-sheet="${M(r.spriteSheet.url)}" data-sprite-cols="${r.spriteSheet.columns}" data-sprite-interval="${r.spriteSheet.interval}">
|
|
@@ -1005,9 +1005,9 @@ ${V}
|
|
|
1005
1005
|
width: 100%;
|
|
1006
1006
|
height: auto;
|
|
1007
1007
|
}
|
|
1008
|
-
`.trim();return{html:V,script:_,css:z}}function
|
|
1008
|
+
`.trim();return{html:V,script:_,css:z}}function Ye(){return bt({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,r,o,l)=>{let{src:s,options:c}=Nt(e,r,o);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,poster:c.poster,controls:c.controls!==!1,autoplay:c.autoplay||!1,muted:c.muted||!1,loop:c.loop||!1,preload:c.preload||"metadata",playsinline:c.playsinline!==!1,lazy:c.lazy!==!1,player:c.player||"native",type:c.type,width:c.width,height:c.height,class:c.class,style:c.style,id:c.id,crossorigin:c.crossorigin,disablePictureInPicture:c.disablePictureInPicture,disableRemotePlayback:c.disableRemotePlayback,title:c.title,quality:c.quality,platform:c.platform,process:c.process,generatePoster:c.generatePoster,streaming:c.streaming,transcode:c.transcode,spriteSheet:c.spriteSheet,waveform:c.waveform},u={isDev:o.__isDev||!1,tsVideosConfig:o.__tsVideosConfig},g=await ce(d,u),y=g.html;if(g.css)y+=`
|
|
1009
1009
|
<style>${g.css}</style>`;if(g.script)y+=`
|
|
1010
|
-
<script>${g.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Nt(e,r,
|
|
1010
|
+
<script>${g.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Nt(e,r,o){if(r.src)return{src:String(r.src),options:r.options||{}};let l=e.trim();if(l.startsWith("@video(")||l.startsWith("("))l=l.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=jt(l),c=Xe(s[0],o)||"",d={};if(s[1]){let p=Xe(s[1],o);if(typeof p==="object"&&p!==null)d=p;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:c,options:d}}function jt(e){let r=[],o="",l=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],g=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&g!=="\\"){if(!l)l=!0,s=u;else if(u===s)l=!1,s="";else o+=u;continue}if(!l){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(o.trim()),o="";continue}}o+=u}if(o.trim())r.push(o.trim());return r}function Xe(e,r){if(typeof e!=="string")return e;let o=e.trim();if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))return o.slice(1,-1);if(!o.startsWith("/")&&!o.startsWith(".")&&!o.startsWith("http")&&!o.startsWith("{")){let l=r[o];if(l!==void 0)return l}if(o.startsWith("{")||o.startsWith("["))try{return JSON.parse(o)}catch{}return o}var $e=Ye();import Vt from"fs";import q from"path";async function Xr(e,r){if(!e.webComponents?.enabled)return[];let o=e.webComponents.components||[],l=[];if(o.length>0){if(e.debug)console.log(`Building ${o.length} web components...`);for(let s of o)try{let c=await zt(s,e,r);if(c)l.push(c)}catch(c){if(console.error(`Error building web component ${s.name}:`,c),e.debug)throw c}}return l}async function zt(e,r,o){let{name:l,file:s,tag:c,extends:d}=e;if(!l||!s||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(s)&&await n(s))p=s;else if(r.componentsDir){let P=q.join(r.componentsDir,s);if(await n(P))p=P}if(!p)p=await gn(s,process.cwd(),r,o);if(!p)return console.error(`Web component source file not found: ${s}`),null;let u=await Bun.file(p).text();o.add(p);let y=(e.outputFormat||"js")==="ts",h=y?Wt({name:l,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Lt({name:l,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=r.webComponents?.outputDir||"dist/web-components";await Vt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${c}.${b}`);if(await Bun.write(x,h),r.debug)console.log(`Built web component ${l} -> ${x}`);return x}function Lt(e){let{name:r,tag:o,baseElement:l="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:p,attributes:u=[]}=e,g=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)g=g.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),g=g.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),g=g.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),g=g.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
|
|
1011
1011
|
* ${r} Web Component
|
|
1012
1012
|
* Auto-generated from stx component
|
|
1013
1013
|
*/
|
|
@@ -1098,8 +1098,8 @@ class ${r.replace(/\W/g,"")} extends ${l} {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
// Register the web component
|
|
1101
|
-
customElements.define('${
|
|
1102
|
-
`}function Wt(e){let{name:r,tag:
|
|
1101
|
+
customElements.define('${o}', ${r.replace(/\W/g,"")})
|
|
1102
|
+
`}function Wt(e){let{name:r,tag:o,baseElement:l="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:p,attributes:u=[],attributeTypes:g={}}=e,y=r.replace(/\W/g,""),h=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)h=h.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),h=h.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),h=h.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),h=h.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");h=h.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let v=p?`<link rel="stylesheet" href="${p}">`:"",b=(w)=>{switch(g[w]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},x=(w)=>w.replace(/-([a-z])/g,(C,D)=>D.toUpperCase()),P=u.map((w)=>` private _${x(w)}: ${b(w)} | null = null;`).join(`
|
|
1103
1103
|
`),S=u.map((w)=>{let C=b(w),D=x(w);return`
|
|
1104
1104
|
get ${D}(): ${C} | null {
|
|
1105
1105
|
return this._${D};
|
|
@@ -1162,7 +1162,7 @@ catch { return value; }
|
|
|
1162
1162
|
*
|
|
1163
1163
|
* @example
|
|
1164
1164
|
* \`\`\`html
|
|
1165
|
-
* <${
|
|
1165
|
+
* <${o}></${o}>
|
|
1166
1166
|
* \`\`\`
|
|
1167
1167
|
*/
|
|
1168
1168
|
|
|
@@ -1177,7 +1177,7 @@ interface SlotChangeDetail {
|
|
|
1177
1177
|
${A}
|
|
1178
1178
|
/**
|
|
1179
1179
|
* ${r} custom element class
|
|
1180
|
-
* @customElement ${
|
|
1180
|
+
* @customElement ${o}
|
|
1181
1181
|
*/
|
|
1182
1182
|
export class ${y} extends ${l} {
|
|
1183
1183
|
${P}
|
|
@@ -1248,13 +1248,13 @@ ${S}
|
|
|
1248
1248
|
// Type augmentation for HTMLElementTagNameMap
|
|
1249
1249
|
declare global {
|
|
1250
1250
|
interface HTMLElementTagNameMap {
|
|
1251
|
-
'${
|
|
1251
|
+
'${o}': ${y};
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
1255
|
// Register the web component
|
|
1256
|
-
customElements.define('${
|
|
1257
|
-
`}function Ft(e,r){let
|
|
1256
|
+
customElements.define('${o}', ${y});
|
|
1257
|
+
`}function Ft(e,r){let o=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),l=o?o[1].trim():"",s=r,c=[],d=!0;if(l){let h=l.match(/export\s+default\s+({[\s\S]*})/);if(h)try{let v=h[1],b=v.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(b)s=b[1];let x=v.match(/props\s*:\s*\[([\s\S]*?)\]/);if(x)c=x[1].split(",").map((S)=>S.trim().replace(/['"`]/g,"")).filter((S)=>S.length>0);let P=v.match(/shadowDOM\s*:\s*(true|false)/);if(P)d=P[1]==="true"}catch{}}let p=e.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),u=p?p[1].trim():"",g=e.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),y=g?g[1].trim():"";return{tag:s,props:c,template:u,styles:y,script:l,shadowDOM:d}}function qt(e){let{tag:r,props:o,template:l,styles:s,shadowDOM:c}=e,d=r.split("-").map((h)=>h.charAt(0).toUpperCase()+h.slice(1)).join(""),p=l.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),u=s.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),g=o.map((h)=>`'${h}'`).join(", "),y=o.map((h)=>`
|
|
1258
1258
|
get ${h}() {
|
|
1259
1259
|
return this.getAttribute('${h}') || '';
|
|
1260
1260
|
}
|
|
@@ -1305,8 +1305,8 @@ ${y}
|
|
|
1305
1305
|
}
|
|
1306
1306
|
|
|
1307
1307
|
customElements.define('${r}', ${d});
|
|
1308
|
-
`}async function Qe(e,r,
|
|
1308
|
+
`}async function Qe(e,r,o,l){if(r.length<1)return a("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=r[0].replace(/['"]/g,""),d=(o.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)]:[q.join(q.dirname(l),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)],u=null;for(let h of p)if(await n(h)){u=await Bun.file(h).text();break}if(!u)return a("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let g=Ft(u,s);return`<script type="module">
|
|
1309
1309
|
${qt(g)}
|
|
1310
|
-
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:nn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},ya,ba,Jr,Yr,De,ke,Ae,Pe,_e,Oe,Fe,$e,...$s],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,i){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=i||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let l=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Al(e,r){let i=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,i&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let i=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=i?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ea(e.stateDir),e.stateDir=nr(),e.cachePath=rr(e.cachePath),e.build)e.build.cacheDir=rr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=rr(e.media.cache.directory);if(e.story)e.story.outDir=rr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function fo(e,r=Ht){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function o(e){let r=e?j.resolve(e):process.cwd(),i=de.get(r);if(i&&i.signature!==Kr(i.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-qmqavdz2.js"),{partialsCache:p}=await import("./chunk-0mwdq478.js");if(d(),p.clear(),c&&i.configSignature===Xr(i.graph)){let u=c.then(async(g)=>{let y={...i.graph};await mo(y,r),de.set(r,{graph:y,signature:Kr(y),configSignature:Xr(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await fo({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await fo({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await fo({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await wa(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Kr(v.graph),configSignature:Xr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-ttemwrbx.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-qy9m6qdn.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Al(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-j8g5cvvm.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
|
-
`)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(r,s),s.catch(()=>{if(Y.get(r)===s)Y.delete(r)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var R=new Proxy(N,{get(e,r){if(K&&r in K)return K[r];if(!se)
|
|
1312
|
-
export{
|
|
1310
|
+
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:sn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},ba,va,Zr,Qr,De,ke,Ae,Pe,_e,Oe,Fe,$e,...As],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Il(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ta(e.stateDir),e.stateDir=sr(),e.cachePath=or(e.cachePath),e.build)e.build.cacheDir=or(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=or(e.media.cache.directory);if(e.story)e.story.outDir=or(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function mo(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==Jr(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-x63f2ywm.js"),{partialsCache:p}=await import("./chunk-jk7chxkt.js");if(d(),p.clear(),c&&o.configSignature===Yr(o.graph)){let u=c.then(async(g)=>{let y={...o.graph};await yo(y,r),de.set(r,{graph:y,signature:Jr(y),configSignature:Yr(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await mo({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await mo({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await mo({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await xa(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Jr(v.graph),configSignature:Yr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-arh1qgmp.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-kn34esxw.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Il(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-zq7xbc1k.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
|
+
`)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(r,s),s.catch(()=>{if(Y.get(r)===s)Y.delete(r)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var R=new Proxy(N,{get(e,r){if(K&&r in K)return K[r];if(!se)i().catch((o)=>{console.warn("[stx] Failed to load config file:",o?.message||o)});return e[r]}});function _p(e){return e}function Cp(e){let r=[],o=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let l=["auto","manual","sections"];if(!l.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let l=["json","yaml","yml","js"];if(!l.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let l=["AA","AAA"];if(!l.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let l=["progressive","islands"];if(!l.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${l.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let l=["none","eager","lazy"];if(!l.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!l.timing||!["before","after"].includes(l.timing))r.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)o.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)o.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let l=["fullscreen","standalone","minimal-ui","browser"];if(!l.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let l=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!l.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.routes){let l=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!l.includes(s.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${l.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let l=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!l.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)o.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)o.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:o}}
|
|
1312
|
+
export{pa,fa,er,Je,ga,Xr,N,Il,mo,i,R,_p,Cp};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Y,Z,Q,Tn,ge,Ce,Ir,Vc,dt,Wt,$n,Rn,An,ee,Pn,In,Or}from"./chunk-x4q4bx3q.js";import"./chunk-qr7a378v.js";export{Z as DEFAULT_FORMATS,Q as DEFAULT_QUALITY,Y as DEFAULT_WIDTHS,Or as ImageProcessingError,In as formatSize,Wt as generateSizes,dt as generateSrcSet,$n as getFallbackVariant,Ir as getImageMetadata,ee as getMimeType,Pn as getTotalSize,Rn as groupVariantsByFormat,ge as isImageBackendAvailable,An as isImageFile,Tn as isSharpAvailable,Ce as processImage,Vc as resizeAndConvert};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ri,si,oi,Tu,ii,ai,$u,ci,li,kc,Ru}from"./chunk-vd5w1jaz.js";export{ri as VideoProcessorCache,kc as analyzeVideo,Tu as clearVideoCache,li as generateDASHManifest,ci as generateHLSManifest,ii as generatePoster,$u as generateSpriteSheet,ai as generateThumbnails,si as getCachedVideoResult,Ru as processVideo,oi as setCachedVideoResult};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import a from"fs";function pt(r){return o(r)}var g=1000,i=new Map;function Nn(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
|
|
3
|
+
`)}function qt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function ae(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
|
|
4
|
+
export{pt,Nn,qt,ae};
|