tamagui 1.89.6 → 1.89.7
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 -40
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +41 -36
- package/dist/test.native.js.map +2 -2
- package/package.json +54 -54
package/dist/test.native.js
CHANGED
|
@@ -3751,7 +3751,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3751
3751
|
return (staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles))[key] || ((_a = staticConfig.acceptTokens) == null ? void 0 : _a[key]);
|
|
3752
3752
|
}
|
|
3753
3753
|
var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3754
|
-
var _a, _b, _c,
|
|
3754
|
+
var _a, _b, _c, _f, _g, _h;
|
|
3755
3755
|
conf = conf || (0, import_config.getConfig)(), import_constants4.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3756
3756
|
let { shorthands } = conf, {
|
|
3757
3757
|
isHOC,
|
|
@@ -3763,7 +3763,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3763
3763
|
inlineWhenUnflattened,
|
|
3764
3764
|
parentStaticConfig,
|
|
3765
3765
|
acceptsClassName
|
|
3766
|
-
} = 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,
|
|
3766
|
+
} = 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, className = props.className || "", mediaStylesSeen = 0, styleState = {
|
|
3767
3767
|
curProps: {},
|
|
3768
3768
|
classNames,
|
|
3769
3769
|
conf,
|
|
@@ -3771,7 +3771,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3771
3771
|
styleProps,
|
|
3772
3772
|
componentState,
|
|
3773
3773
|
staticConfig,
|
|
3774
|
-
style,
|
|
3774
|
+
style: null,
|
|
3775
3775
|
theme,
|
|
3776
3776
|
usedKeys,
|
|
3777
3777
|
viewProps,
|
|
@@ -3818,7 +3818,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3818
3818
|
continue;
|
|
3819
3819
|
}
|
|
3820
3820
|
if (!isValidStyleKeyInit && keyInit.startsWith("_style") && (0, import_isObj.isObj)(valInit)) {
|
|
3821
|
-
Object.assign(styleState.style, valInit);
|
|
3821
|
+
styleState.style || (styleState.style = {}), Object.assign(styleState.style, valInit);
|
|
3822
3822
|
continue;
|
|
3823
3823
|
}
|
|
3824
3824
|
if (0)
|
|
@@ -3842,7 +3842,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3842
3842
|
if ((shouldPassProp || isHOCShouldPassThrough) && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in import_skipProps.skipProps)
|
|
3843
3843
|
continue;
|
|
3844
3844
|
if ((isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && valInit !== "unset" && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
|
|
3845
|
-
style[keyInit] = valInit;
|
|
3845
|
+
styleState.style || (styleState.style = {}), styleState.style[keyInit] = valInit;
|
|
3846
3846
|
continue;
|
|
3847
3847
|
}
|
|
3848
3848
|
let avoidPropMap = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
|
|
@@ -3895,7 +3895,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3895
3895
|
let val2 = pseudoStyleObject[pkey];
|
|
3896
3896
|
if (isDisabled) {
|
|
3897
3897
|
let defaultValues = animatableDefaults[pkey];
|
|
3898
|
-
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
3898
|
+
defaultValues != null && !(pkey in usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
|
|
3899
3899
|
} else {
|
|
3900
3900
|
let curImportance = usedKeys[pkey] || 0;
|
|
3901
3901
|
importance >= curImportance && (pseudos || (pseudos = {}), pseudos[key] || (pseudos[key] = {}), pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2));
|
|
@@ -3941,16 +3941,16 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3941
3941
|
}
|
|
3942
3942
|
let mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle, debug), priority = mediaStylesSeen;
|
|
3943
3943
|
mediaStylesSeen += 1;
|
|
3944
|
-
for (let
|
|
3944
|
+
for (let style of mediaStyles) {
|
|
3945
3945
|
let out = (0, import_createMediaStyle.createMediaStyle)(
|
|
3946
|
-
|
|
3946
|
+
style,
|
|
3947
3947
|
mediaKeyShort,
|
|
3948
3948
|
import_useMedia.mediaQueryConfig,
|
|
3949
3949
|
isMedia,
|
|
3950
3950
|
!1,
|
|
3951
3951
|
priority
|
|
3952
3952
|
);
|
|
3953
|
-
`${
|
|
3953
|
+
`${style.property}${PROP_SPLIT}${mediaKeyShort}` in usedKeys || out.identifier;
|
|
3954
3954
|
}
|
|
3955
3955
|
} else {
|
|
3956
3956
|
let isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group";
|
|
@@ -3988,8 +3988,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3988
3988
|
space = valInit.space;
|
|
3989
3989
|
continue;
|
|
3990
3990
|
}
|
|
3991
|
-
(0, import_useMedia.mergeMediaByImportance)(
|
|
3992
|
-
style,
|
|
3991
|
+
styleState.style || (styleState.style = {}), (0, import_useMedia.mergeMediaByImportance)(
|
|
3992
|
+
styleState.style,
|
|
3993
3993
|
mediaKeyShort,
|
|
3994
3994
|
subKey,
|
|
3995
3995
|
mediaStyle[subKey],
|
|
@@ -4025,20 +4025,19 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4025
4025
|
if (isHOC)
|
|
4026
4026
|
viewProps.style = props.style;
|
|
4027
4027
|
else
|
|
4028
|
-
for (let
|
|
4029
|
-
|
|
4030
|
-
if (styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style), import_constants4.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
4031
|
-
mergeTransform(style, key, val, !0);
|
|
4032
|
-
}), parentSplitStyles && !shouldDoClasses))
|
|
4028
|
+
for (let style of [].concat(props.style))
|
|
4029
|
+
style && (style.$$css ? Object.assign(styleState.classNames, style) : (styleState.style || (styleState.style = {}), Object.assign(styleState.style, style)));
|
|
4030
|
+
if (styleProps.noNormalize !== !1 && (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants4.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.transforms && (styleState.style || (styleState.style = {}), Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
4031
|
+
mergeTransform(styleState.style, key, val, !0);
|
|
4032
|
+
})), parentSplitStyles && !shouldDoClasses))
|
|
4033
4033
|
for (let key in parentSplitStyles.style)
|
|
4034
|
-
key in classNames || key in style || (style[key] = parentSplitStyles.style[key]);
|
|
4034
|
+
key in classNames || styleState.style && key in styleState.style || (styleState.style || (styleState.style = {}), styleState.style[key] = parentSplitStyles.style[key]);
|
|
4035
4035
|
let result = {
|
|
4036
4036
|
space,
|
|
4037
4037
|
hasMedia,
|
|
4038
4038
|
fontFamily: styleState.fontFamily,
|
|
4039
4039
|
viewProps,
|
|
4040
|
-
|
|
4041
|
-
style,
|
|
4040
|
+
style: styleState.style,
|
|
4042
4041
|
pseudos,
|
|
4043
4042
|
classNames,
|
|
4044
4043
|
rulesToInsert,
|
|
@@ -4046,31 +4045,36 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4046
4045
|
pseudoGroups,
|
|
4047
4046
|
mediaGroups
|
|
4048
4047
|
};
|
|
4049
|
-
|
|
4050
|
-
let
|
|
4051
|
-
if (
|
|
4052
|
-
let
|
|
4053
|
-
|
|
4048
|
+
{
|
|
4049
|
+
let style = styleState.style;
|
|
4050
|
+
if (style != null && style.fontFamily) {
|
|
4051
|
+
let faceInfo = (_f = (0, import_config.getFont)(style.fontFamily)) == null ? void 0 : _f.face;
|
|
4052
|
+
if (faceInfo) {
|
|
4053
|
+
let overrideFace = (_h = (_g = faceInfo[style.fontWeight]) == null ? void 0 : _g[style.fontStyle || "normal"]) == null ? void 0 : _h.val;
|
|
4054
|
+
overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
|
|
4055
|
+
}
|
|
4054
4056
|
}
|
|
4055
4057
|
}
|
|
4056
|
-
let
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4058
|
+
let asChild = props.asChild;
|
|
4059
|
+
if (!(asChild === "except-style" || asChild === "except-style-web")) {
|
|
4060
|
+
let style = styleState.style;
|
|
4061
|
+
style && !styleProps.noMergeStyle && (viewProps.style = style);
|
|
4062
|
+
}
|
|
4063
|
+
if (0)
|
|
4060
4064
|
try {
|
|
4061
4065
|
} catch {
|
|
4062
4066
|
}
|
|
4063
4067
|
return result;
|
|
4064
4068
|
};
|
|
4065
4069
|
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
4066
|
-
let { classNames, viewProps,
|
|
4070
|
+
let { classNames, viewProps, usedKeys, styleProps } = styleState;
|
|
4067
4071
|
if (import_constants4.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
4068
4072
|
classNames[key] = val, usedKeys[key] || (usedKeys[key] = 1);
|
|
4069
4073
|
else if (key in import_helpers.stylePropsTransform)
|
|
4070
4074
|
styleState.transforms || (styleState.transforms = {}), styleState.transforms[key] = val;
|
|
4071
4075
|
else {
|
|
4072
4076
|
let out = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
4073
|
-
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
4077
|
+
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : (styleState.style || (styleState.style = {}), styleState.style[key] = out);
|
|
4074
4078
|
}
|
|
4075
4079
|
}
|
|
4076
4080
|
var getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
@@ -4554,7 +4558,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4554
4558
|
elementType,
|
|
4555
4559
|
debugProp
|
|
4556
4560
|
);
|
|
4557
|
-
props.group && props.untilMeasured === "hide" && !curState.hasMeasured && (splitStyles.style.opacity = 0), curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
4561
|
+
props.group && props.untilMeasured === "hide" && !curState.hasMeasured && (splitStyles.style || (splitStyles.style = {}), splitStyles.style.opacity = 0), curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
4558
4562
|
let isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
4559
4563
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
4560
4564
|
enabled: shouldListenForMedia,
|
|
@@ -4603,7 +4607,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4603
4607
|
let animations = useAnimations({
|
|
4604
4608
|
props: propsWithAnimation,
|
|
4605
4609
|
// if hydrating, send empty style
|
|
4606
|
-
style: splitStylesStyle,
|
|
4610
|
+
style: splitStylesStyle || {},
|
|
4607
4611
|
presence,
|
|
4608
4612
|
componentState: state,
|
|
4609
4613
|
styleProps,
|
|
@@ -4746,6 +4750,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4746
4750
|
let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
|
|
4747
4751
|
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content }));
|
|
4748
4752
|
let groupState = curState.group, subGroupContext = (0, import_react2.useMemo)(() => {
|
|
4753
|
+
var _a3, _b2;
|
|
4749
4754
|
if (!(!groupState || !groupName))
|
|
4750
4755
|
return groupState.listeners.clear(), {
|
|
4751
4756
|
...componentContext.groups,
|
|
@@ -4757,8 +4762,8 @@ var require_createComponent_native = __commonJS({
|
|
|
4757
4762
|
// capture just initial width and height if they exist
|
|
4758
4763
|
// will have top, left, width, height (not x, y)
|
|
4759
4764
|
layout: {
|
|
4760
|
-
width: fromPx(splitStyles.style.width),
|
|
4761
|
-
height: fromPx(splitStyles.style.height)
|
|
4765
|
+
width: fromPx((_a3 = splitStyles.style) == null ? void 0 : _a3.width),
|
|
4766
|
+
height: fromPx((_b2 = splitStyles.style) == null ? void 0 : _b2.height)
|
|
4762
4767
|
}
|
|
4763
4768
|
}
|
|
4764
4769
|
},
|
|
@@ -5913,7 +5918,7 @@ var require_useProps_native = __commonJS({
|
|
|
5913
5918
|
};
|
|
5914
5919
|
}
|
|
5915
5920
|
function useStyle2(props, opts) {
|
|
5916
|
-
return usePropsAndStyle2(props, opts)[1];
|
|
5921
|
+
return usePropsAndStyle2(props, opts)[1] || {};
|
|
5917
5922
|
}
|
|
5918
5923
|
function usePropsAndStyle2(props, opts) {
|
|
5919
5924
|
var _a, _b;
|
|
@@ -5937,7 +5942,7 @@ var require_useProps_native = __commonJS({
|
|
|
5937
5942
|
null,
|
|
5938
5943
|
componentContext
|
|
5939
5944
|
);
|
|
5940
|
-
return [splitStyles.viewProps, splitStyles.style, theme, media];
|
|
5945
|
+
return [splitStyles.viewProps, splitStyles.style || {}, theme, media];
|
|
5941
5946
|
}
|
|
5942
5947
|
}
|
|
5943
5948
|
});
|