@kbach/react 0.5.59 → 0.5.60
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.
|
@@ -90,7 +90,12 @@ var _lastFontVersion = -1;
|
|
|
90
90
|
function _invalidateDefaultFontCache() {
|
|
91
91
|
_defaultFontVersion++;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
{
|
|
94
|
+
const _KEY = "__kbach_font_cache_unsub__";
|
|
95
|
+
const g = globalThis;
|
|
96
|
+
if (g[_KEY]) g[_KEY]();
|
|
97
|
+
g[_KEY] = onConfigChange(_invalidateDefaultFontCache);
|
|
98
|
+
}
|
|
94
99
|
function getCachedDefaultFont() {
|
|
95
100
|
if (_lastFontVersion !== _defaultFontVersion) {
|
|
96
101
|
_cachedDefaultFont = getDefaultFontFamily();
|
package/dist/index.js
CHANGED
|
@@ -3400,8 +3400,14 @@ function ThemeProvider({
|
|
|
3400
3400
|
}, [configOverride]);
|
|
3401
3401
|
(0, import_react3.useEffect)(() => {
|
|
3402
3402
|
if (configOverride) return;
|
|
3403
|
-
|
|
3404
|
-
|
|
3403
|
+
let mounted = true;
|
|
3404
|
+
const unsub = onConfigChange((config) => {
|
|
3405
|
+
if (mounted) setResolvedConfig(config);
|
|
3406
|
+
});
|
|
3407
|
+
return () => {
|
|
3408
|
+
mounted = false;
|
|
3409
|
+
unsub();
|
|
3410
|
+
};
|
|
3405
3411
|
}, [configOverride]);
|
|
3406
3412
|
const contextValue = (0, import_react3.useMemo)(
|
|
3407
3413
|
() => ({ mode, resolvedMode, isDark, setMode, toggle, config: resolvedConfig }),
|
package/dist/index.mjs
CHANGED
|
@@ -254,8 +254,14 @@ function ThemeProvider({
|
|
|
254
254
|
}, [configOverride]);
|
|
255
255
|
useEffect(() => {
|
|
256
256
|
if (configOverride) return;
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
let mounted = true;
|
|
258
|
+
const unsub = onConfigChange((config) => {
|
|
259
|
+
if (mounted) setResolvedConfig(config);
|
|
260
|
+
});
|
|
261
|
+
return () => {
|
|
262
|
+
mounted = false;
|
|
263
|
+
unsub();
|
|
264
|
+
};
|
|
259
265
|
}, [configOverride]);
|
|
260
266
|
const contextValue = useMemo2(
|
|
261
267
|
() => ({ mode, resolvedMode, isDark, setMode, toggle, config: resolvedConfig }),
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -3631,7 +3631,12 @@ var _lastFontVersion = -1;
|
|
|
3631
3631
|
function _invalidateDefaultFontCache() {
|
|
3632
3632
|
_defaultFontVersion++;
|
|
3633
3633
|
}
|
|
3634
|
-
|
|
3634
|
+
{
|
|
3635
|
+
const _KEY = "__kbach_font_cache_unsub__";
|
|
3636
|
+
const g = globalThis;
|
|
3637
|
+
if (g[_KEY]) g[_KEY]();
|
|
3638
|
+
g[_KEY] = onConfigChange(_invalidateDefaultFontCache);
|
|
3639
|
+
}
|
|
3635
3640
|
function getCachedDefaultFont() {
|
|
3636
3641
|
if (_lastFontVersion !== _defaultFontVersion) {
|
|
3637
3642
|
_cachedDefaultFont = getDefaultFontFamily();
|
package/dist/jsx-dev-runtime.mjs
CHANGED
package/dist/jsx-runtime.js
CHANGED
|
@@ -3637,7 +3637,12 @@ var _lastFontVersion = -1;
|
|
|
3637
3637
|
function _invalidateDefaultFontCache() {
|
|
3638
3638
|
_defaultFontVersion++;
|
|
3639
3639
|
}
|
|
3640
|
-
|
|
3640
|
+
{
|
|
3641
|
+
const _KEY = "__kbach_font_cache_unsub__";
|
|
3642
|
+
const g = globalThis;
|
|
3643
|
+
if (g[_KEY]) g[_KEY]();
|
|
3644
|
+
g[_KEY] = onConfigChange(_invalidateDefaultFontCache);
|
|
3645
|
+
}
|
|
3641
3646
|
function getCachedDefaultFont() {
|
|
3642
3647
|
if (_lastFontVersion !== _defaultFontVersion) {
|
|
3643
3648
|
_cachedDefaultFont = getDefaultFontFamily();
|
package/dist/jsx-runtime.mjs
CHANGED