tamagui 1.89.3 → 1.89.4
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/test.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
|
}
|
|
@@ -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, _e, _f, _g;
|
|
3754
|
+
var _a, _b, _c, _e, _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,
|
|
@@ -4053,7 +4053,10 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
4053
4053
|
overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
|
|
4054
4054
|
}
|
|
4055
4055
|
}
|
|
4056
|
-
|
|
4056
|
+
let fontFamily = isText || isInput ? styleState.fontFamily || ((_h = staticConfig.defaultProps) == null ? void 0 : _h.fontFamily) : null;
|
|
4057
|
+
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4058
|
+
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", asChild = props.asChild;
|
|
4059
|
+
if (asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style), !1)
|
|
4057
4060
|
try {
|
|
4058
4061
|
} catch {
|
|
4059
4062
|
}
|
|
@@ -4485,7 +4488,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4485
4488
|
// disableClassName="until-hydrated" to be more straightforward
|
|
4486
4489
|
// see issue if not, Button sets disableClassName to true <Button animation="" /> with
|
|
4487
4490
|
// the react-native driver errors because it tries to animate var(--color) to rbga(..)
|
|
4488
|
-
propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group
|
|
4491
|
+
propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group;
|
|
4489
4492
|
if (groupName && !curState.group) {
|
|
4490
4493
|
let listeners = /* @__PURE__ */ new Set();
|
|
4491
4494
|
curState.group = {
|
|
@@ -4513,7 +4516,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4513
4516
|
groupContextState[groupName] = next;
|
|
4514
4517
|
};
|
|
4515
4518
|
}
|
|
4516
|
-
let
|
|
4519
|
+
let hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled), element = import_constants4.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
4517
4520
|
animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
|
|
4518
4521
|
let disableTheme = isHOC;
|
|
4519
4522
|
props.themeShallow && (curState.themeShallow = !0);
|
|
@@ -4563,26 +4566,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4563
4566
|
style: splitStylesStyle,
|
|
4564
4567
|
classNames,
|
|
4565
4568
|
space
|
|
4566
|
-
} = splitStyles, propsWithAnimation = props,
|
|
4567
|
-
if (
|
|
4568
|
-
// if it supports css vars we run it on server too to get matching initial style
|
|
4569
|
-
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
4570
|
-
) {
|
|
4571
|
-
let animations = useAnimations({
|
|
4572
|
-
props: propsWithAnimation,
|
|
4573
|
-
// if hydrating, send empty style
|
|
4574
|
-
style: splitStylesStyle,
|
|
4575
|
-
presence,
|
|
4576
|
-
componentState: state,
|
|
4577
|
-
styleProps,
|
|
4578
|
-
theme: (_g = themeState.state) == null ? void 0 : _g.theme,
|
|
4579
|
-
pseudos: pseudos || null,
|
|
4580
|
-
staticConfig,
|
|
4581
|
-
stateRef
|
|
4582
|
-
});
|
|
4583
|
-
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style);
|
|
4584
|
-
}
|
|
4585
|
-
let {
|
|
4569
|
+
} = splitStyles, propsWithAnimation = props, {
|
|
4586
4570
|
asChild,
|
|
4587
4571
|
children,
|
|
4588
4572
|
themeShallow,
|
|
@@ -4609,9 +4593,30 @@ var require_createComponent_native = __commonJS({
|
|
|
4609
4593
|
// @ts-ignore
|
|
4610
4594
|
defaultVariants,
|
|
4611
4595
|
...nonTamaguiProps
|
|
4612
|
-
} = viewPropsIn,
|
|
4613
|
-
props.
|
|
4614
|
-
|
|
4596
|
+
} = viewPropsIn, viewProps = nonTamaguiProps;
|
|
4597
|
+
hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp);
|
|
4598
|
+
let animationStyles;
|
|
4599
|
+
if (
|
|
4600
|
+
// if it supports css vars we run it on server too to get matching initial style
|
|
4601
|
+
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
4602
|
+
) {
|
|
4603
|
+
let animations = useAnimations({
|
|
4604
|
+
props: propsWithAnimation,
|
|
4605
|
+
// if hydrating, send empty style
|
|
4606
|
+
style: splitStylesStyle,
|
|
4607
|
+
presence,
|
|
4608
|
+
componentState: state,
|
|
4609
|
+
styleProps,
|
|
4610
|
+
theme: (_g = themeState.state) == null ? void 0 : _g.theme,
|
|
4611
|
+
pseudos: pseudos || null,
|
|
4612
|
+
staticConfig,
|
|
4613
|
+
stateRef
|
|
4614
|
+
});
|
|
4615
|
+
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles);
|
|
4616
|
+
}
|
|
4617
|
+
let disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
|
|
4618
|
+
props.accessibilityDisabled;
|
|
4619
|
+
groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
4615
4620
|
nonTamaguiProps.onLayout,
|
|
4616
4621
|
(e) => {
|
|
4617
4622
|
stateRef.current.group.emit(groupName, {
|
|
@@ -4670,10 +4675,6 @@ var require_createComponent_native = __commonJS({
|
|
|
4670
4675
|
pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
|
|
4671
4676
|
mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
|
|
4672
4677
|
]);
|
|
4673
|
-
let fontFamily = isText || isInput ? splitStyles.fontFamily || ((_k = staticConfig.defaultProps) == null ? void 0 : _k.fontFamily) : null;
|
|
4674
|
-
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
4675
|
-
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
|
|
4676
|
-
asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
|
|
4677
4678
|
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), events = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle) && !isDisabled && !props.asChild ? {
|
|
4678
4679
|
onPressOut: attachPress ? (e) => {
|
|
4679
4680
|
unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
@@ -4724,7 +4725,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4724
4725
|
delayPressOut: viewProps.delayPressOut,
|
|
4725
4726
|
focusable: viewProps.focusable ?? !0,
|
|
4726
4727
|
minPressDuration: 0
|
|
4727
|
-
}), (
|
|
4728
|
+
}), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
|
|
4728
4729
|
let direction = props.spaceDirection || "both", content = !children || asChild ? children : spacedChildren2({
|
|
4729
4730
|
separator,
|
|
4730
4731
|
children,
|
|
@@ -4742,7 +4743,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4742
4743
|
events,
|
|
4743
4744
|
staticConfig
|
|
4744
4745
|
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react2.createElement)(elementType, viewProps, content);
|
|
4745
|
-
let ResetPresence = (
|
|
4746
|
+
let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
|
|
4746
4747
|
ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content }));
|
|
4747
4748
|
let groupState = curState.group, subGroupContext = (0, import_react2.useMemo)(() => {
|
|
4748
4749
|
if (!(!groupState || !groupName))
|
|
@@ -4768,7 +4769,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4768
4769
|
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), staticConfig.context) {
|
|
4769
4770
|
let contextProps = staticConfig.context.props;
|
|
4770
4771
|
for (let key in contextProps)
|
|
4771
|
-
(key in style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = style[key] ?? viewProps[key]);
|
|
4772
|
+
(viewProps.style && key in viewProps.style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = ((_n = viewProps.style) == null ? void 0 : _n[key]) ?? viewProps[key]);
|
|
4772
4773
|
}
|
|
4773
4774
|
if (overriddenContextProps) {
|
|
4774
4775
|
let Provider = staticConfig.context.Provider;
|