tamagui 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 +54 -54
package/dist/native.js
CHANGED
|
@@ -1533,7 +1533,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1533
1533
|
getMediaImportanceIfMoreImportant: () => getMediaImportanceIfMoreImportant,
|
|
1534
1534
|
getMediaKeyImportance: () => getMediaKeyImportance,
|
|
1535
1535
|
isMediaKey: () => isMediaKey,
|
|
1536
|
-
mediaKeyMatch: () =>
|
|
1536
|
+
mediaKeyMatch: () => mediaKeyMatch2,
|
|
1537
1537
|
mediaKeyToQuery: () => mediaKeyToQuery,
|
|
1538
1538
|
mediaKeys: () => mediaKeys,
|
|
1539
1539
|
mediaObjectToString: () => mediaObjectToString3,
|
|
@@ -1667,7 +1667,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1667
1667
|
function mediaKeyToQuery(key) {
|
|
1668
1668
|
return cachedMediaKeyToQuery[key] || mediaObjectToString3(mediaQueryConfig3[key], key);
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function mediaKeyMatch2(key, dimensions) {
|
|
1671
1671
|
let mediaQueries = mediaQueryConfig3[key];
|
|
1672
1672
|
return Object.keys(mediaQueries).every((query) => {
|
|
1673
1673
|
let expectedVal = +mediaQueries[query], isMax = query.startsWith("max"), isWidth = query.endsWith("Width"), givenVal = dimensions[isWidth ? "width" : "height"];
|
|
@@ -3514,7 +3514,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3514
3514
|
module2.exports = __toCommonJS2(getVariantExtras_exports);
|
|
3515
3515
|
var import_createVariable = require_createVariable_native();
|
|
3516
3516
|
function getVariantExtras(styleState) {
|
|
3517
|
-
let { curProps, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3517
|
+
let { curProps, props, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
3518
3518
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
3519
3519
|
let fontFamily = (0, import_createVariable.getVariableValue)(
|
|
3520
3520
|
styleState.fontFamily || styleState.curProps.fontFamily || styleState.conf.defaultFont
|
|
@@ -3527,14 +3527,12 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
3527
3527
|
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont],
|
|
3528
3528
|
// TODO do this in splitstlye
|
|
3529
3529
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
3530
|
-
props: new Proxy(
|
|
3530
|
+
props: new Proxy(props, {
|
|
3531
3531
|
// handles shorthands
|
|
3532
3532
|
get(target, key) {
|
|
3533
|
-
let
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
if (Reflect.has(target, key))
|
|
3537
|
-
return Reflect.get(target, key);
|
|
3533
|
+
for (let tryKey of [key, conf.inverseShorthands[key]])
|
|
3534
|
+
if (tryKey)
|
|
3535
|
+
return Reflect.has(curProps, tryKey) ? Reflect.get(curProps, tryKey) : Reflect.get(target, tryKey);
|
|
3538
3536
|
}
|
|
3539
3537
|
})
|
|
3540
3538
|
};
|
|
@@ -3837,8 +3835,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3837
3835
|
inlineWhenUnflattened,
|
|
3838
3836
|
parentStaticConfig,
|
|
3839
3837
|
acceptsClassName
|
|
3840
|
-
} = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClassNames, rulesToInsert =
|
|
3841
|
-
curProps: {
|
|
3838
|
+
} = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.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 = {
|
|
3839
|
+
curProps: {},
|
|
3842
3840
|
classNames,
|
|
3843
3841
|
conf,
|
|
3844
3842
|
props,
|
|
@@ -3862,44 +3860,45 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3862
3860
|
theme: { ...theme }
|
|
3863
3861
|
}), console.groupEnd());
|
|
3864
3862
|
for (let keyOg in props) {
|
|
3865
|
-
process.env.NODE_ENV === "development" && console.groupEnd();
|
|
3866
3863
|
let keyInit = keyOg, valInit = props[keyOg];
|
|
3867
3864
|
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
3868
3865
|
continue;
|
|
3869
3866
|
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3870
|
-
if (styleState.curProps[keyInit] = valInit, !
|
|
3871
|
-
|
|
3872
|
-
if (keyInit === "userSelect")
|
|
3873
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
3874
|
-
else if (keyInit === "role") {
|
|
3875
|
-
viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
3876
|
-
continue;
|
|
3877
|
-
} else if (keyInit.startsWith("aria-")) {
|
|
3878
|
-
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
3879
|
-
let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
3880
|
-
keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
|
|
3867
|
+
if (valInit !== props[keyInit] && (styleState.curProps[keyInit] = valInit), !isValidStyleKeyInit) {
|
|
3868
|
+
if (!import_constants4.isAndroid && keyInit === "elevationAndroid")
|
|
3881
3869
|
continue;
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
viewProps.
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
}
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3870
|
+
if (keyInit === "userSelect")
|
|
3871
|
+
keyInit = "selectable", valInit = valInit !== "none";
|
|
3872
|
+
else if (keyInit === "role") {
|
|
3873
|
+
viewProps.accessibilityRole = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
3874
|
+
continue;
|
|
3875
|
+
} else if (keyInit.startsWith("aria-")) {
|
|
3876
|
+
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
3877
|
+
let nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
3878
|
+
keyInit === "aria-hidden" && (viewProps["aria-hidden"] = valInit), viewProps[nativeA11yProp] = valInit;
|
|
3879
|
+
continue;
|
|
3880
|
+
}
|
|
3881
|
+
if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
|
|
3882
|
+
let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
|
|
3883
|
+
viewProps.accessibilityValue ? viewProps.accessibilityValue[field] = valInit : viewProps.accessibilityValue = {
|
|
3884
|
+
[field]: valInit
|
|
3885
|
+
};
|
|
3886
|
+
} else if (import_accessibilityDirectMap.nativeAccessibilityState[keyInit]) {
|
|
3887
|
+
let field = import_accessibilityDirectMap.nativeAccessibilityState[keyInit];
|
|
3888
|
+
viewProps.accessibilityState ? viewProps.accessibilityState[field] = valInit : viewProps.accessibilityState = {
|
|
3889
|
+
[field]: valInit
|
|
3890
|
+
};
|
|
3891
|
+
}
|
|
3892
|
+
continue;
|
|
3893
|
+
} else if (keyInit.startsWith("data-"))
|
|
3894
|
+
continue;
|
|
3895
|
+
}
|
|
3897
3896
|
if (keyInit === "dataSet") {
|
|
3898
3897
|
for (let keyInit2 in valInit)
|
|
3899
3898
|
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
3900
3899
|
continue;
|
|
3901
3900
|
}
|
|
3902
|
-
if (keyInit.startsWith("_style") && (0, import_isObj.isObj)(valInit)) {
|
|
3901
|
+
if (!isValidStyleKeyInit && keyInit.startsWith("_style") && (0, import_isObj.isObj)(valInit)) {
|
|
3903
3902
|
Object.assign(styleState.style, valInit);
|
|
3904
3903
|
continue;
|
|
3905
3904
|
}
|
|
@@ -3916,12 +3915,12 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3916
3915
|
case "accessibilityRequired":
|
|
3917
3916
|
default:
|
|
3918
3917
|
}
|
|
3919
|
-
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 ||
|
|
3918
|
+
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;
|
|
3920
3919
|
if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web"))
|
|
3921
3920
|
continue;
|
|
3922
3921
|
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
3923
3922
|
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;
|
|
3924
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.
|
|
3923
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
3925
3924
|
` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`
|
|
3926
3925
|
), (0, import_log.log)({ isVariant, valInit, shouldPassProp }), import_constants4.isClient && (0, import_log.log)({
|
|
3927
3926
|
variants,
|
|
@@ -3996,7 +3995,7 @@ current`, {
|
|
|
3996
3995
|
let val2 = pseudoStyleObject[pkey];
|
|
3997
3996
|
if (isDisabled) {
|
|
3998
3997
|
let defaultValues = animatableDefaults[pkey];
|
|
3999
|
-
defaultValues != null && !(pkey in usedKeys) && mergeStyle(styleState, pkey, defaultValues);
|
|
3998
|
+
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
4000
3999
|
} else {
|
|
4001
4000
|
let curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
4002
4001
|
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, {
|
|
@@ -4221,13 +4220,7 @@ current`, {
|
|
|
4221
4220
|
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
4222
4221
|
}
|
|
4223
4222
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
4224
|
-
},
|
|
4225
|
-
}, useSplitStyles = (...args) => {
|
|
4226
|
-
let res = getSplitStyles(...args);
|
|
4227
|
-
return useInsertEffectCompat(() => {
|
|
4228
|
-
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
4229
|
-
}, [res.rulesToInsert]), res;
|
|
4230
|
-
}, animatableDefaults = {
|
|
4223
|
+
}, useSplitStyles = (a, b, c, d, e, f, g, h, i, j) => getSplitStyles(a, b, c, d, e, f, g, h, i, j), animatableDefaults = {
|
|
4231
4224
|
opacity: 1,
|
|
4232
4225
|
scale: 1,
|
|
4233
4226
|
rotate: "0deg",
|
|
@@ -4766,7 +4759,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4766
4759
|
let isStringElement = typeof elementType == "string";
|
|
4767
4760
|
process.env.NODE_ENV === "development" && time && time`theme`;
|
|
4768
4761
|
let mediaState3 = (0, import_useMedia.useMedia)(stateRef, componentContext);
|
|
4769
|
-
process.env.NODE_ENV === "development" && time && time`media
|
|
4762
|
+
(0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time`media`;
|
|
4770
4763
|
let resolveValues = (
|
|
4771
4764
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
4772
4765
|
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
@@ -6483,6 +6476,7 @@ var require_index_native13 = __commonJS({
|
|
|
6483
6476
|
getToken: () => import_config.getToken,
|
|
6484
6477
|
getTokenValue: () => import_config.getTokenValue,
|
|
6485
6478
|
getTokens: () => import_config.getTokens,
|
|
6479
|
+
mediaKeyMatch: () => import_useMedia.mediaKeyMatch,
|
|
6486
6480
|
mediaObjectToString: () => import_useMedia.mediaObjectToString,
|
|
6487
6481
|
mediaQueryConfig: () => import_useMedia.mediaQueryConfig,
|
|
6488
6482
|
mediaState: () => import_useMedia.mediaState,
|