@tamagui/core 1.88.17 → 1.88.18
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 +44 -50
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +42 -47
- package/dist/test.native.js.map +2 -2
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -1694,7 +1694,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1694
1694
|
getMediaImportanceIfMoreImportant: () => getMediaImportanceIfMoreImportant,
|
|
1695
1695
|
getMediaKeyImportance: () => getMediaKeyImportance,
|
|
1696
1696
|
isMediaKey: () => isMediaKey,
|
|
1697
|
-
mediaKeyMatch: () =>
|
|
1697
|
+
mediaKeyMatch: () => mediaKeyMatch2,
|
|
1698
1698
|
mediaKeyToQuery: () => mediaKeyToQuery,
|
|
1699
1699
|
mediaKeys: () => mediaKeys,
|
|
1700
1700
|
mediaObjectToString: () => mediaObjectToString2,
|
|
@@ -1828,7 +1828,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1828
1828
|
function mediaKeyToQuery(key) {
|
|
1829
1829
|
return cachedMediaKeyToQuery[key] || mediaObjectToString2(mediaQueryConfig2[key], key);
|
|
1830
1830
|
}
|
|
1831
|
-
function
|
|
1831
|
+
function mediaKeyMatch2(key, dimensions) {
|
|
1832
1832
|
let mediaQueries = mediaQueryConfig2[key];
|
|
1833
1833
|
return Object.keys(mediaQueries).every((query) => {
|
|
1834
1834
|
let expectedVal = +mediaQueries[query], isMax = query.startsWith("max"), isWidth = query.endsWith("Width"), givenVal = dimensions[isWidth ? "width" : "height"];
|
|
@@ -3675,7 +3675,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3675
3675
|
module2.exports = __toCommonJS2(getVariantExtras_exports);
|
|
3676
3676
|
var import_createVariable = require_createVariable_native();
|
|
3677
3677
|
function getVariantExtras(styleState) {
|
|
3678
|
-
let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3678
|
+
let { curProps, props, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3679
3679
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
3680
3680
|
let fontFamily = (0, import_createVariable.getVariableValue)(
|
|
3681
3681
|
styleState.fontFamily || styleState.curProps.fontFamily || styleState.conf.defaultFont
|
|
@@ -3688,14 +3688,12 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3688
3688
|
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
|
|
3689
3689
|
// TODO do this in splitstlye
|
|
3690
3690
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
3691
|
-
props: new Proxy(
|
|
3691
|
+
props: new Proxy(props, {
|
|
3692
3692
|
// handles shorthands
|
|
3693
3693
|
get(target, key) {
|
|
3694
|
-
let
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
if (Reflect.has(target, key))
|
|
3698
|
-
return Reflect.get(target, key);
|
|
3694
|
+
for (let tryKey of [key, conf.inverseShorthands[key]])
|
|
3695
|
+
if (tryKey)
|
|
3696
|
+
return Reflect.has(curProps, tryKey) ? Reflect.get(curProps, tryKey) : Reflect.get(target, tryKey);
|
|
3699
3697
|
}
|
|
3700
3698
|
})
|
|
3701
3699
|
};
|
|
@@ -3998,8 +3996,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3998
3996
|
inlineWhenUnflattened,
|
|
3999
3997
|
parentStaticConfig,
|
|
4000
3998
|
acceptsClassName
|
|
4001
|
-
} = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert =
|
|
4002
|
-
curProps: {
|
|
3999
|
+
} = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = props.className || "", mediaStylesSeen = 0, styleState = {
|
|
4000
|
+
curProps: {},
|
|
4003
4001
|
classNames,
|
|
4004
4002
|
conf,
|
|
4005
4003
|
props,
|
|
@@ -4023,44 +4021,45 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4023
4021
|
theme: { ...theme }
|
|
4024
4022
|
}), console.groupEnd());
|
|
4025
4023
|
for (let keyOg in props) {
|
|
4026
|
-
process.env.NODE_ENV === "development" && console.groupEnd();
|
|
4027
4024
|
let keyInit = keyOg, valInit = props[keyOg];
|
|
4028
4025
|
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
4029
4026
|
continue;
|
|
4030
4027
|
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
4031
|
-
if (styleState.curProps[keyInit] = valInit, !
|
|
4032
|
-
|
|
4033
|
-
if (keyInit === "userSelect")
|
|
4034
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
4035
|
-
else if (keyInit === "role") {
|
|
4036
|
-
viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
4037
|
-
continue;
|
|
4038
|
-
} else if (keyInit.startsWith("aria-")) {
|
|
4039
|
-
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
4040
|
-
let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
4041
|
-
keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
|
|
4028
|
+
if (valInit !== props[keyInit] && (styleState.curProps[keyInit] = valInit), !isValidStyleKeyInit) {
|
|
4029
|
+
if (!import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
4042
4030
|
continue;
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
viewProps.
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
}
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4031
|
+
if (keyInit === "userSelect")
|
|
4032
|
+
keyInit = "selectable", valInit = valInit !== "none";
|
|
4033
|
+
else if (keyInit === "role") {
|
|
4034
|
+
viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
4035
|
+
continue;
|
|
4036
|
+
} else if (keyInit.startsWith("aria-")) {
|
|
4037
|
+
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
4038
|
+
let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
4039
|
+
keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
|
|
4040
|
+
continue;
|
|
4041
|
+
}
|
|
4042
|
+
if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
|
|
4043
|
+
let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
|
|
4044
|
+
viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = {
|
|
4045
|
+
[field]: valInit
|
|
4046
|
+
};
|
|
4047
|
+
} else if (import_accessibilityDirectMap.nativeAccessibilityState[keyInit]) {
|
|
4048
|
+
let field = import_accessibilityDirectMap.nativeAccessibilityState[keyInit];
|
|
4049
|
+
viewProps.accessibilityState ? viewProps.accessibilityState[field] = valInit : viewProps.accessibilityState = {
|
|
4050
|
+
[field]: valInit
|
|
4051
|
+
};
|
|
4052
|
+
}
|
|
4053
|
+
continue;
|
|
4054
|
+
} else if (keyInit.startsWith("data-"))
|
|
4055
|
+
continue;
|
|
4056
|
+
}
|
|
4058
4057
|
if (keyInit === "dataSet") {
|
|
4059
4058
|
for (let keyInit2 in valInit)
|
|
4060
4059
|
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
4061
4060
|
continue;
|
|
4062
4061
|
}
|
|
4063
|
-
if (keyInit.startsWith("_style") && (0, import_isObj.isObj)(valInit)) {
|
|
4062
|
+
if (!isValidStyleKeyInit && keyInit.startsWith("_style") && (0, import_isObj.isObj)(valInit)) {
|
|
4064
4063
|
Object.assign(styleState.style, valInit);
|
|
4065
4064
|
continue;
|
|
4066
4065
|
}
|
|
@@ -4077,12 +4076,12 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4077
4076
|
case "accessibilityRequired":
|
|
4078
4077
|
default:
|
|
4079
4078
|
}
|
|
4080
|
-
let isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo), isStyleProp = isMediaOrPseudo || isVariant && !styleProps.noExpand ||
|
|
4079
|
+
let isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo), isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !styleProps.noExpand || isShorthand;
|
|
4081
4080
|
if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))
|
|
4082
4081
|
continue;
|
|
4083
4082
|
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
4084
4083
|
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
4085
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.
|
|
4084
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
4086
4085
|
` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`
|
|
4087
4086
|
), (0, import_log.log)({ isVariant, valInit, shouldPassProp }), import_constants.isClient && (0, import_log.log)({
|
|
4088
4087
|
variants,
|
|
@@ -4157,7 +4156,7 @@ current`, {
|
|
|
4157
4156
|
let val2 = pseudoStyleObject[pkey];
|
|
4158
4157
|
if (isDisabled) {
|
|
4159
4158
|
let defaultValues = animatableDefaults[pkey];
|
|
4160
|
-
defaultValues != null && !(pkey in usedKeys) && mergeStyle(styleState, pkey, defaultValues);
|
|
4159
|
+
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
4161
4160
|
} else {
|
|
4162
4161
|
let curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
4163
4162
|
shouldMerge && (pseudos || (pseudos = {}), pseudos[key] || (pseudos[key] = {}), pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
@@ -4382,13 +4381,7 @@ current`, {
|
|
|
4382
4381
|
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
4383
4382
|
}
|
|
4384
4383
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
4385
|
-
},
|
|
4386
|
-
}, useSplitStyles = (...args) => {
|
|
4387
|
-
let res = getSplitStyles(...args);
|
|
4388
|
-
return useInsertEffectCompat(() => {
|
|
4389
|
-
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
4390
|
-
}, [res.rulesToInsert]), res;
|
|
4391
|
-
}, animatableDefaults = {
|
|
4384
|
+
}, useSplitStyles = (a, b, c, d, e, f, g, h, i, j) => getSplitStyles(a, b, c, d, e, f, g, h, i, j), animatableDefaults = {
|
|
4392
4385
|
opacity: 1,
|
|
4393
4386
|
scale: 1,
|
|
4394
4387
|
rotate: "0deg",
|
|
@@ -4927,7 +4920,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4927
4920
|
let isStringElement = typeof elementType == "string";
|
|
4928
4921
|
process.env.NODE_ENV === "development" && time && time`theme`;
|
|
4929
4922
|
let mediaState2 = (0, import_useMedia.useMedia)(stateRef, componentContext);
|
|
4930
|
-
process.env.NODE_ENV === "development" && time && time`media
|
|
4923
|
+
(0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time`media`;
|
|
4931
4924
|
let resolveValues = (
|
|
4932
4925
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
4933
4926
|
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
@@ -6720,6 +6713,7 @@ var require_index_native9 = __commonJS({
|
|
|
6720
6713
|
getToken: () => import_config.getToken,
|
|
6721
6714
|
getTokenValue: () => import_config.getTokenValue,
|
|
6722
6715
|
getTokens: () => import_config.getTokens,
|
|
6716
|
+
mediaKeyMatch: () => import_useMedia.mediaKeyMatch,
|
|
6723
6717
|
mediaObjectToString: () => import_useMedia.mediaObjectToString,
|
|
6724
6718
|
mediaQueryConfig: () => import_useMedia.mediaQueryConfig,
|
|
6725
6719
|
mediaState: () => import_useMedia.mediaState,
|