@master/css 2.0.0-beta.133 → 2.0.0-beta.134

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.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- var v=Object.create;var x=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var I=(n,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of F(i))!$.call(n,o)&&o!==e&&x(n,o,{get:()=>i[o],enumerable:!(t=C(i,o))||t.enumerable});return n};var d=(n,i,e)=>(e=n!=null?v(W(n)):{},I(i||!n||!n.__esModule?x(e,"default",{value:n,enumerable:!0}):e,n));var c=require("commander"),h=d(require("path")),g=require("../utils/read-package"),f=d(require("chokidar")),a=d(require("fs")),j=require("../methods/define-content"),r=d(require("@techor/log"));c.program.command("init").description("Create a Master CSS definition file with configuration").allowUnknownOption().option("--jit","With initialization of the just-in-time program").option("-c, --compiler","With compiler options").option("-o, --override","Override the existing definition file").option("--ext <extension>","Definition extension `ts`, `js`, `mjs`").action(function(n){let{ext:i}=n;if(!i)if(a.default.existsSync("tsconfig.json"))i="ts";else{let{type:m}=(0,g.readPackage)();m==="module"?i="mjs":i="js"}let e=(0,j.defineContent)({...n,ext:i}),t=`master.css.${i}`,o=a.default.existsSync(h.default.join(process.cwd(),t));o?o&&n.override?(a.default.writeFileSync(t,e),r.default.ok`**${t}** definition file is overridden`):r.default.x`**${t}** definition file already exists`:(a.default.writeFileSync(t,e),r.default.ok`**${t}** definition file is created`)});c.program.command("build",{isDefault:!0}).allowUnknownOption().option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your master CSS file output path","master.css").action(async function({watch:n,output:i}){let e=await new(await import("@master/css-compiler")).default().compile(),t=l=>e.insert(l,a.default.readFileSync(l,{encoding:"utf-8"})),o=()=>a.default.writeFileSync(i,e.css.text),m=e.sources;if(console.log(""),r.default`[sources] ${m}`,n){let l=[],u=async()=>{let{include:s,exclude:k,sources:y}=e.options;s?.length&&S(f.default.watch(s,{ignored:k,ignoreInitial:!0})),y?.length&&S(f.default.watch(y,{ignoreInitial:!0})),o(),r.default.tree(e.options)},w=async s=>{t(s),o()},S=s=>{l.push(s.on("add",w).on("change",w))};await u(),console.log(""),r.default.t`Start watching source changes`,r.default.tree(e.options);let p=async()=>{await Promise.all(l.map(s=>s.close())),l.length=0,await e.refresh(),await u()};f.default.watch([e.resolvedConfigPath],{ignoreInitial:!0}).on("add",p).on("change",p).on("unlink",p)}else o()});var{version:O,name:P,description:b}=(0,g.readPackage)(h.default.join(__dirname,"../../package.json"));c.program.name(P);c.program.description(b);c.program.version(O);c.program.parse();
2
+ var v=Object.create;var y=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var O=(n,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of F(i))!$.call(n,o)&&o!==e&&y(n,o,{get:()=>i[o],enumerable:!(t=C(i,o))||t.enumerable});return n};var d=(n,i,e)=>(e=n!=null?v(W(n)):{},O(i||!n||!n.__esModule?y(e,"default",{value:n,enumerable:!0}):e,n));var c=require("commander"),x=d(require("path")),f=d(require("chokidar")),a=d(require("fs")),j=require("../methods/define-content"),r=d(require("@techor/log")),h=require("@techor/fs");c.program.command("init").description("Create a Master CSS definition file with configuration").allowUnknownOption().option("--jit","With initialization of the just-in-time program").option("-c, --compiler","With compiler options").option("-o, --override","Override the existing definition file").option("--ext <extension>","Definition extension `ts`, `js`, `mjs`").action(function(n){let{ext:i}=n;if(!i)if(a.default.existsSync("tsconfig.json"))i="ts";else{let{type:p}=(0,h.readFileAsJSON)("./package.json")||{};p==="module"?i="mjs":i="js"}let e=(0,j.defineContent)({...n,ext:i}),t=`master.css.${i}`,o=a.default.existsSync(x.default.join(process.cwd(),t));o?o&&n.override?(a.default.writeFileSync(t,e),r.default.ok`**${t}** definition file is overridden`):r.default.x`**${t}** definition file already exists`:(a.default.writeFileSync(t,e),r.default.ok`**${t}** definition file is created`)});c.program.command("build",{isDefault:!0}).allowUnknownOption().option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your master CSS file output path","master.css").action(async function({watch:n,output:i}){let e=await new(await import("@master/css-compiler")).default().compile(),t=l=>e.insert(l,a.default.readFileSync(l,{encoding:"utf-8"})),o=()=>a.default.writeFileSync(i,e.css.text),p=e.sources;if(console.log(""),r.default`[sources] ${p}`,n){let l=[],g=async()=>{let{include:s,exclude:k,sources:S}=e.options;s?.length&&w(f.default.watch(s,{ignored:k,ignoreInitial:!0})),S?.length&&w(f.default.watch(S,{ignoreInitial:!0})),o(),r.default.tree(e.options)},u=async s=>{t(s),o()},w=s=>{l.push(s.on("add",u).on("change",u))};await g(),console.log(""),r.default.t`Start watching source changes`,r.default.tree(e.options);let m=async()=>{await Promise.all(l.map(s=>s.close())),l.length=0,await e.refresh(),await g()};f.default.watch([e.resolvedConfigPath],{ignoreInitial:!0}).on("add",m).on("change",m).on("unlink",m)}else o()});var{version:I,name:b,description:D}=(0,h.readFileAsJSON)("../../../package.json",{cwd:__dirname})||{};c.program.name(b);c.program.description(D);c.program.version(I);c.program.parse();
@@ -1 +1 @@
1
- var b=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var O=(e,t)=>{for(var r in t)b(e,r,{get:t[r],enumerable:!0})},A=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of I(t))!T.call(e,s)&&s!==r&&b(e,s,{get:()=>t[s],enumerable:!(o=R(t,s))||o.enumerable});return e};var z=e=>A(b({},"__esModule",{value:!0}),e);var j={};O(j,{rules:()=>D});module.exports=z(j);var x=require("../constants/start-symbol"),g=require("../constants/box-underneath"),f=require("../constants/content-extrema"),h=require("../constants/sizing-values"),C=require("../utils/css-escape"),N={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},r=(i,a)=>{let n=a.indexOf(":");if(n!==-1){i in t||(t[i]={});let d=t[i],v=a.slice(0,n);v in d||(d[v]=a.slice(n+1))}},o=i=>{let a=(n,d)=>{let v=d.slice((0,C.cssEscape)(i.className).length).match(/\{(.*)\}/)[1].split(";");for(let S of v)r(n,S)};if(this.theme){let n=i.natives.find(d=>d.theme===this.theme)??i.natives.find(d=>!d.theme);n&&a(this.theme,n.text)}else for(let n of i.natives)a(n.theme,n.text)},s=[],l="",c=()=>{l&&(s.push(l.replace(/ /g,"")),l="")},m=1;(function i(a){for(;m<e.length;m++){let n=e[m];if(!a){if(n===";"){c();continue}if(n==="}")break}if(l+=n,a===n){if(a==="'"||a==='"'){let d=0;for(let v=l.length-2;l[v]==="\\";v--)d++;if(d%2)continue}break}else n in x.START_SYMBOL&&a!=="'"&&a!=='"'&&(m++,i(x.START_SYMBOL[n]))}})(void 0),c();for(let i of s){let a=this.css.create(i);if(Array.isArray(a))for(let n of a)o(n);else a?o(a):r(this.theme??"",i)}let u={};for(let i in t)for(let[a,n]of Object.entries(t[i]))a in u?u[a][i]=n:u[a]={[i]:n};return u}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return w.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return w.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:h.SIZING_VALUES,unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:h.SIZING_VALUES},height:{match:"^h:.",unit:"rem",native:!0,values:h.SIZING_VALUES},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:h.SIZING_VALUES},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:h.SIZING_VALUES},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:h.SIZING_VALUES},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:h.SIZING_VALUES},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{...g.BOX_UNDERNEATH,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return y.call(this,e)},delete(e){return k.call(this,e)},insert(){return $.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return y.call(this,e)},delete(e){return k.call(this,e)},insert(){return $.call(this)}},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return p(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let o="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)o+=s[l][0];else o=this.prefix.slice(1,-1);switch(o){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return p(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return p(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return p(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:g.BOX_UNDERNEATH},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:g.BOX_UNDERNEATH},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:f.CONTENT_EXTREMA},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:f.CONTENT_EXTREMA,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:f.CONTENT_EXTREMA},gridTemplateRows:{native:!0,unit:"rem",values:f.CONTENT_EXTREMA},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{...g.BOX_UNDERNEATH,margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{...g.BOX_UNDERNEATH,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},D=N;function y(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(r=>r in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function k(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let r=this.css.keyframes[t];if(!--r.count){let o=e.natives.indexOf(r.native);this.css.style.sheet.deleteRule(o),e.natives.splice(o,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function $(){if(this.keyframeNames){let{config:e,keyframes:t,style:r,rules:o}=this.css,s=r?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let c={text:`@keyframes ${l} {`+Object.entries(e.keyframes[l]).map(([u,i])=>`${u} {${Object.entries(i).map(([a,n])=>a+": "+n).join(";")}}`).join(",")+"}",theme:""},m;if(Object.keys(t).length?(m=o[0]).natives.push(c):o.splice(0,0,m={natives:[c],get text(){return this.natives.map(u=>u.text).join("")}}),s){let u;for(let i=0;i<s.cssRules.length;i++){let a=s.cssRules[i];if(a.constructor.name!=="CSSKeyframesRule")break;if(a.name===l){u=a;break}}if(u)c.cssRule=u;else{let i=m.natives.length-1;s.insertRule(c.text,i),c.cssRule=s.cssRules[i]}}t[l]={native:c,count:1}}}}function w(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",o=r+"-left",s=r+"-right",l=r+"-top",c=r+"-bottom";switch(this.prefix[1]){case"x":return{[o]:e,[s]:e};case"y":return{[l]:e,[c]:e};case"l":return{[o]:e};case"r":return{[s]:e};case"t":return{[l]:e};case"b":return{[c]:e};default:return{[r]:e}}}function p(e,t,r=""){let o="border-";r&&(r="-"+r);let s=/^b(order)?-?(.)?/.exec(e)[2],l=o+"left"+r,c=o+"right"+r,m=o+"top"+r,u=o+"bottom"+r;switch(s){case"x":return{[l]:t,[c]:t};case"y":return{[m]:t,[u]:t};case"l":return{[l]:t};case"r":return{[c]:t};case"t":return{[m]:t};case"b":return{[u]:t};default:return{["border"+r]:t}}}0&&(module.exports={rules});
1
+ var b=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var O=(e,t)=>{for(var r in t)b(e,r,{get:t[r],enumerable:!0})},A=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of I(t))!T.call(e,s)&&s!==r&&b(e,s,{get:()=>t[s],enumerable:!(o=R(t,s))||o.enumerable});return e};var z=e=>A(b({},"__esModule",{value:!0}),e);var j={};O(j,{rules:()=>D});module.exports=z(j);var x=require("../constants/start-symbol"),v=require("../constants/box-underneath"),f=require("../constants/content-extrema"),h=require("../constants/sizing-values"),C=require("../utils/css-escape"),N={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},r=(i,a)=>{let n=a.indexOf(":");if(n!==-1){i in t||(t[i]={});let d=t[i],g=a.slice(0,n);g in d||(d[g]=a.slice(n+1))}},o=i=>{let a=(n,d)=>{let g=d.slice((0,C.cssEscape)(i.className).length).match(/\{(.*)\}/)[1].split(";");for(let S of g)r(n,S)};if(this.theme){let n=i.natives.find(d=>d.theme===this.theme)??i.natives.find(d=>!d.theme);n&&a(this.theme,n.text)}else for(let n of i.natives)a(n.theme,n.text)},s=[],l="",c=()=>{l&&(s.push(l.replace(/ /g,"")),l="")},m=1;(function i(a){for(;m<e.length;m++){let n=e[m];if(!a){if(n===";"){c();continue}if(n==="}")break}if(l+=n,a===n){if(a==="'"||a==='"'){let d=0;for(let g=l.length-2;l[g]==="\\";g--)d++;if(d%2)continue}break}else n in x.START_SYMBOL&&a!=="'"&&a!=='"'&&(m++,i(x.START_SYMBOL[n]))}})(void 0),c();for(let i of s){let a=this.css.create(i);if(Array.isArray(a))for(let n of a)o(n);else a?o(a):r(this.theme??"",i)}let u={};for(let i in t)for(let[a,n]of Object.entries(t[i]))a in u?u[a][i]=n:u[a]={[i]:n};return u}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return w.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return w.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:h.SIZING_VALUES,unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:h.SIZING_VALUES},height:{match:"^h:.",unit:"rem",native:!0,values:h.SIZING_VALUES},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:h.SIZING_VALUES},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:h.SIZING_VALUES},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:h.SIZING_VALUES},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:h.SIZING_VALUES},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{...v.BOX_UNDERNEATH,fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return y.call(this,e)},delete(e){return k.call(this,e)},insert(){return $.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return y.call(this,e)},delete(e){return k.call(this,e)},insert(){return $.call(this)}},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return p(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let o="",s=this.prefix.split("-");if(s.length>1)for(let l=1;l<s.length-1;l++)o+=s[l][0];else o=this.prefix.slice(1,-1);switch(o){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return p(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return p(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return p(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:v.BOX_UNDERNEATH},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v.BOX_UNDERNEATH},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:f.CONTENT_EXTREMA},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:f.CONTENT_EXTREMA,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:f.CONTENT_EXTREMA},gridTemplateRows:{native:!0,unit:"rem",values:f.CONTENT_EXTREMA},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{...v.BOX_UNDERNEATH,margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{...v.BOX_UNDERNEATH,margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},D=N;function y(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(r=>r in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function k(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let r=this.css.keyframes[t];if(!--r.count){let o=e.natives.indexOf(r.native);this.css.style.sheet.deleteRule(o),e.natives.splice(o,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function $(){if(this.keyframeNames){let{config:e,keyframes:t,style:r,rules:o}=this.css,s=r?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let c={text:`@keyframes ${l} {`+Object.entries(e.keyframes[l]).map(([u,i])=>`${u} {${Object.entries(i).map(([a,n])=>a+": "+n).join(";")}}`).join(",")+"}",theme:""},m;if(Object.keys(t).length?(m=o[0]).natives.push(c):o.splice(0,0,m={natives:[c],get text(){return this.natives.map(u=>u.text).join("")}}),s){let u;for(let i=0;i<s.cssRules.length;i++){let a=s.cssRules[i];if(a.constructor.name!=="CSSKeyframesRule")break;if(a.name===l){u=a;break}}if(u)c.cssRule=u;else{let i=m.natives.length-1;s.insertRule(c.text,i),c.cssRule=s.cssRules[i]}}t[l]={native:c,count:1}}}}function w(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",o=r+"-left",s=r+"-right",l=r+"-top",c=r+"-bottom";switch(this.prefix[1]){case"x":return{[o]:e,[s]:e};case"y":return{[l]:e,[c]:e};case"l":return{[o]:e};case"r":return{[s]:e};case"t":return{[l]:e};case"b":return{[c]:e};default:return{[r]:e}}}function p(e,t,r=""){let o="border-";r&&(r="-"+r);let s=/^b(order)?-?(.)?/.exec(e)[2],l=o+"left"+r,c=o+"right"+r,m=o+"top"+r,u=o+"bottom"+r;switch(s){case"x":return{[l]:t,[c]:t};case"y":return{[m]:t,[u]:t};case"l":return{[l]:t};case"r":return{[c]:t};case"t":return{[m]:t};case"b":return{[u]:t};default:return{["border"+r]:t}}}0&&(module.exports={rules});
package/dist/cjs/css.js CHANGED
@@ -1 +1 @@
1
- var T=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var P=(g,e,t)=>e in g?T(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var U=(g,e)=>{for(var t in e)T(g,t,{get:e[t],enumerable:!0})},Y=(g,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of q(e))!Z.call(g,l)&&l!==t&&T(g,l,{get:()=>e[l],enumerable:!(s=_(e,l))||s.enumerable});return g};var G=g=>Y(T({},"__esModule",{value:!0}),g);var S=(g,e,t)=>(P(g,typeof e!="symbol"?e+"":e,t),t);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function F(g){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&g instanceof e||g instanceof Date||g instanceof RegExp)}function I(g){if(typeof Buffer<"u"&&Buffer&&g instanceof Buffer){let e=Buffer.alloc(g.length);return g.copy(e),e}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function $(g){let e=[];return g.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=$(t):F(t)?e[s]=I(t):e[s]=j({},t):e[s]=t}),e}function L(g,e){return e==="__proto__"?void 0:g[e]}function j(...g){let e={},t,s;return g.forEach(function(l){typeof l!="object"||l===null||Array.isArray(l)||Object.keys(l).forEach(function(b){if(s=L(e,b),t=L(l,b),t!==e)if(typeof t!="object"||t===null){e[b]=t;return}else if(Array.isArray(t)){e[b]=$(t);return}else if(F(t)){e[b]=I(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[b]=j({},t);return}else{e[b]=j(s,t);return}})}),e}var D=require("./rule"),O=require("./config"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var N=typeof window<"u",V=()=>{let g=document.createElement("style");return g.id="master",g.setAttribute("blocking","render"),g},A=class{constructor(e){this.config=e;this.config?.override||(this.config=j(O.config,e)),this.cache(),N&&this.config.observe&&this.observe(document),A.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer=N?new MutationObserver(e=>{let t={},s=[],l=[],b=[],C=(h,i)=>{i?h.classList.forEach(v):h.classList.forEach(p);let c=h.children;for(let u=0;u<c.length;u++){let d=c[u];d.classList&&(l.push(d),C(d,i))}},p=h=>{h in t?t[h]++:t[h]=1},v=h=>{h in t?t[h]--:h in this.countBy&&(t[h]=-1)},k=(h,i)=>{for(let c=0;c<h.length;c++){let u=h[c];u.classList&&!l.includes(u)&&!b.includes(u)&&(u.isConnected!==i?(l.push(u),C(u,i)):b.push(u))}};for(let h=0;h<e.length;h++){let i=e[h],{addedNodes:c,removedNodes:u,type:d,target:f}=i;if(d==="attributes"){if(s.find(w=>w.target===f))continue;s.push(i)}else k(c,!1),(!f.isConnected||!l.includes(f))&&k(u,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:h,target:i}of s){let c=l.includes(i),u=i.classList,d=h?h.split(" "):[];if(c){if(i.isConnected)continue;for(let f of d)u.contains(f)||v(f)}else if(i.isConnected){u.forEach(f=>{d.includes(f)||p(f)});for(let f of d)u.contains(f)||v(f)}}for(let h in t){let i=t[h],c=(this.countBy[h]||0)+i;c===0?(delete this.countBy[h],this.delete(h)):(h in this.countBy||this.insert(h),this.countBy[h]=c)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:t,selectors:s,themes:l,colors:b,values:C,breakpoints:p,mediaQueries:v,rules:k}=this.config;function h(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(n,o,r="",m={}){let a=x=>x?(r?r+"-":"")+x:r,y=Object.entries(n),R=[],B=[];for(let x of y){let E=x[1];(typeof E=="object"&&!Array.isArray(E)?R:B).push(x)}for(let[x,E]of R)i(E,o,a(x),m);if(o&&r)B.length&&(m[r]=B.reduce((x,[E,z])=>(x[E]=z,x),{}));else for(let[x,E]of B)m[a(x)]=E;return m}if(e)for(let[n,o]of Object.entries(i(e,!0)))this.semantics.push([new RegExp("^"+h(n)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[n,o]]);if(s)for(let[n,o]of Object.entries(i(s,!1))){let r=new RegExp(h(n)+"(?![a-z-])");for(let m of Array.isArray(o)?o:[o]){let a=m.match(/^::-[a-z]+-/m)?.[0]??"",y=this.selectors[a];y||(y=this.selectors[a]=[]);let R=y.find(([B])=>B===r);R||(R=[r,[]],y.push(R)),R[1].push(m)}}C&&(this.globalValues=i(C,!1)),p&&(this.breakpoints=i(p,!1)),v&&(this.mediaQueries=i(v,!1));let c=t?i(t,!1):{},u=l&&!Array.isArray(l)?Object.entries(l).filter(([,{classes:n}])=>n).reduce((n,[o,{classes:r}])=>(n[o]=i(r,!1),n),{}):{},d=[...Object.keys(c),...Object.entries(u).flatMap(([n,o])=>Object.keys(o))],f=n=>{if(n in this.classes)return;let o=this.classes[n]=[],r=(m,a)=>{if(!a)return;let y=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let R of y){let B=x=>{x in this.themeAffectedClassesBy?m in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][m].push(n):this.themeAffectedClassesBy[x][m]=[n]:this.themeAffectedClassesBy[x]={[m]:[n]},o.includes(x)||o.push(x)};if(d.includes(R)){f(R);for(let x of this.classes[R])B(x)}else B(R)}};r("",c?.[n]);for(let[m,a]of Object.entries(u))r(m,a?.[n])};for(let n of d)f(n);for(let n in this.themeAffectedClassesBy){let o=this.classesBy[n]=[];for(let r of Object.values(this.themeAffectedClassesBy[n]))for(let m of r)o.includes(m)||o.push(m)}let w=(n,o)=>{if(!o)return;let r=i(o,!0);for(let[m,a]of Object.entries(r)){let y=typeof a=="string"?{"":a}:a;for(let[R,B]of Object.entries(y)){let x=m+(R?"-"+R:"");x in this.colorThemesMap?this.colorThemesMap[x][n]=B:this.colorThemesMap[x]={[n]:B}}}for(let m in o)this.colorNames.includes(m)||this.colorNames.push(m)};if(w("",b),l)if(Array.isArray(l))this.themeNames.push(...l);else for(let n in l){let o=l[n];w(n,o.colors),this.themeNames.push(n)}let M=n=>{for(let[o,r]of Object.entries(this.colorThemesMap))for(let[m,a]of Object.entries(r))a.startsWith("#")||n(o,r,m,a)};if(M((n,o,r,m)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(m);if(a){let y="#"+(0,H.rgbToHex)(+a[1],+a[2],+a[3]);a[4]&&(y+=Math.round(255*+a[4]).toString(16)),o[r]=y}}),M((n,o,r,m)=>{let[a,y]=m.split("/"),R=this.colorThemesMap[a];if(R){let B=(r?R[r]:void 0)??R[""];o[r]=y?B.slice(0,7)+Math.round(255*+y).toString(16):B}else console.warn(`\`${m}\` doesn't exist in the extended config \`.colors\``),delete o[r],Object.keys(o).length||delete this.colorThemesMap[n]}),k)for(let n in k){let o=k[n],{native:r,values:m,colored:a}=o,y=o.match;if(o.id=n,o.native=r===!0?n.replace(/(?!^)[A-Z]/g,R=>"-"+R).toLowerCase():void 0,m&&(this.values[n]=i(m,!1)),y){let R=Object.keys(this.values[n]??{});y.includes("$values")&&(y=R.length?y.replace(/\$values/,R.join("|")):y.replace(/(?:\|)?\$values/,"")),a&&y.includes("$colors")&&(y=this.colorNames.length?y.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):y.replace(/(?:\|)?\$colors/,"")),this.matches[n]=new RegExp(y)}}}observe(e,t={subtree:!0,childList:!0}){if(this.root!==e){if(N&&e){this.root=e;let s=e===document;s&&(A.root=this),this.host=s?document.documentElement:root.host;let l=s?document.head:e,b=s?document.styleSheets:e.styleSheets;for(let p of b){let{href:v,ownerNode:k}=p;(k.id==="master"||v&&v.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(v))&&(this.style=k)}if(this.style)for(let p=0;p<this.style.sheet.cssRules.length;p++){let v=this.style.sheet.cssRules[p];if(v.constructor.name==="CSSKeyframesRule")continue;let k=i=>{if(i.selectorText){let u=i.selectorText.split(", ")[0].split(" ");for(let d=0;d<u.length;d++){let f=u[d];if(f[0]==="."){let w=f.slice(1),M="";for(let n=0;n<w.length;n++){let o=w[n],r=w[n+1];if(o==="\\"){if(n++,r!=="\\"){M+=r;continue}}else if(Q.SELECTOR_SYMBOLS.includes(o))break;M+=o}if(!(M in this.ruleBy)&&!(M in this.classes)){let n=this.create(M)[0];if(n)return n}}}}else if(i.cssRules)for(let c=0;c<i.cssRules.length;c++){let u=k(i.cssRules[c]);if(u)return u}},h=k(v);if(h){this.rules.push(h),this.ruleBy[h.className]=h;for(let i=0;i<h.natives.length;i++)h.natives[i].cssRule=this.style.sheet.cssRules[p+i];p+=h.natives.length-1,h.config.insert?.call(h)}}else switch(this.style=V(),this.config.precedence){case"highest":console.log(s?document.body:e),(s?document.body:e).append(this.style);break;case"higher":l.append(this.style);break;default:let p=l.querySelector('link[rel="styleSheet"], style');p?p.before(this.style):l.append(this.style);break}let C=p=>{p.forEach(v=>{v in this.countBy?this.countBy[v]++:(this.countBy[v]=1,this.insert(v))})};C(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(p=>C(p.classList)),this.observer.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer?.disconnect?.(),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style?.remove(),this.style=null,this.root=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],l=this.matches[t],{symbol:b,native:C}=s;if(l&&l.test(e))return{origin:"match",config:s};if(b&&e.startsWith(b))return{origin:"symbol",config:s};if(C&&e.startsWith(C+":"))return{origin:"match",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleBy)return this.ruleBy[s];let l=this.match(s);if(l)return new D.Rule(s,l,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=j(O.config,e),this.cache(),!this.style)return;let t=V();this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleBy={};for(let s in this.countBy)this.insert(s)}destroy(){let e=A.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style?.sheet,s=l=>{let b=this.ruleBy[l];if(!(!b||l in this.classesBy&&this.classesBy[l].some(C=>C in this.countBy))){if(t&&b.natives.length){let C=b.natives[0];for(let p=0;p<t.cssRules.length;p++)if(t.cssRules[p]===C.cssRule){for(let k=0;k<b.natives.length;k++)t.deleteRule(p);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[l],b.config.delete&&b.config.delete.call(b,l)}};if(e in this.classes){for(let l of this.classes[e])l in this.countBy||s(l);delete this.ruleBy[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleBy[t.className])continue;let s,l=this.rules.length-1,{media:b,order:C,priority:p,hasWhere:v,className:k}=t,h=(i,c,u,d)=>{let f=0,w;c&&(f=i.findIndex(c)),u&&(w=i.findIndex(u)),f===-1&&(f=i.length),(w===void 0||w===-1)&&(w=i.length);let M=i.slice(f,w);for(let n=0;n<M.length;n++){let o=M[n];if(!(o.priority===-1||d&&d(o))&&(o.priority<p||o.priority===p&&(v&&!o.hasWhere||o.order>=C)))return f+n}return f+M.length};if(b){let i=this.rules.findIndex(c=>c.media);if(i!==-1){let c=b.features["max-width"],u=b.features["min-width"];if(c&&u){let d=c.value-u.value;for(let f=l;f>=i;f--){s=f;let w=this.rules[f],M=w.media,n=M.features["max-width"],o=M.features["min-width"];if(!n||!o){s++;break}let r=n.value-o.value;if(r===d){if(v!==w.hasWhere)continue;if(p!==-1){let m=[this.rules[f]];for(let a=f-1;a>=i;a--){let y=this.rules[a];if(y.hasWhere!==v)break;let R=y.media,B=R.features["max-width"],x=R.features["min-width"];if(!B||!x||B.value-x.value!==r)break;m.unshift(this.rules[a])}s=h(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(r>d)break}}else if(u)for(let d=i;d<=l;d++){s=d;let f=this.rules[d],w=f.media,M=w.features["max-width"],n=w.features["min-width"];if(M){if(n)break;continue}let o=n?.value;if(o===u.value){if(!v&&f.hasWhere){s++;continue}if(p!==-1)s=h(this.rules,r=>r.media,r=>r.media&&r.priority!==-1&&r.media.features["min-width"]&&r.media.features["max-width"],r=>!r.media.features["min-width"]&&!r.media.features["max-width"]);else for(let r=d;r<=l;r++){let m=this.rules[r],a=m.media,y=a.features["min-width"];if(!a.features["max-width"]){if(m.hasWhere!==v||y.value!==o||m.order>=C)break;s=r+1}}break}else{if(o>u.value)break;s++}}else if(c)for(let d=l;d>=i;d--){s=d;let f=this.rules[d],w=f.media,M=w.features["max-width"];if(w.features["min-width"])continue;let o=M?.value;if(!o||o>c.value){s++;break}else if(o===c.value){if(v&&!f.hasWhere)continue;if(p!==-1)s=h(this.rules,r=>r.media,r=>r.media&&r.priority!==-1&&r.media.features["min-width"]&&r.media.features["max-width"],r=>!r.media.features["min-width"]&&!r.media.features["max-width"]);else{let r=[this.rules[d]];for(let m=d-1;m>=i;m--){let a=this.rules[m],y=a.media,R=y.features["min-width"],B=y.features["max-width"];if(!R&&(!B||B.value!==o||a.hasWhere!==v))break;r.unshift(a)}for(let m=0;m<r.length;m++){let a=r[m];if(!a.media.features["min-width"]){if(a.order>=C)break;s=d-r.length+2+m}}}break}}}if(s===void 0)if(i===-1)s=l+1;else if(p!==-1)s=i+h(this.rules.slice(i),void 0,c=>c.media.features["max-width"]||c.media.features["min-width"]);else if(v){let c=i;for(;c<this.rules.length;c++){let u=this.rules[c];if(u.priority!==-1||!u.hasWhere||u.order>=C){s=c;break}}s===void 0&&(s=c)}else for(let c=i;c<=l;c++){s=c;let u=this.rules[c],d=u.media;if(u.priority!==-1||d.features["max-width"]||d.features["min-width"])break;if(u.hasWhere)s++;else if(u.order>=C)break}}else if(p===-1){if(v)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=C),s===-1&&(s=l+1);else{let i=0;for(;i<this.rules.length;i++){let c=this.rules[i];if(c.media||!c.hasWhere&&(c.order>=C||c.priority!==-1)){s=i;break}}s===void 0&&(s=i)}!s&&Object.keys(this.keyframes).length&&s++}else s=h(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,t),this.ruleBy[k]=t,this.style){let i=this.style.sheet,c=0,u=d=>{let f=this.rules[d];if(f){if(!f.natives.length)return u(d-1);let w=f.natives[f.natives.length-1].cssRule;for(let M=0;M<i.cssRules.length;M++)if(i.cssRules[M]===w){c=M+1;break}}};u(s-1);for(let d=0;d<t.natives.length;)try{let f=t.natives[d];i.insertRule(f.text,c),f.cssRule=i.cssRules[c++],d++}catch(f){console.error(f),t.natives.splice(d,1)}}t.config.insert?.call(t)}}get text(){return this.rules.map(e=>e.text).join("")}},W=A;S(W,"root"),S(W,"config",O.config),S(W,"instances",[]),S(W,"refresh",e=>{for(let t of A.instances)t.refresh(e)});N&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
1
+ var T=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var P=(g,e,t)=>e in g?T(g,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):g[e]=t;var U=(g,e)=>{for(var t in e)T(g,t,{get:e[t],enumerable:!0})},Y=(g,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of q(e))!Z.call(g,l)&&l!==t&&T(g,l,{get:()=>e[l],enumerable:!(s=_(e,l))||s.enumerable});return g};var G=g=>Y(T({},"__esModule",{value:!0}),g);var S=(g,e,t)=>(P(g,typeof e!="symbol"?e+"":e,t),t);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function F(g){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&g instanceof e||g instanceof Date||g instanceof RegExp)}function I(g){if(typeof Buffer<"u"&&Buffer&&g instanceof Buffer){let e=Buffer.alloc(g.length);return g.copy(e),e}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function $(g){let e=[];return g.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=$(t):F(t)?e[s]=I(t):e[s]=j({},t):e[s]=t}),e}function L(g,e){return e==="__proto__"?void 0:g[e]}function j(...g){let e={},t,s;return g.forEach(function(l){typeof l!="object"||l===null||Array.isArray(l)||Object.keys(l).forEach(function(b){if(s=L(e,b),t=L(l,b),t!==e)if(typeof t!="object"||t===null){e[b]=t;return}else if(Array.isArray(t)){e[b]=$(t);return}else if(F(t)){e[b]=I(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[b]=j({},t);return}else{e[b]=j(s,t);return}})}),e}var D=require("./rule"),O=require("./config"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var N=typeof window<"u",V=()=>{let g=document.createElement("style");return g.id="master",g.setAttribute("blocking","render"),g},A=class{constructor(e){this.config=e;this.config?.override||(this.config=j(O.config,e)),this.cache(),N&&this.config.observe&&this.observe(document),A.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer=N?new MutationObserver(e=>{let t={},s=[],l=[],b=[],C=(h,i)=>{i?h.classList.forEach(v):h.classList.forEach(p);let c=h.children;for(let u=0;u<c.length;u++){let d=c[u];d.classList&&(l.push(d),C(d,i))}},p=h=>{h in t?t[h]++:t[h]=1},v=h=>{h in t?t[h]--:h in this.countBy&&(t[h]=-1)},k=(h,i)=>{for(let c=0;c<h.length;c++){let u=h[c];u.classList&&!l.includes(u)&&!b.includes(u)&&(u.isConnected!==i?(l.push(u),C(u,i)):b.push(u))}};for(let h=0;h<e.length;h++){let i=e[h],{addedNodes:c,removedNodes:u,type:d,target:f}=i;if(d==="attributes"){if(s.find(w=>w.target===f))continue;s.push(i)}else k(c,!1),(!f.isConnected||!l.includes(f))&&k(u,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:h,target:i}of s){let c=l.includes(i),u=i.classList,d=h?h.split(" "):[];if(c){if(i.isConnected)continue;for(let f of d)u.contains(f)||v(f)}else if(i.isConnected){u.forEach(f=>{d.includes(f)||p(f)});for(let f of d)u.contains(f)||v(f)}}for(let h in t){let i=t[h],c=(this.countBy[h]||0)+i;c===0?(delete this.countBy[h],this.delete(h)):(h in this.countBy||this.insert(h),this.countBy[h]=c)}}}):null;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:t,selectors:s,themes:l,colors:b,values:C,breakpoints:p,mediaQueries:v,rules:k}=this.config;function h(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(n,o,r="",m={}){let a=x=>x?(r?r+"-":"")+x:r,y=Object.entries(n),R=[],B=[];for(let x of y){let E=x[1];(typeof E=="object"&&!Array.isArray(E)?R:B).push(x)}for(let[x,E]of R)i(E,o,a(x),m);if(o&&r)B.length&&(m[r]=B.reduce((x,[E,z])=>(x[E]=z,x),{}));else for(let[x,E]of B)m[a(x)]=E;return m}if(e)for(let[n,o]of Object.entries(i(e,!0)))this.semantics.push([new RegExp("^"+h(n)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[n,o]]);if(s)for(let[n,o]of Object.entries(i(s,!1))){let r=new RegExp(h(n)+"(?![a-z-])");for(let m of Array.isArray(o)?o:[o]){let a=m.match(/^::-[a-z]+-/m)?.[0]??"",y=this.selectors[a];y||(y=this.selectors[a]=[]);let R=y.find(([B])=>B===r);R||(R=[r,[]],y.push(R)),R[1].push(m)}}C&&(this.globalValues=i(C,!1)),p&&(this.breakpoints=i(p,!1)),v&&(this.mediaQueries=i(v,!1));let c=t?i(t,!1):{},u=l&&!Array.isArray(l)?Object.entries(l).filter(([,{classes:n}])=>n).reduce((n,[o,{classes:r}])=>(n[o]=i(r,!1),n),{}):{},d=[...Object.keys(c),...Object.entries(u).flatMap(([n,o])=>Object.keys(o))],f=n=>{if(n in this.classes)return;let o=this.classes[n]=[],r=(m,a)=>{if(!a)return;let y=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let R of y){let B=x=>{x in this.themeAffectedClassesBy?m in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][m].push(n):this.themeAffectedClassesBy[x][m]=[n]:this.themeAffectedClassesBy[x]={[m]:[n]},o.includes(x)||o.push(x)};if(d.includes(R)){f(R);for(let x of this.classes[R])B(x)}else B(R)}};r("",c?.[n]);for(let[m,a]of Object.entries(u))r(m,a?.[n])};for(let n of d)f(n);for(let n in this.themeAffectedClassesBy){let o=this.classesBy[n]=[];for(let r of Object.values(this.themeAffectedClassesBy[n]))for(let m of r)o.includes(m)||o.push(m)}let w=(n,o)=>{if(!o)return;let r=i(o,!0);for(let[m,a]of Object.entries(r)){let y=typeof a=="string"?{"":a}:a;for(let[R,B]of Object.entries(y)){let x=m+(R?"-"+R:"");x in this.colorThemesMap?this.colorThemesMap[x][n]=B:this.colorThemesMap[x]={[n]:B}}}for(let m in o)this.colorNames.includes(m)||this.colorNames.push(m)};if(w("",b),l)if(Array.isArray(l))this.themeNames.push(...l);else for(let n in l){let o=l[n];w(n,o.colors),this.themeNames.push(n)}let M=n=>{for(let[o,r]of Object.entries(this.colorThemesMap))for(let[m,a]of Object.entries(r))a.startsWith("#")||n(o,r,m,a)};if(M((n,o,r,m)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(m);if(a){let y="#"+(0,H.rgbToHex)(+a[1],+a[2],+a[3]);a[4]&&(y+=Math.round(255*+a[4]).toString(16)),o[r]=y}}),M((n,o,r,m)=>{let[a,y]=m.split("/"),R=this.colorThemesMap[a];if(R){let B=(r?R[r]:void 0)??R[""];o[r]=y?B.slice(0,7)+Math.round(255*+y).toString(16):B}else console.warn(`\`${m}\` doesn't exist in the extended config \`.colors\``),delete o[r],Object.keys(o).length||delete this.colorThemesMap[n]}),k)for(let n in k){let o=k[n],{native:r,values:m,colored:a}=o,y=o.match;if(o.id=n,o.native=r===!0?n.replace(/(?!^)[A-Z]/g,R=>"-"+R).toLowerCase():void 0,m&&(this.values[n]=i(m,!1)),y){let R=Object.keys(this.values[n]??{});y.includes("$values")&&(y=R.length?y.replace(/\$values/,R.join("|")):y.replace(/(?:\|)?\$values/,"")),a&&y.includes("$colors")&&(y=this.colorNames.length?y.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):y.replace(/(?:\|)?\$colors/,"")),this.matches[n]=new RegExp(y)}}}observe(e,t={subtree:!0,childList:!0}){if(this.root!==e){if(N&&e){this.root=e;let s=e===document;s&&(A.root=this),this.host=s?document.documentElement:root.host;let l=s?document.head:e,b=s?document.styleSheets:e.styleSheets;for(let p of b){let{href:v,ownerNode:k}=p;(k.id==="master"||v&&v.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(v))&&(this.style=k)}if(this.style)for(let p=0;p<this.style.sheet.cssRules.length;p++){let v=this.style.sheet.cssRules[p];if(v.constructor.name==="CSSKeyframesRule")continue;let k=i=>{if(i.selectorText){let u=i.selectorText.split(", ")[0].split(" ");for(let d=0;d<u.length;d++){let f=u[d];if(f[0]==="."){let w=f.slice(1),M="";for(let n=0;n<w.length;n++){let o=w[n],r=w[n+1];if(o==="\\"){if(n++,r!=="\\"){M+=r;continue}}else if(Q.SELECTOR_SYMBOLS.includes(o))break;M+=o}if(!(M in this.ruleBy)&&!(M in this.classes)){let n=this.create(M)[0];if(n)return n}}}}else if(i.cssRules)for(let c=0;c<i.cssRules.length;c++){let u=k(i.cssRules[c]);if(u)return u}},h=k(v);if(h){this.rules.push(h),this.ruleBy[h.className]=h;for(let i=0;i<h.natives.length;i++)h.natives[i].cssRule=this.style.sheet.cssRules[p+i];p+=h.natives.length-1,h.config.insert?.call(h)}}else switch(this.style=V(),this.config.precedence){case"highest":(s?document.body:e).append(this.style);break;case"higher":l.append(this.style);break;default:let p=l.querySelector('link[rel="styleSheet"], style');p?p.before(this.style):l.append(this.style);break}let C=p=>{p.forEach(v=>{v in this.countBy?this.countBy[v]++:(this.countBy[v]=1,this.insert(v))})};C(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(p=>C(p.classList)),this.observer.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer?.disconnect?.(),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style?.remove(),this.style=null,this.root=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],l=this.matches[t],{symbol:b,native:C}=s;if(l&&l.test(e))return{origin:"match",config:s};if(b&&e.startsWith(b))return{origin:"symbol",config:s};if(C&&e.startsWith(C+":"))return{origin:"match",config:s}}for(let t of this.semantics)if(e.match(t[0]))return{origin:"semantics",value:t[1]}}create(e){let t=s=>{if(s in this.ruleBy)return this.ruleBy[s];let l=this.match(s);if(l)return new D.Rule(s,l,this)};return(e in this.classes?this.classes[e].map(s=>t(s)):[t(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=j(O.config,e),this.cache(),!this.style)return;let t=V();this.style.replaceWith(t),this.style=t,this.rules.length=0,this.ruleBy={};for(let s in this.countBy)this.insert(s)}destroy(){let e=A.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let t=this.style?.sheet,s=l=>{let b=this.ruleBy[l];if(!(!b||l in this.classesBy&&this.classesBy[l].some(C=>C in this.countBy))){if(t&&b.natives.length){let C=b.natives[0];for(let p=0;p<t.cssRules.length;p++)if(t.cssRules[p]===C.cssRule){for(let k=0;k<b.natives.length;k++)t.deleteRule(p);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[l],b.config.delete&&b.config.delete.call(b,l)}};if(e in this.classes){for(let l of this.classes[e])l in this.countBy||s(l);delete this.ruleBy[e]}else s(e)}insert(e){let t=this.create(e);return t.length?(this.insertRules(t),!0):!1}insertRules(e){for(let t of e){if(this.ruleBy[t.className])continue;let s,l=this.rules.length-1,{media:b,order:C,priority:p,hasWhere:v,className:k}=t,h=(i,c,u,d)=>{let f=0,w;c&&(f=i.findIndex(c)),u&&(w=i.findIndex(u)),f===-1&&(f=i.length),(w===void 0||w===-1)&&(w=i.length);let M=i.slice(f,w);for(let n=0;n<M.length;n++){let o=M[n];if(!(o.priority===-1||d&&d(o))&&(o.priority<p||o.priority===p&&(v&&!o.hasWhere||o.order>=C)))return f+n}return f+M.length};if(b){let i=this.rules.findIndex(c=>c.media);if(i!==-1){let c=b.features["max-width"],u=b.features["min-width"];if(c&&u){let d=c.value-u.value;for(let f=l;f>=i;f--){s=f;let w=this.rules[f],M=w.media,n=M.features["max-width"],o=M.features["min-width"];if(!n||!o){s++;break}let r=n.value-o.value;if(r===d){if(v!==w.hasWhere)continue;if(p!==-1){let m=[this.rules[f]];for(let a=f-1;a>=i;a--){let y=this.rules[a];if(y.hasWhere!==v)break;let R=y.media,B=R.features["max-width"],x=R.features["min-width"];if(!B||!x||B.value-x.value!==r)break;m.unshift(this.rules[a])}s=h(this.rules,a=>a.media&&a.priority!==-1&&a.media.features["min-width"]&&a.media.features["max-width"])}break}else if(r>d)break}}else if(u)for(let d=i;d<=l;d++){s=d;let f=this.rules[d],w=f.media,M=w.features["max-width"],n=w.features["min-width"];if(M){if(n)break;continue}let o=n?.value;if(o===u.value){if(!v&&f.hasWhere){s++;continue}if(p!==-1)s=h(this.rules,r=>r.media,r=>r.media&&r.priority!==-1&&r.media.features["min-width"]&&r.media.features["max-width"],r=>!r.media.features["min-width"]&&!r.media.features["max-width"]);else for(let r=d;r<=l;r++){let m=this.rules[r],a=m.media,y=a.features["min-width"];if(!a.features["max-width"]){if(m.hasWhere!==v||y.value!==o||m.order>=C)break;s=r+1}}break}else{if(o>u.value)break;s++}}else if(c)for(let d=l;d>=i;d--){s=d;let f=this.rules[d],w=f.media,M=w.features["max-width"];if(w.features["min-width"])continue;let o=M?.value;if(!o||o>c.value){s++;break}else if(o===c.value){if(v&&!f.hasWhere)continue;if(p!==-1)s=h(this.rules,r=>r.media,r=>r.media&&r.priority!==-1&&r.media.features["min-width"]&&r.media.features["max-width"],r=>!r.media.features["min-width"]&&!r.media.features["max-width"]);else{let r=[this.rules[d]];for(let m=d-1;m>=i;m--){let a=this.rules[m],y=a.media,R=y.features["min-width"],B=y.features["max-width"];if(!R&&(!B||B.value!==o||a.hasWhere!==v))break;r.unshift(a)}for(let m=0;m<r.length;m++){let a=r[m];if(!a.media.features["min-width"]){if(a.order>=C)break;s=d-r.length+2+m}}}break}}}if(s===void 0)if(i===-1)s=l+1;else if(p!==-1)s=i+h(this.rules.slice(i),void 0,c=>c.media.features["max-width"]||c.media.features["min-width"]);else if(v){let c=i;for(;c<this.rules.length;c++){let u=this.rules[c];if(u.priority!==-1||!u.hasWhere||u.order>=C){s=c;break}}s===void 0&&(s=c)}else for(let c=i;c<=l;c++){s=c;let u=this.rules[c],d=u.media;if(u.priority!==-1||d.features["max-width"]||d.features["min-width"])break;if(u.hasWhere)s++;else if(u.order>=C)break}}else if(p===-1){if(v)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=C),s===-1&&(s=l+1);else{let i=0;for(;i<this.rules.length;i++){let c=this.rules[i];if(c.media||!c.hasWhere&&(c.order>=C||c.priority!==-1)){s=i;break}}s===void 0&&(s=i)}!s&&Object.keys(this.keyframes).length&&s++}else s=h(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,t),this.ruleBy[k]=t,this.style){let i=this.style.sheet,c=0,u=d=>{let f=this.rules[d];if(f){if(!f.natives.length)return u(d-1);let w=f.natives[f.natives.length-1].cssRule;for(let M=0;M<i.cssRules.length;M++)if(i.cssRules[M]===w){c=M+1;break}}};u(s-1);for(let d=0;d<t.natives.length;)try{let f=t.natives[d];i.insertRule(f.text,c),f.cssRule=i.cssRules[c++],d++}catch(f){console.error(f),t.natives.splice(d,1)}}t.config.insert?.call(t)}}get text(){return this.rules.map(e=>e.text).join("")}},W=A;S(W,"root"),S(W,"config",O.config),S(W,"instances",[]),S(W,"refresh",e=>{for(let t of A.instances)t.refresh(e)});N&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var B=(f,t)=>{for(var n in t)c(f,n,{get:t[n],enumerable:!0})},l=(f,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of E(t))!d.call(f,u)&&u!==n&&c(f,u,{get:()=>t[u],enumerable:!(o=A(t,u))||o.enumerable});return f},r=(f,t,n)=>(l(f,t,"default"),n&&l(n,t,"default"));var b=f=>l(c({},"__esModule",{value:!0}),f);var e={};B(e,{default:()=>m.MasterCSS,extend:()=>a});module.exports=b(e);r(e,require("./css"),module.exports);r(e,require("./rule"),module.exports);r(e,require("./theme"),module.exports);var m=require("./css");function p(f){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&f instanceof t||f instanceof Date||f instanceof RegExp)}function y(f){if(typeof Buffer<"u"&&Buffer&&f instanceof Buffer){let t=Buffer.alloc(f.length);return f.copy(t),t}else{if(f instanceof Date)return new Date(f.getTime());if(f instanceof RegExp)return new RegExp(f);throw new Error("Unexpected situation")}}function x(f){let t=[];return f.forEach(function(n,o){typeof n=="object"&&n!==null?Array.isArray(n)?t[o]=x(n):p(n)?t[o]=y(n):t[o]=a({},n):t[o]=n}),t}function s(f,t){return t==="__proto__"?void 0:f[t]}function a(...f){let t={},n,o;return f.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(i){if(o=s(t,i),n=s(u,i),n!==t)if(typeof n!="object"||n===null){t[i]=n;return}else if(Array.isArray(n)){t[i]=x(n);return}else if(p(n)){t[i]=y(n);return}else if(typeof o!="object"||o===null||Array.isArray(o)){t[i]=a({},n);return}else{t[i]=a(o,n);return}})}),t}r(e,require("./methods"),module.exports);r(e,require("./config"),module.exports);0&&(module.exports={extend});
1
+ var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var B=(f,t)=>{for(var n in t)c(f,n,{get:t[n],enumerable:!0})},l=(f,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of d(t))!E.call(f,u)&&u!==n&&c(f,u,{get:()=>t[u],enumerable:!(o=A(t,u))||o.enumerable});return f},r=(f,t,n)=>(l(f,t,"default"),n&&l(n,t,"default"));var b=f=>l(c({},"__esModule",{value:!0}),f);var e={};B(e,{default:()=>m.MasterCSS,extend:()=>a});module.exports=b(e);r(e,require("./css"),module.exports);r(e,require("./rule"),module.exports);r(e,require("./theme"),module.exports);var m=require("./css");function p(f){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&f instanceof t||f instanceof Date||f instanceof RegExp)}function y(f){if(typeof Buffer<"u"&&Buffer&&f instanceof Buffer){let t=Buffer.alloc(f.length);return f.copy(t),t}else{if(f instanceof Date)return new Date(f.getTime());if(f instanceof RegExp)return new RegExp(f);throw new Error("Unexpected situation")}}function x(f){let t=[];return f.forEach(function(n,o){typeof n=="object"&&n!==null?Array.isArray(n)?t[o]=x(n):p(n)?t[o]=y(n):t[o]=a({},n):t[o]=n}),t}function s(f,t){return t==="__proto__"?void 0:f[t]}function a(...f){let t={},n,o;return f.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(i){if(o=s(t,i),n=s(u,i),n!==t)if(typeof n!="object"||n===null){t[i]=n;return}else if(Array.isArray(n)){t[i]=x(n);return}else if(p(n)){t[i]=y(n);return}else if(typeof o!="object"||o===null||Array.isArray(o)){t[i]=a({},n);return}else{t[i]=a(o,n);return}})}),t}r(e,require("./methods"),module.exports);r(e,require("./config"),module.exports);0&&(module.exports={extend});
package/dist/cjs/theme.js CHANGED
@@ -1 +1 @@
1
- var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var v=(s,e)=>{for(var t in e)a(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!y.call(s,r)&&r!==t&&a(s,r,{get:()=>e[r],enumerable:!(i=g(e,r))||i.enumerable});return s};var S=s=>E(a({},"__esModule",{value:!0}),s);var T={};v(T,{Theme:()=>h,getDocThemeInitScript:()=>x,themeSettings:()=>c});module.exports=S(T);function u(s){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&s instanceof e||s instanceof Date||s instanceof RegExp)}function f(s){if(typeof Buffer<"u"&&Buffer&&s instanceof Buffer){let e=Buffer.alloc(s.length);return s.copy(e),e}else{if(s instanceof Date)return new Date(s.getTime());if(s instanceof RegExp)return new RegExp(s);throw new Error("Unexpected situation")}}function m(s){let e=[];return s.forEach(function(t,i){typeof t=="object"&&t!==null?Array.isArray(t)?e[i]=m(t):u(t)?e[i]=f(t):e[i]=o({},t):e[i]=t}),e}function l(s,e){return e==="__proto__"?void 0:s[e]}function o(...s){let e={},t,i;return s.forEach(function(r){typeof r!="object"||r===null||Array.isArray(r)||Object.keys(r).forEach(function(n){if(i=l(e,n),t=l(r,n),t!==e)if(typeof t!="object"||t===null){e[n]=t;return}else if(Array.isArray(t)){e[n]=m(t);return}else if(u(t)){e[n]=f(t);return}else if(typeof i!="object"||i===null||Array.isArray(i)){e[n]=o({},t);return}else{e[n]=o(i,t);return}})}),e}var c={store:"theme",init:!0},b=typeof document<"u",d=typeof localStorage<"u",h=class{constructor(e,t=b?document.documentElement:null){this.settings=e;this.host=t;this.settings=e?o(c,e):c,this.settings.init&&this.init()}e=typeof matchMedia<"u"?matchMedia?.("(prefers-color-scheme:dark)"):void 0;s;t;init(){let e=this.settings.default,t=this.storage;t&&(e=t),this.value=e}get storage(){let{store:e}=this.settings;if(d&&e)return localStorage.getItem(e)}get systemValue(){return this.e.matches?"dark":"light"}set value(e){this.s=e,e==="system"?(this.e?.addEventListener?.("change",this.i),this.current=this.systemValue):(this.r(),this.current=e)}get value(){return this.s}set current(e){let t=this.t;this.t=e,this.host&&(t&&this.host.classList.remove(t),this.host.classList.contains(e)||(this.host.classList.add(e),this.host.style&&(this.host.style.colorScheme=e)))}get current(){return this.t}switch(e,t={store:!0,emit:!0}){e&&e!==this.value&&(this.value=e,d&&this.storage!==e&&this.settings.store&&localStorage.setItem(this.settings.store,e),t.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this})))}r(){this.e?.removeEventListener("change",this.i)}i=e=>{this.current=e.matches?"dark":"light"};destroy(){this.r()}};function x(s){return s=Object.assign({store:"theme"},s),`let e${s.default?`='${s.default}'`:""};const c=localStorage.getItem("${s.store}");c&&(e=c);let t=e;e==="system"&&(t=matchMedia("(prefers-color-scheme:dark)").matches?"dark":"light");const s=document.documentElement;s.classList.add(t);s.style.colorScheme=t;`}0&&(module.exports={Theme,getDocThemeInitScript,themeSettings});
1
+ var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var v=(s,e)=>{for(var t in e)a(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p(e))!y.call(s,n)&&n!==t&&a(s,n,{get:()=>e[n],enumerable:!(i=g(e,n))||i.enumerable});return s};var S=s=>E(a({},"__esModule",{value:!0}),s);var T={};v(T,{Theme:()=>h,getDocThemeInitScript:()=>b,themeSettings:()=>c});module.exports=S(T);function u(s){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&s instanceof e||s instanceof Date||s instanceof RegExp)}function f(s){if(typeof Buffer<"u"&&Buffer&&s instanceof Buffer){let e=Buffer.alloc(s.length);return s.copy(e),e}else{if(s instanceof Date)return new Date(s.getTime());if(s instanceof RegExp)return new RegExp(s);throw new Error("Unexpected situation")}}function m(s){let e=[];return s.forEach(function(t,i){typeof t=="object"&&t!==null?Array.isArray(t)?e[i]=m(t):u(t)?e[i]=f(t):e[i]=o({},t):e[i]=t}),e}function l(s,e){return e==="__proto__"?void 0:s[e]}function o(...s){let e={},t,i;return s.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(r){if(i=l(e,r),t=l(n,r),t!==e)if(typeof t!="object"||t===null){e[r]=t;return}else if(Array.isArray(t)){e[r]=m(t);return}else if(u(t)){e[r]=f(t);return}else if(typeof i!="object"||i===null||Array.isArray(i)){e[r]=o({},t);return}else{e[r]=o(i,t);return}})}),e}var c={store:"theme",init:!0},x=typeof document<"u",d=typeof localStorage<"u",h=class{constructor(e,t=x?document.documentElement:null){this.settings=e;this.host=t;this.settings=e?o(c,e):c,this.settings.init&&this.init()}e=typeof matchMedia<"u"?matchMedia?.("(prefers-color-scheme:dark)"):void 0;s;t;init(){let e=this.settings.default,t=this.storage;t&&(e=t),this.value=e}get storage(){let{store:e}=this.settings;if(d&&e)return localStorage.getItem(e)}get systemValue(){return this.e.matches?"dark":"light"}set value(e){this.s=e,e==="system"?(this.e?.addEventListener?.("change",this.i),this.current=this.systemValue):(this.n(),this.current=e)}get value(){return this.s}set current(e){let t=this.t;this.t=e,this.host&&(t&&this.host.classList.remove(t),this.host.classList.contains(e)||(this.host.classList.add(e),this.host.style&&(this.host.style.colorScheme=e)))}get current(){return this.t}switch(e,t={store:!0,emit:!0}){e&&e!==this.value&&(this.value=e,d&&this.storage!==e&&this.settings.store&&localStorage.setItem(this.settings.store,e),t.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this})))}n(){this.e?.removeEventListener("change",this.i)}i=e=>{this.current=e.matches?"dark":"light"};destroy(){this.n()}};function b(s){return s=Object.assign({store:"theme"},s),`let e${s.default?`='${s.default}'`:""};const c=localStorage.getItem("${s.store}");c&&(e=c);let t=e;e==="system"&&(t=matchMedia("(prefers-color-scheme:dark)").matches?"dark":"light");const s=document.documentElement;s.classList.add(t);s.style.colorScheme=t;`}0&&(module.exports={Theme,getDocThemeInitScript,themeSettings});
@@ -1,2 +1,201 @@
1
1
  import { RuleConfig } from '../rule';
