@tamagui/core 2.4.3 → 2.4.5-1784066510418
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 +92 -39
- package/dist/test.native.cjs +87 -38
- package/package.json +10 -10
package/.turbo/turbo-build.log
CHANGED
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) {
|
|
@@ -15351,6 +15374,8 @@ function isValidStyleKey(key, validStyles, accept) {
|
|
|
15351
15374
|
return key in validStyles ? true : accept && key in accept;
|
|
15352
15375
|
}
|
|
15353
15376
|
function shouldSkipNativeHoverProp(key, isMedia) {
|
|
15377
|
+
var _getPlatformDriver;
|
|
15378
|
+
if ((_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo) return false;
|
|
15354
15379
|
if (key === "hoverStyle") return true;
|
|
15355
15380
|
if (isMedia === "group") return getGroupPropParts(key.slice(1)).pseudo === "hover";
|
|
15356
15381
|
return false;
|
|
@@ -15392,9 +15417,16 @@ function mergeStyle(styleState, key, val, importance) {
|
|
|
15392
15417
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
15393
15418
|
usedKeys[key] = importance;
|
|
15394
15419
|
styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
|
|
15420
|
+
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
15395
15421
|
}
|
|
15396
15422
|
}
|
|
15397
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
|
+
}
|
|
15398
15430
|
function passDownProp(viewProps, key, val) {
|
|
15399
15431
|
if (arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false) {
|
|
15400
15432
|
var next = _objectSpread2(_objectSpread2({}, viewProps[key]), val);
|
|
@@ -15433,7 +15465,7 @@ function applyDefaultStyle(pkey, styleState) {
|
|
|
15433
15465
|
var defaultValues = animatableDefaults[pkey];
|
|
15434
15466
|
if (defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style))) mergeStyle(styleState, pkey, defaultValues, 1);
|
|
15435
15467
|
}
|
|
15436
|
-
var conf, PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles, defaultColor, animatableDefaults, mergeTransform, mapTransformKeys;
|
|
15468
|
+
var shouldTrackStyleTokenProvenance, conf, PROP_SPLIT, getSplitStyles, getSubStyle, useSplitStyles, defaultColor, animatableDefaults, mergeTransform, mapTransformKeys;
|
|
15437
15469
|
var init_getSplitStyles_native = __esmMin((() => {
|
|
15438
15470
|
init_index_native$7();
|
|
15439
15471
|
init_index_native$5();
|
|
@@ -15454,8 +15486,10 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15454
15486
|
init_skipProps_native();
|
|
15455
15487
|
init_sortString_native();
|
|
15456
15488
|
init_styleOriginalValues_native();
|
|
15489
|
+
init_styleProvenance_native();
|
|
15457
15490
|
init_transformsToString_native();
|
|
15458
15491
|
init_objectSpread2();
|
|
15492
|
+
shouldTrackStyleTokenProvenance = false;
|
|
15459
15493
|
PROP_SPLIT = "-";
|
|
15460
15494
|
getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
|
|
15461
15495
|
var _loop = function(keyOg2) {
|
|
@@ -15524,51 +15558,51 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15524
15558
|
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
15525
15559
|
}
|
|
15526
15560
|
var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
|
|
15527
|
-
propMapper(keyInit, valInit, styleState, disablePropMap, function(
|
|
15561
|
+
propMapper(keyInit, valInit, styleState, disablePropMap, function(key6, val2, originalVal) {
|
|
15528
15562
|
var _parentStaticConfig_variants;
|
|
15529
|
-
var isStyledContextProp = styledContext &&
|
|
15563
|
+
var isStyledContextProp = styledContext && key6 in styledContext;
|
|
15530
15564
|
if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
|
|
15531
|
-
viewProps[
|
|
15565
|
+
viewProps[key6] = val2;
|
|
15532
15566
|
return;
|
|
15533
15567
|
}
|
|
15534
15568
|
if (val2 == null) return;
|
|
15535
|
-
if (
|
|
15536
|
-
viewProps[
|
|
15569
|
+
if (key6 === "pointerEvents") {
|
|
15570
|
+
viewProps[key6] = val2;
|
|
15537
15571
|
return;
|
|
15538
15572
|
}
|
|
15539
|
-
if (!isHOC && isValidStyleKey(
|
|
15540
|
-
mergeStyle(styleState,
|
|
15573
|
+
if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
|
|
15574
|
+
mergeStyle(styleState, key6, val2, 1, false, originalVal);
|
|
15541
15575
|
return;
|
|
15542
15576
|
}
|
|
15543
|
-
isPseudo =
|
|
15544
|
-
isMedia = isPseudo ? false : getMediaKey(
|
|
15577
|
+
isPseudo = key6 in validPseudoKeys;
|
|
15578
|
+
isMedia = isPseudo ? false : getMediaKey(key6);
|
|
15545
15579
|
isMediaOrPseudo = Boolean(isMedia || isPseudo);
|
|
15546
|
-
isVariant = variants &&
|
|
15547
|
-
if (isMedia === "group")
|
|
15548
|
-
if (shouldSkipNativeHoverProp(
|
|
15549
|
-
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))) {
|
|
15550
15584
|
var _props_key;
|
|
15551
|
-
viewProps[
|
|
15585
|
+
viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
15552
15586
|
}
|
|
15553
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]))) {
|
|
15554
|
-
passDownProp(viewProps,
|
|
15588
|
+
passDownProp(viewProps, key6, val2, isMediaOrPseudo);
|
|
15555
15589
|
return;
|
|
15556
15590
|
}
|
|
15557
15591
|
if (isPseudo) {
|
|
15558
15592
|
if (!val2) return;
|
|
15559
|
-
var pseudoStyleObject = getSubStyle(styleState,
|
|
15593
|
+
var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
|
|
15560
15594
|
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
15561
15595
|
var _pseudos, _key;
|
|
15562
15596
|
pseudos || (pseudos = {});
|
|
15563
|
-
(_pseudos = pseudos)[_key =
|
|
15597
|
+
(_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
|
|
15564
15598
|
if (process.env.IS_STATIC === "is_static") {
|
|
15565
|
-
Object.assign(pseudos[
|
|
15599
|
+
Object.assign(pseudos[key6], pseudoStyleObject);
|
|
15566
15600
|
return;
|
|
15567
15601
|
}
|
|
15568
15602
|
}
|
|
15569
|
-
var descriptor = pseudoDescriptors[
|
|
15570
|
-
var isEnter =
|
|
15571
|
-
var isExit =
|
|
15603
|
+
var descriptor = pseudoDescriptors[key6];
|
|
15604
|
+
var isEnter = key6 === "enterStyle";
|
|
15605
|
+
var isExit = key6 === "exitStyle";
|
|
15572
15606
|
if (!descriptor) return;
|
|
15573
15607
|
if (shouldDoClasses && !isExit) {
|
|
15574
15608
|
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
@@ -15603,34 +15637,34 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15603
15637
|
if (process.env.IS_STATIC === "is_static") {
|
|
15604
15638
|
var _pseudos1, _key1;
|
|
15605
15639
|
pseudos || (pseudos = {});
|
|
15606
|
-
(_pseudos1 = pseudos)[_key1 =
|
|
15607
|
-
pseudos[
|
|
15640
|
+
(_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
|
|
15641
|
+
pseudos[key6][pkey] = _$val;
|
|
15608
15642
|
}
|
|
15609
15643
|
mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
|
|
15610
15644
|
}
|
|
15611
15645
|
}
|
|
15612
15646
|
if (!isDisabled) for (var _$key in val2) {
|
|
15613
|
-
var
|
|
15614
|
-
styleState.usedKeys[
|
|
15647
|
+
var k2 = shorthands[_$key] || _$key;
|
|
15648
|
+
styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
|
|
15615
15649
|
}
|
|
15616
15650
|
}
|
|
15617
15651
|
return;
|
|
15618
15652
|
}
|
|
15619
15653
|
if (isMedia) {
|
|
15620
15654
|
if (!val2) return;
|
|
15621
|
-
var mediaKeyShort =
|
|
15655
|
+
var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
|
|
15622
15656
|
hasMedia || (hasMedia = true);
|
|
15623
15657
|
if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
|
|
15624
15658
|
if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */ new Set();
|
|
15625
15659
|
hasMedia.add(mediaKeyShort);
|
|
15626
15660
|
}
|
|
15627
15661
|
if (isMedia === "platform") {
|
|
15628
|
-
if (!isActivePlatform(
|
|
15662
|
+
if (!isActivePlatform(key6)) return;
|
|
15629
15663
|
}
|
|
15630
15664
|
var priority = mediaStylesSeen;
|
|
15631
15665
|
mediaStylesSeen += 1;
|
|
15632
15666
|
if (shouldDoClasses) {
|
|
15633
|
-
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState,
|
|
15667
|
+
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
|
|
15634
15668
|
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
15635
15669
|
try {
|
|
15636
15670
|
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
@@ -15654,14 +15688,14 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15654
15688
|
}
|
|
15655
15689
|
}
|
|
15656
15690
|
} else {
|
|
15657
|
-
let mergeMediaStyle2 = function(
|
|
15691
|
+
let mergeMediaStyle2 = function(key7, val3, originalVal2) {
|
|
15658
15692
|
var _styleState4;
|
|
15659
|
-
if (!isValidStyleKey(
|
|
15660
|
-
viewProps[
|
|
15693
|
+
if (!isValidStyleKey(key7, validStyles$1, accept)) {
|
|
15694
|
+
viewProps[key7] = val3;
|
|
15661
15695
|
return;
|
|
15662
15696
|
}
|
|
15663
15697
|
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
15664
|
-
if (mergeMediaByImportance(styleState, mediaKeyShort,
|
|
15698
|
+
if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
|
|
15665
15699
|
};
|
|
15666
15700
|
var isThemeMedia = isMedia === "theme";
|
|
15667
15701
|
var isGroupMedia = isMedia === "group";
|
|
@@ -15669,7 +15703,7 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15669
15703
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
15670
15704
|
if (!mediaState$1[mediaKeyShort]) return;
|
|
15671
15705
|
}
|
|
15672
|
-
var mediaStyle1 = getSubStyle(styleState,
|
|
15706
|
+
var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
|
|
15673
15707
|
var importanceBump = 0;
|
|
15674
15708
|
if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
|
|
15675
15709
|
var _styleState3;
|
|
@@ -15783,7 +15817,7 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15783
15817
|
}
|
|
15784
15818
|
if (!isVariant) {
|
|
15785
15819
|
if (isStyledContextProp) return;
|
|
15786
|
-
viewProps[
|
|
15820
|
+
viewProps[key6] = val2;
|
|
15787
15821
|
}
|
|
15788
15822
|
});
|
|
15789
15823
|
};
|
|
@@ -15823,9 +15857,9 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15823
15857
|
};
|
|
15824
15858
|
if (process.env.IS_STATIC === "is_static") {
|
|
15825
15859
|
var { fallbackProps } = styleProps;
|
|
15826
|
-
if (fallbackProps) styleState.props = new Proxy(props, { get(_,
|
|
15827
|
-
if (!Reflect.has(props,
|
|
15828
|
-
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);
|
|
15829
15863
|
} });
|
|
15830
15864
|
}
|
|
15831
15865
|
var { asChild } = props;
|
|
@@ -15864,7 +15898,12 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15864
15898
|
else {
|
|
15865
15899
|
var _styleState2;
|
|
15866
15900
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
15867
|
-
|
|
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
|
+
}
|
|
15868
15907
|
}
|
|
15869
15908
|
}
|
|
15870
15909
|
}
|
|
@@ -15888,6 +15927,18 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15888
15927
|
}
|
|
15889
15928
|
}
|
|
15890
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
|
+
}
|
|
15891
15942
|
var result = {
|
|
15892
15943
|
hasMedia,
|
|
15893
15944
|
fontFamily: styleState.fontFamily,
|
|
@@ -19087,6 +19138,7 @@ exports.LayoutMeasurementController = LayoutMeasurementController;
|
|
|
19087
19138
|
exports.MEDIA_SEP = MEDIA_SEP;
|
|
19088
19139
|
exports.MISSING_THEME_MESSAGE = MISSING_THEME_MESSAGE;
|
|
19089
19140
|
exports.PROP_SPLIT = PROP_SPLIT;
|
|
19141
|
+
exports.STYLE_TOKEN_PROVENANCE_KEY = STYLE_TOKEN_PROVENANCE_KEY;
|
|
19090
19142
|
exports.Slot = Slot;
|
|
19091
19143
|
exports.Slottable = Slottable;
|
|
19092
19144
|
exports.StyleObjectIdentifier = StyleObjectIdentifier;
|
|
@@ -19146,6 +19198,7 @@ exports.getSplitStyles = getSplitStyles;
|
|
|
19146
19198
|
exports.getStyleAtomic = getStyleAtomic;
|
|
19147
19199
|
exports.getStyleCompat = getStyleCompat;
|
|
19148
19200
|
exports.getStyleTags = getStyleTags;
|
|
19201
|
+
exports.getStyleTokenProvenance = getStyleTokenProvenance;
|
|
19149
19202
|
exports.getSubStyle = getSubStyle;
|
|
19150
19203
|
exports.getThemeCSSRules = getThemeCSSRules;
|
|
19151
19204
|
exports.getThemedChildren = getThemedChildren;
|
package/dist/test.native.cjs
CHANGED
|
@@ -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) {
|
|
@@ -3899,6 +3920,8 @@ function isValidStyleKey(key, validStyles, accept) {
|
|
|
3899
3920
|
return key in validStyles ? true : accept && key in accept;
|
|
3900
3921
|
}
|
|
3901
3922
|
function shouldSkipNativeHoverProp(key, isMedia) {
|
|
3923
|
+
var _getPlatformDriver;
|
|
3924
|
+
if ((_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo) return false;
|
|
3902
3925
|
if (key === "hoverStyle") return true;
|
|
3903
3926
|
if (isMedia === "group") return getGroupPropParts(key.slice(1)).pseudo === "hover";
|
|
3904
3927
|
return false;
|
|
@@ -3971,51 +3994,51 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
3971
3994
|
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
3972
3995
|
}
|
|
3973
3996
|
var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
|
|
3974
|
-
propMapper(keyInit, valInit, styleState, disablePropMap, function(
|
|
3997
|
+
propMapper(keyInit, valInit, styleState, disablePropMap, function(key6, val2, originalVal) {
|
|
3975
3998
|
var _parentStaticConfig_variants;
|
|
3976
|
-
var isStyledContextProp = styledContext &&
|
|
3999
|
+
var isStyledContextProp = styledContext && key6 in styledContext;
|
|
3977
4000
|
if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
|
|
3978
|
-
viewProps[
|
|
4001
|
+
viewProps[key6] = val2;
|
|
3979
4002
|
return;
|
|
3980
4003
|
}
|
|
3981
4004
|
if (val2 == null) return;
|
|
3982
|
-
if (
|
|
3983
|
-
viewProps[
|
|
4005
|
+
if (key6 === "pointerEvents") {
|
|
4006
|
+
viewProps[key6] = val2;
|
|
3984
4007
|
return;
|
|
3985
4008
|
}
|
|
3986
|
-
if (!isHOC && isValidStyleKey(
|
|
3987
|
-
mergeStyle(styleState,
|
|
4009
|
+
if (!isHOC && isValidStyleKey(key6, validStyles$1, accept) || isAndroid && key6 === "elevation") {
|
|
4010
|
+
mergeStyle(styleState, key6, val2, 1, false, originalVal);
|
|
3988
4011
|
return;
|
|
3989
4012
|
}
|
|
3990
|
-
isPseudo =
|
|
3991
|
-
isMedia = isPseudo ? false : getMediaKey(
|
|
4013
|
+
isPseudo = key6 in validPseudoKeys;
|
|
4014
|
+
isMedia = isPseudo ? false : getMediaKey(key6);
|
|
3992
4015
|
isMediaOrPseudo = Boolean(isMedia || isPseudo);
|
|
3993
|
-
isVariant = variants &&
|
|
3994
|
-
if (isMedia === "group")
|
|
3995
|
-
if (shouldSkipNativeHoverProp(
|
|
3996
|
-
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))) {
|
|
3997
4020
|
var _props_key;
|
|
3998
|
-
viewProps[
|
|
4021
|
+
viewProps[key6] = (_props_key = props[key6]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
3999
4022
|
}
|
|
4000
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]))) {
|
|
4001
|
-
passDownProp(viewProps,
|
|
4024
|
+
passDownProp(viewProps, key6, val2, isMediaOrPseudo);
|
|
4002
4025
|
return;
|
|
4003
4026
|
}
|
|
4004
4027
|
if (isPseudo) {
|
|
4005
4028
|
if (!val2) return;
|
|
4006
|
-
var pseudoStyleObject = getSubStyle(styleState,
|
|
4029
|
+
var pseudoStyleObject = getSubStyle(styleState, key6, val2, styleProps.noClass && !(process.env.IS_STATIC === "is_static"));
|
|
4007
4030
|
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
4008
4031
|
var _pseudos, _key;
|
|
4009
4032
|
pseudos || (pseudos = {});
|
|
4010
|
-
(_pseudos = pseudos)[_key =
|
|
4033
|
+
(_pseudos = pseudos)[_key = key6] || (_pseudos[_key] = {});
|
|
4011
4034
|
if (process.env.IS_STATIC === "is_static") {
|
|
4012
|
-
Object.assign(pseudos[
|
|
4035
|
+
Object.assign(pseudos[key6], pseudoStyleObject);
|
|
4013
4036
|
return;
|
|
4014
4037
|
}
|
|
4015
4038
|
}
|
|
4016
|
-
var descriptor = pseudoDescriptors[
|
|
4017
|
-
var isEnter =
|
|
4018
|
-
var isExit =
|
|
4039
|
+
var descriptor = pseudoDescriptors[key6];
|
|
4040
|
+
var isEnter = key6 === "enterStyle";
|
|
4041
|
+
var isExit = key6 === "exitStyle";
|
|
4019
4042
|
if (!descriptor) return;
|
|
4020
4043
|
if (shouldDoClasses && !isExit) {
|
|
4021
4044
|
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
@@ -4050,34 +4073,34 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4050
4073
|
if (process.env.IS_STATIC === "is_static") {
|
|
4051
4074
|
var _pseudos1, _key1;
|
|
4052
4075
|
pseudos || (pseudos = {});
|
|
4053
|
-
(_pseudos1 = pseudos)[_key1 =
|
|
4054
|
-
pseudos[
|
|
4076
|
+
(_pseudos1 = pseudos)[_key1 = key6] || (_pseudos1[_key1] = {});
|
|
4077
|
+
pseudos[key6][pkey] = _$val;
|
|
4055
4078
|
}
|
|
4056
4079
|
mergeStyle(styleState, pkey, _$val, importance, false, pseudoOriginalValues === null || pseudoOriginalValues === void 0 ? void 0 : pseudoOriginalValues[pkey]);
|
|
4057
4080
|
}
|
|
4058
4081
|
}
|
|
4059
4082
|
if (!isDisabled) for (var _$key in val2) {
|
|
4060
|
-
var
|
|
4061
|
-
styleState.usedKeys[
|
|
4083
|
+
var k2 = shorthands[_$key] || _$key;
|
|
4084
|
+
styleState.usedKeys[k2] = Math.max(importance, styleState.usedKeys[k2] || 0);
|
|
4062
4085
|
}
|
|
4063
4086
|
}
|
|
4064
4087
|
return;
|
|
4065
4088
|
}
|
|
4066
4089
|
if (isMedia) {
|
|
4067
4090
|
if (!val2) return;
|
|
4068
|
-
var mediaKeyShort =
|
|
4091
|
+
var mediaKeyShort = key6.slice(isMedia == "theme" ? 7 : 1);
|
|
4069
4092
|
hasMedia || (hasMedia = true);
|
|
4070
4093
|
if (val2["space"] || !shouldDoClasses || styleProps.willBeAnimated) {
|
|
4071
4094
|
if (!hasMedia || typeof hasMedia === "boolean") hasMedia = /* @__PURE__ */ new Set();
|
|
4072
4095
|
hasMedia.add(mediaKeyShort);
|
|
4073
4096
|
}
|
|
4074
4097
|
if (isMedia === "platform") {
|
|
4075
|
-
if (!isActivePlatform(
|
|
4098
|
+
if (!isActivePlatform(key6)) return;
|
|
4076
4099
|
}
|
|
4077
4100
|
var priority = mediaStylesSeen;
|
|
4078
4101
|
mediaStylesSeen += 1;
|
|
4079
4102
|
if (shouldDoClasses) {
|
|
4080
|
-
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState,
|
|
4103
|
+
var mediaStyles = getCSSStylesAtomic(getSubStyle(styleState, key6, val2, false));
|
|
4081
4104
|
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
4082
4105
|
try {
|
|
4083
4106
|
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
@@ -4101,14 +4124,14 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4101
4124
|
}
|
|
4102
4125
|
}
|
|
4103
4126
|
} else {
|
|
4104
|
-
let mergeMediaStyle2 = function(
|
|
4127
|
+
let mergeMediaStyle2 = function(key7, val3, originalVal2) {
|
|
4105
4128
|
var _styleState4;
|
|
4106
|
-
if (!isValidStyleKey(
|
|
4107
|
-
viewProps[
|
|
4129
|
+
if (!isValidStyleKey(key7, validStyles$1, accept)) {
|
|
4130
|
+
viewProps[key7] = val3;
|
|
4108
4131
|
return;
|
|
4109
4132
|
}
|
|
4110
4133
|
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
4111
|
-
if (mergeMediaByImportance(styleState, mediaKeyShort,
|
|
4134
|
+
if (mergeMediaByImportance(styleState, mediaKeyShort, key7, val3, mediaState$1[mediaKeyShort], importanceBump, debug, originalVal2) && key7 === "fontFamily") styleState.fontFamily = mediaStyle1.fontFamily;
|
|
4112
4135
|
};
|
|
4113
4136
|
var isThemeMedia = isMedia === "theme";
|
|
4114
4137
|
var isGroupMedia = isMedia === "group";
|
|
@@ -4116,7 +4139,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4116
4139
|
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
4117
4140
|
if (!mediaState$1[mediaKeyShort]) return;
|
|
4118
4141
|
}
|
|
4119
|
-
var mediaStyle1 = getSubStyle(styleState,
|
|
4142
|
+
var mediaStyle1 = getSubStyle(styleState, key6, val2, true);
|
|
4120
4143
|
var importanceBump = 0;
|
|
4121
4144
|
if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
|
|
4122
4145
|
var _styleState3;
|
|
@@ -4230,7 +4253,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4230
4253
|
}
|
|
4231
4254
|
if (!isVariant) {
|
|
4232
4255
|
if (isStyledContextProp) return;
|
|
4233
|
-
viewProps[
|
|
4256
|
+
viewProps[key6] = val2;
|
|
4234
4257
|
}
|
|
4235
4258
|
});
|
|
4236
4259
|
};
|
|
@@ -4270,9 +4293,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4270
4293
|
};
|
|
4271
4294
|
if (process.env.IS_STATIC === "is_static") {
|
|
4272
4295
|
var { fallbackProps } = styleProps;
|
|
4273
|
-
if (fallbackProps) styleState.props = new Proxy(props, { get(_,
|
|
4274
|
-
if (!Reflect.has(props,
|
|
4275
|
-
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);
|
|
4276
4299
|
} });
|
|
4277
4300
|
}
|
|
4278
4301
|
var { asChild } = props;
|
|
@@ -4311,7 +4334,12 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4311
4334
|
else {
|
|
4312
4335
|
var _styleState2;
|
|
4313
4336
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
4314
|
-
|
|
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
|
+
}
|
|
4315
4343
|
}
|
|
4316
4344
|
}
|
|
4317
4345
|
}
|
|
@@ -4335,6 +4363,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
4335
4363
|
}
|
|
4336
4364
|
}
|
|
4337
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
|
+
}
|
|
4338
4378
|
var result = {
|
|
4339
4379
|
hasMedia,
|
|
4340
4380
|
fontFamily: styleState.fontFamily,
|
|
@@ -4395,9 +4435,16 @@ function mergeStyle(styleState, key, val, importance) {
|
|
|
4395
4435
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
4396
4436
|
usedKeys[key] = importance;
|
|
4397
4437
|
styleState.style[key] = key === "transform" && Array.isArray(out) ? [...out] : out;
|
|
4438
|
+
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
4398
4439
|
}
|
|
4399
4440
|
}
|
|
4400
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
|
+
}
|
|
4401
4448
|
var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
|
|
4402
4449
|
var { staticConfig, conf: conf2, styleProps } = styleState;
|
|
4403
4450
|
var styleOut = {};
|
|
@@ -7431,6 +7478,7 @@ exports.LayoutMeasurementController = LayoutMeasurementController;
|
|
|
7431
7478
|
exports.MEDIA_SEP = MEDIA_SEP;
|
|
7432
7479
|
exports.MISSING_THEME_MESSAGE = MISSING_THEME_MESSAGE;
|
|
7433
7480
|
exports.PROP_SPLIT = PROP_SPLIT;
|
|
7481
|
+
exports.STYLE_TOKEN_PROVENANCE_KEY = STYLE_TOKEN_PROVENANCE_KEY;
|
|
7434
7482
|
exports.Slot = Slot;
|
|
7435
7483
|
exports.Slottable = Slottable;
|
|
7436
7484
|
exports.StyleObjectIdentifier = StyleObjectIdentifier;
|
|
@@ -7490,6 +7538,7 @@ exports.getSplitStyles = getSplitStyles;
|
|
|
7490
7538
|
exports.getStyleAtomic = getStyleAtomic;
|
|
7491
7539
|
exports.getStyleCompat = getStyleCompat;
|
|
7492
7540
|
exports.getStyleTags = getStyleTags;
|
|
7541
|
+
exports.getStyleTokenProvenance = getStyleTokenProvenance;
|
|
7493
7542
|
exports.getSubStyle = getSubStyle;
|
|
7494
7543
|
exports.getThemeCSSRules = getThemeCSSRules;
|
|
7495
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.5-1784066510418",
|
|
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.5-1784066510418",
|
|
83
|
+
"@tamagui/react-native-media-driver": "2.4.5-1784066510418",
|
|
84
|
+
"@tamagui/react-native-use-pressable": "2.4.5-1784066510418",
|
|
85
|
+
"@tamagui/use-element-layout": "2.4.5-1784066510418",
|
|
86
|
+
"@tamagui/use-event": "2.4.5-1784066510418",
|
|
87
|
+
"@tamagui/web": "2.4.5-1784066510418"
|
|
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.5-1784066510418",
|
|
91
|
+
"@tamagui/native-bundle": "2.4.5-1784066510418",
|
|
92
|
+
"@tamagui/react-native-web-lite": "2.4.5-1784066510418",
|
|
93
93
|
"@testing-library/react": "^16.1.0",
|
|
94
94
|
"csstype": "^3.0.10",
|
|
95
95
|
"react": ">=19",
|