react-native-gesture-handler 1.10.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -6
- package/android/build.gradle +23 -1
- package/android/gradle.properties +19 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/BaseGestureHandlerInteractionController.kt +18 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/Extensions.kt +11 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/FlingGestureHandler.kt +96 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandler.kt +710 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerInteractionController.kt +8 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.kt +562 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerRegistry.kt +8 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerRegistryImpl.kt +21 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureUtils.kt +49 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/LongPressGestureHandler.kt +97 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/ManualGestureHandler.kt +11 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/NativeViewGestureHandler.kt +129 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/OnTouchEventListener.kt +9 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/PanGestureHandler.kt +289 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/PinchGestureHandler.kt +88 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/{PointerEventsConfig.java → PointerEventsConfig.kt} +3 -5
- package/android/lib/src/main/java/com/swmansion/gesturehandler/RotationGestureDetector.kt +125 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/RotationGestureHandler.kt +79 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/TapGestureHandler.kt +167 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/ViewConfigurationHelper.kt +10 -0
- package/android/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +348 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +57 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +59 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +61 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +686 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerPackage.kt +17 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +95 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +132 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +68 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +34 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +66 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +69 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +51 -0
- package/ios/Handlers/RNFlingHandler.m +78 -5
- package/ios/Handlers/RNForceTouchHandler.m +29 -4
- package/ios/Handlers/RNLongPressHandler.m +105 -3
- package/ios/Handlers/RNManualHandler.h +4 -0
- package/ios/Handlers/RNManualHandler.m +73 -0
- package/ios/Handlers/RNNativeViewHandler.m +30 -2
- package/ios/Handlers/RNPanHandler.m +64 -4
- package/ios/Handlers/RNPinchHandler.m +61 -2
- package/ios/Handlers/RNRotationHandler.m +60 -1
- package/ios/Handlers/RNTapHandler.m +55 -8
- package/ios/RNGestureHandler.h +18 -4
- package/ios/RNGestureHandler.m +123 -13
- package/ios/RNGestureHandler.xcodeproj/xcuserdata/mdk.xcuserdatad/xcschemes/RNGestureHandler.xcscheme +80 -0
- package/ios/RNGestureHandler.xcodeproj/xcuserdata/mdk.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
- package/ios/RNGestureHandlerEvents.h +9 -0
- package/ios/RNGestureHandlerEvents.m +34 -0
- package/ios/RNGestureHandlerManager.h +7 -0
- package/ios/RNGestureHandlerManager.m +62 -34
- package/ios/RNGestureHandlerModule.m +39 -3
- package/ios/RNGestureHandlerPointerTracker.h +25 -0
- package/ios/RNGestureHandlerPointerTracker.m +237 -0
- package/ios/RNGestureHandlerRegistry.h +1 -0
- package/ios/RNGestureHandlerRegistry.m +10 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/RNManualActivationRecognizer.h +10 -0
- package/ios/RNManualActivationRecognizer.m +80 -0
- package/ios/RNRootViewGestureRecognizer.m +1 -1
- package/ios/RNTouchEventType.h +9 -0
- package/lib/commonjs/EventType.js +16 -0
- package/lib/commonjs/EventType.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootView.android.js +1 -13
- package/lib/commonjs/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootView.js +11 -3
- package/lib/commonjs/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +3 -1
- package/lib/commonjs/RNGestureHandlerModule.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 +41 -37
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +31 -12
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +10 -6
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +2 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/gestureHandlerRootHOC.js +1 -1
- package/lib/commonjs/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +23 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +44 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js +23 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +6 -4
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +121 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js +21 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js +21 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/TapGestureHandler.js +23 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/createHandler.js +52 -83
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +80 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js +415 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js +112 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +39 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gesture.js +177 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js +94 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js +85 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +58 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js +19 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js +34 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/panGesture.js +116 -0
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js +19 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +24 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js +19 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js +59 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/commonjs/handlers/handlersRegistry.js +31 -0
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
- package/lib/commonjs/index.js +146 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +13 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/mocks.js +31 -2
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/utils.js +15 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/Errors.js +1 -1
- package/lib/commonjs/web/Errors.js.map +1 -1
- package/lib/commonjs/web/GestureHandler.js +4 -6
- package/lib/commonjs/web/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/NodeManager.js +8 -2
- package/lib/commonjs/web/NodeManager.js.map +1 -1
- package/lib/module/EventType.js +8 -0
- package/lib/module/EventType.js.map +1 -0
- package/lib/module/GestureHandlerRootView.android.js +2 -14
- package/lib/module/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/GestureHandlerRootView.js +5 -1
- package/lib/module/GestureHandlerRootView.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +3 -1
- package/lib/module/RNGestureHandlerModule.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 +43 -40
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureComponents.js +29 -11
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/Swipeable.js +9 -6
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchable.js +2 -1
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/gestureHandlerRootHOC.js +1 -1
- package/lib/module/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +10 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js +29 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/module/handlers/LongPressGestureHandler.js +10 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/handlers/NativeViewGestureHandler.js +4 -3
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +106 -0
- package/lib/module/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/handlers/PinchGestureHandler.js +9 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/handlers/RotationGestureHandler.js +9 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/handlers/TapGestureHandler.js +10 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/handlers/createHandler.js +41 -76
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +66 -0
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/module/handlers/gestures/GestureDetector.js +378 -0
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/module/handlers/gestures/eventReceiver.js +97 -0
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/module/handlers/gestures/flingGesture.js +24 -0
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js +29 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/gesture.js +159 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -0
- package/lib/module/handlers/gestures/gestureComposition.js +79 -0
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/module/handlers/gestures/gestureObjects.js +67 -0
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.js +48 -0
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/module/handlers/gestures/longPressGesture.js +24 -0
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/module/handlers/gestures/manualGesture.js +9 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/module/handlers/gestures/nativeGesture.js +24 -0
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/module/handlers/gestures/panGesture.js +106 -0
- package/lib/module/handlers/gestures/panGesture.js.map +1 -0
- package/lib/module/handlers/gestures/pinchGesture.js +9 -0
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js +19 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/module/handlers/gestures/rotationGesture.js +9 -0
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/module/handlers/gestures/tapGesture.js +49 -0
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/module/handlers/handlersRegistry.js +16 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -0
- package/lib/module/index.js +22 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +5 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/mocks.js +31 -2
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/utils.js +8 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/Errors.js +1 -1
- package/lib/module/web/Errors.js.map +1 -1
- package/lib/module/web/GestureHandler.js +4 -6
- package/lib/module/web/GestureHandler.js.map +1 -1
- package/lib/module/web/NodeManager.js +8 -2
- package/lib/module/web/NodeManager.js.map +1 -1
- package/lib/typescript/EventType.d.ts +8 -0
- package/lib/typescript/GestureHandlerRootView.android.d.ts +2 -4
- package/lib/typescript/GestureHandlerRootView.d.ts +5 -2
- package/lib/typescript/RNGestureHandlerModule.d.ts +1 -1
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +50 -1
- package/lib/typescript/components/GestureButtons.d.ts +36 -0
- package/lib/typescript/components/GestureComponents.d.ts +8 -35
- package/lib/typescript/components/Swipeable.d.ts +73 -6
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +1 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +1 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +33 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +43 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +55 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +19 -4
- package/lib/typescript/handlers/PanGestureHandler.d.ts +137 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +28 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +28 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +56 -0
- package/lib/typescript/handlers/createHandler.d.ts +1 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +62 -0
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +8 -1
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +16 -0
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +2 -0
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +10 -0
- package/lib/typescript/handlers/gestures/gesture.d.ts +90 -0
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +39 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +9 -0
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +5 -0
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/panGesture.d.ts +19 -0
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +6 -0
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +6 -0
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +14 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +6 -0
- package/lib/typescript/index.d.ts +29 -2
- package/lib/typescript/init.d.ts +1 -0
- package/lib/typescript/mocks.d.ts +21 -2
- package/lib/typescript/utils.d.ts +1 -0
- package/lib/typescript/web/FlingGestureHandler.d.ts +0 -1
- package/lib/typescript/web/GestureHandler.d.ts +0 -1
- package/lib/typescript/web/PanGestureHandler.d.ts +0 -1
- package/lib/typescript/web/PinchGestureHandler.d.ts +0 -1
- package/lib/typescript/web/PressGestureHandler.d.ts +0 -1
- package/lib/typescript/web/RotationGestureHandler.d.ts +0 -1
- package/lib/typescript/web/TapGestureHandler.d.ts +0 -1
- package/package.json +7 -5
- package/src/EventType.ts +10 -0
- package/src/GestureHandlerRootView.android.tsx +9 -25
- package/src/GestureHandlerRootView.tsx +11 -2
- package/src/RNGestureHandlerModule.ts +5 -1
- package/src/RNGestureHandlerModule.web.ts +1 -0
- package/src/components/DrawerLayout.tsx +114 -41
- package/src/components/GestureButtons.tsx +45 -5
- package/src/components/GestureComponents.tsx +47 -41
- package/src/components/Swipeable.tsx +108 -21
- package/src/components/touchables/GenericTouchable.tsx +2 -1
- package/src/components/touchables/TouchableOpacity.tsx +1 -1
- package/src/handlers/FlingGestureHandler.ts +57 -0
- package/src/handlers/ForceTouchGestureHandler.ts +83 -0
- package/src/handlers/LongPressGestureHandler.ts +84 -0
- package/src/handlers/NativeViewGestureHandler.ts +31 -7
- package/src/handlers/PanGestureHandler.ts +321 -0
- package/src/handlers/PinchGestureHandler.ts +46 -0
- package/src/handlers/RotationGestureHandler.ts +46 -0
- package/src/handlers/TapGestureHandler.ts +90 -0
- package/src/handlers/createHandler.ts +54 -79
- package/src/handlers/gestureHandlerCommon.ts +185 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +19 -5
- package/src/handlers/gestures/GestureDetector.tsx +490 -0
- package/src/handlers/gestures/eventReceiver.ts +129 -0
- package/src/handlers/gestures/flingGesture.ts +27 -0
- package/src/handlers/gestures/forceTouchGesture.ts +32 -0
- package/src/handlers/gestures/gesture.ts +262 -0
- package/src/handlers/gestures/gestureComposition.ts +109 -0
- package/src/handlers/gestures/gestureObjects.ts +79 -0
- package/src/handlers/gestures/gestureStateManager.ts +60 -0
- package/src/handlers/gestures/longPressGesture.ts +27 -0
- package/src/handlers/gestures/manualGesture.ts +11 -0
- package/src/handlers/gestures/nativeGesture.ts +27 -0
- package/src/handlers/gestures/panGesture.ts +105 -0
- package/src/handlers/gestures/pinchGesture.ts +12 -0
- package/src/handlers/gestures/reanimatedWrapper.ts +45 -0
- package/src/handlers/gestures/rotationGesture.ts +12 -0
- package/src/handlers/gestures/tapGesture.ts +52 -0
- package/src/handlers/handlersRegistry.ts +22 -0
- package/src/index.ts +57 -17
- package/src/init.ts +5 -0
- package/src/mocks.ts +42 -2
- package/src/utils.ts +7 -0
- package/src/web/GestureHandler.ts +1 -2
- package/src/web/NodeManager.ts +5 -0
- package/android/lib/src/main/java/com/swmansion/gesturehandler/BaseGestureHandlerInteractionController.java +0 -23
- package/android/lib/src/main/java/com/swmansion/gesturehandler/FlingGestureHandler.java +0 -110
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandler.java +0 -531
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerInteractionController.java +0 -8
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java +0 -543
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerRegistry.java +0 -10
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerRegistryImpl.java +0 -29
- package/android/lib/src/main/java/com/swmansion/gesturehandler/GestureUtils.java +0 -53
- package/android/lib/src/main/java/com/swmansion/gesturehandler/LongPressGestureHandler.java +0 -81
- package/android/lib/src/main/java/com/swmansion/gesturehandler/NativeViewGestureHandler.java +0 -110
- package/android/lib/src/main/java/com/swmansion/gesturehandler/OnTouchEventListener.java +0 -8
- package/android/lib/src/main/java/com/swmansion/gesturehandler/PanGestureHandler.java +0 -312
- package/android/lib/src/main/java/com/swmansion/gesturehandler/PinchGestureHandler.java +0 -109
- package/android/lib/src/main/java/com/swmansion/gesturehandler/RotationGestureDetector.java +0 -169
- package/android/lib/src/main/java/com/swmansion/gesturehandler/RotationGestureHandler.java +0 -96
- package/android/lib/src/main/java/com/swmansion/gesturehandler/TapGestureHandler.java +0 -172
- package/android/lib/src/main/java/com/swmansion/gesturehandler/ViewConfigurationHelper.java +0 -10
- package/android/src/main/java/com/facebook/react/views/modal/RNGHModalUtils.java +0 -21
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java +0 -296
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.java +0 -72
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java +0 -77
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.java +0 -8
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.java +0 -86
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.java +0 -731
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerPackage.java +0 -31
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.java +0 -101
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.java +0 -151
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.java +0 -7
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.java +0 -76
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.java +0 -49
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java +0 -82
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.java +0 -61
- package/lib/commonjs/handlers/gestureHandlers.js +0 -236
- package/lib/commonjs/handlers/gestureHandlers.js.map +0 -1
- package/lib/module/handlers/gestureHandlers.js +0 -216
- package/lib/module/handlers/gestureHandlers.js.map +0 -1
- package/lib/typescript/handlers/gestureHandlers.d.ts +0 -158
- package/src/handlers/gestureHandlers.ts +0 -511
@@ -1,31 +1,80 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Component } from 'react';
|
3
3
|
import { Animated, StatusBarAnimation, StyleProp, ViewStyle } from 'react-native';
|
4
|
-
import { PanGestureHandler } from '../handlers/
|
4
|
+
import { PanGestureHandler } from '../handlers/PanGestureHandler';
|
5
5
|
export declare type DrawerPosition = 'left' | 'right';
|
6
6
|
export declare type DrawerState = 'Idle' | 'Dragging' | 'Settling';
|
7
7
|
export declare type DrawerType = 'front' | 'back' | 'slide';
|
8
8
|
export declare type DrawerLockMode = 'unlocked' | 'locked-closed' | 'locked-open';
|
9
9
|
export declare type DrawerKeyboardDismissMode = 'none' | 'on-drag';
|
10
10
|
export interface DrawerLayoutProps {
|
11
|
+
/**
|
12
|
+
* This attribute is present in the standard implementation already and is one
|
13
|
+
* of the required params. Gesture handler version of DrawerLayout make it
|
14
|
+
* possible for the function passed as `renderNavigationView` to take an
|
15
|
+
* Animated value as a parameter that indicates the progress of drawer
|
16
|
+
* opening/closing animation (progress value is 0 when closed and 1 when
|
17
|
+
* opened). This can be used by the drawer component to animated its children
|
18
|
+
* while the drawer is opening or closing.
|
19
|
+
*/
|
11
20
|
renderNavigationView: (progressAnimatedValue: Animated.Value) => React.ReactNode;
|
12
21
|
drawerPosition?: DrawerPosition;
|
13
22
|
drawerWidth?: number;
|
14
23
|
drawerBackgroundColor?: string;
|
15
24
|
drawerLockMode?: DrawerLockMode;
|
16
25
|
keyboardDismissMode?: DrawerKeyboardDismissMode;
|
26
|
+
/**
|
27
|
+
* Called when the drawer is closed.
|
28
|
+
*/
|
17
29
|
onDrawerClose?: () => void;
|
30
|
+
/**
|
31
|
+
* Called when the drawer is opened.
|
32
|
+
*/
|
18
33
|
onDrawerOpen?: () => void;
|
34
|
+
/**
|
35
|
+
* Called when the status of the drawer changes.
|
36
|
+
*/
|
19
37
|
onDrawerStateChanged?: (newState: DrawerState, drawerWillShow: boolean) => void;
|
20
38
|
useNativeAnimations?: boolean;
|
21
39
|
drawerType?: DrawerType;
|
40
|
+
/**
|
41
|
+
* Defines how far from the edge of the content view the gesture should
|
42
|
+
* activate.
|
43
|
+
*/
|
22
44
|
edgeWidth?: number;
|
23
45
|
minSwipeDistance?: number;
|
46
|
+
/**
|
47
|
+
* When set to true Drawer component will use
|
48
|
+
* {@link https://reactnative.dev/docs/statusbar StatusBar} API to hide the OS
|
49
|
+
* status bar whenever the drawer is pulled or when its in an "open" state.
|
50
|
+
*/
|
24
51
|
hideStatusBar?: boolean;
|
52
|
+
/**
|
53
|
+
* @default 'slide'
|
54
|
+
*
|
55
|
+
* Can be used when hideStatusBar is set to true and will select the animation
|
56
|
+
* used for hiding/showing the status bar. See
|
57
|
+
* {@link https://reactnative.dev/docs/statusbar StatusBar} documentation for
|
58
|
+
* more details
|
59
|
+
*/
|
25
60
|
statusBarAnimation?: StatusBarAnimation;
|
61
|
+
/**
|
62
|
+
* @default black
|
63
|
+
*
|
64
|
+
* Color of a semi-transparent overlay to be displayed on top of the content
|
65
|
+
* view when drawer gets open. A solid color should be used as the opacity is
|
66
|
+
* added by the Drawer itself and the opacity of the overlay is animated (from
|
67
|
+
* 0% to 70%).
|
68
|
+
*/
|
26
69
|
overlayColor?: string;
|
27
70
|
contentContainerStyle?: StyleProp<ViewStyle>;
|
28
71
|
drawerContainerStyle?: StyleProp<ViewStyle>;
|
72
|
+
/**
|
73
|
+
* Enables two-finger gestures on supported devices, for example iPads with
|
74
|
+
* trackpads. If not enabled the gesture will require click + drag, with
|
75
|
+
* `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger
|
76
|
+
* the gesture.
|
77
|
+
*/
|
29
78
|
enableTrackpadTwoFingerGesture?: boolean;
|
30
79
|
onDrawerSlide?: (position: number) => void;
|
31
80
|
onGestureRef?: (ref: PanGestureHandler) => void;
|
@@ -2,21 +2,57 @@ import * as React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
3
3
|
import { NativeViewGestureHandlerProps } from '../handlers/NativeViewGestureHandler';
|
4
4
|
export interface RawButtonProps extends NativeViewGestureHandlerProps {
|
5
|
+
/**
|
6
|
+
* Defines if more than one button could be pressed simultaneously. By default
|
7
|
+
* set true.
|
8
|
+
*/
|
5
9
|
exclusive?: boolean;
|
10
|
+
/**
|
11
|
+
* Android only.
|
12
|
+
*
|
13
|
+
* Defines color of native ripple animation used since API level 21.
|
14
|
+
*/
|
6
15
|
rippleColor?: any;
|
7
16
|
}
|
8
17
|
export interface BaseButtonProps extends RawButtonProps {
|
18
|
+
/**
|
19
|
+
* Called when the button gets pressed (analogous to `onPress` in
|
20
|
+
* `TouchableHighlight` from RN core).
|
21
|
+
*/
|
9
22
|
onPress?: (pointerInside: boolean) => void;
|
23
|
+
/**
|
24
|
+
* Called when button changes from inactive to active and vice versa. It
|
25
|
+
* passes active state as a boolean variable as a first parameter for that
|
26
|
+
* method.
|
27
|
+
*/
|
10
28
|
onActiveStateChange?: (active: boolean) => void;
|
11
29
|
style?: StyleProp<ViewStyle>;
|
12
30
|
testID?: string;
|
13
31
|
}
|
14
32
|
export interface RectButtonProps extends BaseButtonProps {
|
33
|
+
/**
|
34
|
+
* Background color that will be dimmed when button is in active state.
|
35
|
+
*/
|
15
36
|
underlayColor?: string;
|
37
|
+
/**
|
38
|
+
* iOS only.
|
39
|
+
*
|
40
|
+
* Opacity applied to the underlay when button is in active state.
|
41
|
+
*/
|
16
42
|
activeOpacity?: number;
|
17
43
|
}
|
18
44
|
export interface BorderlessButtonProps extends BaseButtonProps {
|
45
|
+
/**
|
46
|
+
* Android only.
|
47
|
+
*
|
48
|
+
* Set this to false if you want the ripple animation to render only within view bounds.
|
49
|
+
*/
|
19
50
|
borderless?: boolean;
|
51
|
+
/**
|
52
|
+
* iOS only.
|
53
|
+
*
|
54
|
+
* Opacity applied to the button when it is in an active state.
|
55
|
+
*/
|
20
56
|
activeOpacity?: number;
|
21
57
|
}
|
22
58
|
export declare const RawButton: React.ForwardRefExoticComponent<RawButtonProps & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
@@ -1,45 +1,18 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
2
|
+
import { PropsWithChildren, ForwardedRef, RefAttributes, ReactElement } from 'react';
|
3
|
+
import { ScrollView as RNScrollView, ScrollViewProps as RNScrollViewProps, Switch as RNSwitch, SwitchProps as RNSwitchProps, TextInput as RNTextInput, TextInputProps as RNTextInputProps, DrawerLayoutAndroid as RNDrawerLayoutAndroid, DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps, FlatList as RNFlatList, FlatListProps as RNFlatListProps } from 'react-native';
|
3
4
|
import { NativeViewGestureHandlerProps } from '../handlers/NativeViewGestureHandler';
|
4
5
|
export declare const ScrollView: React.ForwardRefExoticComponent<RNScrollViewProps & {
|
5
6
|
children?: React.ReactNode;
|
6
7
|
} & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
7
|
-
export declare type ScrollView = typeof ScrollView &
|
8
|
-
scrollTo(y?: number | {
|
9
|
-
x?: number;
|
10
|
-
y?: number;
|
11
|
-
animated?: boolean;
|
12
|
-
}, x?: number, animated?: boolean): void;
|
13
|
-
scrollToEnd(options?: {
|
14
|
-
animated: boolean;
|
15
|
-
}): void;
|
16
|
-
};
|
8
|
+
export declare type ScrollView = typeof ScrollView & RNScrollView;
|
17
9
|
export declare const Switch: React.ForwardRefExoticComponent<RNSwitchProps & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
18
|
-
export declare type Switch = typeof Switch;
|
10
|
+
export declare type Switch = typeof Switch & RNSwitch;
|
19
11
|
export declare const TextInput: React.ForwardRefExoticComponent<RNTextInputProps & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
20
|
-
export declare type TextInput = typeof TextInput;
|
12
|
+
export declare type TextInput = typeof TextInput & RNTextInput;
|
21
13
|
export declare const DrawerLayoutAndroid: React.ForwardRefExoticComponent<RNDrawerLayoutAndroidProps & {
|
22
14
|
children?: React.ReactNode;
|
23
15
|
} & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
24
|
-
export declare type DrawerLayoutAndroid = typeof DrawerLayoutAndroid;
|
25
|
-
export declare const FlatList: React.
|
26
|
-
export declare type FlatList<ItemT
|
27
|
-
scrollToEnd: (params?: {
|
28
|
-
animated?: boolean;
|
29
|
-
}) => void;
|
30
|
-
scrollToIndex: (params: {
|
31
|
-
animated?: boolean;
|
32
|
-
index: number;
|
33
|
-
viewOffset?: number;
|
34
|
-
viewPosition?: number;
|
35
|
-
}) => void;
|
36
|
-
scrollToItem: (params: {
|
37
|
-
animated?: boolean;
|
38
|
-
item: ItemT;
|
39
|
-
viewPosition?: number;
|
40
|
-
}) => void;
|
41
|
-
scrollToOffset: (params: {
|
42
|
-
animated?: boolean;
|
43
|
-
offset: number;
|
44
|
-
}) => void;
|
45
|
-
};
|
16
|
+
export declare type DrawerLayoutAndroid = typeof DrawerLayoutAndroid & RNDrawerLayoutAndroid;
|
17
|
+
export declare const FlatList: <ItemT = any>(props: React.PropsWithChildren<RNFlatListProps<ItemT> & React.RefAttributes<FlatList<ItemT>> & NativeViewGestureHandlerProps>, ref: React.ForwardedRef<FlatList<ItemT>>) => ReactElement | null;
|
18
|
+
export declare type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;
|
@@ -1,31 +1,91 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { Component } from 'react';
|
3
3
|
import { Animated, StyleProp, ViewStyle } from 'react-native';
|
4
|
-
import { PanGestureHandlerProps } from '../handlers/
|
4
|
+
import { PanGestureHandlerProps } from '../handlers/PanGestureHandler';
|
5
5
|
declare type SwipeableExcludes = Exclude<keyof PanGestureHandlerProps, 'onGestureEvent' | 'onHandlerStateChange'>;
|
6
|
-
interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableExcludes> {
|
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
|
+
*/
|
7
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
|
+
*/
|
8
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
|
+
*/
|
9
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
|
+
*/
|
10
32
|
rightThreshold?: number;
|
33
|
+
/**
|
34
|
+
* Value indicating if the swipeable panel can be pulled further than the left
|
35
|
+
* actions panel's width. It is set to true by default as long as the left
|
36
|
+
* panel render method is present.
|
37
|
+
*/
|
11
38
|
overshootLeft?: boolean;
|
39
|
+
/**
|
40
|
+
* Value indicating if the swipeable panel can be pulled further than the
|
41
|
+
* right actions panel's width. It is set to true by default as long as the
|
42
|
+
* right panel render method is present.
|
43
|
+
*/
|
12
44
|
overshootRight?: boolean;
|
45
|
+
/**
|
46
|
+
* Specifies how much the visual interaction will be delayed compared to the
|
47
|
+
* gesture distance at overshoot. Default value is 1, it mean no friction, for
|
48
|
+
* a native feel, try 8 or above.
|
49
|
+
*/
|
13
50
|
overshootFriction?: number;
|
51
|
+
/**
|
52
|
+
* Called when left action panel gets open.
|
53
|
+
*/
|
14
54
|
onSwipeableLeftOpen?: () => void;
|
55
|
+
/**
|
56
|
+
* Called when right action panel gets open.
|
57
|
+
*/
|
15
58
|
onSwipeableRightOpen?: () => void;
|
59
|
+
/**
|
60
|
+
* Called when action panel gets open (either right or left).
|
61
|
+
*/
|
16
62
|
onSwipeableOpen?: () => void;
|
63
|
+
/**
|
64
|
+
* Called when action panel is closed.
|
65
|
+
*/
|
17
66
|
onSwipeableClose?: () => void;
|
67
|
+
/**
|
68
|
+
* Called when left action panel starts animating on open.
|
69
|
+
*/
|
18
70
|
onSwipeableLeftWillOpen?: () => void;
|
71
|
+
/**
|
72
|
+
* Called when right action panel starts animating on open.
|
73
|
+
*/
|
19
74
|
onSwipeableRightWillOpen?: () => void;
|
75
|
+
/**
|
76
|
+
* Called when action panel starts animating on open (either right or left).
|
77
|
+
*/
|
20
78
|
onSwipeableWillOpen?: () => void;
|
79
|
+
/**
|
80
|
+
* Called when action panel starts animating on close.
|
81
|
+
*/
|
21
82
|
onSwipeableWillClose?: () => void;
|
22
83
|
/**
|
23
84
|
*
|
24
85
|
* This map describes the values to use as inputRange for extra interpolation:
|
25
86
|
* AnimatedValue: [startValue, endValue]
|
26
87
|
*
|
27
|
-
* progressAnimatedValue: [0, 1]
|
28
|
-
* dragAnimatedValue: [0, +]
|
88
|
+
* progressAnimatedValue: [0, 1] dragAnimatedValue: [0, +]
|
29
89
|
*
|
30
90
|
* To support `rtl` flexbox layouts use `flexDirection` styling.
|
31
91
|
* */
|
@@ -35,15 +95,22 @@ interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableExcludes>
|
|
35
95
|
* This map describes the values to use as inputRange for extra interpolation:
|
36
96
|
* AnimatedValue: [startValue, endValue]
|
37
97
|
*
|
38
|
-
* progressAnimatedValue: [0, 1]
|
39
|
-
* dragAnimatedValue: [0, -]
|
98
|
+
* progressAnimatedValue: [0, 1] dragAnimatedValue: [0, -]
|
40
99
|
*
|
41
100
|
* To support `rtl` flexbox layouts use `flexDirection` styling.
|
42
101
|
* */
|
43
102
|
renderRightActions?: (progressAnimatedValue: Animated.AnimatedInterpolation, dragAnimatedValue: Animated.AnimatedInterpolation) => React.ReactNode;
|
44
103
|
useNativeAnimations?: boolean;
|
45
104
|
animationOptions?: Record<string, unknown>;
|
105
|
+
/**
|
106
|
+
* Style object for the container (`Animated.View`), for example to override
|
107
|
+
* `overflow: 'hidden'`.
|
108
|
+
*/
|
46
109
|
containerStyle?: StyleProp<ViewStyle>;
|
110
|
+
/**
|
111
|
+
* Style object for the children container (`Animated.View`), for example to
|
112
|
+
* apply `flex: 1`
|
113
|
+
*/
|
47
114
|
childrenContainerStyle?: StyleProp<ViewStyle>;
|
48
115
|
}
|
49
116
|
declare type SwipeableState = {
|
@@ -1,7 +1,6 @@
|
|
1
|
-
/// <reference types="node" />
|
2
1
|
import { Component } from 'react';
|
3
2
|
import { StyleProp, ViewStyle, TouchableWithoutFeedbackProps } from 'react-native';
|
4
|
-
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/
|
3
|
+
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlerCommon';
|
5
4
|
import { NativeViewGestureHandlerPayload } from '../../handlers/NativeViewGestureHandler';
|
6
5
|
import { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedback.android';
|
7
6
|
/**
|
@@ -41,6 +40,7 @@ export default class GenericTouchable extends Component<GenericTouchableProps &
|
|
41
40
|
delayLongPress: number;
|
42
41
|
extraButtonProps: {
|
43
42
|
rippleColor: string;
|
43
|
+
exclusive: boolean;
|
44
44
|
};
|
45
45
|
};
|
46
46
|
pressInTimeout: Timeout;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
+
export declare const flingGestureHandlerProps: readonly ["numberOfPointers", "direction"];
|
3
|
+
export declare type FlingGestureHandlerEventPayload = {
|
4
|
+
x: number;
|
5
|
+
y: number;
|
6
|
+
absoluteX: number;
|
7
|
+
absoluteY: number;
|
8
|
+
};
|
9
|
+
export interface FlingGestureConfig {
|
10
|
+
/**
|
11
|
+
* Expressed allowed direction of movement. It's possible to pass one or many
|
12
|
+
* directions in one parameter:
|
13
|
+
*
|
14
|
+
* ```js
|
15
|
+
* direction={Directions.RIGHT | Directions.LEFT}
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* or
|
19
|
+
*
|
20
|
+
* ```js
|
21
|
+
* direction={Directions.DOWN}
|
22
|
+
* ```
|
23
|
+
*/
|
24
|
+
direction?: number;
|
25
|
+
/**
|
26
|
+
* Determine exact number of points required to handle the fling gesture.
|
27
|
+
*/
|
28
|
+
numberOfPointers?: number;
|
29
|
+
}
|
30
|
+
export interface FlingGestureHandlerProps extends BaseGestureHandlerProps<FlingGestureHandlerEventPayload>, FlingGestureConfig {
|
31
|
+
}
|
32
|
+
export declare type FlingGestureHandler = typeof FlingGestureHandler;
|
33
|
+
export declare const FlingGestureHandler: import("react").ComponentType<FlingGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
3
|
+
export declare const forceTouchGestureHandlerProps: readonly ["minForce", "maxForce", "feedbackOnActivation"];
|
4
|
+
declare class ForceTouchFallback extends React.Component {
|
5
|
+
static forceTouchAvailable: boolean;
|
6
|
+
componentDidMount(): void;
|
7
|
+
render(): React.ReactNode;
|
8
|
+
}
|
9
|
+
export declare 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
|
+
export interface ForceTouchGestureConfig {
|
20
|
+
/**
|
21
|
+
*
|
22
|
+
* A minimal pressure that is required before handler can activate. Should be a
|
23
|
+
* value from range `[0.0, 1.0]`. Default is `0.2`.
|
24
|
+
*/
|
25
|
+
minForce?: number;
|
26
|
+
/**
|
27
|
+
* A maximal pressure that could be applied for handler. If the pressure is
|
28
|
+
* greater, handler fails. Should be a value from range `[0.0, 1.0]`.
|
29
|
+
*/
|
30
|
+
maxForce?: number;
|
31
|
+
/**
|
32
|
+
* Boolean value defining if haptic feedback has to be performed on
|
33
|
+
* activation.
|
34
|
+
*/
|
35
|
+
feedbackOnActivation?: boolean;
|
36
|
+
}
|
37
|
+
export interface ForceTouchGestureHandlerProps extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>, ForceTouchGestureConfig {
|
38
|
+
}
|
39
|
+
export declare type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & {
|
40
|
+
forceTouchAvailable: boolean;
|
41
|
+
};
|
42
|
+
export declare const ForceTouchGestureHandler: typeof ForceTouchFallback | React.ComponentClass<ForceTouchGestureHandlerProps & React.RefAttributes<any>, any> | React.FunctionComponent<ForceTouchGestureHandlerProps & React.RefAttributes<any>>;
|
43
|
+
export {};
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
+
export declare const longPressGestureHandlerProps: readonly ["minDurationMs", "maxDist"];
|
3
|
+
export declare 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 root view. 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 root view. 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
|
+
export interface LongPressGestureConfig {
|
39
|
+
/**
|
40
|
+
* Minimum time, expressed in milliseconds, that a finger must remain pressed on
|
41
|
+
* the corresponding view. The default value is 500.
|
42
|
+
*/
|
43
|
+
minDurationMs?: number;
|
44
|
+
/**
|
45
|
+
* Maximum distance, expressed in points, that defines how far the finger is
|
46
|
+
* allowed to travel during a long press gesture. If the finger travels
|
47
|
+
* further than the defined distance and the handler hasn't yet activated, it
|
48
|
+
* will fail to recognize the gesture. The default value is 10.
|
49
|
+
*/
|
50
|
+
maxDist?: number;
|
51
|
+
}
|
52
|
+
export interface LongPressGestureHandlerProps extends BaseGestureHandlerProps<LongPressGestureHandlerEventPayload>, LongPressGestureConfig {
|
53
|
+
}
|
54
|
+
export declare type LongPressGestureHandler = typeof LongPressGestureHandler;
|
55
|
+
export declare const LongPressGestureHandler: import("react").ComponentType<LongPressGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -1,12 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export interface
|
1
|
+
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
+
export declare const nativeViewGestureHandlerProps: readonly ["shouldActivateOnStart", "disallowInterruption"];
|
3
|
+
export interface NativeViewGestureConfig {
|
4
|
+
/**
|
5
|
+
* Android only.
|
6
|
+
*
|
7
|
+
* Determines whether the handler should check for an existing touch event on
|
8
|
+
* instantiation.
|
9
|
+
*/
|
4
10
|
shouldActivateOnStart?: boolean;
|
11
|
+
/**
|
12
|
+
* When `true`, cancels all other gesture handlers when this
|
13
|
+
* `NativeViewGestureHandler` receives an `ACTIVE` state event.
|
14
|
+
*/
|
5
15
|
disallowInterruption?: boolean;
|
6
16
|
}
|
17
|
+
export interface NativeViewGestureHandlerProps extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>, NativeViewGestureConfig {
|
18
|
+
}
|
7
19
|
export declare type NativeViewGestureHandlerPayload = {
|
20
|
+
/**
|
21
|
+
* True if gesture was performed inside of containing view, false otherwise.
|
22
|
+
*/
|
8
23
|
pointerInside: boolean;
|
9
24
|
};
|
10
|
-
export declare const nativeViewProps: readonly ["id", "enabled", "
|
25
|
+
export declare const nativeViewProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "waitFor", "simultaneousHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange", "shouldActivateOnStart", "disallowInterruption"];
|
11
26
|
export declare type NativeViewGestureHandler = typeof NativeViewGestureHandler;
|
12
27
|
export declare const NativeViewGestureHandler: import("react").ComponentType<NativeViewGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
+
export declare const panGestureHandlerProps: readonly ["activeOffsetY", "activeOffsetX", "failOffsetY", "failOffsetX", "minDist", "minVelocity", "minVelocityX", "minVelocityY", "minPointers", "maxPointers", "avgTouches", "enableTrackpadTwoFingerGesture"];
|
3
|
+
export declare const panGestureHandlerCustomNativeProps: readonly ["activeOffsetYStart", "activeOffsetYEnd", "activeOffsetXStart", "activeOffsetXEnd", "failOffsetYStart", "failOffsetYEnd", "failOffsetXStart", "failOffsetXEnd"];
|
4
|
+
export declare 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 root view.
|
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 root view.
|
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
|
+
interface CommonPanProperties {
|
55
|
+
/**
|
56
|
+
* Minimum distance the finger (or multiple finger) need to travel before the
|
57
|
+
* handler activates. Expressed in points.
|
58
|
+
*/
|
59
|
+
minDist?: number;
|
60
|
+
/**
|
61
|
+
* Android only.
|
62
|
+
*/
|
63
|
+
avgTouches?: boolean;
|
64
|
+
/**
|
65
|
+
* Enables two-finger gestures on supported devices, for example iPads with
|
66
|
+
* trackpads. If not enabled the gesture will require click + drag, with
|
67
|
+
* enableTrackpadTwoFingerGesture swiping with two fingers will also trigger
|
68
|
+
* the gesture.
|
69
|
+
*/
|
70
|
+
enableTrackpadTwoFingerGesture?: boolean;
|
71
|
+
/**
|
72
|
+
* A number of fingers that is required to be placed before handler can
|
73
|
+
* activate. Should be a higher or equal to 0 integer.
|
74
|
+
*/
|
75
|
+
minPointers?: number;
|
76
|
+
/**
|
77
|
+
* When the given number of fingers is placed on the screen and handler hasn't
|
78
|
+
* yet activated it will fail recognizing the gesture. Should be a higher or
|
79
|
+
* equal to 0 integer.
|
80
|
+
*/
|
81
|
+
maxPointers?: number;
|
82
|
+
minVelocity?: number;
|
83
|
+
minVelocityX?: number;
|
84
|
+
minVelocityY?: number;
|
85
|
+
}
|
86
|
+
export interface PanGestureConfig extends CommonPanProperties {
|
87
|
+
activeOffsetYStart?: number;
|
88
|
+
activeOffsetYEnd?: number;
|
89
|
+
activeOffsetXStart?: number;
|
90
|
+
activeOffsetXEnd?: number;
|
91
|
+
failOffsetYStart?: number;
|
92
|
+
failOffsetYEnd?: number;
|
93
|
+
failOffsetXStart?: number;
|
94
|
+
failOffsetXEnd?: number;
|
95
|
+
}
|
96
|
+
export interface PanGestureHandlerProps extends BaseGestureHandlerProps<PanGestureHandlerEventPayload>, CommonPanProperties {
|
97
|
+
/**
|
98
|
+
* Range along X axis (in points) where fingers travels without activation of
|
99
|
+
* handler. Moving outside of this range implies activation of handler. Range
|
100
|
+
* can be given as an array or a single number. If range is set as an array,
|
101
|
+
* first value must be lower or equal to 0, a the second one higher or equal
|
102
|
+
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
|
103
|
+
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
|
104
|
+
*/
|
105
|
+
activeOffsetY?: number | number[];
|
106
|
+
/**
|
107
|
+
* Range along X axis (in points) where fingers travels without activation of
|
108
|
+
* handler. Moving outside of this range implies activation of handler. Range
|
109
|
+
* can be given as an array or a single number. If range is set as an array,
|
110
|
+
* first value must be lower or equal to 0, a the second one higher or equal
|
111
|
+
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
|
112
|
+
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
|
113
|
+
*/
|
114
|
+
activeOffsetX?: number | number[];
|
115
|
+
/**
|
116
|
+
* When the finger moves outside this range (in points) along Y axis and
|
117
|
+
* handler hasn't yet activated it will fail recognizing the gesture. Range
|
118
|
+
* can be given as an array or a single number. If range is set as an array,
|
119
|
+
* first value must be lower or equal to 0, a the second one higher or equal
|
120
|
+
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
|
121
|
+
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
|
122
|
+
*/
|
123
|
+
failOffsetY?: number | number[];
|
124
|
+
/**
|
125
|
+
* When the finger moves outside this range (in points) along X axis and
|
126
|
+
* handler hasn't yet activated it will fail recognizing the gesture. Range
|
127
|
+
* can be given as an array or a single number. If range is set as an array,
|
128
|
+
* first value must be lower or equal to 0, a the second one higher or equal
|
129
|
+
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
|
130
|
+
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
|
131
|
+
*/
|
132
|
+
failOffsetX?: number | number[];
|
133
|
+
}
|
134
|
+
export declare type PanGestureHandler = typeof PanGestureHandler;
|
135
|
+
export declare const PanGestureHandler: import("react").ComponentType<PanGestureHandlerProps & import("react").RefAttributes<any>>;
|
136
|
+
export declare function managePanProps(props: PanGestureHandlerProps): PanGestureHandlerProps & Partial<Record<"failOffsetXStart" | "failOffsetYStart" | "failOffsetXEnd" | "failOffsetYEnd" | "activeOffsetXStart" | "activeOffsetXEnd" | "activeOffsetYStart" | "activeOffsetYEnd", number>>;
|
137
|
+
export {};
|