tamagui 1.89.3 → 1.89.5
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 +41 -41
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +42 -41
- package/dist/test.native.js.map +3 -3
- package/package.json +54 -54
package/dist/native.js
CHANGED
|
@@ -619,9 +619,9 @@ var require_index_native6 = __commonJS({
|
|
|
619
619
|
}
|
|
620
620
|
});
|
|
621
621
|
|
|
622
|
-
// ../helpers/dist/cjs/native.js
|
|
623
|
-
var
|
|
624
|
-
"../helpers/dist/cjs/native.js"(exports2, module2) {
|
|
622
|
+
// ../helpers/dist/cjs/shouldRenderNativePlatform.native.js
|
|
623
|
+
var require_shouldRenderNativePlatform_native = __commonJS({
|
|
624
|
+
"../helpers/dist/cjs/shouldRenderNativePlatform.native.js"(exports2, module2) {
|
|
625
625
|
"use strict";
|
|
626
626
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
627
627
|
for (var name in all)
|
|
@@ -631,11 +631,11 @@ var require_native = __commonJS({
|
|
|
631
631
|
for (let key of __getOwnPropNames2(from))
|
|
632
632
|
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
633
633
|
return to;
|
|
634
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod),
|
|
635
|
-
__export2(
|
|
634
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), shouldRenderNativePlatform_exports = {};
|
|
635
|
+
__export2(shouldRenderNativePlatform_exports, {
|
|
636
636
|
shouldRenderNativePlatform: () => shouldRenderNativePlatform
|
|
637
637
|
});
|
|
638
|
-
module2.exports = __toCommonJS2(
|
|
638
|
+
module2.exports = __toCommonJS2(shouldRenderNativePlatform_exports);
|
|
639
639
|
var import_constants4 = require_index_native6(), ALL_PLATFORMS = ["web", "android", "ios"];
|
|
640
640
|
function shouldRenderNativePlatform(nativeProp) {
|
|
641
641
|
if (!nativeProp)
|
|
@@ -935,7 +935,7 @@ var require_index_native7 = __commonJS({
|
|
|
935
935
|
__reExport2(src_exports2, require_composeEventHandlers_native(), module2.exports);
|
|
936
936
|
__reExport2(src_exports2, require_concatClassName_native(), module2.exports);
|
|
937
937
|
__reExport2(src_exports2, require_types_native2(), module2.exports);
|
|
938
|
-
__reExport2(src_exports2,
|
|
938
|
+
__reExport2(src_exports2, require_shouldRenderNativePlatform_native(), module2.exports);
|
|
939
939
|
__reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
|
|
940
940
|
__reExport2(src_exports2, require_withStaticProperties_native(), module2.exports);
|
|
941
941
|
}
|
|
@@ -3909,7 +3909,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3909
3909
|
return (staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles))[key] || ((_a = staticConfig.acceptTokens) == null ? void 0 : _a[key]);
|
|
3910
3910
|
}
|
|
3911
3911
|
var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3912
|
-
var _a, _b, _c, _e, _f, _g;
|
|
3912
|
+
var _a, _b, _c, _e, _f, _g, _h;
|
|
3913
3913
|
conf = conf || (0, import_config.getConfig)(), import_constants4.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3914
3914
|
let { shorthands } = conf, {
|
|
3915
3915
|
isHOC,
|
|
@@ -4273,7 +4273,10 @@ current`, {
|
|
|
4273
4273
|
}
|
|
4274
4274
|
process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
|
|
4275
4275
|
}
|
|
4276
|
-
|
|
4276
|
+
let fontFamily = isText || isInput ? styleState.fontFamily || ((_h = staticConfig.defaultProps) == null ? void 0 : _h.fontFamily) : null;
|
|
4277
|
+
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4278
|
+
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", asChild = props.asChild;
|
|
4279
|
+
if (asChild === "except-style" || asChild === "except-style-web" || styleProps.noExpand || (viewProps.style = style), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
|
|
4277
4280
|
console.groupCollapsed("\u{1F539} getSplitStyles ===>");
|
|
4278
4281
|
try {
|
|
4279
4282
|
let logs = {
|
|
@@ -4765,7 +4768,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4765
4768
|
// disableClassName="until-hydrated" to be more straightforward
|
|
4766
4769
|
// see issue if not, Button sets disableClassName to true <Button animation="" /> with
|
|
4767
4770
|
// the react-native driver errors because it tries to animate var(--color) to rbga(..)
|
|
4768
|
-
propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group
|
|
4771
|
+
propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group;
|
|
4769
4772
|
if (groupName && !curState.group) {
|
|
4770
4773
|
let listeners = /* @__PURE__ */ new Set();
|
|
4771
4774
|
curState.group = {
|
|
@@ -4794,7 +4797,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4794
4797
|
};
|
|
4795
4798
|
}
|
|
4796
4799
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
4797
|
-
let
|
|
4800
|
+
let hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled);
|
|
4798
4801
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
4799
4802
|
let element = import_constants4.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
4800
4803
|
animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
|
|
@@ -4861,26 +4864,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4861
4864
|
style: splitStylesStyle,
|
|
4862
4865
|
classNames,
|
|
4863
4866
|
space
|
|
4864
|
-
} = splitStyles, propsWithAnimation = props,
|
|
4865
|
-
if (
|
|
4866
|
-
// if it supports css vars we run it on server too to get matching initial style
|
|
4867
|
-
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
4868
|
-
) {
|
|
4869
|
-
let animations = useAnimations({
|
|
4870
|
-
props: propsWithAnimation,
|
|
4871
|
-
// if hydrating, send empty style
|
|
4872
|
-
style: splitStylesStyle,
|
|
4873
|
-
presence,
|
|
4874
|
-
componentState: state,
|
|
4875
|
-
styleProps,
|
|
4876
|
-
theme: (_g = themeState.state) == null ? void 0 : _g.theme,
|
|
4877
|
-
pseudos: pseudos || null,
|
|
4878
|
-
staticConfig,
|
|
4879
|
-
stateRef
|
|
4880
|
-
});
|
|
4881
|
-
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
4882
|
-
}
|
|
4883
|
-
let {
|
|
4867
|
+
} = splitStyles, propsWithAnimation = props, {
|
|
4884
4868
|
asChild,
|
|
4885
4869
|
children,
|
|
4886
4870
|
themeShallow,
|
|
@@ -4907,15 +4891,35 @@ var require_createComponent_native = __commonJS({
|
|
|
4907
4891
|
// @ts-ignore
|
|
4908
4892
|
defaultVariants,
|
|
4909
4893
|
...nonTamaguiProps
|
|
4910
|
-
} = viewPropsIn;
|
|
4894
|
+
} = viewPropsIn, viewProps = nonTamaguiProps;
|
|
4895
|
+
hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp);
|
|
4896
|
+
let animationStyles;
|
|
4897
|
+
if (
|
|
4898
|
+
// if it supports css vars we run it on server too to get matching initial style
|
|
4899
|
+
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
4900
|
+
) {
|
|
4901
|
+
let animations = useAnimations({
|
|
4902
|
+
props: propsWithAnimation,
|
|
4903
|
+
// if hydrating, send empty style
|
|
4904
|
+
style: splitStylesStyle,
|
|
4905
|
+
presence,
|
|
4906
|
+
componentState: state,
|
|
4907
|
+
styleProps,
|
|
4908
|
+
theme: (_g = themeState.state) == null ? void 0 : _g.theme,
|
|
4909
|
+
pseudos: pseudos || null,
|
|
4910
|
+
staticConfig,
|
|
4911
|
+
stateRef
|
|
4912
|
+
});
|
|
4913
|
+
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
4914
|
+
}
|
|
4911
4915
|
process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(
|
|
4912
4916
|
`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
|
|
4913
4917
|
|
|
4914
4918
|
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`
|
|
4915
4919
|
), process.env.NODE_ENV === "development" && time && time`destructure`;
|
|
4916
4920
|
let disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
|
|
4917
|
-
props.accessibilityDisabled
|
|
4918
|
-
|
|
4921
|
+
props.accessibilityDisabled;
|
|
4922
|
+
groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
4919
4923
|
nonTamaguiProps.onLayout,
|
|
4920
4924
|
(e) => {
|
|
4921
4925
|
stateRef.current.group.emit(groupName, {
|
|
@@ -4979,10 +4983,6 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4979
4983
|
pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
|
|
4980
4984
|
mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
|
|
4981
4985
|
]);
|
|
4982
|
-
let fontFamily = isText || isInput ? splitStyles.fontFamily || ((_k = staticConfig.defaultProps) == null ? void 0 : _k.fontFamily) : null;
|
|
4983
|
-
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4984
|
-
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
|
|
4985
|
-
asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
|
|
4986
4986
|
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants4.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
|
|
4987
4987
|
process.env.NODE_ENV === "development" && time && time`events-setup`;
|
|
4988
4988
|
let events = shouldAttach && !isDisabled && !props.asChild ? {
|
|
@@ -5035,7 +5035,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5035
5035
|
delayPressOut: viewProps.delayPressOut,
|
|
5036
5036
|
focusable: viewProps.focusable ?? !0,
|
|
5037
5037
|
minPressDuration: 0
|
|
5038
|
-
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (
|
|
5038
|
+
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
|
|
5039
5039
|
let direction = props.spaceDirection || "both";
|
|
5040
5040
|
process.env.NODE_ENV === "development" && time && time`hooks`;
|
|
5041
5041
|
let content = !children || asChild ? children : spacedChildren2({
|
|
@@ -5055,7 +5055,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5055
5055
|
events,
|
|
5056
5056
|
staticConfig
|
|
5057
5057
|
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react2.createElement)(elementType, viewProps, content);
|
|
5058
|
-
let ResetPresence = (
|
|
5058
|
+
let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
|
|
5059
5059
|
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content })), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
5060
5060
|
let groupState = curState.group, subGroupContext = (0, import_react2.useMemo)(() => {
|
|
5061
5061
|
if (!(!groupState || !groupName))
|
|
@@ -5081,7 +5081,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5081
5081
|
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
|
|
5082
5082
|
let contextProps = staticConfig.context.props;
|
|
5083
5083
|
for (let key in contextProps)
|
|
5084
|
-
(key in style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
5084
|
+
(viewProps.style && key in viewProps.style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = ((_n = viewProps.style) == null ? void 0 : _n[key]) ?? viewProps[key]);
|
|
5085
5085
|
}
|
|
5086
5086
|
if (overriddenContextProps) {
|
|
5087
5087
|
let Provider = staticConfig.context.Provider;
|