@stacksjs/stx 0.2.630 → 0.2.631
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-05zhvg8t.js +20 -0
- package/dist/chunk-0c31twby.js +2 -0
- package/dist/{chunk-0s1hpqas.js → chunk-0jeqp6yz.js} +2 -2
- package/dist/chunk-0nvb2x2f.js +2 -0
- package/dist/chunk-0whv8hnp.js +4 -0
- package/dist/{chunk-q1983d5e.js → chunk-179c1rdn.js} +2 -2
- package/dist/chunk-1e25xd0z.js +6 -0
- package/dist/{chunk-jp6yn9mj.js → chunk-1ma56c2h.js} +2 -2
- package/dist/{chunk-h9ymjtch.js → chunk-27h1xs4k.js} +12 -12
- package/dist/{chunk-5m0r0j79.js → chunk-2vqz7v37.js} +3 -3
- package/dist/{chunk-10s16tad.js → chunk-2wvz3fd2.js} +2 -2
- package/dist/chunk-3jda301z.js +2 -0
- package/dist/{chunk-gc1dzxee.js → chunk-3p2b88pd.js} +2 -2
- package/dist/chunk-46qg1tqe.js +2 -0
- package/dist/{chunk-66e4ga0z.js → chunk-4fv3jq16.js} +2 -2
- package/dist/{chunk-k1k2t4ez.js → chunk-4y06ekvt.js} +1 -1
- package/dist/chunk-5fjb6avv.js +2 -0
- package/dist/chunk-5kprybdd.js +2 -0
- package/dist/{chunk-n5xbv1a9.js → chunk-62kxavc5.js} +3 -3
- package/dist/{chunk-8q9b82ew.js → chunk-6684b8ym.js} +11 -11
- package/dist/{chunk-npvxq89e.js → chunk-6mtth8d1.js} +3 -3
- package/dist/chunk-6n6nnt33.js +2 -0
- package/dist/chunk-6per0k6j.js +2 -0
- package/dist/{chunk-hb46a5rr.js → chunk-70npkeh2.js} +2 -2
- package/dist/{chunk-y706tkyy.js → chunk-776f05vk.js} +4 -4
- package/dist/{chunk-szjgbjw1.js → chunk-7a8jkwah.js} +2 -2
- package/dist/{chunk-wbhzt74k.js → chunk-7cw0wkbx.js} +1 -1
- package/dist/chunk-7f1dw9r4.js +2 -0
- package/dist/{chunk-khzyc41k.js → chunk-7ky2ny63.js} +13 -13
- package/dist/{chunk-h431swg6.js → chunk-7mpv1a02.js} +9 -9
- package/dist/chunk-7zjv015g.js +2 -0
- package/dist/{chunk-q35z0cyg.js → chunk-85bbtv3m.js} +1 -1
- package/dist/{chunk-qb7a4am2.js → chunk-85g35me6.js} +2 -2
- package/dist/chunk-87nt0kty.js +2 -0
- package/dist/{chunk-3dth76ce.js → chunk-88d5s6v3.js} +3 -3
- package/dist/chunk-8a3sdg2y.js +2 -0
- package/dist/chunk-8e9hd2jq.js +4 -0
- package/dist/{chunk-0c7ss25y.js → chunk-8gksvwsm.js} +3 -3
- package/dist/chunk-8vbfbtke.js +2 -0
- package/dist/chunk-91ranpvz.js +2 -0
- package/dist/chunk-96ypgjm4.js +2 -0
- package/dist/{chunk-1gtrs8va.js → chunk-9b4e815s.js} +8 -8
- package/dist/chunk-9cg6q8mw.js +2 -0
- package/dist/{chunk-gd7vq083.js → chunk-a2ztn8cr.js} +1 -1
- package/dist/chunk-ag4eck6d.js +2 -0
- package/dist/chunk-aq02drjz.js +2 -0
- package/dist/{chunk-jsw5yby0.js → chunk-aqra0qcg.js} +3 -3
- package/dist/{chunk-cnvfh74t.js → chunk-av9zf0zb.js} +5 -5
- package/dist/chunk-ayt4qd82.js +2 -0
- package/dist/{chunk-m735gtc4.js → chunk-az1y9jks.js} +2 -2
- package/dist/chunk-b3mazye4.js +2 -0
- package/dist/chunk-b5cv9xp7.js +2852 -0
- package/dist/{chunk-dayjd2sj.js → chunk-b7p3yca7.js} +4 -4
- package/dist/chunk-bn6sarwd.js +2 -0
- package/dist/chunk-c7xt5gyb.js +2 -0
- package/dist/chunk-cac98pkx.js +2 -0
- package/dist/{chunk-q5w9cmr9.js → chunk-cbj2hmx5.js} +5 -5
- package/dist/chunk-czg6ewy3.js +2 -0
- package/dist/{chunk-sxpnpvt5.js → chunk-d1ya7f79.js} +4 -4
- package/dist/chunk-dcwmcqbr.js +2 -0
- package/dist/{chunk-19bhnbyn.js → chunk-dz4hrgw8.js} +83 -64
- package/dist/chunk-ed1qn902.js +2 -0
- package/dist/chunk-ev479f3z.js +2 -0
- package/dist/{chunk-x6pz1h3x.js → chunk-evs5gb3q.js} +10 -10
- package/dist/{chunk-w3c2c74q.js → chunk-fskpdva4.js} +46 -46
- package/dist/{chunk-5rtatjwq.js → chunk-gh34r6qb.js} +2 -2
- package/dist/chunk-gmg6aj7y.js +2 -0
- package/dist/{chunk-t455jpzx.js → chunk-h4ashx84.js} +1 -1
- package/dist/chunk-hc1m2psz.js +3 -0
- package/dist/{chunk-4hmdcmw1.js → chunk-hfe8g644.js} +6 -6
- package/dist/chunk-htaed68z.js +2 -0
- package/dist/{chunk-g8gzxhp8.js → chunk-j1rnhv0w.js} +3 -3
- package/dist/chunk-j2jm2nqz.js +2 -0
- package/dist/chunk-jb8d4n60.js +2 -0
- package/dist/{chunk-mktk70gq.js → chunk-k2nrx78c.js} +2 -2
- package/dist/chunk-kdnbxwkb.js +2 -0
- package/dist/{chunk-01hf94pa.js → chunk-kf2vas4j.js} +5 -5
- package/dist/chunk-kt5mzw2w.js +2 -0
- package/dist/chunk-kt994306.js +2 -0
- package/dist/{chunk-6qvskcwp.js → chunk-mer3aea0.js} +4 -4
- package/dist/chunk-mezphhpa.js +2 -0
- package/dist/{chunk-5wrmcbch.js → chunk-myhxapnn.js} +2 -2
- package/dist/chunk-n7d69a2q.js +2 -0
- package/dist/{chunk-z4te6223.js → chunk-nz6bzffm.js} +4 -4
- package/dist/{chunk-st71ar7s.js → chunk-pfas39mf.js} +9 -9
- package/dist/{chunk-j18z5nxq.js → chunk-phbnrw2h.js} +2 -2
- package/dist/{chunk-9g5sv1p6.js → chunk-q2p6y0cn.js} +7 -7
- package/dist/{chunk-6rxnh3th.js → chunk-qfppetcn.js} +1 -1
- package/dist/{chunk-wsbccxwy.js → chunk-qpbd2fwp.js} +9 -9
- package/dist/{chunk-y794qh69.js → chunk-qvqgbvfa.js} +6 -6
- package/dist/chunk-qz3tnvwm.js +2 -0
- package/dist/{chunk-dvbgbd06.js → chunk-rns21kkv.js} +2 -2
- package/dist/{chunk-08jyyegp.js → chunk-rq9cbw2y.js} +1 -1
- package/dist/{chunk-q7wj2ypd.js → chunk-s0ar60ng.js} +6 -6
- package/dist/chunk-sddytf9n.js +2 -0
- package/dist/chunk-spvr2vvh.js +2 -0
- package/dist/{chunk-0z189871.js → chunk-t84ww3qb.js} +2 -2
- package/dist/chunk-t91250ag.js +2 -0
- package/dist/{chunk-n8595zaf.js → chunk-tmbqz710.js} +1 -1
- package/dist/{chunk-hjp38m0w.js → chunk-tme29zh9.js} +2 -2
- package/dist/chunk-txkc9w9q.js +2 -0
- package/dist/chunk-ty1c2276.js +2 -0
- package/dist/{chunk-det49x62.js → chunk-v5500ews.js} +2 -2
- package/dist/chunk-vepjs3tg.js +2 -0
- package/dist/{chunk-v3anfm9d.js → chunk-vfbdxxbf.js} +2 -2
- package/dist/{chunk-7mehf3h5.js → chunk-w9c7z8p3.js} +2 -2
- package/dist/chunk-wfp754ya.js +2 -0
- package/dist/chunk-wp3qcfb4.js +3 -0
- package/dist/{chunk-ga48aas6.js → chunk-x17fpc0x.js} +6 -6
- package/dist/chunk-x3sbsxdq.js +2 -0
- package/dist/chunk-xdcvp8tt.js +2 -0
- package/dist/{chunk-ebkjpj5m.js → chunk-xh98er3b.js} +2 -2
- package/dist/{chunk-9z9f3d6b.js → chunk-xrj3tekf.js} +2 -2
- package/dist/chunk-xxnh7gv8.js +2 -0
- package/dist/{chunk-zswn0s45.js → chunk-y2t8xd39.js} +2 -2
- package/dist/chunk-y4egzqqf.js +2 -0
- package/dist/chunk-y4nm9wq4.js +2 -0
- package/dist/{chunk-ygkwp4sf.js → chunk-y5hdc1sb.js} +2 -2
- package/dist/chunk-ygx0akfn.js +2 -0
- package/dist/chunk-yn9fwnq2.js +2 -0
- package/dist/{chunk-3dcdgp1k.js → chunk-yq9rfnd6.js} +1 -1
- package/dist/chunk-z0gfb7b4.js +2 -0
- package/dist/chunk-z3e54btj.js +2 -0
- package/dist/{chunk-773vgw1k.js → chunk-z6fb4m1j.js} +3 -3
- package/dist/cli.js +21 -21
- package/dist/client/signals-class-runtime.js +1 -1
- package/dist/client/signals-component-hydration-runtime.js +1 -1
- package/dist/client/signals-component-props-runtime.js +3 -3
- package/dist/client/signals-container-cleanup-runtime.js +1 -1
- package/dist/client/signals-dom-ready-runtime.js +4 -4
- package/dist/client/signals-event-shorthand-runtime.js +2 -2
- package/dist/client/signals-expression-runtime.js +21 -2
- package/dist/client/signals-for-runtime.js +6 -6
- package/dist/client/signals-handler-runtime.js +1 -1
- package/dist/client/signals-hydration-audit-runtime.js +1 -1
- package/dist/client/signals-hydration-runtime.js +1 -1
- package/dist/client/signals-if-chain-runtime.js +3 -3
- package/dist/client/signals-if-runtime.js +7 -7
- package/dist/client/signals-lazy-hydration-runtime.js +1 -1
- package/dist/client/signals-manifest-hydration-runtime.js +1 -1
- package/dist/client/signals-model-runtime.js +1 -1
- package/dist/client/signals-mount-runtime.js +3 -3
- package/dist/client/signals-process-element-runtime.js +7 -7
- package/dist/client/signals-show-runtime.js +1 -1
- package/dist/client/signals-spa-load-runtime.js +5 -5
- package/dist/client/signals-style-runtime.js +1 -1
- package/dist/client-scope-bindings.d.ts +6 -0
- package/dist/client-scope-bindings.js +98 -0
- package/dist/client-script-bundler.js +9 -3
- package/dist/client-script.js +2 -1
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/includes.js +4 -2
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.d.ts +2 -6
- package/dist/signal-processing.js +4 -80
- package/dist/ssg.js +10 -10
- package/dist/utils.js +5 -3
- package/package.json +5 -5
- package/dist/chunk-0fgp13q4.js +0 -2
- package/dist/chunk-0v0q0960.js +0 -2
- package/dist/chunk-0xxjmnqc.js +0 -2
- package/dist/chunk-1peszdcc.js +0 -2
- package/dist/chunk-1v92x0we.js +0 -15
- package/dist/chunk-2340emvg.js +0 -2
- package/dist/chunk-2xy5p3n4.js +0 -2
- package/dist/chunk-6p57991f.js +0 -2
- package/dist/chunk-711zygzk.js +0 -2
- package/dist/chunk-74r2q9ab.js +0 -2
- package/dist/chunk-7h4mxhkh.js +0 -2
- package/dist/chunk-7zdefvrn.js +0 -2
- package/dist/chunk-847nyz30.js +0 -2
- package/dist/chunk-8898f767.js +0 -2
- package/dist/chunk-9c7wkq4t.js +0 -2
- package/dist/chunk-9g01gnz5.js +0 -6
- package/dist/chunk-9wbraw07.js +0 -2
- package/dist/chunk-apaqfgsx.js +0 -2
- package/dist/chunk-bdnahg9m.js +0 -2
- package/dist/chunk-bfste5zk.js +0 -2
- package/dist/chunk-by4ngspf.js +0 -4
- package/dist/chunk-c0yb755y.js +0 -2
- package/dist/chunk-chaee0vj.js +0 -2
- package/dist/chunk-cy1krwqy.js +0 -2
- package/dist/chunk-d57fh04e.js +0 -2
- package/dist/chunk-dcham5kg.js +0 -2
- package/dist/chunk-e876sg0j.js +0 -2
- package/dist/chunk-ekfmad19.js +0 -2
- package/dist/chunk-f0ghgkxs.js +0 -2
- package/dist/chunk-fnzv245x.js +0 -2
- package/dist/chunk-hjkm6k8c.js +0 -2
- package/dist/chunk-hpvkkke2.js +0 -2
- package/dist/chunk-jb683m9n.js +0 -2
- package/dist/chunk-jfqvmq5w.js +0 -2
- package/dist/chunk-k1vjhhd4.js +0 -2
- package/dist/chunk-k5kj93g7.js +0 -2
- package/dist/chunk-kp4j8vja.js +0 -2
- package/dist/chunk-mb8c650x.js +0 -2
- package/dist/chunk-mfcxhfhb.js +0 -2
- package/dist/chunk-mmqt6qkf.js +0 -2
- package/dist/chunk-n6ek151q.js +0 -2
- package/dist/chunk-ph3ttt90.js +0 -2
- package/dist/chunk-pk68a878.js +0 -2
- package/dist/chunk-ptas1qqx.js +0 -2850
- package/dist/chunk-pz5zh3tg.js +0 -2
- package/dist/chunk-q068mc46.js +0 -2
- package/dist/chunk-q4a2j4qr.js +0 -3
- package/dist/chunk-rfkrktt9.js +0 -2
- package/dist/chunk-rj0nyb2t.js +0 -2
- package/dist/chunk-smpyb21z.js +0 -2
- package/dist/chunk-swv69q75.js +0 -4
- package/dist/chunk-t9ww2z0r.js +0 -2
- package/dist/chunk-th9wcse5.js +0 -2
- package/dist/chunk-v1ck0wd3.js +0 -2
- package/dist/chunk-vgd3yq11.js +0 -3
- package/dist/chunk-w24zd7sj.js +0 -2
- package/dist/chunk-wfettff6.js +0 -2
- package/dist/chunk-xfvbm4pn.js +0 -2
- package/dist/chunk-z04480ar.js +0 -2
- package/dist/chunk-zemkt4kg.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{oa,ia,aa}from"./chunk-rns21kkv.js";import{K,un,dn,os,Qn,er,pn,fn,is,tr}from"./chunk-0jeqp6yz.js";function X(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function Q(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function J(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function Z(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},D=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).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 k}function ee(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function te(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),G=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},z=(b)=>{let w=R;p.restore(e,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!x)z(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)z(k)},_t=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;A=M(w,V).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,j]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},W=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,T).then((A)=>{if(w!==R||T!==N())return j(),I();return n=A,c=Date.now(),P.set(c),G.set(null),p.persist(e,A,k),F(),j(),I()},(A)=>{if(w===R&&T===N())G.set(A&&A.message?A.message:"Could not load.");return j(),I()})},O=`${w} ${T||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:G,updatedAt:P,get key(){return e},load(b){if(wt(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return W(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.add({target:D,updated:()=>{if(c||P())W(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,W(!0);F()}}),d.set(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function ne(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var re=` function useColorMode(options) {
|
|
3
3
|
options = options || {};
|
|
4
4
|
// The pre-paint boot script (stacksjs/stx#1794) publishes the app's
|
|
5
5
|
// configured options here. Reading them makes a bare useColorMode() agree
|
|
@@ -639,7 +639,7 @@ console.log('[stx] entering IIFE');
|
|
|
639
639
|
|
|
640
640
|
`;var le=` function bindClass(el, expr, passedScope = componentScope, isVisible) {
|
|
641
641
|
const originalClasses = el.className;
|
|
642
|
-
const capturedScope =
|
|
642
|
+
const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
|
|
643
643
|
const keys = Object.keys(capturedScope);
|
|
644
644
|
|
|
645
645
|
// Pre-compile \u2014 only the names the expression mentions (see
|
|
@@ -970,7 +970,7 @@ else {
|
|
|
970
970
|
}).filter(Boolean);
|
|
971
971
|
if (!bindings.length) return;
|
|
972
972
|
el.__stx_parent_props_bound = true;
|
|
973
|
-
var scope =
|
|
973
|
+
var scope = mergeTemplateScopes(globalHelpers, callerScope);
|
|
974
974
|
|
|
975
975
|
bindings.forEach(function(binding) {
|
|
976
976
|
var name = binding.name;
|
|
@@ -1027,7 +1027,7 @@ else {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
|
|
1029
1029
|
function resolveComponentCallerScope(el, pageScope) {
|
|
1030
|
-
var resolved =
|
|
1030
|
+
var resolved = mergeTemplateScopes(pageScope);
|
|
1031
1031
|
var ancestors = [];
|
|
1032
1032
|
var current = el && (el.parentElement || el.parentNode);
|
|
1033
1033
|
while (current && current !== document) {
|
|
@@ -1037,7 +1037,7 @@ else {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
ancestors.reverse().forEach(function(scopeId) {
|
|
1039
1039
|
var ancestorScope = window.stx._scopes && window.stx._scopes[scopeId];
|
|
1040
|
-
if (ancestorScope)
|
|
1040
|
+
if (ancestorScope) assignTemplateScope(resolved, ancestorScope);
|
|
1041
1041
|
});
|
|
1042
1042
|
return resolved;
|
|
1043
1043
|
}
|
|
@@ -1205,7 +1205,7 @@ else {
|
|
|
1205
1205
|
return;
|
|
1206
1206
|
}
|
|
1207
1207
|
scopeVars.__el = root;
|
|
1208
|
-
var childScope =
|
|
1208
|
+
var childScope = mergeTemplateScopes(resolvedCallerScope, scopeVars);
|
|
1209
1209
|
root.__stx_disposers = trackEffects(function() {
|
|
1210
1210
|
processElement(root, childScope);
|
|
1211
1211
|
});
|
|
@@ -1412,7 +1412,7 @@ else {
|
|
|
1412
1412
|
document.querySelectorAll('body > *').forEach(function(el) {
|
|
1413
1413
|
if (el === container) return;
|
|
1414
1414
|
if (el.tagName === 'SCRIPT' || el.tagName === 'STYLE') return;
|
|
1415
|
-
if (el.__stx_scope)
|
|
1415
|
+
if (el.__stx_scope) assignTemplateScope(componentScope, el.__stx_scope);
|
|
1416
1416
|
});
|
|
1417
1417
|
|
|
1418
1418
|
// 1-2. Every descendant, then the container: cancel pending island
|
|
@@ -1844,7 +1844,7 @@ else {
|
|
|
1844
1844
|
try {
|
|
1845
1845
|
const result = latestSetup();
|
|
1846
1846
|
if (typeof result === 'object' && result !== null)
|
|
1847
|
-
|
|
1847
|
+
assignTemplateScope(componentScope, result);
|
|
1848
1848
|
}
|
|
1849
1849
|
catch (e) {
|
|
1850
1850
|
console.error('[stx] initial setup error:', e);
|
|
@@ -1867,7 +1867,7 @@ else {
|
|
|
1867
1867
|
const result = window[setupName]();
|
|
1868
1868
|
console.log('[DOMContentLoaded] setup returned:', result ? Object.keys(result).slice(0, 10) : 'null');
|
|
1869
1869
|
if (typeof result === 'object' && result !== null) {
|
|
1870
|
-
|
|
1870
|
+
assignTemplateScope(componentScope, result);
|
|
1871
1871
|
}
|
|
1872
1872
|
}
|
|
1873
1873
|
catch (e) {
|
|
@@ -1875,7 +1875,7 @@ else {
|
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
1877
|
});
|
|
1878
|
-
var pageScopeSnapshot =
|
|
1878
|
+
var pageScopeSnapshot = mergeTemplateScopes(componentScope);
|
|
1879
1879
|
|
|
1880
1880
|
/*
|
|
1881
1881
|
* Any x-data scope the reactive bridge did not reach, initialized here.
|
|
@@ -2012,7 +2012,7 @@ else {
|
|
|
2012
2012
|
// This ensures expressions can access component variables even for elements
|
|
2013
2013
|
// where findElementScope might not work (e.g., cloned elements not yet in DOM)
|
|
2014
2014
|
if (scopeVars) {
|
|
2015
|
-
componentScope =
|
|
2015
|
+
componentScope = mergeTemplateScopes(componentScope, scopeVars);
|
|
2016
2016
|
}
|
|
2017
2017
|
|
|
2018
2018
|
console.log('[stx] calling processElement on scope:', scopeId, 'componentScope keys:', Object.keys(componentScope).length, 'scopeVars keys:', Object.keys(scopeVars).length);
|
|
@@ -2377,7 +2377,7 @@ finally {
|
|
|
2377
2377
|
const signal = scope[varName];
|
|
2378
2378
|
if (signal && signal._isSignal) {
|
|
2379
2379
|
return ($event) => {
|
|
2380
|
-
const addValue = toValue(valueExpr, null, true,
|
|
2380
|
+
const addValue = toValue(valueExpr, null, true, mergeTemplateScopes(scope, { $event: $event }));
|
|
2381
2381
|
signal.update(n => {
|
|
2382
2382
|
switch (op) {
|
|
2383
2383
|
case '+': return n + addValue;
|
|
@@ -2399,7 +2399,7 @@ finally {
|
|
|
2399
2399
|
const signal = scope[varName];
|
|
2400
2400
|
if (signal && signal._isSignal) {
|
|
2401
2401
|
return ($event) => {
|
|
2402
|
-
const newValue = toValue(valueExpr, null, true,
|
|
2402
|
+
const newValue = toValue(valueExpr, null, true, mergeTemplateScopes(scope, { $event: $event }));
|
|
2403
2403
|
signal.set(newValue);
|
|
2404
2404
|
};
|
|
2405
2405
|
}
|
|
@@ -2478,7 +2478,26 @@ finally {
|
|
|
2478
2478
|
for (let i = 0; i < keys.length; i++) args[i] = scope[keys[i]];
|
|
2479
2479
|
return args;
|
|
2480
2480
|
}
|
|
2481
|
-
`;var ke=`
|
|
2481
|
+
`;var ke=` // Setup accessors refer to lexical variables assigned after mounting. Scope
|
|
2482
|
+
// copies preserve those accessors so rows and event closures do not freeze
|
|
2483
|
+
// their setup-time values. Data properties retain ordinary spread semantics.
|
|
2484
|
+
function assignTemplateScope(target, ...sources) {
|
|
2485
|
+
for (var source of sources) {
|
|
2486
|
+
if (!source) continue;
|
|
2487
|
+
for (var key of Object.keys(source)) {
|
|
2488
|
+
var descriptor = Object.getOwnPropertyDescriptor(source, key);
|
|
2489
|
+
descriptor.configurable = true;
|
|
2490
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
2491
|
+
Object.defineProperty(target, key, descriptor);
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
return target;
|
|
2495
|
+
}
|
|
2496
|
+
function mergeTemplateScopes(...sources) {
|
|
2497
|
+
return assignTemplateScope({}, ...sources);
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
let componentScope = { $refs: {} };
|
|
2482
2501
|
|
|
2483
2502
|
// Current element being processed (for scope lookup)
|
|
2484
2503
|
let currentElement = null;
|
|
@@ -2509,7 +2528,7 @@ finally {
|
|
|
2509
2528
|
}
|
|
2510
2529
|
// First try component-level scope
|
|
2511
2530
|
const elementScope = findElementScope(el || currentElement);
|
|
2512
|
-
const baseScope =
|
|
2531
|
+
const baseScope = mergeTemplateScopes(globalHelpers, componentScope, (elementScope || {}), extraScope);
|
|
2513
2532
|
|
|
2514
2533
|
// Check for pipe syntax (Feature #2)
|
|
2515
2534
|
const pipeResult = parsePipeExpression(expr, baseScope);
|
|
@@ -2759,7 +2778,7 @@ catch (e) {
|
|
|
2759
2778
|
}
|
|
2760
2779
|
throw e;
|
|
2761
2780
|
}
|
|
2762
|
-
}`;function
|
|
2781
|
+
}`;function Te(t,a){return` // ==========================================================================
|
|
2763
2782
|
// Declarative Data Fetching (Feature #6 - useFetch)
|
|
2764
2783
|
// ==========================================================================
|
|
2765
2784
|
|
|
@@ -2900,7 +2919,7 @@ else if (immediate) {
|
|
|
2900
2919
|
get isEmpty() { return !loading() && !data(); }
|
|
2901
2920
|
};
|
|
2902
2921
|
}
|
|
2903
|
-
`}var
|
|
2922
|
+
`}var Ae=` function bindFor(el, passedScope = componentScope, attrName = '@for') {
|
|
2904
2923
|
if (el.__stx_for_bound) return;
|
|
2905
2924
|
el.__stx_for_bound = true;
|
|
2906
2925
|
const expr = el.getAttribute(attrName);
|
|
@@ -3086,7 +3105,7 @@ else {
|
|
|
3086
3105
|
return expression;
|
|
3087
3106
|
}
|
|
3088
3107
|
// Use passedScope instead of componentScope to preserve context through nested processing
|
|
3089
|
-
const scope =
|
|
3108
|
+
const scope = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), extraScope);
|
|
3090
3109
|
const unwrapScope = createAutoUnwrapProxy(scope, function(prop) {
|
|
3091
3110
|
if (typeof prop !== 'string') return false;
|
|
3092
3111
|
return expressionCallsSignal(expression, prop)
|
|
@@ -3107,7 +3126,7 @@ catch (e) {
|
|
|
3107
3126
|
const evalLazy = (expression, extraScope = {}) => {
|
|
3108
3127
|
try {
|
|
3109
3128
|
if (/^__[A-Z_]+__$/.test(expression.trim())) return expression;
|
|
3110
|
-
const scope =
|
|
3129
|
+
const scope = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), extraScope);
|
|
3111
3130
|
const unwrapScope = createAutoUnwrapProxy(scope, function(prop) {
|
|
3112
3131
|
if (typeof prop !== 'string') return false;
|
|
3113
3132
|
return expressionCallsSignal(expression, prop)
|
|
@@ -3176,9 +3195,9 @@ catch (e) {
|
|
|
3176
3195
|
itemSignal._isStxLoopItem = true;
|
|
3177
3196
|
const indexSignal = state(index);
|
|
3178
3197
|
|
|
3179
|
-
const itemScope =
|
|
3180
|
-
itemScope
|
|
3181
|
-
if (indexName) itemScope
|
|
3198
|
+
const itemScope = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}));
|
|
3199
|
+
Object.defineProperty(itemScope, itemName, { value: itemSignal, writable: true, enumerable: true, configurable: true });
|
|
3200
|
+
if (indexName) Object.defineProperty(itemScope, indexName, { value: indexSignal, writable: true, enumerable: true, configurable: true });
|
|
3182
3201
|
|
|
3183
3202
|
const elements = [];
|
|
3184
3203
|
if (isTemplate) {
|
|
@@ -3300,7 +3319,7 @@ catch (e) {
|
|
|
3300
3319
|
var rootInScope = true;
|
|
3301
3320
|
var rootVal;
|
|
3302
3321
|
try {
|
|
3303
|
-
var diagMerged =
|
|
3322
|
+
var diagMerged = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}));
|
|
3304
3323
|
var firstIdent = listExpr.match(/^[A-Za-z_$][\\w$]*/);
|
|
3305
3324
|
rootName = firstIdent ? firstIdent[0] : '?';
|
|
3306
3325
|
rootInScope = Object.prototype.hasOwnProperty.call(diagMerged, rootName);
|
|
@@ -3665,7 +3684,7 @@ catch (e) {
|
|
|
3665
3684
|
}
|
|
3666
3685
|
// First try component-level scope
|
|
3667
3686
|
const elementScope = findElementScope(el || currentElement);
|
|
3668
|
-
const scope =
|
|
3687
|
+
const scope = mergeTemplateScopes(globalHelpers, componentScope, (elementScope || {}));
|
|
3669
3688
|
|
|
3670
3689
|
// Check for shorthand syntax (Feature #8)
|
|
3671
3690
|
const shorthandFn = parseEventShorthand(expr, scope);
|
|
@@ -4146,7 +4165,7 @@ catch (e) {
|
|
|
4146
4165
|
el.__stx_parent_scope = el.__stx_parent_scope
|
|
4147
4166
|
|| resolveComponentCallerScope(el, componentScope);
|
|
4148
4167
|
bindParentComponentProps(el, el.__stx_parent_scope);
|
|
4149
|
-
|
|
4168
|
+
assignTemplateScope(componentScope, scopeVars);
|
|
4150
4169
|
el.__stx_disposers = trackEffects(function() { processElement(el, componentScope); });
|
|
4151
4170
|
if (scopeVars.__mountCallbacks && !scopeVars.__mounted) {
|
|
4152
4171
|
scopeVars.__mounted = true;
|
|
@@ -4329,7 +4348,7 @@ catch (e) {
|
|
|
4329
4348
|
s.el.__stx_audit_recovered = true;
|
|
4330
4349
|
try {
|
|
4331
4350
|
var vars = s.registered ? window.stx._scopes[s.id] : null;
|
|
4332
|
-
if (vars)
|
|
4351
|
+
if (vars) assignTemplateScope(componentScope, vars);
|
|
4333
4352
|
s.el.__stx_disposers = trackEffects(function() { processElement(s.el, componentScope); });
|
|
4334
4353
|
s.el.removeAttribute('x-cloak');
|
|
4335
4354
|
s.el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
|
|
@@ -4387,7 +4406,7 @@ catch (e) {
|
|
|
4387
4406
|
var parent = head.parentNode;
|
|
4388
4407
|
if (!parent) { console.warn('[STX] bindIfChain: head element has no parent, skipping'); return; }
|
|
4389
4408
|
|
|
4390
|
-
var capturedComponentScope =
|
|
4409
|
+
var capturedComponentScope = mergeTemplateScopes(passedScope);
|
|
4391
4410
|
|
|
4392
4411
|
// Detach every branch up-front, leaving a positional placeholder comment
|
|
4393
4412
|
// so reinsertion preserves source order. Mark each as a chain member so
|
|
@@ -4454,7 +4473,7 @@ catch (e) {
|
|
|
4454
4473
|
function evalBranch(b) {
|
|
4455
4474
|
var expression = b.expr;
|
|
4456
4475
|
if (/^__[A-Z_]+__$/.test(expression.trim())) return expression;
|
|
4457
|
-
var scope =
|
|
4476
|
+
var scope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (b.capturedElementScope || {}));
|
|
4458
4477
|
try {
|
|
4459
4478
|
var unwrapScope = createExpressionAutoUnwrapProxy(scope, expression);
|
|
4460
4479
|
// Compiled over the names the expression mentions (see __stxCompileScoped).
|
|
@@ -4618,7 +4637,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
4618
4637
|
// branch picked after render survive their row's removal (#1954).
|
|
4619
4638
|
pick.el.__stx_chain_disposers = trackEffects(function () {
|
|
4620
4639
|
peek(function () {
|
|
4621
|
-
var childScope =
|
|
4640
|
+
var childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (pick.capturedElementScope || {}));
|
|
4622
4641
|
// Components compiled inside any branch of an if/else-if/else
|
|
4623
4642
|
// chain carry scoped setup scripts with them. Branch nodes are
|
|
4624
4643
|
// detached before those scripts can execute, so simply
|
|
@@ -4699,7 +4718,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
4699
4718
|
// Capture BOTH element scope AND passedScope NOW before anything changes
|
|
4700
4719
|
// passedScope may contain @for iteration variables or parent component signals
|
|
4701
4720
|
const capturedElementScope = findElementScope(el);
|
|
4702
|
-
const capturedComponentScope =
|
|
4721
|
+
const capturedComponentScope = mergeTemplateScopes(passedScope);
|
|
4703
4722
|
|
|
4704
4723
|
preserveConditionalComponentScopes(el, capturedComponentScope);
|
|
4705
4724
|
stxHost.insert(parent, placeholder, el);
|
|
@@ -4729,7 +4748,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
4729
4748
|
return expression;
|
|
4730
4749
|
}
|
|
4731
4750
|
try {
|
|
4732
|
-
const scope =
|
|
4751
|
+
const scope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
|
|
4733
4752
|
const unwrapScope = createExpressionAutoUnwrapProxy(scope, expression);
|
|
4734
4753
|
const fn = __stxCompileScoped(unwrapScope, [], 'return ' + expression + '');
|
|
4735
4754
|
return fn(...__stxArgs(fn, unwrapScope));
|
|
@@ -4737,7 +4756,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
|
|
|
4737
4756
|
catch (e1) {
|
|
4738
4757
|
try {
|
|
4739
4758
|
// Retry without the unwrap proxy so call-syntax (signal()) works.
|
|
4740
|
-
const scope2 =
|
|
4759
|
+
const scope2 = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
|
|
4741
4760
|
const fn2 = __stxCompileScoped(scope2, [], 'return ' + expression + '');
|
|
4742
4761
|
return fn2(...__stxArgs(fn2, scope2));
|
|
4743
4762
|
}
|
|
@@ -4755,7 +4774,7 @@ catch (e2) {
|
|
|
4755
4774
|
const processChildrenWithScope = () => {
|
|
4756
4775
|
// Build the combined scope for children - no need to modify global componentScope
|
|
4757
4776
|
// Just pass the scope explicitly to processElement
|
|
4758
|
-
const childScope =
|
|
4777
|
+
const childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
|
|
4759
4778
|
|
|
4760
4779
|
|
|
4761
4780
|
Array.from(el.childNodes).forEach(child => processElement(child, childScope));
|
|
@@ -4769,7 +4788,7 @@ catch (e2) {
|
|
|
4769
4788
|
// inserted and left inert, so bindings such as :text and {{ expression }}
|
|
4770
4789
|
// leaked into the rendered UI until the condition toggled.
|
|
4771
4790
|
const processTemplateNodes = (nodes) => {
|
|
4772
|
-
const childScope =
|
|
4791
|
+
const childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
|
|
4773
4792
|
// Components compiled inside a <template :if> carry setup scripts in the
|
|
4774
4793
|
// template content. Browser-cloned scripts are inert, so register their
|
|
4775
4794
|
// scopes and forwarded props before walking the inserted branch. This is
|
|
@@ -4788,7 +4807,7 @@ catch (e2) {
|
|
|
4788
4807
|
|
|
4789
4808
|
// Evaluate the :if expression \u2014 use direct signal read for simple refs,
|
|
4790
4809
|
// falling back to evalExpr for complex expressions
|
|
4791
|
-
const fullScope =
|
|
4810
|
+
const fullScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
|
|
4792
4811
|
const directSignal = fullScope[expr];
|
|
4793
4812
|
|
|
4794
4813
|
effect(() => {
|
|
@@ -4956,7 +4975,7 @@ else if (!value && isInserted) {
|
|
|
4956
4975
|
detachedBranches.add(resume);
|
|
4957
4976
|
return;
|
|
4958
4977
|
}
|
|
4959
|
-
var childScope =
|
|
4978
|
+
var childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
|
|
4960
4979
|
// A false single-element conditional is detached before the
|
|
4961
4980
|
// DOMContentLoaded component-scope pass. When it becomes visible,
|
|
4962
4981
|
// hydrate any component roots in the restored subtree first so
|
|
@@ -5086,7 +5105,7 @@ else if (!value && isInserted) {
|
|
|
5086
5105
|
var effectiveScope = scope;
|
|
5087
5106
|
if (sid) {
|
|
5088
5107
|
var reg = window.stx._scopes ? window.stx._scopes[sid] : null;
|
|
5089
|
-
if (reg) effectiveScope =
|
|
5108
|
+
if (reg) effectiveScope = mergeTemplateScopes(scope, reg);
|
|
5090
5109
|
}
|
|
5091
5110
|
// Walk children and process them with the (now scope-merged) context
|
|
5092
5111
|
Array.from(el.children).forEach(function(child) { processElement(child, effectiveScope); });
|
|
@@ -5196,7 +5215,7 @@ else if (!value && isInserted) {
|
|
|
5196
5215
|
run();
|
|
5197
5216
|
}
|
|
5198
5217
|
}
|
|
5199
|
-
`;var
|
|
5218
|
+
`;var He=` // ==========================================================================
|
|
5200
5219
|
// Lifecycle
|
|
5201
5220
|
// ==========================================================================
|
|
5202
5221
|
|
|
@@ -5530,7 +5549,7 @@ else if (!value && isInserted) {
|
|
|
5530
5549
|
finally { activeDestroySink = outerSink; }
|
|
5531
5550
|
var localMountHooks = mountCallbacks.splice(mountStart);
|
|
5532
5551
|
var localDestroyHooks = destroyCallbacks.splice(destroyStart);
|
|
5533
|
-
var scope =
|
|
5552
|
+
var scope = mergeTemplateScopes({ $refs: {} }, values);
|
|
5534
5553
|
var disposeEffects = trackEffects(function() {
|
|
5535
5554
|
processFromManifest(root, scope, manifest, resolvedNodes);
|
|
5536
5555
|
});
|
|
@@ -5568,7 +5587,7 @@ else if (!value && isInserted) {
|
|
|
5568
5587
|
const tag = el.tagName.toLowerCase();
|
|
5569
5588
|
const type = el.type;
|
|
5570
5589
|
const modifiers = attrName.split('.').slice(1);
|
|
5571
|
-
const capturedScope =
|
|
5590
|
+
const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
|
|
5572
5591
|
const coerceValue = (value) => {
|
|
5573
5592
|
var next = value;
|
|
5574
5593
|
if (modifiers.includes('trim') && typeof next === 'string') next = next.trim();
|
|
@@ -5756,7 +5775,7 @@ else {
|
|
|
5756
5775
|
}
|
|
5757
5776
|
|
|
5758
5777
|
var disposeEffects = trackEffects(function() {
|
|
5759
|
-
processElement(root,
|
|
5778
|
+
processElement(root, mergeTemplateScopes(componentScope, (scope || {})));
|
|
5760
5779
|
});
|
|
5761
5780
|
root.__stx_disposers = disposeEffects;
|
|
5762
5781
|
|
|
@@ -5923,12 +5942,12 @@ else {
|
|
|
5923
5942
|
// caller, not a replacement for its handlers/refs/prop signals.
|
|
5924
5943
|
if (root.hasAttribute('data-stx-component-wrapper')) root.__stx_parent_scope = scope;
|
|
5925
5944
|
else root.__stx_scope = scope;
|
|
5926
|
-
|
|
5945
|
+
assignTemplateScope(componentScope, scope); // Keep for backwards compat
|
|
5927
5946
|
}
|
|
5928
5947
|
|
|
5929
5948
|
// Walk DOM and bind directives, tracking effects for cleanup
|
|
5930
5949
|
var disposeEffects = trackEffects(function() {
|
|
5931
|
-
processElement(root,
|
|
5950
|
+
processElement(root, mergeTemplateScopes(componentScope, (scope || {})));
|
|
5932
5951
|
});
|
|
5933
5952
|
root.__stx_disposers = disposeEffects;
|
|
5934
5953
|
|
|
@@ -7238,14 +7257,14 @@ else {
|
|
|
7238
7257
|
if (el.hasAttribute('x-data') || el.hasAttribute('data-stx-xdata') || el.__stx_scope) {
|
|
7239
7258
|
var xdScope = el.__stx_scope || (findElementScope(el) || {});
|
|
7240
7259
|
if (xdScope && Object.keys(xdScope).length > 0) {
|
|
7241
|
-
scope =
|
|
7260
|
+
scope = mergeTemplateScopes(scope, xdScope);
|
|
7242
7261
|
}
|
|
7243
7262
|
}
|
|
7244
7263
|
// v-memo / @memo \u2014 skip re-processing if dependency values haven't changed
|
|
7245
7264
|
if (el.hasAttribute('data-stx-memo')) {
|
|
7246
7265
|
var memoExpr = el.getAttribute('data-stx-memo');
|
|
7247
7266
|
try {
|
|
7248
|
-
var memoScope =
|
|
7267
|
+
var memoScope = mergeTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
|
|
7249
7268
|
var memoFn = __stxCompileScoped(memoScope, [], 'return ' + memoExpr);
|
|
7250
7269
|
var memoVals = JSON.stringify(memoFn(...__stxArgs(memoFn, memoScope)));
|
|
7251
7270
|
if (el.__stx_memo_prev === memoVals) {
|
|
@@ -7275,7 +7294,7 @@ else {
|
|
|
7275
7294
|
// Capture scope NOW before effects run asynchronously
|
|
7276
7295
|
// Use the passed scope parameter (not global componentScope) to preserve context
|
|
7277
7296
|
// through nested @if/@for processing where componentScope may be restored
|
|
7278
|
-
const capturedScope =
|
|
7297
|
+
const capturedScope = mergeTemplateScopes(globalHelpers, scope, (findElementScope(parentEl) || {}));
|
|
7279
7298
|
parts.forEach(part => {
|
|
7280
7299
|
const match = part.match(/^\\{\\{\\s*([\\s\\S]+?)\\s*\\}\\}$/);
|
|
7281
7300
|
if (match) {
|
|
@@ -7405,7 +7424,7 @@ else if (part) {
|
|
|
7405
7424
|
|
|
7406
7425
|
// Capture scope once for all attribute bindings on this element
|
|
7407
7426
|
// Use the passed scope parameter to preserve context through nested processing
|
|
7408
|
-
const attrCapturedScope =
|
|
7427
|
+
const attrCapturedScope = mergeTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
|
|
7409
7428
|
|
|
7410
7429
|
// Keep the conditional owners captured while the element is in the tree.
|
|
7411
7430
|
// Walking parents on each update loses an outer owner when an inner :if
|
|
@@ -7762,8 +7781,8 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
7762
7781
|
// Capture scope at setup time so @for loop variables are available when event fires
|
|
7763
7782
|
const isForwardedComponentEvent = !!(el.__stx_parent_scope && parentEventNames.includes(eventName));
|
|
7764
7783
|
let eventCapturedScope = isForwardedComponentEvent
|
|
7765
|
-
?
|
|
7766
|
-
:
|
|
7784
|
+
? mergeTemplateScopes(globalHelpers, el.__stx_parent_scope)
|
|
7785
|
+
: mergeTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
|
|
7767
7786
|
|
|
7768
7787
|
stxHost.listen(el, eventName, (event) => {
|
|
7769
7788
|
// A forwarded handler belongs to the caller, whose scope can be
|
|
@@ -7772,7 +7791,7 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
7772
7791
|
// page's scope and only later handed its real caller, so
|
|
7773
7792
|
// @pick="pickFromBank" found nothing and did nothing. Read it now.
|
|
7774
7793
|
if (isForwardedComponentEvent && el.__stx_parent_scope)
|
|
7775
|
-
eventCapturedScope =
|
|
7794
|
+
eventCapturedScope = mergeTemplateScopes(globalHelpers, el.__stx_parent_scope);
|
|
7776
7795
|
// Vue-style component listeners fall through to the rendered native
|
|
7777
7796
|
// root unless the child emits the same event. Signal components use
|
|
7778
7797
|
// a scope wrapper, so native events arrive here from a descendant.
|
|
@@ -8382,7 +8401,7 @@ ${t}
|
|
|
8382
8401
|
if (el.__stx_show_bound) return;
|
|
8383
8402
|
el.__stx_show_bound = true;
|
|
8384
8403
|
|
|
8385
|
-
const capturedScope =
|
|
8404
|
+
const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
|
|
8386
8405
|
|
|
8387
8406
|
// Check if the expression is a simple signal reference (most common case for :show)
|
|
8388
8407
|
const directSignal = capturedScope[expr];
|
|
@@ -8506,7 +8525,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
8506
8525
|
usedLatestSetup = true;
|
|
8507
8526
|
if (typeof setupResult === 'object' && setupResult !== null) {
|
|
8508
8527
|
console.log('[stx:load] _latestSetup keys:', Object.keys(setupResult).slice(0, 10));
|
|
8509
|
-
|
|
8528
|
+
assignTemplateScope(componentScope, setupResult);
|
|
8510
8529
|
}
|
|
8511
8530
|
} catch (e) {
|
|
8512
8531
|
console.error('[stx:load] _latestSetup error:', e);
|
|
@@ -8522,11 +8541,11 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
8522
8541
|
var setupName = el.getAttribute('data-stx');
|
|
8523
8542
|
if (setupName && window[setupName]) {
|
|
8524
8543
|
var result = window[setupName]();
|
|
8525
|
-
if (typeof result === 'object')
|
|
8544
|
+
if (typeof result === 'object') assignTemplateScope(componentScope, result);
|
|
8526
8545
|
}
|
|
8527
8546
|
});
|
|
8528
8547
|
}
|
|
8529
|
-
var spaPageScopeSnapshot =
|
|
8548
|
+
var spaPageScopeSnapshot = mergeTemplateScopes(componentScope);
|
|
8530
8549
|
|
|
8531
8550
|
// Routed component mount scripts execute after DOMContentLoaded. Queue them
|
|
8532
8551
|
// until the destination page setup is active so projected props and parent
|
|
@@ -8597,7 +8616,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
8597
8616
|
// the two share take the component's value for the page. The offline
|
|
8598
8617
|
// banner's connected flag read as a Settings card's "Connected".
|
|
8599
8618
|
if (el.__stx_disposers) return;
|
|
8600
|
-
|
|
8619
|
+
assignTemplateScope(componentScope, scopeVars);
|
|
8601
8620
|
var disposeEffects = trackEffects(function() { processElement(el, componentScope); });
|
|
8602
8621
|
el.__stx_disposers = disposeEffects;
|
|
8603
8622
|
// A replacement layout's scope can live outside the router container.
|
|
@@ -8616,7 +8635,7 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
8616
8635
|
// full load binds the page before any component, so it never saw this.
|
|
8617
8636
|
// A component's own bindings resolve its locals through its scope element,
|
|
8618
8637
|
// and a name only a component declares stays reachable as before.
|
|
8619
|
-
|
|
8638
|
+
assignTemplateScope(componentScope, spaPageScopeSnapshot);
|
|
8620
8639
|
|
|
8621
8640
|
// Process the container content \u2014 bind {{ }}, :attr, @event directives.
|
|
8622
8641
|
// Run synchronously (not in setTimeout) so componentScope is captured correctly.
|
|
@@ -9349,7 +9368,7 @@ finally {
|
|
|
9349
9368
|
return s;
|
|
9350
9369
|
}`;var ht=` function bindStyle(el, expr, passedScope = componentScope, isVisible) {
|
|
9351
9370
|
// Capture scope at setup time - use passed scope to preserve context
|
|
9352
|
-
const capturedScope =
|
|
9371
|
+
const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
|
|
9353
9372
|
|
|
9354
9373
|
const evalExpr = () => {
|
|
9355
9374
|
// Mirror bindClass: first try the auto-unwrap proxy (so an expression
|
|
@@ -10288,7 +10307,7 @@ else if (timer === null) {
|
|
|
10288
10307
|
subscribe: subscribe
|
|
10289
10308
|
};
|
|
10290
10309
|
}
|
|
10291
|
-
`;function
|
|
10310
|
+
`;function Ve(){let t=xt(ln());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function ln(){return`${ae}${Oe}
|
|
10292
10311
|
${Je(ie,Se,Ee)}
|
|
10293
10312
|
|
|
10294
10313
|
${Re}
|
|
@@ -10296,9 +10315,9 @@ ${nt}
|
|
|
10296
10315
|
${et}
|
|
10297
10316
|
${dt}
|
|
10298
10317
|
${_e}
|
|
10299
|
-
${
|
|
10318
|
+
${He}
|
|
10300
10319
|
${bt}
|
|
10301
|
-
${
|
|
10320
|
+
${Te(Q.toString(),Y.toString())}
|
|
10302
10321
|
${ot}
|
|
10303
10322
|
${We}
|
|
10304
10323
|
${Qe}
|
|
@@ -10315,7 +10334,7 @@ ${se}
|
|
|
10315
10334
|
${de}
|
|
10316
10335
|
${fe}
|
|
10317
10336
|
${Ke}
|
|
10318
|
-
${tt(
|
|
10337
|
+
${tt(ia(),aa(),oa())}
|
|
10319
10338
|
|
|
10320
10339
|
${ft}
|
|
10321
10340
|
${it}
|
|
@@ -10326,7 +10345,7 @@ ${yt}
|
|
|
10326
10345
|
${Ue}
|
|
10327
10346
|
${ue}
|
|
10328
10347
|
${Be}
|
|
10329
|
-
${
|
|
10348
|
+
${Ae}
|
|
10330
10349
|
${qe}
|
|
10331
10350
|
${he}
|
|
10332
10351
|
${Pe}
|
|
@@ -10366,5 +10385,5 @@ ${lt}
|
|
|
10366
10385
|
${ct}
|
|
10367
10386
|
${at}
|
|
10368
10387
|
})();
|
|
10369
|
-
`}var
|
|
10370
|
-
export{
|
|
10388
|
+
`}var Cu={state:K,derived:un,effect:dn,batch:os,onMount:Qn,onDestroy:er,isSignal:pn,isDerived:fn,untrack:is,peek:tr,generateSignalsRuntime:Ve,generateSignalsRuntimeDev:ln};
|
|
10389
|
+
export{Ve,ln,Cu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ge,Rc,rd,sd,od,id,Ac,Pc,ad,cd,mi,ld,wn,xn,cr}from"./chunk-b5cv9xp7.js";import"./chunk-62kxavc5.js";import"./chunk-2wvz3fd2.js";import"./chunk-nz6bzffm.js";import"./chunk-70npkeh2.js";import"./chunk-3p2b88pd.js";import"./chunk-7ky2ny63.js";import"./chunk-evs5gb3q.js";import"./chunk-9b4e815s.js";import"./chunk-4fv3jq16.js";import"./chunk-rns21kkv.js";import"./chunk-d1ya7f79.js";import"./chunk-1ma56c2h.js";export{id as __setSignalsGeneratorsForTest,Ge as cacheEngineFingerprint,xn as cacheTemplate,wn as checkCache,ld as clearDevCaches,Pc as getCachedRouterScript,Ac as getCachedSignalsRuntime,ad as getServeClientAsset,mi as getServeModuleBundle,cr as hashFilePath,sd as invalidateFileCache,od as invalidateFileCacheByDir,rd as readFileCached,cd as registerServeModuleBundle,Rc as templateCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ir,kc,Zu,_c,Qu,Cc,ar,b,Mt,Ce,Ec,xs,Tc,ed,Z,$c,td,x,nd}from"./chunk-b5cv9xp7.js";import"./chunk-62kxavc5.js";import"./chunk-2wvz3fd2.js";import"./chunk-nz6bzffm.js";import"./chunk-70npkeh2.js";import"./chunk-3p2b88pd.js";import"./chunk-7ky2ny63.js";import"./chunk-evs5gb3q.js";import"./chunk-9b4e815s.js";import"./chunk-4fv3jq16.js";import"./chunk-rns21kkv.js";import"./chunk-d1ya7f79.js";import"./chunk-1ma56c2h.js";export{$c as applyFilters,Qu as clearCustomFilters,Ec as clientLoopScopes,ir as defaultFilters,b as escapeHtml,Mt as escapeHtmlValue,x as evaluateExpression,Cc as findMustacheEnd,_c as getAllFilters,Tc as interpolateScriptAttributes,xs as interpolateScriptExpressions,ed as interpolateScriptsInTemplate,Z as processExpressions,kc as registerFilter,Zu as registerFilters,ar as replaceInterpolations,td as resetRejectedExpressionWarnings,nd as unescapeHtml,Ce as usesSignalsInScript};
|