windrunner 1.1.1 → 1.1.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/README.md +2 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.esm.js +100 -239
- package/dist/index.js +100 -239
- package/dist/index.min.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29,62 +29,6 @@ __export(index_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(index_exports);
|
|
31
31
|
|
|
32
|
-
// src/variants.js
|
|
33
|
-
var variants = {
|
|
34
|
-
accentColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
35
|
-
accessibility: ["hover", "focus"],
|
|
36
|
-
aspect: ["hover", "focus"],
|
|
37
|
-
backgroundColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
38
|
-
blur: ["hover", "focus"],
|
|
39
|
-
borderColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
40
|
-
boxShadow: ["hover", "focus"],
|
|
41
|
-
brightness: ["hover", "focus"],
|
|
42
|
-
caretColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
43
|
-
contrast: ["hover", "focus"],
|
|
44
|
-
dropShadow: ["hover", "focus"],
|
|
45
|
-
fill: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
46
|
-
flexBasis: ["hover", "focus"],
|
|
47
|
-
gradientColorStops: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
48
|
-
grayscale: ["hover", "focus"],
|
|
49
|
-
hueRotate: ["hover", "focus"],
|
|
50
|
-
insetRing: ["hover", "focus"],
|
|
51
|
-
insetShadow: ["hover", "focus"],
|
|
52
|
-
invert: ["hover", "focus"],
|
|
53
|
-
opacity: ["hover", "focus"],
|
|
54
|
-
outlineColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
55
|
-
outlineOffset: ["hover", "focus"],
|
|
56
|
-
outlineStyle: ["hover", "focus"],
|
|
57
|
-
outlineWidth: ["hover", "focus"],
|
|
58
|
-
placeholderColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
59
|
-
ringColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
60
|
-
ringOffsetColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
61
|
-
ringOffsetWidth: ["hover", "focus"],
|
|
62
|
-
ringWidth: ["hover", "focus"],
|
|
63
|
-
rotate: ["hover", "focus"],
|
|
64
|
-
saturate: ["hover", "focus"],
|
|
65
|
-
scale: ["hover", "focus"],
|
|
66
|
-
sepia: ["hover", "focus"],
|
|
67
|
-
skew: ["hover", "focus"],
|
|
68
|
-
stroke: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
69
|
-
strokeWidth: ["hover", "focus"],
|
|
70
|
-
textColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
71
|
-
textDecoration: ["focus", "hover"],
|
|
72
|
-
textDecorationColor: ["focus", "hover", "not-hover", "not-focus", "not-disabled"],
|
|
73
|
-
textDecorationStyle: ["focus", "hover"],
|
|
74
|
-
textDecorationThickness: ["focus", "hover"],
|
|
75
|
-
textShadowBlur: ["hover", "focus"],
|
|
76
|
-
textShadowColor: ["hover", "focus", "not-hover", "not-focus", "not-disabled"],
|
|
77
|
-
textShadowOpacity: ["hover", "focus"],
|
|
78
|
-
textShadowX: ["hover", "focus"],
|
|
79
|
-
textShadowY: ["hover", "focus"],
|
|
80
|
-
touchAction: ["hover", "focus"],
|
|
81
|
-
mask: ["hover", "focus"],
|
|
82
|
-
transform3d: ["hover", "focus"],
|
|
83
|
-
translate: ["hover", "focus"],
|
|
84
|
-
zIndex: ["hover", "focus"]
|
|
85
|
-
};
|
|
86
|
-
var variants_default = variants;
|
|
87
|
-
|
|
88
32
|
// src/theme.js
|
|
89
33
|
var theme = {
|
|
90
34
|
accentColor: ({ theme: theme2 }) => ({
|
|
@@ -1432,7 +1376,6 @@ var vars_default = vars;
|
|
|
1432
1376
|
|
|
1433
1377
|
// src/config.js
|
|
1434
1378
|
var configOptions = {
|
|
1435
|
-
variants: variants_default,
|
|
1436
1379
|
theme: theme_default,
|
|
1437
1380
|
vars: vars_default
|
|
1438
1381
|
};
|
|
@@ -3339,8 +3282,8 @@ var PluginRegistry = class {
|
|
|
3339
3282
|
* Register multiple variants at once
|
|
3340
3283
|
* @param {Object} variants - Object mapping names to handlers
|
|
3341
3284
|
*/
|
|
3342
|
-
addVariants(
|
|
3343
|
-
Object.entries(
|
|
3285
|
+
addVariants(variants) {
|
|
3286
|
+
Object.entries(variants).forEach(([name, handler]) => {
|
|
3344
3287
|
this.addVariant(name, handler);
|
|
3345
3288
|
});
|
|
3346
3289
|
}
|
|
@@ -3621,9 +3564,75 @@ function compileBaseToken(baseToken, theme2, pluginRegistry) {
|
|
|
3621
3564
|
}
|
|
3622
3565
|
return checkAllBuilders(baseToken, theme2);
|
|
3623
3566
|
}
|
|
3624
|
-
|
|
3567
|
+
var VARIANT_MAP = /* @__PURE__ */ new Map([
|
|
3568
|
+
// Dark mode
|
|
3569
|
+
["dark", (s) => `.dark ${s}`],
|
|
3570
|
+
// Pseudo-classes – interactive
|
|
3571
|
+
["hover", (s) => `${s}:hover`],
|
|
3572
|
+
["focus", (s) => `${s}:focus`],
|
|
3573
|
+
["focus-visible", (s) => `${s}:focus-visible`],
|
|
3574
|
+
["focus-within", (s) => `${s}:focus-within`],
|
|
3575
|
+
["active", (s) => `${s}:active`],
|
|
3576
|
+
["visited", (s) => `${s}:visited`],
|
|
3577
|
+
["disabled", (s) => `${s}:disabled`],
|
|
3578
|
+
["checked", (s) => `${s}:checked`],
|
|
3579
|
+
["indeterminate", (s) => `${s}:indeterminate`],
|
|
3580
|
+
["required", (s) => `${s}:required`],
|
|
3581
|
+
["valid", (s) => `${s}:valid`],
|
|
3582
|
+
["invalid", (s) => `${s}:invalid`],
|
|
3583
|
+
["target", (s) => `${s}:target`],
|
|
3584
|
+
["enabled", (s) => `${s}:enabled`],
|
|
3585
|
+
["default", (s) => `${s}:default`],
|
|
3586
|
+
["optional", (s) => `${s}:optional`],
|
|
3587
|
+
["user-valid", (s) => `${s}:user-valid`],
|
|
3588
|
+
["user-invalid", (s) => `${s}:user-invalid`],
|
|
3589
|
+
["in-range", (s) => `${s}:in-range`],
|
|
3590
|
+
["out-of-range", (s) => `${s}:out-of-range`],
|
|
3591
|
+
["placeholder-shown", (s) => `${s}:placeholder-shown`],
|
|
3592
|
+
["autofill", (s) => `${s}:autofill`],
|
|
3593
|
+
["details-content", (s) => `${s}:details-content`],
|
|
3594
|
+
["read-only", (s) => `${s}:read-only`],
|
|
3595
|
+
["open", (s) => `${s}[open]`],
|
|
3596
|
+
// Pseudo-elements
|
|
3597
|
+
["placeholder", (s) => `${s}::placeholder`],
|
|
3598
|
+
["backdrop", (s) => `${s}::backdrop`],
|
|
3599
|
+
["before", (s) => `${s}::before`],
|
|
3600
|
+
["after", (s) => `${s}::after`],
|
|
3601
|
+
["first-letter", (s) => `${s}::first-letter`],
|
|
3602
|
+
["first-line", (s) => `${s}::first-line`],
|
|
3603
|
+
["marker", (s) => `${s}::marker`],
|
|
3604
|
+
["selection", (s) => `${s}::selection`],
|
|
3605
|
+
["file", (s) => `${s}::file-selector-button`],
|
|
3606
|
+
// Structural pseudo-classes
|
|
3607
|
+
["first", (s) => `${s}:first-child`],
|
|
3608
|
+
["last", (s) => `${s}:last-child`],
|
|
3609
|
+
["odd", (s) => `${s}:nth-child(odd)`],
|
|
3610
|
+
["even", (s) => `${s}:nth-child(even)`],
|
|
3611
|
+
["first-of-type", (s) => `${s}:first-of-type`],
|
|
3612
|
+
["last-of-type", (s) => `${s}:last-of-type`],
|
|
3613
|
+
["only", (s) => `${s}:only-child`],
|
|
3614
|
+
["only-of-type", (s) => `${s}:only-of-type`],
|
|
3615
|
+
["empty", (s) => `${s}:empty`],
|
|
3616
|
+
// Group & peer variants
|
|
3617
|
+
["group-hover", (s) => `.group:hover ${s}`],
|
|
3618
|
+
["group-focus", (s) => `.group:focus ${s}`],
|
|
3619
|
+
["group-active", (s) => `.group:active ${s}`],
|
|
3620
|
+
["peer-hover", (s) => `.peer:hover ~ ${s}`],
|
|
3621
|
+
["peer-focus", (s) => `.peer:focus ~ ${s}`],
|
|
3622
|
+
["peer-checked", (s) => `.peer:checked ~ ${s}`],
|
|
3623
|
+
["peer-disabled", (s) => `.peer:disabled ~ ${s}`],
|
|
3624
|
+
// Negation variants
|
|
3625
|
+
["not-hover", (s) => `${s}:not(:hover)`],
|
|
3626
|
+
["not-focus", (s) => `${s}:not(:focus)`],
|
|
3627
|
+
["not-disabled", (s) => `${s}:not(:disabled)`],
|
|
3628
|
+
["not-checked", (s) => `${s}:not(:checked)`],
|
|
3629
|
+
// In-* variants (group-based)
|
|
3630
|
+
["in-hover", (s) => `.group:hover ${s}`],
|
|
3631
|
+
["in-focus", (s) => `.group:focus ${s}`]
|
|
3632
|
+
]);
|
|
3633
|
+
function applyVariants(selector, variants, pluginRegistry) {
|
|
3625
3634
|
let currentSelector = selector;
|
|
3626
|
-
for (const variant of
|
|
3635
|
+
for (const variant of variants) {
|
|
3627
3636
|
if (pluginRegistry) {
|
|
3628
3637
|
const customHandler = pluginRegistry.matchVariant(variant);
|
|
3629
3638
|
if (customHandler) {
|
|
@@ -3638,180 +3647,11 @@ function applyVariants(selector, variants2, pluginRegistry) {
|
|
|
3638
3647
|
}
|
|
3639
3648
|
}
|
|
3640
3649
|
}
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
currentSelector = `${currentSelector}:hover`;
|
|
3647
|
-
break;
|
|
3648
|
-
case "focus":
|
|
3649
|
-
currentSelector = `${currentSelector}:focus`;
|
|
3650
|
-
break;
|
|
3651
|
-
case "focus-visible":
|
|
3652
|
-
currentSelector = `${currentSelector}:focus-visible`;
|
|
3653
|
-
break;
|
|
3654
|
-
case "focus-within":
|
|
3655
|
-
currentSelector = `${currentSelector}:focus-within`;
|
|
3656
|
-
break;
|
|
3657
|
-
case "active":
|
|
3658
|
-
currentSelector = `${currentSelector}:active`;
|
|
3659
|
-
break;
|
|
3660
|
-
case "visited":
|
|
3661
|
-
currentSelector = `${currentSelector}:visited`;
|
|
3662
|
-
break;
|
|
3663
|
-
case "disabled":
|
|
3664
|
-
currentSelector = `${currentSelector}:disabled`;
|
|
3665
|
-
break;
|
|
3666
|
-
case "checked":
|
|
3667
|
-
currentSelector = `${currentSelector}:checked`;
|
|
3668
|
-
break;
|
|
3669
|
-
case "indeterminate":
|
|
3670
|
-
currentSelector = `${currentSelector}:indeterminate`;
|
|
3671
|
-
break;
|
|
3672
|
-
case "required":
|
|
3673
|
-
currentSelector = `${currentSelector}:required`;
|
|
3674
|
-
break;
|
|
3675
|
-
case "valid":
|
|
3676
|
-
currentSelector = `${currentSelector}:valid`;
|
|
3677
|
-
break;
|
|
3678
|
-
case "invalid":
|
|
3679
|
-
currentSelector = `${currentSelector}:invalid`;
|
|
3680
|
-
break;
|
|
3681
|
-
case "target":
|
|
3682
|
-
currentSelector = `${currentSelector}:target`;
|
|
3683
|
-
break;
|
|
3684
|
-
case "enabled":
|
|
3685
|
-
currentSelector = `${currentSelector}:enabled`;
|
|
3686
|
-
break;
|
|
3687
|
-
case "default":
|
|
3688
|
-
currentSelector = `${currentSelector}:default`;
|
|
3689
|
-
break;
|
|
3690
|
-
case "optional":
|
|
3691
|
-
currentSelector = `${currentSelector}:optional`;
|
|
3692
|
-
break;
|
|
3693
|
-
case "user-valid":
|
|
3694
|
-
currentSelector = `${currentSelector}:user-valid`;
|
|
3695
|
-
break;
|
|
3696
|
-
case "user-invalid":
|
|
3697
|
-
currentSelector = `${currentSelector}:user-invalid`;
|
|
3698
|
-
break;
|
|
3699
|
-
case "in-range":
|
|
3700
|
-
currentSelector = `${currentSelector}:in-range`;
|
|
3701
|
-
break;
|
|
3702
|
-
case "out-of-range":
|
|
3703
|
-
currentSelector = `${currentSelector}:out-of-range`;
|
|
3704
|
-
break;
|
|
3705
|
-
case "placeholder-shown":
|
|
3706
|
-
currentSelector = `${currentSelector}:placeholder-shown`;
|
|
3707
|
-
break;
|
|
3708
|
-
case "autofill":
|
|
3709
|
-
currentSelector = `${currentSelector}:autofill`;
|
|
3710
|
-
break;
|
|
3711
|
-
case "details-content":
|
|
3712
|
-
currentSelector = `${currentSelector}:details-content`;
|
|
3713
|
-
break;
|
|
3714
|
-
case "placeholder":
|
|
3715
|
-
currentSelector = `${currentSelector}::placeholder`;
|
|
3716
|
-
break;
|
|
3717
|
-
case "backdrop":
|
|
3718
|
-
currentSelector = `${currentSelector}::backdrop`;
|
|
3719
|
-
break;
|
|
3720
|
-
case "before":
|
|
3721
|
-
currentSelector = `${currentSelector}::before`;
|
|
3722
|
-
break;
|
|
3723
|
-
case "after":
|
|
3724
|
-
currentSelector = `${currentSelector}::after`;
|
|
3725
|
-
break;
|
|
3726
|
-
case "first-letter":
|
|
3727
|
-
currentSelector = `${currentSelector}::first-letter`;
|
|
3728
|
-
break;
|
|
3729
|
-
case "first-line":
|
|
3730
|
-
currentSelector = `${currentSelector}::first-line`;
|
|
3731
|
-
break;
|
|
3732
|
-
case "marker":
|
|
3733
|
-
currentSelector = `${currentSelector}::marker`;
|
|
3734
|
-
break;
|
|
3735
|
-
case "selection":
|
|
3736
|
-
currentSelector = `${currentSelector}::selection`;
|
|
3737
|
-
break;
|
|
3738
|
-
case "file":
|
|
3739
|
-
currentSelector = `${currentSelector}::file-selector-button`;
|
|
3740
|
-
break;
|
|
3741
|
-
case "first":
|
|
3742
|
-
currentSelector = `${currentSelector}:first-child`;
|
|
3743
|
-
break;
|
|
3744
|
-
case "last":
|
|
3745
|
-
currentSelector = `${currentSelector}:last-child`;
|
|
3746
|
-
break;
|
|
3747
|
-
case "odd":
|
|
3748
|
-
currentSelector = `${currentSelector}:nth-child(odd)`;
|
|
3749
|
-
break;
|
|
3750
|
-
case "even":
|
|
3751
|
-
currentSelector = `${currentSelector}:nth-child(even)`;
|
|
3752
|
-
break;
|
|
3753
|
-
case "first-of-type":
|
|
3754
|
-
currentSelector = `${currentSelector}:first-of-type`;
|
|
3755
|
-
break;
|
|
3756
|
-
case "last-of-type":
|
|
3757
|
-
currentSelector = `${currentSelector}:last-of-type`;
|
|
3758
|
-
break;
|
|
3759
|
-
case "only":
|
|
3760
|
-
currentSelector = `${currentSelector}:only-child`;
|
|
3761
|
-
break;
|
|
3762
|
-
case "only-of-type":
|
|
3763
|
-
currentSelector = `${currentSelector}:only-of-type`;
|
|
3764
|
-
break;
|
|
3765
|
-
case "empty":
|
|
3766
|
-
currentSelector = `${currentSelector}:empty`;
|
|
3767
|
-
break;
|
|
3768
|
-
case "read-only":
|
|
3769
|
-
currentSelector = `${currentSelector}:read-only`;
|
|
3770
|
-
break;
|
|
3771
|
-
case "open":
|
|
3772
|
-
currentSelector = `${currentSelector}[open]`;
|
|
3773
|
-
break;
|
|
3774
|
-
case "group-hover":
|
|
3775
|
-
currentSelector = `.group:hover ${currentSelector}`;
|
|
3776
|
-
break;
|
|
3777
|
-
case "group-focus":
|
|
3778
|
-
currentSelector = `.group:focus ${currentSelector}`;
|
|
3779
|
-
break;
|
|
3780
|
-
case "group-active":
|
|
3781
|
-
currentSelector = `.group:active ${currentSelector}`;
|
|
3782
|
-
break;
|
|
3783
|
-
case "peer-hover":
|
|
3784
|
-
currentSelector = `.peer:hover ~ ${currentSelector}`;
|
|
3785
|
-
break;
|
|
3786
|
-
case "peer-focus":
|
|
3787
|
-
currentSelector = `.peer:focus ~ ${currentSelector}`;
|
|
3788
|
-
break;
|
|
3789
|
-
case "peer-checked":
|
|
3790
|
-
currentSelector = `.peer:checked ~ ${currentSelector}`;
|
|
3791
|
-
break;
|
|
3792
|
-
case "peer-disabled":
|
|
3793
|
-
currentSelector = `.peer:disabled ~ ${currentSelector}`;
|
|
3794
|
-
break;
|
|
3795
|
-
case "not-hover":
|
|
3796
|
-
currentSelector = `${currentSelector}:not(:hover)`;
|
|
3797
|
-
break;
|
|
3798
|
-
case "not-focus":
|
|
3799
|
-
currentSelector = `${currentSelector}:not(:focus)`;
|
|
3800
|
-
break;
|
|
3801
|
-
case "not-disabled":
|
|
3802
|
-
currentSelector = `${currentSelector}:not(:disabled)`;
|
|
3803
|
-
break;
|
|
3804
|
-
case "not-checked":
|
|
3805
|
-
currentSelector = `${currentSelector}:not(:checked)`;
|
|
3806
|
-
break;
|
|
3807
|
-
case "in-hover":
|
|
3808
|
-
currentSelector = `.group:hover ${currentSelector}`;
|
|
3809
|
-
break;
|
|
3810
|
-
case "in-focus":
|
|
3811
|
-
currentSelector = `.group:focus ${currentSelector}`;
|
|
3812
|
-
break;
|
|
3813
|
-
default:
|
|
3814
|
-
return void 0;
|
|
3650
|
+
const builtinHandler = VARIANT_MAP.get(variant);
|
|
3651
|
+
if (builtinHandler) {
|
|
3652
|
+
currentSelector = builtinHandler(currentSelector);
|
|
3653
|
+
} else {
|
|
3654
|
+
return void 0;
|
|
3815
3655
|
}
|
|
3816
3656
|
}
|
|
3817
3657
|
return currentSelector;
|
|
@@ -3827,7 +3667,7 @@ function resolveRuntimeContext(options = {}) {
|
|
|
3827
3667
|
addUtility: (pattern, handler) => pluginRegistry.addUtility(pattern, handler),
|
|
3828
3668
|
addUtilities: (utilities) => pluginRegistry.addUtilities(utilities),
|
|
3829
3669
|
addVariant: (name, handler) => pluginRegistry.addVariant(name, handler),
|
|
3830
|
-
addVariants: (
|
|
3670
|
+
addVariants: (variants) => pluginRegistry.addVariants(variants),
|
|
3831
3671
|
theme: (key) => {
|
|
3832
3672
|
if (!key) return config.theme || {};
|
|
3833
3673
|
const keys = key.split(".");
|
|
@@ -3880,7 +3720,7 @@ function parseClass(className, screens = {}, containers = {}) {
|
|
|
3880
3720
|
const parts = splitByVariantDelimiter(normalized);
|
|
3881
3721
|
if (parts.length === 0) return null;
|
|
3882
3722
|
const baseToken = parts[parts.length - 1];
|
|
3883
|
-
const
|
|
3723
|
+
const variants = [];
|
|
3884
3724
|
let breakpoint = null;
|
|
3885
3725
|
let containerBreakpoint = null;
|
|
3886
3726
|
let starting = false;
|
|
@@ -3901,9 +3741,9 @@ function parseClass(className, screens = {}, containers = {}) {
|
|
|
3901
3741
|
breakpoint = part;
|
|
3902
3742
|
continue;
|
|
3903
3743
|
}
|
|
3904
|
-
|
|
3744
|
+
variants.push(part);
|
|
3905
3745
|
}
|
|
3906
|
-
const result = { original: token, baseToken, variants
|
|
3746
|
+
const result = { original: token, baseToken, variants, breakpoint, containerBreakpoint, important, starting };
|
|
3907
3747
|
if (parseCache.size >= PARSE_CACHE_MAX_SIZE) {
|
|
3908
3748
|
const firstKey = parseCache.keys().next().value;
|
|
3909
3749
|
parseCache.delete(firstKey);
|
|
@@ -4012,6 +3852,9 @@ function createWindrunner(options = {}) {
|
|
|
4012
3852
|
const preflight2 = options.preflight !== false;
|
|
4013
3853
|
const compatMode = options.compatMode || "none";
|
|
4014
3854
|
const compatStyleId = options.compatStyleId || `${styleId}-full`;
|
|
3855
|
+
const maxCacheSize = options.maxCacheSize || 1e4;
|
|
3856
|
+
const onError = typeof options.onError === "function" ? options.onError : null;
|
|
3857
|
+
const onCompile = typeof options.onCompile === "function" ? options.onCompile : null;
|
|
4015
3858
|
const tailwindOptions = getBaseTailwindOptions(options);
|
|
4016
3859
|
const context = resolveRuntimeContext(tailwindOptions);
|
|
4017
3860
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -4057,6 +3900,10 @@ function createWindrunner(options = {}) {
|
|
|
4057
3900
|
const compileWithCache = (className) => {
|
|
4058
3901
|
if (cache.has(className)) return cache.get(className);
|
|
4059
3902
|
const cssRule = compileRuntimeClassNameWithContext(className, context);
|
|
3903
|
+
if (cache.size >= maxCacheSize) {
|
|
3904
|
+
const firstKey = cache.keys().next().value;
|
|
3905
|
+
cache.delete(firstKey);
|
|
3906
|
+
}
|
|
4060
3907
|
cache.set(className, cssRule);
|
|
4061
3908
|
return cssRule;
|
|
4062
3909
|
};
|
|
@@ -4079,8 +3926,10 @@ function createWindrunner(options = {}) {
|
|
|
4079
3926
|
const cssRule = compileWithCache(className);
|
|
4080
3927
|
if (!cssRule) {
|
|
4081
3928
|
ensureCompatStyle();
|
|
3929
|
+
if (onError) onError(className);
|
|
4082
3930
|
} else {
|
|
4083
3931
|
insertRule(cssRule);
|
|
3932
|
+
if (onCompile) onCompile(className, cssRule);
|
|
4084
3933
|
}
|
|
4085
3934
|
return cssRule;
|
|
4086
3935
|
};
|
|
@@ -4183,6 +4032,16 @@ function createWindrunner(options = {}) {
|
|
|
4183
4032
|
}
|
|
4184
4033
|
runStart();
|
|
4185
4034
|
};
|
|
4035
|
+
const clearCache = () => {
|
|
4036
|
+
cache.clear();
|
|
4037
|
+
};
|
|
4038
|
+
const getStats = () => ({
|
|
4039
|
+
cacheSize: cache.size,
|
|
4040
|
+
insertedRuleCount: insertedRules.size,
|
|
4041
|
+
pendingElementCount: pendingElements.size,
|
|
4042
|
+
isObserving: observer !== null,
|
|
4043
|
+
isCompatLoaded: compatLoaded
|
|
4044
|
+
});
|
|
4186
4045
|
return {
|
|
4187
4046
|
processClassName,
|
|
4188
4047
|
processClassList,
|
|
@@ -4192,6 +4051,8 @@ function createWindrunner(options = {}) {
|
|
|
4192
4051
|
flush,
|
|
4193
4052
|
start,
|
|
4194
4053
|
disconnect,
|
|
4054
|
+
clearCache,
|
|
4055
|
+
getStats,
|
|
4195
4056
|
isCompatLoaded: () => compatLoaded,
|
|
4196
4057
|
getCacheSize: () => cache.size,
|
|
4197
4058
|
getInsertedRuleCount: () => insertedRules.size
|