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,13 +1,14 @@
|
|
1
|
-
import { BaseButtonProps, BorderlessButtonProps, RawButtonProps, RectButtonProps } from '../components/
|
1
|
+
import type { BaseButtonProps, BorderlessButtonProps, RawButtonProps, RectButtonProps } from '../components/GestureButtonsProps';
|
2
2
|
import { GestureEvent, GestureEventPayload, HandlerStateChangeEvent, HandlerStateChangeEventPayload } from './gestureHandlerCommon';
|
3
|
-
import {
|
4
|
-
import { ForceTouchGestureHandlerEventPayload,
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
3
|
+
import type { FlingGestureHandlerProps } from './FlingGestureHandler';
|
4
|
+
import type { FlingGestureHandlerEventPayload, ForceTouchGestureHandlerEventPayload, LongPressGestureHandlerEventPayload, PanGestureHandlerEventPayload, PinchGestureHandlerEventPayload, RotationGestureHandlerEventPayload, TapGestureHandlerEventPayload, NativeViewGestureHandlerPayload } from './GestureHandlerEventPayload';
|
5
|
+
import type { ForceTouchGestureHandlerProps } from './ForceTouchGestureHandler';
|
6
|
+
import type { LongPressGestureHandlerProps } from './LongPressGestureHandler';
|
7
|
+
import type { PanGestureHandlerProps } from './PanGestureHandler';
|
8
|
+
import type { PinchGestureHandlerProps } from './PinchGestureHandler';
|
9
|
+
import type { RotationGestureHandlerProps } from './RotationGestureHandler';
|
10
|
+
import type { TapGestureHandlerProps } from './TapGestureHandler';
|
11
|
+
import type { NativeViewGestureHandlerProps } from './NativeViewGestureHandler';
|
11
12
|
export type GestureHandlerGestureEventNativeEvent = GestureEventPayload;
|
12
13
|
export type GestureHandlerStateChangeNativeEvent = HandlerStateChangeEventPayload;
|
13
14
|
export type GestureHandlerGestureEvent = GestureEvent;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BaseGesture, BaseGestureConfig } from './gesture';
|
2
|
-
import { FlingGestureConfig
|
2
|
+
import { FlingGestureConfig } from '../FlingGestureHandler';
|
3
|
+
import type { FlingGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
3
4
|
export declare class FlingGesture extends BaseGesture<FlingGestureHandlerEventPayload> {
|
4
5
|
config: BaseGestureConfig & FlingGestureConfig;
|
5
6
|
constructor();
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BaseGestureConfig, ContinousBaseGesture } from './gesture';
|
2
|
-
import { ForceTouchGestureConfig
|
2
|
+
import { ForceTouchGestureConfig } from '../ForceTouchGestureHandler';
|
3
|
+
import type { ForceTouchGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
3
4
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
4
5
|
export type ForceTouchGestureChangeEventPayload = {
|
5
6
|
forceChange: number;
|
@@ -1,13 +1,7 @@
|
|
1
|
-
|
2
|
-
import { ForceTouchGestureHandlerEventPayload } from '../ForceTouchGestureHandler';
|
1
|
+
/// <reference types="react" />
|
3
2
|
import { HitSlop, CommonGestureConfig, GestureTouchEvent, GestureStateChangeEvent, GestureUpdateEvent, ActiveCursor, MouseButton } from '../gestureHandlerCommon';
|
4
3
|
import { GestureStateManagerType } from './gestureStateManager';
|
5
|
-
import { LongPressGestureHandlerEventPayload } from '../
|
6
|
-
import { PanGestureHandlerEventPayload } from '../PanGestureHandler';
|
7
|
-
import { PinchGestureHandlerEventPayload } from '../PinchGestureHandler';
|
8
|
-
import { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';
|
9
|
-
import { TapGestureHandlerEventPayload } from '../TapGestureHandler';
|
10
|
-
import { NativeViewGestureHandlerPayload } from '../NativeViewGestureHandler';
|
4
|
+
import type { FlingGestureHandlerEventPayload, ForceTouchGestureHandlerEventPayload, LongPressGestureHandlerEventPayload, PanGestureHandlerEventPayload, PinchGestureHandlerEventPayload, RotationGestureHandlerEventPayload, TapGestureHandlerEventPayload, NativeViewGestureHandlerPayload } from '../GestureHandlerEventPayload';
|
11
5
|
export type GestureType = BaseGesture<Record<string, unknown>> | BaseGesture<Record<string, never>> | BaseGesture<TapGestureHandlerEventPayload> | BaseGesture<PanGestureHandlerEventPayload> | BaseGesture<LongPressGestureHandlerEventPayload> | BaseGesture<RotationGestureHandlerEventPayload> | BaseGesture<PinchGestureHandlerEventPayload> | BaseGesture<FlingGestureHandlerEventPayload> | BaseGesture<ForceTouchGestureHandlerEventPayload> | BaseGesture<NativeViewGestureHandlerPayload>;
|
12
6
|
export type GestureRef = number | GestureType | React.RefObject<GestureType | undefined> | React.RefObject<React.ComponentType | undefined>;
|
13
7
|
export interface BaseGestureConfig extends CommonGestureConfig, Record<string, unknown> {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BaseGesture, BaseGestureConfig } from './gesture';
|
2
|
-
import { LongPressGestureConfig
|
2
|
+
import { LongPressGestureConfig } from '../LongPressGestureHandler';
|
3
|
+
import type { LongPressGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
3
4
|
export declare class LongPressGesture extends BaseGesture<LongPressGestureHandlerEventPayload> {
|
4
5
|
config: BaseGestureConfig & LongPressGestureConfig;
|
5
6
|
constructor();
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BaseGestureConfig, BaseGesture } from './gesture';
|
2
|
-
import { NativeViewGestureConfig
|
2
|
+
import { NativeViewGestureConfig } from '../NativeViewGestureHandler';
|
3
|
+
import type { NativeViewGestureHandlerPayload } from '../GestureHandlerEventPayload';
|
3
4
|
export declare class NativeGesture extends BaseGesture<NativeViewGestureHandlerPayload> {
|
4
5
|
config: BaseGestureConfig & NativeViewGestureConfig;
|
5
6
|
constructor();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { BaseGestureConfig, ContinousBaseGesture } from './gesture';
|
2
2
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
3
|
-
import { PanGestureConfig
|
3
|
+
import { PanGestureConfig } from '../PanGestureHandler';
|
4
|
+
import type { PanGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
4
5
|
export type PanGestureChangeEventPayload = {
|
5
6
|
changeX: number;
|
6
7
|
changeY: number;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ContinousBaseGesture } from './gesture';
|
2
|
-
import { PinchGestureHandlerEventPayload } from '../
|
2
|
+
import type { PinchGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
3
3
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
4
4
|
export type PinchGestureChangeEventPayload = {
|
5
5
|
scaleChange: number;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ContinousBaseGesture } from './gesture';
|
2
|
-
import { RotationGestureHandlerEventPayload } from '../
|
2
|
+
import type { RotationGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
3
3
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
4
4
|
type RotationGestureChangeEventPayload = {
|
5
5
|
rotationChange: number;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BaseGestureConfig, BaseGesture } from './gesture';
|
2
|
-
import { TapGestureConfig
|
2
|
+
import { TapGestureConfig } from '../TapGestureHandler';
|
3
|
+
import type { TapGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
|
3
4
|
export declare class TapGesture extends BaseGesture<TapGestureHandlerEventPayload> {
|
4
5
|
config: BaseGestureConfig & TapGestureConfig;
|
5
6
|
constructor();
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function getNextHandlerTag(): number;
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import { GestureType } from './gestures/gesture';
|
2
2
|
import { GestureEvent, HandlerStateChangeEvent } from './gestureHandlerCommon';
|
3
3
|
export declare const handlerIDToTag: Record<string, number>;
|
4
|
-
export declare function getNextHandlerTag(): number;
|
5
4
|
export declare function registerHandler(handlerTag: number, handler: GestureType, testID?: string): void;
|
6
5
|
export declare function registerOldGestureHandler(handlerTag: number, handler: GestureHandlerCallbacks): void;
|
7
6
|
export declare function unregisterHandler(handlerTag: number, testID?: string): void;
|
8
7
|
export declare function findHandler(handlerTag: number): GestureType | undefined;
|
9
8
|
export declare function findOldGestureHandler(handlerTag: number): GestureHandlerCallbacks | undefined;
|
10
|
-
export declare function findHandlerByTestID(testID: string): import("./gestures/gesture").BaseGesture<Record<string, unknown>> | import("./gestures/gesture").BaseGesture<Record<string, never>> | import("./gestures/gesture").BaseGesture<import("./
|
9
|
+
export declare function findHandlerByTestID(testID: string): import("./gestures/gesture").BaseGesture<Record<string, unknown>> | import("./gestures/gesture").BaseGesture<Record<string, never>> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").TapGestureHandlerEventPayload> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").PanGestureHandlerEventPayload> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").LongPressGestureHandlerEventPayload> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").RotationGestureHandlerEventPayload> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").PinchGestureHandlerEventPayload> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").ForceTouchGestureHandlerEventPayload> | import("./gestures/gesture").BaseGesture<import("./GestureHandlerEventPayload").NativeViewGestureHandlerPayload> | null;
|
11
10
|
export interface GestureHandlerCallbacks {
|
12
11
|
onGestureEvent: (event: GestureEvent<any>) => void;
|
13
12
|
onGestureStateChange: (event: HandlerStateChangeEvent<any>) => void;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export declare function filterConfig(props: Record<string, unknown>, validProps: string[], defaults?: Record<string, unknown>): {
|
3
|
+
[x: string]: unknown;
|
4
|
+
};
|
5
|
+
export declare function findNodeHandle(node: null | number | React.Component<any, any> | React.ComponentClass<any>): null | number | React.Component<any, any> | React.ComponentClass<any>;
|
6
|
+
export declare function scheduleFlushOperations(): void;
|
@@ -6,16 +6,17 @@ export { default as GestureHandlerRootView } from './components/GestureHandlerRo
|
|
6
6
|
export type { GestureEvent, HandlerStateChangeEvent, GestureEventPayload, HandlerStateChangeEventPayload, GestureTouchEvent, TouchData, GestureUpdateEvent, GestureStateChangeEvent, } from './handlers/gestureHandlerCommon';
|
7
7
|
export { MouseButton } from './handlers/gestureHandlerCommon';
|
8
8
|
export type { GestureType } from './handlers/gestures/gesture';
|
9
|
-
export type { TapGestureHandlerEventPayload,
|
10
|
-
export type {
|
9
|
+
export type { TapGestureHandlerEventPayload, ForceTouchGestureHandlerEventPayload, LongPressGestureHandlerEventPayload, PanGestureHandlerEventPayload, PinchGestureHandlerEventPayload, RotationGestureHandlerEventPayload, NativeViewGestureHandlerPayload, FlingGestureHandlerEventPayload, } from './handlers/GestureHandlerEventPayload';
|
10
|
+
export type { TapGestureHandlerProps } from './handlers/TapGestureHandler';
|
11
|
+
export type { ForceTouchGestureHandlerProps } from './handlers/ForceTouchGestureHandler';
|
11
12
|
export type { ForceTouchGestureChangeEventPayload } from './handlers/gestures/forceTouchGesture';
|
12
|
-
export type {
|
13
|
-
export type {
|
13
|
+
export type { LongPressGestureHandlerProps } from './handlers/LongPressGestureHandler';
|
14
|
+
export type { PanGestureHandlerProps } from './handlers/PanGestureHandler';
|
14
15
|
export type { PanGestureChangeEventPayload } from './handlers/gestures/panGesture';
|
15
|
-
export type {
|
16
|
+
export type { PinchGestureHandlerProps } from './handlers/PinchGestureHandler';
|
16
17
|
export type { PinchGestureChangeEventPayload } from './handlers/gestures/pinchGesture';
|
17
|
-
export type {
|
18
|
-
export type {
|
18
|
+
export type { RotationGestureHandlerProps } from './handlers/RotationGestureHandler';
|
19
|
+
export type { FlingGestureHandlerProps } from './handlers/FlingGestureHandler';
|
19
20
|
export { TapGestureHandler } from './handlers/TapGestureHandler';
|
20
21
|
export { ForceTouchGestureHandler } from './handlers/ForceTouchGestureHandler';
|
21
22
|
export { LongPressGestureHandler } from './handlers/LongPressGestureHandler';
|
@@ -24,7 +25,7 @@ export { PinchGestureHandler } from './handlers/PinchGestureHandler';
|
|
24
25
|
export { RotationGestureHandler } from './handlers/RotationGestureHandler';
|
25
26
|
export { FlingGestureHandler } from './handlers/FlingGestureHandler';
|
26
27
|
export { default as createNativeWrapper } from './handlers/createNativeWrapper';
|
27
|
-
export type {
|
28
|
+
export type { NativeViewGestureHandlerProps } from './handlers/NativeViewGestureHandler';
|
28
29
|
export { GestureDetector } from './handlers/gestures/GestureDetector';
|
29
30
|
export { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';
|
30
31
|
export type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';
|
@@ -40,7 +41,7 @@ export type { HoverGestureType as HoverGesture } from './handlers/gestures/hover
|
|
40
41
|
export type { ComposedGestureType as ComposedGesture, RaceGestureType as RaceGesture, SimultaneousGestureType as SimultaneousGesture, ExclusiveGestureType as ExclusiveGesture, } from './handlers/gestures/gestureComposition';
|
41
42
|
export type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';
|
42
43
|
export { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';
|
43
|
-
export type { RawButtonProps, BaseButtonProps, RectButtonProps, BorderlessButtonProps, } from './components/
|
44
|
+
export type { RawButtonProps, BaseButtonProps, RectButtonProps, BorderlessButtonProps, } from './components/GestureButtonsProps';
|
44
45
|
export { RawButton, BaseButton, RectButton, BorderlessButton, PureNativeButton, } from './components/GestureButtons';
|
45
46
|
export type { TouchableHighlightProps, TouchableOpacityProps, TouchableWithoutFeedbackProps, } from './components/touchables';
|
46
47
|
export { TouchableHighlight, TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, } from './components/touchables';
|
@@ -49,6 +50,8 @@ export { HoverEffect } from './handlers/gestures/hoverGesture';
|
|
49
50
|
export type { GestureHandlerGestureEvent, GestureHandlerStateChangeEvent, GestureHandlerGestureEventNativeEvent, GestureHandlerStateChangeNativeEvent, NativeViewGestureHandlerGestureEvent, NativeViewGestureHandlerStateChangeEvent, TapGestureHandlerGestureEvent, TapGestureHandlerStateChangeEvent, ForceTouchGestureHandlerGestureEvent, ForceTouchGestureHandlerStateChangeEvent, LongPressGestureHandlerGestureEvent, LongPressGestureHandlerStateChangeEvent, PanGestureHandlerGestureEvent, PanGestureHandlerStateChangeEvent, PinchGestureHandlerGestureEvent, PinchGestureHandlerStateChangeEvent, RotationGestureHandlerGestureEvent, RotationGestureHandlerStateChangeEvent, FlingGestureHandlerGestureEvent, FlingGestureHandlerStateChangeEvent, NativeViewGestureHandlerProperties, TapGestureHandlerProperties, LongPressGestureHandlerProperties, PanGestureHandlerProperties, PinchGestureHandlerProperties, RotationGestureHandlerProperties, FlingGestureHandlerProperties, ForceTouchGestureHandlerProperties, RawButtonProperties, BaseButtonProperties, RectButtonProperties, BorderlessButtonProperties, } from './handlers/gestureHandlerTypesCompat';
|
50
51
|
export type { SwipeableProps } from './components/Swipeable';
|
51
52
|
export { default as Swipeable } from './components/Swipeable';
|
53
|
+
export type { PressableProps } from './components/Pressable';
|
54
|
+
export { default as Pressable } from './components/Pressable';
|
52
55
|
export type { DrawerLayoutProps, DrawerPosition, DrawerState, DrawerType, DrawerLockMode, DrawerKeyboardDismissMode, } from './components/DrawerLayout';
|
53
56
|
export { default as DrawerLayout } from './components/DrawerLayout';
|
54
57
|
export { enableExperimentalWebImplementation, enableLegacyWebImplementation, } from './EnableNewWebImplementation';
|
@@ -1,6 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { ReactTestInstance } from 'react-test-renderer';
|
2
3
|
import { FlingGestureHandler } from '../handlers/FlingGestureHandler';
|
3
|
-
import { ForceTouchGestureHandler
|
4
|
+
import { ForceTouchGestureHandler } from '../handlers/ForceTouchGestureHandler';
|
4
5
|
import { BaseGestureHandlerProps, GestureEvent, HandlerStateChangeEvent } from '../handlers/gestureHandlerCommon';
|
5
6
|
import { FlingGesture } from '../handlers/gestures/flingGesture';
|
6
7
|
import { ForceTouchGesture } from '../handlers/gestures/forceTouchGesture';
|
@@ -11,12 +12,13 @@ import { PanGesture } from '../handlers/gestures/panGesture';
|
|
11
12
|
import { PinchGesture } from '../handlers/gestures/pinchGesture';
|
12
13
|
import { RotationGesture } from '../handlers/gestures/rotationGesture';
|
13
14
|
import { TapGesture } from '../handlers/gestures/tapGesture';
|
14
|
-
import { LongPressGestureHandler
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
import {
|
19
|
-
import {
|
15
|
+
import { LongPressGestureHandler } from '../handlers/LongPressGestureHandler';
|
16
|
+
import type { ForceTouchGestureHandlerEventPayload, LongPressGestureHandlerEventPayload, NativeViewGestureHandlerPayload, PanGestureHandlerEventPayload, PinchGestureHandlerEventPayload, RotationGestureHandlerEventPayload, TapGestureHandlerEventPayload } from '../handlers/GestureHandlerEventPayload';
|
17
|
+
import { NativeViewGestureHandler } from '../handlers/NativeViewGestureHandler';
|
18
|
+
import { PanGestureHandler } from '../handlers/PanGestureHandler';
|
19
|
+
import { PinchGestureHandler } from '../handlers/PinchGestureHandler';
|
20
|
+
import { RotationGestureHandler } from '../handlers/RotationGestureHandler';
|
21
|
+
import { TapGestureHandler } from '../handlers/TapGestureHandler';
|
20
22
|
type GestureHandlerTestEvent<TEventPayload extends Record<string, unknown> = Record<string, unknown>> = (GestureEvent<TEventPayload> | HandlerStateChangeEvent<TEventPayload>)['nativeEvent'];
|
21
23
|
type AllGestures = TapGesture | PanGesture | LongPressGesture | RotationGesture | PinchGesture | FlingGesture | ForceTouchGesture | NativeGesture;
|
22
24
|
type AllHandlers = TapGestureHandler | PanGestureHandler | LongPressGestureHandler | RotationGestureHandler | PinchGestureHandler | FlingGestureHandler | ForceTouchGestureHandler | NativeViewGestureHandler;
|
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export declare function
|
4
|
-
export declare function createGestureHandler(handlerTag: number, handler: InstanceType<ValueOf<typeof HammerGestures>>): void;
|
1
|
+
export declare const gestures: Record<number, any>;
|
2
|
+
export declare function getHandler(tag: number): any;
|
3
|
+
export declare function createGestureHandler(handlerTag: number, handler: any): void;
|
5
4
|
export declare function dropGestureHandler(handlerTag: number): void;
|
6
5
|
export declare function getNodes(): {
|
7
|
-
[x: number]:
|
6
|
+
[x: number]: any;
|
8
7
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-gesture-handler",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.18.0",
|
4
4
|
"description": "Experimental implementation of a new declarative API for gesture handling in react-native",
|
5
5
|
"scripts": {
|
6
6
|
"prepare": "bob build && husky install",
|
@@ -15,7 +15,9 @@
|
|
15
15
|
"lint:js": "eslint --ext '.js,.ts,.tsx' src/ example/src FabricExample/src MacOSExample/src && yarn prettier --check './{src,example,FabricExample,MacOSExample}/**/*.{js,jsx,ts,tsx}'",
|
16
16
|
"lint:js-root": "eslint --ext '.js,.ts,.tsx' src/ && yarn prettier --check './src/**/*.{js,jsx,ts,tsx}'",
|
17
17
|
"lint:android": "./android/gradlew -p android spotlessCheck -q",
|
18
|
-
"
|
18
|
+
"circular-dependency-check": "yarn madge --extensions js,ts,tsx --circular src",
|
19
|
+
"architectures-consistency-check": "node ./scripts/codegen-check-consistency.js",
|
20
|
+
"sync-architectures": "node ./scripts/codegen-sync-archs.js"
|
19
21
|
},
|
20
22
|
"react-native": "src/index.ts",
|
21
23
|
"main": "lib/commonjs/index.js",
|
@@ -39,6 +41,7 @@
|
|
39
41
|
"android/noreanimated/src/main/java/",
|
40
42
|
"apple/",
|
41
43
|
"Swipeable/",
|
44
|
+
"ReanimatedSwipeable/",
|
42
45
|
"jest-utils/",
|
43
46
|
"DrawerLayout/",
|
44
47
|
"README.md",
|
@@ -65,21 +68,15 @@
|
|
65
68
|
"invariant": "^2.2.4",
|
66
69
|
"prop-types": "^15.7.2"
|
67
70
|
},
|
68
|
-
"jest": {
|
69
|
-
"preset": "react-native",
|
70
|
-
"modulePathIgnorePatterns": [
|
71
|
-
"<rootDir>/lib/"
|
72
|
-
]
|
73
|
-
},
|
74
71
|
"devDependencies": {
|
75
72
|
"@babel/core": "^7.12.9",
|
76
73
|
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
77
74
|
"@babel/preset-env": "^7.12.11",
|
78
75
|
"@babel/preset-typescript": "^7.12.7",
|
79
76
|
"@babel/runtime": "^7.12.5",
|
80
|
-
"@react-native/babel-preset": "^0.
|
81
|
-
"@testing-library/jest-native": "^4.
|
82
|
-
"@testing-library/react-native": "^
|
77
|
+
"@react-native/babel-preset": "^0.74.85",
|
78
|
+
"@testing-library/jest-native": "^5.4.3",
|
79
|
+
"@testing-library/react-native": "^12.5.1",
|
83
80
|
"@types/hammerjs": "^2.0.38",
|
84
81
|
"@types/hoist-non-react-statics": "^3.3.1",
|
85
82
|
"@types/jest": "^27.0.3",
|
@@ -96,17 +93,17 @@
|
|
96
93
|
"eslint-plugin-jest": "^26.0.0",
|
97
94
|
"expo": "^35.0.1",
|
98
95
|
"husky": "^8.0.1",
|
99
|
-
"jest": "^
|
96
|
+
"jest": "^28.1.0",
|
100
97
|
"lint-staged": "^12.3.2",
|
101
98
|
"madge": "^6.1.0",
|
102
|
-
"prettier": "
|
99
|
+
"prettier": "2.7.1",
|
103
100
|
"react": "18.2.0",
|
104
101
|
"react-dom": "^16.12.0",
|
105
|
-
"react-native": "0.74.
|
102
|
+
"react-native": "0.74.3",
|
106
103
|
"react-native-builder-bob": "^0.17.1",
|
107
104
|
"react-native-reanimated": "^3.12.0",
|
108
105
|
"react-native-web": "^0.11.7",
|
109
|
-
"react-test-renderer": "
|
106
|
+
"react-test-renderer": "18.2.0",
|
110
107
|
"release-it": "^13.6.5",
|
111
108
|
"typescript": "5.0.4"
|
112
109
|
},
|
@@ -117,7 +114,8 @@
|
|
117
114
|
"lint-staged": {
|
118
115
|
"./{src,example,FabricExample,MacOSExample}/**/*.{ts,tsx}": "yarn format:js",
|
119
116
|
"android/**/*.kt": "yarn format:android",
|
120
|
-
"apple/**/*.{h,m,mm,cpp}": "yarn format:ios"
|
117
|
+
"apple/**/*.{h,m,mm,cpp}": "yarn format:ios",
|
118
|
+
"src/specs/*.ts": "yarn sync-architectures"
|
121
119
|
},
|
122
120
|
"release-it": {
|
123
121
|
"hooks": {
|
package/src/Directions.ts
CHANGED
@@ -3,7 +3,7 @@ const LEFT = 2;
|
|
3
3
|
const UP = 4;
|
4
4
|
const DOWN = 8;
|
5
5
|
|
6
|
-
//
|
6
|
+
// Public interface
|
7
7
|
export const Directions = {
|
8
8
|
RIGHT: RIGHT,
|
9
9
|
LEFT: LEFT,
|
@@ -11,7 +11,7 @@ export const Directions = {
|
|
11
11
|
DOWN: DOWN,
|
12
12
|
} as const;
|
13
13
|
|
14
|
-
//
|
14
|
+
// Internal interface
|
15
15
|
export const DiagonalDirections = {
|
16
16
|
UP_RIGHT: UP | RIGHT,
|
17
17
|
DOWN_RIGHT: DOWN | RIGHT,
|
@@ -67,10 +67,10 @@ export default {
|
|
67
67
|
}
|
68
68
|
|
69
69
|
if (isNewWebImplementationEnabled()) {
|
70
|
-
|
70
|
+
// @ts-ignore Types should be HTMLElement or React.Component
|
71
71
|
NodeManager.getHandler(handlerTag).init(newView, propsRef);
|
72
72
|
} else {
|
73
|
-
|
73
|
+
// @ts-ignore Types should be HTMLElement or React.Component
|
74
74
|
HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
|
75
75
|
}
|
76
76
|
},
|
@@ -30,14 +30,12 @@ import {
|
|
30
30
|
ActiveCursor,
|
31
31
|
MouseButton,
|
32
32
|
} from '../handlers/gestureHandlerCommon';
|
33
|
-
import {
|
34
|
-
|
33
|
+
import { PanGestureHandler } from '../handlers/PanGestureHandler';
|
34
|
+
import type {
|
35
35
|
PanGestureHandlerEventPayload,
|
36
|
-
} from '../handlers/PanGestureHandler';
|
37
|
-
import {
|
38
|
-
TapGestureHandler,
|
39
36
|
TapGestureHandlerEventPayload,
|
40
|
-
} from '../handlers/
|
37
|
+
} from '../handlers/GestureHandlerEventPayload';
|
38
|
+
import { TapGestureHandler } from '../handlers/TapGestureHandler';
|
41
39
|
import { State } from '../State';
|
42
40
|
|
43
41
|
const DRAG_TOSS = 0.05;
|
@@ -156,7 +154,7 @@ export interface DrawerLayoutProps {
|
|
156
154
|
|
157
155
|
onGestureRef?: (ref: PanGestureHandler) => void;
|
158
156
|
|
159
|
-
//
|
157
|
+
// Implicit `children` prop has been removed in @types/react^18.0.0
|
160
158
|
children?:
|
161
159
|
| React.ReactNode
|
162
160
|
| ((openValue?: AnimatedInterpolation) => React.ReactNode);
|
@@ -521,7 +519,7 @@ export default class DrawerLayout extends Component<
|
|
521
519
|
this.emitStateChanged(IDLE, willShow);
|
522
520
|
this.setState({ drawerOpened: willShow });
|
523
521
|
if (this.state.drawerState !== DRAGGING) {
|
524
|
-
//
|
522
|
+
// It's possilbe that user started drag while the drawer
|
525
523
|
// was settling, don't override state in this case
|
526
524
|
this.setState({ drawerState: IDLE });
|
527
525
|
}
|
@@ -603,7 +601,7 @@ export default class DrawerLayout extends Component<
|
|
603
601
|
const drawerSlide = drawerType !== 'back';
|
604
602
|
const containerSlide = drawerType !== 'front';
|
605
603
|
|
606
|
-
//
|
604
|
+
// We rely on row and row-reverse flex directions to position the drawer
|
607
605
|
// properly. Apparently for RTL these are flipped which requires us to use
|
608
606
|
// the opposite setting for the drawer to appear from left or right
|
609
607
|
// according to the drawerPosition prop
|