@unocss/autocomplete 0.56.0 → 0.56.2
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 +5 -9
- package/dist/index.mjs +5 -9
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -228,9 +228,9 @@ function createAutocomplete(uno, options = {}) {
|
|
|
228
228
|
i,
|
|
229
229
|
...a2zd.map((j) => `${i}${j}`)
|
|
230
230
|
]);
|
|
231
|
-
await Promise.all(
|
|
232
|
-
(key) => suggest(key).then((i) => i.forEach((j) => matched.add(j)))
|
|
233
|
-
)
|
|
231
|
+
await Promise.all(
|
|
232
|
+
keys.map((key) => suggest(key).then((i) => i.forEach((j) => matched.add(j))))
|
|
233
|
+
);
|
|
234
234
|
await Promise.all(
|
|
235
235
|
[...matched].filter((i) => i.match(/^\w+$/) && i.length > 3).map((i) => suggest(`${i}-`).then((i2) => i2.forEach((j) => matched.add(j))))
|
|
236
236
|
);
|
|
@@ -318,14 +318,10 @@ function createAutocomplete(uno, options = {}) {
|
|
|
318
318
|
return keys.filter((i) => i[1] && i[0].startsWith(input)).map((i) => i[0]);
|
|
319
319
|
}
|
|
320
320
|
function suggestFromPreset(input) {
|
|
321
|
-
return templates.map(
|
|
322
|
-
(fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType)
|
|
323
|
-
) || [];
|
|
321
|
+
return templates.map((fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType)) || [];
|
|
324
322
|
}
|
|
325
323
|
function suggestVariant(input, used) {
|
|
326
|
-
return uno.config.variants.filter((v) => v.autocomplete && (v.multiPass || !used.has(v))).flatMap((v) => core.toArray(v.autocomplete || [])).map(
|
|
327
|
-
(fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType)
|
|
328
|
-
);
|
|
324
|
+
return uno.config.variants.filter((v) => v.autocomplete && (v.multiPass || !used.has(v))).flatMap((v) => core.toArray(v.autocomplete || [])).map((fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType));
|
|
329
325
|
}
|
|
330
326
|
function reset() {
|
|
331
327
|
templateCache.clear();
|
package/dist/index.mjs
CHANGED
|
@@ -226,9 +226,9 @@ function createAutocomplete(uno, options = {}) {
|
|
|
226
226
|
i,
|
|
227
227
|
...a2zd.map((j) => `${i}${j}`)
|
|
228
228
|
]);
|
|
229
|
-
await Promise.all(
|
|
230
|
-
(key) => suggest(key).then((i) => i.forEach((j) => matched.add(j)))
|
|
231
|
-
)
|
|
229
|
+
await Promise.all(
|
|
230
|
+
keys.map((key) => suggest(key).then((i) => i.forEach((j) => matched.add(j))))
|
|
231
|
+
);
|
|
232
232
|
await Promise.all(
|
|
233
233
|
[...matched].filter((i) => i.match(/^\w+$/) && i.length > 3).map((i) => suggest(`${i}-`).then((i2) => i2.forEach((j) => matched.add(j))))
|
|
234
234
|
);
|
|
@@ -316,14 +316,10 @@ function createAutocomplete(uno, options = {}) {
|
|
|
316
316
|
return keys.filter((i) => i[1] && i[0].startsWith(input)).map((i) => i[0]);
|
|
317
317
|
}
|
|
318
318
|
function suggestFromPreset(input) {
|
|
319
|
-
return templates.map(
|
|
320
|
-
(fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType)
|
|
321
|
-
) || [];
|
|
319
|
+
return templates.map((fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType)) || [];
|
|
322
320
|
}
|
|
323
321
|
function suggestVariant(input, used) {
|
|
324
|
-
return uno.config.variants.filter((v) => v.autocomplete && (v.multiPass || !used.has(v))).flatMap((v) => toArray(v.autocomplete || [])).map(
|
|
325
|
-
(fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType)
|
|
326
|
-
);
|
|
322
|
+
return uno.config.variants.filter((v) => v.autocomplete && (v.multiPass || !used.has(v))).flatMap((v) => toArray(v.autocomplete || [])).map((fn) => typeof fn === "function" ? fn(input) : getParsed(fn)(input, matchType));
|
|
327
323
|
}
|
|
328
324
|
function reset() {
|
|
329
325
|
templateCache.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/autocomplete",
|
|
3
|
-
"version": "0.56.
|
|
3
|
+
"version": "0.56.2",
|
|
4
4
|
"description": "Autocomplete utils for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lru-cache": "^10.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@unocss/core": "0.56.
|
|
40
|
+
"@unocss/core": "0.56.2"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "unbuild",
|