@tamagui/core 3.0.0-beta.1093.1 → 3.0.0-beta.1099.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 +162 -112
- package/dist/test.native.cjs +291 -114
- package/package.json +13 -13
package/dist/native.cjs
CHANGED
|
@@ -10847,6 +10847,80 @@ var nonAnimatableWebTextProps = toStylePropsObject("whiteSpace wordWrap textOver
|
|
|
10847
10847
|
var webOnlyStylePropsView = toStylePropsObject(nonAnimatableWebViewProps, "transition transitionProperty transitionDuration transitionTimingFunction transitionDelay transitionBehavior backdropFilter WebkitBackdropFilter borderTop borderRight borderBottom borderLeft backgroundPosition backgroundSize borderImage caretColor clipPath mask maskBorder maskBorderOutset maskBorderSlice maskBorderSource maskBorderWidth maskImage maskPosition maskSize objectPosition textEmphasis userSelect overflowWrap wordWrap resize");
|
|
10848
10848
|
var webOnlyStylePropsText = toStylePropsObject(nonAnimatableWebTextProps, "textDecorationDistance WebkitLineClamp");
|
|
10849
10849
|
//#endregion
|
|
10850
|
+
//#region ../style-grammar/dist/esm/tooling/config.native.js
|
|
10851
|
+
var containerSizeQueryTextPattern = /width|height|inline-size|block-size/;
|
|
10852
|
+
function isContainerSizeQueryText(query) {
|
|
10853
|
+
return containerSizeQueryTextPattern.test(query);
|
|
10854
|
+
}
|
|
10855
|
+
var grammarPlatformNames = /* @__PURE__ */ new Set([
|
|
10856
|
+
"web",
|
|
10857
|
+
"native",
|
|
10858
|
+
"android",
|
|
10859
|
+
"ios",
|
|
10860
|
+
"tv",
|
|
10861
|
+
"androidtv",
|
|
10862
|
+
"tvos"
|
|
10863
|
+
]);
|
|
10864
|
+
function grammarPlatformRank(modifier) {
|
|
10865
|
+
return modifier === "native" || modifier === "web" ? 1 : modifier === "androidtv" || modifier === "tvos" ? 3 : 2;
|
|
10866
|
+
}
|
|
10867
|
+
//#endregion
|
|
10868
|
+
//#region ../style-grammar/dist/esm/runtime/stateModifiers.native.js
|
|
10869
|
+
var coreStateModifierNames = Object.freeze([
|
|
10870
|
+
"hover",
|
|
10871
|
+
"press",
|
|
10872
|
+
"focus",
|
|
10873
|
+
"focus-visible",
|
|
10874
|
+
"focus-within",
|
|
10875
|
+
"disabled",
|
|
10876
|
+
"enter",
|
|
10877
|
+
"exit"
|
|
10878
|
+
]);
|
|
10879
|
+
var canonicalStateModifierNames = Object.freeze([
|
|
10880
|
+
"hover",
|
|
10881
|
+
"focus-within",
|
|
10882
|
+
"focus",
|
|
10883
|
+
"focus-visible",
|
|
10884
|
+
"press",
|
|
10885
|
+
"disabled",
|
|
10886
|
+
"enter",
|
|
10887
|
+
"exit"
|
|
10888
|
+
]);
|
|
10889
|
+
var stateModifierSelectors = Object.freeze([
|
|
10890
|
+
":hover",
|
|
10891
|
+
":focus-within",
|
|
10892
|
+
":focus",
|
|
10893
|
+
":focus-visible",
|
|
10894
|
+
":active",
|
|
10895
|
+
"[aria-disabled]",
|
|
10896
|
+
".t_unmounted",
|
|
10897
|
+
".t_exiting"
|
|
10898
|
+
]);
|
|
10899
|
+
var modifierAliases = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
10900
|
+
active: "press",
|
|
10901
|
+
pressed: "press",
|
|
10902
|
+
starting: "enter",
|
|
10903
|
+
ending: "exit"
|
|
10904
|
+
}));
|
|
10905
|
+
function isModifierName(text, start, end) {
|
|
10906
|
+
if (start >= end) return false;
|
|
10907
|
+
for (var index = start; index < end; index++) {
|
|
10908
|
+
var code = text.charCodeAt(index);
|
|
10909
|
+
if (!(code >= 97 && code <= 122) && !(code >= 65 && code <= 90) && !(code >= 48 && code <= 57) && code !== 45 && code !== 95) return false;
|
|
10910
|
+
}
|
|
10911
|
+
return true;
|
|
10912
|
+
}
|
|
10913
|
+
function canonicalClauseModifier(name) {
|
|
10914
|
+
var direct = modifierAliases[name];
|
|
10915
|
+
if (direct) return direct;
|
|
10916
|
+
if (!name.startsWith("group-")) return name;
|
|
10917
|
+
var slash = name.indexOf("/");
|
|
10918
|
+
if (slash !== -1 && !isModifierName(name, slash + 1, name.length)) return name;
|
|
10919
|
+
var state = modifierAliases[name.slice(6, slash === -1 ? name.length : slash)];
|
|
10920
|
+
if (!state || state === "enter" || state === "exit") return name;
|
|
10921
|
+
return slash === -1 ? `group-${state}` : `group-${state}${name.slice(slash)}`;
|
|
10922
|
+
}
|
|
10923
|
+
//#endregion
|
|
10850
10924
|
//#region ../style-grammar/dist/esm/runtime/scanFlatValue.native.js
|
|
10851
10925
|
var parsedValues = /* @__PURE__ */ new Map();
|
|
10852
10926
|
var parsedValuesLimit = 4096;
|
|
@@ -10861,12 +10935,12 @@ function parseFlatValue(source) {
|
|
|
10861
10935
|
function parseFlatValueProduction(source) {
|
|
10862
10936
|
var length = source.length;
|
|
10863
10937
|
var segments = [];
|
|
10864
|
-
var sawChain = false, chainStart = -1, chainEnd = -1, segmentStart = 0, wordStart = -1, lastColon = -1, quote = 0, comment = false, depth = 0, valid = true;
|
|
10938
|
+
var sawChain = false, chainStart = -1, chainEnd = -1, segmentStart = 0, wordStart = -1, lastColon = -1, quote = 0, comment = false, depth = 0, valid = true, clauseChainValid = true, currentChainValid = true, chainNonPlatformModifiers = null;
|
|
10865
10939
|
var close = function(end) {
|
|
10866
10940
|
var start = segmentStart;
|
|
10867
10941
|
while (start < end && source.charCodeAt(start) <= 32) start++;
|
|
10868
10942
|
while (end > start && source.charCodeAt(end - 1) <= 32) end--;
|
|
10869
|
-
segments.push(start, end, chainStart, chainEnd, (!sawChain ? 1 : 0) | 6);
|
|
10943
|
+
segments.push(start, end, chainStart, chainEnd, (!sawChain ? 1 : 0) | (clauseChainValid ? 6 : 0));
|
|
10870
10944
|
};
|
|
10871
10945
|
var flush = function() {
|
|
10872
10946
|
if (wordStart !== -1 && lastColon !== -1) {
|
|
@@ -10874,8 +10948,11 @@ function parseFlatValueProduction(source) {
|
|
|
10874
10948
|
chainEnd = lastColon;
|
|
10875
10949
|
sawChain = true;
|
|
10876
10950
|
segmentStart = lastColon + 1;
|
|
10951
|
+
clauseChainValid = currentChainValid;
|
|
10877
10952
|
}
|
|
10878
10953
|
wordStart = lastColon = -1;
|
|
10954
|
+
currentChainValid = true;
|
|
10955
|
+
chainNonPlatformModifiers = null;
|
|
10879
10956
|
};
|
|
10880
10957
|
for (var index = 0; index < length; index++) {
|
|
10881
10958
|
var code = source.charCodeAt(index);
|
|
@@ -10924,7 +11001,20 @@ function parseFlatValueProduction(source) {
|
|
|
10924
11001
|
if (wordStart === -1) wordStart = index;
|
|
10925
11002
|
if (code === 59 || code === 123 || code === 125) valid = false;
|
|
10926
11003
|
else if (code === 58) {
|
|
10927
|
-
if (lastColon === -1)
|
|
11004
|
+
if (lastColon === -1) {
|
|
11005
|
+
close(wordStart);
|
|
11006
|
+
clauseChainValid = true;
|
|
11007
|
+
currentChainValid = true;
|
|
11008
|
+
chainNonPlatformModifiers = /* @__PURE__ */ new Set();
|
|
11009
|
+
}
|
|
11010
|
+
var modStart = lastColon === -1 ? wordStart : lastColon + 1;
|
|
11011
|
+
if (modStart < index && currentChainValid) {
|
|
11012
|
+
var canonical = canonicalClauseModifier(source.slice(modStart, index));
|
|
11013
|
+
if (!grammarPlatformNames.has(canonical)) {
|
|
11014
|
+
chainNonPlatformModifiers === null || chainNonPlatformModifiers === void 0 || chainNonPlatformModifiers.add(canonical);
|
|
11015
|
+
if (chainNonPlatformModifiers && chainNonPlatformModifiers.size > 5) currentChainValid = false;
|
|
11016
|
+
}
|
|
11017
|
+
}
|
|
10928
11018
|
lastColon = index;
|
|
10929
11019
|
}
|
|
10930
11020
|
}
|
|
@@ -10939,83 +11029,9 @@ function parseFlatValueProduction(source) {
|
|
|
10939
11029
|
];
|
|
10940
11030
|
}
|
|
10941
11031
|
//#endregion
|
|
10942
|
-
//#region ../style-grammar/dist/esm/runtime/stateModifiers.native.js
|
|
10943
|
-
var coreStateModifierNames = Object.freeze([
|
|
10944
|
-
"hover",
|
|
10945
|
-
"press",
|
|
10946
|
-
"focus",
|
|
10947
|
-
"focus-visible",
|
|
10948
|
-
"focus-within",
|
|
10949
|
-
"disabled",
|
|
10950
|
-
"enter",
|
|
10951
|
-
"exit"
|
|
10952
|
-
]);
|
|
10953
|
-
var canonicalStateModifierNames = Object.freeze([
|
|
10954
|
-
"hover",
|
|
10955
|
-
"focus-within",
|
|
10956
|
-
"focus",
|
|
10957
|
-
"focus-visible",
|
|
10958
|
-
"press",
|
|
10959
|
-
"disabled",
|
|
10960
|
-
"enter",
|
|
10961
|
-
"exit"
|
|
10962
|
-
]);
|
|
10963
|
-
var stateModifierSelectors = Object.freeze([
|
|
10964
|
-
":hover",
|
|
10965
|
-
":focus-within",
|
|
10966
|
-
":focus",
|
|
10967
|
-
":focus-visible",
|
|
10968
|
-
":active",
|
|
10969
|
-
"[aria-disabled]",
|
|
10970
|
-
".t_unmounted",
|
|
10971
|
-
".t_exiting"
|
|
10972
|
-
]);
|
|
10973
|
-
var modifierAliases = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
10974
|
-
active: "press",
|
|
10975
|
-
pressed: "press",
|
|
10976
|
-
starting: "enter",
|
|
10977
|
-
ending: "exit"
|
|
10978
|
-
}));
|
|
10979
|
-
//#endregion
|
|
10980
11032
|
//#region ../style-grammar/dist/esm/runtime/clauseIdentity.native.js
|
|
10981
11033
|
var stateModifierNames = Object.freeze([...coreStateModifierNames, ...Object.keys(modifierAliases)]);
|
|
10982
11034
|
new Set(stateModifierNames);
|
|
10983
|
-
function isModifierName(text, start, end) {
|
|
10984
|
-
if (start >= end) return false;
|
|
10985
|
-
for (var index = start; index < end; index++) {
|
|
10986
|
-
var code = text.charCodeAt(index);
|
|
10987
|
-
if (!(code >= 97 && code <= 122) && !(code >= 65 && code <= 90) && !(code >= 48 && code <= 57) && code !== 45 && code !== 95) return false;
|
|
10988
|
-
}
|
|
10989
|
-
return true;
|
|
10990
|
-
}
|
|
10991
|
-
function canonicalClauseModifier(name) {
|
|
10992
|
-
var direct = modifierAliases[name];
|
|
10993
|
-
if (direct) return direct;
|
|
10994
|
-
if (!name.startsWith("group-")) return name;
|
|
10995
|
-
var slash = name.indexOf("/");
|
|
10996
|
-
if (slash !== -1 && !isModifierName(name, slash + 1, name.length)) return name;
|
|
10997
|
-
var state = modifierAliases[name.slice(6, slash === -1 ? name.length : slash)];
|
|
10998
|
-
if (!state || state === "enter" || state === "exit") return name;
|
|
10999
|
-
return slash === -1 ? `group-${state}` : `group-${state}${name.slice(slash)}`;
|
|
11000
|
-
}
|
|
11001
|
-
//#endregion
|
|
11002
|
-
//#region ../style-grammar/dist/esm/tooling/config.native.js
|
|
11003
|
-
var containerSizeQueryTextPattern = /width|height|inline-size|block-size/;
|
|
11004
|
-
function isContainerSizeQueryText(query) {
|
|
11005
|
-
return containerSizeQueryTextPattern.test(query);
|
|
11006
|
-
}
|
|
11007
|
-
var grammarPlatformNames = /* @__PURE__ */ new Set([
|
|
11008
|
-
"web",
|
|
11009
|
-
"native",
|
|
11010
|
-
"android",
|
|
11011
|
-
"ios",
|
|
11012
|
-
"tv",
|
|
11013
|
-
"androidtv",
|
|
11014
|
-
"tvos"
|
|
11015
|
-
]);
|
|
11016
|
-
function grammarPlatformRank(modifier) {
|
|
11017
|
-
return modifier === "native" || modifier === "web" ? 1 : modifier === "androidtv" || modifier === "tvos" ? 3 : 2;
|
|
11018
|
-
}
|
|
11019
11035
|
//#endregion
|
|
11020
11036
|
//#region ../style-grammar/dist/esm/runtime/modifierVocabulary.native.js
|
|
11021
11037
|
var configRevisionSymbol = /* @__PURE__ */ Symbol.for("tamagui.configRevision");
|
|
@@ -11999,14 +12015,12 @@ var getConfigFromGlobalOrLocal = function() {
|
|
|
11999
12015
|
return null;
|
|
12000
12016
|
};
|
|
12001
12017
|
var getSetting = function(key) {
|
|
12002
|
-
|
|
12003
|
-
var _config_settings_key;
|
|
12004
|
-
return (_config_settings_key = config.settings[key]) !== null && _config_settings_key !== void 0 ? _config_settings_key : config[key];
|
|
12018
|
+
return getConfigFromGlobalOrLocal().settings[key];
|
|
12005
12019
|
};
|
|
12006
12020
|
function getStyleCompat() {
|
|
12021
|
+
var _config_settings;
|
|
12007
12022
|
var config = getConfigFromGlobalOrLocal();
|
|
12008
|
-
|
|
12009
|
-
return ((_config_settings_styleCompat = config === null || config === void 0 ? void 0 : config.settings.styleCompat) !== null && _config_settings_styleCompat !== void 0 ? _config_settings_styleCompat : config === null || config === void 0 ? void 0 : config.styleCompat) || "web";
|
|
12023
|
+
return (config === null || config === void 0 ? void 0 : (_config_settings = config.settings) === null || _config_settings === void 0 ? void 0 : _config_settings.styleCompat) || "web";
|
|
12010
12024
|
}
|
|
12011
12025
|
var setConfig = function(next) {
|
|
12012
12026
|
var previous = conf;
|
|
@@ -13996,7 +14010,13 @@ var borderDefaults = {
|
|
|
13996
14010
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
13997
14011
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
13998
14012
|
borderLeftWidth: nativeStyle || "borderLeftStyle",
|
|
13999
|
-
borderRightWidth: nativeStyle || "borderRightStyle"
|
|
14013
|
+
borderRightWidth: nativeStyle || "borderRightStyle",
|
|
14014
|
+
borderBlockWidth: nativeStyle || "borderBlockStyle",
|
|
14015
|
+
borderBlockStartWidth: nativeStyle || "borderBlockStartStyle",
|
|
14016
|
+
borderBlockEndWidth: nativeStyle || "borderBlockEndStyle",
|
|
14017
|
+
borderInlineWidth: nativeStyle || "borderInlineStyle",
|
|
14018
|
+
borderInlineStartWidth: nativeStyle || "borderInlineStartStyle",
|
|
14019
|
+
borderInlineEndWidth: nativeStyle || "borderInlineEndStyle"
|
|
14000
14020
|
};
|
|
14001
14021
|
//#endregion
|
|
14002
14022
|
//#region ../web/dist/esm/helpers/styleStaticConfig.native.js
|
|
@@ -14369,7 +14389,7 @@ function isDynamicUnitValue(value) {
|
|
|
14369
14389
|
var _UNIT_RE_exec;
|
|
14370
14390
|
if (typeof value !== "string") return false;
|
|
14371
14391
|
var trimmed = value.trim();
|
|
14372
|
-
if (trimmed.startsWith("clamp(") || trimmed.startsWith("CLAMP(")) return true;
|
|
14392
|
+
if (trimmed.startsWith("clamp(") || trimmed.startsWith("CLAMP(") || trimmed.startsWith("calc(") || trimmed.startsWith("CALC(")) return true;
|
|
14373
14393
|
return !!((_UNIT_RE_exec = UNIT_RE.exec(trimmed.replace(/\s+/g, ""))) === null || _UNIT_RE_exec === void 0 ? void 0 : _UNIT_RE_exec[2]);
|
|
14374
14394
|
}
|
|
14375
14395
|
function getUnitContext(key, styleState) {
|
|
@@ -14423,6 +14443,60 @@ function resolveSingleUnit(val, ctx) {
|
|
|
14423
14443
|
default: return num;
|
|
14424
14444
|
}
|
|
14425
14445
|
}
|
|
14446
|
+
function evaluateCalc(expr, ctx) {
|
|
14447
|
+
var s = expr.trim();
|
|
14448
|
+
if (s.toLowerCase().startsWith("calc(") && s.endsWith(")")) s = s.slice(5, -1).trim();
|
|
14449
|
+
var tokens = s.match(/[()*/+-]|[^\s()*/+-]+/g) || [];
|
|
14450
|
+
var pos = 0;
|
|
14451
|
+
var peek = function() {
|
|
14452
|
+
return tokens[pos];
|
|
14453
|
+
};
|
|
14454
|
+
var consume = function() {
|
|
14455
|
+
return tokens[pos++];
|
|
14456
|
+
};
|
|
14457
|
+
function parseExpression() {
|
|
14458
|
+
var left = parseTerm();
|
|
14459
|
+
while (peek() === "+" || peek() === "-") {
|
|
14460
|
+
var op = consume();
|
|
14461
|
+
var right = parseTerm();
|
|
14462
|
+
if (op === "+") left += right;
|
|
14463
|
+
else left -= right;
|
|
14464
|
+
}
|
|
14465
|
+
return left;
|
|
14466
|
+
}
|
|
14467
|
+
function parseTerm() {
|
|
14468
|
+
var left = parseFactor();
|
|
14469
|
+
while (peek() === "*" || peek() === "/") {
|
|
14470
|
+
var op = consume();
|
|
14471
|
+
var right = parseFactor();
|
|
14472
|
+
if (op === "*") left *= right;
|
|
14473
|
+
else left = right !== 0 ? left / right : 0;
|
|
14474
|
+
}
|
|
14475
|
+
return left;
|
|
14476
|
+
}
|
|
14477
|
+
function parseFactor() {
|
|
14478
|
+
if (peek() === "+") {
|
|
14479
|
+
consume();
|
|
14480
|
+
return parseFactor();
|
|
14481
|
+
}
|
|
14482
|
+
if (peek() === "-") {
|
|
14483
|
+
consume();
|
|
14484
|
+
return -parseFactor();
|
|
14485
|
+
}
|
|
14486
|
+
return parsePrimary();
|
|
14487
|
+
}
|
|
14488
|
+
function parsePrimary() {
|
|
14489
|
+
if (peek() === "(") {
|
|
14490
|
+
consume();
|
|
14491
|
+
var val = parseExpression();
|
|
14492
|
+
if (peek() === ")") consume();
|
|
14493
|
+
return val;
|
|
14494
|
+
}
|
|
14495
|
+
var token = consume();
|
|
14496
|
+
return token ? resolveSingleUnit(token, ctx) : 0;
|
|
14497
|
+
}
|
|
14498
|
+
return parseExpression();
|
|
14499
|
+
}
|
|
14426
14500
|
function resolveClamp(val, ctx) {
|
|
14427
14501
|
var start = val.indexOf("(");
|
|
14428
14502
|
var end = val.lastIndexOf(")");
|
|
@@ -14431,28 +14505,7 @@ function resolveClamp(val, ctx) {
|
|
|
14431
14505
|
if (args.length < 3) return 0;
|
|
14432
14506
|
var min = resolveSingleUnit(args[0], ctx);
|
|
14433
14507
|
var max = resolveSingleUnit(args[2], ctx);
|
|
14434
|
-
var
|
|
14435
|
-
if (prefStr.toLowerCase().startsWith("calc(") && prefStr.endsWith(")")) prefStr = prefStr.slice(5, -1).trim();
|
|
14436
|
-
var pref = 0;
|
|
14437
|
-
var terms = prefStr.match(/([+-]?\s*[^+-]+)/g);
|
|
14438
|
-
if (terms && terms.length > 0) {
|
|
14439
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
14440
|
-
try {
|
|
14441
|
-
for (var _iterator = terms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
14442
|
-
var term = _step.value;
|
|
14443
|
-
pref += resolveSingleUnit(term, ctx);
|
|
14444
|
-
}
|
|
14445
|
-
} catch (err) {
|
|
14446
|
-
_didIteratorError = true;
|
|
14447
|
-
_iteratorError = err;
|
|
14448
|
-
} finally {
|
|
14449
|
-
try {
|
|
14450
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
14451
|
-
} finally {
|
|
14452
|
-
if (_didIteratorError) throw _iteratorError;
|
|
14453
|
-
}
|
|
14454
|
-
}
|
|
14455
|
-
} else pref = resolveSingleUnit(prefStr, ctx);
|
|
14508
|
+
var pref = evaluateCalc(args[1], ctx);
|
|
14456
14509
|
return Math.min(Math.max(pref, Math.min(min, max)), Math.max(min, max));
|
|
14457
14510
|
}
|
|
14458
14511
|
function splitClampArgs(inner) {
|
|
@@ -14477,6 +14530,7 @@ function resolveNativeUnits(key, value, styleState) {
|
|
|
14477
14530
|
if (!isDynamicUnitValue(trimmed)) return value;
|
|
14478
14531
|
var ctx = getUnitContext(key, styleState);
|
|
14479
14532
|
if (trimmed.startsWith("clamp(") || trimmed.startsWith("CLAMP(")) return resolveClamp(trimmed, ctx);
|
|
14533
|
+
if (trimmed.startsWith("calc(") || trimmed.startsWith("CALC(")) return evaluateCalc(trimmed, ctx);
|
|
14480
14534
|
return resolveSingleUnit(trimmed, ctx);
|
|
14481
14535
|
}
|
|
14482
14536
|
//#endregion
|
|
@@ -16664,10 +16718,7 @@ var Theme = createRefComponent(function Theme2(props, ref) {
|
|
|
16664
16718
|
var finalChildren = props["disable-child-theme"] ? react.Children.map(props.children, function(child) {
|
|
16665
16719
|
return passThrough || !/* @__PURE__ */ (0, react.isValidElement)(child) ? child : /* @__PURE__ */ (0, react.cloneElement)(child, { ["data-disable-theme"]: true });
|
|
16666
16720
|
}) : props.children;
|
|
16667
|
-
if (ref)
|
|
16668
|
-
react.default.Children.only(finalChildren);
|
|
16669
|
-
finalChildren = /* @__PURE__ */ (0, react.cloneElement)(finalChildren, { ref });
|
|
16670
|
-
} catch (e) {}
|
|
16721
|
+
if (ref && /* @__PURE__ */ (0, react.isValidElement)(finalChildren)) finalChildren = /* @__PURE__ */ (0, react.cloneElement)(finalChildren, { ref });
|
|
16671
16722
|
var stateRef = (0, react.useRef)({ hasEverThemed: false });
|
|
16672
16723
|
return getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);
|
|
16673
16724
|
});
|
|
@@ -16738,8 +16789,7 @@ var avoidReRenderKeys = /* @__PURE__ */ new Set([
|
|
|
16738
16789
|
"group",
|
|
16739
16790
|
"focus",
|
|
16740
16791
|
"focusWithin",
|
|
16741
|
-
"media"
|
|
16742
|
-
"group"
|
|
16792
|
+
"media"
|
|
16743
16793
|
]);
|
|
16744
16794
|
var groupPseudoKeys = [
|
|
16745
16795
|
"disabled",
|
package/dist/test.native.cjs
CHANGED
|
@@ -887,6 +887,80 @@ var index_native_exports = /* @__PURE__ */ __exportAll({
|
|
|
887
887
|
withStaticProperties: () => withStaticProperties
|
|
888
888
|
});
|
|
889
889
|
//#endregion
|
|
890
|
+
//#region ../style-grammar/dist/esm/tooling/config.native.js
|
|
891
|
+
var containerSizeQueryTextPattern = /width|height|inline-size|block-size/;
|
|
892
|
+
function isContainerSizeQueryText(query) {
|
|
893
|
+
return containerSizeQueryTextPattern.test(query);
|
|
894
|
+
}
|
|
895
|
+
var grammarPlatformNames = /* @__PURE__ */ new Set([
|
|
896
|
+
"web",
|
|
897
|
+
"native",
|
|
898
|
+
"android",
|
|
899
|
+
"ios",
|
|
900
|
+
"tv",
|
|
901
|
+
"androidtv",
|
|
902
|
+
"tvos"
|
|
903
|
+
]);
|
|
904
|
+
function grammarPlatformRank(modifier) {
|
|
905
|
+
return modifier === "native" || modifier === "web" ? 1 : modifier === "androidtv" || modifier === "tvos" ? 3 : 2;
|
|
906
|
+
}
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region ../style-grammar/dist/esm/runtime/stateModifiers.native.js
|
|
909
|
+
var coreStateModifierNames = Object.freeze([
|
|
910
|
+
"hover",
|
|
911
|
+
"press",
|
|
912
|
+
"focus",
|
|
913
|
+
"focus-visible",
|
|
914
|
+
"focus-within",
|
|
915
|
+
"disabled",
|
|
916
|
+
"enter",
|
|
917
|
+
"exit"
|
|
918
|
+
]);
|
|
919
|
+
var canonicalStateModifierNames = Object.freeze([
|
|
920
|
+
"hover",
|
|
921
|
+
"focus-within",
|
|
922
|
+
"focus",
|
|
923
|
+
"focus-visible",
|
|
924
|
+
"press",
|
|
925
|
+
"disabled",
|
|
926
|
+
"enter",
|
|
927
|
+
"exit"
|
|
928
|
+
]);
|
|
929
|
+
var stateModifierSelectors = Object.freeze([
|
|
930
|
+
":hover",
|
|
931
|
+
":focus-within",
|
|
932
|
+
":focus",
|
|
933
|
+
":focus-visible",
|
|
934
|
+
":active",
|
|
935
|
+
"[aria-disabled]",
|
|
936
|
+
".t_unmounted",
|
|
937
|
+
".t_exiting"
|
|
938
|
+
]);
|
|
939
|
+
var modifierAliases = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
940
|
+
active: "press",
|
|
941
|
+
pressed: "press",
|
|
942
|
+
starting: "enter",
|
|
943
|
+
ending: "exit"
|
|
944
|
+
}));
|
|
945
|
+
function isModifierName(text, start, end) {
|
|
946
|
+
if (start >= end) return false;
|
|
947
|
+
for (var index = start; index < end; index++) {
|
|
948
|
+
var code = text.charCodeAt(index);
|
|
949
|
+
if (!(code >= 97 && code <= 122) && !(code >= 65 && code <= 90) && !(code >= 48 && code <= 57) && code !== 45 && code !== 95) return false;
|
|
950
|
+
}
|
|
951
|
+
return true;
|
|
952
|
+
}
|
|
953
|
+
function canonicalClauseModifier(name) {
|
|
954
|
+
var direct = modifierAliases[name];
|
|
955
|
+
if (direct) return direct;
|
|
956
|
+
if (!name.startsWith("group-")) return name;
|
|
957
|
+
var slash = name.indexOf("/");
|
|
958
|
+
if (slash !== -1 && !isModifierName(name, slash + 1, name.length)) return name;
|
|
959
|
+
var state = modifierAliases[name.slice(6, slash === -1 ? name.length : slash)];
|
|
960
|
+
if (!state || state === "enter" || state === "exit") return name;
|
|
961
|
+
return slash === -1 ? `group-${state}` : `group-${state}${name.slice(slash)}`;
|
|
962
|
+
}
|
|
963
|
+
//#endregion
|
|
890
964
|
//#region ../style-grammar/dist/esm/runtime/scanFlatValue.native.js
|
|
891
965
|
function opensUrlToken(source, index) {
|
|
892
966
|
if (index < 3 || (source.charCodeAt(index - 3) | 32) !== 117 || (source.charCodeAt(index - 2) | 32) !== 114 || (source.charCodeAt(index - 1) | 32) !== 108) return false;
|
|
@@ -909,12 +983,12 @@ function parseFlatValue(source) {
|
|
|
909
983
|
function parseFlatValueProduction(source) {
|
|
910
984
|
var length = source.length;
|
|
911
985
|
var segments = [];
|
|
912
|
-
var sawChain = false, chainStart = -1, chainEnd = -1, segmentStart = 0, wordStart = -1, lastColon = -1, quote = 0, comment = false, depth = 0, valid = true;
|
|
986
|
+
var sawChain = false, chainStart = -1, chainEnd = -1, segmentStart = 0, wordStart = -1, lastColon = -1, quote = 0, comment = false, depth = 0, valid = true, clauseChainValid = true, currentChainValid = true, chainNonPlatformModifiers = null;
|
|
913
987
|
var close = function(end) {
|
|
914
988
|
var start = segmentStart;
|
|
915
989
|
while (start < end && source.charCodeAt(start) <= 32) start++;
|
|
916
990
|
while (end > start && source.charCodeAt(end - 1) <= 32) end--;
|
|
917
|
-
segments.push(start, end, chainStart, chainEnd, (!sawChain ? 1 : 0) | 6);
|
|
991
|
+
segments.push(start, end, chainStart, chainEnd, (!sawChain ? 1 : 0) | (clauseChainValid ? 6 : 0));
|
|
918
992
|
};
|
|
919
993
|
var flush = function() {
|
|
920
994
|
if (wordStart !== -1 && lastColon !== -1) {
|
|
@@ -922,8 +996,11 @@ function parseFlatValueProduction(source) {
|
|
|
922
996
|
chainEnd = lastColon;
|
|
923
997
|
sawChain = true;
|
|
924
998
|
segmentStart = lastColon + 1;
|
|
999
|
+
clauseChainValid = currentChainValid;
|
|
925
1000
|
}
|
|
926
1001
|
wordStart = lastColon = -1;
|
|
1002
|
+
currentChainValid = true;
|
|
1003
|
+
chainNonPlatformModifiers = null;
|
|
927
1004
|
};
|
|
928
1005
|
for (var index = 0; index < length; index++) {
|
|
929
1006
|
var code = source.charCodeAt(index);
|
|
@@ -972,7 +1049,20 @@ function parseFlatValueProduction(source) {
|
|
|
972
1049
|
if (wordStart === -1) wordStart = index;
|
|
973
1050
|
if (code === 59 || code === 123 || code === 125) valid = false;
|
|
974
1051
|
else if (code === 58) {
|
|
975
|
-
if (lastColon === -1)
|
|
1052
|
+
if (lastColon === -1) {
|
|
1053
|
+
close(wordStart);
|
|
1054
|
+
clauseChainValid = true;
|
|
1055
|
+
currentChainValid = true;
|
|
1056
|
+
chainNonPlatformModifiers = /* @__PURE__ */ new Set();
|
|
1057
|
+
}
|
|
1058
|
+
var modStart = lastColon === -1 ? wordStart : lastColon + 1;
|
|
1059
|
+
if (modStart < index && currentChainValid) {
|
|
1060
|
+
var canonical = canonicalClauseModifier(source.slice(modStart, index));
|
|
1061
|
+
if (!grammarPlatformNames.has(canonical)) {
|
|
1062
|
+
chainNonPlatformModifiers === null || chainNonPlatformModifiers === void 0 || chainNonPlatformModifiers.add(canonical);
|
|
1063
|
+
if (chainNonPlatformModifiers && chainNonPlatformModifiers.size > 5) currentChainValid = false;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
976
1066
|
lastColon = index;
|
|
977
1067
|
}
|
|
978
1068
|
}
|
|
@@ -989,7 +1079,7 @@ function parseFlatValueProduction(source) {
|
|
|
989
1079
|
function parseFlatValueChecked(source) {
|
|
990
1080
|
var length = source.length;
|
|
991
1081
|
var segments = [];
|
|
992
|
-
var failure = null, failureIndex = -1, sawChain = false, chainStart = -1, chainEnd = -1, chainValid = true, segmentValid = true, segmentStart = 0, comment = false, commentStart = -1, quote = 0, quoteStart = -1, url = false, depth = 0, parenStart = -1, wordStart = -1, lastColon = -1, wordErrorMin = length, wordErrorMax = -1;
|
|
1082
|
+
var failure = null, failureIndex = -1, sawChain = false, chainStart = -1, chainEnd = -1, chainValid = true, segmentValid = true, segmentStart = 0, comment = false, commentStart = -1, quote = 0, quoteStart = -1, url = false, depth = 0, parenStart = -1, wordStart = -1, lastColon = -1, wordErrorMin = length, wordErrorMax = -1, chainNonPlatformModifiers = null;
|
|
993
1083
|
var report = function(code2, index2) {
|
|
994
1084
|
if (failureIndex === -1) failureIndex = index2;
|
|
995
1085
|
failure !== null && failure !== void 0 || (failure = code2);
|
|
@@ -1013,6 +1103,7 @@ function parseFlatValueChecked(source) {
|
|
|
1013
1103
|
} else if (wordErrorMax !== -1) segmentValid = false;
|
|
1014
1104
|
wordStart = lastColon = wordErrorMax = -1;
|
|
1015
1105
|
wordErrorMin = length;
|
|
1106
|
+
chainNonPlatformModifiers = null;
|
|
1016
1107
|
};
|
|
1017
1108
|
for (var index = 0; index < length; index++) {
|
|
1018
1109
|
var code = source.charCodeAt(index);
|
|
@@ -1070,7 +1161,18 @@ function parseFlatValueChecked(source) {
|
|
|
1070
1161
|
if (wordStart === -1) wordStart = index;
|
|
1071
1162
|
if (code === 59 || code === 123 || code === 125) report("invalid-character", index);
|
|
1072
1163
|
else if (code === 58) {
|
|
1073
|
-
if (lastColon === -1)
|
|
1164
|
+
if (lastColon === -1) {
|
|
1165
|
+
close(wordStart);
|
|
1166
|
+
chainNonPlatformModifiers = /* @__PURE__ */ new Set();
|
|
1167
|
+
}
|
|
1168
|
+
var modStart = lastColon === -1 ? wordStart : lastColon + 1;
|
|
1169
|
+
if (modStart < index) {
|
|
1170
|
+
var canonical = canonicalClauseModifier(source.slice(modStart, index));
|
|
1171
|
+
if (!grammarPlatformNames.has(canonical)) {
|
|
1172
|
+
chainNonPlatformModifiers === null || chainNonPlatformModifiers === void 0 || chainNonPlatformModifiers.add(canonical);
|
|
1173
|
+
if (chainNonPlatformModifiers && chainNonPlatformModifiers.size > 5) report("over-deep-clause", modStart);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1074
1176
|
lastColon = index;
|
|
1075
1177
|
}
|
|
1076
1178
|
}
|
|
@@ -1086,83 +1188,12 @@ function parseFlatValueChecked(source) {
|
|
|
1086
1188
|
];
|
|
1087
1189
|
}
|
|
1088
1190
|
//#endregion
|
|
1089
|
-
//#region ../style-grammar/dist/esm/runtime/stateModifiers.native.js
|
|
1090
|
-
var coreStateModifierNames = Object.freeze([
|
|
1091
|
-
"hover",
|
|
1092
|
-
"press",
|
|
1093
|
-
"focus",
|
|
1094
|
-
"focus-visible",
|
|
1095
|
-
"focus-within",
|
|
1096
|
-
"disabled",
|
|
1097
|
-
"enter",
|
|
1098
|
-
"exit"
|
|
1099
|
-
]);
|
|
1100
|
-
var canonicalStateModifierNames = Object.freeze([
|
|
1101
|
-
"hover",
|
|
1102
|
-
"focus-within",
|
|
1103
|
-
"focus",
|
|
1104
|
-
"focus-visible",
|
|
1105
|
-
"press",
|
|
1106
|
-
"disabled",
|
|
1107
|
-
"enter",
|
|
1108
|
-
"exit"
|
|
1109
|
-
]);
|
|
1110
|
-
var stateModifierSelectors = Object.freeze([
|
|
1111
|
-
":hover",
|
|
1112
|
-
":focus-within",
|
|
1113
|
-
":focus",
|
|
1114
|
-
":focus-visible",
|
|
1115
|
-
":active",
|
|
1116
|
-
"[aria-disabled]",
|
|
1117
|
-
".t_unmounted",
|
|
1118
|
-
".t_exiting"
|
|
1119
|
-
]);
|
|
1120
|
-
var modifierAliases = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1121
|
-
active: "press",
|
|
1122
|
-
pressed: "press",
|
|
1123
|
-
starting: "enter",
|
|
1124
|
-
ending: "exit"
|
|
1125
|
-
}));
|
|
1126
|
-
//#endregion
|
|
1127
1191
|
//#region ../style-grammar/dist/esm/runtime/clauseIdentity.native.js
|
|
1128
1192
|
var stateModifierNames = Object.freeze([...coreStateModifierNames, ...Object.keys(modifierAliases)]);
|
|
1129
1193
|
new Set(stateModifierNames);
|
|
1130
|
-
function isModifierName(text, start, end) {
|
|
1131
|
-
if (start >= end) return false;
|
|
1132
|
-
for (var index = start; index < end; index++) {
|
|
1133
|
-
var code = text.charCodeAt(index);
|
|
1134
|
-
if (!(code >= 97 && code <= 122) && !(code >= 65 && code <= 90) && !(code >= 48 && code <= 57) && code !== 45 && code !== 95) return false;
|
|
1135
|
-
}
|
|
1136
|
-
return true;
|
|
1137
|
-
}
|
|
1138
|
-
function canonicalClauseModifier(name) {
|
|
1139
|
-
var direct = modifierAliases[name];
|
|
1140
|
-
if (direct) return direct;
|
|
1141
|
-
if (!name.startsWith("group-")) return name;
|
|
1142
|
-
var slash = name.indexOf("/");
|
|
1143
|
-
if (slash !== -1 && !isModifierName(name, slash + 1, name.length)) return name;
|
|
1144
|
-
var state = modifierAliases[name.slice(6, slash === -1 ? name.length : slash)];
|
|
1145
|
-
if (!state || state === "enter" || state === "exit") return name;
|
|
1146
|
-
return slash === -1 ? `group-${state}` : `group-${state}${name.slice(slash)}`;
|
|
1147
|
-
}
|
|
1148
1194
|
//#endregion
|
|
1149
|
-
//#region ../style-grammar/dist/esm/
|
|
1150
|
-
var
|
|
1151
|
-
function isContainerSizeQueryText(query) {
|
|
1152
|
-
return containerSizeQueryTextPattern.test(query);
|
|
1153
|
-
}
|
|
1154
|
-
var grammarPlatformNames = /* @__PURE__ */ new Set([
|
|
1155
|
-
"web",
|
|
1156
|
-
"native",
|
|
1157
|
-
"android",
|
|
1158
|
-
"ios",
|
|
1159
|
-
"tv",
|
|
1160
|
-
"androidtv",
|
|
1161
|
-
"tvos"
|
|
1162
|
-
]);
|
|
1163
|
-
function grammarPlatformRank(modifier) {
|
|
1164
|
-
return modifier === "native" || modifier === "web" ? 1 : modifier === "androidtv" || modifier === "tvos" ? 3 : 2;
|
|
1165
|
-
}
|
|
1195
|
+
//#region ../style-grammar/dist/esm/runtime/namedCssColors.native.js
|
|
1196
|
+
var namedCssColors = new Set("aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "));
|
|
1166
1197
|
//#endregion
|
|
1167
1198
|
//#region ../style-grammar/dist/esm/runtime/modifierVocabulary.native.js
|
|
1168
1199
|
var configRevisionSymbol = /* @__PURE__ */ Symbol.for("tamagui.configRevision");
|
|
@@ -2192,13 +2223,12 @@ var getSetting = function(key) {
|
|
|
2192
2223
|
if (globalThis.process.env.NODE_ENV === "development") {
|
|
2193
2224
|
if (!config) throw new Error(haventCalledErrorMessage);
|
|
2194
2225
|
}
|
|
2195
|
-
|
|
2196
|
-
return (_config_settings_key = config.settings[key]) !== null && _config_settings_key !== void 0 ? _config_settings_key : config[key];
|
|
2226
|
+
return config.settings[key];
|
|
2197
2227
|
};
|
|
2198
2228
|
function getStyleCompat() {
|
|
2229
|
+
var _config_settings;
|
|
2199
2230
|
var config = getConfigFromGlobalOrLocal();
|
|
2200
|
-
|
|
2201
|
-
return ((_config_settings_styleCompat = config === null || config === void 0 ? void 0 : config.settings.styleCompat) !== null && _config_settings_styleCompat !== void 0 ? _config_settings_styleCompat : config === null || config === void 0 ? void 0 : config.styleCompat) || "web";
|
|
2231
|
+
return (config === null || config === void 0 ? void 0 : (_config_settings = config.settings) === null || _config_settings === void 0 ? void 0 : _config_settings.styleCompat) || "web";
|
|
2202
2232
|
}
|
|
2203
2233
|
var setConfig = function(next) {
|
|
2204
2234
|
setConfigCalledByThisInstance = true;
|
|
@@ -4520,7 +4550,13 @@ var borderDefaults = {
|
|
|
4520
4550
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
4521
4551
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
4522
4552
|
borderLeftWidth: nativeStyle || "borderLeftStyle",
|
|
4523
|
-
borderRightWidth: nativeStyle || "borderRightStyle"
|
|
4553
|
+
borderRightWidth: nativeStyle || "borderRightStyle",
|
|
4554
|
+
borderBlockWidth: nativeStyle || "borderBlockStyle",
|
|
4555
|
+
borderBlockStartWidth: nativeStyle || "borderBlockStartStyle",
|
|
4556
|
+
borderBlockEndWidth: nativeStyle || "borderBlockEndStyle",
|
|
4557
|
+
borderInlineWidth: nativeStyle || "borderInlineStyle",
|
|
4558
|
+
borderInlineStartWidth: nativeStyle || "borderInlineStartStyle",
|
|
4559
|
+
borderInlineEndWidth: nativeStyle || "borderInlineEndStyle"
|
|
4524
4560
|
};
|
|
4525
4561
|
//#endregion
|
|
4526
4562
|
//#region ../web/dist/esm/helpers/styleStaticConfig.native.js
|
|
@@ -5040,7 +5076,7 @@ function isDynamicUnitValue(value) {
|
|
|
5040
5076
|
var _UNIT_RE_exec;
|
|
5041
5077
|
if (typeof value !== "string") return false;
|
|
5042
5078
|
var trimmed = value.trim();
|
|
5043
|
-
if (trimmed.startsWith("clamp(") || trimmed.startsWith("CLAMP(")) return true;
|
|
5079
|
+
if (trimmed.startsWith("clamp(") || trimmed.startsWith("CLAMP(") || trimmed.startsWith("calc(") || trimmed.startsWith("CALC(")) return true;
|
|
5044
5080
|
return !!((_UNIT_RE_exec = UNIT_RE.exec(trimmed.replace(/\s+/g, ""))) === null || _UNIT_RE_exec === void 0 ? void 0 : _UNIT_RE_exec[2]);
|
|
5045
5081
|
}
|
|
5046
5082
|
function getUnitContext(key, styleState) {
|
|
@@ -5094,6 +5130,60 @@ function resolveSingleUnit(val, ctx) {
|
|
|
5094
5130
|
default: return num;
|
|
5095
5131
|
}
|
|
5096
5132
|
}
|
|
5133
|
+
function evaluateCalc(expr, ctx) {
|
|
5134
|
+
var s = expr.trim();
|
|
5135
|
+
if (s.toLowerCase().startsWith("calc(") && s.endsWith(")")) s = s.slice(5, -1).trim();
|
|
5136
|
+
var tokens = s.match(/[()*/+-]|[^\s()*/+-]+/g) || [];
|
|
5137
|
+
var pos = 0;
|
|
5138
|
+
var peek = function() {
|
|
5139
|
+
return tokens[pos];
|
|
5140
|
+
};
|
|
5141
|
+
var consume = function() {
|
|
5142
|
+
return tokens[pos++];
|
|
5143
|
+
};
|
|
5144
|
+
function parseExpression() {
|
|
5145
|
+
var left = parseTerm();
|
|
5146
|
+
while (peek() === "+" || peek() === "-") {
|
|
5147
|
+
var op = consume();
|
|
5148
|
+
var right = parseTerm();
|
|
5149
|
+
if (op === "+") left += right;
|
|
5150
|
+
else left -= right;
|
|
5151
|
+
}
|
|
5152
|
+
return left;
|
|
5153
|
+
}
|
|
5154
|
+
function parseTerm() {
|
|
5155
|
+
var left = parseFactor();
|
|
5156
|
+
while (peek() === "*" || peek() === "/") {
|
|
5157
|
+
var op = consume();
|
|
5158
|
+
var right = parseFactor();
|
|
5159
|
+
if (op === "*") left *= right;
|
|
5160
|
+
else left = right !== 0 ? left / right : 0;
|
|
5161
|
+
}
|
|
5162
|
+
return left;
|
|
5163
|
+
}
|
|
5164
|
+
function parseFactor() {
|
|
5165
|
+
if (peek() === "+") {
|
|
5166
|
+
consume();
|
|
5167
|
+
return parseFactor();
|
|
5168
|
+
}
|
|
5169
|
+
if (peek() === "-") {
|
|
5170
|
+
consume();
|
|
5171
|
+
return -parseFactor();
|
|
5172
|
+
}
|
|
5173
|
+
return parsePrimary();
|
|
5174
|
+
}
|
|
5175
|
+
function parsePrimary() {
|
|
5176
|
+
if (peek() === "(") {
|
|
5177
|
+
consume();
|
|
5178
|
+
var val = parseExpression();
|
|
5179
|
+
if (peek() === ")") consume();
|
|
5180
|
+
return val;
|
|
5181
|
+
}
|
|
5182
|
+
var token = consume();
|
|
5183
|
+
return token ? resolveSingleUnit(token, ctx) : 0;
|
|
5184
|
+
}
|
|
5185
|
+
return parseExpression();
|
|
5186
|
+
}
|
|
5097
5187
|
function resolveClamp(val, ctx) {
|
|
5098
5188
|
var start = val.indexOf("(");
|
|
5099
5189
|
var end = val.lastIndexOf(")");
|
|
@@ -5102,28 +5192,7 @@ function resolveClamp(val, ctx) {
|
|
|
5102
5192
|
if (args.length < 3) return 0;
|
|
5103
5193
|
var min = resolveSingleUnit(args[0], ctx);
|
|
5104
5194
|
var max = resolveSingleUnit(args[2], ctx);
|
|
5105
|
-
var
|
|
5106
|
-
if (prefStr.toLowerCase().startsWith("calc(") && prefStr.endsWith(")")) prefStr = prefStr.slice(5, -1).trim();
|
|
5107
|
-
var pref = 0;
|
|
5108
|
-
var terms = prefStr.match(/([+-]?\s*[^+-]+)/g);
|
|
5109
|
-
if (terms && terms.length > 0) {
|
|
5110
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
5111
|
-
try {
|
|
5112
|
-
for (var _iterator = terms[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
5113
|
-
var term = _step.value;
|
|
5114
|
-
pref += resolveSingleUnit(term, ctx);
|
|
5115
|
-
}
|
|
5116
|
-
} catch (err) {
|
|
5117
|
-
_didIteratorError = true;
|
|
5118
|
-
_iteratorError = err;
|
|
5119
|
-
} finally {
|
|
5120
|
-
try {
|
|
5121
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
5122
|
-
} finally {
|
|
5123
|
-
if (_didIteratorError) throw _iteratorError;
|
|
5124
|
-
}
|
|
5125
|
-
}
|
|
5126
|
-
} else pref = resolveSingleUnit(prefStr, ctx);
|
|
5195
|
+
var pref = evaluateCalc(args[1], ctx);
|
|
5127
5196
|
return Math.min(Math.max(pref, Math.min(min, max)), Math.max(min, max));
|
|
5128
5197
|
}
|
|
5129
5198
|
function splitClampArgs(inner) {
|
|
@@ -5148,6 +5217,7 @@ function resolveNativeUnits(key, value, styleState) {
|
|
|
5148
5217
|
if (!isDynamicUnitValue(trimmed)) return value;
|
|
5149
5218
|
var ctx = getUnitContext(key, styleState);
|
|
5150
5219
|
if (trimmed.startsWith("clamp(") || trimmed.startsWith("CLAMP(")) return resolveClamp(trimmed, ctx);
|
|
5220
|
+
if (trimmed.startsWith("calc(") || trimmed.startsWith("CALC(")) return evaluateCalc(trimmed, ctx);
|
|
5151
5221
|
return resolveSingleUnit(trimmed, ctx);
|
|
5152
5222
|
}
|
|
5153
5223
|
//#endregion
|
|
@@ -5698,6 +5768,19 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
5698
5768
|
if (!isNativeInputColor && keyInit in skipProps && shouldSkipDirectProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) if (keyInit === "transition" && typeof valInit === "string") return;
|
|
5699
5769
|
else return;
|
|
5700
5770
|
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles);
|
|
5771
|
+
if (globalThis.process.env.NODE_ENV === "development") {
|
|
5772
|
+
if (!isValidStyleKeyInit && (!variants || !(keyInit in variants))) {
|
|
5773
|
+
var replacement;
|
|
5774
|
+
if (keyInit === "animation") replacement = "transition=";
|
|
5775
|
+
else if (keyInit === "hoverStyle") replacement = "hover: clause";
|
|
5776
|
+
else if (keyInit === "pressStyle") replacement = "press: clause";
|
|
5777
|
+
else if (keyInit === "focusStyle") replacement = "focus: clause";
|
|
5778
|
+
else if (keyInit === "enterStyle") replacement = "enter: clause";
|
|
5779
|
+
else if (keyInit === "exitStyle") replacement = "exit: clause";
|
|
5780
|
+
else if (keyInit.charCodeAt(0) === 36 && keyInit.length > 1) replacement = `${keyInit.slice(1)}: clause`;
|
|
5781
|
+
if (replacement) warnOnce(`v2-prop:${keyInit}`, `prop "${keyInit}" was removed in v3; use ${replacement}`);
|
|
5782
|
+
}
|
|
5783
|
+
}
|
|
5701
5784
|
if (!isValidStyleKeyInit) {
|
|
5702
5785
|
if (!isAndroid) {
|
|
5703
5786
|
if (keyInit === "elevationAndroid") return;
|
|
@@ -6423,7 +6506,7 @@ function emitUnderCondition(state, property, value, cursor, originalValue, conte
|
|
|
6423
6506
|
return condition;
|
|
6424
6507
|
}
|
|
6425
6508
|
var formatScanFailure = function(failure, source, failureIndex) {
|
|
6426
|
-
return failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"";
|
|
6509
|
+
return failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : failure === "over-deep-clause" ? `a clause with more than 5 non-platform conditions` : "an unterminated \"(\"";
|
|
6427
6510
|
};
|
|
6428
6511
|
var warnScanFailure = function(property, source, failure, failureIndex) {
|
|
6429
6512
|
if (globalThis.process.env.NODE_ENV === "development") warnRefusedValue(property, source, formatScanFailure(failure, source, failureIndex));
|
|
@@ -6449,6 +6532,15 @@ var valueCaches = /* @__PURE__ */ new WeakMap();
|
|
|
6449
6532
|
var valueCacheEntries = 0;
|
|
6450
6533
|
var valueCacheRoot = {};
|
|
6451
6534
|
var parsedSlices = /* @__PURE__ */ new WeakMap();
|
|
6535
|
+
var cssWideColorKeywords = /* @__PURE__ */ new Set([
|
|
6536
|
+
"inherit",
|
|
6537
|
+
"initial",
|
|
6538
|
+
"unset",
|
|
6539
|
+
"revert",
|
|
6540
|
+
"revert-layer",
|
|
6541
|
+
"currentcolor",
|
|
6542
|
+
"transparent"
|
|
6543
|
+
]);
|
|
6452
6544
|
function configuredValue(state, property, raw) {
|
|
6453
6545
|
var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
6454
6546
|
var grammar = getConfigRevisionState(state.conf);
|
|
@@ -6534,8 +6626,89 @@ function configuredValue(state, property, raw) {
|
|
|
6534
6626
|
}
|
|
6535
6627
|
if (globalThis.process.env.NODE_ENV === "development") {
|
|
6536
6628
|
var _state_conf_tokensParsed_color1;
|
|
6537
|
-
var category1 = grammar.tokenCategory(property);
|
|
6629
|
+
var category1 = grammar.tokenCategory(property) || grammar.tokenCategory(state.conf.shorthands[property] || property);
|
|
6538
6630
|
if (category1 && category1 !== "color" && ((_state_conf_tokensParsed_color1 = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color1 === void 0 ? void 0 : _state_conf_tokensParsed_color1[name])) warnOnce(`"${name}" contributes to "color", not "${property}"`);
|
|
6631
|
+
if (!value && !fontProperty) {
|
|
6632
|
+
if (name.charCodeAt(0) === 36 || raw.charCodeAt(0) === 36) {
|
|
6633
|
+
var suggested = name.charCodeAt(0) === 36 ? name.slice(1) : raw.slice(1);
|
|
6634
|
+
warnOnce(`v2-token:${property}=${raw}`, `${property}="${raw}": v3 tokens have no "$" prefix, did you mean "${suggested}"?`);
|
|
6635
|
+
} else if ((category1 === "size" || category1 === "space" || category1 === "radius" || category1 === "zIndex") && /^-?\d+(?:\.\d+)?$/.test(name)) {
|
|
6636
|
+
var nearest;
|
|
6637
|
+
var minDistance = Infinity;
|
|
6638
|
+
var rawNum = Number(name);
|
|
6639
|
+
var tokens = category1 ? state.conf.tokensParsed[category1] : void 0;
|
|
6640
|
+
if (tokens && Number.isFinite(rawNum)) for (var key in tokens) {
|
|
6641
|
+
var keyNum = Number(key);
|
|
6642
|
+
if (Number.isFinite(keyNum)) {
|
|
6643
|
+
var dist = Math.abs(keyNum - rawNum);
|
|
6644
|
+
if (dist < minDistance) {
|
|
6645
|
+
minDistance = dist;
|
|
6646
|
+
nearest = key;
|
|
6647
|
+
}
|
|
6648
|
+
} else {
|
|
6649
|
+
var _tokens_key;
|
|
6650
|
+
var val = (_tokens_key = tokens[key]) === null || _tokens_key === void 0 ? void 0 : _tokens_key.val;
|
|
6651
|
+
var valNum = typeof val === "number" ? val : Number(val);
|
|
6652
|
+
if (Number.isFinite(valNum)) {
|
|
6653
|
+
var dist1 = Math.abs(valNum - rawNum);
|
|
6654
|
+
if (dist1 < minDistance) {
|
|
6655
|
+
minDistance = dist1;
|
|
6656
|
+
nearest = key;
|
|
6657
|
+
}
|
|
6658
|
+
}
|
|
6659
|
+
}
|
|
6660
|
+
}
|
|
6661
|
+
warnOnce(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is with px units${nearest ? `; nearest token is "${nearest}"` : ""}`);
|
|
6662
|
+
} else if (category1 === "color" && /^[a-zA-Z0-9-]+$/.test(name) && /[a-zA-Z]/.test(name)) {
|
|
6663
|
+
var lower = name.toLowerCase();
|
|
6664
|
+
if (!namedCssColors.has(lower) && !cssWideColorKeywords.has(lower)) {
|
|
6665
|
+
var themeKeys = [];
|
|
6666
|
+
if (state.theme && typeof state.theme === "object") for (var k in state.theme) themeKeys.push(k);
|
|
6667
|
+
if (state.conf.themes) {
|
|
6668
|
+
var active = state.conf.themes[state.flatThemeName || ""];
|
|
6669
|
+
if (active) for (var k1 in active) themeKeys.push(k1);
|
|
6670
|
+
else for (var t in state.conf.themes) for (var k2 in state.conf.themes[t]) themeKeys.push(k2);
|
|
6671
|
+
}
|
|
6672
|
+
var bestMatch;
|
|
6673
|
+
var minDistance1 = 3;
|
|
6674
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
6675
|
+
try {
|
|
6676
|
+
for (var _iterator = themeKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
6677
|
+
var key1 = _step.value;
|
|
6678
|
+
if (Math.abs(key1.length - name.length) > 2) continue;
|
|
6679
|
+
var m = name.length;
|
|
6680
|
+
var n = key1.length;
|
|
6681
|
+
var d = [];
|
|
6682
|
+
for (var i = 0; i <= m; i++) d[i] = i;
|
|
6683
|
+
for (var j = 1; j <= n; j++) {
|
|
6684
|
+
var prev = d[0];
|
|
6685
|
+
d[0] = j;
|
|
6686
|
+
for (var i1 = 1; i1 <= m; i1++) {
|
|
6687
|
+
var temp = d[i1];
|
|
6688
|
+
d[i1] = name[i1 - 1] === key1[j - 1] ? prev : Math.min(prev, d[i1], d[i1 - 1]) + 1;
|
|
6689
|
+
prev = temp;
|
|
6690
|
+
}
|
|
6691
|
+
}
|
|
6692
|
+
var dist2 = d[m];
|
|
6693
|
+
if (dist2 <= 2 && dist2 < minDistance1) {
|
|
6694
|
+
minDistance1 = dist2;
|
|
6695
|
+
bestMatch = key1;
|
|
6696
|
+
}
|
|
6697
|
+
}
|
|
6698
|
+
} catch (err) {
|
|
6699
|
+
_didIteratorError = true;
|
|
6700
|
+
_iteratorError = err;
|
|
6701
|
+
} finally {
|
|
6702
|
+
try {
|
|
6703
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
6704
|
+
} finally {
|
|
6705
|
+
if (_didIteratorError) throw _iteratorError;
|
|
6706
|
+
}
|
|
6707
|
+
}
|
|
6708
|
+
warnOnce(`unknown-color:${property}=${raw}`, bestMatch ? `unknown color "${name}", did you mean "${bestMatch}"?` : `unknown color "${name}"`);
|
|
6709
|
+
}
|
|
6710
|
+
}
|
|
6711
|
+
}
|
|
6539
6712
|
}
|
|
6540
6713
|
var out = raw;
|
|
6541
6714
|
if (isVariable(value)) {
|
|
@@ -6798,6 +6971,11 @@ function walkConditionalValue(state, property, value, parent, sink) {
|
|
|
6798
6971
|
if (typeof value === "string") {
|
|
6799
6972
|
var parsed = getConfigRevisionState(state.conf).parseFlatValue(value);
|
|
6800
6973
|
var [segments, failure, failureIndex] = parsed;
|
|
6974
|
+
if (globalThis.process.env.NODE_ENV === "development") {
|
|
6975
|
+
if (getSetting("styleValueSyntax") === "object") {
|
|
6976
|
+
if (segments.length > 5 || segments.length >= 5 && segments[2] !== -1 || value.includes(":")) warnOnce(`syntax:string:${property}=${value}`, `string syntax is disabled by config (styleValueSyntax: 'object'); received "${property}=${value}"`);
|
|
6977
|
+
}
|
|
6978
|
+
}
|
|
6801
6979
|
var slices = parsedSlices.get(parsed);
|
|
6802
6980
|
if (slices === void 0) parsedSlices.set(parsed, slices = []);
|
|
6803
6981
|
var chainCount = segments.length / 5 - 1;
|
|
@@ -6851,6 +7029,9 @@ function walkConditionalValue(state, property, value, parent, sink) {
|
|
|
6851
7029
|
if (globalThis.process.env.NODE_ENV !== "production") lastPayload = value.slice(lastPayloadStart);
|
|
6852
7030
|
} else {
|
|
6853
7031
|
if (!value || typeof value !== "object" || Array.isArray(value) || isVariable(value) || !classifyConditionalObject(value, state)) return false;
|
|
7032
|
+
if (globalThis.process.env.NODE_ENV === "development") {
|
|
7033
|
+
if (getSetting("styleValueSyntax") === "string") warnOnce(`syntax:object:${property}=${JSON.stringify(value)}`, `object-form conditional syntax is disabled by config (styleValueSyntax: 'string'); received "${property}"`);
|
|
7034
|
+
}
|
|
6854
7035
|
if (value.default != null) {
|
|
6855
7036
|
emitConditionalValue(state, property, value.default, parentCondition, value.default, sink, warnMode, contextOnly);
|
|
6856
7037
|
hasBase = true;
|
|
@@ -7462,10 +7643,7 @@ var Theme = createRefComponent(function Theme2(props, ref) {
|
|
|
7462
7643
|
var finalChildren = props["disable-child-theme"] ? react.Children.map(props.children, function(child) {
|
|
7463
7644
|
return passThrough || !/* @__PURE__ */ (0, react.isValidElement)(child) ? child : /* @__PURE__ */ (0, react.cloneElement)(child, { ["data-disable-theme"]: true });
|
|
7464
7645
|
}) : props.children;
|
|
7465
|
-
if (ref)
|
|
7466
|
-
react.default.Children.only(finalChildren);
|
|
7467
|
-
finalChildren = /* @__PURE__ */ (0, react.cloneElement)(finalChildren, { ref });
|
|
7468
|
-
} catch (e) {}
|
|
7646
|
+
if (ref && /* @__PURE__ */ (0, react.isValidElement)(finalChildren)) finalChildren = /* @__PURE__ */ (0, react.cloneElement)(finalChildren, { ref });
|
|
7469
7647
|
var stateRef = (0, react.useRef)({ hasEverThemed: false });
|
|
7470
7648
|
return getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);
|
|
7471
7649
|
});
|
|
@@ -7568,8 +7746,7 @@ var avoidReRenderKeys = /* @__PURE__ */ new Set([
|
|
|
7568
7746
|
"group",
|
|
7569
7747
|
"focus",
|
|
7570
7748
|
"focusWithin",
|
|
7571
|
-
"media"
|
|
7572
|
-
"group"
|
|
7749
|
+
"media"
|
|
7573
7750
|
]);
|
|
7574
7751
|
var groupPseudoKeys = [
|
|
7575
7752
|
"disabled",
|
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.1099.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.1099.1",
|
|
141
|
+
"@tamagui/constants": "3.0.0-beta.1099.1",
|
|
142
|
+
"@tamagui/helpers": "3.0.0-beta.1099.1",
|
|
143
|
+
"@tamagui/react-native-media-driver": "3.0.0-beta.1099.1",
|
|
144
|
+
"@tamagui/react-native-use-pressable": "3.0.0-beta.1099.1",
|
|
145
|
+
"@tamagui/size": "3.0.0-beta.1099.1",
|
|
146
|
+
"@tamagui/use-element-layout": "3.0.0-beta.1099.1",
|
|
147
|
+
"@tamagui/use-event": "3.0.0-beta.1099.1",
|
|
148
|
+
"@tamagui/web": "3.0.0-beta.1099.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.1099.1",
|
|
152
|
+
"@tamagui/native-bundle": "3.0.0-beta.1099.1",
|
|
153
|
+
"@tamagui/react-native-web-lite": "3.0.0-beta.1099.1",
|
|
154
154
|
"@testing-library/react": "^16.1.0",
|
|
155
155
|
"csstype": "^3.0.10",
|
|
156
156
|
"react": "19.2.3",
|