tamagui 1.114.2 → 1.114.3

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 CHANGED
@@ -3845,7 +3845,9 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3845
3845
  if (subkey === "val") globalThis.tamaguiAvoidTracking || (process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" \u{1F3A8} useTheme() tracking new key because of .val access", new Error().stack), track(keyString));
3846
3846
  else if (subkey === "get") return function(platform2) {
3847
3847
  var outVal = (0, import_createVariable.getVariable)(val);
3848
- if (platform2 !== "web" && import_constants4.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !someParentIsInversed(themeManager) && scheme) {
3848
+ if (platform2 !== "web" && import_constants4.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && scheme) {
3849
+ var isInversed = getIsInversed(themeManager);
3850
+ isInversed && (scheme = scheme === "dark" ? "light" : "dark");
3849
3851
  var oppositeThemeName = name.replace(scheme === "dark" ? "dark" : "light", scheme === "dark" ? "light" : "dark"), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
3850
3852
  if (oppositeVal) {
3851
3853
  var dynamicVal = {
@@ -3857,17 +3859,13 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3857
3859
  return dynamicVal;
3858
3860
  }
3859
3861
  }
3860
- if (process.env.NODE_ENV === "development" && debug && (console.info(` \u{1F3A8} useTheme() tracking new key because of:
3862
+ return process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
3861
3863
  not web: ${platform2 !== "web"}
3862
3864
  isIOS: ${import_constants4.isIos}
3863
3865
  deopt: ${deopt}
3864
3866
  fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
3865
- parent inversed: ${someParentIsInversed(themeManager)}
3866
- `), someParentIsInversed(themeManager))) {
3867
- var _themeManager_parentManager;
3868
- console.info(` some parent is inversed: ${themeManager == null ? void 0 : themeManager.state.name} => ${themeManager == null || (_themeManager_parentManager = themeManager.parentManager) === null || _themeManager_parentManager === void 0 ? void 0 : _themeManager_parentManager.state.name}`);
3869
- }
3870
- return track(keyString), outVal;
3867
+ inversed: ${getIsInversed(themeManager)}
3868
+ `), track(keyString), outVal;
3871
3869
  };
3872
3870
  return Reflect.get(val, subkey);
3873
3871
  }
@@ -3879,22 +3877,10 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3879
3877
  }
3880
3878
  });
3881
3879
  }
3882
- function someParentIsInversed(manager) {
3883
- for (var cur = manager; cur; ) {
3880
+ function getIsInversed(manager) {
3881
+ for (var isInversed = !1, cur = manager; cur; ) {
3884
3882
  if (!cur.parentManager) return !1;
3885
- 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.
3886
-
3887
- This means you've accessed a theme value without .get() in a child of an inversed theme.
3888
-
3889
- This isn't necessarily a bug, but can often be due to a mistaken inverse (for example,
3890
- you may have a Theme inside your TamaguiProvider with mis-matched theme values for light/dark).
3891
-
3892
- For this reason we've added this warning. If this is intentional, you can disable it with:
3893
-
3894
- process.env.TAMAGUI_DISABLE_INVERSE_THEME_WARNING === 1
3895
- or globalThis.TAMAGUI_DITW = true
3896
- `), !0;
3897
- cur = cur.parentManager;
3883
+ cur.parentManager.state.scheme !== cur.state.scheme && (isInversed = !isInversed), cur = cur.parentManager;
3898
3884
  }
3899
3885
  return !1;
3900
3886
  }