@tamagui/core 1.123.0 → 1.123.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.
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -13,34 +12,45 @@ var __export = (target, all) => {
13
12
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
13
  return to;
15
14
  };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
16
  var addNativeValidStyles_native_exports = {};
25
17
  __export(addNativeValidStyles_native_exports, {
26
18
  addNativeValidStyles: () => addNativeValidStyles
27
19
  });
28
20
  module.exports = __toCommonJS(addNativeValidStyles_native_exports);
29
- var import_helpers = require("@tamagui/helpers"), import_ReactNativeVersion = __toESM(require("react-native/Libraries/Core/ReactNativeVersion"));
30
- function addNativeValidStyles() {
31
- if (import_ReactNativeVersion.default) {
32
- var { version: { major, minor } } = import_ReactNativeVersion.default;
33
- if (major === 0 && minor >= 77) {
34
- var additional = {
35
- boxSizing: !0,
36
- mixBlendMode: !0,
37
- outlineWidth: !0,
38
- outlineStyle: !0,
39
- outlineSpread: !0,
40
- outlineColor: !0
41
- };
42
- Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
21
+ var import_helpers = require("@tamagui/helpers");
22
+ function getReactNativeVersion() {
23
+ var version = process.env.REACT_NATIVE_VERSION || "";
24
+ if (!process.env.REACT_NATIVE_VERSION)
25
+ try {
26
+ var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
27
+ if (ReactNativeOfficalVersion) {
28
+ var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
29
+ version = `${major}.${minor}.${patch}`;
30
+ }
31
+ } catch {
32
+ } finally {
33
+ version || (version = "0.77");
43
34
  }
35
+ var [major1, minor1, patch1] = version.split(".");
36
+ return [
37
+ +major1,
38
+ +minor1,
39
+ +patch1
40
+ ];
41
+ }
42
+ function addNativeValidStyles() {
43
+ var [major, minor] = getReactNativeVersion();
44
+ if (major === 0 && minor >= 77) {
45
+ var additional = {
46
+ boxSizing: !0,
47
+ mixBlendMode: !0,
48
+ outlineWidth: !0,
49
+ outlineStyle: !0,
50
+ outlineSpread: !0,
51
+ outlineColor: !0
52
+ };
53
+ Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
44
54
  }
45
55
  }
46
56
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/core/core/src/addNativeValidStyles.native.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;qBAA2C,6BAG3C,4BAA+B;AAIxB,SAASA,uBAAAA;AACd,MAAKC,0BAAAA,SACL;QAAM,EACJC,SAAS,EAAEC,OAAOC,MAAK,EAAE,IACvBH,0BAAAA;AAEJ,QAAIE,UAAU,KAAKC,SAAS,IAAI;AAC9B,UAAMC,aAAa;QACjBC,WAAW;QACXC,cAAc;QACdC,cAAc;QACdC,cAAc;QACdC,eAAe;QACfC,cAAc;MAChB;AAEAC,aAAOC,OAAOC,4BAAaT,UAAAA,GAC3BO,OAAOC,OAAOE,8BAAeV,UAAAA;IAC/B;;AACF;",
5
- "names": ["addNativeValidStyles", "ReactNativeVersion", "version", "major", "minor", "additional", "boxSizing", "mixBlendMode", "outlineWidth", "outlineStyle", "outlineSpread", "outlineColor", "Object", "assign", "validStyles", "stylePropsAll"]
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;qBAA2C;AAE3C,SAASA,wBAAAA;AACP,MAAIC,UAAUC,QAAQC,IAAIC,wBAAwB;AAElD,MAAI,CAACF,QAAQC,IAAIC;AACf,QAAI;AACF,UAAMC,4BACJC,QAAQ,gDAAA;AAIV,UAAID,2BAA2B;AAC7B,YAAM,EACJJ,SAAS,EAAEM,OAAOC,OAAOC,MAAK,EAAE,IAC9BJ;AACJJ,kBAAU,GAAGM,KAAAA,IAASC,KAAAA,IAASC,KAAAA;MACjC;IACF,QAAQ;IAER,UAAA;AACE,MAAKR,YACHA,UAAU;IAEd;AAGF,MAAM,CAACM,QAAOC,QAAOC,MAAAA,IAASR,QAAQS,MAAM,GAAA;AAC5C,SAAO;IAAC,CAACH;IAAO,CAACC;IAAO,CAACC;;AAC3B;AAIO,SAASE,uBAAAA;AACd,MAAM,CAACJ,OAAOC,KAAAA,IAASR,sBAAAA;AAEvB,MAAIO,UAAU,KAAKC,SAAS,IAAI;AAC9B,QAAMI,aAAa;MACjBC,WAAW;MACXC,cAAc;MACdC,cAAc;MACdC,cAAc;MACdC,eAAe;MACfC,cAAc;IAChB;AAEAC,WAAOC,OAAOC,4BAAaT,UAAAA,GAC3BO,OAAOC,OAAOE,8BAAeV,UAAAA;EAC/B;AACF;",
5
+ "names": ["getReactNativeVersion", "version", "process", "env", "REACT_NATIVE_VERSION", "ReactNativeOfficalVersion", "require", "major", "minor", "patch", "split", "addNativeValidStyles", "additional", "boxSizing", "mixBlendMode", "outlineWidth", "outlineStyle", "outlineSpread", "outlineColor", "Object", "assign", "validStyles", "stylePropsAll"]
6
6
  }
@@ -1,19 +1,36 @@
1
1
  import { validStyles, stylePropsAll } from "@tamagui/helpers";
2
- import ReactNativeVersion from "react-native/Libraries/Core/ReactNativeVersion";
3
- function addNativeValidStyles() {
4
- if (ReactNativeVersion) {
5
- var { version: { major, minor } } = ReactNativeVersion;
6
- if (major === 0 && minor >= 77) {
7
- var additional = {
8
- boxSizing: !0,
9
- mixBlendMode: !0,
10
- outlineWidth: !0,
11
- outlineStyle: !0,
12
- outlineSpread: !0,
13
- outlineColor: !0
14
- };
15
- Object.assign(validStyles, additional), Object.assign(stylePropsAll, additional);
2
+ function getReactNativeVersion() {
3
+ var version = process.env.REACT_NATIVE_VERSION || "";
4
+ if (!process.env.REACT_NATIVE_VERSION)
5
+ try {
6
+ var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
7
+ if (ReactNativeOfficalVersion) {
8
+ var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
9
+ version = `${major}.${minor}.${patch}`;
10
+ }
11
+ } catch {
12
+ } finally {
13
+ version || (version = "0.77");
16
14
  }
15
+ var [major1, minor1, patch1] = version.split(".");
16
+ return [
17
+ +major1,
18
+ +minor1,
19
+ +patch1
20
+ ];
21
+ }
22
+ function addNativeValidStyles() {
23
+ var [major, minor] = getReactNativeVersion();
24
+ if (major === 0 && minor >= 77) {
25
+ var additional = {
26
+ boxSizing: !0,
27
+ mixBlendMode: !0,
28
+ outlineWidth: !0,
29
+ outlineStyle: !0,
30
+ outlineSpread: !0,
31
+ outlineColor: !0
32
+ };
33
+ Object.assign(validStyles, additional), Object.assign(stylePropsAll, additional);
17
34
  }
18
35
  }
19
36
  export {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/core/core/src/addNativeValidStyles.native.ts"],
4
- "mappings": "AAAA,SAASA,aAAaC,qBAAqB;AAG3C,OAAOC,wBAAwB;AAIxB,SAASC,uBAAAA;AACd,MAAKD,oBACL;QAAM,EACJE,SAAS,EAAEC,OAAOC,MAAK,EAAE,IACvBJ;AAEJ,QAAIG,UAAU,KAAKC,SAAS,IAAI;AAC9B,UAAMC,aAAa;QACjBC,WAAW;QACXC,cAAc;QACdC,cAAc;QACdC,cAAc;QACdC,eAAe;QACfC,cAAc;MAChB;AAEAC,aAAOC,OAAOf,aAAaO,UAAAA,GAC3BO,OAAOC,OAAOd,eAAeM,UAAAA;IAC/B;;AACF;",
5
- "names": ["validStyles", "stylePropsAll", "ReactNativeVersion", "addNativeValidStyles", "version", "major", "minor", "additional", "boxSizing", "mixBlendMode", "outlineWidth", "outlineStyle", "outlineSpread", "outlineColor", "Object", "assign"]
4
+ "mappings": "AAAA,SAASA,aAAaC,qBAAqB;AAE3C,SAASC,wBAAAA;AACP,MAAIC,UAAUC,QAAQC,IAAIC,wBAAwB;AAElD,MAAI,CAACF,QAAQC,IAAIC;AACf,QAAI;AACF,UAAMC,4BACJC,QAAQ,gDAAA;AAIV,UAAID,2BAA2B;AAC7B,YAAM,EACJJ,SAAS,EAAEM,OAAOC,OAAOC,MAAK,EAAE,IAC9BJ;AACJJ,kBAAU,GAAGM,KAAAA,IAASC,KAAAA,IAASC,KAAAA;MACjC;IACF,QAAQ;IAER,UAAA;AACE,MAAKR,YACHA,UAAU;IAEd;AAGF,MAAM,CAACM,QAAOC,QAAOC,MAAAA,IAASR,QAAQS,MAAM,GAAA;AAC5C,SAAO;IAAC,CAACH;IAAO,CAACC;IAAO,CAACC;;AAC3B;AAIO,SAASE,uBAAAA;AACd,MAAM,CAACJ,OAAOC,KAAAA,IAASR,sBAAAA;AAEvB,MAAIO,UAAU,KAAKC,SAAS,IAAI;AAC9B,QAAMI,aAAa;MACjBC,WAAW;MACXC,cAAc;MACdC,cAAc;MACdC,cAAc;MACdC,eAAe;MACfC,cAAc;IAChB;AAEAC,WAAOC,OAAOtB,aAAac,UAAAA,GAC3BO,OAAOC,OAAOrB,eAAea,UAAAA;EAC/B;AACF;",
5
+ "names": ["validStyles", "stylePropsAll", "getReactNativeVersion", "version", "process", "env", "REACT_NATIVE_VERSION", "ReactNativeOfficalVersion", "require", "major", "minor", "patch", "split", "addNativeValidStyles", "additional", "boxSizing", "mixBlendMode", "outlineWidth", "outlineStyle", "outlineSpread", "outlineColor", "Object", "assign"]
6
6
  }
package/dist/native.js CHANGED
@@ -428,7 +428,10 @@ var require_constants_native = __commonJS({
428
428
  }
429
429
  });
430
430
  module2.exports = __toCommonJS2(constants_native_exports);
431
- var import_react3 = require("react"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = !1, isIos = process.env.TEST_NATIVE_PLATFORM === "ios", currentPlatform = "native";
431
+ var import_react3 = require("react"), import_react_native = require("react-native"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = import_react_native.Platform.OS === "android" || process.env.TEST_NATIVE_PLATFORM === "android", isIos = import_react_native.Platform.OS === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios", platforms = {
432
+ ios: "ios",
433
+ android: "android"
434
+ }, currentPlatform = platforms[import_react_native.Platform.OS] || "native";
432
435
  }
433
436
  });
434
437
 
@@ -2464,10 +2467,20 @@ var require_ThemeManager_native = __commonJS({
2464
2467
  }
2465
2468
  }
2466
2469
  ]), ThemeManager2;
