@unocss/transformer-attributify-jsx 0.46.3 → 0.46.5
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 +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ function createFilter(include, exclude) {
|
|
|
14
14
|
const elementRE = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/gs;
|
|
15
15
|
const attributeRE = /([a-zA-Z()#][\[?a-zA-Z0-9-_:()#%\]?]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
|
|
16
16
|
const classFilterRE = /(className|class)\s*=\s*\{[^\}]*\}/i;
|
|
17
|
+
const curlybraceRE = /\{.+\}/g;
|
|
17
18
|
function transformerAttributifyJsx(options = {}) {
|
|
18
19
|
const {
|
|
19
20
|
blocklist = []
|
|
@@ -44,6 +45,8 @@ function transformerAttributifyJsx(options = {}) {
|
|
|
44
45
|
let attributifyPart = item[3];
|
|
45
46
|
if (classNamePart)
|
|
46
47
|
attributifyPart = item[3].replace(classFilterRE, " ".repeat(classNamePart[0].length));
|
|
48
|
+
if (curlybraceRE.test(attributifyPart))
|
|
49
|
+
continue;
|
|
47
50
|
for (const attr of attributifyPart.matchAll(attributeRE)) {
|
|
48
51
|
const matchedRule = attr[0].replace(/\:/i, "-");
|
|
49
52
|
if (matchedRule.includes("=") || isBlocked(matchedRule))
|
package/dist/index.mjs
CHANGED
|
@@ -12,6 +12,7 @@ function createFilter(include, exclude) {
|
|
|
12
12
|
const elementRE = /<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/gs;
|
|
13
13
|
const attributeRE = /([a-zA-Z()#][\[?a-zA-Z0-9-_:()#%\]?]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
|
|
14
14
|
const classFilterRE = /(className|class)\s*=\s*\{[^\}]*\}/i;
|
|
15
|
+
const curlybraceRE = /\{.+\}/g;
|
|
15
16
|
function transformerAttributifyJsx(options = {}) {
|
|
16
17
|
const {
|
|
17
18
|
blocklist = []
|
|
@@ -42,6 +43,8 @@ function transformerAttributifyJsx(options = {}) {
|
|
|
42
43
|
let attributifyPart = item[3];
|
|
43
44
|
if (classNamePart)
|
|
44
45
|
attributifyPart = item[3].replace(classFilterRE, " ".repeat(classNamePart[0].length));
|
|
46
|
+
if (curlybraceRE.test(attributifyPart))
|
|
47
|
+
continue;
|
|
45
48
|
for (const attr of attributifyPart.matchAll(attributeRE)) {
|
|
46
49
|
const matchedRule = attr[0].replace(/\:/i, "-");
|
|
47
50
|
if (matchedRule.includes("=") || isBlocked(matchedRule))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/transformer-attributify-jsx",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.5",
|
|
4
4
|
"description": "Support valueless attributify in JSX/TSX.",
|
|
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.46.
|
|
36
|
+
"@unocss/core": "0.46.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"magic-string": "^0.26.7"
|