tamagui 1.123.0 → 1.123.1

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.
@@ -1184,7 +1184,10 @@ var require_constants_native = __commonJS({
1184
1184
  }
1185
1185
  });
1186
1186
  module2.exports = __toCommonJS2(constants_native_exports);
1187
- var import_react3 = require("react"), isWeb6 = !1, isWindowDefined = !1, isServer2 = !1, isClient2 = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome2 = !1, isWebTouchable2 = !1, isTouchable2 = !0, isAndroid = !1, isIos = process.env.TEST_NATIVE_PLATFORM === "ios", currentPlatform = "native";
1187
+ var import_react3 = require("react"), import_react_native4 = require("react-native"), isWeb6 = !1, isWindowDefined = !1, isServer2 = !1, isClient2 = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome2 = !1, isWebTouchable2 = !1, isTouchable2 = !0, isAndroid = import_react_native4.Platform.OS === "android" || process.env.TEST_NATIVE_PLATFORM === "android", isIos = import_react_native4.Platform.OS === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios", platforms = {
1188
+ ios: "ios",
1189
+ android: "android"
1190
+ }, currentPlatform = platforms[import_react_native4.Platform.OS] || "native";
1188
1191
  }
1189
1192
  });
1190
1193
 
@@ -3368,10 +3371,20 @@ var require_ThemeManager_native = __commonJS({
3368
3371
  }
3369
3372
  }
3370
3373
  ]), ThemeManager2;
3371
- }();
3374
+ }(), cache = {};
3372
3375
  function getState(props, manager) {
3373
- if (props.name && props.reset) throw new Error("Cannot reset and set a new name at the same time.");
3374
3376
  if (!getHasThemeUpdatingProps(props)) return null;
3377
+ var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
3378
+ return (x == null ? void 0 : x.state.name) || ".";
3379
+ }).join("")}`, cached = cache[cacheKey];
3380
+ if (!cached) {
3381
+ var res = getStateUncached(props, manager);
3382
+ return cache[cacheKey] = res, res;
3383
+ }
3384
+ return cached;
3385
+ }
3386
+ function getStateUncached(props, manager) {
3387
+ if (props.name && props.reset) throw new Error("Cannot reset and set a new name at the same time.");
3375
3388
  var themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
3376
3389
  if (!baseManager && props.reset) return console.warn("Cannot reset, no parent theme exists"), null;
3377
3390
  var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
@@ -13327,7 +13340,7 @@ var require_Pressability_native = __commonJS({
13327
13340
  var require_addNativeValidStyles_native = __commonJS({
13328
13341
  "../../core/core/dist/cjs/addNativeValidStyles.native.js"(exports2, module2) {
13329
13342
  "use strict";
13330
- var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
13343
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
13331
13344
  for (var name in all) __defProp2(target, name, {
13332
13345
  get: all[name],
13333
13346
  enumerable: !0
@@ -13355,18 +13368,6 @@ var require_addNativeValidStyles_native = __commonJS({
13355
13368
  }
13356
13369
  }
13357
13370
  return to;
13358
- }, __toESM2 = function(mod, isNodeMode, target) {
13359
- return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
13360
- // If the importer is in node compatibility mode or this is not an ESM
13361
- // file that has been converted to a CommonJS file using a Babel-
13362
- // compatible transform (i.e. "__esModule" has not been set), then set
13363
- // "default" to the CommonJS "module.exports" for node compatibility.
13364
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
13365
- value: mod,
13366
- enumerable: !0
13367
- }) : target,
13368
- mod
13369
- );
13370
13371
  }, __toCommonJS2 = function(mod) {
13371
13372
  return __copyProps2(__defProp2({}, "__esModule", {
13372
13373
  value: !0
@@ -13378,21 +13379,38 @@ var require_addNativeValidStyles_native = __commonJS({
13378
13379
  }
13379
13380
  });
13380
13381
  module2.exports = __toCommonJS2(addNativeValidStyles_native_exports);
13381
- var import_helpers = require_index_native7(), import_ReactNativeVersion = __toESM2(require("react-native/Libraries/Core/ReactNativeVersion"));
13382
- function addNativeValidStyles() {
13383
- if (import_ReactNativeVersion.default) {
13384
- var { version: { major, minor } } = import_ReactNativeVersion.default;
13385
- if (major === 0 && minor >= 77) {
13386
- var additional = {
13387
- boxSizing: !0,
13388
- mixBlendMode: !0,
13389
- outlineWidth: !0,
13390
- outlineStyle: !0,
13391
- outlineSpread: !0,
13392
- outlineColor: !0
13393
- };
13394
- Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
13382
+ var import_helpers = require_index_native7();
13383
+ function getReactNativeVersion() {
13384
+ var version = process.env.REACT_NATIVE_VERSION;
13385
+ if (!version) try {
13386
+ var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
13387
+ if (ReactNativeOfficalVersion) {
13388
+ var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
13389
+ version = `${major}.${minor}.${patch}`;
13395
13390
  }
13391
+ } catch {
13392
+ } finally {
13393
+ version || (version = "0.77");
13394
+ }
13395
+ var [major1, minor1, patch1] = version.split(".");
13396
+ return [
13397
+ +major1,
13398
+ +minor1,
13399
+ +patch1
13400
+ ];
13401
+ }
13402
+ function addNativeValidStyles() {
13403
+ var [major, minor] = getReactNativeVersion();
13404
+ if (major === 0 && minor >= 77) {
13405
+ var additional = {
13406
+ boxSizing: !0,
13407
+ mixBlendMode: !0,
13408
+ outlineWidth: !0,
13409
+ outlineStyle: !0,
13410
+ outlineSpread: !0,
13411
+ outlineColor: !0
13412
+ };
13413
+ Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
13396
13414
  }
13397
13415
  }
13398
13416
  }