@unocss/core 0.14.1 → 0.14.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.d.ts +1 -1
- package/dist/index.js +9 -6
- package/dist/index.mjs +9 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ interface VariantHandler {
|
|
|
111
111
|
/**
|
|
112
112
|
* Rewrite the output selector. Often be used to append pesudo classes or parents.
|
|
113
113
|
*/
|
|
114
|
-
selector?: (input: string) => string | undefined;
|
|
114
|
+
selector?: (input: string, body: CSSEntries) => string | undefined;
|
|
115
115
|
/**
|
|
116
116
|
* Rewrite the output css body. The input come in [key,value][] pairs.
|
|
117
117
|
*/
|
package/dist/index.js
CHANGED
|
@@ -96,6 +96,8 @@ function normalizeCSSValues(obj) {
|
|
|
96
96
|
}
|
|
97
97
|
function clearIdenticalEntries(entry) {
|
|
98
98
|
return entry.filter(([k, v], idx) => {
|
|
99
|
+
if (k.startsWith("$$"))
|
|
100
|
+
return false;
|
|
99
101
|
for (let i = idx - 1; i >= 0; i--) {
|
|
100
102
|
if (entry[i][0] === k && entry[i][1] === v)
|
|
101
103
|
return false;
|
|
@@ -365,7 +367,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
365
367
|
}
|
|
366
368
|
|
|
367
369
|
// package.json
|
|
368
|
-
var version = "0.14.
|
|
370
|
+
var version = "0.14.2";
|
|
369
371
|
|
|
370
372
|
// src/generator/index.ts
|
|
371
373
|
var UnoGenerator = class {
|
|
@@ -565,15 +567,16 @@ var UnoGenerator = class {
|
|
|
565
567
|
return [raw, processed, handlers];
|
|
566
568
|
}
|
|
567
569
|
applyVariants(parsed, variantHandlers = parsed[4], raw = parsed[1]) {
|
|
570
|
+
const entries = variantHandlers.reduce((p, v) => {
|
|
571
|
+
var _a;
|
|
572
|
+
return ((_a = v.body) == null ? void 0 : _a.call(v, p)) || p;
|
|
573
|
+
}, parsed[2]);
|
|
568
574
|
return [
|
|
569
575
|
variantHandlers.reduce((p, v) => {
|
|
570
576
|
var _a;
|
|
571
|
-
return ((_a = v.selector) == null ? void 0 : _a.call(v, p)) || p;
|
|
577
|
+
return ((_a = v.selector) == null ? void 0 : _a.call(v, p, entries)) || p;
|
|
572
578
|
}, toEscapedSelector(raw)),
|
|
573
|
-
|
|
574
|
-
var _a;
|
|
575
|
-
return ((_a = v.body) == null ? void 0 : _a.call(v, p)) || p;
|
|
576
|
-
}, parsed[2]),
|
|
579
|
+
entries,
|
|
577
580
|
variantHandlers.reduce((p, v) => Array.isArray(v.parent) ? v.parent[0] : v.parent || p, void 0)
|
|
578
581
|
];
|
|
579
582
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -52,6 +52,8 @@ function normalizeCSSValues(obj) {
|
|
|
52
52
|
}
|
|
53
53
|
function clearIdenticalEntries(entry) {
|
|
54
54
|
return entry.filter(([k, v], idx) => {
|
|
55
|
+
if (k.startsWith("$$"))
|
|
56
|
+
return false;
|
|
55
57
|
for (let i = idx - 1; i >= 0; i--) {
|
|
56
58
|
if (entry[i][0] === k && entry[i][1] === v)
|
|
57
59
|
return false;
|
|
@@ -321,7 +323,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
321
323
|
}
|
|
322
324
|
|
|
323
325
|
// package.json
|
|
324
|
-
var version = "0.14.
|
|
326
|
+
var version = "0.14.2";
|
|
325
327
|
|
|
326
328
|
// src/generator/index.ts
|
|
327
329
|
var UnoGenerator = class {
|
|
@@ -521,15 +523,16 @@ var UnoGenerator = class {
|
|
|
521
523
|
return [raw, processed, handlers];
|
|
522
524
|
}
|
|
523
525
|
applyVariants(parsed, variantHandlers = parsed[4], raw = parsed[1]) {
|
|
526
|
+
const entries = variantHandlers.reduce((p, v) => {
|
|
527
|
+
var _a;
|
|
528
|
+
return ((_a = v.body) == null ? void 0 : _a.call(v, p)) || p;
|
|
529
|
+
}, parsed[2]);
|
|
524
530
|
return [
|
|
525
531
|
variantHandlers.reduce((p, v) => {
|
|
526
532
|
var _a;
|
|
527
|
-
return ((_a = v.selector) == null ? void 0 : _a.call(v, p)) || p;
|
|
533
|
+
return ((_a = v.selector) == null ? void 0 : _a.call(v, p, entries)) || p;
|
|
528
534
|
}, toEscapedSelector(raw)),
|
|
529
|
-
|
|
530
|
-
var _a;
|
|
531
|
-
return ((_a = v.body) == null ? void 0 : _a.call(v, p)) || p;
|
|
532
|
-
}, parsed[2]),
|
|
535
|
+
entries,
|
|
533
536
|
variantHandlers.reduce((p, v) => Array.isArray(v.parent) ? v.parent[0] : v.parent || p, void 0)
|
|
534
537
|
];
|
|
535
538
|
}
|