@unocss/core 0.27.6 → 0.28.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 +10 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +10 -13
- package/package.json +11 -10
package/dist/index.cjs
CHANGED
|
@@ -356,7 +356,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
const version = "0.
|
|
359
|
+
const version = "0.28.2";
|
|
360
360
|
|
|
361
361
|
class UnoGenerator {
|
|
362
362
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -409,9 +409,8 @@ class UnoGenerator {
|
|
|
409
409
|
if (this.blocked.has(raw))
|
|
410
410
|
return;
|
|
411
411
|
const cacheKey = `${raw}${alias ? ` ${alias}` : ""}`;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
return cached;
|
|
412
|
+
if (this._cache.has(cacheKey))
|
|
413
|
+
return this._cache.get(cacheKey);
|
|
415
414
|
let current = raw;
|
|
416
415
|
for (const p of this.config.preprocess)
|
|
417
416
|
current = p(raw);
|
|
@@ -553,15 +552,13 @@ class UnoGenerator {
|
|
|
553
552
|
continue;
|
|
554
553
|
if (typeof handler === "string")
|
|
555
554
|
handler = { matcher: handler };
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
break;
|
|
564
|
-
}
|
|
555
|
+
processed = handler.matcher;
|
|
556
|
+
if (Array.isArray(handler.parent))
|
|
557
|
+
this.parentOrders.set(handler.parent[0], handler.parent[1]);
|
|
558
|
+
handlers.push(handler);
|
|
559
|
+
usedVariants.add(v);
|
|
560
|
+
applied = true;
|
|
561
|
+
break;
|
|
565
562
|
}
|
|
566
563
|
if (!applied)
|
|
567
564
|
break;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare class UnoGenerator {
|
|
|
13
13
|
setConfig(userConfig?: UserConfig, defaults?: UserConfigDefaults): void;
|
|
14
14
|
applyExtractors(code: string, id?: string, set?: Set<string>): Promise<Set<string>>;
|
|
15
15
|
makeContext(raw: string, applied: VariantMatchedResult): RuleContext<{}>;
|
|
16
|
-
parseToken(raw: string, alias?: string): Promise<StringifiedUtil[] | undefined>;
|
|
16
|
+
parseToken(raw: string, alias?: string): Promise<StringifiedUtil[] | null | undefined>;
|
|
17
17
|
generate(input: string | Set<string>, { id, scope, preflights, safelist, minify, }?: GenerateOptions): Promise<GenerateResult>;
|
|
18
18
|
matchVariants(raw: string, current?: string): VariantMatchedResult;
|
|
19
19
|
applyVariants(parsed: ParsedUtil, variantHandlers?: VariantHandler[], raw?: string): UtilObject;
|
package/dist/index.mjs
CHANGED
|
@@ -352,7 +352,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
352
352
|
};
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
const version = "0.
|
|
355
|
+
const version = "0.28.2";
|
|
356
356
|
|
|
357
357
|
class UnoGenerator {
|
|
358
358
|
constructor(userConfig = {}, defaults = {}) {
|
|
@@ -405,9 +405,8 @@ class UnoGenerator {
|
|
|
405
405
|
if (this.blocked.has(raw))
|
|
406
406
|
return;
|
|
407
407
|
const cacheKey = `${raw}${alias ? ` ${alias}` : ""}`;
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
return cached;
|
|
408
|
+
if (this._cache.has(cacheKey))
|
|
409
|
+
return this._cache.get(cacheKey);
|
|
411
410
|
let current = raw;
|
|
412
411
|
for (const p of this.config.preprocess)
|
|
413
412
|
current = p(raw);
|
|
@@ -549,15 +548,13 @@ class UnoGenerator {
|
|
|
549
548
|
continue;
|
|
550
549
|
if (typeof handler === "string")
|
|
551
550
|
handler = { matcher: handler };
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
break;
|
|
560
|
-
}
|
|
551
|
+
processed = handler.matcher;
|
|
552
|
+
if (Array.isArray(handler.parent))
|
|
553
|
+
this.parentOrders.set(handler.parent[0], handler.parent[1]);
|
|
554
|
+
handlers.push(handler);
|
|
555
|
+
usedVariants.add(v);
|
|
556
|
+
applied = true;
|
|
557
|
+
break;
|
|
561
558
|
}
|
|
562
559
|
if (!applied)
|
|
563
560
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.2",
|
|
4
4
|
"description": "The instant on-demand Atomic CSS engine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -15,17 +15,16 @@
|
|
|
15
15
|
"url": "https://github.com/unocss/unocss/issues"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
|
+
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
20
21
|
"url": "git+https://github.com/unocss/unocss.git",
|
|
21
22
|
"directory": "packages/core"
|
|
22
23
|
},
|
|
23
24
|
"funding": "https://github.com/sponsors/antfu",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"dist"
|
|
28
|
-
],
|
|
25
|
+
"main": "dist/index.cjs",
|
|
26
|
+
"module": "dist/index.mjs",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
29
28
|
"exports": {
|
|
30
29
|
".": {
|
|
31
30
|
"require": "./dist/index.cjs",
|
|
@@ -33,9 +32,10 @@
|
|
|
33
32
|
"types": "./dist/index.d.ts"
|
|
34
33
|
}
|
|
35
34
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"sideEffects": false,
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"magic-string": "^0.26.1",
|
|
41
41
|
"unconfig": "^0.3.1"
|
|
@@ -43,5 +43,6 @@
|
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|
|
45
45
|
"stub": "unbuild --stub"
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
|
+
"readme": "# @unocss/core\n\nThe core engine of [UnoCSS](https://github.com/unocss/unocss) without any presets. It can be used as the engine of your own atomic CSS framework.\n\n## Usage\n\n```ts\nimport { createGenerator } from '@unocss/core'\n\nconst generator = createGenerator({ /* user options */ }, { /* default options */ })\n\nconst { css } = await generator.generate(code)\n```\n\n## License\n\nMIT License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)\n\n"
|
|
47
48
|
}
|