@unocss/preset-attributify 0.14.3 → 0.15.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 CHANGED
@@ -15,6 +15,8 @@ const extractorAttributify = (options) => ({
15
15
  name: "attributify",
16
16
  extract({ code }) {
17
17
  const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, _, content]) => {
18
+ if (options?.ignoreAttributes?.includes(name))
19
+ return [];
18
20
  for (const prefix of strippedPrefixes) {
19
21
  if (name.startsWith(prefix)) {
20
22
  name = name.slice(prefix.length);
package/dist/index.d.ts CHANGED
@@ -28,6 +28,10 @@ interface AttributifyOptions {
28
28
  * @default true
29
29
  */
30
30
  nonValuedAttribute?: boolean;
31
+ /**
32
+ * A list of attributes to be ignored from extracting.
33
+ */
34
+ ignoreAttributes?: string[];
31
35
  }
32
36
 
33
37
  declare const extractorAttributify: (options?: AttributifyOptions | undefined) => Extractor;
package/dist/index.mjs CHANGED
@@ -11,6 +11,8 @@ const extractorAttributify = (options) => ({
11
11
  name: "attributify",
12
12
  extract({ code }) {
13
13
  const result = Array.from(code.matchAll(elementRE)).flatMap((match) => Array.from((match[1] || "").matchAll(valuedAttributeRE))).flatMap(([, name, _, content]) => {
14
+ if (options?.ignoreAttributes?.includes(name))
15
+ return [];
14
16
  for (const prefix of strippedPrefixes) {
15
17
  if (name.startsWith(prefix)) {
16
18
  name = name.slice(prefix.length);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-attributify",
3
- "version": "0.14.3",
3
+ "version": "0.15.0",
4
4
  "description": "Attributify preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@unocss/core": "0.14.3"
36
+ "@unocss/core": "0.15.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "unbuild",