@tamagui/core 1.112.14 → 1.112.16
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 +11 -13
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +11 -13
- package/dist/test.native.js.map +1 -1
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -4635,30 +4635,28 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
4635
4635
|
module2.exports = __toCommonJS2(createMediaStyle_exports);
|
|
4636
4636
|
var import_config = require_config_native(), import_useMedia = require_useMedia_native(), import_getGroupPropParts = require_getGroupPropParts_native(), MEDIA_SEP = "_", prefixes = null, selectors = null, groupPseudoToPseudoCSSMap = {
|
|
4637
4637
|
press: "active"
|
|
4638
|
-
},
|
|
4638
|
+
}, specificities = new Array(5).fill(0).map(function(_, i) {
|
|
4639
4639
|
return new Array(i).fill(":root").join("");
|
|
4640
4640
|
});
|
|
4641
4641
|
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.
|
|
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.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
4643
|
return [
|
|
4644
4644
|
selector,
|
|
4645
|
-
`${presedencePrefix}${mediaSelector} ${selector.
|
|
4645
|
+
`${presedencePrefix}${mediaSelector} ${selector.replaceAll(":root", "")}`
|
|
4646
4646
|
];
|
|
4647
4647
|
}
|
|
4648
4648
|
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) {
|
|
4649
|
+
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
4650
|
return rule.replace(identifier, nextIdentifier);
|
|
4651
4651
|
}).join(";"), isHover = !1;
|
|
4652
4652
|
if (isNonWindowMedia) {
|
|
4653
4653
|
var specificity = (priority || 0) + (isGroup || isPlatform ? 1 : 0);
|
|
4654
4654
|
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]);
|
|
4655
|
+
var groupParts = (0, import_getGroupPropParts.getGroupPropParts)(isTheme ? "theme-" + mediaKeyIn : mediaKeyIn), { name, media, pseudo } = groupParts;
|
|
4656
|
+
groupMediaKey = media, isGroup && (containerName = name), (pseudo === "press" || pseudoIn === "active") && (specificity += 2), pseudo === "hover" && (isHover = !0);
|
|
4657
|
+
var [selector, nextSelector] = getThemeOrGroupSelector(name, styleInner, isGroup, groupParts, isTheme, specificities[specificity]);
|
|
4660
4658
|
styleRule = styleInner.replace(selector, nextSelector);
|
|
4661
|
-
} else styleRule = `${
|
|
4659
|
+
} else styleRule = `${specificities[specificity]}${styleInner}`;
|
|
4662
4660
|
}
|
|
4663
4661
|
if (!isNonWindowMedia || groupMediaKey) {
|
|
4664
4662
|
if (!selectors) {
|
|
@@ -4677,7 +4675,7 @@ var require_createMediaStyle_native = __commonJS({
|
|
|
4677
4675
|
}
|
|
4678
4676
|
var mediaKey = groupMediaKey || mediaKeyIn, mediaSelector = selectors[mediaKey], screenStr = negate ? "not all and " : "", mediaQuery = `${screenStr}${mediaSelector}`, precedenceImportancePrefix = groupMediaKey ? groupPriority : enableMediaPropOrder && priority ? (
|
|
4679
4677
|
// this new array should be cached
|
|
4680
|
-
|
|
4678
|
+
specificities[priority]
|
|
4681
4679
|
) : (
|
|
4682
4680
|
// @ts-ignore
|
|
4683
4681
|
prefixes[mediaKey]
|
|
@@ -6974,7 +6972,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6974
6972
|
}
|
|
6975
6973
|
if (isMedia) {
|
|
6976
6974
|
if (!val) return "continue";
|
|
6977
|
-
var hasSpace = val.space, mediaKeyShort = key.slice(1);
|
|
6975
|
+
var hasSpace = val.space, mediaKeyShort = key.slice(isMedia == "theme" ? 7 : 1);
|
|
6978
6976
|
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
6977
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key}`, {
|
|
6980
6978
|
key,
|
|
@@ -7329,7 +7327,7 @@ current`, {
|
|
|
7329
7327
|
try {
|
|
7330
7328
|
for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
7331
7329
|
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);
|
|
7330
|
+
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
7331
|
}
|
|
7334
7332
|
} catch (err) {
|
|
7335
7333
|
_didIteratorError = !0, _iteratorError = err;
|