@tamagui/core 1.138.4 → 1.138.6

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.cjs CHANGED
@@ -2597,14 +2597,16 @@ var propMapper = function(key, value, styleState, disabled, map) {
2597
2597
  return;
2598
2598
  }
2599
2599
  }
2600
- if (styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]), value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : isVariable(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), value != null) {
2600
+ styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
2601
+ var originalValue = value;
2602
+ if (value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : isVariable(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), value != null) {
2601
2603
  key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
2602
2604
  var expanded = styleProps.noExpand ? null : expandStyle(key, value);
2603
2605
  if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
2604
2606
  var [nkey, nvalue] = expanded[i];
2605
- map(nkey, nvalue);
2607
+ map(nkey, nvalue, originalValue);
2606
2608
  }
2607
- else map(key, value);
2609
+ else map(key, value, originalValue);
2608
2610
  }
2609
2611
  }
2610
2612
  }, resolveVariants = function(key, value, styleProps, styleState, parentVariantKey) {
@@ -2664,7 +2666,10 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
2664
2666
  if (!(!styleProps.noSkip && subKey in skipProps)) {
2665
2667
  if (staticConfig) {
2666
2668
  var _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, contextProps = ((_staticConfig_context = staticConfig.context) === null || _staticConfig_context === void 0 ? void 0 : _staticConfig_context.props) || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 || (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.props);
2667
- contextProps && subKey in contextProps && (styleState.overriddenContextProps || (styleState.overriddenContextProps = {}), styleState.overriddenContextProps[subKey] = val);
2669
+ if (contextProps && subKey in contextProps) {
2670
+ var _styleState, _styleState1;
2671
+ (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {}), styleState.overriddenContextProps[subKey] = val, (_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {}), styleState.originalContextPropValues[subKey] = val;
2672
+ }
2668
2673
  }
2669
2674
  if (styleProps.noExpand) res[subKey] = val;
2670
2675
  else if (variants && subKey in variants) {
@@ -2841,7 +2846,7 @@ function _type_of$2(obj) {
2841
2846
  "@swc/helpers - typeof";
2842
2847
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
2843
2848
  }
2844
- var conf, PROP_SPLIT = "-";
2849
+ var conf, styleOriginalValues = /* @__PURE__ */ new WeakMap(), PROP_SPLIT = "-";
2845
2850
  function normalizeGroupKey(key, groupContext) {
2846
2851
  var parts = key.split("-"), plen = parts.length;
2847
2852
  if (
@@ -2888,7 +2893,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2888
2893
  if (!noSkip && keyInit in skipProps) return "continue";
2889
2894
  (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
2890
2895
  var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
2891
- if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key4, val2) {
2896
+ if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key4, val2, originalVal) {
2892
2897
  var _parentStaticConfig_variants, isStyledContextProp = styledContext && key4 in styledContext;
2893
2898
  if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
2894
2899
  viewProps[key4] = val2;
@@ -2900,7 +2905,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2900
2905
  return;
2901
2906
  }
2902
2907
  if (!isHOC && isValidStyleKey(key4, validStyles$1, accept) || isAndroid && key4 === "elevation") {
2903
- mergeStyle(styleState, key4, val2, 1);
2908
+ mergeStyle(styleState, key4, val2, 1, false, originalVal);
2904
2909
  return;
2905
2910
  }
2906
2911
  if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, isMedia === "group" && (key4 = normalizeGroupKey(key4, groupContext)), (inlineProps == null ? void 0 : inlineProps.has(key4)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key4))) {
@@ -2927,7 +2932,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2927
2932
  {
2928
2933
  var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled2 = componentState[descriptorKey] === false;
2929
2934
  isExit && (isDisabled2 = !styleProps.isExiting), isEnter && componentState.unmounted === false && (isDisabled2 = true);
2930
- var importance = descriptor.priority;
2935
+ var importance = descriptor.priority, pseudoOriginalValues = styleOriginalValues.get(pseudoStyleObject);
2931
2936
  for (var pkey in pseudoStyleObject) {
2932
2937
  var _$val = pseudoStyleObject[pkey];
2933
2938
  if (isDisabled2) applyDefaultStyle(pkey, styleState);
@@ -2938,7 +2943,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2938
2943
  var _pseudos1, _key1;
2939
2944
  pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
2940
2945
  }
2941
- mergeStyle(styleState, pkey, _$val, importance);
2946
+ mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues == null ? void 0 : pseudoOriginalValues[pkey]);
2942
2947
  }
2943
2948
  }
2944
2949
  }
@@ -2957,10 +2962,10 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2957
2962
  var priority = mediaStylesSeen;
2958
2963
  if (mediaStylesSeen += 1, shouldDoClasses) ;
2959
2964
  else {
2960
- let mergeMediaStyle2 = function(key5, val3) {
2965
+ let mergeMediaStyle2 = function(key5, val3, originalVal2) {
2961
2966
  var _styleState4;
2962
2967
  (_styleState4 = styleState).style || (_styleState4.style = {});
2963
- var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState[mediaKeyShort], importanceBump);
2968
+ var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState[mediaKeyShort], importanceBump, debug, originalVal2);
2964
2969
  didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
2965
2970
  };
2966
2971
  var isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
@@ -2974,14 +2979,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2974
2979
  if (dynamicThemeAccess = true, isIos && getSetting("fastSchemeChange")) {
2975
2980
  var _styleState3;
2976
2981
  (_styleState3 = styleState).style || (_styleState3.style = {});
2977
- var scheme = mediaKeyShort, oppositeScheme = getOppositeScheme(mediaKeyShort);
2982
+ var scheme = mediaKeyShort, oppositeScheme = getOppositeScheme(mediaKeyShort), themeOriginalValues = styleOriginalValues.get(mediaStyle1);
2978
2983
  for (var subKey1 in mediaStyle1) {
2979
2984
  var _$val1 = extractValueFromDynamic(mediaStyle1[subKey1], scheme), oppositeVal = extractValueFromDynamic(styleState.style[subKey1], oppositeScheme);
2980
2985
  mediaStyle1[subKey1] = getDynamicVal({
2981
2986
  scheme,
2982
2987
  val: _$val1,
2983
2988
  oppositeVal
2984
- }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority);
2989
+ }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority, false, themeOriginalValues == null ? void 0 : themeOriginalValues[subKey1]);
2985
2990
  }
