@tamagui/core 1.118.2 → 1.118.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.
@@ -1392,7 +1392,7 @@ var require_constants_native = __commonJS({
1392
1392
  }
1393
1393
  });
1394
1394
  module2.exports = __toCommonJS2(constants_native_exports);
1395
- var import_react3 = __toESM2(require("react")), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.default.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = !1, isIos = !1, currentPlatform = "native";
1395
+ var import_react3 = __toESM2(require("react")), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.default.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = !1, isIos = process.env.TEST_NATIVE_PLATFORM === "ios", currentPlatform = "native";
1396
1396
  }
1397
1397
  });
1398
1398
 
@@ -3532,7 +3532,7 @@ var require_useTheme_native = __commonJS({
3532
3532
  if (subkey === "val") globalThis.tamaguiAvoidTracking || track(keyString);
3533
3533
  else if (subkey === "get") return function(platform) {
3534
3534
  var outVal = (0, import_createVariable.getVariable)(val);
3535
- if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !hasFixedSchemeParent(themeManager) && scheme) {
3535
+ if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !shouldDeoptDueToParentScheme(themeManager) && scheme) {
3536
3536
  var _config_themes_name, _config_themes_oppositeName, oppositeName = name.replace(scheme === "dark" ? "dark" : "light", scheme === "dark" ? "light" : "dark"), colorLight = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[keyString]), colorDark = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[keyString]), dynamicVal = {
3537
3537
  dynamic: {
3538
3538
  light: colorLight,
@@ -3551,10 +3551,26 @@ var require_useTheme_native = __commonJS({
3551
3551
  }
3552
3552
  });
3553
3553
  }
3554
- function hasFixedSchemeParent(manager) {
3555
- return manager == null ? void 0 : manager.getParents().slice(1).some(function(x) {
3556
- return x.state.isSchemeFixed;
3557
- });
3554
+ function shouldDeoptDueToParentScheme(manager) {
3555
+ var _parents_, parents = ((manager == null ? void 0 : manager.getParents()) || []).reverse(), rootScheme = (_parents_ = parents[0]) === null || _parents_ === void 0 ? void 0 : _parents_.state.scheme;
3556
+ if (!rootScheme) return !0;
3557
+ var lastParentScheme = rootScheme, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3558
+ try {
3559
+ for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
3560
+ var parent = _step.value;
3561
+ if (parent.state.scheme !== lastParentScheme) return !0;
3562
+ lastParentScheme = parent.state.scheme;
3563
+ }
3564
+ } catch (err) {
3565
+ _didIteratorError = !0, _iteratorError = err;
3566
+ } finally {
3567
+ try {
3568
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3569
+ } finally {
3570
+ if (_didIteratorError) throw _iteratorError;
3571
+ }
3572
+ }
3573
+ return !1;
3558
3574
  }
3559
3575
  var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
3560
3576
  return _idToUID[id];