@tamagui/core 1.91.5 → 1.92.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.
package/dist/native.js CHANGED
@@ -7178,7 +7178,7 @@ var require_propMapper_native = __commonJS({
7178
7178
  get: function(_, k) {
7179
7179
  return k === "curProps" ? subProps : Reflect.get(_, k);
7180
7180
  }
7181
- }) : styleStateIn, conf = styleState.conf, styleProps = styleState.styleProps, fontFamily = styleState.fontFamily, staticConfig = styleState.staticConfig, variants = staticConfig.variants;
7181
+ }) : styleStateIn, conf = styleState.conf, styleProps = styleState.styleProps, fontFamily = styleState.fontFamily, staticConfig = styleState.staticConfig, skipThemeTokenResolution = styleState.skipThemeTokenResolution, variants = staticConfig.variants;
7182
7182
  if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn('Warning: no fontFamily "'.concat(fontFamily, '" found in config: ').concat(Object.keys(conf.fontsParsed).join(", "))), !styleProps.noExpand && variants && key in variants) {
7183
7183
  styleState.curProps[key] = value;
7184
7184
  var variantValue = resolveVariants(key, value, styleProps, styleState, "");
@@ -7368,9 +7368,11 @@ var require_propMapper_native = __commonJS({
7368
7368
  var _theme_value, val = (_theme_value = theme == null ? void 0 : theme[value]) !== null && _theme_value !== void 0 ? _theme_value : tokensParsed[customTokenAccept][value];
7369
7369
  val != null && (resolveAs = "value", valOrVar = val, hasSet = !0);
7370
7370
  }
7371
- if (theme && value in theme)
7372
- valOrVar = theme[value], process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info(" - resolving ".concat(key, " to theme value ").concat(value, ": ").concat(valOrVar == null ? void 0 : valOrVar.val)), hasSet = !0;
7373
- else {
7371
+ if (theme && value in theme) {
7372
+ if (valOrVar = theme[value], styleState.skipThemeTokenResolution && valOrVar != null && valOrVar.val)
7373
+ return process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info(" - keep original value: ".concat(value, " for ").concat(key, " due to enableFlattenThemeOnNative: true")), value;
7374
+ process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.info(" - resolving ".concat(key, " to theme value ").concat(value, ": ").concat(valOrVar == null ? void 0 : valOrVar.val)), hasSet = !0;
7375
+ } else {
7374
7376
  if (value in conf.specificTokens)
7375
7377
  hasSet = !0, valOrVar = conf.specificTokens[value];
7376
7378
  else {
@@ -7634,7 +7636,7 @@ var require_getSplitStyles_native = __commonJS({
7634
7636
  var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
7635
7637
  return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
7636
7638
  }
7637
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) {
7639
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug, skipThemeTokenResolution) {
7638
7640
  conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
7639
7641
  var shorthands = conf.shorthands, isHOC = staticConfig.isHOC, isText = staticConfig.isText, isInput = staticConfig.isInput, variants = staticConfig.variants, isReactNative = staticConfig.isReactNative, inlineProps = staticConfig.inlineProps, inlineWhenUnflattened = staticConfig.inlineWhenUnflattened, parentStaticConfig = staticConfig.parentStaticConfig, acceptsClassName = staticConfig.acceptsClassName, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
7640
7642
  curProps: {},
@@ -7649,7 +7651,8 @@ var require_getSplitStyles_native = __commonJS({
7649
7651
  usedKeys,
7650
7652
  viewProps,
7651
7653
  context,
7652
- debug
7654
+ debug,
7655
+ skipThemeTokenResolution
7653
7656
  };
7654
7657
  process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
7655
7658
  props,
@@ -7729,7 +7732,7 @@ var require_getSplitStyles_native = __commonJS({
7729
7732
  if (!(isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))) {
7730
7733
  var shouldPassProp = !isStyleProp || // is in parent variants
7731
7734
  isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in import_skipProps.skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
7732
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupCollapsed(" \u{1F511} ".concat(keyOg).concat(keyInit !== keyOg ? " (shorthand for ".concat(keyInit, ")") : "", " ").concat(shouldPassThrough ? "(pass)" : "")), (0, import_log.log)({
7735
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), console.groupCollapsed(" \u{1F511} ".concat(keyOg).concat(keyInit !== keyOg ? " (shorthand for ".concat(keyInit, ")") : "", " ").concat(shouldPassThrough ? "(pass)" : "")), (0, import_log.log)({
7733
7736
  isVariant,
7734
7737
  valInit,
7735
7738
  shouldPassProp
@@ -9355,7 +9358,8 @@ var require_createComponent_native = __commonJS({
9355
9358
  props.accessibilityDisabled || !1;
9356
9359
  disabled != null && (initialState.disabled = disabled);
9357
9360
  var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? _object_spread_props(_object_spread2({}, states[0]), _define_property2({}, props.forceStyle, !0)) : states[0], setState = states[1];
9358
- disabled !== state.disabled && setState(_object_spread_props(_object_spread2({}, state), {
9361
+ disabled !== state.disabled && setState(_object_spread_props(_object_spread2({}, state, import_defaultComponentState.defaultComponentState), {
9362
+ // removes any stale press state etc
9359
9363
  disabled
9360
9364
  }));
9361
9365
  var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, debugProp);
@@ -9747,7 +9751,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9747
9751
  console.groupEnd();
9748
9752
  }
9749
9753
  } else {
9750
- (0, import_log.log)(title), import_isDevTools.isDevTools && (0, import_log.log)("viewProps", viewProps), (0, import_log.log)("final styles:");
9754
+ (0, import_log.log)(title), (0, import_log.log)("state: ", state), import_isDevTools.isDevTools && (0, import_log.log)("viewProps", viewProps), (0, import_log.log)("final styles:");
9751
9755
  for (var key2 in splitStylesStyle)
9752
9756
  (0, import_log.log)(key2, splitStylesStyle[key2]);
9753
9757
  }