2986
2991
  } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
2987
2992
  } else if (isGroupMedia) {
@@ -3011,6 +3016,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
3011
3016
  importanceBump = priority1;
3012
3017
  }
3013
3018
  }
3019
+ var mediaOriginalValues = styleOriginalValues.get(mediaStyle1);
3014
3020
  for (var subKey2 in mediaStyle1) {
3015
3021
  if (subKey2 === "space") {
3016
3022
  space = valInit.space;
@@ -3018,8 +3024,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
3018
3024
  }
3019
3025
  if (subKey2[0] === "$") {
3020
3026
  if (!isActivePlatform(subKey2) || !isActiveTheme(subKey2, themeName)) continue;
3021
- for (var subSubKey in mediaStyle1[subKey2]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey2][subSubKey]);
3022
- } else mergeMediaStyle2(subKey2, mediaStyle1[subKey2]);
3027
+ var subOriginalValues = styleOriginalValues.get(mediaStyle1[subKey2]);
3028
+ for (var subSubKey in mediaStyle1[subKey2]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey2][subSubKey], subOriginalValues == null ? void 0 : subOriginalValues[subSubKey]);
3029
+ } else mergeMediaStyle2(subKey2, mediaStyle1[subKey2], mediaOriginalValues == null ? void 0 : mediaOriginalValues[subKey2]);
3023
3030
  }
3024
3031
  }
3025
3032
  return;
@@ -3151,7 +3158,7 @@ function mergeFlatTransforms(target, flatTransforms) {
3151
3158
  });
