@tamagui/core 1.74.2 → 1.74.4

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.
@@ -807,9 +807,9 @@ var require_concatClassName_native = __commonJS({
807
807
  }
808
808
  });
809
809
 
810
- // ../constants/dist/cjs/index.native.js
811
- var require_index_native2 = __commonJS({
812
- "../constants/dist/cjs/index.native.js"(exports, module2) {
810
+ // ../constants/dist/cjs/constants.native.js
811
+ var require_constants_native = __commonJS({
812
+ "../constants/dist/cjs/constants.native.js"(exports, module2) {
813
813
  "use strict";
814
814
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
815
815
  for (var name in all)
@@ -819,8 +819,8 @@ var require_index_native2 = __commonJS({
819
819
  for (let key of __getOwnPropNames2(from))
820
820
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
821
821
  return to;
822
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), index_native_exports = {};
823
- __export2(index_native_exports, {
822
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), constants_native_exports = {};
823
+ __export2(constants_native_exports, {
824
824
  currentPlatform: () => currentPlatform,
825
825
  isAndroid: () => isAndroid,
826
826
  isChrome: () => isChrome,
@@ -833,11 +833,26 @@ var require_index_native2 = __commonJS({
833
833
  isWindowDefined: () => isWindowDefined,
834
834
  useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect3
835
835
  });
836
- module2.exports = __toCommonJS2(index_native_exports);
836
+ module2.exports = __toCommonJS2(constants_native_exports);
837
837
  var import_react = require("react"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect3 = import_react.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = !1, isIos = !1, currentPlatform = "native";
838
838
  }
839
839
  });
840
840
 
841
+ // ../constants/dist/cjs/index.native.js
842
+ var require_index_native2 = __commonJS({
843
+ "../constants/dist/cjs/index.native.js"(exports, module2) {
844
+ "use strict";
845
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
846
+ if (from && typeof from == "object" || typeof from == "function")
847
+ for (let key of __getOwnPropNames2(from))
848
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
849
+ return to;
850
+ }, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
851
+ module2.exports = __toCommonJS2(src_exports2);
852
+ __reExport2(src_exports2, require_constants_native(), module2.exports);
853
+ }
854
+ });
855
+
841
856
  // ../helpers/dist/cjs/validStyleProps.native.js
842
857
  var require_validStyleProps_native = __commonJS({
843
858
  "../helpers/dist/cjs/validStyleProps.native.js"(exports, module2) {
@@ -1986,7 +2001,7 @@ var require_index_native6 = __commonJS({
1986
2001
  });
1987
2002
 
1988
2003
  // ../web/dist/cjs/constants/constants.native.js
1989
- var require_constants_native = __commonJS({
2004
+ var require_constants_native2 = __commonJS({
1990
2005
  "../web/dist/cjs/constants/constants.native.js"(exports, module2) {
1991
2006
  "use strict";
1992
2007
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
@@ -3135,7 +3150,7 @@ var require_propMapper_native = __commonJS({
3135
3150
  return variantValue;
3136
3151
  }
3137
3152
  let shouldReturn = !1;
3138
- if (styleProps.disableExpandShorthands || key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveValues, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(value, styleProps.resolveValues))), shouldReturn || value != null)
3153
+ if (styleProps.disableExpandShorthands || key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveValues, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), shouldReturn || value != null)
3139
3154
  return (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [[key, value]];
3140
3155
  }, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
3141
3156
  let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
@@ -3187,16 +3202,16 @@ var require_propMapper_native = __commonJS({
3187
3202
  var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
3188
3203
  var _a;
3189
3204
  let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
3190
- for (let rKey in value) {
3191
- let fKey = conf.shorthands[rKey] || rKey, val = value[rKey];
3205
+ for (let _key in value) {
3206
+ let subKey = conf.shorthands[_key] || _key, val = value[_key];
3192
3207
  if (styleProps.noExpand)
3193
- res[fKey] = val;
3194
- else if (variants && fKey in variants) {
3195
- if (styleState.curProps[fKey] = val, parentVariantKey && parentVariantKey === key)
3196
- res[fKey] = // SYNC WITH *1
3197
- val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveValues, styleState) : val;
3208
+ res[subKey] = val;
3209
+ else if (variants && subKey in variants) {
3210
+ if (styleState.curProps[subKey] = val, parentVariantKey && parentVariantKey === key)
3211
+ res[subKey] = // SYNC WITH *1
3212
+ val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val;
3198
3213
  else {
3199
- let variantOut = resolveVariants(fKey, val, styleProps, styleState, key);
3214
+ let variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
3200
3215
  if (variantOut)
3201
3216
  for (let [key2, val2] of variantOut)
3202
3217
  val2 != null && (key2 in import_pseudoDescriptors.pseudoDescriptors ? (res[key2] ??= {}, Object.assign(res[key2], val2)) : res[key2] = val2);
@@ -3204,22 +3219,22 @@ var require_propMapper_native = __commonJS({
3204
3219
  continue;
3205
3220
  }
3206
3221
  if ((0, import_createVariable.isVariable)(val)) {
3207
- res[fKey] = resolveVariableValue(val, styleProps.resolveValues);
3222
+ res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues);
3208
3223
  continue;
3209
3224
  }
3210
3225
  if (typeof val == "string") {
3211
3226
  let fVal = (
3212
3227
  // SYNC WITH *1
3213
- val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveValues, styleState) : val
3228
+ val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val
3214
3229
  );
3215
- res[fKey] = fVal;
3230
+ res[subKey] = fVal;
3216
3231
  continue;
3217
3232
  }
3218
3233
  if ((0, import_isObj.isObj)(val)) {
3219
- let subObject = resolveTokensAndVariants(fKey, val, styleProps, styleState, key);
3220
- res[fKey] ??= {}, Object.assign(res[fKey], subObject);
3234
+ let subObject = resolveTokensAndVariants(subKey, val, styleProps, styleState, key);
3235
+ res[subKey] ??= {}, Object.assign(res[subKey], subObject);
3221
3236
  } else
3222
- res[fKey] = val;
3237
+ res[subKey] = val;
3223
3238
  }
3224
3239
  return res;
3225
3240
  }, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
@@ -3283,16 +3298,16 @@ var require_propMapper_native = __commonJS({
3283
3298
  spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
3284
3299
  }
3285
3300
  }
3286
- return hasSet ? resolveVariableValue(valOrVar, resolveAs) : value;
3301
+ return hasSet ? resolveVariableValue(key, valOrVar, resolveAs) : value;
3287
3302
  };
3288
- function resolveVariableValue(valOrVar, resolveValues) {
3303
+ function resolveVariableValue(key, valOrVar, resolveValues) {
3289
3304
  if (resolveValues === "none")
3290
3305
  return valOrVar;
3291
3306
  if ((0, import_createVariable.isVariable)(valOrVar)) {
3292
3307
  if (resolveValues === "value")
3293
3308
  return valOrVar.val;
3294
3309
  let get = valOrVar.get;
3295
- return typeof get == "function" ? get() : valOrVar.val;
3310
+ return key !== "shadowColor" && typeof get == "function" ? get(resolveValues === "web" ? "web" : void 0) : valOrVar.val;
3296
3311
  }
3297
3312
  return valOrVar;
3298
3313
  }
@@ -3821,7 +3836,7 @@ var require_ThemeManager_native = __commonJS({
3821
3836
  getNonComponentParentManager: () => getNonComponentParentManager
3822
3837
  });
3823
3838
  module2.exports = __toCommonJS2(ThemeManager_exports);
3824
- var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native(), emptyState = { name: "" };
3839
+ var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native2(), emptyState = { name: "" };
3825
3840
  function getHasThemeUpdatingProps(props) {
3826
3841
  return props.name || props.componentName || props.inverse || props.reset;
3827
3842
  }
@@ -4050,9 +4065,9 @@ var require_useTheme_native = __commonJS({
4050
4065
  if (subkey === "val")
4051
4066
  track(keyString);
4052
4067
  else if (subkey === "get")
4053
- return () => {
4068
+ return (platform) => {
4054
4069
  let outVal = (0, import_createVariable.getVariable)(val);
4055
- if (import_constants2.isIos && !deopt && config.settings.fastSchemeChange) {
4070
+ if (platform !== "web" && import_constants2.isIos && !deopt && config.settings.fastSchemeChange) {
4056
4071
  let isDark = name.startsWith("dark"), isLight = !isDark && name.startsWith("light");
4057
4072
  if (isDark || isLight) {
4058
4073
  let oppositeThemeName = name.replace(
@@ -4441,7 +4456,7 @@ var require_createComponent_native = __commonJS({
4441
4456
  spacedChildren: () => spacedChildren
4442
4457
  });
4443
4458
  module2.exports = __toCommonJS2(createComponent_exports);
4444
- var import_compose_refs = require_index_native5(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native6(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, mouseUps = /* @__PURE__ */ new Set();
4459
+ var import_compose_refs = require_index_native5(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native6(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, mouseUps = /* @__PURE__ */ new Set();
4445
4460
  if (typeof document < "u") {
4446
4461
  let cancelTouches = () => {
4447
4462
  mouseUps.forEach((x) => x()), mouseUps.clear();
@@ -4725,7 +4740,7 @@ var require_createComponent_native = __commonJS({
4725
4740
  isZStack,
4726
4741
  debug: debugProp
4727
4742
  });
4728
- asChild && (elementType = import_Slot.Slot), content = (0, import_react.createElement)(elementType, viewProps, content);
4743
+ asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), content = (0, import_react.createElement)(elementType, viewProps, content);
4729
4744
  let subGroupContext = (0, import_react.useMemo)(() => {
4730
4745
  if (groupName)
4731
4746
  return {
@@ -5859,7 +5874,7 @@ var require_Stack_native = __commonJS({
5859
5874
  Stack: () => Stack2
5860
5875
  });
5861
5876
  module2.exports = __toCommonJS2(Stack_exports);
5862
- var import_helpers = require_index_native4(), import_constants2 = require_constants_native(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
5877
+ var import_helpers = require_index_native4(), import_constants2 = require_constants_native2(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
5863
5878
  acceptsClassName: !0,
5864
5879
  defaultProps: import_constants2.stackDefaultStyles,
5865
5880
  validStyles: import_helpers.validStyles
@@ -6017,7 +6032,7 @@ var require_ThemeProvider_native = __commonJS({
6017
6032
  ThemeProvider: () => ThemeProvider
6018
6033
  });
6019
6034
  module2.exports = __toCommonJS2(ThemeProvider_exports);
6020
- var import_constants2 = require_index_native2(), import_react = require("react"), import_constants22 = require_constants_native(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants2.isClient && (0, import_react.useLayoutEffect)(() => {
6035
+ var import_constants2 = require_index_native2(), import_react = require("react"), import_constants22 = require_constants_native2(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants2.isClient && (0, import_react.useLayoutEffect)(() => {
6021
6036
  if (props.disableRootThemeClass)
6022
6037
  return;
6023
6038
  let cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = props.themeClassNameOnRoot ? document.documentElement : document.body;
@@ -6254,7 +6269,7 @@ var require_index_native9 = __commonJS({
6254
6269
  __reExport2(src_exports2, require_types_native3(), module2.exports);
6255
6270
  __reExport2(src_exports2, require_GetRef_native(), module2.exports);
6256
6271
  var import_config = require_config_native();
6257
- __reExport2(src_exports2, require_constants_native(), module2.exports);
6272
+ __reExport2(src_exports2, require_constants_native2(), module2.exports);
6258
6273
  __reExport2(src_exports2, require_ComponentContext_native(), module2.exports);
6259
6274
  __reExport2(src_exports2, require_createStyledContext_native(), module2.exports);
6260
6275
  __reExport2(src_exports2, require_expandStyles_native(), module2.exports);