@stacksjs/stx 0.2.454 → 0.2.456
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-service-worker.d.ts +4 -1
- package/dist/chunk-087t6m0p.js +2 -0
- package/dist/chunk-0bdgcm01.js +2 -0
- package/dist/{chunk-yx37nrgr.js → chunk-0trfbqa7.js} +4 -4
- package/dist/{chunk-8ah8npj3.js → chunk-0v5dpk7r.js} +1 -1
- package/dist/{chunk-47jq9j1w.js → chunk-0vgfe5bf.js} +2 -2
- package/dist/chunk-143gpdxy.js +2 -0
- package/dist/{chunk-w8ek4fe8.js → chunk-1sdtg9np.js} +2 -2
- package/dist/chunk-1vgmzmsw.js +2 -0
- package/dist/{chunk-4q366fhp.js → chunk-28qkwe2b.js} +5 -5
- package/dist/{chunk-7mbx7dzg.js → chunk-2bdthb37.js} +2 -2
- package/dist/{chunk-149r1q6c.js → chunk-2cy956js.js} +2 -2
- package/dist/{chunk-2428rqy1.js → chunk-2d1n2fsz.js} +14 -7
- package/dist/chunk-2hddf9pn.js +2 -0
- package/dist/chunk-2zh91zea.js +2 -0
- package/dist/chunk-3227dnct.js +2 -0
- package/dist/chunk-32t5agpk.js +2 -0
- package/dist/chunk-33kwpw1a.js +4 -0
- package/dist/chunk-3ar8gdyd.js +2 -0
- package/dist/chunk-3s2vnqcf.js +2 -0
- package/dist/{chunk-hhjff2r8.js → chunk-44msrx2e.js} +3 -3
- package/dist/{chunk-0tchj3ct.js → chunk-462jmw0a.js} +6 -6
- package/dist/chunk-491pm0a9.js +2 -0
- package/dist/{chunk-g8k5rsqq.js → chunk-4fa3jec9.js} +12 -12
- package/dist/chunk-4henqdjf.js +2 -0
- package/dist/chunk-4qv9me8f.js +2 -0
- package/dist/chunk-561yczfn.js +2 -0
- package/dist/chunk-58n62bxb.js +3 -0
- package/dist/chunk-5arm42dc.js +17 -0
- package/dist/chunk-5hhrbzam.js +2 -0
- package/dist/chunk-5m8q7c5r.js +2 -0
- package/dist/{chunk-pkpmyr0x.js → chunk-5p56w2ke.js} +3 -3
- package/dist/chunk-5pjsc9zv.js +3 -0
- package/dist/{chunk-n9jn3qzw.js → chunk-5qns2sdz.js} +2 -2
- package/dist/chunk-68txmj8d.js +2 -0
- package/dist/{chunk-45rfv3a5.js → chunk-6cp3afft.js} +2 -2
- package/dist/chunk-6qv189mb.js +2 -0
- package/dist/{chunk-dwp3knc4.js → chunk-6r2709dj.js} +3 -3
- package/dist/{chunk-81v9crqy.js → chunk-6wpm3r4h.js} +1 -1
- package/dist/chunk-7rv3nvfh.js +2 -0
- package/dist/chunk-7tt84v1y.js +3 -0
- package/dist/{chunk-33xh91s8.js → chunk-7xeb9szc.js} +2 -2
- package/dist/chunk-8efg91ak.js +4 -0
- package/dist/chunk-8j16292d.js +33 -0
- package/dist/{chunk-qbhbe9cw.js → chunk-8nrttk4f.js} +5 -5
- package/dist/{chunk-73h7qjgq.js → chunk-8xz8t9xp.js} +2 -2
- package/dist/chunk-9t50hw97.js +2 -0
- package/dist/chunk-9z22zs86.js +2 -0
- package/dist/chunk-a32kqsff.js +2 -0
- package/dist/{chunk-19h1j59a.js → chunk-ab56jdah.js} +1 -1
- package/dist/chunk-arvst4wq.js +2 -0
- package/dist/chunk-b70kzmyd.js +3 -0
- package/dist/{chunk-0xztxj98.js → chunk-bq2e9qf6.js} +3 -3
- package/dist/{chunk-aem9hs8n.js → chunk-br1gra4w.js} +2 -2
- package/dist/{chunk-hqywyyez.js → chunk-c491hsm1.js} +5 -5
- package/dist/{chunk-jn8tj4kn.js → chunk-d3mpxr3s.js} +4 -4
- package/dist/chunk-d3zpz5r0.js +2 -0
- package/dist/{chunk-rbkna5rw.js → chunk-d4f1bxtt.js} +11 -11
- package/dist/{chunk-849wf19d.js → chunk-dxxs52yw.js} +3 -3
- package/dist/chunk-ef0gstkd.js +2 -0
- package/dist/{chunk-zqzv5jy2.js → chunk-exgyf65a.js} +4 -4
- package/dist/chunk-f0nf5p60.js +2 -0
- package/dist/{chunk-538h1sfc.js → chunk-f4c39nfh.js} +2 -2
- package/dist/{chunk-s5drjm2j.js → chunk-gkqxnetc.js} +6 -6
- package/dist/chunk-gp5n35mt.js +2 -0
- package/dist/{chunk-axydabse.js → chunk-h9e032kq.js} +3 -3
- package/dist/chunk-ha5z623e.js +2 -0
- package/dist/chunk-hehtgsrt.js +2 -0
- package/dist/chunk-hqzq3a61.js +2 -0
- package/dist/chunk-hskrxdcc.js +2 -0
- package/dist/chunk-hsv23bw6.js +2 -0
- package/dist/chunk-hvx3pc13.js +2 -0
- package/dist/chunk-hz3r02zb.js +2 -0
- package/dist/chunk-jdhs9w6h.js +2 -0
- package/dist/{chunk-vraddzkf.js → chunk-jepq6316.js} +4 -4
- package/dist/{chunk-3pc22sve.js → chunk-jfra00dj.js} +6 -6
- package/dist/{chunk-b5wh10s9.js → chunk-jnmngqs9.js} +78 -78
- package/dist/chunk-jv9xhgvy.js +2 -0
- package/dist/{chunk-dqr5n49p.js → chunk-jz7pvh7b.js} +2 -2
- package/dist/chunk-kcs71ks8.js +2 -0
- package/dist/{chunk-26wmppja.js → chunk-kppgyqwb.js} +1 -1
- package/dist/{chunk-fmj4xvqm.js → chunk-mhpsz5m0.js} +5 -5
- package/dist/chunk-mrk31q6x.js +2 -0
- package/dist/{chunk-b1q5sh7x.js → chunk-n1dyjhte.js} +3 -3
- package/dist/chunk-n38wvr7z.js +2831 -0
- package/dist/{chunk-mnz6bdp3.js → chunk-n866vbgj.js} +5 -5
- package/dist/chunk-n8hd5qap.js +2 -0
- package/dist/{chunk-s59r34p5.js → chunk-nmf12mx3.js} +4 -4
- package/dist/chunk-nqvb9094.js +2 -0
- package/dist/{chunk-9zbjk8pg.js → chunk-nww25qj9.js} +8 -8
- package/dist/chunk-p1mvzdhy.js +2 -0
- package/dist/chunk-pdqt4me8.js +2 -0
- package/dist/chunk-pe214qcn.js +2 -0
- package/dist/chunk-pqxhn8nj.js +2 -0
- package/dist/{chunk-4yyzje7d.js → chunk-pw34r8r5.js} +1 -1
- package/dist/chunk-q6pet6hn.js +2 -0
- package/dist/chunk-q98v7bhs.js +2 -0
- package/dist/chunk-qk6nasfm.js +2 -0
- package/dist/{chunk-d1xbamr1.js → chunk-qn2mx2js.js} +2 -2
- package/dist/{chunk-5xj1df83.js → chunk-r6pax860.js} +7 -7
- package/dist/{chunk-rdq113p4.js → chunk-r80km6mn.js} +2 -2
- package/dist/{chunk-tehvry9a.js → chunk-rcr57c30.js} +10 -10
- package/dist/{chunk-8fj8sm1a.js → chunk-ree9weje.js} +2 -2
- package/dist/{chunk-x4ztj64h.js → chunk-rgwvqmhh.js} +2 -2
- package/dist/{chunk-tn85vr56.js → chunk-rvgvt161.js} +2 -2
- package/dist/{chunk-z68rb7qp.js → chunk-s07kcpc3.js} +5 -5
- package/dist/chunk-sb9nkthv.js +2 -0
- package/dist/chunk-sk1pm2d1.js +11 -0
- package/dist/{chunk-yfd0e7dr.js → chunk-tbjyp03h.js} +1 -1
- package/dist/{chunk-g2afpsw0.js → chunk-tpeyn7wr.js} +2 -2
- package/dist/{chunk-s6e8mmk1.js → chunk-tpvc8xnk.js} +6 -6
- package/dist/chunk-tr7dz5g5.js +2 -0
- package/dist/{chunk-5cyme1g0.js → chunk-v3yqeh15.js} +2 -2
- package/dist/chunk-vc1816wk.js +2 -0
- package/dist/{chunk-9ndzk9r4.js → chunk-vg7wfkt5.js} +3 -3
- package/dist/chunk-vrvnctex.js +2 -0
- package/dist/{chunk-afhkvj3k.js → chunk-w1zvh5y7.js} +2 -2
- package/dist/chunk-wpmzsmrj.js +2 -0
- package/dist/chunk-wywv3kj8.js +2 -0
- package/dist/chunk-xfr3acjk.js +2 -0
- package/dist/chunk-xjqq3jrx.js +2 -0
- package/dist/chunk-xq2v4jpx.js +2 -0
- package/dist/{chunk-3nydw825.js → chunk-y2v0hny6.js} +8 -8
- package/dist/{chunk-56rk985x.js → chunk-y3cqh2jv.js} +3 -3
- package/dist/{chunk-697zcjzg.js → chunk-y8zt1j3h.js} +12 -12
- package/dist/chunk-yyfv2snf.js +2 -0
- package/dist/{chunk-0vbpcef6.js → chunk-z2daw0th.js} +4 -4
- package/dist/{chunk-nw8p8eg9.js → chunk-z3etxty5.js} +5 -5
- package/dist/{chunk-g3h7j2n7.js → chunk-z80d9dd2.js} +2 -2
- package/dist/chunk-z990jtmx.js +2 -0
- package/dist/{chunk-jwpcck1b.js → chunk-zydg3wgt.js} +2 -2
- package/dist/cli.js +20 -20
- package/dist/client-script.d.ts +0 -21
- package/dist/client-script.js +21 -0
- package/dist/composable-loader.js +41 -17
- package/dist/compression.js +25 -6
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/html-masking.js +36 -8
- package/dist/i18n.js +4 -3
- package/dist/includes.js +6 -2
- package/dist/misc-directives.d.ts +0 -10
- package/dist/misc-directives.js +12 -0
- package/dist/offline/app-service-worker.d.ts +4 -1
- package/dist/offline/app-service-worker.js +62 -27
- package/dist/process.js +4 -0
- package/dist/pwa.js +3 -3
- package/dist/signals.js +8 -1
- package/dist/source-signature.d.ts +5 -2
- package/dist/source-signature.js +7 -0
- package/dist/ssg.js +8 -8
- package/dist/store-loader.js +2 -1
- package/dist/utils.js +27 -15
- package/package.json +5 -5
- package/dist/chunk-14x69rt4.js +0 -2
- package/dist/chunk-1kmd0g1k.js +0 -3
- package/dist/chunk-3wezvz6m.js +0 -2
- package/dist/chunk-5402rpwg.js +0 -2
- package/dist/chunk-58ymq1h4.js +0 -2
- package/dist/chunk-5rtbs8zv.js +0 -2
- package/dist/chunk-5tx1wqns.js +0 -2
- package/dist/chunk-6fw3rfcj.js +0 -2
- package/dist/chunk-6nfecsbt.js +0 -2
- package/dist/chunk-6sw7sxh2.js +0 -17
- package/dist/chunk-7qbv0xh6.js +0 -2
- package/dist/chunk-7vdsd9rn.js +0 -2
- package/dist/chunk-8gk34047.js +0 -2
- package/dist/chunk-8nsfkr5n.js +0 -2
- package/dist/chunk-90562q79.js +0 -3
- package/dist/chunk-a1dggchm.js +0 -2
- package/dist/chunk-a1kv42kp.js +0 -2
- package/dist/chunk-a5695s8k.js +0 -2
- package/dist/chunk-avjgetkh.js +0 -2
- package/dist/chunk-bcgth8qf.js +0 -2
- package/dist/chunk-bemksdz5.js +0 -33
- package/dist/chunk-br3ktpyq.js +0 -2
- package/dist/chunk-by1s70jp.js +0 -2
- package/dist/chunk-cwc3p6p7.js +0 -2
- package/dist/chunk-e593pr1r.js +0 -2
- package/dist/chunk-e8y69gg0.js +0 -2
- package/dist/chunk-eam7eann.js +0 -2
- package/dist/chunk-ej7m406s.js +0 -2
- package/dist/chunk-es85mgdw.js +0 -2
- package/dist/chunk-fa5x9zbk.js +0 -2
- package/dist/chunk-fkrzsk74.js +0 -2
- package/dist/chunk-fm3k5v8s.js +0 -2
- package/dist/chunk-fmc9fj4a.js +0 -2
- package/dist/chunk-fn863yek.js +0 -2
- package/dist/chunk-fv30avp2.js +0 -2
- package/dist/chunk-gpmk4s4f.js +0 -2
- package/dist/chunk-hd64hz1n.js +0 -2
- package/dist/chunk-hd75916k.js +0 -4
- package/dist/chunk-hz6a476h.js +0 -2
- package/dist/chunk-j7zywbq0.js +0 -4
- package/dist/chunk-jjm3754f.js +0 -2
- package/dist/chunk-ktk30f6d.js +0 -2
- package/dist/chunk-m3f50p6c.js +0 -2
- package/dist/chunk-m90a5dpn.js +0 -2
- package/dist/chunk-mmp7x8f0.js +0 -2
- package/dist/chunk-nqcg2bf0.js +0 -2
- package/dist/chunk-nrp8qg9j.js +0 -2831
- package/dist/chunk-ns7e951g.js +0 -2
- package/dist/chunk-nycvwnty.js +0 -2
- package/dist/chunk-p9shre7t.js +0 -2
- package/dist/chunk-pe9hxhrb.js +0 -2
- package/dist/chunk-ph6xg67j.js +0 -11
- package/dist/chunk-qewxfhex.js +0 -2
- package/dist/chunk-qfrg8mnf.js +0 -2
- package/dist/chunk-rmnhy5az.js +0 -2
- package/dist/chunk-t6m5wmpy.js +0 -2
- package/dist/chunk-v404gvm0.js +0 -2
- package/dist/chunk-vgvsefz8.js +0 -2
- package/dist/chunk-w9k7pvre.js +0 -2
- package/dist/chunk-wf09xg7j.js +0 -2
- package/dist/chunk-wgqt5pnv.js +0 -2
- package/dist/chunk-wr3h8dmt.js +0 -2
- package/dist/chunk-wtqjfar3.js +0 -2
- package/dist/chunk-x1xncm97.js +0 -2
- package/dist/chunk-yd50awqp.js +0 -3
- package/dist/chunk-ykxd78b2.js +0 -2
- package/dist/chunk-yqsza22w.js +0 -3
- package/dist/chunk-zj80vrv6.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var jr=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function Co(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||jr},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
|
|
2
|
+
var Br=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{name:"variant",type:"string",required:!1,default:"primary"},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onclick",type:"callback",required:!1}],children:"single"}],["craft-text-input",{name:"TextInput",zigType:"craft.TextInput",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-textarea",{name:"TextArea",zigType:"craft.TextArea",props:[{name:"value",type:"string",required:!1,default:""},{name:"placeholder",type:"string",required:!1},{name:"rows",type:"number",required:!1,default:3},{name:"disabled",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-checkbox",{name:"Checkbox",zigType:"craft.Checkbox",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"label",type:"string",required:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-select",{name:"Select",zigType:"craft.Select",props:[{name:"value",type:"string",required:!1},{name:"options",type:"array",required:!0},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-slider",{name:"Slider",zigType:"craft.Slider",props:[{name:"value",type:"number",required:!1,default:0},{name:"min",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"step",type:"number",required:!1,default:1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-toggle",{name:"Toggle",zigType:"craft.Toggle",props:[{name:"checked",type:"boolean",required:!1,default:!1},{name:"disabled",type:"boolean",required:!1,default:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-modal",{name:"Modal",zigType:"craft.Modal",props:[{name:"open",type:"boolean",required:!1,default:!1},{name:"title",type:"string",required:!1},{name:"closable",type:"boolean",required:!1,default:!0},{name:"onclose",type:"callback",required:!1}],children:"multiple"}],["craft-alert",{name:"Alert",zigType:"craft.Alert",props:[{name:"variant",type:"string",required:!1,default:"info"},{name:"title",type:"string",required:!1},{name:"dismissible",type:"boolean",required:!1,default:!1}],children:"single"}],["craft-progress",{name:"ProgressBar",zigType:"craft.ProgressBar",props:[{name:"value",type:"number",required:!1,default:0},{name:"max",type:"number",required:!1,default:100},{name:"indeterminate",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-spinner",{name:"Spinner",zigType:"craft.Spinner",props:[{name:"size",type:"number",required:!1,default:24}],children:"none"}],["craft-avatar",{name:"Avatar",zigType:"craft.Avatar",props:[{name:"src",type:"string",required:!1},{name:"alt",type:"string",required:!1},{name:"size",type:"number",required:!1,default:40}],children:"none"}],["craft-badge",{name:"Badge",zigType:"craft.Badge",props:[{name:"variant",type:"string",required:!1,default:"default"}],children:"single"}],["craft-card",{name:"Card",zigType:"craft.Card",props:[{name:"padding",type:"number",required:!1,default:16}],children:"multiple"}],["craft-sidebar",{name:"Sidebar",zigType:"craft.NativeSidebar",props:[{name:"id",type:"string",required:!1},{name:"variant",type:"string",required:!1,default:"desktop"},{name:"material",type:"string",required:!1,default:"sidebar"},{name:"backgroundEffect",type:"string",required:!1,default:"shimmer"},{name:"allowsVibrancy",type:"boolean",required:!1,default:!0},{name:"materialOpacity",type:"number",required:!1,default:0.68},{name:"minWidth",type:"number",required:!1,default:240},{name:"maxWidth",type:"number",required:!1,default:340},{name:"canCollapse",type:"boolean",required:!1,default:!0},{name:"selectedItem",type:"string",required:!1},{name:"sections",type:"array",required:!1}],children:"multiple",platform:["macos"],fallback:"aside"}],["craft-sidebar-section",{name:"SidebarSection",zigType:"craft.NativeSidebarSection",props:[{name:"id",type:"string",required:!0},{name:"title",type:"string",required:!1},{name:"header",type:"string",required:!1}],children:"multiple",platform:["macos"],fallback:"section"}],["craft-sidebar-item",{name:"SidebarItem",zigType:"craft.NativeSidebarItem",props:[{name:"id",type:"string",required:!0},{name:"label",type:"string",required:!0},{name:"icon",type:"string",required:!1},{name:"badge",type:"string",required:!1},{name:"tintColor",type:"color",required:!1}],children:"none",platform:["macos"],fallback:"button"}],["craft-accordion",{name:"Accordion",zigType:"craft.Accordion",props:[{name:"title",type:"string",required:!0},{name:"open",type:"boolean",required:!1,default:!1}],children:"multiple"}],["craft-tabs",{name:"TabView",zigType:"craft.TabView",props:[{name:"activeTab",type:"number",required:!1,default:0},{name:"ontabchange",type:"callback",required:!1}],children:"multiple"}],["craft-tooltip",{name:"Tooltip",zigType:"craft.Tooltip",props:[{name:"content",type:"string",required:!0},{name:"position",type:"string",required:!1,default:"top"}],children:"single"}],["craft-date-picker",{name:"DatePicker",zigType:"craft.DatePicker",props:[{name:"value",type:"string",required:!1},{name:"min",type:"string",required:!1},{name:"max",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-time-picker",{name:"TimePicker",zigType:"craft.TimePicker",props:[{name:"value",type:"string",required:!1},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-color-picker",{name:"ColorPicker",zigType:"craft.ColorPicker",props:[{name:"value",type:"color",required:!1,default:"#000000"},{name:"onchange",type:"callback",required:!1}],children:"none"}],["craft-data-table",{name:"DataTable",zigType:"craft.DataTable",props:[{name:"data",type:"array",required:!0},{name:"columns",type:"array",required:!0},{name:"sortable",type:"boolean",required:!1,default:!1},{name:"paginated",type:"boolean",required:!1,default:!1}],children:"none"}],["craft-virtual-list",{name:"VirtualList",zigType:"craft.VirtualList",props:[{name:"items",type:"array",required:!0},{name:"itemHeight",type:"number",required:!1,default:48},{name:"renderItem",type:"callback",required:!0}],children:"none"}],["craft-tree-view",{name:"TreeView",zigType:"craft.TreeView",props:[{name:"data",type:"object",required:!0},{name:"expandable",type:"boolean",required:!1,default:!0}],children:"none"}]]);async function $o(e,t={}){let r=performance.now(),n={target:t.target||"universal",format:t.format||"zig",optimize:t.optimize??!0,treeShake:t.treeShake??!0,hotReload:t.hotReload??!1,debug:t.debug??!1,sourceMaps:t.sourceMaps??!1,bundle:t.bundle??!0,minify:t.minify??!1,components:t.components||Br},i=typeof e==="string"?w(e):e,o=I(i.tree,n),s=L(o),a=n.treeShake?O(o,s):o,l=new Map;if(n.target==="universal"){let c=["macos","windows","linux","ios","android"];for(let g of c){let q=u(a,{...n,target:g});l.set(g,q)}}else{let c=u(a,n);l.set(n.target,c)}let p=H(a,n,l),S=_(i,a,n),k={compilationTime:performance.now()-r,totalComponents:f(i.tree),nativeComponents:d(a),webComponents:f(i.tree)-d(a),bundleSize:p.length,treeShakenSize:n.treeShake?W(o,a):p.length,warnings:[],errors:[]},m;if(n.sourceMaps)m=B(i,a);return{code:p,platformCode:l,dependencies:s,manifest:S,sourceMaps:m,stats:k}}function w(e){let t={type:"fragment",children:[]},r=e.match(/<body[^>]*>([\s\S]*?)<\/body>/i),n=r?r[1]:e;return b(n,t),{id:T(),hash:x(e),tree:t,scripts:U(e),styles:Z(e),staticParts:new Map,dynamicParts:new Map,dependencies:[],metadata:{hasSlots:!1,hasDynamicContent:e.includes("{{"),hasEventHandlers:e.includes("onclick")||e.includes("onchange"),hasAsyncContent:!1,componentCount:0,maxDepth:0,estimatedSize:e.length}}}function b(e,t){let r=/<(@?[\w-]+)([^>]*)(?:\/>|>([\s\S]*?)<\/\1>)/g,n;while((n=r.exec(e))!==null){let[,i,o,s]=n,a=i.startsWith("@craft-"),l={type:a?"component":"element",tag:a?i.slice(1):i,props:z(o),children:[],componentName:a?i.slice(1):void 0};if(s){let p=s.replace(/<[^>]+>/g,"").trim();if(p)l.children=l.children??[],l.children.push({type:"text",text:p});b(s,l)}t.children=t.children??[],t.children.push(l)}}function z(e){let t={},r=/([\w-:@]+)(?:=["']([^"']*)["'])?/g,n;while((n=r.exec(e))!==null){let[,i,o]=n;t[i]=o??!0}return t}function I(e,t){return h(e,t)}function h(e,t){let r=e.componentName?t.components?.get(e.componentName):void 0,n="craft.View";if(r)n=r.zigType;else if(e.type==="text")n="craft.Text";else if(e.tag)n=R(e.tag);let i={};if(e.props)for(let[l,p]of Object.entries(e.props))i[l]=M(p);let o=[];if(e.children)for(let l of e.children)o.push(h(l,t));let s=new Map;if(e.props){for(let[l,p]of Object.entries(e.props))if(l.startsWith("on")&&typeof p==="string")s.set(l.slice(2).toLowerCase(),p)}let a=V(e);return{type:A(e,r),zigType:n,props:i,children:o,events:s,styles:a,id:e.hydrationKey,key:e.props?.key}}function R(e){return{div:"craft.View",span:"craft.Text",p:"craft.Text",h1:"craft.Text",h2:"craft.Text",h3:"craft.Text",h4:"craft.Text",h5:"craft.Text",h6:"craft.Text",button:"craft.Button",input:"craft.TextInput",textarea:"craft.TextArea",select:"craft.Select",img:"craft.Image",a:"craft.Link",ul:"craft.List",ol:"craft.List",li:"craft.ListItem",form:"craft.Form",label:"craft.Label",nav:"craft.View",header:"craft.View",footer:"craft.View",main:"craft.View",section:"craft.View",article:"craft.View",aside:"craft.View"}[e.toLowerCase()]||"craft.View"}function M(e){if(typeof e==="string"){if(e.startsWith("{{")&&e.endsWith("}}"))return{type:"binding",path:e.slice(2,-2).trim()};if(e.includes("(")&&e.includes(")"))return{type:"callback",handler:e};return{type:"literal",value:e}}if(typeof e==="number"||typeof e==="boolean")return{type:"literal",value:e};return{type:"literal",value:String(e)}}function A(e,t){if(t){let n=t.name.toLowerCase();if(n.includes("button"))return"button";if(n.includes("input")||n.includes("text"))return"input";if(n.includes("image")||n.includes("avatar"))return"image";if(n.includes("list")||n.includes("table"))return"list";if(n.includes("scroll"))return"scroll";return"custom"}if(e.type==="text")return"text";let r=e.tag?.toLowerCase();if(r==="button")return"button";if(r==="input"||r==="textarea")return"input";if(r==="img")return"image";if(r==="ul"||r==="ol")return"list";return"view"}function V(e){let t=e.props?.style,r={},n={};if(t){let i=t.split(";").filter(Boolean);for(let o of i){let[s,a]=o.split(":").map((l)=>l.trim());if(!s||!a)continue;switch(s){case"display":r.display=a;break;case"flex-direction":r.flexDirection=a;break;case"justify-content":r.justifyContent=j(a);break;case"align-items":r.alignItems=D(a);break;case"gap":r.gap=Number.parseInt(a,10);break;case"padding":r.padding=Number.parseInt(a,10);break;case"margin":r.margin=Number.parseInt(a,10);break;case"width":r.width=a==="auto"?"auto":Number.parseInt(a,10);break;case"height":r.height=a==="auto"?"auto":Number.parseInt(a,10);break;case"background-color":case"background":n.backgroundColor=a;break;case"border-color":n.borderColor=a;break;case"border-width":n.borderWidth=Number.parseInt(a,10);break;case"border-radius":n.borderRadius=Number.parseInt(a,10);break;case"opacity":n.opacity=Number.parseFloat(a);break}}}return{layout:r,appearance:n}}function j(e){return{"flex-start":"start","flex-end":"end",center:"center","space-between":"between","space-around":"around"}[e]||"start"}function D(e){return{"flex-start":"start","flex-end":"end",center:"center",stretch:"stretch"}[e]||"start"}function L(e){let t=[],r=new Set;function n(i,o){let s=i.id||T();if(r.has(s))return;r.add(s);let a={id:s,type:"component",path:i.zigType,dependencies:o?[o]:[],size:C(i),isStatic:P(i)};t.push(a);for(let l of i.children)n(l,s)}return n(e),t}function C(e){let t=100;return t+=Object.keys(e.props).length*20,t+=e.events.size*50,t}function P(e){for(let t of Object.values(e.props))if(t.type!=="literal")return!1;return e.events.size===0}function O(e,t){return e}function W(e,t){let r=0;function n(i){r+=C(i);for(let o of i.children)n(o)}return n(t),r}function u(e,t){switch(t.format){case"zig":return y(e,t);case"typescript":return E(e,t);case"json":return JSON.stringify(e,null,t.minify?0:2);default:return y(e,t)}}function y(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('const std = @import("std");'),r.push('const craft = @import("craft");'),r.push(""),r.push("pub fn render(allocator: std.mem.Allocator) !craft.Element {"),r.push(" return try build(allocator);"),r.push("}"),r.push(""),N(e,r,0),r.join(`
|
|
3
3
|
`)}function N(e,t,r){let n=" ".repeat(r);if(r===0)t.push("fn build(allocator: std.mem.Allocator) !craft.Element {");let i=`node_${r}`;t.push(`${n} var ${i} = try ${e.zigType}.init(allocator);`);for(let[o,s]of Object.entries(e.props))if(s.type==="literal"){let a=typeof s.value==="string"?`"${s.value}"`:String(s.value);t.push(`${n} ${i}.set${J(o)}(${a});`)}for(let o=0;o<e.children.length;o++){let s=e.children[o];if(s.type==="text"){let a=s.props.text?.type==="literal"?String(s.props.text.value):"";t.push(`${n} try ${i}.addChild(try craft.Text.init(allocator, "${a}"));`)}else N(s,t,r+1),t.push(`${n} try ${i}.addChild(node_${r+1});`)}if(r===0)t.push(` return ${i}.element();`),t.push("}")}function E(e,t){let r=[];return r.push("// Auto-generated by stx compiler"),r.push("// Target: "+t.target),r.push(""),r.push('import { Craft } from "@stacksjs/craft";'),r.push(""),r.push("export function render(): Craft.Element {"),r.push(" return "+v(e,1)+";"),r.push("}"),r.join(`
|
|
4
4
|
`)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
|
|
5
5
|
${r} [${o.join(`,
|
|
6
6
|
${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
|
|
7
|
-
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function
|
|
8
|
-
export{
|
|
7
|
+
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Eo(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:$o,createHotReloadServer:Eo,NATIVE_COMPONENTS:Br},mu=K;
|
|
8
|
+
export{Br,$o,Eo,mu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function go(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function mo(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
|
|
3
3
|
<div class="virtual-item ${t.itemClass||""}"
|
|
4
4
|
style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
|
|
5
5
|
data-index="${a}">
|
|
@@ -76,7 +76,7 @@ function fo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
76
76
|
};
|
|
77
77
|
})();
|
|
78
78
|
</script>
|
|
79
|
-
`})}function
|
|
79
|
+
`})}function ca(){return`
|
|
80
80
|
.virtual-list-container {
|
|
81
81
|
position: relative;
|
|
82
82
|
overflow-y: auto;
|
|
@@ -124,7 +124,7 @@ function fo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
124
124
|
0% { background-position: 200% 0; }
|
|
125
125
|
100% { background-position: -200% 0; }
|
|
126
126
|
}
|
|
127
|
-
`}function
|
|
127
|
+
`}function la(v,c){let l=null,u=()=>{if(!l)l=go(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function ua(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=mo(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
128
|
// Infinite scroll detection
|
|
129
129
|
container.addEventListener('scroll', function() {
|
|
130
130
|
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
@@ -142,7 +142,7 @@ function fo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
142
142
|
${x}
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
145
|
-
`})}function
|
|
145
|
+
`})}function da(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
|
|
146
146
|
<div class="virtual-grid-item"
|
|
147
147
|
style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
|
|
148
148
|
data-index="${I}">
|
|
@@ -212,5 +212,5 @@ function fo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
212
212
|
});
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
|
-
`})}var
|
|
216
|
-
export{
|
|
215
|
+
`})}var fl={createVirtualList:go,processVirtualListDirectives:mo,processInfiniteListDirectives:ua,processVirtualGridDirectives:da,generateVirtualListCSS:ca,useVirtualList:la};
|
|
216
|
+
export{go,mo,ca,la,ua,da,fl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pu,Vo,Iu,Uo,Za,Qa,xt,tn,Du,ec,tc,nc,f}from"./chunk-n38wvr7z.js";import"./chunk-bq2e9qf6.js";import"./chunk-8xz8t9xp.js";import"./chunk-0trfbqa7.js";import"./chunk-br1gra4w.js";import"./chunk-zydg3wgt.js";import"./chunk-4fa3jec9.js";import"./chunk-exgyf65a.js";import"./chunk-r6pax860.js";import"./chunk-h9e032kq.js";import"./chunk-w1zvh5y7.js";import"./chunk-nmf12mx3.js";import"./chunk-jz7pvh7b.js";export{xt as buildCss,ec as extractClassNames,Qa as fingerprintConfig,tc as generateCss,Du as getCachedCSS,Pu as getCssServeAsset,f as injectCss,Vo as loadCssEngine,Uo as loadCssEngineConfig,tn as rebuildCss,Iu as resetCssCache,Za as resolveUserCssConfig,nc as withLinkedModuleBundles};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,i}from"./chunk-
|
|
2
|
+
import{t,i}from"./chunk-r6pax860.js";import{Xe,Ge,Je,ue,we,E,er,ln,pe}from"./chunk-exgyf65a.js";var C=/(?<![\w$@])@meta\s*\(/g,x=/(?<![\w$@])@metaTag\s*\(/g,N=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function S(e,r){return(n)=>E(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function ks(e,r,n,p){if(!e.includes("@meta"))return e;let s=Xe(e,C,(a,c)=>{let o=ln(Ge(a),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return E("Meta",c,o.message,n,o.code)},S("Meta",n));return s=Xe(s,x,(a,c)=>{let o=Je(a,r);if(!o.ok)return E("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!we(o.value))return E("MetaTag",c,`expected an object such as { name, content }, got ${ue(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return E("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let g="<meta";if(u.name)g+=` name="${l(u.name)}"`;if(u.property)g+=` property="${l(u.property)}"`;if(u.httpEquiv)g+=` http-equiv="${l(u.httpEquiv)}"`;return g+=` content="${l(u.content)}">`,g},S("MetaTag",n)),s}function b(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(we(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(we))return e.map(r);return null}function _(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Cs(e,r,n){if(!e.includes("@structuredData"))return e;return Xe(e,N,(p,s)=>{let a=Je(p,r);if(!a.ok)return E("StructuredData",s,a.message,n,a.code);if(a.value===void 0||a.value===null)return"";let c=b(a.value);if(!c)return E("StructuredData",s,`expected an object or an array of objects, got ${ue(a.value)}`,n,t.TYPE_ERROR);try{return _(c)}catch(o){let u=o instanceof Error?o.message:String(o);return E("StructuredData",s,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},S("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function $s(e,r,n,p){if(!e.includes("@seo"))return e;return Xe(e,k,(s,a)=>{if(!s.trim())return E("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Je(s,r);if(!c.ok)return E("SEO",a,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!we(c.value))return E("SEO",a,`expected an object such as { title, description }, got ${ue(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,a,n)}catch(o){let u=o instanceof Error?o.message:String(o);return E("SEO",a,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},S("SEO",n))}function R(e,r,n,p){let s=e[r];if(s===void 0||s===null||s===!1)return;if(we(s))return s;er(n,`${r} must be an object, got ${ue(s)}; its tags were left out`,p);return}function q(e,r,n){let p=Object.keys(e).filter((o)=>!L.has(o));if(p.length>0){let o=p.map((u)=>A[u]?`${u} (use ${A[u]})`:u).join(", ");er(r,`@seo does not read ${o}; ${p.length===1?"it was":"they were"} ignored`,n)}let s="";if(e.title)s+=`<title>${l(e.title)}</title>
|
|
3
3
|
`,s+=`<meta name="title" content="${l(e.title)}">
|
|
4
4
|
`;if(e.description)s+=`<meta name="description" content="${l(e.description)}">
|
|
5
5
|
`;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;s+=`<meta name="keywords" content="${l(o)}">
|
|
6
6
|
`}if(e.robots)s+=`<meta name="robots" content="${l(e.robots)}">
|
|
7
7
|
`;if(e.canonical)s+=`<link rel="canonical" href="${l(e.canonical)}">
|
|
8
|
-
`;let a=
|
|
8
|
+
`;let a=R(e,"openGraph",r,n);if(a){if(s+=`<meta property="og:type" content="${l(a.type||"website")}">
|
|
9
9
|
`,a.title||e.title){let o=a.title||e.title||"";s+=`<meta property="og:title" content="${l(o)}">
|
|
10
10
|
`}if(a.description||e.description){let o=a.description||e.description||"";s+=`<meta property="og:description" content="${l(o)}">
|
|
11
11
|
`}if(a.url||e.canonical){let o=a.url||e.canonical||"";s+=`<meta property="og:url" content="${l(o)}">
|
|
@@ -17,15 +17,15 @@ import{t,i}from"./chunk-5xj1df83.js";import{Xe,Ge,Je,ue,we,k,Qn,cn,pe}from"./chu
|
|
|
17
17
|
`}if(a.siteName)s+=`<meta property="og:site_name" content="${l(a.siteName)}">
|
|
18
18
|
`;if(a.locale)s+=`<meta property="og:locale" content="${l(a.locale)}">
|
|
19
19
|
`;if(a.profile){let o=[["first_name",a.profile.firstName],["last_name",a.profile.lastName],["username",a.profile.username],["gender",a.profile.gender]];for(let[u,g]of o)if(g)s+=`<meta property="profile:${u}" content="${l(g)}">
|
|
20
|
-
`}}let c=
|
|
20
|
+
`}}let c=R(e,"twitter",r,n);if(c){if(s+=`<meta name="twitter:card" content="${l(c.card||"summary_large_image")}">
|
|
21
21
|
`,c.title||e.title){let o=c.title||e.title||"";s+=`<meta name="twitter:title" content="${l(o)}">
|
|
22
22
|
`}if(c.description||e.description){let o=c.description||e.description||"";s+=`<meta name="twitter:description" content="${l(o)}">
|
|
23
23
|
`}if(c.image||a&&a.image){let o=c.image||(a?a.image:"")||"";s+=`<meta name="twitter:image" content="${l(o)}">
|
|
24
24
|
`;let u=c.imageAlt||(!c.image&&a?a.imageAlt:void 0);if(u)s+=`<meta name="twitter:image:alt" content="${l(u)}">
|
|
25
25
|
`}if(c.site)s+=`<meta name="twitter:site" content="${l(c.site)}">
|
|
26
26
|
`;if(c.creator)s+=`<meta name="twitter:creator" content="${l(c.creator)}">
|
|
27
|
-
`}if(e.structuredData!==void 0&&e.structuredData!==null){let o=
|
|
28
|
-
`;else
|
|
27
|
+
`}if(e.structuredData!==void 0&&e.structuredData!==null){let o=b(e.structuredData);if(o)s+=`${_(o)}
|
|
28
|
+
`;else er(r,`structuredData must be an object or an array of objects, got ${ue(e.structuredData)}; it was left out`,n)}return s.trim()}function Es(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let p=r.__stx_runtime_head;if(!!(p?.title||p?.meta?.some((w)=>w.property==="og:title"||w.name==="og:title"||w.name==="twitter:title"||w.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let a=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),g="";if(r.title)g=r.title;else if(r.meta&&r.meta.title)g=r.meta.title;else if(o)g=o;else if(n.seo?.defaultConfig?.title)g=n.seo.defaultConfig.title;else g=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=a?"":`
|
|
29
29
|
<meta name="title" content="${l(g)}">`,h=G(c)?"":`
|
|
30
30
|
<meta name="description" content="${l(m)}">`,T=`
|
|
31
31
|
<!-- stx SEO Tags -->${f}${h}
|
|
@@ -43,22 +43,22 @@ import{t,i}from"./chunk-5xj1df83.js";import{Xe,Ge,Je,ue,we,k,Qn,cn,pe}from"./chu
|
|
|
43
43
|
${T}
|
|
44
44
|
`),y;return y.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${T}
|
|
46
|
-
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function
|
|
46
|
+
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function v(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),p=(n?.[1]??n?.[2]??"").trim();if(p)return v(p)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Yn={name:"meta",rawParams:!0,handler:(e,r,n,p)=>{let s=ln(r,n??{});if(s.kind==="error")return E("Meta",`@meta(${r.join(", ")})`,s.message,p,s.code);if(s.kind==="empty")return"";if(n)n.__stx_runtime_head=pe(n.__stx_runtime_head??{},{meta:[s.tag]});return""},hasEndTag:!1},Zn={name:"structuredData",handler:(e,r,n,p)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let s=JSON.parse(e);if(!s["@context"])s["@context"]="https://schema.org";if(!s["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return _(s)}catch(s){let a=s instanceof Error?s.message:String(s);return i("StructuredData",a,t.EVALUATION_ERROR)}},hasEndTag:!0};function Hu(){return[Yn,Zn]}function Vu(e,r){let{baseUrl:n,defaultChangefreq:p="weekly",defaultPriority:s=0.5,includeLastmod:a=!0}=r,c=n.replace(/\/$/,"");return`<?xml version="1.0" encoding="UTF-8"?>
|
|
47
47
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
48
48
|
${e.map((u)=>{let g=u.loc.startsWith("http")?u.loc:`${c}${u.loc.startsWith("/")?"":"/"}${u.loc}`,m=u.lastmod||(a?new Date().toISOString().split("T")[0]:void 0),d=u.changefreq||p,f=u.priority??s,h=` <url>
|
|
49
|
-
<loc>${
|
|
49
|
+
<loc>${I(g)}</loc>`;if(m)h+=`
|
|
50
50
|
<lastmod>${m}</lastmod>`;return h+=`
|
|
51
51
|
<changefreq>${d}</changefreq>`,h+=`
|
|
52
52
|
<priority>${f.toFixed(1)}</priority>`,h+=`
|
|
53
53
|
</url>`,h}).join(`
|
|
54
54
|
`)}
|
|
55
|
-
</urlset>`}function
|
|
55
|
+
</urlset>`}function Uu(e,r){let n=r.replace(/\/$/,""),p=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
56
56
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
57
57
|
${e.map((a)=>{let c=a.startsWith("http")?a:`${n}${a.startsWith("/")?"":"/"}${a}`;return` <sitemap>
|
|
58
|
-
<loc>${
|
|
58
|
+
<loc>${I(c)}</loc>
|
|
59
59
|
<lastmod>${p}</lastmod>
|
|
60
60
|
</sitemap>`}).join(`
|
|
61
61
|
`)}
|
|
62
|
-
</sitemapindex>`}async function
|
|
63
|
-
`).trim()}function
|
|
64
|
-
export{
|
|
62
|
+
</sitemapindex>`}async function Wu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:p=["_*",".*","node_modules","components","partials","layouts"]}=r,s=[],a=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${a}`);for await(let o of c.scan(e)){if(p.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let g=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!g.startsWith("/"))g=`/${g}`;if(g!=="/"&&g.endsWith("/"))g=g.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}s.push({loc:g||"/",lastmod:d,priority:g==="/"?1:0.5})}return s.sort((o,u)=>o.loc.localeCompare(u.loc)),s}function Qn(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let p of n.allow)r.push(`Allow: ${p}`);if(n.disallow)for(let p of n.disallow)r.push(`Disallow: ${p}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let p of n)r.push(`Sitemap: ${p}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
63
|
+
`).trim()}function qu(e){return Qn({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function I(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
64
|
+
export{ks,Cs,$s,Es,Yn,Zn,Hu,Vu,Uu,Wu,Qn,qu};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{m,Zt,w,Me,o,R}from"./chunk-n38wvr7z.js";import{Wr}from"./chunk-8nrttk4f.js";import{s,be}from"./chunk-y3cqh2jv.js";import{a}from"./chunk-7tt84v1y.js";import g from"path";import v from"fs";function pe(e){if(!e||typeof e!=="object")return!1;let t=e;return typeof t.message==="string"&&(t.name==="BuildMessage"||t.name==="ResolveMessage"||("position"in t))}function fe(e){if(e&&typeof e==="object"&&Array.isArray(e.errors))return e.errors;return[e]}function J(e,t){let r=[];for(let l of fe(e)){if(pe(l)){let u=l.position||void 0;r.push({file:t||u?.file,line:u?.line,column:u?.column,message:l.message??"",lineText:u?.lineText});continue}r.push({file:t,message:l instanceof Error?l.message:String(l)})}return r}function De(e,t){return J(e,t).map((r)=>{let l=r.file?`${r.file}${r.line?`:${r.line}${r.column?`:${r.column}`:""}`:""}`:"",u=r.lineText?`
|
|
3
|
+
${r.lineText.trim()}`:"";return l?`${l}: ${r.message}${u}`:`${r.message}${u}`}).join(`
|
|
4
|
+
`)}var me=10;function P(e,t,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(g.basename(e))||Wr(e,t,r)}var re=1,se=new Map,W=600,ge=100,G=new Map;async function he(e){let t=G.get(e)??0;if(t>0&&t<ge){G.set(e,t+1);return}G.set(e,1);try{let r=(await v.promises.readdir(e)).filter((p)=>p.endsWith(".js"));if(r.length<=W)return;let u=(await Promise.all(r.map(async(p)=>{try{return{name:p,at:(await v.promises.stat(g.join(e,p))).mtimeMs}}catch{return null}}))).filter((p)=>p!==null);u.sort((p,d)=>d.at-p.at);for(let p of u.slice(W)){let d=p.name.slice(0,-3);await v.promises.rm(g.join(e,`${d}.js`),{force:!0}),await v.promises.rm(g.join(e,`${d}.deps.json`),{force:!0})}D("pruned bundle cache to",W,"entries")}catch{}}function ie(e){return se.get(e)??[]}function q(e,t){if(e)se.set(e,t)}function Na(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function D(...e){if(Na())console.log("[stx:bundler]",...e)}var Y=[];function Mo(e,t,r){Y.push({filePath:e||"<inline>",message:t,details:r})}function gt(){return Y.slice()}function mt(){Y.length=0}var H;function hu(e){H=e}function No(){if(H)return H;try{let e=R.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Z=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function ht(e){let t=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=t.exec(e))!==null){let u=r[1];if(!Z.some((d)=>d.test(u)))return D("detected user import:",u),!0}let l=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((r=l.exec(e))!==null){let u=r[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Z.some((d)=>d.test(u)))return D("detected side-effect import:",u),!0}return!1}var Yt="stx-module:",xe=/\.(?:[cm]?[jt]sx?|json)$/i;function La(e,t){return g.relative(e,t).split(g.sep).join("/")}function ja(e,t){if(t.size===0)return e;return e.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(r,l,u,p)=>{let d=t.get(p);return d&&!p.startsWith(Yt)?`${l}${u}${d}${u}`:r})}function Ba(e,t){let r=0,l=(p)=>{let d=`__stxMod${r++}`,y=JSON.stringify(p);return t.push(`var ${d} = globalThis.__stxModules && globalThis.__stxModules[${y}];`,`if (${d} === undefined) throw new Error("[stx] module " + ${JSON.stringify(y)} + " is not registered on this page (#1957)");`),d},u=(p,d)=>{for(let y of p.split(",")){let F=y.trim();if(!F)continue;let c=F.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!c)continue;let n=c[1].startsWith('"')?JSON.parse(c[1]):c[1],i=c[2]??n;t.push(`var ${i} = ${d}[${JSON.stringify(n)}];`)}};return e=e.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d,y)=>{let F=y.slice(Yt.length),c=l(F),n=d.trim(),i=n.match(/^([\w$]+)\s*(?:,\s*|$)/);if(i&&!n.startsWith("{")&&!n.startsWith("*"))t.push(`var ${i[1]} = ${c}.default;`),n=n.slice(i[0].length).trim();let f=n.match(/^\*\s*as\s+([\w$]+)$/);if(f)t.push(`var ${f[1]} = ${c};`);else if(n.startsWith("{"))u(n.replace(/^\{|\}$/g,""),c);return""}),e=e.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,d)=>(l(d.slice(Yt.length)),"")),e}function te(e){let t=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,g.join(e,"index.ts"),g.join(e,"index.tsx"),g.join(e,"index.js"),g.join(e,"index.mjs")];for(let r of t)try{if(v.existsSync(r)&&v.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}function $e(e,t,r,l,u,p=new Map,d){let y=(c,n,i)=>{if(P(n,e,d))return null;if(!u||c!==r||!xe.test(n))return null;try{if(!v.statSync(n,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(n);let f=`${Yt}${La(process.cwd(),n)}`;return p.set(i,f),{path:f,external:!0}},F=(c,n)=>{let i=c===r?t:g.dirname(c),f=g.resolve(i,n);return te(f)??f};return{name:"stx-client-bundle",setup(c){if(c.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(n)=>({path:n.path,external:!0})),c.onResolve({filter:/^\//},(n)=>{let i=te(n.path);if(i){let f=y(n.importer,i,n.path);if(f)return f;if(i!==r)l.add(i);return{path:i}}return{path:n.path,external:!0}}),c.onResolve({filter:/^\.\.?\//},(n)=>{let i=F(n.importer,n.path),f=y(n.importer,i,n.path);if(f)return f;return l.add(i),{path:i}}),c.onResolve({filter:/^[@~]\//},(n)=>{let i=g.resolve(e,n.path.slice(2)),f=[i,`${i}.ts`,`${i}.tsx`,`${i}.js`,`${i}.mjs`,`${i}.jsx`,g.join(i,"index.ts"),g.join(i,"index.tsx"),g.join(i,"index.js"),g.join(i,"index.mjs")];for(let S of f)if(v.existsSync(S)&&v.statSync(S,{throwIfNoEntry:!1})?.isFile()){let k=y(n.importer,S,n.path);if(k)return k;return D(`resolved ${n.path[0]}/ import:`,n.path,"\u2192",S),l.add(S),{path:S}}return console.warn(`[stx:bundler] could not resolve ${n.path[0]}/ import:`,n.path),{path:i}}),u)c.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(n)=>{if(n.importer!==r)return;let i=`${Yt}npm:${n.path}`;return p.set(n.path,i),{path:i,external:!0}});c.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(n)=>{if(P(n.path,e,d))throw Error(`Server-only API source cannot be imported by a client script: ${n.path}`);let i=g.extname(n.path).toLowerCase(),f=i===".json"?"json":i===".tsx"?"tsx":i===".jsx"?"jsx":i===".ts"||i===".mts"||i===".cts"?"ts":"js";if(n.path!==r)l.add(n.path);return{contents:v.readFileSync(n.path,"utf8"),loader:f}})}}}var X=new Map,U=m(64),ne=Symbol.for("stx.client-bundle-build-queue");function Fa(e){let t=globalThis,l=(t[ne]??Promise.resolve()).then(e,e);return t[ne]=l.then(()=>{return},()=>{return}),l}async function yt(e,t,r={}){let l=r.projectRoot||process.cwd(),u=(await o(l)).serverApi,p=r.minify??!1,d=r.externalizeUserModules??!0,y=r.cacheDir||a(l,"bundle-cache"),F=new Bun.CryptoHasher("md5");F.update(`${me}\x00${Me()}\x00${JSON.stringify(u??!1)}\x00${d?"registry":"inline"}\x00${e}\x00${t}`);let c=F.digest("hex").slice(0,12),n=g.join(y,`${c}.js`),i=U.get(n);if(i){if(Zt(i.files)&&i.files.every((_)=>!P(_.path,l,u))){D("memo hit:",c);let _=i.files.map((A)=>A.path);return q(t,_),r.collectInputs?.push(..._),i.code}U.delete(n),D("memo invalidated by dep change:",c)}let f=g.join(y,`${c}.deps.json`),S=Bun.file(n);if(await S.exists()){let _=Bun.file(f),A=!1,E=null;if(await _.exists())try{let N=JSON.parse(await _.text());if(N.metadataVersion!==re||!Array.isArray(N.files))A=!1;else E=N.files,A=!0;if(E&&(!Zt(E)||E.some((T)=>P(T.path,l,u))))A=!1}catch{A=!1}if(A){if(D("cache hit:",c),E)q(t,E.map((T)=>T.path)),r.collectInputs?.push(...E.map((T)=>T.path));let N=await S.text();if(E)U.set(n,{code:N,files:E});return N}D("cache invalidated by dep change:",c)}let k=X.get(c);if(k){let _=await k;if(r.collectInputs)r.collectInputs.push(...(U.get(n)?.files??[]).map((A)=>A.path));return _}let M=Fa(()=>ye(e,t,{projectRoot:l,minify:p,cacheDir:y,hash:c,cachePath:n,depsPath:f,collectInputs:r.collectInputs,externalizeUserModules:d,serverApi:u}));X.set(c,M);try{return await M}finally{X.delete(c)}}var we=0;function za(e){return`${e}-${process.pid}-${++we}`}async function ye(e,t,r){let{projectRoot:l,minify:u,cacheDir:p,hash:d,cachePath:y,depsPath:F,externalizeUserModules:c}=r,n=a(l,"bundle-tmp"),i=za(d),f=g.join(n,`${i}.ts`),S=g.join(n,"out",i);v.mkdirSync(n,{recursive:!0}),v.mkdirSync(S,{recursive:!0});let k=g.dirname(t),M=new Set,_=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,A=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,E=s(e),{depths:N,balanced:T}=be(E),V=(B)=>!T||N[B]===0,x;while((x=_.exec(E))!==null){if(x[1])continue;if(!V(x.index))continue;if(x[2])x[2].split(",").forEach((B)=>{let h=Be(B);if(h)M.add(h)});else if(x[3])M.add(x[3])}while((x=A.exec(E))!==null){if(x[1])continue;if(!V(x.index))continue;M.add(x[2])}let oe=/^[ \t]*import\s+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((x=oe.exec(E))!==null){if(!V(x.index))continue;let B=/^\s*['"]([^'"]+)['"]/.exec(e.slice(x.index+x[0].length))?.[1];if(B&&Z.some((h)=>h.test(B)))continue;if(x[1])M.add(x[1]);if(x[2])M.add(x[2]);for(let h of(x[3]??"").split(",")){let j=h.trim();if(!j||/^type\s/.test(j))continue;let L=/\bas\s+(\w+)\s*$/.exec(j)?.[1]??/^\w+$/.exec(j)?.[0];if(L)M.add(L)}}for(let B of E.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let h of B[1].split(",")){let j=/\bas\s+(\w+)\s*$/.exec(h)?.[1]??/^\s*(\w+)\s*$/.exec(h)?.[1];if(j)M.delete(j)}let le=M.size>0?`
|
|
5
|
+
export { ${[...M].join(", ")} }`:"";await Bun.write(f,e+le),D("bundling:",d,"from:",g.basename(t));let Q=new Set,K=new Map;try{let B=await Bun.build({entrypoints:[f],outdir:S,target:"browser",format:"esm",minify:u,plugins:[$e(l,k,f,Q,c,K,r.serverApi)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...w()},root:l});if(!B.success){let I=B.logs.filter((C)=>C.level==="error").map((C)=>C.message).join(", ")||`Unable to bundle ${g.basename(t)}`,O=J(B.logs,t||void 0);if(console.warn("[stx:bundler] build failed:",I),Mo(t||"",I,O),No()==="error")throw Error(I);return e}let h="";for(let b of B.outputs){h=await b.text();break}let j=[];for(let b of h.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of b[1].split(",")){let O=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(O){j.push([O[2],O[1]]);continue}let C=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(C))j.push([C,C])}let L=[];h=Ba(ja(h,K),L);let ae=h.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];h=h.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let ee=`__stxBundle_${d}`,ce=j.map(([b,I])=>`${JSON.stringify(b)}: ${I}`).join(", "),ue=j.map(([b])=>`var ${b} = undefined;`).join(`
|
|
6
|
+
`),de=j.map(([b])=>`${b} = ${ee}[${JSON.stringify(b)}];`).join(`
|
|
7
|
+
`);if(h=`${ae.join(`
|
|
8
|
+
`)}
|
|
9
|
+
${ue}
|
|
10
|
+
var ${ee} = (function() {
|
|
11
|
+
${L.join(`
|
|
12
|
+
`)}
|
|
13
|
+
${h}
|
|
14
|
+
return { ${ce} };
|
|
15
|
+
})();
|
|
16
|
+
${de}`.trim(),D("bundled:",d,"output:",h.length,"bytes"),M.size>0&&j.length===0)return console.warn(`[stx:bundler] dropped every binding for ${g.basename(t)} (${d}); serving the unbundled source and not caching this result`),e;v.mkdirSync(p,{recursive:!0}),await Bun.write(y,h);let z=Array.from(Q).map((b)=>{try{return{path:b,mtimeMs:v.statSync(b).mtimeMs}}catch{return null}}).filter((b)=>b!==null);return await Bun.write(F,JSON.stringify({metadataVersion:re,files:z})),q(t,z.map((b)=>b.path)),r.collectInputs?.push(...z.map((b)=>b.path)),U.set(y,{code:h,files:z}),await he(p),h}catch(B){let h=J(B,t||void 0),j=De(B,t||void 0);if(console.warn(`[stx:bundler] error: ${j}`),Mo(t||"",j,h),No()==="error")throw B;return e}finally{try{v.rmSync(f,{force:!0}),v.rmSync(S,{recursive:!0,force:!0})}catch{}}}function Be(e){let t=e.trim();if(!t)return null;let r=t.indexOf("=");if(r!==-1)t=t.slice(0,r).trim();let l=t.indexOf(":");if(l!==-1)t=t.slice(l+1).trim();if(t.startsWith("..."))t=t.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(t)?t:null}
|
|
17
|
+
export{De,ie,Na,Mo,gt,mt,hu,No,ht,Yt,La,ja,Ba,Fa,yt,za};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Gc}from"./chunk-33kwpw1a.js";import"./chunk-nww25qj9.js";import"./chunk-2d1n2fsz.js";import"./chunk-8nrttk4f.js";import"./chunk-n38wvr7z.js";import"./chunk-bq2e9qf6.js";import"./chunk-8xz8t9xp.js";import"./chunk-0trfbqa7.js";import"./chunk-br1gra4w.js";import"./chunk-zydg3wgt.js";import"./chunk-4fa3jec9.js";import"./chunk-exgyf65a.js";import"./chunk-r6pax860.js";import"./chunk-h9e032kq.js";import"./chunk-w1zvh5y7.js";import"./chunk-nmf12mx3.js";import"./chunk-jz7pvh7b.js";export{Gc as buildForProduction};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`)}catch{return""}})}function
|
|
4
|
-
`)}catch{return""}})}function
|
|
2
|
+
import{V}from"./chunk-2cy956js.js";function g(e,t){let r={};for(let n of e)r[n]=V(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=V(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function R(e,t){let r={};for(let n of t)r[n]=e[n];return r}function ho(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=V(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function w(i){return async(d)=>{d?.preventDefault?.();for(let v of r)o[v]=!0;if(await l())await i(R(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:w}}var Sa=ho;class Vt{rules=[];defaultValue="";addRule(e){let t=new Vt;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Vt;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Vt;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var ml=new Vt;function ka(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
|
|
3
|
+
`)}catch{return""}})}function Ca(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
|
|
4
|
+
`)}catch{return""}})}function $a(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function hl(e,t,r){let n=e;return n=ka(n,t,r),n=Ca(n,t,r),n=$a(n,t,r),n}export{ho,Sa,Vt,ml,ka,Ca,$a,hl};
|
|
@@ -72,7 +72,7 @@ else {
|
|
|
72
72
|
${t}
|
|
73
73
|
})();
|
|
74
74
|
</script>
|
|
75
|
-
`}function
|
|
75
|
+
`}function wl(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{wl};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{createHash as g}from"crypto";import{readFile as
|
|
3
|
-
export{
|
|
2
|
+
import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function _(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function k(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as B,rm as D,stat as H}from"fs/promises";import{join as w,dirname as E}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function S(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function Ft(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await k(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function zt(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await _(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await S(E(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function Ht(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await D(n,{recursive:!0,force:!0})}catch{}}}
|
|
3
|
+
export{_,k,Ft,zt,Ht};
|
|
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
45
45
|
});
|
|
46
46
|
})();
|
|
47
47
|
</script>
|
|
48
|
-
`}function
|
|
48
|
+
`}function vl(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
|
|
49
49
|
<div id="${a}" class="stx-teleport-source" style="display: none;">
|
|
50
50
|
<template>${c}</template>
|
|
51
51
|
</div>
|
|
52
52
|
${m}
|
|
53
|
-
`})}function
|
|
53
|
+
`})}function xl(){return`
|
|
54
54
|
<script>
|
|
55
55
|
(function() {
|
|
56
56
|
// Common teleport targets
|
|
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
68
68
|
})();
|
|
69
69
|
</script>
|
|
70
70
|
`}
|
|
71
|
-
export{
|
|
71
|
+
export{vl,xl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import g from"path";var y=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function I(...r){let o=new Set;for(let s of r){if(!s||!s.includes("__stxModules["))continue;for(let e of s.matchAll(y))try{o.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...o].sort()}async function M(r,o={}){if(r.length===0)return null;let s=process.cwd(),e=[],l=[];r.forEach((t,h)=>{let x=t.startsWith("npm:")?t.slice(4):g.resolve(s,t),a=`__stxRegistered${h}`,d=JSON.stringify(t);e.push(`import * as ${a} from ${JSON.stringify(x)};`),l.push(`if (!globalThis.__stxModules[${d}]) globalThis.__stxModules[${d}] = ${a};`)});let u=[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...l].join(`
|
|
3
|
-
`),n;try{let{bundleClientScript:t}=await import("./chunk-
|
|
3
|
+
`),n;try{let{bundleClientScript:t}=await import("./chunk-0bdgcm01.js");n=await t(u,g.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:o.minify,externalizeUserModules:!1,collectInputs:o.collectInputs})}catch(t){return console.warn("[stx] could not build the page module registry (#1957):",t),null}let{transformAutoImports:p,generateAutoImportDestructuring:m}=await import("./chunk-hsv23bw6.js"),i=p(n),f=m(i.stxImports,i.browserImports),{transformStoreImports:_}=await import("./chunk-nqvb9094.js");n=_(i.code);let c=JSON.stringify(new Bun.CryptoHasher("md5").update(u).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${c}]) return;`,` __stxBundles[${c}] = true;`,f,n,"})();"].join(`
|
|
4
4
|
`)}export{M as buildModuleRegistryScript,I as registeredModuleIdsIn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nu,sc,ns,rs,qo,Ko,ss,os,Bn,oc,Xo,Go,ic,ze}from"./chunk-n38wvr7z.js";import"./chunk-bq2e9qf6.js";import"./chunk-8xz8t9xp.js";import"./chunk-0trfbqa7.js";import"./chunk-br1gra4w.js";import"./chunk-zydg3wgt.js";import"./chunk-4fa3jec9.js";import"./chunk-exgyf65a.js";import"./chunk-r6pax860.js";import"./chunk-h9e032kq.js";import"./chunk-w1zvh5y7.js";import"./chunk-nmf12mx3.js";import"./chunk-jz7pvh7b.js";export{Nu as clearScriptScanCache,ss as convertServerLoopAttributesToDirectives,qo as convertSignalDirectivesToAttributes,os as convertSignalLoopsToAttributes,oc as extractExports,Go as findMarkupIndexOutsideScripts,rs as hasSignalsSyntax,ns as parseLoopExpression,Ko as preEvalLiteralReactiveIfs,Bn as processScriptSetup,Xo as processSignals,ic as rewriteStxImportSpecifiers,sc as scanScriptTags,ze as stripStxRuntimeImports};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import i from"path";var $t=".stx",o="STX_DIR",e=null;function wi(t){e=t?.trim()||null}function on(){return process.env[o]?.trim()||e||$t}function a(t=process.cwd(),...n){let r=on();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function an(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==$t&&!n.startsWith(`${$t}/`))return t;let r=n.slice($t.length+1);return r?i.join(on(),r):on()}
|
|
3
|
+
export{$t,wi,on,a,an};
|