@tamagui/core 1.77.0 → 1.78.0

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
@@ -3290,8 +3290,13 @@ var require_propMapper_native = __commonJS({
3290
3290
  });
3291
3291
  module2.exports = __toCommonJS2(propMapper_exports);
3292
3292
  var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStylesAndRemoveNullishValues = require_expandStylesAndRemoveNullishValues_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
3293
+ var _a;
3293
3294
  if (!import_constants2.isAndroid && key === "elevationAndroid")
3294
3295
  return;
3296
+ if (value === "unset") {
3297
+ let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
3298
+ unsetVal != null && (value = unsetVal);
3299
+ }
3295
3300
  let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
3296
3301
  get(_, k) {
3297
3302
  return k === "curProps" ? subProps : Reflect.get(_, k);
@@ -3308,8 +3313,12 @@ var require_propMapper_native = __commonJS({
3308
3313
  return variantValue;
3309
3314
  }
3310
3315
  let shouldReturn = !1;
3311
- 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)
3312
- return (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [[key, value]];
3316
+ 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) {
3317
+ let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
3318
+ [key, value]
3319
+ ];
3320
+ return key === "fontFamily" && fontFamilyCache.set(result, lastFontFamilyToken), result;
3321
+ }
3313
3322
  }, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
3314
3323
  let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
3315
3324
  if (!variants)
@@ -3435,7 +3444,7 @@ var require_propMapper_native = __commonJS({
3435
3444
  var fontShorthand = {
3436
3445
  fontSize: "size",
3437
3446
  fontWeight: "weight"
3438
- }, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
3447
+ }, lastFontFamilyToken = null, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
3439
3448
  var _a, _b;
3440
3449
  if (resolveAs === "none")
3441
3450
  return value;
@@ -3447,7 +3456,7 @@ var require_propMapper_native = __commonJS({
3447
3456
  else {
3448
3457
  switch (key) {
3449
3458
  case "fontFamily": {
3450
- valOrVar = ((_a = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]) == null ? void 0 : _a.family) || value, hasSet = !0;
3459
+ valOrVar = ((_a = (context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]) == null ? void 0 : _a.family) || value, lastFontFamilyToken = value, hasSet = !0;
3451
3460
  break;
3452
3461
  }
3453
3462
  case "fontSize":
@@ -3512,7 +3521,7 @@ var require_getSplitStyles_native = __commonJS({
3512
3521
  useSplitStyles: () => useSplitStyles
3513
3522
  });
3514
3523
  module2.exports = __toCommonJS2(getSplitStyles_exports);
3515
- var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3524
+ var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react3 = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3516
3525
  var _a, _b, _c, _e, _f, _g;
3517
3526
  conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
3518
3527
  let { shorthands } = conf, {
@@ -3525,7 +3534,7 @@ var require_getSplitStyles_native = __commonJS({
3525
3534
  parentStaticConfig,
3526
3535
  acceptsClassName
3527
3536
  } = staticConfig, validStyleProps = isText ? import_helpers.stylePropsText : import_helpers.validStyles, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = "", mediaStylesSeen = 0, styleState = {
3528
- curProps: Object.assign({}, props),
3537
+ curProps: { ...props },
3529
3538
  classNames,
3530
3539
  conf,
3531
3540
  props,
@@ -3617,7 +3626,7 @@ var require_getSplitStyles_native = __commonJS({
3617
3626
  parentStaticConfig
3618
3627
  }), console.groupEnd()), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps)
3619
3628
  continue;
3620
- if (isText && valInit && (keyInit === fontFamilyKey || keyInit === shorthands[fontFamilyKey]) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
3629
+ if (isText && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
3621
3630
  style[keyInit] = valInit;
3622
3631
  continue;
3623
3632
  }
@@ -3810,7 +3819,7 @@ current`, {
3810
3819
  usedKeys,
3811
3820
  mediaState2[mediaKeyShort],
3812
3821
  importanceBump
3813
- ), key === fontFamilyKey && (styleState.fontFamily = mediaStyle.fontFamily);
3822
+ ), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
3814
3823
  }
3815
3824
  }
3816
3825
  continue;
@@ -5865,6 +5874,10 @@ ${runtimeStyles}`;
5865
5874
  animations: {},
5866
5875
  media: {},
5867
5876
  ...configIn,
5877
+ unset: {
5878
+ fontFamily: configIn.defaultFont ? defaultFont : void 0,
5879
+ ...configIn.unset
5880
+ },
5868
5881
  settings: {
5869
5882
  webContainerType: "size",
5870
5883
  ...configIn.settings
@@ -6451,6 +6464,7 @@ var require_Text_native = __commonJS({
6451
6464
  acceptsClassName: !0,
6452
6465
  isText: !0,
6453
6466
  defaultProps: {
6467
+ fontFamily: "unset",
6454
6468
  suppressHighlighting: !0
6455
6469
  },
6456
6470
  inlineWhenUnflattened: /* @__PURE__ */ new Set(["fontFamily"]),