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
@@ -0,0 +1,125 @@
|
|
1
|
+
import React, { ForwardedRef } from 'react';
|
2
|
+
import type { PanGestureHandlerProps } from '../handlers/PanGestureHandler';
|
3
|
+
import { SharedValue } from 'react-native-reanimated';
|
4
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
5
|
+
type SwipeableExcludes = Exclude<keyof PanGestureHandlerProps, 'onGestureEvent' | 'onHandlerStateChange'>;
|
6
|
+
export interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableExcludes> {
|
7
|
+
/**
|
8
|
+
* Enables two-finger gestures on supported devices, for example iPads with
|
9
|
+
* trackpads. If not enabled the gesture will require click + drag, with
|
10
|
+
* `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger
|
11
|
+
* the gesture.
|
12
|
+
*/
|
13
|
+
enableTrackpadTwoFingerGesture?: boolean;
|
14
|
+
/**
|
15
|
+
* Specifies how much the visual interaction will be delayed compared to the
|
16
|
+
* gesture distance. e.g. value of 1 will indicate that the swipeable panel
|
17
|
+
* should exactly follow the gesture, 2 means it is going to be two times
|
18
|
+
* "slower".
|
19
|
+
*/
|
20
|
+
friction?: number;
|
21
|
+
/**
|
22
|
+
* Distance from the left edge at which released panel will animate to the
|
23
|
+
* open state (or the open panel will animate into the closed state). By
|
24
|
+
* default it's a half of the panel's width.
|
25
|
+
*/
|
26
|
+
leftThreshold?: number;
|
27
|
+
/**
|
28
|
+
* Distance from the right edge at which released panel will animate to the
|
29
|
+
* open state (or the open panel will animate into the closed state). By
|
30
|
+
* default it's a half of the panel's width.
|
31
|
+
*/
|
32
|
+
rightThreshold?: number;
|
33
|
+
/**
|
34
|
+
* Distance that the panel must be dragged from the left edge to be considered
|
35
|
+
* a swipe. The default value is 10.
|
36
|
+
*/
|
37
|
+
dragOffsetFromLeftEdge?: number;
|
38
|
+
/**
|
39
|
+
* Distance that the panel must be dragged from the right edge to be considered
|
40
|
+
* a swipe. The default value is 10.
|
41
|
+
*/
|
42
|
+
dragOffsetFromRightEdge?: number;
|
43
|
+
/**
|
44
|
+
* Value indicating if the swipeable panel can be pulled further than the left
|
45
|
+
* actions panel's width. It is set to true by default as long as the left
|
46
|
+
* panel render method is present.
|
47
|
+
*/
|
48
|
+
overshootLeft?: boolean;
|
49
|
+
/**
|
50
|
+
* Value indicating if the swipeable panel can be pulled further than the
|
51
|
+
* right actions panel's width. It is set to true by default as long as the
|
52
|
+
* right panel render method is present.
|
53
|
+
*/
|
54
|
+
overshootRight?: boolean;
|
55
|
+
/**
|
56
|
+
* Specifies how much the visual interaction will be delayed compared to the
|
57
|
+
* gesture distance at overshoot. Default value is 1, it mean no friction, for
|
58
|
+
* a native feel, try 8 or above.
|
59
|
+
*/
|
60
|
+
overshootFriction?: number;
|
61
|
+
/**
|
62
|
+
* Called when action panel gets open (either right or left).
|
63
|
+
*/
|
64
|
+
onSwipeableOpen?: (direction: 'left' | 'right', swipeable: SwipeableMethods) => void;
|
65
|
+
/**
|
66
|
+
* Called when action panel is closed.
|
67
|
+
*/
|
68
|
+
onSwipeableClose?: (direction: 'left' | 'right', swipeable: SwipeableMethods) => void;
|
69
|
+
/**
|
70
|
+
* Called when action panel starts animating on open (either right or left).
|
71
|
+
*/
|
72
|
+
onSwipeableWillOpen?: (direction: 'left' | 'right') => void;
|
73
|
+
/**
|
74
|
+
* Called when action panel starts animating on close.
|
75
|
+
*/
|
76
|
+
onSwipeableWillClose?: (direction: 'left' | 'right') => void;
|
77
|
+
/**
|
78
|
+
* Called when action panel starts being shown on dragging to open.
|
79
|
+
*/
|
80
|
+
onSwipeableOpenStartDrag?: (direction: 'left' | 'right') => void;
|
81
|
+
/**
|
82
|
+
* Called when action panel starts being shown on dragging to close.
|
83
|
+
*/
|
84
|
+
onSwipeableCloseStartDrag?: (direction: 'left' | 'right') => void;
|
85
|
+
/**
|
86
|
+
*
|
87
|
+
* This map describes the values to use as inputRange for extra interpolation:
|
88
|
+
* AnimatedValue: [startValue, endValue]
|
89
|
+
*
|
90
|
+
* progressAnimatedValue: [0, 1] dragAnimatedValue: [0, +]
|
91
|
+
*
|
92
|
+
* To support `rtl` flexbox layouts use `flexDirection` styling.
|
93
|
+
* */
|
94
|
+
renderLeftActions?: (progressAnimatedValue: SharedValue<number>, dragAnimatedValue: SharedValue<number>, swipeable: SwipeableMethods) => React.ReactNode;
|
95
|
+
/**
|
96
|
+
*
|
97
|
+
* This map describes the values to use as inputRange for extra interpolation:
|
98
|
+
* AnimatedValue: [startValue, endValue]
|
99
|
+
*
|
100
|
+
* progressAnimatedValue: [0, 1] dragAnimatedValue: [0, -]
|
101
|
+
*
|
102
|
+
* To support `rtl` flexbox layouts use `flexDirection` styling.
|
103
|
+
* */
|
104
|
+
renderRightActions?: (progressAnimatedValue: SharedValue<number>, dragAnimatedValue: SharedValue<number>, swipeable: SwipeableMethods) => React.ReactNode;
|
105
|
+
animationOptions?: Record<string, unknown>;
|
106
|
+
/**
|
107
|
+
* Style object for the container (`Animated.View`), for example to override
|
108
|
+
* `overflow: 'hidden'`.
|
109
|
+
*/
|
110
|
+
containerStyle?: StyleProp<ViewStyle>;
|
111
|
+
/**
|
112
|
+
* Style object for the children container (`Animated.View`), for example to
|
113
|
+
* apply `flex: 1`
|
114
|
+
*/
|
115
|
+
childrenContainerStyle?: StyleProp<ViewStyle>;
|
116
|
+
}
|
117
|
+
export interface SwipeableMethods {
|
118
|
+
close: () => void;
|
119
|
+
openLeft: () => void;
|
120
|
+
openRight: () => void;
|
121
|
+
reset: () => void;
|
122
|
+
}
|
123
|
+
declare const Swipeable: React.ForwardRefExoticComponent<SwipeableProps & React.RefAttributes<SwipeableMethods>>;
|
124
|
+
export default Swipeable;
|
125
|
+
export type SwipeableRef = ForwardedRef<SwipeableMethods>;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Component } from 'react';
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
3
|
+
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlerCommon';
|
4
|
+
import type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload';
|
5
|
+
import type { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';
|
6
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
7
7
|
/**
|
8
8
|
* Each touchable is a states' machine which preforms transitions.
|
9
9
|
* On very beginning (and on the very end or recognition) touchable is
|
@@ -17,18 +17,6 @@ export declare const TOUCHABLE_STATE: {
|
|
17
17
|
readonly MOVED_OUTSIDE: 2;
|
18
18
|
};
|
19
19
|
type TouchableState = typeof TOUCHABLE_STATE[keyof typeof TOUCHABLE_STATE];
|
20
|
-
export interface GenericTouchableProps extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
21
|
-
onPress?: () => void;
|
22
|
-
onPressIn?: () => void;
|
23
|
-
onPressOut?: () => void;
|
24
|
-
onLongPress?: () => void;
|
25
|
-
nativeID?: string;
|
26
|
-
shouldActivateOnStart?: boolean;
|
27
|
-
disallowInterruption?: boolean;
|
28
|
-
containerStyle?: StyleProp<ViewStyle>;
|
29
|
-
hitSlop?: Insets | number;
|
30
|
-
userSelect?: UserSelect;
|
31
|
-
}
|
32
20
|
interface InternalProps {
|
33
21
|
extraButtonProps: TouchableNativeFeedbackExtraProps;
|
34
22
|
onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { StyleProp, ViewStyle, TouchableWithoutFeedbackProps, Insets } from 'react-native';
|
2
|
+
import type { UserSelect } from '../../handlers/gestureHandlerCommon';
|
3
|
+
export interface GenericTouchableProps extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
4
|
+
onPress?: () => void;
|
5
|
+
onPressIn?: () => void;
|
6
|
+
onPressOut?: () => void;
|
7
|
+
onLongPress?: () => void;
|
8
|
+
nativeID?: string;
|
9
|
+
shouldActivateOnStart?: boolean;
|
10
|
+
disallowInterruption?: boolean;
|
11
|
+
containerStyle?: StyleProp<ViewStyle>;
|
12
|
+
hitSlop?: Insets | number;
|
13
|
+
userSelect?: UserSelect;
|
14
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Component } from 'react';
|
3
|
-
import { GenericTouchableProps } from './
|
3
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
4
4
|
import { TouchableHighlightProps as RNTouchableHighlightProps, ColorValue } from 'react-native';
|
5
5
|
interface State {
|
6
6
|
extraChildStyle: null | {
|
@@ -1,14 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { ColorValue } from 'react-native';
|
2
2
|
import * as React from 'react';
|
3
3
|
import { Component } from 'react';
|
4
|
-
import {
|
5
|
-
export type TouchableNativeFeedbackExtraProps = {
|
6
|
-
borderless?: boolean;
|
7
|
-
rippleColor?: number | null;
|
8
|
-
rippleRadius?: number | null;
|
9
|
-
foreground?: boolean;
|
10
|
-
};
|
11
|
-
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps & GenericTouchableProps;
|
4
|
+
import { TouchableNativeFeedbackProps, TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedbackProps';
|
12
5
|
/**
|
13
6
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
14
7
|
* There's small difference with handling long press ripple since RN's implementation calls
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps } from 'react-native';
|
2
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
3
|
+
export type TouchableNativeFeedbackExtraProps = {
|
4
|
+
borderless?: boolean;
|
5
|
+
rippleColor?: number | null;
|
6
|
+
rippleRadius?: number | null;
|
7
|
+
foreground?: boolean;
|
8
|
+
};
|
9
|
+
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps & GenericTouchableProps;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Animated, TouchableOpacityProps as RNTouchableOpacityProps } from 'react-native';
|
2
|
-
import { GenericTouchableProps } from './
|
2
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
3
3
|
import * as React from 'react';
|
4
4
|
import { Component } from 'react';
|
5
5
|
export type TouchableOpacityProps = RNTouchableOpacityProps & GenericTouchableProps & {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import GenericTouchable
|
2
|
+
import GenericTouchable from './GenericTouchable';
|
3
|
+
import type { GenericTouchableProps } from './GenericTouchableProps';
|
3
4
|
export type TouchableWithoutFeedbackProps = GenericTouchableProps;
|
4
5
|
declare const TouchableWithoutFeedback: React.ForwardRefExoticComponent<GenericTouchableProps & {
|
5
6
|
children?: React.ReactNode;
|
@@ -1,11 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { FlingGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
4
|
export declare const flingGestureHandlerProps: readonly ["numberOfPointers", "direction"];
|
3
|
-
export type FlingGestureHandlerEventPayload = {
|
4
|
-
x: number;
|
5
|
-
y: number;
|
6
|
-
absoluteX: number;
|
7
|
-
absoluteY: number;
|
8
|
-
};
|
9
5
|
export interface FlingGestureConfig {
|
10
6
|
/**
|
11
7
|
* Expressed allowed direction of movement. It's possible to pass one or many
|
@@ -1,21 +1,12 @@
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
2
2
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
3
|
+
import type { ForceTouchGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
3
4
|
export declare const forceTouchGestureHandlerProps: readonly ["minForce", "maxForce", "feedbackOnActivation"];
|
4
5
|
declare class ForceTouchFallback extends React.Component<PropsWithChildren<unknown>> {
|
5
6
|
static forceTouchAvailable: boolean;
|
6
7
|
componentDidMount(): void;
|
7
8
|
render(): React.ReactNode;
|
8
9
|
}
|
9
|
-
export type ForceTouchGestureHandlerEventPayload = {
|
10
|
-
x: number;
|
11
|
-
y: number;
|
12
|
-
absoluteX: number;
|
13
|
-
absoluteY: number;
|
14
|
-
/**
|
15
|
-
* The pressure of a touch.
|
16
|
-
*/
|
17
|
-
force: number;
|
18
|
-
};
|
19
10
|
export interface ForceTouchGestureConfig {
|
20
11
|
/**
|
21
12
|
*
|
@@ -0,0 +1,159 @@
|
|
1
|
+
export type FlingGestureHandlerEventPayload = {
|
2
|
+
x: number;
|
3
|
+
y: number;
|
4
|
+
absoluteX: number;
|
5
|
+
absoluteY: number;
|
6
|
+
};
|
7
|
+
export type ForceTouchGestureHandlerEventPayload = {
|
8
|
+
x: number;
|
9
|
+
y: number;
|
10
|
+
absoluteX: number;
|
11
|
+
absoluteY: number;
|
12
|
+
/**
|
13
|
+
* The pressure of a touch.
|
14
|
+
*/
|
15
|
+
force: number;
|
16
|
+
};
|
17
|
+
export type LongPressGestureHandlerEventPayload = {
|
18
|
+
/**
|
19
|
+
* X coordinate, expressed in points, of the current position of the pointer
|
20
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
21
|
+
* relative to the view attached to the handler.
|
22
|
+
*/
|
23
|
+
x: number;
|
24
|
+
/**
|
25
|
+
* Y coordinate, expressed in points, of the current position of the pointer
|
26
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
27
|
+
* relative to the view attached to the handler.
|
28
|
+
*/
|
29
|
+
y: number;
|
30
|
+
/**
|
31
|
+
* X coordinate, expressed in points, of the current position of the pointer
|
32
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
33
|
+
* relative to the window. It is recommended to use `absoluteX` instead of
|
34
|
+
* `x` in cases when the view attached to the handler can be transformed as an
|
35
|
+
* effect of the gesture.
|
36
|
+
*/
|
37
|
+
absoluteX: number;
|
38
|
+
/**
|
39
|
+
* Y coordinate, expressed in points, of the current position of the pointer
|
40
|
+
* (finger or a leading pointer when there are multiple fingers placed)
|
41
|
+
* relative to the window. It is recommended to use `absoluteY` instead of
|
42
|
+
* `y` in cases when the view attached to the handler can be transformed as an
|
43
|
+
* effect of the gesture.
|
44
|
+
*/
|
45
|
+
absoluteY: number;
|
46
|
+
/**
|
47
|
+
* Duration of the long press (time since the start of the event), expressed
|
48
|
+
* in milliseconds.
|
49
|
+
*/
|
50
|
+
duration: number;
|
51
|
+
};
|
52
|
+
export type NativeViewGestureHandlerPayload = {
|
53
|
+
/**
|
54
|
+
* True if gesture was performed inside of containing view, false otherwise.
|
55
|
+
*/
|
56
|
+
pointerInside: boolean;
|
57
|
+
};
|
58
|
+
export type PanGestureHandlerEventPayload = {
|
59
|
+
/**
|
60
|
+
* X coordinate of the current position of the pointer (finger or a leading
|
61
|
+
* pointer when there are multiple fingers placed) relative to the view
|
62
|
+
* attached to the handler. Expressed in point units.
|
63
|
+
*/
|
64
|
+
x: number;
|
65
|
+
/**
|
66
|
+
* Y coordinate of the current position of the pointer (finger or a leading
|
67
|
+
* pointer when there are multiple fingers placed) relative to the view
|
68
|
+
* attached to the handler. Expressed in point units.
|
69
|
+
*/
|
70
|
+
y: number;
|
71
|
+
/**
|
72
|
+
* X coordinate of the current position of the pointer (finger or a leading
|
73
|
+
* pointer when there are multiple fingers placed) relative to the window.
|
74
|
+
* The value is expressed in point units. It is recommended to use it instead
|
75
|
+
* of `x` in cases when the original view can be transformed as an effect of
|
76
|
+
* the gesture.
|
77
|
+
*/
|
78
|
+
absoluteX: number;
|
79
|
+
/**
|
80
|
+
* Y coordinate of the current position of the pointer (finger or a leading
|
81
|
+
* pointer when there are multiple fingers placed) relative to the window.
|
82
|
+
* The value is expressed in point units. It is recommended to use it instead
|
83
|
+
* of `y` in cases when the original view can be transformed as an
|
84
|
+
* effect of the gesture.
|
85
|
+
*/
|
86
|
+
absoluteY: number;
|
87
|
+
/**
|
88
|
+
* Translation of the pan gesture along X axis accumulated over the time of
|
89
|
+
* the gesture. The value is expressed in the point units.
|
90
|
+
*/
|
91
|
+
translationX: number;
|
92
|
+
/**
|
93
|
+
* Translation of the pan gesture along Y axis accumulated over the time of
|
94
|
+
* the gesture. The value is expressed in the point units.
|
95
|
+
*/
|
96
|
+
translationY: number;
|
97
|
+
/**
|
98
|
+
* Velocity of the pan gesture along the X axis in the current moment. The
|
99
|
+
* value is expressed in point units per second.
|
100
|
+
*/
|
101
|
+
velocityX: number;
|
102
|
+
/**
|
103
|
+
* Velocity of the pan gesture along the Y axis in the current moment. The
|
104
|
+
* value is expressed in point units per second.
|
105
|
+
*/
|
106
|
+
velocityY: number;
|
107
|
+
};
|
108
|
+
export type PinchGestureHandlerEventPayload = {
|
109
|
+
/**
|
110
|
+
* The scale factor relative to the points of the two touches in screen
|
111
|
+
* coordinates.
|
112
|
+
*/
|
113
|
+
scale: number;
|
114
|
+
/**
|
115
|
+
* Position expressed in points along X axis of center anchor point of
|
116
|
+
* gesture.
|
117
|
+
*/
|
118
|
+
focalX: number;
|
119
|
+
/**
|
120
|
+
* Position expressed in points along Y axis of center anchor point of
|
121
|
+
* gesture.
|
122
|
+
*/
|
123
|
+
focalY: number;
|
124
|
+
/**
|
125
|
+
*
|
126
|
+
* Velocity of the pan gesture the current moment. The value is expressed in
|
127
|
+
* point units per second.
|
128
|
+
*/
|
129
|
+
velocity: number;
|
130
|
+
};
|
131
|
+
export type TapGestureHandlerEventPayload = {
|
132
|
+
x: number;
|
133
|
+
y: number;
|
134
|
+
absoluteX: number;
|
135
|
+
absoluteY: number;
|
136
|
+
};
|
137
|
+
export type RotationGestureHandlerEventPayload = {
|
138
|
+
/**
|
139
|
+
* Amount rotated, expressed in radians, from the gesture's focal point
|
140
|
+
* (anchor).
|
141
|
+
*/
|
142
|
+
rotation: number;
|
143
|
+
/**
|
144
|
+
* X coordinate, expressed in points, of the gesture's central focal point
|
145
|
+
* (anchor).
|
146
|
+
*/
|
147
|
+
anchorX: number;
|
148
|
+
/**
|
149
|
+
* Y coordinate, expressed in points, of the gesture's central focal point
|
150
|
+
* (anchor).
|
151
|
+
*/
|
152
|
+
anchorY: number;
|
153
|
+
/**
|
154
|
+
*
|
155
|
+
* Instantaneous velocity, expressed in point units per second, of the
|
156
|
+
* gesture.
|
157
|
+
*/
|
158
|
+
velocity: number;
|
159
|
+
};
|
@@ -1,40 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { LongPressGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
4
|
export declare const longPressGestureHandlerProps: readonly ["minDurationMs", "maxDist"];
|
3
|
-
export type LongPressGestureHandlerEventPayload = {
|
4
|
-
/**
|
5
|
-
* X coordinate, expressed in points, of the current position of the pointer
|
6
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
7
|
-
* relative to the view attached to the handler.
|
8
|
-
*/
|
9
|
-
x: number;
|
10
|
-
/**
|
11
|
-
* Y coordinate, expressed in points, of the current position of the pointer
|
12
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
13
|
-
* relative to the view attached to the handler.
|
14
|
-
*/
|
15
|
-
y: number;
|
16
|
-
/**
|
17
|
-
* X coordinate, expressed in points, of the current position of the pointer
|
18
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
19
|
-
* relative to the window. It is recommended to use `absoluteX` instead of
|
20
|
-
* `x` in cases when the view attached to the handler can be transformed as an
|
21
|
-
* effect of the gesture.
|
22
|
-
*/
|
23
|
-
absoluteX: number;
|
24
|
-
/**
|
25
|
-
* Y coordinate, expressed in points, of the current position of the pointer
|
26
|
-
* (finger or a leading pointer when there are multiple fingers placed)
|
27
|
-
* relative to the window. It is recommended to use `absoluteY` instead of
|
28
|
-
* `y` in cases when the view attached to the handler can be transformed as an
|
29
|
-
* effect of the gesture.
|
30
|
-
*/
|
31
|
-
absoluteY: number;
|
32
|
-
/**
|
33
|
-
* Duration of the long press (time since the start of the event), expressed
|
34
|
-
* in milliseconds.
|
35
|
-
*/
|
36
|
-
duration: number;
|
37
|
-
};
|
38
5
|
export interface LongPressGestureConfig {
|
39
6
|
/**
|
40
7
|
* Minimum time, expressed in milliseconds, that a finger must remain pressed on
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { NativeViewGestureHandlerPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
4
|
export declare const nativeViewGestureHandlerProps: readonly ["shouldActivateOnStart", "disallowInterruption"];
|
3
5
|
export interface NativeViewGestureConfig {
|
@@ -16,12 +18,6 @@ export interface NativeViewGestureConfig {
|
|
16
18
|
}
|
17
19
|
export interface NativeViewGestureHandlerProps extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>, NativeViewGestureConfig {
|
18
20
|
}
|
19
|
-
export type NativeViewGestureHandlerPayload = {
|
20
|
-
/**
|
21
|
-
* True if gesture was performed inside of containing view, false otherwise.
|
22
|
-
*/
|
23
|
-
pointerInside: boolean;
|
24
|
-
};
|
25
21
|
export declare const nativeViewProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "mouseButton", "enableContextMenu", "touchAction", "waitFor", "simultaneousHandlers", "blocksHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange", "shouldActivateOnStart", "disallowInterruption"];
|
26
22
|
export declare const nativeViewHandlerName = "NativeViewGestureHandler";
|
27
23
|
export type NativeViewGestureHandler = typeof NativeViewGestureHandler;
|
@@ -1,56 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { PanGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
4
|
export declare const panGestureHandlerProps: readonly ["activeOffsetY", "activeOffsetX", "failOffsetY", "failOffsetX", "minDist", "minVelocity", "minVelocityX", "minVelocityY", "minPointers", "maxPointers", "avgTouches", "enableTrackpadTwoFingerGesture", "activateAfterLongPress"];
|
3
5
|
export declare const panGestureHandlerCustomNativeProps: readonly ["activeOffsetYStart", "activeOffsetYEnd", "activeOffsetXStart", "activeOffsetXEnd", "failOffsetYStart", "failOffsetYEnd", "failOffsetXStart", "failOffsetXEnd"];
|
4
|
-
export type PanGestureHandlerEventPayload = {
|
5
|
-
/**
|
6
|
-
* X coordinate of the current position of the pointer (finger or a leading
|
7
|
-
* pointer when there are multiple fingers placed) relative to the view
|
8
|
-
* attached to the handler. Expressed in point units.
|
9
|
-
*/
|
10
|
-
x: number;
|
11
|
-
/**
|
12
|
-
* Y coordinate of the current position of the pointer (finger or a leading
|
13
|
-
* pointer when there are multiple fingers placed) relative to the view
|
14
|
-
* attached to the handler. Expressed in point units.
|
15
|
-
*/
|
16
|
-
y: number;
|
17
|
-
/**
|
18
|
-
* X coordinate of the current position of the pointer (finger or a leading
|
19
|
-
* pointer when there are multiple fingers placed) relative to the window.
|
20
|
-
* The value is expressed in point units. It is recommended to use it instead
|
21
|
-
* of `x` in cases when the original view can be transformed as an effect of
|
22
|
-
* the gesture.
|
23
|
-
*/
|
24
|
-
absoluteX: number;
|
25
|
-
/**
|
26
|
-
* Y coordinate of the current position of the pointer (finger or a leading
|
27
|
-
* pointer when there are multiple fingers placed) relative to the window.
|
28
|
-
* The value is expressed in point units. It is recommended to use it instead
|
29
|
-
* of `y` in cases when the original view can be transformed as an
|
30
|
-
* effect of the gesture.
|
31
|
-
*/
|
32
|
-
absoluteY: number;
|
33
|
-
/**
|
34
|
-
* Translation of the pan gesture along X axis accumulated over the time of
|
35
|
-
* the gesture. The value is expressed in the point units.
|
36
|
-
*/
|
37
|
-
translationX: number;
|
38
|
-
/**
|
39
|
-
* Translation of the pan gesture along Y axis accumulated over the time of
|
40
|
-
* the gesture. The value is expressed in the point units.
|
41
|
-
*/
|
42
|
-
translationY: number;
|
43
|
-
/**
|
44
|
-
* Velocity of the pan gesture along the X axis in the current moment. The
|
45
|
-
* value is expressed in point units per second.
|
46
|
-
*/
|
47
|
-
velocityX: number;
|
48
|
-
/**
|
49
|
-
* Velocity of the pan gesture along the Y axis in the current moment. The
|
50
|
-
* value is expressed in point units per second.
|
51
|
-
*/
|
52
|
-
velocityY: number;
|
53
|
-
};
|
54
6
|
interface CommonPanProperties {
|
55
7
|
/**
|
56
8
|
* Minimum distance the finger (or multiple finger) need to travel before the
|
@@ -135,5 +87,5 @@ export interface PanGestureHandlerProps extends BaseGestureHandlerProps<PanGestu
|
|
135
87
|
export declare const panHandlerName = "PanGestureHandler";
|
136
88
|
export type PanGestureHandler = typeof PanGestureHandler;
|
137
89
|
export declare const PanGestureHandler: import("react").ComponentType<PanGestureHandlerProps & import("react").RefAttributes<any>>;
|
138
|
-
export declare function managePanProps(props: PanGestureHandlerProps): PanGestureHandlerProps & Partial<Record<"
|
90
|
+
export declare function managePanProps(props: PanGestureHandlerProps): PanGestureHandlerProps & Partial<Record<"failOffsetXStart" | "failOffsetYStart" | "failOffsetXEnd" | "failOffsetYEnd" | "activeOffsetXStart" | "activeOffsetXEnd" | "activeOffsetYStart" | "activeOffsetYEnd", number>>;
|
139
91
|
export {};
|
@@ -1,27 +1,6 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { PinchGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
-
export type PinchGestureHandlerEventPayload = {
|
3
|
-
/**
|
4
|
-
* The scale factor relative to the points of the two touches in screen
|
5
|
-
* coordinates.
|
6
|
-
*/
|
7
|
-
scale: number;
|
8
|
-
/**
|
9
|
-
* Position expressed in points along X axis of center anchor point of
|
10
|
-
* gesture.
|
11
|
-
*/
|
12
|
-
focalX: number;
|
13
|
-
/**
|
14
|
-
* Position expressed in points along Y axis of center anchor point of
|
15
|
-
* gesture.
|
16
|
-
*/
|
17
|
-
focalY: number;
|
18
|
-
/**
|
19
|
-
*
|
20
|
-
* Velocity of the pan gesture the current moment. The value is expressed in
|
21
|
-
* point units per second.
|
22
|
-
*/
|
23
|
-
velocity: number;
|
24
|
-
};
|
25
4
|
export interface PinchGestureHandlerProps extends BaseGestureHandlerProps<PinchGestureHandlerEventPayload> {
|
26
5
|
}
|
27
6
|
export declare const pinchHandlerName = "PinchGestureHandler";
|
@@ -1,27 +1,6 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { RotationGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
-
export type RotationGestureHandlerEventPayload = {
|
3
|
-
/**
|
4
|
-
* Amount rotated, expressed in radians, from the gesture's focal point
|
5
|
-
* (anchor).
|
6
|
-
*/
|
7
|
-
rotation: number;
|
8
|
-
/**
|
9
|
-
* X coordinate, expressed in points, of the gesture's central focal point
|
10
|
-
* (anchor).
|
11
|
-
*/
|
12
|
-
anchorX: number;
|
13
|
-
/**
|
14
|
-
* Y coordinate, expressed in points, of the gesture's central focal point
|
15
|
-
* (anchor).
|
16
|
-
*/
|
17
|
-
anchorY: number;
|
18
|
-
/**
|
19
|
-
*
|
20
|
-
* Instantaneous velocity, expressed in point units per second, of the
|
21
|
-
* gesture.
|
22
|
-
*/
|
23
|
-
velocity: number;
|
24
|
-
};
|
25
4
|
export interface RotationGestureHandlerProps extends BaseGestureHandlerProps<RotationGestureHandlerEventPayload> {
|
26
5
|
}
|
27
6
|
export declare const rotationHandlerName = "RotationGestureHandler";
|
@@ -1,11 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { TapGestureHandlerEventPayload } from './GestureHandlerEventPayload';
|
1
3
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
4
|
export declare const tapGestureHandlerProps: readonly ["maxDurationMs", "maxDelayMs", "numberOfTaps", "maxDeltaX", "maxDeltaY", "maxDist", "minPointers"];
|
3
|
-
export type TapGestureHandlerEventPayload = {
|
4
|
-
x: number;
|
5
|
-
y: number;
|
6
|
-
absoluteX: number;
|
7
|
-
absoluteY: number;
|
8
|
-
};
|
9
5
|
export interface TapGestureConfig {
|
10
6
|
/**
|
11
7
|
* Minimum number of pointers (fingers) required to be placed before the
|
@@ -76,8 +76,3 @@ export type BaseGestureHandlerProps<ExtraEventPayloadT extends Record<string, un
|
|
76
76
|
onHandlerStateChange?: (event: HandlerStateChangeEvent<ExtraEventPayloadT>) => void;
|
77
77
|
children?: React.ReactNode;
|
78
78
|
};
|
79
|
-
export declare function filterConfig(props: Record<string, unknown>, validProps: string[], defaults?: Record<string, unknown>): {
|
80
|
-
[x: string]: unknown;
|
81
|
-
};
|
82
|
-
export declare function findNodeHandle(node: null | number | React.Component<any, any> | React.ComponentClass<any>): null | number | React.Component<any, any> | React.ComponentClass<any>;
|
83
|
-
export declare function scheduleFlushOperations(): void;
|