react-native-gesture-handler 2.17.1 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- package/ReanimatedSwipeable/package.json +6 -0
- package/android/build.gradle +0 -103
- package/android/gradle.properties +0 -7
- package/android/paper/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +22 -10
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +16 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +7 -8
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +14 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +3 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +3 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +8 -7
- package/android/src/main/jni/cpp-adapter.cpp +5 -3
- package/apple/Handlers/RNFlingHandler.m +1 -0
- package/apple/Handlers/RNForceTouchHandler.m +2 -0
- package/apple/Handlers/RNLongPressHandler.m +2 -1
- package/apple/Handlers/RNManualHandler.m +1 -0
- package/apple/Handlers/RNNativeViewHandler.mm +31 -27
- package/apple/Handlers/RNPanHandler.m +1 -0
- package/apple/Handlers/RNPinchHandler.m +1 -0
- package/apple/Handlers/RNRotationHandler.m +1 -0
- package/apple/Handlers/RNTapHandler.m +1 -0
- package/apple/RNGestureHandlerModule.mm +3 -2
- package/apple/RNRootViewGestureRecognizer.m +5 -0
- package/lib/commonjs/Directions.js +2 -2
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +2 -2
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +2 -2
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +3 -3
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js +6 -0
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.js +1 -1
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +334 -0
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -0
- package/lib/commonjs/components/Pressable/PressableProps.js +6 -0
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -0
- package/lib/commonjs/components/Pressable/index.js +24 -0
- package/lib/commonjs/components/Pressable/index.js.map +1 -0
- package/lib/commonjs/components/Pressable/utils.js +136 -0
- package/lib/commonjs/components/Pressable/utils.js.map +1 -0
- package/lib/commonjs/components/ReanimatedSwipeable.js +317 -0
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +3 -3
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +4 -4
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js +6 -0
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +6 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +2 -2
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +3 -4
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js +2 -0
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +21 -19
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +3 -3
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -86
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +2 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +21 -31
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +5 -5
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +7 -7
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +5 -5
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +12 -0
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -0
- package/lib/commonjs/handlers/handlersRegistry.js +0 -6
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +91 -0
- package/lib/commonjs/handlers/utils.js.map +1 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +1 -1
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +2 -2
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +2 -2
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/utils.js +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +1 -1
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +4 -4
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +6 -11
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +2 -2
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +4 -11
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +18 -18
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +2 -2
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/TouchEventManager.js +4 -4
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +6 -6
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +2 -0
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/Directions.js +2 -2
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +2 -2
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +2 -2
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +3 -3
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js +2 -0
- package/lib/module/components/GestureButtonsProps.js.map +1 -0
- package/lib/module/components/GestureComponents.js +1 -1
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +1 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +309 -0
- package/lib/module/components/Pressable/Pressable.js.map +1 -0
- package/lib/module/components/Pressable/PressableProps.js +2 -0
- package/lib/module/components/Pressable/PressableProps.js.map +1 -0
- package/lib/module/components/Pressable/index.js +3 -0
- package/lib/module/components/Pressable/index.js.map +1 -0
- package/lib/module/components/Pressable/utils.js +120 -0
- package/lib/module/components/Pressable/utils.js.map +1 -0
- package/lib/module/components/ReanimatedSwipeable.js +293 -0
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -0
- package/lib/module/components/Swipeable.js +3 -3
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchable.js +4 -4
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js +2 -0
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +2 -0
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +2 -2
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js +3 -4
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js +2 -0
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +6 -5
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +3 -3
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +0 -72
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +4 -4
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +18 -28
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +6 -6
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +5 -5
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js +5 -0
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -0
- package/lib/module/handlers/handlersRegistry.js +0 -4
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +73 -0
- package/lib/module/handlers/utils.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +1 -1
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +2 -2
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +2 -2
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/utils.js +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +1 -1
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +4 -4
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +6 -11
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +2 -2
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +4 -11
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +18 -18
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +2 -2
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +1 -1
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/TouchEventManager.js +4 -4
- package/lib/module/web/tools/TouchEventManager.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +6 -6
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +1 -1
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +1 -1
- package/lib/typescript/components/GestureButtons.d.ts +2 -85
- package/lib/typescript/components/GestureButtonsProps.d.ts +99 -0
- package/lib/typescript/components/GestureHandlerButton.d.ts +1 -1
- package/lib/typescript/components/Pressable/Pressable.d.ts +3 -0
- package/lib/typescript/components/Pressable/PressableProps.d.ts +116 -0
- package/lib/typescript/components/Pressable/index.d.ts +2 -0
- package/lib/typescript/components/Pressable/utils.d.ts +15 -0
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +125 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +4 -16
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +14 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -9
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +9 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -1
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +2 -6
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +1 -10
- package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +159 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +2 -35
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +2 -6
- package/lib/typescript/handlers/PanGestureHandler.d.ts +3 -51
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +2 -23
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +2 -23
- package/lib/typescript/handlers/TapGestureHandler.d.ts +2 -6
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -5
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +10 -9
- package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +1 -0
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -0
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +2 -1
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +2 -1
- package/lib/typescript/handlers/gestures/gesture.d.ts +2 -8
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +2 -1
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +2 -1
- package/lib/typescript/handlers/gestures/panGesture.d.ts +2 -1
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +2 -1
- package/lib/typescript/handlers/getNextHandlerTag.d.ts +1 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +1 -2
- package/lib/typescript/handlers/utils.d.ts +6 -0
- package/lib/typescript/index.d.ts +12 -9
- package/lib/typescript/jestUtils/jestUtils.d.ts +9 -7
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/GestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +1 -0
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +1 -0
- package/lib/typescript/web_hammer/NodeManager.d.ts +4 -5
- package/package.json +14 -16
- package/src/Directions.ts +2 -2
- package/src/RNGestureHandlerModule.web.ts +2 -2
- package/src/components/DrawerLayout.tsx +7 -9
- package/src/components/GestureButtons.tsx +13 -123
- package/src/components/GestureButtonsProps.ts +115 -0
- package/src/components/GestureComponents.tsx +1 -1
- package/src/components/GestureHandlerButton.tsx +1 -1
- package/src/components/GestureHandlerRootView.android.tsx +1 -1
- package/src/components/GestureHandlerRootView.tsx +1 -1
- package/src/components/Pressable/Pressable.tsx +398 -0
- package/src/components/Pressable/PressableProps.tsx +149 -0
- package/src/components/Pressable/index.ts +2 -0
- package/src/components/Pressable/utils.ts +180 -0
- package/src/components/ReanimatedSwipeable.tsx +629 -0
- package/src/components/Swipeable.tsx +6 -6
- package/src/components/touchables/GenericTouchable.tsx +9 -36
- package/src/components/touchables/GenericTouchableProps.ts +26 -0
- package/src/components/touchables/TouchableHighlight.tsx +2 -4
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +7 -17
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +12 -0
- package/src/components/touchables/TouchableOpacity.tsx +3 -5
- package/src/components/touchables/TouchableWithoutFeedback.tsx +2 -1
- package/src/getShadowNodeFromRef.ts +2 -2
- package/src/ghQueueMicrotask.ts +7 -4
- package/src/handlers/FlingGestureHandler.ts +1 -6
- package/src/handlers/ForceTouchGestureHandler.ts +1 -12
- package/src/handlers/GestureHandlerEventPayload.ts +184 -0
- package/src/handlers/LongPressGestureHandler.ts +1 -40
- package/src/handlers/NativeViewGestureHandler.ts +1 -7
- package/src/handlers/PanGestureHandler.ts +1 -58
- package/src/handlers/PinchGestureHandler.ts +1 -27
- package/src/handlers/RotationGestureHandler.ts +1 -27
- package/src/handlers/TapGestureHandler.ts +1 -6
- package/src/handlers/createHandler.tsx +6 -11
- package/src/handlers/createNativeWrapper.tsx +3 -3
- package/src/handlers/gestureHandlerCommon.ts +3 -79
- package/src/handlers/gestureHandlerTypesCompat.ts +16 -30
- package/src/handlers/gestures/GestureDetector/Wrap.tsx +1 -1
- package/src/handlers/gestures/GestureDetector/attachHandlers.ts +4 -7
- package/src/handlers/gestures/GestureDetector/dropHandlers.ts +1 -1
- package/src/handlers/gestures/GestureDetector/index.tsx +1 -1
- package/src/handlers/gestures/GestureDetector/updateHandlers.ts +20 -30
- package/src/handlers/gestures/GestureDetector/useDetectorUpdater.ts +1 -1
- package/src/handlers/gestures/GestureDetector/utils.ts +5 -5
- package/src/handlers/gestures/flingGesture.ts +2 -4
- package/src/handlers/gestures/forceTouchGesture.ts +2 -4
- package/src/handlers/gestures/gesture.ts +17 -15
- package/src/handlers/gestures/gestureComposition.ts +5 -5
- package/src/handlers/gestures/gestureStateManager.ts +1 -1
- package/src/handlers/gestures/longPressGesture.ts +2 -4
- package/src/handlers/gestures/nativeGesture.ts +2 -4
- package/src/handlers/gestures/panGesture.ts +2 -4
- package/src/handlers/gestures/pinchGesture.ts +1 -1
- package/src/handlers/gestures/rotationGesture.ts +1 -1
- package/src/handlers/gestures/tapGesture.ts +2 -4
- package/src/handlers/getNextHandlerTag.ts +5 -0
- package/src/handlers/handlersRegistry.ts +0 -6
- package/src/handlers/utils.ts +75 -0
- package/src/index.ts +25 -36
- package/src/init.ts +1 -1
- package/src/jestUtils/jestUtils.ts +12 -10
- package/src/mocks.ts +2 -2
- package/src/utils.ts +1 -1
- package/src/web/Gestures.ts +1 -1
- package/src/web/detectors/RotationGestureDetector.ts +1 -1
- package/src/web/detectors/ScaleGestureDetector.ts +4 -4
- package/src/web/handlers/FlingGestureHandler.ts +1 -1
- package/src/web/handlers/GestureHandler.ts +8 -14
- package/src/web/handlers/NativeViewGestureHandler.ts +3 -3
- package/src/web/handlers/PanGestureHandler.ts +1 -1
- package/src/web/handlers/TapGestureHandler.ts +1 -1
- package/src/web/tools/EventManager.ts +2 -2
- package/src/web/tools/GestureHandlerWebDelegate.ts +3 -8
- package/src/web/tools/LeastSquareSolver.ts +18 -18
- package/src/web/tools/PointerEventManager.ts +2 -2
- package/src/web/tools/PointerTracker.ts +2 -1
- package/src/web/tools/TouchEventManager.ts +4 -4
- package/src/web/tools/VelocityTracker.ts +6 -6
- package/src/web_hammer/NodeManager.ts +2 -11
@@ -1,12 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
Animated,
|
4
|
-
Platform,
|
5
|
-
processColor,
|
6
|
-
StyleSheet,
|
7
|
-
StyleProp,
|
8
|
-
ViewStyle,
|
9
|
-
} from 'react-native';
|
2
|
+
import { Animated, Platform, processColor, StyleSheet } from 'react-native';
|
10
3
|
|
11
4
|
import createNativeWrapper from '../handlers/createNativeWrapper';
|
12
5
|
import GestureHandlerButton from './GestureHandlerButton';
|
@@ -16,118 +9,15 @@ import {
|
|
16
9
|
GestureEvent,
|
17
10
|
HandlerStateChangeEvent,
|
18
11
|
} from '../handlers/gestureHandlerCommon';
|
19
|
-
import {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
*/
|
29
|
-
exclusive?: boolean;
|
30
|
-
// TODO: we should transform props in `createNativeWrapper`
|
31
|
-
|
32
|
-
/**
|
33
|
-
* Android only.
|
34
|
-
*
|
35
|
-
* Defines color of native ripple animation used since API level 21.
|
36
|
-
*/
|
37
|
-
rippleColor?: any; // it was present in BaseButtonProps before but is used here in code
|
38
|
-
|
39
|
-
/**
|
40
|
-
* Android only.
|
41
|
-
*
|
42
|
-
* Defines radius of native ripple animation used since API level 21.
|
43
|
-
*/
|
44
|
-
rippleRadius?: number | null;
|
45
|
-
|
46
|
-
/**
|
47
|
-
* Android only.
|
48
|
-
*
|
49
|
-
* Set this to true if you want the ripple animation to render outside the view bounds.
|
50
|
-
*/
|
51
|
-
borderless?: boolean;
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Android only.
|
55
|
-
*
|
56
|
-
* Defines whether the ripple animation should be drawn on the foreground of the view.
|
57
|
-
*/
|
58
|
-
foreground?: boolean;
|
59
|
-
|
60
|
-
/**
|
61
|
-
* Android only.
|
62
|
-
*
|
63
|
-
* Set this to true if you don't want the system to play sound when the button is pressed.
|
64
|
-
*/
|
65
|
-
touchSoundDisabled?: boolean;
|
66
|
-
}
|
67
|
-
|
68
|
-
interface ButtonWithRefProps {
|
69
|
-
innerRef?: React.ForwardedRef<React.ComponentType<any>>;
|
70
|
-
}
|
71
|
-
|
72
|
-
export interface BaseButtonProps extends RawButtonProps {
|
73
|
-
/**
|
74
|
-
* Called when the button gets pressed (analogous to `onPress` in
|
75
|
-
* `TouchableHighlight` from RN core).
|
76
|
-
*/
|
77
|
-
onPress?: (pointerInside: boolean) => void;
|
78
|
-
|
79
|
-
/**
|
80
|
-
* Called when the button gets pressed and is held for `delayLongPress`
|
81
|
-
* milliseconds.
|
82
|
-
*/
|
83
|
-
onLongPress?: () => void;
|
84
|
-
|
85
|
-
/**
|
86
|
-
* Called when button changes from inactive to active and vice versa. It
|
87
|
-
* passes active state as a boolean variable as a first parameter for that
|
88
|
-
* method.
|
89
|
-
*/
|
90
|
-
onActiveStateChange?: (active: boolean) => void;
|
91
|
-
style?: StyleProp<ViewStyle>;
|
92
|
-
testID?: string;
|
93
|
-
|
94
|
-
/**
|
95
|
-
* Delay, in milliseconds, after which the `onLongPress` callback gets called.
|
96
|
-
* Defaults to 600.
|
97
|
-
*/
|
98
|
-
delayLongPress?: number;
|
99
|
-
}
|
100
|
-
|
101
|
-
interface BaseButtonWithRefProps extends BaseButtonProps, ButtonWithRefProps {}
|
102
|
-
|
103
|
-
export interface RectButtonProps extends BaseButtonProps {
|
104
|
-
/**
|
105
|
-
* Background color that will be dimmed when button is in active state.
|
106
|
-
*/
|
107
|
-
underlayColor?: string;
|
108
|
-
|
109
|
-
/**
|
110
|
-
* iOS only.
|
111
|
-
*
|
112
|
-
* Opacity applied to the underlay when button is in active state.
|
113
|
-
*/
|
114
|
-
activeOpacity?: number;
|
115
|
-
}
|
116
|
-
|
117
|
-
interface RectButtonWithRefProps extends RectButtonProps, ButtonWithRefProps {}
|
118
|
-
|
119
|
-
export interface BorderlessButtonProps extends BaseButtonProps {
|
120
|
-
/**
|
121
|
-
* iOS only.
|
122
|
-
*
|
123
|
-
* Opacity applied to the button when it is in an active state.
|
124
|
-
*/
|
125
|
-
activeOpacity?: number;
|
126
|
-
}
|
127
|
-
|
128
|
-
interface BorderlessButtonWithRefProps
|
129
|
-
extends BorderlessButtonProps,
|
130
|
-
ButtonWithRefProps {}
|
12
|
+
import type { NativeViewGestureHandlerPayload } from '../handlers/GestureHandlerEventPayload';
|
13
|
+
import type {
|
14
|
+
BaseButtonWithRefProps,
|
15
|
+
BaseButtonProps,
|
16
|
+
RectButtonWithRefProps,
|
17
|
+
RectButtonProps,
|
18
|
+
BorderlessButtonWithRefProps,
|
19
|
+
BorderlessButtonProps,
|
20
|
+
} from './GestureButtonsProps';
|
131
21
|
|
132
22
|
export const RawButton = createNativeWrapper(GestureHandlerButton, {
|
133
23
|
shouldCancelWhenOutside: false,
|
@@ -166,7 +56,7 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
|
|
166
56
|
this.lastActive &&
|
167
57
|
this.props.onPress
|
168
58
|
) {
|
169
|
-
this.props.onPress(
|
59
|
+
this.props.onPress(pointerInside);
|
170
60
|
}
|
171
61
|
|
172
62
|
if (
|
@@ -183,7 +73,7 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
|
|
183
73
|
);
|
184
74
|
}
|
185
75
|
} else if (
|
186
|
-
//
|
76
|
+
// Cancel longpress timeout if it's set and the finger moved out of the view
|
187
77
|
state === State.ACTIVE &&
|
188
78
|
!pointerInside &&
|
189
79
|
this.longPressTimeout !== undefined
|
@@ -191,7 +81,7 @@ class InnerBaseButton extends React.Component<BaseButtonWithRefProps> {
|
|
191
81
|
clearTimeout(this.longPressTimeout);
|
192
82
|
this.longPressTimeout = undefined;
|
193
83
|
} else if (
|
194
|
-
//
|
84
|
+
// Cancel longpress timeout if it's set and the gesture has finished
|
195
85
|
this.longPressTimeout !== undefined &&
|
196
86
|
(state === State.END ||
|
197
87
|
state === State.CANCELLED ||
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
3
|
+
import type { NativeViewGestureHandlerProps } from '../handlers/NativeViewGestureHandler';
|
4
|
+
|
5
|
+
export interface RawButtonProps extends NativeViewGestureHandlerProps {
|
6
|
+
/**
|
7
|
+
* Defines if more than one button could be pressed simultaneously. By default
|
8
|
+
* set true.
|
9
|
+
*/
|
10
|
+
exclusive?: boolean;
|
11
|
+
// TODO: we should transform props in `createNativeWrapper`
|
12
|
+
/**
|
13
|
+
* Android only.
|
14
|
+
*
|
15
|
+
* Defines color of native ripple animation used since API level 21.
|
16
|
+
*/
|
17
|
+
rippleColor?: any; // it was present in BaseButtonProps before but is used here in code
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Android only.
|
21
|
+
*
|
22
|
+
* Defines radius of native ripple animation used since API level 21.
|
23
|
+
*/
|
24
|
+
rippleRadius?: number | null;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Android only.
|
28
|
+
*
|
29
|
+
* Set this to true if you want the ripple animation to render outside the view bounds.
|
30
|
+
*/
|
31
|
+
borderless?: boolean;
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Android only.
|
35
|
+
*
|
36
|
+
* Defines whether the ripple animation should be drawn on the foreground of the view.
|
37
|
+
*/
|
38
|
+
foreground?: boolean;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Android only.
|
42
|
+
*
|
43
|
+
* Set this to true if you don't want the system to play sound when the button is pressed.
|
44
|
+
*/
|
45
|
+
touchSoundDisabled?: boolean;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Style object, use it to set additional styles.
|
49
|
+
*/
|
50
|
+
style?: StyleProp<ViewStyle>;
|
51
|
+
}
|
52
|
+
interface ButtonWithRefProps {
|
53
|
+
innerRef?: React.ForwardedRef<React.ComponentType<any>>;
|
54
|
+
}
|
55
|
+
|
56
|
+
export interface BaseButtonProps extends RawButtonProps {
|
57
|
+
/**
|
58
|
+
* Called when the button gets pressed (analogous to `onPress` in
|
59
|
+
* `TouchableHighlight` from RN core).
|
60
|
+
*/
|
61
|
+
onPress?: (pointerInside: boolean) => void;
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Called when the button gets pressed and is held for `delayLongPress`
|
65
|
+
* milliseconds.
|
66
|
+
*/
|
67
|
+
onLongPress?: () => void;
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Called when button changes from inactive to active and vice versa. It
|
71
|
+
* passes active state as a boolean variable as a first parameter for that
|
72
|
+
* method.
|
73
|
+
*/
|
74
|
+
onActiveStateChange?: (active: boolean) => void;
|
75
|
+
style?: StyleProp<ViewStyle>;
|
76
|
+
testID?: string;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Delay, in milliseconds, after which the `onLongPress` callback gets called.
|
80
|
+
* Defaults to 600.
|
81
|
+
*/
|
82
|
+
delayLongPress?: number;
|
83
|
+
}
|
84
|
+
export interface BaseButtonWithRefProps
|
85
|
+
extends BaseButtonProps,
|
86
|
+
ButtonWithRefProps {}
|
87
|
+
|
88
|
+
export interface RectButtonProps extends BaseButtonProps {
|
89
|
+
/**
|
90
|
+
* Background color that will be dimmed when button is in active state.
|
91
|
+
*/
|
92
|
+
underlayColor?: string;
|
93
|
+
|
94
|
+
/**
|
95
|
+
* iOS only.
|
96
|
+
*
|
97
|
+
* Opacity applied to the underlay when button is in active state.
|
98
|
+
*/
|
99
|
+
activeOpacity?: number;
|
100
|
+
}
|
101
|
+
export interface RectButtonWithRefProps
|
102
|
+
extends RectButtonProps,
|
103
|
+
ButtonWithRefProps {}
|
104
|
+
|
105
|
+
export interface BorderlessButtonProps extends BaseButtonProps {
|
106
|
+
/**
|
107
|
+
* iOS only.
|
108
|
+
*
|
109
|
+
* Opacity applied to the button when it is in an active state.
|
110
|
+
*/
|
111
|
+
activeOpacity?: number;
|
112
|
+
}
|
113
|
+
export interface BorderlessButtonWithRefProps
|
114
|
+
extends BorderlessButtonProps,
|
115
|
+
ButtonWithRefProps {}
|
@@ -67,7 +67,7 @@ export const ScrollView = React.forwardRef<
|
|
67
67
|
/>
|
68
68
|
);
|
69
69
|
});
|
70
|
-
//
|
70
|
+
// Backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457
|
71
71
|
// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.
|
72
72
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
73
73
|
export type ScrollView = typeof GHScrollView & RNScrollView;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { HostComponent } from 'react-native';
|
2
|
-
import { RawButtonProps } from './
|
2
|
+
import type { RawButtonProps } from './GestureButtonsProps';
|
3
3
|
import RNGestureHandlerButtonNativeComponent from '../specs/RNGestureHandlerButtonNativeComponent';
|
4
4
|
|
5
5
|
export default RNGestureHandlerButtonNativeComponent as HostComponent<RawButtonProps>;
|
@@ -12,7 +12,7 @@ export default function GestureHandlerRootView({
|
|
12
12
|
style,
|
13
13
|
...rest
|
14
14
|
}: GestureHandlerRootViewProps) {
|
15
|
-
//
|
15
|
+
// Try initialize fabric on the first render, at this point we can
|
16
16
|
// reliably check if fabric is enabled (the function contains a flag
|
17
17
|
// to make sure it's called only once)
|
18
18
|
maybeInitializeFabric();
|
@@ -11,7 +11,7 @@ export default function GestureHandlerRootView({
|
|
11
11
|
style,
|
12
12
|
...rest
|
13
13
|
}: GestureHandlerRootViewProps) {
|
14
|
-
//
|
14
|
+
// Try initialize fabric on the first render, at this point we can
|
15
15
|
// reliably check if fabric is enabled (the function contains a flag
|
16
16
|
// to make sure it's called only once)
|
17
17
|
maybeInitializeFabric();
|