@tamagui/core 1.114.2 → 1.114.4

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
@@ -3703,7 +3703,9 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3703
3703
  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));
3704
3704
  else if (subkey === "get") return function(platform) {
3705
3705
  var outVal = (0, import_createVariable.getVariable)(val);
3706
- if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !someParentIsInversed(themeManager) && scheme) {
3706
+ if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && scheme) {
3707
+ var isInversed = getIsInversed(themeManager);
3708
+ isInversed && (scheme = scheme === "dark" ? "light" : "dark");
3707
3709
  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]);
3708
3710
  if (oppositeVal) {
3709
3711
  var dynamicVal = {
@@ -3715,17 +3717,13 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3715
3717
  return dynamicVal;
3716
3718
  }
3717
3719
  }
3718
- if (process.env.NODE_ENV === "development" && debug && (console.info(` \u{1F3A8} useTheme() tracking new key because of:
3720
+ return process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
3719
3721
  not web: ${platform !== "web"}
3720
3722
  isIOS: ${import_constants2.isIos}
3721
3723
  deopt: ${deopt}
3722
3724
  fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
3723
- parent inversed: ${someParentIsInversed(themeManager)}
3724
- `), someParentIsInversed(themeManager))) {
3725
- var _themeManager_parentManager;
3726
- 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}`);
3727
- }
3728
- return track(keyString), outVal;
3725
+ inversed: ${getIsInversed(themeManager)}
3726
+ `), track(keyString), outVal;
3729
3727
  };
3730
3728
  return Reflect.get(val, subkey);
3731
3729
  }
@@ -3737,22 +3735,10 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3737
3735
  }
3738
3736
  });
3739
3737
  }
3740
- function someParentIsInversed(manager) {
3741
- for (var cur = manager; cur; ) {
3738
+ function getIsInversed(manager) {
3739
+ for (var isInversed = !1, cur = manager; cur; ) {
3742
3740
  if (!cur.parentManager) return !1;
3743
- 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.
3744
-
3745
- This means you've accessed a theme value without .get() in a child of an inversed theme.
3746
-
3747
- This isn't necessarily a bug, but can often be due to a mistaken inverse (for example,
3748
- you may have a Theme inside your TamaguiProvider with mis-matched theme values for light/dark).
3749
-
3750
- For this reason we've added this warning. If this is intentional, you can disable it with:
3751
-
3752
- process.env.TAMAGUI_DISABLE_INVERSE_THEME_WARNING === 1
3753
- or globalThis.TAMAGUI_DITW = true
3754
- `), !0;
3755
- cur = cur.parentManager;
3741
+ cur.parentManager.state.scheme !== cur.state.scheme && (isInversed = !isInversed), cur = cur.parentManager;
3756
3742
  }
3757
3743
  return !1;
3758
3744
  }