@tamagui/core 1.118.3 → 1.119.0

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
@@ -1396,7 +1396,7 @@ var require_constants_native = __commonJS({
1396
1396
  }
1397
1397
  });
1398
1398
  module2.exports = __toCommonJS2(constants_native_exports);
1399
- 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";
1399
+ 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";
1400
1400
  }
1401
1401
  });
1402
1402
 
@@ -3730,7 +3730,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3730
3730
  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));
3731
3731
  else if (subkey === "get") return function(platform) {
3732
3732
  var outVal = (0, import_createVariable.getVariable)(val);
3733
- if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !hasFixedSchemeParent(themeManager) && scheme) {
3733
+ if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !shouldDeoptDueToParentScheme(themeManager) && scheme) {
3734
3734
  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 = {
3735
3735
  dynamic: {
3736
3736
  light: colorLight,
@@ -3764,11 +3764,26 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3764
3764
  }
3765
3765
  return !1;
3766
3766
  }
3767
- function hasFixedSchemeParent(manager) {
3768
- var parents = (manager == null ? void 0 : manager.getParents()) || [];
3769
- return parents.slice(0, parents.length - 1).some(function(x) {
3770
- return x.state.isSchemeFixed;
3771
- });
3767
+ function shouldDeoptDueToParentScheme(manager) {
3768
+ var _parents_, parents = ((manager == null ? void 0 : manager.getParents()) || []).reverse(), rootScheme = (_parents_ = parents[0]) === null || _parents_ === void 0 ? void 0 : _parents_.state.scheme;
3769
+ if (!rootScheme) return !0;
3770
+ var lastParentScheme = rootScheme, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3771
+ try {
3772
+ for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
3773
+ var parent = _step.value;
3774
+ if (parent.state.scheme !== lastParentScheme) return !0;
3775
+ lastParentScheme = parent.state.scheme;
3776
+ }
3777
+ } catch (err) {
3778
+ _didIteratorError = !0, _iteratorError = err;
3779
+ } finally {
3780
+ try {
3781
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3782
+ } finally {
3783
+ if (_didIteratorError) throw _iteratorError;
3784
+ }
3785
+ }
3786
+ return !1;
3772
3787
  }
3773
3788
  var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
3774
3789
  return _idToUID[id];