@master/css 2.0.0-beta.130 → 2.0.0-beta.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/config/index.js +1 -1
- package/dist/cjs/config/keyframes.js +1 -0
- package/dist/cjs/config/precedence.js +1 -0
- package/dist/cjs/config/rules.js +1 -1
- package/dist/cjs/css.js +1 -1
- package/dist/cjs/methods/render-into-html.js +1 -1
- package/dist/cjs/rule.js +1 -1
- package/dist/config/index.d.ts +5 -1
- package/dist/config/keyframes.d.ts +109 -0
- package/dist/config/precedence.d.ts +1 -0
- package/dist/config/rules.d.ts +1 -1
- package/dist/css.d.ts +7 -2
- package/dist/esm/config/index.mjs +1 -1
- package/dist/esm/config/keyframes.mjs +1 -0
- package/dist/esm/config/precedence.mjs +1 -0
- package/dist/esm/config/rules.mjs +1 -1
- package/dist/esm/css.mjs +1 -1
- package/dist/esm/methods/render-into-html.mjs +1 -1
- package/dist/esm/rule.mjs +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +9 -9
- package/dist/rule.d.ts +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Visit [beta.css.master.co](https://beta.css.master.co) to view the full document
|
|
|
66
66
|
Check out the [official guides](https://beta.css.master.co/docs) to get started with Master CSS, or walk through the [examples](https://github.com/master-co/css/tree/beta/examples) for a quick overview of integrating with your framework.
|
|
67
67
|
|
|
68
68
|
## Compilation Modes
|
|
69
|
-
Master CSS provides various [compilation modes](https://beta.css.master.co/docs/compilation)
|
|
69
|
+
Master CSS provides various [compilation modes](https://beta.css.master.co/docs/compilation), allowing you to choose according to the characteristics and needs of different projects.
|
|
70
70
|
|
|
71
71
|
- [Just-in-time](https://beta.css.master.co/docs/compilation/just-in-time) - Observe the DOM tree, manipulate CSS rules according to the changed class name, and synchronize to the running style sheet at runtime
|
|
72
72
|
- [🚧 Ahead-of-time](https://beta.css.master.co/docs/compilation/ahead-of-time) - Scan source files for class names at build time, extract class names, and generate CSS files/virtual modules, then import them in the entry file
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t=Object.defineProperty;var
|
|
1
|
+
var t=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var B=(r,e)=>{for(var o in e)t(r,o,{get:e[o],enumerable:!0})},v=(r,e,o,b)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of R(e))!h.call(r,s)&&s!==o&&t(r,s,{get:()=>e[s],enumerable:!(b=S(e,s))||b.enumerable});return r};var Q=r=>v(t({},"__esModule",{value:!0}),r);var M={};B(M,{breakpoints:()=>i.breakpoints,colors:()=>n.colors,config:()=>x,functions:()=>d.functions,important:()=>y.important,keyframes:()=>k.keyframes,observe:()=>u.observe,override:()=>f.override,precedence:()=>C.precedence,rootSize:()=>m.rootSize,rules:()=>l.rules,scope:()=>p.scope,selectors:()=>a.selectors,semantics:()=>c.semantics,themes:()=>g.themes});module.exports=Q(M);var i=require("./breakpoints"),n=require("./colors"),m=require("./root-size"),p=require("./scope"),a=require("./selectors"),c=require("./semantics"),g=require("./themes"),l=require("./rules"),f=require("./override"),u=require("./observe"),y=require("./important"),k=require("./keyframes"),d=require("./functions"),C=require("./precedence"),x={breakpoints:i.breakpoints,colors:n.colors,rootSize:m.rootSize,scope:p.scope,selectors:a.selectors,semantics:c.semantics,themes:g.themes,rules:l.rules,override:f.override,observe:u.observe,important:y.important,functions:d.functions,keyframes:k.keyframes,precedence:C.precedence};0&&(module.exports={breakpoints,colors,config,functions,important,keyframes,observe,override,precedence,rootSize,rules,scope,selectors,semantics,themes});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var c=(t,r)=>{for(var n in r)o(t,n,{get:r[n],enumerable:!0})},i=(t,r,n,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of m(r))!f.call(t,a)&&a!==n&&o(t,a,{get:()=>r[a],enumerable:!(e=s(r,a))||e.enumerable});return t};var l=t=>i(o({},"__esModule",{value:!0}),t);var g={};c(g,{keyframes:()=>p});module.exports=l(g);var p={fade:{from:{opacity:0},to:{opacity:0}},flash:{"from,50%,to":{opacity:1},"25%,75%":{opacity:0}},float:{"0%":{transform:"none"},"50%":{transform:"translateY(-1.25rem)"},"100%":{transform:"none"}},heart:{"0%":{transform:"scale(1)"},"14%":{transform:"scale(1.3)"},"28%":{transform:"scale(1)"},"42%":{transform:"scale(1.3)"},"70%":{transform:"scale(1)"}},jump:{"0%,100%":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(0.8, 0, 1, 1)"},"50%":{transform:"translateY(0)","animation-timing-function":"cubic-bezier(0, 0, 0.2, 1)"}},ping:{"75%,100%":{transform:"scale(2)",opacity:0}},pulse:{"0%":{transform:"none"},"50%":{transform:"scale(1.05)"},"100%":{transform:"none"}},rotate:{from:{transform:"rotate(-360deg)"},to:{transform:"none"}},shake:{"0%":{transform:"none"},"6.5%":{transform:"translateX(-6px) rotateY(-9deg)"},"18.5%":{transform:"translateX(5px) rotateY(7deg)"},"31.5%":{transform:"translateX(-3px) rotateY(-5deg)"},"43.5%":{transform:"translateX(2px) rotateY(3deg)"},"50%":{transform:"none"}},zoom:{from:{transform:"scale(0)"},"100%":{transform:"none"}}};0&&(module.exports={keyframes});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var d=(c,e)=>{for(var h in e)n(c,h,{get:e[h],enumerable:!0})},g=(c,e,h,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of r(e))!s.call(c,t)&&t!==h&&n(c,t,{get:()=>e[t],enumerable:!(o=p(e,t))||o.enumerable});return c};var i=c=>g(n({},"__esModule",{value:!0}),c);var a={};d(a,{precedence:()=>x});module.exports=i(a);var x="highest";0&&(module.exports={precedence});
|
package/dist/cjs/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},T=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of C(t))!S.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(o=k(t,n))||o.enumerable});return e};var I=e=>T(f({},"__esModule",{value:!0}),e);var z={};R(z,{rules:()=>A});module.exports=I(z);var x=require("../constants/start-symbol"),v=require("../constants/box-underneath"),p=require("../constants/content-extrema"),d=require("../constants/sizing-values"),$=require("../utils/css-escape"),A={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=(l,i)=>{let a=i.indexOf(":");if(a!==-1){l in t||(t[l]={});let c=t[l],g=i.slice(0,a);g in c||(c[g]=i.slice(a+1))}},o=l=>{let i=(a,c)=>{let g=c.slice((0,$.cssEscape)(l.className).length).match(/\{(.*)\}/)[1].split(";");for(let w of g)r(a,w)};if(this.theme){let a=l.natives.find(c=>c.theme===this.theme)??l.natives.find(c=>!c.theme);a&&i(this.theme,a.text)}else for(let a of l.natives)i(a.theme,a.text)},n=[],s="",u=()=>{s&&(n.push(s.replace(/ /g,"")),s="")},h=1;(function l(i){for(;h<e.length;h++){let a=e[h];if(!i){if(a===";"){u();continue}if(a==="}")break}if(s+=a,i===a){if(i==="'"||i==='"'){let c=0;for(let g=s.length-2;s[g]==="\\";g--)c++;if(c%2)continue}break}else a in x.START_SYMBOL&&i!=="'"&&i!=='"'&&(h++,l(x.START_SYMBOL[a]))}})(void 0),u();for(let l of n){let i=this.css.create(l);if(Array.isArray(i))for(let a of i)o(a);else i?o(i):r(this.theme??"",l)}let m={};for(let l in t)for(let[i,a]of Object.entries(t[l]))i in m?m[i][l]=a:m[i]={[l]:a};return console.log(m),m}},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 y.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 y.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:d.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:d.SIZING_VALUES},height:{match:"^h:.",unit:"rem",native:!0,values:d.SIZING_VALUES},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:d.SIZING_VALUES},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:d.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:d.SIZING_VALUES},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:d.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},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},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 b(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="",n=this.prefix.split("-");if(n.length>1)for(let s=1;s<n.length-1;s++)o+=n[s][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 b(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 b(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 b(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:p.CONTENT_EXTREMA},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p.CONTENT_EXTREMA,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:p.CONTENT_EXTREMA},gridTemplateRows:{native:!0,values:p.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}}}};function y(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",o=r+"-left",n=r+"-right",s=r+"-top",u=r+"-bottom";switch(this.prefix[1]){case"x":return{[o]:e,[n]:e};case"y":return{[s]:e,[u]:e};case"l":return{[o]:e};case"r":return{[n]:e};case"t":return{[s]:e};case"b":return{[u]:e};default:return{[r]:e}}}function b(e,t,r=""){let o="border-";r&&(r="-"+r);let n=/^b(order)?-?(.)?/.exec(e)[2],s=o+"left"+r,u=o+"right"+r,h=o+"top"+r,m=o+"bottom"+r;switch(n){case"x":return{[s]:t,[u]:t};case"y":return{[h]:t,[m]:t};case"l":return{[s]:t};case"r":return{[u]:t};case"t":return{[h]:t};case"b":return{[m]: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 D={};O(D,{rules:()=>N});module.exports=z(D);var x=require("../constants/start-symbol"),v=require("../constants/box-underneath"),p=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 f(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 f(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 f(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 f(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:p.CONTENT_EXTREMA},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p.CONTENT_EXTREMA,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:p.CONTENT_EXTREMA},gridTemplateRows:{native:!0,unit:"rem",values:p.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}}}};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 f(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 O=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var Z=(p,e,t)=>e in p?O(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var P=(p,e)=>{for(var t in e)O(p,t,{get:e[t],enumerable:!0})},U=(p,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of _(e))!q.call(p,l)&&l!==t&&O(p,l,{get:()=>e[l],enumerable:!(s=H(e,l))||s.enumerable});return p};var Y=p=>U(O({},"__esModule",{value:!0}),p);var T=(p,e,t)=>(Z(p,typeof e!="symbol"?e+"":e,t),t);var G={};P(G,{MasterCSS:()=>k});module.exports=Y(G);function L(p){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&p instanceof e||p instanceof Date||p instanceof RegExp)}function I(p){if(typeof Buffer<"u"&&Buffer&&p instanceof Buffer){let e=Buffer.alloc(p.length);return p.copy(e),e}else{if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp)return new RegExp(p);throw new Error("Unexpected situation")}}function $(p){let e=[];return p.forEach(function(t,s){typeof t=="object"&&t!==null?Array.isArray(t)?e[s]=$(t):L(t)?e[s]=I(t):e[s]=j({},t):e[s]=t}),e}function N(p,e){return e==="__proto__"?void 0:p[e]}function j(...p){let e={},t,s;return p.forEach(function(l){typeof l!="object"||l===null||Array.isArray(l)||Object.keys(l).forEach(function(R){if(s=N(e,R),t=N(l,R),t!==e)if(typeof t!="object"||t===null){e[R]=t;return}else if(Array.isArray(t)){e[R]=$(t);return}else if(L(t)){e[R]=I(t);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[R]=j({},t);return}else{e[R]=j(s,t);return}})}),e}var V=require("./rule"),S=require("./config"),D=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var F=typeof window<"u",A=class{constructor(e){this.config=e;this.config?.override||(this.config=j(S.config,e)),this.cache(),F&&this.config.observe&&this.observe(document),A.instances.push(this)}rules=[];ruleBy={};countBy={};e=F?new MutationObserver(e=>{let t={},s=[],l=[],R=[],M=(a,i)=>{i?a.classList.forEach(v):a.classList.forEach(y);let c=a.children;for(let m=0;m<c.length;m++){let d=c[m];d.classList&&(l.push(d),M(d,i))}},y=a=>{a in t?t[a]++:t[a]=1},v=a=>{a in t?t[a]--:a in this.countBy&&(t[a]=-1)},B=(a,i)=>{for(let c=0;c<a.length;c++){let m=a[c];m.classList&&!l.includes(m)&&!R.includes(m)&&(m.isConnected!==i?(l.push(m),M(m,i)):R.push(m))}};for(let a=0;a<e.length;a++){let i=e[a],{addedNodes:c,removedNodes:m,type:d,target:f}=i;if(d==="attributes"){if(s.find(w=>w.target===f))continue;s.push(i)}else B(c,!1),(!f.isConnected||!l.includes(f))&&B(m,!0)}if(!(!s.length&&!Object.keys(t).length)){for(let{oldValue:a,target:i}of s){let c=l.includes(i),m=i.classList,d=a?a.split(" "):[];if(c){if(i.isConnected)continue;for(let f of d)m.contains(f)||v(f)}else if(i.isConnected){m.forEach(f=>{d.includes(f)||y(f)});for(let f of d)m.contains(f)||v(f)}}for(let a in t){let i=t[a],c=(this.countBy[a]||0)+i;c===0?(delete this.countBy[a],this.delete(a)):(a in this.countBy||this.insert(a),this.countBy[a]=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={};let{semantics:e,classes:t,selectors:s,themes:l,colors:R,values:M,breakpoints:y,mediaQueries:v,rules:B}=this.config;function a(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function i(r,o,n="",u={}){let h=x=>x?(n?n+"-":"")+x:n,g=Object.entries(r),b=[],E=[];for(let x of g){let W=x[1];(typeof W=="object"&&!Array.isArray(W)?b:E).push(x)}for(let[x,W]of b)i(W,o,h(x),u);if(o&&n)E.length&&(u[n]=E.reduce((x,[W,z])=>(x[W]=z,x),{}));else for(let[x,W]of E)u[h(x)]=W;return u}if(e)for(let[r,o]of Object.entries(i(e,!0)))this.semantics.push([new RegExp("^"+a(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,o]]);if(s)for(let[r,o]of Object.entries(i(s,!1))){let n=new RegExp(a(r)+"(?![a-z-])");for(let u of Array.isArray(o)?o:[o]){let h=u.match(/^::-[a-z]+-/m)?.[0]??"",g=this.selectors[h];g||(g=this.selectors[h]=[]);let b=g.find(([E])=>E===n);b||(b=[n,[]],g.push(b)),b[1].push(u)}}M&&(this.globalValues=i(M,!1)),y&&(this.breakpoints=i(y,!1)),v&&(this.mediaQueries=i(v,!1));let c=t?i(t,!1):{},m=l&&!Array.isArray(l)?Object.entries(l).filter(([,{classes:r}])=>r).reduce((r,[o,{classes:n}])=>(r[o]=i(n,!1),r),{}):{},d=[...Object.keys(c),...Object.entries(m).flatMap(([r,o])=>Object.keys(o))],f=r=>{if(r in this.classes)return;let o=this.classes[r]=[],n=(u,h)=>{if(!h)return;let g=Array.isArray(h)?h:h.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let b of g){let E=x=>{x in this.themeAffectedClassesBy?u in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][u].push(r):this.themeAffectedClassesBy[x][u]=[r]:this.themeAffectedClassesBy[x]={[u]:[r]},o.includes(x)||o.push(x)};if(d.includes(b)){f(b);for(let x of this.classes[b])E(x)}else E(b)}};n("",c?.[r]);for(let[u,h]of Object.entries(m))n(u,h?.[r])};for(let r of d)f(r);for(let r in this.themeAffectedClassesBy){let o=this.classesBy[r]=[];for(let n of Object.values(this.themeAffectedClassesBy[r]))for(let u of n)o.includes(u)||o.push(u)}let w=(r,o)=>{if(!o)return;let n=i(o,!0);for(let[u,h]of Object.entries(n)){let g=typeof h=="string"?{"":h}:h;for(let[b,E]of Object.entries(g)){let x=u+(b?"-"+b:"");x in this.colorThemesMap?this.colorThemesMap[x][r]=E:this.colorThemesMap[x]={[r]:E}}}for(let u in o)this.colorNames.includes(u)||this.colorNames.push(u)};if(w("",R),l)if(Array.isArray(l))this.themeNames.push(...l);else for(let r in l){let o=l[r];w(r,o.colors),this.themeNames.push(r)}let C=r=>{for(let[o,n]of Object.entries(this.colorThemesMap))for(let[u,h]of Object.entries(n))h.startsWith("#")||r(o,n,u,h)};if(C((r,o,n,u)=>{let h=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(h){let g="#"+(0,D.rgbToHex)(+h[1],+h[2],+h[3]);h[4]&&(g+=Math.round(255*+h[4]).toString(16)),o[n]=g}}),C((r,o,n,u)=>{let[h,g]=u.split("/"),b=this.colorThemesMap[h];if(b){let E=(n?b[n]:void 0)??b[""];o[n]=g?E.slice(0,7)+Math.round(255*+g).toString(16):E}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete o[n],Object.keys(o).length||delete this.colorThemesMap[r]}),B)for(let r in B){let o=B[r],{native:n,values:u,colored:h}=o,g=o.match;if(o.id=r,o.native=n===!0?r.replace(/(?!^)[A-Z]/g,b=>"-"+b).toLowerCase():void 0,u&&(this.values[r]=i(u,!1)),g){let b=Object.keys(this.values[r]??{});g.includes("$values")&&(g=b.length?g.replace(/\$values/,b.join("|")):g.replace(/(?:\|)?\$values/,"")),h&&g.includes("$colors")&&(g=this.colorNames.length?g.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):g.replace(/(?:\|)?\$colors/,"")),this.matches[r]=new RegExp(g)}}}observe(e,t={subtree:!0,childList:!0}){if(F&&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,R=s?document.styleSheets:e.styleSheets;for(let y of R){let{title:v,href:B,ownerNode:a}=y;(v==="master"||B&&B.startsWith(window.location.origin)&&/master(?:\..+)?\.css/.test(B))&&(this.style=a)}if(this.style)for(let y=0;y<this.style.sheet.cssRules.length;y++){let v=a=>{if(a.selectorText){let c=a.selectorText.split(", ")[0].split(" ");for(let m=0;m<c.length;m++){let d=c[m];if(d[0]==="."){let f=d.slice(1),w="";for(let C=0;C<f.length;C++){let r=f[C],o=f[C+1];if(r==="\\"){if(C++,o!=="\\"){w+=o;continue}}else if(Q.SELECTOR_SYMBOLS.includes(r))break;w+=r}if(!(w in this.ruleBy)&&!(w in this.classes)){let C=this.create(w)[0];if(C)return C}}}}else if(a.cssRules)for(let i=0;i<a.cssRules.length;i++){let c=v(a.cssRules[i]);if(c)return c}},B=v(this.style.sheet.cssRules[y]);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[y+a];y+=B.natives.length-1}}else{this.style=document.createElement("style"),this.style.title="master";let y=l.querySelector('link[rel="styleSheet"], style');y?y.before(this.style):l.append(this.style)}let M=y=>{y.forEach(v=>{v in this.countBy?this.countBy[v]++:(this.countBy[v]=1,this.insert(v))})};M(this.host.classList),t.subtree&&this.host.querySelectorAll("[class]").forEach(y=>M(y.classList)),this.e.observe(e,{...t,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}return this}disconnect(){this.e.disconnect(),this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style.sheet;if(e)for(let t=e.cssRules.length-1;t>=0;t--)e.deleteRule(t);this.style.remove(),this.style=null}match(e){for(let t in this.config.rules){let s=this.config.rules[t],l=this.matches[t],{symbol:R,native:M}=s;if(l&&l.test(e))return{origin:"match",config:s};if(R&&e.startsWith(R))return{origin:"symbol",config:s};if(M&&e.startsWith(M+":"))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 V.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(S.config,e),this.cache(),!this.style)return;let t=document.createElement("style");t.title="master",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 R=this.ruleBy[l];if(!(!R||l in this.classesBy&&this.classesBy[l].some(M=>M in this.countBy))){if(R.natives.length){let M=R.natives[0];for(let y=0;y<t.cssRules.length;y++)if(t.cssRules[y]===M.cssRule){for(let B=0;B<R.natives.length;B++)t.deleteRule(y);this.rules.splice(this.rules.indexOf(R),1);break}}delete this.ruleBy[l],R.config.delete&&R.config.delete.call(this,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:R,order:M,priority:y,hasWhere:v,className:B}=t,a=(i,c,m,d)=>{let f=0,w;c&&(f=i.findIndex(c)),m&&(w=i.findIndex(m)),f===-1&&(f=i.length),(w===void 0||w===-1)&&(w=i.length);let C=i.slice(f,w);for(let r=0;r<C.length;r++){let o=C[r];if(!(o.priority===-1||d&&d(o))&&(o.priority<y||o.priority===y&&(v&&!o.hasWhere||o.order>=M)))return f+r}return f+C.length};if(R){let i=this.rules.findIndex(c=>c.media);if(i!==-1){let c=R.features["max-width"],m=R.features["min-width"];if(c&&m){let d=c.value-m.value;for(let f=l;f>=i;f--){s=f;let w=this.rules[f],C=w.media,r=C.features["max-width"],o=C.features["min-width"];if(!r||!o){s++;break}let n=r.value-o.value;if(n===d){if(v!==w.hasWhere)continue;if(y!==-1){let u=[this.rules[f]];for(let h=f-1;h>=i;h--){let g=this.rules[h];if(g.hasWhere!==v)break;let b=g.media,E=b.features["max-width"],x=b.features["min-width"];if(!E||!x||E.value-x.value!==n)break;u.unshift(this.rules[h])}s=a(this.rules,h=>h.media&&h.priority!==-1&&h.media.features["min-width"]&&h.media.features["max-width"])}break}else if(n>d)break}}else if(m)for(let d=i;d<=l;d++){s=d;let f=this.rules[d],w=f.media,C=w.features["max-width"],r=w.features["min-width"];if(C){if(r)break;continue}let o=r?.value;if(o===m.value){if(!v&&f.hasWhere){s++;continue}if(y!==-1)s=a(this.rules,n=>n.media,n=>n.media&&n.priority!==-1&&n.media.features["min-width"]&&n.media.features["max-width"],n=>!n.media.features["min-width"]&&!n.media.features["max-width"]);else for(let n=d;n<=l;n++){let u=this.rules[n],h=u.media,g=h.features["min-width"];if(!h.features["max-width"]){if(u.hasWhere!==v||g.value!==o||u.order>=M)break;s=n+1}}break}else{if(o>m.value)break;s++}}else if(c)for(let d=l;d>=i;d--){s=d;let f=this.rules[d],w=f.media,C=w.features["max-width"];if(w.features["min-width"])continue;let o=C?.value;if(!o||o>c.value){s++;break}else if(o===c.value){if(v&&!f.hasWhere)continue;if(y!==-1)s=a(this.rules,n=>n.media,n=>n.media&&n.priority!==-1&&n.media.features["min-width"]&&n.media.features["max-width"],n=>!n.media.features["min-width"]&&!n.media.features["max-width"]);else{let n=[this.rules[d]];for(let u=d-1;u>=i;u--){let h=this.rules[u],g=h.media,b=g.features["min-width"],E=g.features["max-width"];if(!b&&(!E||E.value!==o||h.hasWhere!==v))break;n.unshift(h)}for(let u=0;u<n.length;u++){let h=n[u];if(!h.media.features["min-width"]){if(h.order>=M)break;s=d-n.length+2+u}}}break}}}if(s===void 0)if(i===-1)s=l+1;else if(y!==-1)s=i+a(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 m=this.rules[c];if(m.priority!==-1||!m.hasWhere||m.order>=M){s=c;break}}s===void 0&&(s=c)}else for(let c=i;c<=l;c++){s=c;let m=this.rules[c],d=m.media;if(m.priority!==-1||d.features["max-width"]||d.features["min-width"])break;if(m.hasWhere)s++;else if(m.order>=M)break}}else if(y===-1)if(v)s=this.rules.findIndex(i=>!i.hasWhere||i.media||i.priority!==-1||i.order>=M),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>=M||c.priority!==-1)){s=i;break}}s===void 0&&(s=i)}else s=a(this.rules,void 0,i=>i.media);if(this.rules.splice(s,0,t),this.ruleBy[B]=t,this.style){let i=this.style.sheet,c=0,m=d=>{let f=this.rules[d];if(f){if(!f.natives.length)return m(d-1);let w=f.natives[f.natives.length-1].cssRule;for(let C=0;C<i.cssRules.length;C++)if(i.cssRules[C]===w){c=C+1;break}}};m(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)}}}}get text(){return this.rules.map(e=>e.text).join("")}},k=A;T(k,"root"),T(k,"config",S.config),T(k,"instances",[]),T(k,"refresh",e=>{for(let t of A.instances)t.refresh(e)});F&&(window.MasterCSS=k);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":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 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var s=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var a=(e,r)=>{for(var t in r)s(e,t,{get:r[t],enumerable:!0})},f=(e,r,t,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of d(r))!p.call(e,n)&&n!==t&&s(e,n,{get:()=>r[n],enumerable:!(c=o(r,n))||c.enumerable});return e};var g=e=>f(s({},"__esModule",{value:!0}),e);var y={};a(y,{renderIntoHTML:()=>l});module.exports=g(y);var i=require("./render-from-html");function l(e,r){if(!e)return;let t=`<style id="master">${(0,i.renderFromHTML)(e,r)}</style>`;switch(r?.precedence??"highest"){case"highest":return e.replace(/<\/body>/,`${t}$&`);case"higher":return e.replace(/<\/head>/,`${t}$&`);default:return e.replace(/(<link[^>]*?rel="styleSheet".*?>|<style.*?>|<\/head>)/,`${t}$1`)}}0&&(module.exports={renderIntoHTML});
|
package/dist/cjs/rule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(u,i)=>{for(var s in i)Q(u,s,{get:i[s],enumerable:!0})},xe=(u,i,s,y)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of de(i))!pe.call(u,v)&&v!==s&&Q(u,v,{get:()=>i[v],enumerable:!(y=ge(i,v))||y.enumerable});return u};var ye=u=>xe(Q({},"__esModule",{value:!0}),u);var ve={};me(ve,{Rule:()=>F});module.exports=ye(ve);var q=require("./constants/sorted-selectors"),$=require("./constants/start-symbol"),ce=require("./utils/css-escape");function oe(u){let i=typeof Buffer<"u"?Buffer:null;return!!(i&&u instanceof i||u instanceof Date||u instanceof RegExp)}function le(u){if(typeof Buffer<"u"&&Buffer&&u instanceof Buffer){let i=Buffer.alloc(u.length);return u.copy(i),i}else{if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp)return new RegExp(u);throw new Error("Unexpected situation")}}function fe(u){let i=[];return u.forEach(function(s,y){typeof s=="object"&&s!==null?Array.isArray(s)?i[y]=fe(s):oe(s)?i[y]=le(s):i[y]=A({},s):i[y]=s}),i}function re(u,i){return i==="__proto__"?void 0:u[i]}function A(...u){let i={},s,y;return u.forEach(function(v){typeof v!="object"||v===null||Array.isArray(v)||Object.keys(v).forEach(function(j){if(y=re(i,j),s=re(v,j),s!==i)if(typeof s!="object"||s===null){i[j]=s;return}else if(Array.isArray(s)){i[j]=fe(s);return}else if(oe(s)){i[j]=le(s);return}else if(typeof y!="object"||y===null||Array.isArray(y)){i[j]=A({},s);return}else{i[j]=A(y,s);return}})}),i}var Se={unit:"",order:0,separators:[","]},F=class{constructor(i,s={},y){this.className=i;this.meta=s;this.css=y;this.config=A(Se,s.config);let{unit:v,order:j,colored:C,native:
|
|
1
|
+
var Q=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(u,i)=>{for(var s in i)Q(u,s,{get:i[s],enumerable:!0})},xe=(u,i,s,y)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of de(i))!pe.call(u,v)&&v!==s&&Q(u,v,{get:()=>i[v],enumerable:!(y=ge(i,v))||y.enumerable});return u};var ye=u=>xe(Q({},"__esModule",{value:!0}),u);var ve={};me(ve,{Rule:()=>F});module.exports=ye(ve);var q=require("./constants/sorted-selectors"),$=require("./constants/start-symbol"),ce=require("./utils/css-escape");function oe(u){let i=typeof Buffer<"u"?Buffer:null;return!!(i&&u instanceof i||u instanceof Date||u instanceof RegExp)}function le(u){if(typeof Buffer<"u"&&Buffer&&u instanceof Buffer){let i=Buffer.alloc(u.length);return u.copy(i),i}else{if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp)return new RegExp(u);throw new Error("Unexpected situation")}}function fe(u){let i=[];return u.forEach(function(s,y){typeof s=="object"&&s!==null?Array.isArray(s)?i[y]=fe(s):oe(s)?i[y]=le(s):i[y]=A({},s):i[y]=s}),i}function re(u,i){return i==="__proto__"?void 0:u[i]}function A(...u){let i={},s,y;return u.forEach(function(v){typeof v!="object"||v===null||Array.isArray(v)||Object.keys(v).forEach(function(j){if(y=re(i,j),s=re(v,j),s!==i)if(typeof s!="object"||s===null){i[j]=s;return}else if(Array.isArray(s)){i[j]=fe(s);return}else if(oe(s)){i[j]=le(s);return}else if(typeof y!="object"||y===null||Array.isArray(y)){i[j]=A({},s);return}else{i[j]=A(y,s);return}})}),i}var Se={unit:"",order:0,separators:[","]},F=class{constructor(i,s={},y){this.className=i;this.meta=s;this.css=y;this.config=A(Se,s.config);let{unit:v,order:j,colored:C,native:N,analyze:Y,transform:Z,declare:H,create:J}=this.config,{scope:K,important:ae,functions:ue}=y.config,{themeNames:X,colorNames:G,colorThemesMap:ee,selectors:W,breakpoints:te,mediaQueries:z,themeAffectedClassesBy:he,globalValues:D}=y,ie=he[i];this.order=j,J&&J.call(this,i);let _,ne,I,B,w;if(s.origin==="semantics"){let[g,f]=s.value;B=i.slice(g.length),_=f}else{let g;if(Y)[g,I]=Y.call(this,i);else if(s.origin==="match"){let r=i.indexOf(":");this.prefix=i.slice(0,r+1),this.prefix.includes("(")?(this.prefix=void 0,g=i):g=i.slice(r+1)}else s.origin==="symbol"&&(this.symbol=i[0],g=i.slice(1));w=[];let f=this,a=this.values,m=[","];this.config.separators.length&&m.push(...this.config.separators);let n="",t=0;(function r(e,c,l,o=void 0,h=[],b=[],d){let k=o===void 0,S,M=p=>p==="'"||p==='"',V=()=>S=n.length,O=()=>{if(n){let p=n,x=k?p:n.slice(S);if(n="",T="",a&&x in a&&!h.includes(x)){let R=t;t=0,r(a[x].toString(),c,void 0,o,[...h,x],b,d),t=R,k||(n=n.slice(0,S)+n)}else if(D&&x in D&&!b.includes(x)){let R=t;t=0,r(D[x].toString(),c,void 0,o,h,[...b,x],d),t=R,k||(n=n.slice(0,S)+n)}else if(k){let R=!d&&f.analyzeUnitValue(x,c);w.push({value:R?.value??x,unit:R?.unit})}else{let R=!d&&f.analyzeUnitValue(x,c);n=R?p.slice(0,S)+R.value+R.unit:p}V()}},E=M(l);V();let T="";for(;t<e.length;t++){let p=e[t];if(p===l){if(E){n+=p;let x=0;for(let R=n.length-2;n[R]==="\\";R--)x++;if(x%2)continue}else O(),n+=p;return}else if(!E&&p in $.START_SYMBOL){let x=p==="("&&T&&ue?.[T];x?.name&&(n=n.slice(0,n.length-T.length)+x.name,T=x.name),n+=p,t++;let R=$.START_SYMBOL[p];r(e,x?.unit??c,R,T||o||"",h,b,d||!!x?.transform),x?.transform&&(n=n.slice(0,S+T.length+1)+x.transform.call(f,n.slice(S+T.length+1,-1))+n.slice(-1)),k&&(M(R)?(w.push(n),n=""):O()),T=""}else if((p==="|"||p===" ")&&l!=="}"&&(!E||o==="path"))O(),k||(n+=" ",S++);else{if(!E){if(p==="."){if(isNaN(+e[t+1]))break;e[t-1]==="-"&&(n+="0")}else if(m.includes(p)){O(),k?w.push(p):(n+=p,S++);continue}else if(k&&(p==="#"&&(n||w.length&&e[t-1]!=="|"&&w[t-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(p)))break;T+=p}n+=p}}o===void 0&&O()})(g,v),B=g.slice(t)}B[0]==="!"&&(this.important=!0,B=B.slice(1));let se=g=>{let f=g.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,r)=>r%3?t:t.replace(/_/g," ")).join(""),a=[],m="",n=0;for(let t=0;t<f.length;t++){let r=f[t];if(r==="\\"){m+=r+f[++t];continue}!n&&r===","?(a.push(m),m=""):(m+=r,n&&r===")"?n--:r==="("&&n++)}return m&&a.push(m),a};this.prefixSelectors=I?se(I):[""];let P=B.split("@"),U=P[0];if(U){this.vendorSuffixSelectors={};let g=(t,r,e,c)=>{for(let[l,o]of r)if(l.test(t)){for(let h of o)g(t.replace(l,h),r,e,!0);return}c&&e.push(t)},f=[];""in W?g(U,W[""],f,!0):f.push(U);let a={};for(let[t,r]of Object.entries(W)){if(!t)continue;let e=[];for(let c of f)g(c,r,e,!1);e.length&&(a[t]=e)}let m=(t,r)=>{let e=r.reduce((c,l)=>(c.push(...se(l)),c),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},n=Object.keys(a);if(n.length)for(let t of n)m(t,a[t]);else m("",f);for(let t of Object.values(this.vendorSuffixSelectors))for(let r of t){this.hasWhere!==!1&&(this.hasWhere=r.includes(":where("));for(let e=0;e<q.SORTED_SELECTORS.length;e++)if(r.includes(q.SORTED_SELECTORS[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let g=1;g<P.length;g++){let f=P[g];if(f)if(X.includes(f))this.theme=f;else if(f==="rtl"||f==="ltr")this.direction=f;else{let a,m,n=f.indexOf("_");if(n!==-1)a=f.slice(0,n),m=f.slice(n);else{let t=f.indexOf("(");t!==-1&&(a=f.slice(0,t),m=f.slice(t))}if(!a){a="media";let t=[];this.media={token:f,features:{}};let r=f.split("&");for(let e of r)if(e==="all"||e==="print"||e==="screen"||e==="speech")this.media.type=e;else if(e==="\u{1F5A8}")this.media.type="print";else if(e==="landscape"||e==="portrait")t.push("(orientation:"+e+")");else if(e==="motion"||e==="reduced-motion")t.push("(prefers-reduced-motion:"+(e==="motion"?"no-preference":"reduce")+")");else if(z&&e in z)t.push(z[e]);else{let c={token:e},l="",o="",h=0;e.startsWith("<=")?(o="<=",l="max-width"):e.startsWith(">=")||te[e]?(o=">=",l="min-width"):e.startsWith(">")?(o=">",l="min-width",h=.02):e.startsWith("<")&&(o="<",l="max-width",h=-.02);let b=o?e.replace(o,""):e,d=te[b];switch(l){case"max-width":case"min-width":d?Object.assign(c,this.analyzeUnitValue(d.toString(),"px")):Object.assign(c,this.analyzeUnitValue(b,"px")),c.unit==="px"&&(c.value+=h),this.media.features[l]=c,t.push("("+l+":"+(c.value+c.unit)+")");break}}m="",this.media.type&&(m=this.media.type),t.length&&(m+=(m?" and ":"")+t.join(" and "))}m&&(this.at[a]=(a in this.at?this.at[a]+" and ":"")+m.replace(/_/g," "))}}let L=(g,f)=>{let a,m=(r,e,c)=>{let l="";this.direction&&(l+="[dir="+this.direction+"] ");let o=this.prefixSelectors.map(d=>d+l),h=(d,k)=>o.map(S=>(d?"."+d+" ":"")+(K?K+" ":"")+S).reduce((S,M)=>(S.push(c.reduce((V,O)=>(V.push(M+"."+(0,ce.cssEscape)(k)+O),V),[]).join(",")),S),[]).join(","),b=h(e,i)+(ie?Object.entries(ie).filter(([d])=>this.theme||!C||!e||!d||d===e).map(([d,k])=>k.reduce((S,M)=>S+","+h(this.theme??((C||ne)&&e||d),M),"")).join(""):"")+"{"+r+"}";for(let d of Object.keys(this.at).sort((k,S)=>S==="supports"?-1:1))b="@"+d+" "+this.at[d]+"{"+b+"}";return b},n=[];if(w){let r=this.theme?[this.theme,""]:[g],e,c;for(let l of w)if(typeof l=="string")n.push(l);else{let o=l.value;if(l.unit)o+=l.unit;else if(C&&ee&&G){let h=!1,b=!1;o=o.replace(new RegExp(`(^|,| |\\()((?:${G.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(d,k,S,M)=>{b=!0;let V=ee[S];if(V){let O;for(let E of r)if(O=V[E])break;if(O){h=!0;let E=O;if(M){let T=M.endsWith("%")?parseFloat(M)/100:+M;T=isNaN(T)?1:Math.min(Math.max(T,0),1),E+=Math.round(T*255).toString(16).toUpperCase().padStart(2,"0")}return k+E}}return d}),b&&(c=h)}c!==void 0&&!e&&(e=c),n.push(o)}if(f&&(e===void 0?g:!e))return;if(a=n.reduce((l,o,h)=>l+o+(o===","||w[h+1]===","||h===w.length-1?"":" "),""),Z&&(a=Z.call(this,a,this.css.config)),C&&a==="current"&&(a="currentColor"),H){let l,o;if(w.length===1){let h=w[0];typeof h=="object"&&(l=h.value,o=h.unit)}_=H.call(this,o?l:a,o||"")}else _={[N]:a}}let t={};for(let r in _){let e=(o,h)=>{let b=h+((this.important||ae)&&!h.endsWith("!important")?"!important":"");o in t?t[o].push(b):t[o]=[b]},c=r+":",l=_[r];if(typeof l=="object"){ne=!0;for(let o in l)e(o,c+l[o])}else e(g,c+l.toString())}for(let r of Object.values(this.vendorSuffixSelectors))for(let e in t)this.natives.push({text:m(t[e].join(";"),e,r),theme:e})};if(this.theme)L(this.theme,!1);else if(C)for(let g of X)L(g,!0);else L("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(i=>i.text).join("")}resolveValue(i,s){return Number.isNaN(+i)?i:i/(s==="rem"||s==="em"?this.css.config.rootSize:1)+s}analyzeUnitValue(i,s){let y=s??this.config.unit;if(y){let v="",j=i.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(j)if(i.includes("/")){let[C,N]=i.split("/");return{value:+C/+N*100+"%",unit:v}}else{let C=+j[1];return v=j[3]||"",v||((y==="rem"||y==="em")&&(C=C/this.css.config.rootSize),v=y||""),{value:C,unit:v}}}}};0&&(module.exports={Rule});
|
package/dist/config/index.d.ts
CHANGED
|
@@ -9,9 +9,11 @@ import { rules } from './rules';
|
|
|
9
9
|
import { override } from './override';
|
|
10
10
|
import { observe } from './observe';
|
|
11
11
|
import { important } from './important';
|
|
12
|
+
import { keyframes } from './keyframes';
|
|
12
13
|
import { functions, FunctionConfig } from './functions';
|
|
14
|
+
import { precedence } from './precedence';
|
|
13
15
|
declare const config: Config;
|
|
14
|
-
export { config, breakpoints, colors, rootSize, scope, selectors, semantics, themes, rules, override, observe, important, functions };
|
|
16
|
+
export { config, breakpoints, colors, rootSize, scope, selectors, semantics, themes, rules, override, observe, important, functions, keyframes, precedence };
|
|
15
17
|
import type { RuleConfig } from '../rule';
|
|
16
18
|
type Classes = {
|
|
17
19
|
[key: string]: string | Classes;
|
|
@@ -56,4 +58,6 @@ export interface Config {
|
|
|
56
58
|
override?: boolean;
|
|
57
59
|
observe?: boolean;
|
|
58
60
|
functions?: Record<string, FunctionConfig>;
|
|
61
|
+
keyframes?: Record<string, Record<string, Record<string, string | number>>>;
|
|
62
|
+
precedence?: 'highest' | 'higher' | 'lowest';
|
|
59
63
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export declare const keyframes: {
|
|
2
|
+
fade: {
|
|
3
|
+
from: {
|
|
4
|
+
opacity: number;
|
|
5
|
+
};
|
|
6
|
+
to: {
|
|
7
|
+
opacity: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
flash: {
|
|
11
|
+
'from,50%,to': {
|
|
12
|
+
opacity: number;
|
|
13
|
+
};
|
|
14
|
+
'25%,75%': {
|
|
15
|
+
opacity: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
float: {
|
|
19
|
+
'0%': {
|
|
20
|
+
transform: string;
|
|
21
|
+
};
|
|
22
|
+
'50%': {
|
|
23
|
+
transform: string;
|
|
24
|
+
};
|
|
25
|
+
'100%': {
|
|
26
|
+
transform: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
heart: {
|
|
30
|
+
'0%': {
|
|
31
|
+
transform: string;
|
|
32
|
+
};
|
|
33
|
+
'14%': {
|
|
34
|
+
transform: string;
|
|
35
|
+
};
|
|
36
|
+
'28%': {
|
|
37
|
+
transform: string;
|
|
38
|
+
};
|
|
39
|
+
'42%': {
|
|
40
|
+
transform: string;
|
|
41
|
+
};
|
|
42
|
+
'70%': {
|
|
43
|
+
transform: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
jump: {
|
|
47
|
+
'0%,100%': {
|
|
48
|
+
transform: string;
|
|
49
|
+
'animation-timing-function': string;
|
|
50
|
+
};
|
|
51
|
+
'50%': {
|
|
52
|
+
transform: string;
|
|
53
|
+
'animation-timing-function': string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
ping: {
|
|
57
|
+
'75%,100%': {
|
|
58
|
+
transform: string;
|
|
59
|
+
opacity: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
pulse: {
|
|
63
|
+
'0%': {
|
|
64
|
+
transform: string;
|
|
65
|
+
};
|
|
66
|
+
'50%': {
|
|
67
|
+
transform: string;
|
|
68
|
+
};
|
|
69
|
+
'100%': {
|
|
70
|
+
transform: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
rotate: {
|
|
74
|
+
from: {
|
|
75
|
+
transform: string;
|
|
76
|
+
};
|
|
77
|
+
to: {
|
|
78
|
+
transform: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
shake: {
|
|
82
|
+
'0%': {
|
|
83
|
+
transform: string;
|
|
84
|
+
};
|
|
85
|
+
'6.5%': {
|
|
86
|
+
transform: string;
|
|
87
|
+
};
|
|
88
|
+
'18.5%': {
|
|
89
|
+
transform: string;
|
|
90
|
+
};
|
|
91
|
+
'31.5%': {
|
|
92
|
+
transform: string;
|
|
93
|
+
};
|
|
94
|
+
'43.5%': {
|
|
95
|
+
transform: string;
|
|
96
|
+
};
|
|
97
|
+
'50%': {
|
|
98
|
+
transform: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
zoom: {
|
|
102
|
+
from: {
|
|
103
|
+
transform: string;
|
|
104
|
+
};
|
|
105
|
+
'100%': {
|
|
106
|
+
transform: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const precedence = "highest";
|
package/dist/config/rules.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RuleConfig } from '../rule';
|
|
2
2
|
export declare const rules: Record<string, RuleConfig>;
|
package/dist/css.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rule, RuleMeta } from './rule';
|
|
1
|
+
import { Rule, RuleMeta, RuleNative } from './rule';
|
|
2
2
|
import type { Config } from './config';
|
|
3
3
|
export interface MasterCSS {
|
|
4
4
|
readonly style: HTMLStyleElement;
|
|
@@ -17,6 +17,10 @@ export interface MasterCSS {
|
|
|
17
17
|
breakpoints: Record<string, number>;
|
|
18
18
|
mediaQueries: Record<string, string>;
|
|
19
19
|
matches: Record<string, RegExp>;
|
|
20
|
+
keyframes: Record<string, {
|
|
21
|
+
native: RuleNative;
|
|
22
|
+
count: number;
|
|
23
|
+
}>;
|
|
20
24
|
}
|
|
21
25
|
export declare class MasterCSS {
|
|
22
26
|
config?: Config;
|
|
@@ -27,7 +31,8 @@ export declare class MasterCSS {
|
|
|
27
31
|
readonly rules: Rule[];
|
|
28
32
|
readonly ruleBy: Record<string, Rule>;
|
|
29
33
|
readonly countBy: {};
|
|
30
|
-
|
|
34
|
+
readonly observing = false;
|
|
35
|
+
observer: MutationObserver;
|
|
31
36
|
constructor(config?: Config);
|
|
32
37
|
cache(): void;
|
|
33
38
|
observe(targetRoot: Document | ShadowRoot | null, options?: MutationObserverInit): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{breakpoints as e}from"./breakpoints.mjs";import{colors as r}from"./colors.mjs";import{rootSize as s}from"./root-size.mjs";import{scope as o}from"./scope.mjs";import{selectors as t}from"./selectors.mjs";import{semantics as i}from"./semantics.mjs";import{themes as n}from"./themes.mjs";import{rules as m}from"./rules.mjs";import{override as
|
|
1
|
+
import{breakpoints as e}from"./breakpoints.mjs";import{colors as r}from"./colors.mjs";import{rootSize as s}from"./root-size.mjs";import{scope as o}from"./scope.mjs";import{selectors as t}from"./selectors.mjs";import{semantics as i}from"./semantics.mjs";import{themes as n}from"./themes.mjs";import{rules as m}from"./rules.mjs";import{override as p}from"./override.mjs";import{observe as a}from"./observe.mjs";import{important as c}from"./important.mjs";import{keyframes as g}from"./keyframes.mjs";import{functions as l}from"./functions.mjs";import{precedence as f}from"./precedence.mjs";var z={breakpoints:e,colors:r,rootSize:s,scope:o,selectors:t,semantics:i,themes:n,rules:m,override:p,observe:a,important:c,functions:l,keyframes:g,precedence:f};export{e as breakpoints,r as colors,z as config,l as functions,c as important,g as keyframes,a as observe,p as override,f as precedence,s as rootSize,m as rules,o as scope,t as selectors,i as semantics,n as themes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={fade:{from:{opacity:0},to:{opacity:0}},flash:{"from,50%,to":{opacity:1},"25%,75%":{opacity:0}},float:{"0%":{transform:"none"},"50%":{transform:"translateY(-1.25rem)"},"100%":{transform:"none"}},heart:{"0%":{transform:"scale(1)"},"14%":{transform:"scale(1.3)"},"28%":{transform:"scale(1)"},"42%":{transform:"scale(1.3)"},"70%":{transform:"scale(1)"}},jump:{"0%,100%":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(0.8, 0, 1, 1)"},"50%":{transform:"translateY(0)","animation-timing-function":"cubic-bezier(0, 0, 0.2, 1)"}},ping:{"75%,100%":{transform:"scale(2)",opacity:0}},pulse:{"0%":{transform:"none"},"50%":{transform:"scale(1.05)"},"100%":{transform:"none"}},rotate:{from:{transform:"rotate(-360deg)"},to:{transform:"none"}},shake:{"0%":{transform:"none"},"6.5%":{transform:"translateX(-6px) rotateY(-9deg)"},"18.5%":{transform:"translateX(5px) rotateY(7deg)"},"31.5%":{transform:"translateX(-3px) rotateY(-5deg)"},"43.5%":{transform:"translateX(2px) rotateY(3deg)"},"50%":{transform:"none"}},zoom:{from:{transform:"scale(0)"},"100%":{transform:"none"}}};export{r as keyframes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="highest";export{e as precedence};
|