@stacksjs/stx 0.2.581 → 0.2.583

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.
Files changed (166) hide show
  1. package/dist/{chunk-ayy9mmrw.js → chunk-02qaqamv.js} +6 -6
  2. package/dist/{chunk-6w2yqtrd.js → chunk-07anexcg.js} +1 -1
  3. package/dist/{chunk-dvgvvy5b.js → chunk-09zwhsf9.js} +1 -1
  4. package/dist/{chunk-cb2pyg5t.js → chunk-0dfgefjv.js} +2 -2
  5. package/dist/chunk-0fx3ppnt.js +2 -0
  6. package/dist/chunk-0sfexf9t.js +2 -0
  7. package/dist/chunk-2927nax9.js +2 -0
  8. package/dist/{chunk-eww6sdzz.js → chunk-2943qhdt.js} +1 -1
  9. package/dist/{chunk-9jh2ake5.js → chunk-2nehykbm.js} +5 -5
  10. package/dist/chunk-2rj0ttas.js +2 -0
  11. package/dist/chunk-3ae39ttg.js +2 -0
  12. package/dist/{chunk-q2a58n2a.js → chunk-440yjsk5.js} +1 -1
  13. package/dist/{chunk-kp0hg06s.js → chunk-4pkpr5cg.js} +2 -2
  14. package/dist/{chunk-g4crr86j.js → chunk-4pmgr32a.js} +3 -3
  15. package/dist/chunk-521pe0hb.js +18 -0
  16. package/dist/chunk-58z26y07.js +2 -0
  17. package/dist/chunk-5r9k9s3m.js +2 -0
  18. package/dist/{chunk-vx75fb0d.js → chunk-6fc8vw2v.js} +2 -2
  19. package/dist/{chunk-43h8q2cm.js → chunk-6m3me7yj.js} +6 -6
  20. package/dist/chunk-76vza4ve.js +2 -0
  21. package/dist/{chunk-c1r7zq0q.js → chunk-8tq83fq7.js} +71 -71
  22. package/dist/chunk-8y8bbsh5.js +2 -0
  23. package/dist/{chunk-620szfcp.js → chunk-96mb3brj.js} +2 -2
  24. package/dist/chunk-9kzycb15.js +2 -0
  25. package/dist/{chunk-djft0m5h.js → chunk-ac6v3s3k.js} +1 -1
  26. package/dist/chunk-agfhb2qd.js +2 -0
  27. package/dist/chunk-ay6dzpt4.js +2 -0
  28. package/dist/{chunk-dtcc09x1.js → chunk-b9njk81d.js} +1 -1
  29. package/dist/chunk-bfbcmfww.js +2 -0
  30. package/dist/chunk-br01jvra.js +2 -0
  31. package/dist/{chunk-v8p5p2kp.js → chunk-c12y2bet.js} +1 -1
  32. package/dist/chunk-c2nwchk0.js +2 -0
  33. package/dist/{chunk-3qrrv6af.js → chunk-cby4mkjf.js} +1 -1
  34. package/dist/{chunk-qazn64pm.js → chunk-ck1yca7g.js} +1 -1
  35. package/dist/chunk-cxqrwvc5.js +2 -0
  36. package/dist/chunk-czea8zr1.js +2 -0
  37. package/dist/chunk-d99kfx3k.js +2 -0
  38. package/dist/{chunk-7hkc96de.js → chunk-dhq80e4r.js} +4 -4
  39. package/dist/{chunk-cdgwkzms.js → chunk-dm1qh2vq.js} +1 -1
  40. package/dist/{chunk-5pgbsc3a.js → chunk-dskrwa8f.js} +1 -1
  41. package/dist/{chunk-zk2xk0wd.js → chunk-dvc15djp.js} +2 -2
  42. package/dist/chunk-e6ycqvdm.js +2 -0
  43. package/dist/{chunk-8v19753h.js → chunk-e809x7m0.js} +1 -1
  44. package/dist/{chunk-ta3wn842.js → chunk-en7xxgtb.js} +2 -2
  45. package/dist/chunk-fvx6pd66.js +2 -0
  46. package/dist/{chunk-xpnpg967.js → chunk-g9zeybqh.js} +2 -2
  47. package/dist/{chunk-zz02hwec.js → chunk-h3z9b6bw.js} +22 -22
  48. package/dist/{chunk-yk3fbzx5.js → chunk-hp9nxva6.js} +3 -3
  49. package/dist/chunk-hrbjapvr.js +2 -0
  50. package/dist/{chunk-pmpb34md.js → chunk-hzqyfdpy.js} +5 -5
  51. package/dist/chunk-jc4mxq56.js +2 -0
  52. package/dist/chunk-jdpyxt8j.js +2 -0
  53. package/dist/{chunk-4rkvwm6v.js → chunk-je1as16r.js} +9 -9
  54. package/dist/chunk-k0zev8wc.js +2 -0
  55. package/dist/{chunk-nrfh7gaa.js → chunk-kfwmqacd.js} +1 -1
  56. package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
  57. package/dist/{chunk-y8q1n7hx.js → chunk-ky1426s1.js} +6 -6
  58. package/dist/{chunk-rr8a7d4q.js → chunk-m417sp42.js} +3 -3
  59. package/dist/{chunk-101ekf6y.js → chunk-mjj24qpb.js} +2 -2
  60. package/dist/{chunk-ev5f79mg.js → chunk-mt9x626h.js} +3 -3
  61. package/dist/{chunk-faghmmrs.js → chunk-n4e02qdz.js} +85 -85
  62. package/dist/{chunk-yy3ser06.js → chunk-nh3svtvj.js} +3 -3
  63. package/dist/{chunk-yfq2v7x5.js → chunk-nhd9m8h5.js} +6 -6
  64. package/dist/chunk-nx8rf4qd.js +2 -0
  65. package/dist/{chunk-t8wpzqs4.js → chunk-pbwk8tzz.js} +1 -1
  66. package/dist/chunk-pe5bk9ns.js +2 -0
  67. package/dist/chunk-qb2j34sp.js +2 -0
  68. package/dist/chunk-qknfceta.js +2 -0
  69. package/dist/{chunk-0vnngvy1.js → chunk-qn8gdw21.js} +4 -4
  70. package/dist/chunk-sf98zgw2.js +2 -0
  71. package/dist/chunk-sgsp4dph.js +2 -0
  72. package/dist/{chunk-jtbzmbzz.js → chunk-sv08pd66.js} +2 -2
  73. package/dist/{chunk-30rf7k4n.js → chunk-tfxmzat6.js} +24 -24
  74. package/dist/chunk-tms7amrb.js +2 -0
  75. package/dist/chunk-v0zgarvv.js +2 -0
  76. package/dist/chunk-vczw73ga.js +2 -0
  77. package/dist/{chunk-be2ba3hj.js → chunk-vkc51n9m.js} +2 -2
  78. package/dist/{chunk-1v1mew46.js → chunk-vke73gts.js} +1 -1
  79. package/dist/{chunk-c0s3k64c.js → chunk-w6wtxj54.js} +2 -2
  80. package/dist/chunk-webrqm20.js +2 -0
  81. package/dist/chunk-wngqr949.js +2 -0
  82. package/dist/{chunk-71sdgv7e.js → chunk-wyn5rfzk.js} +105 -35
  83. package/dist/{chunk-yhpyqsbr.js → chunk-x552npae.js} +2 -2
  84. package/dist/{chunk-3wy8q3aq.js → chunk-xp7fxc6p.js} +5 -5
  85. package/dist/{chunk-t4g2fptt.js → chunk-xytkfa48.js} +4 -4
  86. package/dist/chunk-xyzy84x0.js +2 -0
  87. package/dist/chunk-y1jffvkj.js +2 -0
  88. package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
  89. package/dist/chunk-yas134jv.js +2 -0
  90. package/dist/{chunk-tszkg6sj.js → chunk-ycj0342k.js} +1 -1
  91. package/dist/{chunk-mxe21m6q.js → chunk-yd55vynh.js} +1 -1
  92. package/dist/{chunk-hzfhn2vr.js → chunk-ye66wc53.js} +2 -2
  93. package/dist/{chunk-k9th7hc4.js → chunk-ym1sb5bg.js} +2 -2
  94. package/dist/chunk-yn2d8x8m.js +3 -0
  95. package/dist/chunk-ze86h6vp.js +2 -0
  96. package/dist/cli.js +44 -44
  97. package/dist/client/signals-authoring-runtime.js +13 -6
  98. package/dist/client/signals-binding-utils-runtime.js +14 -1
  99. package/dist/client/signals-component-api-runtime.js +3 -1
  100. package/dist/client/signals-event-shorthand-runtime.js +1 -1
  101. package/dist/client/signals-expression-runtime.js +1 -1
  102. package/dist/client/signals-host-runtime.js +20 -0
  103. package/dist/client/signals-manifest-hydration-runtime.js +7 -0
  104. package/dist/client/signals-model-runtime.js +2 -0
  105. package/dist/client/signals-mount-runtime.js +5 -1
  106. package/dist/client/signals-process-element-runtime.js +22 -7
  107. package/dist/component-model.d.ts +1 -1
  108. package/dist/component-model.js +6 -3
  109. package/dist/composition-api.js +3 -2
  110. package/dist/craft-entry.js +2 -2
  111. package/dist/craft.js +2 -2
  112. package/dist/native/compiler/bundle.js +8 -3
  113. package/dist/native/compiler/html-to-ir.d.ts +3 -1
  114. package/dist/native/compiler/html-to-ir.js +28 -1
  115. package/dist/native/runtime/binding-tree.js +12 -0
  116. package/dist/native/runtime/craft-bridge.js +2 -1
  117. package/dist/native/runtime/jsc-globals.d.ts +10 -3
  118. package/dist/native/runtime/jsc-globals.js +23 -4
  119. package/dist/native/runtime/native-host.d.ts +4 -0
  120. package/dist/native/runtime/native-host.js +273 -21
  121. package/dist/native/runtime/shared-screen.js +1 -0
  122. package/dist/native/testing.js +1 -1
  123. package/dist/pwa.js +3 -3
  124. package/dist/ssg.js +7 -7
  125. package/package.json +5 -5
  126. package/dist/chunk-0047meje.js +0 -2
  127. package/dist/chunk-1cat8kdj.js +0 -2
  128. package/dist/chunk-1dwnp35v.js +0 -2
  129. package/dist/chunk-2dnr5qfk.js +0 -2
  130. package/dist/chunk-2v73cjbc.js +0 -2
  131. package/dist/chunk-3akgppsy.js +0 -2
  132. package/dist/chunk-4t67wmcg.js +0 -2
  133. package/dist/chunk-51zn42jy.js +0 -2
  134. package/dist/chunk-5702x95v.js +0 -2
  135. package/dist/chunk-60c2bsh9.js +0 -2
  136. package/dist/chunk-79v4d9qh.js +0 -2
  137. package/dist/chunk-7pp2vx1g.js +0 -2
  138. package/dist/chunk-8zm6tkqb.js +0 -2
  139. package/dist/chunk-a1z36dt5.js +0 -2
  140. package/dist/chunk-atsf1fe0.js +0 -2
  141. package/dist/chunk-b8qd6h1q.js +0 -2
  142. package/dist/chunk-ccxs40xy.js +0 -2
  143. package/dist/chunk-cg8hg6cs.js +0 -3
  144. package/dist/chunk-cp442y7a.js +0 -2
  145. package/dist/chunk-d4en5d3s.js +0 -2
  146. package/dist/chunk-dh80d57p.js +0 -2
  147. package/dist/chunk-dyqte1xq.js +0 -2
  148. package/dist/chunk-e4n4v022.js +0 -2
  149. package/dist/chunk-g2fw68zm.js +0 -2
  150. package/dist/chunk-hcgm37dy.js +0 -2
  151. package/dist/chunk-hd2bn5q7.js +0 -2
  152. package/dist/chunk-j1nqnmcd.js +0 -18
  153. package/dist/chunk-k7jqkt93.js +0 -2
  154. package/dist/chunk-mqy7g74k.js +0 -2
  155. package/dist/chunk-ne03tfje.js +0 -2
  156. package/dist/chunk-p2sns0bn.js +0 -2
  157. package/dist/chunk-s1sycp43.js +0 -2
  158. package/dist/chunk-sp46w7z9.js +0 -2
  159. package/dist/chunk-sy1bk1ry.js +0 -2
  160. package/dist/chunk-tpd5nwa3.js +0 -2
  161. package/dist/chunk-tpt4bgs5.js +0 -2
  162. package/dist/chunk-vq0cb1m9.js +0 -2
  163. package/dist/chunk-y1bppxgw.js +0 -2
  164. package/dist/chunk-yv5rwthv.js +0 -2
  165. package/dist/chunk-z1r4tdqy.js +0 -2
  166. package/dist/chunk-zv288w4e.js +0 -2
