@unocss/runtime 0.57.0 → 0.57.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/runtime",
3
- "version": "0.57.0",
3
+ "version": "0.57.2",
4
4
  "description": "CSS-in-JS Runtime for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -35,9 +35,9 @@
35
35
  "dist"
36
36
  ],
37
37
  "dependencies": {
38
- "@unocss/core": "0.57.0",
39
- "@unocss/preset-attributify": "0.57.0",
40
- "@unocss/preset-uno": "0.57.0"
38
+ "@unocss/core": "0.57.2",
39
+ "@unocss/preset-attributify": "0.57.2",
40
+ "@unocss/preset-uno": "0.57.2"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "pnpm run build:node && pnpm run build:cdn && pnpm run build:presets",
@@ -2,4 +2,4 @@
2
2
  `).join(`
3
3
  `+s),e.push(r+"m+"+B.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Ot()+o+" "+e[0]}function Ot(){return F.inspectOpts.hideDate?"":new Date().toISOString()+" "}function St(...e){return process.stderr.write(q.format(...e)+`
4
4
  `)}function Et(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function jt(){return process.env.DEBUG}function kt(e){e.inspectOpts={};let o=Object.keys(F.inspectOpts);for(let t=0;t<o.length;t++)e.inspectOpts[o[t]]=F.inspectOpts[o[t]]}B.exports=oe()(F);var{formatters:Pe}=B.exports;Pe.o=function(e){return this.inspectOpts.colors=this.useColors,q.inspect(e,this.inspectOpts).split(`
5
- `).map(o=>o.trim()).join(" ")};Pe.O=function(e){return this.inspectOpts.colors=this.useColors,q.inspect(e,this.inspectOpts)}});var z=E((lo,ne)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ne.exports=Te():ne.exports=ze()});async function ie(e,o,t,n){let r;Tt(`${o}:${t}`);try{if(typeof e=="function")r=await e(t);else{let s=e[t];r=typeof s=="function"?await s():s}}catch(s){console.warn(`Failed to load custom icon "${t}" in "${o}":`,s);return}if(r){let s=r.indexOf("<svg");s>0&&(r=r.slice(s));let{transform:u}=n?.customizations??{};return r=typeof u=="function"?await u(r,o,t):r,r.startsWith("<svg")?await V(n?.customizations?.trimCustomSvg===!0?Oe(r):r,o,t,n,void 0):(console.warn(`Custom icon "${t}" in "${o}" is not a valid SVG`),r)}}var _e,Tt,Me=I(()=>{"use strict";_e=M(z(),1);te();Se();Tt=(0,_e.default)("@iconify-loader:custom")});async function W(e,o,t,n){let r,{customize:s}=n?.customizations??{};for(let u of t)if(r=Ce(e,u),r){Rt(`${o}:${u}`);let f={...N};typeof s=="function"&&(f=s(f));let{attributes:{width:m,height:C,...i},body:a}=Fe(r,f),p=n?.scale;return await V(`<svg >${a}</svg>`,o,u,n,()=>({...i}),h=>{let w=(l,c)=>{let x=h[l],y;if(!P(x)){if(x)return;typeof p=="number"?p&&(y=`${p}em`):y=c}y?h[l]=y:delete h[l]};w("width",m),w("height",C)})}}var De,Rt,se=I(()=>{"use strict";Q();we();te();De=M(z(),1);Y();Rt=(0,De.default)("@iconify-loader:icon")});var bo,_,ce=I(()=>{"use strict";Me();se();bo=M(z(),1),_=async(e,o,t)=>{let n=t?.customCollections?.[e];if(n)if(typeof n=="function"){let r;try{r=await n(o)}catch(s){console.warn(`Failed to load custom icon "${o}" in "${e}":`,s);return}if(r){if(typeof r=="string")return await ie(()=>r,e,o,t);if("icons"in r){let s=[o,o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o.replace(/([a-z])(\d+)/g,"$1-$2")];return await W(r,e,s,t)}}}else return await ie(n,e,o,t)}});function Ie(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ve(e){let o=e.startsWith("<svg>")?e.replace("<svg>","<svg >"):e;return!o.includes(" xmlns:xlink=")&&o.includes(" xlink:")&&(o=o.replace("<svg ",'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')),o.includes(" xmlns=")||(o=o.replace("<svg ",'<svg xmlns="http://www.w3.org/2000/svg" ')),Ie(o)}ce();var Io=M(z(),1);var Ne=new Set;function Ve(e){Ne.has(e)||(console.warn("[unocss]",e),Ne.add(e))}ce();se();var Ge=["academicons","akar-icons","ant-design","arcticons","basil","bi","bpmn","brandico","bx","bxl","bxs","bytesize","carbon","charm","ci","cib","cif","cil","circle-flags","circum","clarity","codicon","covid","cryptocurrency-color","cryptocurrency","dashicons","devicon-line","devicon-original","devicon-plain","devicon","ei","el","emblemicons","emojione-monotone","emojione-v1","emojione","entypo-social","entypo","eos-icons","ep","et","eva","fa-brands","fa-regular","fa-solid","fa","fa6-brands","fa6-regular","fa6-solid","fad","fe","feather","file-icons","flag","flagpack","flat-color-icons","flat-ui","fluent-emoji-flat","fluent-emoji-high-contrast","fluent-emoji","fluent-mdl2","fluent","fontelico","fontisto","formkit","foundation","fxemoji","gala","game-icons","geo","gg","gis","gridicons","grommet-icons","guidance","healthicons","heroicons-outline","heroicons-solid","heroicons","humbleicons","ic","icomoon-free","icon-park-outline","icon-park-solid","icon-park-twotone","icon-park","iconamoon","iconoir","icons8","il","ion","iwwa","jam","la","line-md","logos","ls","lucide","majesticons","maki","map","material-symbols","mdi-light","mdi","medical-icon","memory","meteocons","mi","mingcute","mono-icons","nimbus","nonicons","noto-v1","noto","octicon","oi","ooui","openmoji","pajamas","pepicons-pencil","pepicons-pop","pepicons-print","pepicons","ph","pixelarticons","prime","ps","quill","radix-icons","raphael","ri","si-glyph","simple-icons","simple-line-icons","skill-icons","solar","streamline-emojis","streamline","subway","svg-spinners","system-uicons","tabler","tdesign","teenyicons","topcoat","twemoji","typcn","uil","uim","uis","uit","uiw","vaadin","vs","vscode-icons","websymbol","whh","wi","wpf","zmdi","zondicons"];var Lt=3;function Ue(e){return(o={})=>{let{scale:t=1,mode:n="auto",prefix:r="i-",warn:s=!1,collections:u,extraProperties:f={},customizations:m={},autoInstall:C=!1,layer:i="icons",unit:a}=o,p={addXmlNs:!0,scale:t,customCollections:u,autoInstall:C,warn:void 0,customizations:{...m,additionalProps:{...f},trimCustomSvg:!0,async iconCustomizer(w,l,c){await m.iconCustomizer?.(w,l,c),a&&(c.width||(c.width=`${t}${a}`),c.height||(c.height=`${t}${a}`))}}},h;return{name:"@unocss/preset-icons",enforce:"pre",options:o,layers:{icons:-30},rules:[[/^([a-z0-9:_-]+)(?:\?(mask|bg|auto))?$/,async([w,l,c=n])=>{let x="",y="",b;h=h||await e(o);let d={};if(l.includes(":"))[x,y]=l.split(":"),b=await h(x,y,{...p,usedProps:d});else{let k=l.split(/-/g);for(let T=Lt;T>=1&&(x=k.slice(0,T).join("-"),y=k.slice(T).join("-"),b=await h(x,y,{...p,usedProps:d}),!b);T--);}if(!b){s&&Ve(`failed to load icon "${w}"`);return}let K=`url("data:image/svg+xml;utf8,${ve(b)}")`;return c==="auto"&&(c=b.includes("currentColor")?"mask":"bg"),c==="mask"?{"--un-icon":K,"-webkit-mask":"var(--un-icon) no-repeat",mask:"var(--un-icon) no-repeat","-webkit-mask-size":"100% 100%","mask-size":"100% 100%","background-color":"currentColor",color:"inherit",...d}:{background:`${K} no-repeat`,"background-size":"100% 100%","background-color":"transparent",...d}},{layer:i,prefix:r}]]}}}function qe(e,o){let t=new Map;function n(r){if(Ge.includes(r))return t.has(r)||t.set(r,e(`${o}@iconify-json/${r}/icons.json`)),t.get(r)}return async(r,s,u)=>{let f=await _(r,s,u);if(f)return f;let m=await n(r);if(m){let C=[s,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),s.replace(/([a-z])(\d+)/g,"$1-$2")];f=await W(m,r,C,u)}return f}}window.__unocss_runtime=window.__unocss_runtime??{};window.__unocss_runtime.presets=Object.assign(window.__unocss_runtime?.presets??{},(()=>{let e=Ue(async o=>{let t=o?.customFetch??(r=>fetch(r).then(s=>s.json())),n=o?.cdn;return n?qe(t,n):_});return{presetIcons:o=>e(o)}})());})();
5
+ `).map(o=>o.trim()).join(" ")};Pe.O=function(e){return this.inspectOpts.colors=this.useColors,q.inspect(e,this.inspectOpts)}});var z=E((lo,ne)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ne.exports=Te():ne.exports=ze()});async function ie(e,o,t,n){let r;Tt(`${o}:${t}`);try{if(typeof e=="function")r=await e(t);else{let s=e[t];r=typeof s=="function"?await s():s}}catch(s){console.warn(`Failed to load custom icon "${t}" in "${o}":`,s);return}if(r){let s=r.indexOf("<svg");s>0&&(r=r.slice(s));let{transform:u}=n?.customizations??{};return r=typeof u=="function"?await u(r,o,t):r,r.startsWith("<svg")?await V(n?.customizations?.trimCustomSvg===!0?Oe(r):r,o,t,n,void 0):(console.warn(`Custom icon "${t}" in "${o}" is not a valid SVG`),r)}}var _e,Tt,Me=I(()=>{"use strict";_e=M(z(),1);te();Se();Tt=(0,_e.default)("@iconify-loader:custom")});async function W(e,o,t,n){let r,{customize:s}=n?.customizations??{};for(let u of t)if(r=Ce(e,u),r){Rt(`${o}:${u}`);let f={...N};typeof s=="function"&&(f=s(f));let{attributes:{width:m,height:C,...i},body:a}=Fe(r,f),p=n?.scale;return await V(`<svg >${a}</svg>`,o,u,n,()=>({...i}),h=>{let w=(l,c)=>{let x=h[l],y;if(!P(x)){if(x)return;typeof p=="number"?p&&(y=`${p}em`):y=c}y?h[l]=y:delete h[l]};w("width",m),w("height",C)})}}var De,Rt,se=I(()=>{"use strict";Q();we();te();De=M(z(),1);Y();Rt=(0,De.default)("@iconify-loader:icon")});var bo,_,ce=I(()=>{"use strict";Me();se();bo=M(z(),1),_=async(e,o,t)=>{let n=t?.customCollections?.[e];if(n)if(typeof n=="function"){let r;try{r=await n(o)}catch(s){console.warn(`Failed to load custom icon "${o}" in "${e}":`,s);return}if(r){if(typeof r=="string")return await ie(()=>r,e,o,t);if("icons"in r){let s=[o,o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o.replace(/([a-z])(\d+)/g,"$1-$2")];return await W(r,e,s,t)}}}else return await ie(n,e,o,t)}});function Ie(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ve(e){let o=e.startsWith("<svg>")?e.replace("<svg>","<svg >"):e;return!o.includes(" xmlns:xlink=")&&o.includes(" xlink:")&&(o=o.replace("<svg ",'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')),o.includes(" xmlns=")||(o=o.replace("<svg ",'<svg xmlns="http://www.w3.org/2000/svg" ')),Ie(o)}ce();var Io=M(z(),1);var Ne=new Set;function Ve(e){Ne.has(e)||(console.warn("[unocss]",e),Ne.add(e))}ce();se();var Ge=["academicons","akar-icons","ant-design","arcticons","basil","bi","bpmn","brandico","bx","bxl","bxs","bytesize","carbon","charm","ci","cib","cif","cil","circle-flags","circum","clarity","codicon","covid","cryptocurrency-color","cryptocurrency","dashicons","devicon-line","devicon-original","devicon-plain","devicon","ei","el","emblemicons","emojione-monotone","emojione-v1","emojione","entypo-social","entypo","eos-icons","ep","et","eva","fa-brands","fa-regular","fa-solid","fa","fa6-brands","fa6-regular","fa6-solid","fad","fe","feather","file-icons","flag","flagpack","flat-color-icons","flat-ui","fluent-emoji-flat","fluent-emoji-high-contrast","fluent-emoji","fluent-mdl2","fluent","fontelico","fontisto","formkit","foundation","fxemoji","gala","game-icons","geo","gg","gis","gridicons","grommet-icons","guidance","healthicons","heroicons-outline","heroicons-solid","heroicons","humbleicons","ic","icomoon-free","icon-park-outline","icon-park-solid","icon-park-twotone","icon-park","iconamoon","iconoir","icons8","il","ion","iwwa","jam","la","line-md","logos","ls","lucide","majesticons","maki","map","material-symbols-light","material-symbols","mdi-light","mdi","medical-icon","memory","meteocons","mi","mingcute","mono-icons","mynaui","nimbus","nonicons","noto-v1","noto","octicon","oi","ooui","openmoji","pajamas","pepicons-pencil","pepicons-pop","pepicons-print","pepicons","ph","pixelarticons","prime","ps","quill","radix-icons","raphael","ri","si-glyph","simple-icons","simple-line-icons","skill-icons","solar","streamline-emojis","streamline","subway","svg-spinners","system-uicons","tabler","tdesign","teenyicons","topcoat","twemoji","typcn","uil","uim","uis","uit","uiw","vaadin","vs","vscode-icons","websymbol","whh","wi","wpf","zmdi","zondicons"];var Lt=3;function Ue(e){return(o={})=>{let{scale:t=1,mode:n="auto",prefix:r="i-",warn:s=!1,collections:u,extraProperties:f={},customizations:m={},autoInstall:C=!1,layer:i="icons",unit:a}=o,p={addXmlNs:!0,scale:t,customCollections:u,autoInstall:C,warn:void 0,customizations:{...m,additionalProps:{...f},trimCustomSvg:!0,async iconCustomizer(w,l,c){await m.iconCustomizer?.(w,l,c),a&&(c.width||(c.width=`${t}${a}`),c.height||(c.height=`${t}${a}`))}}},h;return{name:"@unocss/preset-icons",enforce:"pre",options:o,layers:{icons:-30},rules:[[/^([a-z0-9:_-]+)(?:\?(mask|bg|auto))?$/,async([w,l,c=n])=>{let x="",y="",b;h=h||await e(o);let d={};if(l.includes(":"))[x,y]=l.split(":"),b=await h(x,y,{...p,usedProps:d});else{let k=l.split(/-/g);for(let T=Lt;T>=1&&(x=k.slice(0,T).join("-"),y=k.slice(T).join("-"),b=await h(x,y,{...p,usedProps:d}),!b);T--);}if(!b){s&&Ve(`failed to load icon "${w}"`);return}let K=`url("data:image/svg+xml;utf8,${ve(b)}")`;return c==="auto"&&(c=b.includes("currentColor")?"mask":"bg"),c==="mask"?{"--un-icon":K,"-webkit-mask":"var(--un-icon) no-repeat",mask:"var(--un-icon) no-repeat","-webkit-mask-size":"100% 100%","mask-size":"100% 100%","background-color":"currentColor",color:"inherit",...d}:{background:`${K} no-repeat`,"background-size":"100% 100%","background-color":"transparent",...d}},{layer:i,prefix:r}]]}}}function qe(e,o){let t=new Map;function n(r){if(Ge.includes(r))return t.has(r)||t.set(r,e(`${o}@iconify-json/${r}/icons.json`)),t.get(r)}return async(r,s,u)=>{let f=await _(r,s,u);if(f)return f;let m=await n(r);if(m){let C=[s,s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),s.replace(/([a-z])(\d+)/g,"$1-$2")];f=await W(m,r,C,u)}return f}}window.__unocss_runtime=window.__unocss_runtime??{};window.__unocss_runtime.presets=Object.assign(window.__unocss_runtime?.presets??{},(()=>{let e=Ue(async o=>{let t=o?.customFetch??(r=>fetch(r).then(s=>s.json())),n=o?.cdn;return n?qe(t,n):_});return{presetIcons:o=>e(o)}})());})();