@unocss/runtime 0.45.26 → 0.45.28

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/core.global.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{function vt(e){let t=e.length,r=-1,n,s="",i=e.charCodeAt(0);for(;++r<t;){if(n=e.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&&t===1&&n===45){s+=`\\${e.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=e.charAt(r);continue}s+=`\\${e.charAt(r)}`}return s}var F=vt;function L(e=[]){return Array.isArray(e)?e:[e]}function D(e){return Array.from(new Set(e))}function v(e){return typeof e=="string"}function K(e){return v(e)?e:(Array.isArray(e)?e:Object.entries(e)).filter(t=>t[1]!=null)}function et(e){return Array.isArray(e)?e.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?e.map(t=>K(t)):[e]:[K(e)]}function wt(e){return e.filter(([t,r],n)=>{if(t.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(e[s][0]===t&&e[s][1]===r)return!1;return!0})}function G(e){return e==null?"":wt(e).map(([t,r])=>r!=null?`${t}:${r};`:void 0).filter(Boolean).join("")}function B(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Y(e,t){let r=e,n=t;if(Array.isArray(r))return[...n];let s={...r};return B(r)&&B(n)&&Object.keys(n).forEach(i=>{B(r[i])&&B(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=Y(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function H(e){let t,r,n;if(Array.isArray(e)){for(r=Array(t=e.length);t--;)r[t]=(n=e[t])&&typeof n=="object"?H(n):n;return r}if(Object.prototype.toString.call(e)==="[object Object]"){r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:H(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=(n=e[t])&&typeof n=="object"?H(n):n;return r}return e}function rt(e){return v(e[0])}function nt(e){return v(e[0])}var Ut=/[\w\u00A0-\uFFFF-_:%-?]/,q="$$shortcut-no-merge";function st(e=""){return Ut.test(e)}function it(e){return typeof e=="function"?{match:e}:e}function W(e){return e.length===3}function ot(e){return e!=null}function at(){}var z=class{_map=new Map;get(t,r){let n=this._map.get(t);if(n)return n.get(r)}getFallback(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(r)||s.set(r,n),s.get(r)}set(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(r,n),this}has(t,r){var n;return(n=this._map.get(t))==null?void 0:n.has(r)}delete(t,r){var n;return((n=this._map.get(t))==null?void 0:n.delete(r))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>t(i,r,s)))}};var ct=/((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function lt(e,t=["-",":"],r=5){ct.lastIndex=0;let n=!1,s=e.toString();do{let i=s;s=s.replace(ct,(a,p,c,o)=>t.includes(c)?o.split(/\s/g).filter(Boolean).map(d=>d==="~"?p:d.replace(/^(!?)(.*)/,`$1${p}${c}$2`)).join(" "):a),n=s!==i,r-=1}while(n&&r);return typeof e=="string"?s:e.length()?e.overwrite(0,e.length(),s):e}var ut=new Set;function ft(e){ut.has(e)||(console.warn("[unocss]",e),ut.add(e))}var At=e=>[...new Set(e.split(/\\?[\s'"`;={}]+/g))].filter(st),Z={name:"split",order:0,extract({code:e}){return At(e)}};function pt(){return{events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}}}var I="default",N="preflights",Vt="shortcuts",dt={[N]:-100,[Vt]:-10,[I]:0};function ht(e){return L(e).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}function $t(e){var r;let t=e.shortcuts?ht(e.shortcuts):void 0;if(e.shortcuts=t,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=e.prefix),i.layer==null&&e.layer&&(i.prefix=e.layer)};t==null||t.forEach(n),(r=e.rules)==null||r.forEach(n)}return e}function J(e={},t={}){let r=Object.assign({},t,e),n=(r.presets||[]).flatMap(L).map($t),s=[...n.filter(l=>l.enforce==="pre"),...n.filter(l=>!l.enforce),...n.filter(l=>l.enforce==="post")],i=Object.assign(dt,...n.map(l=>l.layers),e.layers);function a(l){return D([...s.flatMap(h=>L(h[l]||[])),...L(r[l]||[])])}let p=a("extractors");p.length||p.push(Z),p.sort((l,h)=>(l.order||0)-(h.order||0));let c=a("rules"),o={},d=c.length,u=c.map((l,h)=>{var A;if(rt(l)){let S=((A=l[2])==null?void 0:A.prefix)||"";o[S+l[0]]=[h,l[1],l[2],l];return}return[h,...l]}).filter(Boolean).reverse(),g=H([...s.map(l=>l.theme||{}),r.theme||{}].reduce((l,h)=>Y(l,h),{}));a("extendTheme").forEach(l=>l(g));let y={templates:D(s.map(l=>{var h;return L((h=l.autocomplete)==null?void 0:h.templates)}).flat()),extractors:s.map(l=>{var h;return L((h=l.autocomplete)==null?void 0:h.extractors)}).flat().sort((l,h)=>(l.order||0)-(h.order||0))};return{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:l=>l,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:g,rulesSize:d,rulesDynamic:u,rulesStaticMap:o,preprocess:a("preprocess"),postprocess:a("postprocess"),preflights:a("preflights"),autocomplete:y,variants:a("variants").map(it),shortcuts:ht(a("shortcuts")),extractors:p,safelist:a("safelist")}}var gt="0.45.26";var Q=class{constructor(t={},r={}){this.userConfig=t;this.defaults=r;this.config=J(t,r),this.events.emit("config",this.config)}version=gt;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=pt();setConfig(t,r){!t||(r&&(this.defaults=r),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=J(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,r,n=new Set){let s={get original(){return t},code:t,id:r};for(let i of this.config.extractors){let a=await i.extract(s);if(a)for(let p of a)n.add(p)}return n}makeContext(t,r){let n={rawSelector:t,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(t,r){var c;if(this.blocked.has(t))return;let n=`${t}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=t;for(let o of this.config.preprocess)s=o(t);if(this.isBlocked(s)){this.blocked.add(t),this._cache.set(n,null);return}let i=this.matchVariants(t,s);if(!i||this.isBlocked(i[1])){this.blocked.add(t),this._cache.set(n,null);return}let a=this.makeContext(t,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(a.variants=[...i[3]]);let p=this.expandShortcut(a.currentSelector,a);if(p){let o=await this.stringifyShortcuts(a.variantMatch,a,p[0],p[1]);if(o!=null&&o.length)return this._cache.set(n,o),o}else{let o=(c=await this.parseUtil(a.variantMatch,a))==null?void 0:c.map(d=>this.stringifyUtil(d,a)).filter(ot);if(o!=null&&o.length)return this._cache.set(n,o),o}this._cache.set(n,null)}async generate(t,r={}){let{id:n,scope:s,preflights:i=!0,safelist:a=!0,minify:p=!1}=r,c=v(t)?await this.applyExtractors(t,n):Array.isArray(t)?new Set(t):t;a&&this.config.safelist.forEach(m=>c.add(m));let o=p?"":`
2
- `,d=new Set([I]),u=new Set,g=new Map,y={},l=Array.from(c).map(async m=>{var C;if(u.has(m))return;let b=await this.parseToken(m);if(b!=null){u.add(m);for(let w of b){let f=w[3]||"",x=(C=w[4])==null?void 0:C.layer;g.has(f)||g.set(f,[]),g.get(f).push(w),x&&d.add(x)}}}),h=(async()=>{if(!i)return;let m={generator:this,theme:this.config.theme},b=new Set([]);this.config.preflights.forEach(({layer:C=N})=>{d.add(C),b.add(C)}),y=Object.fromEntries(await Promise.all(Array.from(b).map(async C=>{let f=(await Promise.all(this.config.preflights.filter(x=>(x.layer||N)===C).map(async x=>await x.getCSS(m)))).filter(Boolean).join(o);return[C,f]})))})();await Promise.all([...l,h]);let A=this.config.sortLayers(Array.from(d).sort((m,b)=>(this.config.layers[m]??0)-(this.config.layers[b]??0)||m.localeCompare(b))),S={},R=m=>{if(S[m])return S[m];let b=Array.from(g).sort((w,f)=>{var x;return(this.parentOrders.get(w[0])??0)-(this.parentOrders.get(f[0])??0)||((x=w[0])==null?void 0:x.localeCompare(f[0]||""))||0}).map(([w,f])=>{let x=f.length,U=f.filter(E=>{var V;return(((V=E[4])==null?void 0:V.layer)||I)===m}).sort((E,V)=>{var M,j,k,_;return E[0]-V[0]||(((M=E[4])==null?void 0:M.sort)||0)-(((j=V[4])==null?void 0:j.sort)||0)||((k=E[1])==null?void 0:k.localeCompare(V[1]||""))||((_=E[2])==null?void 0:_.localeCompare(V[2]||""))||0}).map(([,E,V,,M,,j])=>[[[(E&&Tt(E,s))??"",(M==null?void 0:M.sort)??0]],V,!!(j??(M==null?void 0:M.noMerge))]);if(!U.length)return;let P=U.reverse().map(([E,V,M],j)=>{if(!M&&this.config.mergeSelectors)for(let _=j+1;_<x;_++){let T=U[_];if(T&&!T[2]&&(E&&T[0]||E==null&&T[0]==null)&&T[1]===V)return E&&T[0]&&T[0].push(...E),null}let k=E?D(E.sort((_,T)=>{var tt;return _[1]-T[1]||((tt=_[0])==null?void 0:tt.localeCompare(T[0]||""))||0}).map(_=>_[0]).filter(Boolean)):[];return k.length?`${k.join(`,${o}`)}{${V}}`:V}).filter(Boolean).reverse().join(o);if(!w)return P;let O=w.split(" $$ ");return`${O.join("{")}{${o}${P}${o}}${O.map(E=>"").join("}")}`}).filter(Boolean).join(o);i&&(b=[y[m],b].filter(Boolean).join(o));let C=p?"":`/* layer: ${m} */${o}`;return S[m]=b?C+b:""},$=(m=A,b)=>m.filter(C=>!(b!=null&&b.includes(C))).map(C=>R(C)||"").filter(Boolean).join(o);return{get css(){return $()},layers:A,matched:u,getLayers:$,getLayer:R}}matchVariants(t,r){let n=new Set,s=[],i=r||t,a=!1,p={rawSelector:t,theme:this.config.theme,generator:this};for(;;){a=!1;for(let c of this.config.variants){if(!c.multiPass&&n.has(c))continue;let o=c.match(i,p);if(!!o){v(o)&&(o={matcher:o}),i=o.matcher,s.unshift(o),n.add(c),a=!0;break}}if(!a)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s,n]}applyVariants(t,r=t[4],n=t[1]){let i=[...r].sort((o,d)=>(o.order||0)-(d.order||0)).reverse().reduce((o,d)=>u=>{var l,h;let g=((l=d.body)==null?void 0:l.call(d,u.entries))||u.entries,y=Array.isArray(d.parent)?d.parent:[d.parent,void 0];return(d.handle??Lt)({...u,entries:g,selector:((h=d.selector)==null?void 0:h.call(d,u.selector,g))||u.selector,parent:y[0]||u.parent,parentOrder:y[1]||u.parentOrder,layer:d.layer||u.layer,sort:d.sort||u.sort},o)},o=>o)({prefix:"",selector:Pt(n),pseudo:"",entries:t[2]}),{parent:a,parentOrder:p}=i;a!=null&&p!=null&&this.parentOrders.set(a,p);let c={selector:Ot([i.prefix,i.selector,i.pseudo].join("")),entries:i.entries,parent:a,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let o of this.config.postprocess)o(c);return c}constructCustomCSS(t,r,n){let s=K(r);if(v(s))return s;let{selector:i,entries:a,parent:p}=this.applyVariants([0,n||t.rawSelector,s,void 0,t.variantHandlers]),c=`${i}{${G(a)}}`;return p?`${p}{${c}}`:c}async parseUtil(t,r,n=!1){var o;let[s,i,a]=v(t)?this.matchVariants(t):t;this.config.details&&(r.rules=r.rules??[]);let p=this.config.rulesStaticMap[i];if(p&&p[1]&&(n||!((o=p[2])!=null&&o.internal))){this.config.details&&r.rules.push(p[3]);let d=p[0],u=K(p[1]),g=p[2];return v(u)?[[d,u,g]]:[[d,s,u,g,a]]}r.variantHandlers=a;let{rulesDynamic:c}=this.config;for(let[d,u,g,y]of c){if((y==null?void 0:y.internal)&&!n)continue;let l=i;if(y!=null&&y.prefix){if(!i.startsWith(y.prefix))continue;l=i.slice(y.prefix.length)}let h=l.match(u);if(!h)continue;let A=await g(h,r);if(!A)continue;this.config.details&&r.rules.push([u,g,y]);let S=et(A).filter(R=>R.length);if(S.length)return S.map(R=>v(R)?[d,R,y]:[d,s,R,y,a])}}stringifyUtil(t,r){if(!t)return;if(W(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:a,sort:p,noMerge:c}=this.applyVariants(t),o=G(s);if(!o)return;let{layer:d,sort:u,...g}=t[3]??{},y={...g,layer:a??d,sort:p??u};return[t[0],n,o,i,y,this.config.details?r:void 0,c]}expandShortcut(t,r,n=5){var p;if(n===0)return;let s=this.config.details?c=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(c)}:at,i,a;for(let c of this.config.shortcuts){let o=(p=c[2])!=null&&p.prefix?t.slice(c[2].prefix.length):t;if(nt(c)){if(c[0]===o){i=i||c[2],a=c[1],s(c);break}}else{let d=o.match(c[0]);if(d&&(a=c[1](d,r)),a){i=i||c[2],s(c);break}}}if(v(a)&&(a=lt(a).split(/\s+/g)),!a){let[c,o]=v(t)?this.matchVariants(t):t;if(c!==o){let d=this.expandShortcut(o,r,n-1);d&&(a=d[0].map(u=>v(u)?c.replace(o,u):u))}}if(!!a)return[a.flatMap(c=>{var o;return(v(c)?(o=this.expandShortcut(c,r,n-1))==null?void 0:o[0]:void 0)||[c]}).filter(Boolean),i]}async stringifyShortcuts(t,r,n,s={layer:this.config.shortcutsLayer}){var d;let i=new z,a=(await Promise.all(D(n).map(async u=>{let g=v(u)?await this.parseUtil(u,r,!0):[[1/0,"{inline}",K(u),void 0,[]]];return g||ft(`unmatched utility "${u}" in shortcut "${t[1]}"`),g||[]}))).flat(1).filter(Boolean).sort((u,g)=>u[0]-g[0]),[p,,c]=t,o=[];for(let u of a){if(W(u)){o.push([u[0],void 0,u[1],void 0,u[2],r,void 0]);continue}let{selector:g,entries:y,parent:l,sort:h,noMerge:A}=this.applyVariants(u,[...u[4],...c],p);i.getFallback(g,l,[[],u[0]])[0].push([y,!!(A??((d=u[3])==null?void 0:d.noMerge)),h??0])}return o.concat(i.map(([u,g],y,l)=>{let h=(S,R,$)=>{let m=Math.max(...$.map(C=>C[1])),b=$.map(C=>C[0]);return(S?[b.flat(1)]:b).map(C=>{let w=G(C);if(w)return[g,y,w,l,{...s,noMerge:R,sort:m},r,void 0]})};return[[u.filter(([,S])=>S).map(([S,,R])=>[S,R]),!0],[u.filter(([,S])=>!S).map(([S,,R])=>[S,R]),!1]].map(([S,R])=>[...h(!1,R,S.filter(([$])=>$.some(m=>m[0]===q))),...h(!0,R,S.filter(([$])=>$.every(m=>m[0]!==q)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(r=>v(r)?r===t:r.test(t))}};function yt(e,t){return new Q(e,t)}var xt=/ \$\$ /,_t=e=>e.match(xt);function Tt(e,t){return _t(e)?e.replace(xt,t?` ${t} `:" "):t?`${t} ${e}`:e}function Ot(e){let t=e.match(/::[\w-]+(\([\w-]+\))?/g);if(t){for(let r of t)e=e.replace(r,"");e+=t.join("")}return e}var mt=/^\[(.+?)(~?=)"(.*)"\]$/;function Pt(e){return mt.test(e)?e.replace(mt,(t,r,n,s)=>`[${F(r)}${n}"${F(s)}"]`):`.${F(e)}`}function Lt(e,t){return t(e)}var jt=e=>e.replace(/-(\w)/g,(t,r)=>r?r.toUpperCase():""),St=e=>e.charAt(0).toUpperCase()+e.slice(1),Ct=e=>e.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),Et=["Webkit","Moz","ms"];function bt(e){let t={};function r(n){let s=t[n];if(s)return s;let i=jt(n);if(i!=="filter"&&i in e)return t[n]=Ct(i);i=St(i);for(let a=0;a<Et.length;a++){let p=`${Et[a]}${i}`;if(p in e)return t[n]=Ct(St(p))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function Rt(e){return e.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function X(e={}){var C,w;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},r=t==null?void 0:t.runtime,n=Object.assign(e.defaults||{},r);if(r!=null&&r.autoPrefix){let f=n.postprocess;f||(f=[]),Array.isArray(f)||(f=[f]),f.unshift(bt(document.createElement("div").style)),n.postprocess=f}(C=r==null?void 0:r.configResolved)==null||C.call(r,t,n);let s,i=!0,a,p=yt(t,n),c=new Set,o,d=[],u=()=>new Promise(f=>{d.push(f),o!=null&&clearTimeout(o),o=setTimeout(()=>y().then(()=>{let x=d;d=[],x.forEach(U=>U())}),0)});function g(f=document.body){if(f.nodeType!==1)return;let x=f;x.hasAttribute("un-cloak")&&x.removeAttribute("un-cloak"),x.querySelectorAll("[un-cloak]").forEach(U=>{U.removeAttribute("un-cloak")})}async function y(){let f=await p.generate(c);s||(s=document.createElement("style"),document.documentElement.prepend(s)),s.innerHTML=f.css,c=f.matched}async function l(f){let x=c.size;await p.applyExtractors(f,void 0,c),x!==c.size&&await u()}async function h(){let f=document.body&&document.body.outerHTML;f&&(await l(`${f} ${Rt(f)}`),g())}let A=new MutationObserver(f=>{i||f.forEach(async x=>{if(x.target.nodeType!==1)return;let U=x.target;if(U!==s)if(x.type==="childList")x.addedNodes.forEach(async P=>{if(P.nodeType!==1)return;let O=P;a&&!a(O)||(await l(O.outerHTML),g(O))});else{if(a&&!a(U))return;if(x.attributeName!=="un-cloak"){let P=Array.from(U.attributes).map(E=>E.value?`${E.name}="${E.value}"`:E.name).join(" "),O=`<${U.tagName.toLowerCase()} ${P}>`;await l(O)}U.hasAttribute("un-cloak")&&U.removeAttribute("un-cloak")}})}),S=!1;function R(){if(S)return;let f=document.documentElement||document.body;!f||(A.observe(f,{childList:!0,subtree:!0,attributes:!0}),S=!0)}function $(){h(),R()}function m(){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",$):$()}let b=window.__unocss_runtime=window.__unocss_runtime={version:p.version,uno:p,async extract(f){typeof f!="string"&&(f.forEach(x=>c.add(x)),f=""),await l(f)},extractAll:h,inspect(f){a=f},toggleObserver(f){f===void 0?i=!i:i=!!f,!S&&!i&&m()}};((w=r==null?void 0:r.ready)==null?void 0:w.call(r,b))!==!1&&(i=!1,m())}X();})();
1
+ "use strict";(()=>{function vt(e){let t=e.length,r=-1,n,s="",i=e.charCodeAt(0);for(;++r<t;){if(n=e.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&&t===1&&n===45){s+=`\\${e.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=e.charAt(r);continue}s+=`\\${e.charAt(r)}`}return s}var F=vt;function L(e=[]){return Array.isArray(e)?e:[e]}function k(e){return Array.from(new Set(e))}function A(e){return typeof e=="string"}function K(e){return A(e)?e:(Array.isArray(e)?e:Object.entries(e)).filter(t=>t[1]!=null)}function et(e){return Array.isArray(e)?e.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?e.map(t=>K(t)):[e]:[K(e)]}function At(e){return e.filter(([t,r],n)=>{if(t.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(e[s][0]===t&&e[s][1]===r)return!1;return!0})}function G(e){return e==null?"":At(e).map(([t,r])=>r!=null?`${t}:${r};`:void 0).filter(Boolean).join("")}function B(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Y(e,t){let r=e,n=t;if(Array.isArray(r))return[...n];let s={...r};return B(r)&&B(n)&&Object.keys(n).forEach(i=>{B(r[i])&&B(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=Y(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function H(e){let t,r,n;if(Array.isArray(e)){for(r=Array(t=e.length);t--;)r[t]=(n=e[t])&&typeof n=="object"?H(n):n;return r}if(Object.prototype.toString.call(e)==="[object Object]"){r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:H(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=(n=e[t])&&typeof n=="object"?H(n):n;return r}return e}function rt(e){return A(e[0])}function nt(e){return A(e[0])}var wt=/[\w\u00A0-\uFFFF-_:%-?]/,q="$$shortcut-no-merge";function st(e=""){return wt.test(e)}function it(e){return typeof e=="function"?{match:e}:e}function W(e){return e.length===3}function ot(e){return e!=null}function at(){}var z=class{_map=new Map;get(t,r){let n=this._map.get(t);if(n)return n.get(r)}getFallback(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.has(r)||s.set(r,n),s.get(r)}set(t,r,n){let s=this._map.get(t);return s||(s=new Map,this._map.set(t,s)),s.set(r,n),this}has(t,r){var n;return(n=this._map.get(t))==null?void 0:n.has(r)}delete(t,r){var n;return((n=this._map.get(t))==null?void 0:n.delete(r))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>t(i,r,s)))}};var ct=/((?:[!\w+:_/-]|\[&?>?:?.*\])+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function lt(e,t=["-",":"],r=5){ct.lastIndex=0;let n=!1,s=e.toString();do{let i=s;s=s.replace(ct,(o,u,c,a)=>t.includes(c)?a.split(/\s/g).filter(Boolean).map(f=>f==="~"?u:f.replace(/^(!?)(.*)/,`$1${u}${c}$2`)).join(" "):o),n=s!==i,r-=1}while(n&&r);return typeof e=="string"?s:e.length()?e.overwrite(0,e.length(),s):e}var ut=new Set;function ft(e){ut.has(e)||(console.warn("[unocss]",e),ut.add(e))}var Ut=e=>[...new Set(e.split(/\\?[\s'"`;={}]+/g))].filter(st),Z={name:"split",order:0,extract({code:e}){return Ut(e)}};function pt(){return{events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}}}var I="default",N="preflights",Vt="shortcuts",dt={[N]:-100,[Vt]:-10,[I]:0};function ht(e){return L(e).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}function $t(e){var r;let t=e.shortcuts?ht(e.shortcuts):void 0;if(e.shortcuts=t,e.prefix||e.layer){let n=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=e.prefix),i.layer==null&&e.layer&&(i.prefix=e.layer)};t==null||t.forEach(n),(r=e.rules)==null||r.forEach(n)}return e}function J(e={},t={}){let r=Object.assign({},t,e),n=(r.presets||[]).flatMap(L).map($t),s=[...n.filter(p=>p.enforce==="pre"),...n.filter(p=>!p.enforce),...n.filter(p=>p.enforce==="post")],i=Object.assign(dt,...n.map(p=>p.layers),e.layers);function o(p){return k([...s.flatMap(h=>L(h[p]||[])),...L(r[p]||[])])}let u=o("extractors");u.length||u.push(Z),u.sort((p,h)=>(p.order||0)-(h.order||0));let c=o("rules"),a={},f=c.length,l=c.map((p,h)=>{var U;if(rt(p)){let x=((U=p[2])==null?void 0:U.prefix)||"";a[x+p[0]]=[h,p[1],p[2],p];return}return[h,...p]}).filter(Boolean).reverse(),g=H([...s.map(p=>p.theme||{}),r.theme||{}].reduce((p,h)=>Y(p,h),{}));o("extendTheme").forEach(p=>p(g));let m={templates:k(s.map(p=>{var h;return L((h=p.autocomplete)==null?void 0:h.templates)}).flat()),extractors:s.map(p=>{var h;return L((h=p.autocomplete)==null?void 0:h.extractors)}).flat().sort((p,h)=>(p.order||0)-(h.order||0))};return{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:p=>p,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:g,rulesSize:f,rulesDynamic:l,rulesStaticMap:a,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:m,variants:o("variants").map(it),shortcuts:ht(o("shortcuts")),extractors:u,safelist:o("safelist")}}var gt="0.45.28";var Q=class{constructor(t={},r={}){this.userConfig=t;this.defaults=r;this.config=J(t,r),this.events.emit("config",this.config)}version=gt;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=pt();setConfig(t,r){!t||(r&&(this.defaults=r),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=J(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,r,n=new Set){let s={get original(){return t},code:t,id:r};for(let i of this.config.extractors){let o=await i.extract(s);if(o)for(let u of o)n.add(u)}return n}makeContext(t,r){let n={rawSelector:t,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(t,r){var a;if(this.blocked.has(t))return;let n=`${t}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=t;for(let f of this.config.preprocess)s=f(t);if(this.isBlocked(s)){this.blocked.add(t),this._cache.set(n,null);return}let i=this.matchVariants(t,s);if(!i||this.isBlocked(i[1])){this.blocked.add(t),this._cache.set(n,null);return}let o=this.makeContext(t,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let u=this.expandShortcut(o.currentSelector,o),c=u?await this.stringifyShortcuts(o.variantMatch,o,u[0],u[1]):(a=await this.parseUtil(o.variantMatch,o))==null?void 0:a.map(f=>this.stringifyUtil(f,o)).filter(ot);if(c!=null&&c.length)return this._cache.set(n,c),c;this._cache.set(n,null)}async generate(t,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:u=!1}=r,c=A(t)?await this.applyExtractors(t,n):Array.isArray(t)?new Set(t):t;o&&this.config.safelist.forEach(y=>c.add(y));let a=u?"":`
2
+ `,f=new Set([I]),l=new Set,g=new Map,m={},p=Array.from(c).map(async y=>{var b;if(l.has(y))return;let C=await this.parseToken(y);if(C!=null){l.add(y);for(let w of C){let V=w[3]||"",d=(b=w[4])==null?void 0:b.layer;g.has(V)||g.set(V,[]),g.get(V).push(w),d&&f.add(d)}}}),h=(async()=>{if(!i)return;let y={generator:this,theme:this.config.theme},C=new Set([]);this.config.preflights.forEach(({layer:b=N})=>{f.add(b),C.add(b)}),m=Object.fromEntries(await Promise.all(Array.from(C).map(async b=>{let V=(await Promise.all(this.config.preflights.filter(d=>(d.layer||N)===b).map(async d=>await d.getCSS(y)))).filter(Boolean).join(a);return[b,V]})))})();await Promise.all([...p,h]);let U=this.config.sortLayers(Array.from(f).sort((y,C)=>(this.config.layers[y]??0)-(this.config.layers[C]??0)||y.localeCompare(C))),x={},E=y=>{if(x[y])return x[y];let C=Array.from(g).sort((w,V)=>{var d;return(this.parentOrders.get(w[0])??0)-(this.parentOrders.get(V[0])??0)||((d=w[0])==null?void 0:d.localeCompare(V[0]||""))||0}).map(([w,V])=>{let d=V.length,R=V.filter(S=>{var v;return(((v=S[4])==null?void 0:v.layer)||I)===y}).sort((S,v)=>{var T,j,D,_;return S[0]-v[0]||(((T=S[4])==null?void 0:T.sort)||0)-(((j=v[4])==null?void 0:j.sort)||0)||((D=S[1])==null?void 0:D.localeCompare(v[1]||""))||((_=S[2])==null?void 0:_.localeCompare(v[2]||""))||0}).map(([,S,v,,T,,j])=>[[[(S&&_t(S,s))??"",(T==null?void 0:T.sort)??0]],v,!!(j??(T==null?void 0:T.noMerge))]);if(!R.length)return;let $=R.reverse().map(([S,v,T],j)=>{if(!T&&this.config.mergeSelectors)for(let _=j+1;_<d;_++){let O=R[_];if(O&&!O[2]&&(S&&O[0]||S==null&&O[0]==null)&&O[1]===v)return S&&O[0]&&O[0].push(...S),null}let D=S?k(S.sort((_,O)=>{var tt;return _[1]-O[1]||((tt=_[0])==null?void 0:tt.localeCompare(O[0]||""))||0}).map(_=>_[0]).filter(Boolean)):[];return D.length?`${D.join(`,${a}`)}{${v}}`:v}).filter(Boolean).reverse().join(a);if(!w)return $;let P=w.split(" $$ ");return`${P.join("{")}{${a}${$}${a}}${P.map(S=>"").join("}")}`}).filter(Boolean).join(a);i&&(C=[m[y],C].filter(Boolean).join(a));let b=u?"":`/* layer: ${y} */${a}`;return x[y]=C?b+C:""},M=(y=U,C)=>y.filter(b=>!(C!=null&&C.includes(b))).map(b=>E(b)||"").filter(Boolean).join(a);return{get css(){return M()},layers:U,matched:l,getLayers:M,getLayer:E}}matchVariants(t,r){let n=new Set,s=[],i=r||t,o=!1,u={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let c of this.config.variants){if(!c.multiPass&&n.has(c))continue;let a=c.match(i,u);if(!!a){A(a)&&(a={matcher:a}),i=a.matcher,s.unshift(a),n.add(c),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,i,s,n]}applyVariants(t,r=t[4],n=t[1]){let i=[...r].sort((a,f)=>(a.order||0)-(f.order||0)).reverse().reduce((a,f)=>l=>{var p,h;let g=((p=f.body)==null?void 0:p.call(f,l.entries))||l.entries,m=Array.isArray(f.parent)?f.parent:[f.parent,void 0];return(f.handle??Lt)({...l,entries:g,selector:((h=f.selector)==null?void 0:h.call(f,l.selector,g))||l.selector,parent:m[0]||l.parent,parentOrder:m[1]||l.parentOrder,layer:f.layer||l.layer,sort:f.sort||l.sort},a)},a=>a)({prefix:"",selector:Pt(n),pseudo:"",entries:t[2]}),{parent:o,parentOrder:u}=i;o!=null&&u!=null&&this.parentOrders.set(o,u);let c={selector:Ot([i.prefix,i.selector,i.pseudo].join("")),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let a of this.config.postprocess)a(c);return c}constructCustomCSS(t,r,n){let s=K(r);if(A(s))return s;let{selector:i,entries:o,parent:u}=this.applyVariants([0,n||t.rawSelector,s,void 0,t.variantHandlers]),c=`${i}{${G(o)}}`;return u?`${u}{${c}}`:c}async parseUtil(t,r,n=!1){var a;let[s,i,o]=A(t)?this.matchVariants(t):t;this.config.details&&(r.rules=r.rules??[]);let u=this.config.rulesStaticMap[i];if(u&&u[1]&&(n||!((a=u[2])!=null&&a.internal))){this.config.details&&r.rules.push(u[3]);let f=u[0],l=K(u[1]),g=u[2];return A(l)?[[f,l,g]]:[[f,s,l,g,o]]}r.variantHandlers=o;let{rulesDynamic:c}=this.config;for(let[f,l,g,m]of c){if((m==null?void 0:m.internal)&&!n)continue;let p=i;if(m!=null&&m.prefix){if(!i.startsWith(m.prefix))continue;p=i.slice(m.prefix.length)}let h=p.match(l);if(!h)continue;let U=await g(h,r);if(!U)continue;this.config.details&&r.rules.push([l,g,m]);let x=et(U).filter(E=>E.length);if(x.length)return x.map(E=>A(E)?[f,E,m]:[f,s,E,m,o])}}stringifyUtil(t,r){if(!t)return;if(W(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:u,noMerge:c}=this.applyVariants(t),a=G(s);if(!a)return;let{layer:f,sort:l,...g}=t[3]??{},m={...g,layer:o??f,sort:u??l};return[t[0],n,a,i,m,this.config.details?r:void 0,c]}expandShortcut(t,r,n=5){var u;if(n===0)return;let s=this.config.details?c=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(c)}:at,i,o;for(let c of this.config.shortcuts){let a=(u=c[2])!=null&&u.prefix?t.slice(c[2].prefix.length):t;if(nt(c)){if(c[0]===a){i=i||c[2],o=c[1],s(c);break}}else{let f=a.match(c[0]);if(f&&(o=c[1](f,r)),o){i=i||c[2],s(c);break}}}if(A(o)&&(o=lt(o.trim()).split(/\s+/g)),!o){let[c,a]=A(t)?this.matchVariants(t):t;if(c!==a){let f=this.expandShortcut(a,r,n-1);f&&(o=f[0].map(l=>A(l)?c.replace(a,l):l))}}if(!!o)return[o.flatMap(c=>{var a;return(A(c)?(a=this.expandShortcut(c,r,n-1))==null?void 0:a[0]:void 0)||[c]}).filter(Boolean),i]}async stringifyShortcuts(t,r,n,s={layer:this.config.shortcutsLayer}){var f;let i=new z,o=(await Promise.all(k(n).map(async l=>{let g=A(l)?await this.parseUtil(l,r,!0):[[1/0,"{inline}",K(l),void 0,[]]];return g||ft(`unmatched utility "${l}" in shortcut "${t[1]}"`),g||[]}))).flat(1).filter(Boolean).sort((l,g)=>l[0]-g[0]),[u,,c]=t,a=[];for(let l of o){if(W(l)){a.push([l[0],void 0,l[1],void 0,l[2],r,void 0]);continue}let{selector:g,entries:m,parent:p,sort:h,noMerge:U}=this.applyVariants(l,[...l[4],...c],u);i.getFallback(g,p,[[],l[0]])[0].push([m,!!(U??((f=l[3])==null?void 0:f.noMerge)),h??0])}return a.concat(i.map(([l,g],m,p)=>{let h=(x,E,M)=>{let y=Math.max(...M.map(b=>b[1])),C=M.map(b=>b[0]);return(x?[C.flat(1)]:C).map(b=>{let w=G(b);if(w)return[g,m,w,p,{...s,noMerge:E,sort:y},r,void 0]})};return[[l.filter(([,x])=>x).map(([x,,E])=>[x,E]),!0],[l.filter(([,x])=>!x).map(([x,,E])=>[x,E]),!1]].map(([x,E])=>[...h(!1,E,x.filter(([M])=>M.some(y=>y[0]===q))),...h(!0,E,x.filter(([M])=>M.every(y=>y[0]!==q)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(r=>A(r)?r===t:r.test(t))}};function yt(e,t){return new Q(e,t)}var xt=/ \$\$ /,Tt=e=>e.match(xt);function _t(e,t){return Tt(e)?e.replace(xt,t?` ${t} `:" "):t?`${t} ${e}`:e}function Ot(e){let t=e.match(/::[\w-]+(\([\w-]+\))?/g);if(t){for(let r of t)e=e.replace(r,"");e+=t.join("")}return e}var mt=/^\[(.+?)(~?=)"(.*)"\]$/;function Pt(e){return mt.test(e)?e.replace(mt,(t,r,n,s)=>`[${F(r)}${n}"${F(s)}"]`):`.${F(e)}`}function Lt(e,t){return t(e)}var jt=e=>e.replace(/-(\w)/g,(t,r)=>r?r.toUpperCase():""),St=e=>e.charAt(0).toUpperCase()+e.slice(1),Ct=e=>e.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),bt=["Webkit","Moz","ms"];function Et(e){let t={};function r(n){let s=t[n];if(s)return s;let i=jt(n);if(i!=="filter"&&i in e)return t[n]=Ct(i);i=St(i);for(let o=0;o<bt.length;o++){let u=`${bt[o]}${i}`;if(u in e)return t[n]=Ct(St(u))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function Rt(e){return e.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function X(e={}){var w,V;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},r=t==null?void 0:t.runtime,n=Object.assign(e.defaults||{},r),s=n.cloakAttribute??"un-cloak";if(r!=null&&r.autoPrefix){let d=n.postprocess;d||(d=[]),Array.isArray(d)||(d=[d]),d.unshift(Et(document.createElement("div").style)),n.postprocess=d}(w=r==null?void 0:r.configResolved)==null||w.call(r,t,n);let i,o=!0,u,c=yt(t,n),a=new Set,f,l=[],g=()=>new Promise(d=>{l.push(d),f!=null&&clearTimeout(f),f=setTimeout(()=>p().then(()=>{let R=l;l=[],R.forEach($=>$())}),0)});function m(d=document.body){if(d.nodeType!==1)return;let R=d;R.hasAttribute(s)&&R.removeAttribute(s),R.querySelectorAll(`[${s}]`).forEach($=>{$.removeAttribute(s)})}async function p(){let d=await c.generate(a);i||(i=document.createElement("style"),document.documentElement.prepend(i)),i.innerHTML=d.css,a=d.matched}async function h(d){let R=a.size;await c.applyExtractors(d,void 0,a),R!==a.size&&await g()}async function U(){let d=document.body&&document.body.outerHTML;d&&(await h(`${d} ${Rt(d)}`),m())}let x=new MutationObserver(d=>{o||d.forEach(async R=>{if(R.target.nodeType!==1)return;let $=R.target;if($!==i)if(R.type==="childList")R.addedNodes.forEach(async P=>{if(P.nodeType!==1)return;let S=P;u&&!u(S)||(await h(S.outerHTML),m(S))});else{if(u&&!u($))return;if(R.attributeName!==s){let P=Array.from($.attributes).map(v=>v.value?`${v.name}="${v.value}"`:v.name).join(" "),S=`<${$.tagName.toLowerCase()} ${P}>`;await h(S)}$.hasAttribute(s)&&$.removeAttribute(s)}})}),E=!1;function M(){if(E)return;let d=document.documentElement||document.body;!d||(x.observe(d,{childList:!0,subtree:!0,attributes:!0}),E=!0)}function y(){U(),M()}function C(){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",y):y()}let b=window.__unocss_runtime=window.__unocss_runtime={version:c.version,uno:c,async extract(d){typeof d!="string"&&(d.forEach(R=>a.add(R)),d=""),await h(d)},extractAll:U,inspect(d){u=d},toggleObserver(d){d===void 0?o=!o:o=!!d,!E&&!o&&C()}};((V=r==null?void 0:r.ready)==null?void 0:V.call(r,b))!==!1&&(o=!1,C())}X();})();
package/dist/index.d.ts CHANGED
@@ -10,6 +10,11 @@ interface RuntimeOptions {
10
10
  * @default false
11
11
  */
12
12
  autoPrefix?: boolean;
13
+ /**
14
+ * Attribute to use as cloaking
15
+ * @default 'un-cloak'
16
+ */
17
+ cloakAttribute?: string;
13
18
  /**
14
19
  * Callback to modify config
15
20
  */
package/dist/index.js CHANGED
@@ -66,6 +66,7 @@ function init(inlineConfig = {}) {
66
66
  const config = window.__unocss || {};
67
67
  const runtime = config == null ? void 0 : config.runtime;
68
68
  const defaultConfig = Object.assign(inlineConfig.defaults || {}, runtime);
69
+ const cloakAttribute = defaultConfig.cloakAttribute ?? "un-cloak";
69
70
  if (runtime == null ? void 0 : runtime.autoPrefix) {
70
71
  let postprocess = defaultConfig.postprocess;
71
72
  if (!postprocess)
@@ -97,10 +98,10 @@ function init(inlineConfig = {}) {
97
98
  if (node.nodeType !== 1)
98
99
  return;
99
100
  const el = node;
100
- if (el.hasAttribute("un-cloak"))
101
- el.removeAttribute("un-cloak");
102
- el.querySelectorAll("[un-cloak]").forEach((n) => {
103
- n.removeAttribute("un-cloak");
101
+ if (el.hasAttribute(cloakAttribute))
102
+ el.removeAttribute(cloakAttribute);
103
+ el.querySelectorAll(`[${cloakAttribute}]`).forEach((n) => {
104
+ n.removeAttribute(cloakAttribute);
104
105
  });
105
106
  }
106
107
  async function updateStyle() {
@@ -147,13 +148,13 @@ function init(inlineConfig = {}) {
147
148
  } else {
148
149
  if (inspector && !inspector(target))
149
150
  return;
150
- if (mutation.attributeName !== "un-cloak") {
151
+ if (mutation.attributeName !== cloakAttribute) {
151
152
  const attrs = Array.from(target.attributes).map((i) => i.value ? `${i.name}="${i.value}"` : i.name).join(" ");
152
153
  const tag = `<${target.tagName.toLowerCase()} ${attrs}>`;
153
154
  await extract(tag);
154
155
  }
155
- if (target.hasAttribute("un-cloak"))
156
- target.removeAttribute("un-cloak");
156
+ if (target.hasAttribute(cloakAttribute))
157
+ target.removeAttribute(cloakAttribute);
157
158
  }
158
159
  });
159
160
  });
package/dist/index.mjs CHANGED
@@ -42,6 +42,7 @@ function init(inlineConfig = {}) {
42
42
  const config = window.__unocss || {};
43
43
  const runtime = config == null ? void 0 : config.runtime;
44
44
  const defaultConfig = Object.assign(inlineConfig.defaults || {}, runtime);
45
+ const cloakAttribute = defaultConfig.cloakAttribute ?? "un-cloak";
45
46
  if (runtime == null ? void 0 : runtime.autoPrefix) {
46
47
  let postprocess = defaultConfig.postprocess;
47
48
  if (!postprocess)
@@ -73,10 +74,10 @@ function init(inlineConfig = {}) {
73
74
  if (node.nodeType !== 1)
74
75
  return;
75
76
  const el = node;
76
- if (el.hasAttribute("un-cloak"))
77
- el.removeAttribute("un-cloak");
78
- el.querySelectorAll("[un-cloak]").forEach((n) => {
79
- n.removeAttribute("un-cloak");
77
+ if (el.hasAttribute(cloakAttribute))
78
+ el.removeAttribute(cloakAttribute);
79
+ el.querySelectorAll(`[${cloakAttribute}]`).forEach((n) => {
80
+ n.removeAttribute(cloakAttribute);
80
81
  });
81
82
  }
82
83
  async function updateStyle() {
@@ -123,13 +124,13 @@ function init(inlineConfig = {}) {
123
124
  } else {
124
125
  if (inspector && !inspector(target))
125
126
  return;
126
- if (mutation.attributeName !== "un-cloak") {
127
+ if (mutation.attributeName !== cloakAttribute) {
127
128
  const attrs = Array.from(target.attributes).map((i) => i.value ? `${i.name}="${i.value}"` : i.name).join(" ");
128
129
  const tag = `<${target.tagName.toLowerCase()} ${attrs}>`;
129
130
  await extract(tag);
130
131
  }
131
- if (target.hasAttribute("un-cloak"))
132
- target.removeAttribute("un-cloak");
132
+ if (target.hasAttribute(cloakAttribute))
133
+ target.removeAttribute(cloakAttribute);
133
134
  }
134
135
  });
135
136
  });