@unocss/autocomplete 0.65.2 → 0.65.4
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 -5
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -6,10 +6,8 @@ function searchUsageBoundary(line, index, attributify = true) {
|
|
|
6
6
|
let start = index;
|
|
7
7
|
let end = index;
|
|
8
8
|
const regex = /[^\s>"'`;]/;
|
|
9
|
-
while (start && regex.test(line.charAt(start - 1)))
|
|
10
|
-
|
|
11
|
-
while (end < line.length && regex.test(line.charAt(end)))
|
|
12
|
-
++end;
|
|
9
|
+
while (start && regex.test(line.charAt(start - 1))) --start;
|
|
10
|
+
while (end < line.length && regex.test(line.charAt(end))) ++end;
|
|
13
11
|
if (attributify) {
|
|
14
12
|
return {
|
|
15
13
|
content: line.slice(start, end),
|
|
@@ -377,7 +375,7 @@ function createAutocomplete(_uno, options = {}) {
|
|
|
377
375
|
return staticUtils.filter((i) => i.startsWith(input));
|
|
378
376
|
}
|
|
379
377
|
async function suggestUnoCache(input) {
|
|
380
|
-
const keys = Array.from(uno.
|
|
378
|
+
const keys = Array.from(uno.cache.entries());
|
|
381
379
|
return keys.filter((i) => i[1] && i[0].startsWith(input)).map((i) => i[0]);
|
|
382
380
|
}
|
|
383
381
|
function suggestFromPreset(input) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/autocomplete",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.65.
|
|
4
|
+
"version": "0.65.4",
|
|
5
5
|
"description": "Autocomplete utils for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lru-cache": "^10.4.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@unocss/core": "0.65.
|
|
40
|
+
"@unocss/core": "0.65.4"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "unbuild",
|