@stacksjs/stx 0.2.762 → 0.2.765
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-01484snf.js +2 -0
- package/dist/{chunk-b51p56k5.js → chunk-07c8rk93.js} +2 -2
- package/dist/chunk-09cera09.js +2 -0
- package/dist/{chunk-zhrz4zvw.js → chunk-0d29b573.js} +4 -4
- package/dist/chunk-0f5276fm.js +2 -0
- package/dist/{chunk-8yyq3nfg.js → chunk-0nzeqc13.js} +2 -2
- package/dist/chunk-16n128gh.js +2 -0
- package/dist/chunk-171bbyqv.js +2 -0
- package/dist/{chunk-dnsf934e.js → chunk-1day2nbr.js} +5 -5
- package/dist/chunk-1g0g498y.js +2 -0
- package/dist/{chunk-x5seqmrv.js → chunk-1g5fg1ys.js} +2 -2
- package/dist/chunk-1qppvj48.js +2 -0
- package/dist/{chunk-tpfxvw4q.js → chunk-1w4a0xya.js} +14 -14
- package/dist/chunk-1z77g0j6.js +2 -0
- package/dist/chunk-2hbwpm36.js +177 -0
- package/dist/{chunk-rh2qth8r.js → chunk-2mckhfet.js} +5 -5
- package/dist/chunk-31e7xkrt.js +2 -0
- package/dist/chunk-3ffz7pd4.js +2 -0
- package/dist/{chunk-37y8sg48.js → chunk-3mf27gj6.js} +2 -2
- package/dist/{chunk-gwjh981q.js → chunk-49w4cbqb.js} +7 -7
- package/dist/chunk-4bhbtvtm.js +2 -0
- package/dist/{chunk-18chz0q4.js → chunk-4m3666pm.js} +1 -1
- package/dist/{chunk-xtwc2dbk.js → chunk-4tppbw4r.js} +2 -2
- package/dist/{chunk-rmk8efc3.js → chunk-4yk7zngj.js} +109 -109
- package/dist/{chunk-rj3p5fdy.js → chunk-51dxp9w9.js} +3 -3
- package/dist/chunk-59r38w60.js +2 -0
- package/dist/chunk-5ttj2c0h.js +2 -0
- package/dist/chunk-5x312c05.js +2 -0
- package/dist/chunk-65h2h51z.js +2 -0
- package/dist/chunk-6ch8t3d9.js +3 -0
- package/dist/{chunk-tshpcvcy.js → chunk-6h6teyxp.js} +2 -2
- package/dist/{chunk-319aez2f.js → chunk-6jnrpnxb.js} +3 -3
- package/dist/chunk-6rd0zz6k.js +2 -0
- package/dist/{chunk-8y54tpbr.js → chunk-74y29xxs.js} +5 -5
- package/dist/{chunk-t1shvfhm.js → chunk-7aw9qm74.js} +47 -47
- package/dist/chunk-7bvhpdqv.js +2 -0
- package/dist/{chunk-0fs9kx0h.js → chunk-7yx2ztt5.js} +2 -2
- package/dist/{chunk-f8p8ggvw.js → chunk-8hanmv49.js} +4 -4
- package/dist/{chunk-j1tsda22.js → chunk-8prk7e1z.js} +10 -10
- package/dist/{chunk-nm9tnxnw.js → chunk-8zgvr0fw.js} +5 -5
- package/dist/{chunk-pqbxa0r7.js → chunk-a2yptg7r.js} +2 -2
- package/dist/{chunk-qystt1qc.js → chunk-a627f39k.js} +1 -1
- package/dist/{chunk-ds6mbfdq.js → chunk-as4s0nf5.js} +3 -3
- package/dist/chunk-axxd53tn.js +2 -0
- package/dist/{chunk-evxp3wmv.js → chunk-ay02q27h.js} +7 -7
- package/dist/{chunk-2eamszdq.js → chunk-ay5g5cbk.js} +2 -2
- package/dist/chunk-b8ar6431.js +2 -0
- package/dist/{chunk-yb71b2d6.js → chunk-b8hsvzqb.js} +2 -2
- package/dist/chunk-bnm7ym0g.js +2 -0
- package/dist/{chunk-0sd4td6z.js → chunk-bnwkytme.js} +3 -3
- package/dist/chunk-brg2ydrk.js +2 -0
- package/dist/chunk-bwkw2dw3.js +2 -0
- package/dist/chunk-c0fwppzc.js +2 -0
- package/dist/{chunk-8rk79ha1.js → chunk-c1b481my.js} +2 -2
- package/dist/chunk-c5kpc7rn.js +2 -0
- package/dist/{chunk-59k4xb92.js → chunk-c5mbhfff.js} +5 -5
- package/dist/chunk-c8256r1a.js +2 -0
- package/dist/chunk-cap6exxx.js +2 -0
- package/dist/{chunk-mbe4gqd3.js → chunk-ccedry39.js} +2 -2
- package/dist/chunk-cft1sprt.js +2 -0
- package/dist/{chunk-qjbcp3tc.js → chunk-cswar3zs.js} +3 -3
- package/dist/{chunk-t2cq4bpe.js → chunk-dphhs29v.js} +6 -6
- package/dist/chunk-dt0deg4z.js +2 -0
- package/dist/{chunk-jgk5j35w.js → chunk-dvh63p75.js} +4 -4
- package/dist/{chunk-932zx5q4.js → chunk-dxk5r71v.js} +6 -6
- package/dist/{chunk-d96xddt9.js → chunk-e1e5xf8z.js} +13 -13
- package/dist/{chunk-w2pch5xn.js → chunk-e645nk33.js} +2 -2
- package/dist/{chunk-qpb80r4b.js → chunk-efr9dgt6.js} +2 -2
- package/dist/chunk-ejqr5cva.js +2 -0
- package/dist/{chunk-fxmc5006.js → chunk-et831a4y.js} +2 -2
- package/dist/{chunk-5yhv5eqq.js → chunk-ev4zxhpd.js} +2 -2
- package/dist/chunk-evbxyw80.js +2 -0
- package/dist/chunk-f66n66c8.js +2 -0
- package/dist/chunk-f6h8yagj.js +2 -0
- package/dist/{chunk-y8pftjg8.js → chunk-fjbhtakz.js} +1 -1
- package/dist/chunk-fpsm2qed.js +2 -0
- package/dist/{chunk-v1ff2dfp.js → chunk-fta169tc.js} +3 -3
- package/dist/{chunk-a222bwpc.js → chunk-ftt3r7wh.js} +5 -5
- package/dist/{chunk-48g9wez2.js → chunk-fz717vpc.js} +29 -29
- package/dist/chunk-fzf7yfpn.js +2 -0
- package/dist/chunk-gaatje2g.js +2 -0
- package/dist/{chunk-b0z2n941.js → chunk-h8yk9qm7.js} +2 -2
- package/dist/chunk-hfcmbbkq.js +2 -0
- package/dist/{chunk-3mz088mb.js → chunk-jb1c4e49.js} +2 -2
- package/dist/chunk-jhz0dvqz.js +2 -0
- package/dist/chunk-k54pgbzm.js +2 -0
- package/dist/{chunk-r8zhed35.js → chunk-kc3kt59e.js} +2 -2
- package/dist/chunk-kkx2gqk8.js +2 -0
- package/dist/{chunk-rqd6b2nc.js → chunk-knzp4c6m.js} +3 -3
- package/dist/{chunk-m3z13f59.js → chunk-kwy0spcd.js} +3 -3
- package/dist/{chunk-b7x8b83z.js → chunk-m15nbvck.js} +1 -1
- package/dist/{chunk-wby7qzha.js → chunk-m3dr63n0.js} +3 -3
- package/dist/{chunk-eb6p3p62.js → chunk-mdtjjzqc.js} +2 -2
- package/dist/{chunk-epa73jvs.js → chunk-mmcqgwk7.js} +2 -2
- package/dist/{chunk-02c46de1.js → chunk-mpaepc7n.js} +165 -42
- package/dist/{chunk-0kq0k4pg.js → chunk-n5dd6rpt.js} +2 -2
- package/dist/{chunk-jyp2mmts.js → chunk-n8gfetjx.js} +2 -2
- package/dist/chunk-n9zka6dg.js +2 -0
- package/dist/{chunk-bvctccab.js → chunk-nj5azxxj.js} +3 -3
- package/dist/{chunk-42zqmcnc.js → chunk-nr3pepv1.js} +3 -3
- package/dist/{chunk-r1tp2gnr.js → chunk-p42kp93g.js} +1 -1
- package/dist/{chunk-2zd51tj4.js → chunk-pqgk9mxp.js} +2 -2
- package/dist/chunk-pvx57vpw.js +2 -0
- package/dist/{chunk-fhpsf4z7.js → chunk-q22hwm64.js} +5 -5
- package/dist/chunk-qcz104h3.js +2 -0
- package/dist/chunk-qgvez75f.js +2 -0
- package/dist/{chunk-y4mp1rra.js → chunk-qv2k0qb1.js} +94 -94
- package/dist/{chunk-k2ex94n8.js → chunk-qv99gqee.js} +1 -1
- package/dist/chunk-r0j6jkxc.js +2 -0
- package/dist/{chunk-ben8bjnk.js → chunk-rv0yth27.js} +4 -4
- package/dist/chunk-rzh4xgb4.js +2 -0
- package/dist/chunk-rzv9xcyp.js +2 -0
- package/dist/{chunk-4tgn1frg.js → chunk-s2py8kg7.js} +2 -2
- package/dist/chunk-s922mx0k.js +2 -0
- package/dist/{chunk-rd33qkfs.js → chunk-s9m2gfns.js} +7 -7
- package/dist/{chunk-xt034729.js → chunk-scq0h2cs.js} +6 -6
- package/dist/{chunk-ak93e1zz.js → chunk-stww901w.js} +5 -5
- package/dist/chunk-sy4wqxta.js +2 -0
- package/dist/chunk-szdm8wfn.js +2 -0
- package/dist/chunk-t424gvwc.js +2 -0
- package/dist/{chunk-yk456jp4.js → chunk-t6d7m4tf.js} +7 -7
- package/dist/{chunk-mdvtermb.js → chunk-t70s45hc.js} +2 -2
- package/dist/{chunk-dvpk4c1y.js → chunk-t8cgxk8w.js} +2 -2
- package/dist/{chunk-edhxg3rz.js → chunk-tqf8a258.js} +56 -56
- package/dist/{chunk-9k8ztdcc.js → chunk-vkpmemb1.js} +2 -2
- package/dist/chunk-vtvaa8y9.js +2 -0
- package/dist/chunk-vvj09a7b.js +2 -0
- package/dist/{chunk-rxm1mjkb.js → chunk-vvm38ysm.js} +1 -1
- package/dist/chunk-vwjy6491.js +2 -0
- package/dist/{chunk-736ex6r5.js → chunk-vy1weqvj.js} +4 -4
- package/dist/chunk-w2nzevn0.js +2 -0
- package/dist/chunk-wadp2rmj.js +2 -0
- package/dist/{chunk-k9247v28.js → chunk-wb2ej5by.js} +1 -1
- package/dist/chunk-wbkcwj27.js +2 -0
- package/dist/{chunk-2typf9dh.js → chunk-wp4nqnn7.js} +1 -1
- package/dist/chunk-wzp8y0a4.js +2 -0
- package/dist/chunk-xc1he6hs.js +2 -0
- package/dist/{chunk-m6rzsbas.js → chunk-xcstrdhp.js} +4 -4
- package/dist/{chunk-cdcrd33m.js → chunk-ysfeg3cn.js} +2 -2
- package/dist/chunk-ytzzth34.js +2 -0
- package/dist/{chunk-xgnmgjpv.js → chunk-z6sg0dq3.js} +4 -4
- package/dist/{chunk-k9wr8xf5.js → chunk-zfaa5xn5.js} +6 -6
- package/dist/chunk-zhxg6b64.js +2 -0
- package/dist/{chunk-rha8sv1h.js → chunk-zjar9jdd.js} +2 -2
- package/dist/{chunk-89801pjp.js → chunk-zs8yjtaz.js} +5 -5
- package/dist/{chunk-q3azy64b.js → chunk-ztbk9yqv.js} +4 -4
- package/dist/cli.js +19 -19
- package/dist/client/signals-bootstrap-runtime.js +1 -1
- package/dist/client/signals-class-runtime.js +5 -5
- package/dist/client/signals-dom-ready-runtime.js +1 -0
- package/dist/client/signals-expression-runtime.js +118 -0
- package/dist/client/signals-for-runtime.js +7 -7
- package/dist/client/signals-if-chain-runtime.js +3 -3
- package/dist/client/signals-if-runtime.js +7 -7
- package/dist/client/signals-model-runtime.js +1 -1
- package/dist/client/signals-process-element-runtime.js +12 -8
- package/dist/client/signals-show-runtime.js +1 -1
- package/dist/client/signals-style-runtime.js +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-virtual-list.d.ts +24 -0
- package/dist/composables/use-virtual-list.js +76 -0
- package/dist/config.js +3 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/document-shell.d.ts +10 -1
- package/dist/document-shell.js +1 -1
- package/dist/expressions.js +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/native/compiler/render-screen.d.ts +2 -8
- package/dist/native/compiler/render-screen.js +3 -10
- package/dist/native/event-names.js +2 -0
- package/dist/native/primitives-dir.d.ts +13 -0
- package/dist/native/primitives-dir.js +14 -0
- package/dist/native/prop-names.js +1 -0
- package/dist/process.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +8 -8
- package/dist/state-management.d.ts +22 -0
- package/dist/types/config-types.d.ts +2 -0
- package/dist/unresolved-identifiers.js +1 -0
- package/dist/utils.js +20 -2
- package/package.json +5 -5
- package/stx.d.ts +4 -0
- package/dist/chunk-00nz3pas.js +0 -2
- package/dist/chunk-05jdq9tw.js +0 -177
- package/dist/chunk-0cajfv7y.js +0 -2
- package/dist/chunk-13v3vgb6.js +0 -2
- package/dist/chunk-1p8t2ekg.js +0 -2
- package/dist/chunk-1rcntvgx.js +0 -2
- package/dist/chunk-1w5gtkd6.js +0 -2
- package/dist/chunk-28vtqwxh.js +0 -2
- package/dist/chunk-298gj90a.js +0 -2
- package/dist/chunk-2gn6smrq.js +0 -2
- package/dist/chunk-2wq0h5ye.js +0 -2
- package/dist/chunk-3wxb7mfb.js +0 -2
- package/dist/chunk-528cn6qm.js +0 -2
- package/dist/chunk-5x0g7e9y.js +0 -2
- package/dist/chunk-633a53wg.js +0 -2
- package/dist/chunk-6b737vch.js +0 -2
- package/dist/chunk-72ns4q88.js +0 -2
- package/dist/chunk-86cg9qqm.js +0 -2
- package/dist/chunk-8czxtjwm.js +0 -2
- package/dist/chunk-8h5mqs28.js +0 -2
- package/dist/chunk-940wny2b.js +0 -2
- package/dist/chunk-9fh4ah7t.js +0 -2
- package/dist/chunk-a81rt2t4.js +0 -3
- package/dist/chunk-ad9dt9rk.js +0 -2
- package/dist/chunk-ak4w2emd.js +0 -2
- package/dist/chunk-b8dtz3v8.js +0 -2
- package/dist/chunk-cenvzm5q.js +0 -2
- package/dist/chunk-d49pst1m.js +0 -2
- package/dist/chunk-dj0qy19b.js +0 -2
- package/dist/chunk-e2q79dfs.js +0 -2
- package/dist/chunk-ebxncrd8.js +0 -2
- package/dist/chunk-fht1zs1r.js +0 -2
- package/dist/chunk-fjfrgef4.js +0 -2
- package/dist/chunk-fmk9hjht.js +0 -2
- package/dist/chunk-fxnk5ee8.js +0 -2
- package/dist/chunk-j1z7tgdp.js +0 -2
- package/dist/chunk-jq1698j4.js +0 -2
- package/dist/chunk-k0jkpw0q.js +0 -2
- package/dist/chunk-k469ym7a.js +0 -2
- package/dist/chunk-m5740sd3.js +0 -2
- package/dist/chunk-mdw96yhg.js +0 -2
- package/dist/chunk-mebf9vwb.js +0 -2
- package/dist/chunk-p2se8s6r.js +0 -2
- package/dist/chunk-p7zrz0wb.js +0 -2
- package/dist/chunk-pdnyfk2v.js +0 -2
- package/dist/chunk-qfhjtz2q.js +0 -2
- package/dist/chunk-r5tsewzd.js +0 -2
- package/dist/chunk-rnvrtcz6.js +0 -2
- package/dist/chunk-s36cpnxa.js +0 -2
- package/dist/chunk-tfy1m821.js +0 -2
- package/dist/chunk-vc3ppphz.js +0 -2
- package/dist/chunk-vttx66q0.js +0 -2
- package/dist/chunk-vxs07119.js +0 -2
- package/dist/chunk-x1x69g3s.js +0 -2
- package/dist/chunk-x8hz5gzb.js +0 -2
- package/dist/chunk-xfdtym3s.js +0 -2
- package/dist/chunk-y6mqq78g.js +0 -2
- package/dist/chunk-ycttwgpg.js +0 -2
- package/dist/chunk-yd6x9226.js +0 -2
- package/dist/chunk-yn3kff5k.js +0 -2
- package/dist/chunk-ynjm2tm0.js +0 -2
- package/dist/chunk-zpjdp0he.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_}from"./chunk-
|
|
3
|
-
`)}catch{return""}})}function
|
|
4
|
-
`)}catch{return""}})}function
|
|
2
|
+
import{_}from"./chunk-qv2k0qb1.js";import{le}from"./chunk-n8gfetjx.js";function g(e,t){let r={};for(let n of e)r[n]=le(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=le(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 v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function fa(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=le(!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 V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(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:V}}var tu=fa;class Bn{rules=[];defaultValue="";addRule(e){let t=new Bn;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 Bn;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 Bn;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 wm=new Bn;function nu(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,{...t,message:l},r)).join(`
|
|
3
|
+
`)}catch{return""}})}function ru(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,{...t,message:l},r)).join(`
|
|
4
|
+
`)}catch{return""}})}function su(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 vm(e,t,r){let n=e;return n=nu(n,t,r),n=ru(n,t,r),n=su(n,t,r),n}export{fa,tu,Bn,wm,nu,ru,su,vm};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{oo,Yi,zr,io,ao,$n,qt,Zi,Hr,Vr,co,lo,Hg,Vg,dt}from"./chunk-1day2nbr.js";export{dt as DeployError,Yi as calculateSha1,zr as collectDeployFiles,Vr as createDefaultNetlifyConfig,io as createFileManifest,oo as createNetlifyClient,Hg as deploy,Hr as detectProjectConfig,ao as filterRequiredFiles,$n as formatSize,Zi as generateNetlifyToml,qt as getTotalSize,lo as hasNetlifyConfig,Vg as initNetlify,co as writeNetlifyConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{sn,Eo,To,$o,yh,Ro}from"./chunk-c5mbhfff.js";import"./chunk-ztbk9yqv.js";import"./chunk-8hanmv49.js";import"./chunk-1g5fg1ys.js";export{To as buildServerApi,yh as createServerApi,sn as discoverServerApi,Eo as generateApiTypes,Ro as isServerApiSource,$o as productionApiDispatcher};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ai,Pi,Ii,_g,Cg,Eg,bl,Tg,$g}from"./chunk-p42kp93g.js";export{Ai as ImageProcessorCache,bl as applyTransformations,_g as clearImageCache,Tg as generateResponsiveVariants,$g as generateSrcset,Pi as getCachedImageResult,Eg as optimizeImage,Cg as processImage,Ii as setCachedImageResult};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as
|
|
3
|
-
export{Gg,
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as rm}from"ts-broadcasting";import{Broadcast as sm,BroadcastServer as om}from"ts-broadcasting";var e=null,u=[];function Gg(){return e}async function Jg(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Yg(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Zg(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Dl(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Dl(n,t,r){if(!i())return;s.send(n,t,r)}function Qg(n,t,r){if(!i())return;s.toUser(n,t,r)}function em(n,t,r){if(!i())return;s.toUsers(n,t,r)}function tm(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function nm(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{Gg,Jg,Yg,Zg,Dl,Qg,em,tm,nm,rm,sm,om};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var yo=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 ga(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||yo},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 bo=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 ma(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||bo},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 ha(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:ma,createHotReloadServer:ha,NATIVE_COMPONENTS:bo},lh=K;
|
|
8
|
+
export{bo,ma,ha,lh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{m,ui,zc,Hc,eg,tg,ng,rg,sg,Bs,og,je,Y,Be,ig,_r,ag,Wc,gi,Fe,r,yn,qc,h,fe,Hh}from"./chunk-qv2k0qb1.js";import"./chunk-t8cgxk8w.js";import"./chunk-1g5fg1ys.js";import"./chunk-1w4a0xya.js";import"./chunk-4833k99b.js";import"./chunk-07c8rk93.js";export{fe as clearComponentCache,gi as componentClientSignalNames,ui as convertToCommonJS,h as createDetailedErrorMessage,sg as extractDirectiveNames,zc as extractScriptFromTemplate,m as extractVariables,r as fileExists,Hh as getComponentCacheStats,tg as getPositionInfo,Y as getSharedTranspiler,qc as getSourceLineInfo,rg as hasDirectives,Hc as hasVariables,ag as isHydrateTrigger,og as isJavaScriptScript,Fe as renderComponentWithSlot,yn as resolveTemplatePath,ig as scopeOnRootElement,Bs as scopeSequenceKey,je as shouldTranspileTypeScript,Wc as slotContentHasExpressions,Be as transpileTypeScript,_r as userComponentFileExists,ng as validateDirective,eg as validateTemplate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{zt}from"./chunk-
|
|
2
|
+
import{zt}from"./chunk-dvh63p75.js";function Gs(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=zt(e),i=`
|
|
3
3
|
<!-- stx PWA Meta Tags -->
|
|
4
4
|
<link rel="manifest" href="/manifest.json">
|
|
5
5
|
<meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
|
|
@@ -43,9 +43,9 @@ if ('serviceWorker' in navigator) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
</script>
|
|
46
|
-
<!-- End stx PWA -->`,i}function
|
|
46
|
+
<!-- End stx PWA -->`,i}function $i(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=Gs(n);return e.slice(0,o)+i+`
|
|
47
47
|
`+e.slice(o)}return e+Gs(n)}let t=Gs(n);return e.replace("</head>",`${t}
|
|
48
|
-
</head>`)}function
|
|
48
|
+
</head>`)}function hg(e){if(!e.pwa?.enabled)return"";return`<script>
|
|
49
49
|
if ('serviceWorker' in navigator) {
|
|
50
50
|
window.addEventListener('load', function() {
|
|
51
51
|
navigator.serviceWorker.register('/${zt(e)}')
|
|
@@ -57,5 +57,5 @@ if ('serviceWorker' in navigator) {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
</script>`}function
|
|
61
|
-
export{Gs,
|
|
60
|
+
</script>`}function yg(){return'<link rel="manifest" href="/manifest.json">'}function bg(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
61
|
+
export{Gs,$i,hg,yg,bg};
|