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