@tamagui/core 1.120.0 → 1.120.2

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
@@ -3593,6 +3593,74 @@ var require_createShallowSetState_native = __commonJS({
3593
3593
  }
3594
3594
  });
3595
3595
 
3596
+ // ../web/dist/cjs/hooks/shouldDeoptDueToParentScheme.native.js
3597
+ var require_shouldDeoptDueToParentScheme_native = __commonJS({
3598
+ "../web/dist/cjs/hooks/shouldDeoptDueToParentScheme.native.js"(exports2, module2) {
3599
+ "use strict";
3600
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3601
+ for (var name in all) __defProp2(target, name, {
3602
+ get: all[name],
3603
+ enumerable: !0
3604
+ });
3605
+ }, __copyProps2 = function(to, from, except, desc) {
3606
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3607
+ if (from && typeof from == "object" || typeof from == "function") try {
3608
+ for (var _loop = function() {
3609
+ var key = _step.value;
3610
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3611
+ get: function() {
3612
+ return from[key];
3613
+ },
3614
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3615
+ });
3616
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3617
+ } catch (err) {
3618
+ _didIteratorError = !0, _iteratorError = err;
3619
+ } finally {
3620
+ try {
3621
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3622
+ } finally {
3623
+ if (_didIteratorError)
3624
+ throw _iteratorError;
3625
+ }
3626
+ }
3627
+ return to;
3628
+ }, __toCommonJS2 = function(mod) {
3629
+ return __copyProps2(__defProp2({}, "__esModule", {
3630
+ value: !0
3631
+ }), mod);
3632
+ }, shouldDeoptDueToParentScheme_native_exports = {};
3633
+ __export2(shouldDeoptDueToParentScheme_native_exports, {
3634
+ shouldDeoptDueToParentScheme: function() {
3635
+ return shouldDeoptDueToParentScheme;
3636
+ }
3637
+ });
3638
+ module2.exports = __toCommonJS2(shouldDeoptDueToParentScheme_native_exports);
3639
+ var import_react_native = require("react-native");
3640
+ function shouldDeoptDueToParentScheme(manager) {
3641
+ var _parents_, parents = ((manager == null ? void 0 : manager.getParents()) || []).reverse(), rootScheme = (_parents_ = parents[0]) === null || _parents_ === void 0 ? void 0 : _parents_.state.scheme;
3642
+ if (!rootScheme || import_react_native.Appearance.getColorScheme() !== rootScheme) return !0;
3643
+ var lastParentScheme = rootScheme, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3644
+ try {
3645
+ for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
3646
+ var parent = _step.value;
3647
+ if (parent.state.scheme !== lastParentScheme) return !0;
3648
+ lastParentScheme = parent.state.scheme;
3649
+ }
3650
+ } catch (err) {
3651
+ _didIteratorError = !0, _iteratorError = err;
3652
+ } finally {
3653
+ try {
3654
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3655
+ } finally {
3656
+ if (_didIteratorError) throw _iteratorError;
3657
+ }
3658
+ }
3659
+ return !1;
3660
+ }
3661
+ }
3662
+ });
3663
+
3596
3664
  // ../web/dist/cjs/hooks/useTheme.native.js
3597
3665
  var require_useTheme_native = __commonJS({
3598
3666
  "../web/dist/cjs/hooks/useTheme.native.js"(exports2, module2) {
@@ -3663,7 +3731,7 @@ var require_useTheme_native = __commonJS({
3663
3731
  }
3664
3732
  });
3665
3733
  module2.exports = __toCommonJS2(useTheme_exports);
3666
- var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_createShallowSetState = require_createShallowSetState_native(), emptyProps = {
3734
+ var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_createShallowSetState = require_createShallowSetState_native(), import_shouldDeoptDueToParentScheme = require_shouldDeoptDueToParentScheme_native(), emptyProps = {
3667
3735
  name: null
3668
3736
  }, cached;
3669
3737
  function getDefaultThemeProxied() {
@@ -3730,11 +3798,11 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3730
3798
  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
3799
  else if (subkey === "get") return function(platform) {
3732
3800
  var outVal = (0, import_createVariable.getVariable)(val);
3733
- if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !shouldDeoptDueToParentScheme(themeManager) && scheme) {
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 = {
3801
+ if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(themeManager) && scheme) {
3802
+ var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[keyString]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[keyString]), dynamicVal = {
3735
3803
  dynamic: {
3736
- light: colorLight,
3737
- dark: colorDark
3804
+ [scheme]: color,
3805
+ [oppositeScheme]: oppositeColor
3738
3806
  }
3739
3807
  };
3740
3808
  return dynamicVal;
@@ -3764,27 +3832,6 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3764
3832
  }
3765
3833
  return !1;
3766
3834
  }
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;
3787
- }
3788
3835
  var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
3789
3836
  return _idToUID[id];
3790
3837
  }, getThemeManager = function(id) {