@tamagui/core 1.112.15 → 1.112.17
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 +16 -13
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +16 -13
- package/dist/test.native.js.map +1 -1
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -1997,6 +1997,9 @@ var require_config_native = __commonJS({
|
|
|
1997
1997
|
getConfig: function() {
|
|
1998
1998
|
return getConfig2;
|
|
1999
1999
|
},
|
|
2000
|
+
getConfigMaybe: function() {
|
|
2001
|
+
return getConfigMaybe;
|
|
2002
|
+
},
|
|
2000
2003
|
getFont: function() {
|
|
2001
2004
|
return getFont;
|
|
2002
2005
|
},
|
|
@@ -2065,6 +2068,8 @@ Haven't called createTamagui yet.
|
|
|
2065
2068
|
}, getConfig2 = function() {
|
|
2066
2069
|
if (!conf) throw new Error(process.env.NODE_ENV !== "production" ? "Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering. Also, make sure all of your tamagui dependencies are on the same version (`tamagui`, `@tamagui/package-name`, etc.) not just in your package.json, but in your lockfile." : "Err0");
|
|
2067
2070
|
return conf;
|
|
2071
|
+
}, getConfigMaybe = function() {
|
|
2072
|
+
return conf;
|
|
2068
2073
|
}, tokensMerged;
|
|
2069
2074
|
function setTokens(_) {
|
|
2070
2075
|
tokensMerged = _;
|
|
@@ -4635,30 +4640,28 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
4635
4640
|
module2.exports = __toCommonJS2(createMediaStyle_exports);
|
|
4636
4641
|
var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
|
|
4637
4642
|
press: "active"
|
|
4638
|
-
},
|
|
4643
|
+
}, specificities = new Array(5).fill(0).map(function(_, i) {
|
|
4639
4644
|
return new Array(i).fill(":root").join("");
|
|
4640
4645
|
});
|
|
4641
4646
|
function getThemeOrGroupSelector(name, styleInner, isGroup, groupParts) {
|
|
4642
|
-
var isTheme = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, precedenceImportancePrefix = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "", selectorStart = styleInner.
|
|
4647
|
+
var isTheme = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, precedenceImportancePrefix = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "", selectorStart = styleInner.lastIndexOf(":root") + 5, selectorEnd = styleInner.lastIndexOf("{"), selector = styleInner.slice(selectorStart, selectorEnd), precedenceSpace = (0, import_config.getSetting)("themeClassNameOnRoot") && isTheme ? "" : " ", pseudoSelectorName = groupParts.pseudo ? groupPseudoToPseudoCSSMap[groupParts.pseudo] || groupParts.pseudo : void 0, pseudoSelector = pseudoSelectorName ? `:${pseudoSelectorName}` : "", presedencePrefix = `:root${precedenceImportancePrefix}${precedenceSpace}`, mediaSelector = `.t_${isGroup ? "group_" : ""}${name}${pseudoSelector}`;
|
|
4643
4648
|
return [
|
|
4644
4649
|
selector,
|
|
4645
|
-
`${presedencePrefix}${mediaSelector} ${selector.
|
|
4650
|
+
`${presedencePrefix}${mediaSelector} ${selector.replaceAll(":root", "")}`
|
|
4646
4651
|
];
|
|
4647
4652
|
}
|
|
4648
4653
|
var createMediaStyle = function(styleObject, mediaKeyIn, mediaQueries, type, negate, priority) {
|
|
4649
|
-
var [property, , identifier, , rules] = styleObject, enableMediaPropOrder = (0, import_config.getSetting)("mediaPropOrder"), isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
|
|
4654
|
+
var [property, , identifier, pseudoIn, rules] = styleObject, enableMediaPropOrder = (0, import_config.getSetting)("mediaPropOrder"), isTheme = type === "theme", isPlatform = type === "platform", isGroup = type === "group", isNonWindowMedia = isTheme || isPlatform || isGroup, negKey = negate ? "0" : "", ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1), id = `${ogPrefix}${MEDIA_SEP}${mediaKeyIn.replace("-", "")}${negKey}${MEDIA_SEP}`, styleRule = "", groupPriority = "", groupMediaKey, containerName, nextIdentifier = identifier.replace(ogPrefix, id), styleInner = rules.map(function(rule) {
|
|
4650
4655
|
return rule.replace(identifier, nextIdentifier);
|
|
4651
4656
|
}).join(";"), isHover = !1;
|
|
4652
4657
|
if (isNonWindowMedia) {
|
|
4653
4658
|
var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
|
|
4654
4659
|
if (isTheme || isGroup) {
|
|
4655
|
-
var { name, media, pseudo } =
|
|
4656
|
-
groupMediaKey = media;
|
|
4657
|
-
var
|
|
4658
|
-
isGroup && (containerName = name), pseudo === "press" && (specificity += 2), pseudo === "hover" && (isHover = !0);
|
|
4659
|
-
var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specifities[specificity]);
|
|
4660
|
+
var groupParts = (0, import_getGroupPropParts.getGroupPropParts)(isTheme ? "theme-" + mediaKeyIn : mediaKeyIn), { name, media, pseudo } = groupParts;
|
|
4661
|
+
groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = !0);
|
|
4662
|
+
var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
|
|
4660
4663
|
styleRule = styleInner.replace(selector, nextSelector);
|
|
4661
|
-
} else styleRule = `${
|
|
4664
|
+
} else styleRule = `${specificities[specificity]}${styleInner}`;
|
|
4662
4665
|
}
|
|
4663
4666
|
if (!isNonWindowMedia || groupMediaKey) {
|
|
4664
4667
|
if (!selectors) {
|
|
@@ -4677,7 +4680,7 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
4677
4680
|
}
|
|
4678
4681
|
var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
|
|
4679
4682
|
// this new array should be cached
|
|
4680
|
-
|
|
4683
|
+
specificities[priority]
|
|
4681
4684
|
) : (
|
|
4682
4685
|
// @ts-ignore
|
|
4683
4686
|
prefixes[mediaKey]
|
|
@@ -6974,7 +6977,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6974
6977
|
}
|
|
6975
6978
|
if (isMedia) {
|
|
6976
6979
|
if (!val) return "continue";
|
|
6977
|
-
var hasSpace = val.space, mediaKeyShort = key.slice(1);
|
|
6980
|
+
var hasSpace = val.space, mediaKeyShort = key.slice(isMedia == "theme" ? 7 : 1);
|
|
6978
6981
|
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key)) return "continue";
|
|
6979
6982
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key}`, {
|
|
6980
6983
|
key,
|
|
@@ -7329,7 +7332,7 @@ current`, {
|
|
|
7329
7332
|
try {
|
|
7330
7333
|
for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
7331
7334
|
var [skey, sval] = _step.value;
|
|
7332
|
-
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
7335
|
+
skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
7333
7336
|
}
|
|
7334
7337
|
} catch (err) {
|
|
7335
7338
|
_didIteratorError = !0, _iteratorError = err;
|