@tamagui/core 3.0.0-beta.1125.1 → 3.0.0-beta.1141.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.cjs +96 -50
- package/dist/test.native.cjs +107 -65
- package/package.json +13 -13
package/dist/native.cjs
CHANGED
|
@@ -1027,16 +1027,11 @@ var unitlessNumbers = {
|
|
|
1027
1027
|
flexShrink: true,
|
|
1028
1028
|
flexNegative: true,
|
|
1029
1029
|
fontWeight: true,
|
|
1030
|
-
gap: true,
|
|
1031
|
-
columnGap: true,
|
|
1032
|
-
rowGap: true,
|
|
1033
1030
|
gridRow: true,
|
|
1034
1031
|
gridRowEnd: true,
|
|
1035
|
-
gridRowGap: true,
|
|
1036
1032
|
gridRowStart: true,
|
|
1037
1033
|
gridColumn: true,
|
|
1038
1034
|
gridColumnEnd: true,
|
|
1039
|
-
gridColumnGap: true,
|
|
1040
1035
|
gridColumnStart: true,
|
|
1041
1036
|
lineClamp: true,
|
|
1042
1037
|
opacity: true,
|
|
@@ -12029,6 +12024,7 @@ var setConfig = function(next) {
|
|
|
12029
12024
|
if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;
|
|
12030
12025
|
conf = next;
|
|
12031
12026
|
globalThis.__tamaguiConfig = next;
|
|
12027
|
+
if (process.env.TAMAGUI_ENVIRONMENT === "tamagui") globalThis.__tamaguiEvaluationConfig = next;
|
|
12032
12028
|
};
|
|
12033
12029
|
var setConfigFont = function(name, font, fontParsed) {
|
|
12034
12030
|
var config = getConfigFromGlobalOrLocal();
|
|
@@ -12655,6 +12651,10 @@ function getDynamicVal(param) {
|
|
|
12655
12651
|
[oppositeScheme]: oppositeVal
|
|
12656
12652
|
} };
|
|
12657
12653
|
}
|
|
12654
|
+
function extractValueFromDynamic(val, scheme) {
|
|
12655
|
+
if (val === null || val === void 0 ? void 0 : val["dynamic"]) return val["dynamic"][scheme];
|
|
12656
|
+
return val;
|
|
12657
|
+
}
|
|
12658
12658
|
//#endregion
|
|
12659
12659
|
//#region ../web/dist/esm/helpers/themeUpdateState.native.js
|
|
12660
12660
|
var themeUpdateStateKey = "_tmgInlineLayer";
|
|
@@ -15057,8 +15057,21 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
15057
15057
|
}
|
|
15058
15058
|
var styleOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style) : void 0;
|
|
15059
15059
|
for (var key1 in style) {
|
|
15060
|
-
|
|
15061
|
-
|
|
15060
|
+
var value1 = style[key1];
|
|
15061
|
+
if (value1 == null) continue;
|
|
15062
|
+
var inline = !styleState.styleProps.stylePieceEntries;
|
|
15063
|
+
if (inline) {
|
|
15064
|
+
if (typeof value1 === "string") {
|
|
15065
|
+
var [segments] = getConfigRevisionState(conf).parseFlatValue(value1);
|
|
15066
|
+
for (var index2 = 4; index2 < segments.length; index2 += 5) if (!(segments[index2] & 1)) {
|
|
15067
|
+
inline = false;
|
|
15068
|
+
break;
|
|
15069
|
+
}
|
|
15070
|
+
} else if (value1 && typeof value1 === "object" && !Array.isArray(value1) && !isVariable(value1) && classifyConditionalObject(value1, styleState) !== 0) inline = false;
|
|
15071
|
+
}
|
|
15072
|
+
styleState.flatInlineStyleProp = inline;
|
|
15073
|
+
contributeValue(styleState, key1, value1, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key1]);
|
|
15074
|
+
styleState.flatInlineStyleProp = false;
|
|
15062
15075
|
}
|
|
15063
15076
|
}
|
|
15064
15077
|
pass[passSourceLayer] = layerBeforeStyle;
|
|
@@ -15134,7 +15147,7 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
15134
15147
|
if (valInit === "unset") {
|
|
15135
15148
|
var expanded = expandStyle(keyInit, valInit, conf.settings.styleCompat || "web");
|
|
15136
15149
|
clearDirectStyle(styleState, keyInit);
|
|
15137
|
-
if (expanded) for (var
|
|
15150
|
+
if (expanded) for (var index3 = 0; index3 < expanded.length; index3++) clearDirectStyle(styleState, expanded[index3][0]);
|
|
15138
15151
|
} else contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
|
|
15139
15152
|
return;
|
|
15140
15153
|
}
|
|
@@ -15466,7 +15479,10 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
15466
15479
|
for (var index = 0; index < list.length; index++) {
|
|
15467
15480
|
var entry = list[index];
|
|
15468
15481
|
var entryFlags = entry[7] & 31;
|
|
15469
|
-
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS)))
|
|
15482
|
+
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) {
|
|
15483
|
+
if (sourceLayer === sourceLayerStyle && entry[7] >> 5 === sourceLayerStyle && entry[0] === source[0] && !condition && !entry[2]) list.splice(index--, 1);
|
|
15484
|
+
continue;
|
|
15485
|
+
}
|
|
15470
15486
|
if (entry[0] !== source[0]) continue;
|
|
15471
15487
|
if (flags & recordDefault) {
|
|
15472
15488
|
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
@@ -15524,8 +15540,8 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
15524
15540
|
var tokenName = typeof originalVal === "string" ? originalVal : "";
|
|
15525
15541
|
if (tokenName) {
|
|
15526
15542
|
var slash = tokenName.lastIndexOf("/");
|
|
15527
|
-
var opacity = slash === -1 ? NaN :
|
|
15528
|
-
if (
|
|
15543
|
+
var opacity = slash === -1 ? NaN : +tokenName.slice(slash + 1);
|
|
15544
|
+
if (opacity % 1 === 0 && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
15529
15545
|
}
|
|
15530
15546
|
if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (((_styleState_conf_themes = styleState.conf.themes) === null || _styleState_conf_themes === void 0 ? void 0 : _styleState_conf_themes[styleState.flatThemeName || ""]) || {}) || Object.values(styleState.conf.tokensParsed).some(function(category) {
|
|
15531
15547
|
return tokenName in category;
|
|
@@ -15574,27 +15590,39 @@ var recordDefault = 8;
|
|
|
15574
15590
|
var recordCSS = 16;
|
|
15575
15591
|
function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
15576
15592
|
var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
|
|
15577
|
-
var
|
|
15593
|
+
var _direct_flatPass;
|
|
15578
15594
|
var _direct;
|
|
15579
15595
|
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
|
|
15580
15596
|
var identity = cursor ? cursor[conditionKey] : "";
|
|
15581
|
-
var
|
|
15582
|
-
var
|
|
15597
|
+
var direct = state;
|
|
15598
|
+
var slots = (_direct = direct).flatSlots || (_direct.flatSlots = /* @__PURE__ */ new Map());
|
|
15599
|
+
var sourceLayer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
|
|
15600
|
+
if (direct.flatInlineStyleProp) flags |= recordInline;
|
|
15601
|
+
var cssSlot = property.startsWith("transition") ? "transition" : property;
|
|
15602
|
+
var slot = flags & recordInline && cssSlot !== property ? property : cssSlot;
|
|
15583
15603
|
var list = slots.get(slot);
|
|
15584
15604
|
if (!list) slots.set(slot, list = []);
|
|
15585
|
-
|
|
15586
|
-
var
|
|
15587
|
-
var
|
|
15588
|
-
|
|
15589
|
-
|
|
15605
|
+
if (sourceLayer === sourceLayerStyle && !condition) {
|
|
15606
|
+
var other = slot === cssSlot ? list : slots.get(flags & recordInline ? cssSlot : property);
|
|
15607
|
+
if (other) for (var index = 0; index < other.length; index++) {
|
|
15608
|
+
var entry = other[index];
|
|
15609
|
+
var entryFlags = entry[7];
|
|
15610
|
+
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
|
|
15611
|
+
}
|
|
15612
|
+
}
|
|
15613
|
+
for (var index1 = 0; index1 < list.length; index1++) {
|
|
15614
|
+
var entry1 = list[index1];
|
|
15615
|
+
var entryFlags1 = entry1[7];
|
|
15616
|
+
if ((entryFlags1 & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
|
|
15617
|
+
if (entry1[0] !== property) continue;
|
|
15590
15618
|
if (flags & recordDefault) {
|
|
15591
|
-
if (!(
|
|
15592
|
-
} else if (
|
|
15593
|
-
list.splice(
|
|
15619
|
+
if (!(entryFlags1 & recordDefault) && (!entry1[2] || entry1[3] === identity)) return;
|
|
15620
|
+
} else if (entryFlags1 & recordDefault && (!condition || entry1[3] === identity)) {
|
|
15621
|
+
list.splice(index1--, 1);
|
|
15594
15622
|
continue;
|
|
15595
15623
|
}
|
|
15596
|
-
if (
|
|
15597
|
-
list.splice(
|
|
15624
|
+
if (entry1[3] === identity) {
|
|
15625
|
+
list.splice(index1, 1);
|
|
15598
15626
|
break;
|
|
15599
15627
|
}
|
|
15600
15628
|
}
|
|
@@ -15606,7 +15634,7 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
|
15606
15634
|
cursor ? cursor[conditionSelector] : "",
|
|
15607
15635
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
15608
15636
|
original,
|
|
15609
|
-
flags |
|
|
15637
|
+
flags | sourceLayer << 5
|
|
15610
15638
|
]);
|
|
15611
15639
|
}
|
|
15612
15640
|
function streamWriteInline(state, property, value, cursor, original) {
|
|
@@ -15763,14 +15791,14 @@ var valueCacheEntries = 0;
|
|
|
15763
15791
|
var valueCacheRoot = {};
|
|
15764
15792
|
var parsedSlices = /* @__PURE__ */ new WeakMap();
|
|
15765
15793
|
function configuredValue(state, property, raw) {
|
|
15766
|
-
var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
15794
|
+
var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, nativeColors = arguments.length > 4 ? arguments[4] : void 0;
|
|
15767
15795
|
var grammar = getConfigRevisionState(state.conf);
|
|
15768
15796
|
var name = raw;
|
|
15769
15797
|
var opacity;
|
|
15770
15798
|
var slash = raw.lastIndexOf("/");
|
|
15771
15799
|
if (slash > 0) {
|
|
15772
|
-
var amount =
|
|
15773
|
-
if (
|
|
15800
|
+
var amount = +raw.slice(slash + 1);
|
|
15801
|
+
if (amount % 1 === 0 && amount >= 0 && amount <= 100) {
|
|
15774
15802
|
name = raw.slice(0, slash);
|
|
15775
15803
|
opacity = amount;
|
|
15776
15804
|
}
|
|
@@ -15783,7 +15811,7 @@ function configuredValue(state, property, raw) {
|
|
|
15783
15811
|
var fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
|
|
15784
15812
|
var resolveValues = state.styleProps.resolveValues;
|
|
15785
15813
|
var byRaw;
|
|
15786
|
-
if (!fontProperty) {
|
|
15814
|
+
if (!fontProperty && !nativeColors) {
|
|
15787
15815
|
var _maps;
|
|
15788
15816
|
var revision = grammar.revision;
|
|
15789
15817
|
if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
|
|
@@ -15847,20 +15875,25 @@ function configuredValue(state, property, raw) {
|
|
|
15847
15875
|
}
|
|
15848
15876
|
var out = raw;
|
|
15849
15877
|
if (isVariable(value)) {
|
|
15850
|
-
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(property, value, resolveValues);
|
|
15878
|
+
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(nativeColors ? "color" : property, value, resolveValues);
|
|
15851
15879
|
if (opacity !== void 0) {
|
|
15852
15880
|
var _normalizeColor;
|
|
15853
15881
|
out = (_normalizeColor = normalizeColor(out, opacity / 100)) !== null && _normalizeColor !== void 0 ? _normalizeColor : out;
|
|
15854
15882
|
}
|
|
15855
15883
|
}
|
|
15884
|
+
if (nativeColors && out && typeof out === "object") {
|
|
15885
|
+
var reference = `__tamagui_native_color_${nativeColors.size}`;
|
|
15886
|
+
nativeColors.set(reference, out);
|
|
15887
|
+
out = reference;
|
|
15888
|
+
}
|
|
15856
15889
|
if (embedded && out === raw) {
|
|
15857
15890
|
var usedSafeArea = state.flatUsesSafeArea;
|
|
15858
15891
|
out = grammar.embeddedTokens(raw, function(word) {
|
|
15859
|
-
return configuredValue(state, property, word);
|
|
15892
|
+
return configuredValue(state, property, word, false, nativeColors);
|
|
15860
15893
|
});
|
|
15861
15894
|
if (!usedSafeArea && state.flatUsesSafeArea) return out;
|
|
15862
15895
|
}
|
|
15863
|
-
if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
|
|
15896
|
+
if (!fontProperty && !fromTheme && !nativeColors) if (valueCacheEntries > 8192) {
|
|
15864
15897
|
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
15865
15898
|
valueCacheEntries = 0;
|
|
15866
15899
|
} else {
|
|
@@ -15898,9 +15931,21 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
|
|
|
15898
15931
|
var theme = cursor ? cursor[conditionTheme] : "";
|
|
15899
15932
|
if (theme) {
|
|
15900
15933
|
if (supportsDynamicColorIOS && isColorStyleKey(property)) {
|
|
15901
|
-
var _direct
|
|
15902
|
-
var
|
|
15903
|
-
schemes
|
|
15934
|
+
var _direct;
|
|
15935
|
+
var colors = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {});
|
|
15936
|
+
var schemes = colors[property];
|
|
15937
|
+
if (!schemes) {
|
|
15938
|
+
var _direct_flatSlots_get_find, _direct_flatSlots_get, _direct_flatSlots;
|
|
15939
|
+
schemes = colors[property] = {};
|
|
15940
|
+
var base = (_direct_flatSlots = direct.flatSlots) === null || _direct_flatSlots === void 0 ? void 0 : (_direct_flatSlots_get = _direct_flatSlots.get(property)) === null || _direct_flatSlots_get === void 0 ? void 0 : (_direct_flatSlots_get_find = _direct_flatSlots_get.find(function(entry) {
|
|
15941
|
+
return !entry[2];
|
|
15942
|
+
})) === null || _direct_flatSlots_get_find === void 0 ? void 0 : _direct_flatSlots_get_find[1];
|
|
15943
|
+
if (base !== void 0) {
|
|
15944
|
+
schemes.light = extractValueFromDynamic(base, "light");
|
|
15945
|
+
schemes.dark = extractValueFromDynamic(base, "dark");
|
|
15946
|
+
}
|
|
15947
|
+
}
|
|
15948
|
+
schemes[theme] = extractValueFromDynamic(value, theme);
|
|
15904
15949
|
streamWriteInline(state, property, { dynamic: _objectSpread2({}, schemes) }, cursor, originalValue, true, condition & 1 ? condition : condition + 1);
|
|
15905
15950
|
return;
|
|
15906
15951
|
}
|
|
@@ -15923,10 +15968,8 @@ function numericUnitValue(value, first, second) {
|
|
|
15923
15968
|
return value.length > first.length && (value.endsWith(first) || value.endsWith(second)) ? +value.slice(0, -first.length) : NaN;
|
|
15924
15969
|
}
|
|
15925
15970
|
function resolveNumericValue(value) {
|
|
15926
|
-
var
|
|
15927
|
-
|
|
15928
|
-
var numeric = +value;
|
|
15929
|
-
return Number.isFinite(numeric) ? numeric : value;
|
|
15971
|
+
var numeric = numericUnitValue(value, "px", "dp");
|
|
15972
|
+
return isFinite(numeric) ? numeric : isFinite(numeric = +value) ? numeric : value;
|
|
15930
15973
|
}
|
|
15931
15974
|
function emitBorder(state, property, raw, cursor, originalValue, contextOnly) {
|
|
15932
15975
|
if (property === "borderBlock" || property === "borderInline") return;
|
|
@@ -15980,9 +16023,9 @@ function emitTextDecoration(state, raw, cursor, originalValue, contextOnly) {
|
|
|
15980
16023
|
function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
|
|
15981
16024
|
emitProperty(state, property, resolveValue(state, property, raw), cursor, originalValue, contextOnly);
|
|
15982
16025
|
}
|
|
15983
|
-
function resolveValue(state, property, raw) {
|
|
15984
|
-
var value = typeof raw === "string" ? configuredValue(state, property, raw, true) : raw;
|
|
15985
|
-
if (typeof value === "string" && value !== "") value = resolveNumericValue(value);
|
|
16026
|
+
function resolveValue(state, property, raw, nativeColors) {
|
|
16027
|
+
var value = typeof raw === "string" ? configuredValue(state, property, raw, true, nativeColors) : raw;
|
|
16028
|
+
if (typeof value === "string" && value !== "" && true) value = resolveNumericValue(value);
|
|
15986
16029
|
return value;
|
|
15987
16030
|
}
|
|
15988
16031
|
function shadowUnit(part) {
|
|
@@ -16026,7 +16069,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
16026
16069
|
if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
|
|
16027
16070
|
var value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
16028
16071
|
if (typeof value2 === "string" && !value2.startsWith("theme:")) {
|
|
16029
|
-
if (property === "rotate" && !
|
|
16072
|
+
if (property === "rotate" && !isFinite(numericUnitValue(value2, "deg", "rad")) && true) {
|
|
16030
16073
|
if (condition & 1) {
|
|
16031
16074
|
removeTransformValue(state.transformAccumulator, property);
|
|
16032
16075
|
writeStyleRecord(state, property, void 0, cursor, void 0, recordRetract);
|
|
@@ -16038,9 +16081,10 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
16038
16081
|
emitProperty(state, property, value2, cursor, originalValue, contextOnly);
|
|
16039
16082
|
return;
|
|
16040
16083
|
}
|
|
16041
|
-
var
|
|
16084
|
+
var nativeColors = typeof raw === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow") ? /* @__PURE__ */ new Map() : void 0;
|
|
16085
|
+
var value3 = resolveValue(state, property, raw, nativeColors);
|
|
16042
16086
|
if (typeof value3 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
|
|
16043
|
-
var parsed = parseNativeStyle(property, value3);
|
|
16087
|
+
var parsed = parseNativeStyle(property, value3, nativeColors);
|
|
16044
16088
|
if (parsed) {
|
|
16045
16089
|
if (property === "textShadow") {
|
|
16046
16090
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
@@ -16108,9 +16152,9 @@ function walkConditionalValue(state, property, value, parent, sink) {
|
|
|
16108
16152
|
if (slices === void 0) parsedSlices.set(parsed, slices = []);
|
|
16109
16153
|
var chainCount = segments.length / 5 - 1;
|
|
16110
16154
|
if (property === "aspectRatio" && chainCount === 1) {
|
|
16111
|
-
var left =
|
|
16112
|
-
var right =
|
|
16113
|
-
if (left > 0 && right > 0 &&
|
|
16155
|
+
var left = +value.slice(segments[7], segments[8]);
|
|
16156
|
+
var right = +value.slice(segments[5], segments[6]);
|
|
16157
|
+
if (left > 0 && right > 0 && isFinite(left) && isFinite(right)) return false;
|
|
16114
16158
|
}
|
|
16115
16159
|
for (var index = 0; index < segments.length; index += 5) {
|
|
16116
16160
|
var start = segments[index];
|
|
@@ -16218,18 +16262,20 @@ function contributeValue(state, property, value, originalValue) {
|
|
|
16218
16262
|
function clearDirectStyle(state, property) {
|
|
16219
16263
|
var _direct_flatAtomics;
|
|
16220
16264
|
var direct = state;
|
|
16265
|
+
if (direct.flatDynamicColors) delete direct.flatDynamicColors[property];
|
|
16221
16266
|
var propertyKind = getConfigRevisionState(state.conf).propertyKind(property);
|
|
16222
16267
|
var atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
|
|
16223
16268
|
var slot = atomicKey;
|
|
16224
16269
|
(_direct_flatAtomics = direct.flatAtomics) === null || _direct_flatAtomics === void 0 || _direct_flatAtomics.delete(slot);
|
|
16225
16270
|
if (direct.flatSlots) {
|
|
16226
|
-
if (slot !== atomicKey) {
|
|
16271
|
+
if (slot !== atomicKey || atomicKey === "flex") {
|
|
16227
16272
|
var entries = direct.flatSlots.get(slot);
|
|
16228
16273
|
if (entries) {
|
|
16229
16274
|
for (var index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
|
|
16275
|
+
if (!entries.length) direct.flatSlots.delete(slot);
|
|
16230
16276
|
}
|
|
16231
16277
|
}
|
|
16232
|
-
direct.flatSlots.delete(atomicKey);
|
|
16278
|
+
if (atomicKey !== "flex") direct.flatSlots.delete(atomicKey);
|
|
16233
16279
|
}
|
|
16234
16280
|
if (atomicKey === "transform") state.transformAccumulator = void 0;
|
|
16235
16281
|
if (state.style) delete state.style[atomicKey];
|
package/dist/test.native.cjs
CHANGED
|
@@ -2200,7 +2200,7 @@ Haven't called createTamagui yet. ${MISSING_THEME_MESSAGE}
|
|
|
2200
2200
|
var getConfigFromGlobalOrLocal = function() {
|
|
2201
2201
|
if (conf) return conf;
|
|
2202
2202
|
if (globalThis.__tamaguiConfig) {
|
|
2203
|
-
if (globalThis.process.env.NODE_ENV === "development" && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
2203
|
+
if (globalThis.process.env.NODE_ENV === "development" && globalThis.__tamaguiEvaluationConfig !== globalThis.__tamaguiConfig && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
2204
2204
|
globalThis.__tamaguiPendingCheck = true;
|
|
2205
2205
|
setTimeout(function() {
|
|
2206
2206
|
if (!setConfigCalledByThisInstance && !globalThis.__tamaguiHasWarnedGlobalFallback) {
|
|
@@ -2238,6 +2238,7 @@ var setConfig = function(next) {
|
|
|
2238
2238
|
if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;
|
|
2239
2239
|
conf = next;
|
|
2240
2240
|
globalThis.__tamaguiConfig = next;
|
|
2241
|
+
if (process.env.TAMAGUI_ENVIRONMENT === "tamagui") globalThis.__tamaguiEvaluationConfig = next;
|
|
2241
2242
|
};
|
|
2242
2243
|
var setConfigFont = function(name, font, fontParsed) {
|
|
2243
2244
|
var config = getConfigFromGlobalOrLocal();
|
|
@@ -2896,6 +2897,10 @@ function getDynamicVal(param) {
|
|
|
2896
2897
|
[oppositeScheme]: oppositeVal
|
|
2897
2898
|
} };
|
|
2898
2899
|
}
|
|
2900
|
+
function extractValueFromDynamic(val, scheme) {
|
|
2901
|
+
if (val === null || val === void 0 ? void 0 : val["dynamic"]) return val["dynamic"][scheme];
|
|
2902
|
+
return val;
|
|
2903
|
+
}
|
|
2899
2904
|
//#endregion
|
|
2900
2905
|
//#region ../web/dist/esm/helpers/themeUpdateState.native.js
|
|
2901
2906
|
var themeUpdateStateKey = "_tmgInlineLayer";
|
|
@@ -5757,8 +5762,21 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
5757
5762
|
}
|
|
5758
5763
|
var styleOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style) : void 0;
|
|
5759
5764
|
for (var key1 in style) {
|
|
5760
|
-
|
|
5761
|
-
|
|
5765
|
+
var value1 = style[key1];
|
|
5766
|
+
if (value1 == null) continue;
|
|
5767
|
+
var inline = !styleState.styleProps.stylePieceEntries;
|
|
5768
|
+
if (inline) {
|
|
5769
|
+
if (typeof value1 === "string") {
|
|
5770
|
+
var [segments] = getConfigRevisionState(conf).parseFlatValue(value1);
|
|
5771
|
+
for (var index2 = 4; index2 < segments.length; index2 += 5) if (!(segments[index2] & 1)) {
|
|
5772
|
+
inline = false;
|
|
5773
|
+
break;
|
|
5774
|
+
}
|
|
5775
|
+
} else if (value1 && typeof value1 === "object" && !Array.isArray(value1) && !isVariable(value1) && classifyConditionalObject(value1, styleState) !== 0) inline = false;
|
|
5776
|
+
}
|
|
5777
|
+
styleState.flatInlineStyleProp = inline;
|
|
5778
|
+
contributeValue(styleState, key1, value1, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key1]);
|
|
5779
|
+
styleState.flatInlineStyleProp = false;
|
|
5762
5780
|
}
|
|
5763
5781
|
}
|
|
5764
5782
|
pass[passSourceLayer] = layerBeforeStyle;
|
|
@@ -5867,7 +5885,7 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
5867
5885
|
if (valInit === "unset") {
|
|
5868
5886
|
var expanded = expandStyle(keyInit, valInit, conf.settings.styleCompat || "web");
|
|
5869
5887
|
clearDirectStyle(styleState, keyInit);
|
|
5870
|
-
if (expanded) for (var
|
|
5888
|
+
if (expanded) for (var index3 = 0; index3 < expanded.length; index3++) clearDirectStyle(styleState, expanded[index3][0]);
|
|
5871
5889
|
} else contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
|
|
5872
5890
|
return;
|
|
5873
5891
|
}
|
|
@@ -6249,7 +6267,10 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
6249
6267
|
for (var index = 0; index < list.length; index++) {
|
|
6250
6268
|
var entry = list[index];
|
|
6251
6269
|
var entryFlags = entry[7] & 31;
|
|
6252
|
-
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS)))
|
|
6270
|
+
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) {
|
|
6271
|
+
if (sourceLayer === sourceLayerStyle && entry[7] >> 5 === sourceLayerStyle && entry[0] === source[0] && !condition && !entry[2]) list.splice(index--, 1);
|
|
6272
|
+
continue;
|
|
6273
|
+
}
|
|
6253
6274
|
if (entry[0] !== source[0]) continue;
|
|
6254
6275
|
if (flags & recordDefault) {
|
|
6255
6276
|
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
@@ -6307,8 +6328,8 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
6307
6328
|
var tokenName = typeof originalVal === "string" ? originalVal : "";
|
|
6308
6329
|
if (tokenName) {
|
|
6309
6330
|
var slash = tokenName.lastIndexOf("/");
|
|
6310
|
-
var opacity = slash === -1 ? NaN :
|
|
6311
|
-
if (
|
|
6331
|
+
var opacity = slash === -1 ? NaN : +tokenName.slice(slash + 1);
|
|
6332
|
+
if (opacity % 1 === 0 && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
6312
6333
|
}
|
|
6313
6334
|
if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (((_styleState_conf_themes = styleState.conf.themes) === null || _styleState_conf_themes === void 0 ? void 0 : _styleState_conf_themes[styleState.flatThemeName || ""]) || {}) || Object.values(styleState.conf.tokensParsed).some(function(category) {
|
|
6314
6335
|
return tokenName in category;
|
|
@@ -6357,27 +6378,39 @@ var recordDefault = 8;
|
|
|
6357
6378
|
var recordCSS = 16;
|
|
6358
6379
|
function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
6359
6380
|
var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
|
|
6360
|
-
var
|
|
6381
|
+
var _direct_flatPass;
|
|
6361
6382
|
var _direct;
|
|
6362
6383
|
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
|
|
6363
6384
|
var identity = cursor ? cursor[conditionKey] : "";
|
|
6364
|
-
var
|
|
6365
|
-
var
|
|
6385
|
+
var direct = state;
|
|
6386
|
+
var slots = (_direct = direct).flatSlots || (_direct.flatSlots = /* @__PURE__ */ new Map());
|
|
6387
|
+
var sourceLayer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
|
|
6388
|
+
if (direct.flatInlineStyleProp) flags |= recordInline;
|
|
6389
|
+
var cssSlot = property.startsWith("transition") ? "transition" : property;
|
|
6390
|
+
var slot = flags & recordInline && cssSlot !== property ? property : cssSlot;
|
|
6366
6391
|
var list = slots.get(slot);
|
|
6367
6392
|
if (!list) slots.set(slot, list = []);
|
|
6368
|
-
|
|
6369
|
-
var
|
|
6370
|
-
var
|
|
6371
|
-
|
|
6372
|
-
|
|
6393
|
+
if (sourceLayer === sourceLayerStyle && !condition) {
|
|
6394
|
+
var other = slot === cssSlot ? list : slots.get(flags & recordInline ? cssSlot : property);
|
|
6395
|
+
if (other) for (var index = 0; index < other.length; index++) {
|
|
6396
|
+
var entry = other[index];
|
|
6397
|
+
var entryFlags = entry[7];
|
|
6398
|
+
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
|
|
6399
|
+
}
|
|
6400
|
+
}
|
|
6401
|
+
for (var index1 = 0; index1 < list.length; index1++) {
|
|
6402
|
+
var entry1 = list[index1];
|
|
6403
|
+
var entryFlags1 = entry1[7];
|
|
6404
|
+
if ((entryFlags1 & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
|
|
6405
|
+
if (entry1[0] !== property) continue;
|
|
6373
6406
|
if (flags & recordDefault) {
|
|
6374
|
-
if (!(
|
|
6375
|
-
} else if (
|
|
6376
|
-
list.splice(
|
|
6407
|
+
if (!(entryFlags1 & recordDefault) && (!entry1[2] || entry1[3] === identity)) return;
|
|
6408
|
+
} else if (entryFlags1 & recordDefault && (!condition || entry1[3] === identity)) {
|
|
6409
|
+
list.splice(index1--, 1);
|
|
6377
6410
|
continue;
|
|
6378
6411
|
}
|
|
6379
|
-
if (
|
|
6380
|
-
list.splice(
|
|
6412
|
+
if (entry1[3] === identity) {
|
|
6413
|
+
list.splice(index1, 1);
|
|
6381
6414
|
break;
|
|
6382
6415
|
}
|
|
6383
6416
|
}
|
|
@@ -6389,7 +6422,7 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
|
6389
6422
|
cursor ? cursor[conditionSelector] : "",
|
|
6390
6423
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
6391
6424
|
original,
|
|
6392
|
-
flags |
|
|
6425
|
+
flags | sourceLayer << 5
|
|
6393
6426
|
]);
|
|
6394
6427
|
}
|
|
6395
6428
|
function streamWriteInline(state, property, value, cursor, original) {
|
|
@@ -6564,14 +6597,14 @@ var cssWideColorKeywords = /* @__PURE__ */ new Set([
|
|
|
6564
6597
|
"transparent"
|
|
6565
6598
|
]);
|
|
6566
6599
|
function configuredValue(state, property, raw) {
|
|
6567
|
-
var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
6600
|
+
var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, nativeColors = arguments.length > 4 ? arguments[4] : void 0;
|
|
6568
6601
|
var grammar = getConfigRevisionState(state.conf);
|
|
6569
6602
|
var name = raw;
|
|
6570
6603
|
var opacity;
|
|
6571
6604
|
var slash = raw.lastIndexOf("/");
|
|
6572
6605
|
if (slash > 0) {
|
|
6573
|
-
var amount =
|
|
6574
|
-
if (
|
|
6606
|
+
var amount = +raw.slice(slash + 1);
|
|
6607
|
+
if (amount % 1 === 0 && amount >= 0 && amount <= 100) {
|
|
6575
6608
|
name = raw.slice(0, slash);
|
|
6576
6609
|
opacity = amount;
|
|
6577
6610
|
}
|
|
@@ -6584,7 +6617,7 @@ function configuredValue(state, property, raw) {
|
|
|
6584
6617
|
var fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
|
|
6585
6618
|
var resolveValues = state.styleProps.resolveValues;
|
|
6586
6619
|
var byRaw;
|
|
6587
|
-
if (!fontProperty) {
|
|
6620
|
+
if (!fontProperty && !nativeColors) {
|
|
6588
6621
|
var _maps;
|
|
6589
6622
|
var revision = grammar.revision;
|
|
6590
6623
|
if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
|
|
@@ -6660,27 +6693,18 @@ function configuredValue(state, property, raw) {
|
|
|
6660
6693
|
var rawNum = Number(name);
|
|
6661
6694
|
var tokens = category1 ? state.conf.tokensParsed[category1] : void 0;
|
|
6662
6695
|
if (tokens && Number.isFinite(rawNum)) for (var key in tokens) {
|
|
6663
|
-
var
|
|
6664
|
-
|
|
6665
|
-
|
|
6696
|
+
var _tokens_key;
|
|
6697
|
+
var val = (_tokens_key = tokens[key]) === null || _tokens_key === void 0 ? void 0 : _tokens_key.val;
|
|
6698
|
+
var valNum = typeof val === "number" ? val : Number(val);
|
|
6699
|
+
if (Number.isFinite(valNum)) {
|
|
6700
|
+
var dist = Math.abs(valNum - rawNum);
|
|
6666
6701
|
if (dist < minDistance) {
|
|
6667
6702
|
minDistance = dist;
|
|
6668
6703
|
nearest = key;
|
|
6669
6704
|
}
|
|
6670
|
-
} else {
|
|
6671
|
-
var _tokens_key;
|
|
6672
|
-
var val = (_tokens_key = tokens[key]) === null || _tokens_key === void 0 ? void 0 : _tokens_key.val;
|
|
6673
|
-
var valNum = typeof val === "number" ? val : Number(val);
|
|
6674
|
-
if (Number.isFinite(valNum)) {
|
|
6675
|
-
var dist1 = Math.abs(valNum - rawNum);
|
|
6676
|
-
if (dist1 < minDistance) {
|
|
6677
|
-
minDistance = dist1;
|
|
6678
|
-
nearest = key;
|
|
6679
|
-
}
|
|
6680
|
-
}
|
|
6681
6705
|
}
|
|
6682
6706
|
}
|
|
6683
|
-
warnOnce(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is with px units${nearest ? `; nearest token is "${nearest}"` : ""}`);
|
|
6707
|
+
if (nearest) warnOnce(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is${category1 === "zIndex" ? "" : " with px units"}${nearest ? `; nearest token is "${nearest}"` : ""}`);
|
|
6684
6708
|
} else if (category1 === "color" && /^[a-zA-Z0-9-]+$/.test(name) && /[a-zA-Z]/.test(name)) {
|
|
6685
6709
|
var lower = name.toLowerCase();
|
|
6686
6710
|
if (!namedCssColors.has(lower) && !cssWideColorKeywords.has(lower)) {
|
|
@@ -6711,9 +6735,9 @@ function configuredValue(state, property, raw) {
|
|
|
6711
6735
|
prev = temp;
|
|
6712
6736
|
}
|
|
6713
6737
|
}
|
|
6714
|
-
var
|
|
6715
|
-
if (
|
|
6716
|
-
minDistance1 =
|
|
6738
|
+
var dist1 = d[m];
|
|
6739
|
+
if (dist1 <= 2 && dist1 < minDistance1) {
|
|
6740
|
+
minDistance1 = dist1;
|
|
6717
6741
|
bestMatch = key1;
|
|
6718
6742
|
}
|
|
6719
6743
|
}
|
|
@@ -6734,20 +6758,25 @@ function configuredValue(state, property, raw) {
|
|
|
6734
6758
|
}
|
|
6735
6759
|
var out = raw;
|
|
6736
6760
|
if (isVariable(value)) {
|
|
6737
|
-
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(property, value, resolveValues);
|
|
6761
|
+
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(nativeColors ? "color" : property, value, resolveValues);
|
|
6738
6762
|
if (opacity !== void 0) {
|
|
6739
6763
|
var _normalizeColor;
|
|
6740
6764
|
out = (_normalizeColor = normalizeColor(out, opacity / 100)) !== null && _normalizeColor !== void 0 ? _normalizeColor : out;
|
|
6741
6765
|
}
|
|
6742
6766
|
}
|
|
6767
|
+
if (nativeColors && out && typeof out === "object") {
|
|
6768
|
+
var reference = `__tamagui_native_color_${nativeColors.size}`;
|
|
6769
|
+
nativeColors.set(reference, out);
|
|
6770
|
+
out = reference;
|
|
6771
|
+
}
|
|
6743
6772
|
if (embedded && out === raw) {
|
|
6744
6773
|
var usedSafeArea = state.flatUsesSafeArea;
|
|
6745
6774
|
out = grammar.embeddedTokens(raw, function(word) {
|
|
6746
|
-
return configuredValue(state, property, word);
|
|
6775
|
+
return configuredValue(state, property, word, false, nativeColors);
|
|
6747
6776
|
});
|
|
6748
6777
|
if (!usedSafeArea && state.flatUsesSafeArea) return out;
|
|
6749
6778
|
}
|
|
6750
|
-
if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
|
|
6779
|
+
if (!fontProperty && !fromTheme && !nativeColors) if (valueCacheEntries > 8192) {
|
|
6751
6780
|
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
6752
6781
|
valueCacheEntries = 0;
|
|
6753
6782
|
} else {
|
|
@@ -6785,9 +6814,21 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
|
|
|
6785
6814
|
var theme = cursor ? cursor[conditionTheme] : "";
|
|
6786
6815
|
if (theme) {
|
|
6787
6816
|
if (supportsDynamicColorIOS && isColorStyleKey(property)) {
|
|
6788
|
-
var _direct
|
|
6789
|
-
var
|
|
6790
|
-
schemes
|
|
6817
|
+
var _direct;
|
|
6818
|
+
var colors = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {});
|
|
6819
|
+
var schemes = colors[property];
|
|
6820
|
+
if (!schemes) {
|
|
6821
|
+
var _direct_flatSlots_get_find, _direct_flatSlots_get, _direct_flatSlots;
|
|
6822
|
+
schemes = colors[property] = {};
|
|
6823
|
+
var base = (_direct_flatSlots = direct.flatSlots) === null || _direct_flatSlots === void 0 ? void 0 : (_direct_flatSlots_get = _direct_flatSlots.get(property)) === null || _direct_flatSlots_get === void 0 ? void 0 : (_direct_flatSlots_get_find = _direct_flatSlots_get.find(function(entry) {
|
|
6824
|
+
return !entry[2];
|
|
6825
|
+
})) === null || _direct_flatSlots_get_find === void 0 ? void 0 : _direct_flatSlots_get_find[1];
|
|
6826
|
+
if (base !== void 0) {
|
|
6827
|
+
schemes.light = extractValueFromDynamic(base, "light");
|
|
6828
|
+
schemes.dark = extractValueFromDynamic(base, "dark");
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
schemes[theme] = extractValueFromDynamic(value, theme);
|
|
6791
6832
|
streamWriteInline(state, property, { dynamic: _objectSpread2({}, schemes) }, cursor, originalValue, true, condition & 1 ? condition : condition + 1);
|
|
6792
6833
|
return;
|
|
6793
6834
|
}
|
|
@@ -6810,10 +6851,8 @@ function numericUnitValue(value, first, second) {
|
|
|
6810
6851
|
return value.length > first.length && (value.endsWith(first) || value.endsWith(second)) ? +value.slice(0, -first.length) : NaN;
|
|
6811
6852
|
}
|
|
6812
6853
|
function resolveNumericValue(value) {
|
|
6813
|
-
var
|
|
6814
|
-
|
|
6815
|
-
var numeric = +value;
|
|
6816
|
-
return Number.isFinite(numeric) ? numeric : value;
|
|
6854
|
+
var numeric = numericUnitValue(value, "px", "dp");
|
|
6855
|
+
return isFinite(numeric) ? numeric : isFinite(numeric = +value) ? numeric : value;
|
|
6817
6856
|
}
|
|
6818
6857
|
function emitBorder(state, property, raw, cursor, originalValue, contextOnly) {
|
|
6819
6858
|
if (property === "borderBlock" || property === "borderInline") {
|
|
@@ -6870,9 +6909,9 @@ function emitTextDecoration(state, raw, cursor, originalValue, contextOnly) {
|
|
|
6870
6909
|
function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
|
|
6871
6910
|
emitProperty(state, property, resolveValue(state, property, raw), cursor, originalValue, contextOnly);
|
|
6872
6911
|
}
|
|
6873
|
-
function resolveValue(state, property, raw) {
|
|
6874
|
-
var value = typeof raw === "string" ? configuredValue(state, property, raw, true) : raw;
|
|
6875
|
-
if (typeof value === "string" && value !== "") value = resolveNumericValue(value);
|
|
6912
|
+
function resolveValue(state, property, raw, nativeColors) {
|
|
6913
|
+
var value = typeof raw === "string" ? configuredValue(state, property, raw, true, nativeColors) : raw;
|
|
6914
|
+
if (typeof value === "string" && value !== "" && true) value = resolveNumericValue(value);
|
|
6876
6915
|
return value;
|
|
6877
6916
|
}
|
|
6878
6917
|
function shadowUnit(part) {
|
|
@@ -6917,7 +6956,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
6917
6956
|
if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
|
|
6918
6957
|
var value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
6919
6958
|
if (typeof value2 === "string" && !value2.startsWith("theme:")) {
|
|
6920
|
-
if (property === "rotate" && !
|
|
6959
|
+
if (property === "rotate" && !isFinite(numericUnitValue(value2, "deg", "rad")) && true) {
|
|
6921
6960
|
if (globalThis.process.env.NODE_ENV === "development") warnOnce(`native transform "${property}" cannot represent "${value2}"; dropping it`);
|
|
6922
6961
|
if (condition & 1) {
|
|
6923
6962
|
removeTransformValue(state.transformAccumulator, property);
|
|
@@ -6930,9 +6969,10 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
6930
6969
|
emitProperty(state, property, value2, cursor, originalValue, contextOnly);
|
|
6931
6970
|
return;
|
|
6932
6971
|
}
|
|
6933
|
-
var
|
|
6972
|
+
var nativeColors = typeof raw === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow") ? /* @__PURE__ */ new Map() : void 0;
|
|
6973
|
+
var value3 = resolveValue(state, property, raw, nativeColors);
|
|
6934
6974
|
if (typeof value3 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
|
|
6935
|
-
var parsed = parseNativeStyle(property, value3);
|
|
6975
|
+
var parsed = parseNativeStyle(property, value3, nativeColors);
|
|
6936
6976
|
if (parsed) {
|
|
6937
6977
|
if (property === "textShadow") {
|
|
6938
6978
|
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
@@ -7006,9 +7046,9 @@ function walkConditionalValue(state, property, value, parent, sink) {
|
|
|
7006
7046
|
if (slices === void 0) parsedSlices.set(parsed, slices = []);
|
|
7007
7047
|
var chainCount = segments.length / 5 - 1;
|
|
7008
7048
|
if (property === "aspectRatio" && chainCount === 1) {
|
|
7009
|
-
var left =
|
|
7010
|
-
var right =
|
|
7011
|
-
if (left > 0 && right > 0 &&
|
|
7049
|
+
var left = +value.slice(segments[7], segments[8]);
|
|
7050
|
+
var right = +value.slice(segments[5], segments[6]);
|
|
7051
|
+
if (left > 0 && right > 0 && isFinite(left) && isFinite(right)) return false;
|
|
7012
7052
|
}
|
|
7013
7053
|
for (var index = 0; index < segments.length; index += 5) {
|
|
7014
7054
|
var start = segments[index];
|
|
@@ -7069,7 +7109,7 @@ function walkConditionalValue(state, property, value, parent, sink) {
|
|
|
7069
7109
|
if (cursor1[conditionValue] & conditionResolvedFlag || warnMode) emitConditionalValue(state, property, value[key], cursor1, value[key], sink, warnMode, contextOnly);
|
|
7070
7110
|
}
|
|
7071
7111
|
}
|
|
7072
|
-
if (warnMode && globalThis.process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && getConfigRevisionState(state.conf).tokenCategory(property) && splitComponents(lastPayload).length > 1) warnOnce(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
7112
|
+
if (warnMode && globalThis.process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && getConfigRevisionState(state.conf).tokenCategory(property) && getConfigRevisionState(state.conf).propertyKind(property) !== 8 && property !== "boxShadow" && property !== "textShadow" && property !== "fontFamily" && property !== "gap" && splitComponents(lastPayload).length > 1) warnOnce(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
7073
7113
|
if (warnMode === 1 && conditions & 12 && !hasBase) {
|
|
7074
7114
|
var _state_flatPropertyLayers;
|
|
7075
7115
|
var resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
|
|
@@ -7132,18 +7172,20 @@ function contributeValue(state, property, value, originalValue) {
|
|
|
7132
7172
|
function clearDirectStyle(state, property) {
|
|
7133
7173
|
var _direct_flatAtomics;
|
|
7134
7174
|
var direct = state;
|
|
7175
|
+
if (direct.flatDynamicColors) delete direct.flatDynamicColors[property];
|
|
7135
7176
|
var propertyKind = getConfigRevisionState(state.conf).propertyKind(property);
|
|
7136
7177
|
var atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
|
|
7137
7178
|
var slot = atomicKey;
|
|
7138
7179
|
(_direct_flatAtomics = direct.flatAtomics) === null || _direct_flatAtomics === void 0 || _direct_flatAtomics.delete(slot);
|
|
7139
7180
|
if (direct.flatSlots) {
|
|
7140
|
-
if (slot !== atomicKey) {
|
|
7181
|
+
if (slot !== atomicKey || atomicKey === "flex") {
|
|
7141
7182
|
var entries = direct.flatSlots.get(slot);
|
|
7142
7183
|
if (entries) {
|
|
7143
7184
|
for (var index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
|
|
7185
|
+
if (!entries.length) direct.flatSlots.delete(slot);
|
|
7144
7186
|
}
|
|
7145
7187
|
}
|
|
7146
|
-
direct.flatSlots.delete(atomicKey);
|
|
7188
|
+
if (atomicKey !== "flex") direct.flatSlots.delete(atomicKey);
|
|
7147
7189
|
}
|
|
7148
7190
|
if (atomicKey === "transform") state.transformAccumulator = void 0;
|
|
7149
7191
|
if (state.style) delete state.style[atomicKey];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1141.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -137,20 +137,20 @@
|
|
|
137
137
|
"clean:build": "tamagui-build clean:build"
|
|
138
138
|
},
|
|
139
139
|
"dependencies": {
|
|
140
|
-
"@tamagui/compose-refs": "3.0.0-beta.
|
|
141
|
-
"@tamagui/constants": "3.0.0-beta.
|
|
142
|
-
"@tamagui/helpers": "3.0.0-beta.
|
|
143
|
-
"@tamagui/react-native-media-driver": "3.0.0-beta.
|
|
144
|
-
"@tamagui/react-native-use-pressable": "3.0.0-beta.
|
|
145
|
-
"@tamagui/size": "3.0.0-beta.
|
|
146
|
-
"@tamagui/use-element-layout": "3.0.0-beta.
|
|
147
|
-
"@tamagui/use-event": "3.0.0-beta.
|
|
148
|
-
"@tamagui/web": "3.0.0-beta.
|
|
140
|
+
"@tamagui/compose-refs": "3.0.0-beta.1141.1",
|
|
141
|
+
"@tamagui/constants": "3.0.0-beta.1141.1",
|
|
142
|
+
"@tamagui/helpers": "3.0.0-beta.1141.1",
|
|
143
|
+
"@tamagui/react-native-media-driver": "3.0.0-beta.1141.1",
|
|
144
|
+
"@tamagui/react-native-use-pressable": "3.0.0-beta.1141.1",
|
|
145
|
+
"@tamagui/size": "3.0.0-beta.1141.1",
|
|
146
|
+
"@tamagui/use-element-layout": "3.0.0-beta.1141.1",
|
|
147
|
+
"@tamagui/use-event": "3.0.0-beta.1141.1",
|
|
148
|
+
"@tamagui/web": "3.0.0-beta.1141.1"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
|
-
"@tamagui/build": "3.0.0-beta.
|
|
152
|
-
"@tamagui/native-bundle": "3.0.0-beta.
|
|
153
|
-
"@tamagui/react-native-web-lite": "3.0.0-beta.
|
|
151
|
+
"@tamagui/build": "3.0.0-beta.1141.1",
|
|
152
|
+
"@tamagui/native-bundle": "3.0.0-beta.1141.1",
|
|
153
|
+
"@tamagui/react-native-web-lite": "3.0.0-beta.1141.1",
|
|
154
154
|
"@testing-library/react": "^16.1.0",
|
|
155
155
|
"csstype": "^3.0.10",
|
|
156
156
|
"react": "19.2.3",
|