@una-ui/extractor-vue-script 0.53.0 → 0.54.1
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.mjs +3 -3
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -7,15 +7,15 @@ function generateSelectors(prefix, values) {
|
|
|
7
7
|
function splitCodeWithArbitraryVariants(code, prefixes) {
|
|
8
8
|
const result = [];
|
|
9
9
|
const camelCasePrefixes = prefixes.map((prefix) => prefix.replace(/-([a-z])/g, (_, c) => c.toUpperCase()));
|
|
10
|
-
prefixes = [...prefixes, ...camelCasePrefixes];
|
|
10
|
+
prefixes = [.../* @__PURE__ */ new Set([...prefixes, ...camelCasePrefixes])];
|
|
11
11
|
for (const prefix of prefixes) {
|
|
12
|
-
const regex = new RegExp(`\\b${prefix}\\s*:\\s*'([^']*)'`, "
|
|
12
|
+
const regex = new RegExp(`\\b${prefix}\\s*:\\s*(?:'([^']*)'|{[^}]*\\bdefault\\s*:\\s*'([^']*)'\\s*,?.*?})`, "gms");
|
|
13
13
|
let match;
|
|
14
14
|
while (true) {
|
|
15
15
|
match = regex.exec(code);
|
|
16
16
|
if (match === null)
|
|
17
17
|
break;
|
|
18
|
-
const values = match[1].split(defaultSplitRE);
|
|
18
|
+
const values = (match[1] ?? match[2]).split(defaultSplitRE);
|
|
19
19
|
const selectors = generateSelectors(prefix, values);
|
|
20
20
|
result.push(...selectors);
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/extractor-vue-script",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.1",
|
|
4
4
|
"description": "Unocss extractor for Vue script",
|
|
5
5
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@unocss/core": "^66.0.0"
|
|
38
|
+
"@unocss/core": "^66.0.0",
|
|
39
|
+
"vitest": "^3.1.3"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "unbuild",
|