@tamagui/core 1.85.7 → 1.85.8
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.js +15 -16
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +11 -14
- package/dist/test.native.js.map +1 -1
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -1465,7 +1465,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1465
1465
|
}
|
|
1466
1466
|
return scannedCache.set(sheet2, cacheKey), dedupedThemes;
|
|
1467
1467
|
}
|
|
1468
|
-
var colorVarToVal, rootComputedStyle = null
|
|
1468
|
+
var colorVarToVal, rootComputedStyle = null;
|
|
1469
1469
|
function addThemesFromCSS(cssStyleRule, tokens) {
|
|
1470
1470
|
let selectors = cssStyleRule.selectorText.split(",");
|
|
1471
1471
|
if (!selectors.length)
|
|
@@ -1483,7 +1483,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1483
1483
|
if (sepI === -1)
|
|
1484
1484
|
continue;
|
|
1485
1485
|
let key = rule.slice(rule.indexOf("--") + 2, sepI), val = rule.slice(sepI + 2), value;
|
|
1486
|
-
if (val
|
|
1486
|
+
if (val.startsWith("var(")) {
|
|
1487
1487
|
let varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
1488
1488
|
tokenVal ? value = tokenVal : (rootComputedStyle ||= getComputedStyle(document.body), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
1489
1489
|
} else
|
|
@@ -1497,20 +1497,17 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1497
1497
|
!0
|
|
1498
1498
|
);
|
|
1499
1499
|
}
|
|
1500
|
-
|
|
1501
|
-
names: [
|
|
1502
|
-
...new Set(
|
|
1503
|
-
selectors.map((selector) => {
|
|
1504
|
-
let parts = selector.replace(/(.t_|:root)/g, "").trim().split(" "), secondToLast = parts[parts.length - 2] || "", scheme = secondToLast.includes("dark") ? "dark" : secondToLast.includes("light") ? "light" : "", name = (() => {
|
|
1505
|
-
let _ = parts[parts.length - 1];
|
|
1506
|
-
return scheme && _.startsWith(scheme) && (_ = _.slice(scheme.length + 1)), _;
|
|
1507
|
-
})();
|
|
1508
|
-
return scheme === name || schemes[name] ? scheme : `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1509
|
-
})
|
|
1510
|
-
)
|
|
1511
|
-
],
|
|
1500
|
+
let dedupedEntry = {
|
|
1501
|
+
names: [],
|
|
1512
1502
|
theme: values
|
|
1513
1503
|
};
|
|
1504
|
+
for (let selector of selectors) {
|
|
1505
|
+
let scheme = selector.includes("t_dark") ? "dark" : selector.includes("t_light") ? "light" : "", name = selector.slice(selector.lastIndexOf(".t_") + 3);
|
|
1506
|
+
name.startsWith(scheme) && (name = name.slice(scheme.length + 1)), scheme === name && (scheme = "");
|
|
1507
|
+
let themeName = `${scheme}${scheme && name ? "_" : ""}${name}`;
|
|
1508
|
+
dedupedEntry.names.includes(themeName) || dedupedEntry.names.push(themeName);
|
|
1509
|
+
}
|
|
1510
|
+
return dedupedEntry;
|
|
1514
1511
|
}
|
|
1515
1512
|
function getTamaguiSelector(rule, collectThemes = !1) {
|
|
1516
1513
|
if (rule instanceof CSSStyleRule) {
|
|
@@ -3806,7 +3803,9 @@ var require_propMapper_native = __commonJS({
|
|
|
3806
3803
|
let expanded = (0, import_expandStylesAndRemoveNullishValues.expandStylesAndRemoveNullishValues)(
|
|
3807
3804
|
variantValue,
|
|
3808
3805
|
!!styleProps.noNormalize
|
|
3809
|
-
)
|
|
3806
|
+
);
|
|
3807
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" expanding styles from ", variantValue, "to", expanded);
|
|
3808
|
+
let next = Object.entries(expanded);
|
|
3810
3809
|
return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
|
|
3811
3810
|
}
|
|
3812
3811
|
};
|
|
@@ -3844,7 +3843,7 @@ var require_propMapper_native = __commonJS({
|
|
|
3844
3843
|
continue;
|
|
3845
3844
|
}
|
|
3846
3845
|
if ((0, import_createVariable.isVariable)(val)) {
|
|
3847
|
-
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues);
|
|
3846
|
+
res[subKey] = resolveVariableValue(subKey, val, styleProps.resolveValues), process.env.NODE_ENV === "development" && debug === "verbose" && console.info("variable", subKey, res[subKey]);
|
|
3848
3847
|
continue;
|
|
3849
3848
|
}
|
|
3850
3849
|
if (typeof val == "string") {
|