@unocss/runtime 0.50.5 → 0.50.7
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/attributify.global.js +3 -3
- package/core.global.js +2 -2
- package/dist/index.js +9 -3
- package/dist/index.mjs +9 -3
- package/full.global.js +3 -3
- package/mini.global.js +3 -3
- package/package.json +4 -4
- package/uno.global.js +3 -3
package/core.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(()=>{function
|
|
2
|
-
`,c=new Set([
|
|
1
|
+
"use strict";(()=>{function be(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var H=be;function A(t=[]){return Array.isArray(t)?t:[t]}function j(t){return Array.from(new Set(t))}function T(t){return typeof t=="string"}function D(t){return T(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function ee(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>D(e)):[t]:[D(t)]}function ve(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function F(t){return t==null?"":ve(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function G(t){return t&&typeof t=="object"&&!Array.isArray(t)}function N(t,e){let r=t,n=e;if(Array.isArray(r))return[...n];let s={...r};return G(r)&&G(n)&&Object.keys(n).forEach(i=>{G(r[i])&&G(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=N(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function k(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:k(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}return t}function te(t){return T(t[0])}function re(t){return T(t[0])}var we=/[\w\u00A0-\uFFFF-_:%-?]/,q="$$shortcut-no-merge";function ne(t=""){return we.test(t)}function se(t){return typeof t=="function"?{match:t}:t}function Y(t){return t.length===3}function ie(t){return t!=null}function oe(){}var B=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var z={};function Ae(t=["-",":"]){let e=t.join("|");return z[e]||(z[e]=new RegExp(`((?:[!@\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),z[e].lastIndex=0,z[e]}function Ue(t,e=["-",":"],r=5){let n=Ae(e),s=!1,i=t.toString(),o=new Set;do{let a=i;i=i.replace(n,(u,l,c,d)=>e.includes(c)?(o.add(l+c),d.split(/\s/g).filter(Boolean).map(x=>x==="~"?l:x.replace(/^(!?)(.*)/,`$1${l}${c}$2`)).join(" ")):u),s=i!==a,r-=1}while(s&&r);return{prefixes:Array.from(o),expanded:i,hasChanged:s}}function ae(t,e=["-",":"],r=5){let{expanded:n}=Ue(t.toString(),e,r);return typeof t=="string"?n:t.length()?t.overwrite(0,t.length(),n):t}var ce=new Set;function le(t){ce.has(t)||(console.warn("[unocss]",t),ce.add(t))}var ue=/[\\:]?[\s'"`;{}]+/g;var fe=/(?:[\w&:[\]-]|\[\S+=\S+\])+\[\\?['"]?\S+?['"]\]\]?[\w:-]*/g,pe=/\[(\\\W|[\w-])+:[^\s:]*?("\S+?"|'\S+?'|`\S+?`|[^\s:]+?)[^\s:]*?\)?\]/g,Ve=/^\[(\\\W|[\w-])+:['"]?\S+?['"]?\]$/;function $e(t){let e=new Set;for(let r of t.matchAll(pe))t[r.index-1]?.match(/^[\s'"`]/)&&e.add(r[0]);for(let r of t.matchAll(fe))e.add(r[0]);return t.split(ue).forEach(r=>{ne(r)&&!Ve.test(r)&&e.add(r)}),[...e]}var Z={name:"split",order:0,extract({code:t}){return $e(t)}};function de(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var W="default",I="preflights",Me="shortcuts",he={[I]:-100,[Me]:-10,[W]:0};function me(t){return A(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}function _e(t){let e=t.shortcuts?me(t.shortcuts):void 0;if(t.shortcuts=e,t.prefix||t.layer){let r=n=>{n[2]||(n[2]={});let s=n[2];s.prefix==null&&t.prefix&&(s.prefix=A(t.prefix)),s.layer==null&&t.layer&&(s.layer=t.layer)};e?.forEach(r),t.rules?.forEach(r)}return t}function J(t={},e={}){let r=Object.assign({},e,t),n=(r.presets||[]).flatMap(A).map(_e),s=[...n.filter(f=>f.enforce==="pre"),...n.filter(f=>!f.enforce),...n.filter(f=>f.enforce==="post")],i=Object.assign({},he,...n.map(f=>f.layers),r.layers);function o(f){return j([...s.flatMap(h=>A(h[f]||[])),...A(r[f]||[])])}let a=o("extractors");a.length||a.push(Z),a.sort((f,h)=>(f.order||0)-(h.order||0));let u=o("rules"),l={},c=u.length,d=u.map((f,h)=>{if(te(f)){A(f[2]?.prefix||"").forEach(E=>{l[E+f[0]]=[h,f[1],f[2],f]});return}return[h,...f]}).filter(Boolean).reverse(),x=k([...s.map(f=>f.theme||{}),r.theme||{}].reduce((f,h)=>N(f,h),{}));o("extendTheme").forEach(f=>f(x));let C={templates:j(s.map(f=>A(f.autocomplete?.templates)).flat()),extractors:s.map(f=>A(f.autocomplete?.extractors)).flat().sort((f,h)=>(f.order||0)-(h.order||0))},v=A(o("separators"));return v.length||(v=[":","-"]),{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:f=>f,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:x,rulesSize:c,rulesDynamic:d,rulesStaticMap:l,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:C,variants:o("variants").map(se).sort((f,h)=>(f.order||0)-(h.order||0)),shortcuts:me(o("shortcuts")).reverse(),extractors:a,safelist:o("safelist"),separators:v}}var ge="0.50.7";var Q=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=J(e,r),this.events.emit("config",this.config)}version=ge;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=de();setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=J(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={get original(){return e},code:e,id:r};for(let i of this.config.extractors){let o=await i.extract(s);if(o)for(let a of o)n.add(a)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let l of this.config.preprocess)s=l(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=await this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let o=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let a=await this.expandShortcut(o.currentSelector,o),u=a?await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]):(await this.parseUtil(o.variantMatch,o))?.map(l=>this.stringifyUtil(l,o)).filter(ie);if(u?.length)return this._cache.set(n,u),u;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:a=!1}=r,u=T(e)?await this.applyExtractors(e,n):Array.isArray(e)?new Set(e):e;o&&this.config.safelist.forEach(g=>u.add(g));let l=a?"":`
|
|
2
|
+
`,c=new Set([W]),d=new Set,x=new Map,C={},v=Array.from(u).map(async g=>{if(d.has(g))return;let S=await this.parseToken(g);if(S!=null){d.add(g);for(let R of S){let w=R[3]||"",V=R[4]?.layer;x.has(w)||x.set(w,[]),x.get(w).push(R),V&&c.add(V)}}});await Promise.all(v),await(async()=>{if(!i)return;let g={generator:this,theme:this.config.theme},S=new Set([]);this.config.preflights.forEach(({layer:R=I})=>{c.add(R),S.add(R)}),C=Object.fromEntries(await Promise.all(Array.from(S).map(async R=>{let V=(await Promise.all(this.config.preflights.filter(_=>(_.layer||I)===R).map(async _=>await _.getCSS(g)))).filter(Boolean).join(l);return[R,V]})))})();let f=this.config.sortLayers(Array.from(c).sort((g,S)=>(this.config.layers[g]??0)-(this.config.layers[S]??0)||g.localeCompare(S))),h={},b=g=>{if(h[g])return h[g];let S=Array.from(x).sort((w,V)=>(this.parentOrders.get(w[0])??0)-(this.parentOrders.get(V[0])??0)||w[0]?.localeCompare(V[0]||"")||0).map(([w,V])=>{let _=V.length,L=V.filter(p=>(p[4]?.layer||W)===g).sort((p,y)=>p[0]-y[0]||(p[4]?.sort||0)-(y[4]?.sort||0)||p[5]?.currentSelector?.localeCompare(y[5]?.currentSelector??"")||p[1]?.localeCompare(y[1]||"")||p[2]?.localeCompare(y[2]||"")||0).map(([,p,y,,U,,$])=>[[[(p&&je(p,s))??"",U?.sort??0]],y,!!($??U?.noMerge)]);if(!L.length)return;let K=L.reverse().map(([p,y,U],$)=>{if(!U&&this.config.mergeSelectors)for(let O=$+1;O<_;O++){let M=L[O];if(M&&!M[2]&&(p&&M[0]||p==null&&M[0]==null)&&M[1]===y)return p&&M[0]&&M[0].push(...p),null}let P=p?j(p.sort((O,M)=>O[1]-M[1]||O[0]?.localeCompare(M[0]||"")||0).map(O=>O[0]).filter(Boolean)):[];return P.length?`${P.join(`,${l}`)}{${y}}`:y}).filter(Boolean).reverse().join(l);if(!w)return K;let m=w.split(" $$ ");return`${m.join("{")}{${l}${K}${l}}${m.map(p=>"").join("}")}`}).filter(Boolean).join(l);i&&(S=[C[g],S].filter(Boolean).join(l));let R=a?"":`/* layer: ${g} */${l}`;return h[g]=S?R+S:""},E=(g=f,S)=>g.filter(R=>!S?.includes(R)).map(R=>b(R)||"").filter(Boolean).join(l);return{get css(){return E()},layers:f,matched:d,getLayers:E,getLayer:b}}async matchVariants(e,r){let n=new Set,s=[],i=r||e,o=!1,a={rawSelector:e,theme:this.config.theme,generator:this};for(;;){o=!1;for(let u of this.config.variants){if(!u.multiPass&&n.has(u))continue;let l=await u.match(i,a);if(l){T(l)&&(l={matcher:l}),i=l.matcher,s.unshift(l),n.add(u),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,s,n]}applyVariants(e,r=e[4],n=e[1]){let i=r.slice().sort((l,c)=>(l.order||0)-(c.order||0)).reduceRight((l,c)=>d=>{let x=c.body?.(d.entries)||d.entries,C=Array.isArray(c.parent)?c.parent:[c.parent,void 0];return(c.handle??ke)({...d,entries:x,selector:c.selector?.(d.selector,x)||d.selector,parent:C[0]||d.parent,parentOrder:C[1]||d.parentOrder,layer:c.layer||d.layer,sort:c.sort||d.sort},l)},l=>l)({prefix:"",selector:De(n),pseudo:"",entries:e[2]}),{parent:o,parentOrder:a}=i;o!=null&&a!=null&&this.parentOrders.set(o,a);let u={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let l of this.config.postprocess)l(u);return u}constructCustomCSS(e,r,n){let s=D(r);if(T(s))return s;let{selector:i,entries:o,parent:a}=this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]),u=`${i}{${F(o)}}`;return a?`${a}{${u}}`:u}async parseUtil(e,r,n=!1,s){let[i,o,a]=T(e)?await this.matchVariants(e):e;this.config.details&&(r.rules=r.rules??[]);let u=this.config.rulesStaticMap[o];if(u&&u[1]&&(n||!u[2]?.internal)){this.config.details&&r.rules.push(u[3]);let c=u[0],d=D(u[1]),x=u[2];return T(d)?[[c,d,x]]:[[c,i,d,x,a]]}r.variantHandlers=a;let{rulesDynamic:l}=this.config;for(let[c,d,x,C]of l){if(C?.internal&&!n)continue;let v=o;if(C?.prefix){let E=A(C.prefix);if(s){let g=A(s);if(!E.some(S=>g.includes(S)))continue}else{let g=E.find(S=>o.startsWith(S));if(g==null)continue;v=o.slice(g.length)}}let f=v.match(d);if(!f)continue;let h=await x(f,r);if(!h)continue;this.config.details&&r.rules.push([d,x,C]);let b=ee(h).filter(E=>E.length);if(b.length)return b.map(E=>T(E)?[c,E,C]:[c,i,E,C,a])}}stringifyUtil(e,r){if(!e)return;if(Y(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:a,noMerge:u}=this.applyVariants(e),l=F(s);if(!l)return;let{layer:c,sort:d,...x}=e[3]??{},C={...x,layer:o??c,sort:a??d};return[e[0],n,l,i,C,this.config.details?r:void 0,u]}async expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?a=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(a)}:oe,i,o;for(let a of this.config.shortcuts){let u=e;if(a[2]?.prefix){let c=A(a[2].prefix).find(d=>e.startsWith(d));if(c==null)continue;u=e.slice(c.length)}if(re(a)){if(a[0]===u){i=i||a[2],o=a[1],s(a);break}}else{let l=u.match(a[0]);if(l&&(o=a[1](l,r)),o){i=i||a[2],s(a);break}}}if(T(o)&&(o=ae(o.trim()).split(/\s+/g)),!o){let[a,u]=T(e)?await this.matchVariants(e):e;if(a!==u){let l=await this.expandShortcut(u,r,n-1);l&&(o=l[0].map(c=>T(c)?a.replace(u,c):c))}}if(o)return[(await Promise.all(o.map(async a=>(T(a)?(await this.expandShortcut(a,r,n-1))?.[0]:void 0)||[a]))).flat(1).filter(Boolean),i]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let i=new B,o=(await Promise.all(j(n).map(async c=>{let d=T(c)?await this.parseUtil(c,r,!0,s.prefix):[[1/0,"{inline}",D(c),void 0,[]]];return d||le(`unmatched utility "${c}" in shortcut "${e[1]}"`),d||[]}))).flat(1).filter(Boolean).sort((c,d)=>c[0]-d[0]),[a,,u]=e,l=[];for(let c of o){if(Y(c)){l.push([c[0],void 0,c[1],void 0,c[2],r,void 0]);continue}let{selector:d,entries:x,parent:C,sort:v,noMerge:f}=this.applyVariants(c,[...c[4],...u],a);i.getFallback(d,C,[[],c[0]])[0].push([x,!!(f??c[3]?.noMerge),v??0])}return l.concat(i.map(([c,d],x,C)=>{let v=(h,b,E)=>{let g=Math.max(...E.map(R=>R[1])),S=E.map(R=>R[0]);return(h?[S.flat(1)]:S).map(R=>{let w=F(R);if(w)return[d,x,w,C,{...s,noMerge:b,sort:g},r,void 0]})};return[[c.filter(([,h])=>h).map(([h,,b])=>[h,b]),!0],[c.filter(([,h])=>!h).map(([h,,b])=>[h,b]),!1]].map(([h,b])=>[...v(!1,b,h.filter(([E])=>E.some(g=>g[0]===q))),...v(!0,b,h.filter(([E])=>E.every(g=>g[0]!==q)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(r=>T(r)?r===e:r.test(e))}};function xe(t,e){return new Q(t,e)}var Oe=/\s\$\$\s+/g;function Le(t){return t.match(/\s\$\$\s/)}function je(t,e){return Le(t)?t.replace(Oe,e?` ${e} `:" "):e?`${e} ${t}`:t}var ye=/^\[(.+?)(~?=)"(.*)"\]$/;function De(t){return ye.test(t)?t.replace(ye,(e,r,n,s)=>`[${H(r)}${n}"${H(s)}"]`):`.${H(t)}`}function ke(t,e){return e(t)}function Ke(t){return t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():"")}function Se(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Ce(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var Ee=["Webkit","Moz","ms"];function Re(t){let e={};function r(n){let s=e[n];if(s)return s;let i=Ke(n);if(i!=="filter"&&i in t)return e[n]=Ce(i);i=Se(i);for(let o=0;o<Ee.length;o++){let a=`${Ee[o]}${i}`;if(a in t)return e[n]=Ce(Se(a))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function Te(t){return t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}function X(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,r=window.document,n=()=>r.documentElement,s=e.__unocss||{},i=Object.assign({},t,s.runtime),o=i.defaults||{},a=i.cloakAttribute??"un-cloak";i.autoPrefix&&(o.postprocess=A(o.postprocess)).unshift(Re(r.createElement("div").style)),i.configResolved?.(s,o);let u=xe(s,o),l=new Map,c=!0,d=new Set,x,C,v=[],f=()=>new Promise(m=>{v.push(m),C!=null&&clearTimeout(C),C=setTimeout(()=>E().then(()=>{let p=v;v=[],p.forEach(y=>y())}),0)});function h(m){if(m.nodeType!==1)return;let p=m;p.hasAttribute(a)&&p.removeAttribute(a),p.querySelectorAll(`[${a}]`).forEach(y=>{y.removeAttribute(a)})}function b(m,p){let y=l.get(m);if(!y)if(y=r.createElement("style"),l.set(m,y),p==null)n().prepend(y);else{let U=b(p),$=U.parentNode;$?$.insertBefore(y,U.nextSibling):n().prepend(y)}return y}async function E(){let m=await u.generate(d);return m.layers.reduce((p,y)=>(b(y,p).innerHTML=m.getLayer(y)??"",y),void 0),d=m.matched,{...m,getStyleElement:p=>l.get(p),getStyleElements:()=>l}}async function g(m){let p=d.size;await u.applyExtractors(m,void 0,d),p!==d.size&&await f()}async function S(){let m=r.body,p=m&&m.outerHTML;p&&(await g(`${p} ${Te(p)}`),h(n()),h(m))}let R=new MutationObserver(m=>{c||m.forEach(async p=>{if(p.target.nodeType!==1)return;let y=p.target;for(let U of l)if(y===U[1])return;if(p.type==="childList")p.addedNodes.forEach(async U=>{if(U.nodeType!==1)return;let $=U;x&&!x($)||(await g($.outerHTML),h($))});else{if(x&&!x(y))return;if(p.attributeName!==a){let U=Array.from(y.attributes).map(P=>P.value?`${P.name}="${P.value}"`:P.name).join(" "),$=`<${y.tagName.toLowerCase()} ${U}>`;await g($)}y.hasAttribute(a)&&y.removeAttribute(a)}})}),w=!1;function V(){if(w)return;let m=n()||r.body;m&&(R.observe(m,{childList:!0,subtree:!0,attributes:!0}),w=!0)}function _(){S(),V()}function L(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",_):_()}let K=e.__unocss_runtime=e.__unocss_runtime={version:u.version,uno:u,async extract(m){T(m)||(m.forEach(p=>d.add(p)),m=""),await g(m)},extractAll:S,inspect(m){x=m},toggleObserver(m){m===void 0?c=!c:c=!!m,!w&&!c&&L()},update:E};i.ready?.(K)!==!1&&(c=!1,L())}X();})();
|
package/dist/index.js
CHANGED
|
@@ -26,9 +26,15 @@ module.exports = __toCommonJS(src_exports);
|
|
|
26
26
|
var import_core = require("@unocss/core");
|
|
27
27
|
|
|
28
28
|
// src/utils.ts
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
function camelize(str) {
|
|
30
|
+
return str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
|
|
31
|
+
}
|
|
32
|
+
function capitalize(str) {
|
|
33
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
34
|
+
}
|
|
35
|
+
function hyphenate(str) {
|
|
36
|
+
return str.replace(/(?:^|\B)([A-Z])/g, "-$1").toLowerCase();
|
|
37
|
+
}
|
|
32
38
|
var prefixes = ["Webkit", "Moz", "ms"];
|
|
33
39
|
function autoPrefixer(style) {
|
|
34
40
|
const prefixCache = {};
|
package/dist/index.mjs
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
import { createGenerator, isString, toArray } from "@unocss/core";
|
|
3
3
|
|
|
4
4
|
// src/utils.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function camelize(str) {
|
|
6
|
+
return str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
|
|
7
|
+
}
|
|
8
|
+
function capitalize(str) {
|
|
9
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
10
|
+
}
|
|
11
|
+
function hyphenate(str) {
|
|
12
|
+
return str.replace(/(?:^|\B)([A-Z])/g, "-$1").toLowerCase();
|
|
13
|
+
}
|
|
8
14
|
var prefixes = ["Webkit", "Moz", "ms"];
|
|
9
15
|
function autoPrefixer(style) {
|
|
10
16
|
const prefixCache = {};
|