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
@@ -4,14 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.PanGesture = void 0;
|
7
|
+
|
7
8
|
var _gesture = require("./gesture");
|
8
|
-
|
9
|
-
function
|
10
|
-
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
11
12
|
function changeEventCalculator(current, previous) {
|
12
13
|
'worklet';
|
13
14
|
|
14
15
|
let changePayload;
|
16
|
+
|
15
17
|
if (previous === undefined) {
|
16
18
|
changePayload = {
|
17
19
|
changeX: current.translationX,
|
@@ -23,23 +25,27 @@ function changeEventCalculator(current, previous) {
|
|
23
25
|
changeY: current.translationY - previous.translationY
|
24
26
|
};
|
25
27
|
}
|
26
|
-
|
27
|
-
|
28
|
+
|
29
|
+
return { ...current,
|
28
30
|
...changePayload
|
29
31
|
};
|
30
32
|
}
|
33
|
+
|
31
34
|
class PanGesture extends _gesture.ContinousBaseGesture {
|
32
35
|
constructor() {
|
33
36
|
super();
|
37
|
+
|
34
38
|
_defineProperty(this, "config", {});
|
39
|
+
|
35
40
|
this.handlerName = 'PanGestureHandler';
|
36
41
|
}
|
37
|
-
|
38
42
|
/**
|
39
43
|
* Range along Y axis (in points) where fingers travels without activation of gesture.
|
40
44
|
* @param offset
|
41
45
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetyvalue-number--number
|
42
46
|
*/
|
47
|
+
|
48
|
+
|
43
49
|
activeOffsetY(offset) {
|
44
50
|
if (Array.isArray(offset)) {
|
45
51
|
this.config.activeOffsetYStart = offset[0];
|
@@ -49,14 +55,16 @@ class PanGesture extends _gesture.ContinousBaseGesture {
|
|
49
55
|
} else {
|
50
56
|
this.config.activeOffsetYEnd = offset;
|
51
57
|
}
|
58
|
+
|
52
59
|
return this;
|
53
60
|
}
|
54
|
-
|
55
61
|
/**
|
56
62
|
* Range along X axis (in points) where fingers travels without activation of gesture.
|
57
63
|
* @param offset
|
58
64
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetxvalue-number--number
|
59
65
|
*/
|
66
|
+
|
67
|
+
|
60
68
|
activeOffsetX(offset) {
|
61
69
|
if (Array.isArray(offset)) {
|
62
70
|
this.config.activeOffsetXStart = offset[0];
|
@@ -66,14 +74,16 @@ class PanGesture extends _gesture.ContinousBaseGesture {
|
|
66
74
|
} else {
|
67
75
|
this.config.activeOffsetXEnd = offset;
|
68
76
|
}
|
77
|
+
|
69
78
|
return this;
|
70
79
|
}
|
71
|
-
|
72
80
|
/**
|
73
81
|
* When the finger moves outside this range (in points) along Y axis and gesture hasn't yet activated it will fail recognizing the gesture.
|
74
82
|
* @param offset
|
75
83
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetyvalue-number--number
|
76
84
|
*/
|
85
|
+
|
86
|
+
|
77
87
|
failOffsetY(offset) {
|
78
88
|
if (Array.isArray(offset)) {
|
79
89
|
this.config.failOffsetYStart = offset[0];
|
@@ -83,14 +93,16 @@ class PanGesture extends _gesture.ContinousBaseGesture {
|
|
83
93
|
} else {
|
84
94
|
this.config.failOffsetYEnd = offset;
|
85
95
|
}
|
96
|
+
|
86
97
|
return this;
|
87
98
|
}
|
88
|
-
|
89
99
|
/**
|
90
100
|
* When the finger moves outside this range (in points) along X axis and gesture hasn't yet activated it will fail recognizing the gesture.
|
91
101
|
* @param offset
|
92
102
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetxvalue-number--number
|
93
103
|
*/
|
104
|
+
|
105
|
+
|
94
106
|
failOffsetX(offset) {
|
95
107
|
if (Array.isArray(offset)) {
|
96
108
|
this.config.failOffsetXStart = offset[0];
|
@@ -100,101 +112,114 @@ class PanGesture extends _gesture.ContinousBaseGesture {
|
|
100
112
|
} else {
|
101
113
|
this.config.failOffsetXEnd = offset;
|
102
114
|
}
|
115
|
+
|
103
116
|
return this;
|
104
117
|
}
|
105
|
-
|
106
118
|
/**
|
107
119
|
* A number of fingers that is required to be placed before gesture can activate. Should be a higher or equal to 0 integer.
|
108
120
|
* @param minPointers
|
109
121
|
*/
|
122
|
+
|
123
|
+
|
110
124
|
minPointers(minPointers) {
|
111
125
|
this.config.minPointers = minPointers;
|
112
126
|
return this;
|
113
127
|
}
|
114
|
-
|
115
128
|
/**
|
116
129
|
* When the given number of fingers is placed on the screen and gesture hasn't yet activated it will fail recognizing the gesture.
|
117
130
|
* Should be a higher or equal to 0 integer.
|
118
131
|
* @param maxPointers
|
119
132
|
*/
|
133
|
+
|
134
|
+
|
120
135
|
maxPointers(maxPointers) {
|
121
136
|
this.config.maxPointers = maxPointers;
|
122
137
|
return this;
|
123
138
|
}
|
124
|
-
|
125
139
|
/**
|
126
140
|
* Minimum distance the finger (or multiple finger) need to travel before the gesture activates.
|
127
141
|
* Expressed in points.
|
128
142
|
* @param distance
|
129
143
|
*/
|
144
|
+
|
145
|
+
|
130
146
|
minDistance(distance) {
|
131
147
|
this.config.minDist = distance;
|
132
148
|
return this;
|
133
149
|
}
|
134
|
-
|
135
150
|
/**
|
136
151
|
* Minimum velocity the finger has to reach in order to activate handler.
|
137
152
|
* @param velocity
|
138
153
|
*/
|
154
|
+
|
155
|
+
|
139
156
|
minVelocity(velocity) {
|
140
157
|
this.config.minVelocity = velocity;
|
141
158
|
return this;
|
142
159
|
}
|
143
|
-
|
144
160
|
/**
|
145
161
|
* Minimum velocity along X axis the finger has to reach in order to activate handler.
|
146
162
|
* @param velocity
|
147
163
|
*/
|
164
|
+
|
165
|
+
|
148
166
|
minVelocityX(velocity) {
|
149
167
|
this.config.minVelocityX = velocity;
|
150
168
|
return this;
|
151
169
|
}
|
152
|
-
|
153
170
|
/**
|
154
171
|
* Minimum velocity along Y axis the finger has to reach in order to activate handler.
|
155
172
|
* @param velocity
|
156
173
|
*/
|
174
|
+
|
175
|
+
|
157
176
|
minVelocityY(velocity) {
|
158
177
|
this.config.minVelocityY = velocity;
|
159
178
|
return this;
|
160
179
|
}
|
161
|
-
|
162
180
|
/**
|
163
181
|
* #### Android only
|
164
182
|
* Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen).
|
165
183
|
* This modifier allows that behavior to be changed to the one that is default on iOS - the averaged position of all active pointers will be used to calculate the translation values.
|
166
184
|
* @param value
|
167
185
|
*/
|
186
|
+
|
187
|
+
|
168
188
|
averageTouches(value) {
|
169
189
|
this.config.avgTouches = value;
|
170
190
|
return this;
|
171
191
|
}
|
172
|
-
|
173
192
|
/**
|
174
193
|
* #### iOS only
|
175
194
|
* Enables two-finger gestures on supported devices, for example iPads with trackpads.
|
176
195
|
* @param value
|
177
196
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#enabletrackpadtwofingergesturevalue-boolean-ios-only
|
178
197
|
*/
|
198
|
+
|
199
|
+
|
179
200
|
enableTrackpadTwoFingerGesture(value) {
|
180
201
|
this.config.enableTrackpadTwoFingerGesture = value;
|
181
202
|
return this;
|
182
203
|
}
|
183
|
-
|
184
204
|
/**
|
185
205
|
* Duration in milliseconds of the LongPress gesture before Pan is allowed to activate.
|
186
206
|
* @param duration
|
187
207
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#activateafterlongpressduration-number
|
188
208
|
*/
|
209
|
+
|
210
|
+
|
189
211
|
activateAfterLongPress(duration) {
|
190
212
|
this.config.activateAfterLongPress = duration;
|
191
213
|
return this;
|
192
214
|
}
|
215
|
+
|
193
216
|
onChange(callback) {
|
194
217
|
// @ts-ignore TS being overprotective, PanGestureHandlerEventPayload is Record
|
195
218
|
this.handlers.changeEventCalculator = changeEventCalculator;
|
196
219
|
return super.onChange(callback);
|
197
220
|
}
|
221
|
+
|
198
222
|
}
|
223
|
+
|
199
224
|
exports.PanGesture = PanGesture;
|
200
225
|
//# sourceMappingURL=panGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_gesture","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","changeEventCalculator","current","previous","changePayload","undefined","changeX","translationX","changeY","translationY","PanGesture","ContinousBaseGesture","constructor","handlerName","activeOffsetY","offset","Array","isArray","config","activeOffsetYStart","activeOffsetYEnd","activeOffsetX","activeOffsetXStart","activeOffsetXEnd","failOffsetY","failOffsetYStart","failOffsetYEnd","failOffsetX","failOffsetXStart","failOffsetXEnd","minPointers","maxPointers","minDistance","distance","minDist","minVelocity","velocity","minVelocityX","minVelocityY","averageTouches","avgTouches","enableTrackpadTwoFingerGesture","activateAfterLongPress","duration","onChange","callback","handlers","exports"],"sources":["panGesture.ts"],"sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\nimport { PanGestureConfig } from '../PanGestureHandler';\nimport type { PanGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\n\nexport type PanGestureChangeEventPayload = {\n changeX: number;\n changeY: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<PanGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<PanGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: PanGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n changeX: current.translationX,\n changeY: current.translationY,\n };\n } else {\n changePayload = {\n changeX: current.translationX - previous.translationX,\n changeY: current.translationY - previous.translationY,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class PanGesture extends ContinousBaseGesture<\n PanGestureHandlerEventPayload,\n PanGestureChangeEventPayload\n> {\n public config: BaseGestureConfig & PanGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'PanGestureHandler';\n }\n\n /**\n * Range along Y axis (in points) where fingers travels without activation of gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetyvalue-number--number\n */\n activeOffsetY(\n offset: number | [activeOffsetYStart: number, activeOffsetYEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetYStart = offset[0];\n this.config.activeOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetYStart = offset;\n } else {\n this.config.activeOffsetYEnd = offset;\n }\n return this;\n }\n\n /**\n * Range along X axis (in points) where fingers travels without activation of gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetxvalue-number--number\n */\n activeOffsetX(\n offset: number | [activeOffsetXStart: number, activeOffsetXEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetXStart = offset[0];\n this.config.activeOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetXStart = offset;\n } else {\n this.config.activeOffsetXEnd = offset;\n }\n return this;\n }\n\n /**\n * When the finger moves outside this range (in points) along Y axis and gesture hasn't yet activated it will fail recognizing the gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetyvalue-number--number\n */\n failOffsetY(\n offset: number | [failOffsetYStart: number, failOffsetYEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.failOffsetYStart = offset[0];\n this.config.failOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetYStart = offset;\n } else {\n this.config.failOffsetYEnd = offset;\n }\n return this;\n }\n\n /**\n * When the finger moves outside this range (in points) along X axis and gesture hasn't yet activated it will fail recognizing the gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetxvalue-number--number\n */\n failOffsetX(\n offset: number | [failOffsetXStart: number, failOffsetXEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.failOffsetXStart = offset[0];\n this.config.failOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetXStart = offset;\n } else {\n this.config.failOffsetXEnd = offset;\n }\n return this;\n }\n\n /**\n * A number of fingers that is required to be placed before gesture can activate. Should be a higher or equal to 0 integer.\n * @param minPointers\n */\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n /**\n * When the given number of fingers is placed on the screen and gesture hasn't yet activated it will fail recognizing the gesture.\n * Should be a higher or equal to 0 integer.\n * @param maxPointers\n */\n maxPointers(maxPointers: number) {\n this.config.maxPointers = maxPointers;\n return this;\n }\n\n /**\n * Minimum distance the finger (or multiple finger) need to travel before the gesture activates.\n * Expressed in points.\n * @param distance\n */\n minDistance(distance: number) {\n this.config.minDist = distance;\n return this;\n }\n\n /**\n * Minimum velocity the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocity(velocity: number) {\n this.config.minVelocity = velocity;\n return this;\n }\n\n /**\n * Minimum velocity along X axis the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocityX(velocity: number) {\n this.config.minVelocityX = velocity;\n return this;\n }\n\n /**\n * Minimum velocity along Y axis the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocityY(velocity: number) {\n this.config.minVelocityY = velocity;\n return this;\n }\n\n /**\n * #### Android only\n * Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen).\n * This modifier allows that behavior to be changed to the one that is default on iOS - the averaged position of all active pointers will be used to calculate the translation values.\n * @param value\n */\n averageTouches(value: boolean) {\n this.config.avgTouches = value;\n return this;\n }\n\n /**\n * #### iOS only\n * Enables two-finger gestures on supported devices, for example iPads with trackpads.\n * @param value\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#enabletrackpadtwofingergesturevalue-boolean-ios-only\n */\n enableTrackpadTwoFingerGesture(value: boolean) {\n this.config.enableTrackpadTwoFingerGesture = value;\n return this;\n }\n\n /**\n * Duration in milliseconds of the LongPress gesture before Pan is allowed to activate.\n * @param duration\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#activateafterlongpressduration-number\n */\n activateAfterLongPress(duration: number) {\n this.config.activateAfterLongPress = duration;\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n PanGestureHandlerEventPayload & PanGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, PanGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type PanGestureType = InstanceType<typeof PanGesture>;\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAoE,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAA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,KAAc,EAAE;IAC7B,IAAI,CAAC6B,MAAM,CAACsB,UAAU,GAAGnD,KAAK;IAC9B,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEoD,8BAA8BA,CAACpD,KAAc,EAAE;IAC7C,IAAI,CAAC6B,MAAM,CAACuB,8BAA8B,GAAGpD,KAAK;IAClD,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEqD,sBAAsBA,CAACC,QAAgB,EAAE;IACvC,IAAI,CAACzB,MAAM,CAACwB,sBAAsB,GAAGC,QAAQ;IAC7C,OAAO,IAAI;EACb;EAEAC,QAAQA,CACNC,QAIS,EACT;IACA;IACA,IAAI,CAACC,QAAQ,CAAC7C,qBAAqB,GAAGA,qBAAqB;IAC3D,OAAO,KAAK,CAAC2C,QAAQ,CAACC,QAAQ,CAAC;EACjC;AACF;AAACE,OAAA,CAAArC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
1
|
+
{"version":3,"sources":["panGesture.ts"],"names":["changeEventCalculator","current","previous","changePayload","undefined","changeX","translationX","changeY","translationY","PanGesture","ContinousBaseGesture","constructor","handlerName","activeOffsetY","offset","Array","isArray","config","activeOffsetYStart","activeOffsetYEnd","activeOffsetX","activeOffsetXStart","activeOffsetXEnd","failOffsetY","failOffsetYStart","failOffsetYEnd","failOffsetX","failOffsetXStart","failOffsetXEnd","minPointers","maxPointers","minDistance","distance","minDist","minVelocity","velocity","minVelocityX","minVelocityY","averageTouches","value","avgTouches","enableTrackpadTwoFingerGesture","activateAfterLongPress","duration","onChange","callback","handlers"],"mappings":";;;;;;;AAAA;;;;AAUA,SAASA,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,OAAO,EAAEJ,OAAO,CAACK,YADH;AAEdC,MAAAA,OAAO,EAAEN,OAAO,CAACO;AA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A,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKf,MAAL,CAAYgB,OAAZ,GAAsBD,QAAtB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;;;AACEE,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKlB,MAAL,CAAYiB,WAAZ,GAA0BC,QAA1B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,YAAY,CAACD,QAAD,EAAmB;AAC7B,SAAKlB,MAAL,CAAYmB,YAAZ,GAA2BD,QAA3B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;;;AACEE,EAAAA,YAAY,CAACF,QAAD,EAAmB;AAC7B,SAAKlB,MAAL,CAAYoB,YAAZ,GAA2BF,QAA3B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACEG,EAAAA,cAAc,CAACC,KAAD,EAAiB;AAC7B,SAAKtB,MAAL,CAAYuB,UAAZ,GAAyBD,KAAzB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACEE,EAAAA,8BAA8B,CAACF,KAAD,EAAiB;AAC7C,SAAKtB,MAAL,CAAYwB,8BAAZ,GAA6CF,KAA7C;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEG,EAAAA,sBAAsB,CAACC,QAAD,EAAmB;AACvC,SAAK1B,MAAL,CAAYyB,sBAAZ,GAAqCC,QAArC;AACA,WAAO,IAAP;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAc9C,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAM4C,QAAN,CAAeC,QAAf,CAAP;AACD;;AAvLD","sourcesContent":["import { BaseGestureConfig, ContinousBaseGesture } from './gesture';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\nimport { PanGestureConfig } from '../PanGestureHandler';\nimport type { PanGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\n\nexport type PanGestureChangeEventPayload = {\n changeX: number;\n changeY: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<PanGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<PanGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: PanGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n changeX: current.translationX,\n changeY: current.translationY,\n };\n } else {\n changePayload = {\n changeX: current.translationX - previous.translationX,\n changeY: current.translationY - previous.translationY,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class PanGesture extends ContinousBaseGesture<\n PanGestureHandlerEventPayload,\n PanGestureChangeEventPayload\n> {\n public config: BaseGestureConfig & PanGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'PanGestureHandler';\n }\n\n /**\n * Range along Y axis (in points) where fingers travels without activation of gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetyvalue-number--number\n */\n activeOffsetY(\n offset: number | [activeOffsetYStart: number, activeOffsetYEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetYStart = offset[0];\n this.config.activeOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetYStart = offset;\n } else {\n this.config.activeOffsetYEnd = offset;\n }\n return this;\n }\n\n /**\n * Range along X axis (in points) where fingers travels without activation of gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetxvalue-number--number\n */\n activeOffsetX(\n offset: number | [activeOffsetXStart: number, activeOffsetXEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.activeOffsetXStart = offset[0];\n this.config.activeOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.activeOffsetXStart = offset;\n } else {\n this.config.activeOffsetXEnd = offset;\n }\n return this;\n }\n\n /**\n * When the finger moves outside this range (in points) along Y axis and gesture hasn't yet activated it will fail recognizing the gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetyvalue-number--number\n */\n failOffsetY(\n offset: number | [failOffsetYStart: number, failOffsetYEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.failOffsetYStart = offset[0];\n this.config.failOffsetYEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetYStart = offset;\n } else {\n this.config.failOffsetYEnd = offset;\n }\n return this;\n }\n\n /**\n * When the finger moves outside this range (in points) along X axis and gesture hasn't yet activated it will fail recognizing the gesture.\n * @param offset\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetxvalue-number--number\n */\n failOffsetX(\n offset: number | [failOffsetXStart: number, failOffsetXEnd: number]\n ) {\n if (Array.isArray(offset)) {\n this.config.failOffsetXStart = offset[0];\n this.config.failOffsetXEnd = offset[1];\n } else if (offset < 0) {\n this.config.failOffsetXStart = offset;\n } else {\n this.config.failOffsetXEnd = offset;\n }\n return this;\n }\n\n /**\n * A number of fingers that is required to be placed before gesture can activate. Should be a higher or equal to 0 integer.\n * @param minPointers\n */\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n /**\n * When the given number of fingers is placed on the screen and gesture hasn't yet activated it will fail recognizing the gesture.\n * Should be a higher or equal to 0 integer.\n * @param maxPointers\n */\n maxPointers(maxPointers: number) {\n this.config.maxPointers = maxPointers;\n return this;\n }\n\n /**\n * Minimum distance the finger (or multiple finger) need to travel before the gesture activates.\n * Expressed in points.\n * @param distance\n */\n minDistance(distance: number) {\n this.config.minDist = distance;\n return this;\n }\n\n /**\n * Minimum velocity the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocity(velocity: number) {\n this.config.minVelocity = velocity;\n return this;\n }\n\n /**\n * Minimum velocity along X axis the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocityX(velocity: number) {\n this.config.minVelocityX = velocity;\n return this;\n }\n\n /**\n * Minimum velocity along Y axis the finger has to reach in order to activate handler.\n * @param velocity\n */\n minVelocityY(velocity: number) {\n this.config.minVelocityY = velocity;\n return this;\n }\n\n /**\n * #### Android only\n * Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen).\n * This modifier allows that behavior to be changed to the one that is default on iOS - the averaged position of all active pointers will be used to calculate the translation values.\n * @param value\n */\n averageTouches(value: boolean) {\n this.config.avgTouches = value;\n return this;\n }\n\n /**\n * #### iOS only\n * Enables two-finger gestures on supported devices, for example iPads with trackpads.\n * @param value\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#enabletrackpadtwofingergesturevalue-boolean-ios-only\n */\n enableTrackpadTwoFingerGesture(value: boolean) {\n this.config.enableTrackpadTwoFingerGesture = value;\n return this;\n }\n\n /**\n * Duration in milliseconds of the LongPress gesture before Pan is allowed to activate.\n * @param duration\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#activateafterlongpressduration-number\n */\n activateAfterLongPress(duration: number) {\n this.config.activateAfterLongPress = duration;\n return this;\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n PanGestureHandlerEventPayload & PanGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, PanGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type PanGestureType = InstanceType<typeof PanGesture>;\n"]}
|
@@ -4,11 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.PinchGesture = void 0;
|
7
|
+
|
7
8
|
var _gesture = require("./gesture");
|
9
|
+
|
8
10
|
function changeEventCalculator(current, previous) {
|
9
11
|
'worklet';
|
10
12
|
|
11
13
|
let changePayload;
|
14
|
+
|
12
15
|
if (previous === undefined) {
|
13
16
|
changePayload = {
|
14
17
|
scaleChange: current.scale
|
@@ -18,21 +21,25 @@ function changeEventCalculator(current, previous) {
|
|
18
21
|
scaleChange: current.scale / previous.scale
|
19
22
|
};
|
20
23
|
}
|
21
|
-
|
22
|
-
|
24
|
+
|
25
|
+
return { ...current,
|
23
26
|
...changePayload
|
24
27
|
};
|
25
28
|
}
|
29
|
+
|
26
30
|
class PinchGesture extends _gesture.ContinousBaseGesture {
|
27
31
|
constructor() {
|
28
32
|
super();
|
29
33
|
this.handlerName = 'PinchGestureHandler';
|
30
34
|
}
|
35
|
+
|
31
36
|
onChange(callback) {
|
32
37
|
// @ts-ignore TS being overprotective, PinchGestureHandlerEventPayload is Record
|
33
38
|
this.handlers.changeEventCalculator = changeEventCalculator;
|
34
39
|
return super.onChange(callback);
|
35
40
|
}
|
41
|
+
|
36
42
|
}
|
43
|
+
|
37
44
|
exports.PinchGesture = PinchGesture;
|
38
45
|
//# sourceMappingURL=pinchGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["pinchGesture.ts"],"names":["changeEventCalculator","current","previous","changePayload","undefined","scaleChange","scale","PinchGesture","ContinousBaseGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":";;;;;;;AAAA;;AAQA,SAASA,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,WAAW,EAAEJ,OAAO,CAACK;AADP,KAAhB;AAGD,GAJD,MAIO;AACLH,IAAAA,aAAa,GAAG;AACdE,MAAAA,WAAW,EAAEJ,OAAO,CAACK,KAAR,GAAgBJ,QAAQ,CAACI;AADxB,KAAhB;AAGD;;AAED,SAAO,EAAE,GAAGL,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAEM,MAAMI,YAAN,SAA2BC,6BAA3B,CAGL;AACAC,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,qBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAcb,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMW,QAAN,CAAeC,QAAf,CAAP;AACD;;AAjBD","sourcesContent":["import { ContinousBaseGesture } from './gesture';\nimport type { PinchGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\n\nexport type PinchGestureChangeEventPayload = {\n scaleChange: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<PinchGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<PinchGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: PinchGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n scaleChange: current.scale,\n };\n } else {\n changePayload = {\n scaleChange: current.scale / previous.scale,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class PinchGesture extends ContinousBaseGesture<\n PinchGestureHandlerEventPayload,\n PinchGestureChangeEventPayload\n> {\n constructor() {\n super();\n\n this.handlerName = 'PinchGestureHandler';\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n PinchGestureHandlerEventPayload & PinchGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, PinchGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type PinchGestureType = InstanceType<typeof PinchGesture>;\n"]}
|
@@ -4,9 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.Reanimated = void 0;
|
7
|
+
|
7
8
|
var _utils = require("../../utils");
|
9
|
+
|
8
10
|
var _Reanimated;
|
9
|
-
|
11
|
+
|
12
|
+
let Reanimated;
|
13
|
+
exports.Reanimated = Reanimated;
|
14
|
+
|
10
15
|
try {
|
11
16
|
exports.Reanimated = Reanimated = require('react-native-reanimated');
|
12
17
|
} catch (e) {
|
@@ -14,11 +19,13 @@ try {
|
|
14
19
|
// @ts-ignore TS demands the variable to be initialized
|
15
20
|
exports.Reanimated = Reanimated = undefined;
|
16
21
|
}
|
22
|
+
|
17
23
|
if (!((_Reanimated = Reanimated) !== null && _Reanimated !== void 0 && _Reanimated.useSharedValue)) {
|
18
24
|
// @ts-ignore Make sure the loaded module is actually Reanimated, if it's not
|
19
25
|
// reset the module to undefined so we can fallback to the default implementation
|
20
26
|
exports.Reanimated = Reanimated = undefined;
|
21
27
|
}
|
28
|
+
|
22
29
|
if (Reanimated !== undefined && !Reanimated.setGestureState) {
|
23
30
|
// The loaded module is Reanimated but it doesn't have the setGestureState defined
|
24
31
|
Reanimated.setGestureState = () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["reanimatedWrapper.ts"],"names":["Reanimated","require","e","undefined","useSharedValue","setGestureState","console","warn"],"mappings":";;;;;;;AAKA;;;;AAMA,IAAIA,UAAJ;;;AAoBA,IAAI;AACF,uBAAAA,UAAU,GAAGC,OAAO,CAAC,yBAAD,CAApB;AACD,CAFD,CAEE,OAAOC,CAAP,EAAU;AACV;AACA;AACA,uBAAAF,UAAU,GAAGG,SAAb;AACD;;AAED,IAAI,iBAACH,UAAD,wCAAC,YAAYI,cAAb,CAAJ,EAAiC;AAC/B;AACA;AACA,uBAAAJ,UAAU,GAAGG,SAAb;AACD;;AAED,IAAIH,UAAU,KAAKG,SAAf,IAA4B,CAACH,UAAU,CAACK,eAA5C,EAA6D;AAC3D;AACAL,EAAAA,UAAU,CAACK,eAAX,GAA6B,MAAM;AACjC;;AACAC,IAAAA,OAAO,CAACC,IAAR,CACE,uBACE,gGADF,CADF;AAKD,GAPD;AAQD","sourcesContent":["import { ComponentClass } from 'react';\nimport {\n GestureUpdateEvent,\n GestureStateChangeEvent,\n} from '../gestureHandlerCommon';\nimport { tagMessage } from '../../utils';\n\nexport interface SharedValue<T> {\n value: T;\n}\n\nlet Reanimated:\n | {\n default: {\n // Slightly modified definition copied from 'react-native-reanimated'\n // eslint-disable-next-line @typescript-eslint/ban-types\n createAnimatedComponent<P extends object>(\n component: ComponentClass<P>,\n options?: unknown\n ): ComponentClass<P>;\n };\n useEvent: (\n callback: (event: GestureUpdateEvent | GestureStateChangeEvent) => void,\n events: string[],\n rebuild: boolean\n ) => unknown;\n useSharedValue: <T>(value: T) => SharedValue<T>;\n setGestureState: (handlerTag: number, newState: number) => void;\n }\n | undefined;\n\ntry {\n Reanimated = require('react-native-reanimated');\n} catch (e) {\n // When 'react-native-reanimated' is not available we want to quietly continue\n // @ts-ignore TS demands the variable to be initialized\n Reanimated = undefined;\n}\n\nif (!Reanimated?.useSharedValue) {\n // @ts-ignore Make sure the loaded module is actually Reanimated, if it's not\n // reset the module to undefined so we can fallback to the default implementation\n Reanimated = undefined;\n}\n\nif (Reanimated !== undefined && !Reanimated.setGestureState) {\n // The loaded module is Reanimated but it doesn't have the setGestureState defined\n Reanimated.setGestureState = () => {\n 'worklet';\n console.warn(\n tagMessage(\n 'Please use newer version of react-native-reanimated in order to control state of the gestures.'\n )\n );\n };\n}\n\nexport { Reanimated };\n"]}
|
@@ -4,11 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.RotationGesture = void 0;
|
7
|
+
|
7
8
|
var _gesture = require("./gesture");
|
9
|
+
|
8
10
|
function changeEventCalculator(current, previous) {
|
9
11
|
'worklet';
|
10
12
|
|
11
13
|
let changePayload;
|
14
|
+
|
12
15
|
if (previous === undefined) {
|
13
16
|
changePayload = {
|
14
17
|
rotationChange: current.rotation
|
@@ -18,21 +21,25 @@ function changeEventCalculator(current, previous) {
|
|
18
21
|
rotationChange: current.rotation - previous.rotation
|
19
22
|
};
|
20
23
|
}
|
21
|
-
|
22
|
-
|
24
|
+
|
25
|
+
return { ...current,
|
23
26
|
...changePayload
|
24
27
|
};
|
25
28
|
}
|
29
|
+
|
26
30
|
class RotationGesture extends _gesture.ContinousBaseGesture {
|
27
31
|
constructor() {
|
28
32
|
super();
|
29
33
|
this.handlerName = 'RotationGestureHandler';
|
30
34
|
}
|
35
|
+
|
31
36
|
onChange(callback) {
|
32
37
|
// @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record
|
33
38
|
this.handlers.changeEventCalculator = changeEventCalculator;
|
34
39
|
return super.onChange(callback);
|
35
40
|
}
|
41
|
+
|
36
42
|
}
|
43
|
+
|
37
44
|
exports.RotationGesture = RotationGesture;
|
38
45
|
//# sourceMappingURL=rotationGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["rotationGesture.ts"],"names":["changeEventCalculator","current","previous","changePayload","undefined","rotationChange","rotation","RotationGesture","ContinousBaseGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":";;;;;;;AAAA;;AAQA,SAASA,qBAAT,CACEC,OADF,EAEEC,QAFF,EAGE;AACA;;AACA,MAAIC,aAAJ;;AACA,MAAID,QAAQ,KAAKE,SAAjB,EAA4B;AAC1BD,IAAAA,aAAa,GAAG;AACdE,MAAAA,cAAc,EAAEJ,OAAO,CAACK;AADV,KAAhB;AAGD,GAJD,MAIO;AACLH,IAAAA,aAAa,GAAG;AACdE,MAAAA,cAAc,EAAEJ,OAAO,CAACK,QAAR,GAAmBJ,QAAQ,CAACI;AAD9B,KAAhB;AAGD;;AAED,SAAO,EAAE,GAAGL,OAAL;AAAc,OAAGE;AAAjB,GAAP;AACD;;AAEM,MAAMI,eAAN,SAA8BC,6BAA9B,CAGL;AACAC,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,wBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAcb,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMW,QAAN,CAAeC,QAAf,CAAP;AACD;;AAjBD","sourcesContent":["import { ContinousBaseGesture } from './gesture';\nimport type { RotationGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\nimport { GestureUpdateEvent } from '../gestureHandlerCommon';\n\ntype RotationGestureChangeEventPayload = {\n rotationChange: number;\n};\n\nfunction changeEventCalculator(\n current: GestureUpdateEvent<RotationGestureHandlerEventPayload>,\n previous?: GestureUpdateEvent<RotationGestureHandlerEventPayload>\n) {\n 'worklet';\n let changePayload: RotationGestureChangeEventPayload;\n if (previous === undefined) {\n changePayload = {\n rotationChange: current.rotation,\n };\n } else {\n changePayload = {\n rotationChange: current.rotation - previous.rotation,\n };\n }\n\n return { ...current, ...changePayload };\n}\n\nexport class RotationGesture extends ContinousBaseGesture<\n RotationGestureHandlerEventPayload,\n RotationGestureChangeEventPayload\n> {\n constructor() {\n super();\n\n this.handlerName = 'RotationGestureHandler';\n }\n\n onChange(\n callback: (\n event: GestureUpdateEvent<\n RotationGestureHandlerEventPayload & RotationGestureChangeEventPayload\n >\n ) => void\n ) {\n // @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record\n this.handlers.changeEventCalculator = changeEventCalculator;\n return super.onChange(callback);\n }\n}\n\nexport type RotationGestureType = InstanceType<typeof RotationGesture>;\n"]}
|
@@ -4,87 +4,99 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.TapGesture = void 0;
|
7
|
+
|
7
8
|
var _gesture = require("./gesture");
|
8
|
-
|
9
|
-
function
|
10
|
-
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
11
12
|
class TapGesture extends _gesture.BaseGesture {
|
12
13
|
constructor() {
|
13
14
|
super();
|
15
|
+
|
14
16
|
_defineProperty(this, "config", {});
|
17
|
+
|
15
18
|
this.handlerName = 'TapGestureHandler';
|
16
19
|
this.shouldCancelWhenOutside(true);
|
17
20
|
}
|
18
|
-
|
19
21
|
/**
|
20
22
|
* Minimum number of pointers (fingers) required to be placed before the gesture activates.
|
21
23
|
* Should be a positive integer. The default value is 1.
|
22
24
|
* @param minPointers
|
23
25
|
*/
|
26
|
+
|
27
|
+
|
24
28
|
minPointers(minPointers) {
|
25
29
|
this.config.minPointers = minPointers;
|
26
30
|
return this;
|
27
31
|
}
|
28
|
-
|
29
32
|
/**
|
30
33
|
* Number of tap gestures required to activate the gesture.
|
31
34
|
* The default value is 1.
|
32
35
|
* @param count
|
33
36
|
*/
|
37
|
+
|
38
|
+
|
34
39
|
numberOfTaps(count) {
|
35
40
|
this.config.numberOfTaps = count;
|
36
41
|
return this;
|
37
42
|
}
|
38
|
-
|
39
43
|
/**
|
40
44
|
* Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a tap gesture.
|
41
45
|
* @param maxDist
|
42
46
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdistancevalue-number
|
43
47
|
*/
|
48
|
+
|
49
|
+
|
44
50
|
maxDistance(maxDist) {
|
45
51
|
this.config.maxDist = maxDist;
|
46
52
|
return this;
|
47
53
|
}
|
48
|
-
|
49
54
|
/**
|
50
55
|
* Maximum time, expressed in milliseconds, that defines how fast a finger must be released after a touch.
|
51
56
|
* The default value is 500.
|
52
57
|
* @param duration
|
53
58
|
*/
|
59
|
+
|
60
|
+
|
54
61
|
maxDuration(duration) {
|
55
62
|
this.config.maxDurationMs = duration;
|
56
63
|
return this;
|
57
64
|
}
|
58
|
-
|
59
65
|
/**
|
60
66
|
* Maximum time, expressed in milliseconds, that can pass before the next tap — if many taps are required.
|
61
67
|
* The default value is 500.
|
62
68
|
* @param delay
|
63
69
|
*/
|
70
|
+
|
71
|
+
|
64
72
|
maxDelay(delay) {
|
65
73
|
this.config.maxDelayMs = delay;
|
66
74
|
return this;
|
67
75
|
}
|
68
|
-
|
69
76
|
/**
|
70
77
|
* Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the X axis during a tap gesture.
|
71
78
|
* @param delta
|
72
79
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltaxvalue-number
|
73
80
|
*/
|
81
|
+
|
82
|
+
|
74
83
|
maxDeltaX(delta) {
|
75
84
|
this.config.maxDeltaX = delta;
|
76
85
|
return this;
|
77
86
|
}
|
78
|
-
|
79
87
|
/**
|
80
88
|
* Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the Y axis during a tap gesture.
|
81
89
|
* @param delta
|
82
90
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltayvalue-number
|
83
91
|
*/
|
92
|
+
|
93
|
+
|
84
94
|
maxDeltaY(delta) {
|
85
95
|
this.config.maxDeltaY = delta;
|
86
96
|
return this;
|
87
97
|
}
|
98
|
+
|
88
99
|
}
|
100
|
+
|
89
101
|
exports.TapGesture = TapGesture;
|
90
102
|
//# sourceMappingURL=tapGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["tapGesture.ts"],"names":["TapGesture","BaseGesture","constructor","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"mappings":";;;;;;;AAAA;;;;AAIO,MAAMA,UAAN,SAAyBC,oBAAzB,CAAoE;AAGzEC,EAAAA,WAAW,GAAG;AACZ;;AADY,oCAFwC,EAExC;;AAGZ,SAAKC,WAAL,GAAmB,mBAAnB;AACA,SAAKC,uBAAL,CAA6B,IAA7B;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACA,WAAD,EAAsB;AAC/B,SAAKC,MAAL,CAAYD,WAAZ,GAA0BA,WAA1B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEE,EAAAA,YAAY,CAACC,KAAD,EAAgB;AAC1B,SAAKF,MAAL,CAAYC,YAAZ,GAA2BC,KAA3B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACC,OAAD,EAAkB;AAC3B,SAAKJ,MAAL,CAAYI,OAAZ,GAAsBA,OAAtB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,WAAW,CAACC,QAAD,EAAmB;AAC5B,SAAKN,MAAL,CAAYO,aAAZ,GAA4BD,QAA5B;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEE,EAAAA,QAAQ,CAACC,KAAD,EAAgB;AACtB,SAAKT,MAAL,CAAYU,UAAZ,GAAyBD,KAAzB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEE,EAAAA,SAAS,CAACC,KAAD,EAAgB;AACvB,SAAKZ,MAAL,CAAYW,SAAZ,GAAwBC,KAAxB;AACA,WAAO,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,SAAS,CAACD,KAAD,EAAgB;AACvB,SAAKZ,MAAL,CAAYa,SAAZ,GAAwBD,KAAxB;AACA,WAAO,IAAP;AACD;;AA9EwE","sourcesContent":["import { BaseGestureConfig, BaseGesture } from './gesture';\nimport { TapGestureConfig } from '../TapGestureHandler';\nimport type { TapGestureHandlerEventPayload } from '../GestureHandlerEventPayload';\n\nexport class TapGesture extends BaseGesture<TapGestureHandlerEventPayload> {\n public config: BaseGestureConfig & TapGestureConfig = {};\n\n constructor() {\n super();\n\n this.handlerName = 'TapGestureHandler';\n this.shouldCancelWhenOutside(true);\n }\n\n /**\n * Minimum number of pointers (fingers) required to be placed before the gesture activates.\n * Should be a positive integer. The default value is 1.\n * @param minPointers\n */\n minPointers(minPointers: number) {\n this.config.minPointers = minPointers;\n return this;\n }\n\n /**\n * Number of tap gestures required to activate the gesture.\n * The default value is 1.\n * @param count\n */\n numberOfTaps(count: number) {\n this.config.numberOfTaps = count;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a tap gesture.\n * @param maxDist\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdistancevalue-number\n */\n maxDistance(maxDist: number) {\n this.config.maxDist = maxDist;\n return this;\n }\n\n /**\n * Maximum time, expressed in milliseconds, that defines how fast a finger must be released after a touch.\n * The default value is 500.\n * @param duration\n */\n maxDuration(duration: number) {\n this.config.maxDurationMs = duration;\n return this;\n }\n\n /**\n * Maximum time, expressed in milliseconds, that can pass before the next tap — if many taps are required.\n * The default value is 500.\n * @param delay\n */\n maxDelay(delay: number) {\n this.config.maxDelayMs = delay;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the X axis during a tap gesture.\n * @param delta\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltaxvalue-number\n */\n maxDeltaX(delta: number) {\n this.config.maxDeltaX = delta;\n return this;\n }\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the Y axis during a tap gesture.\n * @param delta\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltayvalue-number\n */\n maxDeltaY(delta: number) {\n this.config.maxDeltaY = delta;\n return this;\n }\n}\n\nexport type TapGestureType = InstanceType<typeof TapGesture>;\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["handlerTag","getNextHandlerTag"],"
|
1
|
+
{"version":3,"sources":["getNextHandlerTag.ts"],"names":["handlerTag","getNextHandlerTag"],"mappings":";;;;;;AAAA,IAAIA,UAAU,GAAG,CAAjB;;AAEO,SAASC,iBAAT,GAAqC;AAC1C,SAAOD,UAAU,EAAjB;AACD","sourcesContent":["let handlerTag = 1;\n\nexport function getNextHandlerTag(): number {\n return handlerTag++;\n}\n"]}
|