@unocss/autocomplete 0.30.3 → 0.30.6
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 +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -40,13 +40,15 @@ function parseAutocomplete(template, theme = {}) {
|
|
|
40
40
|
suggest
|
|
41
41
|
};
|
|
42
42
|
function handleNonGroup(input) {
|
|
43
|
-
handleRegexMatch(input, /\$([\w
|
|
43
|
+
handleRegexMatch(input, /\$([\w\.\|]+)/g, (m) => {
|
|
44
44
|
parts.push({
|
|
45
45
|
type: "theme",
|
|
46
46
|
objects: m[1].split("|").map((i) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
return i.split(".").reduce((v, k) => {
|
|
48
|
+
if (!k || !v[k])
|
|
49
|
+
throw new Error(`Invalid theme key ${k}`);
|
|
50
|
+
return v[k];
|
|
51
|
+
}, theme);
|
|
50
52
|
})
|
|
51
53
|
});
|
|
52
54
|
}, (str) => {
|
package/dist/index.mjs
CHANGED
|
@@ -32,13 +32,15 @@ function parseAutocomplete(template, theme = {}) {
|
|
|
32
32
|
suggest
|
|
33
33
|
};
|
|
34
34
|
function handleNonGroup(input) {
|
|
35
|
-
handleRegexMatch(input, /\$([\w
|
|
35
|
+
handleRegexMatch(input, /\$([\w\.\|]+)/g, (m) => {
|
|
36
36
|
parts.push({
|
|
37
37
|
type: "theme",
|
|
38
38
|
objects: m[1].split("|").map((i) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return i.split(".").reduce((v, k) => {
|
|
40
|
+
if (!k || !v[k])
|
|
41
|
+
throw new Error(`Invalid theme key ${k}`);
|
|
42
|
+
return v[k];
|
|
43
|
+
}, theme);
|
|
42
44
|
})
|
|
43
45
|
});
|
|
44
46
|
}, (str) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/autocomplete",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.6",
|
|
4
4
|
"description": "Autocomplete utils for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/lru-cache": "^7.5.0",
|
|
39
|
-
"@unocss/core": "0.30.
|
|
39
|
+
"@unocss/core": "0.30.6"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|