@stacksjs/stx 0.2.421 → 0.2.423
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-ep5jnqdb.js → chunk-02n071n7.js} +6 -6
- package/dist/chunk-03n23sh6.js +2 -0
- package/dist/chunk-07mxghsz.js +2 -0
- package/dist/{chunk-kjkwycce.js → chunk-0bmc75w6.js} +4 -4
- package/dist/{chunk-hyak4dzg.js → chunk-0hhq9hbq.js} +3 -3
- package/dist/{chunk-66k7yxnr.js → chunk-12pvnn1e.js} +4 -4
- package/dist/chunk-1497wcxc.js +2 -0
- package/dist/chunk-17n9e5wk.js +2 -0
- package/dist/chunk-1p8hc1ve.js +2 -0
- package/dist/chunk-1r3ghgsz.js +2 -0
- package/dist/{chunk-r8wze9ym.js → chunk-24e7qjb8.js} +2 -2
- package/dist/chunk-259ecbwa.js +2 -0
- package/dist/chunk-26gfsa9w.js +2 -0
- package/dist/{chunk-3ynkg5dz.js → chunk-2bpjq1qz.js} +2 -2
- package/dist/{chunk-11ra3sbc.js → chunk-2x9jd5w0.js} +3 -3
- package/dist/{chunk-k31fwm2w.js → chunk-3hmy75tw.js} +5 -5
- package/dist/{chunk-12b8akfg.js → chunk-3pxp0r0a.js} +3 -3
- package/dist/{chunk-x5ks23vx.js → chunk-3ry9ca1s.js} +2 -2
- package/dist/{chunk-th9s15es.js → chunk-45rfv3a5.js} +2 -2
- package/dist/chunk-47apfsxp.js +2 -0
- package/dist/{chunk-ax58cds3.js → chunk-48kgnqpk.js} +4 -4
- package/dist/{chunk-rsxvbnp4.js → chunk-4hd5wb8x.js} +3 -3
- package/dist/chunk-535nrr6j.js +2 -0
- package/dist/chunk-5mfhk69g.js +2 -0
- package/dist/{chunk-aync8qmk.js → chunk-5vwg3h5g.js} +2 -2
- package/dist/{chunk-tspmynvh.js → chunk-62chbqev.js} +1 -1
- package/dist/chunk-6c7294j8.js +2 -0
- package/dist/{chunk-z0ck9t6j.js → chunk-6cbvx87h.js} +5 -5
- package/dist/{chunk-kea18wnc.js → chunk-6fsbny9m.js} +3 -3
- package/dist/chunk-6gh2rvyz.js +2 -0
- package/dist/chunk-6j6gbp0y.js +2 -0
- package/dist/chunk-6jgjmycb.js +2 -0
- package/dist/{chunk-hjp990p8.js → chunk-6t278w29.js} +2 -2
- package/dist/{chunk-5vfyxxrp.js → chunk-6t7mxb0b.js} +2 -2
- package/dist/chunk-6wmxrn6x.js +2 -0
- package/dist/chunk-6wweqfg7.js +2 -0
- package/dist/{chunk-h1h6xe1k.js → chunk-7a9h7ycs.js} +5 -5
- package/dist/chunk-7pbv9mg7.js +2 -0
- package/dist/{chunk-09hhrjk9.js → chunk-89b2r1q0.js} +6 -6
- package/dist/{chunk-0varh725.js → chunk-8a0r2j8f.js} +3 -3
- package/dist/{chunk-pzngjk81.js → chunk-8nsbf2mz.js} +1074 -1074
- package/dist/{chunk-mg13q1kd.js → chunk-8zf5q1m3.js} +2 -2
- package/dist/chunk-9d53d0t6.js +2 -0
- package/dist/chunk-9j72har9.js +2 -0
- package/dist/chunk-9yqz5ge5.js +2 -0
- package/dist/chunk-a5c9n7an.js +2 -0
- package/dist/chunk-a836zn7c.js +2 -0
- package/dist/{chunk-8vq0qjq9.js → chunk-a8g6y9kw.js} +5 -5
- package/dist/{chunk-21a7p956.js → chunk-acwgap78.js} +1 -1
- package/dist/{chunk-qx3js9tk.js → chunk-aen2baze.js} +1 -1
- package/dist/chunk-ahgrkva8.js +2 -0
- package/dist/chunk-akbb6j7s.js +2 -0
- package/dist/chunk-avakcrbs.js +2 -0
- package/dist/{chunk-tafebmtg.js → chunk-axydabse.js} +2 -2
- package/dist/{chunk-4n6c5rp5.js → chunk-b7973zvk.js} +2 -2
- package/dist/{chunk-debz86rr.js → chunk-bxwe7wxj.js} +10 -10
- package/dist/{chunk-2ewa2sg5.js → chunk-c1dmr865.js} +3 -3
- package/dist/chunk-cenq2n6e.js +2 -0
- package/dist/{chunk-zvh2nnzr.js → chunk-cf6htz63.js} +1 -1
- package/dist/chunk-cnmz9543.js +2 -0
- package/dist/{chunk-bh4x090w.js → chunk-cx2rdew4.js} +13 -13
- package/dist/{chunk-wg1ttvs5.js → chunk-cznsm2n3.js} +2 -2
- package/dist/chunk-d1qzhawc.js +2 -0
- package/dist/chunk-d6hnvwre.js +2 -0
- package/dist/{chunk-014gmm8w.js → chunk-dcwjxq8n.js} +2 -2
- package/dist/chunk-dhqwg62x.js +2 -0
- package/dist/{chunk-z521cyfv.js → chunk-dmd6yk2x.js} +5 -5
- package/dist/chunk-e18qfegt.js +2 -0
- package/dist/chunk-eej89wkt.js +2 -0
- package/dist/chunk-ekxffxbd.js +2 -0
- package/dist/{chunk-hy9e3ny6.js → chunk-ex0tq6x2.js} +1 -1
- package/dist/{chunk-8drvzsk1.js → chunk-fg5ve6ey.js} +2 -2
- package/dist/{chunk-3kmhv1kf.js → chunk-fnt1q1sp.js} +11 -11
- package/dist/chunk-g67gg66e.js +2 -0
- package/dist/chunk-gq16fxc2.js +2 -0
- package/dist/{chunk-4e101kjp.js → chunk-h3c7z73m.js} +2 -2
- package/dist/chunk-h4avjh3q.js +2 -0
- package/dist/chunk-h7qte7ye.js +2 -0
- package/dist/{chunk-4mew0ae3.js → chunk-hb9gxad0.js} +3 -3
- package/dist/{chunk-0y7x0hvr.js → chunk-hg4k3nkr.js} +1 -1
- package/dist/{chunk-dhxbjw6k.js → chunk-hnep9jbj.js} +2 -2
- package/dist/chunk-hwycbxg7.js +2 -0
- package/dist/{chunk-34gy5zjm.js → chunk-j1q65enz.js} +2 -2
- package/dist/chunk-j5myfxe8.js +18 -0
- package/dist/{chunk-8jqy69td.js → chunk-j7zywbq0.js} +2 -2
- package/dist/{chunk-32y3767j.js → chunk-jbrdebzs.js} +7 -7
- package/dist/{chunk-1336h4sv.js → chunk-jj4pyeyj.js} +1 -1
- package/dist/{chunk-g1fxmp9z.js → chunk-k8sqs7j2.js} +4 -4
- package/dist/chunk-mg7jhx5v.js +2 -0
- package/dist/chunk-n16wa755.js +2 -0
- package/dist/chunk-ngv1c807.js +2 -0
- package/dist/{chunk-krr2vb0s.js → chunk-p2x7tjbt.js} +3 -3
- package/dist/{chunk-62r4fa4q.js → chunk-ptjqacjd.js} +2 -2
- package/dist/{chunk-rj3hyqff.js → chunk-qm1tt8g1.js} +2334 -2334
- package/dist/chunk-r7r5h2eh.js +2 -0
- package/dist/chunk-rhkx17d9.js +2 -0
- package/dist/{chunk-b1fg9vg7.js → chunk-s28eh0jn.js} +2 -2
- package/dist/{chunk-10967rws.js → chunk-s295vp9x.js} +3 -3
- package/dist/chunk-sazpw71r.js +4 -0
- package/dist/{chunk-20tdz0zs.js → chunk-sbdzqqr1.js} +6 -6
- package/dist/{chunk-qby6wxat.js → chunk-spx27cs4.js} +2 -2
- package/dist/{chunk-m16h8ea0.js → chunk-stxmwytg.js} +2 -2
- package/dist/{chunk-2tfe2g58.js → chunk-t3wh1jbk.js} +6 -6
- package/dist/{chunk-802pr252.js → chunk-tfexmdkt.js} +2 -2
- package/dist/{chunk-6aqcgrhw.js → chunk-tfz95n7j.js} +5 -5
- package/dist/chunk-thdbqsxq.js +2 -0
- package/dist/chunk-tpnfcb83.js +2 -0
- package/dist/chunk-tqkv4th9.js +2 -0
- package/dist/chunk-tznejj9h.js +2 -0
- package/dist/{chunk-ap6fehea.js → chunk-vfk725vm.js} +5 -5
- package/dist/chunk-vsrm9k7p.js +2 -0
- package/dist/chunk-vwms759h.js +2 -0
- package/dist/{chunk-xvzxrt9a.js → chunk-w2085fwx.js} +5 -5
- package/dist/chunk-w252cgnv.js +30 -0
- package/dist/chunk-whdw6dhb.js +2 -0
- package/dist/chunk-wtms9jhs.js +3 -0
- package/dist/chunk-wtqjfar3.js +2 -0
- package/dist/chunk-wx7kfet5.js +2 -0
- package/dist/chunk-wy873fy8.js +2 -0
- package/dist/{chunk-a4r19yxm.js → chunk-xa3wsmt5.js} +11 -11
- package/dist/chunk-xrbqf77j.js +2 -0
- package/dist/{chunk-757ec865.js → chunk-yaebdyfr.js} +2 -2
- package/dist/chunk-ycpq3gxc.js +2 -0
- package/dist/chunk-yd50awqp.js +3 -0
- package/dist/{chunk-csjw5esc.js → chunk-ydz7w2mt.js} +2 -2
- package/dist/chunk-yjgbxf26.js +2 -0
- package/dist/{chunk-jjnfj9nf.js → chunk-yqsza22w.js} +2 -2
- package/dist/{chunk-8j8k27xb.js → chunk-zbr333kf.js} +115 -31
- package/dist/chunk-zcyjdcpx.js +33 -0
- package/dist/{chunk-tqnysw0k.js → chunk-zfzcedw4.js} +4 -4
- package/dist/chunk-zm73n103.js +2 -0
- package/dist/cli.js +21 -21
- package/dist/component-renderer.js +54 -2
- package/dist/composables/use-outbox.d.ts +1 -0
- package/dist/composables/use-outbox.js +14 -4
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/database.js +2 -2
- package/dist/native/bridge/protocol.d.ts +5 -0
- package/dist/native/bridge/protocol.js +3 -0
- package/dist/native/cli.js +12 -2
- package/dist/native/compiler/bundle.d.ts +4 -3
- package/dist/native/compiler/bundle.js +46 -51
- package/dist/native/compiler/component-mapping.d.ts +5 -0
- package/dist/native/compiler/component-mapping.js +90 -0
- package/dist/native/compiler/html-to-ir.js +42 -6
- package/dist/native/compiler/ir.d.ts +2 -0
- package/dist/native/compiler/render-screen.d.ts +4 -0
- package/dist/native/compiler/render-screen.js +10 -2
- package/dist/native/compiler/setup-script.d.ts +6 -0
- package/dist/native/compiler/setup-script.js +10 -0
- package/dist/native/components/primitives.d.ts +10 -0
- package/dist/native/index.d.ts +6 -24
- package/dist/native/index.js +1 -17
- package/dist/native/primitives/Button.stx +2 -1
- package/dist/native/primitives/Text.stx +2 -1
- package/dist/native/primitives/TextInput.stx +3 -1
- package/dist/native/prop-names.d.ts +2 -0
- package/dist/native/prop-names.js +71 -0
- package/dist/native/runtime/binding-tree.d.ts +31 -0
- package/dist/native/runtime/binding-tree.js +100 -0
- package/dist/native/runtime/craft-bridge.d.ts +9 -0
- package/dist/native/runtime/craft-bridge.js +231 -0
- package/dist/native/runtime/craft.d.ts +28 -3
- package/dist/native/runtime/jsc-globals.d.ts +16 -0
- package/dist/native/runtime/jsc-globals.js +64 -0
- package/dist/native/runtime/native-host.d.ts +3 -1
- package/dist/native/runtime/native-host.js +183 -33
- package/dist/native/runtime/shared-screen.d.ts +15 -0
- package/dist/native/runtime/shared-screen.js +41 -0
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.d.ts +3 -1
- package/dist/signal-processing.js +4 -3
- package/dist/signals.js +104 -20
- package/dist/ssg.js +28 -28
- package/dist/variable-extractor.js +4 -1
- package/package.json +5 -5
- package/dist/chunk-0n76c3g8.js +0 -2
- package/dist/chunk-10fh9qhe.js +0 -2
- package/dist/chunk-18awnp9d.js +0 -2
- package/dist/chunk-2hswgxpb.js +0 -2
- package/dist/chunk-3zye6eh1.js +0 -2
- package/dist/chunk-4488r5j1.js +0 -2
- package/dist/chunk-4amznxaq.js +0 -2
- package/dist/chunk-5akd7qsb.js +0 -2
- package/dist/chunk-5eqd40k0.js +0 -2
- package/dist/chunk-6r9y4p81.js +0 -2
- package/dist/chunk-75zcwcrt.js +0 -2
- package/dist/chunk-89e1d0rz.js +0 -4
- package/dist/chunk-8nsqac4z.js +0 -2
- package/dist/chunk-8ttvazck.js +0 -2
- package/dist/chunk-8y4bqsxz.js +0 -2
- package/dist/chunk-ac033b93.js +0 -2
- package/dist/chunk-aj43359g.js +0 -2
- package/dist/chunk-aj8yq228.js +0 -2
- package/dist/chunk-as72dvvm.js +0 -2
- package/dist/chunk-awtrcb5m.js +0 -18
- package/dist/chunk-b01jqb5f.js +0 -2
- package/dist/chunk-b7z2yegr.js +0 -2
- package/dist/chunk-bfvaxrq0.js +0 -2
- package/dist/chunk-bkaw7sgz.js +0 -2
- package/dist/chunk-bmk0s261.js +0 -2
- package/dist/chunk-bvbank3z.js +0 -2
- package/dist/chunk-cvzkbsds.js +0 -2
- package/dist/chunk-cw6j75ck.js +0 -30
- package/dist/chunk-d2c5727w.js +0 -2
- package/dist/chunk-d5amzers.js +0 -2
- package/dist/chunk-dfchrqw5.js +0 -2
- package/dist/chunk-dscsvkfa.js +0 -2
- package/dist/chunk-eav0pt6d.js +0 -2
- package/dist/chunk-hahzjyxc.js +0 -2
- package/dist/chunk-hgqcqg1h.js +0 -2
- package/dist/chunk-hjdwf9gp.js +0 -2
- package/dist/chunk-jjm0ekw8.js +0 -2
- package/dist/chunk-jjtzm6dn.js +0 -3
- package/dist/chunk-k1am0dyg.js +0 -2
- package/dist/chunk-m2jphkdv.js +0 -2
- package/dist/chunk-mk7b3qdz.js +0 -2
- package/dist/chunk-ncvfjcr2.js +0 -2
- package/dist/chunk-p083sckk.js +0 -2
- package/dist/chunk-p7b17yr0.js +0 -2
- package/dist/chunk-pc178389.js +0 -2
- package/dist/chunk-q1v0jwr4.js +0 -2
- package/dist/chunk-r5gjb55x.js +0 -2
- package/dist/chunk-rj8rdd8n.js +0 -2
- package/dist/chunk-s0pmn48x.js +0 -2
- package/dist/chunk-s58yz9q0.js +0 -2
- package/dist/chunk-srdzwtsq.js +0 -2
- package/dist/chunk-tf44jyrh.js +0 -2
- package/dist/chunk-tfypkw4y.js +0 -3
- package/dist/chunk-vwxasbtx.js +0 -2
- package/dist/chunk-wynvh7dc.js +0 -2
- package/dist/chunk-x8rckpyz.js +0 -2
- package/dist/chunk-y4xs4m7p.js +0 -2
- package/dist/chunk-y8rpk1b9.js +0 -2
- package/dist/chunk-y9m93qkk.js +0 -2
- package/dist/chunk-ya0qecph.js +0 -27
- package/dist/chunk-ya9c8nec.js +0 -2
- package/dist/chunk-yvq1f313.js +0 -2
- package/dist/chunk-yy3dgwfm.js +0 -2
- package/dist/chunk-zpcz2kh6.js +0 -2
- package/dist/native/compiler/codegen.d.ts +0 -10
- package/dist/native/compiler/codegen.js +0 -145
- package/dist/native/compiler/parser.d.ts +0 -88
- package/dist/native/compiler/parser.js +0 -753
- package/dist/native/runtime/entry.d.ts +0 -1
- package/dist/native/runtime/entry.js +0 -3
- package/dist/native/runtime/index.d.ts +0 -45
- package/dist/native/runtime/index.js +0 -165
- package/dist/native/runtime/screen.d.ts +0 -43
- package/dist/native/runtime/screen.js +0 -808
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h,d,
|
|
2
|
+
import{h,d,n,g,A}from"./chunk-qm1tt8g1.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,s;M.lastIndex=0;while((s=M.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Jl(e,t={},o={}){let s={...A,...o,streaming:{...q,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(m.trim())await d(m,y,e);let E=H(c),u=new Set;if(!E.some((w)=>w.type==="suspense")){let w=s.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let p=await n(c,y,e,s,u);for(let b=0;b<p.length;b+=r)i.enqueue(p.slice(b,b+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await n(I,y,e,s,u);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await n(_.content,y,e,s,u);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,u);i.enqueue(C)}}}}else{let w=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
|
-
</div>`),w.set(l.name,
|
|
4
|
+
</div>`),w.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
|
|
5
5
|
<script>
|
|
6
6
|
(function() {
|
|
7
7
|
window.__stxSuspense = window.__stxSuspense || {
|
|
@@ -17,13 +17,13 @@ import{h,d,r,g,A}from"./chunk-rj3hyqff.js";import k from"path";var q={enabled:!0
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
})();
|
|
20
|
-
</script>`);let x=Array.from(w.entries()).map(async([l,p])=>{i.enqueue(await
|
|
20
|
+
</script>`);let x=Array.from(w.entries()).map(async([l,p])=>{i.enqueue(await fi(l,p))});await Promise.all(x)}i.close()}catch(a){i.error(a)}}})}async function fi(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
|
|
21
21
|
<script>
|
|
22
|
-
window.__stxSuspense.resolve('${e}', \`${
|
|
23
|
-
</script>`}catch(o){let
|
|
22
|
+
window.__stxSuspense.resolve('${e}', \`${s}\`);
|
|
23
|
+
</script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
|
|
24
24
|
<script>
|
|
25
|
-
window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${h(
|
|
26
|
-
</script>`}}var
|
|
25
|
+
window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${h(s)}</div>');
|
|
26
|
+
</script>`}}var $a=`
|
|
27
27
|
<script>
|
|
28
28
|
(function(){
|
|
29
29
|
window.__stxSuspense = window.__stxSuspense || {
|
|
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
})();
|
|
46
|
-
</script>`;function z(e,t,o){if(!t||t<=0)return e;let
|
|
46
|
+
</script>`;function z(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function Yl(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue($a),await Promise.all(t.map(async(i)=>{let a=z(i.render(),s,i.id);r.enqueue(await fi(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Zl(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),S=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=S,`<div data-suspense="${i}">${m}</div>`})}function Ql(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function eu(e,t={},o={}){let s={...A,...o,streaming:{...q,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(m.trim())await d(m,y,e);let E=new Set,u=s.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let x=await n(c,y,e,s,E);for(let l=0;l<x.length;l+=r)i.enqueue(x.slice(l,l+r))}else{let x=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)x.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let b=0;for(let f of x){if(f.start>b){let _=c.slice(b,f.start);if(_.trim()){let C=await n(_,y,e,s,E);i.enqueue(C)}}let v=await n(f.content,y,e,s,E);i.enqueue(v),b=f.end}if(b<c.length){let f=c.slice(b);if(f.trim()){let v=await n(f,y,e,s,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function tu(e,t={}){let o={...A,...t,streaming:{...q,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,m={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];m[u]=R}let y=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:k.dirname(e)};return await d(i,R,e),n(y,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!m[u])return`<div class="error-message">Section "${h(u)}" not found in template "${h(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await d(i,w,e);let x=new Set;return await n(m[u],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return g("Expression",x,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>S}}var Ea={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Ta={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
|
|
47
47
|
${c}
|
|
48
48
|
<script type="application/json" data-island-props="${a}">
|
|
49
49
|
${m?`{${m}}`:"{}"}
|
|
50
50
|
</script>
|
|
51
|
-
</div>`}};function
|
|
51
|
+
</div>`}};function nu(e={}){let t=[];if(e.streaming?.enabled)t.push(Ea);if(e.hydration?.enabled)t.push(Ta);return t}async function ru(e,t,o,s={}){return e}function su(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function iu(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
|
|
52
52
|
`);if(t==="loader")return`
|
|
53
53
|
(function() {
|
|
54
54
|
window.__stx = window.__stx || {};
|
|
@@ -64,7 +64,7 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
|
|
|
64
64
|
const stx = {
|
|
65
65
|
// Component registry
|
|
66
66
|
components: {
|
|
67
|
-
${
|
|
67
|
+
${r}
|
|
68
68
|
},
|
|
69
69
|
|
|
70
70
|
// Loaded island instances
|
|
@@ -191,4 +191,4 @@ else {
|
|
|
191
191
|
stx.hydrate();
|
|
192
192
|
}
|
|
193
193
|
})();`}
|
|
194
|
-
export{
|
|
194
|
+
export{Jl,fi,$a,Yl,Zl,Ql,eu,tu,Ea,Ta,nu,ru,su,iu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Jl,fi,$a,Yl,Zl,Ql,eu,tu,Ea,Ta,nu,ru,su,iu}from"./chunk-xa3wsmt5.js";import"./chunk-qm1tt8g1.js";import"./chunk-2x9jd5w0.js";import"./chunk-3ry9ca1s.js";import"./chunk-k8sqs7j2.js";import"./chunk-h3c7z73m.js";import"./chunk-ptjqacjd.js";import"./chunk-jbrdebzs.js";import"./chunk-48kgnqpk.js";import"./chunk-89b2r1q0.js";import"./chunk-axydabse.js";import"./chunk-yaebdyfr.js";import"./chunk-12pvnn1e.js";import"./chunk-b7973zvk.js";export{$a as SUSPENSE_RESOLVER_RUNTIME,fi as buildSuspenseResolveScript,tu as createStreamRenderer,Ql as extractStreamBoundaries,iu as generateHydrationRuntime,Ta as islandDirective,ru as processSectionDirectives,Zl as processStreamDirectives,nu as registerStreamingDirectives,Yl as renderStreamingPage,Jl as streamTemplate,eu as streamTemplateSimple,su as streamToResponse,Ea as streamingSuspenseDirective};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import u from"fs";import l from"path";var g=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,x=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],h=3;function y(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function
|
|
3
|
-
export{
|
|
2
|
+
import u from"fs";import l from"path";var g=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,x=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],h=3;function y(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function fn(e,t,r=0,o=new Set){if(!t||r>=h)return!1;for(let s of e.matchAll(x)){let n=y(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=u.readFileSync(n,"utf8")}catch{continue}if(g.test(i))return!0;if(fn(i,n,r+1,o))return!0}return!1}var m=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],vo=["onMount","onDestroy"];function _t(e="const",t=[],r){let o=t.length?m.filter((s)=>!t.includes(s)):m;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=m.filter((e)=>!E.includes(e));function Rs(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function wo(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Rs(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(fn(r[1],t))return!0;return!1}function xo(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function So(e){return _.includes(e.toLowerCase())}var rr=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],ko=[...rr,...w];function Co(){return`{${rr.map((e)=>`'${e}':1`).join(",")}}`}var As=["class","style","text","html","show","model","if","ref"];function $o(){return`{${As.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Eo(){return`/^(${p.join("|")})/`}function To(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{fn,m,vo,_t,Rs,wo,xo,So,rr,ko,Co,As,$o,Eo,To};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Io,Do}from"./chunk-8nsbf2mz.js";import"./chunk-a8g6y9kw.js";import"./chunk-7a9h7ycs.js";import"./chunk-bxwe7wxj.js";import"./chunk-5vwg3h5g.js";import"./chunk-cx2rdew4.js";import"./chunk-sazpw71r.js";import"./chunk-spx27cs4.js";import"./chunk-stxmwytg.js";import"./chunk-2bpjq1qz.js";import"./chunk-dcwjxq8n.js";import{Qs}from"./chunk-w252cgnv.js";import"./chunk-aen2baze.js";import"./chunk-24e7qjb8.js";import"./chunk-6t278w29.js";import"./chunk-ex0tq6x2.js";import"./chunk-4hd5wb8x.js";import"./chunk-02n071n7.js";import"./chunk-t3wh1jbk.js";import"./chunk-s295vp9x.js";import"./chunk-s28eh0jn.js";import"./chunk-6fsbny9m.js";import"./chunk-j1q65enz.js";import"./chunk-8a0r2j8f.js";import"./chunk-vfk725vm.js";import"./chunk-w2085fwx.js";import"./chunk-zfzcedw4.js";import"./chunk-3hmy75tw.js";import"./chunk-hb9gxad0.js";import"./chunk-zbr333kf.js";import"./chunk-xa3wsmt5.js";import"./chunk-j5myfxe8.js";import"./chunk-c1dmr865.js";import"./chunk-tfz95n7j.js";import"./chunk-6cbvx87h.js";import{me,Zt,Qt,q,d,n,Wn,A,i,ce}from"./chunk-qm1tt8g1.js";import"./chunk-2x9jd5w0.js";import"./chunk-3ry9ca1s.js";import"./chunk-k8sqs7j2.js";import"./chunk-h3c7z73m.js";import"./chunk-ptjqacjd.js";import"./chunk-jbrdebzs.js";import"./chunk-48kgnqpk.js";import"./chunk-89b2r1q0.js";import"./chunk-axydabse.js";import"./chunk-yaebdyfr.js";import"./chunk-12pvnn1e.js";import"./chunk-b7973zvk.js";export{Wn as buildWebComponents,Qt as cacheTemplate,Zt as checkCache,Qs as classifyAllScripts,Io as createMiddleware,Do as createRoute,A as defaultConfig,d as extractVariables,q as injectRouterScript,i as loadStxConfig,me as processClientScript,n as processDirectives,ce as readMarkdownFile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ie,
|
|
2
|
+
import{ie,pt}from"./chunk-p2x7tjbt.js";import{fe}from"./chunk-yqsza22w.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -17,7 +17,7 @@ registerRoute(
|
|
|
17
17
|
],`:""}
|
|
18
18
|
})
|
|
19
19
|
);`)}return c.join(`
|
|
20
|
-
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?ie(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?ie(t,e):null,l=s?
|
|
20
|
+
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?ie(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?ie(t,e):null,l=s?pt(s):"[]",o=k(n.modules),u=d(e);return`/**
|
|
21
21
|
* Service Worker - Generated by stx with Workbox
|
|
22
22
|
* Cache Version: ${n.cacheVersion}
|
|
23
23
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function fe(){let{NODE_ENV:o}=process.env;return o==="production"}function D(){let{STX_DEBUG:o}=process.env;return!fe()||o==="true"}function
|
|
3
|
-
export{fe,D,
|
|
2
|
+
function fe(){let{NODE_ENV:o}=process.env;return o==="production"}function D(){let{STX_DEBUG:o}=process.env;return!fe()||o==="true"}function pn(){let{NODE_ENV:o}=process.env;return o==="test"}
|
|
3
|
+
export{fe,D,pn};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Co,$o,Eo}from"./chunk-yaebdyfr.js";import{z,En,Wt,Dr,Or,Tn,qt,Kt,Mr,_n}from"./chunk-fg5ve6ey.js";function W(r,d=!0,u){if(!d||!r||typeof window>"u")return;let o=window;if(!o.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let f=JSON.parse(y?.textContent||"{}");o.__STX_DATA__=f&&typeof f==="object"&&!Array.isArray(f)?f:{}}catch{o.__STX_DATA__={}}}let i=o.__STX_DATA__;if(i&&Object.prototype.hasOwnProperty.call(i,r))try{return{data:u?u(i[r]):i[r]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function X(r){if(typeof window>"u")return;let d=window;if(r===void 0)d.__STX_DATA__={};else{if(!d.__STX_DATA__)try{let u=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");d.__STX_DATA__=u&&typeof u==="object"&&!Array.isArray(u)?u:{}}catch{d.__STX_DATA__={}}if(d.__STX_DATA__)delete d.__STX_DATA__[r]}}function Q(r){let d=null;try{d=typeof indexedDB<"u"?indexedDB:null}catch{d=null}if(!d)return null;let u=d,o=r||"stx-kept",i=null,y=()=>{if(!i)i=new Promise((h,l)=>{let a=u.open(o,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>h(a.result),a.onerror=()=>l(a.error),a.onblocked=()=>l(Error("blocked"))}),i.catch(()=>{i=null});return i},f=(h,l)=>y().then((a)=>new Promise((v,g)=>{let t=a.transaction("kv",h),s=l(t.objectStore("kv"));t.oncomplete=()=>v(s?s.result:void 0),t.onerror=()=>g(t.error),t.onabort=()=>g(t.error)}));return{get:(h)=>f("readonly",(l)=>l.get(h)),set:(h,l)=>f("readwrite",(a)=>{a.put(l,h)}),remove:(h)=>f("readwrite",(l)=>{l.delete(h)}),removePrefix:(h)=>f("readwrite",(l)=>{l.delete(IDBKeyRange.bound(h,`${h}\uFFFF`))})}}function G(r,d){let u=r||{},o=null;if(u.storage!==void 0)o=u.storage;else try{o=typeof localStorage<"u"?localStorage:null}catch{o=null}let i=null,y=u.backend!==void 0;if(y)i=u.backend||null;let f=()=>{if(y)return i;y=!0;try{i=d?d():null}catch{i=null}if(i){let e=i;e.get("__stx_probe__").catch(()=>{if(i===e)i=null})}return i},h=u.limit||32768,l=u.defer||((e)=>{let n=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(n)n(e,{timeout:200});else setTimeout(e,16)}),a=new Map,v=new Set,g=new Map,t=!1,s=Promise.resolve(),m=(e)=>{try{return JSON.parse(e)}catch{return e}},p=(e,n)=>{if(!o)return!1;try{return o.setItem(e,n),!0}catch{return!1}},T=(e)=>{try{if(o)o.removeItem(e)}catch{}},S=()=>{if(t=!1,!g.size)return s;let e=Array.from(g.entries());return g.clear(),s=s.then(()=>Promise.all(e.map(([n,c])=>{if(!i){v.delete(n);try{p(n,JSON.stringify(c===void 0?null:c))}catch{}return}let _;try{return _={v:c},i.set(n,_).catch(()=>{let w;try{w=JSON.stringify(c)}catch{return}return i?i.set(n,{j:w}).catch(()=>{p(n,w)}):void 0})}catch{return}}))).then(()=>{}),s},R=(e,n)=>{if(g.set(e,n),v.add(e),t)return;t=!0,l(()=>{S()})},O=(e)=>{if(!e||typeof e!=="object")return;let n=e;if("v"in n)return{value:n.v};if(typeof n.j==="string")return{value:m(n.j)};return},E={peek(e){if(a.has(e))return{value:a.get(e)};let n=null;try{n=o?o.getItem(e):null}catch{n=null}if(n===null||n===void 0)return;let c=m(n);return a.set(e,c),{value:c}},load(e){let n=E.peek(e),c=n?null:f();if(n||!c)return Promise.resolve(n);return c.get(e).then((_)=>{if(a.has(e))return{value:a.get(e)};let w=O(_);if(w)a.set(e,w.value),v.add(e);return w},()=>{return})},set(e,n){if(a.set(e,n),i&&v.has(e)){R(e,n);return}let c;try{c=JSON.stringify(n===void 0?null:n)}catch{return}if(c.length<=h&&p(e,c))return;if(!f()){if(c.length>h)p(e,c);return}T(e),R(e,n)},forget(e){for(let c of Array.from(a.keys()))if(c.indexOf(e)===0)a.delete(c);for(let c of Array.from(g.keys()))if(c.indexOf(e)===0)g.delete(c);for(let c of Array.from(v))if(c.indexOf(e)===0)v.delete(c);try{if(o)for(let c=o.length-1;c>=0;c--){let _=o.key(c);if(_&&_.indexOf(e)===0)o.removeItem(_)}}catch{}let n=f();if(!n)return s;return s=s.then(()=>n.removePrefix(e)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return E}function J(r,d){if(!r)return!1;if(r===d.key)return!0;if(!d.url)return!1;if(r===d.url)return!0;try{let u=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",o=new URL(r,u),i=new URL(d.url,u);if(o.origin!==i.origin||o.pathname!==i.pathname)return!1;return!o.search||o.search===i.search}catch{return!1}}function Y(r){let d=r.prefix||"stx:kept:",u=r.matches||((t,s)=>t===s.key||t===s.url),o=new Set,i=new Map,y,f=(t)=>t===void 0?y:t,h=(t,s)=>{let m=f(s);if(m===!1||m===null||m==="")return null;return`${d}${m===void 0?"":`${m}:`}query:${t}`},l=(t)=>{let s=t&&t.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},v={setScope(t){y=t},scope:()=>y,keyFor:h,seed(t,s){let m=h(t,s);return m?l(r.kept.peek(m)):void 0},restore(t,s){let m=h(t,s);return m?r.kept.load(m).then(l):Promise.resolve(void 0)},persist(t,s,m){let p=h(t,m);if(p)r.kept.set(p,{d:s,at:Date.now()})},overlay(t,s,m){let p=a();if(!p||!p.size)return s;let T=s;return p.forEach((S)=>{try{T=S.overlay(t,T,m)}catch{}}),T},watch(t){return o.add(t),()=>{o.delete(t)}},cachedQuery(t,s){let m=i.get(t);if(m){if(s&&m.__options)m.__options(s);return m}let p=s||{},T=p.initial===void 0?null:p.initial,S=()=>typeof p.scope==="function"?p.scope():p.scope,R=()=>(typeof p.url==="function"?p.url():p.url)||null,O=()=>({key:t,url:R()}),E=S(),e=T,n=0,c=null,_=v.seed(t,E);if(_)e=_.data;let w=r.state(v.overlay(O(),e)),H=r.state(!1),V=r.state(!1),q=r.state(null),I=r.state(_?_.at:0),N=0,M=()=>{w.set(v.overlay(O(),e))},K=(b)=>{let x=N;v.restore(t,b).then((C)=>{if(!C||x!==N||n)return;e=C.data,I.set(C.at),M()})};if(!_)K(E);let ee=()=>{let b=S();if(b===E)return;E=b,N++,c=null,n=0;let x=v.seed(t,E);if(e=x?x.data:T,I.set(x?x.at:0),M(),!x)K(E)},te=(b)=>{let x=R(),C=p.timeoutMs||15000,A=typeof AbortController<"u"?new AbortController:null,k=null,ne=new Promise((D,L)=>{k=setTimeout(()=>{if(A)A.abort();L(Error("The request took too long."))},C)}),U;if(p.load)U=p.load({force:b,url:x,signal:A?A.signal:void 0});else if(x){let D=p.fetch||((P,F)=>fetch(P,F)),L={method:"GET",headers:{Accept:"application/json"}};if(b)L.cache="no-cache";if(A)L.signal=A.signal;U=D(x,L).then((P)=>{if(!P.ok)return P.json().catch(()=>null).then((F)=>{throw Error(F&&(F.error||F.message)||`Request failed (${P.status})`)});return P.json()})}else return Promise.resolve(w());return Promise.race([U,ne]).then((D)=>{if(k)clearTimeout(k);return p.transform?p.transform(D):D},(D)=>{if(k)clearTimeout(k);throw D})},B=(b)=>{if(c)return c;let x=N;if(V.set(!0),n===0&&!I())H.set(!0);let C=()=>{if(x!==N)return;c=null,V.set(!1),H.set(!1)},A=te(b).then((k)=>{if(x!==N)return w();return e=k,n=Date.now(),I.set(n),q.set(null),v.persist(t,k,E),M(),C(),w()},(k)=>{if(x===N)q.set(k&&k.message?k.message:"Could not load.");return C(),w()});return c=A,A},j={data:w,loading:H,isFetching:V,error:q,updatedAt:I,get key(){return t},load(b){if(ee(),!b&&n&&Date.now()-n<(p.staleTime||0))return Promise.resolve(w());return B(!!b)},refresh(){return j.load(!0)},set(b){e=typeof b==="function"?b(e):b,v.persist(t,e,E),M()},invalidate(){n=0},__options(b){p={...p,...b}}};if(o.add({target:O,updated:()=>{if(n||I())B(!1)},outbox:(b)=>{if(b)e=v.overlay(O(),e,b.id),n=0,B(!0);M()}}),i.set(t,j),p.immediate)j.load();return j}},g=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(r.listen!==!1&&g&&typeof g.addEventListener==="function")g.addEventListener("stx:updated",(t)=>{let s=t.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;o.forEach((m)=>{if(u(s.url,m.target()))m.updated()})}),g.addEventListener("stx:outbox",(t)=>{let s=t.detail||{},m=s.sent&&typeof s.sent.id==="string"?s.sent:null;o.forEach((p)=>{if(m){let T=Array.isArray(m.affects)?m.affects:[],S=p.target();if(!T.some((R)=>u(R,S)))return}p.outbox(m)})});return v}function Z(r,d,u,o,i){let y=!0,f=new Set,h=(a)=>o.get?o.get(a):a,l=()=>h(r());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:d}),l.set=(a)=>{if(!y)return;let v=d(),g=o.set?o.set(a,v):a;if(v.trim&&typeof g==="string")g=g.trim();if(v.number&&typeof g==="string"&&g!==""){let t=Number(g);if(!Number.isNaN(t))g=t}if(Object.is(r(),g))return;r.set(g),u(g)},l.update=(a)=>l.set(a(l())),l.input=(a)=>{if(!d().lazy)l.set(a)},l.change=(a)=>{if(d().lazy)l.set(a)},l.subscribe=(a)=>{if(!y)return()=>{};let v=r.subscribe((g,t)=>a(h(g),h(t)));return f.add(v),()=>{v(),f.delete(v)}},Object.defineProperty(l,"value",{get:l,set:l.set}),i(()=>{y=!1,f.forEach((a)=>a()),f.clear()}),l}function Pe(){let r=re(Ut());try{let u=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(r);return u=u.replace(/\}(var |let |const |function )/g,"};$1"),u}catch{return r}}function re(r){let d=[],u=0,o="console.log(";while(u<r.length){let i=r.indexOf(o,u);if(i===-1){d.push(r.slice(u));break}d.push(r.slice(u,i));let y=1,f=i+o.length;while(f<r.length&&y>0){let h=r[f];if(h==='"'||h==="'"||h==="`"){let l=h;f++;while(f<r.length&&r[f]!==l){if(r[f]==="\\")f++;f++}f++;continue}if(h==="(")y++;else if(h===")")y--;f++}d.push("0"),u=f}return d.join("")}function Ut(){return`
|
|
3
3
|
// STX Signals Runtime (Development Build)
|
|
4
4
|
console.log('[stx] signals runtime loading');
|
|
5
5
|
// Pre-initialization shim: capture onMount/onDestroy calls made before the runtime IIFE runs
|
|
@@ -27,8 +27,19 @@ console.log('[stx] entering IIFE');
|
|
|
27
27
|
// exactly as it was: same calls, one property lookup earlier.
|
|
28
28
|
var stxHost = window.__stx_host || {
|
|
29
29
|
setText: function(node, value) { node.textContent = value; },
|
|
30
|
-
setAttribute: function(node, name, value) {
|
|
30
|
+
setAttribute: function(node, name, value) {
|
|
31
|
+
var next = value;
|
|
32
|
+
if (typeof value === 'object' && value !== null) {
|
|
33
|
+
try { next = JSON.stringify(value); }
|
|
34
|
+
catch (e) { next = String(value); }
|
|
35
|
+
}
|
|
36
|
+
node.setAttribute(name, next);
|
|
37
|
+
},
|
|
31
38
|
removeAttribute: function(node, name) { node.removeAttribute(name); },
|
|
39
|
+
setStyle: function(node, value) {
|
|
40
|
+
if (typeof value === 'object' && value !== null) Object.assign(node.style, value);
|
|
41
|
+
else if (typeof value === 'string') node.style.cssText = value;
|
|
42
|
+
},
|
|
32
43
|
|
|
33
44
|
// Structural operations, for the bindings that build rows rather than
|
|
34
45
|
// update one node (#1984).
|
|
@@ -1354,8 +1365,8 @@ finally {
|
|
|
1354
1365
|
// Declarative Data Fetching (Feature #6 - useFetch)
|
|
1355
1366
|
// ==========================================================================
|
|
1356
1367
|
|
|
1357
|
-
var readHydratedData = ${
|
|
1358
|
-
var clearServerData = ${
|
|
1368
|
+
var readHydratedData = ${W.toString()};
|
|
1369
|
+
var clearServerData = ${X.toString()};
|
|
1359
1370
|
|
|
1360
1371
|
function useFetch(urlOrFn, options = {}) {
|
|
1361
1372
|
const hydrated = readHydratedData(options.key, options.hydrate !== false, options.transform);
|
|
@@ -2788,21 +2799,72 @@ catch (e) {
|
|
|
2788
2799
|
* Absent a manifest nothing changes: the walk is still the default, and a
|
|
2789
2800
|
* page that ships no list hydrates exactly as it did.
|
|
2790
2801
|
*/
|
|
2791
|
-
function processFromManifest(root, scope, manifest) {
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2802
|
+
function processFromManifest(root, scope, manifest, resolvedNodes) {
|
|
2803
|
+
// Arrays have an entries() method too. Prefer the array itself before
|
|
2804
|
+
// accepting the compiled document shape { entries: [...] }.
|
|
2805
|
+
var entries = Array.isArray(manifest)
|
|
2806
|
+
? manifest
|
|
2807
|
+
: (manifest && Array.isArray(manifest.entries) ? manifest.entries : null);
|
|
2808
|
+
if (!entries || !entries.length || (!root && !resolvedNodes)) return false;
|
|
2809
|
+
for (var i = 0; i < entries.length; i++) {
|
|
2810
|
+
var entry = entries[i];
|
|
2795
2811
|
var id = entry && entry.id;
|
|
2796
2812
|
if (id === undefined || id === null) continue;
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2813
|
+
// Native compilation already has stable handles for every manifest id.
|
|
2814
|
+
// Accept those handles directly so a non-DOM host never needs selectors
|
|
2815
|
+
// or an attribute walk. The browser keeps its existing lookup fallback.
|
|
2816
|
+
var node = resolvedNodes
|
|
2817
|
+
? (typeof resolvedNodes.get === 'function' ? resolvedNodes.get(id) : resolvedNodes[id])
|
|
2818
|
+
: null;
|
|
2819
|
+
if (!node && root) {
|
|
2820
|
+
node = root.getAttribute && root.getAttribute('data-stx-b') === String(id)
|
|
2821
|
+
? root
|
|
2822
|
+
: (root.querySelector ? root.querySelector('[data-stx-b="' + id + '"]') : null);
|
|
2823
|
+
}
|
|
2800
2824
|
if (!node) continue;
|
|
2825
|
+
// A structural binding can detach its source before a later manifest
|
|
2826
|
+
// entry reaches one of that source's children. Native handles expose
|
|
2827
|
+
// this state directly; do not register effects or handlers for a view
|
|
2828
|
+
// that no longer exists in the host tree. Browser hydration keeps its
|
|
2829
|
+
// existing behaviour because it does not pass resolvedNodes here.
|
|
2830
|
+
if (resolvedNodes && node.__stxId !== undefined && node.isConnected === false) continue;
|
|
2801
2831
|
processElement(node, scope, true);
|
|
2802
2832
|
}
|
|
2803
2833
|
return true;
|
|
2804
2834
|
}
|
|
2805
2835
|
|
|
2836
|
+
// Bind a precompiled host tree without waiting for DOMContentLoaded. Native
|
|
2837
|
+
// passes its manifest id to node-handle table; browser hydration continues
|
|
2838
|
+
// through the document-ready path below. The same state, effect, expression,
|
|
2839
|
+
// event and host implementations are used by both.
|
|
2840
|
+
function hydrateHost(root, setup, manifest, resolvedNodes) {
|
|
2841
|
+
var mountStart = mountCallbacks.length;
|
|
2842
|
+
var destroyStart = destroyCallbacks.length;
|
|
2843
|
+
var outerSink = activeDestroySink;
|
|
2844
|
+
activeDestroySink = null;
|
|
2845
|
+
var values;
|
|
2846
|
+
try { values = typeof setup === 'function' ? setup() : setup; }
|
|
2847
|
+
finally { activeDestroySink = outerSink; }
|
|
2848
|
+
var localMountHooks = mountCallbacks.splice(mountStart);
|
|
2849
|
+
var localDestroyHooks = destroyCallbacks.splice(destroyStart);
|
|
2850
|
+
var scope = Object.assign({ $refs: {} }, values || {});
|
|
2851
|
+
var disposeEffects = trackEffects(function() {
|
|
2852
|
+
processFromManifest(root, scope, manifest, resolvedNodes);
|
|
2853
|
+
});
|
|
2854
|
+
runMountCallbacks(localMountHooks, localDestroyHooks);
|
|
2855
|
+
var mounted = true;
|
|
2856
|
+
return function disposeHost() {
|
|
2857
|
+
if (!mounted) return;
|
|
2858
|
+
mounted = false;
|
|
2859
|
+
disposeEffects();
|
|
2860
|
+
var hooks = localDestroyHooks.splice(0, localDestroyHooks.length);
|
|
2861
|
+
for (var i = 0; i < hooks.length; i++) {
|
|
2862
|
+
try { hooks[i](); }
|
|
2863
|
+
catch (e) { console.warn('[stx] native destroy error:', e); }
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2806
2868
|
// skipChildren: this element's bindings only, because something else already
|
|
2807
2869
|
// knows where the rest are. The manifest path passes it for every entry, so
|
|
2808
2870
|
// the tree is never walked; see processFromManifest.
|
|
@@ -2993,6 +3055,19 @@ else if (part) {
|
|
|
2993
3055
|
// Use the passed scope parameter to preserve context through nested processing
|
|
2994
3056
|
const attrCapturedScope = { ...globalHelpers, ...scope, ...(findElementScope(el) || {}) };
|
|
2995
3057
|
|
|
3058
|
+
// Keep the conditional owners captured while the element is in the tree.
|
|
3059
|
+
// Walking parents on each update loses an outer owner when an inner :if
|
|
3060
|
+
// detaches its own root. These signals suspend writes while either owner
|
|
3061
|
+
// is hidden and refresh the latest value AFTER reinsertion, even when the
|
|
3062
|
+
// attribute's source did not change on that show.
|
|
3063
|
+
const attrVisibility = [];
|
|
3064
|
+
for (var attrAncestor = el; attrAncestor; attrAncestor = attrAncestor.parentNode) {
|
|
3065
|
+
if (attrAncestor.__stx_if_visible) attrVisibility.push(attrAncestor.__stx_if_visible);
|
|
3066
|
+
}
|
|
3067
|
+
function attributesVisible() {
|
|
3068
|
+
return attrVisibility.every(function(visible) { return visible(); });
|
|
3069
|
+
}
|
|
3070
|
+
|
|
2996
3071
|
// Post-eval unwrap: if the expression result is a signal function (e.g.
|
|
2997
3072
|
// step was resolved via identifier lookup, not via the auto-unwrap
|
|
2998
3073
|
// proxy \u2014 happens when a client script declares const step = state(...)
|
|
@@ -3052,7 +3127,7 @@ catch (e2) {
|
|
|
3052
3127
|
};
|
|
3053
3128
|
|
|
3054
3129
|
// Known directive names to exclude from generic :attr binding
|
|
3055
|
-
var DIRECTIVE_NAMES = ${
|
|
3130
|
+
var DIRECTIVE_NAMES = ${$o()};
|
|
3056
3131
|
|
|
3057
3132
|
// A bound value cannot introduce a URL scheme the page did not ask for.
|
|
3058
3133
|
// This is the client half of url-safety.ts: the server refuses a scheme
|
|
@@ -3087,7 +3162,7 @@ catch (e2) {
|
|
|
3087
3162
|
// a dead duplicate attribute and the real viewBox never updates.
|
|
3088
3163
|
var SVG_ATTR_CASE = {attributename:'attributeName', attributetype:'attributeType', basefrequency:'baseFrequency', baseprofile:'baseProfile', calcmode:'calcMode', clippathunits:'clipPathUnits', diffuseconstant:'diffuseConstant', edgemode:'edgeMode', filterunits:'filterUnits', glyphref:'glyphRef', gradienttransform:'gradientTransform', gradientunits:'gradientUnits', kernelmatrix:'kernelMatrix', kernelunitlength:'kernelUnitLength', keypoints:'keyPoints', keysplines:'keySplines', keytimes:'keyTimes', lengthadjust:'lengthAdjust', limitingconeangle:'limitingConeAngle', markerheight:'markerHeight', markerunits:'markerUnits', markerwidth:'markerWidth', maskcontentunits:'maskContentUnits', maskunits:'maskUnits', numoctaves:'numOctaves', pathlength:'pathLength', patterncontentunits:'patternContentUnits', patterntransform:'patternTransform', patternunits:'patternUnits', pointsatx:'pointsAtX', pointsaty:'pointsAtY', pointsatz:'pointsAtZ', preservealpha:'preserveAlpha', preserveaspectratio:'preserveAspectRatio', primitiveunits:'primitiveUnits', refx:'refX', refy:'refY', repeatcount:'repeatCount', repeatdur:'repeatDur', requiredextensions:'requiredExtensions', requiredfeatures:'requiredFeatures', specularconstant:'specularConstant', specularexponent:'specularExponent', spreadmethod:'spreadMethod', startoffset:'startOffset', stddeviation:'stdDeviation', stitchtiles:'stitchTiles', surfacescale:'surfaceScale', systemlanguage:'systemLanguage', tablevalues:'tableValues', targetx:'targetX', targety:'targetY', textlength:'textLength', viewbox:'viewBox', viewtarget:'viewTarget', xchannelselector:'xChannelSelector', ychannelselector:'yChannelSelector', zoomandpan:'zoomAndPan'};
|
|
3089
3164
|
var SVG_NS = 'http://www.w3.org/2000/svg';
|
|
3090
|
-
var EVENT_RE = ${
|
|
3165
|
+
var EVENT_RE = ${Eo()};
|
|
3091
3166
|
var KEY_MAP = {enter:'Enter', tab:'Tab', escape:'Escape', space:' ', up:'ArrowUp', down:'ArrowDown', left:'ArrowLeft', right:'ArrowRight', 'delete':'Delete', backspace:'Backspace'};
|
|
3092
3167
|
|
|
3093
3168
|
// Handle attributes
|
|
@@ -3123,7 +3198,7 @@ catch (e2) {
|
|
|
3123
3198
|
// :attr still works for backward compat but is reserved for structural directives.
|
|
3124
3199
|
// x-text, x-html, x-model, x-show, x-if, x-for, x-cloak, x-ref, x-data are
|
|
3125
3200
|
// handled by their own code paths below \u2014 exclude them here.
|
|
3126
|
-
var X_HANDLED = ${
|
|
3201
|
+
var X_HANDLED = ${Co()};
|
|
3127
3202
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
3128
3203
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
3129
3204
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
@@ -3134,6 +3209,7 @@ catch (e2) {
|
|
|
3134
3209
|
? el.__stx_parent_scope
|
|
3135
3210
|
: attrCapturedScope;
|
|
3136
3211
|
effect(() => {
|
|
3212
|
+
if (!attributesVisible()) return;
|
|
3137
3213
|
const v = evalAttrExpr(value, bindingScope);
|
|
3138
3214
|
// Form control values are live DOM properties. Setting only the HTML
|
|
3139
3215
|
// attribute does not update a <select>'s chosen option and can leave
|
|
@@ -3147,6 +3223,7 @@ catch (e2) {
|
|
|
3147
3223
|
controlValue = v === false || v === null || v === undefined ? '' : String(controlValue);
|
|
3148
3224
|
el.__stx_bound_value = controlValue;
|
|
3149
3225
|
var applyControlValue = function() {
|
|
3226
|
+
if (!attributesVisible()) return;
|
|
3150
3227
|
var desiredValue = el.__stx_bound_value == null ? '' : String(el.__stx_bound_value);
|
|
3151
3228
|
el.value = desiredValue;
|
|
3152
3229
|
if (desiredValue === '' && el.tagName !== 'OPTION') el.removeAttribute(attrName);
|
|
@@ -3210,6 +3287,9 @@ else {
|
|
|
3210
3287
|
catch (e) { attrValue = String(v); }
|
|
3211
3288
|
}
|
|
3212
3289
|
var attrValueSafe = safeUrlAttr(attrName, attrValue);
|
|
3290
|
+
// Keep structured values structured for non-DOM hosts. The DOM
|
|
3291
|
+
// host serializes them at its boundary, preserving web output.
|
|
3292
|
+
var hostValue = (typeof v === 'object' && v !== null) ? v : attrValueSafe;
|
|
3213
3293
|
// Writing the value an attribute already has is not nothing: a
|
|
3214
3294
|
// frame given its own src again loads again (an entry in the
|
|
3215
3295
|
// page's history each time) and a video restarts. A player whose
|
|
@@ -3226,22 +3306,22 @@ else {
|
|
|
3226
3306
|
&& el.hasAttribute('src') && el.getAttribute('src') !== String(attrValueSafe)) {
|
|
3227
3307
|
var nextSibling = el.nextSibling;
|
|
3228
3308
|
parentNode.removeChild(el);
|
|
3229
|
-
stxHost.setAttribute(el, attrName,
|
|
3309
|
+
stxHost.setAttribute(el, attrName, hostValue);
|
|
3230
3310
|
parentNode.insertBefore(el, nextSibling);
|
|
3231
3311
|
}
|
|
3232
3312
|
else {
|
|
3233
|
-
stxHost.setAttribute(el, attrName,
|
|
3313
|
+
stxHost.setAttribute(el, attrName, hostValue);
|
|
3234
3314
|
}
|
|
3235
3315
|
}
|
|
3236
3316
|
});
|
|
3237
3317
|
el.removeAttribute(name);
|
|
3238
3318
|
}
|
|
3239
3319
|
else if (name === '@class' || name === ':class' || name === 'x-class') {
|
|
3240
|
-
bindClass(el, value, scope);
|
|
3320
|
+
bindClass(el, value, scope, attributesVisible);
|
|
3241
3321
|
el.removeAttribute(name);
|
|
3242
3322
|
}
|
|
3243
3323
|
else if (name === '@style' || name === ':style' || name === 'x-style') {
|
|
3244
|
-
bindStyle(el, value, scope);
|
|
3324
|
+
bindStyle(el, value, scope, attributesVisible);
|
|
3245
3325
|
el.removeAttribute(name);
|
|
3246
3326
|
}
|
|
3247
3327
|
else if (name === '@text' || name === ':text' || name === 'x-text') {
|
|
@@ -3727,7 +3807,7 @@ else {
|
|
|
3727
3807
|
el.removeAttribute(attrName);
|
|
3728
3808
|
}
|
|
3729
3809
|
|
|
3730
|
-
function bindClass(el, expr, passedScope = componentScope) {
|
|
3810
|
+
function bindClass(el, expr, passedScope = componentScope, isVisible) {
|
|
3731
3811
|
const originalClasses = el.className;
|
|
3732
3812
|
const capturedScope = { ...globalHelpers, ...passedScope, ...(findElementScope(el) || {}) };
|
|
3733
3813
|
const keys = Object.keys(capturedScope);
|
|
@@ -3746,6 +3826,7 @@ else {
|
|
|
3746
3826
|
}
|
|
3747
3827
|
|
|
3748
3828
|
effect(() => {
|
|
3829
|
+
if (isVisible && !isVisible()) return;
|
|
3749
3830
|
// Subscribe to signals by reading them, establishing reactive deps.
|
|
3750
3831
|
// But pass RAW scope values to the fn so call-expressions like
|
|
3751
3832
|
// activeTab() === 'overview' work \u2014 if we passed unwrapped values,
|
|
@@ -3795,7 +3876,7 @@ else {
|
|
|
3795
3876
|
});
|
|
3796
3877
|
}
|
|
3797
3878
|
|
|
3798
|
-
function bindStyle(el, expr, passedScope = componentScope) {
|
|
3879
|
+
function bindStyle(el, expr, passedScope = componentScope, isVisible) {
|
|
3799
3880
|
// Capture scope at setup time - use passed scope to preserve context
|
|
3800
3881
|
const capturedScope = { ...globalHelpers, ...passedScope, ...(findElementScope(el) || {}) };
|
|
3801
3882
|
|
|
@@ -3824,13 +3905,9 @@ catch (e2) {
|
|
|
3824
3905
|
};
|
|
3825
3906
|
|
|
3826
3907
|
effect(() => {
|
|
3908
|
+
if (isVisible && !isVisible()) return;
|
|
3827
3909
|
const value = evalExpr();
|
|
3828
|
-
|
|
3829
|
-
Object.assign(el.style, value);
|
|
3830
|
-
}
|
|
3831
|
-
else if (typeof value === 'string') {
|
|
3832
|
-
el.style.cssText = value;
|
|
3833
|
-
}
|
|
3910
|
+
stxHost.setStyle(el, value);
|
|
3834
3911
|
});
|
|
3835
3912
|
}
|
|
3836
3913
|
|
|
@@ -4864,6 +4941,7 @@ catch (e) {
|
|
|
4864
4941
|
b.el.__stx_if_bound = true;
|
|
4865
4942
|
b.el.__stx_chain_member = true;
|
|
4866
4943
|
b.el.__stx_chain_active = false;
|
|
4944
|
+
b.el.__stx_if_visible = state(false);
|
|
4867
4945
|
b.capturedElementScope = findElementScope(b.el);
|
|
4868
4946
|
b.placeholder = stxHost.anchor('stx-if-chain');
|
|
4869
4947
|
stxHost.insert(parent, b.placeholder, b.el);
|
|
@@ -4983,6 +5061,7 @@ catch (e2) {
|
|
|
4983
5061
|
if (currentIdx !== -1) {
|
|
4984
5062
|
var gone = chain[currentIdx];
|
|
4985
5063
|
gone.el.__stx_chain_active = false;
|
|
5064
|
+
gone.el.__stx_if_visible.set(false);
|
|
4986
5065
|
|
|
4987
5066
|
if (gone.isTemplate) {
|
|
4988
5067
|
// Everything this branch rendered goes, not just the clones it owns:
|
|
@@ -5043,6 +5122,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
5043
5122
|
if (pickHost.__stx_detached_if) pickHost.__stx_detached_if.delete(n);
|
|
5044
5123
|
stxHost.insert(pickHost, n, anchor);
|
|
5045
5124
|
});
|
|
5125
|
+
pick.el.__stx_if_visible.set(true);
|
|
5046
5126
|
// Bound AFTER the clones, so hiding can remove whatever a structural
|
|
5047
5127
|
// directive inside the branch renders as their sibling.
|
|
5048
5128
|
if (pick.isTemplate) {
|
|
@@ -5138,6 +5218,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
5138
5218
|
|
|
5139
5219
|
// Handle <template> elements specially - clone their content
|
|
5140
5220
|
const isTemplate = el.tagName === 'TEMPLATE';
|
|
5221
|
+
if (!isTemplate) el.__stx_if_visible = state(true);
|
|
5141
5222
|
const componentSetupSiblings = isTemplate ? [] : findConditionalComponentSetupSiblings(el);
|
|
5142
5223
|
let currentNodes = isTemplate ? [] : [el, ...componentSetupSiblings];
|
|
5143
5224
|
|
|
@@ -5308,11 +5389,13 @@ else {
|
|
|
5308
5389
|
const insertionAnchor = placeholder.nextSibling;
|
|
5309
5390
|
currentNodes.forEach(node => stxHost.insert(parent, node, insertionAnchor));
|
|
5310
5391
|
if (parent && parent.__stx_detached_if) currentNodes.forEach(node => parent.__stx_detached_if.delete(node));
|
|
5392
|
+
el.__stx_if_visible.set(true);
|
|
5311
5393
|
el.__stx_shown_at = performance.now();
|
|
5312
5394
|
isInserted = true;
|
|
5313
5395
|
}
|
|
5314
5396
|
else if (!value && isInserted) {
|
|
5315
5397
|
console.log('[stx] bindIf REMOVING element for :if=' + expr, 'el.isConnected:', el.isConnected, 'parent:', parent.tagName);
|
|
5398
|
+
el.__stx_if_visible.set(false);
|
|
5316
5399
|
// Do NOT disposeSubtreeScopes here. :if is a TOGGLE \u2014 the element is
|
|
5317
5400
|
// re-shown when the condition flips back \u2014 not a permanent unmount.
|
|
5318
5401
|
// A nested data-stx-scope inside this subtree is created once by its
|
|
@@ -6240,8 +6323,8 @@ catch (e) {} }
|
|
|
6240
6323
|
// off the critical path and read back asynchronously. Values kept before it
|
|
6241
6324
|
// are read where they are.
|
|
6242
6325
|
var STX_KEPT_PREFIX = 'stx:kept:';
|
|
6243
|
-
var __stxKept = (${
|
|
6244
|
-
var __stxQueries = (${
|
|
6326
|
+
var __stxKept = (${G.toString()})(undefined, ${Q.toString()});
|
|
6327
|
+
var __stxQueries = (${Y.toString()})({ state: state, kept: __stxKept, prefix: STX_KEPT_PREFIX, matches: ${J.toString()} });
|
|
6245
6328
|
function stxKeptPrefix(scope) {
|
|
6246
6329
|
return STX_KEPT_PREFIX + (scope === undefined || scope === null || scope === '' ? '' : String(scope) + ':');
|
|
6247
6330
|
}
|
|
@@ -6366,7 +6449,7 @@ catch (e) {} }
|
|
|
6366
6449
|
return normalizedPrefix + '-' + __stxGeneratedIdCounter;
|
|
6367
6450
|
}
|
|
6368
6451
|
|
|
6369
|
-
var createModelSignal = ${
|
|
6452
|
+
var createModelSignal = ${Z.toString()};
|
|
6370
6453
|
function useModel(name, options) {
|
|
6371
6454
|
if (typeof name !== 'string') { options = name || {}; name = 'modelValue'; }
|
|
6372
6455
|
options = options || {};
|
|
@@ -7292,6 +7375,7 @@ catch (e) {} }
|
|
|
7292
7375
|
// calling a detached one.
|
|
7293
7376
|
window.stx = Object.assign(window.stx || {}, {
|
|
7294
7377
|
hydrate: hydrateSubtree,
|
|
7378
|
+
hydrateHost,
|
|
7295
7379
|
state,
|
|
7296
7380
|
derived,
|
|
7297
7381
|
effect,
|
|
@@ -9242,5 +9326,5 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
9242
9326
|
}
|
|
9243
9327
|
}
|
|
9244
9328
|
})();
|
|
9245
|
-
`}var
|
|
9246
|
-
export{
|
|
9329
|
+
`}var Wl={state:z,derived:En,effect:Wt,batch:Dr,onMount:Or,onDestroy:Tn,isSignal:qt,isDerived:Kt,untrack:Mr,peek:_n,generateSignalsRuntime:Pe,generateSignalsRuntimeDev:Ut};
|
|
9330
|
+
export{Pe,Ut,Wl};
|