react-native-gesture-handler 2.23.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNGestureHandler.podspec +8 -0
- package/android/build.gradle +9 -3
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +2 -1
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +2 -1
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +60 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +67 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +8 -11
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +10 -2
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +6 -1
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +3 -1
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +5 -3
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +6 -2
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +3 -1
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +2 -1
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +3 -4
- package/lib/commonjs/State.js.map +1 -1
- package/lib/commonjs/TouchEventType.js +3 -3
- package/lib/commonjs/TouchEventType.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +115 -90
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +81 -28
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +37 -26
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +27 -13
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +6 -2
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +77 -29
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js +3 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +20 -5
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +86 -44
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +75 -34
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +28 -10
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/ExtraButtonProps.js +2 -0
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +34 -19
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +25 -16
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +25 -13
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +12 -7
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +4 -1
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +14 -5
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +6 -1
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +14 -13
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +2 -1
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +146 -59
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +30 -18
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +14 -5
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +21 -13
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +24 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +84 -44
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +21 -6
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +26 -6
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +104 -75
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +11 -4
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +5 -4
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +83 -19
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +15 -5
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +12 -3
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +37 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +23 -5
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +4 -2
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +47 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +17 -9
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +41 -7
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +78 -11
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +22 -5
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +14 -7
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +45 -9
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +18 -3
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +76 -27
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +3 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +16 -9
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +26 -13
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +14 -4
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +1 -3
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +3 -9
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +5 -2
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +1 -0
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +1 -0
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +4 -3
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +0 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +20 -10
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +17 -18
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/RNRenderer.js.map +1 -1
- package/lib/module/RNRenderer.web.js.map +1 -1
- package/lib/module/State.js +1 -4
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +1 -3
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +99 -80
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +55 -19
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +12 -17
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +4 -4
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.web.js +2 -1
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +2 -1
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +2 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +2 -1
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +59 -26
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/PressableProps.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/Pressable/utils.js +14 -4
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +66 -40
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +30 -14
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +59 -28
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +15 -7
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js +2 -2
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/ExtraButtonProps.js +2 -0
- package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +63 -34
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +24 -15
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +16 -10
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +15 -10
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/findNodeHandle.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +11 -5
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/getReactNativeVersion.js.map +1 -1
- package/lib/module/getReactNativeVersion.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +13 -13
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -6
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -6
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +19 -8
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -2
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -2
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -6
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +119 -57
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +22 -15
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +4 -9
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -3
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +7 -8
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +14 -11
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +6 -2
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +38 -14
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +9 -5
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +73 -44
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +24 -16
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +14 -1
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +18 -9
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +11 -6
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +4 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +9 -5
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +41 -18
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +7 -2
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +7 -2
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +19 -10
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +5 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +13 -4
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +2 -3
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +66 -20
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +7 -3
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +10 -3
- package/lib/module/mountRegistry.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/typeUtils.js.map +1 -1
- package/lib/module/utils.js +15 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +1 -2
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +38 -5
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +181 -61
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +40 -5
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +114 -7
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +59 -5
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +14 -9
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +13 -3
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +39 -7
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +71 -10
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +19 -5
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +19 -3
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +65 -30
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +12 -7
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +35 -9
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +39 -8
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +14 -3
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +25 -8
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +10 -3
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +57 -22
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +1 -0
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +130 -53
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +8 -6
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +40 -6
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +34 -13
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +45 -31
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +1 -2
- package/lib/module/web_hammer/constants.js.map +1 -1
- package/lib/module/web_hammer/utils.js +2 -2
- package/lib/module/web_hammer/utils.js.map +1 -1
- package/lib/typescript/components/GestureComponents.d.ts +1 -1
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +5 -0
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +7 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -2
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -7
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -0
- package/lib/typescript/web/utils.d.ts +2 -0
- package/package.json +9 -8
- package/src/components/GestureComponents.tsx +1 -1
- package/src/components/ReanimatedDrawerLayout.tsx +17 -4
- package/src/components/Text.tsx +5 -0
- package/src/components/touchables/ExtraButtonProps.ts +7 -0
- package/src/components/touchables/GenericTouchable.tsx +0 -2
- package/src/components/touchables/GenericTouchableProps.ts +2 -0
- package/src/components/touchables/TouchableHighlight.tsx +2 -2
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -8
- package/src/components/touchables/TouchableOpacity.tsx +2 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +22 -4
- package/src/handlers/createHandler.tsx +20 -9
- package/src/handlers/createNativeWrapper.tsx +7 -3
- package/src/handlers/gestures/GestureDetector/Wrap.web.tsx +2 -4
- package/src/utils.ts +6 -0
- package/src/web/utils.ts +21 -3
@@ -1,6 +1,5 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
+
|
4
3
|
import { Platform } from 'react-native';
|
5
4
|
import { State } from '../../State';
|
6
5
|
import { DEFAULT_TOUCH_SLOP } from '../constants';
|
@@ -8,25 +7,33 @@ import GestureHandler from './GestureHandler';
|
|
8
7
|
export default class NativeViewGestureHandler extends GestureHandler {
|
9
8
|
constructor(...args) {
|
10
9
|
super(...args);
|
10
|
+
|
11
11
|
_defineProperty(this, "buttonRole", void 0);
|
12
|
-
|
13
|
-
// @ts-ignore Logic yet to be implemented
|
12
|
+
|
14
13
|
_defineProperty(this, "shouldActivateOnStart", false);
|
14
|
+
|
15
15
|
_defineProperty(this, "disallowInterruption", false);
|
16
|
+
|
16
17
|
_defineProperty(this, "startX", 0);
|
18
|
+
|
17
19
|
_defineProperty(this, "startY", 0);
|
20
|
+
|
18
21
|
_defineProperty(this, "minDistSq", DEFAULT_TOUCH_SLOP * DEFAULT_TOUCH_SLOP);
|
19
22
|
}
|
23
|
+
|
20
24
|
init(ref, propsRef) {
|
21
25
|
super.init(ref, propsRef);
|
22
26
|
this.shouldCancelWhenOutside = true;
|
27
|
+
|
23
28
|
if (Platform.OS !== 'web') {
|
24
29
|
return;
|
25
30
|
}
|
31
|
+
|
26
32
|
const view = this.delegate.view;
|
27
33
|
this.restoreViewStyles(view);
|
28
34
|
this.buttonRole = view.getAttribute('role') === 'button';
|
29
35
|
}
|
36
|
+
|
30
37
|
updateGestureConfig({
|
31
38
|
enabled = true,
|
32
39
|
...props
|
@@ -35,54 +42,67 @@ export default class NativeViewGestureHandler extends GestureHandler {
|
|
35
42
|
enabled: enabled,
|
36
43
|
...props
|
37
44
|
});
|
45
|
+
|
38
46
|
if (this.config.shouldActivateOnStart !== undefined) {
|
39
47
|
this.shouldActivateOnStart = this.config.shouldActivateOnStart;
|
40
48
|
}
|
49
|
+
|
41
50
|
if (this.config.disallowInterruption !== undefined) {
|
42
51
|
this.disallowInterruption = this.config.disallowInterruption;
|
43
52
|
}
|
53
|
+
|
44
54
|
const view = this.delegate.view;
|
45
55
|
this.restoreViewStyles(view);
|
46
56
|
}
|
57
|
+
|
47
58
|
restoreViewStyles(view) {
|
48
59
|
if (!view) {
|
49
60
|
return;
|
50
61
|
}
|
51
|
-
|
52
|
-
// @ts-ignore Turns on defualt touch behavior on Safari
|
62
|
+
|
63
|
+
view.style['touchAction'] = 'auto'; // @ts-ignore Turns on defualt touch behavior on Safari
|
64
|
+
|
53
65
|
view.style['WebkitTouchCallout'] = 'auto';
|
54
66
|
}
|
67
|
+
|
55
68
|
onPointerDown(event) {
|
56
69
|
this.tracker.addToTracker(event);
|
57
70
|
super.onPointerDown(event);
|
58
71
|
this.newPointerAction();
|
59
72
|
this.tryToSendTouchEvent(event);
|
60
73
|
}
|
74
|
+
|
61
75
|
onPointerAdd(event) {
|
62
76
|
this.tracker.addToTracker(event);
|
63
77
|
super.onPointerAdd(event);
|
64
78
|
this.newPointerAction();
|
65
79
|
}
|
80
|
+
|
66
81
|
newPointerAction() {
|
67
82
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
68
83
|
this.startX = lastCoords.x;
|
69
84
|
this.startY = lastCoords.y;
|
85
|
+
|
70
86
|
if (this.state !== State.UNDETERMINED) {
|
71
87
|
return;
|
72
88
|
}
|
89
|
+
|
73
90
|
this.begin();
|
74
91
|
const view = this.delegate.view;
|
75
92
|
const isRNGHText = view.hasAttribute('rnghtext');
|
93
|
+
|
76
94
|
if (this.buttonRole || isRNGHText) {
|
77
95
|
this.activate();
|
78
96
|
}
|
79
97
|
}
|
98
|
+
|
80
99
|
onPointerMove(event) {
|
81
100
|
this.tracker.track(event);
|
82
101
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
83
102
|
const dx = this.startX - lastCoords.x;
|
84
103
|
const dy = this.startY - lastCoords.y;
|
85
104
|
const distSq = dx * dx + dy * dy;
|
105
|
+
|
86
106
|
if (distSq >= this.minDistSq) {
|
87
107
|
if (this.buttonRole && this.state === State.ACTIVE) {
|
88
108
|
this.cancel();
|
@@ -91,21 +111,26 @@ export default class NativeViewGestureHandler extends GestureHandler {
|
|
91
111
|
}
|
92
112
|
}
|
93
113
|
}
|
114
|
+
|
94
115
|
onPointerLeave() {
|
95
116
|
if (this.state === State.BEGAN || this.state === State.ACTIVE) {
|
96
117
|
this.cancel();
|
97
118
|
}
|
98
119
|
}
|
120
|
+
|
99
121
|
onPointerUp(event) {
|
100
122
|
super.onPointerUp(event);
|
101
123
|
this.onUp(event);
|
102
124
|
}
|
125
|
+
|
103
126
|
onPointerRemove(event) {
|
104
127
|
super.onPointerRemove(event);
|
105
128
|
this.onUp(event);
|
106
129
|
}
|
130
|
+
|
107
131
|
onUp(event) {
|
108
132
|
this.tracker.removeFromTracker(event.pointerId);
|
133
|
+
|
109
134
|
if (this.tracker.trackedPointersCount === 0) {
|
110
135
|
if (this.state === State.ACTIVE) {
|
111
136
|
this.end();
|
@@ -114,27 +139,36 @@ export default class NativeViewGestureHandler extends GestureHandler {
|
|
114
139
|
}
|
115
140
|
}
|
116
141
|
}
|
142
|
+
|
117
143
|
shouldRecognizeSimultaneously(handler) {
|
118
144
|
if (super.shouldRecognizeSimultaneously(handler)) {
|
119
145
|
return true;
|
120
146
|
}
|
147
|
+
|
121
148
|
if (handler instanceof NativeViewGestureHandler && handler.state === State.ACTIVE && handler.disallowsInterruption()) {
|
122
149
|
return false;
|
123
150
|
}
|
151
|
+
|
124
152
|
const canBeInterrupted = !this.disallowInterruption;
|
153
|
+
|
125
154
|
if (this.state === State.ACTIVE && handler.state === State.ACTIVE && canBeInterrupted) {
|
126
155
|
return false;
|
127
156
|
}
|
157
|
+
|
128
158
|
return this.state === State.ACTIVE && canBeInterrupted && handler.handlerTag > 0;
|
129
159
|
}
|
160
|
+
|
130
161
|
shouldBeCancelledByOther(_handler) {
|
131
162
|
return !this.disallowInterruption;
|
132
163
|
}
|
164
|
+
|
133
165
|
disallowsInterruption() {
|
134
166
|
return this.disallowInterruption;
|
135
167
|
}
|
168
|
+
|
136
169
|
isButton() {
|
137
170
|
return this.buttonRole;
|
138
171
|
}
|
172
|
+
|
139
173
|
}
|
140
174
|
//# sourceMappingURL=NativeViewGestureHandler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","State","DEFAULT_TOUCH_SLOP","GestureHandler","NativeViewGestureHandler","
|
1
|
+
{"version":3,"sources":["NativeViewGestureHandler.ts"],"names":["Platform","State","DEFAULT_TOUCH_SLOP","GestureHandler","NativeViewGestureHandler","init","ref","propsRef","shouldCancelWhenOutside","OS","view","delegate","restoreViewStyles","buttonRole","getAttribute","updateGestureConfig","enabled","props","config","shouldActivateOnStart","undefined","disallowInterruption","style","onPointerDown","event","tracker","addToTracker","newPointerAction","tryToSendTouchEvent","onPointerAdd","lastCoords","getAbsoluteCoordsAverage","startX","x","startY","y","state","UNDETERMINED","begin","isRNGHText","hasAttribute","activate","onPointerMove","track","dx","dy","distSq","minDistSq","ACTIVE","cancel","BEGAN","onPointerLeave","onPointerUp","onUp","onPointerRemove","removeFromTracker","pointerId","trackedPointersCount","end","fail","shouldRecognizeSimultaneously","handler","disallowsInterruption","canBeInterrupted","handlerTag","shouldBeCancelledByOther","_handler","isButton"],"mappings":"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","sourcesContent":["import { Platform } from 'react-native';\nimport { State } from '../../State';\nimport { DEFAULT_TOUCH_SLOP } from '../constants';\nimport { AdaptedEvent, Config } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\nexport default class NativeViewGestureHandler extends GestureHandler {\n private buttonRole!: boolean;\n\n // TODO: Implement logic for activation on start\n // @ts-ignore Logic yet to be implemented\n private shouldActivateOnStart = false;\n private disallowInterruption = false;\n\n private startX = 0;\n private startY = 0;\n private minDistSq = DEFAULT_TOUCH_SLOP * DEFAULT_TOUCH_SLOP;\n\n public init(ref: number, propsRef: React.RefObject<unknown>): void {\n super.init(ref, propsRef);\n\n this.shouldCancelWhenOutside = true;\n\n if (Platform.OS !== 'web') {\n return;\n }\n\n const view = this.delegate.view as HTMLElement;\n\n this.restoreViewStyles(view);\n this.buttonRole = view.getAttribute('role') === 'button';\n }\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.shouldActivateOnStart !== undefined) {\n this.shouldActivateOnStart = this.config.shouldActivateOnStart;\n }\n if (this.config.disallowInterruption !== undefined) {\n this.disallowInterruption = this.config.disallowInterruption;\n }\n\n const view = this.delegate.view as HTMLElement;\n this.restoreViewStyles(view);\n }\n\n private restoreViewStyles(view: HTMLElement) {\n if (!view) {\n return;\n }\n\n view.style['touchAction'] = 'auto';\n // @ts-ignore Turns on defualt touch behavior on Safari\n view.style['WebkitTouchCallout'] = 'auto';\n }\n\n protected onPointerDown(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerDown(event);\n this.newPointerAction();\n\n this.tryToSendTouchEvent(event);\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n this.tracker.addToTracker(event);\n super.onPointerAdd(event);\n this.newPointerAction();\n }\n\n private newPointerAction(): void {\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.startX = lastCoords.x;\n this.startY = lastCoords.y;\n\n if (this.state !== State.UNDETERMINED) {\n return;\n }\n\n this.begin();\n\n const view = this.delegate.view as HTMLElement;\n const isRNGHText = view.hasAttribute('rnghtext');\n\n if (this.buttonRole || isRNGHText) {\n this.activate();\n }\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.tracker.track(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n const dx = this.startX - lastCoords.x;\n const dy = this.startY - lastCoords.y;\n const distSq = dx * dx + dy * dy;\n\n if (distSq >= this.minDistSq) {\n if (this.buttonRole && this.state === State.ACTIVE) {\n this.cancel();\n } else if (!this.buttonRole && this.state === State.BEGAN) {\n this.activate();\n }\n }\n }\n\n protected onPointerLeave(): void {\n if (this.state === State.BEGAN || this.state === State.ACTIVE) {\n this.cancel();\n }\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n this.onUp(event);\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.onUp(event);\n }\n\n private onUp(event: AdaptedEvent): void {\n this.tracker.removeFromTracker(event.pointerId);\n\n if (this.tracker.trackedPointersCount === 0) {\n if (this.state === State.ACTIVE) {\n this.end();\n } else {\n this.fail();\n }\n }\n }\n\n public shouldRecognizeSimultaneously(handler: GestureHandler): boolean {\n if (super.shouldRecognizeSimultaneously(handler)) {\n return true;\n }\n\n if (\n handler instanceof NativeViewGestureHandler &&\n handler.state === State.ACTIVE &&\n handler.disallowsInterruption()\n ) {\n return false;\n }\n\n const canBeInterrupted = !this.disallowInterruption;\n\n if (\n this.state === State.ACTIVE &&\n handler.state === State.ACTIVE &&\n canBeInterrupted\n ) {\n return false;\n }\n\n return (\n this.state === State.ACTIVE && canBeInterrupted && handler.handlerTag > 0\n );\n }\n\n public shouldBeCancelledByOther(_handler: GestureHandler): boolean {\n return !this.disallowInterruption;\n }\n\n public disallowsInterruption(): boolean {\n return this.disallowInterruption;\n }\n\n public isButton(): boolean {\n return this.buttonRole;\n }\n}\n"]}
|
@@ -1,6 +1,5 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
+
|
4
3
|
import { State } from '../../State';
|
5
4
|
import { DEFAULT_TOUCH_SLOP } from '../constants';
|
6
5
|
import { WheelDevice } from '../interfaces';
|
@@ -11,36 +10,66 @@ const DEFAULT_MIN_DIST_SQ = DEFAULT_TOUCH_SLOP * DEFAULT_TOUCH_SLOP;
|
|
11
10
|
export default class PanGestureHandler extends GestureHandler {
|
12
11
|
constructor(...args) {
|
13
12
|
super(...args);
|
13
|
+
|
14
14
|
_defineProperty(this, "customActivationProperties", ['activeOffsetXStart', 'activeOffsetXEnd', 'failOffsetXStart', 'failOffsetXEnd', 'activeOffsetYStart', 'activeOffsetYEnd', 'failOffsetYStart', 'failOffsetYEnd', 'minVelocityX', 'minVelocityY', 'minVelocity']);
|
15
|
+
|
15
16
|
_defineProperty(this, "velocityX", 0);
|
17
|
+
|
16
18
|
_defineProperty(this, "velocityY", 0);
|
19
|
+
|
17
20
|
_defineProperty(this, "minDistSq", DEFAULT_MIN_DIST_SQ);
|
21
|
+
|
18
22
|
_defineProperty(this, "activeOffsetXStart", -Number.MAX_SAFE_INTEGER);
|
23
|
+
|
19
24
|
_defineProperty(this, "activeOffsetXEnd", Number.MIN_SAFE_INTEGER);
|
25
|
+
|
20
26
|
_defineProperty(this, "failOffsetXStart", Number.MIN_SAFE_INTEGER);
|
27
|
+
|
21
28
|
_defineProperty(this, "failOffsetXEnd", Number.MAX_SAFE_INTEGER);
|
29
|
+
|
22
30
|
_defineProperty(this, "activeOffsetYStart", Number.MAX_SAFE_INTEGER);
|
31
|
+
|
23
32
|
_defineProperty(this, "activeOffsetYEnd", Number.MIN_SAFE_INTEGER);
|
33
|
+
|
24
34
|
_defineProperty(this, "failOffsetYStart", Number.MIN_SAFE_INTEGER);
|
35
|
+
|
25
36
|
_defineProperty(this, "failOffsetYEnd", Number.MAX_SAFE_INTEGER);
|
37
|
+
|
26
38
|
_defineProperty(this, "minVelocityX", Number.MAX_SAFE_INTEGER);
|
39
|
+
|
27
40
|
_defineProperty(this, "minVelocityY", Number.MAX_SAFE_INTEGER);
|
41
|
+
|
28
42
|
_defineProperty(this, "minVelocitySq", Number.MAX_SAFE_INTEGER);
|
43
|
+
|
29
44
|
_defineProperty(this, "minPointers", DEFAULT_MIN_POINTERS);
|
45
|
+
|
30
46
|
_defineProperty(this, "maxPointers", DEFAULT_MAX_POINTERS);
|
47
|
+
|
31
48
|
_defineProperty(this, "startX", 0);
|
49
|
+
|
32
50
|
_defineProperty(this, "startY", 0);
|
51
|
+
|
33
52
|
_defineProperty(this, "offsetX", 0);
|
53
|
+
|
34
54
|
_defineProperty(this, "offsetY", 0);
|
55
|
+
|
35
56
|
_defineProperty(this, "lastX", 0);
|
57
|
+
|
36
58
|
_defineProperty(this, "lastY", 0);
|
59
|
+
|
37
60
|
_defineProperty(this, "stylusData", void 0);
|
61
|
+
|
38
62
|
_defineProperty(this, "activateAfterLongPress", 0);
|
63
|
+
|
39
64
|
_defineProperty(this, "activationTimeout", 0);
|
65
|
+
|
40
66
|
_defineProperty(this, "enableTrackpadTwoFingerGesture", false);
|
67
|
+
|
41
68
|
_defineProperty(this, "endWheelTimeout", 0);
|
69
|
+
|
42
70
|
_defineProperty(this, "wheelDevice", WheelDevice.UNDETERMINED);
|
43
71
|
}
|
72
|
+
|
44
73
|
updateGestureConfig({
|
45
74
|
enabled = true,
|
46
75
|
...props
|
@@ -51,82 +80,107 @@ export default class PanGestureHandler extends GestureHandler {
|
|
51
80
|
...props
|
52
81
|
});
|
53
82
|
this.checkCustomActivationCriteria(this.customActivationProperties);
|
83
|
+
|
54
84
|
if (this.config.minDist !== undefined) {
|
55
85
|
this.minDistSq = this.config.minDist * this.config.minDist;
|
56
86
|
} else if (this.hasCustomActivationCriteria) {
|
57
87
|
this.minDistSq = Number.MAX_SAFE_INTEGER;
|
58
88
|
}
|
89
|
+
|
59
90
|
if (this.config.minPointers !== undefined) {
|
60
91
|
this.minPointers = this.config.minPointers;
|
61
92
|
}
|
93
|
+
|
62
94
|
if (this.config.maxPointers !== undefined) {
|
63
95
|
this.maxPointers = this.config.maxPointers;
|
64
96
|
}
|
97
|
+
|
65
98
|
if (this.config.minVelocity !== undefined) {
|
66
99
|
this.minVelocityX = this.config.minVelocity;
|
67
100
|
this.minVelocityY = this.config.minVelocity;
|
68
101
|
}
|
102
|
+
|
69
103
|
if (this.config.minVelocityX !== undefined) {
|
70
104
|
this.minVelocityX = this.config.minVelocityX;
|
71
105
|
}
|
106
|
+
|
72
107
|
if (this.config.minVelocityY !== undefined) {
|
73
108
|
this.minVelocityY = this.config.minVelocityY;
|
74
109
|
}
|
110
|
+
|
75
111
|
if (this.config.activateAfterLongPress !== undefined) {
|
76
112
|
this.activateAfterLongPress = this.config.activateAfterLongPress;
|
77
113
|
}
|
114
|
+
|
78
115
|
if (this.config.activeOffsetXStart !== undefined) {
|
79
116
|
this.activeOffsetXStart = this.config.activeOffsetXStart;
|
117
|
+
|
80
118
|
if (this.config.activeOffsetXEnd === undefined) {
|
81
119
|
this.activeOffsetXEnd = Number.MAX_SAFE_INTEGER;
|
82
120
|
}
|
83
121
|
}
|
122
|
+
|
84
123
|
if (this.config.activeOffsetXEnd !== undefined) {
|
85
124
|
this.activeOffsetXEnd = this.config.activeOffsetXEnd;
|
125
|
+
|
86
126
|
if (this.config.activeOffsetXStart === undefined) {
|
87
127
|
this.activeOffsetXStart = Number.MIN_SAFE_INTEGER;
|
88
128
|
}
|
89
129
|
}
|
130
|
+
|
90
131
|
if (this.config.failOffsetXStart !== undefined) {
|
91
132
|
this.failOffsetXStart = this.config.failOffsetXStart;
|
133
|
+
|
92
134
|
if (this.config.failOffsetXEnd === undefined) {
|
93
135
|
this.failOffsetXEnd = Number.MAX_SAFE_INTEGER;
|
94
136
|
}
|
95
137
|
}
|
138
|
+
|
96
139
|
if (this.config.failOffsetXEnd !== undefined) {
|
97
140
|
this.failOffsetXEnd = this.config.failOffsetXEnd;
|
141
|
+
|
98
142
|
if (this.config.failOffsetXStart === undefined) {
|
99
143
|
this.failOffsetXStart = Number.MIN_SAFE_INTEGER;
|
100
144
|
}
|
101
145
|
}
|
146
|
+
|
102
147
|
if (this.config.activeOffsetYStart !== undefined) {
|
103
148
|
this.activeOffsetYStart = this.config.activeOffsetYStart;
|
149
|
+
|
104
150
|
if (this.config.activeOffsetYEnd === undefined) {
|
105
151
|
this.activeOffsetYEnd = Number.MAX_SAFE_INTEGER;
|
106
152
|
}
|
107
153
|
}
|
154
|
+
|
108
155
|
if (this.config.activeOffsetYEnd !== undefined) {
|
109
156
|
this.activeOffsetYEnd = this.config.activeOffsetYEnd;
|
157
|
+
|
110
158
|
if (this.config.activeOffsetYStart === undefined) {
|
111
159
|
this.activeOffsetYStart = Number.MIN_SAFE_INTEGER;
|
112
160
|
}
|
113
161
|
}
|
162
|
+
|
114
163
|
if (this.config.failOffsetYStart !== undefined) {
|
115
164
|
this.failOffsetYStart = this.config.failOffsetYStart;
|
165
|
+
|
116
166
|
if (this.config.failOffsetYEnd === undefined) {
|
117
167
|
this.failOffsetYEnd = Number.MAX_SAFE_INTEGER;
|
118
168
|
}
|
119
169
|
}
|
170
|
+
|
120
171
|
if (this.config.failOffsetYEnd !== undefined) {
|
121
172
|
this.failOffsetYEnd = this.config.failOffsetYEnd;
|
173
|
+
|
122
174
|
if (this.config.failOffsetYStart === undefined) {
|
123
175
|
this.failOffsetYStart = Number.MIN_SAFE_INTEGER;
|
124
176
|
}
|
125
177
|
}
|
178
|
+
|
126
179
|
if (this.config.enableTrackpadTwoFingerGesture !== undefined) {
|
127
180
|
this.enableTrackpadTwoFingerGesture = this.config.enableTrackpadTwoFingerGesture;
|
128
181
|
}
|
129
182
|
}
|
183
|
+
|
130
184
|
resetConfig() {
|
131
185
|
super.resetConfig();
|
132
186
|
this.activeOffsetXStart = -Number.MAX_SAFE_INTEGER;
|
@@ -145,11 +199,11 @@ export default class PanGestureHandler extends GestureHandler {
|
|
145
199
|
this.maxPointers = DEFAULT_MAX_POINTERS;
|
146
200
|
this.activateAfterLongPress = 0;
|
147
201
|
}
|
202
|
+
|
148
203
|
transformNativeEvent() {
|
149
204
|
const translationX = this.getTranslationX();
|
150
205
|
const translationY = this.getTranslationY();
|
151
|
-
return {
|
152
|
-
...super.transformNativeEvent(),
|
206
|
+
return { ...super.transformNativeEvent(),
|
153
207
|
translationX: isNaN(translationX) ? 0 : translationX,
|
154
208
|
translationY: isNaN(translationY) ? 0 : translationY,
|
155
209
|
velocityX: this.velocityX,
|
@@ -157,21 +211,25 @@ export default class PanGestureHandler extends GestureHandler {
|
|
157
211
|
stylusData: this.stylusData
|
158
212
|
};
|
159
213
|
}
|
214
|
+
|
160
215
|
getTranslationX() {
|
161
216
|
return this.lastX - this.startX + this.offsetX;
|
162
217
|
}
|
218
|
+
|
163
219
|
getTranslationY() {
|
164
220
|
return this.lastY - this.startY + this.offsetY;
|
165
221
|
}
|
222
|
+
|
166
223
|
clearActivationTimeout() {
|
167
224
|
clearTimeout(this.activationTimeout);
|
168
|
-
}
|
225
|
+
} // Events Handling
|
226
|
+
|
169
227
|
|
170
|
-
// Events Handling
|
171
228
|
onPointerDown(event) {
|
172
229
|
if (!this.isButtonInConfig(event.button)) {
|
173
230
|
return;
|
174
231
|
}
|
232
|
+
|
175
233
|
this.tracker.addToTracker(event);
|
176
234
|
this.stylusData = event.stylusData;
|
177
235
|
super.onPointerDown(event);
|
@@ -184,6 +242,7 @@ export default class PanGestureHandler extends GestureHandler {
|
|
184
242
|
this.checkBegan();
|
185
243
|
this.tryToSendTouchEvent(event);
|
186
244
|
}
|
245
|
+
|
187
246
|
onPointerAdd(event) {
|
188
247
|
this.tracker.addToTracker(event);
|
189
248
|
super.onPointerAdd(event);
|
@@ -195,6 +254,7 @@ export default class PanGestureHandler extends GestureHandler {
|
|
195
254
|
this.lastY = lastCoords.y;
|
196
255
|
this.startX = this.lastX;
|
197
256
|
this.startY = this.lastY;
|
257
|
+
|
198
258
|
if (this.tracker.trackedPointersCount > this.maxPointers) {
|
199
259
|
if (this.state === State.ACTIVE) {
|
200
260
|
this.cancel();
|
@@ -205,18 +265,23 @@ export default class PanGestureHandler extends GestureHandler {
|
|
205
265
|
this.checkBegan();
|
206
266
|
}
|
207
267
|
}
|
268
|
+
|
208
269
|
onPointerUp(event) {
|
209
270
|
this.stylusData = event.stylusData;
|
210
271
|
super.onPointerUp(event);
|
272
|
+
|
211
273
|
if (this.state === State.ACTIVE) {
|
212
274
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
213
275
|
this.lastX = lastCoords.x;
|
214
276
|
this.lastY = lastCoords.y;
|
215
277
|
}
|
278
|
+
|
216
279
|
this.tracker.removeFromTracker(event.pointerId);
|
280
|
+
|
217
281
|
if (this.tracker.trackedPointersCount === 0) {
|
218
282
|
this.clearActivationTimeout();
|
219
283
|
}
|
284
|
+
|
220
285
|
if (this.state === State.ACTIVE) {
|
221
286
|
this.end();
|
222
287
|
} else {
|
@@ -224,6 +289,7 @@ export default class PanGestureHandler extends GestureHandler {
|
|
224
289
|
this.fail();
|
225
290
|
}
|
226
291
|
}
|
292
|
+
|
227
293
|
onPointerRemove(event) {
|
228
294
|
super.onPointerRemove(event);
|
229
295
|
this.tracker.removeFromTracker(event.pointerId);
|
@@ -234,10 +300,12 @@ export default class PanGestureHandler extends GestureHandler {
|
|
234
300
|
this.lastY = lastCoords.y;
|
235
301
|
this.startX = this.lastX;
|
236
302
|
this.startY = this.lastY;
|
303
|
+
|
237
304
|
if (!(this.state === State.ACTIVE && this.tracker.trackedPointersCount < this.minPointers)) {
|
238
305
|
this.checkBegan();
|
239
306
|
}
|
240
307
|
}
|
308
|
+
|
241
309
|
onPointerMove(event) {
|
242
310
|
this.tracker.track(event);
|
243
311
|
this.stylusData = event.stylusData;
|
@@ -250,10 +318,12 @@ export default class PanGestureHandler extends GestureHandler {
|
|
250
318
|
this.checkBegan();
|
251
319
|
super.onPointerMove(event);
|
252
320
|
}
|
321
|
+
|
253
322
|
onPointerOutOfBounds(event) {
|
254
323
|
if (this.shouldCancelWhenOutside) {
|
255
324
|
return;
|
256
325
|
}
|
326
|
+
|
257
327
|
this.tracker.track(event);
|
258
328
|
this.stylusData = event.stylusData;
|
259
329
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
@@ -263,10 +333,12 @@ export default class PanGestureHandler extends GestureHandler {
|
|
263
333
|
this.velocityX = velocity.x;
|
264
334
|
this.velocityY = velocity.y;
|
265
335
|
this.checkBegan();
|
336
|
+
|
266
337
|
if (this.state === State.ACTIVE) {
|
267
338
|
super.onPointerOutOfBounds(event);
|
268
339
|
}
|
269
340
|
}
|
341
|
+
|
270
342
|
scheduleWheelEnd(event) {
|
271
343
|
clearTimeout(this.endWheelTimeout);
|
272
344
|
this.endWheelTimeout = setTimeout(() => {
|
@@ -275,19 +347,24 @@ export default class PanGestureHandler extends GestureHandler {
|
|
275
347
|
this.tracker.removeFromTracker(event.pointerId);
|
276
348
|
this.state = State.UNDETERMINED;
|
277
349
|
}
|
350
|
+
|
278
351
|
this.wheelDevice = WheelDevice.UNDETERMINED;
|
279
352
|
}, 30);
|
280
353
|
}
|
354
|
+
|
281
355
|
onWheel(event) {
|
282
356
|
if (this.wheelDevice === WheelDevice.MOUSE || !this.enableTrackpadTwoFingerGesture) {
|
283
357
|
return;
|
284
358
|
}
|
359
|
+
|
285
360
|
if (this.state === State.UNDETERMINED) {
|
286
361
|
this.wheelDevice = event.wheelDeltaY % 120 !== 0 ? WheelDevice.TOUCHPAD : WheelDevice.MOUSE;
|
362
|
+
|
287
363
|
if (this.wheelDevice === WheelDevice.MOUSE) {
|
288
364
|
this.scheduleWheelEnd(event);
|
289
365
|
return;
|
290
366
|
}
|
367
|
+
|
291
368
|
this.tracker.addToTracker(event);
|
292
369
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
293
370
|
this.lastX = lastCoords.x;
|
@@ -297,6 +374,7 @@ export default class PanGestureHandler extends GestureHandler {
|
|
297
374
|
this.begin();
|
298
375
|
this.activate();
|
299
376
|
}
|
377
|
+
|
300
378
|
this.tracker.track(event);
|
301
379
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
302
380
|
this.lastX = lastCoords.x;
|
@@ -307,55 +385,75 @@ export default class PanGestureHandler extends GestureHandler {
|
|
307
385
|
this.tryToSendMoveEvent(false, event);
|
308
386
|
this.scheduleWheelEnd(event);
|
309
387
|
}
|
388
|
+
|
310
389
|
shouldActivate() {
|
311
390
|
const dx = this.getTranslationX();
|
391
|
+
|
312
392
|
if (this.activeOffsetXStart !== Number.MAX_SAFE_INTEGER && dx < this.activeOffsetXStart) {
|
313
393
|
return true;
|
314
394
|
}
|
395
|
+
|
315
396
|
if (this.activeOffsetXEnd !== Number.MIN_SAFE_INTEGER && dx > this.activeOffsetXEnd) {
|
316
397
|
return true;
|
317
398
|
}
|
399
|
+
|
318
400
|
const dy = this.getTranslationY();
|
401
|
+
|
319
402
|
if (this.activeOffsetYStart !== Number.MAX_SAFE_INTEGER && dy < this.activeOffsetYStart) {
|
320
403
|
return true;
|
321
404
|
}
|
405
|
+
|
322
406
|
if (this.activeOffsetYEnd !== Number.MIN_SAFE_INTEGER && dy > this.activeOffsetYEnd) {
|
323
407
|
return true;
|
324
408
|
}
|
409
|
+
|
325
410
|
const distanceSq = dx * dx + dy * dy;
|
411
|
+
|
326
412
|
if (this.minDistSq !== Number.MAX_SAFE_INTEGER && distanceSq >= this.minDistSq) {
|
327
413
|
return true;
|
328
414
|
}
|
415
|
+
|
329
416
|
const vx = this.velocityX;
|
417
|
+
|
330
418
|
if (this.minVelocityX !== Number.MAX_SAFE_INTEGER && (this.minVelocityX < 0 && vx <= this.minVelocityX || this.minVelocityX >= 0 && this.minVelocityX <= vx)) {
|
331
419
|
return true;
|
332
420
|
}
|
421
|
+
|
333
422
|
const vy = this.velocityY;
|
423
|
+
|
334
424
|
if (this.minVelocityY !== Number.MAX_SAFE_INTEGER && (this.minVelocityY < 0 && vy <= this.minVelocityY || this.minVelocityY >= 0 && this.minVelocityY <= vy)) {
|
335
425
|
return true;
|
336
426
|
}
|
427
|
+
|
337
428
|
const velocitySq = vx * vx + vy * vy;
|
338
429
|
return this.minVelocitySq !== Number.MAX_SAFE_INTEGER && velocitySq >= this.minVelocitySq;
|
339
430
|
}
|
431
|
+
|
340
432
|
shouldFail() {
|
341
433
|
const dx = this.getTranslationX();
|
342
434
|
const dy = this.getTranslationY();
|
343
435
|
const distanceSq = dx * dx + dy * dy;
|
436
|
+
|
344
437
|
if (this.activateAfterLongPress > 0 && distanceSq > DEFAULT_MIN_DIST_SQ) {
|
345
438
|
this.clearActivationTimeout();
|
346
439
|
return true;
|
347
440
|
}
|
441
|
+
|
348
442
|
if (this.failOffsetXStart !== Number.MIN_SAFE_INTEGER && dx < this.failOffsetXStart) {
|
349
443
|
return true;
|
350
444
|
}
|
445
|
+
|
351
446
|
if (this.failOffsetXEnd !== Number.MAX_SAFE_INTEGER && dx > this.failOffsetXEnd) {
|
352
447
|
return true;
|
353
448
|
}
|
449
|
+
|
354
450
|
if (this.failOffsetYStart !== Number.MIN_SAFE_INTEGER && dy < this.failOffsetYStart) {
|
355
451
|
return true;
|
356
452
|
}
|
453
|
+
|
357
454
|
return this.failOffsetYEnd !== Number.MAX_SAFE_INTEGER && dy > this.failOffsetYEnd;
|
358
455
|
}
|
456
|
+
|
359
457
|
tryBegin(event) {
|
360
458
|
if (this.state === State.UNDETERMINED && this.tracker.trackedPointersCount >= this.minPointers) {
|
361
459
|
this.resetProgress();
|
@@ -364,6 +462,7 @@ export default class PanGestureHandler extends GestureHandler {
|
|
364
462
|
this.velocityX = 0;
|
365
463
|
this.velocityY = 0;
|
366
464
|
this.begin();
|
465
|
+
|
367
466
|
if (this.activateAfterLongPress > 0) {
|
368
467
|
this.activationTimeout = setTimeout(() => {
|
369
468
|
this.activate();
|
@@ -375,6 +474,7 @@ export default class PanGestureHandler extends GestureHandler {
|
|
375
474
|
this.velocityY = velocity.y;
|
376
475
|
}
|
377
476
|
}
|
477
|
+
|
378
478
|
checkBegan() {
|
379
479
|
if (this.state === State.BEGAN) {
|
380
480
|
if (this.shouldFail()) {
|
@@ -384,24 +484,31 @@ export default class PanGestureHandler extends GestureHandler {
|
|
384
484
|
}
|
385
485
|
}
|
386
486
|
}
|
487
|
+
|
387
488
|
activate(force = false) {
|
388
489
|
if (this.state !== State.ACTIVE) {
|
389
490
|
this.resetProgress();
|
390
491
|
}
|
492
|
+
|
391
493
|
super.activate(force);
|
392
494
|
}
|
495
|
+
|
393
496
|
onCancel() {
|
394
497
|
this.clearActivationTimeout();
|
395
498
|
}
|
499
|
+
|
396
500
|
onReset() {
|
397
501
|
this.clearActivationTimeout();
|
398
502
|
}
|
503
|
+
|
399
504
|
resetProgress() {
|
400
505
|
if (this.state === State.ACTIVE) {
|
401
506
|
return;
|
402
507
|
}
|
508
|
+
|
403
509
|
this.startX = this.lastX;
|
404
510
|
this.startY = this.lastY;
|
405
511
|
}
|
512
|
+
|
406
513
|
}
|
407
514
|
//# sourceMappingURL=PanGestureHandler.js.map
|