@tamagui/core 1.125.24 → 1.125.25

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
@@ -983,6 +983,87 @@ var require_index_native3 = __commonJS({
983
983
  }
984
984
  });
985
985
 
986
+ // ../web/dist/cjs/constants/constants.native.js
987
+ var require_constants_native2 = __commonJS({
988
+ "../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
989
+ "use strict";
990
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
991
+ for (var name in all) __defProp2(target, name, {
992
+ get: all[name],
993
+ enumerable: !0
994
+ });
995
+ }, __copyProps2 = function(to, from, except, desc) {
996
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
997
+ if (from && typeof from == "object" || typeof from == "function") try {
998
+ for (var _loop = function() {
999
+ var key = _step.value;
1000
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
1001
+ get: function() {
1002
+ return from[key];
1003
+ },
1004
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
1005
+ });
1006
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
1007
+ } catch (err) {
1008
+ _didIteratorError = !0, _iteratorError = err;
1009
+ } finally {
1010
+ try {
1011
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
1012
+ } finally {
1013
+ if (_didIteratorError)
1014
+ throw _iteratorError;
1015
+ }
1016
+ }
1017
+ return to;
1018
+ }, __toCommonJS2 = function(mod) {
1019
+ return __copyProps2(__defProp2({}, "__esModule", {
1020
+ value: !0
1021
+ }), mod);
1022
+ }, constants_exports = {};
1023
+ __export2(constants_exports, {
1024
+ FONT_DATA_ATTRIBUTE_NAME: function() {
1025
+ return FONT_DATA_ATTRIBUTE_NAME;
1026
+ },
1027
+ MISSING_THEME_MESSAGE: function() {
1028
+ return MISSING_THEME_MESSAGE;
1029
+ },
1030
+ THEME_CLASSNAME_PREFIX: function() {
1031
+ return THEME_CLASSNAME_PREFIX;
1032
+ },
1033
+ THEME_NAME_SEPARATOR: function() {
1034
+ return THEME_NAME_SEPARATOR;
1035
+ },
1036
+ stackDefaultStyles: function() {
1037
+ return stackDefaultStyles;
1038
+ },
1039
+ webViewFlexCompatStyles: function() {
1040
+ return webViewFlexCompatStyles;
1041
+ }
1042
+ });
1043
+ module2.exports = __toCommonJS2(constants_exports);
1044
+ var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", stackDefaultStyles = {}, webViewFlexCompatStyles = {
1045
+ display: "flex",
1046
+ alignItems: "stretch",
1047
+ flexDirection: "column",
1048
+ flexBasis: "auto",
1049
+ // @ts-expect-error
1050
+ boxSizing: "border-box",
1051
+ position: process.env.TAMAGUI_POSITION_STATIC === "1" ? "static" : "relative",
1052
+ minHeight: 0,
1053
+ minWidth: 0,
1054
+ flexShrink: 0
1055
+ }, MISSING_THEME_MESSAGE = process.env.NODE_ENV === "development" ? `Can't find Tamagui configuration.
1056
+
1057
+ 99% of the time this is due to having mis-matched versions of Tamagui dependencies.
1058
+ Ensure that every "tamagui" and "@tamagui/*" dependency is pinned to exactly the same version.
1059
+
1060
+ We have a CLI tool to help check this:
1061
+
1062
+ npx @tamagui/cli check
1063
+ ` : "Missing theme.";
1064
+ }
1065
+ });
1066
+
986
1067
  // ../web/dist/cjs/config.native.js
