@unocss/preset-attributify 0.54.3 → 0.55.0
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/dist/index.cjs +4 -5
- package/dist/index.mjs +4 -5
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -146,7 +146,7 @@ function extractorAttributify(options) {
|
|
|
146
146
|
return {
|
|
147
147
|
name: "@unocss/preset-attributify/extractor",
|
|
148
148
|
extract({ code }) {
|
|
149
|
-
|
|
149
|
+
return Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
150
150
|
const content = contents.filter(Boolean).join("");
|
|
151
151
|
if (ignoreAttributes.includes(name))
|
|
152
152
|
return [];
|
|
@@ -158,10 +158,10 @@ function extractorAttributify(options) {
|
|
|
158
158
|
}
|
|
159
159
|
if (!content) {
|
|
160
160
|
if (core.isValidSelector(name) && nonValuedAttribute !== false) {
|
|
161
|
-
const
|
|
161
|
+
const result = [`[${name}=""]`];
|
|
162
162
|
if (trueToNonValued)
|
|
163
|
-
|
|
164
|
-
return
|
|
163
|
+
result.push(`[${name}="true"]`);
|
|
164
|
+
return result;
|
|
165
165
|
}
|
|
166
166
|
return [];
|
|
167
167
|
}
|
|
@@ -173,7 +173,6 @@ function extractorAttributify(options) {
|
|
|
173
173
|
return content.split(splitterRE).filter((v) => Boolean(v) && v !== ":").map((v) => `[${name}~="${v}"]`);
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
return new Set(result);
|
|
177
176
|
}
|
|
178
177
|
};
|
|
179
178
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -142,7 +142,7 @@ function extractorAttributify(options) {
|
|
|
142
142
|
return {
|
|
143
143
|
name: "@unocss/preset-attributify/extractor",
|
|
144
144
|
extract({ code }) {
|
|
145
|
-
|
|
145
|
+
return Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, ...contents]) => {
|
|
146
146
|
const content = contents.filter(Boolean).join("");
|
|
147
147
|
if (ignoreAttributes.includes(name))
|
|
148
148
|
return [];
|
|
@@ -154,10 +154,10 @@ function extractorAttributify(options) {
|
|
|
154
154
|
}
|
|
155
155
|
if (!content) {
|
|
156
156
|
if (isValidSelector(name) && nonValuedAttribute !== false) {
|
|
157
|
-
const
|
|
157
|
+
const result = [`[${name}=""]`];
|
|
158
158
|
if (trueToNonValued)
|
|
159
|
-
|
|
160
|
-
return
|
|
159
|
+
result.push(`[${name}="true"]`);
|
|
160
|
+
return result;
|
|
161
161
|
}
|
|
162
162
|
return [];
|
|
163
163
|
}
|
|
@@ -169,7 +169,6 @@ function extractorAttributify(options) {
|
|
|
169
169
|
return content.split(splitterRE).filter((v) => Boolean(v) && v !== ":").map((v) => `[${name}~="${v}"]`);
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
|
-
return new Set(result);
|
|
173
172
|
}
|
|
174
173
|
};
|
|
175
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-attributify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Attributify preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@unocss/core": "0.
|
|
36
|
+
"@unocss/core": "0.55.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "unbuild",
|