@tamagui/core 2.4.5 → 2.4.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/.turbo/turbo-build.log +2 -2
- package/dist/native.cjs +86 -39
- package/dist/test.native.cjs +81 -38
- package/package.json +10 -10
package/.turbo/turbo-build.log
CHANGED
package/dist/native.cjs
CHANGED
|
@@ -15324,6 +15324,25 @@ var init_sortString_native = __esmMin((() => {
|
|
|
15324
15324
|
};
|
|
15325
15325
|
}));
|
|
15326
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
|
|
15327
15346
|
//#region ../web/dist/esm/helpers/transformsToString.native.js
|
|
15328
15347
|
function transformsToString(transforms) {
|
|
15329
15348
|
return transforms.map(function(transform) {
|
|
@@ -15398,9 +15417,16 @@ function mergeStyle(styleState, key, val, importance) {
|
|
|
15398
15417
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
15399
15418
|
usedKeys[key] = importance;
|
|
15400
15419
|
styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
|
|
15420
|
+
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
15401
15421
|
}
|
|
15402
15422
|
}
|
|
15403
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
|
+
}
|
|
15404
15430
|
function passDownProp(viewProps, key, val) {
|
|
15405
15431
|
if (arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false) {
|
|
15406
15432
|
var next = _objectSpread2(_objectSpread2({}, viewProps[key]), val);
|
|
@@ -15439,7 +15465,7 @@ function applyDefaultStyle(pkey, styleState) {
|
|
|
15439
15465
|
var defaultValues = animatableDefaults[pkey];
|
|
15440
15466
|
if (defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style))) mergeStyle(styleState, pkey, defaultValues, 1);
|
|
15441
15467
|
}
|
|
15442
|
-
var conf, PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles, defaultColor, animatableDefaults, mergeTransform, mapTransformKeys;
|
|
15468
|
+
var shouldTrackStyleTokenProvenance, conf, PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles, defaultColor, animatableDefaults, mergeTransform, mapTransformKeys;
|
|
15443
15469
|
var init_getSplitStyles_native = __esmMin((() => {
|
|
15444
15470
|
init_index_native$7();
|
|
15445
15471
|
init_index_native$5();
|
|
@@ -15460,8 +15486,10 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15460
15486
|
init_skipProps_native();
|
|
15461
15487
|
init_sortString_native();
|
|
15462
15488
|
init_styleOriginalValues_native();
|
|
15489
|
+
init_styleProvenance_native();
|
|
15463
15490
|
init_transformsToString_native();
|
|
15464
15491
|
init_objectSpread2();
|
|
15492
|
+
shouldTrackStyleTokenProvenance = false;
|
|
15465
15493
|
PROP_SPLIT = "-";
|
|
15466
15494
|
getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
|
|
15467
15495
|
var _loop = function(keyOg2) {
|
|
@@ -15530,51 +15558,51 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15530
15558
|
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
15531
15559
|
}
|
|
15532
15560
|
var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
|
|
15533
|
-
propMapper(keyInit, valInit, styleState, disablePropMap, function(
|
|
15561
|
+
propMapper(keyInit, valInit, styleState, disablePropMap, function(key6, val2, originalVal) {
|
|
15534
15562
|
var _parentStaticConfig_variants;
|
|
15535
|
-
var isStyledContextProp = styledContext &&
|
|
15563
|
+
var isStyledContextProp = styledContext && key6 in styledContext;
|
|
15536
15564
|
if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
|
|
15537
|
-
viewProps[
|
|
15565
|
+
viewProps[key6] = val2;
|
|
15538
15566
|
return;
|
|
15539
15567
|
}
|
|
15540
15568
|
if (val2 == null) return;
|
|
15541
|
-
if (
|
|
15542
|
-
viewProps[
|
|
15569
|
+
if (key6 === "pointerEvents") {
|
|
15570
|
+
viewProps[key6] = val2;
|
|
15543
15571
|
return;
|
|
15544
15572
|
}
|
|
15545
|
-
if (!isHOC && isValidStyleKey(
|
|
15546
|
-
mergeStyle(styleState,
|
|
15573
|
+
if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
|
|
15574
|
+
mergeStyle(styleState, key6, val2, 1, false, originalVal);
|
|
15547
15575
|
return;
|
|
15548
15576
|
}
|
|
15549
|
-
isPseudo =
|
|
15550
|
-
isMedia = isPseudo ? false : getMediaKey(
|
|
15577
|
+
isPseudo = key6 in validPseudoKeys;
|
|
15578
|
+
isMedia = isPseudo ? false : getMediaKey(key6);
|
|
15551
15579
|
isMediaOrPseudo = Boolean(isMedia || isPseudo);
|
|
15552
|
-
isVariant = variants &&
|
|
15553
|
-
if (isMedia === "group")
|
|
15554
|
-
if (shouldSkipNativeHoverProp(
|
|
15555
|
-
if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(
|
|
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))) {
|
|
15556
15584
|
var _props_key;
|
|
15557
|
-
viewProps[
|
|
15585
|
+
viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
15558
15586
|
}
|
|
15559
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]))) {
|
|
15560
|
-
passDownProp(viewProps,
|
|
15588
|
+
passDownProp(viewProps, key6, val2, isMediaOrPseudo);
|
|
15561
15589
|
return;
|
|
15562
15590
|
}
|
|
15563
15591
|
if (isPseudo) {
|
|
15564
15592
|
if (!val2) return;
|
|
15565
|
-
var pseudoStyleObject = getSubStyle(styleState,
|
|
15593
|
+
var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
|
|
15566
15594
|
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
15567
15595
|
var _pseudos, _key;
|
|
15568
15596
|
pseudos || (pseudos = {});
|
|
15569
|
-
(_pseudos = pseudos)[_key =
|
|
15597
|
+
(_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
|
|
15570
15598
|
if (process.env.IS_STATIC === "is_static") {
|
|
15571
|
-
Object.assign(pseudos[
|
|
15599
|
+
Object.assign(pseudos[key6], pseudoStyleObject);
|
|
15572
15600
|
return;
|
|
15573
15601
|
}
|
|
15574
15602
|
}
|
|
15575
|
-
var descriptor = pseudoDescriptors[
|
|
15576
|
-
var isEnter =
|
|
15577
|
-
var isExit =
|
|
15603
|
+
var descriptor = pseudoDescriptors[key6];
|
|
15604
|
+
var isEnter = key6 === "enterStyle";
|
|
15605
|
+
var isExit = key6 === "exitStyle";
|
|
15578
15606
|
if (!descriptor) return;
|
|
15579
15607
|
if (shouldDoClasses && !isExit) {
|
|
15580
15608
|
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
@@ -15609,34 +15637,34 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15609
15637
|
if (process.env.IS_STATIC === "is_static") {
|
|
15610
15638
|
var _pseudos1, _key1;
|
|
15611
15639
|
pseudos || (pseudos = {});
|
|
15612
|
-
(_pseudos1 = pseudos)[_key1 =
|
|
15613
|
-
pseudos[
|
|
15640
|
+
(_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
|
|
15641
|
+
pseudos[key6][pkey] = _$val;
|
|
15614
15642
|
}
|
|
15615
15643
|
mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
|
|
15616
15644
|
}
|
|
15617
15645
|
}
|
|
15618
15646
|
if (!isDisabled) for (var _$key in val2) {
|
|
15619
|
-
var
|
|
15620
|
-
styleState.usedKeys[
|
|
15647
|
+
var k2 = shorthands[_$key] || _$key;
|
|
15648
|
+
styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
|
|
15621
15649
|
}
|
|
15622
15650
|
}
|
|
15623
15651
|
return;
|
|
15624
15652
|
}
|
|
15625
15653
|
if (isMedia) {
|
|
15626
15654
|
if (!val2) return;
|
|
15627
|
-
var mediaKeyShort =
|
|
15655
|
+
var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
|
|
15628
15656
|
hasMedia || (hasMedia = true);
|
|
15629
15657
|
if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
|
|
15630
15658
|
if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */ new Set();
|
|
15631
15659
|
hasMedia.add(mediaKeyShort);
|
|
15632
15660
|
}
|
|
15633
15661
|
if (isMedia === "platform") {
|
|
15634
|
-
if (!isActivePlatform(
|
|
15662
|
+
if (!isActivePlatform(key6)) return;
|
|
15635
15663
|
}
|
|
15636
15664
|
var priority = mediaStylesSeen;
|
|
15637
15665
|
mediaStylesSeen += 1;
|
|
15638
15666
|
if (shouldDoClasses) {
|
|
15639
|
-
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState,
|
|
15667
|
+
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
|
|
15640
15668
|
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
15641
15669
|
try {
|
|
15642
15670
|
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
@@ -15660,14 +15688,14 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15660
15688
|
}
|
|
15661
15689
|
}
|
|
15662
15690
|
} else {
|
|
15663
|
-
let mergeMediaStyle2 = function(
|
|
15691
|
+
let mergeMediaStyle2 = function(key7, val3, originalVal2) {
|
|
15664
15692
|
var _styleState4;
|
|
15665
|
-
if (!isValidStyleKey(
|
|
15666
|
-
viewProps[
|
|
15693
|
+
if (!isValidStyleKey(key7, validStyles$1, accept)) {
|
|
15694
|
+
viewProps[key7] = val3;
|
|
15667
15695
|
return;
|
|
15668
15696
|
}
|
|
15669
15697
|
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
15670
|
-
if (mergeMediaByImportance(styleState, mediaKeyShort,
|
|
15698
|
+
if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
|
|
15671
15699
|
};
|
|
15672
15700
|
var isThemeMedia = isMedia === "theme";
|
|
15673
15701
|
var isGroupMedia = isMedia === "group";
|
|
@@ -15675,7 +15703,7 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15675
15703
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
15676
15704
|
if (!mediaState$1[mediaKeyShort]) return;
|
|
15677
15705
|
}
|
|
15678
|
-
var mediaStyle1 = getSubStyle(styleState,
|
|
15706
|
+
var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
|
|
15679
15707
|
var importanceBump = 0;
|
|
15680
15708
|
if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
|
|
15681
15709
|
var _styleState3;
|
|
@@ -15789,7 +15817,7 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15789
15817
|
}
|
|
15790
15818
|
if (!isVariant) {
|
|
15791
15819
|
if (isStyledContextProp) return;
|
|
15792
|
-
viewProps[
|
|
15820
|
+
viewProps[key6] = val2;
|
|
15793
15821
|
}
|
|
15794
15822
|
});
|
|
15795
15823
|
};
|
|
@@ -15829,9 +15857,9 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15829
15857
|
};
|
|
15830
15858
|
if (process.env.IS_STATIC === "is_static") {
|
|
15831
15859
|
var { fallbackProps } = styleProps;
|
|
15832
|
-
if (fallbackProps) styleState.props = new Proxy(props, { get(_,
|
|
15833
|
-
if (!Reflect.has(props,
|
|
15834
|
-
return Reflect.get(props,
|
|
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);
|
|
15835
15863
|
} });
|
|
15836
15864
|
}
|
|
15837
15865
|
var { asChild } = props;
|
|
@@ -15870,7 +15898,12 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15870
15898
|
else {
|
|
15871
15899
|
var _styleState2;
|
|
15872
15900
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
15873
|
-
|
|
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
|
+
}
|
|
15874
15907
|
}
|
|
15875
15908
|
}
|
|
15876
15909
|
}
|
|
@@ -15894,6 +15927,18 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15894
15927
|
}
|
|
15895
15928
|
}
|
|
15896
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
|
+
}
|
|
15897
15942
|
var result = {
|
|
15898
15943
|
hasMedia,
|
|
15899
15944
|
fontFamily: styleState.fontFamily,
|
|
@@ -19093,6 +19138,7 @@ exports.LayoutMeasurementController = LayoutMeasurementController;
|
|
|
19093
19138
|
exports.MEDIA_SEP = MEDIA_SEP;
|
|
19094
19139
|
exports.MISSING_THEME_MESSAGE = MISSING_THEME_MESSAGE;
|
|
19095
19140
|
exports.PROP_SPLIT = PROP_SPLIT;
|
|
19141
|
+
exports.STYLE_TOKEN_PROVENANCE_KEY = STYLE_TOKEN_PROVENANCE_KEY;
|
|
19096
19142
|
exports.Slot = Slot;
|
|
19097
19143
|
exports.Slottable = Slottable;
|
|
19098
19144
|
exports.StyleObjectIdentifier = StyleObjectIdentifier;
|
|
@@ -19152,6 +19198,7 @@ exports.getSplitStyles = getSplitStyles;
|
|
|
19152
19198
|
exports.getStyleAtomic = getStyleAtomic;
|
|
19153
19199
|
exports.getStyleCompat = getStyleCompat;
|
|
19154
19200
|
exports.getStyleTags = getStyleTags;
|
|
19201
|
+
exports.getStyleTokenProvenance = getStyleTokenProvenance;
|
|
19155
19202
|
exports.getSubStyle = getSubStyle;
|
|
19156
19203
|
exports.getThemeCSSRules = getThemeCSSRules;
|
|
19157
19204
|
exports.getThemedChildren = getThemedChildren;
|
package/dist/test.native.cjs
CHANGED
|
@@ -3873,6 +3873,22 @@ var sortString = function(a, b) {
|
|
|
3873
3873
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
3874
3874
|
};
|
|
3875
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
|
|
3876
3892
|
//#region ../web/dist/esm/helpers/transformsToString.native.js
|
|
3877
3893
|
function transformsToString(transforms) {
|
|
3878
3894
|
return transforms.map(function(transform) {
|
|
@@ -3888,6 +3904,7 @@ function _type_of$3(obj) {
|
|
|
3888
3904
|
"@swc/helpers - typeof";
|
|
3889
3905
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
3890
3906
|
}
|
|
3907
|
+
var shouldTrackStyleTokenProvenance = false;
|
|
3891
3908
|
var conf;
|
|
3892
3909
|
var PROP_SPLIT = "-";
|
|
3893
3910
|
function normalizeGroupKey(key, groupContext) {
|
|
@@ -3977,51 +3994,51 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3977
3994
|
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
3978
3995
|
}
|
|
3979
3996
|
var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
|
|
3980
|
-
propMapper(keyInit, valInit, styleState, disablePropMap, function(
|
|
3997
|
+
propMapper(keyInit, valInit, styleState, disablePropMap, function(key6, val2, originalVal) {
|
|
3981
3998
|
var _parentStaticConfig_variants;
|
|
3982
|
-
var isStyledContextProp = styledContext &&
|
|
3999
|
+
var isStyledContextProp = styledContext && key6 in styledContext;
|
|
3983
4000
|
if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
|
|
3984
|
-
viewProps[
|
|
4001
|
+
viewProps[key6] = val2;
|
|
3985
4002
|
return;
|
|
3986
4003
|
}
|
|
3987
4004
|
if (val2 == null) return;
|
|
3988
|
-
if (
|
|
3989
|
-
viewProps[
|
|
4005
|
+
if (key6 === "pointerEvents") {
|
|
4006
|
+
viewProps[key6] = val2;
|
|
3990
4007
|
return;
|
|
3991
4008
|
}
|
|
3992
|
-
if (!isHOC && isValidStyleKey(
|
|
3993
|
-
mergeStyle(styleState,
|
|
4009
|
+
if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
|
|
4010
|
+
mergeStyle(styleState, key6, val2, 1, false, originalVal);
|
|
3994
4011
|
return;
|
|
3995
4012
|
}
|
|
3996
|
-
isPseudo =
|
|
3997
|
-
isMedia = isPseudo ? false : getMediaKey(
|
|
4013
|
+
isPseudo = key6 in validPseudoKeys;
|
|
4014
|
+
isMedia = isPseudo ? false : getMediaKey(key6);
|
|
3998
4015
|
isMediaOrPseudo = Boolean(isMedia || isPseudo);
|
|
3999
|
-
isVariant = variants &&
|
|
4000
|
-
if (isMedia === "group")
|
|
4001
|
-
if (shouldSkipNativeHoverProp(
|
|
4002
|
-
if ((inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(
|
|
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))) {
|
|
4003
4020
|
var _props_key;
|
|
4004
|
-
viewProps[
|
|
4021
|
+
viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
4005
4022
|
}
|
|
4006
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]))) {
|
|
4007
|
-
passDownProp(viewProps,
|
|
4024
|
+
passDownProp(viewProps, key6, val2, isMediaOrPseudo);
|
|
4008
4025
|
return;
|
|
4009
4026
|
}
|
|
4010
4027
|
if (isPseudo) {
|
|
4011
4028
|
if (!val2) return;
|
|
4012
|
-
var pseudoStyleObject = getSubStyle(styleState,
|
|
4029
|
+
var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
|
|
4013
4030
|
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
4014
4031
|
var _pseudos, _key;
|
|
4015
4032
|
pseudos || (pseudos = {});
|
|
4016
|
-
(_pseudos = pseudos)[_key =
|
|
4033
|
+
(_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
|
|
4017
4034
|
if (process.env.IS_STATIC === "is_static") {
|
|
4018
|
-
Object.assign(pseudos[
|
|
4035
|
+
Object.assign(pseudos[key6], pseudoStyleObject);
|
|
4019
4036
|
return;
|
|
4020
4037
|
}
|
|
4021
4038
|
}
|
|
4022
|
-
var descriptor = pseudoDescriptors[
|
|
4023
|
-
var isEnter =
|
|
4024
|
-
var isExit =
|
|
4039
|
+
var descriptor = pseudoDescriptors[key6];
|
|
4040
|
+
var isEnter = key6 === "enterStyle";
|
|
4041
|
+
var isExit = key6 === "exitStyle";
|
|
4025
4042
|
if (!descriptor) return;
|
|
4026
4043
|
if (shouldDoClasses && !isExit) {
|
|
4027
4044
|
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
@@ -4056,34 +4073,34 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4056
4073
|
if (process.env.IS_STATIC === "is_static") {
|
|
4057
4074
|
var _pseudos1, _key1;
|
|
4058
4075
|
pseudos || (pseudos = {});
|
|
4059
|
-
(_pseudos1 = pseudos)[_key1 =
|
|
4060
|
-
pseudos[
|
|
4076
|
+
(_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
|
|
4077
|
+
pseudos[key6][pkey] = _$val;
|
|
4061
4078
|
}
|
|
4062
4079
|
mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
|
|
4063
4080
|
}
|
|
4064
4081
|
}
|
|
4065
4082
|
if (!isDisabled) for (var _$key in val2) {
|
|
4066
|
-
var
|
|
4067
|
-
styleState.usedKeys[
|
|
4083
|
+
var k2 = shorthands[_$key] || _$key;
|
|
4084
|
+
styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
|
|
4068
4085
|
}
|
|
4069
4086
|
}
|
|
4070
4087
|
return;
|
|
4071
4088
|
}
|
|
4072
4089
|
if (isMedia) {
|
|
4073
4090
|
if (!val2) return;
|
|
4074
|
-
var mediaKeyShort =
|
|
4091
|
+
var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
|
|
4075
4092
|
hasMedia || (hasMedia = true);
|
|
4076
4093
|
if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
|
|
4077
4094
|
if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */ new Set();
|
|
4078
4095
|
hasMedia.add(mediaKeyShort);
|
|
4079
4096
|
}
|
|
4080
4097
|
if (isMedia === "platform") {
|
|
4081
|
-
if (!isActivePlatform(
|
|
4098
|
+
if (!isActivePlatform(key6)) return;
|
|
4082
4099
|
}
|
|
4083
4100
|
var priority = mediaStylesSeen;
|
|
4084
4101
|
mediaStylesSeen += 1;
|
|
4085
4102
|
if (shouldDoClasses) {
|
|
4086
|
-
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState,
|
|
4103
|
+
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
|
|
4087
4104
|
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
4088
4105
|
try {
|
|
4089
4106
|
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
@@ -4107,14 +4124,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4107
4124
|
}
|
|
4108
4125
|
}
|
|
4109
4126
|
} else {
|
|
4110
|
-
let mergeMediaStyle2 = function(
|
|
4127
|
+
let mergeMediaStyle2 = function(key7, val3, originalVal2) {
|
|
4111
4128
|
var _styleState4;
|
|
4112
|
-
if (!isValidStyleKey(
|
|
4113
|
-
viewProps[
|
|
4129
|
+
if (!isValidStyleKey(key7, validStyles$1, accept)) {
|
|
4130
|
+
viewProps[key7] = val3;
|
|
4114
4131
|
return;
|
|
4115
4132
|
}
|
|
4116
4133
|
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
4117
|
-
if (mergeMediaByImportance(styleState, mediaKeyShort,
|
|
4134
|
+
if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
|
|
4118
4135
|
};
|
|
4119
4136
|
var isThemeMedia = isMedia === "theme";
|
|
4120
4137
|
var isGroupMedia = isMedia === "group";
|
|
@@ -4122,7 +4139,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4122
4139
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
4123
4140
|
if (!mediaState$1[mediaKeyShort]) return;
|
|
4124
4141
|
}
|
|
4125
|
-
var mediaStyle1 = getSubStyle(styleState,
|
|
4142
|
+
var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
|
|
4126
4143
|
var importanceBump = 0;
|
|
4127
4144
|
if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
|
|
4128
4145
|
var _styleState3;
|
|
@@ -4236,7 +4253,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4236
4253
|
}
|
|
4237
4254
|
if (!isVariant) {
|
|
4238
4255
|
if (isStyledContextProp) return;
|
|
4239
|
-
viewProps[
|
|
4256
|
+
viewProps[key6] = val2;
|
|
4240
4257
|
}
|
|
4241
4258
|
});
|
|
4242
4259
|
};
|
|
@@ -4276,9 +4293,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4276
4293
|
};
|
|
4277
4294
|
if (process.env.IS_STATIC === "is_static") {
|
|
4278
4295
|
var { fallbackProps } = styleProps;
|
|
4279
|
-
if (fallbackProps) styleState.props = new Proxy(props, { get(_,
|
|
4280
|
-
if (!Reflect.has(props,
|
|
4281
|
-
return Reflect.get(props,
|
|
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);
|
|
4282
4299
|
} });
|
|
4283
4300
|
}
|
|
4284
4301
|
var { asChild } = props;
|
|
@@ -4317,7 +4334,12 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4317
4334
|
else {
|
|
4318
4335
|
var _styleState2;
|
|
4319
4336
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
4320
|
-
|
|
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
|
+
}
|
|
4321
4343
|
}
|
|
4322
4344
|
}
|
|
4323
4345
|
}
|
|
@@ -4341,6 +4363,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4341
4363
|
}
|
|
4342
4364
|
}
|
|
4343
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
|
+
}
|
|
4344
4378
|
var result = {
|
|
4345
4379
|
hasMedia,
|
|
4346
4380
|
fontFamily: styleState.fontFamily,
|
|
@@ -4401,9 +4435,16 @@ function mergeStyle(styleState, key, val, importance) {
|
|
|
4401
4435
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
4402
4436
|
usedKeys[key] = importance;
|
|
4403
4437
|
styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
|
|
4438
|
+
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
4404
4439
|
}
|
|
4405
4440
|
}
|
|
4406
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
|
+
}
|
|
4407
4448
|
var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
|
|
4408
4449
|
var { staticConfig, conf: conf2, styleProps } = styleState;
|
|
4409
4450
|
var styleOut = {};
|
|
@@ -7437,6 +7478,7 @@ exports.LayoutMeasurementController = LayoutMeasurementController;
|
|
|
7437
7478
|
exports.MEDIA_SEP = MEDIA_SEP;
|
|
7438
7479
|
exports.MISSING_THEME_MESSAGE = MISSING_THEME_MESSAGE;
|
|
7439
7480
|
exports.PROP_SPLIT = PROP_SPLIT;
|
|
7481
|
+
exports.STYLE_TOKEN_PROVENANCE_KEY = STYLE_TOKEN_PROVENANCE_KEY;
|
|
7440
7482
|
exports.Slot = Slot;
|
|
7441
7483
|
exports.Slottable = Slottable;
|
|
7442
7484
|
exports.StyleObjectIdentifier = StyleObjectIdentifier;
|
|
@@ -7496,6 +7538,7 @@ exports.getSplitStyles = getSplitStyles;
|
|
|
7496
7538
|
exports.getStyleAtomic = getStyleAtomic;
|
|
7497
7539
|
exports.getStyleCompat = getStyleCompat;
|
|
7498
7540
|
exports.getStyleTags = getStyleTags;
|
|
7541
|
+
exports.getStyleTokenProvenance = getStyleTokenProvenance;
|
|
7499
7542
|
exports.getSubStyle = getSubStyle;
|
|
7500
7543
|
exports.getThemeCSSRules = getThemeCSSRules;
|
|
7501
7544
|
exports.getThemedChildren = getThemedChildren;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.6",
|
|
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.
|
|
83
|
-
"@tamagui/react-native-media-driver": "2.4.
|
|
84
|
-
"@tamagui/react-native-use-pressable": "2.4.
|
|
85
|
-
"@tamagui/use-element-layout": "2.4.
|
|
86
|
-
"@tamagui/use-event": "2.4.
|
|
87
|
-
"@tamagui/web": "2.4.
|
|
82
|
+
"@tamagui/helpers": "2.4.6",
|
|
83
|
+
"@tamagui/react-native-media-driver": "2.4.6",
|
|
84
|
+
"@tamagui/react-native-use-pressable": "2.4.6",
|
|
85
|
+
"@tamagui/use-element-layout": "2.4.6",
|
|
86
|
+
"@tamagui/use-event": "2.4.6",
|
|
87
|
+
"@tamagui/web": "2.4.6"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@tamagui/build": "2.4.
|
|
91
|
-
"@tamagui/native-bundle": "2.4.
|
|
92
|
-
"@tamagui/react-native-web-lite": "2.4.
|
|
90
|
+
"@tamagui/build": "2.4.6",
|
|
91
|
+
"@tamagui/native-bundle": "2.4.6",
|
|
92
|
+
"@tamagui/react-native-web-lite": "2.4.6",
|
|
93
93
|
"@testing-library/react": "^16.1.0",
|
|
94
94
|
"csstype": "^3.0.10",
|
|
95
95
|
"react": ">=19",
|