@tamagui/core 1.88.18 → 1.88.19
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 +179 -169
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +155 -144
- package/dist/test.native.js.map +1 -1
- package/package.json +6 -6
package/dist/test.native.js
CHANGED
|
@@ -3910,171 +3910,181 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3910
3910
|
style[keyInit] = valInit;
|
|
3911
3911
|
continue;
|
|
3912
3912
|
}
|
|
3913
|
-
let
|
|
3914
|
-
if (
|
|
3913
|
+
let avoidPropMap = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
|
|
3914
|
+
if (!avoidPropMap) {
|
|
3915
|
+
if (!expanded)
|
|
3916
|
+
continue;
|
|
3917
|
+
let next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
3918
|
+
next && (styleState.fontFamily = next);
|
|
3919
|
+
}
|
|
3920
|
+
if (0)
|
|
3915
3921
|
try {
|
|
3916
3922
|
} catch {
|
|
3917
3923
|
}
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3924
|
+
let key = keyInit, val = valInit, max = expanded ? expanded.length : 1;
|
|
3925
|
+
for (let i = 0; i < max; i++) {
|
|
3926
|
+
if (expanded) {
|
|
3927
|
+
let [k, v] = expanded[i];
|
|
3928
|
+
key = k, val = v;
|
|
3929
|
+
}
|
|
3930
|
+
if (!(val == null || key in usedKeys)) {
|
|
3931
|
+
if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key in variants, (inlineProps != null && inlineProps.has(key) || IS_STATIC && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key)) && (viewProps[key] = props[key] ?? val), styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]))) {
|
|
3932
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo);
|
|
3933
|
+
continue;
|
|
3934
|
+
}
|
|
3935
|
+
if (isPseudo) {
|
|
3936
|
+
if (!val)
|
|
3937
|
+
continue;
|
|
3938
|
+
let pseudoStyleObject = getSubStyle(
|
|
3939
|
+
styleState,
|
|
3940
|
+
key,
|
|
3941
|
+
val,
|
|
3942
|
+
styleProps.noClassNames
|
|
3943
|
+
), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
3944
|
+
if (!descriptor)
|
|
3945
|
+
continue;
|
|
3946
|
+
if ((!shouldDoClasses || IS_STATIC) && (pseudos || (pseudos = {}), pseudos[key] || (pseudos[key] = {}), IS_STATIC)) {
|
|
3947
|
+
Object.assign(pseudos[key], pseudoStyleObject);
|
|
3923
3948
|
continue;
|
|
3924
3949
|
}
|
|
3925
|
-
if (
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
for (let psuedoStyle of pseudoStyles)
|
|
3943
|
-
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3944
|
-
}
|
|
3945
|
-
if (!shouldDoClasses || isExit || isEnter) {
|
|
3946
|
-
let descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
3947
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted);
|
|
3948
|
-
let importance = descriptor.priority;
|
|
3949
|
-
for (let pkey in pseudoStyleObject) {
|
|
3950
|
-
let val2 = pseudoStyleObject[pkey];
|
|
3951
|
-
if (isDisabled) {
|
|
3952
|
-
let defaultValues = animatableDefaults[pkey];
|
|
3953
|
-
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
3954
|
-
} else {
|
|
3955
|
-
let curImportance = usedKeys[pkey] || 0;
|
|
3956
|
-
importance >= curImportance && (pseudos || (pseudos = {}), pseudos[key] || (pseudos[key] = {}), pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2));
|
|
3957
|
-
}
|
|
3950
|
+
if (shouldDoClasses && !isExit) {
|
|
3951
|
+
let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
3952
|
+
for (let psuedoStyle of pseudoStyles)
|
|
3953
|
+
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3954
|
+
}
|
|
3955
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
3956
|
+
let descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
3957
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted);
|
|
3958
|
+
let importance = descriptor.priority;
|
|
3959
|
+
for (let pkey in pseudoStyleObject) {
|
|
3960
|
+
let val2 = pseudoStyleObject[pkey];
|
|
3961
|
+
if (isDisabled) {
|
|
3962
|
+
let defaultValues = animatableDefaults[pkey];
|
|
3963
|
+
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
3964
|
+
} else {
|
|
3965
|
+
let curImportance = usedKeys[pkey] || 0;
|
|
3966
|
+
importance >= curImportance && (pseudos || (pseudos = {}), pseudos[key] || (pseudos[key] = {}), pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2));
|
|
3958
3967
|
}
|
|
3959
|
-
if (!isDisabled)
|
|
3960
|
-
for (let key2 in val) {
|
|
3961
|
-
let k = shorthands[key2] || key2;
|
|
3962
|
-
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
3963
|
-
}
|
|
3964
3968
|
}
|
|
3969
|
+
if (!isDisabled)
|
|
3970
|
+
for (let key2 in val) {
|
|
3971
|
+
let k = shorthands[key2] || key2;
|
|
3972
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
3975
|
+
continue;
|
|
3976
|
+
}
|
|
3977
|
+
if (isMedia) {
|
|
3978
|
+
if (!val)
|
|
3965
3979
|
continue;
|
|
3980
|
+
if (isMedia === "platform") {
|
|
3981
|
+
let platform = key.slice(10);
|
|
3982
|
+
if (
|
|
3983
|
+
// supports web, ios, android
|
|
3984
|
+
platform !== import_constants.currentPlatform && // supports web, native
|
|
3985
|
+
platform !== "native"
|
|
3986
|
+
)
|
|
3987
|
+
continue;
|
|
3966
3988
|
}
|
|
3967
|
-
|
|
3968
|
-
|
|
3989
|
+
hasMedia || (hasMedia = !0);
|
|
3990
|
+
let mediaStyle = getSubStyle(
|
|
3991
|
+
styleState,
|
|
3992
|
+
key,
|
|
3993
|
+
val,
|
|
3994
|
+
// TODO try true like pseudo
|
|
3995
|
+
!1
|
|
3996
|
+
), mediaKeyShort = key.slice(1), hasSpace = val.space;
|
|
3997
|
+
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
3998
|
+
if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
|
|
3999
|
+
let importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
4000
|
+
mediaKeyShort,
|
|
4001
|
+
"space",
|
|
4002
|
+
usedKeys,
|
|
4003
|
+
!0
|
|
4004
|
+
);
|
|
4005
|
+
importance && (space = val.space, usedKeys.space = importance);
|
|
4006
|
+
}
|
|
4007
|
+
let mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle, debug), priority = mediaStylesSeen;
|
|
4008
|
+
mediaStylesSeen += 1;
|
|
4009
|
+
for (let style2 of mediaStyles) {
|
|
4010
|
+
let out = (0, import_createMediaStyle.createMediaStyle)(
|
|
4011
|
+
style2,
|
|
4012
|
+
mediaKeyShort,
|
|
4013
|
+
import_useMedia.mediaQueryConfig,
|
|
4014
|
+
isMedia,
|
|
4015
|
+
!1,
|
|
4016
|
+
priority
|
|
4017
|
+
);
|
|
4018
|
+
`${style2.property}${PROP_SPLIT}${mediaKeyShort}` in usedKeys || out.identifier;
|
|
4019
|
+
}
|
|
4020
|
+
} else {
|
|
4021
|
+
let isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group";
|
|
4022
|
+
if (!isThemeMedia && isMedia !== "platform" && !isGroupMedia && !mediaState2[mediaKeyShort])
|
|
3969
4023
|
continue;
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
platform !== "native"
|
|
3976
|
-
)
|
|
4024
|
+
let importanceBump = 0;
|
|
4025
|
+
if (isThemeMedia) {
|
|
4026
|
+
dynamicThemeAccess = !0;
|
|
4027
|
+
let mediaThemeName = mediaKeyShort.slice(6);
|
|
4028
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
3977
4029
|
continue;
|
|
3978
|
-
}
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
styleState,
|
|
3982
|
-
key,
|
|
3983
|
-
val,
|
|
3984
|
-
// TODO try true like pseudo
|
|
3985
|
-
!1
|
|
3986
|
-
), mediaKeyShort = key.slice(1), hasSpace = val.space;
|
|
3987
|
-
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
3988
|
-
if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
|
|
3989
|
-
let importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
3990
|
-
mediaKeyShort,
|
|
3991
|
-
"space",
|
|
3992
|
-
usedKeys,
|
|
3993
|
-
!0
|
|
3994
|
-
);
|
|
3995
|
-
importance && (space = val.space, usedKeys.space = importance);
|
|
3996
|
-
}
|
|
3997
|
-
let mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle, debug), priority = mediaStylesSeen;
|
|
3998
|
-
mediaStylesSeen += 1;
|
|
3999
|
-
for (let style2 of mediaStyles) {
|
|
4000
|
-
let out = (0, import_createMediaStyle.createMediaStyle)(
|
|
4001
|
-
style2,
|
|
4002
|
-
mediaKeyShort,
|
|
4003
|
-
import_useMedia.mediaQueryConfig,
|
|
4004
|
-
isMedia,
|
|
4005
|
-
!1,
|
|
4006
|
-
priority
|
|
4007
|
-
);
|
|
4008
|
-
`${style2.property}${PROP_SPLIT}${mediaKeyShort}` in usedKeys || out.identifier;
|
|
4009
|
-
}
|
|
4010
|
-
} else {
|
|
4011
|
-
let isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group";
|
|
4012
|
-
if (!isThemeMedia && isMedia !== "platform" && !isGroupMedia && !mediaState2[mediaKeyShort])
|
|
4030
|
+
} else if (isGroupMedia) {
|
|
4031
|
+
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
4032
|
+
if (!groupContext)
|
|
4013
4033
|
continue;
|
|
4014
|
-
let
|
|
4015
|
-
if (
|
|
4016
|
-
|
|
4017
|
-
let
|
|
4018
|
-
if (!(
|
|
4019
|
-
continue;
|
|
4020
|
-
} else if (isGroupMedia) {
|
|
4021
|
-
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
4022
|
-
if (!groupContext)
|
|
4034
|
+
let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_c = componentState.group) == null ? void 0 : _c[groupName];
|
|
4035
|
+
if (groupMediaKey) {
|
|
4036
|
+
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
4037
|
+
let mediaState22 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState22 == null ? void 0 : mediaState22[groupMediaKey];
|
|
4038
|
+
if (!mediaState22 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive)
|
|
4023
4039
|
continue;
|
|
4024
|
-
|
|
4025
|
-
if (groupMediaKey) {
|
|
4026
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
4027
|
-
let mediaState22 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState22 == null ? void 0 : mediaState22[groupMediaKey];
|
|
4028
|
-
if (!mediaState22 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive)
|
|
4029
|
-
continue;
|
|
4030
|
-
importanceBump = 2;
|
|
4031
|
-
}
|
|
4032
|
-
if (groupPseudoKey) {
|
|
4033
|
-
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
4034
|
-
let componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
4035
|
-
context.groups.state[groupName]).pseudo;
|
|
4036
|
-
if (!(componentGroupPseudoState != null && componentGroupPseudoState[groupPseudoKey]))
|
|
4037
|
-
continue;
|
|
4038
|
-
importanceBump = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
4039
|
-
}
|
|
4040
|
+
importanceBump = 2;
|
|
4040
4041
|
}
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4042
|
+
if (groupPseudoKey) {
|
|
4043
|
+
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
4044
|
+
let componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
4045
|
+
context.groups.state[groupName]).pseudo;
|
|
4046
|
+
if (!(componentGroupPseudoState != null && componentGroupPseudoState[groupPseudoKey]))
|
|
4044
4047
|
continue;
|
|
4045
|
-
|
|
4046
|
-
(0, import_useMedia.mergeMediaByImportance)(
|
|
4047
|
-
style,
|
|
4048
|
-
mediaKeyShort,
|
|
4049
|
-
subKey,
|
|
4050
|
-
mediaStyle[subKey],
|
|
4051
|
-
usedKeys,
|
|
4052
|
-
mediaState2[mediaKeyShort],
|
|
4053
|
-
importanceBump
|
|
4054
|
-
), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
4048
|
+
importanceBump = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
4055
4049
|
}
|
|
4056
4050
|
}
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4051
|
+
for (let subKey in mediaStyle) {
|
|
4052
|
+
if (subKey === "space") {
|
|
4053
|
+
space = valInit.space;
|
|
4054
|
+
continue;
|
|
4055
|
+
}
|
|
4056
|
+
(0, import_useMedia.mergeMediaByImportance)(
|
|
4057
|
+
style,
|
|
4058
|
+
mediaKeyShort,
|
|
4059
|
+
subKey,
|
|
4060
|
+
mediaStyle[subKey],
|
|
4061
|
+
usedKeys,
|
|
4062
|
+
mediaState2[mediaKeyShort],
|
|
4063
|
+
importanceBump
|
|
4064
|
+
), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
4065
|
+
}
|
|
4070
4066
|
}
|
|
4071
|
-
|
|
4067
|
+
continue;
|
|
4072
4068
|
}
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4069
|
+
if (key === "pointerEvents") {
|
|
4070
|
+
viewProps[key] = val;
|
|
4071
|
+
continue;
|
|
4072
|
+
}
|
|
4073
|
+
if (
|
|
4074
|
+
// is HOC we can just pass through the styles as props
|
|
4075
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
4076
|
+
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
|
|
4077
|
+
) {
|
|
4078
|
+
mergeStyle(styleState, key, val);
|
|
4079
|
+
continue;
|
|
4076
4080
|
}
|
|
4081
|
+
isVariant || (viewProps[key] = val);
|
|
4082
|
+
}
|
|
4077
4083
|
}
|
|
4084
|
+
if (0)
|
|
4085
|
+
try {
|
|
4086
|
+
} catch {
|
|
4087
|
+
}
|
|
4078
4088
|
}
|
|
4079
4089
|
if (props.style)
|
|
4080
4090
|
if (isHOC)
|
|
@@ -4860,6 +4870,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4860
4870
|
if (0 && import_constants.isWeb)
|
|
4861
4871
|
try {
|
|
4862
4872
|
} catch {
|
|
4873
|
+
} finally {
|
|
4863
4874
|
}
|
|
4864
4875
|
return content;
|
|
4865
4876
|
});
|