@unocss/runtime 0.63.2 → 0.63.3
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 +6 -6
- package/core.global.js +1 -1
- package/full.global.js +6 -6
- package/mini.global.js +6 -6
- package/package.json +4 -4
- package/preset-attributify.global.js +1 -1
- package/preset-mini.global.js +7 -7
- package/preset-uno.global.js +7 -7
- package/preset-wind.global.js +7 -7
- package/uno.global.js +6 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.63.
|
|
4
|
+
"version": "0.63.3",
|
|
5
5
|
"description": "CSS-in-JS Runtime for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unocss/
|
|
39
|
-
"@unocss/preset-uno": "0.63.
|
|
40
|
-
"@unocss/
|
|
38
|
+
"@unocss/core": "0.63.3",
|
|
39
|
+
"@unocss/preset-uno": "0.63.3",
|
|
40
|
+
"@unocss/preset-attributify": "0.63.3"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "pnpm run build:node && pnpm run build:cdn && pnpm run build:presets",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var U=/^\[(.+?)~?="(.*)"\]$/;var T=/[\w\u00A0-\uFFFF%-?]/;function w(t){return t.match(U)}function E(t=""){return T.test(t)}var V=/^(?!.*\[[^:]+:.+\]$)((?:.+:)?!?)(.*)$/;function v(t={}){let d=t.prefix??"un-",o=t.prefixedOnly??!1,x=t.trueToNonValued??!1,l;return{name:"attributify",match(r,{generator:b}){let i=w(r);if(!i)return;let e=i[1];if(e.startsWith(d))e=e.slice(d.length);else if(o)return;let u=i[2],[,c="",n=u]=u.match(V)||[];if(c&&n.match(/^[\d.]+$/)){let a=c.split(/([^:]*:)/g).filter(Boolean);n=a.pop()+n,c=a.join("")}if(n==="~"||x&&n==="true"||!n)return`${c}${e}`;if(l==null){let a=b?.config?.separators?.join("|");a?l=new RegExp(`^(.*\\](?:${a}))(\\[[^\\]]+?\\])$`):l=!1}if(l){let[,a,f]=u.match(l)||[];if(f)return`${a}${c}${e}-${f}`}return`${c}${e}-${n}`}}}var k=/(<\w[\w:.$-]*\s)((?:'[^>']*'|"[^>"]*"|`[^>`]*`|\{[^>}]*\}|[^>]*?)*)/g,C=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF-:%]+)(?:=("[^"]*|'[^']*))?/g,F=/[\s'"`;>]+/;function P(t){return{name:"attributify",extract:({content:d,cursor:o})=>{let x=d.matchAll(k),l,r=0;for(let s of x){let[,m,g]=s,A=s.index+m.length;if(o>A&&o<=A+g.length){r=A,l=g;break}}if(!l)return null;let b=l.matchAll(C),i=0,e,u;for(let s of b){let[m,g,A]=s,$=r+s.index;if(o>$&&o<=$+m.length){i=$,e=g,u=A?.slice(1);break}}if(!e||e==="class"||e==="className"||e===":class")return null;let c=!!t?.prefix&&e.startsWith(t.prefix);if(t?.prefixedOnly&&!c)return null;let n=c?e.slice(t.prefix.length):e;if(u===void 0)return{extracted:n,resolveReplacement(s){let m=c?t.prefix.length:0;return{start:i+m,end:i+e.length,replacement:s}}};let a=i+e.length+2,f=F.exec(u),p=0,h;for(;f;){let[s]=f;if(o>a+p&&o<=a+p+f.index){h=u.slice(p,p+f.index);break}p+=f.index+s.length,f=F.exec(u.slice(p))}h===void 0&&(h=u.slice(p));let[,y="",S]=h.match(V)||[];return{extracted:`${y}${n}-${S}`,transformSuggestions(s){return s.filter(m=>m.startsWith(`${y}${n}-`)).map(m=>y+m.slice(y.length+n.length+1))},resolveReplacement(s){return{start:p+a,end:p+a+h.length,replacement:y+s.slice(y.length+n.length+1)}}}}}}var W=["v-bind:",":"],_=/[\s'"`;]+/g,O=/<[^>\s]*\s((?:'[^']*'|"[^"]*"|`[^`]*`|\{[^}]*\}|=>|[^>]*?)*)/g,I=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF:!%.~<-]+)=?(?:"([^"]*)"|'([^']*)'|\{([^}]*)\})?/g,R=["placeholder","fill","opacity","stroke-opacity"];function N(t){let d=t?.ignoreAttributes??R,o=t?.nonValuedAttribute??!0,x=t?.trueToNonValued??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:l}){return Array.from(l.matchAll(O)).flatMap(r=>Array.from((r[1]||"").matchAll(I))).flatMap(([,r,...b])=>{let i=b.filter(Boolean).join("");if(d.includes(r))return[];for(let e of W)if(r.startsWith(e)){r=r.slice(e.length);break}if(!i){if(E(r)&&o!==!1){let e=[`[${r}=""]`];return x&&e.push(`[${r}="true"]`),e}return[]}return["class","className"].includes(r)?i.split(_).filter(E):O.test(i)?(O.lastIndex=0,this.extract({code:i})):t?.prefixedOnly&&t.prefix&&!r.startsWith(t.prefix)?[]:i.split(_).filter(e=>!!e&&e!==":").map(e=>`[${r}~="${e}"]`)})}}}var B=(t={})=>{t.strict=t.strict??!1,t.prefix=t.prefix??"un-",t.prefixedOnly=t.prefixedOnly??!1,t.nonValuedAttribute=t.nonValuedAttribute??!0,t.ignoreAttributes=t.ignoreAttributes??R;let d=[v(t)],o=[N(t)],x=[P(t)];return{name:"@unocss/preset-attributify",enforce:"post",variants:d,extractors:o,options:t,autocomplete:{extractors:x},extractorDefault:t.strict?!1:void 0}},j=B;window.__unocss_runtime=window.__unocss_runtime??{};window.__unocss_runtime.presets=Object.assign(window.__unocss_runtime?.presets??{},{presetAttributify:t=>j(t)});})();
|