@tamagui/core 2.2.0-1781071309197 → 2.2.0-1781132308330
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/.turbo/turbo-build.log +2 -2
- package/dist/native.cjs +53 -11
- package/dist/test.native.cjs +49 -11
- package/package.json +10 -10
package/.turbo/turbo-build.log
CHANGED
package/dist/native.cjs
CHANGED
|
@@ -11794,9 +11794,22 @@ var init_constants_native$1 = __esmMin((() => {
|
|
|
11794
11794
|
}[Platform.OS] : void 0) || "native";
|
|
11795
11795
|
}));
|
|
11796
11796
|
//#endregion
|
|
11797
|
+
//#region ../constants/dist/esm/platformDriver.native.js
|
|
11798
|
+
function setupPlatformDriver(driver) {
|
|
11799
|
+
platformDriver = driver;
|
|
11800
|
+
}
|
|
11801
|
+
function getPlatformDriver() {
|
|
11802
|
+
return platformDriver;
|
|
11803
|
+
}
|
|
11804
|
+
var platformDriver;
|
|
11805
|
+
var init_platformDriver_native = __esmMin((() => {
|
|
11806
|
+
platformDriver = null;
|
|
11807
|
+
}));
|
|
11808
|
+
//#endregion
|
|
11797
11809
|
//#region ../constants/dist/esm/index.native.js
|
|
11798
11810
|
var init_index_native$7 = __esmMin((() => {
|
|
11799
11811
|
init_constants_native$1();
|
|
11812
|
+
init_platformDriver_native();
|
|
11800
11813
|
}));
|
|
11801
11814
|
//#endregion
|
|
11802
11815
|
//#region ../web/dist/esm/constants/constants.native.js
|
|
@@ -13666,10 +13679,17 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
13666
13679
|
ref.current.pressOutTimer = null;
|
|
13667
13680
|
ref.current.longPressTimer = null;
|
|
13668
13681
|
}
|
|
13669
|
-
viewProps.onStartShouldSetResponder
|
|
13670
|
-
|
|
13682
|
+
var userStartShouldSet = viewProps.onStartShouldSetResponder;
|
|
13683
|
+
var userGrant = viewProps.onResponderGrant;
|
|
13684
|
+
var userRelease = viewProps.onResponderRelease;
|
|
13685
|
+
var userTerminate = viewProps.onResponderTerminate;
|
|
13686
|
+
var userTerminationRequest = viewProps.onResponderTerminationRequest;
|
|
13687
|
+
var userMove = viewProps.onResponderMove;
|
|
13688
|
+
viewProps.onStartShouldSetResponder = function(e) {
|
|
13689
|
+
return Boolean(userStartShouldSet === null || userStartShouldSet === void 0 ? void 0 : userStartShouldSet(e)) || !events.disabled;
|
|
13671
13690
|
};
|
|
13672
13691
|
viewProps.onResponderGrant = function(e) {
|
|
13692
|
+
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
13673
13693
|
cleanup();
|
|
13674
13694
|
ref.current.state = "pressing";
|
|
13675
13695
|
if (delayPressIn > 0) ref.current.pressInTimer = setTimeout(function() {
|
|
@@ -13685,6 +13705,7 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
13685
13705
|
}, delayLongPress + delayPressIn);
|
|
13686
13706
|
};
|
|
13687
13707
|
viewProps.onResponderRelease = function(e) {
|
|
13708
|
+
userRelease === null || userRelease === void 0 || userRelease(e);
|
|
13688
13709
|
var wasLongPressed = ref.current.state === "longPressed";
|
|
13689
13710
|
cleanup();
|
|
13690
13711
|
if (ref.current.state === "pressing") activate(e);
|
|
@@ -13696,15 +13717,18 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
13696
13717
|
ref.current.state = "idle";
|
|
13697
13718
|
};
|
|
13698
13719
|
viewProps.onResponderTerminate = function(e) {
|
|
13720
|
+
userTerminate === null || userTerminate === void 0 || userTerminate(e);
|
|
13699
13721
|
cleanup();
|
|
13700
13722
|
if (ref.current.state === "active" || ref.current.state === "longPressed") deactivate(e);
|
|
13701
13723
|
ref.current.state = "idle";
|
|
13702
13724
|
};
|
|
13703
|
-
viewProps.onResponderTerminationRequest = function() {
|
|
13725
|
+
viewProps.onResponderTerminationRequest = function(e) {
|
|
13726
|
+
if (userTerminationRequest) return userTerminationRequest(e);
|
|
13704
13727
|
return events.cancelable !== false;
|
|
13705
13728
|
};
|
|
13706
13729
|
viewProps.onResponderMove = function(e) {
|
|
13707
13730
|
var _events_onPressMove;
|
|
13731
|
+
userMove === null || userMove === void 0 || userMove(e);
|
|
13708
13732
|
(_events_onPressMove = events.onPressMove) === null || _events_onPressMove === void 0 || _events_onPressMove.call(events, e);
|
|
13709
13733
|
};
|
|
13710
13734
|
}
|
|
@@ -16230,7 +16254,7 @@ var init_useComponentState_native = __esmMin((() => {
|
|
|
16230
16254
|
init_objectSpread2();
|
|
16231
16255
|
useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
16232
16256
|
"use no memo";
|
|
16233
|
-
var _animationDriver_usePresence;
|
|
16257
|
+
var _getPlatformDriver, _animationDriver_usePresence;
|
|
16234
16258
|
var isHydrated = useDidFinishSSR();
|
|
16235
16259
|
var needsHydration = !useIsClientOnly();
|
|
16236
16260
|
var useAnimations = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? void 0 : animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.useAnimations;
|
|
@@ -16244,8 +16268,9 @@ var init_useComponentState_native = __esmMin((() => {
|
|
|
16244
16268
|
var outputStyle = (_animationDriver_outputStyle = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.outputStyle) !== null && _animationDriver_outputStyle !== void 0 ? _animationDriver_outputStyle : "css";
|
|
16245
16269
|
var curStateRef = stateRef.current;
|
|
16246
16270
|
if (!needsHydration && hasAnimationProp) curStateRef.hasAnimated = true;
|
|
16271
|
+
var platformPseudo = Boolean(!isHOC && useAnimations && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && ((_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo) && ("hoverStyle" in props || "pressStyle" in props || "focusStyle" in props));
|
|
16247
16272
|
var willBeAnimatedClient = function() {
|
|
16248
|
-
return Boolean(!!(hasAnimationProp && !isHOC && useAnimations) || curStateRef.hasAnimated);
|
|
16273
|
+
return Boolean(!!((hasAnimationProp || platformPseudo) && !isHOC && useAnimations) || curStateRef.hasAnimated);
|
|
16249
16274
|
}();
|
|
16250
16275
|
var willBeAnimated = willBeAnimatedClient;
|
|
16251
16276
|
if (willBeAnimated && !curStateRef.hasAnimated) curStateRef.hasAnimated = true;
|
|
@@ -16302,7 +16327,8 @@ var init_useComponentState_native = __esmMin((() => {
|
|
|
16302
16327
|
inputStyle,
|
|
16303
16328
|
outputStyle,
|
|
16304
16329
|
willBeAnimated,
|
|
16305
|
-
willBeAnimatedClient
|
|
16330
|
+
willBeAnimatedClient,
|
|
16331
|
+
platformPseudo
|
|
16306
16332
|
};
|
|
16307
16333
|
};
|
|
16308
16334
|
isDisabled = function(props) {
|
|
@@ -16410,13 +16436,25 @@ function createComponent(staticConfig) {
|
|
|
16410
16436
|
}();
|
|
16411
16437
|
var useAnimations = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.useAnimations;
|
|
16412
16438
|
var componentState = useComponentState(props, (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig, config);
|
|
16413
|
-
var { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, inputStyle, outputStyle, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState;
|
|
16439
|
+
var { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, inputStyle, outputStyle, willBeAnimated, willBeAnimatedClient, platformPseudo, startedUnhydrated } = componentState;
|
|
16414
16440
|
if (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) useIsomorphicLayoutEffect(function() {
|
|
16415
16441
|
var pendingState = stateRef.current.nextState;
|
|
16416
16442
|
if (!pendingState) return;
|
|
16417
16443
|
stateRef.current.nextState = void 0;
|
|
16418
16444
|
if (!isEqualShallow(state, pendingState)) componentState.setStateShallow(pendingState);
|
|
16419
16445
|
});
|
|
16446
|
+
useIsomorphicLayoutEffect(function() {
|
|
16447
|
+
var _getPlatformDriver;
|
|
16448
|
+
if (!platformPseudo || props.disabled) return;
|
|
16449
|
+
var pseudoDriver = (_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo;
|
|
16450
|
+
var host = stateRef.current.host;
|
|
16451
|
+
if (!pseudoDriver || !host) return;
|
|
16452
|
+
return pseudoDriver.subscribe(host, function(param) {
|
|
16453
|
+
var { hovered } = param;
|
|
16454
|
+
var _stateRef_current_setStateShallow, _stateRef_current;
|
|
16455
|
+
(_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, { hover: hovered });
|
|
16456
|
+
});
|
|
16457
|
+
}, [platformPseudo, props.disabled]);
|
|
16420
16458
|
var allGroupContexts = (0, react.useMemo)(function() {
|
|
16421
16459
|
var _stateRef_current_group_listeners, _stateRef_current_group;
|
|
16422
16460
|
if (!groupName || props.passThrough) return groupContextParent;
|
|
@@ -16512,7 +16550,7 @@ function createComponent(staticConfig) {
|
|
|
16512
16550
|
}
|
|
16513
16551
|
}
|
|
16514
16552
|
var hasEnterExitTransition = props.transition && _type_of$1(props.transition) === "object" && !Array.isArray(props.transition) && ("enter" in props.transition || "exit" in props.transition);
|
|
16515
|
-
if (!isPassthrough && (hasAnimationProp || groupName) && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && !hasEnterExitTransition) {
|
|
16553
|
+
if (!isPassthrough && (hasAnimationProp || groupName || platformPseudo) && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && !hasEnterExitTransition) {
|
|
16516
16554
|
let updateGroupListeners2 = function() {
|
|
16517
16555
|
var updatedState = stateRef.current.nextState;
|
|
16518
16556
|
if (groupContext) {
|
|
@@ -16531,7 +16569,8 @@ function createComponent(staticConfig) {
|
|
|
16531
16569
|
var updatedState = stateRef.current.nextState || state;
|
|
16532
16570
|
var mediaState2 = stateRef.current.nextMedia;
|
|
16533
16571
|
var nextStyles = getSplitStyles(props, staticConfig, theme, themeName, updatedState, mediaState2 ? _objectSpread2(_objectSpread2({}, styleProps), {}, { mediaState: mediaState2 }) : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp, animationDriver);
|
|
16534
|
-
var
|
|
16572
|
+
var _props_transition2;
|
|
16573
|
+
var effectiveTransition2 = resolveEffectivePseudoTransition(stateRef.current.prevPseudoState, updatedState, nextStyles === null || nextStyles === void 0 ? void 0 : nextStyles.pseudoTransitions, (_props_transition2 = props.transition) !== null && _props_transition2 !== void 0 ? _props_transition2 : platformPseudo ? "0ms" : void 0);
|
|
16535
16574
|
stateRef.current.prevPseudoState = extractPseudoState(updatedState);
|
|
16536
16575
|
var hasActivePseudo = Boolean(updatedState.hover || updatedState.press || updatedState.pressIn || updatedState.focus || updatedState.focusWithin);
|
|
16537
16576
|
useStyleListener((nextStyles === null || nextStyles === void 0 ? void 0 : nextStyles.style) || {}, effectiveTransition2, hasActivePseudo);
|
|
@@ -16612,7 +16651,8 @@ function createComponent(staticConfig) {
|
|
|
16612
16651
|
var useStyleEmitter = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) ? function(listener) {
|
|
16613
16652
|
stateRef.current.useStyleListener = listener;
|
|
16614
16653
|
} : void 0;
|
|
16615
|
-
var
|
|
16654
|
+
var _props_transition;
|
|
16655
|
+
var effectiveTransition = resolveEffectivePseudoTransition(stateRef.current.prevPseudoState, state, splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.pseudoTransitions, (_props_transition = props.transition) !== null && _props_transition !== void 0 ? _props_transition : platformPseudo ? "0ms" : void 0);
|
|
16616
16656
|
if (splitStyles) splitStyles.effectiveTransition = effectiveTransition;
|
|
16617
16657
|
stateRef.current.prevPseudoState = extractPseudoState(state);
|
|
16618
16658
|
var animations = useAnimations({
|
|
@@ -16719,7 +16759,7 @@ function createComponent(staticConfig) {
|
|
|
16719
16759
|
var hasDynamicGroupChildren = Boolean(groupName && state.hasDynGroupChildren);
|
|
16720
16760
|
var attachPress = Boolean(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || (pseudos === null || pseudos === void 0 ? void 0 : pseudos.focusVisibleStyle));
|
|
16721
16761
|
var runtimeHoverStyle = !disabled && noClass && (pseudos === null || pseudos === void 0 ? void 0 : pseudos.hoverStyle);
|
|
16722
|
-
var needsHoverState = Boolean(hasDynamicGroupChildren || runtimeHoverStyle);
|
|
16762
|
+
var needsHoverState = Boolean(hasDynamicGroupChildren || runtimeHoverStyle && !platformPseudo);
|
|
16723
16763
|
var attachHover = isNativeDesktop && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave);
|
|
16724
16764
|
var shouldAttach = !disabled && !props.asChild && Boolean(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
|
|
16725
16765
|
var needsPressState = Boolean(hasDynamicGroupChildren || runtimePressStyle);
|
|
@@ -18852,6 +18892,7 @@ exports.getExpandedShorthands = getExpandedShorthands;
|
|
|
18852
18892
|
exports.getFontFamilyFromNameOrVariable = getFontFamilyFromNameOrVariable;
|
|
18853
18893
|
exports.getFontsForLanguage = getFontsForLanguage;
|
|
18854
18894
|
exports.getMedia = getMedia;
|
|
18895
|
+
exports.getPlatformDriver = getPlatformDriver;
|
|
18855
18896
|
exports.getReactNativeConfig = getReactNativeConfig;
|
|
18856
18897
|
exports.getRgba = getRgba;
|
|
18857
18898
|
exports.getSetting = getSetting;
|
|
@@ -18938,6 +18979,7 @@ exports.setRef = setRef;
|
|
|
18938
18979
|
exports.setupDev = setupDev;
|
|
18939
18980
|
exports.setupHooks = setupHooks;
|
|
18940
18981
|
exports.setupMatchMedia = setupMatchMedia;
|
|
18982
|
+
exports.setupPlatformDriver = setupPlatformDriver;
|
|
18941
18983
|
exports.shouldRenderNativePlatform = shouldRenderNativePlatform;
|
|
18942
18984
|
exports.simpleHash = simpleHash;
|
|
18943
18985
|
exports.styleOriginalValues = styleOriginalValues;
|
package/dist/test.native.cjs
CHANGED
|
@@ -346,6 +346,15 @@ var currentPlatform = ((react_native.Platform === null || react_native.Platform
|
|
|
346
346
|
windows: "windows"
|
|
347
347
|
}[react_native.Platform.OS] : void 0) || "native";
|
|
348
348
|
//#endregion
|
|
349
|
+
//#region ../constants/dist/esm/platformDriver.native.js
|
|
350
|
+
var platformDriver = null;
|
|
351
|
+
function setupPlatformDriver(driver) {
|
|
352
|
+
platformDriver = driver;
|
|
353
|
+
}
|
|
354
|
+
function getPlatformDriver() {
|
|
355
|
+
return platformDriver;
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
349
358
|
//#region ../web/dist/esm/constants/constants.native.js
|
|
350
359
|
var THEME_NAME_SEPARATOR = "_";
|
|
351
360
|
var THEME_CLASSNAME_PREFIX = "t_";
|
|
@@ -2083,10 +2092,17 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
2083
2092
|
ref.current.pressOutTimer = null;
|
|
2084
2093
|
ref.current.longPressTimer = null;
|
|
2085
2094
|
}
|
|
2086
|
-
viewProps.onStartShouldSetResponder
|
|
2087
|
-
|
|
2095
|
+
var userStartShouldSet = viewProps.onStartShouldSetResponder;
|
|
2096
|
+
var userGrant = viewProps.onResponderGrant;
|
|
2097
|
+
var userRelease = viewProps.onResponderRelease;
|
|
2098
|
+
var userTerminate = viewProps.onResponderTerminate;
|
|
2099
|
+
var userTerminationRequest = viewProps.onResponderTerminationRequest;
|
|
2100
|
+
var userMove = viewProps.onResponderMove;
|
|
2101
|
+
viewProps.onStartShouldSetResponder = function(e) {
|
|
2102
|
+
return Boolean(userStartShouldSet === null || userStartShouldSet === void 0 ? void 0 : userStartShouldSet(e)) || !events.disabled;
|
|
2088
2103
|
};
|
|
2089
2104
|
viewProps.onResponderGrant = function(e) {
|
|
2105
|
+
userGrant === null || userGrant === void 0 || userGrant(e);
|
|
2090
2106
|
cleanup();
|
|
2091
2107
|
ref.current.state = "pressing";
|
|
2092
2108
|
if (delayPressIn > 0) ref.current.pressInTimer = setTimeout(function() {
|
|
@@ -2102,6 +2118,7 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
2102
2118
|
}, delayLongPress + delayPressIn);
|
|
2103
2119
|
};
|
|
2104
2120
|
viewProps.onResponderRelease = function(e) {
|
|
2121
|
+
userRelease === null || userRelease === void 0 || userRelease(e);
|
|
2105
2122
|
var wasLongPressed = ref.current.state === "longPressed";
|
|
2106
2123
|
cleanup();
|
|
2107
2124
|
if (ref.current.state === "pressing") activate(e);
|
|
@@ -2113,15 +2130,18 @@ function useMainThreadPressEvents(events, viewProps) {
|
|
|
2113
2130
|
ref.current.state = "idle";
|
|
2114
2131
|
};
|
|
2115
2132
|
viewProps.onResponderTerminate = function(e) {
|
|
2133
|
+
userTerminate === null || userTerminate === void 0 || userTerminate(e);
|
|
2116
2134
|
cleanup();
|
|
2117
2135
|
if (ref.current.state === "active" || ref.current.state === "longPressed") deactivate(e);
|
|
2118
2136
|
ref.current.state = "idle";
|
|
2119
2137
|
};
|
|
2120
|
-
viewProps.onResponderTerminationRequest = function() {
|
|
2138
|
+
viewProps.onResponderTerminationRequest = function(e) {
|
|
2139
|
+
if (userTerminationRequest) return userTerminationRequest(e);
|
|
2121
2140
|
return events.cancelable !== false;
|
|
2122
2141
|
};
|
|
2123
2142
|
viewProps.onResponderMove = function(e) {
|
|
2124
2143
|
var _events_onPressMove;
|
|
2144
|
+
userMove === null || userMove === void 0 || userMove(e);
|
|
2125
2145
|
(_events_onPressMove = events.onPressMove) === null || _events_onPressMove === void 0 || _events_onPressMove.call(events, e);
|
|
2126
2146
|
};
|
|
2127
2147
|
}
|
|
@@ -4701,7 +4721,7 @@ function _type_of$2(obj) {
|
|
|
4701
4721
|
}
|
|
4702
4722
|
var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
4703
4723
|
"use no memo";
|
|
4704
|
-
var _animationDriver_usePresence;
|
|
4724
|
+
var _getPlatformDriver, _animationDriver_usePresence;
|
|
4705
4725
|
var isHydrated = useDidFinishSSR();
|
|
4706
4726
|
var needsHydration = !useIsClientOnly();
|
|
4707
4727
|
var useAnimations = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? void 0 : animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.useAnimations;
|
|
@@ -4715,8 +4735,9 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
4715
4735
|
var outputStyle = (_animationDriver_outputStyle = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.outputStyle) !== null && _animationDriver_outputStyle !== void 0 ? _animationDriver_outputStyle : "css";
|
|
4716
4736
|
var curStateRef = stateRef.current;
|
|
4717
4737
|
if (!needsHydration && hasAnimationProp) curStateRef.hasAnimated = true;
|
|
4738
|
+
var platformPseudo = Boolean(!isHOC && useAnimations && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && ((_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo) && ("hoverStyle" in props || "pressStyle" in props || "focusStyle" in props));
|
|
4718
4739
|
var willBeAnimatedClient = function() {
|
|
4719
|
-
return Boolean(!!(hasAnimationProp && !isHOC && useAnimations) || curStateRef.hasAnimated);
|
|
4740
|
+
return Boolean(!!((hasAnimationProp || platformPseudo) && !isHOC && useAnimations) || curStateRef.hasAnimated);
|
|
4720
4741
|
}();
|
|
4721
4742
|
var willBeAnimated = willBeAnimatedClient;
|
|
4722
4743
|
if (willBeAnimated && !curStateRef.hasAnimated) curStateRef.hasAnimated = true;
|
|
@@ -4773,7 +4794,8 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
4773
4794
|
inputStyle,
|
|
4774
4795
|
outputStyle,
|
|
4775
4796
|
willBeAnimated,
|
|
4776
|
-
willBeAnimatedClient
|
|
4797
|
+
willBeAnimatedClient,
|
|
4798
|
+
platformPseudo
|
|
4777
4799
|
};
|
|
4778
4800
|
};
|
|
4779
4801
|
function hasAnimatedStyleValue(style) {
|
|
@@ -4924,13 +4946,25 @@ function createComponent(staticConfig) {
|
|
|
4924
4946
|
}();
|
|
4925
4947
|
var useAnimations = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.useAnimations;
|
|
4926
4948
|
var componentState = useComponentState(props, (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig, config);
|
|
4927
|
-
var { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, inputStyle, outputStyle, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState;
|
|
4949
|
+
var { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, inputStyle, outputStyle, willBeAnimated, willBeAnimatedClient, platformPseudo, startedUnhydrated } = componentState;
|
|
4928
4950
|
if (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) useIsomorphicLayoutEffect(function() {
|
|
4929
4951
|
var pendingState = stateRef.current.nextState;
|
|
4930
4952
|
if (!pendingState) return;
|
|
4931
4953
|
stateRef.current.nextState = void 0;
|
|
4932
4954
|
if (!isEqualShallow(state, pendingState)) componentState.setStateShallow(pendingState);
|
|
4933
4955
|
});
|
|
4956
|
+
useIsomorphicLayoutEffect(function() {
|
|
4957
|
+
var _getPlatformDriver;
|
|
4958
|
+
if (!platformPseudo || props.disabled) return;
|
|
4959
|
+
var pseudoDriver = (_getPlatformDriver = getPlatformDriver()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo;
|
|
4960
|
+
var host = stateRef.current.host;
|
|
4961
|
+
if (!pseudoDriver || !host) return;
|
|
4962
|
+
return pseudoDriver.subscribe(host, function(param) {
|
|
4963
|
+
var { hovered } = param;
|
|
4964
|
+
var _stateRef_current_setStateShallow, _stateRef_current;
|
|
4965
|
+
(_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, { hover: hovered });
|
|
4966
|
+
});
|
|
4967
|
+
}, [platformPseudo, props.disabled]);
|
|
4934
4968
|
var allGroupContexts = (0, react.useMemo)(function() {
|
|
4935
4969
|
var _stateRef_current_group_listeners, _stateRef_current_group;
|
|
4936
4970
|
if (!groupName || props.passThrough) return groupContextParent;
|
|
@@ -5026,7 +5060,7 @@ function createComponent(staticConfig) {
|
|
|
5026
5060
|
}
|
|
5027
5061
|
}
|
|
5028
5062
|
var hasEnterExitTransition = props.transition && _type_of$1(props.transition) === "object" && !Array.isArray(props.transition) && ("enter" in props.transition || "exit" in props.transition);
|
|
5029
|
-
if (!isPassthrough && (hasAnimationProp || groupName) && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && !hasEnterExitTransition) {
|
|
5063
|
+
if (!isPassthrough && (hasAnimationProp || groupName || platformPseudo) && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && !hasEnterExitTransition) {
|
|
5030
5064
|
let updateGroupListeners2 = function() {
|
|
5031
5065
|
var updatedState = stateRef.current.nextState;
|
|
5032
5066
|
if (groupContext) {
|
|
@@ -5045,7 +5079,8 @@ function createComponent(staticConfig) {
|
|
|
5045
5079
|
var updatedState = stateRef.current.nextState || state;
|
|
5046
5080
|
var mediaState2 = stateRef.current.nextMedia;
|
|
5047
5081
|
var nextStyles = getSplitStyles(props, staticConfig, theme, themeName, updatedState, mediaState2 ? _objectSpread2(_objectSpread2({}, styleProps), {}, { mediaState: mediaState2 }) : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp, animationDriver);
|
|
5048
|
-
var
|
|
5082
|
+
var _props_transition2;
|
|
5083
|
+
var effectiveTransition2 = resolveEffectivePseudoTransition(stateRef.current.prevPseudoState, updatedState, nextStyles === null || nextStyles === void 0 ? void 0 : nextStyles.pseudoTransitions, (_props_transition2 = props.transition) !== null && _props_transition2 !== void 0 ? _props_transition2 : platformPseudo ? "0ms" : void 0);
|
|
5049
5084
|
stateRef.current.prevPseudoState = extractPseudoState(updatedState);
|
|
5050
5085
|
var hasActivePseudo = Boolean(updatedState.hover || updatedState.press || updatedState.pressIn || updatedState.focus || updatedState.focusWithin);
|
|
5051
5086
|
useStyleListener((nextStyles === null || nextStyles === void 0 ? void 0 : nextStyles.style) || {}, effectiveTransition2, hasActivePseudo);
|
|
@@ -5126,7 +5161,8 @@ function createComponent(staticConfig) {
|
|
|
5126
5161
|
var useStyleEmitter = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) ? function(listener) {
|
|
5127
5162
|
stateRef.current.useStyleListener = listener;
|
|
5128
5163
|
} : void 0;
|
|
5129
|
-
var
|
|
5164
|
+
var _props_transition;
|
|
5165
|
+
var effectiveTransition = resolveEffectivePseudoTransition(stateRef.current.prevPseudoState, state, splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.pseudoTransitions, (_props_transition = props.transition) !== null && _props_transition !== void 0 ? _props_transition : platformPseudo ? "0ms" : void 0);
|
|
5130
5166
|
if (splitStyles) splitStyles.effectiveTransition = effectiveTransition;
|
|
5131
5167
|
stateRef.current.prevPseudoState = extractPseudoState(state);
|
|
5132
5168
|
var animations = useAnimations({
|
|
@@ -5233,7 +5269,7 @@ function createComponent(staticConfig) {
|
|
|
5233
5269
|
var hasDynamicGroupChildren = Boolean(groupName && state.hasDynGroupChildren);
|
|
5234
5270
|
var attachPress = Boolean(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || (pseudos === null || pseudos === void 0 ? void 0 : pseudos.focusVisibleStyle));
|
|
5235
5271
|
var runtimeHoverStyle = !disabled && noClass && (pseudos === null || pseudos === void 0 ? void 0 : pseudos.hoverStyle);
|
|
5236
|
-
var needsHoverState = Boolean(hasDynamicGroupChildren || runtimeHoverStyle);
|
|
5272
|
+
var needsHoverState = Boolean(hasDynamicGroupChildren || runtimeHoverStyle && !platformPseudo);
|
|
5237
5273
|
var attachHover = isNativeDesktop && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave);
|
|
5238
5274
|
var shouldAttach = !disabled && !props.asChild && Boolean(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
|
|
5239
5275
|
var needsPressState = Boolean(hasDynamicGroupChildren || runtimePressStyle);
|
|
@@ -7194,6 +7230,7 @@ exports.getExpandedShorthands = getExpandedShorthands;
|
|
|
7194
7230
|
exports.getFontFamilyFromNameOrVariable = getFontFamilyFromNameOrVariable;
|
|
7195
7231
|
exports.getFontsForLanguage = getFontsForLanguage;
|
|
7196
7232
|
exports.getMedia = getMedia;
|
|
7233
|
+
exports.getPlatformDriver = getPlatformDriver;
|
|
7197
7234
|
exports.getReactNativeConfig = getReactNativeConfig;
|
|
7198
7235
|
exports.getRgba = getRgba;
|
|
7199
7236
|
exports.getSetting = getSetting;
|
|
@@ -7280,6 +7317,7 @@ exports.setRef = setRef;
|
|
|
7280
7317
|
exports.setupDev = setupDev;
|
|
7281
7318
|
exports.setupHooks = setupHooks;
|
|
7282
7319
|
exports.setupMatchMedia = setupMatchMedia;
|
|
7320
|
+
exports.setupPlatformDriver = setupPlatformDriver;
|
|
7283
7321
|
exports.shouldRenderNativePlatform = shouldRenderNativePlatform;
|
|
7284
7322
|
exports.simpleHash = simpleHash;
|
|
7285
7323
|
exports.styleOriginalValues = styleOriginalValues;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "2.2.0-
|
|
3
|
+
"version": "2.2.0-1781132308330",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -79,17 +79,17 @@
|
|
|
79
79
|
"clean:build": "tamagui-build clean:build"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@tamagui/helpers": "2.2.0-
|
|
83
|
-
"@tamagui/react-native-media-driver": "2.2.0-
|
|
84
|
-
"@tamagui/react-native-use-pressable": "2.2.0-
|
|
85
|
-
"@tamagui/use-element-layout": "2.2.0-
|
|
86
|
-
"@tamagui/use-event": "2.2.0-
|
|
87
|
-
"@tamagui/web": "2.2.0-
|
|
82
|
+
"@tamagui/helpers": "2.2.0-1781132308330",
|
|
83
|
+
"@tamagui/react-native-media-driver": "2.2.0-1781132308330",
|
|
84
|
+
"@tamagui/react-native-use-pressable": "2.2.0-1781132308330",
|
|
85
|
+
"@tamagui/use-element-layout": "2.2.0-1781132308330",
|
|
86
|
+
"@tamagui/use-event": "2.2.0-1781132308330",
|
|
87
|
+
"@tamagui/web": "2.2.0-1781132308330"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@tamagui/build": "2.2.0-
|
|
91
|
-
"@tamagui/native-bundle": "2.2.0-
|
|
92
|
-
"@tamagui/react-native-web-lite": "2.2.0-
|
|
90
|
+
"@tamagui/build": "2.2.0-1781132308330",
|
|
91
|
+
"@tamagui/native-bundle": "2.2.0-1781132308330",
|
|
92
|
+
"@tamagui/react-native-web-lite": "2.2.0-1781132308330",
|
|
93
93
|
"@testing-library/react": "^16.1.0",
|
|
94
94
|
"csstype": "^3.0.10",
|
|
95
95
|
"react": ">=19",
|