2
- export declare const rules: Record<"filter" | "fill" | "flex" | "grid" | "x" | "group" | "variable" | "fontSize" | "fontWeight" | "fontFamily" | "fontSmoothing" | "fontStyle" | "fontVariantNumeric" | "fontFeatureSettings" | "font" | "color" | "margin" | "padding" | "flexBasis" | "flexWrap" | "flexGrow" | "flexShrink" | "flexDirection" | "display" | "width" | "height" | "minWidth" | "minHeight" | "box" | "minBox" | "maxBox" | "contain" | "content" | "counterIncrement" | "counterReset" | "letterSpacing" | "lineHeight" | "objectFit" | "objectPosition" | "textAlign" | "textDecorationColor" | "textDecorationStyle" | "textDecorationThickness" | "textDecorationLine" | "textDecoration" | "textUnderlineOffset" | "textOverflow" | "textOrientation" | "textTransform" | "textRendering" | "textIndent" | "verticalAlign" | "columns" | "whiteSpace" | "inset" | "lines" | "maxHeight" | "maxWidth" | "boxSizing" | "opacity" | "visibility" | "clear" | "float" | "isolation" | "overflow" | "overscrollBehavior" | "zIndex" | "position" | "cursor" | "pointerEvents" | "resize" | "touchAction" | "wordBreak" | "wordSpacing" | "userDrag" | "userSelect" | "textShadow" | "textSize" | "textFillColor" | "textStrokeWidth" | "textStrokeColor" | "textStroke" | "boxShadow" | "tableLayout" | "transformBox" | "transformStyle" | "transformOrigin" | "transform" | "transitionProperty" | "transitionTimingFunction" | "transitionDuration" | "transitionDelay" | "transition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animation" | "borderColor" | "borderRadius" | "borderStyle" | "borderWidth" | "borderCollapse" | "borderSpacing" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderImage" | "border" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundColor" | "backgroundClip" | "backgroundOrigin" | "backgroundPosition" | "backgroundRepeat" | "backgroundSize" | "backgroundImage" | "background" | "mixBlendMode" | "backdropFilter" | "strokeDasharray" | "strokeDashoffset" | "strokeWidth" | "stroke" | "y" | "cx" | "cy" | "rx" | "ry" | "gridColumnStart" | "gridColumnEnd" | "gridColumn" | "gridColumns" | "gridRowStart" | "gridRowEnd" | "gridRow" | "gridRows" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplate" | "gridArea" | "gap" | "order" | "breakInside" | "breakBefore" | "breakAfter" | "boxDecorationBreak" | "aspectRatio" | "columnSpan" | "alignContent" | "alignItems" | "alignSelf" | "justifyContent" | "justifyItems" | "justifySelf" | "placeContent" | "placeItems" | "placeSelf" | "listStylePosition" | "listStyleType" | "listStyleImage" | "listStyle" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "outline" | "accentColor" | "appearance" | "caretColor" | "scrollBehavior" | "scrollMargin" | "scrollPadding" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "willChange" | "writingMode" | "direction" | "shapeOutside" | "shapeMargin" | "shapeImageThreshold" | "clipPath" | "quotes" | "maskImage", RuleConfig>;
2
+ export declare const rules: {
3
+ group: RuleConfig;
4
+ variable: RuleConfig;
5
+ fontSize: RuleConfig;
6
+ fontWeight: RuleConfig;
7
+ fontFamily: RuleConfig;
8
+ fontSmoothing: RuleConfig;
9
+ fontStyle: RuleConfig;
10
+ fontVariantNumeric: RuleConfig;
11
+ fontFeatureSettings: RuleConfig;
12
+ font: RuleConfig;
13
+ color: RuleConfig;
14
+ margin: RuleConfig;
15
+ padding: RuleConfig;
16
+ flexBasis: RuleConfig;
17
+ flexWrap: RuleConfig;
18
+ flexGrow: RuleConfig;
19
+ flexShrink: RuleConfig;
20
+ flexDirection: RuleConfig;
21
+ flex: RuleConfig;
22
+ display: RuleConfig;
23
+ width: RuleConfig;
24
+ height: RuleConfig;
25
+ minWidth: RuleConfig;
26
+ minHeight: RuleConfig;
27
+ box: RuleConfig;
28
+ minBox: RuleConfig;
29
+ maxBox: RuleConfig;
30
+ contain: RuleConfig;
31
+ content: RuleConfig;
32
+ counterIncrement: RuleConfig;
33
+ counterReset: RuleConfig;
34
+ letterSpacing: RuleConfig;
35
+ lineHeight: RuleConfig;
36
+ objectFit: RuleConfig;
37
+ objectPosition: RuleConfig;
38
+ textAlign: RuleConfig;
39
+ textDecorationColor: RuleConfig;
40
+ textDecorationStyle: RuleConfig;
41
+ textDecorationThickness: RuleConfig;
42
+ textDecorationLine: RuleConfig;
43
+ textDecoration: RuleConfig;
44
+ textUnderlineOffset: RuleConfig;
45
+ textOverflow: RuleConfig;
46
+ textOrientation: RuleConfig;
47
+ textTransform: RuleConfig;
48
+ textRendering: RuleConfig;
49
+ textIndent: RuleConfig;
50
+ verticalAlign: RuleConfig;
51
+ columns: RuleConfig;
52
+ whiteSpace: RuleConfig;
53
+ inset: RuleConfig;
54
+ lines: RuleConfig;
55
+ maxHeight: RuleConfig;
56
+ maxWidth: RuleConfig;
57
+ boxSizing: RuleConfig;
58
+ opacity: RuleConfig;
59
+ visibility: RuleConfig;
60
+ clear: RuleConfig;
61
+ float: RuleConfig;
62
+ isolation: RuleConfig;
63
+ overflow: RuleConfig;
64
+ overscrollBehavior: RuleConfig;
65
+ zIndex: RuleConfig;
66
+ position: RuleConfig;
67
+ cursor: RuleConfig;
68
+ pointerEvents: RuleConfig;
69
+ resize: RuleConfig;
70
+ touchAction: RuleConfig;
71
+ wordBreak: RuleConfig;
72
+ wordSpacing: RuleConfig;
73
+ userDrag: RuleConfig;
74
+ userSelect: RuleConfig;
75
+ textShadow: RuleConfig;
76
+ textSize: RuleConfig;
77
+ textFillColor: RuleConfig;
78
+ textStrokeWidth: RuleConfig;
79
+ textStrokeColor: RuleConfig;
80
+ textStroke: RuleConfig;
81
+ boxShadow: RuleConfig;
82
+ tableLayout: RuleConfig;
83
+ transformBox: RuleConfig;
84
+ transformStyle: RuleConfig;
85
+ transformOrigin: RuleConfig;
86
+ transform: RuleConfig;
87
+ transitionProperty: RuleConfig;
88
+ transitionTimingFunction: RuleConfig;
89
+ transitionDuration: RuleConfig;
90
+ transitionDelay: RuleConfig;
91
+ transition: RuleConfig;
92
+ animationDelay: RuleConfig;
93
+ animationDirection: RuleConfig;
94
+ animationDuration: RuleConfig;
95
+ animationFillMode: RuleConfig;
96
+ animationIterationCount: RuleConfig;
97
+ animationName: RuleConfig;
98
+ animationPlayState: RuleConfig;
99
+ animationTimingFunction: RuleConfig;
100
+ animation: RuleConfig;
101
+ borderColor: RuleConfig;
102
+ borderRadius: RuleConfig;
103
+ borderStyle: RuleConfig;
104
+ borderWidth: RuleConfig;
105
+ borderCollapse: RuleConfig;
106
+ borderSpacing: RuleConfig;
107
+ borderImageOutset: RuleConfig;
108
+ borderImageRepeat: RuleConfig;
109
+ borderImageSlice: RuleConfig;
110
+ borderImageSource: RuleConfig;
111
+ borderImageWidth: RuleConfig;
112
+ borderImage: RuleConfig;
113
+ border: RuleConfig;
114
+ backgroundAttachment: RuleConfig;
115
+ backgroundBlendMode: RuleConfig;
116
+ backgroundColor: RuleConfig;
117
+ backgroundClip: RuleConfig;
118
+ backgroundOrigin: RuleConfig;
119
+ backgroundPosition: RuleConfig;
120
+ backgroundRepeat: RuleConfig;
121
+ backgroundSize: RuleConfig;
122
+ backgroundImage: RuleConfig;
123
+ background: RuleConfig;
124
+ mixBlendMode: RuleConfig;
125
+ backdropFilter: RuleConfig;
126
+ filter: RuleConfig;
127
+ fill: RuleConfig;
128
+ strokeDasharray: RuleConfig;
129
+ strokeDashoffset: RuleConfig;
130
+ strokeWidth: RuleConfig;
131
+ stroke: RuleConfig;
132
+ x: RuleConfig;
133
+ y: RuleConfig;
134
+ cx: RuleConfig;
135
+ cy: RuleConfig;
136
+ rx: RuleConfig;
137
+ ry: RuleConfig;
138
+ gridColumnStart: RuleConfig;
139
+ gridColumnEnd: RuleConfig;
140
+ gridColumn: RuleConfig;
141
+ gridColumns: RuleConfig;
142
+ gridRowStart: RuleConfig;
143
+ gridRowEnd: RuleConfig;
144
+ gridRow: RuleConfig;
145
+ gridRows: RuleConfig;
146
+ gridAutoColumns: RuleConfig;
147
+ gridAutoFlow: RuleConfig;
148
+ gridAutoRows: RuleConfig;
149
+ gridTemplateAreas: RuleConfig;
150
+ gridTemplateColumns: RuleConfig;
151
+ gridTemplateRows: RuleConfig;
152
+ gridTemplate: RuleConfig;
153
+ gridArea: RuleConfig;
154
+ grid: RuleConfig;
155
+ gap: RuleConfig;
156
+ order: RuleConfig;
157
+ breakInside: RuleConfig;
158
+ breakBefore: RuleConfig;
159
+ breakAfter: RuleConfig;
160
+ boxDecorationBreak: RuleConfig;
161
+ aspectRatio: RuleConfig;
162
+ columnSpan: RuleConfig;
163
+ alignContent: RuleConfig;
164
+ alignItems: RuleConfig;
165
+ alignSelf: RuleConfig;
166
+ justifyContent: RuleConfig;
167
+ justifyItems: RuleConfig;
168
+ justifySelf: RuleConfig;
169
+ placeContent: RuleConfig;
170
+ placeItems: RuleConfig;
171
+ placeSelf: RuleConfig;
172
+ listStylePosition: RuleConfig;
173
+ listStyleType: RuleConfig;
174
+ listStyleImage: RuleConfig;
175
+ listStyle: RuleConfig;
176
+ outlineColor: RuleConfig;
177
+ outlineOffset: RuleConfig;
178
+ outlineStyle: RuleConfig;
179
+ outlineWidth: RuleConfig;
180
+ outline: RuleConfig;
181
+ accentColor: RuleConfig;
182
+ appearance: RuleConfig;
183
+ caretColor: RuleConfig;
184
+ scrollBehavior: RuleConfig;
185
+ scrollMargin: RuleConfig;
186
+ scrollPadding: RuleConfig;
187
+ scrollSnapAlign: RuleConfig;
188
+ scrollSnapStop: RuleConfig;
189
+ scrollSnapType: RuleConfig;
190
+ willChange: RuleConfig;
191
+ writingMode: RuleConfig;
192
+ direction: RuleConfig;
193
+ shapeOutside: RuleConfig;
194
+ shapeMargin: RuleConfig;
195
+ shapeImageThreshold: RuleConfig;
196
+ clipPath: RuleConfig;
197
+ quotes: RuleConfig;
198
+ maskImage: RuleConfig;
199
+ } & {
200
+ [key: string]: RuleConfig;
201
+ };
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{program as c}from"commander";import w from"path";import{readPackage as S}from"../utils/read-package.mjs";import m from"chokidar";import a from"fs";import{defineContent as x}from"../methods/define-content.mjs";import t from"@techor/log";c.command("init").description("Create a Master CSS definition file with configuration").allowUnknownOption().option("--jit","With initialization of the just-in-time program").option("-c, --compiler","With compiler options").option("-o, --override","Override the existing definition file").option("--ext <extension>","Definition extension `ts`, `js`, `mjs`").action(function(l){let{ext:e}=l;if(!e)if(a.existsSync("tsconfig.json"))e="ts";else{let{type:d}=S();d==="module"?e="mjs":e="js"}let i=x({...l,ext:e}),n=`master.css.${e}`,s=a.existsSync(w.join(process.cwd(),n));s?s&&l.override?(a.writeFileSync(n,i),t.ok`**${n}** definition file is overridden`):t.x`**${n}** definition file already exists`:(a.writeFileSync(n,i),t.ok`**${n}** definition file is created`)});c.command("build",{isDefault:!0}).allowUnknownOption().option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your master CSS file output path","master.css").action(async function({watch:l,output:e}){let i=await new(await import("@master/css-compiler")).default().compile(),n=r=>i.insert(r,a.readFileSync(r,{encoding:"utf-8"})),s=()=>a.writeFileSync(e,i.css.text),d=i.sources;if(console.log(""),t`[sources] ${d}`,l){let r=[],p=async()=>{let{include:o,exclude:y,sources:u}=i.options;o?.length&&g(m.watch(o,{ignored:y,ignoreInitial:!0})),u?.length&&g(m.watch(u,{ignoreInitial:!0})),s(),t.tree(i.options)},h=async o=>{n(o),s()},g=o=>{r.push(o.on("add",h).on("change",h))};await p(),console.log(""),t.t`Start watching source changes`,t.tree(i.options);let f=async()=>{await Promise.all(r.map(o=>o.close())),r.length=0,await i.refresh(),await p()};m.watch([i.resolvedConfigPath],{ignoreInitial:!0}).on("add",f).on("change",f).on("unlink",f)}else s()});var{version:j,name:k,description:v}=S(w.join(__dirname,"../../package.json"));c.name(k);c.description(v);c.version(j);c.parse();
2
+ import{program as c}from"commander";import y from"path";import p from"chokidar";import a from"fs";import{defineContent as x}from"../methods/define-content.mjs";import t from"@techor/log";import{readFileAsJSON as w}from"@techor/fs";c.command("init").description("Create a Master CSS definition file with configuration").allowUnknownOption().option("--jit","With initialization of the just-in-time program").option("-c, --compiler","With compiler options").option("-o, --override","Override the existing definition file").option("--ext <extension>","Definition extension `ts`, `js`, `mjs`").action(function(l){let{ext:e}=l;if(!e)if(a.existsSync("tsconfig.json"))e="ts";else{let{type:d}=w("./package.json")||{};d==="module"?e="mjs":e="js"}let i=x({...l,ext:e}),n=`master.css.${e}`,s=a.existsSync(y.join(process.cwd(),n));s?s&&l.override?(a.writeFileSync(n,i),t.ok`**${n}** definition file is overridden`):t.x`**${n}** definition file already exists`:(a.writeFileSync(n,i),t.ok`**${n}** definition file is created`)});c.command("build",{isDefault:!0}).allowUnknownOption().option("-w, --watch","Watch file changed and generate CSS rules.").option("-o, --output <path>","Specify your master CSS file output path","master.css").action(async function({watch:l,output:e}){let i=await new(await import("@master/css-compiler")).default().compile(),n=r=>i.insert(r,a.readFileSync(r,{encoding:"utf-8"})),s=()=>a.writeFileSync(e,i.css.text),d=i.sources;if(console.log(""),t`[sources] ${d}`,l){let r=[],m=async()=>{let{include:o,exclude:S,sources:u}=i.options;o?.length&&g(p.watch(o,{ignored:S,ignoreInitial:!0})),u?.length&&g(p.watch(u,{ignoreInitial:!0})),s(),t.tree(i.options)},h=async o=>{n(o),s()},g=o=>{r.push(o.on("add",h).on("change",h))};await m(),console.log(""),t.t`Start watching source changes`,t.tree(i.options);let f=async()=>{await Promise.all(r.map(o=>o.close())),r.length=0,await i.refresh(),await m()};p.watch([i.resolvedConfigPath],{ignoreInitial:!0}).on("add",f).on("change",f).on("unlink",f)}else s()});var{version:j,name:k,description:v}=w("../../../package.json",{cwd:__dirname})||{};c.name(k);c.description(v);c.version(j);c.parse();