react-native-gesture-handler 2.23.0 → 2.24.0
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/RNGestureHandler.podspec +8 -0
- package/android/build.gradle +9 -3
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +2 -1
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +2 -1
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +60 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +67 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +8 -11
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +10 -2
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +6 -1
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +3 -1
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +5 -3
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +6 -2
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +3 -1
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +2 -1
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +3 -4
- package/lib/commonjs/State.js.map +1 -1
- package/lib/commonjs/TouchEventType.js +3 -3
- package/lib/commonjs/TouchEventType.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +115 -90
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +81 -28
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +37 -26
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +27 -13
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +6 -2
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +77 -29
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js +3 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +20 -5
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +86 -44
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +75 -34
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +28 -10
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/ExtraButtonProps.js +2 -0
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +34 -19
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +25 -16
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +25 -13
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +12 -7
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +4 -1
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +14 -5
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +6 -1
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +14 -13
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +2 -1
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +146 -59
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +30 -18
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +14 -5
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +21 -13
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +24 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +84 -44
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +21 -6
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +26 -6
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +104 -75
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +11 -4
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +5 -4
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +83 -19
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +15 -5
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +12 -3
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +37 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +23 -5
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +4 -2
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +47 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +17 -9
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +41 -7
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +78 -11
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +22 -5
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +14 -7
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +45 -9
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +18 -3
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +76 -27
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +3 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +16 -9
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +26 -13
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +14 -4
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +1 -3
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +3 -9
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +5 -2
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +1 -0
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +1 -0
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +4 -3
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +0 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +20 -10
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +17 -18
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/RNRenderer.js.map +1 -1
- package/lib/module/RNRenderer.web.js.map +1 -1
- package/lib/module/State.js +1 -4
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +1 -3
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +99 -80
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +55 -19
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +12 -17
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +4 -4
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.web.js +2 -1
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +2 -1
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +2 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +2 -1
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +59 -26
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/PressableProps.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/Pressable/utils.js +14 -4
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +66 -40
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +30 -14
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +59 -28
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +15 -7
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js +2 -2
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/ExtraButtonProps.js +2 -0
- package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +63 -34
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +24 -15
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +16 -10
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +15 -10
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/findNodeHandle.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +11 -5
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/getReactNativeVersion.js.map +1 -1
- package/lib/module/getReactNativeVersion.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +13 -13
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -6
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -6
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +19 -8
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -2
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -2
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -6
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +119 -57
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +22 -15
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +4 -9
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -3
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +7 -8
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +14 -11
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +6 -2
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +38 -14
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +9 -5
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +73 -44
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +24 -16
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +14 -1
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +18 -9
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +11 -6
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +4 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +9 -5
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +41 -18
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +7 -2
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +7 -2
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +19 -10
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +5 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +13 -4
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +2 -3
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +66 -20
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +7 -3
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +10 -3
- package/lib/module/mountRegistry.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/typeUtils.js.map +1 -1
- package/lib/module/utils.js +15 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +1 -2
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +38 -5
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +181 -61
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +40 -5
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +114 -7
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +59 -5
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +14 -9
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +13 -3
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +39 -7
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +71 -10
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +19 -5
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +19 -3
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +65 -30
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +12 -7
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +35 -9
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +39 -8
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +14 -3
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +25 -8
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +10 -3
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +57 -22
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +1 -0
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +130 -53
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +8 -6
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +40 -6
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +34 -13
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +45 -31
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +1 -2
- package/lib/module/web_hammer/constants.js.map +1 -1
- package/lib/module/web_hammer/utils.js +2 -2
- package/lib/module/web_hammer/utils.js.map +1 -1
- package/lib/typescript/components/GestureComponents.d.ts +1 -1
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +5 -0
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +7 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -2
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -7
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -0
- package/lib/typescript/web/utils.d.ts +2 -0
- package/package.json +9 -8
- package/src/components/GestureComponents.tsx +1 -1
- package/src/components/ReanimatedDrawerLayout.tsx +17 -4
- package/src/components/Text.tsx +5 -0
- package/src/components/touchables/ExtraButtonProps.ts +7 -0
- package/src/components/touchables/GenericTouchable.tsx +0 -2
- package/src/components/touchables/GenericTouchableProps.ts +2 -0
- package/src/components/touchables/TouchableHighlight.tsx +2 -2
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -8
- package/src/components/touchables/TouchableOpacity.tsx +2 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +22 -4
- package/src/handlers/createHandler.tsx +20 -9
- package/src/handlers/createNativeWrapper.tsx +7 -3
- package/src/handlers/gestures/GestureDetector/Wrap.web.tsx +2 -4
- package/src/utils.ts +6 -0
- package/src/web/utils.ts +21 -3
@@ -1,7 +1,6 @@
|
|
1
1
|
// TODO(TS) remove if not necessary after rewrite
|
2
|
-
export const isnan = v => Number.isNaN(v);
|
2
|
+
export const isnan = v => Number.isNaN(v); // TODO(TS) remove if not necessary after rewrite
|
3
3
|
|
4
|
-
// TODO(TS) remove if not necessary after rewrite
|
5
4
|
export const isValidNumber = v => typeof v === 'number' && !Number.isNaN(v);
|
6
5
|
export const TEST_MIN_IF_NOT_NAN = (value, limit) => !isnan(limit) && (limit < 0 && value <= limit || limit >= 0 && value >= limit);
|
7
6
|
export const VEC_LEN_SQ = ({
|
@@ -14,6 +13,7 @@ export function fireAfterInterval(method, interval) {
|
|
14
13
|
method();
|
15
14
|
return null;
|
16
15
|
}
|
16
|
+
|
17
17
|
return setTimeout(() => method(), interval);
|
18
18
|
}
|
19
19
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isnan","v","Number","isNaN","isValidNumber","TEST_MIN_IF_NOT_NAN","value","limit","VEC_LEN_SQ","x","y","TEST_MAX_IF_NOT_NAN","max","fireAfterInterval","method","interval","setTimeout"],"
|
1
|
+
{"version":3,"sources":["utils.ts"],"names":["isnan","v","Number","isNaN","isValidNumber","TEST_MIN_IF_NOT_NAN","value","limit","VEC_LEN_SQ","x","y","TEST_MAX_IF_NOT_NAN","max","fireAfterInterval","method","interval","setTimeout"],"mappings":"AAAA;AACA,OAAO,MAAMA,KAAK,GAAIC,CAAD,IAAgBC,MAAM,CAACC,KAAP,CAAaF,CAAb,CAA9B,C,CAEP;;AACA,OAAO,MAAMG,aAAa,GAAIH,CAAD,IAC3B,OAAOA,CAAP,KAAa,QAAb,IAAyB,CAACC,MAAM,CAACC,KAAP,CAAaF,CAAb,CADrB;AAGP,OAAO,MAAMI,mBAAmB,GAAG,CAACC,KAAD,EAAgBC,KAAhB,KACjC,CAACP,KAAK,CAACO,KAAD,CAAN,KACEA,KAAK,GAAG,CAAR,IAAaD,KAAK,IAAIC,KAAvB,IAAkCA,KAAK,IAAI,CAAT,IAAcD,KAAK,IAAIC,KAD1D,CADK;AAGP,OAAO,MAAMC,UAAU,GAAG,CAAC;AAAEC,EAAAA,CAAC,GAAG,CAAN;AAASC,EAAAA,CAAC,GAAG;AAAb,IAAmB,EAApB,KAA2BD,CAAC,GAAGA,CAAJ,GAAQC,CAAC,GAAGA,CAA1D;AACP,OAAO,MAAMC,mBAAmB,GAAG,CAACL,KAAD,EAAgBM,GAAhB,KACjC,CAACZ,KAAK,CAACY,GAAD,CAAN,KAAiBA,GAAG,GAAG,CAAN,IAAWN,KAAK,GAAGM,GAApB,IAA6BA,GAAG,IAAI,CAAP,IAAYN,KAAK,GAAGM,GAAjE,CADK;AAGP,OAAO,SAASC,iBAAT,CACLC,MADK,EAELC,QAFK,EAGL;AACA,MAAI,CAACA,QAAL,EAAe;AACbD,IAAAA,MAAM;AACN,WAAO,IAAP;AACD;;AACD,SAAOE,UAAU,CAAC,MAAMF,MAAM,EAAb,EAAiBC,QAAjB,CAAjB;AACD","sourcesContent":["// TODO(TS) remove if not necessary after rewrite\nexport const isnan = (v: unknown) => Number.isNaN(v);\n\n// TODO(TS) remove if not necessary after rewrite\nexport const isValidNumber = (v: unknown) =>\n typeof v === 'number' && !Number.isNaN(v);\n\nexport const TEST_MIN_IF_NOT_NAN = (value: number, limit: number): boolean =>\n !isnan(limit) &&\n ((limit < 0 && value <= limit) || (limit >= 0 && value >= limit));\nexport const VEC_LEN_SQ = ({ x = 0, y = 0 } = {}) => x * x + y * y;\nexport const TEST_MAX_IF_NOT_NAN = (value: number, max: number) =>\n !isnan(max) && ((max < 0 && value < max) || (max >= 0 && value > max));\n\nexport function fireAfterInterval(\n method: () => void,\n interval?: number | boolean\n) {\n if (!interval) {\n method();\n return null;\n }\n return setTimeout(() => method(), interval as number);\n}\n"]}
|
@@ -17,6 +17,6 @@ export declare const DrawerLayoutAndroid: React.ForwardRefExoticComponent<RNDraw
|
|
17
17
|
children?: React.ReactNode;
|
18
18
|
} & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
19
19
|
export type DrawerLayoutAndroid = typeof DrawerLayoutAndroid & RNDrawerLayoutAndroid;
|
20
|
-
export declare const FlatList: <ItemT = any>(props: React.PropsWithChildren<Omit<RNFlatListProps<ItemT>, "renderScrollComponent"> & React.RefAttributes<FlatList<ItemT>> & NativeViewGestureHandlerProps>, ref
|
20
|
+
export declare const FlatList: <ItemT = any>(props: React.PropsWithChildren<Omit<RNFlatListProps<ItemT>, "renderScrollComponent"> & React.RefAttributes<FlatList<ItemT>> & NativeViewGestureHandlerProps>, ref?: React.ForwardedRef<FlatList<ItemT>> | undefined) => ReactElement | null;
|
21
21
|
export type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;
|
22
22
|
export {};
|
@@ -76,6 +76,11 @@ export interface DrawerLayoutProps {
|
|
76
76
|
* Type of animation that will play when opening the drawer.
|
77
77
|
*/
|
78
78
|
drawerType?: DrawerType;
|
79
|
+
/**
|
80
|
+
* Speed of animation that will play when letting go, or dismissing the drawer.
|
81
|
+
* This will also be the default animation speed for programatic controlls.
|
82
|
+
*/
|
83
|
+
animationSpeed?: number;
|
79
84
|
/**
|
80
85
|
* Defines how far from the edge of the content view the gesture should
|
81
86
|
* activate.
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
3
3
|
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlerCommon';
|
4
4
|
import type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload';
|
5
|
-
import type { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';
|
6
5
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
7
6
|
/**
|
8
7
|
* Each touchable is a states' machine which preforms transitions.
|
@@ -18,7 +17,6 @@ export declare const TOUCHABLE_STATE: {
|
|
18
17
|
};
|
19
18
|
type TouchableState = (typeof TOUCHABLE_STATE)[keyof typeof TOUCHABLE_STATE];
|
20
19
|
interface InternalProps {
|
21
|
-
extraButtonProps: TouchableNativeFeedbackExtraProps;
|
22
20
|
onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
|
23
21
|
}
|
24
22
|
type Timeout = ReturnType<typeof setTimeout> | null | undefined;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { StyleProp, ViewStyle, TouchableWithoutFeedbackProps, Insets } from 'react-native';
|
2
2
|
import type { UserSelect } from '../../handlers/gestureHandlerCommon';
|
3
|
+
import { ExtraButtonProps } from './ExtraButtonProps';
|
3
4
|
export interface GenericTouchableProps extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
4
5
|
onPress?: () => void;
|
5
6
|
onPressIn?: () => void;
|
@@ -11,4 +12,5 @@ export interface GenericTouchableProps extends Omit<TouchableWithoutFeedbackProp
|
|
11
12
|
containerStyle?: StyleProp<ViewStyle>;
|
12
13
|
hitSlop?: Insets | number;
|
13
14
|
userSelect?: UserSelect;
|
15
|
+
extraButtonProps?: ExtraButtonProps;
|
14
16
|
}
|
@@ -11,11 +11,11 @@ interface State {
|
|
11
11
|
};
|
12
12
|
}
|
13
13
|
/**
|
14
|
-
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
|
14
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
|
15
15
|
*/
|
16
16
|
export type TouchableHighlightProps = RNTouchableHighlightProps & GenericTouchableProps;
|
17
17
|
/**
|
18
|
-
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
|
18
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
|
19
19
|
*
|
20
20
|
* TouchableHighlight follows RN's implementation
|
21
21
|
*/
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { ColorValue } from 'react-native';
|
2
2
|
import * as React from 'react';
|
3
3
|
import { Component } from 'react';
|
4
|
-
import { TouchableNativeFeedbackProps
|
4
|
+
import { TouchableNativeFeedbackProps } from './TouchableNativeFeedbackProps';
|
5
5
|
/**
|
6
|
-
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
6
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
7
7
|
*
|
8
8
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
9
9
|
* There's small difference with handling long press ripple since RN's implementation calls
|
@@ -35,6 +35,6 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
|
|
35
35
|
rippleRadius: number | undefined;
|
36
36
|
};
|
37
37
|
static canUseNativeForeground: () => boolean;
|
38
|
-
getExtraButtonProps():
|
38
|
+
getExtraButtonProps(): import("./ExtraButtonProps").ExtraButtonProps;
|
39
39
|
render(): React.JSX.Element;
|
40
40
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';
|
2
2
|
/**
|
3
|
-
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
3
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
4
4
|
*/
|
5
5
|
declare const TouchableNativeFeedback: typeof RNTouchableNativeFeedback;
|
6
6
|
export default TouchableNativeFeedback;
|
@@ -1,12 +1,8 @@
|
|
1
1
|
import type { TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps } from 'react-native';
|
2
2
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
3
|
-
|
4
|
-
|
5
|
-
rippleColor?: number | null;
|
6
|
-
rippleRadius?: number | null;
|
7
|
-
foreground?: boolean;
|
8
|
-
};
|
3
|
+
import { ExtraButtonProps } from './ExtraButtonProps';
|
4
|
+
export type TouchableNativeFeedbackExtraProps = ExtraButtonProps;
|
9
5
|
/**
|
10
|
-
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
6
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
11
7
|
*/
|
12
8
|
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps & GenericTouchableProps;
|
@@ -3,13 +3,13 @@ import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
3
3
|
import * as React from 'react';
|
4
4
|
import { Component } from 'react';
|
5
5
|
/**
|
6
|
-
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler.
|
6
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
7
7
|
*/
|
8
8
|
export type TouchableOpacityProps = RNTouchableOpacityProps & GenericTouchableProps & {
|
9
9
|
useNativeAnimations?: boolean;
|
10
10
|
};
|
11
11
|
/**
|
12
|
-
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler.
|
12
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
13
13
|
*
|
14
14
|
* TouchableOpacity bases on timing animation which has been used in RN's core
|
15
15
|
*/
|
@@ -2,11 +2,11 @@ import * as React from 'react';
|
|
2
2
|
import GenericTouchable from './GenericTouchable';
|
3
3
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
4
4
|
/**
|
5
|
-
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler.
|
5
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
6
6
|
*/
|
7
7
|
export type TouchableWithoutFeedbackProps = GenericTouchableProps;
|
8
8
|
/**
|
9
|
-
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler.
|
9
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
10
10
|
*/
|
11
11
|
declare const TouchableWithoutFeedback: React.ForwardRefExoticComponent<GenericTouchableProps & {
|
12
12
|
children?: React.ReactNode;
|
@@ -10,4 +10,4 @@ export declare function extractGestureRelations(gesture: GestureType): {
|
|
10
10
|
export declare function checkGestureCallbacksForWorklets(gesture: GestureType): void;
|
11
11
|
export declare function validateDetectorChildren(ref: any): void;
|
12
12
|
export declare function useForceRender(): () => void;
|
13
|
-
export declare function useWebEventHandlers(): import("react").
|
13
|
+
export declare function useWebEventHandlers(): import("react").RefObject<WebEventHandler>;
|
@@ -5,6 +5,7 @@ export declare function hasProperty(object: object, key: string): boolean;
|
|
5
5
|
export declare function isTestEnv(): boolean;
|
6
6
|
export declare function tagMessage(msg: string): string;
|
7
7
|
export declare function isFabric(): boolean;
|
8
|
+
export declare function isReact19(): boolean;
|
8
9
|
export declare function isRemoteDebuggingEnabled(): boolean;
|
9
10
|
/**
|
10
11
|
* Recursively compares two objects for deep equality.
|
@@ -9,4 +9,6 @@ export declare function calculateViewScale(view: HTMLElement): {
|
|
9
9
|
scaleY: number;
|
10
10
|
};
|
11
11
|
export declare function tryExtractStylusData(event: PointerEvent): StylusData | undefined;
|
12
|
+
export declare const RNSVGElements: Set<string>;
|
12
13
|
export declare function isRNSVGElement(viewRef: SVGRef | GestureHandlerRef): boolean;
|
14
|
+
export declare function isRNSVGNode(node: any): boolean;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-gesture-handler",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.24.0",
|
4
4
|
"description": "Declarative API exposing native platform touch and gesture system to React Native",
|
5
5
|
"scripts": {
|
6
6
|
"prepare": "bob build && husky install",
|
@@ -36,6 +36,7 @@
|
|
36
36
|
"android/src/main/jni/",
|
37
37
|
"android/fabric/src/main/java",
|
38
38
|
"android/paper/src/main/java",
|
39
|
+
"android/paper77/src/main/java",
|
39
40
|
"android/common/src/main/java/",
|
40
41
|
"android/reanimated/src/main/java/",
|
41
42
|
"android/noreanimated/src/main/java/",
|
@@ -74,13 +75,13 @@
|
|
74
75
|
"@babel/core": "^7.25.2",
|
75
76
|
"@babel/preset-env": "^7.25.3",
|
76
77
|
"@babel/preset-typescript": "^7.12.7",
|
77
|
-
"@react-native/babel-preset": "0.
|
78
|
+
"@react-native/babel-preset": "0.78.0",
|
78
79
|
"@testing-library/react-native": "^12.5.1",
|
79
80
|
"@types/hoist-non-react-statics": "^3.3.1",
|
80
81
|
"@types/invariant": "^2.2.37",
|
81
82
|
"@types/jest": "^27.0.3",
|
82
|
-
"@types/react": "^
|
83
|
-
"@types/react-test-renderer": "^
|
83
|
+
"@types/react": "^19.0.0",
|
84
|
+
"@types/react-test-renderer": "^19.0.0",
|
84
85
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
85
86
|
"@typescript-eslint/parser": "^4.33.0",
|
86
87
|
"babel-plugin-module-resolver": "^5.0.2",
|
@@ -96,11 +97,11 @@
|
|
96
97
|
"lint-staged": "^12.3.2",
|
97
98
|
"madge": "^6.1.0",
|
98
99
|
"prettier": "3.3.3",
|
99
|
-
"react": "
|
100
|
-
"react-native": "0.
|
100
|
+
"react": "19.0.0",
|
101
|
+
"react-native": "0.78.0",
|
101
102
|
"react-native-builder-bob": "^0.17.1",
|
102
|
-
"react-native-reanimated": "^3.
|
103
|
-
"react-test-renderer": "
|
103
|
+
"react-native-reanimated": "^3.12.0",
|
104
|
+
"react-test-renderer": "19.0.0",
|
104
105
|
"release-it": "^13.6.5",
|
105
106
|
"typescript": "5.0.4"
|
106
107
|
},
|
@@ -142,7 +142,7 @@ export const FlatList = React.forwardRef((props, ref) => {
|
|
142
142
|
RefAttributes<FlatList<ItemT>> &
|
143
143
|
NativeViewGestureHandlerProps
|
144
144
|
>,
|
145
|
-
ref
|
145
|
+
ref?: ForwardedRef<FlatList<ItemT>>
|
146
146
|
) => ReactElement | null;
|
147
147
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
148
148
|
export type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;
|
@@ -143,6 +143,12 @@ export interface DrawerLayoutProps {
|
|
143
143
|
*/
|
144
144
|
drawerType?: DrawerType;
|
145
145
|
|
146
|
+
/**
|
147
|
+
* Speed of animation that will play when letting go, or dismissing the drawer.
|
148
|
+
* This will also be the default animation speed for programatic controlls.
|
149
|
+
*/
|
150
|
+
animationSpeed?: number;
|
151
|
+
|
146
152
|
/**
|
147
153
|
* Defines how far from the edge of the content view the gesture should
|
148
154
|
* activate.
|
@@ -256,6 +262,10 @@ const defaultProps = {
|
|
256
262
|
statusBarAnimation: 'slide' as StatusBarAnimation,
|
257
263
|
};
|
258
264
|
|
265
|
+
// StatusBar.setHidden and Keyboard.dismiss cannot be directly referenced in worklets.
|
266
|
+
const setStatusBarHidden = StatusBar.setHidden;
|
267
|
+
const dismissKeyboard = Keyboard.dismiss;
|
268
|
+
|
259
269
|
const DrawerLayout = forwardRef<DrawerLayoutMethods, DrawerLayoutProps>(
|
260
270
|
function DrawerLayout(props: DrawerLayoutProps, ref) {
|
261
271
|
const [containerWidth, setContainerWidth] = useState(0);
|
@@ -288,6 +298,7 @@ const DrawerLayout = forwardRef<DrawerLayoutMethods, DrawerLayoutProps>(
|
|
288
298
|
onDrawerClose,
|
289
299
|
onDrawerOpen,
|
290
300
|
onDrawerStateChanged,
|
301
|
+
animationSpeed: animationSpeedProp,
|
291
302
|
} = props;
|
292
303
|
|
293
304
|
const isFromLeft = drawerPosition === DrawerPosition.LEFT;
|
@@ -366,7 +377,7 @@ const DrawerLayout = forwardRef<DrawerLayoutMethods, DrawerLayoutProps>(
|
|
366
377
|
runOnJS(setDrawerState)(DrawerState.SETTLING);
|
367
378
|
|
368
379
|
if (hideStatusBar) {
|
369
|
-
runOnJS(
|
380
|
+
runOnJS(setStatusBarHidden)(willShow, statusBarAnimation);
|
370
381
|
}
|
371
382
|
|
372
383
|
const normalizedToValue = interpolate(
|
@@ -388,7 +399,9 @@ const DrawerLayout = forwardRef<DrawerLayoutMethods, DrawerLayoutProps>(
|
|
388
399
|
{
|
389
400
|
overshootClamping: true,
|
390
401
|
velocity: normalizedInitialVelocity,
|
391
|
-
mass: animationSpeed
|
402
|
+
mass: animationSpeed
|
403
|
+
? 1 / animationSpeed
|
404
|
+
: 1 / (animationSpeedProp ?? 1),
|
392
405
|
damping: 40,
|
393
406
|
stiffness: 500,
|
394
407
|
},
|
@@ -529,10 +542,10 @@ const DrawerLayout = forwardRef<DrawerLayoutMethods, DrawerLayoutProps>(
|
|
529
542
|
emitStateChanged(DrawerState.DRAGGING, false);
|
530
543
|
runOnJS(setDrawerState)(DrawerState.DRAGGING);
|
531
544
|
if (keyboardDismissMode === DrawerKeyboardDismissMode.ON_DRAG) {
|
532
|
-
runOnJS(
|
545
|
+
runOnJS(dismissKeyboard)();
|
533
546
|
}
|
534
547
|
if (hideStatusBar) {
|
535
|
-
runOnJS(
|
548
|
+
runOnJS(setStatusBarHidden)(true, statusBarAnimation);
|
536
549
|
}
|
537
550
|
})
|
538
551
|
.onUpdate((event) => {
|
package/src/components/Text.tsx
CHANGED
@@ -35,6 +35,11 @@ export const Text = forwardRef(
|
|
35
35
|
}
|
36
36
|
};
|
37
37
|
|
38
|
+
// This is a special case for `Text` component. After https://github.com/software-mansion/react-native-gesture-handler/pull/3379 we check for
|
39
|
+
// `displayName` field. However, `Text` from RN has this field set to `Text`, but is also present in `RNSVGElements` set.
|
40
|
+
// We don't want to treat our `Text` as the one from `SVG`, therefore we add special field to ref.
|
41
|
+
refHandler.rngh = true;
|
42
|
+
|
38
43
|
useEffect(() => {
|
39
44
|
if (Platform.OS !== 'web') {
|
40
45
|
return;
|
@@ -10,7 +10,6 @@ import {
|
|
10
10
|
HandlerStateChangeEvent,
|
11
11
|
} from '../../handlers/gestureHandlerCommon';
|
12
12
|
import type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload';
|
13
|
-
import type { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';
|
14
13
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
15
14
|
|
16
15
|
/**
|
@@ -29,7 +28,6 @@ export const TOUCHABLE_STATE = {
|
|
29
28
|
type TouchableState = (typeof TOUCHABLE_STATE)[keyof typeof TOUCHABLE_STATE];
|
30
29
|
|
31
30
|
interface InternalProps {
|
32
|
-
extraButtonProps: TouchableNativeFeedbackExtraProps;
|
33
31
|
onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
|
34
32
|
}
|
35
33
|
|
@@ -5,6 +5,7 @@ import type {
|
|
5
5
|
Insets,
|
6
6
|
} from 'react-native';
|
7
7
|
import type { UserSelect } from '../../handlers/gestureHandlerCommon';
|
8
|
+
import { ExtraButtonProps } from './ExtraButtonProps';
|
8
9
|
|
9
10
|
export interface GenericTouchableProps
|
10
11
|
extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
@@ -23,4 +24,5 @@ export interface GenericTouchableProps
|
|
23
24
|
containerStyle?: StyleProp<ViewStyle>;
|
24
25
|
hitSlop?: Insets | number;
|
25
26
|
userSelect?: UserSelect;
|
27
|
+
extraButtonProps?: ExtraButtonProps;
|
26
28
|
}
|
@@ -20,13 +20,13 @@ interface State {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
/**
|
23
|
-
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
|
23
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
|
24
24
|
*/
|
25
25
|
export type TouchableHighlightProps = RNTouchableHighlightProps &
|
26
26
|
GenericTouchableProps;
|
27
27
|
|
28
28
|
/**
|
29
|
-
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
|
29
|
+
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
|
30
30
|
*
|
31
31
|
* TouchableHighlight follows RN's implementation
|
32
32
|
*/
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
} from './TouchableNativeFeedbackProps';
|
9
9
|
|
10
10
|
/**
|
11
|
-
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
11
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
12
12
|
*
|
13
13
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
14
14
|
* There's small difference with handling long press ripple since RN's implementation calls
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';
|
2
2
|
|
3
3
|
/**
|
4
|
-
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
4
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
5
5
|
*/
|
6
6
|
const TouchableNativeFeedback = RNTouchableNativeFeedback;
|
7
7
|
|
@@ -1,15 +1,10 @@
|
|
1
1
|
import type { TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps } from 'react-native';
|
2
2
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
3
|
+
import { ExtraButtonProps } from './ExtraButtonProps';
|
3
4
|
|
4
|
-
export type TouchableNativeFeedbackExtraProps =
|
5
|
-
borderless?: boolean;
|
6
|
-
rippleColor?: number | null;
|
7
|
-
rippleRadius?: number | null;
|
8
|
-
foreground?: boolean;
|
9
|
-
};
|
10
|
-
|
5
|
+
export type TouchableNativeFeedbackExtraProps = ExtraButtonProps;
|
11
6
|
/**
|
12
|
-
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
|
7
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
13
8
|
*/
|
14
9
|
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps &
|
15
10
|
GenericTouchableProps;
|
@@ -11,7 +11,7 @@ import * as React from 'react';
|
|
11
11
|
import { Component } from 'react';
|
12
12
|
|
13
13
|
/**
|
14
|
-
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler.
|
14
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
15
15
|
*/
|
16
16
|
export type TouchableOpacityProps = RNTouchableOpacityProps &
|
17
17
|
GenericTouchableProps & {
|
@@ -19,7 +19,7 @@ export type TouchableOpacityProps = RNTouchableOpacityProps &
|
|
19
19
|
};
|
20
20
|
|
21
21
|
/**
|
22
|
-
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler.
|
22
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
23
23
|
*
|
24
24
|
* TouchableOpacity bases on timing animation which has been used in RN's core
|
25
25
|
*/
|
@@ -4,18 +4,36 @@ import GenericTouchable from './GenericTouchable';
|
|
4
4
|
import type { GenericTouchableProps } from './GenericTouchableProps';
|
5
5
|
|
6
6
|
/**
|
7
|
-
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler.
|
7
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
8
8
|
*/
|
9
9
|
export type TouchableWithoutFeedbackProps = GenericTouchableProps;
|
10
10
|
|
11
11
|
/**
|
12
|
-
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler.
|
12
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
13
13
|
*/
|
14
14
|
const TouchableWithoutFeedback = React.forwardRef<
|
15
15
|
GenericTouchable,
|
16
16
|
PropsWithChildren<TouchableWithoutFeedbackProps>
|
17
|
-
>(
|
17
|
+
>(
|
18
|
+
(
|
19
|
+
{
|
20
|
+
delayLongPress = 600,
|
21
|
+
extraButtonProps = {
|
22
|
+
rippleColor: 'transparent',
|
23
|
+
exclusive: true,
|
24
|
+
},
|
25
|
+
...rest
|
26
|
+
},
|
18
27
|
|
19
|
-
|
28
|
+
ref
|
29
|
+
) => (
|
30
|
+
<GenericTouchable
|
31
|
+
ref={ref}
|
32
|
+
delayLongPress={delayLongPress}
|
33
|
+
extraButtonProps={extraButtonProps}
|
34
|
+
{...rest}
|
35
|
+
/>
|
36
|
+
)
|
37
|
+
);
|
20
38
|
|
21
39
|
export default TouchableWithoutFeedback;
|
@@ -23,12 +23,19 @@ import {
|
|
23
23
|
import { filterConfig, scheduleFlushOperations } from './utils';
|
24
24
|
import findNodeHandle from '../findNodeHandle';
|
25
25
|
import { ValueOf } from '../typeUtils';
|
26
|
-
import {
|
26
|
+
import {
|
27
|
+
deepEqual,
|
28
|
+
isFabric,
|
29
|
+
isReact19,
|
30
|
+
isTestEnv,
|
31
|
+
tagMessage,
|
32
|
+
} from '../utils';
|
27
33
|
import { ActionType } from '../ActionType';
|
28
34
|
import { PressabilityDebugView } from './PressabilityDebugView';
|
29
35
|
import GestureHandlerRootViewContext from '../GestureHandlerRootViewContext';
|
30
36
|
import { ghQueueMicrotask } from '../ghQueueMicrotask';
|
31
37
|
import { MountRegistry } from '../mountRegistry';
|
38
|
+
import { ReactElement } from 'react';
|
32
39
|
|
33
40
|
const UIManagerAny = UIManager as any;
|
34
41
|
|
@@ -308,14 +315,18 @@ export default function createHandler<
|
|
308
315
|
this.viewNode = node;
|
309
316
|
|
310
317
|
const child = React.Children.only(this.props.children);
|
311
|
-
//
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
318
|
+
// @ts-ignore Since React 19 ref is accessible as standard prop
|
319
|
+
// https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref
|
320
|
+
const ref = isReact19() ? (child as ReactElement).props?.ref : child?.ref;
|
321
|
+
|
322
|
+
if (!ref) {
|
323
|
+
return;
|
324
|
+
}
|
325
|
+
|
326
|
+
if (typeof ref === 'function') {
|
327
|
+
ref(node);
|
328
|
+
} else {
|
329
|
+
ref.current = node;
|
319
330
|
}
|
320
331
|
};
|
321
332
|
|
@@ -44,11 +44,15 @@ export default function createNativeWrapper<P>(
|
|
44
44
|
},
|
45
45
|
{
|
46
46
|
gestureHandlerProps: { ...config }, // Watch out not to modify config
|
47
|
-
childProps: {
|
47
|
+
childProps: {
|
48
|
+
enabled: props.enabled,
|
49
|
+
hitSlop: props.hitSlop,
|
50
|
+
testID: props.testID,
|
51
|
+
} as P,
|
48
52
|
}
|
49
53
|
);
|
50
|
-
const _ref = useRef<React.ComponentType<P>>();
|
51
|
-
const _gestureHandlerRef = useRef<React.ComponentType<P>>();
|
54
|
+
const _ref = useRef<React.ComponentType<P>>(null);
|
55
|
+
const _gestureHandlerRef = useRef<React.ComponentType<P>>(null);
|
52
56
|
useImperativeHandle(
|
53
57
|
ref,
|
54
58
|
// @ts-ignore TODO(TS) decide how nulls work in this context
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { forwardRef } from 'react';
|
2
2
|
import type { LegacyRef, PropsWithChildren } from 'react';
|
3
3
|
import { tagMessage } from '../../../utils';
|
4
|
+
import { isRNSVGNode } from '../../../web/utils';
|
4
5
|
|
5
6
|
export const Wrap = forwardRef<HTMLDivElement, PropsWithChildren<{}>>(
|
6
7
|
({ children }, ref) => {
|
@@ -8,10 +9,7 @@ export const Wrap = forwardRef<HTMLDivElement, PropsWithChildren<{}>>(
|
|
8
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9
10
|
const child: any = React.Children.only(children);
|
10
11
|
|
11
|
-
|
12
|
-
Object.getPrototypeOf(child?.type)?.name === 'WebShape';
|
13
|
-
|
14
|
-
if (isRNSVGNode) {
|
12
|
+
if (isRNSVGNode(child)) {
|
15
13
|
const clone = React.cloneElement(
|
16
14
|
child,
|
17
15
|
{ ref },
|
package/src/utils.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
1
3
|
export function toArray<T>(object: T | T[]): T[] {
|
2
4
|
if (!Array.isArray(object)) {
|
3
5
|
return [object];
|
@@ -50,6 +52,10 @@ export function isFabric(): boolean {
|
|
50
52
|
return !!global?.nativeFabricUIManager;
|
51
53
|
}
|
52
54
|
|
55
|
+
export function isReact19() {
|
56
|
+
return React.version.startsWith('19.');
|
57
|
+
}
|
58
|
+
|
53
59
|
export function isRemoteDebuggingEnabled(): boolean {
|
54
60
|
// react-native-reanimated checks if in remote debugging in the same way
|
55
61
|
// @ts-ignore global is available but node types are not included
|