@thi.ng/meta-css 0.19.30 → 0.19.34
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/README.md +1 -1
- package/index.js +11 -11
- package/package.json +116 -116
- package/CHANGELOG.md +0 -353
package/README.md
CHANGED
|
@@ -2759,7 +2759,7 @@ The toolchain itself is distributed as CLI bundle with **no runtime
|
|
|
2759
2759
|
dependencies**. The following dependencies are only shown for informational
|
|
2760
2760
|
purposes and are (partially) included in the bundle.
|
|
2761
2761
|
|
|
2762
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 14.
|
|
2762
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 14.29 KB
|
|
2763
2763
|
|
|
2764
2764
|
## Dependencies
|
|
2765
2765
|
|
package/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Go={default:95,command:92,error:91,hint:90,multi:90,param:96,required:33};var Tt=(t)=>t;function W(t,o=Object.create(null)){return(...n)=>{let r=n.join("-");return r in o?o[r]:o[r]=t(...n)}}var nt=W((t,o)=>t.repeat(o));var Jo=(t)=>/^[a-f0-9]+$/i.test(t);var jo=(t)=>/^[-+]?\d+$/.test(t),Xo=(t)=>/^[-+]?\d*\.?\d+(e[-+]?\d+)?$/i.test(t);var Y=(t,o=(n)=>n!==void 0?": "+n:"")=>class extends Error{origMessage;constructor(n){super(t(n)+o(n));this.origMessage=n!==void 0?String(n):""}};var
|
|
3
|
-
`),this.parent?.logEntry(t)}}
|
|
2
|
+
var Go={default:95,command:92,error:91,hint:90,multi:90,param:96,required:33};var Tt=(t)=>t;function W(t,o=Object.create(null)){return(...n)=>{let r=n.join("-");return r in o?o[r]:o[r]=t(...n)}}var nt=W((t,o)=>t.repeat(o));var Jo=(t)=>/^[a-f0-9]+$/i.test(t);var jo=(t)=>/^[-+]?\d+$/.test(t),Xo=(t)=>/^[-+]?\d*\.?\d+(e[-+]?\d+)?$/i.test(t);var Y=(t,o=(n)=>n!==void 0?": "+n:"")=>class extends Error{origMessage;constructor(n){super(t(n)+o(n));this.origMessage=n!==void 0?String(n):""}};var wr=Y(()=>"illegal argument(s)"),_=(t)=>{throw new wr(t)};var Oo=(t)=>Xo(t)?parseFloat(t):_(`not a numeric value: ${t}`),io=(t)=>Jo(t)?parseInt(t,16):_(`not a hex value: ${t}`),No=(t)=>jo(t)?parseInt(t):_(`not an integer: ${t}`);var yr=(t,o)=>t+(o?`[${o}..]`:""),Wt=(t,o,n)=>(r)=>({type:t,coerce:o,hint:n,group:"main",...r}),Yt=(t,o,n,r=",")=>(m)=>({type:t,delim:r,hint:yr(n,m.delim??r),coerce:(f)=>f.map(o),group:"main",multi:!0,...m}),M=(t)=>({type:"flag",group:"flags",default:!1,...t}),D=Wt("string",Tt,"STR"),Dt=Yt("strings",Tt,"STR"),_f=Wt("float",Oo,"NUM"),Cf=Yt("floats",Oo,"NUM"),zt=Wt("int",No,"INT"),uf=Yt("ints",No,"INT"),Af=Wt("hex",io,"HEX"),Lf=Yt("hexes",io,"HEX");var Bf={dryRun:M({desc:"Dry run (no changes applied)"})},Tf={quiet:M({alias:"q",desc:"Disable all logging"})},Zo={verbose:M({alias:"v",desc:"Display extra information"})};var L=Array.isArray;var B=((t)=>{return t[t.FINE=0]="FINE",t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.SEVERE=4]="SEVERE",t[t.NONE=5]="NONE",t})(B||{});var Hr=0;class $t{constructor(t,o=B.FINE,n){this.parent=n,this.id=t||`logger-${Hr++}`,this.level=typeof o==="string"?B[o]:o}id;level;addChild(t){return t.parent=this,t}enabled(t){return this.level<=t}fine(...t){this.log(B.FINE,t)}debug(...t){this.log(B.DEBUG,t)}info(...t){this.log(B.INFO,t)}warn(...t){this.log(B.WARN,t)}severe(...t){this.log(B.SEVERE,t)}none(){}log(t,o){this.level<=t&&this.logEntry([t,this.id,Date.now(),...o])}}var Ko=(t)=>t.map((o)=>{if(typeof o==="function")o=o();if(!(typeof o==="string"||typeof o==="number"))o=JSON.stringify(o);return o});class Pt extends $t{constructor(t,o,n,r){super(o,n,r);this.target=t}childLogger(t,o){return new Pt(this.target,t,o??this.level,this)}logEntry(t){if(t[0]<this.level)return;this.target.write(`[${B[t[0]]}] ${t[1]}: ${Ko(t.slice(3)).join(" ")}
|
|
3
|
+
`),this.parent?.logEntry(t)}}var eo={black:1,blue:5,cyan:7,gray:17,green:3,magenta:6,red:2,white:24,yellow:4,lightBlue:21,lightCyan:23,lightGray:8,lightGreen:19,lightMagenta:22,lightRed:18,lightYellow:20,bgBlack:32,bgBlue:160,bgCyan:224,bgGray:544,bgGreen:96,bgMagenta:192,bgRed:64,bgWhite:768,bgYellow:128,bgLightBlue:672,bgLightCyan:736,bgLightGray:256,bgLightGreen:608,bgLightMagenta:704,bgLightRed:576,bgLightYellow:640};var Rr=(t,o)=>(n)=>t.format(o,n),ho=(t)=>Object.keys(eo).reduce((o,n)=>(o[n]=Rr(t,eo[n]),o),{format:t});var bo="\x1B[0m";var Mr=["","1","2","1;2","4","1;4","2;4","1;2;4"],Jt={format:(t,o)=>Jt.start(t)+o+Jt.end,start:W((t)=>{let o=[],n=t&15;return n&&o.push(29+(t>>4&1)*60+n),n=t>>5&15,n&&o.push(39+(t>>9&1)*60+n),n=t>>10,n&&o.push(Mr[n]),"\x1B["+o.join(";")+"m"}),end:bo,prefix:bo,suffix:`
|
|
4
4
|
`};var Vo={format:(t,o)=>String(o),prefix:"",suffix:`
|
|
5
5
|
`,start:()=>"",end:""};var jt=ho(Jt),qo=ho(Vo);var Ir=(t)=>t.toUpperCase(),po=(t)=>t.toLowerCase(),Xt=(t)=>t.length?t[0].toUpperCase()+t.substring(1):t,rt=(t,o="-")=>po(t.replace(/([a-z0-9\u00e0-\u00fd])([A-Z\u00c0-\u00dd])/g,(n,r,m)=>r+o+m));var Qo=(t,o="-")=>po(t).replace(new RegExp(`\\${o}+(\\w)`,"g"),(n,r)=>Ir(r));var ko=(t=!1,o)=>(n)=>t||typeof n!=="string"&&typeof n!=="number"?JSON.stringify(n,null,o):String(n);var vo=Object.getPrototypeOf,z=(t)=>{let o;return t!=null&&typeof t==="object"&&((o=vo(t))===null||vo(o)===null)};var Ur=/\x1b\[[0-9;]+m/g,Wr=(t)=>t.replace(Ur,"");var Zt=(t)=>Wr(t).length;var lo=W((t,o=" ")=>{let n=nt(String(o),t);return(r,m)=>{if(r==null)return n;return r=r.toString(),m=m!==void 0?m:r.length,m<t?r+n.substring(m):r}});function*mt(t,o=/\r?\n/g,n=!1){let r=0,m=t.length,f=~~n,E;if(typeof o==="string")E=new RegExp(o,"g");else if(!o.flags.includes("g"))E=new RegExp(o,o.flags+"g");else E=o;for(;r<m;){let G=E.exec(t);if(!G){yield t.substring(r);return}let O=G[0].length;yield t.substring(r,G.index+f*O),r=G.index+O}}class _o{n=0;w=[];constructor(t,o){t!=null&&this.add(t,o)}add(t,o=t.length){return this.w.push(t),this.n+=o+~~(this.n>0),this}toString(){return this.w.join(" ")}}var Yr={length:(t)=>t.length,split:(t,o)=>o},xo={length:Zt,split:(t,o)=>{let n=/\x1b\[[0-9;]+m/g,r=o,m;while(m=n.exec(t)){if(m.index>=o)break;let f=m[0].length;r+=f,o+=f}return r}},go=(t,o,n,r)=>{let m=t[t.length-1];m&&r-m.n>n?m.add(o,n):t.push(new _o(o,n))},Dr=(t,{width:o,min:n,hard:r,splitter:m},f=0,E=[])=>{let G=m.length(t),O=o-f;if(O<n&&O<G)O=o;while(r&&G>O){let i=m.split(t,O),N=t.substring(0,i);go(E,N,O,o),t=t.substring(i),O=o,G=m.length(t)}return go(E,t,G,o),E},zr=(t,o,n=[])=>{if(!t.length)return n.push(new _o),n;let r={width:80,min:4,hard:!1,splitter:Yr,...o};for(let m of mt(t,o.delimWord||/\s/g)){let f=n[n.length-1];Dr(m,r,f&&f.n>0?f.n+1:0,n)}return n},ao=(t,o)=>{let n=[];for(let r of mt(t,o.delimLine))n=n.concat(zr(r,o));return n};var U=(t,o)=>o!=null?`\x1B[${o}m${t}\x1B[0m`:t,Kt=(t,o)=>lo(o)(t,Zt(t)),bt=(t,o)=>t?ao(t,{width:o,splitter:xo,hard:!1}):[],Vt=(t,o,n)=>{let r=nt(" ",o);return bt(t,n-o).map((m,f)=>f?r+m:m).join(`
|
|
6
|
-
`)},l=(t)=>z(t)?{...Go,...t}:t!==!1?Go:{};var
|
|
6
|
+
`)},l=(t)=>z(t)?{...Go,...t}:t!==!1?Go:{};var Ft=(t,o={})=>{o={lineWidth:80,paramWidth:32,showDefaults:!0,prefix:"",suffix:"",groups:["flags","main"],...o};let n=l(o.color),r=(E)=>E.map((G)=>Pr(G,t[G],o,n,o.paramWidth)),m=Object.keys(t).sort(),f=o.groups?o.groups.map((E)=>[E,m.filter((G)=>t[G].group===E)]).filter((E)=>!!E[1].length):[["options",m]];return[...bt(o.prefix,o.lineWidth),...f.map(([E,G])=>[...o.showGroupNames?[`${Xt(E)}:
|
|
7
7
|
`]:[],...r(G),""].join(`
|
|
8
8
|
`)),...bt(o.suffix,o.lineWidth)].join(`
|
|
9
9
|
`)},Pr=(t,o,n,r,m)=>{let f=Jr(o,r),E=jr(o,r,f),G=U(`--${rt(t)}`,r.param),O=`${E}${G}${f}`,i=!!o.required&&o.default===void 0,N=[];i&&N.push("required"),o.multi&&N.push("multiple");let e=Xr(N,r,i)+(o.desc||"")+Zr(o,n,r);return Kt(O,n.paramWidth)+Vt(e,m,n.lineWidth)},Jr=(t,o)=>t.hint?U(" "+t.hint,o.hint):"",jr=(t,o,n)=>t.alias?`${U("-"+t.alias,o.param)}${n}, `:"",Xr=(t,o,n)=>t.length?U(`[${t.join(", ")}] `,n?o.required:o.multi):"",Zr=(t,o,n)=>o.showDefaults&&t.default!=null&&t.default!==!1?U(` (default: ${ko(!0)(t.defaultHint!=null?t.defaultHint:t.default)})`,n.default):"";var Kr=Y(()=>"parse error"),so=(t,o,n)=>{n={start:2,showUsage:!0,help:["--help","-h"],...n};try{return br(t,o,n)}catch(r){if(n.showUsage)console.log(U(r.message,l(n.usageOpts?.color).error)+`
|
|
10
10
|
|
|
11
|
-
`+
|
|
11
|
+
`+Ft(t,n.usageOpts));throw new Kr(r.message)}},br=(t,o,n)=>{let r=Vr(t),m={},f,E,G=n.start;for(;G<o.length;){let O=o[G];if(!f){if(n.help.includes(O)){console.log(Ft(t,n.usageOpts));return}let i=qr(t,r,m,O);if(f=i.id,E=i.spec,G=G+~~(i.state<2),i.state)break}else{if(pr(E,m,f,O))break;f=null,G++}}return f&&_(`missing value for: --${rt(f)}`),{result:Qr(t,m),index:G,rest:o.slice(G),done:G>=o.length}},Vr=(t)=>Object.entries(t).reduce((o,[n,r])=>r.alias?(o[r.alias]=n,o):o,{}),qr=(t,o,n,r)=>{if(r[0]!=="-")return{state:2};let m;if(r[1]==="-"){if(r.length===2)return{state:1};m=Qo(r.substring(2))}else m=o[r.substring(1)],!m&&_(`unknown option: ${r}`);let f=t[m];if(!f&&_(m),f.type==="flag"){if(n[m]=!0,m=void 0,f.fn&&!f.fn("true"))return{state:1,spec:f}}return{state:0,id:m,spec:f}},pr=(t,o,n,r)=>{if(t.multi)L(o[n])?o[n].push(r):o[n]=[r];else o[n]=r;return t.fn&&!t.fn(r)},Qr=(t,o)=>{let n;for(let r in t)if(n=t[r],o[r]===void 0){if(n.default!==void 0)o[r]=n.default;else if(n.required)_(`missing arg: --${rt(r)}`)}else if(n.coerce)kr(n,o,r);return o},kr=(t,o,n)=>{try{if(t.multi&&t.delim&&t.split!==!1)o[n]=o[n].reduce((r,m)=>(r.push(...m.split(t.delim)),r),[]);o[n]=t.coerce(o[n])}catch(r){throw Error(`arg --${rt(n)}: ${r.message}`)}};var nn=async(t)=>{let o=t.argv||process.argv,n=!process.env.NO_COLOR,r=l(n),m={prefix:"",color:n,...t.usage};try{let f,E,G=t.start??2;if(t.single){if(f=Object.keys(t.commands)[0],!f)_("no command provided");E=t.commands[f]}else{if(f=o[G],E=t.commands[f],!E)m.prefix+=tn(t.commands,m),co(t,m);else m.prefix+=tn({[f]:E},m,`
|
|
12
12
|
Current command:
|
|
13
|
-
`);G++}let O;try{O=so({...t.opts,...E.opts},o,{usageOpts:m,start:G})}catch(N){process.exit(1)}if(!O)process.exit(0);if(E.inputs!==void 0){let N=O.rest.length,e;if(L(E.inputs)){let[h,C]=E.inputs;if(N<h||N>C)e=C<1/0?`expected ${h}-${C} inputs`:`expected at least ${h} input(s)`}else if(N!==E.inputs)e=`expected ${E.inputs} input(s)`;if(e)on(e,r),co(t,m)}let i=await t.ctx({logger:new
|
|
13
|
+
`);G++}let O;try{O=so({...t.opts,...E.opts},o,{usageOpts:m,start:G})}catch(N){process.exit(1)}if(!O)process.exit(0);if(E.inputs!==void 0){let N=O.rest.length,e;if(L(E.inputs)){let[h,C]=E.inputs;if(N<h||N>C)e=C<1/0?`expected ${h}-${C} inputs`:`expected at least ${h} input(s)`}else if(N!==E.inputs)e=`expected ${E.inputs} input(s)`;if(e)on(e,r),co(t,m)}let i=await t.ctx({logger:new Pt(process.stderr,t.name,"INFO"),format:n?jt:qo,opts:O.result,inputs:O.rest},E);if(await E.fn(i),t.post)await t.post(i,E)}catch(f){on(f.message,r),process.exit(1)}},co=(t,o)=>{process.stderr.write(Ft(t.opts,o)),process.exit(1)},tn=(t,{color:o,lineWidth:n=80}={},r=`
|
|
14
14
|
Available commands:
|
|
15
15
|
`)=>{let m=Object.keys(t),f=Math.max(...m.map((G)=>G.length)),E=l(o);return[r,...m.map((G)=>`${Kt(U(G,E.command),f)} : ${Vt(t[G].desc,f+3,n)}`),`
|
|
16
16
|
`].join(`
|
|
@@ -22,16 +22,16 @@ Available commands:
|
|
|
22
22
|
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${t} v${o}
|
|
23
23
|
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${n}
|
|
24
24
|
\u2588 \u2502
|
|
25
|
-
\u2588 \u2588 \u2502`;var T=(t)=>typeof t==="string";var vr=[[process.env.HOME?new RegExp(process.env.HOME,"g"):/~/,"~"]];var qt=(t)=>{for(let[o,n]of vr)t=t.replace(o,n);return t};import{existsSync as dr,mkdirSync as lr,statSync as IE}from"fs";import{dirname as gr}from"path";var xr=(t)=>t.length>0&&!dr(t)?(lr(t,{recursive:!0}),!0):!1,fn=(t)=>xr(gr(t));var X=(t)=>typeof t==="function";import{readFileSync as cr}from"fs";import{writeFileSync as ar}from"fs";var En=(t,o,n,r,m=!1)=>sr(ar,t,o,n,r,m);var sr=(t,o,n,r,m,f=!1)=>{if(m?.info(`${f?"[dryrun] ":""}writing file: ${qt(o)}`),f)return;return fn(o),t(o,n,!r&&T(n)?"utf-8":r)};var
|
|
26
|
-
`):o,"utf-8",n,r);var Z=(t,o)=>JSON.parse(
|
|
25
|
+
\u2588 \u2588 \u2502`;var T=(t)=>typeof t==="string";var vr=[[process.env.HOME?new RegExp(process.env.HOME,"g"):/~/,"~"]];var qt=(t)=>{for(let[o,n]of vr)t=t.replace(o,n);return t};import{existsSync as dr,mkdirSync as lr,statSync as IE}from"fs";import{dirname as gr}from"path";var xr=(t)=>t.length>0&&!dr(t)?(lr(t,{recursive:!0}),!0):!1,fn=(t)=>xr(gr(t));var X=(t)=>typeof t==="function";import{readFileSync as cr}from"fs";import{writeFileSync as ar}from"fs";var En=(t,o,n,r,m=!1)=>sr(ar,t,o,n,r,m);var sr=(t,o,n,r,m,f=!1)=>{if(m?.info(`${f?"[dryrun] ":""}writing file: ${qt(o)}`),f)return;return fn(o),t(o,n,!r&&T(n)?"utf-8":r)};var S=(t,o,n="utf-8")=>{return o?.debug("reading file:",qt(t)),cr(t,n)};var Co=(t,o,n,r=!1)=>En(t,L(o)?o.join(`
|
|
26
|
+
`):o,"utf-8",n,r);var Z=(t,o)=>JSON.parse(S(t,o));var b=Symbol(),uo=()=>{};var St=Object.freeze({level:B.NONE,addChild(t){return t},childLogger:()=>St,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){},none(){},logEntry(){}});import{join as Qm}from"path";var Ao=(t,o)=>{if(t===o)return 0;if(t==null)return o==null?0:-1;if(o==null)return t==null?0:1;if(typeof t.compare==="function")return t.compare(o);if(typeof o.compare==="function")return-o.compare(t);return t<o?-1:t>o?1:0};var tm=Y(()=>"Assertion failed"),pt=(typeof process<"u"&&process.env!==void 0?!0:import.meta.env?import.meta.env.MODE!=="production"||!!import.meta.env.UMBRELLA_ASSERTS||!!import.meta.env.VITE_UMBRELLA_ASSERTS:!0)?(t,o)=>{if(typeof t==="function"&&!t()||!t)throw new tm(typeof o==="function"?o():o)}:()=>{};var Qt=(t)=>t!=null&&typeof t!=="function"&&t.length!==void 0;var Gn=(t)=>{return(t==null||!t[Symbol.iterator])&&_(`value is not iterable: ${t}`),t};var On=(t)=>Qt(t)?t:[...Gn(t)];var wt=(t)=>t[t.length-1];var kt=(t,o)=>typeof t?.[o]==="function";var $=(t)=>typeof t?.[Symbol.iterator]==="function";var vt=(t)=>t!=null&&typeof t!=="string"&&typeof t[Symbol.iterator]==="function";var om=Y(()=>"illegal arity"),ft=(t)=>{throw new om(t)};var nm=Y(()=>"illegal state"),Et=(t)=>{throw new nm(t)};var Nn=["-moz-","-ms-","-o-","-webkit-"],Gt={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},dt={rules:`
|
|
27
27
|
`,ruleSep:", ",valSep:" ",decls:`
|
|
28
28
|
`,declStart:` {
|
|
29
29
|
`,declEnd:`}
|
|
30
|
-
`,indent:" ",comments:!0};function Lo(...t){let[o,n,r,m,f,E,G,O,i,N]=t;switch(t.length){case 0:ft(0);case 1:return o;case 2:return(...h)=>o(n(...h));case 3:return(...h)=>o(n(r(...h)));case 4:return(...h)=>o(n(r(m(...h))));case 5:return(...h)=>o(n(r(m(f(...h)))));case 6:return(...h)=>o(n(r(m(f(E(...h))))));case 7:return(...h)=>o(n(r(m(f(E(G(...h)))))));case 8:return(...h)=>o(n(r(m(f(E(G(O(...h))))))));case 9:return(...h)=>o(n(r(m(f(E(G(O(i(...h)))))))));case 10:default:let e=(...h)=>o(n(r(m(f(E(G(O(i(N(...h))))))))));return t.length===10?e:Lo(e,...t.slice(10))}}var g=(t)=>kt(t,"xform")?t.xform():t;function P(...t){return t=t.map(g),Lo.apply(null,t)}var V=(t,o)=>[t[0],t[1],o];class
|
|
30
|
+
`,indent:" ",comments:!0};function Lo(...t){let[o,n,r,m,f,E,G,O,i,N]=t;switch(t.length){case 0:ft(0);case 1:return o;case 2:return(...h)=>o(n(...h));case 3:return(...h)=>o(n(r(...h)));case 4:return(...h)=>o(n(r(m(...h))));case 5:return(...h)=>o(n(r(m(f(...h)))));case 6:return(...h)=>o(n(r(m(f(E(...h))))));case 7:return(...h)=>o(n(r(m(f(E(G(...h)))))));case 8:return(...h)=>o(n(r(m(f(E(G(O(...h))))))));case 9:return(...h)=>o(n(r(m(f(E(G(O(i(...h)))))))));case 10:default:let e=(...h)=>o(n(r(m(f(E(G(O(i(N(...h))))))))));return t.length===10?e:Lo(e,...t.slice(10))}}var g=(t)=>kt(t,"xform")?t.xform():t;function P(...t){return t=t.map(g),Lo.apply(null,t)}var V=(t,o)=>[t[0],t[1],o];class yt{value;constructor(t){this.value=t}deref(){return this.value}}var w=(t)=>t instanceof yt,en=(t)=>t instanceof yt?t:new yt(t),J=(t)=>t instanceof yt?t.deref():t;var rm=(t)=>t.length===2?[void 0,t[1]]:t.length===3?[t[1],t[2]]:ft(t.length);function Ot(...t){let o=t[0],n=o[0],r=o[1],m=o[2];t=rm(t);let f=t[0]==null?n():t[0],E=t[1];return J(r(kt(E,"$reduce")?E.$reduce(m,f):Qt(E)?mm(m,f,E):fm(m,f,E)))}var mm=(t,o,n)=>{for(let r=0,m=n.length;r<m;r++)if(o=t(o,n[r]),w(o)){o=o.deref();break}return o},fm=(t,o,n)=>{for(let r of n)if(o=t(o,r),w(o)){o=o.deref();break}return o},it=(t,o)=>[t,Tt,o],hn=(t,o)=>{let n=o.length-1;return $(o[n])?o.length>1?Ot(t.apply(null,o.slice(0,n)),o[n]):Ot(t(),o[0]):void 0};function Nt(t){return t?[...t]:it(()=>[],(o,n)=>(o.push(n),o))}function*et(t,o){let n=g(t)(Nt()),r=n[1],m=n[2];for(let f of o){let E=m([],f);if(w(E)){yield*J(r(E.deref()));return}if(E.length)yield*E}yield*J(r([]))}function*x(t,o){let n=g(t)([uo,uo,(r,m)=>m])[2];for(let r of o){let m=n(b,r);if(w(m)){if(m=J(m.deref()),m!==b)yield m;return}if(m!==b)yield m}}var lt=(t,o,n=x)=>{let r=o.length-1;return $(o[r])?o.length>1?n(t.apply(null,o.slice(0,r)),o[r]):n(t(),o[0]):void 0};function Bo(t,o){return $(o)?et(Bo(t),T(o)?[o]:o):(n)=>{let r=n[2],m=(f,E)=>{let G=t(E);if(G){for(let O of G)if(f=m(f,O),w(f))break;return f}return r(f,E)};return V(n,m)}}function _n(t){return Bo((o)=>vt(o)?o:void 0,t)}function A(t,o){return $(o)?x(A(t),o):(n)=>{let r=n[2];return V(n,(m,f)=>r(m,t(f)))}}function*gt(...t){let o=t.length-1;if(o<0)return;let n=Array(o+1).fill(0),r=t.map(On),m=r.reduce((f,E)=>f*E.length,1);for(let f=0;f<m;f++){let E=[];for(let G=o;G>=0;G--){let O=r[G],i=n[G];if(i===O.length)n[G]=i=0,G>0&&n[G-1]++;E[G]=O[i]}n[o]++,yield E}}function*Cn(t,o=1/0){while(o-- >0)yield t}function To(t,o){t=t||"";let n=!0;return o?[...o].join(t):it(()=>"",(r,m)=>(r=n?r+m:r+t+m,n=!1,r))}function xt(...t){return Em(xt,Ot,t)}var Em=(t,o,n)=>{let r,m;switch(n.length){case 4:m=n[3],r=n[2];break;case 3:m=n[2];break;case 2:return A((f)=>t(n[0],n[1],f));default:ft(n.length)}return o(g(n[0])(n[1]),r,m)};var Gm=new Set,Om=":[",un=P(_n(),A((t)=>t[0]==="&"?t.substring(1):Om.includes(t[0])?t:" "+t)),im=(t,o)=>P(t,A((n)=>T(n)&&n.startsWith(" .")?n+o:n)),ht=(t,o,n,r)=>{let m=n.length,f=[],E,G,O=(i,N)=>{let e=null;if(L(N))ht(t,$o(o,f),N,r);else if($(N)&&!T(N))ht(t,$o(o,f),[...N],r);else if((G=X(N))||(e=r.fns[N]))if(!o.length){if(e)return e.apply(null,n.slice(i+1))(t,r),!0;N(t,r)}else if(G)O(i,N());else _(`quoted fn ('${N}') only allowed at head position`);else if(z(N))E=Object.assign(E||{},N);else if(N!=null)f.push(N)};for(let i=0;i<m;i++)if(O(i,n[i]))return t;return E&&t.push(Nm(o,f,E,r)),t},$o=(t,o)=>t.length?[...gt(t,o)]:o,Nm=(t,o,n,r)=>{let m=r.format,f=j(r),E=r.scope?im(un,r.scope):un;return[f,xt(A((G)=>xt(E,To(),L(G)?G:[G]).trim()),To(m.ruleSep),$o(t,o)),m.declStart,Ht(n,r),f,m.declEnd].join("")},Ht=(t,o)=>{let n=o.format,r=o.autoprefix||Gm,m=j(o,o.depth+1),f=[];for(let E in t)if(t.hasOwnProperty(E)){let G=t[E];if(X(G))G=G(t);if(L(G))G=G.map((O)=>L(O)?O.join(" "):O).join(n.ruleSep);if(r.has(E))for(let O of o.vendors)f.push(`${m}${O}${E}:${n.valSep}${G};`);f.push(`${m}${E}:${n.valSep}${G};`)}return f.join(n.decls)+n.decls},j=(t,o=t.depth)=>o>1?[...Cn(t.format.indent,o)].join(""):o>0?t.format.indent:"";function An(t,...o){let n=o.length===1?o[0]:o.reduce((r,m,f)=>{return r[f/(o.length-1)*100|0]=m,r},{});return(r,m)=>{let f=j(m);m.depth++;let E=j(m);r.push(`${f}@keyframes ${t}${m.format.declStart}`);for(let G in n)if(n.hasOwnProperty(G))r.push([E,G+"%",m.format.declStart,Ht(n[G],m),E,m.format.declEnd].join(""));return m.depth--,r.push(f+m.format.declEnd),r}}var Ln=(t,o=!1)=>(n,r)=>{let m=j(r),f=j(r,r.depth+1);if(r.format.comments||o)n.push(m+"/*",t.split(`
|
|
31
31
|
`).map((E)=>f+E).join(`
|
|
32
|
-
`),m+"*/");return n};var at=(t,o,n)=>(r,m)=>{let f=j(m);return r.push(`${f}${t} ${em(o)}${m.format.declStart}`),m.depth++,ht(r,[],n,m),m.depth--,r.push(f+m.format.declEnd),r},em=(t)=>{if(T(t))return t;let o=[];for(let n in t)if(t.hasOwnProperty(n)){let r=t[n];if(r===!0)r=Bn.has(n)?n:`(${n})`;else if(r===!1)r=`(not ${Bn.has(n)?n:`(${n})`})`;else if(r==="only")r+=" "+n;else r=`(${n}:${r})`;o.push(r)}return o.join(" and ")},Bn=new Set(["all","print","screen"]);var a=(t,o)=>{return o={format:Gt,vendors:Nn,fns:{},depth:0,...o},L(o.autoprefix)&&(o.autoprefix=new Set(o.autoprefix)),z(t)?Rt(t,o):X(t)?t([],o).join(o.format.rules):ht([],[],L(t)?t:vt(t)?[...t]:_("invalid rules"),o).join(o.format.rules)};var Tn=(t,...o)=>(n,r)=>(n.push(o.length?`@import url(${t}) ${o.join(r.format.ruleSep)};`:`@import url(${t});`),n);var _t=(t,o)=>at("@media",t,o);function $n(...t){return(o,n)=>(o.push(t.length>1?`@namespace ${t[0]} url(${t[1]});`:`@namespace url(${t[0]});`),o)}var Fn=(t,o)=>at("@supports",t,o);var st={"@comment":Ln,"@import":Tn,"@keyframes":An,"@media":_t,"@namespace":$n,"@supports":Fn};var wn=4,Sn=(t)=>wn=t,R=(t)=>t===(t|0)?String(t):t.toFixed(wn).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,"");var yn=(t)=>`${R(t)}em`,Hn=(t)=>`${R(t)}ex`;var Rn=(t)=>`${R(t)}rem`,Fo=(t)=>`${R(t)}%`,Mn=(t)=>`${R(t)}px`,In=(t)=>`${R(t)}vh`,Un=(t)=>`${R(t)}vw`,Wn=(t)=>`${R(t)}vmin`,Yn=(t)=>`${R(t)}vmax`,Dn=(t)=>`${t|0}ms`,zn=(t)=>`${R(t)}s`;var Pn=(t)=>`${R(t)}deg`,Jn=(t)=>`${R(t)}rad`,jn=(t)=>`${R(t)}turn`,Xn=(t)=>`url(${t})`;var F=((t)=>{return t[t.IDLE=0]="IDLE",t[t.ACTIVE=1]="ACTIVE",t[t.DONE=2]="DONE",t[t.UNSUBSCRIBED=3]="UNSUBSCRIBED",t[t.ERROR=4]="ERROR",t})(F||{});var hm=0,_m=()=>hm++,s=(t,o)=>!o||!o.id?{...o,id:t+"-"+_m()}:o;class wo extends $t{set(t){this.parent=t}childLogger(t,o){return new wo(t,o??this.level,this)}logEntry(t){this.parent.logEntry(t)}}var Zn=new wo("root",B.FINE,St);var y=Zn.childLogger("rstream");class q{constructor(t,o){this.wrapped=t,o=s("sub",{closeIn:"last",closeOut:"last",cache:!0,...o}),this.parent=o.parent,this.id=o.id,this.closeIn=o.closeIn,this.closeOut=o.closeOut,this.cacheLast=o.cache,o.xform&&(this.xform=o.xform(Nt()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=b;state=F.IDLE;subs=[];deref(){return this.last!==b?this.last:void 0}getState(){return this.state}setState(t){this.state=t}subscribe(t,o={}){this.ensureState();let n;if(t instanceof q&&!o.xform)t.ensureState(),pt(!t.parent,`sub '${t.id}' already has a parent`),t.parent=this,n=t;else n=new q(t,{...o,parent:this});return this.subs.push(n),this.setState(F.ACTIVE),n.setState(F.ACTIVE),this.last!=b&&n.next(this.last),n}transform(...t){let o,n;if(z(yt(t)))n=t.pop(),o={error:n.error};return this.subscribe(o,s("xform",t.length>0?{...n,xform:P(...t)}:n))}map(t,o){return this.transform(A(t),o||{})}unsubscribe(t){return t?this.unsubscribeChild(t):this.unsubscribeSelf()}unsubscribeSelf(){return y.debug(this.id,"unsub self"),this.parent?.unsubscribe(this),this.state<F.UNSUBSCRIBED&&(this.state=F.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(t){y.debug(this.id,"unsub child",t.id);let o=this.subs.indexOf(t);if(o>=0){if(this.subs.splice(o,1),this.closeOut==="first"||!this.subs.length&&this.closeOut!=="never")this.unsubscribe();return!0}return!1}next(t){if(this.state>=F.DONE)return;this.xform?this.dispatchXform(t):this.dispatch(t)}done(){if(y.debug(this.id,"entering done()"),this.state>=F.DONE)return;if(this.xform){if(!this.dispatchXformDone())return}if(this.state=F.DONE,this.dispatchTo("done"))this.state<F.UNSUBSCRIBED&&this.unsubscribe();y.debug(this.id,"exiting done()")}error(t){let n=this.wrapped?.error;return n&&y.debug(this.id,"attempting wrapped error handler"),n?.(t)||this.unhandledError(t)}unhandledError(t){return(y.parent!==St?y:console).warn(this.id,"unhandled error:",t),this.unsubscribe(),this.state=F.ERROR,!1}dispatchTo(t,o){let n=this.wrapped;if(n)try{n[t]&&n[t](o)}catch(m){if(!this.error(m))return!1}let r=t==="next"?this.subs:[...this.subs];for(let m=r.length;m-- >0;){n=r[m];try{n[t]&&n[t](o)}catch(f){if(t==="error"||!n.error||!n.error(f))return this.unhandledError(f)}}return!0}dispatch(t){y.debug(this.id,"dispatch",t),this.cacheLast&&(this.last=t),this.dispatchTo("next",t)}dispatchXform(t){let o;try{o=this.xform[2]([],t)}catch(n){this.error(n);return}if(this.dispatchXformVals(o))S(o)&&this.done()}dispatchXformDone(){let t;try{t=this.xform[1]([])}catch(o){return this.error(o)}return this.dispatchXformVals(t)}dispatchXformVals(t){let o=J(t);for(let n=0,r=o.length;n<r&&this.state<F.DONE;n++)this.dispatch(o[n]);return this.state<F.ERROR}ensureState(){if(this.state>=F.DONE)Et(`operation not allowed in state ${F[this.state]}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var Kn=(t,o)=>{let n=new bn(o);return n.next(t),n};class bn extends q{src;_cancel;_inited;constructor(t,o){let[n,r]=X(t)?[t,o||{}]:[void 0,t||{}];super(r.error?{error:r.error}:void 0,s("stream",r));this.src=n,this._inited=!1}subscribe(t,o={}){let n=super.subscribe(t,o);if(!this._inited){if(this.src)try{this._cancel=this.src(this)||(()=>{return})}catch(r){let m=this.wrapped;if(!m||!m.error||!m.error(r))this.unhandledError(r)}this._inited=!0}return n}unsubscribe(t){let o=super.unsubscribe(t);if(o&&(!t||(!this.subs||!this.subs.length)&&this.closeOut!=="never"))this.cancel();return o}done(){this.cancel(),super.done(),delete this.src,delete this._cancel}error(t){if(super.error(t))return!0;return this.cancel(),!1}cancel(){if(this._cancel){y.debug(this.id,"cancel");let t=this._cancel;delete this._cancel,t()}}}var Vn=(t,o)=>t==="first"||t==="last"&&!o;function So(t){return t?Ot(So(),t):it(()=>({}),(o,[n,r])=>(o[n]=r,o))}var qn=()=>(t)=>{let o=t[2];return V(t,(n,r)=>{if(r){for(let m of J(r)||[])if(n=o(n,m),S(n))break}return S(r)?en(n):n})};function yo(t,o){return $(o)?et(yo(t),o):P(A(t),qn())}function Ho(t,o){return $(o)?x(Ho(t),o):A(X(t)?(n)=>[t(n),n]:(n)=>[t,n])}function Ro(...t){let o=lt(Ro,t);if(o)return o;let n=t[0],r=t[1]!==!1;return A((m)=>{let f=r?{}:m;for(let E in m)f[E]=n(m[E]);return f})}var pn=(t)=>t;function Mo(...t){let o=lt(Mo,t,et);if(o)return o;let{key:n=pn,mergeOnly:r=!1,reset:m=!0,all:f=!0,backPressure:E=0}=t[1],G=L(t[0])?new Set(t[0]):t[0],O=new Set,i=new Map,N={},e=([h,C,I])=>{let v=!0;if(r||E<1)return[h,(u)=>{if(m&&f&&O.size>0||!m&&v)u=I(u,N),N={},O.clear(),v=!1;return C(u)},(u,d)=>{let H=n(d);if(G.has(H)){if(N[H]=d,O.add(H),r||Qn(G,O))if(u=I(u,N),v=!1,m)N={},O.clear();else N={...N}}return u}];else return[h,(u)=>{if(f&&O.size>0)u=I(u,kn(i,O)),i.clear(),O.clear();return C(u)},(u,d)=>{let H=n(d);if(G.has(H)){let K=i.get(H);!K&&i.set(H,K=[]),K.length>=E&&Et(`max back pressure (${E}) exceeded for input: ${String(H)}`),K.push(d),O.add(H);while(Qn(G,O))if(u=I(u,kn(i,O)),v=!1,S(u))break}return u}]};return e.keys=()=>G,e.clear=()=>{i.clear(),G.clear(),O.clear(),N={}},e.add=(h)=>{G.add(h)},e.delete=(h,C=!0)=>{if(i.delete(h),G.delete(h),C)O.delete(h),delete N[h]},e}var Qn=(t,o)=>{if(o.size<t.size)return!1;for(let n of t)if(!o.has(n))return!1;return!0},kn=(t,o)=>{let n={};for(let r of o){let m=t.get(r);n[r]=m.shift(),!m.length&&o.delete(r)}return n};var vn=(t,o)=>{let n=!0;for(let r of o)n=t.removeID(r)&&n;return n};var ct=(t)=>new dn(t);class dn extends q{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(t){let o=Mo(new Set,{key:(r)=>r[0],mergeOnly:t.mergeOnly===!0,reset:t.reset===!0,all:t.all!==!1,backPressure:t.backPressure||0}),n=Ro((r)=>r[1]);super(void 0,s("streamsync",{...t,xform:t.xform?P(o,n,t.xform):P(o,n)}));this.sources=new Map,this.realSourceIDs=new Map,this.invRealSourceIDs=new Map,this.idSources=new Map,this.psync=o,this.clean=!!t.clean,t.src&&this.addAll(t.src)}add(t,o){o||(o=t.id),this.ensureState(),this.psync.add(o),this.realSourceIDs.set(o,t.id),this.invRealSourceIDs.set(t.id,o),this.idSources.set(t.id,t),this.sources.set(t,t.subscribe({next:(n)=>n[1]instanceof q?this.add(n[1]):this.next(n),done:()=>this.markDone(t),__owner:this},{xform:Ho(o),id:`in-${o}`}))}addAll(t){for(let o in t)this.psync.add(o);for(let o in t)this.add(t[o],o)}remove(t){let o=this.sources.get(t);if(o){let n=this.invRealSourceIDs.get(t.id);return y.info(`removing src: ${t.id} (${n})`),this.psync.delete(n,this.clean),this.realSourceIDs.delete(n),this.invRealSourceIDs.delete(t.id),this.idSources.delete(t.id),this.sources.delete(t),o.unsubscribe(),!0}return!1}removeID(t){let o=this.getSourceForID(t);return o?this.remove(o):!1}removeAll(t){for(let n of t)this.psync.delete(this.invRealSourceIDs.get(n.id));let o=!0;for(let n of t)o=this.remove(n)&&o;return o}removeAllIDs(t){return vn(this,t)}getSourceForID(t){return this.idSources.get(this.realSourceIDs.get(t))}getSources(){let t={};for(let[o,n]of this.idSources)t[this.invRealSourceIDs.get(o)]=n;return t}unsubscribe(t){if(!t){y.debug(this.id,"unsub sources");for(let o of this.sources.values())o.unsubscribe();this.sources.clear(),this.psync.clear(),this.realSourceIDs.clear(),this.invRealSourceIDs.clear(),this.idSources.clear()}return super.unsubscribe(t)}markDone(t){this.remove(t),Vn(this.closeIn,this.sources.size)&&this.done()}}var Io=W((t,o=" ")=>{let n=nt(String(o),t);return(r,m)=>{if(r==null)return n;return r=r.toString(),m=m!==void 0?m:r.length,m<t?n.substring(m)+r:r}}),NO=Io(2,"0"),eO=Io(3,"0"),ln=Io(4,"0");var Cm=/\{(\d+)\}/g;var Uo=(t,...o)=>o.length>0?t.replace(Cm,(n,r)=>String(o[parseInt(r,10)])):t;var gn=(t)=>({key:(o)=>o,group:Nt(),...t});function Wo(...t){let o=hn(Wo,t);if(o)return o;let n=gn(t[0]),[r,m,f]=n.group;return[()=>({}),(E)=>{for(let G in E)E[G]=m(E[G]);return E},(E,G)=>{let O=n.key(G);return E[O]=E[O]?f(E[O],G):f(r(),G),E}]}function Yo(t,o){return $(o)?x(Yo(t),o):(n)=>{let r=n[2];return V(n,(m,f)=>t(f)?r(m,f):m)}}import{watch as tr}from"fs";import{resolve as c}from"path";var xn={specs:D({alias:"s",required:!0,desc:"Path to generated JSON defs"})},to={bundle:M({alias:"b",desc:"Bundle inputs (see `out` option)"})},Ct={include:zt({alias:"I",desc:"Include CSS files (prepend)"})},oo={eval:D({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"})},no={force:zt({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},an={media:zt({alias:"m",hint:"ID",desc:"Media query IDs (use 'ALL' for all)",delim:","})},sn={onlyDecls:M({desc:"Only emit framework decls"})},p={out:D({alias:"o",desc:"Output file (or stdout)"})},ro={prec:Pt({default:3,desc:"Number of fractional digits"})},Q={pretty:M({alias:"p",desc:"Pretty print output"})},ut={noDecls:M({alias:"d",desc:"Don't emit framework decls"})},At={noHeader:M({desc:"Don't emit generated header comment"})},Lt={scope:D({desc:"Suffix for CSS class names"})},Bt={watch:M({alias:"w",desc:"Watch input files for changes"})};import{watch as um}from"fs";import{resolve as cn}from"path";var k=(t,o,n)=>{o=T(o)?o:o.join(`
|
|
32
|
+
`),m+"*/");return n};var at=(t,o,n)=>(r,m)=>{let f=j(m);return r.push(`${f}${t} ${em(o)}${m.format.declStart}`),m.depth++,ht(r,[],n,m),m.depth--,r.push(f+m.format.declEnd),r},em=(t)=>{if(T(t))return t;let o=[];for(let n in t)if(t.hasOwnProperty(n)){let r=t[n];if(r===!0)r=Bn.has(n)?n:`(${n})`;else if(r===!1)r=`(not ${Bn.has(n)?n:`(${n})`})`;else if(r==="only")r+=" "+n;else r=`(${n}:${r})`;o.push(r)}return o.join(" and ")},Bn=new Set(["all","print","screen"]);var a=(t,o)=>{return o={format:Gt,vendors:Nn,fns:{},depth:0,...o},L(o.autoprefix)&&(o.autoprefix=new Set(o.autoprefix)),z(t)?Ht(t,o):X(t)?t([],o).join(o.format.rules):ht([],[],L(t)?t:vt(t)?[...t]:_("invalid rules"),o).join(o.format.rules)};var Tn=(t,...o)=>(n,r)=>(n.push(o.length?`@import url(${t}) ${o.join(r.format.ruleSep)};`:`@import url(${t});`),n);var _t=(t,o)=>at("@media",t,o);function $n(...t){return(o,n)=>(o.push(t.length>1?`@namespace ${t[0]} url(${t[1]});`:`@namespace url(${t[0]});`),o)}var Fn=(t,o)=>at("@supports",t,o);var st={"@comment":Ln,"@import":Tn,"@keyframes":An,"@media":_t,"@namespace":$n,"@supports":Fn};var Sn=4,wn=(t)=>Sn=t,R=(t)=>t===(t|0)?String(t):t.toFixed(Sn).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,"");var yn=(t)=>`${R(t)}em`,Hn=(t)=>`${R(t)}ex`;var Rn=(t)=>`${R(t)}rem`,Fo=(t)=>`${R(t)}%`,Mn=(t)=>`${R(t)}px`,In=(t)=>`${R(t)}vh`,Un=(t)=>`${R(t)}vw`,Wn=(t)=>`${R(t)}vmin`,Yn=(t)=>`${R(t)}vmax`,Dn=(t)=>`${t|0}ms`,zn=(t)=>`${R(t)}s`;var Pn=(t)=>`${R(t)}deg`,Jn=(t)=>`${R(t)}rad`,jn=(t)=>`${R(t)}turn`,Xn=(t)=>`url(${t})`;var F=((t)=>{return t[t.IDLE=0]="IDLE",t[t.ACTIVE=1]="ACTIVE",t[t.DONE=2]="DONE",t[t.UNSUBSCRIBED=3]="UNSUBSCRIBED",t[t.ERROR=4]="ERROR",t})(F||{});var hm=0,_m=()=>hm++,s=(t,o)=>!o||!o.id?{...o,id:t+"-"+_m()}:o;class So extends $t{set(t){this.parent=t}childLogger(t,o){return new So(t,o??this.level,this)}logEntry(t){this.parent.logEntry(t)}}var Zn=new So("root",B.FINE,St);var y=Zn.childLogger("rstream");class q{constructor(t,o){this.wrapped=t,o=s("sub",{closeIn:"last",closeOut:"last",cache:!0,...o}),this.parent=o.parent,this.id=o.id,this.closeIn=o.closeIn,this.closeOut=o.closeOut,this.cacheLast=o.cache,o.xform&&(this.xform=o.xform(Nt()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=b;state=F.IDLE;subs=[];deref(){return this.last!==b?this.last:void 0}getState(){return this.state}setState(t){this.state=t}subscribe(t,o={}){this.ensureState();let n;if(t instanceof q&&!o.xform)t.ensureState(),pt(!t.parent,`sub '${t.id}' already has a parent`),t.parent=this,n=t;else n=new q(t,{...o,parent:this});return this.subs.push(n),this.setState(F.ACTIVE),n.setState(F.ACTIVE),this.last!=b&&n.next(this.last),n}transform(...t){let o,n;if(z(wt(t)))n=t.pop(),o={error:n.error};return this.subscribe(o,s("xform",t.length>0?{...n,xform:P(...t)}:n))}map(t,o){return this.transform(A(t),o||{})}unsubscribe(t){return t?this.unsubscribeChild(t):this.unsubscribeSelf()}unsubscribeSelf(){return y.debug(this.id,"unsub self"),this.parent?.unsubscribe(this),this.state<F.UNSUBSCRIBED&&(this.state=F.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(t){y.debug(this.id,"unsub child",t.id);let o=this.subs.indexOf(t);if(o>=0){if(this.subs.splice(o,1),this.closeOut==="first"||!this.subs.length&&this.closeOut!=="never")this.unsubscribe();return!0}return!1}next(t){if(this.state>=F.DONE)return;this.xform?this.dispatchXform(t):this.dispatch(t)}done(){if(y.debug(this.id,"entering done()"),this.state>=F.DONE)return;if(this.xform){if(!this.dispatchXformDone())return}if(this.state=F.DONE,this.dispatchTo("done"))this.state<F.UNSUBSCRIBED&&this.unsubscribe();y.debug(this.id,"exiting done()")}error(t){let n=this.wrapped?.error;return n&&y.debug(this.id,"attempting wrapped error handler"),n?.(t)||this.unhandledError(t)}unhandledError(t){return(y.parent!==St?y:console).warn(this.id,"unhandled error:",t),this.unsubscribe(),this.state=F.ERROR,!1}dispatchTo(t,o){let n=this.wrapped;if(n)try{n[t]&&n[t](o)}catch(m){if(!this.error(m))return!1}let r=t==="next"?this.subs:[...this.subs];for(let m=r.length;m-- >0;){n=r[m];try{n[t]&&n[t](o)}catch(f){if(t==="error"||!n.error||!n.error(f))return this.unhandledError(f)}}return!0}dispatch(t){y.debug(this.id,"dispatch",t),this.cacheLast&&(this.last=t),this.dispatchTo("next",t)}dispatchXform(t){let o;try{o=this.xform[2]([],t)}catch(n){this.error(n);return}if(this.dispatchXformVals(o))w(o)&&this.done()}dispatchXformDone(){let t;try{t=this.xform[1]([])}catch(o){return this.error(o)}return this.dispatchXformVals(t)}dispatchXformVals(t){let o=J(t);for(let n=0,r=o.length;n<r&&this.state<F.DONE;n++)this.dispatch(o[n]);return this.state<F.ERROR}ensureState(){if(this.state>=F.DONE)Et(`operation not allowed in state ${F[this.state]}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var Kn=(t,o)=>{let n=new bn(o);return n.next(t),n};class bn extends q{src;_cancel;_inited;constructor(t,o){let[n,r]=X(t)?[t,o||{}]:[void 0,t||{}];super(r.error?{error:r.error}:void 0,s("stream",r));this.src=n,this._inited=!1}subscribe(t,o={}){let n=super.subscribe(t,o);if(!this._inited){if(this.src)try{this._cancel=this.src(this)||(()=>{return})}catch(r){let m=this.wrapped;if(!m||!m.error||!m.error(r))this.unhandledError(r)}this._inited=!0}return n}unsubscribe(t){let o=super.unsubscribe(t);if(o&&(!t||(!this.subs||!this.subs.length)&&this.closeOut!=="never"))this.cancel();return o}done(){this.cancel(),super.done(),delete this.src,delete this._cancel}error(t){if(super.error(t))return!0;return this.cancel(),!1}cancel(){if(this._cancel){y.debug(this.id,"cancel");let t=this._cancel;delete this._cancel,t()}}}var Vn=(t,o)=>t==="first"||t==="last"&&!o;function wo(t){return t?Ot(wo(),t):it(()=>({}),(o,[n,r])=>(o[n]=r,o))}var qn=()=>(t)=>{let o=t[2];return V(t,(n,r)=>{if(r){for(let m of J(r)||[])if(n=o(n,m),w(n))break}return w(r)?en(n):n})};function yo(t,o){return $(o)?et(yo(t),o):P(A(t),qn())}function Ho(t,o){return $(o)?x(Ho(t),o):A(X(t)?(n)=>[t(n),n]:(n)=>[t,n])}function Ro(...t){let o=lt(Ro,t);if(o)return o;let n=t[0],r=t[1]!==!1;return A((m)=>{let f=r?{}:m;for(let E in m)f[E]=n(m[E]);return f})}var pn=(t)=>t;function Mo(...t){let o=lt(Mo,t,et);if(o)return o;let{key:n=pn,mergeOnly:r=!1,reset:m=!0,all:f=!0,backPressure:E=0}=t[1],G=L(t[0])?new Set(t[0]):t[0],O=new Set,i=new Map,N={},e=([h,C,I])=>{let v=!0;if(r||E<1)return[h,(u)=>{if(m&&f&&O.size>0||!m&&v)u=I(u,N),N={},O.clear(),v=!1;return C(u)},(u,d)=>{let H=n(d);if(G.has(H)){if(N[H]=d,O.add(H),r||Qn(G,O))if(u=I(u,N),v=!1,m)N={},O.clear();else N={...N}}return u}];else return[h,(u)=>{if(f&&O.size>0)u=I(u,kn(i,O)),i.clear(),O.clear();return C(u)},(u,d)=>{let H=n(d);if(G.has(H)){let K=i.get(H);!K&&i.set(H,K=[]),K.length>=E&&Et(`max back pressure (${E}) exceeded for input: ${String(H)}`),K.push(d),O.add(H);while(Qn(G,O))if(u=I(u,kn(i,O)),v=!1,w(u))break}return u}]};return e.keys=()=>G,e.clear=()=>{i.clear(),G.clear(),O.clear(),N={}},e.add=(h)=>{G.add(h)},e.delete=(h,C=!0)=>{if(i.delete(h),G.delete(h),C)O.delete(h),delete N[h]},e}var Qn=(t,o)=>{if(o.size<t.size)return!1;for(let n of t)if(!o.has(n))return!1;return!0},kn=(t,o)=>{let n={};for(let r of o){let m=t.get(r);n[r]=m.shift(),!m.length&&o.delete(r)}return n};var vn=(t,o)=>{let n=!0;for(let r of o)n=t.removeID(r)&&n;return n};var ct=(t)=>new dn(t);class dn extends q{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(t){let o=Mo(new Set,{key:(r)=>r[0],mergeOnly:t.mergeOnly===!0,reset:t.reset===!0,all:t.all!==!1,backPressure:t.backPressure||0}),n=Ro((r)=>r[1]);super(void 0,s("streamsync",{...t,xform:t.xform?P(o,n,t.xform):P(o,n)}));this.sources=new Map,this.realSourceIDs=new Map,this.invRealSourceIDs=new Map,this.idSources=new Map,this.psync=o,this.clean=!!t.clean,t.src&&this.addAll(t.src)}add(t,o){o||(o=t.id),this.ensureState(),this.psync.add(o),this.realSourceIDs.set(o,t.id),this.invRealSourceIDs.set(t.id,o),this.idSources.set(t.id,t),this.sources.set(t,t.subscribe({next:(n)=>n[1]instanceof q?this.add(n[1]):this.next(n),done:()=>this.markDone(t),__owner:this},{xform:Ho(o),id:`in-${o}`}))}addAll(t){for(let o in t)this.psync.add(o);for(let o in t)this.add(t[o],o)}remove(t){let o=this.sources.get(t);if(o){let n=this.invRealSourceIDs.get(t.id);return y.info(`removing src: ${t.id} (${n})`),this.psync.delete(n,this.clean),this.realSourceIDs.delete(n),this.invRealSourceIDs.delete(t.id),this.idSources.delete(t.id),this.sources.delete(t),o.unsubscribe(),!0}return!1}removeID(t){let o=this.getSourceForID(t);return o?this.remove(o):!1}removeAll(t){for(let n of t)this.psync.delete(this.invRealSourceIDs.get(n.id));let o=!0;for(let n of t)o=this.remove(n)&&o;return o}removeAllIDs(t){return vn(this,t)}getSourceForID(t){return this.idSources.get(this.realSourceIDs.get(t))}getSources(){let t={};for(let[o,n]of this.idSources)t[this.invRealSourceIDs.get(o)]=n;return t}unsubscribe(t){if(!t){y.debug(this.id,"unsub sources");for(let o of this.sources.values())o.unsubscribe();this.sources.clear(),this.psync.clear(),this.realSourceIDs.clear(),this.invRealSourceIDs.clear(),this.idSources.clear()}return super.unsubscribe(t)}markDone(t){this.remove(t),Vn(this.closeIn,this.sources.size)&&this.done()}}var Io=W((t,o=" ")=>{let n=nt(String(o),t);return(r,m)=>{if(r==null)return n;return r=r.toString(),m=m!==void 0?m:r.length,m<t?n.substring(m)+r:r}}),NO=Io(2,"0"),eO=Io(3,"0"),ln=Io(4,"0");var Cm=/\{(\d+)\}/g;var Uo=(t,...o)=>o.length>0?t.replace(Cm,(n,r)=>String(o[parseInt(r,10)])):t;var gn=(t)=>({key:(o)=>o,group:Nt(),...t});function Wo(...t){let o=hn(Wo,t);if(o)return o;let n=gn(t[0]),[r,m,f]=n.group;return[()=>({}),(E)=>{for(let G in E)E[G]=m(E[G]);return E},(E,G)=>{let O=n.key(G);return E[O]=E[O]?f(E[O],G):f(r(),G),E}]}function Yo(t,o){return $(o)?x(Yo(t),o):(n)=>{let r=n[2];return V(n,(m,f)=>t(f)?r(m,f):m)}}import{watch as tr}from"fs";import{resolve as c}from"path";var xn={specs:D({alias:"s",required:!0,desc:"Path to generated JSON defs"})},to={bundle:M({alias:"b",desc:"Bundle inputs (see `out` option)"})},Ct={include:Dt({alias:"I",desc:"Include CSS files (prepend)"})},oo={eval:D({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"})},no={force:Dt({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},an={media:Dt({alias:"m",hint:"ID",desc:"Media query IDs (use 'ALL' for all)",delim:","})},sn={onlyDecls:M({desc:"Only emit framework decls"})},p={out:D({alias:"o",desc:"Output file (or stdout)"})},ro={prec:zt({default:3,desc:"Number of fractional digits"})},Q={pretty:M({alias:"p",desc:"Pretty print output"})},ut={noDecls:M({alias:"d",desc:"Don't emit framework decls"})},At={noHeader:M({desc:"Don't emit generated header comment"})},Lt={scope:D({desc:"Suffix for CSS class names"})},Bt={watch:M({alias:"w",desc:"Watch input files for changes"})};import{watch as um}from"fs";import{resolve as cn}from"path";var k=(t,o,n)=>{o=T(o)?o:o.join(`
|
|
33
33
|
`),t?Co(cn(t),o,n):process.stdout.write(o+`
|
|
34
|
-
`)},mo=({info:{name:t,version:o}})=>`/*! ${t} v${o} - generated by thi.ng/meta-css @ ${new Date().toISOString()} */`,Mt=(t,o)=>{let n=()=>{o.info("closing watchers..."),r.forEach((m)=>m.watcher.close())},r=t.map((m,f)=>{m=cn(m);let E=Kn(w(m,o),{id:`in${ln(f)}`});return{input:E,watcher:um(m,{},(G)=>{if(G==="change")try{E.next(w(m,o))}catch(O){o.warn(O.message),n()}else o.warn("input removed:",m),n()})}});return process.on("SIGINT",n),ct({src:So(A(({input:m})=>[m.id,m],r))})},fo=(t)=>Object.keys(t).reduce((o,n)=>{if(!n.startsWith("__"))o[n]=t[n];return o},{});var nr={desc:"Transpile (and optionally bundle) meta stylesheets to CSS",opts:{...to,...oo,...no,...Ct,...ut,...At,...p,...Q,...Lt,...xn,...Bt,noWrite:M({desc:"Don't write files, use stdout only"})},fn:Do};async function Do(t){let o=Z(c(t.opts.specs),t.logger),n=$m(o,t.opts.force||[],t.logger);if(t.opts.bundle)if(t.opts.watch)await Lm(t,n);else Ut(t,o,n,t.opts.eval?[t.opts.eval]:t.inputs.map((r)=>w(c(r),t.logger)),t.opts.out);else if(t.opts.watch)await Am(t,o,n);else if(t.opts.eval)try{Ut(t,o,n,[t.opts.eval])}catch(r){t.logger.warn(r.message)}else for(let r of t.inputs)try{r=c(r);let m=!t.opts.noWrite?r.replace(/\.mcss$/,".css"):void 0;Ut(t,o,n,[w(r,t.logger)],m)}catch(m){t.logger.warn(m.message)}}var Am=async(t,o,n)=>{let r=c(t.opts.specs),m,f={process:()=>{try{return o=Z(r,t.logger),m.forEach((G)=>G.process()),!0}catch(G){return t.logger.warn(G.message+": "+r),!1}},watcher:tr(r,{},(G)=>{if(G==="change")f.process();else t.logger.warn("specs file removed:",r),E()})},E=()=>{t.logger.info("closing watchers..."),f.watcher.close(),m.forEach((G)=>G.watcher.close())};m=t.inputs.map((G)=>{G=c(G);let O=!t.opts.noWrite?G.replace(/\.mcss$/,".css"):void 0,i=()=>{try{return Ut(t,o,n,[w(G,t.logger)],O),!0}catch(N){if(t.logger.warn(N.message+": "+G),m)E();return!1}};if(!i())process.exit(1);return{process:i,watcher:tr(G,{},(N)=>{if(N==="change")i();else t.logger.warn("input removed:",G),E()})}}),t.logger.info("waiting for changes, press ctrl+c to cancel..."),process.on("SIGINT",E)},Lm=async(t,o)=>{ct({src:{styles:Mt(t.inputs,t.logger),specs:Mt([t.opts.specs],t.logger).map((n)=>JSON.parse(Object.values(n)[0]))}}).subscribe({next({styles:n,specs:r}){try{Ut(t,r,o,Object.keys(n).sort().map((m)=>n[m]),t.opts.out)}catch(m){t.logger.warn(m.message)}}})},Ut=({logger:t,opts:{include:o,noDecls:n,noHeader:r,pretty:m,scope:f}},E,G,O,i)=>{let N={logger:t,specs:E,css:{format:m?dt:Gt,fns:st,scope:f},mediaQueryIDs:new Set(Object.keys(E.media)),mediaQueryRules:{...G.mediaQueryRules},plainRules:{...G.plainRules}},e=o?o.map((h)=>w(c(h),t).trim()):[];if(!r)e.push(mo(E));if(!n&&E.decls.length)e.push(a(E.decls,N.css));O.forEach((h)=>Fm(h,N)),Tm(e,N),Bm(e,N),k(i,e,t)},Bm=(t,{css:o,logger:n,mediaQueryRules:r,specs:m})=>{for(let f in r){let E=mr(r[f],m);n.debug("mediaquery rules",f,E),t.push(a(_t(Hm(m.media,f),E),o))}},Tm=(t,{css:o,logger:n,plainRules:r,specs:m})=>{let f=mr(r,m);n.debug("plain rules",f),t.push(a(f,o))},$m=(t,o,n)=>{let r=new Set(Object.keys(t.media)),m=new Set(Object.keys(t.classes)),f={},E={};if(o.length&&o[0][0]==="@")o=[...mt(w(c(o[0].substring(1)),n))];for(let G of o){if(!G||G.startsWith("//"))continue;let{token:O,query:i}=fr(G,r),N;if(O.includes("*")){let e=new RegExp(`^${O.replace("*",".*")}$`);N=[...Yo((h)=>e.test(h),m)]}else if(m.has(O))N=[O];else{n.warn(`unknown include rule ID: ${G}, skipping...`);continue}for(let e of N)n.debug("including class:",e),i?Er(f,i,`.${e}`,e):Gr(E,`.${e}`,e)}return{mediaQueryRules:f,plainRules:E}},Fm=(t,{specs:o,mediaQueryIDs:n,mediaQueryRules:r,plainRules:m})=>{let f=Wt(),E=Wt(f),G={root:f,curr:E,scopes:[E]};for(let O of mt(t)){if(!O||/^\s*\/\//.test(O))continue;for(let i of wm(O)){if(!i)continue;let N=G.curr;switch(N.state){case"sel":case"nest":if(i==="{"){if(N.state==="sel")N.sel=N.sel.map((e)=>e.replace(",","")),N.path=Sm(G.scopes);N.state="class"}else if(i==="}")or(G);else{let e=yt(N.sel);if(!e||e.endsWith(","))N.sel.push(i);else N.sel[N.sel.length-1]+=" "+i}break;case"class":if(i==="{")N.state="nest",G.scopes.push(G.curr=Wt(N));else if(i==="}")or(G);else{let{token:e,query:h}=fr(i,n);if(!o.classes[e]&&!(Or(e)||Nr(e)||ir(e)))_(`unknown class ID: ${e}`);if(h)Er(r,h,N.path,e);else Gr(m,N.path,e)}break;default:Et(N.state)}}}};function*wm(t){let o=-1,n=t.length,r=0,m=0,f=!1;for(let E=0;E<n;E++){let G=t[E];if(G==='"'&&!(r||m))if(f)yield t.substring(o,E+1),o=-1,f=!1;else f=!0;else if(G===" "||G==="\t"){if(!(r||m||f)&&o>=0)yield t.substring(o,E),o=-1}else if(G==="{"||G==="}"){if(o>=0)yield t.substring(o,E);yield G,o=-1}else if(G==="(")r++;else if(G===")"){if(--r<0)_(`invalid nesting in line: '${t}'`)}else if(G==="["){if(o<0)o=E;m++}else if(G==="]"){if(--m<0)_(`invalid arg nesting in line: '${t}'`)}else if(o<0)o=E}if(f)_("string literals must be fully on a single line");if(r)_("template calls must be fully on a single line");if(m)_("verbatim properties must be fully on a single line");if(o>=0)yield t.substring(o,n)}var It=":",rr="///",Wt=(t)=>({state:"sel",sel:t?[]:["<root>"],path:"",parent:t}),or=(t)=>{let o=!t.curr.sel.length;if(pt(!!t.curr.parent,"stack underflow"),t.scopes.pop(),t.scopes.length>0){if(t.curr=yt(t.scopes),!o&&t.curr.state==="nest")t.scopes.push(t.curr=Wt(t.curr))}else t.scopes.push(t.curr=Wt(t.root))},Sm=(t)=>t.map((o)=>o.sel.join(",")).join(rr),mr=(t,o)=>Object.entries(t).map(([n,r])=>ym(n,r,o)),ym=(t,o,n)=>{let r=[],m=r,f=t.split(rr);for(let E=0;E<f.length;E++){let G=f[E].split(",");if(E==f.length-1){let O=Object.assign({},...A((i)=>Nr(i)?Im(i):Or(i)?Rm(i):ir(i)?Mm(n,i):fo(n.classes[i]),o));G.push(O)}m.push(G),m=G}return r[0]},fr=(t,o)=>{if(/^::?/.test(t))return{token:t};let n=t.lastIndexOf(It);if(n<0)return{token:t};let r=t.indexOf("("),m=t.indexOf("[");if(r>0||m>0){let G=r>0?m>0?Math.min(r,m):r:m;if(G<n&&t.indexOf(It)>G)return{token:t};n=t.substring(0,G).lastIndexOf(It)}let f=t.substring(0,n);if(!f.split(It).every((G)=>o.has(G)))_(`invalid media query in token: ${t}`);return{token:t.substring(n+1),query:f}},Hm=(t,o)=>o.split(It).reduce((n,r)=>Object.assign(n,t[r]),{}),Er=(t,o,n,r)=>{if(!t[o])t[o]={};(t[o][n]||(t[o][n]=new Set)).add(r)},Gr=(t,o,n)=>(t[o]||(t[o]=new Set)).add(n),Rm=(t)=>{let o=t.indexOf("="),n=t.substring(0,o),r=t.substring(o+1);return{[`--${n}`]:r[0]==='"'?r.slice(1,-1):r}},Mm=(t,o)=>{let n=o.indexOf("("),r=o.substring(0,n),m=o.substring(n+1,o.length-1).split(/(?<!\\),/g).map((E)=>E.trim().replace("\\,",",")),f=t.templates[r];if(!f)_(`unknown template: ${r}`);if(m.length!==f.__arity)_(`template "${r}" expected ${f.__arity} arguments`);return Object.entries(f).reduce((E,[G,O])=>{if(!G.startsWith("__")){if(G=Uo(G,...m),T(O))O=Uo(O,...m);E[G]=O}return E},{})},Im=(t)=>{let[o,n,r]=/^(.+)-\[(.+)\]/.exec(t);return{[n]:r}},Or=(t)=>/^[a-z0-9:_-]+=.+/i.test(t),ir=(t)=>t.includes("(")&&t.endsWith(")"),Nr=(t)=>t.indexOf("-[")>0&&t.endsWith("]");var hr={deg:Pn,em:yn,ex:Hn,ms:Dn,percent:Fo,px:Mn,rad:Jn,rem:Rn,second:zn,turn:jn,url:Xn,vh:In,vmax:Yn,vmin:Wn,vw:Un,"%":Fo},Um={percent:"{0}%",second:"{0}s",url:"url({0})"},Wm={"":[""],a:[""],h:["-left","-right"],v:["-top","-bottom"],t:["-top"],top:["top"],b:["-bottom"],bottom:["bottom"],r:["-right"],right:["right"],l:["-left"],left:["left"],x:["-x"],y:["-y"],in:[""],out:[""]},_r={desc:"Generate framework rules from specs",opts:{...p,...ro,...Q,...Bt},fn:zo};async function zo(t){if(t.opts.watch)await Ym(t);else await Cr(t.inputs.map((o)=>w(o,t.logger)),t.opts,t.logger)}var Ym=async(t)=>{Mt(t.inputs,t.logger).subscribe({next(o){try{Cr(Object.keys(o).sort().map((n)=>o[n]),t.opts,t.logger)}catch(n){t.logger.warn(n.message)}}})},Cr=async(t,o,n)=>{let r={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},templates:{},decls:[]};Sn(o.prec);for(let m of t){let f=JSON.parse(m);if(Object.assign(r.info,f.info),Object.assign(r.media,f.media),f.decls)r.decls.push(...f.decls);if(f.specs)for(let E of f.specs)try{ur(f,E,r.classes,n)}catch(G){n.warn(`error processing spec: ${E.name}`,G,", skipping...")}if(f.templates)for(let E of f.templates)Dm(f,E,r.templates,n)}return k(o.out,JSON.stringify(r,null,o.pretty?4:0),n),r},ur=(t,o,n,r,m=!1)=>{let f=L(o.vars)?o.vars:[""],E=T(o.props)?{[o.props]:"<v>"}:o.props,G=zm(o,t),O=new Set;for(let i of f){let N=t.vars?.[i]||Wm[i];if(!N)_(`unknown variation ID: ${i}`);for(let[e,h]of gt(N,Object.keys(G))){let C=tt(o.name,i,e,h,G[h]),I=o.unit?tt(o.unit,i,e,h,G[h]):void 0,v=m?Jm(I):Pm(G[h],I);if(!n[C]){if(n[C]={},o.user!=null)n[C].__user=o.user;if(o.doc!=null)n[C].__doc=jm(o.doc,i,e,h,v)}else if(!O.has(C))_(`duplicate class ID: ${C}`);O.add(C);let u=-1;for(let[d,H]of Object.entries(E)){let K=tt(d,i,e,h,G[h]),Eo=tt(!I||T(H)?String(H):hr[I](H),i,e,h,v);if(n[C][K]=Eo,r.debug(C,K,Eo),m)u=er(Eo,er(K,u))}if(m)n[C].__arity=u+1}}return n},Dm=(t,o,n,r)=>ur(t,{...o,values:[""]},n,r,!0),er=(t,o)=>{let n=/\{(\d+)\}/g,r;while(r=n.exec(t))o=Math.max(o,+r[1]);return o},zm=(t,o)=>{let n=T(t.values)?o.tables?.[t.values]||_(`invalid table ID: ${t.values}`):t.values;if(z(n))return n;let r=t.key==="v"?(m)=>String(m):t.key==="i+1"?(m,f)=>String(f+1):t.key==="i"||t.key===void 0?(m,f)=>String(f):_(`invalid key type: ${t.key}`);return n.reduce((m,f,E)=>{return m[r(f,E)]=f,m},{})},Pm=(t,o)=>{if(!o||T(t))return t;let n=hr[o];if(!n)_(`invalid unit: ${o}`);return n(t)},Jm=(t)=>t?Um[t]||"{0}"+t:"{0}",tt=(t,o,n,r,m)=>t.replace(/<vid>/g,o).replace(/<var>/g,n).replace(/<k>/g,r).replace(/<v>/g,String(m)),jm=({group:t,desc:o,args:n},r,m,f,E)=>({group:t?tt(t,r,m,f,E):"TODO",desc:o?tt(o,r,m,f,E):void 0,args:n?n.map((G)=>tt(G,r,m,f,E)):void 0});var Ar={desc:"Combination of the generate & convert commands",opts:{...to,...oo,...no,...Ct,...ut,...At,...ro,...Q,...Lt,...Bt,outCss:D({desc:"Output file for CSS bundle",required:!0}),outSpecs:D({desc:"Output file for framework",required:!0})},fn:async(t)=>{let{opts:o,inputs:n}=t,[r,m]=n.reduce((G,O)=>(G[O.endsWith(".json")?0:1].push(O),G),[[],[]]),f={inputs:r,format:t.format,logger:t.logger,opts:{...o,out:o.outSpecs}},E={inputs:m,format:t.format,logger:t.logger,opts:{...o,noWrite:!1,out:o.outCss,scope:o.scope,specs:o.outSpecs}};await zo(f),await Do(E)}};import{resolve as Xm}from"path";var Tr={desc:"Generate Markdown documentation for framework specs",opts:{...p,level:Pt({alias:"l",desc:"Initial heading level",default:1}),title:D({alias:"t",desc:"Custom main title, set to NONE to disable"})},inputs:1,fn:async(t)=>{let{logger:o,opts:n,inputs:r}=t,m=Z(Xm(r[0]),o),f=Zm(m,n);k(n.out,f,o)}},Zm=(t,{level:o,title:n})=>{let r=Object.keys(t.classes).length,m=Object.keys(t.templates).length,f=[`Currently, there are ${r+m} CSS utility classes (incl. ${m} templates) defined in "${t.info.name}" (v${t.info.version}):`,"",`${ot(o+1)} Classes by category`,"",...Br(t.classes,bm,o+2),`${ot(o+1)} Templates by category`,"",...Br(t.templates,Vm,o+2),`${ot(o+1)} Media queries`,"",...Object.entries(t.media).map(([E,G])=>`- **${E}**: \`${JSON.stringify(G)}\``),""];if(n!=="NONE")f.unshift(`${ot(o)} ${n??t.info.name}
|
|
34
|
+
`)},mo=({info:{name:t,version:o}})=>`/*! ${t} v${o} - generated by thi.ng/meta-css @ ${new Date().toISOString()} */`,Rt=(t,o)=>{let n=()=>{o.info("closing watchers..."),r.forEach((m)=>m.watcher.close())},r=t.map((m,f)=>{m=cn(m);let E=Kn(S(m,o),{id:`in${ln(f)}`});return{input:E,watcher:um(m,{},(G)=>{if(G==="change")try{E.next(S(m,o))}catch(O){o.warn(O.message),n()}else o.warn("input removed:",m),n()})}});return process.on("SIGINT",n),ct({src:wo(A(({input:m})=>[m.id,m],r))})},fo=(t)=>Object.keys(t).reduce((o,n)=>{if(!n.startsWith("__"))o[n]=t[n];return o},{});var nr={desc:"Transpile (and optionally bundle) meta stylesheets to CSS",opts:{...to,...oo,...no,...Ct,...ut,...At,...p,...Q,...Lt,...xn,...Bt,noWrite:M({desc:"Don't write files, use stdout only"})},fn:Do};async function Do(t){let o=Z(c(t.opts.specs),t.logger),n=$m(o,t.opts.force||[],t.logger);if(t.opts.bundle)if(t.opts.watch)await Lm(t,n);else It(t,o,n,t.opts.eval?[t.opts.eval]:t.inputs.map((r)=>S(c(r),t.logger)),t.opts.out);else if(t.opts.watch)await Am(t,o,n);else if(t.opts.eval)try{It(t,o,n,[t.opts.eval])}catch(r){t.logger.warn(r.message)}else for(let r of t.inputs)try{r=c(r);let m=!t.opts.noWrite?r.replace(/\.mcss$/,".css"):void 0;It(t,o,n,[S(r,t.logger)],m)}catch(m){t.logger.warn(m.message)}}var Am=async(t,o,n)=>{let r=c(t.opts.specs),m,f={process:()=>{try{return o=Z(r,t.logger),m.forEach((G)=>G.process()),!0}catch(G){return t.logger.warn(G.message+": "+r),!1}},watcher:tr(r,{},(G)=>{if(G==="change")f.process();else t.logger.warn("specs file removed:",r),E()})},E=()=>{t.logger.info("closing watchers..."),f.watcher.close(),m.forEach((G)=>G.watcher.close())};m=t.inputs.map((G)=>{G=c(G);let O=!t.opts.noWrite?G.replace(/\.mcss$/,".css"):void 0,i=()=>{try{return It(t,o,n,[S(G,t.logger)],O),!0}catch(N){if(t.logger.warn(N.message+": "+G),m)E();return!1}};if(!i())process.exit(1);return{process:i,watcher:tr(G,{},(N)=>{if(N==="change")i();else t.logger.warn("input removed:",G),E()})}}),t.logger.info("waiting for changes, press ctrl+c to cancel..."),process.on("SIGINT",E)},Lm=async(t,o)=>{ct({src:{styles:Rt(t.inputs,t.logger),specs:Rt([t.opts.specs],t.logger).map((n)=>JSON.parse(Object.values(n)[0]))}}).subscribe({next({styles:n,specs:r}){try{It(t,r,o,Object.keys(n).sort().map((m)=>n[m]),t.opts.out)}catch(m){t.logger.warn(m.message)}}})},It=({logger:t,opts:{include:o,noDecls:n,noHeader:r,pretty:m,scope:f}},E,G,O,i)=>{let N={logger:t,specs:E,css:{format:m?dt:Gt,fns:st,scope:f},mediaQueryIDs:new Set(Object.keys(E.media)),mediaQueryRules:{...G.mediaQueryRules},plainRules:{...G.plainRules}},e=o?o.map((h)=>S(c(h),t).trim()):[];if(!r)e.push(mo(E));if(!n&&E.decls.length)e.push(a(E.decls,N.css));O.forEach((h)=>Fm(h,N)),Tm(e,N),Bm(e,N),k(i,e,t)},Bm=(t,{css:o,logger:n,mediaQueryRules:r,specs:m})=>{for(let f in r){let E=mr(r[f],m);n.debug("mediaquery rules",f,E),t.push(a(_t(Hm(m.media,f),E),o))}},Tm=(t,{css:o,logger:n,plainRules:r,specs:m})=>{let f=mr(r,m);n.debug("plain rules",f),t.push(a(f,o))},$m=(t,o,n)=>{let r=new Set(Object.keys(t.media)),m=new Set(Object.keys(t.classes)),f={},E={};if(o.length&&o[0][0]==="@")o=[...mt(S(c(o[0].substring(1)),n))];for(let G of o){if(!G||G.startsWith("//"))continue;let{token:O,query:i}=fr(G,r),N;if(O.includes("*")){let e=new RegExp(`^${O.replace("*",".*")}$`);N=[...Yo((h)=>e.test(h),m)]}else if(m.has(O))N=[O];else{n.warn(`unknown include rule ID: ${G}, skipping...`);continue}for(let e of N)n.debug("including class:",e),i?Er(f,i,`.${e}`,e):Gr(E,`.${e}`,e)}return{mediaQueryRules:f,plainRules:E}},Fm=(t,{specs:o,mediaQueryIDs:n,mediaQueryRules:r,plainRules:m})=>{let f=Ut(),E=Ut(f),G={root:f,curr:E,scopes:[E]};for(let O of mt(t)){if(!O||/^\s*\/\//.test(O))continue;for(let i of Sm(O)){if(!i)continue;let N=G.curr;switch(N.state){case"sel":case"nest":if(i==="{"){if(N.state==="sel")N.sel=N.sel.map((e)=>e.replace(",","")),N.path=wm(G.scopes);N.state="class"}else if(i==="}")or(G);else{let e=wt(N.sel);if(!e||e.endsWith(","))N.sel.push(i);else N.sel[N.sel.length-1]+=" "+i}break;case"class":if(i==="{")N.state="nest",G.scopes.push(G.curr=Ut(N));else if(i==="}")or(G);else{let{token:e,query:h}=fr(i,n);if(!o.classes[e]&&!(Or(e)||Nr(e)||ir(e)))_(`unknown class ID: ${e}`);if(h)Er(r,h,N.path,e);else Gr(m,N.path,e)}break;default:Et(N.state)}}}};function*Sm(t){let o=-1,n=t.length,r=0,m=0,f=!1;for(let E=0;E<n;E++){let G=t[E];if(G==='"'&&!(r||m))if(f)yield t.substring(o,E+1),o=-1,f=!1;else f=!0;else if(G===" "||G==="\t"){if(!(r||m||f)&&o>=0)yield t.substring(o,E),o=-1}else if(G==="{"||G==="}"){if(o>=0)yield t.substring(o,E);yield G,o=-1}else if(G==="(")r++;else if(G===")"){if(--r<0)_(`invalid nesting in line: '${t}'`)}else if(G==="["){if(o<0)o=E;m++}else if(G==="]"){if(--m<0)_(`invalid arg nesting in line: '${t}'`)}else if(o<0)o=E}if(f)_("string literals must be fully on a single line");if(r)_("template calls must be fully on a single line");if(m)_("verbatim properties must be fully on a single line");if(o>=0)yield t.substring(o,n)}var Mt=":",rr="///",Ut=(t)=>({state:"sel",sel:t?[]:["<root>"],path:"",parent:t}),or=(t)=>{let o=!t.curr.sel.length;if(pt(!!t.curr.parent,"stack underflow"),t.scopes.pop(),t.scopes.length>0){if(t.curr=wt(t.scopes),!o&&t.curr.state==="nest")t.scopes.push(t.curr=Ut(t.curr))}else t.scopes.push(t.curr=Ut(t.root))},wm=(t)=>t.map((o)=>o.sel.join(",")).join(rr),mr=(t,o)=>Object.entries(t).map(([n,r])=>ym(n,r,o)),ym=(t,o,n)=>{let r=[],m=r,f=t.split(rr);for(let E=0;E<f.length;E++){let G=f[E].split(",");if(E==f.length-1){let O=Object.assign({},...A((i)=>Nr(i)?Im(i):Or(i)?Rm(i):ir(i)?Mm(n,i):fo(n.classes[i]),o));G.push(O)}m.push(G),m=G}return r[0]},fr=(t,o)=>{if(/^::?/.test(t))return{token:t};let n=t.lastIndexOf(Mt);if(n<0)return{token:t};let r=t.indexOf("("),m=t.indexOf("[");if(r>0||m>0){let G=r>0?m>0?Math.min(r,m):r:m;if(G<n&&t.indexOf(Mt)>G)return{token:t};n=t.substring(0,G).lastIndexOf(Mt)}let f=t.substring(0,n);if(!f.split(Mt).every((G)=>o.has(G)))_(`invalid media query in token: ${t}`);return{token:t.substring(n+1),query:f}},Hm=(t,o)=>o.split(Mt).reduce((n,r)=>Object.assign(n,t[r]),{}),Er=(t,o,n,r)=>{if(!t[o])t[o]={};(t[o][n]||(t[o][n]=new Set)).add(r)},Gr=(t,o,n)=>(t[o]||(t[o]=new Set)).add(n),Rm=(t)=>{let o=t.indexOf("="),n=t.substring(0,o),r=t.substring(o+1);return{[`--${n}`]:r[0]==='"'?r.slice(1,-1):r}},Mm=(t,o)=>{let n=o.indexOf("("),r=o.substring(0,n),m=o.substring(n+1,o.length-1).split(/(?<!\\),/g).map((E)=>E.trim().replace("\\,",",")),f=t.templates[r];if(!f)_(`unknown template: ${r}`);if(m.length!==f.__arity)_(`template "${r}" expected ${f.__arity} arguments`);return Object.entries(f).reduce((E,[G,O])=>{if(!G.startsWith("__")){if(G=Uo(G,...m),T(O))O=Uo(O,...m);E[G]=O}return E},{})},Im=(t)=>{let[o,n,r]=/^(.+)-\[(.+)\]/.exec(t);return{[n]:r}},Or=(t)=>/^[a-z0-9:_-]+=.+/i.test(t),ir=(t)=>t.includes("(")&&t.endsWith(")"),Nr=(t)=>t.indexOf("-[")>0&&t.endsWith("]");var hr={deg:Pn,em:yn,ex:Hn,ms:Dn,percent:Fo,px:Mn,rad:Jn,rem:Rn,second:zn,turn:jn,url:Xn,vh:In,vmax:Yn,vmin:Wn,vw:Un,"%":Fo},Um={percent:"{0}%",second:"{0}s",url:"url({0})"},Wm={"":[""],a:[""],h:["-left","-right"],v:["-top","-bottom"],t:["-top"],top:["top"],b:["-bottom"],bottom:["bottom"],r:["-right"],right:["right"],l:["-left"],left:["left"],x:["-x"],y:["-y"],in:[""],out:[""]},_r={desc:"Generate framework rules from specs",opts:{...p,...ro,...Q,...Bt},fn:zo};async function zo(t){if(t.opts.watch)await Ym(t);else await Cr(t.inputs.map((o)=>S(o,t.logger)),t.opts,t.logger)}var Ym=async(t)=>{Rt(t.inputs,t.logger).subscribe({next(o){try{Cr(Object.keys(o).sort().map((n)=>o[n]),t.opts,t.logger)}catch(n){t.logger.warn(n.message)}}})},Cr=async(t,o,n)=>{let r={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},templates:{},decls:[]};wn(o.prec);for(let m of t){let f=JSON.parse(m);if(Object.assign(r.info,f.info),Object.assign(r.media,f.media),f.decls)r.decls.push(...f.decls);if(f.specs)for(let E of f.specs)try{ur(f,E,r.classes,n)}catch(G){n.warn(`error processing spec: ${E.name}`,G,", skipping...")}if(f.templates)for(let E of f.templates)Dm(f,E,r.templates,n)}return k(o.out,JSON.stringify(r,null,o.pretty?4:0),n),r},ur=(t,o,n,r,m=!1)=>{let f=L(o.vars)?o.vars:[""],E=T(o.props)?{[o.props]:"<v>"}:o.props,G=zm(o,t),O=new Set;for(let i of f){let N=t.vars?.[i]||Wm[i];if(!N)_(`unknown variation ID: ${i}`);for(let[e,h]of gt(N,Object.keys(G))){let C=tt(o.name,i,e,h,G[h]),I=o.unit?tt(o.unit,i,e,h,G[h]):void 0,v=m?Jm(I):Pm(G[h],I);if(!n[C]){if(n[C]={},o.user!=null)n[C].__user=o.user;if(o.doc!=null)n[C].__doc=jm(o.doc,i,e,h,v)}else if(!O.has(C))_(`duplicate class ID: ${C}`);O.add(C);let u=-1;for(let[d,H]of Object.entries(E)){let K=tt(d,i,e,h,G[h]),Eo=tt(!I||T(H)?String(H):hr[I](H),i,e,h,v);if(n[C][K]=Eo,r.debug(C,K,Eo),m)u=er(Eo,er(K,u))}if(m)n[C].__arity=u+1}}return n},Dm=(t,o,n,r)=>ur(t,{...o,values:[""]},n,r,!0),er=(t,o)=>{let n=/\{(\d+)\}/g,r;while(r=n.exec(t))o=Math.max(o,+r[1]);return o},zm=(t,o)=>{let n=T(t.values)?o.tables?.[t.values]||_(`invalid table ID: ${t.values}`):t.values;if(z(n))return n;let r=t.key==="v"?(m)=>String(m):t.key==="i+1"?(m,f)=>String(f+1):t.key==="i"||t.key===void 0?(m,f)=>String(f):_(`invalid key type: ${t.key}`);return n.reduce((m,f,E)=>{return m[r(f,E)]=f,m},{})},Pm=(t,o)=>{if(!o||T(t))return t;let n=hr[o];if(!n)_(`invalid unit: ${o}`);return n(t)},Jm=(t)=>t?Um[t]||"{0}"+t:"{0}",tt=(t,o,n,r,m)=>t.replace(/<vid>/g,o).replace(/<var>/g,n).replace(/<k>/g,r).replace(/<v>/g,String(m)),jm=({group:t,desc:o,args:n},r,m,f,E)=>({group:t?tt(t,r,m,f,E):"TODO",desc:o?tt(o,r,m,f,E):void 0,args:n?n.map((G)=>tt(G,r,m,f,E)):void 0});var Ar={desc:"Combination of the generate & convert commands",opts:{...to,...oo,...no,...Ct,...ut,...At,...ro,...Q,...Lt,...Bt,outCss:D({desc:"Output file for CSS bundle",required:!0}),outSpecs:D({desc:"Output file for framework",required:!0})},fn:async(t)=>{let{opts:o,inputs:n}=t,[r,m]=n.reduce((G,O)=>(G[O.endsWith(".json")?0:1].push(O),G),[[],[]]),f={inputs:r,format:t.format,logger:t.logger,opts:{...o,out:o.outSpecs}},E={inputs:m,format:t.format,logger:t.logger,opts:{...o,noWrite:!1,out:o.outCss,scope:o.scope,specs:o.outSpecs}};await zo(f),await Do(E)}};import{resolve as Xm}from"path";var Tr={desc:"Generate Markdown documentation for framework specs",opts:{...p,level:zt({alias:"l",desc:"Initial heading level",default:1}),title:D({alias:"t",desc:"Custom main title, set to NONE to disable"})},inputs:1,fn:async(t)=>{let{logger:o,opts:n,inputs:r}=t,m=Z(Xm(r[0]),o),f=Zm(m,n);k(n.out,f,o)}},Zm=(t,{level:o,title:n})=>{let r=Object.keys(t.classes).length,m=Object.keys(t.templates).length,f=[`Currently, there are ${r+m} CSS utility classes (incl. ${m} templates) defined in "${t.info.name}" (v${t.info.version}):`,"",`${ot(o+1)} Classes by category`,"",...Br(t.classes,bm,o+2),`${ot(o+1)} Templates by category`,"",...Br(t.templates,Vm,o+2),`${ot(o+1)} Media queries`,"",...Object.entries(t.media).map(([E,G])=>`- **${E}**: \`${JSON.stringify(G)}\``),""];if(n!=="NONE")f.unshift(`${ot(o)} ${n??t.info.name}
|
|
35
35
|
`);return f},Lr=(t)=>t.split(/(\d+)/).map((o)=>{let n=parseInt(o);return isNaN(n)?o:n}),Km=(t,o)=>{if(/\d+/.test(t)&&/\d+/.test(o)){let n=Lr(t),r=Lr(o),m=n.length;if(m===r.length){for(let f=0;f<m;f++)if(n[f]!==r[f])return Ao(n[f],r[f]);return 0}return n.length-r.length}return Ao(t,o)},Br=(t,o,n)=>{let r=Wo({key:([m,{__doc:f}])=>f?.group||"TODO",group:[()=>[],(m)=>m.sort(),(m,f)=>(m.push(f[0]),m)]},Object.entries(t));return yo((m)=>{let f=r[m].sort(Km).map((G)=>o(G,t[G].__doc,n+1)),E=f.length;return[`${ot(n)} ${Xt(m)}`,E>3?`
|
|
36
36
|
<details><summary>${E} items:</summary>
|
|
37
37
|
`:"",f.join(`
|
|
@@ -41,7 +41,7 @@ Available commands:
|
|
|
41
41
|
TODO`;let r=o.args.map((m)=>/^\w+/.exec(m)[0]).join(", ");return[`${ot(n)} \`${t}(${r})\``,"",...o.args.map(qm),o.desc?`
|
|
42
42
|
${o.desc}
|
|
43
43
|
`:""].join(`
|
|
44
|
-
`)},qm=(t)=>`- ${t.replace(/^(\w+)/,(o,n)=>`**${n}**`)}`,ot=W((t)=>"#".repeat(t));import{resolve as $r}from"path";var
|
|
44
|
+
`)},qm=(t)=>`- ${t.replace(/^(\w+)/,(o,n)=>`**${n}**`)}`,ot=W((t)=>"#".repeat(t));import{resolve as $r}from"path";var Sr={desc:"Export entire generated framework as CSS",opts:{...Ct,...ut,...sn,...p,...Q,...At,...an,...Lt},inputs:1,fn:async(t)=>{let{logger:o,opts:{include:n,media:r,noDecls:m,noHeader:f,onlyDecls:E,out:G,pretty:O,scope:i},inputs:N}=t,e={format:O?dt:Gt,fns:st,scope:i},h=Z($r(N[0]),o),C=n?n.map((I)=>S($r(I),o).trim()):[];if(!f)C.push(mo(h));if(!m&&h.decls.length)C.push(a(h.decls,e));if(!E)C.push(pm(h,r,e,o));k(G,C,o)}},pm=(t,o,n,r)=>{let m=Fr("",t);if(o){let f=o[0]==="ALL"?Object.keys(t.media):o;for(let E of f)if(t.media[E])m.push(_t(t.media[E],Fr("-"+E,t)));else r.warn(`invalid media query ID: ${E}, skipping...`)}return a(m,n)},Fr=(t,o)=>Object.entries(o.classes).map(([n,r])=>[`.${n}${t}`,fo(r)]);var Po=Z(Qm(process.argv[2],"package.json"));nn({name:"metacss",start:3,opts:{...Zo},commands:{convert:nr,develop:Ar,doc:Tr,export:Sr,generate:_r},ctx:async(t)=>{return rn(t.logger,t.opts.verbose),{...t,format:jt}},usage:{prefix:`${mn(Po.name,Po.version,Po.description)}
|
|
45
45
|
|
|
46
46
|
Usage: metacss <cmd> [opts] input [...]
|
|
47
47
|
metacss <cmd> --help
|
package/package.json
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
2
|
+
"name": "@thi.ng/meta-css",
|
|
3
|
+
"version": "0.19.34",
|
|
4
|
+
"description": "Data-driven CSS framework codegen, transpiler & bundler",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"metacss": "bin/metacss"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/thi-ng/umbrella.git"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://thi.ng/meta-css",
|
|
17
|
+
"funding": [
|
|
18
|
+
{
|
|
19
|
+
"type": "github",
|
|
20
|
+
"url": "https://github.com/sponsors/postspectacular"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "patreon",
|
|
24
|
+
"url": "https://patreon.com/thing_umbrella"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "liberapay",
|
|
28
|
+
"url": "https://liberapay.com/thi.ng"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
32
|
+
"license": "Apache-2.0",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "yarn clean && bun build --outfile=index.js --target bun --minify --bundle src/index.ts",
|
|
35
|
+
"build:decl": "tsc --declaration --emitDeclarationOnly",
|
|
36
|
+
"build:esbuild": "esbuild --format=esm --platform=node --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
|
|
37
|
+
"build:specs": "bin/metacss generate --prec 3 -o export/framework.json specs/*.json",
|
|
38
|
+
"clean": "bun ../../tools/src/clean-package.ts",
|
|
39
|
+
"doc": "typedoc --options ../../typedoc.json --out doc src/index.ts",
|
|
40
|
+
"doc:readme": "yarn doc:specs && bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
41
|
+
"doc:specs": "yarn build:specs && bin/metacss doc --level 2 --title NONE -o export/framework.md export/framework.json",
|
|
42
|
+
"pub": "npm publish --access public",
|
|
43
|
+
"test": "bun test",
|
|
44
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@thi.ng/api": "^8.12.6",
|
|
48
|
+
"@thi.ng/args": "^3.1.5",
|
|
49
|
+
"@thi.ng/arrays": "^2.13.15",
|
|
50
|
+
"@thi.ng/checks": "^3.7.22",
|
|
51
|
+
"@thi.ng/compare": "^2.4.32",
|
|
52
|
+
"@thi.ng/errors": "^2.5.46",
|
|
53
|
+
"@thi.ng/file-io": "^2.2.15",
|
|
54
|
+
"@thi.ng/hiccup-css": "^2.7.69",
|
|
55
|
+
"@thi.ng/logger": "^3.2.5",
|
|
56
|
+
"@thi.ng/memoize": "^4.0.30",
|
|
57
|
+
"@thi.ng/rstream": "^9.3.3",
|
|
58
|
+
"@thi.ng/strings": "^3.9.26",
|
|
59
|
+
"@thi.ng/text-format": "^2.2.45",
|
|
60
|
+
"@thi.ng/transducers": "^9.6.14"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^24.9.1",
|
|
64
|
+
"esbuild": "^0.25.11",
|
|
65
|
+
"typedoc": "^0.28.14",
|
|
66
|
+
"typescript": "^5.9.3"
|
|
67
|
+
},
|
|
68
|
+
"keywords": [
|
|
69
|
+
"browser",
|
|
70
|
+
"bun",
|
|
71
|
+
"bundler",
|
|
72
|
+
"cli",
|
|
73
|
+
"codegen",
|
|
74
|
+
"compiler",
|
|
75
|
+
"component",
|
|
76
|
+
"css",
|
|
77
|
+
"export",
|
|
78
|
+
"fileformat",
|
|
79
|
+
"generative",
|
|
80
|
+
"generator",
|
|
81
|
+
"json",
|
|
82
|
+
"no-browser",
|
|
83
|
+
"tool",
|
|
84
|
+
"transpiler",
|
|
85
|
+
"typescript",
|
|
86
|
+
"ui"
|
|
87
|
+
],
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public"
|
|
90
|
+
},
|
|
91
|
+
"browser": {
|
|
92
|
+
"process": false,
|
|
93
|
+
"setTimeout": false
|
|
94
|
+
},
|
|
95
|
+
"engines": {
|
|
96
|
+
"node": ">=18"
|
|
97
|
+
},
|
|
98
|
+
"files": [
|
|
99
|
+
"./*.js",
|
|
100
|
+
"./*.d.ts",
|
|
101
|
+
"bin",
|
|
102
|
+
"specs"
|
|
103
|
+
],
|
|
104
|
+
"exports": {
|
|
105
|
+
".": {
|
|
106
|
+
"default": "./index.js"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"thi.ng": {
|
|
110
|
+
"related": [
|
|
111
|
+
"hiccup-css"
|
|
112
|
+
],
|
|
113
|
+
"status": "alpha",
|
|
114
|
+
"year": 2023
|
|
115
|
+
},
|
|
116
|
+
"gitHead": "136a5e5ef0b69e82329db00d806c3c4e8f1aa063\n"
|
|
117
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
- **Last updated**: 2025-09-26T11:53:06Z
|
|
4
|
-
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
|
-
|
|
6
|
-
All notable changes to this project will be documented in this file.
|
|
7
|
-
Only versions published since **2022-01-01** are listed here.
|
|
8
|
-
Please consult the Git history for older version information.
|
|
9
|
-
See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
|
|
10
|
-
|
|
11
|
-
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
|
-
and/or version bumps of transitive dependencies.
|
|
13
|
-
|
|
14
|
-
### [0.19.28](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.19.28) (2025-09-26)
|
|
15
|
-
|
|
16
|
-
#### ♻️ Refactoring
|
|
17
|
-
|
|
18
|
-
- update CLI arg specs ([34596a3](https://github.com/thi-ng/umbrella/commit/34596a3))
|
|
19
|
-
|
|
20
|
-
### [0.19.21](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.19.21) (2025-08-06)
|
|
21
|
-
|
|
22
|
-
#### ♻️ Refactoring
|
|
23
|
-
|
|
24
|
-
- update CLI internals ([c91e873](https://github.com/thi-ng/umbrella/commit/c91e873))
|
|
25
|
-
|
|
26
|
-
### [0.19.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.19.2) (2025-06-27)
|
|
27
|
-
|
|
28
|
-
#### ♻️ Refactoring
|
|
29
|
-
|
|
30
|
-
- minor update CLI wrapper ([e0b0c34](https://github.com/thi-ng/umbrella/commit/e0b0c34))
|
|
31
|
-
|
|
32
|
-
## [0.19.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.19.0) (2025-06-26)
|
|
33
|
-
|
|
34
|
-
#### 🚀 Features
|
|
35
|
-
|
|
36
|
-
- add support for string literals in var assignments ([2749c30](https://github.com/thi-ng/umbrella/commit/2749c30))
|
|
37
|
-
- use string lit to ignore white space in var assignments
|
|
38
|
-
- `name="a b c"` => `--name: a b c;`
|
|
39
|
-
- add/update tests
|
|
40
|
-
- add tween-colors() template fn ([a5b8f9d](https://github.com/thi-ng/umbrella/commit/a5b8f9d))
|
|
41
|
-
- add border-style specs ([c4cbd2f](https://github.com/thi-ng/umbrella/commit/c4cbd2f))
|
|
42
|
-
- add/replace color ops ([ba78142](https://github.com/thi-ng/umbrella/commit/ba78142))
|
|
43
|
-
- replace existing `def-rgb/hsl/lch` / `adjust-rgb/hsl/lch` with:
|
|
44
|
-
- `adjust-color()`
|
|
45
|
-
- `lighten-color()`
|
|
46
|
-
- `rotate-color()`
|
|
47
|
-
- `saturate-color()`
|
|
48
|
-
- `with-alpha()`
|
|
49
|
-
- all color ops using `oklch()` now
|
|
50
|
-
- add `font-family()` tpl fn ([38c65d4](https://github.com/thi-ng/umbrella/commit/38c65d4))
|
|
51
|
-
|
|
52
|
-
## [0.18.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.18.0) (2025-02-11)
|
|
53
|
-
|
|
54
|
-
#### 🚀 Features
|
|
55
|
-
|
|
56
|
-
- update CLI wrapper, make `bun` optional ([a694c9d](https://github.com/thi-ng/umbrella/commit/a694c9d))
|
|
57
|
-
- check if `bun` is available, otherwise fallback to `node`
|
|
58
|
-
- update CLI args (add metacss pkg dir)
|
|
59
|
-
- update readme
|
|
60
|
-
|
|
61
|
-
### [0.17.8](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.17.8) (2025-01-14)
|
|
62
|
-
|
|
63
|
-
#### ♻️ Refactoring
|
|
64
|
-
|
|
65
|
-
- use optional chaining & nullish coalescing ([c5a0a13](https://github.com/thi-ng/umbrella/commit/c5a0a13))
|
|
66
|
-
|
|
67
|
-
### [0.17.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.17.4) (2024-12-13)
|
|
68
|
-
|
|
69
|
-
#### 🩹 Bug fixes
|
|
70
|
-
|
|
71
|
-
- update var assignment check in parser ([7dfe792](https://github.com/thi-ng/umbrella/commit/7dfe792))
|
|
72
|
-
- use more strict regexp to check for var assignment
|
|
73
|
-
- update tests
|
|
74
|
-
|
|
75
|
-
### [0.17.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.17.3) (2024-12-12)
|
|
76
|
-
|
|
77
|
-
#### 🩹 Bug fixes
|
|
78
|
-
|
|
79
|
-
- support `:` in template args ([a5657dd](https://github.com/thi-ng/umbrella/commit/a5657dd))
|
|
80
|
-
- update `__parseMediaQueryToken()`
|
|
81
|
-
- add/update tests
|
|
82
|
-
|
|
83
|
-
## [0.17.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.17.0) (2024-11-24)
|
|
84
|
-
|
|
85
|
-
#### 🚀 Features
|
|
86
|
-
|
|
87
|
-
- update width/height specs ([5e59d5e](https://github.com/thi-ng/umbrella/commit/5e59d5e))
|
|
88
|
-
- remove obsolete template defs, update readme ([2f607c0](https://github.com/thi-ng/umbrella/commit/2f607c0))
|
|
89
|
-
- commit which actually removed defs: [ecac29da87](https://github.com/thi-ng/umbrella/commit/ecac29da87)
|
|
90
|
-
|
|
91
|
-
#### 🩹 Bug fixes
|
|
92
|
-
|
|
93
|
-
- update `i` key/index handling in generator rules ([4150775](https://github.com/thi-ng/umbrella/commit/4150775))
|
|
94
|
-
- update verbatim prop parsing ([0876811](https://github.com/thi-ng/umbrella/commit/0876811))
|
|
95
|
-
- fixes nested selectors in the form `[sel] { ... }`
|
|
96
|
-
- update tests
|
|
97
|
-
|
|
98
|
-
#### ♻️ Refactoring
|
|
99
|
-
|
|
100
|
-
- remove obsolete default template specs ([ecac29d](https://github.com/thi-ng/umbrella/commit/ecac29d))
|
|
101
|
-
- remove template specs from base framework which can be easily replicated
|
|
102
|
-
via verbatim properties
|
|
103
|
-
- i.e. `prop-name(value)` => `prop-name-[value]`
|
|
104
|
-
- update framework version
|
|
105
|
-
- update readme
|
|
106
|
-
|
|
107
|
-
### [0.16.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.16.1) (2024-11-15)
|
|
108
|
-
|
|
109
|
-
#### 🩹 Bug fixes
|
|
110
|
-
|
|
111
|
-
- fix parser to priortize var assignments ([937ed79](https://github.com/thi-ng/umbrella/commit/937ed79))
|
|
112
|
-
- order of checks in previous impl didn't allow for
|
|
113
|
-
`var2=var(--var1)` style assignments
|
|
114
|
-
- update tests
|
|
115
|
-
|
|
116
|
-
## [0.16.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.16.0) (2024-11-15)
|
|
117
|
-
|
|
118
|
-
#### 🚀 Features
|
|
119
|
-
|
|
120
|
-
- add verbatim property syntax ([0233ba1](https://github.com/thi-ng/umbrella/commit/0233ba1))
|
|
121
|
-
- add support for `prop-name-[value]` syntax in .mcss stylesheets
|
|
122
|
-
- add/update tests
|
|
123
|
-
- add/update framework specs ([7069752](https://github.com/thi-ng/umbrella/commit/7069752))
|
|
124
|
-
|
|
125
|
-
### [0.15.11](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.15.11) (2024-11-13)
|
|
126
|
-
|
|
127
|
-
#### 🩹 Bug fixes
|
|
128
|
-
|
|
129
|
-
- fix `fill()` template spec ([9151d85](https://github.com/thi-ng/umbrella/commit/9151d85))
|
|
130
|
-
|
|
131
|
-
## [0.15.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.15.0) (2024-08-28)
|
|
132
|
-
|
|
133
|
-
#### 🚀 Features
|
|
134
|
-
|
|
135
|
-
- update font-family tpl ([56dd1d3](https://github.com/thi-ng/umbrella/commit/56dd1d3))
|
|
136
|
-
|
|
137
|
-
## [0.14.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.14.0) (2024-08-18)
|
|
138
|
-
|
|
139
|
-
#### 🚀 Features
|
|
140
|
-
|
|
141
|
-
- add shadow templates ([5a1b3f9](https://github.com/thi-ng/umbrella/commit/5a1b3f9))
|
|
142
|
-
|
|
143
|
-
## [0.13.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.13.0) (2024-08-13)
|
|
144
|
-
|
|
145
|
-
#### 🚀 Features
|
|
146
|
-
|
|
147
|
-
- add `br-pill` variations ([c293f5f](https://github.com/thi-ng/umbrella/commit/c293f5f))
|
|
148
|
-
|
|
149
|
-
### [0.12.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.12.2) (2024-06-21)
|
|
150
|
-
|
|
151
|
-
#### ♻️ Refactoring
|
|
152
|
-
|
|
153
|
-
- enforce uniform naming convention of internal functions ([56992b2](https://github.com/thi-ng/umbrella/commit/56992b2))
|
|
154
|
-
|
|
155
|
-
## [0.12.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.12.0) (2024-04-26)
|
|
156
|
-
|
|
157
|
-
#### 🚀 Features
|
|
158
|
-
|
|
159
|
-
- add color-scheme, light-dark() and appearance rules/tpls ([5f90a48](https://github.com/thi-ng/umbrella/commit/5f90a48))
|
|
160
|
-
|
|
161
|
-
### [0.11.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.11.1) (2024-04-20)
|
|
162
|
-
|
|
163
|
-
#### ♻️ Refactoring
|
|
164
|
-
|
|
165
|
-
- update type usage ([1455b8f](https://github.com/thi-ng/umbrella/commit/1455b8f))
|
|
166
|
-
|
|
167
|
-
## [0.11.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.11.0) (2024-04-11)
|
|
168
|
-
|
|
169
|
-
#### 🚀 Features
|
|
170
|
-
|
|
171
|
-
- add/update CSS rule specs ([dfab906](https://github.com/thi-ng/umbrella/commit/dfab906))
|
|
172
|
-
|
|
173
|
-
### [0.10.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.10.3) (2024-04-08)
|
|
174
|
-
|
|
175
|
-
#### ♻️ Refactoring
|
|
176
|
-
|
|
177
|
-
- update reducer handling due to updates in [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/main/packages/transducers) pkg ([6eba744](https://github.com/thi-ng/umbrella/commit/6eba744))
|
|
178
|
-
|
|
179
|
-
## [0.10.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.10.0) (2024-03-27)
|
|
180
|
-
|
|
181
|
-
#### 🚀 Features
|
|
182
|
-
|
|
183
|
-
- add/update CSS specs ([e93d033](https://github.com/thi-ng/umbrella/commit/e93d033))
|
|
184
|
-
- update responsive media query breakpoints ([f61a119](https://github.com/thi-ng/umbrella/commit/f61a119))
|
|
185
|
-
- add `font-family()` template spec ([849c104](https://github.com/thi-ng/umbrella/commit/849c104))
|
|
186
|
-
- add `doc` command, update script aliases ([943b7d7](https://github.com/thi-ng/umbrella/commit/943b7d7))
|
|
187
|
-
- add CSS scoping option, internal refactor ([d7286c5](https://github.com/thi-ng/umbrella/commit/d7286c5))
|
|
188
|
-
|
|
189
|
-
## [0.9.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.9.0) (2024-03-21)
|
|
190
|
-
|
|
191
|
-
#### 🚀 Features
|
|
192
|
-
|
|
193
|
-
- check for invalid template IDs ([ceb8bb2](https://github.com/thi-ng/umbrella/commit/ceb8bb2))
|
|
194
|
-
- add/update CSS specs/templates ([468877b](https://github.com/thi-ng/umbrella/commit/468877b))
|
|
195
|
-
- add CSS specs/templates, update readme ([febe609](https://github.com/thi-ng/umbrella/commit/febe609))
|
|
196
|
-
|
|
197
|
-
### [0.8.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.8.1) (2024-03-18)
|
|
198
|
-
|
|
199
|
-
#### 🩹 Bug fixes
|
|
200
|
-
|
|
201
|
-
- fix template unit alias handling ([d7f11c0](https://github.com/thi-ng/umbrella/commit/d7f11c0))
|
|
202
|
-
- update TEMPLATE_UNITS aliases
|
|
203
|
-
- update __templateValue() helper
|
|
204
|
-
- add tests
|
|
205
|
-
|
|
206
|
-
#### ♻️ Refactoring
|
|
207
|
-
|
|
208
|
-
- rename fill/stroke specs, update color ops docs ([731ad15](https://github.com/thi-ng/umbrella/commit/731ad15))
|
|
209
|
-
|
|
210
|
-
## [0.8.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.8.0) (2024-03-17)
|
|
211
|
-
|
|
212
|
-
#### 🚀 Features
|
|
213
|
-
|
|
214
|
-
- add/update animation genspecs ([d7cb506](https://github.com/thi-ng/umbrella/commit/d7cb506))
|
|
215
|
-
- add animation-delay
|
|
216
|
-
- add shrink anim & keyframes
|
|
217
|
-
- add support for templated class specs ([eb09f16](https://github.com/thi-ng/umbrella/commit/eb09f16))
|
|
218
|
-
- add TemplateSpec, update CompiledSpecs
|
|
219
|
-
- add expandTemplateSpec()
|
|
220
|
-
- update expandSpec() to also handle templates, compute tpl arity
|
|
221
|
-
- update generateFramework(), make specs/templates optional
|
|
222
|
-
- update convert command impl to support templates
|
|
223
|
-
- refactor export command impl
|
|
224
|
-
- add/update tests
|
|
225
|
-
- add/update framework specs/templates ([119f385](https://github.com/thi-ng/umbrella/commit/119f385))
|
|
226
|
-
- update spec format, add spec doc object & handling ([dc63b3a](https://github.com/thi-ng/umbrella/commit/dc63b3a))
|
|
227
|
-
- update expandSpec() to handle docs & interpolate doc strings
|
|
228
|
-
- refactor convert & export commands
|
|
229
|
-
- major update base framework specs ([a985039](https://github.com/thi-ng/umbrella/commit/a985039))
|
|
230
|
-
- add docs for all specs
|
|
231
|
-
- refactor various specs as parametric templates
|
|
232
|
-
- massively reduce number of specs (~90 less)
|
|
233
|
-
- rename various specs to be less cryptic
|
|
234
|
-
- major update spec doc generator ([7117ae9](https://github.com/thi-ng/umbrella/commit/7117ae9))
|
|
235
|
-
- improve doc interpolation ([9509cc3](https://github.com/thi-ng/umbrella/commit/9509cc3))
|
|
236
|
-
- also process doc strings for template args
|
|
237
|
-
- extract __interpolateDoc() helper
|
|
238
|
-
- update stylesheet line parsing ([ee43572](https://github.com/thi-ng/umbrella/commit/ee43572))
|
|
239
|
-
- add splitLine() to correctly handle more complex tokenization rules
|
|
240
|
-
and perform more checks (e.g. parens matching, nesting)
|
|
241
|
-
- add tests
|
|
242
|
-
- add color operation templates (rgb, hsl, lch, oklch) ([b49860e](https://github.com/thi-ng/umbrella/commit/b49860e))
|
|
243
|
-
- add/update template specs ([e4ef222](https://github.com/thi-ng/umbrella/commit/e4ef222))
|
|
244
|
-
|
|
245
|
-
#### 🩹 Bug fixes
|
|
246
|
-
|
|
247
|
-
- comma-handling in template arg list parsing ([e8d45a5](https://github.com/thi-ng/umbrella/commit/e8d45a5))
|
|
248
|
-
- use negative lookbehind to support `\,` comma-escaping in single args
|
|
249
|
-
- update template arity calculation ([ac50c39](https://github.com/thi-ng/umbrella/commit/ac50c39))
|
|
250
|
-
|
|
251
|
-
#### ♻️ Refactoring
|
|
252
|
-
|
|
253
|
-
- update color var templates ([5f08683](https://github.com/thi-ng/umbrella/commit/5f08683))
|
|
254
|
-
- update color(), bg-color(), border-color(), fill(), stroke()
|
|
255
|
-
- now accepting full var name as arg, rather than just an index
|
|
256
|
-
|
|
257
|
-
### [0.7.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.7.5) (2024-02-22)
|
|
258
|
-
|
|
259
|
-
#### ♻️ Refactoring
|
|
260
|
-
|
|
261
|
-
- update all `node:*` imports ([c71a526](https://github.com/thi-ng/umbrella/commit/c71a526))
|
|
262
|
-
|
|
263
|
-
## [0.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.7.0) (2024-02-10)
|
|
264
|
-
|
|
265
|
-
#### 🚀 Features
|
|
266
|
-
|
|
267
|
-
- add `develop` cmd, update file watchers ([0380923](https://github.com/thi-ng/umbrella/commit/0380923))
|
|
268
|
-
- update `convert` and `generate` commands
|
|
269
|
-
- add `develop` command as combined workflow wrapper
|
|
270
|
-
- extract & re-use file watching setup
|
|
271
|
-
|
|
272
|
-
### [0.6.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.6.1) (2024-01-26)
|
|
273
|
-
|
|
274
|
-
#### ♻️ Refactoring
|
|
275
|
-
|
|
276
|
-
- update file watchers ([bb4d661](https://github.com/thi-ng/umbrella/commit/bb4d661))
|
|
277
|
-
|
|
278
|
-
## [0.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.6.0) (2024-01-23)
|
|
279
|
-
|
|
280
|
-
#### 🚀 Features
|
|
281
|
-
|
|
282
|
-
- update .mcss syntax, support var assignments ([468c9c5](https://github.com/thi-ng/umbrella/commit/468c9c5))
|
|
283
|
-
- update syntax to support `varname=value` assignments (incl. media prefixes)
|
|
284
|
-
- add tests
|
|
285
|
-
- add --only-decls option for export cmd ([ef8ef65](https://github.com/thi-ng/umbrella/commit/ef8ef65))
|
|
286
|
-
- update/add/rename commands ([3628c4c](https://github.com/thi-ng/umbrella/commit/3628c4c))
|
|
287
|
-
- rename `convert` => `bundle`
|
|
288
|
-
- add new `convert` command to transpile individual stylesheets
|
|
289
|
-
- update CLI arg specs/re-use
|
|
290
|
-
- merge bundle & convert cmds ([a2187cb](https://github.com/thi-ng/umbrella/commit/a2187cb))
|
|
291
|
-
|
|
292
|
-
### [0.5.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.5.1) (2023-12-31)
|
|
293
|
-
|
|
294
|
-
#### ♻️ Refactoring
|
|
295
|
-
|
|
296
|
-
- update spec format (key & variations) ([f7f2d09](https://github.com/thi-ng/umbrella/commit/f7f2d09))
|
|
297
|
-
|
|
298
|
-
## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.5.0) (2023-12-28)
|
|
299
|
-
|
|
300
|
-
#### 🚀 Features
|
|
301
|
-
|
|
302
|
-
- add supported for quoted fns ([5d8e2fc](https://github.com/thi-ng/umbrella/commit/5d8e2fc))
|
|
303
|
-
- update generate cmd input handling ([c156762](https://github.com/thi-ng/umbrella/commit/c156762))
|
|
304
|
-
|
|
305
|
-
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.4.0) (2023-12-26)
|
|
306
|
-
|
|
307
|
-
#### 🚀 Features
|
|
308
|
-
|
|
309
|
-
- add support for file-local variation defs ([3a8e1a3](https://github.com/thi-ng/umbrella/commit/3a8e1a3))
|
|
310
|
-
- support parametric units in generator specs ([004a23d](https://github.com/thi-ng/umbrella/commit/004a23d))
|
|
311
|
-
- add support for hiccup-css declarations ([cd2ceca](https://github.com/thi-ng/umbrella/commit/cd2ceca))
|
|
312
|
-
|
|
313
|
-
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.3.0) (2023-12-22)
|
|
314
|
-
|
|
315
|
-
#### 🚀 Features
|
|
316
|
-
|
|
317
|
-
- update convert cmd ([d0275ce](https://github.com/thi-ng/umbrella/commit/d0275ce))
|
|
318
|
-
- add --eval option to convert from string arg
|
|
319
|
-
|
|
320
|
-
## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.2.0) (2023-12-21)
|
|
321
|
-
|
|
322
|
-
#### 🚀 Features
|
|
323
|
-
|
|
324
|
-
- update specs/format, simplify generate, update tests ([394ba09](https://github.com/thi-ng/umbrella/commit/394ba09))
|
|
325
|
-
- update specs format, add support for user data ([7e3ec01](https://github.com/thi-ng/umbrella/commit/7e3ec01))
|
|
326
|
-
|
|
327
|
-
### [0.1.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.1.1) (2023-12-18)
|
|
328
|
-
|
|
329
|
-
#### ♻️ Refactoring
|
|
330
|
-
|
|
331
|
-
- update export cmd args ([7a2feaf](https://github.com/thi-ng/umbrella/commit/7a2feaf))
|
|
332
|
-
|
|
333
|
-
## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.1.0) (2023-12-18)
|
|
334
|
-
|
|
335
|
-
#### 🚀 Features
|
|
336
|
-
|
|
337
|
-
- import as new pkg ([08628b3](https://github.com/thi-ng/umbrella/commit/08628b3))
|
|
338
|
-
- switch generated framework output to JSON, simplify ([8850cae](https://github.com/thi-ng/umbrella/commit/8850cae))
|
|
339
|
-
- merge media query refs from all inputs ([34047c9](https://github.com/thi-ng/umbrella/commit/34047c9))
|
|
340
|
-
- dedupe & merge all selectors & decls ([fd333c8](https://github.com/thi-ng/umbrella/commit/fd333c8))
|
|
341
|
-
- add input file watching ([717dbe1](https://github.com/thi-ng/umbrella/commit/717dbe1))
|
|
342
|
-
- add error handling for watch mode ([3b8dab9](https://github.com/thi-ng/umbrella/commit/3b8dab9))
|
|
343
|
-
- add support for line comments in .meta files ([a6273c8](https://github.com/thi-ng/umbrella/commit/a6273c8))
|
|
344
|
-
- add export cmd, update other cmds & arg handling ([f8b326a](https://github.com/thi-ng/umbrella/commit/f8b326a))
|
|
345
|
-
- add pretty printing for generate cmd ([2c27c9b](https://github.com/thi-ng/umbrella/commit/2c27c9b))
|
|
346
|
-
- add convert option to force include CSS classes ([9932e91](https://github.com/thi-ng/umbrella/commit/9932e91))
|
|
347
|
-
- update generate & convert cmds ([15daa6e](https://github.com/thi-ng/umbrella/commit/15daa6e))
|
|
348
|
-
- support reading force includes from file ([f92456b](https://github.com/thi-ng/umbrella/commit/f92456b))
|
|
349
|
-
- update convert cmd flag spec ([606a585](https://github.com/thi-ng/umbrella/commit/606a585))
|
|
350
|
-
|
|
351
|
-
#### 🩹 Bug fixes
|
|
352
|
-
|
|
353
|
-
- resolve out file path ([6e7f7dd](https://github.com/thi-ng/umbrella/commit/6e7f7dd))
|