@tamagui/core 2.4.4 → 2.4.5-1784076621864

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.
@@ -1,4 +1,4 @@
1
1
  $ tamagui-build
2
- built @tamagui/core in 2060 ms
2
+ built @tamagui/core in 1631 ms
3
3
  Running afterBuild script...
4
- afterBuild completed in 917 ms
4
+ afterBuild completed in 329 ms
package/dist/native.cjs CHANGED
@@ -13257,6 +13257,10 @@ var init_useThemeState_native = __esmMin((() => {
13257
13257
  (0, react.useEffect)(function() {
13258
13258
  var r = ref.current;
13259
13259
  var renderVersion = r.renderVersion;
13260
+ if (r.lastSnap && !states.has(r.id)) {
13261
+ states.set(r.id, r.lastSnap);
13262
+ localStates.set(r.id, r.lastSnap);
13263
+ }
13260
13264
  if (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);
13261
13265
  if (shouldSubscribeToTheme(r, cascadeOnChange)) {
13262
13266
  if (!r.unsubscribe) {
@@ -15320,6 +15324,25 @@ var init_sortString_native = __esmMin((() => {
15320
15324
  };
15321
15325
  }));
15322
15326
  //#endregion
15327
+ //#region ../web/dist/esm/helpers/styleProvenance.native.js
15328
+ function setStyleTokenProvenance(style, provenance) {
15329
+ Object.defineProperty(style, provenanceSymbol, {
15330
+ value: provenance,
15331
+ enumerable: false,
15332
+ configurable: true,
15333
+ writable: true
15334
+ });
15335
+ }
15336
+ function getStyleTokenProvenance(style) {
15337
+ if (!style) return void 0;
15338
+ return style[provenanceSymbol];
15339
+ }
15340
+ var STYLE_TOKEN_PROVENANCE_KEY, provenanceSymbol;
15341
+ var init_styleProvenance_native = __esmMin((() => {
15342
+ STYLE_TOKEN_PROVENANCE_KEY = "tamagui.styleTokenProvenance";
15343
+ provenanceSymbol = /* @__PURE__ */ Symbol.for(STYLE_TOKEN_PROVENANCE_KEY);
15344
+ }));
15345
+ //#endregion
15323
15346
  //#region ../web/dist/esm/helpers/transformsToString.native.js
15324
15347
  function transformsToString(transforms) {
15325
15348
  return transforms.map(function(transform) {
@@ -15394,9 +15417,16 @@ function mergeStyle(styleState, key, val, importance) {
15394
15417
  (_styleState2 = styleState).style || (_styleState2.style = {});
15395
15418
  usedKeys[key] = importance;
15396
15419
  styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
15420
+ if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
15397
15421
  }
15398
15422
  }
15399
15423
  }
15424
+ function recordStyleTokenProvenance(styleState, key, originalVal) {
15425
+ if (typeof originalVal === "string" && originalVal[0] === "$") {
15426
+ var _styleState;
15427
+ ((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
15428
+ } else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
15429
+ }
15400
15430
  function passDownProp(viewProps, key, val) {
15401
15431
  if (arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false) {
15402
15432
  var next = _objectSpread2(_objectSpread2({}, viewProps[key]), val);
@@ -15435,7 +15465,7 @@ function applyDefaultStyle(pkey, styleState) {
15435
15465
  var defaultValues = animatableDefaults[pkey];
15436
15466
  if (defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style))) mergeStyle(styleState, pkey, defaultValues, 1);
15437
15467
  }
15438
- var conf, PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles, defaultColor, animatableDefaults, mergeTransform, mapTransformKeys;
15468
+ var shouldTrackStyleTokenProvenance, conf, PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles, defaultColor, animatableDefaults, mergeTransform, mapTransformKeys;
15439
15469
  var init_getSplitStyles_native = __esmMin((() => {
15440
15470
  init_index_native$7();
15441
15471
  init_index_native$5();
@@ -15456,8 +15486,10 @@ var init_getSplitStyles_native = __esmMin((() => {
15456
15486
  init_skipProps_native();
15457
15487
  init_sortString_native();
15458
15488
  init_styleOriginalValues_native();
15489
+ init_styleProvenance_native();
15459
15490
  init_transformsToString_native();
15460
15491
  init_objectSpread2();
15492
+ shouldTrackStyleTokenProvenance = false;
15461
15493
  PROP_SPLIT = "-";
15462
15494
  getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
15463
15495
  var _loop = function(keyOg2) {
@@ -15526,51 +15558,51 @@ var init_getSplitStyles_native = __esmMin((() => {
15526
15558
  if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
15527
15559
  }
15528
15560
  var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
15529
- propMapper(keyInit, valInit, styleState, disablePropMap, function(key5, val2, originalVal) {
15561
+ propMapper(keyInit, valInit, styleState, disablePropMap, function(key6, val2, originalVal) {
15530
15562
  var _parentStaticConfig_variants;
15531
- var isStyledContextProp = styledContext && key5 in styledContext;
15563
+ var isStyledContextProp = styledContext && key6 in styledContext;
15532
15564
  if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
15533
- viewProps[key5] = val2;
15565
+ viewProps[key6] = val2;
15534
15566
  return;
15535
15567
  }
15536
15568
  if (val2 == null) return;
15537
- if (key5 === "pointerEvents") {
15538
- viewProps[key5] = val2;
15569
+ if (key6 === "pointerEvents") {
15570
+ viewProps[key6] = val2;
15539
15571
  return;
15540
15572
  }
15541
- if (!isHOC && isValidStyleKey(key5, validStyles$1, accept) || isAndroid && key5 === "elevation") {
15542
- mergeStyle(styleState, key5, val2, 1, false, originalVal);
15573
+ if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
15574
+ mergeStyle(styleState, key6, val2, 1, false, originalVal);
15543
15575
  return;
15544
15576
  }
15545
- isPseudo = key5 in validPseudoKeys;
15546
- isMedia = isPseudo ? false : getMediaKey(key5);
15577
+ isPseudo = key6 in validPseudoKeys;
15578
+ isMedia = isPseudo ? false : getMediaKey(key6);
15547
15579
  isMediaOrPseudo = Boolean(isMedia || isPseudo);
15548
- isVariant = variants && key5 in variants;
15549
- if (isMedia === "group") key5 = normalizeGroupKey(key5, groupContext);
15550
- if (shouldSkipNativeHoverProp(key5, isMedia)) return;
15551
- if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key5)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened === null || inlineWhenUnflattened === void 0 ? void 0 : inlineWhenUnflattened.has(key5))) {
15580
+ isVariant = variants && key6 in variants;
15581
+ if (isMedia === "group") key6 = normalizeGroupKey(key6, groupContext);
15582
+ if (shouldSkipNativeHoverProp(key6, isMedia)) return;
15583
+ if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key6)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened === null || inlineWhenUnflattened === void 0 ? void 0 : inlineWhenUnflattened.has(key6))) {
15552
15584
  var _props_key;
15553
- viewProps[key5] = (_props_key = props[key5]) !== null && _props_key !== void 0 ? _props_key : val2;
15585
+ viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
15554
15586
  }
15555
15587
  if (styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]))) {
15556
- passDownProp(viewProps, key5, val2, isMediaOrPseudo);
15588
+ passDownProp(viewProps, key6, val2, isMediaOrPseudo);
15557
15589
  return;
15558
15590
  }
15559
15591
  if (isPseudo) {
15560
15592
  if (!val2) return;
15561
- var pseudoStyleObject = getSubStyle(styleState, key5, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
15593
+ var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
15562
15594
  if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
15563
15595
  var _pseudos, _key;
15564
15596
  pseudos || (pseudos = {});
15565
- (_pseudos = pseudos)[_key = key5] || (_pseudos[_key] = {});
15597
+ (_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
15566
15598
  if (process.env.IS_STATIC === "is_static") {
15567
- Object.assign(pseudos[key5], pseudoStyleObject);
15599
+ Object.assign(pseudos[key6], pseudoStyleObject);
15568
15600
  return;
15569
15601
  }
15570
15602
  }
15571
- var descriptor = pseudoDescriptors[key5];
15572
- var isEnter = key5 === "enterStyle";
15573
- var isExit = key5 === "exitStyle";
15603
+ var descriptor = pseudoDescriptors[key6];
15604
+ var isEnter = key6 === "enterStyle";
15605
+ var isExit = key6 === "exitStyle";
15574
15606
  if (!descriptor) return;
15575
15607
  if (shouldDoClasses && !isExit) {
15576
15608
  var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
@@ -15605,34 +15637,34 @@ var init_getSplitStyles_native = __esmMin((() => {
15605
15637
  if (process.env.IS_STATIC === "is_static") {
15606
15638
  var _pseudos1, _key1;
15607
15639
  pseudos || (pseudos = {});
15608
- (_pseudos1 = pseudos)[_key1 = key5] || (_pseudos1[_key1] = {});
15609
- pseudos[key5][pkey] = _$val;
15640
+ (_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
15641
+ pseudos[key6][pkey] = _$val;
15610
15642
  }
15611
15643
  mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
15612
15644
  }
15613
15645
  }
15614
15646
  if (!isDisabled) for (var _$key in val2) {
15615
- var k = shorthands[_$key] || _$key;
15616
- styleState.usedKeys[k] = Math.max(importance, styleState.usedKeys[k] || 0);
15647
+ var k2 = shorthands[_$key] || _$key;
15648
+ styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
15617
15649
  }
15618
15650
  }
15619
15651
  return;
15620
15652
  }
15621
15653
  if (isMedia) {
15622
15654
  if (!val2) return;
15623
- var mediaKeyShort = key5.slice(isMedia == "theme" ? 7 : 1);
15655
+ var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
15624
15656
  hasMedia || (hasMedia = true);
15625
15657
  if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
15626
15658
  if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */ new Set();
15627
15659
  hasMedia.add(mediaKeyShort);
15628
15660
  }
15629
15661
  if (isMedia === "platform") {
15630
- if (!isActivePlatform(key5)) return;
15662
+ if (!isActivePlatform(key6)) return;
15631
15663
  }
15632
15664
  var priority = mediaStylesSeen;
15633
15665
  mediaStylesSeen += 1;
15634
15666
  if (shouldDoClasses) {
15635
- var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key5, val2, false));
15667
+ var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
15636
15668
  var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
15637
15669
  try {
15638
15670
  for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
@@ -15656,14 +15688,14 @@ var init_getSplitStyles_native = __esmMin((() => {
15656
15688
  }
15657
15689
  }
15658
15690
  } else {
15659
- let mergeMediaStyle2 = function(key6, val3, originalVal2) {
15691
+ let mergeMediaStyle2 = function(key7, val3, originalVal2) {
15660
15692
  var _styleState4;
15661
- if (!isValidStyleKey(key6, validStyles$1, accept)) {
15662
- viewProps[key6] = val3;
15693
+ if (!isValidStyleKey(key7, validStyles$1, accept)) {
15694
+ viewProps[key7] = val3;
15663
15695
  return;
15664
15696
  }
15665
15697
  (_styleState4 = styleState).style || (_styleState4.style = {});
15666
- if (mergeMediaByImportance(styleState, mediaKeyShort, key6, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key6 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
15698
+ if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
15667
15699
  };
15668
15700
  var isThemeMedia = isMedia === "theme";
15669
15701
  var isGroupMedia = isMedia === "group";
@@ -15671,7 +15703,7 @@ var init_getSplitStyles_native = __esmMin((() => {
15671
15703
  if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
15672
15704
  if (!mediaState$1[mediaKeyShort]) return;
15673
15705
  }
15674
- var mediaStyle1 = getSubStyle(styleState, key5, val2, true);
15706
+ var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
15675
15707
  var importanceBump = 0;
15676
15708
  if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
15677
15709
  var _styleState3;
@@ -15785,7 +15817,7 @@ var init_getSplitStyles_native = __esmMin((() => {
15785
15817
  }
15786
15818
  if (!isVariant) {
15787
15819
  if (isStyledContextProp) return;
15788
- viewProps[key5] = val2;
15820
+ viewProps[key6] = val2;
15789
15821
  }
15790
15822
  });
15791
15823
  };
@@ -15825,9 +15857,9 @@ var init_getSplitStyles_native = __esmMin((() => {
15825
15857
  };
15826
15858
  if (process.env.IS_STATIC === "is_static") {
15827
15859
  var { fallbackProps } = styleProps;
15828
- if (fallbackProps) styleState.props = new Proxy(props, { get(_, key5, val2) {
15829
- if (!Reflect.has(props, key5)) return Reflect.get(fallbackProps, key5);
15830
- return Reflect.get(props, key5);
15860
+ if (fallbackProps) styleState.props = new Proxy(props, { get(_, key6, val2) {
15861
+ if (!Reflect.has(props, key6)) return Reflect.get(fallbackProps, key6);
15862
+ return Reflect.get(props, key6);
15831
15863
  } });
15832
15864
  }
15833
15865
  var { asChild } = props;
@@ -15866,7 +15898,12 @@ var init_getSplitStyles_native = __esmMin((() => {
15866
15898
  else {
15867
15899
  var _styleState2;
15868
15900
  (_styleState2 = styleState).style || (_styleState2.style = {});
15869
- Object.assign(styleState.style, normalizeStyle$1(style));
15901
+ var normalized = normalizeStyle$1(style);
15902
+ Object.assign(styleState.style, normalized);
15903
+ if (shouldTrackStyleTokenProvenance) {
15904
+ var styleOriginals = styleOriginalValues.get(normalized);
15905
+ for (var k in normalized) recordStyleTokenProvenance(styleState, k, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[k]);
15906
+ }
15870
15907
  }
15871
15908
  }
15872
15909
  }
@@ -15890,6 +15927,18 @@ var init_getSplitStyles_native = __esmMin((() => {
15890
15927
  }
15891
15928
  }
15892
15929
  }
15930
+ if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
15931
+ var provenance = {};
15932
+ var hasProvenance = false;
15933
+ for (var key4 in styleState.tokenProvenance) {
15934
+ provenance[key4] = {
15935
+ token: styleState.tokenProvenance[key4],
15936
+ theme: themeName
15937
+ };
15938
+ hasProvenance = true;
15939
+ }
15940
+ if (hasProvenance) setStyleTokenProvenance(styleState.style, provenance);
15941
+ }
15893
15942
  var result = {
15894
15943
  hasMedia,
15895
15944
  fontFamily: styleState.fontFamily,
@@ -19089,6 +19138,7 @@ exports.LayoutMeasurementController = LayoutMeasurementController;
19089
19138
  exports.MEDIA_SEP = MEDIA_SEP;
19090
19139
  exports.MISSING_THEME_MESSAGE = MISSING_THEME_MESSAGE;
19091
19140
  exports.PROP_SPLIT = PROP_SPLIT;
19141
+ exports.STYLE_TOKEN_PROVENANCE_KEY = STYLE_TOKEN_PROVENANCE_KEY;
19092
19142
  exports.Slot = Slot;
19093
19143
  exports.Slottable = Slottable;
19094
19144
  exports.StyleObjectIdentifier = StyleObjectIdentifier;
@@ -19148,6 +19198,7 @@ exports.getSplitStyles = getSplitStyles;
19148
19198
  exports.getStyleAtomic = getStyleAtomic;
19149
19199
  exports.getStyleCompat = getStyleCompat;
19150
19200
  exports.getStyleTags = getStyleTags;
19201
+ exports.getStyleTokenProvenance = getStyleTokenProvenance;
19151
19202
  exports.getSubStyle = getSubStyle;
19152
19203
  exports.getThemeCSSRules = getThemeCSSRules;
19153
19204
  exports.getThemedChildren = getThemedChildren;
@@ -1527,6 +1527,10 @@ var useThemeState = function(props) {
1527
1527
  (0, react.useEffect)(function() {
1528
1528
  var r = ref.current;
1529
1529
  var renderVersion = r.renderVersion;
1530
+ if (r.lastSnap && !states.has(r.id)) {
1531
+ states.set(r.id, r.lastSnap);
1532
+ localStates.set(r.id, r.lastSnap);
1533
+ }
1530
1534
  if (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);
1531
1535
  if (shouldSubscribeToTheme(r, cascadeOnChange)) {
1532
1536
  if (!r.unsubscribe) {
@@ -3869,6 +3873,22 @@ var sortString = function(a, b) {
3869
3873
  return a < b ? -1 : a > b ? 1 : 0;
3870
3874
  };
3871
3875
  //#endregion
3876
+ //#region ../web/dist/esm/helpers/styleProvenance.native.js
3877
+ var STYLE_TOKEN_PROVENANCE_KEY = "tamagui.styleTokenProvenance";
3878
+ var provenanceSymbol = /* @__PURE__ */ Symbol.for(STYLE_TOKEN_PROVENANCE_KEY);
3879
+ function setStyleTokenProvenance(style, provenance) {
3880
+ Object.defineProperty(style, provenanceSymbol, {
3881
+ value: provenance,
3882
+ enumerable: false,
3883
+ configurable: true,
3884
+ writable: true
3885
+ });
3886
+ }
3887
+ function getStyleTokenProvenance(style) {
3888
+ if (!style) return void 0;
3889
+ return style[provenanceSymbol];
3890
+ }
3891
+ //#endregion
3872
3892
  //#region ../web/dist/esm/helpers/transformsToString.native.js
3873
3893
  function transformsToString(transforms) {
3874
3894
  return transforms.map(function(transform) {
@@ -3884,6 +3904,7 @@ function _type_of$3(obj) {
3884
3904
  "@swc/helpers - typeof";
3885
3905
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
3886
3906
  }
3907
+ var shouldTrackStyleTokenProvenance = false;
3887
3908
  var conf;
3888
3909
  var PROP_SPLIT = "-";
3889
3910
  function normalizeGroupKey(key, groupContext) {
@@ -3973,51 +3994,51 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
3973
3994
  if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
3974
3995
  }
3975
3996
  var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
3976
- propMapper(keyInit, valInit, styleState, disablePropMap, function(key5, val2, originalVal) {
3997
+ propMapper(keyInit, valInit, styleState, disablePropMap, function(key6, val2, originalVal) {
3977
3998
  var _parentStaticConfig_variants;
3978
- var isStyledContextProp = styledContext && key5 in styledContext;
3999
+ var isStyledContextProp = styledContext && key6 in styledContext;
3979
4000
  if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
3980
- viewProps[key5] = val2;
4001
+ viewProps[key6] = val2;
3981
4002
  return;
3982
4003
  }
3983
4004
  if (val2 == null) return;
3984
- if (key5 === "pointerEvents") {
3985
- viewProps[key5] = val2;
4005
+ if (key6 === "pointerEvents") {
4006
+ viewProps[key6] = val2;
3986
4007
  return;
3987
4008
  }
3988
- if (!isHOC && isValidStyleKey(key5, validStyles$1, accept) || isAndroid && key5 === "elevation") {
3989
- mergeStyle(styleState, key5, val2, 1, false, originalVal);
4009
+ if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
4010
+ mergeStyle(styleState, key6, val2, 1, false, originalVal);
3990
4011
  return;
3991
4012
  }
3992
- isPseudo = key5 in validPseudoKeys;
3993
- isMedia = isPseudo ? false : getMediaKey(key5);
4013
+ isPseudo = key6 in validPseudoKeys;
4014
+ isMedia = isPseudo ? false : getMediaKey(key6);
3994
4015
  isMediaOrPseudo = Boolean(isMedia || isPseudo);
3995
- isVariant = variants && key5 in variants;
3996
- if (isMedia === "group") key5 = normalizeGroupKey(key5, groupContext);
3997
- if (shouldSkipNativeHoverProp(key5, isMedia)) return;
3998
- if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key5)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened === null || inlineWhenUnflattened === void 0 ? void 0 : inlineWhenUnflattened.has(key5))) {
4016
+ isVariant = variants && key6 in variants;
4017
+ if (isMedia === "group") key6 = normalizeGroupKey(key6, groupContext);
4018
+ if (shouldSkipNativeHoverProp(key6, isMedia)) return;
4019
+ if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key6)) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened === null || inlineWhenUnflattened === void 0 ? void 0 : inlineWhenUnflattened.has(key6))) {
3999
4020
  var _props_key;
4000
- viewProps[key5] = (_props_key = props[key5]) !== null && _props_key !== void 0 ? _props_key : val2;
4021
+ viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
4001
4022
  }
4002
4023
  if (styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]))) {
4003
- passDownProp(viewProps, key5, val2, isMediaOrPseudo);
4024
+ passDownProp(viewProps, key6, val2, isMediaOrPseudo);
4004
4025
  return;
4005
4026
  }
4006
4027
  if (isPseudo) {
4007
4028
  if (!val2) return;
4008
- var pseudoStyleObject = getSubStyle(styleState, key5, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
4029
+ var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
4009
4030
  if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
4010
4031
  var _pseudos, _key;
4011
4032
  pseudos || (pseudos = {});
4012
- (_pseudos = pseudos)[_key = key5] || (_pseudos[_key] = {});
4033
+ (_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
4013
4034
  if (process.env.IS_STATIC === "is_static") {
4014
- Object.assign(pseudos[key5], pseudoStyleObject);
4035
+ Object.assign(pseudos[key6], pseudoStyleObject);
4015
4036
  return;
4016
4037
  }
4017
4038
  }
4018
- var descriptor = pseudoDescriptors[key5];
4019
- var isEnter = key5 === "enterStyle";
4020
- var isExit = key5 === "exitStyle";
4039
+ var descriptor = pseudoDescriptors[key6];
4040
+ var isEnter = key6 === "enterStyle";
4041
+ var isExit = key6 === "exitStyle";
4021
4042
  if (!descriptor) return;
4022
4043
  if (shouldDoClasses && !isExit) {
4023
4044
  var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
@@ -4052,34 +4073,34 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4052
4073
  if (process.env.IS_STATIC === "is_static") {
4053
4074
  var _pseudos1, _key1;
4054
4075
  pseudos || (pseudos = {});
4055
- (_pseudos1 = pseudos)[_key1 = key5] || (_pseudos1[_key1] = {});
4056
- pseudos[key5][pkey] = _$val;
4076
+ (_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
4077
+ pseudos[key6][pkey] = _$val;
4057
4078
  }
4058
4079
  mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
4059
4080
  }
4060
4081
  }
4061
4082
  if (!isDisabled) for (var _$key in val2) {
4062
- var k = shorthands[_$key] || _$key;
4063
- styleState.usedKeys[k] = Math.max(importance, styleState.usedKeys[k] || 0);
4083
+ var k2 = shorthands[_$key] || _$key;
4084
+ styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
4064
4085
  }
4065
4086
  }
4066
4087
  return;
4067
4088
  }
4068
4089
  if (isMedia) {
4069
4090
  if (!val2) return;
4070
- var mediaKeyShort = key5.slice(isMedia == "theme" ? 7 : 1);
4091
+ var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
4071
4092
  hasMedia || (hasMedia = true);
4072
4093
  if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
4073
4094
  if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */ new Set();
4074
4095
  hasMedia.add(mediaKeyShort);
4075
4096
  }
4076
4097
  if (isMedia === "platform") {
4077
- if (!isActivePlatform(key5)) return;
4098
+ if (!isActivePlatform(key6)) return;
4078
4099
  }
4079
4100
  var priority = mediaStylesSeen;
4080
4101
  mediaStylesSeen += 1;
4081
4102
  if (shouldDoClasses) {
4082
- var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key5, val2, false));
4103
+ var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
4083
4104
  var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
4084
4105
  try {
4085
4106
  for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
@@ -4103,14 +4124,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4103
4124
  }
4104
4125
  }
4105
4126
  } else {
4106
- let mergeMediaStyle2 = function(key6, val3, originalVal2) {
4127
+ let mergeMediaStyle2 = function(key7, val3, originalVal2) {
4107
4128
  var _styleState4;
4108
- if (!isValidStyleKey(key6, validStyles$1, accept)) {
4109
- viewProps[key6] = val3;
4129
+ if (!isValidStyleKey(key7, validStyles$1, accept)) {
4130
+ viewProps[key7] = val3;
4110
4131
  return;
4111
4132
  }
4112
4133
  (_styleState4 = styleState).style || (_styleState4.style = {});
4113
- if (mergeMediaByImportance(styleState, mediaKeyShort, key6, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key6 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
4134
+ if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
4114
4135
  };
4115
4136
  var isThemeMedia = isMedia === "theme";
4116
4137
  var isGroupMedia = isMedia === "group";
@@ -4118,7 +4139,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4118
4139
  if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
4119
4140
  if (!mediaState$1[mediaKeyShort]) return;
4120
4141
  }
4121
- var mediaStyle1 = getSubStyle(styleState, key5, val2, true);
4142
+ var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
4122
4143
  var importanceBump = 0;
4123
4144
  if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
4124
4145
  var _styleState3;
@@ -4232,7 +4253,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4232
4253
  }
4233
4254
  if (!isVariant) {
4234
4255
  if (isStyledContextProp) return;
4235
- viewProps[key5] = val2;
4256
+ viewProps[key6] = val2;
4236
4257
  }
4237
4258
  });
4238
4259
  };
@@ -4272,9 +4293,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4272
4293
  };
4273
4294
  if (process.env.IS_STATIC === "is_static") {
4274
4295
  var { fallbackProps } = styleProps;
4275
- if (fallbackProps) styleState.props = new Proxy(props, { get(_, key5, val2) {
4276
- if (!Reflect.has(props, key5)) return Reflect.get(fallbackProps, key5);
4277
- return Reflect.get(props, key5);
4296
+ if (fallbackProps) styleState.props = new Proxy(props, { get(_, key6, val2) {
4297
+ if (!Reflect.has(props, key6)) return Reflect.get(fallbackProps, key6);
4298
+ return Reflect.get(props, key6);
4278
4299
  } });
4279
4300
  }
4280
4301
  var { asChild } = props;
@@ -4313,7 +4334,12 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4313
4334
  else {
4314
4335
  var _styleState2;
4315
4336
  (_styleState2 = styleState).style || (_styleState2.style = {});
4316
- Object.assign(styleState.style, normalizeStyle$1(style));
4337
+ var normalized = normalizeStyle$1(style);
4338
+ Object.assign(styleState.style, normalized);
4339
+ if (shouldTrackStyleTokenProvenance) {
4340
+ var styleOriginals = styleOriginalValues.get(normalized);
4341
+ for (var k in normalized) recordStyleTokenProvenance(styleState, k, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[k]);
4342
+ }
4317
4343
  }
4318
4344
  }
4319
4345
  }
@@ -4337,6 +4363,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
4337
4363
  }
4338
4364
  }
4339
4365
  }
4366
+ if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
4367
+ var provenance = {};
4368
+ var hasProvenance = false;
4369
+ for (var key4 in styleState.tokenProvenance) {
4370
+ provenance[key4] = {
4371
+ token: styleState.tokenProvenance[key4],
4372
+ theme: themeName
4373
+ };
4374
+ hasProvenance = true;
4375
+ }
4376
+ if (hasProvenance) setStyleTokenProvenance(styleState.style, provenance);
4377
+ }
4340
4378
  var result = {
4341
4379
  hasMedia,
4342
4380
  fontFamily: styleState.fontFamily,
@@ -4397,9 +4435,16 @@ function mergeStyle(styleState, key, val, importance) {
4397
4435
  (_styleState2 = styleState).style || (_styleState2.style = {});
4398
4436
  usedKeys[key] = importance;
4399
4437
  styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
4438
+ if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
4400
4439
  }
4401
4440
  }
4402
4441
  }
4442
+ function recordStyleTokenProvenance(styleState, key, originalVal) {
4443
+ if (typeof originalVal === "string" && originalVal[0] === "$") {
4444
+ var _styleState;
4445
+ ((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
4446
+ } else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
4447
+ }
4403
4448
  var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
4404
4449
  var { staticConfig, conf: conf2, styleProps } = styleState;
4405
4450
  var styleOut = {};
@@ -7433,6 +7478,7 @@ exports.LayoutMeasurementController = LayoutMeasurementController;
7433
7478
  exports.MEDIA_SEP = MEDIA_SEP;
7434
7479
  exports.MISSING_THEME_MESSAGE = MISSING_THEME_MESSAGE;
7435
7480
  exports.PROP_SPLIT = PROP_SPLIT;
7481
+ exports.STYLE_TOKEN_PROVENANCE_KEY = STYLE_TOKEN_PROVENANCE_KEY;
7436
7482
  exports.Slot = Slot;
7437
7483
  exports.Slottable = Slottable;
7438
7484
  exports.StyleObjectIdentifier = StyleObjectIdentifier;
@@ -7492,6 +7538,7 @@ exports.getSplitStyles = getSplitStyles;
7492
7538
  exports.getStyleAtomic = getStyleAtomic;
7493
7539
  exports.getStyleCompat = getStyleCompat;
7494
7540
  exports.getStyleTags = getStyleTags;
7541
+ exports.getStyleTokenProvenance = getStyleTokenProvenance;
7495
7542
  exports.getSubStyle = getSubStyle;
7496
7543
  exports.getThemeCSSRules = getThemeCSSRules;
7497
7544
  exports.getThemedChildren = getThemedChildren;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "2.4.4",
3
+ "version": "2.4.5-1784076621864",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -79,17 +79,17 @@
79
79
  "clean:build": "tamagui-build clean:build"
80
80
  },
81
81
  "dependencies": {
82
- "@tamagui/helpers": "2.4.4",
83
- "@tamagui/react-native-media-driver": "2.4.4",
84
- "@tamagui/react-native-use-pressable": "2.4.4",
85
- "@tamagui/use-element-layout": "2.4.4",
86
- "@tamagui/use-event": "2.4.4",
87
- "@tamagui/web": "2.4.4"
82
+ "@tamagui/helpers": "2.4.5-1784076621864",
83
+ "@tamagui/react-native-media-driver": "2.4.5-1784076621864",
84
+ "@tamagui/react-native-use-pressable": "2.4.5-1784076621864",
85
+ "@tamagui/use-element-layout": "2.4.5-1784076621864",
86
+ "@tamagui/use-event": "2.4.5-1784076621864",
87
+ "@tamagui/web": "2.4.5-1784076621864"
88
88
  },
89
89
  "devDependencies": {
90
- "@tamagui/build": "2.4.4",
91
- "@tamagui/native-bundle": "2.4.4",
92
- "@tamagui/react-native-web-lite": "2.4.4",
90
+ "@tamagui/build": "2.4.5-1784076621864",
91
+ "@tamagui/native-bundle": "2.4.5-1784076621864",
92
+ "@tamagui/react-native-web-lite": "2.4.5-1784076621864",
93
93
  "@testing-library/react": "^16.1.0",
94
94
  "csstype": "^3.0.10",
95
95
  "react": ">=19",