987
1068
  var require_config_native = __commonJS({
988
1069
  "../web/dist/cjs/config.native.js"(exports2, module2) {
@@ -1077,15 +1158,8 @@ var require_config_native = __commonJS({
1077
1158
  }
1078
1159
  });
1079
1160
  module2.exports = __toCommonJS2(config_exports);
1080
- var import_constants2 = require_index_native2(), conf, haventCalledErrorMessage = process.env.NODE_ENV === "development" ? `
1081
- Haven't called createTamagui yet.
1082
-
1083
- This often happens due to having duplicate Tamagui sub-dependencies.
1084
-
1085
- Tamagui needs every @tamagui/* dependency to be on the exact same version, we include an upgrade script
1086
- with the starter kits that you can call with "yarn upgrade:tamagui" to help with this.
1087
-
1088
- You may want to clear your node_modules as well and run a fresh install after ugprading.
1161
+ var import_constants2 = require_index_native2(), import_constants22 = require_constants_native2(), conf, haventCalledErrorMessage = process.env.NODE_ENV === "development" ? `
1162
+ Haven't called createTamagui yet. ${import_constants22.MISSING_THEME_MESSAGE}
1089
1163
  ` : "\u274C Error 001", getSetting2 = function(key) {
1090
1164
  if (process.env.NODE_ENV === "development" && !conf) throw new Error(haventCalledErrorMessage);
1091
1165
  var _conf_settings_key;
@@ -2322,76 +2396,6 @@ var require_index_native4 = __commonJS({
2322
2396
  }
2323
2397
  });
2324
2398
 
2325
- // ../web/dist/cjs/constants/constants.native.js
2326
- var require_constants_native2 = __commonJS({
2327
- "../web/dist/cjs/constants/constants.native.js"(exports2, module2) {
2328
- "use strict";
2329
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
2330
- for (var name in all) __defProp2(target, name, {
2331
- get: all[name],
2332
- enumerable: !0
2333
- });
2334
- }, __copyProps2 = function(to, from, except, desc) {
2335
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
2336
- if (from && typeof from == "object" || typeof from == "function") try {
2337
- for (var _loop = function() {
2338
- var key = _step.value;
2339
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
2340
- get: function() {
2341
- return from[key];
2342
- },
2343
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2344
- });
2345
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
2346
- } catch (err) {
2347
- _didIteratorError = !0, _iteratorError = err;
2348
- } finally {
2349
- try {
2350
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2351
- } finally {
2352
- if (_didIteratorError)
2353
- throw _iteratorError;
2354
- }
2355
- }
2356
- return to;
2357
- }, __toCommonJS2 = function(mod) {
2358
- return __copyProps2(__defProp2({}, "__esModule", {
2359
- value: !0
2360
- }), mod);
2361
- }, constants_exports = {};
2362
- __export2(constants_exports, {
2363
- FONT_DATA_ATTRIBUTE_NAME: function() {
2364
- return FONT_DATA_ATTRIBUTE_NAME;
2365
- },
2366
- THEME_CLASSNAME_PREFIX: function() {
2367
- return THEME_CLASSNAME_PREFIX;
2368
- },
2369
- THEME_NAME_SEPARATOR: function() {
2370
- return THEME_NAME_SEPARATOR;
2371
- },
2372
- stackDefaultStyles: function() {
2373
- return stackDefaultStyles;
2374
- },
2375
- webViewFlexCompatStyles: function() {
2376
- return webViewFlexCompatStyles;
2377
- }
2378
- });
2379
- module2.exports = __toCommonJS2(constants_exports);
2380
- var THEME_NAME_SEPARATOR = "_", THEME_CLASSNAME_PREFIX = "t_", FONT_DATA_ATTRIBUTE_NAME = "data-tamagui-font", stackDefaultStyles = {}, webViewFlexCompatStyles = {
2381
- display: "flex",
2382
- alignItems: "stretch",
2383
- flexDirection: "column",
2384
- flexBasis: "auto",
2385
- // @ts-expect-error
2386
- boxSizing: "border-box",
2387
- position: process.env.TAMAGUI_POSITION_STATIC === "1" ? "static" : "relative",
2388
- minHeight: 0,
2389
- minWidth: 0,
2390
- flexShrink: 0
2391
- };
2392
- }
2393
- });
2394
-
2395
2399
  // ../web/dist/cjs/constants/isDevTools.native.js
2396
2400
  var require_isDevTools_native = __commonJS({
2397
2401
  "../web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
@@ -4977,7 +4981,7 @@ var require_propMapper_native = __commonJS({
4977
4981
  try {
4978
4982
  for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
4979
4983
  var { name, spreadName } = _step.value;
4980
- if (spreadName in variant && value in tokensParsed[name]) return variant[spreadName];
4984
+ if (spreadName in variant && name in tokensParsed && value in tokensParsed[name]) return variant[spreadName];
4981
4985
  }
4982
4986
  } catch (err) {
4983
4987
  _didIteratorError = !0, _iteratorError = err;
@@ -6098,7 +6102,7 @@ var require_useThemeState_native = __commonJS({
6098
6102
  }
6099
6103
  });
6100
6104
  module2.exports = __toCommonJS2(useThemeState_exports);
6101
- var import_constants2 = require_index_native2(), import_react3 = require("react"), import_config = require_config_native(), ThemeStateContext = (0, import_react3.createContext)(""), allListeners = /* @__PURE__ */ new Map(), listenersByParent = {}, HasRenderedOnce = /* @__PURE__ */ new WeakMap(), HadTheme = /* @__PURE__ */ new WeakMap(), PendingUpdate = /* @__PURE__ */ new Map(), states = /* @__PURE__ */ new Map(), localStates = /* @__PURE__ */ new Map(), shouldForce = !1, forceUpdateThemes2 = function() {
6105
+ var import_constants2 = require_index_native2(), import_react3 = require("react"), import_config = require_config_native(), import_constants22 = require_constants_native2(), ThemeStateContext = (0, import_react3.createContext)(""), allListeners = /* @__PURE__ */ new Map(), listenersByParent = {}, HasRenderedOnce = /* @__PURE__ */ new WeakMap(), HadTheme = /* @__PURE__ */ new WeakMap(), PendingUpdate = /* @__PURE__ */ new Map(), states = /* @__PURE__ */ new Map(), localStates = /* @__PURE__ */ new Map(), shouldForce = !1, forceUpdateThemes2 = function() {
6102
6106
  cacheVersion++, shouldForce = !0, allListeners.forEach(function(cb) {
6103
6107
  return cb();
6104
6108
  });
@@ -6108,7 +6112,7 @@ var require_useThemeState_native = __commonJS({
6108
6112
  return rootThemeState;
6109
6113
  }, useThemeState = function(props) {
6110
6114
  var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, keys = arguments.length > 2 ? arguments[2] : void 0, { disable } = props, parentId = (0, import_react3.useContext)(ThemeStateContext);
6111
- if (!parentId && !isRoot) throw new Error("No parent?");
6115
+ if (!parentId && !isRoot) throw new Error(import_constants22.MISSING_THEME_MESSAGE);
6112
6116
  if (disable) return states.get(parentId) || {
6113
6117
  id: "",
6114
6118
  name: "light",
@@ -6176,7 +6180,7 @@ var require_useThemeState_native = __commonJS({
6176
6180
  ];
6177
6181
  if (!name) {
6178
6182
  var next = lastState ?? parentState;
6179
- if (!next) throw new Error("No theme and no parent?");
6183
+ if (!next) throw new Error(import_constants22.MISSING_THEME_MESSAGE);
6180
6184
  if (shouldRerender) {
6181
6185
  var updated = {
6182
6186
  ...parentState || lastState