react-native-gesture-handler 2.17.0 → 2.18.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/ReanimatedSwipeable/package.json +6 -0
- package/android/build.gradle +0 -105
- 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,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
Animated,
|
|
5
|
-
Platform,
|
|
6
|
-
StyleProp,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
TouchableWithoutFeedbackProps,
|
|
9
|
-
Insets,
|
|
10
|
-
} from 'react-native';
|
|
3
|
+
import { Animated, Platform } from 'react-native';
|
|
11
4
|
|
|
12
5
|
import { State } from '../../State';
|
|
13
6
|
import { BaseButton } from '../GestureButtons';
|
|
@@ -15,10 +8,10 @@ import { BaseButton } from '../GestureButtons';
|
|
|
15
8
|
import {
|
|
16
9
|
GestureEvent,
|
|
17
10
|
HandlerStateChangeEvent,
|
|
18
|
-
UserSelect,
|
|
19
11
|
} from '../../handlers/gestureHandlerCommon';
|
|
20
|
-
import { NativeViewGestureHandlerPayload } from '../../handlers/
|
|
21
|
-
import { TouchableNativeFeedbackExtraProps } from './
|
|
12
|
+
import type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload';
|
|
13
|
+
import type { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';
|
|
14
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
22
15
|
|
|
23
16
|
/**
|
|
24
17
|
* Each touchable is a states' machine which preforms transitions.
|
|
@@ -35,26 +28,6 @@ export const TOUCHABLE_STATE = {
|
|
|
35
28
|
|
|
36
29
|
type TouchableState = typeof TOUCHABLE_STATE[keyof typeof TOUCHABLE_STATE];
|
|
37
30
|
|
|
38
|
-
export interface GenericTouchableProps
|
|
39
|
-
extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
|
40
|
-
// Decided to drop not used fields from RN's implementation.
|
|
41
|
-
// e.g. onBlur and onFocus as well as deprecated props. - TODO: this comment may be unuseful in this moment
|
|
42
|
-
|
|
43
|
-
// TODO: in RN these events get native event parameter, which prolly could be used in our implementation too
|
|
44
|
-
onPress?: () => void;
|
|
45
|
-
onPressIn?: () => void;
|
|
46
|
-
onPressOut?: () => void;
|
|
47
|
-
onLongPress?: () => void;
|
|
48
|
-
|
|
49
|
-
nativeID?: string;
|
|
50
|
-
shouldActivateOnStart?: boolean;
|
|
51
|
-
disallowInterruption?: boolean;
|
|
52
|
-
|
|
53
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
54
|
-
hitSlop?: Insets | number;
|
|
55
|
-
userSelect?: UserSelect;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
31
|
interface InternalProps {
|
|
59
32
|
extraButtonProps: TouchableNativeFeedbackExtraProps;
|
|
60
33
|
onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
|
|
@@ -80,7 +53,7 @@ export default class GenericTouchable extends Component<
|
|
|
80
53
|
},
|
|
81
54
|
};
|
|
82
55
|
|
|
83
|
-
//
|
|
56
|
+
// Timeout handlers
|
|
84
57
|
pressInTimeout: Timeout;
|
|
85
58
|
pressOutTimeout: Timeout;
|
|
86
59
|
longPressTimeout: Timeout;
|
|
@@ -147,7 +120,7 @@ export default class GenericTouchable extends Component<
|
|
|
147
120
|
componentDidMount() {
|
|
148
121
|
this.reset();
|
|
149
122
|
}
|
|
150
|
-
//
|
|
123
|
+
// Reset timeout to prevent memory leaks.
|
|
151
124
|
reset() {
|
|
152
125
|
this.longPressDetected = false;
|
|
153
126
|
this.pointerInside = true;
|
|
@@ -229,12 +202,12 @@ export default class GenericTouchable extends Component<
|
|
|
229
202
|
|
|
230
203
|
onLongPressDetected = () => {
|
|
231
204
|
this.longPressDetected = true;
|
|
232
|
-
//
|
|
205
|
+
// Checked for in the caller of `onLongPressDetected`, but better to check twice
|
|
233
206
|
this.props.onLongPress?.();
|
|
234
207
|
};
|
|
235
208
|
|
|
236
209
|
componentWillUnmount() {
|
|
237
|
-
//
|
|
210
|
+
// To prevent memory leaks
|
|
238
211
|
this.reset();
|
|
239
212
|
}
|
|
240
213
|
|
|
@@ -246,7 +219,7 @@ export default class GenericTouchable extends Component<
|
|
|
246
219
|
}
|
|
247
220
|
|
|
248
221
|
onMoveOut() {
|
|
249
|
-
//
|
|
222
|
+
// Long press should no longer be detected
|
|
250
223
|
clearTimeout(this.longPressTimeout!);
|
|
251
224
|
this.longPressTimeout = null;
|
|
252
225
|
if (this.STATE === TOUCHABLE_STATE.BEGAN) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
StyleProp,
|
|
3
|
+
ViewStyle,
|
|
4
|
+
TouchableWithoutFeedbackProps,
|
|
5
|
+
Insets,
|
|
6
|
+
} from 'react-native';
|
|
7
|
+
import type { UserSelect } from '../../handlers/gestureHandlerCommon';
|
|
8
|
+
|
|
9
|
+
export interface GenericTouchableProps
|
|
10
|
+
extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
|
11
|
+
// Decided to drop not used fields from RN's implementation.
|
|
12
|
+
// e.g. onBlur and onFocus as well as deprecated props. - TODO: this comment may be unuseful in this moment
|
|
13
|
+
// TODO: in RN these events get native event parameter, which prolly could be used in our implementation too
|
|
14
|
+
onPress?: () => void;
|
|
15
|
+
onPressIn?: () => void;
|
|
16
|
+
onPressOut?: () => void;
|
|
17
|
+
onLongPress?: () => void;
|
|
18
|
+
|
|
19
|
+
nativeID?: string;
|
|
20
|
+
shouldActivateOnStart?: boolean;
|
|
21
|
+
disallowInterruption?: boolean;
|
|
22
|
+
|
|
23
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
24
|
+
hitSlop?: Insets | number;
|
|
25
|
+
userSelect?: UserSelect;
|
|
26
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import GenericTouchable, {
|
|
4
|
-
|
|
5
|
-
TOUCHABLE_STATE,
|
|
6
|
-
} from './GenericTouchable';
|
|
3
|
+
import GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';
|
|
4
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
7
5
|
import {
|
|
8
6
|
StyleSheet,
|
|
9
7
|
View,
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Platform,
|
|
3
|
-
TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps,
|
|
4
|
-
ColorValue,
|
|
5
|
-
} from 'react-native';
|
|
1
|
+
import { Platform, ColorValue } from 'react-native';
|
|
6
2
|
import * as React from 'react';
|
|
7
3
|
import { Component } from 'react';
|
|
8
|
-
import GenericTouchable
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
rippleRadius?: number | null;
|
|
14
|
-
foreground?: boolean;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps &
|
|
18
|
-
GenericTouchableProps;
|
|
4
|
+
import GenericTouchable from './GenericTouchable';
|
|
5
|
+
import {
|
|
6
|
+
TouchableNativeFeedbackProps,
|
|
7
|
+
TouchableNativeFeedbackExtraProps,
|
|
8
|
+
} from './TouchableNativeFeedbackProps';
|
|
19
9
|
|
|
20
10
|
/**
|
|
21
11
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
|
@@ -33,7 +23,7 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
|
|
|
33
23
|
},
|
|
34
24
|
};
|
|
35
25
|
|
|
36
|
-
//
|
|
26
|
+
// Could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change
|
|
37
27
|
static SelectableBackground = (rippleRadius?: number) => ({
|
|
38
28
|
type: 'ThemeAttrAndroid',
|
|
39
29
|
// I added `attribute` prop to clone the implementation of RN and be able to use only 2 types
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps } from 'react-native';
|
|
2
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
3
|
+
|
|
4
|
+
export type TouchableNativeFeedbackExtraProps = {
|
|
5
|
+
borderless?: boolean;
|
|
6
|
+
rippleColor?: number | null;
|
|
7
|
+
rippleRadius?: number | null;
|
|
8
|
+
foreground?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps &
|
|
12
|
+
GenericTouchableProps;
|
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
View,
|
|
6
6
|
TouchableOpacityProps as RNTouchableOpacityProps,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import GenericTouchable, {
|
|
9
|
-
|
|
10
|
-
GenericTouchableProps,
|
|
11
|
-
} from './GenericTouchable';
|
|
8
|
+
import GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';
|
|
9
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
12
10
|
import * as React from 'react';
|
|
13
11
|
import { Component } from 'react';
|
|
14
12
|
|
|
@@ -26,7 +24,7 @@ export default class TouchableOpacity extends Component<TouchableOpacityProps> {
|
|
|
26
24
|
activeOpacity: 0.2,
|
|
27
25
|
};
|
|
28
26
|
|
|
29
|
-
//
|
|
27
|
+
// Opacity is 1 one by default but could be overwritten
|
|
30
28
|
getChildStyleOpacityWithDefault = () => {
|
|
31
29
|
const childStyle = StyleSheet.flatten(this.props.style) || {};
|
|
32
30
|
return childStyle.opacity == null
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import GenericTouchable
|
|
3
|
+
import GenericTouchable from './GenericTouchable';
|
|
4
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
|
4
5
|
|
|
5
6
|
export type TouchableWithoutFeedbackProps = GenericTouchableProps;
|
|
6
7
|
|
|
@@ -8,7 +8,7 @@ let getInternalInstanceHandleFromPublicInstance: (ref: unknown) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export function getShadowNodeFromRef(ref: unknown) {
|
|
11
|
-
//
|
|
11
|
+
// Load findHostInstance_DEPRECATED lazily because it may not be available before render
|
|
12
12
|
if (findHostInstance_DEPRECATED === undefined) {
|
|
13
13
|
try {
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -20,7 +20,7 @@ export function getShadowNodeFromRef(ref: unknown) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// Load findHostInstance_DEPRECATED lazily because it may not be available before render
|
|
24
24
|
if (getInternalInstanceHandleFromPublicInstance === undefined) {
|
|
25
25
|
try {
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
package/src/ghQueueMicrotask.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// That's why if `queueMicrotask` doesn't exist, we use `setImmediate` instead, since it was used before we switched to `queueMicrotask` in version 2.11.0
|
|
1
|
+
// We check for typeof requestAnimationFrame because of SSR
|
|
2
|
+
// Functions are bound to null to avoid issues with scope when using Metro inline requires.
|
|
4
3
|
export const ghQueueMicrotask =
|
|
5
|
-
typeof
|
|
4
|
+
typeof setImmediate === 'function'
|
|
5
|
+
? setImmediate.bind(null)
|
|
6
|
+
: typeof requestAnimationFrame === 'function'
|
|
7
|
+
? requestAnimationFrame.bind(null)
|
|
8
|
+
: queueMicrotask.bind(null);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FlingGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
|
1
2
|
import createHandler from './createHandler';
|
|
2
3
|
import {
|
|
3
4
|
BaseGestureHandlerProps,
|
|
@@ -9,12 +10,6 @@ export const flingGestureHandlerProps = [
|
|
|
9
10
|
'direction',
|
|
10
11
|
] as const;
|
|
11
12
|
|
|
12
|
-
export type FlingGestureHandlerEventPayload = {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
absoluteX: number;
|
|
16
|
-
absoluteY: number;
|
|
17
|
-
};
|
|
18
13
|
export interface FlingGestureConfig {
|
|
19
14
|
/**
|
|
20
15
|
* Expressed allowed direction of movement. It's possible to pass one or many
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
BaseGestureHandlerProps,
|
|
7
7
|
baseGestureHandlerProps,
|
|
8
8
|
} from './gestureHandlerCommon';
|
|
9
|
+
import type { ForceTouchGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
|
9
10
|
|
|
10
11
|
export const forceTouchGestureHandlerProps = [
|
|
11
12
|
'minForce',
|
|
@@ -28,18 +29,6 @@ class ForceTouchFallback extends React.Component<PropsWithChildren<unknown>> {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
export type ForceTouchGestureHandlerEventPayload = {
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
absoluteX: number;
|
|
35
|
-
absoluteY: number;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The pressure of a touch.
|
|
39
|
-
*/
|
|
40
|
-
force: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
32
|
export interface ForceTouchGestureConfig {
|
|
44
33
|
/**
|
|
45
34
|
*
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
export type FlingGestureHandlerEventPayload = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
absoluteX: number;
|
|
5
|
+
absoluteY: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ForceTouchGestureHandlerEventPayload = {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
absoluteX: number;
|
|
12
|
+
absoluteY: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The pressure of a touch.
|
|
16
|
+
*/
|
|
17
|
+
force: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type LongPressGestureHandlerEventPayload = {
|
|
21
|
+
/**
|
|
22
|
+
* X coordinate, expressed in points, of the current position of the pointer
|
|
23
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
|
24
|
+
* relative to the view attached to the handler.
|
|
25
|
+
*/
|
|
26
|
+
x: number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Y coordinate, expressed in points, of the current position of the pointer
|
|
30
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
|
31
|
+
* relative to the view attached to the handler.
|
|
32
|
+
*/
|
|
33
|
+
y: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* X coordinate, expressed in points, of the current position of the pointer
|
|
37
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
|
38
|
+
* relative to the window. It is recommended to use `absoluteX` instead of
|
|
39
|
+
* `x` in cases when the view attached to the handler can be transformed as an
|
|
40
|
+
* effect of the gesture.
|
|
41
|
+
*/
|
|
42
|
+
absoluteX: number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Y coordinate, expressed in points, of the current position of the pointer
|
|
46
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
|
47
|
+
* relative to the window. It is recommended to use `absoluteY` instead of
|
|
48
|
+
* `y` in cases when the view attached to the handler can be transformed as an
|
|
49
|
+
* effect of the gesture.
|
|
50
|
+
*/
|
|
51
|
+
absoluteY: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Duration of the long press (time since the start of the event), expressed
|
|
55
|
+
* in milliseconds.
|
|
56
|
+
*/
|
|
57
|
+
duration: number;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type NativeViewGestureHandlerPayload = {
|
|
61
|
+
/**
|
|
62
|
+
* True if gesture was performed inside of containing view, false otherwise.
|
|
63
|
+
*/
|
|
64
|
+
pointerInside: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type PanGestureHandlerEventPayload = {
|
|
68
|
+
/**
|
|
69
|
+
* X coordinate of the current position of the pointer (finger or a leading
|
|
70
|
+
* pointer when there are multiple fingers placed) relative to the view
|
|
71
|
+
* attached to the handler. Expressed in point units.
|
|
72
|
+
*/
|
|
73
|
+
x: number;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Y coordinate of the current position of the pointer (finger or a leading
|
|
77
|
+
* pointer when there are multiple fingers placed) relative to the view
|
|
78
|
+
* attached to the handler. Expressed in point units.
|
|
79
|
+
*/
|
|
80
|
+
y: number;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* X coordinate of the current position of the pointer (finger or a leading
|
|
84
|
+
* pointer when there are multiple fingers placed) relative to the window.
|
|
85
|
+
* The value is expressed in point units. It is recommended to use it instead
|
|
86
|
+
* of `x` in cases when the original view can be transformed as an effect of
|
|
87
|
+
* the gesture.
|
|
88
|
+
*/
|
|
89
|
+
absoluteX: number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Y coordinate of the current position of the pointer (finger or a leading
|
|
93
|
+
* pointer when there are multiple fingers placed) relative to the window.
|
|
94
|
+
* The value is expressed in point units. It is recommended to use it instead
|
|
95
|
+
* of `y` in cases when the original view can be transformed as an
|
|
96
|
+
* effect of the gesture.
|
|
97
|
+
*/
|
|
98
|
+
absoluteY: number;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Translation of the pan gesture along X axis accumulated over the time of
|
|
102
|
+
* the gesture. The value is expressed in the point units.
|
|
103
|
+
*/
|
|
104
|
+
translationX: number;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Translation of the pan gesture along Y axis accumulated over the time of
|
|
108
|
+
* the gesture. The value is expressed in the point units.
|
|
109
|
+
*/
|
|
110
|
+
translationY: number;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Velocity of the pan gesture along the X axis in the current moment. The
|
|
114
|
+
* value is expressed in point units per second.
|
|
115
|
+
*/
|
|
116
|
+
velocityX: number;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Velocity of the pan gesture along the Y axis in the current moment. The
|
|
120
|
+
* value is expressed in point units per second.
|
|
121
|
+
*/
|
|
122
|
+
velocityY: number;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type PinchGestureHandlerEventPayload = {
|
|
126
|
+
/**
|
|
127
|
+
* The scale factor relative to the points of the two touches in screen
|
|
128
|
+
* coordinates.
|
|
129
|
+
*/
|
|
130
|
+
scale: number;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Position expressed in points along X axis of center anchor point of
|
|
134
|
+
* gesture.
|
|
135
|
+
*/
|
|
136
|
+
focalX: number;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Position expressed in points along Y axis of center anchor point of
|
|
140
|
+
* gesture.
|
|
141
|
+
*/
|
|
142
|
+
focalY: number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* Velocity of the pan gesture the current moment. The value is expressed in
|
|
147
|
+
* point units per second.
|
|
148
|
+
*/
|
|
149
|
+
velocity: number;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type TapGestureHandlerEventPayload = {
|
|
153
|
+
x: number;
|
|
154
|
+
y: number;
|
|
155
|
+
absoluteX: number;
|
|
156
|
+
absoluteY: number;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type RotationGestureHandlerEventPayload = {
|
|
160
|
+
/**
|
|
161
|
+
* Amount rotated, expressed in radians, from the gesture's focal point
|
|
162
|
+
* (anchor).
|
|
163
|
+
*/
|
|
164
|
+
rotation: number;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* X coordinate, expressed in points, of the gesture's central focal point
|
|
168
|
+
* (anchor).
|
|
169
|
+
*/
|
|
170
|
+
anchorX: number;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Y coordinate, expressed in points, of the gesture's central focal point
|
|
174
|
+
* (anchor).
|
|
175
|
+
*/
|
|
176
|
+
anchorY: number;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* Instantaneous velocity, expressed in point units per second, of the
|
|
181
|
+
* gesture.
|
|
182
|
+
*/
|
|
183
|
+
velocity: number;
|
|
184
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LongPressGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
|
1
2
|
import createHandler from './createHandler';
|
|
2
3
|
import {
|
|
3
4
|
BaseGestureHandlerProps,
|
|
@@ -9,46 +10,6 @@ export const longPressGestureHandlerProps = [
|
|
|
9
10
|
'maxDist',
|
|
10
11
|
] as const;
|
|
11
12
|
|
|
12
|
-
export type LongPressGestureHandlerEventPayload = {
|
|
13
|
-
/**
|
|
14
|
-
* X coordinate, expressed in points, of the current position of the pointer
|
|
15
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
|
16
|
-
* relative to the view attached to the handler.
|
|
17
|
-
*/
|
|
18
|
-
x: number;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Y coordinate, expressed in points, of the current position of the pointer
|
|
22
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
|
23
|
-
* relative to the view attached to the handler.
|
|
24
|
-
*/
|
|
25
|
-
y: number;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* X coordinate, expressed in points, of the current position of the pointer
|
|
29
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
|
30
|
-
* relative to the window. It is recommended to use `absoluteX` instead of
|
|
31
|
-
* `x` in cases when the view attached to the handler can be transformed as an
|
|
32
|
-
* effect of the gesture.
|
|
33
|
-
*/
|
|
34
|
-
absoluteX: number;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Y coordinate, expressed in points, of the current position of the pointer
|
|
38
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
|
39
|
-
* relative to the window. It is recommended to use `absoluteY` instead of
|
|
40
|
-
* `y` in cases when the view attached to the handler can be transformed as an
|
|
41
|
-
* effect of the gesture.
|
|
42
|
-
*/
|
|
43
|
-
absoluteY: number;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Duration of the long press (time since the start of the event), expressed
|
|
47
|
-
* in milliseconds.
|
|
48
|
-
*/
|
|
49
|
-
duration: number;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
13
|
export interface LongPressGestureConfig {
|
|
53
14
|
/**
|
|
54
15
|
* Minimum time, expressed in milliseconds, that a finger must remain pressed on
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NativeViewGestureHandlerPayload } from './GestureHandlerEventPayload';
|
|
1
2
|
import createHandler from './createHandler';
|
|
2
3
|
import {
|
|
3
4
|
BaseGestureHandlerProps,
|
|
@@ -29,13 +30,6 @@ export interface NativeViewGestureHandlerProps
|
|
|
29
30
|
extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>,
|
|
30
31
|
NativeViewGestureConfig {}
|
|
31
32
|
|
|
32
|
-
export type NativeViewGestureHandlerPayload = {
|
|
33
|
-
/**
|
|
34
|
-
* True if gesture was performed inside of containing view, false otherwise.
|
|
35
|
-
*/
|
|
36
|
-
pointerInside: boolean;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
33
|
export const nativeViewProps = [
|
|
40
34
|
...baseGestureHandlerProps,
|
|
41
35
|
...nativeViewGestureHandlerProps,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PanGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
|
1
2
|
import createHandler from './createHandler';
|
|
2
3
|
import {
|
|
3
4
|
BaseGestureHandlerProps,
|
|
@@ -31,64 +32,6 @@ export const panGestureHandlerCustomNativeProps = [
|
|
|
31
32
|
'failOffsetXEnd',
|
|
32
33
|
] as const;
|
|
33
34
|
|
|
34
|
-
export type PanGestureHandlerEventPayload = {
|
|
35
|
-
/**
|
|
36
|
-
* X coordinate of the current position of the pointer (finger or a leading
|
|
37
|
-
* pointer when there are multiple fingers placed) relative to the view
|
|
38
|
-
* attached to the handler. Expressed in point units.
|
|
39
|
-
*/
|
|
40
|
-
x: number;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Y coordinate of the current position of the pointer (finger or a leading
|
|
44
|
-
* pointer when there are multiple fingers placed) relative to the view
|
|
45
|
-
* attached to the handler. Expressed in point units.
|
|
46
|
-
*/
|
|
47
|
-
y: number;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* X coordinate of the current position of the pointer (finger or a leading
|
|
51
|
-
* pointer when there are multiple fingers placed) relative to the window.
|
|
52
|
-
* The value is expressed in point units. It is recommended to use it instead
|
|
53
|
-
* of `x` in cases when the original view can be transformed as an effect of
|
|
54
|
-
* the gesture.
|
|
55
|
-
*/
|
|
56
|
-
absoluteX: number;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Y coordinate of the current position of the pointer (finger or a leading
|
|
60
|
-
* pointer when there are multiple fingers placed) relative to the window.
|
|
61
|
-
* The value is expressed in point units. It is recommended to use it instead
|
|
62
|
-
* of `y` in cases when the original view can be transformed as an
|
|
63
|
-
* effect of the gesture.
|
|
64
|
-
*/
|
|
65
|
-
absoluteY: number;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Translation of the pan gesture along X axis accumulated over the time of
|
|
69
|
-
* the gesture. The value is expressed in the point units.
|
|
70
|
-
*/
|
|
71
|
-
translationX: number;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Translation of the pan gesture along Y axis accumulated over the time of
|
|
75
|
-
* the gesture. The value is expressed in the point units.
|
|
76
|
-
*/
|
|
77
|
-
translationY: number;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Velocity of the pan gesture along the X axis in the current moment. The
|
|
81
|
-
* value is expressed in point units per second.
|
|
82
|
-
*/
|
|
83
|
-
velocityX: number;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Velocity of the pan gesture along the Y axis in the current moment. The
|
|
87
|
-
* value is expressed in point units per second.
|
|
88
|
-
*/
|
|
89
|
-
velocityY: number;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
35
|
interface CommonPanProperties {
|
|
93
36
|
/**
|
|
94
37
|
* Minimum distance the finger (or multiple finger) need to travel before the
|
|
@@ -1,36 +1,10 @@
|
|
|
1
|
+
import { PinchGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
|
1
2
|
import createHandler from './createHandler';
|
|
2
3
|
import {
|
|
3
4
|
BaseGestureHandlerProps,
|
|
4
5
|
baseGestureHandlerProps,
|
|
5
6
|
} from './gestureHandlerCommon';
|
|
6
7
|
|
|
7
|
-
export type PinchGestureHandlerEventPayload = {
|
|
8
|
-
/**
|
|
9
|
-
* The scale factor relative to the points of the two touches in screen
|
|
10
|
-
* coordinates.
|
|
11
|
-
*/
|
|
12
|
-
scale: number;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Position expressed in points along X axis of center anchor point of
|
|
16
|
-
* gesture.
|
|
17
|
-
*/
|
|
18
|
-
focalX: number;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Position expressed in points along Y axis of center anchor point of
|
|
22
|
-
* gesture.
|
|
23
|
-
*/
|
|
24
|
-
focalY: number;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* Velocity of the pan gesture the current moment. The value is expressed in
|
|
29
|
-
* point units per second.
|
|
30
|
-
*/
|
|
31
|
-
velocity: number;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
8
|
export interface PinchGestureHandlerProps
|
|
35
9
|
extends BaseGestureHandlerProps<PinchGestureHandlerEventPayload> {}
|
|
36
10
|
|