@stacksjs/stx 0.2.583 → 0.2.584
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-ck1yca7g.js → chunk-03qf2z4d.js} +1 -1
- package/dist/{chunk-hp9nxva6.js → chunk-07869zev.js} +4 -4
- package/dist/chunk-08g5j4fq.js +2 -0
- package/dist/chunk-0hpw65yr.js +2 -0
- package/dist/chunk-11jmasqb.js +2 -0
- package/dist/chunk-2c7ysn9s.js +2 -0
- package/dist/chunk-2wb1w0p6.js +2 -0
- package/dist/chunk-2wx2aczp.js +2 -0
- package/dist/chunk-325dn55d.js +4 -0
- package/dist/chunk-34kxj258.js +2 -0
- package/dist/{chunk-ktyctev3.js → chunk-3y5tzxm6.js} +2 -2
- package/dist/{chunk-h0a2s340.js → chunk-49xtxzr8.js} +2 -2
- package/dist/chunk-4efqcpg5.js +2 -0
- package/dist/{chunk-5kh5ehfh.js → chunk-4h58as2c.js} +2 -2
- package/dist/chunk-4k6h00kk.js +2 -0
- package/dist/{chunk-ky1426s1.js → chunk-4myvw20e.js} +10 -10
- package/dist/chunk-4szz2esp.js +2 -0
- package/dist/chunk-4wkghwag.js +2 -0
- package/dist/chunk-53grq69s.js +2 -0
- package/dist/chunk-55n8mhq4.js +2 -0
- package/dist/chunk-5s229r1e.js +2 -0
- package/dist/{chunk-521pe0hb.js → chunk-5zg3xj45.js} +4 -4
- package/dist/{chunk-ye66wc53.js → chunk-67m2prah.js} +2 -2
- package/dist/chunk-6djvj6hg.js +2 -0
- package/dist/chunk-6ebj7gfr.js +2 -0
- package/dist/{chunk-4pmgr32a.js → chunk-6hgngmn0.js} +3 -3
- package/dist/chunk-71tnfe1n.js +2 -0
- package/dist/{chunk-mjj24qpb.js → chunk-794v5crp.js} +2 -2
- package/dist/chunk-7dkwf9h5.js +2 -0
- package/dist/{chunk-cnknvvwm.js → chunk-7fghm9zy.js} +1 -1
- package/dist/{chunk-02qaqamv.js → chunk-7ra30crf.js} +7 -7
- package/dist/{chunk-117xss52.js → chunk-7xw1e8t6.js} +2 -2
- package/dist/{chunk-w6wtxj54.js → chunk-7ydavm3h.js} +2 -2
- package/dist/{chunk-qdyp2zqf.js → chunk-82bttwqm.js} +2 -2
- package/dist/chunk-8992smwz.js +2 -0
- package/dist/{chunk-qn8gdw21.js → chunk-8s7zbhdd.js} +4 -4
- package/dist/chunk-8zn83jfs.js +2 -0
- package/dist/{chunk-h3z9b6bw.js → chunk-96zgn94z.js} +11 -11
- package/dist/{chunk-6m3me7yj.js → chunk-9cpxzze0.js} +9 -9
- package/dist/{chunk-6fc8vw2v.js → chunk-9e091vkf.js} +3 -3
- package/dist/chunk-9pk5jhqa.js +3 -0
- package/dist/{chunk-09zwhsf9.js → chunk-9r5w6s80.js} +3 -3
- package/dist/{chunk-c0h2eqe0.js → chunk-a8n6mt7s.js} +2 -2
- package/dist/{chunk-ac6v3s3k.js → chunk-agy4mxn8.js} +2 -2
- package/dist/{chunk-mt9x626h.js → chunk-axz1x4r9.js} +5 -5
- package/dist/{chunk-07anexcg.js → chunk-b5van393.js} +2 -2
- package/dist/{chunk-w3rmepwy.js → chunk-bfbmdjh4.js} +2 -2
- package/dist/chunk-bqtph83n.js +2 -0
- package/dist/chunk-bs1bdhvp.js +2 -0
- package/dist/{chunk-0k5faspy.js → chunk-bsy10tz6.js} +6 -6
- package/dist/chunk-c1c4sh7t.js +2 -0
- package/dist/{chunk-dvc15djp.js → chunk-c6egfhy6.js} +2 -2
- package/dist/chunk-ce2d0hz9.js +2 -0
- package/dist/chunk-cjq9k1xb.js +2 -0
- package/dist/{chunk-ym1sb5bg.js → chunk-d2jb1rkp.js} +5 -5
- package/dist/{chunk-nhd9m8h5.js → chunk-d4awfk42.js} +6 -6
- package/dist/chunk-d9vjsqs4.js +2 -0
- package/dist/{chunk-e809x7m0.js → chunk-e26pzdxy.js} +1 -1
- package/dist/{chunk-kfwmqacd.js → chunk-e556dvy4.js} +3 -3
- package/dist/{chunk-cby4mkjf.js → chunk-e6h7pzym.js} +1 -1
- package/dist/{chunk-0dfgefjv.js → chunk-ebfpjnf3.js} +2 -2
- package/dist/chunk-ede39b7h.js +3 -0
- package/dist/chunk-f0fxyh3e.js +2 -0
- package/dist/{chunk-4srg0qbv.js → chunk-f29fk7dw.js} +2 -2
- package/dist/chunk-fjyhc41r.js +2 -0
- package/dist/{chunk-vke73gts.js → chunk-fkq55rh7.js} +1 -1
- package/dist/chunk-fn4wwgnc.js +2 -0
- package/dist/{chunk-pbwk8tzz.js → chunk-g8mxprxj.js} +1 -1
- package/dist/chunk-h2534p6q.js +2 -0
- package/dist/{chunk-2nehykbm.js → chunk-h7atbtds.js} +5 -5
- package/dist/{chunk-nh3svtvj.js → chunk-h988fxh3.js} +5 -5
- package/dist/chunk-hr34x6sx.js +2 -0
- package/dist/{chunk-en7xxgtb.js → chunk-hsy9rhct.js} +2 -2
- package/dist/chunk-hygxh993.js +2 -0
- package/dist/{chunk-s12bnv32.js → chunk-hz11wmx9.js} +2 -2
- package/dist/{chunk-wyn5rfzk.js → chunk-j7kcjgxy.js} +115 -26
- package/dist/chunk-j87tntna.js +2 -0
- package/dist/{chunk-ycj0342k.js → chunk-jqbk6pfk.js} +2 -2
- package/dist/{chunk-vkc51n9m.js → chunk-k1szsenr.js} +2 -2
- package/dist/{chunk-xp7fxc6p.js → chunk-k3rnpjxf.js} +5 -5
- package/dist/{chunk-sv08pd66.js → chunk-k71e38fk.js} +4 -4
- package/dist/chunk-kgtnfvqb.js +2 -0
- package/dist/chunk-krwrx9x9.js +2 -0
- package/dist/{chunk-je1as16r.js → chunk-m3w67x05.js} +5 -5
- package/dist/chunk-m5j8hht5.js +2 -0
- package/dist/chunk-mc8j6dwa.js +2 -0
- package/dist/{chunk-vpdx7qr3.js → chunk-mmbspaqh.js} +2 -2
- package/dist/{chunk-hzqyfdpy.js → chunk-n0t938d2.js} +7 -7
- package/dist/{chunk-8tq83fq7.js → chunk-n2gy2arh.js} +57 -57
- package/dist/chunk-n2j3pn9s.js +2 -0
- package/dist/{chunk-sv5nvfmb.js → chunk-np6nm4rq.js} +2 -2
- package/dist/chunk-ns1jqzqk.js +2 -0
- package/dist/chunk-p973efbe.js +2 -0
- package/dist/{chunk-m8tm44rq.js → chunk-pg164sdw.js} +2 -2
- package/dist/{chunk-x552npae.js → chunk-pxw4edw8.js} +4 -4
- package/dist/{chunk-1r1maqep.js → chunk-q1cvef6b.js} +3 -3
- package/dist/chunk-q765v7b2.js +2 -0
- package/dist/{chunk-96mb3brj.js → chunk-qebxzf9w.js} +3 -3
- package/dist/{chunk-jpqkm8tm.js → chunk-qf3axv86.js} +3 -3
- package/dist/{chunk-dhq80e4r.js → chunk-qhr1tkhj.js} +7 -7
- package/dist/chunk-qq59xzwc.js +2 -0
- package/dist/chunk-r0e743c3.js +2 -0
- package/dist/{chunk-qccgncp2.js → chunk-rdm5mfc5.js} +6 -6
- package/dist/chunk-s043hpvd.js +2 -0
- package/dist/{chunk-m417sp42.js → chunk-s1ptn02h.js} +3 -3
- package/dist/{chunk-g9zeybqh.js → chunk-s5vxxwg6.js} +2 -2
- package/dist/chunk-sckze59r.js +2 -0
- package/dist/chunk-sjkdpsca.js +3 -0
- package/dist/chunk-sr1md7vv.js +2845 -0
- package/dist/chunk-t431anrx.js +2 -0
- package/dist/chunk-t7mxbt40.js +2 -0
- package/dist/{chunk-r47cs92n.js → chunk-tc15vkfh.js} +2 -2
- package/dist/{chunk-6z3e1tyz.js → chunk-tnafnb23.js} +1 -1
- package/dist/{chunk-ah9xyss2.js → chunk-v8ze2q95.js} +2 -2
- package/dist/{chunk-xytkfa48.js → chunk-vf15db1j.js} +6 -6
- package/dist/chunk-vvqxbhfx.js +2 -0
- package/dist/{chunk-dm1qh2vq.js → chunk-w24qmxc3.js} +3 -3
- package/dist/chunk-w7zgftez.js +2 -0
- package/dist/chunk-wfp36qf4.js +2 -0
- package/dist/chunk-wn2gzwmv.js +2 -0
- package/dist/{chunk-wwj8zbzc.js → chunk-wywprjc5.js} +5 -5
- package/dist/chunk-x5qymgxa.js +2 -0
- package/dist/chunk-xfe2nzxd.js +2 -0
- package/dist/chunk-xjwgzp6s.js +2 -0
- package/dist/chunk-xyepqdjy.js +2 -0
- package/dist/chunk-y5ryjdpv.js +122 -0
- package/dist/{chunk-3e3dpp7w.js → chunk-y5x8xnnf.js} +3 -3
- package/dist/chunk-yhqaafsw.js +2 -0
- package/dist/{chunk-4pkpr5cg.js → chunk-z2mg470f.js} +4 -4
- package/dist/chunk-z7trbwn3.js +2 -0
- package/dist/{chunk-2943qhdt.js → chunk-zgv1h2np.js} +2 -2
- package/dist/{chunk-bj29pwm0.js → chunk-zrw1zf54.js} +3 -3
- package/dist/chunk-zxf8f71v.js +2 -0
- package/dist/chunk-zxt75k06.js +2 -0
- package/dist/cli.js +20 -20
- package/dist/client/signals-host-runtime.js +52 -1
- package/dist/client/signals-manifest-hydration-runtime.js +13 -0
- package/dist/client/signals-overlay-runtime.js +29 -6
- package/dist/client/signals-public-api-runtime.js +2 -0
- package/dist/client/signals-style-runtime.js +1 -1
- package/dist/component-renderer.js +26 -6
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/design-tokens.d.ts +4 -0
- package/dist/native/compiler/design-tokens.js +28 -0
- package/dist/native/compiler/headwind-to-style.d.ts +5 -4
- package/dist/native/compiler/headwind-to-style.js +105 -65
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +47 -243
- package/dist/native/compiler/inline-style.d.ts +13 -0
- package/dist/native/compiler/inline-style.js +285 -0
- package/dist/native/compiler/ir.d.ts +5 -1
- package/dist/native/compiler/render-screen.js +3 -1
- package/dist/native/compiler/style-variables.d.ts +8 -0
- package/dist/native/compiler/style-variables.js +142 -0
- package/dist/native/compiler/stylesheet-theme.d.ts +6 -0
- package/dist/native/compiler/stylesheet-theme.js +110 -0
- package/dist/native/runtime/craft-bridge.js +3 -1
- package/dist/native/runtime/native-host.d.ts +13 -2
- package/dist/native/runtime/native-host.js +237 -36
- package/dist/native/runtime/overlay-presenter.d.ts +29 -0
- package/dist/native/runtime/overlay-presenter.js +69 -0
- package/dist/native/runtime/shared-screen.js +12 -1
- package/dist/native/runtime/view-operations.d.ts +20 -0
- package/dist/native/runtime/view-operations.js +35 -0
- package/dist/native/testing-mutations.d.ts +4 -0
- package/dist/native/testing-mutations.js +64 -0
- package/dist/native/testing.d.ts +2 -0
- package/dist/native/testing.js +18 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +9 -9
- package/dist/testing.js +2 -0
- package/dist/types/config-types.d.ts +2 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +25 -5
- package/package.json +5 -5
- package/dist/chunk-00p22wzr.js +0 -3
- package/dist/chunk-0fx3ppnt.js +0 -2
- package/dist/chunk-0sfexf9t.js +0 -2
- package/dist/chunk-2927nax9.js +0 -2
- package/dist/chunk-2rj0ttas.js +0 -2
- package/dist/chunk-2rx9d75e.js +0 -4
- package/dist/chunk-3ae39ttg.js +0 -2
- package/dist/chunk-3x6p9me0.js +0 -2
- package/dist/chunk-440yjsk5.js +0 -2
- package/dist/chunk-58z26y07.js +0 -2
- package/dist/chunk-5db5sxy3.js +0 -3
- package/dist/chunk-5r9k9s3m.js +0 -2
- package/dist/chunk-76vza4ve.js +0 -2
- package/dist/chunk-84f9dnq5.js +0 -2
- package/dist/chunk-8tq5x4z8.js +0 -2
- package/dist/chunk-8y8bbsh5.js +0 -2
- package/dist/chunk-9kzycb15.js +0 -2
- package/dist/chunk-agfhb2qd.js +0 -2
- package/dist/chunk-ay6dzpt4.js +0 -2
- package/dist/chunk-b9njk81d.js +0 -2
- package/dist/chunk-bfbcmfww.js +0 -2
- package/dist/chunk-br01jvra.js +0 -2
- package/dist/chunk-c12y2bet.js +0 -2
- package/dist/chunk-c2nwchk0.js +0 -2
- package/dist/chunk-cxqrwvc5.js +0 -2
- package/dist/chunk-czea8zr1.js +0 -2
- package/dist/chunk-d99kfx3k.js +0 -2
- package/dist/chunk-dpn1pmxj.js +0 -2
- package/dist/chunk-dskrwa8f.js +0 -2
- package/dist/chunk-e6ycqvdm.js +0 -2
- package/dist/chunk-efgk2xv1.js +0 -2
- package/dist/chunk-fj70wq7k.js +0 -2
- package/dist/chunk-fvx6pd66.js +0 -2
- package/dist/chunk-hrbjapvr.js +0 -2
- package/dist/chunk-jc4mxq56.js +0 -2
- package/dist/chunk-jdpyxt8j.js +0 -2
- package/dist/chunk-k0zev8wc.js +0 -2
- package/dist/chunk-mhjwtkx9.js +0 -2
- package/dist/chunk-n4e02qdz.js +0 -2838
- package/dist/chunk-nx8rf4qd.js +0 -2
- package/dist/chunk-pe5bk9ns.js +0 -2
- package/dist/chunk-qb2j34sp.js +0 -2
- package/dist/chunk-qknfceta.js +0 -2
- package/dist/chunk-s932zfjz.js +0 -2
- package/dist/chunk-sf98zgw2.js +0 -2
- package/dist/chunk-sgsp4dph.js +0 -2
- package/dist/chunk-t48ws5j0.js +0 -2
- package/dist/chunk-tfxmzat6.js +0 -122
- package/dist/chunk-thbc9gtj.js +0 -2
- package/dist/chunk-tms7amrb.js +0 -2
- package/dist/chunk-tn9v10q2.js +0 -2
- package/dist/chunk-v0zgarvv.js +0 -2
- package/dist/chunk-v9jd283e.js +0 -2
- package/dist/chunk-vczw73ga.js +0 -2
- package/dist/chunk-webrqm20.js +0 -2
- package/dist/chunk-wg2w7zmt.js +0 -3
- package/dist/chunk-wgkxgsqx.js +0 -2
- package/dist/chunk-wngqr949.js +0 -2
- package/dist/chunk-xyzy84x0.js +0 -2
- package/dist/chunk-y1jffvkj.js +0 -2
- package/dist/chunk-yas134jv.js +0 -2
- package/dist/chunk-yd55vynh.js +0 -2
- package/dist/chunk-yygze2s0.js +0 -2
- package/dist/chunk-z732tf98.js +0 -2
- package/dist/chunk-ze86h6vp.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ae,
|
|
2
|
+
import{ae,bt}from"./chunk-qf3axv86.js";import{E}from"./chunk-ede39b7h.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?ae(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 R(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?ae(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?ae(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 R(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?ae(t,e):null,l=s?bt(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
|
*
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{_a,jl,Ea,Ta,Bl,Fl}from"./chunk-ebfpjnf3.js";import"./chunk-sr1md7vv.js";import"./chunk-w24qmxc3.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-zgv1h2np.js";import"./chunk-k1szsenr.js";import"./chunk-7ra30crf.js";import"./chunk-9cpxzze0.js";import"./chunk-qhr1tkhj.js";import"./chunk-mmbspaqh.js";import"./chunk-c6egfhy6.js";import"./chunk-pxw4edw8.js";import"./chunk-82bttwqm.js";export{Fl as applySlots,Bl as extractSlotContent,jl as parseSlotElement,_a as parseSlots,Ta as processSlots,Ea as renderSlot};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-qhr1tkhj.js";import"./chunk-v8ze2q95.js";import"./chunk-w24qmxc3.js";import{a}from"./chunk-sjkdpsca.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
|
|
3
3
|
`)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Uo,Vo,Wo,Uu}from"./chunk-96zgn94z.js";import"./chunk-5zg3xj45.js";import"./chunk-7xw1e8t6.js";import"./chunk-sr1md7vv.js";import"./chunk-w24qmxc3.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-zgv1h2np.js";import"./chunk-k1szsenr.js";import"./chunk-7ra30crf.js";import"./chunk-9cpxzze0.js";import"./chunk-qhr1tkhj.js";import"./chunk-mmbspaqh.js";import"./chunk-c6egfhy6.js";import"./chunk-pxw4edw8.js";import"./chunk-82bttwqm.js";export{Uo as buildNative,Uu as default,Wo as getAvailableFormats,Vo as getAvailableTargets};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{R,k,
|
|
2
|
+
import{R,k,Jt,Yt,Zt}from"./chunk-pg164sdw.js";import{resolve as z,basename as j,extname as T,join as q}from"path";import{mkdir as E}from"fs/promises";var S={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class Ur{config;constructor(e={}){this.config={...S,...e}}async get(e,s){return Jt(e,s,"image",this.config)}async set(e,s,r){return Yt(e,s,r,"image",this.config)}async clear(){return Zt("image",this.config)}updateConfig(e){this.config={...this.config,...e}}}var w=null;function v(e){if(!w)w=new Ur(e);else if(e)w.updateConfig(e);return w}async function Vr(e,s,r){let t=r?{directory:`${r.outputDir}/../.cache`}:{};return v(t).get(e,s)}async function Wr(e,s,r,t){let a=t?{directory:`${t.outputDir}/../.cache`}:{};return v(a).set(e,s,r)}async function $a(){return v().clear()}async function x(){try{return await import("ts-images")}catch{return null}}function F(e){switch(e){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function D(e,s){let r=s?F(s):F("web"),t=e.formatQuality||{};return{jpeg:{...r.jpeg,...t.jpeg},png:{...r.png,...t.png},webp:{...r.webp,...t.webp},avif:{...r.avif,...t.avif}}}async function Ra(e,s,r){let t=await x();if(!t)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:e,processed:!1};let a=await Vr(e,s,r);if(a)return a;try{let c=z(e);if(!await k(c))return{src:e,processed:!1,errors:[`Source file not found: ${e}`]};let n=D(r,s.preset),p=r.outputDir||"dist/images",I=r.baseUrl||"/images";await E(p,{recursive:!0});let d=await R(c),P=j(e,T(e)),b=s.outputFormat?[s.outputFormat]:r.defaultFormats||["avif","webp","jpeg"],o={src:e,processed:!0,variants:[],hash:d},u=null;if(s.transformations&&s.transformations.length>0)u=await Oo(c,s.transformations,t);for(let i of b){let l=n[i]||{},g=`${P}-${d}.${i}`,h=q(p,g);try{let m=await t.optimizeImage({input:u||c,output:h,format:i,quality:l.quality,progressive:l.progressive});if(m){if(o.variants.push({path:h,url:`${I}/${g}`,width:m.width||0,height:m.height||0,format:i,size:m.outputSize||0}),!o.originalWidth&&m.width)o.originalWidth=m.width,o.originalHeight=m.height}}catch(m){o.errors=o.errors||[],o.errors.push(`Failed to optimize ${i}: ${m}`)}}if(s.embedThumbhash||s.placeholder==="thumbhash")try{let i=await t.generateThumbHash(c);o.placeholder=i.dataUrl}catch(i){o.errors=o.errors||[],o.errors.push(`Failed to generate thumbhash: ${i}`)}if(s.useDominantColor)try{let i=await t.generatePlaceholder(c,{strategy:"dominant-color"});o.dominantColor=i.dominantColor}catch(i){o.errors=o.errors||[],o.errors.push(`Failed to extract dominant color: ${i}`)}return await Wr(e,s,o,r),o}catch(c){return{src:e,processed:!1,errors:[`Processing failed: ${c}`]}}}async function Aa(e,s,r,t){let a=await x();if(!a)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await a.optimizeImage({input:e,output:t,format:s,quality:r}))?.outputSize}}catch(c){return{success:!1,error:String(c)}}}async function Oo(e,s,r){let t=r||await x();if(!t)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let a=await t.decode(e);for(let c of s){let n=c.options||{};switch(c.type){case"resize":if(n.width||n.height)a=await t.resize(a,{width:n.width,height:n.height,fit:n.fit});break;case"blur":if(n.sigma!==void 0)a=await t.blur(a,n.sigma);break;case"sharpen":if(n.amount!==void 0)a=await t.sharpen(a,n.amount);break;case"grayscale":a=await t.grayscale(a);break;case"rotate":if(n.angle!==void 0)a=await t.rotate(a,n.angle);break;case"flip":a=await t.flip(a);break;case"flop":a=await t.flop(a);break;case"brightness":if(n.value!==void 0)a=await t.brightness(a,n.value);break;case"contrast":if(n.value!==void 0)a=await t.contrast(a,n.value);break;case"saturation":if(n.value!==void 0)a=await t.saturation(a,n.value);break}}return await t.encode(a,"png")}catch(a){return console.error(`[stx-media] Transformation failed: ${a}`),null}}import{resolve as Q,basename as U,extname as V,join as L}from"path";import{mkdir as H}from"fs/promises";async function O(){try{return await import("ts-images")}catch{return null}}var A=[320,480,640,768,1024,1280,1536,1920];async function Pa(e,s,r){let t=await O();if(!t)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let a=Q(e);if(!await k(a))return console.warn(`[stx-media] Source file not found: ${e}`),null;try{let c=s.responsiveWidths||r.breakpoints||A,n=s.formats||r.defaultFormats||["avif","webp","jpeg"],p=r.outputDir||"dist/images",I=r.baseUrl||"/images";await H(p,{recursive:!0});let d=await R(a),P=U(e,V(e)),b=r.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},o={src:e,byFormat:{},srcsets:{}};for(let i of n){o.byFormat[i]=[];let l=[];for(let g of c){let h=`${P}-${g}w-${d}.${i}`,m=L(p,h),y=`${I}/${h}`;try{let C=b[i]?.quality||80;if(await k(m)){o.byFormat[i].push({path:m,url:y,width:g,height:0,format:i,size:0}),l.push(`${y} ${g}w`);continue}let f=await t.processImage({input:a,output:m,format:i,quality:C,resize:{width:g}});if(f)o.byFormat[i].push({path:m,url:y,width:g,height:f.height||Math.round(g*(f.height||1)/(f.width||1)),format:i,size:f.outputSize||0}),l.push(`${y} ${g}w`)}catch(C){console.warn(`[stx-media] Failed to generate ${i} at ${g}w: ${C}`)}}o.srcsets[i]=l.join(", ")}let u=s.placeholder||r.placeholderStrategy||"thumbhash";if(u!=="none")try{if(u==="thumbhash"){let i=await t.generateThumbHash(a);o.placeholder={dataURL:i.dataUrl,width:i.width||32,height:i.height||32,strategy:"thumbhash"}}else{let i=await t.generatePlaceholder(a,{strategy:u,width:20});o.placeholder={dataURL:i.dataURL,width:i.width,height:i.height,strategy:u}}}catch(i){console.warn(`[stx-media] Failed to generate placeholder: ${i}`)}return o.sizes=s.sizes||B(c),o}catch(c){return console.error(`[stx-media] Responsive generation failed: ${c}`),null}}function B(e){let s=[...e].sort((t,a)=>t-a),r=[];for(let t=0;t<s.length-1;t++){let a=s[t];r.push(`(max-width: ${a}px) ${a}px`)}return r.push(`${s[s.length-1]}px`),r.join(", ")}function Ia(e,s="width"){if(!e||e.length===0)return"";if(s==="dpr")return e.filter((r)=>r.dpr).map((r)=>`${r.url} ${r.dpr}x`).join(", ");return e.map((r)=>`${r.url} ${r.width}w`).join(", ")}export{Ur,Vr,Wr,$a,Ra,Aa,Oo,Pa,Ia};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function
|
|
2
|
+
var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function lu(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
|
|
3
3
|
<div class="stx-suspense" data-suspense-id="${s}" data-custom-id="${i}" data-status="pending">
|
|
4
4
|
<div class="stx-suspense-fallback" data-suspense-fallback="${s}">
|
|
5
5
|
${t}
|
|
@@ -189,7 +189,7 @@ else {
|
|
|
189
189
|
}, 0);
|
|
190
190
|
})();
|
|
191
191
|
</script>
|
|
192
|
-
`}function
|
|
192
|
+
`}function uu(s,n,t){return{id:s,fallback:t,content:n}}async function du(s){let n=s.map((e)=>`
|
|
193
193
|
<div id="stx-ssr-suspense-${e.id}" class="stx-ssr-suspense">
|
|
194
194
|
${e.fallback}
|
|
195
195
|
</div>
|
|
@@ -214,7 +214,7 @@ else {
|
|
|
214
214
|
}
|
|
215
215
|
})();
|
|
216
216
|
</script>
|
|
217
|
-
`}}return{initial:n,streaming:t()}}function
|
|
217
|
+
`}}return{initial:n,streaming:t()}}function pu(){return`
|
|
218
218
|
/* STX Suspense Styles */
|
|
219
219
|
.stx-suspense {
|
|
220
220
|
position: relative;
|
|
@@ -270,7 +270,7 @@ else {
|
|
|
270
270
|
background-size: 200% 100%;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
`}function
|
|
273
|
+
`}function fu(){return`
|
|
274
274
|
// STX Suspense Runtime
|
|
275
275
|
(function() {
|
|
276
276
|
if (typeof window === 'undefined') return;
|
|
@@ -338,4 +338,4 @@ else {
|
|
|
338
338
|
console.log('[stx] Suspense runtime initialized');
|
|
339
339
|
})();
|
|
340
340
|
`}
|
|
341
|
-
export{
|
|
341
|
+
export{lu,uu,du,pu,fu};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Z}from"./chunk-
|
|
3
|
-
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function
|
|
4
|
-
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function E(s,l){let o=s.map((i)=>({route:i,...Z(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=i.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function
|
|
5
|
-
`));let c=n.outputs.find((d)=>d.kind==="entry-point");if(!c||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${u.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await c.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function
|
|
6
|
-
export{
|
|
2
|
+
import{Z}from"./chunk-pxw4edw8.js";import{fe,C}from"./chunk-k1szsenr.js";import{ji}from"./chunk-k71e38fk.js";import{a}from"./chunk-sjkdpsca.js";import v from"fs";import m from"path";import{pathToFileURL as I}from"url";var P=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],R=new Set;function Ct(s,l={}){let o=m.resolve(s,l.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let u=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=u.pop(),c=n.lastIndexOf("."),d=c>=0?n.slice(c+1):"get",g=d.toUpperCase();if(!P.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${P.map((A)=>A.toLowerCase()).join(", ")}`);if(c>=0)n=n.slice(0,c);if(n!=="index")u.push(n);let r=new Set,h=u.map((A,j)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&j!==u.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,S=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(S))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(S)} and ${e}`);f.set(S,e);let x=m.join(o,e);R.add(m.resolve(x)),R.add(v.realpathSync(x)),i.push({pattern:w,method:g,filePath:x})}return i.sort((e,p)=>{let u=e.pattern.split("/"),n=p.pattern.split("/"),c=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(u.length,n.length);d++){let g=c(n[d])-c(u[d]);if(g)return g}return e.pattern.localeCompare(p.pattern)||e.method.localeCompare(p.method)})}async function as(s,l){let o=a(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of l){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:p}=Z(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${p.map((u)=>`${JSON.stringify(u)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
|
|
3
|
+
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function cs(s,l,o={}){let i=Ct(s,o);await as(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
+
`)}`);let p=e.outputs.find((c)=>c.kind==="entry-point");if(!p)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await p.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),p),f.push({...t,filePath:n})}return f}function E(s,l){let o=s.map((i)=>({route:i,...Z(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,p=(r)=>r.replace(/:\w+/g,":param"),u=t.filter((r)=>p(r.route.pattern)===p(e)),n=i.method,c=u.find((r)=>r.route.method===n)??(n==="HEAD"?u.find((r)=>r.route.method==="GET"):void 0);if(!c){let r=new Set(u.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=c.regex.exec(f),g=Object.create(null);try{c.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(c.route);if(typeof r!=="function")throw Error(`API endpoint ${c.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function ls(s,l){return E(l,async(o)=>(await import(I(m.resolve(s,o.filePath)).href)).default)}async function qu(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=Ct(s,o);return await as(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=Ct(s,o);await as(s,t);let{loadStxConfig:e}=await import("./chunk-mc8j6dwa.js"),p=C((await e(s)).runtimeConfig);return await fe(p,()=>E(t,async(u)=>{let n=await Bun.build({entrypoints:[u.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
|
+
`));let c=n.outputs.find((d)=>d.kind==="entry-point");if(!c||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${u.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await c.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function us(s,l,o){if(ji(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(R.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(l,typeof o==="object"?o.dir??"server/api":"server/api"),t=(p)=>{try{return v.realpathSync(p)}catch{return m.resolve(p)}},e=t(s);return[f,m.resolve(l,"server"),m.resolve(l,".output/server")].some((p)=>{let u=t(p);return e===u||e.startsWith(`${u}${m.sep}`)})}
|
|
6
|
+
export{Ct,as,cs,ls,qu,us};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as
|
|
3
|
-
export{
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Ol}from"ts-broadcasting";import{Broadcast as Dl,BroadcastServer as Nl}from"ts-broadcasting";var e=null,u=[];function _l(){return e}async function El(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Tl(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function $l(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Sa(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Sa(n,t,r){if(!i())return;s.send(n,t,r)}function Rl(n,t,r){if(!i())return;s.toUser(n,t,r)}function Al(n,t,r){if(!i())return;s.toUsers(n,t,r)}function Pl(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function Il(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{_l,El,Tl,$l,Sa,Rl,Al,Pl,Il,Ol,Dl,Nl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{to,no,rt,Z,Nn,_r,Mn,Er,Tr,nl,rl,sl,Ln,ol,il,al,cl,sa,oa,ia,ro,aa,ll,st,ot,it,at,ct,lt,Te,ul}from"./chunk-pxw4edw8.js";export{Mn as Router,al as abortNavigation,_r as bracketPathToRegex,st as clearMiddleware,oa as createClientCookieManager,ct as createMiddlewareContext,at as createRouteLocation,sa as createServerCookieManager,ia as createStorageManager,cl as defineMiddleware,rl as defineRoute,sl as defineRoutes,Er as findErrorPage,Tr as formatRoutes,no as generateRouteManifest,to as generateRouteTypes,aa as getMiddleware,ot as getMiddlewareNames,Te as getRouterScript,ul as getRouterScriptDev,ll as hasMiddleware,rt as isFileRequestPath,it as loadMiddlewareFromDirectory,Nn as matchRoute,il as navigateTo,Z as patternToRegex,ro as registerMiddleware,ol as resetRoutes,Ln as route,lt as runMiddleware,nl as setAppUrl};
|
|
@@ -72,7 +72,7 @@ else {
|
|
|
72
72
|
${t}
|
|
73
73
|
})();
|
|
74
74
|
</script>
|
|
75
|
-
`}function
|
|
75
|
+
`}function eu(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
|
|
76
76
|
<div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
|
|
77
77
|
${d}
|
|
78
78
|
${c}
|
|
@@ -81,4 +81,4 @@ else {
|
|
|
81
81
|
</div>
|
|
82
82
|
${h}
|
|
83
83
|
`})}
|
|
84
|
-
export{
|
|
84
|
+
export{eu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ea,ta,na}from"./chunk-c6egfhy6.js";import{W,nn,rn,es,Gn,Kn,sn,on,ts,Xn}from"./chunk-7ydavm3h.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),K=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((A)=>{if(!A||w!==R||c)return;n=A.data,P.set(A.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 A=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."))},A)}),T;if(m.load)T=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;T=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([T,j]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,A=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,A).then((T)=>{if(w!==R||A!==N())return j(),I();return n=T,c=Date.now(),P.set(c),K.set(null),p.persist(e,T,k),F(),j(),I()},(T)=>{if(w===R&&A===N())K.set(T&&T.message?T.message:"Could not load.");return j(),I()})},O=`${w} ${A||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!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())G(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,G(!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
|
|
@@ -2731,7 +2731,7 @@ catch (e) {
|
|
|
2731
2731
|
}
|
|
2732
2732
|
throw e;
|
|
2733
2733
|
}
|
|
2734
|
-
}`;function
|
|
2734
|
+
}`;function Ae(t,a){return` // ==========================================================================
|
|
2735
2735
|
// Declarative Data Fetching (Feature #6 - useFetch)
|
|
2736
2736
|
// ==========================================================================
|
|
2737
2737
|
|
|
@@ -2872,7 +2872,7 @@ else if (immediate) {
|
|
|
2872
2872
|
get isEmpty() { return !loading() && !data(); }
|
|
2873
2873
|
};
|
|
2874
2874
|
}
|
|
2875
|
-
`}var
|
|
2875
|
+
`}var Te=` function bindFor(el, passedScope = componentScope, attrName = '@for') {
|
|
2876
2876
|
if (el.__stx_for_bound) return;
|
|
2877
2877
|
el.__stx_for_bound = true;
|
|
2878
2878
|
const expr = el.getAttribute(attrName);
|
|
@@ -3518,7 +3518,7 @@ catch (e) {
|
|
|
3518
3518
|
if (tgIsGroup) parent.__stx_tg_init = true;
|
|
3519
3519
|
});
|
|
3520
3520
|
}
|
|
3521
|
-
`;var
|
|
3521
|
+
`;var Ne=` // Also expose globally for convenience
|
|
3522
3522
|
window.state = state;
|
|
3523
3523
|
window.derived = derived;
|
|
3524
3524
|
window.memo = memo;
|
|
@@ -3585,7 +3585,7 @@ catch (e) {
|
|
|
3585
3585
|
// Note: SPA Router and View Transitions CSS are provided by the canonical
|
|
3586
3586
|
// router script (packages/router/src/client.ts) which is injected alongside
|
|
3587
3587
|
// the signals runtime or via the @stxRouter directive.
|
|
3588
|
-
`;var
|
|
3588
|
+
`;var Ce=` function expressionUsesSignalApi(expression, name) {
|
|
3589
3589
|
var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
|
|
3590
3590
|
return expressionUsesSignalMethod(expression, name)
|
|
3591
3591
|
|| expressionUsesSignalValue(expression, name);
|
|
@@ -3664,7 +3664,7 @@ catch (e) {
|
|
|
3664
3664
|
console.warn('[STX] Handler error:', expr, e);
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
3667
|
-
`;var
|
|
3667
|
+
`;var Ie=` // ==========================================================================
|
|
3668
3668
|
// Client-side useHead / useSeoMeta
|
|
3669
3669
|
// ==========================================================================
|
|
3670
3670
|
|
|
@@ -3755,7 +3755,7 @@ catch (e) {
|
|
|
3755
3755
|
if (config.canonical) meta.push({ property: 'og:url', content: config.canonical });
|
|
3756
3756
|
useHead({ title: config.title || config.ogTitle, meta: meta });
|
|
3757
3757
|
}
|
|
3758
|
-
`;var
|
|
3758
|
+
`;var Re=` // ==========================================================================
|
|
3759
3759
|
// Global Helpers (Feature #5)
|
|
3760
3760
|
// ==========================================================================
|
|
3761
3761
|
|
|
@@ -3884,7 +3884,7 @@ catch (e) {
|
|
|
3884
3884
|
const deps = depsMap.get(key);
|
|
3885
3885
|
if (deps) notifySubscribers(deps);
|
|
3886
3886
|
}
|
|
3887
|
-
`;var
|
|
3887
|
+
`;var Oe=` // \u2500\u2500 Host \u2500\u2500
|
|
3888
3888
|
//
|
|
3889
3889
|
// The tree this runtime mutates. Every write the binding layer makes to a
|
|
3890
3890
|
// node goes through here, so the same runtime can drive something that is not
|
|
@@ -3898,6 +3898,14 @@ catch (e) {
|
|
|
3898
3898
|
// branch swap, and nowhere near the line that caused it, which keeps the web path
|
|
3899
3899
|
// exactly as it was: same calls, one property lookup earlier.
|
|
3900
3900
|
var stxHost = window.__stx_host || {
|
|
3901
|
+
parent: function(node) { return node ? node.parentElement : null; },
|
|
3902
|
+
getAttribute: function(node, name) { return node && node.getAttribute ? node.getAttribute(name) : null; },
|
|
3903
|
+
observeChildren: function(node, callback) {
|
|
3904
|
+
var active = true;
|
|
3905
|
+
var observer = new MutationObserver(function() { if (active) callback(); });
|
|
3906
|
+
observer.observe(node, { childList: true, subtree: true });
|
|
3907
|
+
return function() { active = false; observer.disconnect(); };
|
|
3908
|
+
},
|
|
3901
3909
|
setText: function(node, value) { node.textContent = value; },
|
|
3902
3910
|
setMarkup: function(node, value) { node.innerHTML = value == null ? '' : value; },
|
|
3903
3911
|
setAttribute: function(node, name, value) {
|
|
@@ -3916,7 +3924,50 @@ catch (e) {
|
|
|
3916
3924
|
observer.observe(node, { attributes: true, attributeFilter: names });
|
|
3917
3925
|
return function() { observer.disconnect(); };
|
|
3918
3926
|
},
|
|
3919
|
-
setStyle: function(node, value) {
|
|
3927
|
+
setStyle: function(node, value, replaceBinding) {
|
|
3928
|
+
// A binding owns its current keys, not the element's entire inline style.
|
|
3929
|
+
// Keep the original value and priority so removing a key restores them.
|
|
3930
|
+
if (replaceBinding) {
|
|
3931
|
+
var next = Object.create(null);
|
|
3932
|
+
var priorities = Object.create(null);
|
|
3933
|
+
if (typeof value === 'string') {
|
|
3934
|
+
var parsed = document.createElement('div').style;
|
|
3935
|
+
parsed.cssText = value;
|
|
3936
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
3937
|
+
var property = parsed.item(i);
|
|
3938
|
+
next[property] = parsed.getPropertyValue(property);
|
|
3939
|
+
priorities[property] = parsed.getPropertyPriority(property);
|
|
3940
|
+
}
|
|
3941
|
+
}
|
|
3942
|
+
else if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
3943
|
+
Object.keys(value).forEach(function(key) {
|
|
3944
|
+
if (value[key] == null || value[key] === '') return;
|
|
3945
|
+
var name = key.indexOf('--') === 0 ? key : key.replace(/[A-Z]/g, function(c) { return '-' + c.toLowerCase(); });
|
|
3946
|
+
next[name] = value[key];
|
|
3947
|
+
});
|
|
3948
|
+
}
|
|
3949
|
+
var baseline = node.__stx_bound_style_baseline || (node.__stx_bound_style_baseline = Object.create(null));
|
|
3950
|
+
Object.keys(baseline).forEach(function(name) {
|
|
3951
|
+
if (Object.prototype.hasOwnProperty.call(next, name)) return;
|
|
3952
|
+
var prior = baseline[name];
|
|
3953
|
+
if (prior.value) node.style.setProperty(name, prior.value, prior.priority);
|
|
3954
|
+
else node.style.removeProperty(name);
|
|
3955
|
+
if (name === 'display') node.__stx_display = prior.value;
|
|
3956
|
+
delete baseline[name];
|
|
3957
|
+
});
|
|
3958
|
+
Object.keys(next).forEach(function(name) {
|
|
3959
|
+
if (!Object.prototype.hasOwnProperty.call(baseline, name)) {
|
|
3960
|
+
baseline[name] = {
|
|
3961
|
+
value: name === 'display' && node.__stx_visible === false ? node.__stx_display || '' : node.style.getPropertyValue(name),
|
|
3962
|
+
priority: node.style.getPropertyPriority(name)
|
|
3963
|
+
};
|
|
3964
|
+
}
|
|
3965
|
+
node.style.setProperty(name, next[name], priorities[name] || '');
|
|
3966
|
+
if (name === 'display') node.__stx_display = next[name];
|
|
3967
|
+
});
|
|
3968
|
+
if (node.__stx_visible === false) node.style.display = 'none';
|
|
3969
|
+
return;
|
|
3970
|
+
}
|
|
3920
3971
|
if (typeof value === 'object' && value !== null) {
|
|
3921
3972
|
Object.assign(node.style, value);
|
|
3922
3973
|
if (Object.prototype.hasOwnProperty.call(value, 'display')) node.__stx_display = value.display || '';
|
|
@@ -5455,6 +5506,19 @@ else if (!value && isInserted) {
|
|
|
5455
5506
|
var disposeEffects = trackEffects(function() {
|
|
5456
5507
|
processFromManifest(root, scope, manifest, resolvedNodes);
|
|
5457
5508
|
});
|
|
5509
|
+
// The manifest visits bindings, not every component. Static component
|
|
5510
|
+
// roots still own lifecycle hooks, and those hooks must see fully bound
|
|
5511
|
+
// props/refs. Detached conditional and loop sources must not mount.
|
|
5512
|
+
[root].concat(stxHost.descendants(root)).forEach(function(node) {
|
|
5513
|
+
if (!node || node.isConnected === false || !node.getAttribute || hasPendingLoopBoundary(node)) return;
|
|
5514
|
+
var scopeId = node.getAttribute('data-stx-scope');
|
|
5515
|
+
var local = scopeId && window.stx._scopes && window.stx._scopes[scopeId];
|
|
5516
|
+
if (!local || local.__mounted || local.__suspended) return;
|
|
5517
|
+
if (node.hasAttribute('stx-hydrate') && !node.__stx_hydrated) return;
|
|
5518
|
+
local.__el = node;
|
|
5519
|
+
local.__mounted = true;
|
|
5520
|
+
runMountCallbacks(local.__mountCallbacks || [], scopeDestroySink(local));
|
|
5521
|
+
});
|
|
5458
5522
|
runMountCallbacks(localMountHooks, localDestroyHooks);
|
|
5459
5523
|
var mounted = true;
|
|
5460
5524
|
return function disposeHost() {
|
|
@@ -6204,6 +6268,19 @@ else {
|
|
|
6204
6268
|
|
|
6205
6269
|
// Lock, listen and inert to match the stack after any change.
|
|
6206
6270
|
function _overlaySync() {
|
|
6271
|
+
if (stxHost.isNative) {
|
|
6272
|
+
stxHost.syncOverlays(_overlays.map(function(entry) {
|
|
6273
|
+
return Object.assign({}, entry, { onRequestClose: function(event) {
|
|
6274
|
+
if (entry.onRequestClose) { entry.onRequestClose(event); return; }
|
|
6275
|
+
var reason = event && (event.reason || (event.nativeEvent && event.nativeEvent.reason));
|
|
6276
|
+
if (reason === 'backdrop') { if (entry.onBackdrop) entry.onBackdrop(); }
|
|
6277
|
+
else if (reason === 'back' || reason === 'escape') { if (entry.onEscape) entry.onEscape(); }
|
|
6278
|
+
else if (!!entry.onBackdrop === !!entry.onEscape) { if (entry.onEscape) entry.onEscape(); }
|
|
6279
|
+
else console.warn('[stx:overlays] Native dismissal was denied: this host must report reason=backdrop or reason=back to honor different closeOnBackdrop/closeOnEscape policies.');
|
|
6280
|
+
} });
|
|
6281
|
+
}));
|
|
6282
|
+
return;
|
|
6283
|
+
}
|
|
6207
6284
|
for (var i = 0; i < _overlayInerted.length; i++) {
|
|
6208
6285
|
try { _overlayInerted[i].inert = false; }
|
|
6209
6286
|
catch (_e) { /* element may be gone */ }
|
|
@@ -6352,10 +6429,15 @@ else {
|
|
|
6352
6429
|
var at = _overlayIndex(id);
|
|
6353
6430
|
if (at !== -1) {
|
|
6354
6431
|
var existing = _overlays[at];
|
|
6432
|
+
var updated = Object.assign({}, existing);
|
|
6355
6433
|
for (var key in opts) {
|
|
6356
|
-
if (Object.prototype.hasOwnProperty.call(opts, key))
|
|
6434
|
+
if (Object.prototype.hasOwnProperty.call(opts, key)) updated[key] = opts[key];
|
|
6357
6435
|
}
|
|
6358
|
-
|
|
6436
|
+
// A native presenter holds callbacks for the last accepted entry.
|
|
6437
|
+
// Do not mutate it until the replacement has passed host validation.
|
|
6438
|
+
_overlays[at] = updated;
|
|
6439
|
+
try { _overlaySync(); }
|
|
6440
|
+
catch (e) { _overlays[at] = existing; throw e; }
|
|
6359
6441
|
return;
|
|
6360
6442
|
}
|
|
6361
6443
|
var isModal = opts.modal !== false;
|
|
@@ -6366,18 +6448,23 @@ else {
|
|
|
6366
6448
|
root: opts.root || null,
|
|
6367
6449
|
zIndex: typeof opts.zIndex === 'number' ? opts.zIndex : null,
|
|
6368
6450
|
onEscape: opts.onEscape || null,
|
|
6451
|
+
onBackdrop: opts.onBackdrop || null,
|
|
6369
6452
|
initialFocus: opts.initialFocus || null,
|
|
6370
6453
|
// A popup hands focus back itself, to its own trigger, and only when
|
|
6371
6454
|
// focus was inside it; a modal layer always does.
|
|
6372
6455
|
restoreFocus: opts.restoreFocus !== undefined ? opts.restoreFocus !== false : isModal,
|
|
6373
|
-
opener: opts.opener !== undefined ? opts.opener : document.activeElement
|
|
6456
|
+
opener: opts.opener !== undefined ? opts.opener : (stxHost.isNative ? null : document.activeElement),
|
|
6457
|
+
// Native Modal reports backdrop/back dismissal through the same host
|
|
6458
|
+
// event. Shared components supply the applicable dismissal policy.
|
|
6459
|
+
onRequestClose: opts.onRequestClose || null
|
|
6374
6460
|
};
|
|
6375
6461
|
_overlays.push(entry);
|
|
6376
|
-
_overlaySync();
|
|
6462
|
+
try { _overlaySync(); }
|
|
6463
|
+
catch (e) { _overlays.splice(_overlays.indexOf(entry), 1); throw e; }
|
|
6377
6464
|
// Synchronously first, so a caller that asserts focus straight after
|
|
6378
6465
|
// opening sees it; then retried for a panel that is not displayed yet.
|
|
6379
6466
|
// A popup keeps focus where its own keyboard handling puts it.
|
|
6380
|
-
if (isModal || opts.initialFocus) _overlayFocusIn(entry, 10);
|
|
6467
|
+
if (!stxHost.isNative && (isModal || opts.initialFocus)) _overlayFocusIn(entry, 10);
|
|
6381
6468
|
},
|
|
6382
6469
|
/** Take an overlay off the stack, wherever it is in it. */
|
|
6383
6470
|
close: function(id) {
|
|
@@ -6389,7 +6476,7 @@ else {
|
|
|
6389
6476
|
// Only the overlay that had the keyboard gives it back. Closing one
|
|
6390
6477
|
// underneath (its owner went away) must not pull focus out of the top.
|
|
6391
6478
|
var opener = entry.opener;
|
|
6392
|
-
if (wasTop && entry.restoreFocus && opener && opener.isConnected !== false && typeof opener.focus === 'function') {
|
|
6479
|
+
if (!stxHost.isNative && wasTop && entry.restoreFocus && opener && opener.isConnected !== false && typeof opener.focus === 'function') {
|
|
6393
6480
|
try { opener.focus(); }
|
|
6394
6481
|
catch (_e) { /* gone; nothing to give focus back to */ }
|
|
6395
6482
|
}
|
|
@@ -7985,6 +8072,8 @@ catch (e) {
|
|
|
7985
8072
|
${t}
|
|
7986
8073
|
|
|
7987
8074
|
_mountCallbacks: mountCallbacks,
|
|
8075
|
+
// Internal adapter for the shared component library, not a DOM facade.
|
|
8076
|
+
_host: stxHost,
|
|
7988
8077
|
_destroyCallbacks: destroyCallbacks,
|
|
7989
8078
|
_cleanupContainer: cleanupContainer,
|
|
7990
8079
|
_flushLoad: flushStxLoad,
|
|
@@ -9261,7 +9350,7 @@ catch (e2) {
|
|
|
9261
9350
|
effect(() => {
|
|
9262
9351
|
if (isVisible && !isVisible()) return;
|
|
9263
9352
|
const value = evalExpr();
|
|
9264
|
-
stxHost.setStyle(el, value);
|
|
9353
|
+
stxHost.setStyle(el, value, true);
|
|
9265
9354
|
});
|
|
9266
9355
|
}
|
|
9267
9356
|
`;var ft=` // <Suspense> boundary (#1742). Aggregates the loading/error state of every
|
|
@@ -10171,17 +10260,17 @@ else if (timer === null) {
|
|
|
10171
10260
|
subscribe: subscribe
|
|
10172
10261
|
};
|
|
10173
10262
|
}
|
|
10174
|
-
`;function
|
|
10263
|
+
`;function Me(){let t=xt(tn());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 tn(){return`${ae}${Oe}
|
|
10175
10264
|
${Je(ie,Se,Ee)}
|
|
10176
10265
|
|
|
10177
|
-
${
|
|
10266
|
+
${Re}
|
|
10178
10267
|
${nt}
|
|
10179
10268
|
${et}
|
|
10180
10269
|
${dt}
|
|
10181
10270
|
${_e}
|
|
10182
10271
|
${He}
|
|
10183
10272
|
${bt}
|
|
10184
|
-
${
|
|
10273
|
+
${Ae(Q.toString(),Y.toString())}
|
|
10185
10274
|
${ot}
|
|
10186
10275
|
${We}
|
|
10187
10276
|
${Qe}
|
|
@@ -10192,13 +10281,13 @@ ${ze}
|
|
|
10192
10281
|
|
|
10193
10282
|
${ke}
|
|
10194
10283
|
${xe}
|
|
10195
|
-
${
|
|
10284
|
+
${Ce}
|
|
10196
10285
|
${Ve}
|
|
10197
10286
|
${se}
|
|
10198
10287
|
${de}
|
|
10199
10288
|
${fe}
|
|
10200
10289
|
${Ke}
|
|
10201
|
-
${tt(
|
|
10290
|
+
${tt(ta(),na(),ea())}
|
|
10202
10291
|
|
|
10203
10292
|
${ft}
|
|
10204
10293
|
${it}
|
|
@@ -10209,7 +10298,7 @@ ${yt}
|
|
|
10209
10298
|
${Ue}
|
|
10210
10299
|
${ue}
|
|
10211
10300
|
${Be}
|
|
10212
|
-
${
|
|
10301
|
+
${Te}
|
|
10213
10302
|
${qe}
|
|
10214
10303
|
${he}
|
|
10215
10304
|
${Le}
|
|
@@ -10224,7 +10313,7 @@ ${pt}
|
|
|
10224
10313
|
${je(Z.toString(),J.toString(),te.toString(),ee.toString(),ne.toString())}
|
|
10225
10314
|
${ge}
|
|
10226
10315
|
${oe(X.toString())}
|
|
10227
|
-
${
|
|
10316
|
+
${Ie}
|
|
10228
10317
|
${vt}
|
|
10229
10318
|
|
|
10230
10319
|
${Xe}
|
|
@@ -10239,7 +10328,7 @@ ${ut}
|
|
|
10239
10328
|
${$e}
|
|
10240
10329
|
});
|
|
10241
10330
|
|
|
10242
|
-
${
|
|
10331
|
+
${Ne}
|
|
10243
10332
|
${ye}
|
|
10244
10333
|
${be}
|
|
10245
10334
|
${st}
|
|
@@ -10249,5 +10338,5 @@ ${lt}
|
|
|
10249
10338
|
${ct}
|
|
10250
10339
|
${at}
|
|
10251
10340
|
})();
|
|
10252
|
-
`}var
|
|
10253
|
-
export{
|
|
10341
|
+
`}var xu={state:W,derived:nn,effect:rn,batch:es,onMount:Gn,onDestroy:Kn,isSignal:sn,isDerived:on,untrack:ts,peek:Xn,generateSignalsRuntime:Me,generateSignalsRuntimeDev:tn};
|
|
10342
|
+
export{Me,tn,xu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{o}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{o}from"./chunk-sr1md7vv.js";import{Hr}from"./chunk-s5vxxwg6.js";import p from"path";async function Ml(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if(Hr(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-kgtnfvqb.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
|
|
3
|
+
export{Ml};
|