@stacksjs/stx 0.2.530 → 0.2.532
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-35j1evvy.js → chunk-03wggzg8.js} +3 -3
- package/dist/chunk-08emfsq3.js +2 -0
- package/dist/{chunk-2twfqcxm.js → chunk-0dqxnx20.js} +2 -2
- package/dist/chunk-0p9pwd61.js +2 -0
- package/dist/chunk-0pebjkzx.js +18 -0
- package/dist/{chunk-f1n4e4jy.js → chunk-0wvsfs4s.js} +2 -2
- package/dist/chunk-0zmv31nc.js +2 -0
- package/dist/{chunk-c322rrge.js → chunk-12e4a0ab.js} +2 -2
- package/dist/chunk-12v4d123.js +2 -0
- package/dist/{chunk-2m5mx0x8.js → chunk-15r72kw7.js} +1 -1
- package/dist/{chunk-gvngrxvb.js → chunk-1945hk44.js} +1 -1
- package/dist/chunk-28xtazwz.js +2 -0
- package/dist/{chunk-y8h823cb.js → chunk-292vew7b.js} +36 -36
- package/dist/chunk-2936t942.js +2 -0
- package/dist/chunk-29qwmthc.js +2 -0
- package/dist/chunk-2a4szpje.js +3 -0
- package/dist/{chunk-8m3k43d3.js → chunk-2dzd2h15.js} +7 -7
- package/dist/{chunk-0rt5ec7a.js → chunk-2jk0vceh.js} +4 -4
- package/dist/{chunk-ktvr45qg.js → chunk-2qbvsvwc.js} +2 -2
- package/dist/chunk-2y6tzn6d.js +3 -0
- package/dist/{chunk-csbft3wz.js → chunk-31c1g3rt.js} +3 -3
- package/dist/chunk-323cxa69.js +2 -0
- package/dist/chunk-375zp0vr.js +2 -0
- package/dist/{chunk-21rm5kv6.js → chunk-38w14qs7.js} +2 -2
- package/dist/{chunk-raqbqt1r.js → chunk-3vvppnws.js} +6 -6
- package/dist/chunk-3w49r16x.js +2 -0
- package/dist/chunk-3zyvhf4p.js +2 -0
- package/dist/chunk-458etq5a.js +4 -0
- package/dist/chunk-4cmqjmqr.js +3 -0
- package/dist/{chunk-37nybpw1.js → chunk-4gt0r98p.js} +65 -14
- package/dist/{chunk-3x9d58f4.js → chunk-4xxhprts.js} +11 -11
- package/dist/{chunk-4drgbkga.js → chunk-587ehsxn.js} +2 -2
- package/dist/{chunk-5tyes97j.js → chunk-5tj6expd.js} +2 -2
- package/dist/{chunk-kzztmawd.js → chunk-664503e6.js} +6 -6
- package/dist/{chunk-hkjqqx92.js → chunk-6abvk7vj.js} +3 -3
- package/dist/{chunk-ba88n1j7.js → chunk-6v1gwdbv.js} +2 -2
- package/dist/{chunk-y0c1srgj.js → chunk-7s14bthq.js} +5 -5
- package/dist/{chunk-2etevws0.js → chunk-7tabykst.js} +2 -2
- package/dist/{chunk-zw029e7n.js → chunk-7wfh2hqy.js} +4 -4
- package/dist/chunk-7ybgfk0m.js +3 -0
- package/dist/chunk-8bcvb86w.js +2 -0
- package/dist/chunk-8gmb3k1p.js +2 -0
- package/dist/{chunk-v2zxxjqn.js → chunk-90wh9zzy.js} +6 -6
- package/dist/{chunk-d8ramz4s.js → chunk-9a73re8k.js} +2 -2
- package/dist/{chunk-p4gbvge6.js → chunk-9pztpvvk.js} +1 -1
- package/dist/chunk-9skdekv5.js +2 -0
- package/dist/{chunk-7p0zerfj.js → chunk-9sqjmd9a.js} +10 -10
- package/dist/{chunk-czmw5xsd.js → chunk-9w2vmfha.js} +2 -2
- package/dist/chunk-9xq5yer8.js +2 -0
- package/dist/chunk-a15yzfc6.js +2 -0
- package/dist/{chunk-2hc5mbw8.js → chunk-azb58ven.js} +2 -2
- package/dist/{chunk-869wyw0j.js → chunk-b7xdk1g4.js} +6 -6
- package/dist/{chunk-9mjy16pw.js → chunk-bpr4bkde.js} +2 -2
- package/dist/chunk-cp4dr9ch.js +2 -0
- package/dist/{chunk-6t0rq51y.js → chunk-d2r8t40y.js} +2 -2
- package/dist/chunk-d4155ec5.js +2 -0
- package/dist/{chunk-6k7spr38.js → chunk-d7x6n702.js} +7 -7
- package/dist/chunk-dd31q423.js +2 -0
- package/dist/{chunk-qhg55cvv.js → chunk-ee4wwr89.js} +5 -5
- package/dist/{chunk-f5pmyxtn.js → chunk-ennxrn5g.js} +5 -5
- package/dist/{chunk-xevnx24r.js → chunk-er031j13.js} +2 -2
- package/dist/chunk-f2q5bckn.js +2 -0
- package/dist/chunk-fhx35529.js +2 -0
- package/dist/chunk-frw35d2v.js +2 -0
- package/dist/chunk-fyxydww2.js +4 -0
- package/dist/{chunk-nzk14k6w.js → chunk-g060jncp.js} +7 -7
- package/dist/{chunk-x1tzt7yc.js → chunk-g12j8ahm.js} +4 -4
- package/dist/chunk-g5t10z04.js +2837 -0
- package/dist/{chunk-x9mzfq3p.js → chunk-grb3kfya.js} +1 -1
- package/dist/{chunk-3cn7973z.js → chunk-gsxb0ry9.js} +1 -1
- package/dist/{chunk-619j0mnz.js → chunk-gvw8wh29.js} +5 -5
- package/dist/{chunk-e6y6s7q8.js → chunk-gxfnmjzp.js} +2 -2
- package/dist/chunk-h1y5q942.js +2 -0
- package/dist/chunk-h791c7sb.js +2 -0
- package/dist/chunk-h88jcr3k.js +2 -0
- package/dist/chunk-heq5c0gd.js +2 -0
- package/dist/{chunk-ravc60z0.js → chunk-hp1tnxzb.js} +8 -8
- package/dist/chunk-hpeg9erh.js +3 -0
- package/dist/chunk-j3b24e77.js +2 -0
- package/dist/{chunk-vrrqnp5k.js → chunk-j8pacd7m.js} +5 -5
- package/dist/{chunk-346zc43s.js → chunk-jjwg83xv.js} +1 -1
- package/dist/chunk-jpck8nm5.js +2 -0
- package/dist/{chunk-58jyc7kp.js → chunk-kg77xs08.js} +3 -3
- package/dist/{chunk-1te1s9fa.js → chunk-khwj964t.js} +4 -4
- package/dist/{chunk-299xbyhn.js → chunk-kwvexxey.js} +4 -4
- package/dist/chunk-ky25egh1.js +2 -0
- package/dist/{chunk-w6ys6eq4.js → chunk-m2v04c6v.js} +93 -93
- package/dist/chunk-m4d99a9r.js +2 -0
- package/dist/chunk-ndv44bgs.js +2 -0
- package/dist/chunk-ng2sdph7.js +2 -0
- package/dist/{chunk-yh3p86qa.js → chunk-p8qr0q85.js} +2 -2
- package/dist/{chunk-6k4f583z.js → chunk-p8yh7mgr.js} +2 -2
- package/dist/chunk-pkfwxp9n.js +2 -0
- package/dist/chunk-pr5q4wev.js +2 -0
- package/dist/{chunk-fk45zc1b.js → chunk-q6e45gnw.js} +5 -5
- package/dist/chunk-qs3p7sc6.js +2 -0
- package/dist/{chunk-wqxdx2td.js → chunk-r6gxy92f.js} +2 -2
- package/dist/chunk-rchwwcxy.js +2 -0
- package/dist/chunk-rk4mttds.js +2 -0
- package/dist/chunk-rma3bv36.js +2 -0
- package/dist/chunk-rp5a91ak.js +2 -0
- package/dist/{chunk-hhys3aaa.js → chunk-rs46hksk.js} +2 -2
- package/dist/{chunk-wn5zjs5m.js → chunk-rtk6n3vh.js} +3 -3
- package/dist/chunk-rwn3b21z.js +3 -0
- package/dist/chunk-sp5x96rn.js +2 -0
- package/dist/chunk-st79dqpz.js +2 -0
- package/dist/{chunk-8g1fx4mg.js → chunk-stbsqy7e.js} +2 -2
- package/dist/chunk-t2mjeezd.js +2 -0
- package/dist/chunk-t61j834x.js +2 -0
- package/dist/{chunk-s19r6qe3.js → chunk-t6769zcy.js} +55 -55
- package/dist/chunk-t94z65ry.js +2 -0
- package/dist/{chunk-0ytm2ecf.js → chunk-tkeabv04.js} +16 -16
- package/dist/{chunk-1e7g79x4.js → chunk-v1m9nrn9.js} +1 -1
- package/dist/chunk-v2vg5jqq.js +2 -0
- package/dist/{chunk-07abr1v4.js → chunk-vg8thz41.js} +3 -3
- package/dist/chunk-vmfw4svt.js +2 -0
- package/dist/chunk-w6ecbk3y.js +2 -0
- package/dist/chunk-wbv6vjhm.js +2 -0
- package/dist/chunk-wfbr3txe.js +2 -0
- package/dist/{chunk-1v6yyvxf.js → chunk-wk85dz07.js} +3 -3
- package/dist/chunk-wpnv0naj.js +2 -0
- package/dist/chunk-wwny5dk9.js +2 -0
- package/dist/chunk-wzymzex7.js +2 -0
- package/dist/chunk-x55avrcf.js +2 -0
- package/dist/{chunk-hbwmmt91.js → chunk-xab6b4mt.js} +2 -2
- package/dist/{chunk-fd795e6s.js → chunk-xb0785wp.js} +2 -2
- package/dist/{chunk-1s7qdv2h.js → chunk-xcfhy5bj.js} +3 -3
- package/dist/{chunk-b0zz4dbx.js → chunk-xdtz2v5r.js} +3 -3
- package/dist/chunk-xmwd2xm6.js +2 -0
- package/dist/chunk-xtknewf7.js +2 -0
- package/dist/{chunk-wm5b2y65.js → chunk-y4qks0bd.js} +2 -2
- package/dist/{chunk-1h4z3xpy.js → chunk-y7ds4qyb.js} +3 -3
- package/dist/{chunk-p8c5g5n2.js → chunk-yn3kp3qy.js} +5 -5
- package/dist/chunk-yts2745t.js +2 -0
- package/dist/chunk-zah67v44.js +2 -0
- package/dist/chunk-zpdq0kx1.js +2 -0
- package/dist/chunk-zpf9he2x.js +2 -0
- package/dist/chunk-zpftj8s8.js +2 -0
- package/dist/{chunk-xpvvne6r.js → chunk-zzphh8g9.js} +9 -9
- package/dist/cli.js +62 -62
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/image-optimization/processor.js +6 -8
- package/dist/native/runtime/native-host.js +4 -1
- package/dist/native-build.js +12 -7
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +13 -13
- package/dist/temp-dir.d.ts +52 -0
- package/dist/temp-dir.js +140 -0
- package/package.json +5 -5
- package/dist/chunk-088jh5zy.js +0 -2
- package/dist/chunk-089x96rp.js +0 -2
- package/dist/chunk-0fad6jf4.js +0 -2
- package/dist/chunk-0fna7gd0.js +0 -2
- package/dist/chunk-0ksq0e6s.js +0 -2
- package/dist/chunk-2bwhc8ea.js +0 -2
- package/dist/chunk-2fb4yx25.js +0 -4
- package/dist/chunk-2y82wf9d.js +0 -3
- package/dist/chunk-3bsnte2s.js +0 -2
- package/dist/chunk-3j02tj5n.js +0 -2
- package/dist/chunk-3j9de8yh.js +0 -2
- package/dist/chunk-3v2bf157.js +0 -2
- package/dist/chunk-62ry3ta3.js +0 -2
- package/dist/chunk-62s4jb6m.js +0 -2
- package/dist/chunk-6dd0zr74.js +0 -2
- package/dist/chunk-87zse67b.js +0 -2
- package/dist/chunk-9hx4s11k.js +0 -2
- package/dist/chunk-9z76qhdm.js +0 -2
- package/dist/chunk-a0pq8xg4.js +0 -2
- package/dist/chunk-ad0czgpa.js +0 -2
- package/dist/chunk-axjzqh7v.js +0 -2
- package/dist/chunk-bday3eyq.js +0 -2
- package/dist/chunk-c2243par.js +0 -2
- package/dist/chunk-csy2m03w.js +0 -2
- package/dist/chunk-d3qdcdz9.js +0 -2
- package/dist/chunk-dvph69ej.js +0 -2
- package/dist/chunk-e1c9gypy.js +0 -2
- package/dist/chunk-eadr1eph.js +0 -2
- package/dist/chunk-eh3nvr2g.js +0 -2
- package/dist/chunk-f3nxd8z8.js +0 -2
- package/dist/chunk-fanmabb0.js +0 -2
- package/dist/chunk-fjd5ka6v.js +0 -2
- package/dist/chunk-fq5xecrx.js +0 -2
- package/dist/chunk-g25n9e8z.js +0 -2
- package/dist/chunk-g7ey7mtw.js +0 -3
- package/dist/chunk-gaz311xs.js +0 -2
- package/dist/chunk-ggb57j6c.js +0 -3
- package/dist/chunk-hmk2x1t8.js +0 -2
- package/dist/chunk-j1tbfabt.js +0 -2
- package/dist/chunk-jftv278d.js +0 -2
- package/dist/chunk-jj8ssn0d.js +0 -3
- package/dist/chunk-jkd0c82m.js +0 -2
- package/dist/chunk-jw536pve.js +0 -2
- package/dist/chunk-jwx0h9qb.js +0 -2
- package/dist/chunk-k4p80n25.js +0 -2
- package/dist/chunk-kpvr93cb.js +0 -2
- package/dist/chunk-kxa069d6.js +0 -2
- package/dist/chunk-pkwed7dt.js +0 -2
- package/dist/chunk-pq5nywkf.js +0 -2
- package/dist/chunk-qfm2gy40.js +0 -2
- package/dist/chunk-r37sf7ys.js +0 -18
- package/dist/chunk-rnnead1w.js +0 -2
- package/dist/chunk-szbvewf8.js +0 -2
- package/dist/chunk-t2yrb7pt.js +0 -2
- package/dist/chunk-tjjvphx3.js +0 -2
- package/dist/chunk-tsdjwe93.js +0 -2
- package/dist/chunk-v70hfs6d.js +0 -2
- package/dist/chunk-vp37585y.js +0 -2
- package/dist/chunk-vr0fb0x1.js +0 -2
- package/dist/chunk-w5kx0qzg.js +0 -2
- package/dist/chunk-wy36z6qp.js +0 -2
- package/dist/chunk-wyxjsx4k.js +0 -2837
- package/dist/chunk-x7a4c0x1.js +0 -2
- package/dist/chunk-y0a89hgw.js +0 -2
- package/dist/chunk-y4b60ke0.js +0 -2
- package/dist/chunk-yn2d8x8m.js +0 -3
- package/dist/chunk-yqh6dny3.js +0 -2
- package/dist/chunk-z4f2msjp.js +0 -2
- package/dist/chunk-zmdyr321.js +0 -3
|
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
45
45
|
});
|
|
46
46
|
})();
|
|
47
47
|
</script>
|
|
48
|
-
`}function
|
|
48
|
+
`}function Hl(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
|
|
49
49
|
<div id="${a}" class="stx-teleport-source" style="display: none;">
|
|
50
50
|
<template>${c}</template>
|
|
51
51
|
</div>
|
|
52
52
|
${m}
|
|
53
|
-
`})}function
|
|
53
|
+
`})}function Vl(){return`
|
|
54
54
|
<script>
|
|
55
55
|
(function() {
|
|
56
56
|
// Common teleport targets
|
|
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
68
68
|
})();
|
|
69
69
|
</script>
|
|
70
70
|
`}
|
|
71
|
-
export{
|
|
71
|
+
export{Hl,Vl};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function
|
|
3
|
-
export{
|
|
2
|
+
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function aa(e,n,t={}){let o=Math.min(t.width??1440,h),s=Math.min(t.height??2200,h),i=t.waitMs??800,r=t.timeoutMs??15000,m=t.format??"png",c=M(e),u=(f)=>new p({width:o,height:f,headless:!0,...t.backend?{backend:t.backend}:{}}),a=u(s);try{if(await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r);if(t.fullPage){let d=await T(a);if(d>s){if(a.close(),a=u(d),await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r)}}let f=await a.screenshot({encoding:"buffer",format:m});b(l.dirname(l.resolve(n)),{recursive:!0}),await Bun.write(n,f)}finally{a.close()}if(!y(n))throw Error(`Screenshot was not produced for ${e}`);return{input:e,output:n,bytes:S(n).size}}async function dl(e,n,t={}){b(n,{recursive:!0});let o;if(!/^https?:\/\//.test(e)&&y(e)&&S(e).isDirectory())o=v(e).filter((r)=>r.endsWith(".html")).map((r)=>l.join(e,r));else o=[e];let s=t.format??"png",i=[];for(let r of o){let m=/^https?:\/\//.test(r)?new URL(r).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":l.basename(r).replace(/\.html?$/,"");i.push(await aa(r,l.join(n,`${m}.${s}`),t))}return i}
|
|
3
|
+
export{aa,dl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fd,Co,za,gd,md,hd,yd,bd,Ha,Va,wd,vd,xd,Sd}from"./chunk-g060jncp.js";import"./chunk-g5t10z04.js";import"./chunk-kg77xs08.js";import"./chunk-bpr4bkde.js";import"./chunk-kwvexxey.js";import"./chunk-y4qks0bd.js";import"./chunk-p8yh7mgr.js";import"./chunk-2dzd2h15.js";import"./chunk-9sqjmd9a.js";import"./chunk-tkeabv04.js";import"./chunk-6v1gwdbv.js";import"./chunk-5tj6expd.js";import"./chunk-4gt0r98p.js";import"./chunk-gxfnmjzp.js";export{za as SUSPENSE_RESOLVER_RUNTIME,Co as buildSuspenseResolveScript,bd as createStreamRenderer,hd as extractStreamBoundaries,Sd as generateHydrationRuntime,Va as islandDirective,vd as processSectionDirectives,md as processStreamDirectives,wd as registerStreamingDirectives,gd as renderStreamingPage,fd as streamTemplate,yd as streamTemplateSimple,xd as streamToResponse,Ha as streamingSuspenseDirective};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fn,Le,Be,ye,ei,Wn,Q,X,ln,d,n,R}from"./chunk-g5t10z04.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:m}=Fn(o),c=await(e.renderer??((s)=>Le(s)))(m);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Q(o);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function M(o,e){return`<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>${(e||"stx").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
${o}
|
|
11
|
+
</body>
|
|
12
|
+
</html>`}async function Oo(o,e={}){let r=_(o),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let a=await m.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=_(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};ln(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:m,serverScripts:a,clientScripts:c}=v(o),s={...R,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Wn(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await n(t,p,e,s,u),ei(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
|
|
13
|
+
${c.join(`
|
|
14
|
+
`)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Be(p),g=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await ye(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
|
|
15
|
+
`);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
|
|
16
|
+
$1`);else t+=`
|
|
17
|
+
${g}`}t=await X(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-yts2745t.js");t=await i(t)}catch{}return t}
|
|
18
|
+
export{Oo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var l=null,k=[],a=0,p=new Set;function v(){return l}function b(e){let i=l;return k.push(e),l=e,i}function T(e){k.pop(),l=e}function y(){return a>0}function g(e){p.add(e)}function m(e){a++;try{e()}finally{if(a--,a===0){let i=[...p];p.clear();for(let n of i)n()}}}function D(e){let i=l;l=null;try{return e()}finally{l=i}}var h=[],f=[];function V(e){let i=e,n=new Set,r=new Set,o=()=>{let t=v();if(t)r.add(t);return i};return o.set=(t)=>{if(!Object.is(t,i)){let c=i;if(i=t,n.forEach((s)=>{try{s(i,c)}catch(u){console.error("[stx] subscriber error:",u)}}),y())r.forEach((s)=>g(s));else r.forEach((s)=>s())}},o.update=(t)=>{o.set(t(i))},o.subscribe=(t)=>(n.add(t),()=>n.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function
|
|
3
|
-
export{V,
|
|
2
|
+
var l=null,k=[],a=0,p=new Set;function v(){return l}function b(e){let i=l;return k.push(e),l=e,i}function T(e){k.pop(),l=e}function y(){return a>0}function g(e){p.add(e)}function m(e){a++;try{e()}finally{if(a--,a===0){let i=[...p];p.clear();for(let n of i)n()}}}function D(e){let i=l;l=null;try{return e()}finally{l=i}}var h=[],f=[];function V(e){let i=e,n=new Set,r=new Set,o=()=>{let t=v();if(t)r.add(t);return i};return o.set=(t)=>{if(!Object.is(t,i)){let c=i;if(i=t,n.forEach((s)=>{try{s(i,c)}catch(u){console.error("[stx] subscriber error:",u)}}),y())r.forEach((s)=>g(s));else r.forEach((s)=>s())}},o.update=(t)=>{o.set(t(i))},o.subscribe=(t)=>(n.add(t),()=>n.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Mn(e){let i,n=!0,r=new Set,o=()=>{if(!n)if(n=!0,y())r.forEach((c)=>g(c));else r.forEach((c)=>c())},t=()=>{let c=v();if(c)r.add(c);if(n){let s=b(o);try{i=e()}finally{T(s)}n=!1}return i};return Object.defineProperty(t,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(t,"value",{get:()=>t(),configurable:!0}),t}function Jt(e,i={}){let n,r=!1,o=()=>{if(r)return;if(n){let c=n;n=void 0;try{c()}catch(s){console.error("[stx] effect cleanup error:",s)}}let t=b(o);try{let c=e();n=typeof c==="function"?c:void 0}catch(c){r=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{T(t)}};if(i.immediate!==!1)o();return()=>{if(r=!0,n){let t=n;n=void 0,t()}}}function Fr(e){m(e)}function zr(e){h.push(e)}function Nn(e){f.push(e)}function ld(){C(h,"onMount",f)}function dd(){C(f,"onDestroy")}function C(e,i,n){let r=e.splice(0,e.length);for(let o of r)try{let t=o();if(n&&typeof t==="function")n.push(t)}catch(t){console.error(`[stx] ${i} callback threw:`,t)}}function ud(){return{mount:h.length,destroy:f.length}}function Yt(e){return typeof e==="function"&&e._isSignal===!0}function Zt(e){return typeof e==="function"&&e._isDerived===!0}function Hr(e){if(Yt(e)||Zt(e))return e();return e}function Ln(e){return D(e)}function pd(e,i){let n=typeof e==="function"?e:()=>e,r=V([]),o=Mn(()=>r().reduce((s,u)=>i(s,u.action),n())),t=!1;return Jt(()=>{if(n(),!t){t=!0;return}if(Ln(()=>r().length))r.set([])}),[o,(s,u)=>{let x={action:s};r.set([...r(),x]);let d=()=>{let S=r().filter((A)=>A!==x);if(S.length!==r().length)r.set(S)};if(u&&typeof u.then==="function")Promise.resolve(u).then(d,d);return d}]}
|
|
3
|
+
export{V,Mn,Jt,Fr,zr,Nn,ld,dd,ud,Yt,Zt,Hr,Ln,pd};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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
|
|
3
|
-
export{
|
|
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 ct(){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 hr(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 lt(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 Ws(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function Te(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function qs(e){console.log(` ${O("\u2139")} ${e}`)}function Ks(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 yr(){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 dt(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 Xs(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 ut(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{ct,hr,lt,Ws,Te,qs,Ks,yr,dt,Xs,ut};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{pl,fl,gl,ml,ca,hl,yl,bl,wl,vl,xl,Sl}from"./chunk-p8qr0q85.js";export{xl as Broadcast,Sl as BroadcastServer,ca as broadcast,wl as broadcastPresence,bl as broadcastPrivate,vl as channel,pl as getBroadcastServer,ml as loadChannels,fl as startBroadcasting,gl as stopBroadcasting,hl as toUser,yl as toUsers};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{_,k,Ut,Wt,qt}from"./chunk-er031j13.js";import{resolve as S,basename as z,extname as j,join as T}from"path";import{mkdir as q}from"fs/promises";var F={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class Rr{config;constructor(e={}){this.config={...F,...e}}async get(e,s){return Ut(e,s,"image",this.config)}async set(e,s,r){return Wt(e,s,r,"image",this.config)}async clear(){return qt("image",this.config)}updateConfig(e){this.config={...this.config,...e}}}var w=null;function v(e){if(!w)w=new Rr(e);else if(e)w.updateConfig(e);return w}async function Ar(e,s,r){let t=r?{directory:`${r.outputDir}/../.cache`}:{};return v(t).get(e,s)}async function Pr(e,s,r,t){let a=t?{directory:`${t.outputDir}/../.cache`}:{};return v(a).set(e,s,r)}async function ga(){return v().clear()}async function x(){try{return await import("ts-images")}catch{return null}}function R(e){switch(e){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function E(e,s){let r=s?R(s):R("web"),t=e.formatQuality||{};return{jpeg:{...r.jpeg,...t.jpeg},png:{...r.png,...t.png},webp:{...r.webp,...t.webp},avif:{...r.avif,...t.avif}}}async function ma(e,s,r){let t=await x();if(!t)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:e,processed:!1};let a=await Ar(e,s,r);if(a)return a;try{let c=S(e);if(!await k(c))return{src:e,processed:!1,errors:[`Source file not found: ${e}`]};let n=E(r,s.preset),p=r.outputDir||"dist/images",I=r.baseUrl||"/images";await q(p,{recursive:!0});let d=await _(c),P=z(e,j(e)),b=s.outputFormat?[s.outputFormat]:r.defaultFormats||["avif","webp","jpeg"],o={src:e,processed:!0,variants:[],hash:d},u=null;if(s.transformations&&s.transformations.length>0)u=await wo(c,s.transformations,t);for(let i of b){let l=n[i]||{},g=`${P}-${d}.${i}`,h=T(p,g);try{let m=await t.optimizeImage({input:u||c,output:h,format:i,quality:l.quality,progressive:l.progressive});if(m){if(o.variants.push({path:h,url:`${I}/${g}`,width:m.width||0,height:m.height||0,format:i,size:m.outputSize||0}),!o.originalWidth&&m.width)o.originalWidth=m.width,o.originalHeight=m.height}}catch(m){o.errors=o.errors||[],o.errors.push(`Failed to optimize ${i}: ${m}`)}}if(s.embedThumbhash||s.placeholder==="thumbhash")try{let i=await t.generateThumbHash(c);o.placeholder=i.dataUrl}catch(i){o.errors=o.errors||[],o.errors.push(`Failed to generate thumbhash: ${i}`)}if(s.useDominantColor)try{let i=await t.generatePlaceholder(c,{strategy:"dominant-color"});o.dominantColor=i.dominantColor}catch(i){o.errors=o.errors||[],o.errors.push(`Failed to extract dominant color: ${i}`)}return await Pr(e,s,o,r),o}catch(c){return{src:e,processed:!1,errors:[`Processing failed: ${c}`]}}}async function ha(e,s,r,t){let a=await x();if(!a)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await a.optimizeImage({input:e,output:t,format:s,quality:r}))?.outputSize}}catch(c){return{success:!1,error:String(c)}}}async function wo(e,s,r){let t=r||await x();if(!t)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let a=await t.decode(e);for(let c of s){let n=c.options||{};switch(c.type){case"resize":if(n.width||n.height)a=await t.resize(a,{width:n.width,height:n.height,fit:n.fit});break;case"blur":if(n.sigma!==void 0)a=await t.blur(a,n.sigma);break;case"sharpen":if(n.amount!==void 0)a=await t.sharpen(a,n.amount);break;case"grayscale":a=await t.grayscale(a);break;case"rotate":if(n.angle!==void 0)a=await t.rotate(a,n.angle);break;case"flip":a=await t.flip(a);break;case"flop":a=await t.flop(a);break;case"brightness":if(n.value!==void 0)a=await t.brightness(a,n.value);break;case"contrast":if(n.value!==void 0)a=await t.contrast(a,n.value);break;case"saturation":if(n.value!==void 0)a=await t.saturation(a,n.value);break}}return await t.encode(a,"png")}catch(a){return console.error(`[stx-media] Transformation failed: ${a}`),null}}import{resolve as D,basename as Q,extname as U,join as V}from"path";import{mkdir as L}from"fs/promises";async function H(){try{return await import("ts-images")}catch{return null}}var O=[320,480,640,768,1024,1280,1536,1920];async function ya(e,s,r){let t=await H();if(!t)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let a=D(e);if(!await k(a))return console.warn(`[stx-media] Source file not found: ${e}`),null;try{let c=s.responsiveWidths||r.breakpoints||O,n=s.formats||r.defaultFormats||["avif","webp","jpeg"],p=r.outputDir||"dist/images",I=r.baseUrl||"/images";await L(p,{recursive:!0});let d=await _(a),P=Q(e,U(e)),b=r.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},o={src:e,byFormat:{},srcsets:{}};for(let i of n){o.byFormat[i]=[];let l=[];for(let g of c){let h=`${P}-${g}w-${d}.${i}`,m=V(p,h),y=`${I}/${h}`;try{let C=b[i]?.quality||80;if(await k(m)){o.byFormat[i].push({path:m,url:y,width:g,height:0,format:i,size:0}),l.push(`${y} ${g}w`);continue}let f=await t.processImage({input:a,output:m,format:i,quality:C,resize:{width:g}});if(f)o.byFormat[i].push({path:m,url:y,width:g,height:f.height||Math.round(g*(f.height||1)/(f.width||1)),format:i,size:f.outputSize||0}),l.push(`${y} ${g}w`)}catch(C){console.warn(`[stx-media] Failed to generate ${i} at ${g}w: ${C}`)}}o.srcsets[i]=l.join(", ")}let u=s.placeholder||r.placeholderStrategy||"thumbhash";if(u!=="none")try{if(u==="thumbhash"){let i=await t.generateThumbHash(a);o.placeholder={dataURL:i.dataUrl,width:i.width||32,height:i.height||32,strategy:"thumbhash"}}else{let i=await t.generatePlaceholder(a,{strategy:u,width:20});o.placeholder={dataURL:i.dataURL,width:i.width,height:i.height,strategy:u}}}catch(i){console.warn(`[stx-media] Failed to generate placeholder: ${i}`)}return o.sizes=s.sizes||A(c),o}catch(c){return console.error(`[stx-media] Responsive generation failed: ${c}`),null}}function A(e){let s=[...e].sort((t,a)=>t-a),r=[];for(let t=0;t<s.length-1;t++){let a=s[t];r.push(`(max-width: ${a}px) ${a}px`)}return r.push(`${s[s.length-1]}px`),r.join(", ")}function ba(e,s="width"){if(!e||e.length===0)return"";if(s==="dpr")return e.filter((r)=>r.dpr).map((r)=>`${r.url} ${r.dpr}x`).join(", ");return e.map((r)=>`${r.url} ${r.width}w`).join(", ")}export{Rr,Ar,Pr,ga,ma,ha,wo,ya,ba};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import m from"path";var y=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function I(...o){let r=new Set;for(let s of o){if(!s||!s.includes("__stxModules["))continue;for(let e of s.matchAll(y))try{r.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...r].sort()}async function w(o,r={}){if(o.length===0)return null;let s=process.cwd(),e=[],a=[];o.forEach((t,c)=>{let i=t.startsWith("npm:")?t.slice(4):m.resolve(s,t),l=`__stxRegistered${c}`,p=JSON.stringify(t);e.push(`import * as ${l} from ${JSON.stringify(i)};`),a.push(`if (!globalThis.__stxModules[${p}]) globalThis.__stxModules[${p}] = ${l};`)});let d=[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...a].join(`
|
|
3
|
-
`),n;try{let{bundleClientScript:t}=await import("./chunk-
|
|
3
|
+
`),n;try{let{bundleClientScript:t}=await import("./chunk-v2vg5jqq.js");n=await t(d,m.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:r.minify,externalizeUserModules:!1,collectInputs:r.collectInputs,throwOnFailure:!0})}catch(t){let{formatBuildFailure:c}=await import("./chunk-t94z65ry.js"),i=c(t);console.warn(`[stx] could not build the page module registry (#1957): ${i}`);let l=`[stx] the page module registry did not build, so ${o.join(", ")} cannot load (#1957): ${i}`;return`;console.error(${JSON.stringify(l)});`}let{transformAutoImports:f,generateAutoImportDestructuring:_}=await import("./chunk-ng2sdph7.js"),u=f(n),h=_(u.stxImports,u.browserImports),{transformStoreImports:x}=await import("./chunk-zpftj8s8.js");n=x(u.code);let g=JSON.stringify(new Bun.CryptoHasher("md5").update(d).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${g}]) return;`,` __stxBundles[${g}] = true;`,h,n,"})();"].join(`
|
|
4
4
|
`)}export{w as buildModuleRegistryScript,I as registeredModuleIdsIn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Yd,wc,ds,us,ci,li,ps,gs,Xn,vc,di,ui,xc,We}from"./chunk-g5t10z04.js";import"./chunk-kg77xs08.js";import"./chunk-bpr4bkde.js";import"./chunk-kwvexxey.js";import"./chunk-y4qks0bd.js";import"./chunk-p8yh7mgr.js";import"./chunk-2dzd2h15.js";import"./chunk-9sqjmd9a.js";import"./chunk-tkeabv04.js";import"./chunk-6v1gwdbv.js";import"./chunk-5tj6expd.js";import"./chunk-4gt0r98p.js";import"./chunk-gxfnmjzp.js";export{Yd as clearScriptScanCache,ps as convertServerLoopAttributesToDirectives,ci as convertSignalDirectivesToAttributes,gs as convertSignalLoopsToAttributes,vc as extractExports,ui as findMarkupIndexOutsideScripts,us as hasSignalsSyntax,ds as parseLoopExpression,li as preEvalLiteralReactiveIfs,Xn as processScriptSetup,di as processSignals,xc as rewriteStxImportSpecifiers,wc as scanScriptTags,We as stripStxRuntimeImports};
|