react-native-gesture-handler 2.22.0 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
- package/android/src/main/jni/cpp-adapter.cpp +19 -12
- package/apple/RNGestureHandler.mm +15 -8
- package/apple/RNGestureHandlerModule.mm +17 -5
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +11 -8
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +2 -10
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +2 -7
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +1 -6
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +1 -3
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +3 -5
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +2 -6
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +13 -39
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +22 -32
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +1 -3
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +1 -2
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +4 -3
- 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 +96 -115
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +36 -80
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +26 -37
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +13 -27
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +2 -6
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +4 -12
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +4 -15
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +4 -14
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +4 -13
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +46 -78
- 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 +1 -3
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +5 -20
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +38 -76
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +133 -98
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +34 -75
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +18 -26
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +5 -14
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +40 -76
- 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 +20 -33
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +17 -31
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -4
- 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 +17 -24
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +12 -13
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +7 -12
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +1 -4
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +9 -10
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +1 -6
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +0 -1
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +13 -14
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +0 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +1 -2
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +16 -10
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +20 -23
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +16 -10
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +17 -12
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +20 -31
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +14 -8
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +14 -8
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +16 -10
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +55 -135
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +33 -32
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +1 -2
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +9 -10
- 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 +5 -14
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +10 -20
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -29
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +1 -10
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +12 -37
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -3
- 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 +12 -24
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -48
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +3 -13
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +2 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +8 -16
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +28 -56
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -46
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +5 -12
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +8 -19
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +44 -84
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +17 -31
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +1 -27
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +3 -9
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +2 -7
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +11 -25
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +6 -14
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +0 -6
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +5 -12
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +18 -43
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +2 -9
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +1 -8
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +2 -9
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +10 -22
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +0 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +11 -21
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +6 -26
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +75 -104
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +4 -11
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +4 -5
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +19 -83
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +5 -15
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +3 -12
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +1 -5
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +2 -7
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +2 -7
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +15 -30
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +5 -23
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +2 -4
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +26 -62
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +36 -65
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +12 -55
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +160 -273
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +8 -21
- 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 +12 -53
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +1 -11
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +21 -62
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +23 -138
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +19 -56
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +16 -54
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +10 -71
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +9 -17
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +17 -29
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +7 -41
- 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 +51 -118
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +37 -58
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +21 -40
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +4 -26
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +30 -67
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +9 -16
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +10 -45
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +24 -60
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +3 -18
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +10 -32
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +4 -17
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +26 -55
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +7 -19
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +3 -13
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +0 -3
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +13 -44
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +55 -142
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +2 -11
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +5 -19
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +16 -24
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +9 -16
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +8 -49
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +2 -11
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +15 -43
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +2 -13
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +33 -52
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +13 -26
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +4 -14
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +3 -1
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +9 -3
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +2 -5
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +0 -1
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +0 -1
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +3 -4
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +1 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +12 -22
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +18 -17
- 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 +4 -1
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +3 -1
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +87 -99
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +27 -55
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +17 -12
- 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 +1 -2
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +1 -2
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +1 -2
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +1 -2
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +44 -61
- 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 +4 -14
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +34 -56
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +130 -84
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +28 -59
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +14 -13
- 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/GenericTouchable.js +34 -63
- 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 +16 -23
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +11 -19
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
- 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 +13 -14
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -2
- 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 +9 -8
- 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 +13 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +16 -8
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +13 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +13 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +15 -19
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +13 -0
- 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 +13 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +13 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +54 -108
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +28 -22
- 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 +9 -4
- 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 +3 -4
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +5 -6
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +8 -16
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +9 -15
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -2
- 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 +11 -14
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -39
- 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 +2 -6
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -9
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +25 -30
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +14 -38
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +5 -9
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +8 -17
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +44 -73
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +16 -24
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +1 -14
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +3 -4
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +9 -18
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +6 -11
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +0 -4
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +5 -9
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +18 -41
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +2 -7
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -5
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +2 -7
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +10 -19
- 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 +6 -8
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +4 -13
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +3 -2
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +20 -66
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +3 -7
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +3 -10
- 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 +8 -13
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +2 -1
- 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 +26 -59
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +36 -61
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +11 -45
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +159 -259
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +7 -13
- 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 +11 -46
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -6
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +20 -54
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +22 -129
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +18 -48
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +15 -46
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +9 -63
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +9 -14
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +17 -27
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +7 -39
- 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 +50 -111
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +36 -47
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +21 -35
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +3 -19
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +30 -65
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +9 -14
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +9 -35
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +23 -54
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +3 -14
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +9 -26
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +3 -10
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +21 -40
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +4 -13
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +0 -5
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +0 -1
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +10 -35
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +53 -130
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +1 -6
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +2 -11
- 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 +6 -8
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +6 -40
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +0 -5
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +13 -34
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +0 -6
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +31 -45
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +2 -1
- 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/DrawerLayout.d.ts +27 -0
- package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
- package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
- package/lib/typescript/components/Pressable/index.d.ts +1 -1
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -1
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
- package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
- package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
- package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
- package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
- package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
- package/package.json +2 -2
- package/src/RNGestureHandlerModule.web.ts +2 -2
- package/src/components/DrawerLayout.tsx +29 -0
- package/src/components/GestureButtons.tsx +13 -2
- package/src/components/GestureButtonsProps.ts +31 -2
- package/src/components/Pressable/Pressable.tsx +22 -5
- package/src/components/Pressable/PressableProps.tsx +4 -11
- package/src/components/Pressable/index.ts +4 -1
- package/src/components/ReanimatedSwipeable.tsx +194 -113
- package/src/components/Text.tsx +13 -4
- package/src/components/touchables/TouchableHighlight.tsx +5 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +5 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
- package/src/findNodeHandle.web.ts +6 -0
- package/src/handlers/FlingGestureHandler.ts +10 -0
- package/src/handlers/ForceTouchGestureHandler.ts +9 -0
- package/src/handlers/LongPressGestureHandler.ts +10 -0
- package/src/handlers/NativeViewGestureHandler.ts +10 -0
- package/src/handlers/PanGestureHandler.ts +10 -0
- package/src/handlers/PinchGestureHandler.ts +10 -0
- package/src/handlers/RotationGestureHandler.ts +10 -0
- package/src/handlers/TapGestureHandler.ts +10 -0
- package/src/handlers/createHandler.tsx +11 -4
- package/src/handlers/createNativeWrapper.tsx +10 -4
- package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
- package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
- package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
- package/src/handlers/handlersRegistry.ts +7 -3
- package/src/index.ts +4 -1
- package/src/utils.ts +2 -2
- package/src/web/detectors/RotationGestureDetector.ts +22 -22
- package/src/web/detectors/ScaleGestureDetector.ts +24 -24
- package/src/web/handlers/FlingGestureHandler.ts +6 -7
- package/src/web/handlers/GestureHandler.ts +115 -105
- package/src/web/handlers/HoverGestureHandler.ts +2 -2
- package/src/web/handlers/IGestureHandler.ts +12 -13
- package/src/web/handlers/LongPressGestureHandler.ts +7 -7
- package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
- package/src/web/handlers/PanGestureHandler.ts +17 -17
- package/src/web/handlers/PinchGestureHandler.ts +17 -21
- package/src/web/handlers/RotationGestureHandler.ts +12 -12
- package/src/web/handlers/TapGestureHandler.ts +4 -6
- package/src/web/tools/CircularBuffer.ts +15 -15
- package/src/web/tools/GestureHandlerDelegate.ts +1 -1
- package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
- package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
- package/src/web/tools/InteractionManager.ts +16 -16
- package/src/web/tools/NodeManager.ts +2 -2
- package/src/web/tools/PointerTracker.ts +20 -20
- package/src/web/tools/Vector.ts +1 -1
- package/src/web/tools/VelocityTracker.ts +1 -1
@@ -1,5 +1,6 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
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); }
|
3
4
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
4
5
|
import { State } from '../../State';
|
5
6
|
import { TouchEventType, EventTypes } from '../interfaces';
|
@@ -9,48 +10,37 @@ import PointerTracker from '../tools/PointerTracker';
|
|
9
10
|
import { MouseButton } from '../../handlers/gestureHandlerCommon';
|
10
11
|
import { PointerType } from '../../PointerType';
|
11
12
|
export default class GestureHandler {
|
12
|
-
// Orchestrator properties
|
13
13
|
constructor(delegate) {
|
14
14
|
_defineProperty(this, "lastSentState", null);
|
15
|
-
|
16
|
-
_defineProperty(this, "
|
17
|
-
|
18
|
-
_defineProperty(this, "shouldCancelWhenOutside", false);
|
19
|
-
|
15
|
+
_defineProperty(this, "_state", State.UNDETERMINED);
|
16
|
+
_defineProperty(this, "_shouldCancelWhenOutside", false);
|
20
17
|
_defineProperty(this, "hasCustomActivationCriteria", false);
|
21
|
-
|
22
|
-
_defineProperty(this, "enabled", false);
|
23
|
-
|
18
|
+
_defineProperty(this, "_enabled", false);
|
24
19
|
_defineProperty(this, "viewRef", void 0);
|
25
|
-
|
26
20
|
_defineProperty(this, "propsRef", void 0);
|
27
|
-
|
28
|
-
_defineProperty(this, "
|
29
|
-
|
30
|
-
_defineProperty(this, "config", {
|
21
|
+
_defineProperty(this, "_handlerTag", void 0);
|
22
|
+
_defineProperty(this, "_config", {
|
31
23
|
enabled: false
|
32
24
|
});
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
_defineProperty(this, "
|
37
|
-
|
38
|
-
_defineProperty(this, "
|
39
|
-
|
40
|
-
_defineProperty(this, "
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
_defineProperty(this, "pointerType", PointerType.MOUSE);
|
45
|
-
|
46
|
-
_defineProperty(this, "delegate", void 0);
|
47
|
-
|
25
|
+
_defineProperty(this, "_tracker", new PointerTracker());
|
26
|
+
// Orchestrator properties
|
27
|
+
_defineProperty(this, "_activationIndex", 0);
|
28
|
+
_defineProperty(this, "_awaiting", false);
|
29
|
+
_defineProperty(this, "_active", false);
|
30
|
+
_defineProperty(this, "_shouldResetProgress", false);
|
31
|
+
_defineProperty(this, "_pointerType", PointerType.MOUSE);
|
32
|
+
_defineProperty(this, "_delegate", void 0);
|
33
|
+
//
|
34
|
+
// Events Sending
|
35
|
+
//
|
48
36
|
_defineProperty(this, "sendEvent", (newState, oldState) => {
|
49
37
|
const {
|
50
38
|
onGestureHandlerEvent,
|
51
39
|
onGestureHandlerStateChange
|
52
40
|
} = this.propsRef.current;
|
53
|
-
const resultEvent = this.transformEventData(newState, oldState);
|
41
|
+
const resultEvent = this.transformEventData(newState, oldState);
|
42
|
+
|
43
|
+
// In the new API oldState field has to be undefined, unless we send event state changed
|
54
44
|
// Here the order is flipped to avoid workarounds such as making backup of the state and setting it to undefined first, then changing it back
|
55
45
|
// Flipping order with setting oldState to undefined solves issue, when events were being sent twice instead of once
|
56
46
|
// However, this may cause trouble in the future (but for now we don't know that)
|
@@ -59,26 +49,24 @@ export default class GestureHandler {
|
|
59
49
|
this.lastSentState = newState;
|
60
50
|
invokeNullableMethod(onGestureHandlerStateChange, resultEvent);
|
61
51
|
}
|
62
|
-
|
63
|
-
if (this.currentState === State.ACTIVE) {
|
52
|
+
if (this.state === State.ACTIVE) {
|
64
53
|
resultEvent.nativeEvent.oldState = undefined;
|
65
54
|
invokeNullableMethod(onGestureHandlerEvent, resultEvent);
|
66
55
|
}
|
67
56
|
});
|
57
|
+
this._delegate = delegate;
|
58
|
+
}
|
68
59
|
|
69
|
-
|
70
|
-
} //
|
60
|
+
//
|
71
61
|
// Initializing handler
|
72
62
|
//
|
73
63
|
|
74
|
-
|
75
64
|
init(viewRef, propsRef) {
|
76
65
|
this.propsRef = propsRef;
|
77
66
|
this.viewRef = viewRef;
|
78
|
-
this.
|
67
|
+
this.state = State.UNDETERMINED;
|
79
68
|
this.delegate.init(viewRef, this);
|
80
69
|
}
|
81
|
-
|
82
70
|
attachEventManager(manager) {
|
83
71
|
manager.setOnPointerDown(this.onPointerDown.bind(this));
|
84
72
|
manager.setOnPointerAdd(this.onPointerAdd.bind(this));
|
@@ -93,284 +81,218 @@ export default class GestureHandler {
|
|
93
81
|
manager.setOnPointerMoveOut(this.onPointerMoveOut.bind(this));
|
94
82
|
manager.setOnWheel(this.onWheel.bind(this));
|
95
83
|
manager.registerListeners();
|
96
|
-
}
|
84
|
+
}
|
85
|
+
|
86
|
+
//
|
97
87
|
// Resetting handler
|
98
88
|
//
|
99
89
|
|
100
|
-
|
101
90
|
onCancel() {}
|
102
|
-
|
103
91
|
onReset() {}
|
104
|
-
|
105
92
|
resetProgress() {}
|
106
|
-
|
107
93
|
reset() {
|
108
94
|
this.tracker.resetTracker();
|
109
95
|
this.onReset();
|
110
96
|
this.resetProgress();
|
111
97
|
this.delegate.reset();
|
112
|
-
this.
|
113
|
-
}
|
98
|
+
this.state = State.UNDETERMINED;
|
99
|
+
}
|
100
|
+
|
101
|
+
//
|
114
102
|
// State logic
|
115
103
|
//
|
116
104
|
|
117
|
-
|
118
105
|
moveToState(newState, sendIfDisabled) {
|
119
|
-
if (this.
|
106
|
+
if (this.state === newState) {
|
120
107
|
return;
|
121
108
|
}
|
122
|
-
|
123
|
-
|
124
|
-
this.
|
125
|
-
|
126
|
-
if (this.tracker.getTrackedPointersCount() > 0 && this.config.needsPointerData && this.isFinished()) {
|
109
|
+
const oldState = this.state;
|
110
|
+
this.state = newState;
|
111
|
+
if (this.tracker.trackedPointersCount > 0 && this.config.needsPointerData && this.isFinished()) {
|
127
112
|
this.cancelTouches();
|
128
113
|
}
|
129
|
-
|
130
|
-
GestureHandlerOrchestrator.getInstance().onHandlerStateChange(this, newState, oldState, sendIfDisabled);
|
114
|
+
GestureHandlerOrchestrator.instance.onHandlerStateChange(this, newState, oldState, sendIfDisabled);
|
131
115
|
this.onStateChange(newState, oldState);
|
132
|
-
|
133
116
|
if (!this.enabled && this.isFinished()) {
|
134
|
-
this.
|
117
|
+
this.state = State.UNDETERMINED;
|
135
118
|
}
|
136
119
|
}
|
137
|
-
|
138
120
|
onStateChange(_newState, _oldState) {}
|
139
|
-
|
140
121
|
begin() {
|
141
122
|
if (!this.checkHitSlop()) {
|
142
123
|
return;
|
143
124
|
}
|
144
|
-
|
145
|
-
if (this.currentState === State.UNDETERMINED) {
|
125
|
+
if (this.state === State.UNDETERMINED) {
|
146
126
|
this.moveToState(State.BEGAN);
|
147
127
|
}
|
148
128
|
}
|
129
|
+
|
149
130
|
/**
|
150
131
|
* @param {boolean} sendIfDisabled - Used when handler becomes disabled. With this flag orchestrator will be forced to send fail event
|
151
132
|
*/
|
152
|
-
|
153
|
-
|
154
133
|
fail(sendIfDisabled) {
|
155
|
-
if (this.
|
134
|
+
if (this.state === State.ACTIVE || this.state === State.BEGAN) {
|
156
135
|
// Here the order of calling the delegate and moveToState is important.
|
157
136
|
// At this point we can use currentState as previuos state, because immediately after changing cursor we call moveToState method.
|
158
137
|
this.delegate.onFail();
|
159
138
|
this.moveToState(State.FAILED, sendIfDisabled);
|
160
139
|
}
|
161
|
-
|
162
140
|
this.resetProgress();
|
163
141
|
}
|
142
|
+
|
164
143
|
/**
|
165
144
|
* @param {boolean} sendIfDisabled - Used when handler becomes disabled. With this flag orchestrator will be forced to send cancel event
|
166
145
|
*/
|
167
|
-
|
168
|
-
|
169
146
|
cancel(sendIfDisabled) {
|
170
|
-
if (this.
|
171
|
-
this.onCancel();
|
147
|
+
if (this.state === State.ACTIVE || this.state === State.UNDETERMINED || this.state === State.BEGAN) {
|
148
|
+
this.onCancel();
|
172
149
|
|
150
|
+
// Same as above - order matters
|
173
151
|
this.delegate.onCancel();
|
174
152
|
this.moveToState(State.CANCELLED, sendIfDisabled);
|
175
153
|
}
|
176
154
|
}
|
177
|
-
|
178
155
|
activate(force = false) {
|
179
|
-
if ((this.config.manualActivation !== true || force) && (this.
|
156
|
+
if ((this.config.manualActivation !== true || force) && (this.state === State.UNDETERMINED || this.state === State.BEGAN)) {
|
180
157
|
this.delegate.onActivate();
|
181
158
|
this.moveToState(State.ACTIVE);
|
182
159
|
}
|
183
160
|
}
|
184
|
-
|
185
161
|
end() {
|
186
|
-
if (this.
|
162
|
+
if (this.state === State.BEGAN || this.state === State.ACTIVE) {
|
187
163
|
// Same as above - order matters
|
188
164
|
this.delegate.onEnd();
|
189
165
|
this.moveToState(State.END);
|
190
166
|
}
|
191
|
-
|
192
167
|
this.resetProgress();
|
193
|
-
} //
|
194
|
-
// Methods for orchestrator
|
195
|
-
//
|
196
|
-
|
197
|
-
|
198
|
-
isAwaiting() {
|
199
|
-
return this.awaiting;
|
200
|
-
}
|
201
|
-
|
202
|
-
setAwaiting(value) {
|
203
|
-
this.awaiting = value;
|
204
168
|
}
|
205
169
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
setActive(value) {
|
211
|
-
this.active = value;
|
212
|
-
}
|
170
|
+
//
|
171
|
+
// Methods for orchestrator
|
172
|
+
//
|
213
173
|
|
214
174
|
getShouldResetProgress() {
|
215
175
|
return this.shouldResetProgress;
|
216
176
|
}
|
217
|
-
|
218
177
|
setShouldResetProgress(value) {
|
219
178
|
this.shouldResetProgress = value;
|
220
179
|
}
|
221
|
-
|
222
|
-
getActivationIndex() {
|
223
|
-
return this.activationIndex;
|
224
|
-
}
|
225
|
-
|
226
|
-
setActivationIndex(value) {
|
227
|
-
this.activationIndex = value;
|
228
|
-
}
|
229
|
-
|
230
180
|
shouldWaitForHandlerFailure(handler) {
|
231
181
|
if (handler === this) {
|
232
182
|
return false;
|
233
183
|
}
|
234
|
-
|
235
|
-
return InteractionManager.getInstance().shouldWaitForHandlerFailure(this, handler);
|
184
|
+
return InteractionManager.instance.shouldWaitForHandlerFailure(this, handler);
|
236
185
|
}
|
237
|
-
|
238
186
|
shouldRequireToWaitForFailure(handler) {
|
239
187
|
if (handler === this) {
|
240
188
|
return false;
|
241
189
|
}
|
242
|
-
|
243
|
-
return InteractionManager.getInstance().shouldRequireHandlerToWaitForFailure(this, handler);
|
190
|
+
return InteractionManager.instance.shouldRequireHandlerToWaitForFailure(this, handler);
|
244
191
|
}
|
245
|
-
|
246
192
|
shouldRecognizeSimultaneously(handler) {
|
247
193
|
if (handler === this) {
|
248
194
|
return true;
|
249
195
|
}
|
250
|
-
|
251
|
-
return InteractionManager.getInstance().shouldRecognizeSimultaneously(this, handler);
|
196
|
+
return InteractionManager.instance.shouldRecognizeSimultaneously(this, handler);
|
252
197
|
}
|
253
|
-
|
254
198
|
shouldBeCancelledByOther(handler) {
|
255
199
|
if (handler === this) {
|
256
200
|
return false;
|
257
201
|
}
|
202
|
+
return InteractionManager.instance.shouldHandlerBeCancelledBy(this, handler);
|
203
|
+
}
|
258
204
|
|
259
|
-
|
260
|
-
} //
|
205
|
+
//
|
261
206
|
// Event actions
|
262
207
|
//
|
263
208
|
|
264
|
-
|
265
209
|
onPointerDown(event) {
|
266
|
-
GestureHandlerOrchestrator.
|
210
|
+
GestureHandlerOrchestrator.instance.recordHandlerIfNotPresent(this);
|
267
211
|
this.pointerType = event.pointerType;
|
268
|
-
|
269
212
|
if (this.pointerType === PointerType.TOUCH) {
|
270
|
-
GestureHandlerOrchestrator.
|
271
|
-
}
|
272
|
-
|
273
|
-
} // Adding another pointer to existing ones
|
274
|
-
|
213
|
+
GestureHandlerOrchestrator.instance.cancelMouseAndPenGestures(this);
|
214
|
+
}
|
275
215
|
|
216
|
+
// TODO: Bring back touch events along with introducing `handleDown` method that will handle handler specific stuff
|
217
|
+
}
|
218
|
+
// Adding another pointer to existing ones
|
276
219
|
onPointerAdd(event) {
|
277
220
|
this.tryToSendTouchEvent(event);
|
278
221
|
}
|
279
|
-
|
280
222
|
onPointerUp(event) {
|
281
223
|
this.tryToSendTouchEvent(event);
|
282
|
-
}
|
283
|
-
|
284
|
-
|
224
|
+
}
|
225
|
+
// Removing pointer, when there is more than one pointers
|
285
226
|
onPointerRemove(event) {
|
286
227
|
this.tryToSendTouchEvent(event);
|
287
228
|
}
|
288
|
-
|
289
229
|
onPointerMove(event) {
|
290
230
|
this.tryToSendMoveEvent(false, event);
|
291
231
|
}
|
292
|
-
|
293
232
|
onPointerLeave(event) {
|
294
233
|
if (this.shouldCancelWhenOutside) {
|
295
|
-
switch (this.
|
234
|
+
switch (this.state) {
|
296
235
|
case State.ACTIVE:
|
297
236
|
this.cancel();
|
298
237
|
break;
|
299
|
-
|
300
238
|
case State.BEGAN:
|
301
239
|
this.fail();
|
302
240
|
break;
|
303
241
|
}
|
304
|
-
|
305
242
|
return;
|
306
243
|
}
|
307
|
-
|
308
244
|
this.tryToSendTouchEvent(event);
|
309
245
|
}
|
310
|
-
|
311
246
|
onPointerEnter(event) {
|
312
247
|
this.tryToSendTouchEvent(event);
|
313
248
|
}
|
314
|
-
|
315
249
|
onPointerCancel(event) {
|
316
250
|
this.tryToSendTouchEvent(event);
|
317
251
|
this.cancel();
|
318
252
|
this.reset();
|
319
253
|
}
|
320
|
-
|
321
254
|
onPointerOutOfBounds(event) {
|
322
255
|
this.tryToSendMoveEvent(true, event);
|
323
256
|
}
|
324
|
-
|
325
|
-
|
257
|
+
onPointerMoveOver(_event) {
|
258
|
+
// Used only by hover gesture handler atm
|
326
259
|
}
|
327
|
-
|
328
|
-
|
260
|
+
onPointerMoveOut(_event) {
|
261
|
+
// Used only by hover gesture handler atm
|
329
262
|
}
|
330
|
-
|
331
|
-
|
263
|
+
onWheel(_event) {
|
264
|
+
// Used only by pan gesture handler
|
332
265
|
}
|
333
|
-
|
334
266
|
tryToSendMoveEvent(out, event) {
|
335
267
|
if (out && this.shouldCancelWhenOutside || !this.enabled) {
|
336
268
|
return;
|
337
269
|
}
|
338
|
-
|
339
270
|
if (this.active) {
|
340
|
-
this.sendEvent(this.
|
271
|
+
this.sendEvent(this.state, this.state);
|
341
272
|
}
|
342
|
-
|
343
273
|
this.tryToSendTouchEvent(event);
|
344
274
|
}
|
345
|
-
|
346
275
|
tryToSendTouchEvent(event) {
|
347
276
|
if (this.config.needsPointerData) {
|
348
277
|
this.sendTouchEvent(event);
|
349
278
|
}
|
350
279
|
}
|
351
|
-
|
352
280
|
sendTouchEvent(event) {
|
353
281
|
if (!this.enabled) {
|
354
282
|
return;
|
355
283
|
}
|
356
|
-
|
357
284
|
const {
|
358
285
|
onGestureHandlerEvent
|
359
286
|
} = this.propsRef.current;
|
360
287
|
const touchEvent = this.transformTouchEvent(event);
|
361
|
-
|
362
288
|
if (touchEvent) {
|
363
289
|
invokeNullableMethod(onGestureHandlerEvent, touchEvent);
|
364
290
|
}
|
365
|
-
}
|
366
|
-
// Events Sending
|
367
|
-
//
|
368
|
-
|
369
|
-
|
291
|
+
}
|
370
292
|
transformEventData(newState, oldState) {
|
371
293
|
return {
|
372
294
|
nativeEvent: {
|
373
|
-
numberOfPointers: this.tracker.
|
295
|
+
numberOfPointers: this.tracker.trackedPointersCount,
|
374
296
|
state: newState,
|
375
297
|
pointerInside: this.delegate.isPointerInBounds(this.tracker.getAbsoluteCoordsAverage()),
|
376
298
|
...this.transformNativeEvent(),
|
@@ -382,20 +304,19 @@ export default class GestureHandler {
|
|
382
304
|
timeStamp: Date.now()
|
383
305
|
};
|
384
306
|
}
|
385
|
-
|
386
307
|
transformTouchEvent(event) {
|
387
308
|
const rect = this.delegate.measureView();
|
388
309
|
const all = [];
|
389
310
|
const changed = [];
|
390
|
-
const trackerData = this.tracker.
|
311
|
+
const trackerData = this.tracker.trackedPointers;
|
312
|
+
|
313
|
+
// This if handles edge case where all pointers have been cancelled
|
391
314
|
// When pointercancel is triggered, reset method is called. This means that tracker will be reset after first pointer being cancelled
|
392
315
|
// The problem is, that handler will receive another pointercancel event from the rest of the pointers
|
393
316
|
// To avoid crashing, we don't send event if tracker tracks no pointers, i.e. has been reset
|
394
|
-
|
395
317
|
if (trackerData.size === 0 || !trackerData.has(event.pointerId)) {
|
396
318
|
return;
|
397
319
|
}
|
398
|
-
|
399
320
|
trackerData.forEach((element, key) => {
|
400
321
|
const id = this.tracker.getMappedTouchEventId(key);
|
401
322
|
all.push({
|
@@ -405,9 +326,10 @@ export default class GestureHandler {
|
|
405
326
|
absoluteX: element.abosoluteCoords.x,
|
406
327
|
absoluteY: element.abosoluteCoords.y
|
407
328
|
});
|
408
|
-
});
|
409
|
-
// However, if the event is cancel, we want to cancel all pointers to avoid crashes
|
329
|
+
});
|
410
330
|
|
331
|
+
// Each pointer sends its own event, so we want changed touches to contain only the pointer that has changed.
|
332
|
+
// However, if the event is cancel, we want to cancel all pointers to avoid crashes
|
411
333
|
if (event.eventType !== EventTypes.CANCEL) {
|
412
334
|
changed.push({
|
413
335
|
id: this.tracker.getMappedTouchEventId(event.pointerId),
|
@@ -428,42 +350,35 @@ export default class GestureHandler {
|
|
428
350
|
});
|
429
351
|
});
|
430
352
|
}
|
431
|
-
|
432
353
|
let eventType = TouchEventType.UNDETERMINED;
|
433
|
-
|
434
354
|
switch (event.eventType) {
|
435
355
|
case EventTypes.DOWN:
|
436
356
|
case EventTypes.ADDITIONAL_POINTER_DOWN:
|
437
357
|
eventType = TouchEventType.DOWN;
|
438
358
|
break;
|
439
|
-
|
440
359
|
case EventTypes.UP:
|
441
360
|
case EventTypes.ADDITIONAL_POINTER_UP:
|
442
361
|
eventType = TouchEventType.UP;
|
443
362
|
break;
|
444
|
-
|
445
363
|
case EventTypes.MOVE:
|
446
364
|
eventType = TouchEventType.MOVE;
|
447
365
|
break;
|
448
|
-
|
449
366
|
case EventTypes.CANCEL:
|
450
367
|
eventType = TouchEventType.CANCELLED;
|
451
368
|
break;
|
452
|
-
}
|
369
|
+
}
|
370
|
+
|
371
|
+
// Here, when we receive up event, we want to decrease number of touches
|
453
372
|
// That's because we want handler to send information that there's one pointer less
|
454
373
|
// However, we still want this pointer to be present in allTouches array, so that its data can be accessed
|
455
|
-
|
456
|
-
|
457
374
|
let numberOfTouches = all.length;
|
458
|
-
|
459
375
|
if (event.eventType === EventTypes.UP || event.eventType === EventTypes.ADDITIONAL_POINTER_UP) {
|
460
376
|
--numberOfTouches;
|
461
377
|
}
|
462
|
-
|
463
378
|
return {
|
464
379
|
nativeEvent: {
|
465
380
|
handlerTag: this.handlerTag,
|
466
|
-
state: this.
|
381
|
+
state: this.state,
|
467
382
|
eventType: eventType,
|
468
383
|
changedTouches: changed,
|
469
384
|
allTouches: all,
|
@@ -473,17 +388,14 @@ export default class GestureHandler {
|
|
473
388
|
timeStamp: Date.now()
|
474
389
|
};
|
475
390
|
}
|
476
|
-
|
477
391
|
cancelTouches() {
|
478
392
|
const rect = this.delegate.measureView();
|
479
393
|
const all = [];
|
480
394
|
const changed = [];
|
481
|
-
const trackerData = this.tracker.
|
482
|
-
|
395
|
+
const trackerData = this.tracker.trackedPointers;
|
483
396
|
if (trackerData.size === 0) {
|
484
397
|
return;
|
485
398
|
}
|
486
|
-
|
487
399
|
trackerData.forEach((element, key) => {
|
488
400
|
const id = this.tracker.getMappedTouchEventId(key);
|
489
401
|
all.push({
|
@@ -504,7 +416,7 @@ export default class GestureHandler {
|
|
504
416
|
const cancelEvent = {
|
505
417
|
nativeEvent: {
|
506
418
|
handlerTag: this.handlerTag,
|
507
|
-
state: this.
|
419
|
+
state: this.state,
|
508
420
|
eventType: TouchEventType.CANCELLED,
|
509
421
|
changedTouches: changed,
|
510
422
|
allTouches: all,
|
@@ -518,7 +430,6 @@ export default class GestureHandler {
|
|
518
430
|
} = this.propsRef.current;
|
519
431
|
invokeNullableMethod(onGestureHandlerEvent, cancelEvent);
|
520
432
|
}
|
521
|
-
|
522
433
|
transformNativeEvent() {
|
523
434
|
// Those properties are shared by most handlers and if not this method will be overriden
|
524
435
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
@@ -529,47 +440,41 @@ export default class GestureHandler {
|
|
529
440
|
absoluteX: lastCoords.x,
|
530
441
|
absoluteY: lastCoords.y
|
531
442
|
};
|
532
|
-
}
|
443
|
+
}
|
444
|
+
|
445
|
+
//
|
533
446
|
// Handling config
|
534
447
|
//
|
535
448
|
|
536
|
-
|
537
449
|
updateGestureConfig({
|
538
450
|
enabled = true,
|
539
451
|
...props
|
540
452
|
}) {
|
541
|
-
this.
|
453
|
+
this._config = {
|
542
454
|
enabled: enabled,
|
543
455
|
...props
|
544
456
|
};
|
545
457
|
this.enabled = enabled;
|
546
458
|
this.delegate.onEnabledChange(enabled);
|
547
|
-
|
548
459
|
if (this.config.shouldCancelWhenOutside !== undefined) {
|
549
|
-
this.
|
460
|
+
this.shouldCancelWhenOutside = this.config.shouldCancelWhenOutside;
|
550
461
|
}
|
551
|
-
|
552
462
|
this.validateHitSlops();
|
553
|
-
|
554
463
|
if (this.enabled) {
|
555
464
|
return;
|
556
465
|
}
|
557
|
-
|
558
|
-
switch (this.currentState) {
|
466
|
+
switch (this.state) {
|
559
467
|
case State.ACTIVE:
|
560
468
|
this.fail(true);
|
561
469
|
break;
|
562
|
-
|
563
470
|
case State.UNDETERMINED:
|
564
|
-
GestureHandlerOrchestrator.
|
471
|
+
GestureHandlerOrchestrator.instance.removeHandlerFromOrchestrator(this);
|
565
472
|
break;
|
566
|
-
|
567
473
|
default:
|
568
474
|
this.cancel(true);
|
569
475
|
break;
|
570
476
|
}
|
571
477
|
}
|
572
|
-
|
573
478
|
checkCustomActivationCriteria(criterias) {
|
574
479
|
for (const key in this.config) {
|
575
480
|
if (criterias.indexOf(key) >= 0) {
|
@@ -577,34 +482,27 @@ export default class GestureHandler {
|
|
577
482
|
}
|
578
483
|
}
|
579
484
|
}
|
580
|
-
|
581
485
|
validateHitSlops() {
|
582
486
|
if (!this.config.hitSlop) {
|
583
487
|
return;
|
584
488
|
}
|
585
|
-
|
586
489
|
if (this.config.hitSlop.left !== undefined && this.config.hitSlop.right !== undefined && this.config.hitSlop.width !== undefined) {
|
587
490
|
throw new Error('HitSlop Error: Cannot define left, right and width at the same time');
|
588
491
|
}
|
589
|
-
|
590
492
|
if (this.config.hitSlop.width !== undefined && this.config.hitSlop.left === undefined && this.config.hitSlop.right === undefined) {
|
591
493
|
throw new Error('HitSlop Error: When width is defined, either left or right has to be defined');
|
592
494
|
}
|
593
|
-
|
594
495
|
if (this.config.hitSlop.height !== undefined && this.config.hitSlop.top !== undefined && this.config.hitSlop.bottom !== undefined) {
|
595
496
|
throw new Error('HitSlop Error: Cannot define top, bottom and height at the same time');
|
596
497
|
}
|
597
|
-
|
598
498
|
if (this.config.hitSlop.height !== undefined && this.config.hitSlop.top === undefined && this.config.hitSlop.bottom === undefined) {
|
599
499
|
throw new Error('HitSlop Error: When height is defined, either top or bottom has to be defined');
|
600
500
|
}
|
601
501
|
}
|
602
|
-
|
603
502
|
checkHitSlop() {
|
604
503
|
if (!this.config.hitSlop) {
|
605
504
|
return true;
|
606
505
|
}
|
607
|
-
|
608
506
|
const {
|
609
507
|
width,
|
610
508
|
height
|
@@ -613,33 +511,26 @@ export default class GestureHandler {
|
|
613
511
|
let top = 0;
|
614
512
|
let right = width;
|
615
513
|
let bottom = height;
|
616
|
-
|
617
514
|
if (this.config.hitSlop.horizontal !== undefined) {
|
618
515
|
left -= this.config.hitSlop.horizontal;
|
619
516
|
right += this.config.hitSlop.horizontal;
|
620
517
|
}
|
621
|
-
|
622
518
|
if (this.config.hitSlop.vertical !== undefined) {
|
623
519
|
top -= this.config.hitSlop.vertical;
|
624
520
|
bottom += this.config.hitSlop.vertical;
|
625
521
|
}
|
626
|
-
|
627
522
|
if (this.config.hitSlop.left !== undefined) {
|
628
523
|
left = -this.config.hitSlop.left;
|
629
524
|
}
|
630
|
-
|
631
525
|
if (this.config.hitSlop.right !== undefined) {
|
632
526
|
right = width + this.config.hitSlop.right;
|
633
527
|
}
|
634
|
-
|
635
528
|
if (this.config.hitSlop.top !== undefined) {
|
636
529
|
top = -this.config.hitSlop.top;
|
637
530
|
}
|
638
|
-
|
639
531
|
if (this.config.hitSlop.bottom !== undefined) {
|
640
532
|
bottom = width + this.config.hitSlop.bottom;
|
641
533
|
}
|
642
|
-
|
643
534
|
if (this.config.hitSlop.width !== undefined) {
|
644
535
|
if (this.config.hitSlop.left !== undefined) {
|
645
536
|
right = left + this.config.hitSlop.width;
|
@@ -647,7 +538,6 @@ export default class GestureHandler {
|
|
647
538
|
left = right - this.config.hitSlop.width;
|
648
539
|
}
|
649
540
|
}
|
650
|
-
|
651
541
|
if (this.config.hitSlop.height !== undefined) {
|
652
542
|
if (this.config.hitSlop.top !== undefined) {
|
653
543
|
bottom = top + this.config.hitSlop.height;
|
@@ -655,7 +545,6 @@ export default class GestureHandler {
|
|
655
545
|
top = bottom - this.config.hitSlop.height;
|
656
546
|
}
|
657
547
|
}
|
658
|
-
|
659
548
|
const rect = this.delegate.measureView();
|
660
549
|
const {
|
661
550
|
x,
|
@@ -665,107 +554,119 @@ export default class GestureHandler {
|
|
665
554
|
const offsetY = y - rect.pageY;
|
666
555
|
return offsetX >= left && offsetX <= right && offsetY >= top && offsetY <= bottom;
|
667
556
|
}
|
668
|
-
|
669
557
|
isButtonInConfig(mouseButton) {
|
670
558
|
return !mouseButton || !this.config.mouseButton && mouseButton === MouseButton.LEFT || this.config.mouseButton && mouseButton & this.config.mouseButton;
|
671
559
|
}
|
672
|
-
|
673
560
|
resetConfig() {}
|
674
|
-
|
675
561
|
onDestroy() {
|
676
562
|
this.delegate.destroy(this.config);
|
677
|
-
}
|
563
|
+
}
|
564
|
+
|
565
|
+
//
|
678
566
|
// Getters and setters
|
679
567
|
//
|
680
568
|
|
681
|
-
|
682
|
-
|
683
|
-
return this.handlerTag;
|
569
|
+
get handlerTag() {
|
570
|
+
return this._handlerTag;
|
684
571
|
}
|
685
|
-
|
686
|
-
|
687
|
-
this.handlerTag = tag;
|
572
|
+
set handlerTag(value) {
|
573
|
+
this._handlerTag = value;
|
688
574
|
}
|
689
|
-
|
690
|
-
|
691
|
-
return this.config;
|
575
|
+
get config() {
|
576
|
+
return this._config;
|
692
577
|
}
|
693
|
-
|
694
|
-
|
695
|
-
return this.delegate;
|
578
|
+
get delegate() {
|
579
|
+
return this._delegate;
|
696
580
|
}
|
697
|
-
|
698
|
-
|
699
|
-
return this.tracker;
|
581
|
+
get tracker() {
|
582
|
+
return this._tracker;
|
700
583
|
}
|
701
|
-
|
702
|
-
|
703
|
-
return this.tracker.getTrackedPointersID();
|
584
|
+
get state() {
|
585
|
+
return this._state;
|
704
586
|
}
|
705
|
-
|
706
|
-
|
707
|
-
return this.currentState;
|
587
|
+
set state(value) {
|
588
|
+
this._state = value;
|
708
589
|
}
|
709
|
-
|
710
|
-
|
711
|
-
return this.enabled;
|
590
|
+
get shouldCancelWhenOutside() {
|
591
|
+
return this._shouldCancelWhenOutside;
|
712
592
|
}
|
713
|
-
|
714
|
-
|
715
|
-
return this.currentState === State.END || this.currentState === State.FAILED || this.currentState === State.CANCELLED;
|
593
|
+
set shouldCancelWhenOutside(value) {
|
594
|
+
this._shouldCancelWhenOutside = value;
|
716
595
|
}
|
717
|
-
|
718
|
-
|
719
|
-
this.shouldCancelWhenOutside = shouldCancel;
|
596
|
+
get enabled() {
|
597
|
+
return this._enabled;
|
720
598
|
}
|
721
|
-
|
722
|
-
|
723
|
-
return this.shouldCancelWhenOutside;
|
599
|
+
set enabled(value) {
|
600
|
+
this._enabled = value;
|
724
601
|
}
|
725
|
-
|
726
|
-
|
727
|
-
|
602
|
+
get pointerType() {
|
603
|
+
return this._pointerType;
|
604
|
+
}
|
605
|
+
set pointerType(value) {
|
606
|
+
this._pointerType = value;
|
607
|
+
}
|
608
|
+
get active() {
|
609
|
+
return this._active;
|
610
|
+
}
|
611
|
+
set active(value) {
|
612
|
+
this._active = value;
|
613
|
+
}
|
614
|
+
get awaiting() {
|
615
|
+
return this._awaiting;
|
616
|
+
}
|
617
|
+
set awaiting(value) {
|
618
|
+
this._awaiting = value;
|
619
|
+
}
|
620
|
+
get activationIndex() {
|
621
|
+
return this._activationIndex;
|
622
|
+
}
|
623
|
+
set activationIndex(value) {
|
624
|
+
this._activationIndex = value;
|
625
|
+
}
|
626
|
+
get shouldResetProgress() {
|
627
|
+
return this._shouldResetProgress;
|
628
|
+
}
|
629
|
+
set shouldResetProgress(value) {
|
630
|
+
this._shouldResetProgress = value;
|
631
|
+
}
|
632
|
+
getTrackedPointersID() {
|
633
|
+
return this.tracker.trackedPointersIDs;
|
634
|
+
}
|
635
|
+
isFinished() {
|
636
|
+
return this.state === State.END || this.state === State.FAILED || this.state === State.CANCELLED;
|
728
637
|
}
|
729
|
-
|
730
638
|
}
|
731
|
-
|
732
639
|
function invokeNullableMethod(method, event) {
|
733
640
|
if (!method) {
|
734
641
|
return;
|
735
642
|
}
|
736
|
-
|
737
643
|
if (typeof method === 'function') {
|
738
644
|
method(event);
|
739
645
|
return;
|
740
646
|
}
|
741
|
-
|
742
647
|
if ('__getHandler' in method && typeof method.__getHandler === 'function') {
|
743
648
|
const handler = method.__getHandler();
|
744
|
-
|
745
649
|
invokeNullableMethod(handler, event);
|
746
650
|
return;
|
747
651
|
}
|
748
|
-
|
749
652
|
if (!('__nodeConfig' in method)) {
|
750
653
|
return;
|
751
654
|
}
|
752
|
-
|
753
655
|
const {
|
754
656
|
argMapping
|
755
657
|
} = method.__nodeConfig;
|
756
|
-
|
757
658
|
if (!Array.isArray(argMapping)) {
|
758
659
|
return;
|
759
660
|
}
|
760
|
-
|
761
661
|
for (const [index, [key, value]] of argMapping.entries()) {
|
762
662
|
if (!(key in event.nativeEvent)) {
|
763
663
|
continue;
|
764
|
-
}
|
765
|
-
|
664
|
+
}
|
766
665
|
|
767
|
-
|
666
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
667
|
+
const nativeValue = event.nativeEvent[key];
|
768
668
|
|
669
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
769
670
|
if (value !== null && value !== void 0 && value.setValue) {
|
770
671
|
// Reanimated API
|
771
672
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
@@ -775,7 +676,6 @@ function invokeNullableMethod(method, event) {
|
|
775
676
|
method.__nodeConfig.argMapping[index] = [key, nativeValue];
|
776
677
|
}
|
777
678
|
}
|
778
|
-
|
779
679
|
return;
|
780
680
|
}
|
781
681
|
//# sourceMappingURL=GestureHandler.js.map
|