@tenoxui/moxie 0.6.6 → 0.6.8

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.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var W=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var P=(A,s,t)=>s in A?R(A,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[s]=t,x=(A,s)=>{for(var t in s||(s={}))j.call(s,t)&&P(A,t,s[t]);if(W)for(var t of W(s))V.call(s,t)&&P(A,t,s[t]);return A};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class S{constructor({property:s={},values:t={},classes:r={}}={}){this.property=x({moxie:({key:i,secondValue:n})=>n?null:i},s),this.values=t,this.classes=r}toKebabCase(s){if(/^(webkit|moz|ms|o)[A-Z]/.test(s)){const t=s.match(/^(webkit|moz|ms|o)/);if(t){const r=t[0];return`-${r}${s.slice(r.length).replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`}}return s.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}escapeCSSSelector(s){return s.replace(/^(\d)/,"\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g,"\\$1")}getAllClassNames(s){if(!s)return[];const t=new Set;return Object.entries(s).forEach(([r,i])=>{i&&typeof i=="object"&&Object.keys(i).forEach(n=>{t.add(n)})}),Array.from(t)}getTypePrefixes(s=[]){const t=this.property,r=this.classes,i=Object.keys(t);if(!r)return[...i,...s].sort((l,e)=>e.length-l.length);const o=[...this.getAllClassNames(r)];return[...i,...o,...s].sort((l,e)=>e.length-l.length)}regexp(s){const t=this.getTypePrefixes(s).join("|"),r="\\[[^\\]]+\\]",i="\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)",n="\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}",o="[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?:-(?:"+r+"|"+i+"|"+n+"))|"+r+"|"+i+"|"+n,l=`(${t}|\\[[^\\]]+\\])`,e="(?:-)",h="(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+r+"|"+n+"|"+i+"|(?:\\$[^\\s\\/]+))",u="([a-zA-Z%]*)",c="(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+r+"|"+n+"|"+i+"|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";return{prefix:o,type:l,separator:e,value:h,unit:u,secondValuePattern:c,all:"^(?:("+o+"):)?"+l+e+h+u+c+"$"}}parse(s,t){const r=this.regexp(t),i=s.match(new RegExp(r.all));if(i){const[,o,l,e,h,u,c]=i;return[o,l,e,h||"",u,c]}const n=s.match(new RegExp(`^(?:(${r.prefix}):)?${r.type}$`));return n?[n[1],n[2],"","",void 0,void 0]:null}constructRaw(s,t,r,i,n,o){return`${s?`${s}:`:""}${t}${r?"-":""}${r}${i}${n?`/${n}${o}`:""}`}processValue(s,t,r){if(!s)return"";const i=n=>n.replace(/\{([^}]+)\}/g,(o,l)=>{const e=this.values,h=e!==null?typeof e[r]=="object"?e[r][l]:e[l]:void 0;return typeof h=="string"?h:o});if(typeof this.values=="object"&&this.values!==null&&(this.values[r]&&typeof this.values[r]=="object"&&this.values[r][s]||this.values[s]))return typeof this.values[r]=="object"&&this.values[r]!==null?this.values[r][s]:this.values[s];if(s.startsWith("$"))return`var(--${s.slice(1)})`;if(s.startsWith("[")&&s.endsWith("]")||s.startsWith("(")&&s.endsWith(")")){const n=s.slice(1,-1).replace(/\\\_/g,"m0x13c55").replace(/\_/g," ").replace(/m0x13c55/g,"_");return n.includes("{")?i(n):n.startsWith("--")?`var(${n})`:n}return s+(t||"")}processShorthand(s="",t="",r="",i,n="",o="",l){const e=this.property[s];if(typeof e=="object"&&!Array.isArray(e)&&!("property"in e))return null;const h=/^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;let u=null,c=t||"";const $=c.match(h);if($&&(u=$[1].trim(),c=$[2].trim()),(typeof e=="string"&&!e.includes(":")||Array.isArray(e))&&(!t||t.includes(u+":")||n))return null;let p;t.includes(u+":")?p=t.startsWith("(")?`(${c})`:`[${c}]`:p=t;const f=this.processValue(p,r,s),y=this.processValue(n,o,s);if(s.startsWith("[")&&s.endsWith("]")){if(!t||n)return null;const a=s.slice(1,-1).split(",").map(m=>m.trim().startsWith("--")?String(m.trim()):this.toKebabCase(String(m.trim())));return{className:this.constructRaw(i,s,t,r),cssRules:a.length===1?a[0]:a,value:f,prefix:i}}if(e){if(typeof e=="object"&&"property"in e){const m=e.group&&this.values[e.group][f]?this.values[e.group][f]:r?t:f,d=typeof e.property=="function"?e.property({value:t.startsWith("[")?f:m,unit:t.startsWith("[")?"":r,secondValue:t.startsWith("[")?"":o?n:y,secondUnit:t.startsWith("[")?"":o,key:u,raw:l}):e.property,g=e.value||"{0}";let b;if(typeof g=="function")b=g({value:m,unit:r,secondValue:o?n:y,secondUnit:o,key:u,raw:l});else if(typeof g=="string"){const C=e.group||s,w=this.processValue(p,r,C);this.values[C]&&typeof this.values[C]=="object"&&this.values[C][p]?b=this.values[C][p]:g.includes("{")?b=this.parseValuePattern(C,g,w,"",y,""):typeof g=="string"&&!g.includes("{")?b=g:b=f}else if(Array.isArray(g)){if(!g.includes(t+r)||n)return null;b=t+r}else b=null;return(typeof e.property=="string"||Array.isArray(e.property))&&typeof g=="string"&&(t.includes(u+":")||!g.includes("{1")&&n)||(typeof e.property=="string"||Array.isArray(e.property))&&g===null||typeof e.property=="string"&&e.property.includes(":")&&t||(typeof e.property=="string"||Array.isArray(e.property))&&typeof e.value=="string"&&!e.value.includes("{")&&t?null:{className:this.constructRaw(i,s,t,r,n,o),cssRules:d?Array.isArray(d)?d:typeof d=="string"&&(d.includes(":")||d.includes("value:"))?d.includes("value:")?d.slice(6):this.toKebabCase(String(d)):this.toKebabCase(String(d)):null,value:g===null||d===null||d.includes(":")||d.includes("value:")?null:t.startsWith("[")?f:b,prefix:i}}const a=typeof e=="function"?e({value:t.startsWith("[")?f:r?t:f,unit:t.startsWith("[")?"":r,secondValue:t.startsWith("[")?"":o?n:y,secondUnit:t.startsWith("[")?"":o,key:u,raw:l}):e;return{className:this.constructRaw(i,s,t,r,n,o),cssRules:a?Array.isArray(e)?a:typeof a=="string"&&(a.includes(":")||a.startsWith("value:"))?a.startsWith("value:")?a.slice(6):this.toKebabCase(String(a)):this.toKebabCase(String(a)):null,value:typeof a=="string"&&a.includes(":")?null:f,prefix:i}}return null}parseValuePattern(s,t,r,i,n,o){if(!t.includes("{0}")&&!t.includes("{1")&&!t.includes("||"))return t;const[l,e]=t.split("||").map(c=>c.trim()),h=this.processValue(r,i,s),u=this.processValue(n,o,s);if(t.includes("{0}")&&t.includes("{1")||t.includes("{1")){let c=l;if(r&&(c=c.replace(/\{0\}/g,h)),t.includes("{1")){t.includes("{1}")&&(n?c=n.startsWith("[")?u:c.replace(/\{1\}/g,u):c=e||l);const $=/\{1([^}]*)\}/g;let p;for(;(p=$.exec(c))!==null;){const f=p[0],y=p[1].trim();let a=u;!a&&y.includes("|")?a=y.split("|")[1].trim():a||(a=""),c=r.startsWith("[")?h:c.replace(f,a)}}return r?c:e||l}else return r?r.startsWith("[")?h:l.replace(/\{0\}/g,h):e||l}getParentClass(s){return Object.keys(this.classes).filter(t=>Object.prototype.hasOwnProperty.call(this.classes[t],s))}processCustomClass(s,t="",r="",i="",n="",o=""){if(!s)return null;const l=this.getParentClass(s),e=t&&s.endsWith(`-${t}${r}`);if(l.length>0){const h=l.map(u=>{const c=this.classes[u];if(!c||t&&!e&&c[s]&&!c[s].includes("{0}")&&!c[s].includes("|"))return null;const $=this.parseValuePattern(s,c[s]||"",t,r,n,o);return`${this.toKebabCase(String(u))}: ${$}`}).filter(Boolean).join("; ");return{className:e?s:this.constructRaw(i,s,t,r,n,o),cssRules:h,value:null,prefix:i}}return null}process(s){try{const t=Array.isArray(s)?s:s.split(/\s+/),r=[];for(const i of t)try{if(!i)continue;const n=this.parse(i);if(!n)continue;const[o,l,e,h,u,c]=n;if(!l)continue;const $=this.getParentClass(`${l}-${e}`).length>0?`${l}-${e}`:l;try{const p=this.processCustomClass($,e,h,o,u,c);if(p){const{className:f,cssRules:y,prefix:a}=p;if(!y||y==="null")continue;r.push({className:this.escapeCSSSelector(f),cssRules:y,value:null,prefix:a,raw:[...n,this.constructRaw(a,l,e,h,u,c)]});continue}}catch(p){console.warn(`Error processing custom class "${i}":`,p)}try{const p=this.processShorthand(l,e,h,o,u,c,n);if(p){const{className:f,cssRules:y,value:a,prefix:m}=p;if(!y||y==="null")continue;r.push({className:this.escapeCSSSelector(f),cssRules:y,value:a,prefix:m,raw:[...n,this.constructRaw(o,l,e,h,u,c)]})}}catch(p){console.warn(`Error processing shorthand "${i}":`,p)}}catch(n){console.warn(`Failed to process class \`${i}\`:`,n)}return r}catch(t){return console.error("Critical error in process method:",t),[]}}}exports.TenoxUI=S;exports.default=S;
1
+ "use strict";var w=Object.defineProperty;var x=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var W=(m,t,s)=>t in m?w(m,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):m[t]=s,P=(m,t)=>{for(var s in t||(t={}))j.call(t,s)&&W(m,s,t[s]);if(x)for(var s of x(t))V.call(t,s)&&W(m,s,t[s]);return m};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class R{constructor({property:t={},values:s={},classes:e={},prefixChars:n=[]}={}){this.property=P({moxie:({key:i,secondValue:l})=>l?null:i},t),this.values=s,this.classes=e,this.prefixChars=n.map(this.escapeRegex)}toKebabCase(t){if(/^(webkit|moz|ms|o)[A-Z]/.test(t)){const s=t.match(/^(webkit|moz|ms|o)/);if(s){const e=s[0];return`-${e}${t.slice(e.length).replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`}}return t.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`)}escapeCSSSelector(t){return t.replace(/^(\d)/,"\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g,"\\$1")}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\/\\-]/g,"\\$&")}getAllClassNames(t){if(!t)return[];const s=new Set;return Object.entries(t).forEach(([e,n])=>{n&&typeof n=="object"&&Object.keys(n).forEach(i=>{s.add(i)})}),Array.from(s)}getTypePrefixes(t=[]){const s=this.classes,e=Object.keys(this.property);if(!s)return[...e,...t].sort((l,c)=>c.length-l.length);const i=[...this.getAllClassNames(s)];return[...e,...i,...t].sort((l,c)=>c.length-l.length)}regexp(t){const s=this.getTypePrefixes(t).map(this.escapeRegex).join("|"),e="\\[[^\\]]+\\]",n="\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)",i="\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}",l=`[${["a-zA-Z0-9_\\-",...this.prefixChars].join("")}]`,c=l+"+|"+l+"+(?:-(?:"+e+"|"+n+"|"+i+"))|"+l+"+(?:-(?:"+e+"|"+n+"|"+i+"))?(?:\\/[a-zA-Z0-9_\\-]+)|"+e+"|"+n+"|"+i,r=`(${s}|\\[[^\\]]+\\])`,h="(?:-)",u="(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+e+"|"+i+"|"+n+"|(?:\\$[^\\s\\/]+))",a="([a-zA-Z%]*)",$="(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+e+"|"+i+"|"+n+"|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";return{prefix:c,type:r,separator:h,value:u,unit:a,secondValuePattern:$,all:"^(?:("+c+"):)?"+r+h+u+a+$+"$"}}parse(t,s){const e=this.regexp(s),n=t.match(new RegExp(e.all));if(n){const[,l,c,r,h,u,a]=n;return[l,c,r,h||"",u,a]}const i=t.match(new RegExp(`^(?:(${e.prefix}):)?${e.type}$`));return i?[i[1],i[2],"","",void 0,void 0]:null}constructRaw(t,s,e,n,i,l){return`${t?`${t}:`:""}${s}${e?"-":""}${e}${n}${i?`/${i}${l}`:""}`}processValue(t,s,e){if(!t)return"";const n=i=>i.replace(/\{([^}]+)\}/g,(l,c)=>{const r=this.values,h=r!==null?typeof r[e]=="object"?r[e][c]:r[c]:void 0;return typeof h=="string"?h:l});if(typeof this.values=="object"&&this.values!==null&&(this.values[e]&&typeof this.values[e]=="object"&&this.values[e][t]||this.values[t]))return typeof this.values[e]=="object"&&this.values[e]!==null?this.values[e][t]:this.values[t];if(t.startsWith("$"))return`var(--${t.slice(1)})`;if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")")){const i=t.slice(1,-1).replace(/\\\_/g,"m0x13c55").replace(/\_/g," ").replace(/m0x13c55/g,"_");return i.includes("{")?n(i):i.startsWith("--")?`var(${i})`:i}return t+(s||"")}processShorthand(t="",s="",e="",n,i="",l="",c){const r=this.property[t];if(typeof r=="object"&&!Array.isArray(r)&&!("property"in r))return null;const h=/^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;let u=null,a=s||"";const $=a.match(h);if($&&(u=$[1].trim(),a=$[2].trim()),(typeof r=="string"&&!r.includes(":")||Array.isArray(r))&&(!s||s.includes(u+":")||i))return null;let p;s.includes(u+":")?p=s.startsWith("(")?`(${a})`:`[${a}]`:p=s;const f=this.processValue(p,e,t),y=this.processValue(i,l,t);if(t.startsWith("[")&&t.endsWith("]")){if(!s||i)return null;const o=t.slice(1,-1).split(",").map(A=>A.trim().startsWith("--")?String(A.trim()):this.toKebabCase(String(A.trim())));return{className:this.constructRaw(n,t,s,e),cssRules:o.length===1?o[0]:o,value:f,prefix:n}}if(r){if(typeof r=="object"&&"property"in r){const A=r.group&&this.values[r.group][f]?this.values[r.group][f]:e?s:f,d=typeof r.property=="function"?r.property({value:s.startsWith("[")?f:A,unit:s.startsWith("[")?"":e,secondValue:s.startsWith("[")?"":l?i:y,secondUnit:s.startsWith("[")?"":l,key:u,raw:c}):r.property,g=r.value||"{0}";let C;if(typeof g=="function")C=g({value:A,unit:e,secondValue:l?i:y,secondUnit:l,key:u,raw:c});else if(typeof g=="string"){const b=r.group||t,S=this.processValue(p,e,b);this.values[b]&&typeof this.values[b]=="object"&&this.values[b][p]?C=this.values[b][p]:g.includes("{")?C=this.parseValuePattern(b,g,S,"",y,""):typeof g=="string"&&!g.includes("{")?C=g:C=f}else if(Array.isArray(g)){if(!g.includes(s+e)||i)return null;C=s+e}else C=null;return(typeof r.property=="string"||Array.isArray(r.property))&&typeof g=="string"&&(s.includes(u+":")||!g.includes("{1")&&i)||(typeof r.property=="string"||Array.isArray(r.property))&&g===null||typeof r.property=="string"&&r.property.includes(":")&&s||(typeof r.property=="string"||Array.isArray(r.property))&&typeof r.value=="string"&&!r.value.includes("{")&&s?null:{className:this.constructRaw(n,t,s,e,i,l),cssRules:d?Array.isArray(d)?d:typeof d=="string"&&(d.includes(":")||d.includes("value:"))?d.includes("value:")?d.slice(6):this.toKebabCase(String(d)):this.toKebabCase(String(d)):null,value:g===null||d===null||d.includes(":")||d.includes("value:")?null:s.startsWith("[")?f:C,prefix:n}}const o=typeof r=="function"?r({value:s.startsWith("[")?f:e?s:f,unit:s.startsWith("[")?"":e,secondValue:s.startsWith("[")?"":l?i:y,secondUnit:s.startsWith("[")?"":l,key:u,raw:c}):r;return{className:this.constructRaw(n,t,s,e,i,l),cssRules:o?Array.isArray(r)?o:typeof o=="string"&&(o.includes(":")||o.startsWith("value:"))?o.startsWith("value:")?o.slice(6):this.toKebabCase(String(o)):this.toKebabCase(String(o)):null,value:typeof o=="string"&&o.includes(":")?null:f,prefix:n}}return null}parseValuePattern(t,s,e,n,i,l){if(!s.includes("{0}")&&!s.includes("{1")&&!s.includes("||"))return s;const[c,r]=s.split("||").map(a=>a.trim()),h=this.processValue(e,n,t),u=this.processValue(i,l,t);if(s.includes("{0}")&&s.includes("{1")||s.includes("{1")){let a=c;if(e&&(a=a.replace(/\{0\}/g,h)),s.includes("{1")){s.includes("{1}")&&(i?a=i.startsWith("[")?u:a.replace(/\{1\}/g,u):a=r||c);const $=/\{1([^}]*)\}/g;let p;for(;(p=$.exec(a))!==null;){const f=p[0],y=p[1].trim();let o=u;!o&&y.includes("|")?o=y.split("|")[1].trim():o||(o=""),a=e.startsWith("[")?h:a.replace(f,o)}}return e?a:r||c}else return e?e.startsWith("[")?h:c.replace(/\{0\}/g,h):r||c}getParentClass(t){return Object.keys(this.classes).filter(s=>Object.prototype.hasOwnProperty.call(this.classes[s],t))}processCustomClass(t,s="",e="",n="",i="",l=""){if(!t)return null;const c=this.getParentClass(t),r=s&&t.endsWith(`-${s}${e}`);if(c.length>0){const h=c.map(u=>{const a=this.classes[u];if(!a||s&&!r&&a[t]&&!a[t].includes("{0}")&&!a[t].includes("|"))return null;const $=this.parseValuePattern(t,a[t]||"",s,e,i,l);return`${this.toKebabCase(String(u))}: ${$}`}).filter(Boolean).join("; ");return{className:r?t:this.constructRaw(n,t,s,e,i,l),cssRules:h,value:null,prefix:n}}return null}process(t){try{const s=Array.isArray(t)?t:t.split(/\s+/),e=[];for(const n of s)try{if(!n)continue;const i=this.parse(n);if(!i)continue;const[l,c,r,h,u,a]=i;if(!c)continue;const $=this.getParentClass(`${c}-${r}`).length>0?`${c}-${r}`:c;try{const p=this.processCustomClass($,r,h,l,u,a);if(p){const{className:f,cssRules:y,prefix:o}=p;if(!y||y==="null")continue;e.push({className:this.escapeCSSSelector(f),cssRules:y,value:null,prefix:o,raw:[...i,this.constructRaw(o,c,r,h,u,a)]});continue}}catch(p){console.warn(`Error processing custom class "${n}":`,p)}try{const p=this.processShorthand(c,r,h,l,u,a,i);if(p){const{className:f,cssRules:y,value:o,prefix:A}=p;if(!y||y==="null")continue;e.push({className:this.escapeCSSSelector(f),cssRules:y,value:o,prefix:A,raw:[...i,this.constructRaw(l,c,r,h,u,a)]})}}catch(p){console.warn(`Error processing shorthand "${n}":`,p)}}catch(i){console.warn(`Failed to process class \`${n}\`:`,i)}return e}catch(s){return console.error("Critical error in process method:",s),[]}}}exports.TenoxUI=R;exports.default=R;
package/dist/index.d.ts CHANGED
@@ -3,9 +3,11 @@ export declare class TenoxUI {
3
3
  private property;
4
4
  private values;
5
5
  private classes;
6
- constructor({ property, values, classes }?: Config);
6
+ private prefixChars;
7
+ constructor({ property, values, classes, prefixChars }?: Config);
7
8
  toKebabCase(str: string): string;
8
9
  escapeCSSSelector(str: string): string;
10
+ private escapeRegex;
9
11
  private getAllClassNames;
10
12
  private getTypePrefixes;
11
13
  regexp(safelist?: string[]): {
package/dist/index.es.js CHANGED
@@ -1,171 +1,176 @@
1
- var S = Object.defineProperty;
2
- var W = Object.getOwnPropertySymbols;
3
- var R = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
4
- var P = (A, s, t) => s in A ? S(A, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[s] = t, x = (A, s) => {
5
- for (var t in s || (s = {}))
6
- R.call(s, t) && P(A, t, s[t]);
7
- if (W)
8
- for (var t of W(s))
9
- V.call(s, t) && P(A, t, s[t]);
10
- return A;
1
+ var w = Object.defineProperty;
2
+ var x = Object.getOwnPropertySymbols;
3
+ var S = Object.prototype.hasOwnProperty, j = Object.prototype.propertyIsEnumerable;
4
+ var W = (m, t, s) => t in m ? w(m, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : m[t] = s, P = (m, t) => {
5
+ for (var s in t || (t = {}))
6
+ S.call(t, s) && W(m, s, t[s]);
7
+ if (x)
8
+ for (var s of x(t))
9
+ j.call(t, s) && W(m, s, t[s]);
10
+ return m;
11
11
  };
12
12
  class Z {
13
- constructor({ property: s = {}, values: t = {}, classes: r = {} } = {}) {
14
- this.property = x({
13
+ constructor({ property: t = {}, values: s = {}, classes: e = {}, prefixChars: n = [] } = {}) {
14
+ this.property = P({
15
15
  // use moxie-* utility to access all properties and variables
16
16
  // e.g. `moxie-(color:red)` => `color: red`, `moxie-(--my-var:20px_1rem)` => `--my-var: 20px 1rem`
17
- moxie: ({ key: i, secondValue: n }) => n ? null : i
18
- }, s), this.values = t, this.classes = r;
17
+ moxie: ({ key: i, secondValue: l }) => l ? null : i
18
+ }, t), this.values = s, this.classes = e, this.prefixChars = n.map(this.escapeRegex);
19
19
  }
20
- toKebabCase(s) {
21
- if (/^(webkit|moz|ms|o)[A-Z]/.test(s)) {
22
- const t = s.match(/^(webkit|moz|ms|o)/);
23
- if (t) {
24
- const r = t[0];
25
- return `-${r}${s.slice(r.length).replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`)}`;
20
+ toKebabCase(t) {
21
+ if (/^(webkit|moz|ms|o)[A-Z]/.test(t)) {
22
+ const s = t.match(/^(webkit|moz|ms|o)/);
23
+ if (s) {
24
+ const e = s[0];
25
+ return `-${e}${t.slice(e.length).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`)}`;
26
26
  }
27
27
  }
28
- return s.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
28
+ return t.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`);
29
29
  }
30
- escapeCSSSelector(s) {
31
- return s.replace(/^(\d)/, "\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g, "\\$1");
30
+ escapeCSSSelector(t) {
31
+ return t.replace(/^(\d)/, "\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g, "\\$1");
32
32
  }
33
- getAllClassNames(s) {
34
- if (!s) return [];
35
- const t = /* @__PURE__ */ new Set();
36
- return Object.entries(s).forEach(([r, i]) => {
37
- i && typeof i == "object" && Object.keys(i).forEach((n) => {
38
- t.add(n);
33
+ escapeRegex(t) {
34
+ return t.replace(/[.*+?^${}()|[\]\\/\\-]/g, "\\$&");
35
+ }
36
+ getAllClassNames(t) {
37
+ if (!t) return [];
38
+ const s = /* @__PURE__ */ new Set();
39
+ return Object.entries(t).forEach(([e, n]) => {
40
+ n && typeof n == "object" && Object.keys(n).forEach((i) => {
41
+ s.add(i);
39
42
  });
40
- }), Array.from(t);
43
+ }), Array.from(s);
41
44
  }
42
- getTypePrefixes(s = []) {
43
- const t = this.property, r = this.classes, i = Object.keys(t);
44
- if (!r)
45
- return [...i, ...s].sort((l, e) => e.length - l.length);
46
- const o = [...this.getAllClassNames(r)];
47
- return [...i, ...o, ...s].sort((l, e) => e.length - l.length);
45
+ getTypePrefixes(t = []) {
46
+ const s = this.classes, e = Object.keys(this.property);
47
+ if (!s)
48
+ return [...e, ...t].sort((l, c) => c.length - l.length);
49
+ const i = [...this.getAllClassNames(s)];
50
+ return [...e, ...i, ...t].sort((l, c) => c.length - l.length);
48
51
  }
49
- regexp(s) {
50
- const t = this.getTypePrefixes(s).join("|"), r = "\\[[^\\]]+\\]", i = "\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)", n = "\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}", o = (
52
+ regexp(t) {
53
+ const s = this.getTypePrefixes(t).map(this.escapeRegex).join("|"), e = "\\[[^\\]]+\\]", n = "\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)", i = "\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}", l = `[${["a-zA-Z0-9_\\-", ...this.prefixChars].join("")}]`, c = (
51
54
  // Simple prefix (hover, md, focus, etc.)
52
- "[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?:-(?:" + r + "|" + i + "|" + n + "))|" + // Direct bracket, parenthesis, or brace content
53
- r + "|" + i + "|" + n
54
- ), l = `(${t}|\\[[^\\]]+\\])`, e = "(?:-)", h = "(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + // Hex colors
55
- r + "|" + // Bracket content
56
- n + "|" + // Curly brace content
57
- i + "|(?:\\$[^\\s\\/]+))", u = "([a-zA-Z%]*)", c = "(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + r + "|" + n + "|" + i + "|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";
55
+ l + "+|" + // value-like prefix (nth-(4), max-[445px], etc.)
56
+ l + "+(?:-(?:" + e + "|" + n + "|" + i + "))|" + // added support for custom secondValue for prefix
57
+ l + "+(?:-(?:" + e + "|" + n + "|" + i + "))?(?:\\/[a-zA-Z0-9_\\-]+)|" + // Direct bracket, parenthesis, or brace content
58
+ e + "|" + n + "|" + i
59
+ ), r = `(${s}|\\[[^\\]]+\\])`, h = "(?:-)", u = "(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + // Hex colors
60
+ e + "|" + // Bracket content
61
+ i + "|" + // Curly brace content
62
+ n + "|(?:\\$[^\\s\\/]+))", a = "([a-zA-Z%]*)", $ = "(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + e + "|" + i + "|" + n + "|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";
58
63
  return {
59
- prefix: o,
60
- type: l,
61
- separator: e,
62
- value: h,
63
- unit: u,
64
- secondValuePattern: c,
65
- all: "^(?:(" + o + "):)?" + l + e + h + u + c + "$"
64
+ prefix: c,
65
+ type: r,
66
+ separator: h,
67
+ value: u,
68
+ unit: a,
69
+ secondValuePattern: $,
70
+ all: "^(?:(" + c + "):)?" + r + h + u + a + $ + "$"
66
71
  };
67
72
  }
68
- parse(s, t) {
69
- const r = this.regexp(t), i = s.match(new RegExp(r.all));
70
- if (i) {
71
- const [, o, l, e, h, u, c] = i;
72
- return [o, l, e, h || "", u, c];
73
+ parse(t, s) {
74
+ const e = this.regexp(s), n = t.match(new RegExp(e.all));
75
+ if (n) {
76
+ const [, l, c, r, h, u, a] = n;
77
+ return [l, c, r, h || "", u, a];
73
78
  }
74
- const n = s.match(new RegExp(`^(?:(${r.prefix}):)?${r.type}$`));
75
- return n ? [n[1], n[2], "", "", void 0, void 0] : null;
79
+ const i = t.match(new RegExp(`^(?:(${e.prefix}):)?${e.type}$`));
80
+ return i ? [i[1], i[2], "", "", void 0, void 0] : null;
76
81
  }
77
- constructRaw(s, t, r, i, n, o) {
78
- return `${s ? `${s}:` : ""}${t}${r ? "-" : ""}${r}${i}${n ? `/${n}${o}` : ""}`;
82
+ constructRaw(t, s, e, n, i, l) {
83
+ return `${t ? `${t}:` : ""}${s}${e ? "-" : ""}${e}${n}${i ? `/${i}${l}` : ""}`;
79
84
  }
80
85
  // unique value parser
81
- processValue(s, t, r) {
82
- if (!s) return "";
83
- const i = (n) => n.replace(/\{([^}]+)\}/g, (o, l) => {
84
- const e = this.values, h = e !== null ? typeof e[r] == "object" ? e[r][l] : e[l] : void 0;
85
- return typeof h == "string" ? h : o;
86
+ processValue(t, s, e) {
87
+ if (!t) return "";
88
+ const n = (i) => i.replace(/\{([^}]+)\}/g, (l, c) => {
89
+ const r = this.values, h = r !== null ? typeof r[e] == "object" ? r[e][c] : r[c] : void 0;
90
+ return typeof h == "string" ? h : l;
86
91
  });
87
- if (typeof this.values == "object" && this.values !== null && (this.values[r] && typeof this.values[r] == "object" && this.values[r][s] || this.values[s]))
88
- return typeof this.values[r] == "object" && this.values[r] !== null ? this.values[r][s] : this.values[s];
89
- if (s.startsWith("$"))
90
- return `var(--${s.slice(1)})`;
91
- if (s.startsWith("[") && s.endsWith("]") || s.startsWith("(") && s.endsWith(")")) {
92
- const n = s.slice(1, -1).replace(/\\\_/g, "m0x13c55").replace(/\_/g, " ").replace(/m0x13c55/g, "_");
93
- return n.includes("{") ? i(n) : n.startsWith("--") ? `var(${n})` : n;
92
+ if (typeof this.values == "object" && this.values !== null && (this.values[e] && typeof this.values[e] == "object" && this.values[e][t] || this.values[t]))
93
+ return typeof this.values[e] == "object" && this.values[e] !== null ? this.values[e][t] : this.values[t];
94
+ if (t.startsWith("$"))
95
+ return `var(--${t.slice(1)})`;
96
+ if (t.startsWith("[") && t.endsWith("]") || t.startsWith("(") && t.endsWith(")")) {
97
+ const i = t.slice(1, -1).replace(/\\\_/g, "m0x13c55").replace(/\_/g, " ").replace(/m0x13c55/g, "_");
98
+ return i.includes("{") ? n(i) : i.startsWith("--") ? `var(${i})` : i;
94
99
  }
95
- return s + (t || "");
100
+ return t + (s || "");
96
101
  }
97
- processShorthand(s = "", t = "", r = "", i, n = "", o = "", l) {
98
- const e = this.property[s];
99
- if (typeof e == "object" && !Array.isArray(e) && !("property" in e))
102
+ processShorthand(t = "", s = "", e = "", n, i = "", l = "", c) {
103
+ const r = this.property[t];
104
+ if (typeof r == "object" && !Array.isArray(r) && !("property" in r))
100
105
  return null;
101
106
  const h = /^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;
102
- let u = null, c = t || "";
103
- const $ = c.match(h);
104
- if ($ && (u = $[1].trim(), c = $[2].trim()), (typeof e == "string" && !e.includes(":") || Array.isArray(e)) && (!t || t.includes(u + ":") || n))
107
+ let u = null, a = s || "";
108
+ const $ = a.match(h);
109
+ if ($ && (u = $[1].trim(), a = $[2].trim()), (typeof r == "string" && !r.includes(":") || Array.isArray(r)) && (!s || s.includes(u + ":") || i))
105
110
  return null;
106
111
  let p;
107
- t.includes(u + ":") ? p = t.startsWith("(") ? `(${c})` : `[${c}]` : p = t;
108
- const f = this.processValue(p, r, s), y = this.processValue(n, o, s);
109
- if (s.startsWith("[") && s.endsWith("]")) {
110
- if (!t || n) return null;
111
- const a = s.slice(1, -1).split(",").map(
112
- (m) => m.trim().startsWith("--") ? String(m.trim()) : this.toKebabCase(String(m.trim()))
112
+ s.includes(u + ":") ? p = s.startsWith("(") ? `(${a})` : `[${a}]` : p = s;
113
+ const f = this.processValue(p, e, t), y = this.processValue(i, l, t);
114
+ if (t.startsWith("[") && t.endsWith("]")) {
115
+ if (!s || i) return null;
116
+ const o = t.slice(1, -1).split(",").map(
117
+ (A) => A.trim().startsWith("--") ? String(A.trim()) : this.toKebabCase(String(A.trim()))
113
118
  );
114
119
  return {
115
- className: this.constructRaw(i, s, t, r),
116
- cssRules: a.length === 1 ? a[0] : a,
120
+ className: this.constructRaw(n, t, s, e),
121
+ cssRules: o.length === 1 ? o[0] : o,
117
122
  value: f,
118
- prefix: i
123
+ prefix: n
119
124
  };
120
125
  }
121
- if (e) {
122
- if (typeof e == "object" && "property" in e) {
123
- const m = e.group && this.values[e.group][f] ? this.values[e.group][f] : r ? t : f, d = (
126
+ if (r) {
127
+ if (typeof r == "object" && "property" in r) {
128
+ const A = r.group && this.values[r.group][f] ? this.values[r.group][f] : e ? s : f, d = (
124
129
  // handle `properties.property` function
125
- typeof e.property == "function" ? e.property({
126
- value: t.startsWith("[") ? f : m,
127
- unit: t.startsWith("[") ? "" : r,
128
- secondValue: t.startsWith("[") ? "" : o ? n : y,
129
- secondUnit: t.startsWith("[") ? "" : o,
130
+ typeof r.property == "function" ? r.property({
131
+ value: s.startsWith("[") ? f : A,
132
+ unit: s.startsWith("[") ? "" : e,
133
+ secondValue: s.startsWith("[") ? "" : l ? i : y,
134
+ secondUnit: s.startsWith("[") ? "" : l,
130
135
  key: u,
131
- raw: l
136
+ raw: c
132
137
  }) : (
133
138
  // defaulting to string property
134
139
  // e.g. { property: { p: { property: 'padding', value: '{0} {1}' } }
135
140
  // the `p` is the type or the shorthand for `padding` property -
136
141
  // and has support for second value
137
- e.property
142
+ r.property
138
143
  )
139
- ), g = e.value || "{0}";
140
- let b;
144
+ ), g = r.value || "{0}";
145
+ let C;
141
146
  if (typeof g == "function")
142
- b = g({
143
- value: m,
144
- unit: r,
145
- secondValue: o ? n : y,
146
- secondUnit: o,
147
+ C = g({
148
+ value: A,
149
+ unit: e,
150
+ secondValue: l ? i : y,
151
+ secondUnit: l,
147
152
  key: u,
148
- raw: l
153
+ raw: c
149
154
  });
150
155
  else if (typeof g == "string") {
151
- const C = e.group || s, w = this.processValue(p, r, C);
152
- this.values[C] && typeof this.values[C] == "object" && this.values[C][p] ? b = this.values[C][p] : g.includes("{") ? b = this.parseValuePattern(
153
- C,
156
+ const b = r.group || t, R = this.processValue(p, e, b);
157
+ this.values[b] && typeof this.values[b] == "object" && this.values[b][p] ? C = this.values[b][p] : g.includes("{") ? C = this.parseValuePattern(
158
+ b,
154
159
  g,
155
- w,
160
+ R,
156
161
  "",
157
162
  y,
158
163
  ""
159
- ) : typeof g == "string" && !g.includes("{") ? b = g : b = f;
164
+ ) : typeof g == "string" && !g.includes("{") ? C = g : C = f;
160
165
  } else if (Array.isArray(g)) {
161
- if (!g.includes(t + r) || n) return null;
162
- b = t + r;
163
- } else b = null;
164
- return (typeof e.property == "string" || Array.isArray(e.property)) && typeof g == "string" && (t.includes(u + ":") || !g.includes("{1") && n) || // check if the property is string or array of properties
166
+ if (!g.includes(s + e) || i) return null;
167
+ C = s + e;
168
+ } else C = null;
169
+ return (typeof r.property == "string" || Array.isArray(r.property)) && typeof g == "string" && (s.includes(u + ":") || !g.includes("{1") && i) || // check if the property is string or array of properties
165
170
  // but the value is null
166
- (typeof e.property == "string" || Array.isArray(e.property)) && g === null || // check if the type is a direct rules but has `value` defined
167
- typeof e.property == "string" && e.property.includes(":") && t || (typeof e.property == "string" || Array.isArray(e.property)) && typeof e.value == "string" && !e.value.includes("{") && t ? null : {
168
- className: this.constructRaw(i, s, t, r, n, o),
171
+ (typeof r.property == "string" || Array.isArray(r.property)) && g === null || // check if the type is a direct rules but has `value` defined
172
+ typeof r.property == "string" && r.property.includes(":") && s || (typeof r.property == "string" || Array.isArray(r.property)) && typeof r.value == "string" && !r.value.includes("{") && s ? null : {
173
+ className: this.constructRaw(n, t, s, e, i, l),
169
174
  cssRules: (
170
175
  // if not property, or when `properties.property` as function return null
171
176
  d ? Array.isArray(d) ? d : (
@@ -176,157 +181,157 @@ class Z {
176
181
  )
177
182
  ) : null
178
183
  ),
179
- value: g === null || d === null || d.includes(":") || d.includes("value:") ? null : t.startsWith("[") ? f : b,
180
- prefix: i
184
+ value: g === null || d === null || d.includes(":") || d.includes("value:") ? null : s.startsWith("[") ? f : C,
185
+ prefix: n
181
186
  };
182
187
  }
183
- const a = (
188
+ const o = (
184
189
  // handle `properties` as function
185
190
  // e.g. m: ({ value, unit }) => `margin: ${value}${unit || 'px'}`
186
191
  // m-4 => margin: 4px
187
192
  // m-4rem => margin: 4rem
188
- typeof e == "function" ? e({
189
- value: t.startsWith("[") ? f : r ? t : f,
190
- unit: t.startsWith("[") ? "" : r,
191
- secondValue: t.startsWith("[") ? "" : o ? n : y,
192
- secondUnit: t.startsWith("[") ? "" : o,
193
+ typeof r == "function" ? r({
194
+ value: s.startsWith("[") ? f : e ? s : f,
195
+ unit: s.startsWith("[") ? "" : e,
196
+ secondValue: s.startsWith("[") ? "" : l ? i : y,
197
+ secondUnit: s.startsWith("[") ? "" : l,
193
198
  key: u,
194
- raw: l
199
+ raw: c
195
200
  }) : (
196
201
  // e.g. { property: { bg: 'background' } }
197
202
  // the `bg` is the type or the shorthand for `background` property
198
- e
203
+ r
199
204
  )
200
205
  );
201
206
  return {
202
- className: this.constructRaw(i, s, t, r, n, o),
203
- cssRules: a ? Array.isArray(e) ? a : typeof a == "string" && (a.includes(":") || a.startsWith("value:")) ? a.startsWith("value:") ? a.slice(6) : this.toKebabCase(String(a)) : this.toKebabCase(String(a)) : null,
204
- value: typeof a == "string" && a.includes(":") ? null : f,
205
- prefix: i
207
+ className: this.constructRaw(n, t, s, e, i, l),
208
+ cssRules: o ? Array.isArray(r) ? o : typeof o == "string" && (o.includes(":") || o.startsWith("value:")) ? o.startsWith("value:") ? o.slice(6) : this.toKebabCase(String(o)) : this.toKebabCase(String(o)) : null,
209
+ value: typeof o == "string" && o.includes(":") ? null : f,
210
+ prefix: n
206
211
  };
207
212
  }
208
213
  return null;
209
214
  }
210
- parseValuePattern(s, t, r, i, n, o) {
211
- if (!t.includes("{0}") && !t.includes("{1") && !t.includes("||"))
212
- return t;
213
- const [l, e] = t.split("||").map((c) => c.trim()), h = this.processValue(r, i, s), u = this.processValue(n, o, s);
214
- if (t.includes("{0}") && t.includes("{1") || t.includes("{1")) {
215
- let c = l;
216
- if (r && (c = c.replace(/\{0\}/g, h)), t.includes("{1")) {
217
- t.includes("{1}") && (n ? c = n.startsWith("[") ? u : c.replace(/\{1\}/g, u) : c = e || l);
215
+ parseValuePattern(t, s, e, n, i, l) {
216
+ if (!s.includes("{0}") && !s.includes("{1") && !s.includes("||"))
217
+ return s;
218
+ const [c, r] = s.split("||").map((a) => a.trim()), h = this.processValue(e, n, t), u = this.processValue(i, l, t);
219
+ if (s.includes("{0}") && s.includes("{1") || s.includes("{1")) {
220
+ let a = c;
221
+ if (e && (a = a.replace(/\{0\}/g, h)), s.includes("{1")) {
222
+ s.includes("{1}") && (i ? a = i.startsWith("[") ? u : a.replace(/\{1\}/g, u) : a = r || c);
218
223
  const $ = /\{1([^}]*)\}/g;
219
224
  let p;
220
- for (; (p = $.exec(c)) !== null; ) {
225
+ for (; (p = $.exec(a)) !== null; ) {
221
226
  const f = p[0], y = p[1].trim();
222
- let a = u;
223
- !a && y.includes("|") ? a = y.split("|")[1].trim() : a || (a = ""), c = r.startsWith("[") ? h : c.replace(f, a);
227
+ let o = u;
228
+ !o && y.includes("|") ? o = y.split("|")[1].trim() : o || (o = ""), a = e.startsWith("[") ? h : a.replace(f, o);
224
229
  }
225
230
  }
226
- return r ? c : e || l;
231
+ return e ? a : r || c;
227
232
  } else
228
- return r ? r.startsWith("[") ? h : l.replace(/\{0\}/g, h) : e || l;
233
+ return e ? e.startsWith("[") ? h : c.replace(/\{0\}/g, h) : r || c;
229
234
  }
230
- getParentClass(s) {
235
+ getParentClass(t) {
231
236
  return Object.keys(this.classes).filter(
232
- (t) => Object.prototype.hasOwnProperty.call(
233
- this.classes[t],
234
- s
237
+ (s) => Object.prototype.hasOwnProperty.call(
238
+ this.classes[s],
239
+ t
235
240
  )
236
241
  );
237
242
  }
238
- processCustomClass(s, t = "", r = "", i = "", n = "", o = "") {
239
- if (!s) return null;
240
- const l = this.getParentClass(s), e = t && s.endsWith(`-${t}${r}`);
241
- if (l.length > 0) {
242
- const h = l.map((u) => {
243
- const c = this.classes[u];
244
- if (!c || t && !e && c[s] && !c[s].includes("{0}") && !c[s].includes("|"))
243
+ processCustomClass(t, s = "", e = "", n = "", i = "", l = "") {
244
+ if (!t) return null;
245
+ const c = this.getParentClass(t), r = s && t.endsWith(`-${s}${e}`);
246
+ if (c.length > 0) {
247
+ const h = c.map((u) => {
248
+ const a = this.classes[u];
249
+ if (!a || s && !r && a[t] && !a[t].includes("{0}") && !a[t].includes("|"))
245
250
  return null;
246
251
  const $ = this.parseValuePattern(
247
- s,
248
- c[s] || "",
249
252
  t,
250
- r,
251
- n,
252
- o
253
+ a[t] || "",
254
+ s,
255
+ e,
256
+ i,
257
+ l
253
258
  );
254
259
  return `${this.toKebabCase(String(u))}: ${$}`;
255
260
  }).filter(Boolean).join("; ");
256
261
  return {
257
- className: e ? s : this.constructRaw(i, s, t, r, n, o),
262
+ className: r ? t : this.constructRaw(n, t, s, e, i, l),
258
263
  cssRules: h,
259
264
  value: null,
260
- prefix: i
265
+ prefix: n
261
266
  };
262
267
  }
263
268
  return null;
264
269
  }
265
- process(s) {
270
+ process(t) {
266
271
  try {
267
- const t = Array.isArray(s) ? s : s.split(/\s+/), r = [];
268
- for (const i of t)
272
+ const s = Array.isArray(t) ? t : t.split(/\s+/), e = [];
273
+ for (const n of s)
269
274
  try {
270
- if (!i) continue;
271
- const n = this.parse(i);
272
275
  if (!n) continue;
273
- const [o, l, e, h, u, c] = n;
274
- if (!l) continue;
275
- const $ = this.getParentClass(`${l}-${e}`).length > 0 ? `${l}-${e}` : l;
276
+ const i = this.parse(n);
277
+ if (!i) continue;
278
+ const [l, c, r, h, u, a] = i;
279
+ if (!c) continue;
280
+ const $ = this.getParentClass(`${c}-${r}`).length > 0 ? `${c}-${r}` : c;
276
281
  try {
277
282
  const p = this.processCustomClass(
278
283
  $,
279
- e,
284
+ r,
280
285
  h,
281
- o,
286
+ l,
282
287
  u,
283
- c
288
+ a
284
289
  );
285
290
  if (p) {
286
- const { className: f, cssRules: y, prefix: a } = p;
291
+ const { className: f, cssRules: y, prefix: o } = p;
287
292
  if (!y || y === "null") continue;
288
- r.push({
293
+ e.push({
289
294
  className: this.escapeCSSSelector(f),
290
295
  cssRules: y,
291
296
  value: null,
292
- prefix: a,
293
- raw: [...n, this.constructRaw(a, l, e, h, u, c)]
297
+ prefix: o,
298
+ raw: [...i, this.constructRaw(o, c, r, h, u, a)]
294
299
  });
295
300
  continue;
296
301
  }
297
302
  } catch (p) {
298
- console.warn(`Error processing custom class "${i}":`, p);
303
+ console.warn(`Error processing custom class "${n}":`, p);
299
304
  }
300
305
  try {
301
306
  const p = this.processShorthand(
302
- l,
303
- e,
307
+ c,
308
+ r,
304
309
  h,
305
- o,
310
+ l,
306
311
  u,
307
- c,
308
- n
312
+ a,
313
+ i
309
314
  );
310
315
  if (p) {
311
- const { className: f, cssRules: y, value: a, prefix: m } = p;
316
+ const { className: f, cssRules: y, value: o, prefix: A } = p;
312
317
  if (!y || y === "null") continue;
313
- r.push({
318
+ e.push({
314
319
  className: this.escapeCSSSelector(f),
315
320
  cssRules: y,
316
- value: a,
317
- prefix: m,
318
- raw: [...n, this.constructRaw(o, l, e, h, u, c)]
321
+ value: o,
322
+ prefix: A,
323
+ raw: [...i, this.constructRaw(l, c, r, h, u, a)]
319
324
  });
320
325
  }
321
326
  } catch (p) {
322
- console.warn(`Error processing shorthand "${i}":`, p);
327
+ console.warn(`Error processing shorthand "${n}":`, p);
323
328
  }
324
- } catch (n) {
325
- console.warn(`Failed to process class \`${i}\`:`, n);
329
+ } catch (i) {
330
+ console.warn(`Failed to process class \`${n}\`:`, i);
326
331
  }
327
- return r;
328
- } catch (t) {
329
- return console.error("Critical error in process method:", t), [];
332
+ return e;
333
+ } catch (s) {
334
+ return console.error("Critical error in process method:", s), [];
330
335
  }
331
336
  }
332
337
  }
@@ -1 +1 @@
1
- var __tenoxui_moxie__=function(m){"use strict";var _=Object.defineProperty;var S=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var w=(m,d,A)=>d in m?_(m,d,{enumerable:!0,configurable:!0,writable:!0,value:A}):m[d]=A,x=(m,d)=>{for(var A in d||(d={}))j.call(d,A)&&w(m,A,d[A]);if(S)for(var A of S(d))V.call(d,A)&&w(m,A,d[A]);return m};class d{constructor({property:s={},values:t={},classes:r={}}={}){this.property=x({moxie:({key:i,secondValue:n})=>n?null:i},s),this.values=t,this.classes=r}toKebabCase(s){if(/^(webkit|moz|ms|o)[A-Z]/.test(s)){const t=s.match(/^(webkit|moz|ms|o)/);if(t){const r=t[0];return`-${r}${s.slice(r.length).replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`}}return s.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}escapeCSSSelector(s){return s.replace(/^(\d)/,"\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g,"\\$1")}getAllClassNames(s){if(!s)return[];const t=new Set;return Object.entries(s).forEach(([r,i])=>{i&&typeof i=="object"&&Object.keys(i).forEach(n=>{t.add(n)})}),Array.from(t)}getTypePrefixes(s=[]){const t=this.property,r=this.classes,i=Object.keys(t);if(!r)return[...i,...s].sort((l,e)=>e.length-l.length);const o=[...this.getAllClassNames(r)];return[...i,...o,...s].sort((l,e)=>e.length-l.length)}regexp(s){const t=this.getTypePrefixes(s).join("|"),r="\\[[^\\]]+\\]",i="\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)",n="\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}",o="[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?:-(?:"+r+"|"+i+"|"+n+"))|"+r+"|"+i+"|"+n,l=`(${t}|\\[[^\\]]+\\])`,e="(?:-)",h="(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+r+"|"+n+"|"+i+"|(?:\\$[^\\s\\/]+))",u="([a-zA-Z%]*)",c="(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+r+"|"+n+"|"+i+"|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";return{prefix:o,type:l,separator:e,value:h,unit:u,secondValuePattern:c,all:"^(?:("+o+"):)?"+l+e+h+u+c+"$"}}parse(s,t){const r=this.regexp(t),i=s.match(new RegExp(r.all));if(i){const[,o,l,e,h,u,c]=i;return[o,l,e,h||"",u,c]}const n=s.match(new RegExp(`^(?:(${r.prefix}):)?${r.type}$`));return n?[n[1],n[2],"","",void 0,void 0]:null}constructRaw(s,t,r,i,n,o){return`${s?`${s}:`:""}${t}${r?"-":""}${r}${i}${n?`/${n}${o}`:""}`}processValue(s,t,r){if(!s)return"";const i=n=>n.replace(/\{([^}]+)\}/g,(o,l)=>{const e=this.values,h=e!==null?typeof e[r]=="object"?e[r][l]:e[l]:void 0;return typeof h=="string"?h:o});if(typeof this.values=="object"&&this.values!==null&&(this.values[r]&&typeof this.values[r]=="object"&&this.values[r][s]||this.values[s]))return typeof this.values[r]=="object"&&this.values[r]!==null?this.values[r][s]:this.values[s];if(s.startsWith("$"))return`var(--${s.slice(1)})`;if(s.startsWith("[")&&s.endsWith("]")||s.startsWith("(")&&s.endsWith(")")){const n=s.slice(1,-1).replace(/\\\_/g,"m0x13c55").replace(/\_/g," ").replace(/m0x13c55/g,"_");return n.includes("{")?i(n):n.startsWith("--")?`var(${n})`:n}return s+(t||"")}processShorthand(s="",t="",r="",i,n="",o="",l){const e=this.property[s];if(typeof e=="object"&&!Array.isArray(e)&&!("property"in e))return null;const h=/^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;let u=null,c=t||"";const b=c.match(h);if(b&&(u=b[1].trim(),c=b[2].trim()),(typeof e=="string"&&!e.includes(":")||Array.isArray(e))&&(!t||t.includes(u+":")||n))return null;let p;t.includes(u+":")?p=t.startsWith("(")?`(${c})`:`[${c}]`:p=t;const f=this.processValue(p,r,s),y=this.processValue(n,o,s);if(s.startsWith("[")&&s.endsWith("]")){if(!t||n)return null;const a=s.slice(1,-1).split(",").map(C=>C.trim().startsWith("--")?String(C.trim()):this.toKebabCase(String(C.trim())));return{className:this.constructRaw(i,s,t,r),cssRules:a.length===1?a[0]:a,value:f,prefix:i}}if(e){if(typeof e=="object"&&"property"in e){const C=e.group&&this.values[e.group][f]?this.values[e.group][f]:r?t:f,$=typeof e.property=="function"?e.property({value:t.startsWith("[")?f:C,unit:t.startsWith("[")?"":r,secondValue:t.startsWith("[")?"":o?n:y,secondUnit:t.startsWith("[")?"":o,key:u,raw:l}):e.property,g=e.value||"{0}";let W;if(typeof g=="function")W=g({value:C,unit:r,secondValue:o?n:y,secondUnit:o,key:u,raw:l});else if(typeof g=="string"){const P=e.group||s,R=this.processValue(p,r,P);this.values[P]&&typeof this.values[P]=="object"&&this.values[P][p]?W=this.values[P][p]:g.includes("{")?W=this.parseValuePattern(P,g,R,"",y,""):typeof g=="string"&&!g.includes("{")?W=g:W=f}else if(Array.isArray(g)){if(!g.includes(t+r)||n)return null;W=t+r}else W=null;return(typeof e.property=="string"||Array.isArray(e.property))&&typeof g=="string"&&(t.includes(u+":")||!g.includes("{1")&&n)||(typeof e.property=="string"||Array.isArray(e.property))&&g===null||typeof e.property=="string"&&e.property.includes(":")&&t||(typeof e.property=="string"||Array.isArray(e.property))&&typeof e.value=="string"&&!e.value.includes("{")&&t?null:{className:this.constructRaw(i,s,t,r,n,o),cssRules:$?Array.isArray($)?$:typeof $=="string"&&($.includes(":")||$.includes("value:"))?$.includes("value:")?$.slice(6):this.toKebabCase(String($)):this.toKebabCase(String($)):null,value:g===null||$===null||$.includes(":")||$.includes("value:")?null:t.startsWith("[")?f:W,prefix:i}}const a=typeof e=="function"?e({value:t.startsWith("[")?f:r?t:f,unit:t.startsWith("[")?"":r,secondValue:t.startsWith("[")?"":o?n:y,secondUnit:t.startsWith("[")?"":o,key:u,raw:l}):e;return{className:this.constructRaw(i,s,t,r,n,o),cssRules:a?Array.isArray(e)?a:typeof a=="string"&&(a.includes(":")||a.startsWith("value:"))?a.startsWith("value:")?a.slice(6):this.toKebabCase(String(a)):this.toKebabCase(String(a)):null,value:typeof a=="string"&&a.includes(":")?null:f,prefix:i}}return null}parseValuePattern(s,t,r,i,n,o){if(!t.includes("{0}")&&!t.includes("{1")&&!t.includes("||"))return t;const[l,e]=t.split("||").map(c=>c.trim()),h=this.processValue(r,i,s),u=this.processValue(n,o,s);if(t.includes("{0}")&&t.includes("{1")||t.includes("{1")){let c=l;if(r&&(c=c.replace(/\{0\}/g,h)),t.includes("{1")){t.includes("{1}")&&(n?c=n.startsWith("[")?u:c.replace(/\{1\}/g,u):c=e||l);const b=/\{1([^}]*)\}/g;let p;for(;(p=b.exec(c))!==null;){const f=p[0],y=p[1].trim();let a=u;!a&&y.includes("|")?a=y.split("|")[1].trim():a||(a=""),c=r.startsWith("[")?h:c.replace(f,a)}}return r?c:e||l}else return r?r.startsWith("[")?h:l.replace(/\{0\}/g,h):e||l}getParentClass(s){return Object.keys(this.classes).filter(t=>Object.prototype.hasOwnProperty.call(this.classes[t],s))}processCustomClass(s,t="",r="",i="",n="",o=""){if(!s)return null;const l=this.getParentClass(s),e=t&&s.endsWith(`-${t}${r}`);if(l.length>0){const h=l.map(u=>{const c=this.classes[u];if(!c||t&&!e&&c[s]&&!c[s].includes("{0}")&&!c[s].includes("|"))return null;const b=this.parseValuePattern(s,c[s]||"",t,r,n,o);return`${this.toKebabCase(String(u))}: ${b}`}).filter(Boolean).join("; ");return{className:e?s:this.constructRaw(i,s,t,r,n,o),cssRules:h,value:null,prefix:i}}return null}process(s){try{const t=Array.isArray(s)?s:s.split(/\s+/),r=[];for(const i of t)try{if(!i)continue;const n=this.parse(i);if(!n)continue;const[o,l,e,h,u,c]=n;if(!l)continue;const b=this.getParentClass(`${l}-${e}`).length>0?`${l}-${e}`:l;try{const p=this.processCustomClass(b,e,h,o,u,c);if(p){const{className:f,cssRules:y,prefix:a}=p;if(!y||y==="null")continue;r.push({className:this.escapeCSSSelector(f),cssRules:y,value:null,prefix:a,raw:[...n,this.constructRaw(a,l,e,h,u,c)]});continue}}catch(p){console.warn(`Error processing custom class "${i}":`,p)}try{const p=this.processShorthand(l,e,h,o,u,c,n);if(p){const{className:f,cssRules:y,value:a,prefix:C}=p;if(!y||y==="null")continue;r.push({className:this.escapeCSSSelector(f),cssRules:y,value:a,prefix:C,raw:[...n,this.constructRaw(o,l,e,h,u,c)]})}}catch(p){console.warn(`Error processing shorthand "${i}":`,p)}}catch(n){console.warn(`Failed to process class \`${i}\`:`,n)}return r}catch(t){return console.error("Critical error in process method:",t),[]}}}return m.TenoxUI=d,m.default=d,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),m}({});
1
+ var __tenoxui_moxie__=function(m){"use strict";var _=Object.defineProperty;var P=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var R=(m,d,C)=>d in m?_(m,d,{enumerable:!0,configurable:!0,writable:!0,value:C}):m[d]=C,S=(m,d)=>{for(var C in d||(d={}))j.call(d,C)&&R(m,C,d[C]);if(P)for(var C of P(d))V.call(d,C)&&R(m,C,d[C]);return m};class d{constructor({property:t={},values:s={},classes:e={},prefixChars:n=[]}={}){this.property=S({moxie:({key:i,secondValue:l})=>l?null:i},t),this.values=s,this.classes=e,this.prefixChars=n.map(this.escapeRegex)}toKebabCase(t){if(/^(webkit|moz|ms|o)[A-Z]/.test(t)){const s=t.match(/^(webkit|moz|ms|o)/);if(s){const e=s[0];return`-${e}${t.slice(e.length).replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`}}return t.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`)}escapeCSSSelector(t){return t.replace(/^(\d)/,"\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g,"\\$1")}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\/\\-]/g,"\\$&")}getAllClassNames(t){if(!t)return[];const s=new Set;return Object.entries(t).forEach(([e,n])=>{n&&typeof n=="object"&&Object.keys(n).forEach(i=>{s.add(i)})}),Array.from(s)}getTypePrefixes(t=[]){const s=this.classes,e=Object.keys(this.property);if(!s)return[...e,...t].sort((l,c)=>c.length-l.length);const i=[...this.getAllClassNames(s)];return[...e,...i,...t].sort((l,c)=>c.length-l.length)}regexp(t){const s=this.getTypePrefixes(t).map(this.escapeRegex).join("|"),e="\\[[^\\]]+\\]",n="\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)",i="\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}",l=`[${["a-zA-Z0-9_\\-",...this.prefixChars].join("")}]`,c=l+"+|"+l+"+(?:-(?:"+e+"|"+n+"|"+i+"))|"+l+"+(?:-(?:"+e+"|"+n+"|"+i+"))?(?:\\/[a-zA-Z0-9_\\-]+)|"+e+"|"+n+"|"+i,r=`(${s}|\\[[^\\]]+\\])`,h="(?:-)",u="(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+e+"|"+i+"|"+n+"|(?:\\$[^\\s\\/]+))",a="([a-zA-Z%]*)",A="(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+e+"|"+i+"|"+n+"|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";return{prefix:c,type:r,separator:h,value:u,unit:a,secondValuePattern:A,all:"^(?:("+c+"):)?"+r+h+u+a+A+"$"}}parse(t,s){const e=this.regexp(s),n=t.match(new RegExp(e.all));if(n){const[,l,c,r,h,u,a]=n;return[l,c,r,h||"",u,a]}const i=t.match(new RegExp(`^(?:(${e.prefix}):)?${e.type}$`));return i?[i[1],i[2],"","",void 0,void 0]:null}constructRaw(t,s,e,n,i,l){return`${t?`${t}:`:""}${s}${e?"-":""}${e}${n}${i?`/${i}${l}`:""}`}processValue(t,s,e){if(!t)return"";const n=i=>i.replace(/\{([^}]+)\}/g,(l,c)=>{const r=this.values,h=r!==null?typeof r[e]=="object"?r[e][c]:r[c]:void 0;return typeof h=="string"?h:l});if(typeof this.values=="object"&&this.values!==null&&(this.values[e]&&typeof this.values[e]=="object"&&this.values[e][t]||this.values[t]))return typeof this.values[e]=="object"&&this.values[e]!==null?this.values[e][t]:this.values[t];if(t.startsWith("$"))return`var(--${t.slice(1)})`;if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")")){const i=t.slice(1,-1).replace(/\\\_/g,"m0x13c55").replace(/\_/g," ").replace(/m0x13c55/g,"_");return i.includes("{")?n(i):i.startsWith("--")?`var(${i})`:i}return t+(s||"")}processShorthand(t="",s="",e="",n,i="",l="",c){const r=this.property[t];if(typeof r=="object"&&!Array.isArray(r)&&!("property"in r))return null;const h=/^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;let u=null,a=s||"";const A=a.match(h);if(A&&(u=A[1].trim(),a=A[2].trim()),(typeof r=="string"&&!r.includes(":")||Array.isArray(r))&&(!s||s.includes(u+":")||i))return null;let p;s.includes(u+":")?p=s.startsWith("(")?`(${a})`:`[${a}]`:p=s;const f=this.processValue(p,e,t),y=this.processValue(i,l,t);if(t.startsWith("[")&&t.endsWith("]")){if(!s||i)return null;const o=t.slice(1,-1).split(",").map(b=>b.trim().startsWith("--")?String(b.trim()):this.toKebabCase(String(b.trim())));return{className:this.constructRaw(n,t,s,e),cssRules:o.length===1?o[0]:o,value:f,prefix:n}}if(r){if(typeof r=="object"&&"property"in r){const b=r.group&&this.values[r.group][f]?this.values[r.group][f]:e?s:f,$=typeof r.property=="function"?r.property({value:s.startsWith("[")?f:b,unit:s.startsWith("[")?"":e,secondValue:s.startsWith("[")?"":l?i:y,secondUnit:s.startsWith("[")?"":l,key:u,raw:c}):r.property,g=r.value||"{0}";let x;if(typeof g=="function")x=g({value:b,unit:e,secondValue:l?i:y,secondUnit:l,key:u,raw:c});else if(typeof g=="string"){const W=r.group||t,w=this.processValue(p,e,W);this.values[W]&&typeof this.values[W]=="object"&&this.values[W][p]?x=this.values[W][p]:g.includes("{")?x=this.parseValuePattern(W,g,w,"",y,""):typeof g=="string"&&!g.includes("{")?x=g:x=f}else if(Array.isArray(g)){if(!g.includes(s+e)||i)return null;x=s+e}else x=null;return(typeof r.property=="string"||Array.isArray(r.property))&&typeof g=="string"&&(s.includes(u+":")||!g.includes("{1")&&i)||(typeof r.property=="string"||Array.isArray(r.property))&&g===null||typeof r.property=="string"&&r.property.includes(":")&&s||(typeof r.property=="string"||Array.isArray(r.property))&&typeof r.value=="string"&&!r.value.includes("{")&&s?null:{className:this.constructRaw(n,t,s,e,i,l),cssRules:$?Array.isArray($)?$:typeof $=="string"&&($.includes(":")||$.includes("value:"))?$.includes("value:")?$.slice(6):this.toKebabCase(String($)):this.toKebabCase(String($)):null,value:g===null||$===null||$.includes(":")||$.includes("value:")?null:s.startsWith("[")?f:x,prefix:n}}const o=typeof r=="function"?r({value:s.startsWith("[")?f:e?s:f,unit:s.startsWith("[")?"":e,secondValue:s.startsWith("[")?"":l?i:y,secondUnit:s.startsWith("[")?"":l,key:u,raw:c}):r;return{className:this.constructRaw(n,t,s,e,i,l),cssRules:o?Array.isArray(r)?o:typeof o=="string"&&(o.includes(":")||o.startsWith("value:"))?o.startsWith("value:")?o.slice(6):this.toKebabCase(String(o)):this.toKebabCase(String(o)):null,value:typeof o=="string"&&o.includes(":")?null:f,prefix:n}}return null}parseValuePattern(t,s,e,n,i,l){if(!s.includes("{0}")&&!s.includes("{1")&&!s.includes("||"))return s;const[c,r]=s.split("||").map(a=>a.trim()),h=this.processValue(e,n,t),u=this.processValue(i,l,t);if(s.includes("{0}")&&s.includes("{1")||s.includes("{1")){let a=c;if(e&&(a=a.replace(/\{0\}/g,h)),s.includes("{1")){s.includes("{1}")&&(i?a=i.startsWith("[")?u:a.replace(/\{1\}/g,u):a=r||c);const A=/\{1([^}]*)\}/g;let p;for(;(p=A.exec(a))!==null;){const f=p[0],y=p[1].trim();let o=u;!o&&y.includes("|")?o=y.split("|")[1].trim():o||(o=""),a=e.startsWith("[")?h:a.replace(f,o)}}return e?a:r||c}else return e?e.startsWith("[")?h:c.replace(/\{0\}/g,h):r||c}getParentClass(t){return Object.keys(this.classes).filter(s=>Object.prototype.hasOwnProperty.call(this.classes[s],t))}processCustomClass(t,s="",e="",n="",i="",l=""){if(!t)return null;const c=this.getParentClass(t),r=s&&t.endsWith(`-${s}${e}`);if(c.length>0){const h=c.map(u=>{const a=this.classes[u];if(!a||s&&!r&&a[t]&&!a[t].includes("{0}")&&!a[t].includes("|"))return null;const A=this.parseValuePattern(t,a[t]||"",s,e,i,l);return`${this.toKebabCase(String(u))}: ${A}`}).filter(Boolean).join("; ");return{className:r?t:this.constructRaw(n,t,s,e,i,l),cssRules:h,value:null,prefix:n}}return null}process(t){try{const s=Array.isArray(t)?t:t.split(/\s+/),e=[];for(const n of s)try{if(!n)continue;const i=this.parse(n);if(!i)continue;const[l,c,r,h,u,a]=i;if(!c)continue;const A=this.getParentClass(`${c}-${r}`).length>0?`${c}-${r}`:c;try{const p=this.processCustomClass(A,r,h,l,u,a);if(p){const{className:f,cssRules:y,prefix:o}=p;if(!y||y==="null")continue;e.push({className:this.escapeCSSSelector(f),cssRules:y,value:null,prefix:o,raw:[...i,this.constructRaw(o,c,r,h,u,a)]});continue}}catch(p){console.warn(`Error processing custom class "${n}":`,p)}try{const p=this.processShorthand(c,r,h,l,u,a,i);if(p){const{className:f,cssRules:y,value:o,prefix:b}=p;if(!y||y==="null")continue;e.push({className:this.escapeCSSSelector(f),cssRules:y,value:o,prefix:b,raw:[...i,this.constructRaw(l,c,r,h,u,a)]})}}catch(p){console.warn(`Error processing shorthand "${n}":`,p)}}catch(i){console.warn(`Failed to process class \`${n}\`:`,i)}return e}catch(s){return console.error("Critical error in process method:",s),[]}}}return m.TenoxUI=d,m.default=d,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),m}({});
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(d,f){typeof exports=="object"&&typeof module!="undefined"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(d=typeof globalThis!="undefined"?globalThis:d||self,f(d.__tenoxui_moxie__={}))})(this,function(d){"use strict";var _=Object.defineProperty;var P=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var S=(d,f,A)=>f in d?_(d,f,{enumerable:!0,configurable:!0,writable:!0,value:A}):d[f]=A,w=(d,f)=>{for(var A in f||(f={}))j.call(f,A)&&S(d,A,f[A]);if(P)for(var A of P(f))V.call(f,A)&&S(d,A,f[A]);return d};class f{constructor({property:s={},values:t={},classes:r={}}={}){this.property=w({moxie:({key:i,secondValue:n})=>n?null:i},s),this.values=t,this.classes=r}toKebabCase(s){if(/^(webkit|moz|ms|o)[A-Z]/.test(s)){const t=s.match(/^(webkit|moz|ms|o)/);if(t){const r=t[0];return`-${r}${s.slice(r.length).replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`}}return s.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}escapeCSSSelector(s){return s.replace(/^(\d)/,"\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g,"\\$1")}getAllClassNames(s){if(!s)return[];const t=new Set;return Object.entries(s).forEach(([r,i])=>{i&&typeof i=="object"&&Object.keys(i).forEach(n=>{t.add(n)})}),Array.from(t)}getTypePrefixes(s=[]){const t=this.property,r=this.classes,i=Object.keys(t);if(!r)return[...i,...s].sort((l,e)=>e.length-l.length);const c=[...this.getAllClassNames(r)];return[...i,...c,...s].sort((l,e)=>e.length-l.length)}regexp(s){const t=this.getTypePrefixes(s).join("|"),r="\\[[^\\]]+\\]",i="\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)",n="\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}",c="[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?:-(?:"+r+"|"+i+"|"+n+"))|"+r+"|"+i+"|"+n,l=`(${t}|\\[[^\\]]+\\])`,e="(?:-)",h="(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+r+"|"+n+"|"+i+"|(?:\\$[^\\s\\/]+))",u="([a-zA-Z%]*)",o="(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+r+"|"+n+"|"+i+"|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";return{prefix:c,type:l,separator:e,value:h,unit:u,secondValuePattern:o,all:"^(?:("+c+"):)?"+l+e+h+u+o+"$"}}parse(s,t){const r=this.regexp(t),i=s.match(new RegExp(r.all));if(i){const[,c,l,e,h,u,o]=i;return[c,l,e,h||"",u,o]}const n=s.match(new RegExp(`^(?:(${r.prefix}):)?${r.type}$`));return n?[n[1],n[2],"","",void 0,void 0]:null}constructRaw(s,t,r,i,n,c){return`${s?`${s}:`:""}${t}${r?"-":""}${r}${i}${n?`/${n}${c}`:""}`}processValue(s,t,r){if(!s)return"";const i=n=>n.replace(/\{([^}]+)\}/g,(c,l)=>{const e=this.values,h=e!==null?typeof e[r]=="object"?e[r][l]:e[l]:void 0;return typeof h=="string"?h:c});if(typeof this.values=="object"&&this.values!==null&&(this.values[r]&&typeof this.values[r]=="object"&&this.values[r][s]||this.values[s]))return typeof this.values[r]=="object"&&this.values[r]!==null?this.values[r][s]:this.values[s];if(s.startsWith("$"))return`var(--${s.slice(1)})`;if(s.startsWith("[")&&s.endsWith("]")||s.startsWith("(")&&s.endsWith(")")){const n=s.slice(1,-1).replace(/\\\_/g,"m0x13c55").replace(/\_/g," ").replace(/m0x13c55/g,"_");return n.includes("{")?i(n):n.startsWith("--")?`var(${n})`:n}return s+(t||"")}processShorthand(s="",t="",r="",i,n="",c="",l){const e=this.property[s];if(typeof e=="object"&&!Array.isArray(e)&&!("property"in e))return null;const h=/^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;let u=null,o=t||"";const b=o.match(h);if(b&&(u=b[1].trim(),o=b[2].trim()),(typeof e=="string"&&!e.includes(":")||Array.isArray(e))&&(!t||t.includes(u+":")||n))return null;let p;t.includes(u+":")?p=t.startsWith("(")?`(${o})`:`[${o}]`:p=t;const y=this.processValue(p,r,s),g=this.processValue(n,c,s);if(s.startsWith("[")&&s.endsWith("]")){if(!t||n)return null;const a=s.slice(1,-1).split(",").map(C=>C.trim().startsWith("--")?String(C.trim()):this.toKebabCase(String(C.trim())));return{className:this.constructRaw(i,s,t,r),cssRules:a.length===1?a[0]:a,value:y,prefix:i}}if(e){if(typeof e=="object"&&"property"in e){const C=e.group&&this.values[e.group][y]?this.values[e.group][y]:r?t:y,$=typeof e.property=="function"?e.property({value:t.startsWith("[")?y:C,unit:t.startsWith("[")?"":r,secondValue:t.startsWith("[")?"":c?n:g,secondUnit:t.startsWith("[")?"":c,key:u,raw:l}):e.property,m=e.value||"{0}";let W;if(typeof m=="function")W=m({value:C,unit:r,secondValue:c?n:g,secondUnit:c,key:u,raw:l});else if(typeof m=="string"){const x=e.group||s,R=this.processValue(p,r,x);this.values[x]&&typeof this.values[x]=="object"&&this.values[x][p]?W=this.values[x][p]:m.includes("{")?W=this.parseValuePattern(x,m,R,"",g,""):typeof m=="string"&&!m.includes("{")?W=m:W=y}else if(Array.isArray(m)){if(!m.includes(t+r)||n)return null;W=t+r}else W=null;return(typeof e.property=="string"||Array.isArray(e.property))&&typeof m=="string"&&(t.includes(u+":")||!m.includes("{1")&&n)||(typeof e.property=="string"||Array.isArray(e.property))&&m===null||typeof e.property=="string"&&e.property.includes(":")&&t||(typeof e.property=="string"||Array.isArray(e.property))&&typeof e.value=="string"&&!e.value.includes("{")&&t?null:{className:this.constructRaw(i,s,t,r,n,c),cssRules:$?Array.isArray($)?$:typeof $=="string"&&($.includes(":")||$.includes("value:"))?$.includes("value:")?$.slice(6):this.toKebabCase(String($)):this.toKebabCase(String($)):null,value:m===null||$===null||$.includes(":")||$.includes("value:")?null:t.startsWith("[")?y:W,prefix:i}}const a=typeof e=="function"?e({value:t.startsWith("[")?y:r?t:y,unit:t.startsWith("[")?"":r,secondValue:t.startsWith("[")?"":c?n:g,secondUnit:t.startsWith("[")?"":c,key:u,raw:l}):e;return{className:this.constructRaw(i,s,t,r,n,c),cssRules:a?Array.isArray(e)?a:typeof a=="string"&&(a.includes(":")||a.startsWith("value:"))?a.startsWith("value:")?a.slice(6):this.toKebabCase(String(a)):this.toKebabCase(String(a)):null,value:typeof a=="string"&&a.includes(":")?null:y,prefix:i}}return null}parseValuePattern(s,t,r,i,n,c){if(!t.includes("{0}")&&!t.includes("{1")&&!t.includes("||"))return t;const[l,e]=t.split("||").map(o=>o.trim()),h=this.processValue(r,i,s),u=this.processValue(n,c,s);if(t.includes("{0}")&&t.includes("{1")||t.includes("{1")){let o=l;if(r&&(o=o.replace(/\{0\}/g,h)),t.includes("{1")){t.includes("{1}")&&(n?o=n.startsWith("[")?u:o.replace(/\{1\}/g,u):o=e||l);const b=/\{1([^}]*)\}/g;let p;for(;(p=b.exec(o))!==null;){const y=p[0],g=p[1].trim();let a=u;!a&&g.includes("|")?a=g.split("|")[1].trim():a||(a=""),o=r.startsWith("[")?h:o.replace(y,a)}}return r?o:e||l}else return r?r.startsWith("[")?h:l.replace(/\{0\}/g,h):e||l}getParentClass(s){return Object.keys(this.classes).filter(t=>Object.prototype.hasOwnProperty.call(this.classes[t],s))}processCustomClass(s,t="",r="",i="",n="",c=""){if(!s)return null;const l=this.getParentClass(s),e=t&&s.endsWith(`-${t}${r}`);if(l.length>0){const h=l.map(u=>{const o=this.classes[u];if(!o||t&&!e&&o[s]&&!o[s].includes("{0}")&&!o[s].includes("|"))return null;const b=this.parseValuePattern(s,o[s]||"",t,r,n,c);return`${this.toKebabCase(String(u))}: ${b}`}).filter(Boolean).join("; ");return{className:e?s:this.constructRaw(i,s,t,r,n,c),cssRules:h,value:null,prefix:i}}return null}process(s){try{const t=Array.isArray(s)?s:s.split(/\s+/),r=[];for(const i of t)try{if(!i)continue;const n=this.parse(i);if(!n)continue;const[c,l,e,h,u,o]=n;if(!l)continue;const b=this.getParentClass(`${l}-${e}`).length>0?`${l}-${e}`:l;try{const p=this.processCustomClass(b,e,h,c,u,o);if(p){const{className:y,cssRules:g,prefix:a}=p;if(!g||g==="null")continue;r.push({className:this.escapeCSSSelector(y),cssRules:g,value:null,prefix:a,raw:[...n,this.constructRaw(a,l,e,h,u,o)]});continue}}catch(p){console.warn(`Error processing custom class "${i}":`,p)}try{const p=this.processShorthand(l,e,h,c,u,o,n);if(p){const{className:y,cssRules:g,value:a,prefix:C}=p;if(!g||g==="null")continue;r.push({className:this.escapeCSSSelector(y),cssRules:g,value:a,prefix:C,raw:[...n,this.constructRaw(c,l,e,h,u,o)]})}}catch(p){console.warn(`Error processing shorthand "${i}":`,p)}}catch(n){console.warn(`Failed to process class \`${i}\`:`,n)}return r}catch(t){return console.error("Critical error in process method:",t),[]}}}d.TenoxUI=f,d.default=f,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(d,f){typeof exports=="object"&&typeof module!="undefined"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(d=typeof globalThis!="undefined"?globalThis:d||self,f(d.__tenoxui_moxie__={}))})(this,function(d){"use strict";var _=Object.defineProperty;var P=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var R=(d,f,C)=>f in d?_(d,f,{enumerable:!0,configurable:!0,writable:!0,value:C}):d[f]=C,S=(d,f)=>{for(var C in f||(f={}))j.call(f,C)&&R(d,C,f[C]);if(P)for(var C of P(f))V.call(f,C)&&R(d,C,f[C]);return d};class f{constructor({property:t={},values:e={},classes:s={},prefixChars:n=[]}={}){this.property=S({moxie:({key:i,secondValue:l})=>l?null:i},t),this.values=e,this.classes=s,this.prefixChars=n.map(this.escapeRegex)}toKebabCase(t){if(/^(webkit|moz|ms|o)[A-Z]/.test(t)){const e=t.match(/^(webkit|moz|ms|o)/);if(e){const s=e[0];return`-${s}${t.slice(s.length).replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`}}return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}escapeCSSSelector(t){return t.replace(/^(\d)/,"\\3$1 ").replace(/([#{}.:;?%&,@+*~'"!^$[\]()=>|/])/g,"\\$1")}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\/\\-]/g,"\\$&")}getAllClassNames(t){if(!t)return[];const e=new Set;return Object.entries(t).forEach(([s,n])=>{n&&typeof n=="object"&&Object.keys(n).forEach(i=>{e.add(i)})}),Array.from(e)}getTypePrefixes(t=[]){const e=this.classes,s=Object.keys(this.property);if(!e)return[...s,...t].sort((l,o)=>o.length-l.length);const i=[...this.getAllClassNames(e)];return[...s,...i,...t].sort((l,o)=>o.length-l.length)}regexp(t){const e=this.getTypePrefixes(t).map(this.escapeRegex).join("|"),s="\\[[^\\]]+\\]",n="\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)",i="\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}",l=`[${["a-zA-Z0-9_\\-",...this.prefixChars].join("")}]`,o=l+"+|"+l+"+(?:-(?:"+s+"|"+n+"|"+i+"))|"+l+"+(?:-(?:"+s+"|"+n+"|"+i+"))?(?:\\/[a-zA-Z0-9_\\-]+)|"+s+"|"+n+"|"+i,r=`(${e}|\\[[^\\]]+\\])`,h="(?:-)",u="(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+s+"|"+i+"|"+n+"|(?:\\$[^\\s\\/]+))",c="([a-zA-Z%]*)",A="(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|"+s+"|"+i+"|"+n+"|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";return{prefix:o,type:r,separator:h,value:u,unit:c,secondValuePattern:A,all:"^(?:("+o+"):)?"+r+h+u+c+A+"$"}}parse(t,e){const s=this.regexp(e),n=t.match(new RegExp(s.all));if(n){const[,l,o,r,h,u,c]=n;return[l,o,r,h||"",u,c]}const i=t.match(new RegExp(`^(?:(${s.prefix}):)?${s.type}$`));return i?[i[1],i[2],"","",void 0,void 0]:null}constructRaw(t,e,s,n,i,l){return`${t?`${t}:`:""}${e}${s?"-":""}${s}${n}${i?`/${i}${l}`:""}`}processValue(t,e,s){if(!t)return"";const n=i=>i.replace(/\{([^}]+)\}/g,(l,o)=>{const r=this.values,h=r!==null?typeof r[s]=="object"?r[s][o]:r[o]:void 0;return typeof h=="string"?h:l});if(typeof this.values=="object"&&this.values!==null&&(this.values[s]&&typeof this.values[s]=="object"&&this.values[s][t]||this.values[t]))return typeof this.values[s]=="object"&&this.values[s]!==null?this.values[s][t]:this.values[t];if(t.startsWith("$"))return`var(--${t.slice(1)})`;if(t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")")){const i=t.slice(1,-1).replace(/\\\_/g,"m0x13c55").replace(/\_/g," ").replace(/m0x13c55/g,"_");return i.includes("{")?n(i):i.startsWith("--")?`var(${i})`:i}return t+(e||"")}processShorthand(t="",e="",s="",n,i="",l="",o){const r=this.property[t];if(typeof r=="object"&&!Array.isArray(r)&&!("property"in r))return null;const h=/^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;let u=null,c=e||"";const A=c.match(h);if(A&&(u=A[1].trim(),c=A[2].trim()),(typeof r=="string"&&!r.includes(":")||Array.isArray(r))&&(!e||e.includes(u+":")||i))return null;let p;e.includes(u+":")?p=e.startsWith("(")?`(${c})`:`[${c}]`:p=e;const y=this.processValue(p,s,t),g=this.processValue(i,l,t);if(t.startsWith("[")&&t.endsWith("]")){if(!e||i)return null;const a=t.slice(1,-1).split(",").map(b=>b.trim().startsWith("--")?String(b.trim()):this.toKebabCase(String(b.trim())));return{className:this.constructRaw(n,t,e,s),cssRules:a.length===1?a[0]:a,value:y,prefix:n}}if(r){if(typeof r=="object"&&"property"in r){const b=r.group&&this.values[r.group][y]?this.values[r.group][y]:s?e:y,m=typeof r.property=="function"?r.property({value:e.startsWith("[")?y:b,unit:e.startsWith("[")?"":s,secondValue:e.startsWith("[")?"":l?i:g,secondUnit:e.startsWith("[")?"":l,key:u,raw:o}):r.property,$=r.value||"{0}";let x;if(typeof $=="function")x=$({value:b,unit:s,secondValue:l?i:g,secondUnit:l,key:u,raw:o});else if(typeof $=="string"){const W=r.group||t,w=this.processValue(p,s,W);this.values[W]&&typeof this.values[W]=="object"&&this.values[W][p]?x=this.values[W][p]:$.includes("{")?x=this.parseValuePattern(W,$,w,"",g,""):typeof $=="string"&&!$.includes("{")?x=$:x=y}else if(Array.isArray($)){if(!$.includes(e+s)||i)return null;x=e+s}else x=null;return(typeof r.property=="string"||Array.isArray(r.property))&&typeof $=="string"&&(e.includes(u+":")||!$.includes("{1")&&i)||(typeof r.property=="string"||Array.isArray(r.property))&&$===null||typeof r.property=="string"&&r.property.includes(":")&&e||(typeof r.property=="string"||Array.isArray(r.property))&&typeof r.value=="string"&&!r.value.includes("{")&&e?null:{className:this.constructRaw(n,t,e,s,i,l),cssRules:m?Array.isArray(m)?m:typeof m=="string"&&(m.includes(":")||m.includes("value:"))?m.includes("value:")?m.slice(6):this.toKebabCase(String(m)):this.toKebabCase(String(m)):null,value:$===null||m===null||m.includes(":")||m.includes("value:")?null:e.startsWith("[")?y:x,prefix:n}}const a=typeof r=="function"?r({value:e.startsWith("[")?y:s?e:y,unit:e.startsWith("[")?"":s,secondValue:e.startsWith("[")?"":l?i:g,secondUnit:e.startsWith("[")?"":l,key:u,raw:o}):r;return{className:this.constructRaw(n,t,e,s,i,l),cssRules:a?Array.isArray(r)?a:typeof a=="string"&&(a.includes(":")||a.startsWith("value:"))?a.startsWith("value:")?a.slice(6):this.toKebabCase(String(a)):this.toKebabCase(String(a)):null,value:typeof a=="string"&&a.includes(":")?null:y,prefix:n}}return null}parseValuePattern(t,e,s,n,i,l){if(!e.includes("{0}")&&!e.includes("{1")&&!e.includes("||"))return e;const[o,r]=e.split("||").map(c=>c.trim()),h=this.processValue(s,n,t),u=this.processValue(i,l,t);if(e.includes("{0}")&&e.includes("{1")||e.includes("{1")){let c=o;if(s&&(c=c.replace(/\{0\}/g,h)),e.includes("{1")){e.includes("{1}")&&(i?c=i.startsWith("[")?u:c.replace(/\{1\}/g,u):c=r||o);const A=/\{1([^}]*)\}/g;let p;for(;(p=A.exec(c))!==null;){const y=p[0],g=p[1].trim();let a=u;!a&&g.includes("|")?a=g.split("|")[1].trim():a||(a=""),c=s.startsWith("[")?h:c.replace(y,a)}}return s?c:r||o}else return s?s.startsWith("[")?h:o.replace(/\{0\}/g,h):r||o}getParentClass(t){return Object.keys(this.classes).filter(e=>Object.prototype.hasOwnProperty.call(this.classes[e],t))}processCustomClass(t,e="",s="",n="",i="",l=""){if(!t)return null;const o=this.getParentClass(t),r=e&&t.endsWith(`-${e}${s}`);if(o.length>0){const h=o.map(u=>{const c=this.classes[u];if(!c||e&&!r&&c[t]&&!c[t].includes("{0}")&&!c[t].includes("|"))return null;const A=this.parseValuePattern(t,c[t]||"",e,s,i,l);return`${this.toKebabCase(String(u))}: ${A}`}).filter(Boolean).join("; ");return{className:r?t:this.constructRaw(n,t,e,s,i,l),cssRules:h,value:null,prefix:n}}return null}process(t){try{const e=Array.isArray(t)?t:t.split(/\s+/),s=[];for(const n of e)try{if(!n)continue;const i=this.parse(n);if(!i)continue;const[l,o,r,h,u,c]=i;if(!o)continue;const A=this.getParentClass(`${o}-${r}`).length>0?`${o}-${r}`:o;try{const p=this.processCustomClass(A,r,h,l,u,c);if(p){const{className:y,cssRules:g,prefix:a}=p;if(!g||g==="null")continue;s.push({className:this.escapeCSSSelector(y),cssRules:g,value:null,prefix:a,raw:[...i,this.constructRaw(a,o,r,h,u,c)]});continue}}catch(p){console.warn(`Error processing custom class "${n}":`,p)}try{const p=this.processShorthand(o,r,h,l,u,c,i);if(p){const{className:y,cssRules:g,value:a,prefix:b}=p;if(!g||g==="null")continue;s.push({className:this.escapeCSSSelector(y),cssRules:g,value:a,prefix:b,raw:[...i,this.constructRaw(l,o,r,h,u,c)]})}}catch(p){console.warn(`Error processing shorthand "${n}":`,p)}}catch(i){console.warn(`Failed to process class \`${n}\`:`,i)}return s}catch(e){return console.error("Critical error in process method:",e),[]}}}d.TenoxUI=f,d.default=f,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -22,6 +22,7 @@ export interface Config {
22
22
  property?: Property;
23
23
  values?: Values;
24
24
  classes?: Classes;
25
+ prefixChars?: string[];
25
26
  }
26
27
  export type Parsed = null | (string | undefined)[];
27
28
  export type ProcessedStyle = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenoxui/moxie",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Very lightweight utility-first CSS engine for style generation",
5
5
  "author": "NOuSantx <nousantx@gmail.com>",
6
6
  "license": "MIT",