@tamagui/core 1.112.24 → 1.112.25-1728362181133
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/native.js +25 -10
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +13 -9
- package/dist/test.native.js.map +2 -2
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -3732,7 +3732,18 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3732
3732
|
function someParentIsInversed(manager) {
|
|
3733
3733
|
for (var cur = manager; cur; ) {
|
|
3734
3734
|
if (!cur.parentManager) return !1;
|
|
3735
|
-
if (cur.parentManager.state.scheme !== cur.state.scheme) return !
|
|
3735
|
+
if (cur.parentManager.state.scheme !== cur.state.scheme) return process.env.NODE_ENV === "development" && !globalThis.TAMAGUI_DITW && !process.env.TAMAGUI_DISABLE_INVERSE_THEME_WARNING && console.info(` \u203C\uFE0F De-opted a theme value access due to an inversed parent.
|
|
3736
|
+
|
|
3737
|
+
This means you've accessed a theme value without .get() in a child of an inversed theme.
|
|
3738
|
+
|
|
3739
|
+
This isn't necessarily a bug, but can often be due to a mistaken inverse (for example,
|
|
3740
|
+
you may have a Theme inside your TamaguiProvider with mis-matched theme values for light/dark).
|
|
3741
|
+
|
|
3742
|
+
For this reason we've added this warning. If this is intentional, you can disable it with:
|
|
3743
|
+
|
|
3744
|
+
process.env.TAMAGUI_DISABLE_INVERSE_THEME_WARNING === 1
|
|
3745
|
+
or globalThis.TAMAGUI_DITW = true
|
|
3746
|
+
`), !0;
|
|
3736
3747
|
cur = cur.parentManager;
|
|
3737
3748
|
}
|
|
3738
3749
|
return !1;
|
|
@@ -3764,10 +3775,14 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3764
3775
|
function getShouldUpdateTheme() {
|
|
3765
3776
|
var manager = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : themeManager, nextState = arguments.length > 1 ? arguments[1] : void 0, prevState2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : state, forceShouldChange = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, forceUpdate = shouldUpdate == null ? void 0 : shouldUpdate();
|
|
3766
3777
|
if (!(!manager || !forceShouldChange && forceUpdate === !1)) {
|
|
3767
|
-
var
|
|
3768
|
-
if (forceShouldChange ||
|
|
3778
|
+
var next2 = nextState || manager.getState(props, parentManager);
|
|
3779
|
+
if (forceShouldChange || next2 && !(forceUpdate !== !0 && !manager.getStateShouldChange(next2, prevState2))) return next2;
|
|
3769
3780
|
}
|
|
3770
3781
|
}
|
|
3782
|
+
if (!import_constants2.isWeb && themeManager && getShouldUpdateTheme(themeManager)) {
|
|
3783
|
+
var _next_state, _themeState_state, next = createState(themeState);
|
|
3784
|
+
((_next_state = next.state) === null || _next_state === void 0 ? void 0 : _next_state.name) !== ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) && (setThemeState(next), themeManager.notify());
|
|
3785
|
+
}
|
|
3771
3786
|
if (import_constants2.isServer || (import_react3.default.useLayoutEffect(function() {
|
|
3772
3787
|
themeManager && state && prevState && state !== prevState && themeManager.notify();
|
|
3773
3788
|
}, [
|
|
@@ -3786,8 +3801,8 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3786
3801
|
(isNewTheme || getShouldUpdateTheme(themeManager)) && (activeThemeManagers.add(themeManager), setThemeState(createState));
|
|
3787
3802
|
var selfListenerDispose = themeManager.onChangeTheme(function(_a, _b, forced) {
|
|
3788
3803
|
forced && setThemeState(function(prev) {
|
|
3789
|
-
var
|
|
3790
|
-
return
|
|
3804
|
+
var next2 = createState(prev, forced !== "self");
|
|
3805
|
+
return next2;
|
|
3791
3806
|
});
|
|
3792
3807
|
}, !0), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(function(name, manager, forced) {
|
|
3793
3808
|
var force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
|
|
@@ -3848,8 +3863,8 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3848
3863
|
};
|
|
3849
3864
|
if (prev != null && prev.themeManager) {
|
|
3850
3865
|
themeManager2 = prev.themeManager;
|
|
3851
|
-
var forceChange = force
|
|
3852
|
-
nextState ? (state2 = nextState, !prev.isNewTheme && !isRoot ? themeManager2 = getNewThemeManager() : themeManager2.updateState(nextState)) : prev.isNewTheme && parentManager && !
|
|
3866
|
+
var forceChange = force, next2 = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(themeManager2, next2, prev.state, forceChange);
|
|
3867
|
+
nextState ? (state2 = nextState, !prev.isNewTheme && !isRoot ? themeManager2 = getNewThemeManager() : themeManager2.updateState(nextState)) : prev.isNewTheme && parentManager && !next2 && (themeManager2 = parentManager);
|
|
3853
3868
|
} else themeManager2 = getNewThemeManager(), state2 = {
|
|
3854
3869
|
...themeManager2.state
|
|
3855
3870
|
};
|
|
@@ -10859,9 +10874,9 @@ var require_useProps_native = __commonJS({
|
|
|
10859
10874
|
componentName: staticConfig.componentName,
|
|
10860
10875
|
name: "theme" in props ? props.theme : void 0,
|
|
10861
10876
|
inverse: "themeInverse" in props ? props.themeInverse : void 0
|
|
10862
|
-
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()),
|
|
10877
|
+
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaState2 = (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, {
|
|
10863
10878
|
isAnimated: !1,
|
|
10864
|
-
mediaState:
|
|
10879
|
+
mediaState: mediaState2,
|
|
10865
10880
|
noSkip: !0,
|
|
10866
10881
|
noMergeStyle: !0,
|
|
10867
10882
|
noClassNames: !0,
|
|
@@ -10897,7 +10912,7 @@ var require_useProps_native = __commonJS({
|
|
|
10897
10912
|
splitStyles.viewProps,
|
|
10898
10913
|
splitStyles.style || {},
|
|
10899
10914
|
theme,
|
|
10900
|
-
|
|
10915
|
+
mediaState2
|
|
10901
10916
|
];
|
|
10902
10917
|
}
|
|
10903
10918
|
}
|