@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.
@@ -3213,8 +3213,13 @@ var require_propMapper_native = __commonJS({
3213
3213
  });
3214
3214
  module2.exports = __toCommonJS2(propMapper_exports);
3215
3215
  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) => {
3216
+ var _a;
3216
3217
  if (!import_constants2.isAndroid && key === "elevationAndroid")
3217
3218
  return;
3219
+ if (value === "unset") {
3220
+ let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
3221
+ unsetVal != null && (value = unsetVal);
3222
+ }
3218
3223
  let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
3219
3224
  get(_, k) {
3220
3225
  return k === "curProps" ? subProps : Reflect.get(_, k);
@@ -3227,8 +3232,12 @@ var require_propMapper_native = __commonJS({
3227
3232
  return variantValue;
3228
3233
  }
3229
3234
  let shouldReturn = !1;
3230
- 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)
3231
- return (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [[key, value]];
3235
+ 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) {
3236
+ let result = (styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value)) || [
3237
+ [key, value]
3238
+ ];
3239
+ return key === "fontFamily" && fontFamilyCache.set(result, lastFontFamilyToken), result;
3240
+ }
3232
3241
  }, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
3233
3242
  let { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
3234
3243
  if (!variants)
@@ -3341,7 +3350,7 @@ var require_propMapper_native = __commonJS({
3341
3350
  var fontShorthand = {
3342
3351
  fontSize: "size",
3343
3352
  fontWeight: "weight"
3344
- }, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
3353
+ }, lastFontFamilyToken = null, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
3345
3354
  var _a, _b;
3346
3355
  if (resolveAs === "none")
3347
3356
  return value;
@@ -3353,7 +3362,7 @@ var require_propMapper_native = __commonJS({
3353
3362
  else {
3354
3363
  switch (key) {
3355
3364
  case "fontFamily": {
3356
- 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;
3365
+ 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;
3357
3366
  break;
3358
3367
  }
3359
3368
  case "fontSize":
@@ -3414,7 +3423,7 @@ var require_getSplitStyles_native = __commonJS({
3414
3423
  useSplitStyles: () => useSplitStyles
3415
3424
  });
3416
3425
  module2.exports = __toCommonJS2(getSplitStyles_exports);
3417
- 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) => {
3426
+ 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) => {
3418
3427
  var _a, _b, _c, _e, _f, _g;
3419
3428
  conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
3420
3429
  let { shorthands } = conf, {
@@ -3427,7 +3436,7 @@ var require_getSplitStyles_native = __commonJS({
3427
3436
  parentStaticConfig,
3428
3437
  acceptsClassName
3429
3438
  } = 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 = {
3430
- curProps: Object.assign({}, props),
3439
+ curProps: { ...props },
3431
3440
  classNames,
3432
3441
  conf,
3433
3442
  props,
@@ -3501,7 +3510,7 @@ var require_getSplitStyles_native = __commonJS({
3501
3510
  isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps));
3502
3511
  if ((shouldPassProp || isHOCShouldPassThrough) && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps)
3503
3512
  continue;
3504
- if (isText && valInit && (keyInit === fontFamilyKey || keyInit === shorthands[fontFamilyKey]) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
3513
+ if (isText && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
3505
3514
  style[keyInit] = valInit;
3506
3515
  continue;
3507
3516
  }
@@ -3646,7 +3655,7 @@ var require_getSplitStyles_native = __commonJS({
3646
3655
  usedKeys,
3647
3656
  mediaState2[mediaKeyShort],
3648
3657
  importanceBump
3649
- ), key === fontFamilyKey && (styleState.fontFamily = mediaStyle.fontFamily);
3658
+ ), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
3650
3659
  }
3651
3660
  }
3652
3661
  continue;
@@ -5502,6 +5511,10 @@ ${runtimeStyles}`;
5502
5511
  animations: {},
5503
5512
  media: {},
5504
5513
  ...configIn,
5514
+ unset: {
5515
+ fontFamily: configIn.defaultFont ? defaultFont : void 0,
5516
+ ...configIn.unset
5517
+ },
5505
5518
  settings: {
5506
5519
  webContainerType: "size",
5507
5520
  ...configIn.settings
@@ -6088,6 +6101,7 @@ var require_Text_native = __commonJS({
6088
6101
  acceptsClassName: !0,
6089
6102
  isText: !0,
6090
6103
  defaultProps: {
6104
+ fontFamily: "unset",
6091
6105
  suppressHighlighting: !0
6092
6106
  },
6093
6107
  inlineWhenUnflattened: /* @__PURE__ */ new Set(["fontFamily"]),