3152
3159
  }
3153
3160
  function mergeStyle(styleState, key, val, importance) {
3154
- var _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, {
3161
+ var originalVal = arguments.length > 5 ? arguments[5] : void 0, _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, {
3155
3162
  viewProps,
3156
3163
  styleProps,
3157
3164
  staticConfig,
@@ -3160,8 +3167,10 @@ function mergeStyle(styleState, key, val, importance) {
3160
3167
  if (!(existingImportance > importance)) {
3161
3168
  var contextProps = ((_staticConfig_context = staticConfig.context) === null || _staticConfig_context === void 0 ? void 0 : _staticConfig_context.props) || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 || (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.props);
3162
3169
  if (contextProps && key in contextProps) {
3163
- var _styleState;
3164
- (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {}), styleState.overriddenContextProps[key] = val;
3170
+ var _styleState_originalContextPropValues, _styleState;
3171
+ (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
3172
+ var originalFromState = (_styleState_originalContextPropValues = styleState.originalContextPropValues) === null || _styleState_originalContextPropValues === void 0 ? void 0 : _styleState_originalContextPropValues[key], _ref;
3173
+ styleState.overriddenContextProps[key] = (_ref = originalVal != null ? originalVal : originalFromState) !== null && _ref !== void 0 ? _ref : val;
3165
3174
  }
3166
3175
  if (key in stylePropsTransform) {
3167
3176
  var _styleState1;
@@ -3187,14 +3196,14 @@ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
3187
3196
  key1 = conf2.shorthands[key1] || key1;
3188
3197
  var shouldSkip = !staticConfig.isHOC && key1 in skipProps && !styleProps.noSkip;
3189
3198
  if (shouldSkip) return key = key1, "continue";
3190
- propMapper(key1, val, styleState, false, function(skey, sval) {
3191
- skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval);
3199
+ propMapper(key1, val, styleState, false, function(skey, sval, originalVal) {
3200
+ originalVal !== void 0 && (originalValues || (originalValues = {}), originalValues[skey] = originalVal), skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval);
3192
3201
  }), key = key1;
3193
3202
  }, {
3194
3203
  staticConfig,
3195
3204
  conf: conf2,
3196
3205
  styleProps
3197
- } = styleState, styleOut = {};
3206
+ } = styleState, styleOut = {}, originalValues;
3198
3207
  for (var key in styleIn) _loop2(key);
3199
3208
  if (!avoidMergeTransform) {
3200
3209
  if (Array.isArray(styleOut.transform)) {
@@ -3203,7 +3212,7 @@ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
3203
3212
  }
3204
3213
  styleState.flatTransforms && mergeFlatTransforms(styleOut, styleState.flatTransforms);
3205
3214
  }
3206
- return styleProps.noNormalize || fixStyles(styleOut), styleOut;
3215
+ return styleProps.noNormalize || fixStyles(styleOut), originalValues && styleOriginalValues.set(styleOut, originalValues), styleOut;
3207
3216
  }, useSplitStyles = function(a, b2, c, d, e2, f, g, h2, i, j, k, l) {
3208
3217
  var res = getSplitStyles(a, b2, c, d, e2, f, g, h2, i, j, k, l);
3209
3218
  return res;
@@ -3240,15 +3249,16 @@ function passDownProp(viewProps, key, val) {
3240
3249
  delete viewProps[key], viewProps[key] = next;
3241
3250
  } else viewProps[key] = val;
3242
3251
  }
3243
- function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp) {
3252
+ function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp, originalVal) {
3244
3253
  styleState.usedKeys;
3245
3254
  var importance = getMediaImportanceIfMoreImportant(mediaKey, key, styleState, isSizeMedia);
3246
3255
  if (importanceBump && (importance = (importance || 0) + importanceBump), importance === null) return false;
3247
3256
  if (key in pseudoDescriptors) {
3248
3257
  var descriptor = pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled2 = styleState.componentState[descriptorKey] === false;
3249
3258
  if (isDisabled2) return false;
3250
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
3251
- } else mergeStyle(styleState, key, value, importance);
3259
+ var pseudoOriginalValues = styleOriginalValues.get(value);
3260
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance, false, pseudoOriginalValues == null ? void 0 : pseudoOriginalValues[subKey]);
3261
+ } else mergeStyle(styleState, key, value, importance, false, originalVal);
3252
3262
  return true;
3253
3263
  }
3254
3264
  function normalizeStyle(style) {
@@ -5568,6 +5578,7 @@ exports.shouldRenderNativePlatform = shouldRenderNativePlatform;
5568
5578
  exports.simpleHash = simpleHash;
5569
5579
  exports.spacedChildren = spacedChildren;
5570
5580
  exports.stackDefaultStyles = stackDefaultStyles;
5581
+ exports.styleOriginalValues = styleOriginalValues;
5571
5582
  exports.stylePropsAll = stylePropsAll;
5572
5583
  exports.stylePropsText = stylePropsText;
5573
5584
  exports.stylePropsTextOnly = stylePropsTextOnly;
@@ -2422,14 +2422,16 @@ var propMapper = function(key, value, styleState, disabled, map) {
2422
2422
  return;
2423
2423
  }
2424
2424
  }
2425
- if (styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]), value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : isVariable(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), value != null) {
2425
+ styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
2426
+ var originalValue = value;
2427
+ if (value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : isVariable(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), value != null) {
2426
2428
  key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
2427
2429
  var expanded = styleProps.noExpand ? null : expandStyle(key, value);
2428
2430
  if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
2429
2431
  var [nkey, nvalue] = expanded[i];
2430
- map(nkey, nvalue);
2432
+ map(nkey, nvalue, originalValue);
2431
2433
  }
2432
- else map(key, value);
2434
+ else map(key, value, originalValue);
2433
2435
  }
