@unocss/transformer-attributify-jsx 0.55.1 → 0.55.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/dist/index.cjs CHANGED
@@ -11,7 +11,7 @@ function createFilter(include, exclude) {
11
11
  return includePattern.some((p) => id.match(p));
12
12
  };
13
13
  }
14
- const elementRE = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`(?:[^>]|[\S])*?`|\{(?:[^>]|[\S])*?\}|[^>]*?)*)/g;
14
+ const elementRE = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|[\{`]([^>]|[\S])*?[\}`]|[^>]*?)*)/g;
15
15
  const attributeRE = /([a-zA-Z()#][\[?a-zA-Z0-9-_:()#%\]?]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
16
16
  const valuedAttributeRE = /((?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=(?:["]([^"]*)["]|[']([^']*)[']|[{]((?:[`(](?:[^`)]*)[`)]|[^}])+)[}])/gms;
17
17
  function transformerAttributifyJsx(options = {}) {
@@ -0,0 +1,24 @@
1
+ import { SourceCodeTransformer } from '@unocss/core';
2
+
3
+ type FilterPattern = Array<string | RegExp> | string | RegExp | null;
4
+ interface TransformerAttributifyJsxOptions {
5
+ /**
6
+ * the list of attributes to ignore
7
+ * @default []
8
+ */
9
+ blocklist?: (string | RegExp)[];
10
+ /**
11
+ * Regex of modules to be included from processing
12
+ * @default [/\.[jt]sx$/, /\.mdx$/]
13
+ */
14
+ include?: FilterPattern;
15
+ /**
16
+ * Regex of modules to exclude from processing
17
+ *
18
+ * @default []
19
+ */
20
+ exclude?: FilterPattern;
21
+ }
22
+ declare function transformerAttributifyJsx(options?: TransformerAttributifyJsxOptions): SourceCodeTransformer;
23
+
24
+ export { type FilterPattern, type TransformerAttributifyJsxOptions, transformerAttributifyJsx as default };
@@ -0,0 +1,24 @@
1
+ import { SourceCodeTransformer } from '@unocss/core';
2
+
3
+ type FilterPattern = Array<string | RegExp> | string | RegExp | null;
4
+ interface TransformerAttributifyJsxOptions {
5
+ /**
6
+ * the list of attributes to ignore
7
+ * @default []
8
+ */
9
+ blocklist?: (string | RegExp)[];
10
+ /**
11
+ * Regex of modules to be included from processing
12
+ * @default [/\.[jt]sx$/, /\.mdx$/]
13
+ */
14
+ include?: FilterPattern;
15
+ /**
16
+ * Regex of modules to exclude from processing
17
+ *
18
+ * @default []
19
+ */
20
+ exclude?: FilterPattern;
21
+ }
22
+ declare function transformerAttributifyJsx(options?: TransformerAttributifyJsxOptions): SourceCodeTransformer;
23
+
24
+ export { type FilterPattern, type TransformerAttributifyJsxOptions, transformerAttributifyJsx as default };
package/dist/index.d.ts CHANGED
@@ -21,4 +21,4 @@ interface TransformerAttributifyJsxOptions {
21
21
  }
22
22
  declare function transformerAttributifyJsx(options?: TransformerAttributifyJsxOptions): SourceCodeTransformer;
23
23
 
24
- export { FilterPattern, TransformerAttributifyJsxOptions, transformerAttributifyJsx as default };
24
+ export { type FilterPattern, type TransformerAttributifyJsxOptions, transformerAttributifyJsx as default };
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ function createFilter(include, exclude) {
9
9
  return includePattern.some((p) => id.match(p));
10
10
  };
11
11
  }
12
- const elementRE = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|`(?:[^>]|[\S])*?`|\{(?:[^>]|[\S])*?\}|[^>]*?)*)/g;
12
+ const elementRE = /(<\w[\w:\.$-]*\s)((?:'[^>]*?'|"[^>]*?"|[\{`]([^>]|[\S])*?[\}`]|[^>]*?)*)/g;
13
13
  const attributeRE = /([a-zA-Z()#][\[?a-zA-Z0-9-_:()#%\]?]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
14
14
  const valuedAttributeRE = /((?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-.~<]+)=(?:["]([^"]*)["]|[']([^']*)[']|[{]((?:[`(](?:[^`)]*)[`)]|[^}])+)[}])/gms;
15
15
  function transformerAttributifyJsx(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/transformer-attributify-jsx",
3
- "version": "0.55.1",
3
+ "version": "0.55.3",
4
4
  "description": "Support valueless attributify in JSX/TSX.",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -33,10 +33,10 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@unocss/core": "0.55.1"
36
+ "@unocss/core": "0.55.3"
37
37
  },
38
38
  "devDependencies": {
39
- "magic-string": "^0.30.2"
39
+ "magic-string": "^0.30.3"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",