shweet 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -668,6 +668,20 @@ declare const v: {
668
668
  preserve3d: string;
669
669
  };
670
670
 
671
+ interface propCfg {
672
+ rem?: boolean;
673
+ degree?: boolean;
674
+ quote?: boolean;
675
+ delimeter?: string;
676
+ percent?: boolean;
677
+ second?: boolean;
678
+ delimeter_arr?: string;
679
+ percent_arr?: string;
680
+ unit?: string;
681
+ }
682
+ type undefNull = CSSValue | undefined | null | undefNull[];
683
+ declare const Value: (val: CSSValue | undefNull, cfg?: propCfg) => string;
684
+
671
685
  interface saveCSS {
672
686
  dir?: string | string[];
673
687
  mapDir?: string;
@@ -709,4 +723,4 @@ declare class Shweet {
709
723
  }
710
724
  declare function fileName(path: string): string;
711
725
 
712
- export { type CSS, type CSSValue, type CSSinR, type KFCSS, Medyas, Shweet, Var, type VarType, __, type atCSS, f, fileName, type fontFace, log, med, media, ps, supports, v };
726
+ export { type CSS, type CSSValue, type CSSinR, type KFCSS, Medyas, Shweet, Value, Var, type VarType, __, type atCSS, f, fileName, type fontFace, log, med, media, ps, supports, v };
package/dist/index.js CHANGED
@@ -10,4 +10,4 @@ ${H.join(`
10
10
  }`)}),n.IMPORTED.forEach((J)=>{this.FONT(J,C)})}getCID(n,C,$,T=!0){let J=/\.(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,E=/#(?![0-9])([a-zA-Z0-9_-]+)(?![^{]*})/g,G=/\b([a-zA-Z][a-zA-Z0-9]*)\b(?![^{}]*})/g,U=[...new Set(Gn(n,J)),...new Set(Gn(n,E))];if(T&&B($)&&$)U.forEach((R)=>{this.CID.init(R.replaceAll("-","_"),new Set).add(C+R)});return U.push(...new Set(Gn(n,G))),U.some((R)=>this.shaker.includes(R)||this.include.includes(R))}push(n,C,$,T,J){if(!(this.shaker.length&&C.startsWith(".")||C.startsWith("#"))||T)jn(n,$,J),nC(n,$,J,C)}}var u=(n,C)=>{return`${n} {
11
11
  ${C.join(`
12
12
  `)}
13
- }`},Gn=(n,C)=>{return Yn(n.matchAll(C),($)=>$[1])},jn=(n,C,$)=>{try{if(!n[C])n[C]={},n[C][$]=[];if(!n[C][$])n[C][$]=[]}catch(T){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},nC=(n,C,$,T)=>{if(!n[C])n[C]={[$]:T.split(",").map((J)=>J.trim())};else n[C][$].push(...T.split(",").map((J)=>J.trim()))},CC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,($)=>$+C);return n};import{mkdirSync as $C,writeFileSync as TC,existsSync as Kn}from"fs";var nn=(n,C="")=>{if(Kn(n))return!0;return TC(n,C,{flag:"wx"}),!0},Cn=(n)=>{if(Kn(n))return!0;return $C(n,{recursive:!0}),!0};import{writeFileSync as wn}from"fs";function f(n){return function(...C){return{[n]:C}}}class Mn{static attr(n){let[C,$]=q(n)[0];return f(`[${C}="${$}"]`)}static after(n=""){return f("::after"+n)}static before(n=""){return f("::before"+n)}static backdrop(n=""){return f("::backdrop"+n)}static cue(n=""){return f("::cue"+n)}static cueRegion(n=""){return f("::cue-region"+n)}static firstLetter(n=""){return f("::first-letter"+n)}static firstLine(n=""){return f("::first-line"+n)}static marker(n=""){return f("::marker"+n)}static part(n=""){return f("::part"+n)}static placeholder(n=""){return f("::placeholder"+n)}static selection(n=""){return f("::selection"+n)}static slotted(n=""){return f("::slotted"+n)}static spellingError(n=""){return f("::spelling-error"+n)}static targetText(n=""){return f("::target-text"+n)}static viewTransition(n=""){return f("::view-transition"+n)}static viewTransitionGroup(n=""){return f("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return f("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return f("::view-transition-new"+n)}static viewTransitionOld(n=""){return f("::view-transition-old"+n)}static scrollbar(n=""){return f("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return f("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return f("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return f("::-webkit-scrollbar-corner"+n)}static active(n=""){return f(":active"+n)}static anyLink(n=""){return f(":any-link"+n)}static autofill(n=""){return f(":autofill"+n)}static blank(n=""){return f(":blank"+n)}static checked(n=""){return f(":checked"+n)}static current(n=""){return f(":current"+n)}static default(n=""){return f(":default"+n)}static defined(n=""){return f(":defined"+n)}static disabled(n=""){return f(":disabled"+n)}static empty(n=""){return f(":empty"+n)}static enabled(n=""){return f(":enabled"+n)}static first(n=""){return f(":first"+n)}static firstChild(n=""){return f(":first-child"+n)}static firstOfType(n=""){return f(":first-of-type"+n)}static fullscreen(n=""){return f(":fullscreen"+n)}static future(n=""){return f(":future"+n)}static focus(n=""){return f(":focus"+n)}static focusVisible(n=""){return f(":focus-visible"+n)}static focusWithin(n=""){return f(":focus-within"+n)}static host(n=""){return f(":host"+n)}static hover(n=""){return f(":hover"+n)}static indeterminate(n=""){return f(":indeterminate"+n)}static inRange(n=""){return f(":in-range"+n)}static invalid(n=""){return f(":invalid"+n)}static lastChild(n=""){return f(":last-child"+n)}static lastOfType(n=""){return f(":last-of-type"+n)}static left(n=""){return f(":left"+n)}static link(n=""){return f(":link"+n)}static localLink(n=""){return f(":local-link"+n)}static modal(n=""){return f(":modal"+n)}static onlyChild(n=""){return f(":only-child"+n)}static onlyOfType(n=""){return f(":only-of-type"+n)}static optional(n=""){return f(":optional"+n)}static outOfRange(n=""){return f(":out-of-range"+n)}static past(n=""){return f(":past"+n)}static pictureInPicture(n=""){return f(":picture-in-picture"+n)}static placeholderShown(n=""){return f(":placeholder-shown"+n)}static paused(n=""){return f(":paused"+n)}static playing(n=""){return f(":playing"+n)}static readOnly(n=""){return f(":read-only"+n)}static readWrite(n=""){return f(":read-write"+n)}static required(n=""){return f(":required"+n)}static right(n=""){return f(":right"+n)}static root(n=""){return f(":root"+n)}static scope(n=""){return f(":scope"+n)}static target(n=""){return f(":target"+n)}static targetWithin(n=""){return f(":target-within"+n)}static userInvalid(n=""){return f(":user-invalid"+n)}static valid(n=""){return f(":valid"+n)}static visited(n=""){return f(":visited"+n)}static dir(n){return f(`:dir(${n})`)}static has(n){return f(`:has(${n})`)}static host_(n){return f(`:host(${n})`)}static hostContext(n){return f(`:host-context(${n})`)}static is(n){return f(`:is(${n})`)}static lang(n){return f(`:lang(${n})`)}static not(n){return f(`:not(${n})`)}static nthChild(n){return f(`:nth-child(${n})`)}static nthCol(n){return f(`:nth-col(${n})`)}static nthLastChild(n){return f(`:nth-last-child(${n})`)}static nthLastCol(n){return f(`:nth-last-col(${n})`)}static nthLastOfType(n){return f(`:nth-last-of-type(${n})`)}static nthOfType(n){return f(`:nth-of-type(${n})`)}static state(n){return f(`:state(${n})`)}static where(n){return f(`:where(${n})`)}static and(n){return f(", "+n)}static child(n){return f(" > "+n)}static desc(n){return f(" "+n)}static next(n){return f(" + "+n)}static general(n){return f(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return f(n)}}class In{static minmax(n,C){return`minmax(${Q([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${Q([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${Q([n,Q([C],{rem:!0})],{delimeter:", "})})`}}class hn extends In{static attr(n,C,$){return`attr(${Q([n,C,$])})`}static blur(n){return`blur(${Q([n],{rem:!0})})`}static brightness(n){return`brightness(${Q([n])})`}static calc(...n){return`calc(${Q(n,{rem:!0})})`}static circle(n,C){return`circle(${Q([n,C],{rem:!0})})`}static clamp(n,C,$){return`clamp(${Q([n,C,$],{rem:!0,delimeter:", "})})`}static colorMix(n,C,$){return`color-mix(${Q([n,Q(W(C)?C:[C]),Q(W($)?$:[$])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${Q(n,{delimeter:", "})})`}static contrast(n){return`contrast(${Q([n])})`}static cubicBezier(n,C,$,T){return`cubic-bezier(${Q([n,C,$,T],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${Q(n,{rem:!0})})`}static grayscale(n){return`grayscale(${Q([n])})`}static hsl(n,C,$){return`hsl(${Q([n,C,$])})`}static hsla(n,C,$,T){return`hsl(${Q([n,C,$,T?["/",T]:T])})`}static hueRotate(n){return`hue-rotate(${Q([n],{degree:!0})})`}static inset(...n){return`inset(${Q(n,{rem:!0})})`}static invert(n){return`invert(${Q([n])})`}static linearGradient(...n){return`linear-gradient(${Q(n,{delimeter:", "})})`}static matrix(n,C,$,T,J,E){return`matrix(${Q([n,C,$,T,J,E],{delimeter:", "})})`}static matrix3d(n,C,$,T){return`matrix3d(${Q([n,C,$,T],{delimeter:", "})})`}static max(...n){return`max(${Q(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${Q(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${Q([n])})`}static path(n){return`path(${Q([n],{quote:!0})})`}static clipPath(n,C){return`path(${Q([n,Q([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${Q([n])})`}static polygon(...n){return`polygon(${Q(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${Q(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${Q(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,$){return`rgb(${Q([n,C,$])})`}static rgba(n,C,$,T){return`rgba(${Q([n,C,$,T?["/",T]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${Q([n],{degree:!0})})`}static rotate3d(n,C,$,T){return`rotate3d(${Q([Q([n,C,$],{delimeter:", "}),T],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${Q([n],{degree:!0})})`}static rotateY(n){return`rotateY(${Q([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${Q([n],{degree:!0})})`}static saturate(...n){return`saturate(${Q(n)})`}static scale(n,C){return`scale(${Q([n,C],{delimeter:", "})})`}static scale3d(n,C,$){return`scale3d(${Q([n,C,$],{delimeter:", "})})`}static scaleX(n){return`scaleX(${Q([n])})`}static scaleY(n){return`scaleY(${Q([n])})`}static scaleZ(n){return`scaleZ(${Q([n])})`}static sepia(n){return`sepia(${Q([n])})`}static skew(...n){return`skew(${Q(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${Q([n],{degree:!0})})`}static skewY(n){return`skewY(${Q([n],{degree:!0})})`}static steps(n,C){return`steps(${Q([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${Q(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${Q(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${Q([n],{rem:!0})})`}static translateY(n){return`translateY(${Q([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${Q(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${Q([n],{quote:!0})})`}static var(n,C=""){n="--"+A(n);let $=C?", "+Q([C],{rem:!0,delimeter:", "}):"";return`var(${Q([n],{rem:!0})}${$})`}}var fC={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class JC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:$,Shweet:T=[],exportMap:J,webkitKeyframes:E,unit:G="rem"}){this.path=n,this.name=C||qC(n),this.prefix=$??"",this.exportMap=J;let U=W(T)?T:[T];SC.call(this,this.prefix,U,E,J,G);let R=this;Object.assign(this,{get shweet(){return R}}),this.save=({dir:Z,mapDir:g,mapName:S="index",minify:b=!0,shaker:H=[],include:F=[]})=>{let O=B(J)?J:!!g,D=new Rn(this,H,F).load(O),M=W(Z)?Z:[Z],I=b?QC(D.css):D.css;if(M.forEach((h)=>{if(!h)return;let y=h.endsWith("/")?"":"/",Un=h+y+this.name+".css";Cn(h+y),nn(Un),wn(Un,I||"/* --------------*/")}),g){let h=g.endsWith("/")?"":"/",y=g+h+S+".js";Cn(g+h),nn(y),EC(y,D.CID)}return this}}get imported(){return[...this._imported]}}var QC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").trim()},EC=(n,C)=>{let $={};C.forEach((J)=>{q(J).forEach(([E,G])=>{if(!$[E])$[E]=[G];else $[E].push(G)})});let T=[...C.entries()].map(([J,E])=>{return`${J}="${[...E].join(" ")}"`}).sort((J,E)=>J.localeCompare(E,void 0,{numeric:!0}));wn(n,T.length?`export const ${T.join()};`:"export {}");return};function SC(n,C,$=!1,T,J){let E={d:new V("",n,T,J),i:new V("#",n,T,J),c:new V(".",n,T,J),kf:new k(n,$,J),at:new m,font:new l};C.forEach((G)=>{this._imported.add(G.path),G._imported.forEach((U)=>{this._imported.add(U)}),w(E).forEach((U)=>{E[U].load(G[U])})}),w(E).forEach((G)=>{E[G]=E[G].css}),X(this,E)}function qC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{fC as v,an as supports,Mn as ps,N as media,j as med,c as log,qC as fileName,hn as f,bn as __,vn as Var,JC as Shweet,a as Medyas};
13
+ }`},Gn=(n,C)=>{return Yn(n.matchAll(C),($)=>$[1])},jn=(n,C,$)=>{try{if(!n[C])n[C]={},n[C][$]=[];if(!n[C][$])n[C][$]=[]}catch(T){c.e=[`property "${C}" not found!`,{error:"@ensurePropsInitialized"}]}},nC=(n,C,$,T)=>{if(!n[C])n[C]={[$]:T.split(",").map((J)=>J.trim())};else n[C][$].push(...T.split(",").map((J)=>J.trim()))},CC=(n,C)=>{if(C)return n.replaceAll(/\.|\#/g,($)=>$+C);return n};import{mkdirSync as $C,writeFileSync as TC,existsSync as Kn}from"fs";var nn=(n,C="")=>{if(Kn(n))return!0;return TC(n,C,{flag:"wx"}),!0},Cn=(n)=>{if(Kn(n))return!0;return $C(n,{recursive:!0}),!0};import{writeFileSync as wn}from"fs";function f(n){return function(...C){return{[n]:C}}}class Mn{static attr(n){let[C,$]=q(n)[0];return f(`[${C}="${$}"]`)}static after(n=""){return f("::after"+n)}static before(n=""){return f("::before"+n)}static backdrop(n=""){return f("::backdrop"+n)}static cue(n=""){return f("::cue"+n)}static cueRegion(n=""){return f("::cue-region"+n)}static firstLetter(n=""){return f("::first-letter"+n)}static firstLine(n=""){return f("::first-line"+n)}static marker(n=""){return f("::marker"+n)}static part(n=""){return f("::part"+n)}static placeholder(n=""){return f("::placeholder"+n)}static selection(n=""){return f("::selection"+n)}static slotted(n=""){return f("::slotted"+n)}static spellingError(n=""){return f("::spelling-error"+n)}static targetText(n=""){return f("::target-text"+n)}static viewTransition(n=""){return f("::view-transition"+n)}static viewTransitionGroup(n=""){return f("::view-transition-group"+n)}static viewTransitionImagePair(n=""){return f("::view-transition-image-pair"+n)}static viewTransitionNew(n=""){return f("::view-transition-new"+n)}static viewTransitionOld(n=""){return f("::view-transition-old"+n)}static scrollbar(n=""){return f("::-webkit-scrollbar"+n)}static scrollbarThumb(n=""){return f("::-webkit-scrollbar-thumb"+n)}static scrollbarTrack(n=""){return f("::-webkit-scrollbar-track"+n)}static scrollbarCorner(n=""){return f("::-webkit-scrollbar-corner"+n)}static active(n=""){return f(":active"+n)}static anyLink(n=""){return f(":any-link"+n)}static autofill(n=""){return f(":autofill"+n)}static blank(n=""){return f(":blank"+n)}static checked(n=""){return f(":checked"+n)}static current(n=""){return f(":current"+n)}static default(n=""){return f(":default"+n)}static defined(n=""){return f(":defined"+n)}static disabled(n=""){return f(":disabled"+n)}static empty(n=""){return f(":empty"+n)}static enabled(n=""){return f(":enabled"+n)}static first(n=""){return f(":first"+n)}static firstChild(n=""){return f(":first-child"+n)}static firstOfType(n=""){return f(":first-of-type"+n)}static fullscreen(n=""){return f(":fullscreen"+n)}static future(n=""){return f(":future"+n)}static focus(n=""){return f(":focus"+n)}static focusVisible(n=""){return f(":focus-visible"+n)}static focusWithin(n=""){return f(":focus-within"+n)}static host(n=""){return f(":host"+n)}static hover(n=""){return f(":hover"+n)}static indeterminate(n=""){return f(":indeterminate"+n)}static inRange(n=""){return f(":in-range"+n)}static invalid(n=""){return f(":invalid"+n)}static lastChild(n=""){return f(":last-child"+n)}static lastOfType(n=""){return f(":last-of-type"+n)}static left(n=""){return f(":left"+n)}static link(n=""){return f(":link"+n)}static localLink(n=""){return f(":local-link"+n)}static modal(n=""){return f(":modal"+n)}static onlyChild(n=""){return f(":only-child"+n)}static onlyOfType(n=""){return f(":only-of-type"+n)}static optional(n=""){return f(":optional"+n)}static outOfRange(n=""){return f(":out-of-range"+n)}static past(n=""){return f(":past"+n)}static pictureInPicture(n=""){return f(":picture-in-picture"+n)}static placeholderShown(n=""){return f(":placeholder-shown"+n)}static paused(n=""){return f(":paused"+n)}static playing(n=""){return f(":playing"+n)}static readOnly(n=""){return f(":read-only"+n)}static readWrite(n=""){return f(":read-write"+n)}static required(n=""){return f(":required"+n)}static right(n=""){return f(":right"+n)}static root(n=""){return f(":root"+n)}static scope(n=""){return f(":scope"+n)}static target(n=""){return f(":target"+n)}static targetWithin(n=""){return f(":target-within"+n)}static userInvalid(n=""){return f(":user-invalid"+n)}static valid(n=""){return f(":valid"+n)}static visited(n=""){return f(":visited"+n)}static dir(n){return f(`:dir(${n})`)}static has(n){return f(`:has(${n})`)}static host_(n){return f(`:host(${n})`)}static hostContext(n){return f(`:host-context(${n})`)}static is(n){return f(`:is(${n})`)}static lang(n){return f(`:lang(${n})`)}static not(n){return f(`:not(${n})`)}static nthChild(n){return f(`:nth-child(${n})`)}static nthCol(n){return f(`:nth-col(${n})`)}static nthLastChild(n){return f(`:nth-last-child(${n})`)}static nthLastCol(n){return f(`:nth-last-col(${n})`)}static nthLastOfType(n){return f(`:nth-last-of-type(${n})`)}static nthOfType(n){return f(`:nth-of-type(${n})`)}static state(n){return f(`:state(${n})`)}static where(n){return f(`:where(${n})`)}static and(n){return f(", "+n)}static child(n){return f(" > "+n)}static desc(n){return f(" "+n)}static next(n){return f(" + "+n)}static general(n){return f(" ~ "+n)}static withClass(n){if(!n.startsWith("."))throw Error("should start with . or # - class / id");return f(n)}}class In{static minmax(n,C){return`minmax(${Q([n,C],{rem:!0,delimeter:", "})})`}static fitContent(n){return`fit-content(${Q([n],{rem:!0})})`}static repeat(n,...C){return`repeat(${Q([n,Q([C],{rem:!0})],{delimeter:", "})})`}}class hn extends In{static attr(n,C,$){return`attr(${Q([n,C,$])})`}static blur(n){return`blur(${Q([n],{rem:!0})})`}static brightness(n){return`brightness(${Q([n])})`}static calc(...n){return`calc(${Q(n,{rem:!0})})`}static circle(n,C){return`circle(${Q([n,C],{rem:!0})})`}static clamp(n,C,$){return`clamp(${Q([n,C,$],{rem:!0,delimeter:", "})})`}static colorMix(n,C,$){return`color-mix(${Q([n,Q(W(C)?C:[C]),Q(W($)?$:[$])],{delimeter:", "})})`}static conicGradient(...n){return`conic-gradient(${Q(n,{delimeter:", "})})`}static contrast(n){return`contrast(${Q([n])})`}static cubicBezier(n,C,$,T){return`cubic-bezier(${Q([n,C,$,T],{delimeter:", "})})`}static dropShadow(...n){return`drop-shadow(${Q(n,{rem:!0})})`}static grayscale(n){return`grayscale(${Q([n])})`}static hsl(n,C,$){return`hsl(${Q([n,C,$])})`}static hsla(n,C,$,T){return`hsl(${Q([n,C,$,T?["/",T]:T])})`}static hueRotate(n){return`hue-rotate(${Q([n],{degree:!0})})`}static inset(...n){return`inset(${Q(n,{rem:!0})})`}static invert(n){return`invert(${Q([n])})`}static linearGradient(...n){return`linear-gradient(${Q(n,{delimeter:", "})})`}static matrix(n,C,$,T,J,E){return`matrix(${Q([n,C,$,T,J,E],{delimeter:", "})})`}static matrix3d(n,C,$,T){return`matrix3d(${Q([n,C,$,T],{delimeter:", "})})`}static max(...n){return`max(${Q(n,{rem:!0,delimeter:", "})})`}static min(...n){return`min(${Q(n,{rem:!0,delimeter:", "})})`}static opacity(n){return`opacity(${Q([n])})`}static path(n){return`path(${Q([n],{quote:!0})})`}static clipPath(n,C){return`path(${Q([n,Q([C],{quote:!0})],{delimeter:", "})})`}static perspective(n){return`perspective(${Q([n])})`}static polygon(...n){return`polygon(${Q(n,{percent:!0,delimeter:", "})})`}static ray(...n){return`ray(${Q(n,{degree:!0})})`}static radialGradient(...n){return`radial-gradient(${Q(n,{delimeter_arr:", ",percent:!0,delimeter:", "})})`}static repeatingConicGradient(...n){return`repeating-conic-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingLinearGradient(...n){return`repeating-linear-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static repeatingRadialGradient(...n){return`repeating-radial-gradient(${Q(n,{degree:!0,delimeter:", "})})`}static rgb(n,C,$){return`rgb(${Q([n,C,$])})`}static rgba(n,C,$,T){return`rgba(${Q([n,C,$,T?["/",T]:void 0],{delimeter_arr:" "})})`}static rotate(n){return`rotate(${Q([n],{degree:!0})})`}static rotate3d(n,C,$,T){return`rotate3d(${Q([Q([n,C,$],{delimeter:", "}),T],{degree:!0,delimeter:", "})})`}static rotateX(n){return`rotateX(${Q([n],{degree:!0})})`}static rotateY(n){return`rotateY(${Q([n],{degree:!0})})`}static rotateZ(n){return`rotateZ(${Q([n],{degree:!0})})`}static saturate(...n){return`saturate(${Q(n)})`}static scale(n,C){return`scale(${Q([n,C],{delimeter:", "})})`}static scale3d(n,C,$){return`scale3d(${Q([n,C,$],{delimeter:", "})})`}static scaleX(n){return`scaleX(${Q([n])})`}static scaleY(n){return`scaleY(${Q([n])})`}static scaleZ(n){return`scaleZ(${Q([n])})`}static sepia(n){return`sepia(${Q([n])})`}static skew(...n){return`skew(${Q(n,{degree:!0,delimeter:", "})})`}static skewX(n){return`skewX(${Q([n],{degree:!0})})`}static skewY(n){return`skewY(${Q([n],{degree:!0})})`}static steps(n,C){return`steps(${Q([n,C],{delimeter:", "})})`}static translate(...n){return`translate(${Q(n,{rem:!0,delimeter:", "})})`}static translate3d(...n){return`translate3d(${Q(n,{rem:!0,delimeter:", "})})`}static translateX(n){return`translateX(${Q([n],{rem:!0})})`}static translateY(n){return`translateY(${Q([n],{rem:!0})})`}static translateZ(...n){return`translateZ(${Q(n,{rem:!0,delimeter:", "})})`}static url(n){return`url(${Q([n],{quote:!0})})`}static var(n,C=""){n="--"+A(n);let $=C?", "+Q([C],{rem:!0,delimeter:", "}):"";return`var(${Q([n],{rem:!0})}${$})`}}var fC={important:" !important",visible:"visible",hidden:"hidden",auto:"auto",none:"none",clip:"clip",scroll:"scroll",initial:"initial",inherit:"inherit",flex:"flex",center:"center",flex_start:"flex-start",flex_end:"flex-end",space_evenly:"space-evenly",stretch:"stretch",wrap:"wrap",column:"column",column_reverse:"column-reverse",row:"row",row_reverse:"row-reverse",space_between:"space-between",space_around:"space-around",pr100:"100%",pr50:"50%",i100vh:"100vh",i100vw:"100vw",block:"block",sticky:"sticky",fixed:"fixed",absolute:"absolute",relative:"relative",pointer:"pointer",grabbing:"grabbing",checkbox:"checkbox",solid:"solid",inset:"inset",bold:"bold",currentColor:"currentColor",forwards:"forwards",text:"text",norepeat:"no-repeat",nowrap:"nowrap",difference:"difference",preserve3d:"preserve-3d"};class JC{path;name;prefix;exportMap;_imported=new Set;save;constructor({__filename:n,name:C,prefix:$,Shweet:T=[],exportMap:J,webkitKeyframes:E,unit:G="rem"}){this.path=n,this.name=C||qC(n),this.prefix=$??"",this.exportMap=J;let U=W(T)?T:[T];SC.call(this,this.prefix,U,E,J,G);let R=this;Object.assign(this,{get shweet(){return R}}),this.save=({dir:Z,mapDir:g,mapName:S="index",minify:b=!0,shaker:H=[],include:F=[]})=>{let O=B(J)?J:!!g,D=new Rn(this,H,F).load(O),M=W(Z)?Z:[Z],I=b?QC(D.css):D.css;if(M.forEach((h)=>{if(!h)return;let y=h.endsWith("/")?"":"/",Un=h+y+this.name+".css";Cn(h+y),nn(Un),wn(Un,I||"/* --------------*/")}),g){let h=g.endsWith("/")?"":"/",y=g+h+S+".js";Cn(g+h),nn(y),EC(y,D.CID)}return this}}get imported(){return[...this._imported]}}var QC=(n)=>{return n.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s*([{}:;,])\s*/g,"$1").trim()},EC=(n,C)=>{let $={};C.forEach((J)=>{q(J).forEach(([E,G])=>{if(!$[E])$[E]=[G];else $[E].push(G)})});let T=[...C.entries()].map(([J,E])=>{return`${J}="${[...E].join(" ")}"`}).sort((J,E)=>J.localeCompare(E,void 0,{numeric:!0}));wn(n,T.length?`export const ${T.join()};`:"export {}");return};function SC(n,C,$=!1,T,J){let E={d:new V("",n,T,J),i:new V("#",n,T,J),c:new V(".",n,T,J),kf:new k(n,$,J),at:new m,font:new l};C.forEach((G)=>{this._imported.add(G.path),G._imported.forEach((U)=>{this._imported.add(U)}),w(E).forEach((U)=>{E[U].load(G[U])})}),w(E).forEach((G)=>{E[G]=E[G].css}),X(this,E)}function qC(n){return n.split("/").slice(-1)[0].split(".")[0]}export{fC as v,an as supports,Mn as ps,N as media,j as med,c as log,qC as fileName,hn as f,bn as __,vn as Var,Q as Value,JC as Shweet,a as Medyas};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shweet",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "CSS in TS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",