2434
2436
  }
2435
2437
  }, resolveVariants = function(key, value, styleProps, styleState, parentVariantKey) {
@@ -2489,7 +2491,10 @@ var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVar
2489
2491
  if (!(!styleProps.noSkip && subKey in skipProps)) {
2490
2492
  if (staticConfig) {
2491
2493
  var _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, contextProps = ((_staticConfig_context = staticConfig.context) === null || _staticConfig_context === void 0 ? void 0 : _staticConfig_context.props) || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 || (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.props);
2492
- contextProps && subKey in contextProps && (styleState.overriddenContextProps || (styleState.overriddenContextProps = {}), styleState.overriddenContextProps[subKey] = val);
2494
+ if (contextProps && subKey in contextProps) {
2495
+ var _styleState, _styleState1;
2496
+ (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {}), styleState.overriddenContextProps[subKey] = val, (_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {}), styleState.originalContextPropValues[subKey] = val;
2497
+ }
2493
2498
  }
2494
2499
  if (styleProps.noExpand) res[subKey] = val;
2495
2500
  else if (variants && subKey in variants) {
@@ -2666,7 +2671,7 @@ function _type_of$2(obj) {
2666
2671
  "@swc/helpers - typeof";
2667
2672
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
2668
2673
  }
2669
- var conf, PROP_SPLIT = "-";
2674
+ var conf, styleOriginalValues = /* @__PURE__ */ new WeakMap(), PROP_SPLIT = "-";
2670
2675
  function normalizeGroupKey(key, groupContext) {
2671
2676
  var parts = key.split("-"), plen = parts.length;
2672
2677
  if (
@@ -2714,7 +2719,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2714
2719
  if (!noSkip && keyInit in skipProps) return "continue";
2715
2720
  (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
2716
2721
  var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
2717
- if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key4, val2) {
2722
+ if (propMapper(keyInit, valInit, styleState, disablePropMap, function(key4, val2, originalVal) {
2718
2723
  var _parentStaticConfig_variants, isStyledContextProp = styledContext && key4 in styledContext;
2719
2724
  if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
2720
2725
  viewProps[key4] = val2;
@@ -2726,7 +2731,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2726
2731
  return;
2727
2732
  }
2728
2733
  if (!isHOC && isValidStyleKey(key4, validStyles$1, accept) || isAndroid && key4 === "elevation") {
2729
- mergeStyle(styleState, key4, val2, 1);
2734
+ mergeStyle(styleState, key4, val2, 1, false, originalVal);
2730
2735
  return;
2731
2736
  }
2732
2737
  if (isPseudo = key4 in validPseudoKeys, isMedia = isPseudo ? false : getMediaKey(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, isMedia === "group" && (key4 = normalizeGroupKey(key4, groupContext)), (inlineProps == null ? void 0 : inlineProps.has(key4)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key4))) {
@@ -2753,7 +2758,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2753
2758
  {
2754
2759
  var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled2 = componentState[descriptorKey] === false;
2755
2760
  isExit && (isDisabled2 = !styleProps.isExiting), isEnter && componentState.unmounted === false && (isDisabled2 = true);
2756
- var importance = descriptor.priority;
2761
+ var importance = descriptor.priority, pseudoOriginalValues = styleOriginalValues.get(pseudoStyleObject);
2757
2762
  for (var pkey in pseudoStyleObject) {
2758
2763
  var _$val = pseudoStyleObject[pkey];
2759
2764
  if (isDisabled2) applyDefaultStyle(pkey, styleState);
@@ -2764,7 +2769,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2764
2769
  var _pseudos1, _key1;
2765
2770
  pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
2766
2771
  }
2767
- mergeStyle(styleState, pkey, _$val, importance);
2772
+ mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues == null ? void 0 : pseudoOriginalValues[pkey]);
2768
2773
  }
2769
2774
  }
2770
2775
  }
@@ -2783,10 +2788,10 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2783
2788
  var priority = mediaStylesSeen;
2784
2789
  if (mediaStylesSeen += 1, shouldDoClasses) ;
2785
2790
  else {
2786
- let mergeMediaStyle2 = function(key5, val3) {
2791
+ let mergeMediaStyle2 = function(key5, val3, originalVal2) {
2787
2792
  var _styleState4;
2788
2793
  (_styleState4 = styleState).style || (_styleState4.style = {});
2789
- var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState[mediaKeyShort], importanceBump);
2794
+ var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState[mediaKeyShort], importanceBump, debug, originalVal2);
2790
2795
  didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
2791
2796
  };
2792
2797
  var isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
@@ -2800,14 +2805,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2800
2805
  if (dynamicThemeAccess = true, isIos && getSetting("fastSchemeChange")) {
2801
2806
  var _styleState3;
2802
2807
  (_styleState3 = styleState).style || (_styleState3.style = {});
2803
- var scheme = mediaKeyShort, oppositeScheme = getOppositeScheme(mediaKeyShort);
2808
+ var scheme = mediaKeyShort, oppositeScheme = getOppositeScheme(mediaKeyShort), themeOriginalValues = styleOriginalValues.get(mediaStyle1);
2804
2809
  for (var subKey1 in mediaStyle1) {
2805
2810
  var _$val1 = extractValueFromDynamic(mediaStyle1[subKey1], scheme), oppositeVal = extractValueFromDynamic(styleState.style[subKey1], oppositeScheme);
2806
2811
  mediaStyle1[subKey1] = getDynamicVal({
2807
2812
  scheme,
2808
2813
  val: _$val1,
2809
2814
  oppositeVal
2810
- }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority);
2815
+ }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority, false, themeOriginalValues == null ? void 0 : themeOriginalValues[subKey1]);
2811
2816
  }
2812
2817
  } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
2813
2818
  } else if (isGroupMedia) {
@@ -2837,6 +2842,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2837
2842
  importanceBump = priority1;
2838
2843
  }
2839
2844
  }
2845
+ var mediaOriginalValues = styleOriginalValues.get(mediaStyle1);
2840
2846
  for (var subKey2 in mediaStyle1) {
2841
2847
  if (subKey2 === "space") {
2842
2848
  space = valInit.space;
@@ -2844,8 +2850,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
2844
2850
  }
2845
2851
  if (subKey2[0] === "$") {
2846
2852
  if (!isActivePlatform(subKey2) || !isActiveTheme(subKey2, themeName)) continue;
2847
- for (var subSubKey in mediaStyle1[subKey2]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey2][subSubKey]);
2848
- } else mergeMediaStyle2(subKey2, mediaStyle1[subKey2]);
2853
+ var subOriginalValues = styleOriginalValues.get(mediaStyle1[subKey2]);
2854
+ for (var subSubKey in mediaStyle1[subKey2]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey2][subSubKey], subOriginalValues == null ? void 0 : subOriginalValues[subSubKey]);
2855
+ } else mergeMediaStyle2(subKey2, mediaStyle1[subKey2], mediaOriginalValues == null ? void 0 : mediaOriginalValues[subKey2]);
2849
2856
  }
