@stacksjs/stx 0.2.846 → 0.2.849
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/app-shell.d.ts +2 -1
- package/dist/app-shell.js +3 -3
- package/dist/{chunk-cpdfxy8g.js → chunk-056rsqc6.js} +12 -12
- package/dist/{chunk-wzpd3htt.js → chunk-09412heg.js} +7 -7
- package/dist/chunk-0d4zhbjz.js +2 -0
- package/dist/{chunk-ng8nkbp2.js → chunk-0ey7kc6t.js} +2 -2
- package/dist/chunk-0g05v7m1.js +2 -0
- package/dist/{chunk-z26fg4p0.js → chunk-0wms5teg.js} +2 -2
- package/dist/{chunk-nsc93haq.js → chunk-0zgxxhvs.js} +6 -6
- package/dist/chunk-11snc6n0.js +2 -0
- package/dist/{chunk-82vf29ty.js → chunk-12r22pf0.js} +2 -2
- package/dist/{chunk-j1n2xb48.js → chunk-14cvwsy1.js} +2 -2
- package/dist/{chunk-0e4y6h1h.js → chunk-1k12cc65.js} +14 -14
- package/dist/chunk-1menbxwb.js +2 -0
- package/dist/chunk-1p968nww.js +2 -0
- package/dist/chunk-1pf4y2yr.js +2 -0
- package/dist/{chunk-6pgq75h9.js → chunk-25m74mh1.js} +5 -5
- package/dist/{chunk-xq9w5g23.js → chunk-2j3gttzf.js} +1 -1
- package/dist/chunk-2sxmmjt1.js +2 -0
- package/dist/{chunk-h76wsqr4.js → chunk-2ts9pb6s.js} +2 -2
- package/dist/{chunk-caw0wzns.js → chunk-2xf323h9.js} +3 -3
- package/dist/chunk-34afrhts.js +2 -0
- package/dist/chunk-37bzsnr7.js +2 -0
- package/dist/chunk-3m5v3ynh.js +4 -0
- package/dist/chunk-3m6n90sk.js +2 -0
- package/dist/{chunk-zx2xwrp3.js → chunk-3qyz80d6.js} +6 -6
- package/dist/{chunk-an6vb4ng.js → chunk-46t924aw.js} +2 -2
- package/dist/{chunk-9hfk5wf1.js → chunk-4fc8zs15.js} +5 -5
- package/dist/chunk-4q4mtrc5.js +2 -0
- package/dist/{chunk-xskygt2v.js → chunk-54p27ney.js} +5 -5
- package/dist/chunk-5bm8hmwd.js +2 -0
- package/dist/chunk-5r2z29n8.js +2 -0
- package/dist/{chunk-wbx27kdd.js → chunk-5wr1qqz3.js} +2 -2
- package/dist/{chunk-wvsnp294.js → chunk-63sqdcr6.js} +9 -9
- package/dist/chunk-660preb9.js +2 -0
- package/dist/chunk-6hd83cj4.js +2 -0
- package/dist/{chunk-gs33xdk7.js → chunk-6xcmeev9.js} +5 -5
- package/dist/chunk-740njbwc.js +2 -0
- package/dist/chunk-77fs8281.js +2 -0
- package/dist/chunk-7c73t536.js +2 -0
- package/dist/chunk-7ycmnsh5.js +2 -0
- package/dist/{chunk-r3v1zaj0.js → chunk-81ysx0tc.js} +2 -2
- package/dist/{chunk-hp8ny2zb.js → chunk-83dxfhkw.js} +5 -5
- package/dist/chunk-84gg2atb.js +2 -0
- package/dist/chunk-86z8zrn9.js +3 -0
- package/dist/{chunk-5903tzcw.js → chunk-88a7qaw8.js} +3 -3
- package/dist/{chunk-1qp5808r.js → chunk-8bxws458.js} +3 -3
- package/dist/{chunk-j3zy3mrn.js → chunk-8vkywnpx.js} +9 -9
- package/dist/{chunk-zkn55966.js → chunk-90mm5bf8.js} +6 -6
- package/dist/{chunk-8az9e5b9.js → chunk-93c08def.js} +5 -5
- package/dist/chunk-9c6yvh3p.js +2 -0
- package/dist/chunk-9f0pv6sz.js +2 -0
- package/dist/chunk-9fxeqf0e.js +2 -0
- package/dist/{chunk-4041q9sd.js → chunk-9mbyhepc.js} +5 -5
- package/dist/{chunk-vxayh4az.js → chunk-9qxx2teq.js} +6 -6
- package/dist/{chunk-p8ry1q7c.js → chunk-9sjtph54.js} +3 -3
- package/dist/chunk-atsjexk0.js +2 -0
- package/dist/{chunk-x3pxxx7j.js → chunk-b147ejha.js} +3 -3
- package/dist/{chunk-1w5hte9z.js → chunk-b3n1m4m5.js} +2 -2
- package/dist/chunk-bcefawtc.js +2 -0
- package/dist/chunk-bkqqa8aw.js +2 -0
- package/dist/chunk-bmds786f.js +2 -0
- package/dist/{chunk-ph57nv7v.js → chunk-bsw6hd14.js} +2 -2
- package/dist/{chunk-s2a51j0k.js → chunk-bttvkzxh.js} +6 -6
- package/dist/chunk-c0azgkss.js +2 -0
- package/dist/{chunk-v8y01jbr.js → chunk-c541s99z.js} +4 -4
- package/dist/{chunk-50tnhq5f.js → chunk-c7qej674.js} +30 -30
- package/dist/chunk-cbz7jtzf.js +2 -0
- package/dist/{chunk-bsr6kf34.js → chunk-ct54e34a.js} +1 -1
- package/dist/{chunk-84myqca7.js → chunk-cww1zk8y.js} +2 -2
- package/dist/{chunk-d1pat213.js → chunk-dv9q56r7.js} +2 -2
- package/dist/chunk-e1n286mv.js +2 -0
- package/dist/{chunk-t3e95q80.js → chunk-eg2p1cyw.js} +14 -14
- package/dist/{chunk-7rcc2tzz.js → chunk-emf6ee94.js} +3 -3
- package/dist/chunk-evdskc25.js +2 -0
- package/dist/chunk-f18rxz70.js +2 -0
- package/dist/{chunk-wd632rge.js → chunk-f2zgh4xr.js} +7 -7
- package/dist/chunk-f8akfzzn.js +2 -0
- package/dist/chunk-f8wmxwa3.js +2 -0
- package/dist/{chunk-neh3kewg.js → chunk-fa3ygt8c.js} +4 -4
- package/dist/{chunk-n475s55q.js → chunk-fez9828r.js} +2 -2
- package/dist/chunk-fseqwysr.js +2 -0
- package/dist/{chunk-ds1vj0dw.js → chunk-fx8jjasv.js} +4 -4
- package/dist/{chunk-x1n01gc1.js → chunk-ga650crj.js} +5 -5
- package/dist/{chunk-rg2gfyy0.js → chunk-gpkxphqz.js} +2 -2
- package/dist/chunk-h8zb6cek.js +2 -0
- package/dist/chunk-hc4ydhw0.js +2 -0
- package/dist/{chunk-30g5kqy0.js → chunk-he9dzchk.js} +1 -1
- package/dist/{chunk-4y6hes3h.js → chunk-hpwtjb4a.js} +2 -2
- package/dist/chunk-j08r18x1.js +2 -0
- package/dist/chunk-j539dz72.js +2 -0
- package/dist/{chunk-s6qzmwp3.js → chunk-jaf44web.js} +1 -1
- package/dist/{chunk-vyggv4k0.js → chunk-jcwtw3hd.js} +2 -2
- package/dist/{chunk-81nmqdht.js → chunk-jh36gqcq.js} +2 -2
- package/dist/{chunk-m8cpabd2.js → chunk-jm0qsr3s.js} +3 -3
- package/dist/{chunk-4v6mbvqv.js → chunk-jmshgw0t.js} +5 -5
- package/dist/chunk-jqngvqby.js +2 -0
- package/dist/{chunk-vh8wn94m.js → chunk-jtccqpwa.js} +2 -2
- package/dist/chunk-k33kgf8a.js +2 -0
- package/dist/{chunk-7qwfbafg.js → chunk-k44qj40k.js} +2 -2
- package/dist/{chunk-444sbdm8.js → chunk-k7e3e149.js} +36 -36
- package/dist/chunk-ke76eaat.js +33 -0
- package/dist/chunk-kz7ha54c.js +2 -0
- package/dist/chunk-m7cbkrz6.js +2 -0
- package/dist/{chunk-qttjrja7.js → chunk-ma9yq04p.js} +2 -2
- package/dist/chunk-md8dj6tb.js +2 -0
- package/dist/{chunk-krdfnsz6.js → chunk-mnncq81c.js} +5 -5
- package/dist/chunk-na1v2jcy.js +2 -0
- package/dist/{chunk-jf0a5ew8.js → chunk-na1x46xm.js} +3 -3
- package/dist/{chunk-sxsjxme0.js → chunk-nws4zm4k.js} +4 -4
- package/dist/chunk-p2fkggw4.js +3 -0
- package/dist/chunk-pqqyjvq9.js +2 -0
- package/dist/chunk-q18508s2.js +2 -0
- package/dist/chunk-qay7pgnq.js +2 -0
- package/dist/chunk-qczgdzjk.js +2 -0
- package/dist/{chunk-rgy9c7d8.js → chunk-qpz9jrvw.js} +3 -3
- package/dist/chunk-r40g6785.js +2 -0
- package/dist/chunk-r6085mp4.js +2 -0
- package/dist/{chunk-prrf0j54.js → chunk-r96ahk8s.js} +5 -5
- package/dist/chunk-rke4q3jk.js +2 -0
- package/dist/{chunk-mzyx6y1a.js → chunk-rqjskxpw.js} +32 -32
- package/dist/chunk-rrnvbwac.js +2 -0
- package/dist/{chunk-c78dsx3f.js → chunk-rtsshvpt.js} +10 -10
- package/dist/{chunk-66e0d2t7.js → chunk-rwc322gq.js} +2 -2
- package/dist/{chunk-r1984y6y.js → chunk-shnw9geh.js} +4 -4
- package/dist/{chunk-dspmqeg0.js → chunk-t4dkcf28.js} +114 -25
- package/dist/{chunk-2a792g5e.js → chunk-t5q31st4.js} +2 -2
- package/dist/{chunk-4jmkvzns.js → chunk-tb5h85ag.js} +2 -2
- package/dist/{chunk-098mrr5f.js → chunk-tbcvarvy.js} +2 -2
- package/dist/chunk-te1wksa0.js +2 -0
- package/dist/{chunk-6x6xthsv.js → chunk-tj533808.js} +2 -2
- package/dist/{chunk-jx14j83s.js → chunk-tm5t3hh3.js} +3 -3
- package/dist/{chunk-serwcna2.js → chunk-trgbdydw.js} +2 -2
- package/dist/chunk-v11hvvxc.js +2 -0
- package/dist/{chunk-fnfq6fkk.js → chunk-v929r67j.js} +1 -1
- package/dist/chunk-vasvns9e.js +2 -0
- package/dist/chunk-vdb3p2v3.js +2 -0
- package/dist/chunk-vm2y05sr.js +2 -0
- package/dist/{chunk-zyt8k9n0.js → chunk-wdwx2aa6.js} +2 -2
- package/dist/{chunk-6g7wrn48.js → chunk-wp14sf2j.js} +2 -2
- package/dist/{chunk-xhytkzg7.js → chunk-wzyc9da7.js} +2 -2
- package/dist/chunk-x2wn6mpd.js +2 -0
- package/dist/chunk-x45mp78q.js +2 -0
- package/dist/chunk-xa2qfe51.js +3 -0
- package/dist/{chunk-zjqvbcwa.js → chunk-xppm4cs4.js} +2 -2
- package/dist/{chunk-tzqnf28n.js → chunk-xr9rf0e6.js} +3 -3
- package/dist/chunk-xsmyhp5f.js +2 -0
- package/dist/{chunk-xj5j18nf.js → chunk-y1cneng3.js} +2 -2
- package/dist/{chunk-rn7710jg.js → chunk-y6wbbmp3.js} +3 -3
- package/dist/{chunk-evww725k.js → chunk-ynnd6nnt.js} +63 -63
- package/dist/{chunk-d4jhyxp6.js → chunk-yqjmqndq.js} +6 -6
- package/dist/{chunk-hff8z61n.js → chunk-yrmppd8r.js} +1 -1
- package/dist/{chunk-9d9sartn.js → chunk-z57xq46m.js} +1 -1
- package/dist/chunk-zecffe6a.js +2 -0
- package/dist/{chunk-ea5w92vs.js → chunk-zfb2wnha.js} +3 -3
- package/dist/cli.js +20 -20
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/floating-actions.d.ts +43 -0
- package/dist/native/floating-actions.js +50 -0
- package/dist/native/index.d.ts +1 -0
- package/dist/native/index.js +1 -0
- package/dist/native/primitives/FloatingActions.stx +42 -0
- package/dist/native/runtime/browser-screen.js +3 -8
- package/dist/page-head.d.ts +15 -0
- package/dist/page-head.js +35 -10
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +6 -6
- package/dist/template-compiler.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-07hvjvj1.js +0 -2
- package/dist/chunk-13sp1247.js +0 -2
- package/dist/chunk-1kdtapc1.js +0 -2
- package/dist/chunk-263gby2p.js +0 -2
- package/dist/chunk-33ggd5at.js +0 -2
- package/dist/chunk-3q19w77r.js +0 -2
- package/dist/chunk-40x0vwza.js +0 -2
- package/dist/chunk-4cmda04d.js +0 -2
- package/dist/chunk-5xt4tjpm.js +0 -2
- package/dist/chunk-6289h3tr.js +0 -2
- package/dist/chunk-6q7ke5p0.js +0 -2
- package/dist/chunk-6ya0860g.js +0 -2
- package/dist/chunk-8k7rfy77.js +0 -3
- package/dist/chunk-9enwmg0z.js +0 -2
- package/dist/chunk-a7z6j9ga.js +0 -2
- package/dist/chunk-ab6dw6f4.js +0 -2
- package/dist/chunk-adnntqk3.js +0 -2
- package/dist/chunk-bhzbcmm7.js +0 -2
- package/dist/chunk-cfez1qbm.js +0 -2
- package/dist/chunk-cgyddqxw.js +0 -2
- package/dist/chunk-cng4fhpt.js +0 -2
- package/dist/chunk-ctq1qy1g.js +0 -2
- package/dist/chunk-cyghcps7.js +0 -2
- package/dist/chunk-e26aqarz.js +0 -2
- package/dist/chunk-e7816ep3.js +0 -2
- package/dist/chunk-en8hnq2q.js +0 -2
- package/dist/chunk-enz6fsdx.js +0 -2
- package/dist/chunk-eydqn4gz.js +0 -2
- package/dist/chunk-fk7gs41v.js +0 -2
- package/dist/chunk-fx04tq90.js +0 -2
- package/dist/chunk-fzba0b0n.js +0 -2
- package/dist/chunk-g7tj2tnz.js +0 -2
- package/dist/chunk-ga0293gz.js +0 -2
- package/dist/chunk-gab3h25h.js +0 -2
- package/dist/chunk-hczqyk7c.js +0 -2
- package/dist/chunk-hs6fg0k9.js +0 -2
- package/dist/chunk-hsg4ggt0.js +0 -2
- package/dist/chunk-k3pfadjb.js +0 -2
- package/dist/chunk-kmnre1tq.js +0 -2
- package/dist/chunk-mgtp037k.js +0 -3
- package/dist/chunk-mp42d9v5.js +0 -2
- package/dist/chunk-mtmgrccj.js +0 -2
- package/dist/chunk-n20tsy6a.js +0 -2
- package/dist/chunk-nhn69eva.js +0 -4
- package/dist/chunk-pdt1phnh.js +0 -2
- package/dist/chunk-q87wwwra.js +0 -2
- package/dist/chunk-r1mvd96m.js +0 -2
- package/dist/chunk-rrj3gv46.js +0 -3
- package/dist/chunk-s321pb85.js +0 -2
- package/dist/chunk-st75663x.js +0 -2
- package/dist/chunk-stss2b88.js +0 -2
- package/dist/chunk-svxkcdhh.js +0 -2
- package/dist/chunk-t6gm8z7x.js +0 -2
- package/dist/chunk-tkssavxx.js +0 -2
- package/dist/chunk-tw6y23ew.js +0 -2
- package/dist/chunk-vm34qp5k.js +0 -2
- package/dist/chunk-vtg2tqzt.js +0 -2
- package/dist/chunk-wddaxpep.js +0 -2
- package/dist/chunk-x6bt567m.js +0 -2
- package/dist/chunk-xdzs2mxv.js +0 -32
- package/dist/chunk-xf4d9gam.js +0 -2
- package/dist/chunk-xf5db38j.js +0 -2
- package/dist/chunk-y5t7ec69.js +0 -2
- package/dist/chunk-yk90sqqv.js +0 -2
- package/dist/chunk-z231es22.js +0 -2
- package/dist/chunk-zphekzv8.js +0 -2
- package/dist/chunk-zsft5466.js +0 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Tn}from"./chunk-eg2p1cyw.js";import{q,y,Nt,Dt,$r,m,il,ki,W,A}from"./chunk-ynnd6nnt.js";import{tn}from"./chunk-rwc322gq.js";import{n}from"./chunk-xa2qfe51.js";import{X}from"./chunk-k44qj40k.js";var G=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)s.push({start:r.index,end:r.index+r[0].length});return s}function N(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},r=s,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let o=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];r=r.slice(o[0].length);continue}let c=r.match(/^#([\w-]+)/);if(c){e.id=c[1],r=r.slice(c[0].length);continue}let a=r.match(/^\.([\w-]+)/);if(a){e.className=a[1],r=r.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Y(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=r.exec(t))!==null){if(N(o.index,i))continue;let c=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||G.has(c))continue;if(e.tag&&e.tag!==c)continue;if(!Y(a,e))continue;let l=o[0],f=o.index+l.length,u=new RegExp(`<(/?)${c}\\b([^>]*)>`,"gi");u.lastIndex=f;let p=1,h;while((h=u.exec(t))!==null){if(N(h.index,i))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(p+=S?-1:1,p===0)return{openTag:l,openIndex:o.index,start:f,end:h.index,tagName:c}}return null}return null}var gt="private, no-store";function Gt(t){return t.replace(/&#(\d+);/g,(s,e)=>F(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>F(Number.parseInt(e,16),s)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function F(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Ee(t){return t.headers.get("X-STX-Router")==="true"}function Z(t,s){if(!t)return s;return t.split(",").some((r)=>r.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function j(t){return{Vary:Z(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function D(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return y(s,(r,i)=>(e.lastIndex=i,e.exec(r)?e.lastIndex:-1)).map(({token:r})=>r)}function L(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let r of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=r[1].toLowerCase();if(!(i in s))s[i]=r[2]??r[3]??r[4]??""}return s}function Nn(t){let s=[];for(let e of D(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let r=L(e);if(/^<meta\b/i.test(e)){let i=r.property?"property":"name",o=Gt(r[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${n(o)}" content="${E(r.content??"")}">`)}else{let i=Gt(r.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&r.hreflang)s.push(`<link rel="${i}" href="${E(r.href??"")}"${i==="alternate"?` hreflang="${E(r.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
|
|
3
|
+
`}var Q=["media","crossorigin","integrity"];function Dn(t){let s=[];for(let e of D(t)){if(!/^<link\b/i.test(e))continue;let r=L(e);if(Gt(r.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!r.href||"data-css"in r||"disabled"in r)continue;let i=Q.filter((o)=>(o in r)).map((o)=>` ${o}="${E(r[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(r.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
|
|
4
|
+
`:""}import T from"path";var tt="stx-page-head:",et=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function nt(){let t=X()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-f8wmxwa3.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${r()}</script>`}catch{_[t]=""}return _[t]}async function fa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let r=T.resolve(t,s);if(await Bun.file(r).exists())return r;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function wo(t,s){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let o=tn(e),c=[...o.client.map((g)=>g.fullTag),...o.signals.map((g)=>g.fullTag)],a=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=l.exec(e))!==null)a.push(f[0]);let u=r;for(let g of o.server)u=u.replace(g.fullTag,"");for(let g of o.client)u=u.replace(g.fullTag,"");u=u.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let p="<!--__STX_PAGE_SLOT__-->";if(u=u.replace(/<slot\s*\/>/gi,p).replace(/<slot\s*>\s*<\/slot>/gi,p),!u.includes(p))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:R,loadStxConfig:b}=await import("./chunk-660preb9.js"),k=await b(),d={__filename:t,__dirname:T.dirname(t)};for(let g of c){let C=g.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!g.includes("client")&&!g.includes('type="module"'))await S(C[1],d,t)}let x=await h(u,d,t,{...R,...k,...s},new Set),w=x.indexOf(p);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,w),afterSlot:x.substring(w+p.length),filePath:t,shellScripts:c,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Jr(t,s,e){let r,i="",o=s.match(et);if(o){s=s.replace(o[0],"");try{let u=Buffer.from(o[1],"base64").toString("utf8"),p=u.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(p)r=p[1].trim();i=u.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let c=e||r||"stx App",a=nt(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
5
|
+
<html lang="en">
|
|
6
|
+
<head>
|
|
7
|
+
<meta charset="UTF-8">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
+
<title>${c}</title>
|
|
10
|
+
${i?` ${i}
|
|
11
|
+
`:""} ${t.shellStyles.join(`
|
|
12
|
+
`)}
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
${t.beforeSlot}
|
|
16
|
+
<div data-stx-content>${s}</div>
|
|
17
|
+
${t.afterSlot}
|
|
18
|
+
${t.shellScripts.filter((u)=>!u.includes("server")).join(`
|
|
19
|
+
`)}
|
|
20
|
+
${l}
|
|
21
|
+
${a}
|
|
22
|
+
</body>
|
|
23
|
+
</html>`}function qe(t,s={}){let e=t.trim();if(!Tn(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let l=i[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,u;while((u=f.exec(l))!==null)r.push(u[0]);let p=l.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(p)r.push(p[0]);let h=l.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(h)r.push(h[0])}if(s.preserveHead&&i){let l=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,u;while((u=f.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(u[0]))continue;l.push(u[0])}if(l.length>0)r.unshift(`<!--${tt}${Buffer.from(l.join(`
|
|
24
|
+
`),"utf8").toString("base64")}-->`)}let o=e.match(/<body\b[^>]*>/i),c=e.lastIndexOf("</body>");if(o&&c!==-1){let l=o.index+o[0].length,f=e.slice(l,c).trim();if(r.length>0)return r.join(`
|
|
25
|
+
`)+`
|
|
26
|
+
`+f;return f}let a=e;if(a=a.replace(/<!DOCTYPE\b[^>]*>/i,""),a=a.replace(/<html\b[^>]*>/i,""),a=a.replace(/<\/html\s*>/i,""),i)a=a.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
|
|
27
|
+
`));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var H=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function V(t,s,e,r){if(!H.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let c=`data-stx-scope="${o}"`;for(let a=t.indexOf(c);a!==-1;a=t.indexOf(c,a+c.length))if(a>=e&&a<r)return!1;return!0}function ga(t){return Ee(t)}function rt(t,s){let e=[],r=new Set;for(let i of y(t,q)){if(i.start>=s.start&&i.start<s.end)continue;let o=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",c=new Map;for(let f of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))c.set(f[1].toLowerCase(),f[2]??f[3]??f[4]??"");let a=c.get("src")?.trim(),l=c.get("type")?.trim().toLowerCase();if(!a||c.has("server")||l&&!["module","text/javascript","application/javascript"].includes(l))continue;if(c.has("data-stx-runtime")||c.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(a))continue;if(V(t,i.token,s.start,s.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function Ke(t,s="main"){return!!P(t.trim(),s)}function Te(t,s="main",e=!1){let r=t.trim(),i=[],o=[],c=r.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(c){let x=c[1],w=/<style\b[^>]*>[\s\S]*?<\/style>/gi,g;while((g=w.exec(x))!==null)i.push(g[0]);let C=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((g=C.exec(x))!==null){if(H.test(g[0])||g[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(g[0]))continue;o.push(g[0])}}let a=P(r,s);if(!a)return(e?Nn(t)+Dn(t):"")+qe(t);let l=rt(r,a),f=new Set(l),{tagName:u,start:p,end:h}=a,S=r.slice(p,h).trim(),R=[],b=r.match(/<body\b[^>]*>/i),k=r.lastIndexOf("</body>");if(b&&b.index!==void 0&&k!==-1){let w=[[b.index+b[0].length,a.openIndex],[h+`</${u}>`.length,k]],g=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[C,I]of w){if(C>=I)continue;let z=r.slice(C,I),v;g.lastIndex=0;while((v=g.exec(z))!==null){if(V(r,v[0],p,h))continue;R.push(v[0])}}}let d=[];if(e)d.push(Nn(t)+Dn(t));if(i.length>0)d.push(i.join(`
|
|
28
|
+
`));if(l.length>0)d.push(l.join(`
|
|
29
|
+
`));if(o.length>0)d.push(o.filter((x)=>!f.has(x)).join(`
|
|
30
|
+
`));if(R.length>0)d.push(R.filter((x)=>!f.has(x)).join(`
|
|
31
|
+
`));return d.push(S),d.join(`
|
|
32
|
+
`)}import O from"fs";import B from"path";function ma(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function ha(t,s){let e=B.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function ya(t){let s=B.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function st(t){let s=t.headers.get("content-type")||"",e={},r=(i,o)=>{let c=e[i];if(c===void 0)e[i]=o;else if(Array.isArray(c))c.push(o);else e[i]=[c,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,c]of i.entries())if(typeof c==="string")r(o,c);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())r(i,o);return e}return e}function vo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function U(t,s={}){let e=s.request,r=s.method??e?.method;if(!e||!vo(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await st(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let c=o,a=it(c.cookies),l=c.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:f,redirect:u,...p}=c;if(Object.assign(t,p),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function it(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){s.push(M(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function ba(t,s=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)r.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,o);return new Response(null,{status:303,headers:r})}async function Mn(t,s={}){let{html:e,context:r,redirect:i,cookies:o}=await ot(t,s),c=Nt(r),a=Dt(r);if(i)return{html:e,redirect:i,cookies:o,status:c,headers:a};let{extractStreamBoundaries:l}=await import("./chunk-m7cbkrz6.js"),f=l(r),u=t.streamTemplates;if(u&&Object.keys(u).length>0){let{processDirectives:p}=await import("./chunk-zecffe6a.js"),{defaultConfig:h}=await import("./chunk-xsmyhp5f.js"),S=r.streamBoundaries||{},R={...h,autoShell:!1},b=Object.keys(u).map((d)=>({id:d,render:async()=>{let x=typeof S[d]==="function"?await S[d]():void 0;return p(u[d],{...r,$boundary:x},t.sourceFile,R,new Set)}})),k=new Set(b.map((d)=>d.id));f=[...(f||[]).filter((d)=>!k.has(d.id)),...b]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:o,status:c,headers:a}}async function ot(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!ki(t.html))return{html:t.html,context:e};for(let c of t.serverScriptContent)try{await m(c,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let r=await U(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(c)=>{let a=c.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=$r(e);if(!l)return a;let f=a.indexOf("</head>");return f<0?l+a:a.slice(0,f)+l+a.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!ki(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let o=new Map;for(let[c,a]of Object.entries(t.placeholders))if(a.expression)try{let l=A(a.expression,e);if(a.type==="raw")o.set(c,l!==void 0&&l!==null?String(l):"");else o.set(c,l!==void 0&&l!==null?W(String(l)):"")}catch(l){if(s.__stx_strict_hydration)throw l;o.set(c,"")}return{html:i(il(t.html,o)),context:e,cookies:r.cookies}}
|
|
33
|
+
export{gt,Gt,Ee,j,Nn,Dn,fa,wo,Jr,qe,ga,Ke,Te,ma,ha,ya,vo,ba,Mn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Qg}from"./chunk-b147ejha.js";import"./chunk-c7qej674.js";import"./chunk-8vkywnpx.js";import"./chunk-f2zgh4xr.js";import"./chunk-t5q31st4.js";import"./chunk-shnw9geh.js";import"./chunk-xa2qfe51.js";import"./chunk-88a7qaw8.js";import"./chunk-cww1zk8y.js";import"./chunk-63sqdcr6.js";import"./chunk-0zgxxhvs.js";import"./chunk-he9dzchk.js";import"./chunk-0ey7kc6t.js";import"./chunk-rtsshvpt.js";import"./chunk-xr9rf0e6.js";import"./chunk-jtccqpwa.js";import"./chunk-nws4zm4k.js";import"./chunk-09412heg.js";import"./chunk-t4dkcf28.js";import"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{Qg as startInteractive};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{zm,_a,hu,Hm,Vm,Um,Wm,qm,yu,bu,Km,Xm,Gm,Jm}from"./chunk-yqjmqndq.js";import"./chunk-c7qej674.js";import"./chunk-8vkywnpx.js";import"./chunk-f2zgh4xr.js";import"./chunk-t5q31st4.js";import"./chunk-shnw9geh.js";import"./chunk-xa2qfe51.js";import"./chunk-88a7qaw8.js";import"./chunk-cww1zk8y.js";import"./chunk-63sqdcr6.js";import"./chunk-0zgxxhvs.js";import"./chunk-he9dzchk.js";import"./chunk-0ey7kc6t.js";import"./chunk-rtsshvpt.js";import"./chunk-xr9rf0e6.js";import"./chunk-jtccqpwa.js";import"./chunk-nws4zm4k.js";import"./chunk-09412heg.js";import"./chunk-t4dkcf28.js";import"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{hu as SUSPENSE_RESOLVER_RUNTIME,_a as buildSuspenseResolveScript,qm as createStreamRenderer,Um as extractStreamBoundaries,Jm as generateHydrationRuntime,bu as islandDirective,Xm as processSectionDirectives,Vm as processStreamDirectives,Km as registerStreamingDirectives,Hm as renderStreamingPage,zm as streamTemplate,Wm as streamTemplateSimple,Gm as streamToResponse,yu as streamingSuspenseDirective};
|
|
@@ -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 Ut(){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
|
|
3
|
-
export{Ut,
|
|
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 Ut(){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 io(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 Wt(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 Gi(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function lt(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Ji(e){console.log(` ${O("\u2139")} ${e}`)}function Yi(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 ao(){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 qt(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 Zi(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 Kt(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{Ut,io,Wt,Gi,lt,Ji,Yi,ao,qt,Zi,Kt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{cn,No,Do,Mo,Ih,Lo}from"./chunk-54p27ney.js";import"./chunk-nws4zm4k.js";import"./chunk-t4dkcf28.js";import"./chunk-46t924aw.js";export{Do as buildServerApi,Ih as createServerApi,cn as discoverServerApi,No as generateApiTypes,Lo as isServerApiSource,Mo as productionApiDispatcher};
|