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