react-native-gesture-handler 1.10.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/DrawerLayout/package.json +3 -3
- package/README.md +7 -6
- package/Swipeable/package.json +3 -3
- 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/jestSetup.js +7 -0
- package/lib/commonjs/Directions.js +15 -0
- package/lib/commonjs/Directions.js.map +1 -0
- package/lib/commonjs/EventType.js +16 -0
- package/lib/commonjs/EventType.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootView.android.js +24 -0
- package/lib/commonjs/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootView.js +20 -0
- package/lib/commonjs/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/PlatformConstants.js +15 -0
- package/lib/commonjs/PlatformConstants.js.map +1 -0
- package/lib/commonjs/PlatformConstants.web.js +14 -0
- package/lib/commonjs/PlatformConstants.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.js +22 -0
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js +80 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/commonjs/State.js +18 -0
- package/lib/commonjs/State.js.map +1 -0
- package/lib/commonjs/components/DrawerLayout.js +535 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -0
- package/lib/commonjs/components/GestureButtons.js +207 -0
- package/lib/commonjs/components/GestureButtons.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.js +76 -0
- package/lib/commonjs/components/GestureComponents.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.web.js +46 -0
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.js +13 -0
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js +24 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +365 -0
- package/lib/commonjs/components/Swipeable.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +278 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js +109 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +100 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +12 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js +75 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +26 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/index.js +40 -0
- package/lib/commonjs/components/touchables/index.js.map +1 -0
- package/lib/commonjs/gestureHandlerRootHOC.js +39 -0
- package/lib/commonjs/gestureHandlerRootHOC.js.map +1 -0
- 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 +25 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
- 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 +373 -0
- package/lib/commonjs/handlers/createHandler.js.map +1 -0
- package/lib/commonjs/handlers/createNativeWrapper.js +70 -0
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +80 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +2 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.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 +338 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/init.js +13 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/mocks.js +64 -0
- package/lib/commonjs/mocks.js.map +1 -0
- package/lib/commonjs/typeUtils.js +2 -0
- package/lib/commonjs/typeUtils.js.map +1 -0
- package/lib/commonjs/utils.js +15 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/DiscreteGestureHandler.js +105 -0
- package/lib/commonjs/web/DiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web/DraggingGestureHandler.js +53 -0
- package/lib/commonjs/web/DraggingGestureHandler.js.map +1 -0
- package/lib/commonjs/web/Errors.js +16 -0
- package/lib/commonjs/web/Errors.js.map +1 -0
- package/lib/commonjs/web/FlingGestureHandler.js +170 -0
- package/lib/commonjs/web/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web/GestureHandler.js +533 -0
- package/lib/commonjs/web/GestureHandler.js.map +1 -0
- package/lib/commonjs/web/IndiscreteGestureHandler.js +54 -0
- package/lib/commonjs/web/IndiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web/LongPressGestureHandler.js +71 -0
- package/lib/commonjs/web/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web/NativeViewGestureHandler.js +62 -0
- package/lib/commonjs/web/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web/NodeManager.js +43 -0
- package/lib/commonjs/web/NodeManager.js.map +1 -0
- package/lib/commonjs/web/PanGestureHandler.js +189 -0
- package/lib/commonjs/web/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web/PinchGestureHandler.js +40 -0
- package/lib/commonjs/web/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web/PressGestureHandler.js +188 -0
- package/lib/commonjs/web/PressGestureHandler.js.map +1 -0
- package/lib/commonjs/web/RotationGestureHandler.js +44 -0
- package/lib/commonjs/web/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web/TapGestureHandler.js +192 -0
- package/lib/commonjs/web/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web/constants.js +64 -0
- package/lib/commonjs/web/constants.js.map +1 -0
- package/lib/commonjs/web/utils.js +42 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/module/Directions.js +7 -0
- package/lib/module/Directions.js.map +1 -0
- package/lib/module/EventType.js +8 -0
- package/lib/module/EventType.js.map +1 -0
- package/lib/module/GestureHandlerRootView.android.js +10 -0
- package/lib/module/GestureHandlerRootView.android.js.map +1 -0
- package/lib/module/GestureHandlerRootView.js +7 -0
- package/lib/module/GestureHandlerRootView.js.map +1 -0
- package/lib/module/PlatformConstants.js +5 -0
- package/lib/module/PlatformConstants.js.map +1 -0
- package/lib/module/PlatformConstants.web.js +7 -0
- package/lib/module/PlatformConstants.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +13 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.web.js +56 -0
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/module/State.js +10 -0
- package/lib/module/State.js.map +1 -0
- package/lib/module/components/DrawerLayout.js +520 -0
- package/lib/module/components/DrawerLayout.js.map +1 -0
- package/lib/module/components/GestureButtons.js +172 -0
- package/lib/module/components/GestureButtons.js.map +1 -0
- package/lib/module/components/GestureComponents.js +53 -0
- package/lib/module/components/GestureComponents.js.map +1 -0
- package/lib/module/components/GestureComponents.web.js +25 -0
- package/lib/module/components/GestureComponents.web.js.map +1 -0
- package/{dist/src → lib/module}/components/GestureHandlerButton.js +1 -0
- package/lib/module/components/GestureHandlerButton.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.web.js +9 -0
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/module/components/Swipeable.js +347 -0
- package/lib/module/components/Swipeable.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +262 -0
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/module/components/touchables/TouchableHighlight.js +95 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +84 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/{dist/src → lib/module}/components/touchables/TouchableNativeFeedback.js +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/module/components/touchables/TouchableOpacity.js +61 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +10 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/{dist/src → lib/module}/components/touchables/index.js +1 -0
- package/lib/module/components/touchables/index.js.map +1 -0
- package/lib/module/gestureHandlerRootHOC.js +21 -0
- package/lib/module/gestureHandlerRootHOC.js.map +1 -0
- 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 +11 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -0
- 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 +348 -0
- package/lib/module/handlers/createHandler.js.map +1 -0
- package/lib/module/handlers/createNativeWrapper.js +58 -0
- package/lib/module/handlers/createNativeWrapper.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +66 -0
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.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 +34 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/init.js +5 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/mocks.js +54 -0
- package/lib/module/mocks.js.map +1 -0
- package/lib/module/typeUtils.js +2 -0
- package/lib/module/typeUtils.js.map +1 -0
- package/lib/module/utils.js +8 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/DiscreteGestureHandler.js +94 -0
- package/lib/module/web/DiscreteGestureHandler.js.map +1 -0
- package/lib/module/web/DraggingGestureHandler.js +40 -0
- package/lib/module/web/DraggingGestureHandler.js.map +1 -0
- package/lib/module/web/Errors.js +7 -0
- package/lib/module/web/Errors.js.map +1 -0
- package/lib/module/web/FlingGestureHandler.js +156 -0
- package/lib/module/web/FlingGestureHandler.js.map +1 -0
- package/lib/module/web/GestureHandler.js +518 -0
- package/lib/module/web/GestureHandler.js.map +1 -0
- package/lib/module/web/IndiscreteGestureHandler.js +44 -0
- package/lib/module/web/IndiscreteGestureHandler.js.map +1 -0
- package/lib/module/web/LongPressGestureHandler.js +58 -0
- package/lib/module/web/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web/NativeViewGestureHandler.js +45 -0
- package/lib/module/web/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web/NodeManager.js +30 -0
- package/lib/module/web/NodeManager.js.map +1 -0
- package/lib/module/web/PanGestureHandler.js +175 -0
- package/lib/module/web/PanGestureHandler.js.map +1 -0
- package/lib/module/web/PinchGestureHandler.js +29 -0
- package/lib/module/web/PinchGestureHandler.js.map +1 -0
- package/lib/module/web/PressGestureHandler.js +174 -0
- package/lib/module/web/PressGestureHandler.js.map +1 -0
- package/lib/module/web/RotationGestureHandler.js +32 -0
- package/lib/module/web/RotationGestureHandler.js.map +1 -0
- package/lib/module/web/TapGestureHandler.js +180 -0
- package/lib/module/web/TapGestureHandler.js.map +1 -0
- package/lib/module/web/constants.js +43 -0
- package/lib/module/web/constants.js.map +1 -0
- package/lib/module/web/utils.js +19 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/typescript/Directions.d.ts +7 -0
- package/lib/typescript/EventType.d.ts +8 -0
- package/lib/typescript/GestureHandlerRootView.android.d.ts +2 -0
- package/lib/typescript/GestureHandlerRootView.d.ts +5 -0
- package/{dist/src → lib/typescript}/PlatformConstants.d.ts +0 -0
- package/{dist/src → lib/typescript}/PlatformConstants.web.d.ts +0 -0
- package/{dist/src → lib/typescript}/RNGestureHandlerModule.d.ts +1 -8
- package/{dist/src → lib/typescript}/RNGestureHandlerModule.web.d.ts +1 -1
- package/{dist/src → lib/typescript}/State.d.ts +0 -0
- package/{dist/src → lib/typescript}/components/DrawerLayout.d.ts +52 -2
- package/{dist/src → lib/typescript}/components/GestureButtons.d.ts +37 -1
- package/lib/typescript/components/GestureComponents.d.ts +18 -0
- package/lib/typescript/components/GestureComponents.web.d.ts +7 -0
- package/{dist/src → lib/typescript}/components/GestureHandlerButton.d.ts +0 -0
- package/{dist/src → lib/typescript}/components/GestureHandlerButton.web.d.ts +1 -1
- package/lib/typescript/components/Swipeable.d.ts +150 -0
- package/{dist/src → lib/typescript}/components/touchables/GenericTouchable.d.ts +3 -3
- package/{dist/src → lib/typescript}/components/touchables/TouchableHighlight.d.ts +1 -0
- package/{dist/src → lib/typescript}/components/touchables/TouchableNativeFeedback.android.d.ts +0 -0
- package/{dist/src → lib/typescript}/components/touchables/TouchableNativeFeedback.d.ts +0 -0
- package/{dist/src → lib/typescript}/components/touchables/TouchableOpacity.d.ts +1 -0
- package/{dist/src → lib/typescript}/components/touchables/TouchableWithoutFeedback.d.ts +4 -2
- package/{dist/src → lib/typescript}/components/touchables/index.d.ts +0 -0
- package/lib/typescript/gestureHandlerRootHOC.d.ts +3 -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 +27 -0
- 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/{dist/src → lib/typescript}/handlers/createHandler.d.ts +2 -2
- package/{dist/src → lib/typescript}/handlers/createNativeWrapper.d.ts +1 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +62 -0
- package/{dist/src → lib/typescript}/handlers/gestureHandlerTypesCompat.d.ts +17 -2
- 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 +44 -0
- package/lib/typescript/init.d.ts +1 -0
- package/lib/typescript/mocks.d.ts +43 -0
- package/{dist/src → lib/typescript}/typeUtils.d.ts +0 -0
- package/lib/typescript/utils.d.ts +1 -0
- package/{dist/src → lib/typescript}/web/DiscreteGestureHandler.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/DraggingGestureHandler.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/Errors.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/FlingGestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/GestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/IndiscreteGestureHandler.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/LongPressGestureHandler.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/NativeViewGestureHandler.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/NodeManager.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/PanGestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/PinchGestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/PressGestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/RotationGestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/TapGestureHandler.d.ts +0 -1
- package/{dist/src → lib/typescript}/web/constants.d.ts +0 -0
- package/{dist/src → lib/typescript}/web/utils.d.ts +0 -0
- package/package.json +38 -16
- package/src/Directions.ts +8 -2
- package/src/EventType.ts +10 -0
- package/src/GestureHandlerRootView.android.tsx +10 -25
- package/src/GestureHandlerRootView.tsx +12 -0
- package/src/PlatformConstants.ts +3 -2
- package/src/RNGestureHandlerModule.ts +15 -9
- package/src/RNGestureHandlerModule.web.ts +1 -0
- package/src/components/DrawerLayout.tsx +117 -43
- package/src/components/GestureButtons.tsx +46 -6
- package/src/components/GestureComponents.tsx +48 -41
- package/src/components/GestureComponents.web.tsx +1 -1
- package/src/components/{GestureHandlerButton.ts → GestureHandlerButton.tsx} +0 -0
- package/src/components/GestureHandlerButton.web.tsx +1 -1
- package/src/components/Swipeable.tsx +110 -22
- package/src/components/touchables/GenericTouchable.tsx +5 -3
- package/src/components/touchables/TouchableHighlight.tsx +2 -1
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -1
- package/src/components/touchables/{TouchableNativeFeedback.ts → TouchableNativeFeedback.tsx} +0 -0
- package/src/components/touchables/TouchableOpacity.tsx +3 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +3 -2
- package/src/gestureHandlerRootHOC.tsx +5 -5
- 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 +61 -83
- package/src/handlers/createNativeWrapper.tsx +3 -2
- package/src/handlers/gestureHandlerCommon.ts +185 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +37 -4
- 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 +156 -0
- package/src/init.ts +5 -0
- package/src/mocks.ts +65 -0
- package/src/utils.ts +7 -0
- package/src/web/GestureHandler.ts +3 -4
- package/src/web/NativeViewGestureHandler.ts +0 -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/dist/index.d.ts +0 -13
- package/dist/index.js +0 -16
- package/dist/src/Directions.d.ts +0 -7
- package/dist/src/Directions.js +0 -2
- package/dist/src/GestureHandlerRootView.android.d.ts +0 -4
- package/dist/src/GestureHandlerRootView.android.expo.d.ts +0 -2
- package/dist/src/GestureHandlerRootView.android.expo.js +0 -2
- package/dist/src/GestureHandlerRootView.android.js +0 -21
- package/dist/src/GestureHandlerRootView.d.ts +0 -2
- package/dist/src/GestureHandlerRootView.js +0 -2
- package/dist/src/PlatformConstants.js +0 -2
- package/dist/src/PlatformConstants.web.js +0 -5
- package/dist/src/RNGestureHandlerModule.js +0 -3
- package/dist/src/RNGestureHandlerModule.web.js +0 -47
- package/dist/src/State.js +0 -9
- package/dist/src/__mocks__/RNGestureHandlerModule.d.ts +0 -23
- package/dist/src/__mocks__/RNGestureHandlerModule.js +0 -25
- package/dist/src/components/DrawerLayout.js +0 -390
- package/dist/src/components/GestureButtons.js +0 -113
- package/dist/src/components/GestureComponents.d.ts +0 -45
- package/dist/src/components/GestureComponents.js +0 -18
- package/dist/src/components/GestureComponents.web.d.ts +0 -7
- package/dist/src/components/GestureComponents.web.js +0 -18
- package/dist/src/components/GestureHandlerButton.web.js +0 -3
- package/dist/src/components/Swipeable.d.ts +0 -82
- package/dist/src/components/Swipeable.js +0 -248
- package/dist/src/components/touchables/GenericTouchable.js +0 -209
- package/dist/src/components/touchables/TouchableHighlight.js +0 -72
- package/dist/src/components/touchables/TouchableNativeFeedback.android.js +0 -62
- package/dist/src/components/touchables/TouchableOpacity.js +0 -49
- package/dist/src/components/touchables/TouchableWithoutFeedback.js +0 -5
- package/dist/src/gestureHandlerRootHOC.d.ts +0 -3
- package/dist/src/gestureHandlerRootHOC.js +0 -17
- package/dist/src/handlers/NativeViewGestureHandler.d.ts +0 -12
- package/dist/src/handlers/NativeViewGestureHandler.js +0 -13
- package/dist/src/handlers/createHandler.js +0 -292
- package/dist/src/handlers/createNativeWrapper.js +0 -50
- package/dist/src/handlers/gestureHandlerTypesCompat.js +0 -1
- package/dist/src/handlers/gestureHandlers.d.ts +0 -158
- package/dist/src/handlers/gestureHandlers.js +0 -247
- package/dist/src/typeUtils.js +0 -1
- package/dist/src/web/DiscreteGestureHandler.js +0 -48
- package/dist/src/web/DraggingGestureHandler.js +0 -25
- package/dist/src/web/Errors.js +0 -5
- package/dist/src/web/FlingGestureHandler.js +0 -119
- package/dist/src/web/GestureHandler.js +0 -413
- package/dist/src/web/IndiscreteGestureHandler.js +0 -26
- package/dist/src/web/LongPressGestureHandler.js +0 -46
- package/dist/src/web/NativeViewGestureHandler.js +0 -39
- package/dist/src/web/NodeManager.js +0 -22
- package/dist/src/web/PanGestureHandler.js +0 -145
- package/dist/src/web/PinchGestureHandler.js +0 -19
- package/dist/src/web/PressGestureHandler.js +0 -135
- package/dist/src/web/RotationGestureHandler.js +0 -20
- package/dist/src/web/TapGestureHandler.js +0 -143
- package/dist/src/web/constants.js +0 -42
- package/dist/src/web/utils.js +0 -15
- package/index.ts +0 -103
- package/src/GestureHandlerRootView.android.expo.ts +0 -3
- package/src/GestureHandlerRootView.ts +0 -3
- package/src/__mocks__/RNGestureHandlerModule.ts +0 -27
- package/src/handlers/gestureHandlers.ts +0 -511
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["init.ts"],"names":["initialize"],"mappings":";;;;;;;AAAA;;AAEO,SAASA,UAAT,GAAsB;AAC3B;AACD","sourcesContent":["import { startListening } from './handlers/gestures/eventReceiver';\n\nexport function initialize() {\n startListening();\n}\n"]}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _reactNative = require("react-native");
|
9
|
+
|
10
|
+
var _State = require("./State");
|
11
|
+
|
12
|
+
var _Directions = require("./Directions");
|
13
|
+
|
14
|
+
const NOOP = () => {// do nothing
|
15
|
+
};
|
16
|
+
|
17
|
+
const PanGestureHandler = _reactNative.View;
|
18
|
+
const attachGestureHandler = NOOP;
|
19
|
+
const createGestureHandler = NOOP;
|
20
|
+
const dropGestureHandler = NOOP;
|
21
|
+
const updateGestureHandler = NOOP;
|
22
|
+
const NativeViewGestureHandler = _reactNative.View;
|
23
|
+
const TapGestureHandler = _reactNative.View;
|
24
|
+
const ForceTouchGestureHandler = _reactNative.View;
|
25
|
+
const LongPressGestureHandler = _reactNative.View;
|
26
|
+
const PinchGestureHandler = _reactNative.View;
|
27
|
+
const RotationGestureHandler = _reactNative.View;
|
28
|
+
const FlingGestureHandler = _reactNative.View;
|
29
|
+
const RawButton = _reactNative.TouchableNativeFeedback;
|
30
|
+
const BaseButton = _reactNative.TouchableNativeFeedback;
|
31
|
+
const RectButton = _reactNative.TouchableNativeFeedback;
|
32
|
+
const BorderlessButton = _reactNative.TouchableNativeFeedback;
|
33
|
+
var _default = {
|
34
|
+
TouchableHighlight: _reactNative.TouchableHighlight,
|
35
|
+
TouchableNativeFeedback: _reactNative.TouchableNativeFeedback,
|
36
|
+
TouchableOpacity: _reactNative.TouchableOpacity,
|
37
|
+
TouchableWithoutFeedback: _reactNative.TouchableWithoutFeedback,
|
38
|
+
ScrollView: _reactNative.ScrollView,
|
39
|
+
FlatList: _reactNative.FlatList,
|
40
|
+
Switch: _reactNative.Switch,
|
41
|
+
TextInput: _reactNative.TextInput,
|
42
|
+
DrawerLayoutAndroid: _reactNative.DrawerLayoutAndroid,
|
43
|
+
NativeViewGestureHandler,
|
44
|
+
TapGestureHandler,
|
45
|
+
ForceTouchGestureHandler,
|
46
|
+
LongPressGestureHandler,
|
47
|
+
PinchGestureHandler,
|
48
|
+
RotationGestureHandler,
|
49
|
+
FlingGestureHandler,
|
50
|
+
RawButton,
|
51
|
+
BaseButton,
|
52
|
+
RectButton,
|
53
|
+
BorderlessButton,
|
54
|
+
PanGestureHandler,
|
55
|
+
attachGestureHandler,
|
56
|
+
createGestureHandler,
|
57
|
+
dropGestureHandler,
|
58
|
+
updateGestureHandler,
|
59
|
+
// probably can be removed
|
60
|
+
Directions: _Directions.Directions,
|
61
|
+
State: _State.State
|
62
|
+
};
|
63
|
+
exports.default = _default;
|
64
|
+
//# sourceMappingURL=mocks.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["mocks.ts"],"names":["NOOP","PanGestureHandler","View","attachGestureHandler","createGestureHandler","dropGestureHandler","updateGestureHandler","NativeViewGestureHandler","TapGestureHandler","ForceTouchGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","RawButton","TouchableNativeFeedback","BaseButton","RectButton","BorderlessButton","TouchableHighlight","TouchableOpacity","TouchableWithoutFeedback","ScrollView","FlatList","Switch","TextInput","DrawerLayoutAndroid","Directions","State"],"mappings":";;;;;;;AAAA;;AAYA;;AACA;;AAEA,MAAMA,IAAI,GAAG,MAAM,CACjB;AACD,CAFD;;AAGA,MAAMC,iBAAiB,GAAGC,iBAA1B;AACA,MAAMC,oBAAoB,GAAGH,IAA7B;AACA,MAAMI,oBAAoB,GAAGJ,IAA7B;AACA,MAAMK,kBAAkB,GAAGL,IAA3B;AACA,MAAMM,oBAAoB,GAAGN,IAA7B;AACA,MAAMO,wBAAwB,GAAGL,iBAAjC;AACA,MAAMM,iBAAiB,GAAGN,iBAA1B;AACA,MAAMO,wBAAwB,GAAGP,iBAAjC;AACA,MAAMQ,uBAAuB,GAAGR,iBAAhC;AACA,MAAMS,mBAAmB,GAAGT,iBAA5B;AACA,MAAMU,sBAAsB,GAAGV,iBAA/B;AACA,MAAMW,mBAAmB,GAAGX,iBAA5B;AACA,MAAMY,SAAS,GAAGC,oCAAlB;AACA,MAAMC,UAAU,GAAGD,oCAAnB;AACA,MAAME,UAAU,GAAGF,oCAAnB;AACA,MAAMG,gBAAgB,GAAGH,oCAAzB;eAEe;AACbI,EAAAA,kBAAkB,EAAlBA,+BADa;AAEbJ,EAAAA,uBAAuB,EAAvBA,oCAFa;AAGbK,EAAAA,gBAAgB,EAAhBA,6BAHa;AAIbC,EAAAA,wBAAwB,EAAxBA,qCAJa;AAKbC,EAAAA,UAAU,EAAVA,uBALa;AAMbC,EAAAA,QAAQ,EAARA,qBANa;AAObC,EAAAA,MAAM,EAANA,mBAPa;AAQbC,EAAAA,SAAS,EAATA,sBARa;AASbC,EAAAA,mBAAmB,EAAnBA,gCATa;AAUbnB,EAAAA,wBAVa;AAWbC,EAAAA,iBAXa;AAYbC,EAAAA,wBAZa;AAabC,EAAAA,uBAba;AAcbC,EAAAA,mBAda;AAebC,EAAAA,sBAfa;AAgBbC,EAAAA,mBAhBa;AAiBbC,EAAAA,SAjBa;AAkBbE,EAAAA,UAlBa;AAmBbC,EAAAA,UAnBa;AAoBbC,EAAAA,gBApBa;AAqBbjB,EAAAA,iBArBa;AAsBbE,EAAAA,oBAtBa;AAuBbC,EAAAA,oBAvBa;AAwBbC,EAAAA,kBAxBa;AAyBbC,EAAAA,oBAzBa;AA0Bb;AACAqB,EAAAA,UAAU,EAAVA,sBA3Ba;AA4BbC,EAAAA,KAAK,EAALA;AA5Ba,C","sourcesContent":["import {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n View,\n} from 'react-native';\nimport { State } from './State';\nimport { Directions } from './Directions';\n\nconst NOOP = () => {\n // do nothing\n};\nconst PanGestureHandler = View;\nconst attachGestureHandler = NOOP;\nconst createGestureHandler = NOOP;\nconst dropGestureHandler = NOOP;\nconst updateGestureHandler = NOOP;\nconst NativeViewGestureHandler = View;\nconst TapGestureHandler = View;\nconst ForceTouchGestureHandler = View;\nconst LongPressGestureHandler = View;\nconst PinchGestureHandler = View;\nconst RotationGestureHandler = View;\nconst FlingGestureHandler = View;\nconst RawButton = TouchableNativeFeedback;\nconst BaseButton = TouchableNativeFeedback;\nconst RectButton = TouchableNativeFeedback;\nconst BorderlessButton = TouchableNativeFeedback;\n\nexport default {\n TouchableHighlight,\n TouchableNativeFeedback,\n TouchableOpacity,\n TouchableWithoutFeedback,\n ScrollView,\n FlatList,\n Switch,\n TextInput,\n DrawerLayoutAndroid,\n NativeViewGestureHandler,\n TapGestureHandler,\n ForceTouchGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n RawButton,\n BaseButton,\n RectButton,\n BorderlessButton,\n PanGestureHandler,\n attachGestureHandler,\n createGestureHandler,\n dropGestureHandler,\n updateGestureHandler,\n // probably can be removed\n Directions,\n State,\n} as const;\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.toArray = toArray;
|
7
|
+
|
8
|
+
function toArray(object) {
|
9
|
+
if (!Array.isArray(object)) {
|
10
|
+
return [object];
|
11
|
+
}
|
12
|
+
|
13
|
+
return object;
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["utils.ts"],"names":["toArray","object","Array","isArray"],"mappings":";;;;;;;AAAO,SAASA,OAAT,CAAoBC,MAApB,EAA0C;AAC/C,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,MAAd,CAAL,EAA4B;AAC1B,WAAO,CAACA,MAAD,CAAP;AACD;;AAED,SAAOA,MAAP;AACD","sourcesContent":["export function toArray<T>(object: T | T[]): T[] {\n if (!Array.isArray(object)) {\n return [object];\n }\n\n return object;\n}\n"]}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _GestureHandler = _interopRequireDefault(require("./GestureHandler"));
|
9
|
+
|
10
|
+
var _utils = require("./utils");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
/* eslint-disable eslint-comments/no-unlimited-disable */
|
15
|
+
|
16
|
+
/* eslint-disable */
|
17
|
+
class DiscreteGestureHandler extends _GestureHandler.default {
|
18
|
+
get isDiscrete() {
|
19
|
+
return true;
|
20
|
+
}
|
21
|
+
|
22
|
+
get shouldEnableGestureOnSetup() {
|
23
|
+
return true;
|
24
|
+
}
|
25
|
+
|
26
|
+
shouldFailUnderCustomCriteria({
|
27
|
+
x,
|
28
|
+
y,
|
29
|
+
deltaX,
|
30
|
+
deltaY
|
31
|
+
}, {
|
32
|
+
maxDeltaX,
|
33
|
+
maxDeltaY,
|
34
|
+
maxDistSq,
|
35
|
+
shouldCancelWhenOutside
|
36
|
+
}) {
|
37
|
+
if (shouldCancelWhenOutside) {
|
38
|
+
if (!this.isPointInView({
|
39
|
+
x,
|
40
|
+
y
|
41
|
+
})) {
|
42
|
+
return true;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
return (0, _utils.TEST_MAX_IF_NOT_NAN)(Math.abs(deltaX), maxDeltaX) || (0, _utils.TEST_MAX_IF_NOT_NAN)(Math.abs(deltaY), maxDeltaY) || (0, _utils.TEST_MAX_IF_NOT_NAN)(Math.abs(deltaY * deltaY + deltaX * deltaX), maxDistSq);
|
47
|
+
}
|
48
|
+
|
49
|
+
transformNativeEvent({
|
50
|
+
center: {
|
51
|
+
x,
|
52
|
+
y
|
53
|
+
}
|
54
|
+
}) {
|
55
|
+
// @ts-ignore FIXME(TS)
|
56
|
+
const rect = this.view.getBoundingClientRect();
|
57
|
+
return {
|
58
|
+
absoluteX: x,
|
59
|
+
absoluteY: y,
|
60
|
+
x: x - rect.left,
|
61
|
+
y: y - rect.top
|
62
|
+
};
|
63
|
+
}
|
64
|
+
|
65
|
+
isGestureEnabledForEvent({
|
66
|
+
minPointers,
|
67
|
+
maxPointers,
|
68
|
+
maxDeltaX,
|
69
|
+
maxDeltaY,
|
70
|
+
maxDistSq,
|
71
|
+
shouldCancelWhenOutside
|
72
|
+
}, _recognizer, {
|
73
|
+
maxPointers: pointerLength,
|
74
|
+
center,
|
75
|
+
deltaX,
|
76
|
+
deltaY
|
77
|
+
}) {
|
78
|
+
const validPointerCount = pointerLength >= minPointers && pointerLength <= maxPointers;
|
79
|
+
|
80
|
+
if (this.shouldFailUnderCustomCriteria({ ...center,
|
81
|
+
deltaX,
|
82
|
+
deltaY
|
83
|
+
}, {
|
84
|
+
maxDeltaX,
|
85
|
+
maxDeltaY,
|
86
|
+
maxDistSq,
|
87
|
+
shouldCancelWhenOutside
|
88
|
+
}) || // A user probably won't land a multi-pointer tap on the first tick (so we cannot just cancel each time)
|
89
|
+
// but if the gesture is running and the user adds or subtracts another pointer then it should fail.
|
90
|
+
!validPointerCount && this.isGestureRunning) {
|
91
|
+
return {
|
92
|
+
failed: true
|
93
|
+
};
|
94
|
+
}
|
95
|
+
|
96
|
+
return {
|
97
|
+
success: validPointerCount
|
98
|
+
};
|
99
|
+
}
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
var _default = DiscreteGestureHandler;
|
104
|
+
exports.default = _default;
|
105
|
+
//# sourceMappingURL=DiscreteGestureHandler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["DiscreteGestureHandler.ts"],"names":["DiscreteGestureHandler","GestureHandler","isDiscrete","shouldEnableGestureOnSetup","shouldFailUnderCustomCriteria","x","y","deltaX","deltaY","maxDeltaX","maxDeltaY","maxDistSq","shouldCancelWhenOutside","isPointInView","Math","abs","transformNativeEvent","center","rect","view","getBoundingClientRect","absoluteX","absoluteY","left","top","isGestureEnabledForEvent","minPointers","maxPointers","_recognizer","pointerLength","validPointerCount","isGestureRunning","failed","success"],"mappings":";;;;;;;AAEA;;AACA;;;;AAHA;;AACA;AAIA,MAAeA,sBAAf,SAA8CC,uBAA9C,CAA6D;AAC7C,MAAVC,UAAU,GAAG;AACf,WAAO,IAAP;AACD;;AAE6B,MAA1BC,0BAA0B,GAAG;AAC/B,WAAO,IAAP;AACD;;AAEDC,EAAAA,6BAA6B,CAC3B;AAAEC,IAAAA,CAAF;AAAKC,IAAAA,CAAL;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA;AAAhB,GAD2B,EAE3B;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,SAAb;AAAwBC,IAAAA,SAAxB;AAAmCC,IAAAA;AAAnC,GAF2B,EAG3B;AACA,QAAIA,uBAAJ,EAA6B;AAC3B,UAAI,CAAC,KAAKC,aAAL,CAAmB;AAAER,QAAAA,CAAF;AAAKC,QAAAA;AAAL,OAAnB,CAAL,EAAmC;AACjC,eAAO,IAAP;AACD;AACF;;AACD,WACE,gCAAoBQ,IAAI,CAACC,GAAL,CAASR,MAAT,CAApB,EAAsCE,SAAtC,KACA,gCAAoBK,IAAI,CAACC,GAAL,CAASP,MAAT,CAApB,EAAsCE,SAAtC,CADA,IAEA,gCACEI,IAAI,CAACC,GAAL,CAASP,MAAM,GAAGA,MAAT,GAAkBD,MAAM,GAAGA,MAApC,CADF,EAEEI,SAFF,CAHF;AAQD;;AAEDK,EAAAA,oBAAoB,CAAC;AAAEC,IAAAA,MAAM,EAAE;AAAEZ,MAAAA,CAAF;AAAKC,MAAAA;AAAL;AAAV,GAAD,EAA4B;AAC9C;AACA,UAAMY,IAAI,GAAG,KAAKC,IAAL,CAAWC,qBAAX,EAAb;AAEA,WAAO;AACLC,MAAAA,SAAS,EAAEhB,CADN;AAELiB,MAAAA,SAAS,EAAEhB,CAFN;AAGLD,MAAAA,CAAC,EAAEA,CAAC,GAAGa,IAAI,CAACK,IAHP;AAILjB,MAAAA,CAAC,EAAEA,CAAC,GAAGY,IAAI,CAACM;AAJP,KAAP;AAMD;;AAEDC,EAAAA,wBAAwB,CACtB;AACEC,IAAAA,WADF;AAEEC,IAAAA,WAFF;AAGElB,IAAAA,SAHF;AAIEC,IAAAA,SAJF;AAKEC,IAAAA,SALF;AAMEC,IAAAA;AANF,GADsB,EAStBgB,WATsB,EAUtB;AAAED,IAAAA,WAAW,EAAEE,aAAf;AAA8BZ,IAAAA,MAA9B;AAAsCV,IAAAA,MAAtC;AAA8CC,IAAAA;AAA9C,GAVsB,EAWtB;AACA,UAAMsB,iBAAiB,GACrBD,aAAa,IAAIH,WAAjB,IAAgCG,aAAa,IAAIF,WADnD;;AAGA,QACE,KAAKvB,6BAAL,CACE,EAAE,GAAGa,MAAL;AAAaV,MAAAA,MAAb;AAAqBC,MAAAA;AAArB,KADF,EAEE;AACEC,MAAAA,SADF;AAEEC,MAAAA,SAFF;AAGEC,MAAAA,SAHF;AAIEC,MAAAA;AAJF,KAFF,KASA;AACA;AACC,KAACkB,iBAAD,IAAsB,KAAKC,gBAZ9B,EAaE;AACA,aAAO;AAAEC,QAAAA,MAAM,EAAE;AAAV,OAAP;AACD;;AAED,WAAO;AAAEC,MAAAA,OAAO,EAAEH;AAAX,KAAP;AACD;;AAzE0D;;eA4E9C9B,sB","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport GestureHandler from './GestureHandler';\nimport { TEST_MAX_IF_NOT_NAN } from './utils';\n\nabstract class DiscreteGestureHandler extends GestureHandler {\n get isDiscrete() {\n return true;\n }\n\n get shouldEnableGestureOnSetup() {\n return true;\n }\n\n shouldFailUnderCustomCriteria(\n { x, y, deltaX, deltaY }: any,\n { maxDeltaX, maxDeltaY, maxDistSq, shouldCancelWhenOutside }: any\n ) {\n if (shouldCancelWhenOutside) {\n if (!this.isPointInView({ x, y })) {\n return true;\n }\n }\n return (\n TEST_MAX_IF_NOT_NAN(Math.abs(deltaX), maxDeltaX) ||\n TEST_MAX_IF_NOT_NAN(Math.abs(deltaY), maxDeltaY) ||\n TEST_MAX_IF_NOT_NAN(\n Math.abs(deltaY * deltaY + deltaX * deltaX),\n maxDistSq\n )\n );\n }\n\n transformNativeEvent({ center: { x, y } }: any) {\n // @ts-ignore FIXME(TS)\n const rect = this.view!.getBoundingClientRect();\n\n return {\n absoluteX: x,\n absoluteY: y,\n x: x - rect.left,\n y: y - rect.top,\n };\n }\n\n isGestureEnabledForEvent(\n {\n minPointers,\n maxPointers,\n maxDeltaX,\n maxDeltaY,\n maxDistSq,\n shouldCancelWhenOutside,\n }: any,\n _recognizer: any,\n { maxPointers: pointerLength, center, deltaX, deltaY }: any\n ) {\n const validPointerCount =\n pointerLength >= minPointers && pointerLength <= maxPointers;\n\n if (\n this.shouldFailUnderCustomCriteria(\n { ...center, deltaX, deltaY },\n {\n maxDeltaX,\n maxDeltaY,\n maxDistSq,\n shouldCancelWhenOutside,\n }\n ) ||\n // A user probably won't land a multi-pointer tap on the first tick (so we cannot just cancel each time)\n // but if the gesture is running and the user adds or subtracts another pointer then it should fail.\n (!validPointerCount && this.isGestureRunning)\n ) {\n return { failed: true };\n }\n\n return { success: validPointerCount };\n }\n}\n\nexport default DiscreteGestureHandler;\n"]}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _GestureHandler = _interopRequireDefault(require("./GestureHandler"));
|
9
|
+
|
10
|
+
var _reactNative = require("react-native");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
/* eslint-disable eslint-comments/no-unlimited-disable */
|
15
|
+
|
16
|
+
/* eslint-disable */
|
17
|
+
class DraggingGestureHandler extends _GestureHandler.default {
|
18
|
+
get shouldEnableGestureOnSetup() {
|
19
|
+
return true;
|
20
|
+
}
|
21
|
+
|
22
|
+
transformNativeEvent({
|
23
|
+
deltaX,
|
24
|
+
deltaY,
|
25
|
+
velocityX,
|
26
|
+
velocityY,
|
27
|
+
center: {
|
28
|
+
x,
|
29
|
+
y
|
30
|
+
}
|
31
|
+
}) {
|
32
|
+
// @ts-ignore FIXME(TS)
|
33
|
+
const rect = this.view.getBoundingClientRect();
|
34
|
+
|
35
|
+
const ratio = _reactNative.PixelRatio.get();
|
36
|
+
|
37
|
+
return {
|
38
|
+
translationX: deltaX - (this.__initialX || 0),
|
39
|
+
translationY: deltaY - (this.__initialY || 0),
|
40
|
+
absoluteX: x,
|
41
|
+
absoluteY: y,
|
42
|
+
velocityX: velocityX * ratio,
|
43
|
+
velocityY: velocityY * ratio,
|
44
|
+
x: x - rect.left,
|
45
|
+
y: y - rect.top
|
46
|
+
};
|
47
|
+
}
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
var _default = DraggingGestureHandler;
|
52
|
+
exports.default = _default;
|
53
|
+
//# sourceMappingURL=DraggingGestureHandler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["DraggingGestureHandler.ts"],"names":["DraggingGestureHandler","GestureHandler","shouldEnableGestureOnSetup","transformNativeEvent","deltaX","deltaY","velocityX","velocityY","center","x","y","rect","view","getBoundingClientRect","ratio","PixelRatio","get","translationX","__initialX","translationY","__initialY","absoluteX","absoluteY","left","top"],"mappings":";;;;;;;AAEA;;AACA;;;;AAHA;;AACA;AAIA,MAAeA,sBAAf,SAA8CC,uBAA9C,CAA6D;AAC7B,MAA1BC,0BAA0B,GAAG;AAC/B,WAAO,IAAP;AACD;;AAEDC,EAAAA,oBAAoB,CAAC;AACnBC,IAAAA,MADmB;AAEnBC,IAAAA,MAFmB;AAGnBC,IAAAA,SAHmB;AAInBC,IAAAA,SAJmB;AAKnBC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,CAAF;AAAKC,MAAAA;AAAL;AALW,GAAD,EAMD;AACjB;AACA,UAAMC,IAAI,GAAG,KAAKC,IAAL,CAAWC,qBAAX,EAAb;;AACA,UAAMC,KAAK,GAAGC,wBAAWC,GAAX,EAAd;;AACA,WAAO;AACLC,MAAAA,YAAY,EAAEb,MAAM,IAAI,KAAKc,UAAL,IAAmB,CAAvB,CADf;AAELC,MAAAA,YAAY,EAAEd,MAAM,IAAI,KAAKe,UAAL,IAAmB,CAAvB,CAFf;AAGLC,MAAAA,SAAS,EAAEZ,CAHN;AAILa,MAAAA,SAAS,EAAEZ,CAJN;AAKLJ,MAAAA,SAAS,EAAEA,SAAS,GAAGQ,KALlB;AAMLP,MAAAA,SAAS,EAAEA,SAAS,GAAGO,KANlB;AAOLL,MAAAA,CAAC,EAAEA,CAAC,GAAGE,IAAI,CAACY,IAPP;AAQLb,MAAAA,CAAC,EAAEA,CAAC,GAAGC,IAAI,CAACa;AARP,KAAP;AAUD;;AAzB0D;;eA4B9CxB,sB","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport GestureHandler, { HammerInputExt } from './GestureHandler';\nimport { PixelRatio } from 'react-native';\n\nabstract class DraggingGestureHandler extends GestureHandler {\n get shouldEnableGestureOnSetup() {\n return true;\n }\n\n transformNativeEvent({\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n center: { x, y },\n }: HammerInputExt) {\n // @ts-ignore FIXME(TS)\n const rect = this.view!.getBoundingClientRect();\n const ratio = PixelRatio.get();\n return {\n translationX: deltaX - (this.__initialX || 0),\n translationY: deltaY - (this.__initialY || 0),\n absoluteX: x,\n absoluteY: y,\n velocityX: velocityX * ratio,\n velocityY: velocityY * ratio,\n x: x - rect.left,\n y: y - rect.top,\n };\n }\n}\n\nexport default DraggingGestureHandler;\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.GesturePropError = void 0;
|
7
|
+
|
8
|
+
class GesturePropError extends Error {
|
9
|
+
constructor(name, value, expectedType) {
|
10
|
+
super(`Invalid property \`${name}: ${value}\` expected \`${expectedType}\``);
|
11
|
+
}
|
12
|
+
|
13
|
+
}
|
14
|
+
|
15
|
+
exports.GesturePropError = GesturePropError;
|
16
|
+
//# sourceMappingURL=Errors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["Errors.ts"],"names":["GesturePropError","Error","constructor","name","value","expectedType"],"mappings":";;;;;;;AAAO,MAAMA,gBAAN,SAA+BC,KAA/B,CAAqC;AAC1CC,EAAAA,WAAW,CAACC,IAAD,EAAeC,KAAf,EAA+BC,YAA/B,EAAqD;AAC9D,UACG,sBAAqBF,IAAK,KAAIC,KAAM,iBAAgBC,YAAa,IADpE;AAGD;;AALyC","sourcesContent":["export class GesturePropError extends Error {\n constructor(name: string, value: unknown, expectedType: string) {\n super(\n `Invalid property \\`${name}: ${value}\\` expected \\`${expectedType}\\``\n );\n }\n}\n"]}
|
@@ -0,0 +1,170 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
|
9
|
+
|
10
|
+
var _constants = require("./constants");
|
11
|
+
|
12
|
+
var _Errors = require("./Errors");
|
13
|
+
|
14
|
+
var _DraggingGestureHandler = _interopRequireDefault(require("./DraggingGestureHandler"));
|
15
|
+
|
16
|
+
var _utils = require("./utils");
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
/* eslint-disable eslint-comments/no-unlimited-disable */
|
21
|
+
|
22
|
+
/* eslint-disable */
|
23
|
+
class FlingGestureHandler extends _DraggingGestureHandler.default {
|
24
|
+
get name() {
|
25
|
+
return 'swipe';
|
26
|
+
}
|
27
|
+
|
28
|
+
get NativeGestureClass() {
|
29
|
+
return _hammerjs.default.Swipe;
|
30
|
+
}
|
31
|
+
|
32
|
+
onGestureActivated(event) {
|
33
|
+
this.sendEvent({ ...event,
|
34
|
+
eventType: _hammerjs.default.INPUT_MOVE,
|
35
|
+
isFinal: false,
|
36
|
+
isFirst: true
|
37
|
+
});
|
38
|
+
this.isGestureRunning = false;
|
39
|
+
this.hasGestureFailed = false;
|
40
|
+
this.sendEvent({ ...event,
|
41
|
+
eventType: _hammerjs.default.INPUT_END,
|
42
|
+
isFinal: true
|
43
|
+
});
|
44
|
+
}
|
45
|
+
|
46
|
+
onRawEvent(ev) {
|
47
|
+
super.onRawEvent(ev);
|
48
|
+
|
49
|
+
if (this.hasGestureFailed) {
|
50
|
+
return;
|
51
|
+
} // Hammer doesn't send a `cancel` event for taps.
|
52
|
+
// Manually fail the event.
|
53
|
+
|
54
|
+
|
55
|
+
if (ev.isFinal) {
|
56
|
+
setTimeout(() => {
|
57
|
+
if (this.isGestureRunning) {
|
58
|
+
this.cancelEvent(ev);
|
59
|
+
}
|
60
|
+
});
|
61
|
+
} else if (!this.hasGestureFailed && !this.isGestureRunning) {
|
62
|
+
// Tap Gesture start event
|
63
|
+
const gesture = this.hammer.get(this.name); // @ts-ignore FIXME(TS)
|
64
|
+
|
65
|
+
if (gesture.options.enable(gesture, ev)) {
|
66
|
+
this.onStart(ev);
|
67
|
+
this.sendEvent(ev);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
getHammerConfig() {
|
73
|
+
return {
|
74
|
+
// @ts-ignore FIXME(TS)
|
75
|
+
pointers: this.config.numberOfPointers,
|
76
|
+
direction: this.getDirection()
|
77
|
+
};
|
78
|
+
}
|
79
|
+
|
80
|
+
getTargetDirections(direction) {
|
81
|
+
const directions = [];
|
82
|
+
|
83
|
+
if (direction & _constants.Direction.RIGHT) {
|
84
|
+
directions.push(_hammerjs.default.DIRECTION_RIGHT);
|
85
|
+
}
|
86
|
+
|
87
|
+
if (direction & _constants.Direction.LEFT) {
|
88
|
+
directions.push(_hammerjs.default.DIRECTION_LEFT);
|
89
|
+
}
|
90
|
+
|
91
|
+
if (direction & _constants.Direction.UP) {
|
92
|
+
directions.push(_hammerjs.default.DIRECTION_UP);
|
93
|
+
}
|
94
|
+
|
95
|
+
if (direction & _constants.Direction.DOWN) {
|
96
|
+
directions.push(_hammerjs.default.DIRECTION_DOWN);
|
97
|
+
} // const hammerDirection = directions.reduce((a, b) => a | b, 0);
|
98
|
+
|
99
|
+
|
100
|
+
return directions;
|
101
|
+
}
|
102
|
+
|
103
|
+
getDirection() {
|
104
|
+
// @ts-ignore FIXME(TS)
|
105
|
+
const {
|
106
|
+
direction
|
107
|
+
} = this.getConfig();
|
108
|
+
let directions = [];
|
109
|
+
|
110
|
+
if (direction & _constants.Direction.RIGHT) {
|
111
|
+
directions.push(_hammerjs.default.DIRECTION_HORIZONTAL);
|
112
|
+
}
|
113
|
+
|
114
|
+
if (direction & _constants.Direction.LEFT) {
|
115
|
+
directions.push(_hammerjs.default.DIRECTION_HORIZONTAL);
|
116
|
+
}
|
117
|
+
|
118
|
+
if (direction & _constants.Direction.UP) {
|
119
|
+
directions.push(_hammerjs.default.DIRECTION_VERTICAL);
|
120
|
+
}
|
121
|
+
|
122
|
+
if (direction & _constants.Direction.DOWN) {
|
123
|
+
directions.push(_hammerjs.default.DIRECTION_VERTICAL);
|
124
|
+
}
|
125
|
+
|
126
|
+
directions = [...new Set(directions)];
|
127
|
+
if (directions.length === 0) return _hammerjs.default.DIRECTION_NONE;
|
128
|
+
if (directions.length === 1) return directions[0];
|
129
|
+
return _hammerjs.default.DIRECTION_ALL;
|
130
|
+
}
|
131
|
+
|
132
|
+
isGestureEnabledForEvent({
|
133
|
+
numberOfPointers
|
134
|
+
}, _recognizer, {
|
135
|
+
maxPointers: pointerLength
|
136
|
+
}) {
|
137
|
+
const validPointerCount = pointerLength === numberOfPointers;
|
138
|
+
|
139
|
+
if (!validPointerCount && this.isGestureRunning) {
|
140
|
+
return {
|
141
|
+
failed: true
|
142
|
+
};
|
143
|
+
}
|
144
|
+
|
145
|
+
return {
|
146
|
+
success: validPointerCount
|
147
|
+
};
|
148
|
+
}
|
149
|
+
|
150
|
+
updateGestureConfig({
|
151
|
+
numberOfPointers = 1,
|
152
|
+
direction,
|
153
|
+
...props
|
154
|
+
}) {
|
155
|
+
if ((0, _utils.isnan)(direction) || typeof direction !== 'number') {
|
156
|
+
throw new _Errors.GesturePropError('direction', direction, 'number');
|
157
|
+
}
|
158
|
+
|
159
|
+
return super.updateGestureConfig({
|
160
|
+
numberOfPointers,
|
161
|
+
direction,
|
162
|
+
...props
|
163
|
+
});
|
164
|
+
}
|
165
|
+
|
166
|
+
}
|
167
|
+
|
168
|
+
var _default = FlingGestureHandler;
|
169
|
+
exports.default = _default;
|
170
|
+
//# sourceMappingURL=FlingGestureHandler.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["FlingGestureHandler.ts"],"names":["FlingGestureHandler","DraggingGestureHandler","name","NativeGestureClass","Hammer","Swipe","onGestureActivated","event","sendEvent","eventType","INPUT_MOVE","isFinal","isFirst","isGestureRunning","hasGestureFailed","INPUT_END","onRawEvent","ev","setTimeout","cancelEvent","gesture","hammer","get","options","enable","onStart","getHammerConfig","pointers","config","numberOfPointers","direction","getDirection","getTargetDirections","directions","Direction","RIGHT","push","DIRECTION_RIGHT","LEFT","DIRECTION_LEFT","UP","DIRECTION_UP","DOWN","DIRECTION_DOWN","getConfig","DIRECTION_HORIZONTAL","DIRECTION_VERTICAL","Set","length","DIRECTION_NONE","DIRECTION_ALL","isGestureEnabledForEvent","_recognizer","maxPointers","pointerLength","validPointerCount","failed","success","updateGestureConfig","props","GesturePropError"],"mappings":"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","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport Hammer from '@egjs/hammerjs';\n\nimport { Direction } from './constants';\nimport { GesturePropError } from './Errors';\nimport DraggingGestureHandler from './DraggingGestureHandler';\nimport { isnan } from './utils';\nimport { HammerInputExt } from './GestureHandler';\n\nclass FlingGestureHandler extends DraggingGestureHandler {\n get name() {\n return 'swipe';\n }\n\n get NativeGestureClass() {\n return Hammer.Swipe;\n }\n\n onGestureActivated(event: HammerInputExt) {\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_MOVE,\n isFinal: false,\n isFirst: true,\n });\n this.isGestureRunning = false;\n this.hasGestureFailed = false;\n this.sendEvent({\n ...event,\n eventType: Hammer.INPUT_END,\n isFinal: true,\n });\n }\n\n onRawEvent(ev: HammerInputExt) {\n super.onRawEvent(ev);\n if (this.hasGestureFailed) {\n return;\n }\n // Hammer doesn't send a `cancel` event for taps.\n // Manually fail the event.\n if (ev.isFinal) {\n setTimeout(() => {\n if (this.isGestureRunning) {\n this.cancelEvent(ev);\n }\n });\n } else if (!this.hasGestureFailed && !this.isGestureRunning) {\n // Tap Gesture start event\n const gesture = this.hammer!.get(this.name);\n // @ts-ignore FIXME(TS)\n if (gesture.options.enable(gesture, ev)) {\n this.onStart(ev);\n this.sendEvent(ev);\n }\n }\n }\n\n getHammerConfig() {\n return {\n // @ts-ignore FIXME(TS)\n pointers: this.config.numberOfPointers,\n direction: this.getDirection(),\n };\n }\n\n getTargetDirections(direction: number) {\n const directions = [];\n if (direction & Direction.RIGHT) {\n directions.push(Hammer.DIRECTION_RIGHT);\n }\n if (direction & Direction.LEFT) {\n directions.push(Hammer.DIRECTION_LEFT);\n }\n if (direction & Direction.UP) {\n directions.push(Hammer.DIRECTION_UP);\n }\n if (direction & Direction.DOWN) {\n directions.push(Hammer.DIRECTION_DOWN);\n }\n // const hammerDirection = directions.reduce((a, b) => a | b, 0);\n return directions;\n }\n\n getDirection() {\n // @ts-ignore FIXME(TS)\n const { direction } = this.getConfig();\n\n let directions = [];\n if (direction & Direction.RIGHT) {\n directions.push(Hammer.DIRECTION_HORIZONTAL);\n }\n if (direction & Direction.LEFT) {\n directions.push(Hammer.DIRECTION_HORIZONTAL);\n }\n if (direction & Direction.UP) {\n directions.push(Hammer.DIRECTION_VERTICAL);\n }\n if (direction & Direction.DOWN) {\n directions.push(Hammer.DIRECTION_VERTICAL);\n }\n directions = [...new Set(directions)];\n\n if (directions.length === 0) return Hammer.DIRECTION_NONE;\n if (directions.length === 1) return directions[0];\n return Hammer.DIRECTION_ALL;\n }\n\n isGestureEnabledForEvent(\n { numberOfPointers }: any,\n _recognizer: any,\n { maxPointers: pointerLength }: any\n ) {\n const validPointerCount = pointerLength === numberOfPointers;\n if (!validPointerCount && this.isGestureRunning) {\n return { failed: true };\n }\n return { success: validPointerCount };\n }\n\n updateGestureConfig({ numberOfPointers = 1, direction, ...props }: any) {\n if (isnan(direction) || typeof direction !== 'number') {\n throw new GesturePropError('direction', direction, 'number');\n }\n return super.updateGestureConfig({\n numberOfPointers,\n direction,\n ...props,\n });\n }\n}\n\nexport default FlingGestureHandler;\n"]}
|