@@ -1,20 +1,20 @@
1
1
  // @bun
2
- import{y}from"./chunk-zk2xk0wd.js";import{K,We,ps,gs,ai,ci,li,di,Zn,ms,ui,pi,fi,At,o}from"./chunk-faghmmrs.js";import{Wr}from"./chunk-vx75fb0d.js";import{a}from"./chunk-00p22wzr.js";import{existsSync as M,readFileSync as G}from"fs";import h from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=At.filter((e)=>!me.has(e)).sort(),ne=[...y].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ie(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let m of l[1].matchAll(/[^,]+/g)){let S=m[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let r=x[1];if(!xe.has(r)||i.has(r))continue;let f=u.offset+g+m.index+x[0].length-r.length,p=e.slice(0,f),w=p.split(`
2
+ import{y}from"./chunk-dvc15djp.js";import{K,We,ps,gs,ai,ci,li,ui,Qn,ms,di,pi,fi,At,o}from"./chunk-n4e02qdz.js";import{qr}from"./chunk-6fc8vw2v.js";import{a}from"./chunk-00p22wzr.js";import{existsSync as M,readFileSync as G}from"fs";import h from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=At.filter((e)=>!me.has(e)).sort(),ne=[...y].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ie(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let m of l[1].matchAll(/[^,]+/g)){let S=m[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let r=x[1];if(!xe.has(r)||i.has(r))continue;let f=u.offset+g+m.index+x[0].length-r.length,p=e.slice(0,f),w=p.split(`
3
3
  `).length;s.push({line:w,column:f-(p.lastIndexOf(`
4
- `)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:Se(r,u.kind)})}}}return s}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let s=T.resolve(e);for(;;){let u=T.join(s,"tsconfig.json");if(t(u))return u;let i=T.dirname(s);if(i===s)return;s=i}}function se(e,t,s){let u=we(e,s);if(!u)return;let i=new Set,l=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let S=m.compilerOptions?.plugins;if(Array.isArray(S)){let r=S.find((p)=>p?.name===ke),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...x].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=T.resolve(T.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function ua(e,t="",s=""){let u=e.startLine>1?`
5
- `.repeat(e.startLine-1):"",i=ms(e)+gs(ps(e.code)),l=e.kind==="client"||e.kind==="plain"?li(t,e.code):"";return Zn(`${u+i}
4
+ `)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:Se(r,u.kind)})}}}return s}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let s=T.resolve(e);for(;;){let u=T.join(s,"tsconfig.json");if(t(u))return u;let i=T.dirname(s);if(i===s)return;s=i}}function se(e,t,s){let u=we(e,s);if(!u)return;let i=new Set,l=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let S=m.compilerOptions?.plugins;if(Array.isArray(S)){let r=S.find((p)=>p?.name===ke),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...x].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=T.resolve(T.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function da(e,t="",s=""){let u=e.startLine>1?`
5
+ `.repeat(e.startLine-1):"",i=ms(e)+gs(ps(e.code)),l=e.kind==="client"||e.kind==="plain"?li(t,e.code):"";return Qn(`${u+i}
6
6
  ${l}
7
7
  export {}
8
8
  `,s)}var $e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function ve(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],s=new Set(y),u=[];for(let{file:i,names:l}of e){let g=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));u.push(` export * from ${g}`);for(let m of l){if(s.has(m)||$e.has(m))continue;s.add(m),t.push(`declare const ${m}: typeof import(${g})[${JSON.stringify(m)}]`)}}return t.push("declare module '@composables' {",...u,"}"),t.join(`
9
9
  `)}function mo(e,t,s){return`${e}.__stx_${t}${s}.ts`}function fl(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function pa(){return re("stx.d.ts")}function fa(){return re("stx-module.d.ts")}function re(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(M(t))return t;return null}var Te=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function De(e){return e>=1000&&e<2000}function oe(e){let t="",s=!1,u=!1;for(let i=0;i<e.length;i++){let l=e[i];if(s){if(t+=l,u)u=!1;else if(l==="\\")u=!0;else if(l==='"')s=!1;continue}if(l==='"'){s=!0,t+=l;continue}if(l==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
10
10
  `)i++;t+=`
11
11
  `;continue}if(l==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(G(e,"utf8")))}catch{return}}function Oe(e){let t=h.resolve(e),s;for(;;){let r=h.join(t,"tsconfig.json");if(M(r)){s=r;break}let f=h.dirname(t);if(f===t)break;t=f}if(!s)return{};let u=new Set,i=s,l,g,m=s;while(i&&!u.has(i)){u.add(i);let r;try{r=JSON.parse(oe(G(i,"utf8")))}catch{break}let f=r?.compilerOptions??{};if(!l&&f.paths&&typeof f.paths==="object")l=f.paths,m=i;if(!g&&typeof f.baseUrl==="string")g=h.resolve(h.dirname(i),f.baseUrl);if(l&&g)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!l)return{};let S=g??h.dirname(m),x={};for(let[r,f]of Object.entries(l)){if(!Array.isArray(f))continue;x[r]=f.map((p)=>typeof p==="string"&&!h.isAbsolute(p)?h.resolve(S,p):p)}return{paths:x}}async function gl(e,t={}){let s=t.client!==!1,u=t.server!==!1,i=t.templates!==!1,l=t.componentsDir??(i?(await o()).componentsDir:void 0),g=new Map,m=new Map,S=[],x=[],r=0,f=0,p=pa();for(let n of e){let c=await Bun.file(n).text(),b=We(c).filter((d)=>{if(d.kind==="server")return u;return s}),k=We(c).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
12
- `);for(let d of ie(c,b))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(s&&k){let d=b.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>di(k,O.code)))];if(E.length>0)m.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=h.dirname(h.resolve(n)),v=i?ui(c,{runtimeGlobals:!p,originDir:D,filePath:h.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(b.length===0&&R===0)continue;if(x.push(n),r+=b.length,f+=R,b.forEach((d,E)=>{g.set(mo(n,d.kind,E),{source:ua(d,k,D),origin:n,kind:d.kind})}),v&&R>0)g.set(mo(n,"template",0),{source:v.text,origin:n,kind:"template",virtual:v})}if(g.size===0)return{diagnostics:S,checkedFiles:x,blockCount:0,expressionCount:0};let w=(t.extraLibs??[]).map((n)=>h.resolve(n)),ce=se(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),Ee,M);for(let n of ce?.libs??[])if(!w.includes(n)&&M(n))w.push(n);if(p)w.push(p);let X=p?fa():null;if(X)w.push(X);let F=`${a()}/typecheck/__stx_globals.d.ts`,ae=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",ai(p?ci(G(p,"utf8")):void 0),...p?[]:["declare const window: any",...y.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...K.map((n)=>`declare const ${n}: any`)].join(`
13
- `),ve(await Wr())].filter(Boolean).join(`
12
+ `);for(let d of ie(c,b))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(s&&k){let d=b.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>ui(k,O.code)))];if(E.length>0)m.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=h.dirname(h.resolve(n)),v=i?di(c,{runtimeGlobals:!p,originDir:D,filePath:h.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(b.length===0&&R===0)continue;if(x.push(n),r+=b.length,f+=R,b.forEach((d,E)=>{g.set(mo(n,d.kind,E),{source:da(d,k,D),origin:n,kind:d.kind})}),v&&R>0)g.set(mo(n,"template",0),{source:v.text,origin:n,kind:"template",virtual:v})}if(g.size===0)return{diagnostics:S,checkedFiles:x,blockCount:0,expressionCount:0};let w=(t.extraLibs??[]).map((n)=>h.resolve(n)),ce=se(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),Ee,M);for(let n of ce?.libs??[])if(!w.includes(n)&&M(n))w.push(n);if(p)w.push(p);let X=p?fa():null;if(X)w.push(X);let F=`${a()}/typecheck/__stx_globals.d.ts`,ae=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",ai(p?ci(G(p,"utf8")):void 0),...p?[]:["declare const window: any",...y.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...K.map((n)=>`declare const ${n}: any`)].join(`
13
+ `),ve(await qr())].filter(Boolean).join(`
14
14
  `),_=`${a()}/typecheck`;await Bun.$`rm -rf ${_}`.quiet().nothrow(),await Bun.$`mkdir -p ${_}`.quiet().nothrow(),await Bun.write(F,ae);let N=new Map,le=0;for(let[n,c]of g){let b=`${le++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${_}/${b}`,c.source),N.set(b,c)}let ue={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Oe(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},V=async(n,c)=>{let b=`${_}/tsconfig${c===1?"":`.${c}`}.json`;await Bun.write(b,JSON.stringify({compilerOptions:ue,files:n.map((D)=>`${_}/${D}`).concat(F,...w)},null,2));let k=Bun.spawnSync(["bun","x","tsc","-p",b,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(k.stdout)+new TextDecoder().decode(k.stderr),exitCode:k.exitCode??0}},J=await V([...N.keys()],1),U=J.output,I=[],W=J.exitCode,z=0,pe=new Set(w.map((n)=>n.split("/").pop())),q=0,B=new Set,H=(n)=>{for(let c of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
15
15
  `)){let b=c.match(Te);if(!b)continue;if(z++,pe.has(b[1].split("/").pop()))q++;let[,k,D,v,R,d,E]=b,O=k.split("/").pop(),C=N.get(O);if(!C)continue;if(De(Number(d)))B.add(O);let A=Number(D),L=Number(v),Y;if(C.virtual){let P=fi(C.virtual,A,L);if(!P?.expression)continue;if(pi(P,Number(d)))continue;A=P.line,L=P.column,Y=P.expression.code.trim()}I.push({file:C.origin,line:A,column:L,code:Number(d),message:E,category:R==="error"?"error":"warning",blockKind:C.kind,expression:Y})}};H(U);let de=z,fe=q;if(B.size>0&&B.size<N.size){let n=[...N.keys()].filter((c)=>!B.has(c));H((await V(n,2)).output)}if(s)for(let[n,c]of m){if(c.names.length===0)continue;I.push({file:n,line:c.line,column:1,code:0,message:`${c.names.length===1?"1 value reaches":`${c.names.length} values reach`} this block on the implicit bridge and ${c.names.length===1?"is":"are"} untyped: ${c.names.join(", ")}. Declare them with defineClientPayload({ ${c.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:c.kind})}I.push(...S);let Z=new Set,j=I.filter((n)=>{let c=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(Z.has(c))return!1;return Z.add(c),!0});j.sort((n,c)=>n.file.localeCompare(c.file)||n.line-c.line||n.column-c.column);let Q=fe>0&&j.length===0,ge=Q||W!==0&&de===0?`${Q?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${W} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
16
16
  ${U.trim().split(`
17
17
  `).slice(0,12).join(`
18
18
  `)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:x,blockCount:r,expressionCount:f,failure:ge}}function ml(e){return e.map((t)=>{let s=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${s}`}).join(`
19
19
  `)}
20
- export{ua,mo,fl,pa,fa,gl,ml};
20
+ export{da,mo,fl,pa,fa,gl,ml};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{y}from"./chunk-zk2xk0wd.js";import{O,Mt}from"./chunk-vpdx7qr3.js";import{w,qe,j,o}from"./chunk-faghmmrs.js";import{ce,vt,xt,St}from"./chunk-kp0hg06s.js";import{Me,Yt,mt,V}from"./chunk-2rx9d75e.js";import{E,Tn}from"./chunk-5db5sxy3.js";import p from"path";var a=new Map;function A(c,n){for(let s of c.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of c.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let i of(s[1]??"").split(",")){let l=((i.includes(":")?i.split(":").pop():i)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of c.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let i of(s[1]??"").split(",")){let r=i.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function pd(c){let n;if(c)n=p.resolve(c);else{let t=await o();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${xt()}`,i=new Bun.Glob("*.ts"),r=[];try{for await(let t of i.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return V(a,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>ce(t))])],f=Me(l()),d=mt(a,s,f);if(d!==void 0)return d||null;if(r.length===0)return V(a,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let x=u.map((t)=>t.file),m=[],g=new Set,v=j({loader:"ts",target:"browser",define:w()});for(let t of x)try{let e=await Bun.file(t).text(),_=p.basename(t,".ts");if(A(e,g),vt(e))e=await St(e,t,{projectRoot:process.cwd(),externalizeUserModules:E()});e=qe(e),e=O(e),e=Mt(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=v.transformSync(e),m.push(`// Store: ${_}
2
+ import{y}from"./chunk-dvc15djp.js";import{O,Mt}from"./chunk-vpdx7qr3.js";import{w,qe,j,o}from"./chunk-n4e02qdz.js";import{ce,wt,xt,St}from"./chunk-4pkpr5cg.js";import{Me,Yt,mt,V}from"./chunk-2rx9d75e.js";import{E,Tn}from"./chunk-5db5sxy3.js";import p from"path";var a=new Map;function A(c,n){for(let s of c.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of c.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let i of(s[1]??"").split(",")){let l=((i.includes(":")?i.split(":").pop():i)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of c.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let i of(s[1]??"").split(",")){let r=i.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function pu(c){let n;if(c)n=p.resolve(c);else{let t=await o();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${xt()}`,i=new Bun.Glob("*.ts"),r=[];try{for await(let t of i.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return V(a,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>ce(t))])],f=Me(l()),d=mt(a,s,f);if(d!==void 0)return d||null;if(r.length===0)return V(a,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let x=u.map((t)=>t.file),m=[],g=new Set,v=j({loader:"ts",target:"browser",define:w()});for(let t of x)try{let e=await Bun.file(t).text(),_=p.basename(t,".ts");if(A(e,g),wt(e))e=await St(e,t,{projectRoot:process.cwd(),externalizeUserModules:E()});e=qe(e),e=O(e),e=Mt(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=v.transformSync(e),m.push(`// Store: ${_}
3
3
  ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(m.length===0)return V(a,s,f,""),null;let S=m.join(`
4
4
 
5
5
  `),h=`;(function(){
@@ -7,5 +7,5 @@ var __stx = window.stx || {};
7
7
  ${y.filter((t)=>!g.has(t)&&new RegExp(`\\b${t}\\b`).test(S)).map((t)=>`var ${t} = __stx[${JSON.stringify(t)}];`).join(`
8
8
  `)}
9
9
  ${S}
10
- })();`,b=E()?Tn(h):h;return f=Me(l()),V(a,s,f,b),b}function fd(){a.clear(),Yt()}
11
- export{pd,fd};
10
+ })();`,b=E()?Tn(h):h;return f=Me(l()),V(a,s,f,b),b}function fu(){a.clear(),Yt()}
11
+ export{pu,fu};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function lt(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function Sr(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function dt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Zs(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function $e(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Qs(e){console.log(` ${O("\u2139")} ${e}`)}function eo(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function kr(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function ut(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function to(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function pt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
- export{lt,Sr,dt,Zs,$e,Qs,eo,kr,ut,to,pt};
2
+ var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function lt(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function kr(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function ut(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Zs(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function $e(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Qs(e){console.log(` ${O("\u2139")} ${e}`)}function eo(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function Cr(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function dt(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function to(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function pt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
+ export{lt,kr,ut,Zs,$e,Qs,eo,Cr,dt,to,pt};
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
228
228
  opacity: 1;
229
229
  max-height: 1000px;
230
230
  }
231
- `}function ed(){return`
231
+ `}function eu(){return`
232
232
  // STX Transition Runtime
233
233
  (function() {
234
234
  if (typeof window === 'undefined') return;
@@ -317,5 +317,5 @@ else {
317
317
 
318
318
  console.log('[stx] Transition runtime initialized');
319
319
  })();
320
- `}function td(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
- export{Jl,Yl,Zl,Ql,ed,td};
320
+ `}function tu(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
+ export{Jl,Yl,Zl,Ql,eu,tu};