2850
2857
  }
2851
2858
  return;
@@ -2977,7 +2984,7 @@ function mergeFlatTransforms(target, flatTransforms) {
2977
2984
  });
2978
2985
  }
2979
2986
  function mergeStyle(styleState, key, val, importance) {
2980
- var _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, {
2987
+ var originalVal = arguments.length > 5 ? arguments[5] : void 0, _staticConfig_context, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig, {
2981
2988
  viewProps,
2982
2989
  styleProps,
2983
2990
  staticConfig,
@@ -2986,8 +2993,10 @@ function mergeStyle(styleState, key, val, importance) {
2986
2993
  if (!(existingImportance > importance)) {
2987
2994
  var contextProps = ((_staticConfig_context = staticConfig.context) === null || _staticConfig_context === void 0 ? void 0 : _staticConfig_context.props) || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 || (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.props);
2988
2995
  if (contextProps && key in contextProps) {
2989
- var _styleState;
2990
- (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {}), styleState.overriddenContextProps[key] = val;
2996
+ var _styleState_originalContextPropValues, _styleState;
2997
+ (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
2998
+ var originalFromState = (_styleState_originalContextPropValues = styleState.originalContextPropValues) === null || _styleState_originalContextPropValues === void 0 ? void 0 : _styleState_originalContextPropValues[key], _ref;
2999
+ styleState.overriddenContextProps[key] = (_ref = originalVal != null ? originalVal : originalFromState) !== null && _ref !== void 0 ? _ref : val;
2991
3000
  }
2992
3001
  if (key in stylePropsTransform) {
2993
3002
  var _styleState1;
@@ -3013,14 +3022,14 @@ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
3013
3022
  key1 = conf2.shorthands[key1] || key1;
3014
3023
  var shouldSkip = !staticConfig.isHOC && key1 in skipProps && !styleProps.noSkip;
3015
3024
  if (shouldSkip) return key = key1, "continue";
3016
- propMapper(key1, val, styleState, false, function(skey, sval) {
3017
- skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval);
3025
+ propMapper(key1, val, styleState, false, function(skey, sval, originalVal) {
3026
+ originalVal !== void 0 && (originalValues || (originalValues = {}), originalValues[skey] = originalVal), skey in validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : normalizeValueWithProperty(sval);
3018
3027
  }), key = key1;
3019
3028
  }, {
3020
3029
  staticConfig,
3021
3030
  conf: conf2,
3022
3031
  styleProps
3023
- } = styleState, styleOut = {};
3032
+ } = styleState, styleOut = {}, originalValues;
3024
3033
  for (var key in styleIn) _loop2(key);
3025
3034
  if (!avoidMergeTransform) {
3026
3035
  if (Array.isArray(styleOut.transform)) {
@@ -3029,7 +3038,7 @@ var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
3029
3038
  }
3030
3039
  styleState.flatTransforms && mergeFlatTransforms(styleOut, styleState.flatTransforms);
3031
3040
  }
3032
- return styleProps.noNormalize || fixStyles(styleOut), styleOut;
3041
+ return styleProps.noNormalize || fixStyles(styleOut), originalValues && styleOriginalValues.set(styleOut, originalValues), styleOut;
3033
3042
  }, useSplitStyles = function(a, b2, c, d, e2, f, g, h2, i, j, k, l) {
3034
3043
  var res = getSplitStyles(a, b2, c, d, e2, f, g, h2, i, j, k, l);
3035
3044
  return res;
@@ -3066,15 +3075,16 @@ function passDownProp(viewProps, key, val) {
3066
3075
  delete viewProps[key], viewProps[key] = next;
3067
3076
  } else viewProps[key] = val;
3068
3077
  }
3069
- function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp) {
3078
+ function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp, originalVal) {
3070
3079
  styleState.usedKeys;
3071
3080
  var importance = getMediaImportanceIfMoreImportant(mediaKey, key, styleState, isSizeMedia);
3072
3081
  if (importanceBump && (importance = (importance || 0) + importanceBump), importance === null) return false;
3073
3082
  if (key in pseudoDescriptors) {
3074
3083
  var descriptor = pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled2 = styleState.componentState[descriptorKey] === false;
3075
3084
  if (isDisabled2) return false;
3076
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
3077
- } else mergeStyle(styleState, key, value, importance);
3085
+ var pseudoOriginalValues = styleOriginalValues.get(value);
3086
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance, false, pseudoOriginalValues == null ? void 0 : pseudoOriginalValues[subKey]);
3087
+ } else mergeStyle(styleState, key, value, importance, false, originalVal);
3078
3088
  return true;
3079
3089
  }
3080
3090
  function normalizeStyle(style) {
@@ -5321,6 +5331,7 @@ exports.shouldRenderNativePlatform = shouldRenderNativePlatform;
5321
5331
  exports.simpleHash = simpleHash;
5322
5332
  exports.spacedChildren = spacedChildren;
5323
5333
  exports.stackDefaultStyles = stackDefaultStyles;
5334
+ exports.styleOriginalValues = styleOriginalValues;
5324
5335
  exports.stylePropsAll = stylePropsAll;
5325
5336
  exports.stylePropsText = stylePropsText;
5326
5337
  exports.stylePropsTextOnly = stylePropsTextOnly;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.138.4",
3
+ "version": "1.138.6",
4
4
  "type": "module",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/cjs",
@@ -33,18 +33,18 @@
33
33
  "native-test.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@tamagui/helpers": "1.138.4",
37
- "@tamagui/react-native-media-driver": "1.138.4",
38
- "@tamagui/react-native-use-pressable": "1.138.4",
39
- "@tamagui/react-native-use-responder-events": "1.138.4",
40
- "@tamagui/use-element-layout": "1.138.4",
41
- "@tamagui/use-event": "1.138.4",
42
- "@tamagui/web": "1.138.4"
36
+ "@tamagui/helpers": "1.138.6",
37
+ "@tamagui/react-native-media-driver": "1.138.6",
38
+ "@tamagui/react-native-use-pressable": "1.138.6",
39
+ "@tamagui/react-native-use-responder-events": "1.138.6",
40
+ "@tamagui/use-element-layout": "1.138.6",
41
+ "@tamagui/use-event": "1.138.6",
42
+ "@tamagui/web": "1.138.6"
43
43
  },
44
44
  "devDependencies": {
45
- "@tamagui/build": "1.138.4",
46
- "@tamagui/native-bundle": "1.138.4",
47
- "@tamagui/react-native-web-lite": "1.138.4",
45
+ "@tamagui/build": "1.138.6",
46
+ "@tamagui/native-bundle": "1.138.6",
47
+ "@tamagui/react-native-web-lite": "1.138.6",
48
48
  "@testing-library/react": "^16.1.0",
49
49
  "csstype": "^3.0.10",
50
50
  "react": "*",