2467
- }();
2470
+ }(), cache2 = {};
2468
2471
  function getState(props, manager) {
2469
- if (props.name && props.reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
2470
2472
  if (!getHasThemeUpdatingProps(props)) return null;
2473
+ var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
2474
+ return (x == null ? void 0 : x.state.name) || ".";
2475
+ }).join("")}`, cached = cache2[cacheKey];
2476
+ if (!cached) {
2477
+ var res = getStateUncached(props, manager);
2478
+ return cache2[cacheKey] = res, res;
2479
+ }
2480
+ return cached;
2481
+ }
2482
+ function getStateUncached(props, manager) {
2483
+ if (props.name && props.reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
2471
2484
  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];
2472
2485
  if (!baseManager && props.reset) return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
2473
2486
  var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
@@ -12524,21 +12537,39 @@ var tm, measureElement = async function(target) {
12524
12537
  var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
12525
12538
 
12526
12539
  // src/addNativeValidStyles.native.ts
12527
- var import_helpers = __toESM(require_index_native3()), import_ReactNativeVersion = __toESM(require("react-native/Libraries/Core/ReactNativeVersion"));
12540
+ var import_helpers = __toESM(require_index_native3());
12541
+ function getReactNativeVersion() {
12542
+ var version = process.env.REACT_NATIVE_VERSION || "";
12543
+ if (!process.env.REACT_NATIVE_VERSION)
12544
+ try {
12545
+ var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
12546
+ if (ReactNativeOfficalVersion) {
12547
+ var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
12548
+ version = `${major}.${minor}.${patch}`;
12549
+ }
12550
+ } catch {
12551
+ } finally {
12552
+ version || (version = "0.77");
12553
+ }
12554
+ var [major1, minor1, patch1] = version.split(".");
12555
+ return [
12556
+ +major1,
12557
+ +minor1,
12558
+ +patch1
12559
+ ];
12560
+ }
12528
12561
  function addNativeValidStyles() {
12529
- if (import_ReactNativeVersion.default) {
12530
- var { version: { major, minor } } = import_ReactNativeVersion.default;
12531
- if (major === 0 && minor >= 77) {
12532
- var additional = {
12533
- boxSizing: !0,
12534
- mixBlendMode: !0,
12535
- outlineWidth: !0,
12536
- outlineStyle: !0,
12537
- outlineSpread: !0,
12538
- outlineColor: !0
12539
- };
12540
- Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
12541
- }
12562
+ var [major, minor] = getReactNativeVersion();
12563
+ if (major === 0 && minor >= 77) {
12564
+ var additional = {
12565
+ boxSizing: !0,
12566
+ mixBlendMode: !0,
12567
+ outlineWidth: !0,
12568
+ outlineStyle: !0,
12569
+ outlineSpread: !0,
12570
+ outlineColor: !0
12571
+ };
12572
+ Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
12542
12573
  }
12543
12574
  }
12544
12575