react-native-gesture-handler 1.10.3 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/android/build.gradle +49 -1
- package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
- 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 +713 -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/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/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 +440 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js +135 -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 +65 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gesture.js +193 -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 +31 -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 +144 -0
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js +45 -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 +45 -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 +402 -0
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/module/handlers/gestures/eventReceiver.js +120 -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 +56 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/gesture.js +175 -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 +22 -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 +135 -0
- package/lib/module/handlers/gestures/panGesture.js.map +1 -0
- package/lib/module/handlers/gestures/pinchGesture.js +36 -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 +36 -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 +16 -0
- package/lib/typescript/handlers/gestures/gesture.d.ts +97 -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 +7 -0
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/panGesture.d.ts +26 -0
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +12 -0
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +12 -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 +8 -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 +519 -0
- package/src/handlers/gestures/eventReceiver.ts +151 -0
- package/src/handlers/gestures/flingGesture.ts +27 -0
- package/src/handlers/gestures/forceTouchGesture.ts +74 -0
- package/src/handlers/gestures/gesture.ts +292 -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 +31 -0
- package/src/handlers/gestures/nativeGesture.ts +27 -0
- package/src/handlers/gestures/panGesture.ts +147 -0
- package/src/handlers/gestures/pinchGesture.ts +51 -0
- package/src/handlers/gestures/reanimatedWrapper.ts +45 -0
- package/src/handlers/gestures/rotationGesture.ts +51 -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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GestureHandler.ts"],"names":["Hammer","findNodeHandle","State","EventMap","NodeManager","gestureInstances","GestureHandler","id","name","gestureInstance","isDiscrete","shouldEnableGestureOnSetup","Error","constructor","UNDETERMINED","Array","isArray","config","waitFor","gesture","removePendingGesture","clearSelfAsPending","hammer","stop","destroy","x","y","rect","view","getBoundingClientRect","pointerInside","left","right","top","bottom","nativeEvent","onGestureHandlerEvent","onGestureHandlerStateChange","propsRef","current","event","transformEventData","invokeNullableMethod","lastSentState","state","get","enable","recognizer","inputData","enabled","isGestureRunning","hasGestureFailed","options","maxPointers","_stillWaiting","_getPendingGestures","length","hasCustomActivationCriteria","deltaRotation","initialRotation","rotation","success","failed","isGestureEnabledForEvent","getConfig","simulateCancelEvent","params","getHammerConfig","set","onWaitingEnded","_gesture","pendingGestures","addPendingGesture","_config","_recognizer","_event","NativeGestureClass","updateHasCustomActivationCriteria","updateGestureConfig","props","ensureConfig","sync","getState","type","eventType","numberOfPointers","changedTouch","changedPointers","isPointInView","clientX","clientY","previousState","oldState","transformNativeEvent","handlerTag","target","ref","timeStamp","Date","now","cancelPendingGestures","Object","values","cancelEvent","notifyPendingGestures","onGestureEnded","forceInvalidate","sendEvent","INPUT_CANCEL","isFinal","onRawEvent","isFirst","setView","Manager","add","on","ev","setTimeout","setupEvents","onStart","onGestureActivated","deltaX","deltaY","__initialX","__initialY","onSuccess","stillWaiting","filter","pointers","minPointers","_inputData","method","__getHandler","handler","argMapping","__nodeConfig","index","key","value","nativeValue","setValue","minDist","minDistSq","minVelocity","minVelocitySq","maxDist","maxDistSq","asArray","map","getHandler","v","configProps","forEach","prop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AA;AAAF,KAAD,KACH1F,WAAW,CAACiJ,UAAZ,CAAuBvD,UAAvB,CAFY,EAIbiC,MAJa,CAILuB,CAAD,IAAOA,CAJD,CAAhB;AAKD,GAND,MAMO;AACLvE,IAAAA,KAAK,CAAC7D,OAAN,GAAgB,IAAhB;AACD;;AAED,QAAMqI,WAAW,GAAG,CAClB,aADkB,EAElB,aAFkB,EAGlB,SAHkB,EAIlB,SAJkB,EAKlB,WALkB,EAMlB,eANkB,EAOlB,WAPkB,EAQlB,aARkB,EASlB,kBATkB,EAUlB,kBAVkB,EAWlB,gBAXkB,EAYlB,gBAZkB,EAalB,oBAbkB,EAclB,kBAdkB,EAelB,oBAfkB,EAgBlB,kBAhBkB,CAApB;AAkBAA,EAAAA,WAAW,CAACC,OAAZ,CAAqBC,IAAD,IAAsC;AACxD,QAAI,OAAO1E,KAAK,CAAC0E,IAAD,CAAZ,KAAuB,WAA3B,EAAwC;AACtC1E,MAAAA,KAAK,CAAC0E,IAAD,CAAL,GAAcC,MAAM,CAACC,GAArB;AACD;AACF,GAJD;AAKA,SAAO5E,KAAP,CAjDsD,CAiDpB;AACnC;;AAED,SAASoE,OAAT,CAAoBT,KAApB,EAAoC;AAClC;AACA,SAAOA,KAAK,IAAI,IAAT,GAAgB,EAAhB,GAAqB3H,KAAK,CAACC,OAAN,CAAc0H,KAAd,IAAuBA,KAAvB,GAA+B,CAACA,KAAD,CAA3D;AACD;;AAED,eAAepI,cAAf","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport Hammer from '@egjs/hammerjs';\nimport { findNodeHandle } from 'react-native';\n\nimport { State } from '../State';\nimport { EventMap } from './constants';\nimport * as NodeManager from './NodeManager';\n\n// TODO(TS) Replace with HammerInput if https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438/files is merged\nexport type HammerInputExt = Omit<HammerInput, 'destroy' | 'handler' | 'init'>;\n\nexport type Config = Partial<{\n enabled: boolean;\n minPointers: number;\n maxPointers: number;\n minDist: number;\n minDistSq: number;\n minVelocity: number;\n minVelocitySq: number;\n maxDist: number;\n maxDistSq: number;\n failOffsetXStart: number;\n failOffsetYStart: number;\n failOffsetXEnd: number;\n failOffsetYEnd: number;\n activeOffsetXStart: number;\n activeOffsetXEnd: number;\n activeOffsetYStart: number;\n activeOffsetYEnd: number;\n waitFor: any[] | null;\n}>;\n\ntype NativeEvent = ReturnType<GestureHandler['transformEventData']>;\n\nlet gestureInstances = 0;\n\nabstract class GestureHandler {\n public handlerTag: any;\n public isGestureRunning = false;\n public view: number | null = null;\n protected hasCustomActivationCriteria: boolean;\n protected hasGestureFailed = false;\n protected hammer: HammerManager | null = null;\n protected initialRotation: number | null = null;\n protected __initialX: any;\n protected __initialY: any;\n protected config: Config = {};\n protected previousState: State = State.UNDETERMINED;\n private pendingGestures: Record<string, this> = {};\n private oldState: State = State.UNDETERMINED;\n private lastSentState: State | null = null;\n private gestureInstance: number;\n private _stillWaiting: any;\n private propsRef: any;\n private ref: any;\n\n abstract get name(): string;\n\n get id() {\n return `${this.name}${this.gestureInstance}`;\n }\n\n get isDiscrete() {\n return false;\n }\n\n get shouldEnableGestureOnSetup(): boolean {\n throw new Error('Must override GestureHandler.shouldEnableGestureOnSetup');\n }\n\n constructor() {\n this.gestureInstance = gestureInstances++;\n this.hasCustomActivationCriteria = false;\n }\n\n getConfig() {\n return this.config;\n }\n\n onWaitingEnded(_gesture: this) {}\n\n removePendingGesture(id: string) {\n delete this.pendingGestures[id];\n }\n\n addPendingGesture(gesture: this) {\n this.pendingGestures[gesture.id] = gesture;\n }\n\n isGestureEnabledForEvent(\n _config: any,\n _recognizer: any,\n _event: any\n ): { failed?: boolean; success?: boolean } {\n return { success: true };\n }\n\n get NativeGestureClass(): RecognizerStatic {\n throw new Error('Must override GestureHandler.NativeGestureClass');\n }\n\n updateHasCustomActivationCriteria(_config: Config) {\n return true;\n }\n\n clearSelfAsPending = () => {\n if (Array.isArray(this.config.waitFor)) {\n for (const gesture of this.config.waitFor) {\n gesture.removePendingGesture(this.id);\n }\n }\n };\n\n updateGestureConfig({ enabled = true, ...props }) {\n this.clearSelfAsPending();\n\n this.config = ensureConfig({ enabled, ...props });\n this.hasCustomActivationCriteria = this.updateHasCustomActivationCriteria(\n this.config\n );\n if (Array.isArray(this.config.waitFor)) {\n for (const gesture of this.config.waitFor) {\n gesture.addPendingGesture(this);\n }\n }\n\n if (this.hammer) {\n this.sync();\n }\n return this.config;\n }\n\n destroy = () => {\n this.clearSelfAsPending();\n\n if (this.hammer) {\n this.hammer.stop(false);\n this.hammer.destroy();\n }\n this.hammer = null;\n };\n\n isPointInView = ({ x, y }: { x: number; y: number }) => {\n // @ts-ignore FIXME(TS)\n const rect = this.view!.getBoundingClientRect();\n const pointerInside =\n x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;\n return pointerInside;\n };\n\n getState(type: keyof typeof EventMap): State {\n // @ts-ignore TODO(TS) check if this is needed\n if (type == 0) {\n return 0;\n }\n return EventMap[type];\n }\n\n transformEventData(event: HammerInputExt) {\n const { eventType, maxPointers: numberOfPointers } = event;\n // const direction = DirectionMap[ev.direction];\n const changedTouch = event.changedPointers[0];\n const pointerInside = this.isPointInView({\n x: changedTouch.clientX,\n y: changedTouch.clientY,\n });\n\n // TODO(TS) Remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50966 is merged.\n const state = this.getState(eventType as 1 | 2 | 4 | 8);\n if (state !== this.previousState) {\n this.oldState = this.previousState;\n this.previousState = state;\n }\n\n return {\n nativeEvent: {\n numberOfPointers,\n state,\n pointerInside,\n ...this.transformNativeEvent(event),\n // onHandlerStateChange only\n handlerTag: this.handlerTag,\n target: this.ref,\n oldState: this.oldState,\n },\n timeStamp: Date.now(),\n };\n }\n\n transformNativeEvent(_event: HammerInputExt) {\n return {};\n }\n\n sendEvent = (nativeEvent: HammerInputExt) => {\n const {\n onGestureHandlerEvent,\n onGestureHandlerStateChange,\n } = this.propsRef.current;\n\n const event = this.transformEventData(nativeEvent);\n\n invokeNullableMethod(onGestureHandlerEvent, event);\n if (this.lastSentState !== event.nativeEvent.state) {\n this.lastSentState = event.nativeEvent.state as State;\n invokeNullableMethod(onGestureHandlerStateChange, event);\n }\n };\n\n cancelPendingGestures(event: HammerInputExt) {\n for (const gesture of Object.values(this.pendingGestures)) {\n if (gesture && gesture.isGestureRunning) {\n gesture.hasGestureFailed = true;\n gesture.cancelEvent(event);\n }\n }\n }\n\n notifyPendingGestures() {\n for (const gesture of Object.values(this.pendingGestures)) {\n if (gesture) {\n gesture.onWaitingEnded(this);\n }\n }\n }\n\n // FIXME event is undefined in runtime when firstly invoked (see Draggable example), check other functions taking event as input\n onGestureEnded(event: HammerInputExt) {\n this.isGestureRunning = false;\n this.cancelPendingGestures(event);\n }\n\n forceInvalidate(event: HammerInputExt) {\n if (this.isGestureRunning) {\n this.hasGestureFailed = true;\n this.cancelEvent(event);\n }\n }\n\n cancelEvent(event: HammerInputExt) {\n this.notifyPendingGestures();\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_CANCEL,\n isFinal: true,\n });\n this.onGestureEnded(event);\n }\n\n onRawEvent({ isFirst }: HammerInputExt) {\n if (isFirst) {\n this.hasGestureFailed = false;\n }\n }\n\n setView(ref: Parameters<typeof findNodeHandle>['0'], propsRef: any) {\n if (ref == null) {\n this.destroy();\n this.view = null;\n return;\n }\n\n this.propsRef = propsRef;\n this.ref = ref;\n\n this.view = findNodeHandle(ref);\n this.hammer = new Hammer.Manager(this.view as any);\n\n this.oldState = State.UNDETERMINED;\n this.previousState = State.UNDETERMINED;\n this.lastSentState = null;\n\n const { NativeGestureClass } = this;\n // @ts-ignore TODO(TS)\n const gesture = new NativeGestureClass(this.getHammerConfig());\n this.hammer.add(gesture);\n\n this.hammer.on('hammer.input', (ev: HammerInput) => {\n if (!this.config.enabled) {\n this.hasGestureFailed = false;\n this.isGestureRunning = false;\n return;\n }\n\n this.onRawEvent((ev as unknown) as HammerInputExt);\n\n // TODO: Bacon: Check against something other than null\n // The isFirst value is not called when the first rotation is calculated.\n if (this.initialRotation === null && ev.rotation !== 0) {\n this.initialRotation = ev.rotation;\n }\n if (ev.isFinal) {\n // in favor of a willFail otherwise the last frame of the gesture will be captured.\n setTimeout(() => {\n this.initialRotation = null;\n this.hasGestureFailed = false;\n });\n }\n });\n\n this.setupEvents();\n this.sync();\n }\n\n setupEvents() {\n // TODO(TS) Hammer types aren't exactly that what we get in runtime\n if (!this.isDiscrete) {\n this.hammer!.on(`${this.name}start`, (event: HammerInput) =>\n this.onStart((event as unknown) as HammerInputExt)\n );\n this.hammer!.on(\n `${this.name}end ${this.name}cancel`,\n (event: HammerInput) => {\n this.onGestureEnded((event as unknown) as HammerInputExt);\n }\n );\n }\n this.hammer!.on(this.name, (ev: HammerInput) =>\n this.onGestureActivated((ev as unknown) as HammerInputExt)\n ); // TODO(TS) remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438 is merged\n }\n\n onStart({ deltaX, deltaY, rotation }: HammerInputExt) {\n // Reset the state for the next gesture\n this.oldState = State.UNDETERMINED;\n this.previousState = State.UNDETERMINED;\n this.lastSentState = null;\n\n this.isGestureRunning = true;\n this.__initialX = deltaX;\n this.__initialY = deltaY;\n this.initialRotation = rotation;\n }\n\n onGestureActivated(ev: HammerInputExt) {\n this.sendEvent(ev);\n }\n\n onSuccess() {}\n\n _getPendingGestures() {\n if (Array.isArray(this.config.waitFor) && this.config.waitFor.length) {\n // Get the list of gestures that this gesture is still waiting for.\n // Use `=== false` in case a ref that isn't a gesture handler is used.\n const stillWaiting = this.config.waitFor.filter(\n ({ hasGestureFailed }) => hasGestureFailed === false\n );\n return stillWaiting;\n }\n return [];\n }\n\n getHammerConfig() {\n const pointers =\n this.config.minPointers === this.config.maxPointers\n ? this.config.minPointers\n : 0;\n return {\n pointers,\n };\n }\n\n sync = () => {\n const gesture = this.hammer!.get(this.name);\n if (!gesture) return;\n\n const enable = (recognizer: any, inputData: any) => {\n if (!this.config.enabled) {\n this.isGestureRunning = false;\n this.hasGestureFailed = false;\n return false;\n }\n\n // Prevent events before the system is ready.\n if (\n !inputData ||\n !recognizer.options ||\n typeof inputData.maxPointers === 'undefined'\n ) {\n return this.shouldEnableGestureOnSetup;\n }\n\n if (this.hasGestureFailed) {\n return false;\n }\n\n if (!this.isDiscrete) {\n if (this.isGestureRunning) {\n return true;\n }\n // The built-in hammer.js \"waitFor\" doesn't work across multiple views.\n // Only process if there are views to wait for.\n this._stillWaiting = this._getPendingGestures();\n // This gesture should continue waiting.\n if (this._stillWaiting.length) {\n // Check to see if one of the gestures you're waiting for has started.\n // If it has then the gesture should fail.\n for (const gesture of this._stillWaiting) {\n // When the target gesture has started, this gesture must force fail.\n if (!gesture.isDiscrete && gesture.isGestureRunning) {\n this.hasGestureFailed = true;\n this.isGestureRunning = false;\n return false;\n }\n }\n // This gesture shouldn't start until the others have finished.\n return false;\n }\n }\n\n // Use default behaviour\n if (!this.hasCustomActivationCriteria) {\n return true;\n }\n\n const deltaRotation =\n this.initialRotation == null\n ? 0\n : inputData.rotation - this.initialRotation;\n // @ts-ignore FIXME(TS)\n const { success, failed } = this.isGestureEnabledForEvent(\n this.getConfig(),\n recognizer,\n {\n ...inputData,\n deltaRotation,\n }\n );\n\n if (failed) {\n this.simulateCancelEvent(inputData);\n this.hasGestureFailed = true;\n }\n return success;\n };\n\n const params = this.getHammerConfig();\n // @ts-ignore FIXME(TS)\n gesture.set({ ...params, enable });\n };\n\n simulateCancelEvent(_inputData: any) {}\n}\n\n// TODO(TS) investigate this method\n// Used for sending data to a callback or AnimatedEvent\nfunction invokeNullableMethod(\n method:\n | ((event: NativeEvent) => void)\n | { __getHandler: () => (event: NativeEvent) => void }\n | { __nodeConfig: { argMapping: any } },\n event: NativeEvent\n) {\n if (method) {\n if (typeof method === 'function') {\n method(event);\n } else {\n // For use with reanimated's AnimatedEvent\n if (\n '__getHandler' in method &&\n typeof method.__getHandler === 'function'\n ) {\n const handler = method.__getHandler();\n invokeNullableMethod(handler, event);\n } else {\n if ('__nodeConfig' in method) {\n const { argMapping } = method.__nodeConfig;\n if (Array.isArray(argMapping)) {\n for (const index in argMapping) {\n const [key, value] = argMapping[index];\n if (key in event.nativeEvent) {\n // @ts-ignore fix method type\n const nativeValue = event.nativeEvent[key];\n if (value && value.setValue) {\n // Reanimated API\n value.setValue(nativeValue);\n } else {\n // RN Animated API\n method.__nodeConfig.argMapping[index] = [key, nativeValue];\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\n// Validate the props\nfunction ensureConfig(config: Config): Required<Config> {\n const props = { ...config };\n\n // TODO(TS) We use ! to assert that if property is present then value is not empty (null, undefined)\n if ('minDist' in config) {\n props.minDist = config.minDist;\n props.minDistSq = props.minDist! * props.minDist!;\n }\n if ('minVelocity' in config) {\n props.minVelocity = config.minVelocity;\n props.minVelocitySq = props.minVelocity! * props.minVelocity!;\n }\n if ('maxDist' in config) {\n props.maxDist = config.maxDist;\n props.maxDistSq = config.maxDist! * config.maxDist!;\n }\n if ('waitFor' in config) {\n props.waitFor = asArray(config.waitFor)\n .map(({ handlerTag }: { handlerTag: number }) =>\n NodeManager.getHandler(handlerTag)\n )\n .filter((v) => v);\n } else {\n props.waitFor = null;\n }\n\n const configProps = [\n 'minPointers',\n 'maxPointers',\n 'minDist',\n 'maxDist',\n 'maxDistSq',\n 'minVelocitySq',\n 'minDistSq',\n 'minVelocity',\n 'failOffsetXStart',\n 'failOffsetYStart',\n 'failOffsetXEnd',\n 'failOffsetYEnd',\n 'activeOffsetXStart',\n 'activeOffsetXEnd',\n 'activeOffsetYStart',\n 'activeOffsetYEnd',\n ] as const;\n configProps.forEach((prop: typeof configProps[number]) => {\n if (typeof props[prop] === 'undefined') {\n props[prop] = Number.NaN;\n }\n });\n return props as Required<Config>; // TODO(TS) how to convince TS that props are filled?\n}\n\nfunction asArray<T>(value: T | T[]) {\n // TODO(TS) use config.waitFor type\n return value == null ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport default GestureHandler;\n"]}
|
|
1
|
+
{"version":3,"sources":["GestureHandler.ts"],"names":["Hammer","findNodeHandle","State","EventMap","NodeManager","gestureInstances","GestureHandler","id","name","gestureInstance","isDiscrete","shouldEnableGestureOnSetup","Error","constructor","UNDETERMINED","Array","isArray","config","waitFor","gesture","removePendingGesture","clearSelfAsPending","hammer","stop","destroy","x","y","rect","view","getBoundingClientRect","pointerInside","left","right","top","bottom","nativeEvent","onGestureHandlerEvent","onGestureHandlerStateChange","propsRef","current","event","transformEventData","invokeNullableMethod","lastSentState","state","get","enable","recognizer","inputData","enabled","isGestureRunning","hasGestureFailed","options","maxPointers","_stillWaiting","_getPendingGestures","length","hasCustomActivationCriteria","deltaRotation","initialRotation","rotation","success","failed","isGestureEnabledForEvent","getConfig","simulateCancelEvent","params","getHammerConfig","set","onWaitingEnded","_gesture","pendingGestures","addPendingGesture","_config","_recognizer","_event","NativeGestureClass","updateHasCustomActivationCriteria","updateGestureConfig","props","ensureConfig","sync","getState","type","eventType","numberOfPointers","changedTouch","changedPointers","isPointInView","clientX","clientY","previousState","oldState","transformNativeEvent","handlerTag","target","ref","timeStamp","Date","now","cancelPendingGestures","Object","values","cancelEvent","notifyPendingGestures","onGestureEnded","forceInvalidate","sendEvent","INPUT_CANCEL","isFinal","onRawEvent","isFirst","setView","Manager","add","on","ev","setTimeout","setupEvents","onStart","onGestureActivated","deltaX","deltaY","__initialX","__initialY","onSuccess","stillWaiting","filter","pointers","minPointers","_inputData","method","__getHandler","handler","argMapping","__nodeConfig","index","key","value","entries","nativeValue","setValue","minDist","minDistSq","minVelocity","minVelocitySq","maxDist","maxDistSq","asArray","map","getHandler","v","configProps","forEach","prop","Number","NaN"],"mappings":";;AAAA;;AACA;AACA,OAAOA,MAAP,MAAmB,gBAAnB;AACA,SAASC,cAAT,QAA+B,cAA/B;AAEA,SAASC,KAAT,QAAsB,UAAtB;AACA,SAASC,QAAT,QAAyB,aAAzB;AACA,OAAO,KAAKC,WAAZ,MAA6B,eAA7B,C,CAEA;;AA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B;AACD;;AAED,QAAMsI,WAAW,GAAG,CAClB,aADkB,EAElB,aAFkB,EAGlB,SAHkB,EAIlB,SAJkB,EAKlB,WALkB,EAMlB,eANkB,EAOlB,WAPkB,EAQlB,aARkB,EASlB,kBATkB,EAUlB,kBAVkB,EAWlB,gBAXkB,EAYlB,gBAZkB,EAalB,oBAbkB,EAclB,kBAdkB,EAelB,oBAfkB,EAgBlB,kBAhBkB,CAApB;AAkBAA,EAAAA,WAAW,CAACC,OAAZ,CAAqBC,IAAD,IAAsC;AACxD,QAAI,OAAO3E,KAAK,CAAC2E,IAAD,CAAZ,KAAuB,WAA3B,EAAwC;AACtC3E,MAAAA,KAAK,CAAC2E,IAAD,CAAL,GAAcC,MAAM,CAACC,GAArB;AACD;AACF,GAJD;AAKA,SAAO7E,KAAP,CAjDsD,CAiDpB;AACnC;;AAED,SAASqE,OAAT,CAAoBV,KAApB,EAAoC;AAClC;AACA,SAAOA,KAAK,IAAI,IAAT,GAAgB,EAAhB,GAAqB3H,KAAK,CAACC,OAAN,CAAc0H,KAAd,IAAuBA,KAAvB,GAA+B,CAACA,KAAD,CAA3D;AACD;;AAED,eAAepI,cAAf","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport Hammer from '@egjs/hammerjs';\nimport { findNodeHandle } from 'react-native';\n\nimport { State } from '../State';\nimport { EventMap } from './constants';\nimport * as NodeManager from './NodeManager';\n\n// TODO(TS) Replace with HammerInput if https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438/files is merged\nexport type HammerInputExt = Omit<HammerInput, 'destroy' | 'handler' | 'init'>;\n\nexport type Config = Partial<{\n enabled: boolean;\n minPointers: number;\n maxPointers: number;\n minDist: number;\n minDistSq: number;\n minVelocity: number;\n minVelocitySq: number;\n maxDist: number;\n maxDistSq: number;\n failOffsetXStart: number;\n failOffsetYStart: number;\n failOffsetXEnd: number;\n failOffsetYEnd: number;\n activeOffsetXStart: number;\n activeOffsetXEnd: number;\n activeOffsetYStart: number;\n activeOffsetYEnd: number;\n waitFor: any[] | null;\n}>;\n\ntype NativeEvent = ReturnType<GestureHandler['transformEventData']>;\n\nlet gestureInstances = 0;\n\nabstract class GestureHandler {\n public handlerTag: any;\n public isGestureRunning = false;\n public view: number | null = null;\n protected hasCustomActivationCriteria: boolean;\n protected hasGestureFailed = false;\n protected hammer: HammerManager | null = null;\n protected initialRotation: number | null = null;\n protected __initialX: any;\n protected __initialY: any;\n protected config: Config = {};\n protected previousState: State = State.UNDETERMINED;\n private pendingGestures: Record<string, this> = {};\n private oldState: State = State.UNDETERMINED;\n private lastSentState: State | null = null;\n private gestureInstance: number;\n private _stillWaiting: any;\n private propsRef: any;\n private ref: any;\n\n abstract get name(): string;\n\n get id() {\n return `${this.name}${this.gestureInstance}`;\n }\n\n get isDiscrete() {\n return false;\n }\n\n get shouldEnableGestureOnSetup(): boolean {\n throw new Error('Must override GestureHandler.shouldEnableGestureOnSetup');\n }\n\n constructor() {\n this.gestureInstance = gestureInstances++;\n this.hasCustomActivationCriteria = false;\n }\n\n getConfig() {\n return this.config;\n }\n\n onWaitingEnded(_gesture: this) {}\n\n removePendingGesture(id: string) {\n delete this.pendingGestures[id];\n }\n\n addPendingGesture(gesture: this) {\n this.pendingGestures[gesture.id] = gesture;\n }\n\n isGestureEnabledForEvent(\n _config: any,\n _recognizer: any,\n _event: any\n ): { failed?: boolean; success?: boolean } {\n return { success: true };\n }\n\n get NativeGestureClass(): RecognizerStatic {\n throw new Error('Must override GestureHandler.NativeGestureClass');\n }\n\n updateHasCustomActivationCriteria(_config: Config) {\n return true;\n }\n\n clearSelfAsPending = () => {\n if (Array.isArray(this.config.waitFor)) {\n for (const gesture of this.config.waitFor) {\n gesture.removePendingGesture(this.id);\n }\n }\n };\n\n updateGestureConfig({ enabled = true, ...props }) {\n this.clearSelfAsPending();\n\n this.config = ensureConfig({ enabled, ...props });\n this.hasCustomActivationCriteria = this.updateHasCustomActivationCriteria(\n this.config\n );\n if (Array.isArray(this.config.waitFor)) {\n for (const gesture of this.config.waitFor) {\n gesture.addPendingGesture(this);\n }\n }\n\n if (this.hammer) {\n this.sync();\n }\n return this.config;\n }\n\n destroy = () => {\n this.clearSelfAsPending();\n\n if (this.hammer) {\n this.hammer.stop(false);\n this.hammer.destroy();\n }\n this.hammer = null;\n };\n\n isPointInView = ({ x, y }: { x: number; y: number }) => {\n // @ts-ignore FIXME(TS)\n const rect = this.view!.getBoundingClientRect();\n const pointerInside =\n x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;\n return pointerInside;\n };\n\n getState(type: keyof typeof EventMap): State {\n // @ts-ignore TODO(TS) check if this is needed\n if (type == 0) {\n return 0;\n }\n return EventMap[type];\n }\n\n transformEventData(event: HammerInputExt) {\n const { eventType, maxPointers: numberOfPointers } = event;\n // const direction = DirectionMap[ev.direction];\n const changedTouch = event.changedPointers[0];\n const pointerInside = this.isPointInView({\n x: changedTouch.clientX,\n y: changedTouch.clientY,\n });\n\n // TODO(TS) Remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50966 is merged.\n const state = this.getState(eventType as 1 | 2 | 4 | 8);\n if (state !== this.previousState) {\n this.oldState = this.previousState;\n this.previousState = state;\n }\n\n return {\n nativeEvent: {\n numberOfPointers,\n state,\n pointerInside,\n ...this.transformNativeEvent(event),\n // onHandlerStateChange only\n handlerTag: this.handlerTag,\n target: this.ref,\n oldState: this.oldState,\n },\n timeStamp: Date.now(),\n };\n }\n\n transformNativeEvent(_event: HammerInputExt) {\n return {};\n }\n\n sendEvent = (nativeEvent: HammerInputExt) => {\n const {\n onGestureHandlerEvent,\n onGestureHandlerStateChange,\n } = this.propsRef.current;\n\n const event = this.transformEventData(nativeEvent);\n\n invokeNullableMethod(onGestureHandlerEvent, event);\n if (this.lastSentState !== event.nativeEvent.state) {\n this.lastSentState = event.nativeEvent.state as State;\n invokeNullableMethod(onGestureHandlerStateChange, event);\n }\n };\n\n cancelPendingGestures(event: HammerInputExt) {\n for (const gesture of Object.values(this.pendingGestures)) {\n if (gesture && gesture.isGestureRunning) {\n gesture.hasGestureFailed = true;\n gesture.cancelEvent(event);\n }\n }\n }\n\n notifyPendingGestures() {\n for (const gesture of Object.values(this.pendingGestures)) {\n if (gesture) {\n gesture.onWaitingEnded(this);\n }\n }\n }\n\n // FIXME event is undefined in runtime when firstly invoked (see Draggable example), check other functions taking event as input\n onGestureEnded(event: HammerInputExt) {\n this.isGestureRunning = false;\n this.cancelPendingGestures(event);\n }\n\n forceInvalidate(event: HammerInputExt) {\n if (this.isGestureRunning) {\n this.hasGestureFailed = true;\n this.cancelEvent(event);\n }\n }\n\n cancelEvent(event: HammerInputExt) {\n this.notifyPendingGestures();\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_CANCEL,\n isFinal: true,\n });\n this.onGestureEnded(event);\n }\n\n onRawEvent({ isFirst }: HammerInputExt) {\n if (isFirst) {\n this.hasGestureFailed = false;\n }\n }\n\n setView(ref: Parameters<typeof findNodeHandle>['0'], propsRef: any) {\n if (ref == null) {\n this.destroy();\n this.view = null;\n return;\n }\n\n this.propsRef = propsRef;\n this.ref = ref;\n\n this.view = findNodeHandle(ref);\n this.hammer = new Hammer.Manager(this.view as any);\n\n this.oldState = State.UNDETERMINED;\n this.previousState = State.UNDETERMINED;\n this.lastSentState = null;\n\n const { NativeGestureClass } = this;\n // @ts-ignore TODO(TS)\n const gesture = new NativeGestureClass(this.getHammerConfig());\n this.hammer.add(gesture);\n\n this.hammer.on('hammer.input', (ev: HammerInput) => {\n if (!this.config.enabled) {\n this.hasGestureFailed = false;\n this.isGestureRunning = false;\n return;\n }\n\n this.onRawEvent((ev as unknown) as HammerInputExt);\n\n // TODO: Bacon: Check against something other than null\n // The isFirst value is not called when the first rotation is calculated.\n if (this.initialRotation === null && ev.rotation !== 0) {\n this.initialRotation = ev.rotation;\n }\n if (ev.isFinal) {\n // in favor of a willFail otherwise the last frame of the gesture will be captured.\n setTimeout(() => {\n this.initialRotation = null;\n this.hasGestureFailed = false;\n });\n }\n });\n\n this.setupEvents();\n this.sync();\n }\n\n setupEvents() {\n // TODO(TS) Hammer types aren't exactly that what we get in runtime\n if (!this.isDiscrete) {\n this.hammer!.on(`${this.name}start`, (event: HammerInput) =>\n this.onStart((event as unknown) as HammerInputExt)\n );\n this.hammer!.on(\n `${this.name}end ${this.name}cancel`,\n (event: HammerInput) => {\n this.onGestureEnded((event as unknown) as HammerInputExt);\n }\n );\n }\n this.hammer!.on(this.name, (ev: HammerInput) =>\n this.onGestureActivated((ev as unknown) as HammerInputExt)\n ); // TODO(TS) remove cast after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/50438 is merged\n }\n\n onStart({ deltaX, deltaY, rotation }: HammerInputExt) {\n // Reset the state for the next gesture\n this.oldState = State.UNDETERMINED;\n this.previousState = State.UNDETERMINED;\n this.lastSentState = null;\n\n this.isGestureRunning = true;\n this.__initialX = deltaX;\n this.__initialY = deltaY;\n this.initialRotation = rotation;\n }\n\n onGestureActivated(ev: HammerInputExt) {\n this.sendEvent(ev);\n }\n\n onSuccess() {}\n\n _getPendingGestures() {\n if (Array.isArray(this.config.waitFor) && this.config.waitFor.length) {\n // Get the list of gestures that this gesture is still waiting for.\n // Use `=== false` in case a ref that isn't a gesture handler is used.\n const stillWaiting = this.config.waitFor.filter(\n ({ hasGestureFailed }) => hasGestureFailed === false\n );\n return stillWaiting;\n }\n return [];\n }\n\n getHammerConfig() {\n const pointers =\n this.config.minPointers === this.config.maxPointers\n ? this.config.minPointers\n : 0;\n return {\n pointers,\n };\n }\n\n sync = () => {\n const gesture = this.hammer!.get(this.name);\n if (!gesture) return;\n\n const enable = (recognizer: any, inputData: any) => {\n if (!this.config.enabled) {\n this.isGestureRunning = false;\n this.hasGestureFailed = false;\n return false;\n }\n\n // Prevent events before the system is ready.\n if (\n !inputData ||\n !recognizer.options ||\n typeof inputData.maxPointers === 'undefined'\n ) {\n return this.shouldEnableGestureOnSetup;\n }\n\n if (this.hasGestureFailed) {\n return false;\n }\n\n if (!this.isDiscrete) {\n if (this.isGestureRunning) {\n return true;\n }\n // The built-in hammer.js \"waitFor\" doesn't work across multiple views.\n // Only process if there are views to wait for.\n this._stillWaiting = this._getPendingGestures();\n // This gesture should continue waiting.\n if (this._stillWaiting.length) {\n // Check to see if one of the gestures you're waiting for has started.\n // If it has then the gesture should fail.\n for (const gesture of this._stillWaiting) {\n // When the target gesture has started, this gesture must force fail.\n if (!gesture.isDiscrete && gesture.isGestureRunning) {\n this.hasGestureFailed = true;\n this.isGestureRunning = false;\n return false;\n }\n }\n // This gesture shouldn't start until the others have finished.\n return false;\n }\n }\n\n // Use default behaviour\n if (!this.hasCustomActivationCriteria) {\n return true;\n }\n\n const deltaRotation =\n this.initialRotation == null\n ? 0\n : inputData.rotation - this.initialRotation;\n // @ts-ignore FIXME(TS)\n const { success, failed } = this.isGestureEnabledForEvent(\n this.getConfig(),\n recognizer,\n {\n ...inputData,\n deltaRotation,\n }\n );\n\n if (failed) {\n this.simulateCancelEvent(inputData);\n this.hasGestureFailed = true;\n }\n return success;\n };\n\n const params = this.getHammerConfig();\n // @ts-ignore FIXME(TS)\n gesture.set({ ...params, enable });\n };\n\n simulateCancelEvent(_inputData: any) {}\n}\n\n// TODO(TS) investigate this method\n// Used for sending data to a callback or AnimatedEvent\nfunction invokeNullableMethod(\n method:\n | ((event: NativeEvent) => void)\n | { __getHandler: () => (event: NativeEvent) => void }\n | { __nodeConfig: { argMapping: any } },\n event: NativeEvent\n) {\n if (method) {\n if (typeof method === 'function') {\n method(event);\n } else {\n // For use with reanimated's AnimatedEvent\n if (\n '__getHandler' in method &&\n typeof method.__getHandler === 'function'\n ) {\n const handler = method.__getHandler();\n invokeNullableMethod(handler, event);\n } else {\n if ('__nodeConfig' in method) {\n const { argMapping } = method.__nodeConfig;\n if (Array.isArray(argMapping)) {\n for (const [index, [key, value]] of argMapping.entries()) {\n if (key in event.nativeEvent) {\n // @ts-ignore fix method type\n const nativeValue = event.nativeEvent[key];\n if (value && value.setValue) {\n // Reanimated API\n value.setValue(nativeValue);\n } else {\n // RN Animated API\n method.__nodeConfig.argMapping[index] = [key, nativeValue];\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\n// Validate the props\nfunction ensureConfig(config: Config): Required<Config> {\n const props = { ...config };\n\n // TODO(TS) We use ! to assert that if property is present then value is not empty (null, undefined)\n if ('minDist' in config) {\n props.minDist = config.minDist;\n props.minDistSq = props.minDist! * props.minDist!;\n }\n if ('minVelocity' in config) {\n props.minVelocity = config.minVelocity;\n props.minVelocitySq = props.minVelocity! * props.minVelocity!;\n }\n if ('maxDist' in config) {\n props.maxDist = config.maxDist;\n props.maxDistSq = config.maxDist! * config.maxDist!;\n }\n if ('waitFor' in config) {\n props.waitFor = asArray(config.waitFor)\n .map(({ handlerTag }: { handlerTag: number }) =>\n NodeManager.getHandler(handlerTag)\n )\n .filter((v) => v);\n } else {\n props.waitFor = null;\n }\n\n const configProps = [\n 'minPointers',\n 'maxPointers',\n 'minDist',\n 'maxDist',\n 'maxDistSq',\n 'minVelocitySq',\n 'minDistSq',\n 'minVelocity',\n 'failOffsetXStart',\n 'failOffsetYStart',\n 'failOffsetXEnd',\n 'failOffsetYEnd',\n 'activeOffsetXStart',\n 'activeOffsetXEnd',\n 'activeOffsetYStart',\n 'activeOffsetYEnd',\n ] as const;\n configProps.forEach((prop: typeof configProps[number]) => {\n if (typeof props[prop] === 'undefined') {\n props[prop] = Number.NaN;\n }\n });\n return props as Required<Config>; // TODO(TS) how to convince TS that props are filled?\n}\n\nfunction asArray<T>(value: T | T[]) {\n // TODO(TS) use config.waitFor type\n return value == null ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport default GestureHandler;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const gestures = {};
|
|
2
2
|
export function getHandler(tag) {
|
|
3
3
|
if (tag in gestures) return gestures[tag];
|
|
4
|
-
throw new Error(
|
|
4
|
+
throw new Error(`No handler for tag ${tag}`);
|
|
5
5
|
}
|
|
6
6
|
export function createGestureHandler(handlerTag, handler) {
|
|
7
7
|
if (handlerTag in gestures) {
|
|
8
|
-
throw new Error(
|
|
8
|
+
throw new Error(`Handler with tag ${handlerTag} already exists`);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
gestures[handlerTag] = handler; // @ts-ignore no types for web handlers yet
|
|
@@ -13,6 +13,12 @@ export function createGestureHandler(handlerTag, handler) {
|
|
|
13
13
|
gestures[handlerTag].handlerTag = handlerTag;
|
|
14
14
|
}
|
|
15
15
|
export function dropGestureHandler(handlerTag) {
|
|
16
|
+
// Since React 18, there are cases where componentWillUnmount gets called twice in a row
|
|
17
|
+
// so skip this if the tag was already removed.
|
|
18
|
+
if (!(handlerTag in gestures)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
getHandler(handlerTag).destroy(); // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
17
23
|
|
|
18
24
|
delete gestures[handlerTag];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["NodeManager.ts"],"names":["gestures","getHandler","tag","Error","createGestureHandler","handlerTag","handler","dropGestureHandler","destroy","getNodes"],"mappings":"AAGA,MAAMA,QAAgE,GAAG,EAAzE;AAEA,OAAO,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,MAAIA,GAAG,IAAIF,QAAX,EAAqB,OAAOA,QAAQ,CAACE,GAAD,CAAf;AAErB,QAAM,IAAIC,KAAJ,
|
|
1
|
+
{"version":3,"sources":["NodeManager.ts"],"names":["gestures","getHandler","tag","Error","createGestureHandler","handlerTag","handler","dropGestureHandler","destroy","getNodes"],"mappings":"AAGA,MAAMA,QAAgE,GAAG,EAAzE;AAEA,OAAO,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,MAAIA,GAAG,IAAIF,QAAX,EAAqB,OAAOA,QAAQ,CAACE,GAAD,CAAf;AAErB,QAAM,IAAIC,KAAJ,CAAW,sBAAqBD,GAAI,EAApC,CAAN;AACD;AAED,OAAO,SAASE,oBAAT,CACLC,UADK,EAELC,OAFK,EAGL;AACA,MAAID,UAAU,IAAIL,QAAlB,EAA4B;AAC1B,UAAM,IAAIG,KAAJ,CAAW,oBAAmBE,UAAW,iBAAzC,CAAN;AACD;;AACDL,EAAAA,QAAQ,CAACK,UAAD,CAAR,GAAuBC,OAAvB,CAJA,CAKA;;AACAN,EAAAA,QAAQ,CAACK,UAAD,CAAR,CAAqBA,UAArB,GAAkCA,UAAlC;AACD;AAED,OAAO,SAASE,kBAAT,CAA4BF,UAA5B,EAAgD;AACrD;AACA;AACA,MAAI,EAAEA,UAAU,IAAIL,QAAhB,CAAJ,EAA+B;AAC7B;AACD;;AACDC,EAAAA,UAAU,CAACI,UAAD,CAAV,CAAuBG,OAAvB,GANqD,CAOrD;;AACA,SAAOR,QAAQ,CAACK,UAAD,CAAf;AACD;AAED,OAAO,SAASI,QAAT,GAAoB;AACzB,SAAO,EAAE,GAAGT;AAAL,GAAP;AACD","sourcesContent":["import { ValueOf } from '../typeUtils';\nimport { Gestures } from '../RNGestureHandlerModule.web';\n\nconst gestures: Record<number, InstanceType<ValueOf<typeof Gestures>>> = {};\n\nexport function getHandler(tag: number) {\n if (tag in gestures) return gestures[tag];\n\n throw new Error(`No handler for tag ${tag}`);\n}\n\nexport function createGestureHandler(\n handlerTag: number,\n handler: InstanceType<ValueOf<typeof Gestures>>\n) {\n if (handlerTag in gestures) {\n throw new Error(`Handler with tag ${handlerTag} already exists`);\n }\n gestures[handlerTag] = handler;\n // @ts-ignore no types for web handlers yet\n gestures[handlerTag].handlerTag = handlerTag;\n}\n\nexport function dropGestureHandler(handlerTag: number) {\n // Since React 18, there are cases where componentWillUnmount gets called twice in a row\n // so skip this if the tag was already removed.\n if (!(handlerTag in gestures)) {\n return;\n }\n getHandler(handlerTag).destroy();\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete gestures[handlerTag];\n}\n\nexport function getNodes() {\n return { ...gestures };\n}\n"]}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export default function GestureHandlerRootView({ children, ...rest }: Props): JSX.Element;
|
|
4
|
-
export {};
|
|
1
|
+
import { GestureHandlerRootViewProps } from './GestureHandlerRootView';
|
|
2
|
+
export default function GestureHandlerRootView({ children, ...rest }: GestureHandlerRootViewProps): JSX.Element;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
3
|
+
export interface GestureHandlerRootViewProps extends PropsWithChildren<ViewProps> {
|
|
4
|
+
}
|
|
5
|
+
export default function GestureHandlerRootView({ ...rest }: GestureHandlerRootViewProps): JSX.Element;
|
|
@@ -2,7 +2,7 @@ export declare type RNGestureHandlerModuleProps = {
|
|
|
2
2
|
handleSetJSResponder: (tag: number, blockNativeResponder: boolean) => void;
|
|
3
3
|
handleClearJSResponder: () => void;
|
|
4
4
|
createGestureHandler: (handlerName: string, handlerTag: number, config: Readonly<Record<string, unknown>>) => void;
|
|
5
|
-
attachGestureHandler: (handlerTag: number, newView: number) => void;
|
|
5
|
+
attachGestureHandler: (handlerTag: number, newView: number, usingDeviceEvents: boolean) => void;
|
|
6
6
|
updateGestureHandler: (handlerTag: number, newConfig: Readonly<Record<string, unknown>>) => void;
|
|
7
7
|
dropGestureHandler: (handlerTag: number) => void;
|
|
8
8
|
};
|
|
@@ -24,7 +24,7 @@ declare const _default: {
|
|
|
24
24
|
handleSetJSResponder(tag: number, blockNativeResponder: boolean): void;
|
|
25
25
|
handleClearJSResponder(): void;
|
|
26
26
|
createGestureHandler<T>(handlerName: keyof typeof Gestures, handlerTag: number, config: T): void;
|
|
27
|
-
attachGestureHandler(handlerTag: number, newView: number, propsRef: React.RefObject<unknown>): void;
|
|
27
|
+
attachGestureHandler(handlerTag: number, newView: number, _usingDeviceEvents: boolean, propsRef: React.RefObject<unknown>): void;
|
|
28
28
|
updateGestureHandler(handlerTag: number, newConfig: any): void;
|
|
29
29
|
getGestureHandlerNode(handlerTag: number): PanGestureHandler | RotationGestureHandler | PinchGestureHandler | TapGestureHandler | NativeViewGestureHandler | LongPressGestureHandler | FlingGestureHandler;
|
|
30
30
|
dropGestureHandler(handlerTag: number): void;
|
|
@@ -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>>;
|