@unocss/runtime 66.6.6 → 66.6.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 +8 -8
- package/core.global.js +2 -2
- package/full.global.js +8 -8
- package/mini.global.js +7 -7
- package/package.json +4 -4
- package/preset-attributify.global.js +1 -1
- package/preset-mini.global.js +6 -6
- package/preset-rem-to-px.global.js +1 -1
- package/preset-tagify.global.js +1 -1
- package/preset-typography.global.js +1 -1
- package/preset-uno.global.js +7 -7
- package/preset-web-fonts.global.js +1 -1
- package/preset-wind.global.js +7 -7
- package/preset-wind3.global.js +7 -7
- package/preset-wind4.global.js +11 -11
- package/uno.global.js +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var I="default",U="preflights",B="shortcuts",M="imports",J={[M]:-200,[U]:-100,[B]:-10,[I]:0};function C(t=[]){return Array.isArray(t)?t:[t]}function A(t){return t&&typeof t=="object"&&!Array.isArray(t)}function
|
|
1
|
+
"use strict";(()=>{var I="default",U="preflights",B="shortcuts",M="imports",J={[M]:-200,[U]:-100,[B]:-10,[I]:0};function C(t=[]){return Array.isArray(t)?t:[t]}function A(t){return t&&typeof t=="object"&&!Array.isArray(t)}function _(t,s,l=!1){let c=t,e=s;if(Array.isArray(e))return l&&Array.isArray(e)?[...c,...e]:[...e];let n={...c};return A(c)&&A(e)&&Object.keys(e).forEach(o=>{A(c[o])&&A(e[o])||Array.isArray(c[o])&&Array.isArray(e[o])?n[o]=_(c[o],e[o],l):Object.assign(n,{[o]:e[o]})}),n}function G(t,s){return{name:t,getImportUrl(l){let c=l.map(e=>{let{name:n,weights:o,italic:i}=e,v=n.toLowerCase().replace(/\s/g,"-");if(!o?.length)return`${v}${i?":i":""}`;let f=o.map(d=>d.toString());return!f.some(d=>d.endsWith("i"))&&i&&(f=f.map(d=>d+="i")),`${v}:${f.join(",")}`});return`${s}/css?family=${c.join("|")}&display=swap`}}}var R=G("bunny","https://fonts.bunny.net");function D(t){if(!t||t.length===0)return"";let s=[[]];for(let{values:l}of t){let c=[];for(let e of s)for(let n of l)c.push([...e,n]);s=c}return s.map(l=>l.join(",")).join(";")}function j(t,s){return{name:t,getImportUrl(l){let c=l.map(e=>{let n=e.name.replace(/\s+/g,"+"),o=[];return e.italic&&o.push({axis:"ital",values:["0","1"]}),e.widths?.length&&o.push({axis:"wdth",values:e.widths.map(i=>i.toString())}),e.weights?.length&&o.push({axis:"wght",values:e.weights.map(i=>i.toString())}),o.length&&(n+=":",n+=o.map(i=>i.axis).join(","),n+="@",n+=D(o)),`family=${n}`}).join("&");return`${s}/css2?${c}&display=swap`}}}var E=j("google","https://fonts.googleapis.com");var W=j("coollabs","https://api.fonts.coollabs.io");var L=H("fontshare","https://api.fontshare.com");function H(t,s){return{name:t,getImportUrl(l){let c=l.map(e=>{let n=e.name.replace(/\s+/g,"-").toLocaleLowerCase();return e.weights?.length?n+=`@${e.weights.flatMap(o=>e.italic?Number(o)+1:o).sort().join()}`:n+=`@${e.italic?2:1}`,`f[]=${n}`}).join("&");return`${s}/v2/css?${c}&display=swap`}}}function z(t,s){let l=new Map,c=new Map;return{name:t,async getPreflight(e,n){return(await Promise.all(e.map(async i=>{let v=[],f=i.name.toLowerCase().replace(/\s+/g,"-"),u=l.get(f);if(!u){let $=`https://api.fontsource.org/v1/fonts/${f}`;try{u=await n($),l.set(f,u)}catch{throw new Error(`Failed to fetch font: ${i.name}`)}}let{weights:d,unicodeRange:b,variants:g,family:x}=u,P=u.subsets.filter($=>i.subsets?i.subsets.includes($):!0),S=i.italic?"italic":"normal";if(u.variable&&!i.preferStatic){let $=c.get(f),r=`https://api.fontsource.org/v1/variable/${f}`;try{$=await n(r),c.set(f,$)}catch{throw new Error(`Failed to fetch font variable: ${i.name}`)}let a=_($.axes,i.variable??{});for(let p of P)if(b[p]){let h=`${s}/fontsource/fonts/${u.id}:vf@latest/${p}-wght-${S}.woff2`,y={family:x,display:"swap",style:S,weight:400,src:[{url:h,format:"woff2-variations"}],variable:{wght:a.wght??void 0,wdth:a.wdth??void 0,slnt:a.slnt??void 0},unicodeRange:b[p],comment:`${u.id}-${p}-wght-normal`};v.push(O(y))}else Object.entries(b).filter(([h])=>!u.subsets.includes(h)).forEach(([h,y])=>{let m=`${s}/fontsource/fonts/${u.id}:vf@latest/${h.slice(1,-1)}-wght-${S}.woff2`,w={family:x,display:"swap",style:S,weight:400,src:[{url:m,format:"woff2-variations"}],variable:{wght:a.wght??void 0,wdth:a.wdth??void 0,slnt:a.slnt??void 0},unicodeRange:y,comment:`${u.id}-${h}-wght-normal`};v.push(O(w))})}else{let $=i.weights&&i.weights.length>0?i.weights:d;for(let r of P)for(let a of $){let p=g[a][S][r].url,h={family:x,display:"swap",style:S,weight:Number(a),src:[{url:p.woff2,format:"woff2"}],unicodeRange:b[r],comment:`${u.id}-${r}-${a}-${S}`};v.push(O(h))}}return v}))).flat().join(`
|
|
2
2
|
|
|
3
3
|
`)}}}var k=z("fontsource","https://cdn.jsdelivr.net");function O(t){let{family:s,style:l,display:c,weight:e,variable:n,src:o,unicodeRange:i,comment:v,spacer:f=`
|
|
4
4
|
`}=t,{wght:u,wdth:d,slnt:b}=n??{},g="@font-face {";return g+=`${f}font-family: '${s}';`,g+=`${f}font-style: ${b?`oblique ${Number(b.max)*-1}deg ${Number(b.min)*-1}deg`:l};`,g+=`${f}font-display: ${c};`,g+=`${f}font-weight: ${u?Y(u):e};`,d&&(g+=`${f}font-stretch: ${d.min}% ${d.max}%;`),g+=`${f}src: ${o.map(({url:x,format:P})=>`url(${x}) format('${P}')`).join(", ")};`,i&&(g+=`${f}unicode-range: ${i};`),v&&(g=`/* ${v} */
|