react-native-gesture-handler 2.23.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNGestureHandler.podspec +8 -0
- package/android/build.gradle +9 -3
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +2 -1
- package/android/paper/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +2 -1
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +60 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +26 -0
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +67 -0
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +8 -11
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +10 -2
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +7 -2
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +6 -1
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +3 -1
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +5 -3
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +6 -2
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +37 -11
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +32 -22
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +3 -1
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +2 -1
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +3 -4
- package/lib/commonjs/State.js.map +1 -1
- package/lib/commonjs/TouchEventType.js +3 -3
- package/lib/commonjs/TouchEventType.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +115 -90
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +81 -28
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +37 -26
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +27 -13
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +6 -2
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +12 -4
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +15 -4
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +14 -4
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +13 -4
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +77 -29
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js +3 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +20 -5
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +86 -44
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +45 -18
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +75 -34
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +28 -10
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +14 -5
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/ExtraButtonProps.js +2 -0
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +76 -40
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +34 -19
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +32 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -2
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +25 -16
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +25 -13
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +12 -7
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +4 -1
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +14 -5
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +6 -1
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +14 -13
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +2 -1
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +11 -9
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +22 -15
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +11 -9
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +13 -10
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +32 -13
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +9 -7
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +9 -7
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +11 -9
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +146 -59
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +30 -18
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +1 -0
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +2 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +10 -9
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +14 -5
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +21 -13
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +29 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +10 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +36 -11
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +3 -0
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +24 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +48 -12
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +9 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +14 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +55 -27
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +46 -14
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +19 -8
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +84 -44
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +31 -17
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +27 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +9 -3
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +7 -2
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +25 -11
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +14 -6
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +6 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +12 -5
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +43 -18
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +8 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +9 -2
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +22 -10
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +1 -0
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +21 -6
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +26 -6
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +104 -75
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +11 -4
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +5 -4
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +83 -19
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +15 -5
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +12 -3
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +5 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +7 -2
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +37 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +23 -5
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +4 -2
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +41 -5
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +42 -13
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +49 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +195 -62
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +19 -6
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +47 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +11 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +49 -8
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +123 -8
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +41 -4
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +42 -4
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +67 -6
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +17 -9
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -3
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +41 -7
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +78 -11
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +48 -8
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +22 -5
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +26 -4
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +67 -30
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +14 -7
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +45 -10
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +45 -9
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +18 -3
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +31 -9
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +17 -4
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +76 -27
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +19 -7
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +13 -3
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +3 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +44 -13
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +142 -55
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +19 -5
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +24 -16
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +16 -9
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +49 -8
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +11 -2
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +43 -15
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +13 -2
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +52 -33
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +26 -13
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +14 -4
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +1 -3
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +3 -9
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +5 -2
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +1 -0
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +1 -0
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +4 -3
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +0 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +20 -10
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +17 -18
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/RNRenderer.js.map +1 -1
- package/lib/module/RNRenderer.web.js.map +1 -1
- package/lib/module/State.js +1 -4
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +1 -3
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +99 -80
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +55 -19
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +12 -17
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +4 -4
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.web.js +2 -1
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +2 -1
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +2 -1
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +2 -1
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +59 -26
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/PressableProps.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/Pressable/utils.js +14 -4
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +66 -40
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +30 -14
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +59 -28
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +15 -7
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js +2 -2
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/ExtraButtonProps.js +2 -0
- package/lib/module/components/touchables/ExtraButtonProps.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +63 -34
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +24 -15
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +20 -10
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +2 -2
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +16 -10
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +15 -10
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/findNodeHandle.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +11 -5
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/getReactNativeVersion.js.map +1 -1
- package/lib/module/getReactNativeVersion.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +13 -13
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -6
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +8 -12
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -6
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +19 -8
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -2
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -2
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -6
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +119 -57
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +22 -15
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +4 -9
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +4 -3
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +7 -8
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +16 -8
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +1 -0
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +13 -7
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +2 -0
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +14 -11
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +39 -12
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +6 -2
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -5
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +28 -23
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +38 -14
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +9 -5
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +17 -8
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +73 -44
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +24 -16
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +14 -1
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +4 -3
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +18 -9
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +11 -6
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +4 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +9 -5
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +41 -18
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +7 -2
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +5 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +7 -2
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +19 -10
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +5 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +13 -4
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +2 -3
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +66 -20
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +7 -3
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +10 -3
- package/lib/module/mountRegistry.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/typeUtils.js.map +1 -1
- package/lib/module/utils.js +15 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +1 -2
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +38 -5
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +38 -13
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +39 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +181 -61
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +11 -5
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +40 -5
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +6 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +41 -7
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +114 -7
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +33 -3
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +34 -3
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +59 -5
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +14 -9
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +13 -3
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +39 -7
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +71 -10
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +37 -7
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +19 -5
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +19 -3
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +65 -30
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +12 -7
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +35 -9
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +39 -8
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +14 -3
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +25 -8
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +10 -3
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +57 -22
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +13 -4
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +5 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +1 -0
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +35 -10
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +130 -53
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +6 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +11 -2
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +8 -6
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +40 -6
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +5 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +34 -13
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +6 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +45 -31
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +1 -2
- package/lib/module/web_hammer/constants.js.map +1 -1
- package/lib/module/web_hammer/utils.js +2 -2
- package/lib/module/web_hammer/utils.js.map +1 -1
- package/lib/typescript/components/GestureComponents.d.ts +1 -1
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +5 -0
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +7 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -2
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +3 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +1 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -7
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +2 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +2 -2
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -0
- package/lib/typescript/web/utils.d.ts +2 -0
- package/package.json +9 -8
- package/src/components/GestureComponents.tsx +1 -1
- package/src/components/ReanimatedDrawerLayout.tsx +17 -4
- package/src/components/Text.tsx +5 -0
- package/src/components/touchables/ExtraButtonProps.ts +7 -0
- package/src/components/touchables/GenericTouchable.tsx +0 -2
- package/src/components/touchables/GenericTouchableProps.ts +2 -0
- package/src/components/touchables/TouchableHighlight.tsx +2 -2
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedback.tsx +1 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -8
- package/src/components/touchables/TouchableOpacity.tsx +2 -2
- package/src/components/touchables/TouchableWithoutFeedback.tsx +22 -4
- package/src/handlers/createHandler.tsx +20 -9
- package/src/handlers/createNativeWrapper.tsx +7 -3
- package/src/handlers/gestures/GestureDetector/Wrap.web.tsx +2 -4
- package/src/utils.ts +6 -0
- package/src/web/utils.ts +21 -3
@@ -1,11 +1,12 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
+
|
4
3
|
import { ContinousBaseGesture } from './gesture';
|
4
|
+
|
5
5
|
function changeEventCalculator(current, previous) {
|
6
6
|
'worklet';
|
7
7
|
|
8
8
|
let changePayload;
|
9
|
+
|
9
10
|
if (previous === undefined) {
|
10
11
|
changePayload = {
|
11
12
|
changeX: current.translationX,
|
@@ -17,23 +18,27 @@ function changeEventCalculator(current, previous) {
|
|
17
18
|
changeY: current.translationY - previous.translationY
|
18
19
|
};
|
19
20
|
}
|
20
|
-
|
21
|
-
|
21
|
+
|
22
|
+
return { ...current,
|
22
23
|
...changePayload
|
23
24
|
};
|
24
25
|
}
|
26
|
+
|
25
27
|
export class PanGesture extends ContinousBaseGesture {
|
26
28
|
constructor() {
|
27
29
|
super();
|
30
|
+
|
28
31
|
_defineProperty(this, "config", {});
|
32
|
+
|
29
33
|
this.handlerName = 'PanGestureHandler';
|
30
34
|
}
|
31
|
-
|
32
35
|
/**
|
33
36
|
* Range along Y axis (in points) where fingers travels without activation of gesture.
|
34
37
|
* @param offset
|
35
38
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetyvalue-number--number
|
36
39
|
*/
|
40
|
+
|
41
|
+
|
37
42
|
activeOffsetY(offset) {
|
38
43
|
if (Array.isArray(offset)) {
|
39
44
|
this.config.activeOffsetYStart = offset[0];
|
@@ -43,14 +48,16 @@ export class PanGesture extends ContinousBaseGesture {
|
|
43
48
|
} else {
|
44
49
|
this.config.activeOffsetYEnd = offset;
|
45
50
|
}
|
51
|
+
|
46
52
|
return this;
|
47
53
|
}
|
48
|
-
|
49
54
|
/**
|
50
55
|
* Range along X axis (in points) where fingers travels without activation of gesture.
|
51
56
|
* @param offset
|
52
57
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#activeoffsetxvalue-number--number
|
53
58
|
*/
|
59
|
+
|
60
|
+
|
54
61
|
activeOffsetX(offset) {
|
55
62
|
if (Array.isArray(offset)) {
|
56
63
|
this.config.activeOffsetXStart = offset[0];
|
@@ -60,14 +67,16 @@ export class PanGesture extends ContinousBaseGesture {
|
|
60
67
|
} else {
|
61
68
|
this.config.activeOffsetXEnd = offset;
|
62
69
|
}
|
70
|
+
|
63
71
|
return this;
|
64
72
|
}
|
65
|
-
|
66
73
|
/**
|
67
74
|
* When the finger moves outside this range (in points) along Y axis and gesture hasn't yet activated it will fail recognizing the gesture.
|
68
75
|
* @param offset
|
69
76
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetyvalue-number--number
|
70
77
|
*/
|
78
|
+
|
79
|
+
|
71
80
|
failOffsetY(offset) {
|
72
81
|
if (Array.isArray(offset)) {
|
73
82
|
this.config.failOffsetYStart = offset[0];
|
@@ -77,14 +86,16 @@ export class PanGesture extends ContinousBaseGesture {
|
|
77
86
|
} else {
|
78
87
|
this.config.failOffsetYEnd = offset;
|
79
88
|
}
|
89
|
+
|
80
90
|
return this;
|
81
91
|
}
|
82
|
-
|
83
92
|
/**
|
84
93
|
* When the finger moves outside this range (in points) along X axis and gesture hasn't yet activated it will fail recognizing the gesture.
|
85
94
|
* @param offset
|
86
95
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture#failoffsetxvalue-number--number
|
87
96
|
*/
|
97
|
+
|
98
|
+
|
88
99
|
failOffsetX(offset) {
|
89
100
|
if (Array.isArray(offset)) {
|
90
101
|
this.config.failOffsetXStart = offset[0];
|
@@ -94,100 +105,112 @@ export class PanGesture extends ContinousBaseGesture {
|
|
94
105
|
} else {
|
95
106
|
this.config.failOffsetXEnd = offset;
|
96
107
|
}
|
108
|
+
|
97
109
|
return this;
|
98
110
|
}
|
99
|
-
|
100
111
|
/**
|
101
112
|
* A number of fingers that is required to be placed before gesture can activate. Should be a higher or equal to 0 integer.
|
102
113
|
* @param minPointers
|
103
114
|
*/
|
115
|
+
|
116
|
+
|
104
117
|
minPointers(minPointers) {
|
105
118
|
this.config.minPointers = minPointers;
|
106
119
|
return this;
|
107
120
|
}
|
108
|
-
|
109
121
|
/**
|
110
122
|
* When the given number of fingers is placed on the screen and gesture hasn't yet activated it will fail recognizing the gesture.
|
111
123
|
* Should be a higher or equal to 0 integer.
|
112
124
|
* @param maxPointers
|
113
125
|
*/
|
126
|
+
|
127
|
+
|
114
128
|
maxPointers(maxPointers) {
|
115
129
|
this.config.maxPointers = maxPointers;
|
116
130
|
return this;
|
117
131
|
}
|
118
|
-
|
119
132
|
/**
|
120
133
|
* Minimum distance the finger (or multiple finger) need to travel before the gesture activates.
|
121
134
|
* Expressed in points.
|
122
135
|
* @param distance
|
123
136
|
*/
|
137
|
+
|
138
|
+
|
124
139
|
minDistance(distance) {
|
125
140
|
this.config.minDist = distance;
|
126
141
|
return this;
|
127
142
|
}
|
128
|
-
|
129
143
|
/**
|
130
144
|
* Minimum velocity the finger has to reach in order to activate handler.
|
131
145
|
* @param velocity
|
132
146
|
*/
|
147
|
+
|
148
|
+
|
133
149
|
minVelocity(velocity) {
|
134
150
|
this.config.minVelocity = velocity;
|
135
151
|
return this;
|
136
152
|
}
|
137
|
-
|
138
153
|
/**
|
139
154
|
* Minimum velocity along X axis the finger has to reach in order to activate handler.
|
140
155
|
* @param velocity
|
141
156
|
*/
|
157
|
+
|
158
|
+
|
142
159
|
minVelocityX(velocity) {
|
143
160
|
this.config.minVelocityX = velocity;
|
144
161
|
return this;
|
145
162
|
}
|
146
|
-
|
147
163
|
/**
|
148
164
|
* Minimum velocity along Y axis the finger has to reach in order to activate handler.
|
149
165
|
* @param velocity
|
150
166
|
*/
|
167
|
+
|
168
|
+
|
151
169
|
minVelocityY(velocity) {
|
152
170
|
this.config.minVelocityY = velocity;
|
153
171
|
return this;
|
154
172
|
}
|
155
|
-
|
156
173
|
/**
|
157
174
|
* #### Android only
|
158
175
|
* Android, by default, will calculate translation values based on the position of the leading pointer (the first one that was placed on the screen).
|
159
176
|
* 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.
|
160
177
|
* @param value
|
161
178
|
*/
|
179
|
+
|
180
|
+
|
162
181
|
averageTouches(value) {
|
163
182
|
this.config.avgTouches = value;
|
164
183
|
return this;
|
165
184
|
}
|
166
|
-
|
167
185
|
/**
|
168
186
|
* #### iOS only
|
169
187
|
* Enables two-finger gestures on supported devices, for example iPads with trackpads.
|
170
188
|
* @param value
|
171
189
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#enabletrackpadtwofingergesturevalue-boolean-ios-only
|
172
190
|
*/
|
191
|
+
|
192
|
+
|
173
193
|
enableTrackpadTwoFingerGesture(value) {
|
174
194
|
this.config.enableTrackpadTwoFingerGesture = value;
|
175
195
|
return this;
|
176
196
|
}
|
177
|
-
|
178
197
|
/**
|
179
198
|
* Duration in milliseconds of the LongPress gesture before Pan is allowed to activate.
|
180
199
|
* @param duration
|
181
200
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture/#activateafterlongpressduration-number
|
182
201
|
*/
|
202
|
+
|
203
|
+
|
183
204
|
activateAfterLongPress(duration) {
|
184
205
|
this.config.activateAfterLongPress = duration;
|
185
206
|
return this;
|
186
207
|
}
|
208
|
+
|
187
209
|
onChange(callback) {
|
188
210
|
// @ts-ignore TS being overprotective, PanGestureHandlerEventPayload is Record
|
189
211
|
this.handlers.changeEventCalculator = changeEventCalculator;
|
190
212
|
return super.onChange(callback);
|
191
213
|
}
|
214
|
+
|
192
215
|
}
|
193
216
|
//# sourceMappingURL=panGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","changeX","translationX","changeY","translationY","PanGesture","constructor","_defineProperty","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"],"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":"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","ignoreList":[]}
|
1
|
+
{"version":3,"sources":["panGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","changeX","translationX","changeY","translationY","PanGesture","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":"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","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"]}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { ContinousBaseGesture } from './gesture';
|
2
|
+
|
2
3
|
function changeEventCalculator(current, previous) {
|
3
4
|
'worklet';
|
4
5
|
|
5
6
|
let changePayload;
|
7
|
+
|
6
8
|
if (previous === undefined) {
|
7
9
|
changePayload = {
|
8
10
|
scaleChange: current.scale
|
@@ -12,20 +14,23 @@ function changeEventCalculator(current, previous) {
|
|
12
14
|
scaleChange: current.scale / previous.scale
|
13
15
|
};
|
14
16
|
}
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
return { ...current,
|
17
19
|
...changePayload
|
18
20
|
};
|
19
21
|
}
|
22
|
+
|
20
23
|
export class PinchGesture extends ContinousBaseGesture {
|
21
24
|
constructor() {
|
22
25
|
super();
|
23
26
|
this.handlerName = 'PinchGestureHandler';
|
24
27
|
}
|
28
|
+
|
25
29
|
onChange(callback) {
|
26
30
|
// @ts-ignore TS being overprotective, PinchGestureHandlerEventPayload is Record
|
27
31
|
this.handlers.changeEventCalculator = changeEventCalculator;
|
28
32
|
return super.onChange(callback);
|
29
33
|
}
|
34
|
+
|
30
35
|
}
|
31
36
|
//# sourceMappingURL=pinchGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","scaleChange","scale","PinchGesture","constructor","handlerName","onChange","callback","handlers"],"
|
1
|
+
{"version":3,"sources":["pinchGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","scaleChange","scale","PinchGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,WAArC;;AAQA,SAASC,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;;AAED,OAAO,MAAMI,YAAN,SAA2BR,oBAA3B,CAGL;AACAS,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,qBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAcZ,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMU,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"]}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
var _Reanimated;
|
2
|
+
|
2
3
|
import { tagMessage } from '../../utils';
|
3
4
|
let Reanimated;
|
5
|
+
|
4
6
|
try {
|
5
7
|
Reanimated = require('react-native-reanimated');
|
6
8
|
} catch (e) {
|
@@ -8,11 +10,13 @@ try {
|
|
8
10
|
// @ts-ignore TS demands the variable to be initialized
|
9
11
|
Reanimated = undefined;
|
10
12
|
}
|
13
|
+
|
11
14
|
if (!((_Reanimated = Reanimated) !== null && _Reanimated !== void 0 && _Reanimated.useSharedValue)) {
|
12
15
|
// @ts-ignore Make sure the loaded module is actually Reanimated, if it's not
|
13
16
|
// reset the module to undefined so we can fallback to the default implementation
|
14
17
|
Reanimated = undefined;
|
15
18
|
}
|
19
|
+
|
16
20
|
if (Reanimated !== undefined && !Reanimated.setGestureState) {
|
17
21
|
// The loaded module is Reanimated but it doesn't have the setGestureState defined
|
18
22
|
Reanimated.setGestureState = () => {
|
@@ -21,5 +25,6 @@ if (Reanimated !== undefined && !Reanimated.setGestureState) {
|
|
21
25
|
console.warn(tagMessage('Please use newer version of react-native-reanimated in order to control state of the gestures.'));
|
22
26
|
};
|
23
27
|
}
|
28
|
+
|
24
29
|
export { Reanimated };
|
25
30
|
//# sourceMappingURL=reanimatedWrapper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["tagMessage","Reanimated","require","e","undefined","
|
1
|
+
{"version":3,"sources":["reanimatedWrapper.ts"],"names":["tagMessage","Reanimated","require","e","undefined","useSharedValue","setGestureState","console","warn"],"mappings":";;AAKA,SAASA,UAAT,QAA2B,aAA3B;AAMA,IAAIC,UAAJ;;AAoBA,IAAI;AACFA,EAAAA,UAAU,GAAGC,OAAO,CAAC,yBAAD,CAApB;AACD,CAFD,CAEE,OAAOC,CAAP,EAAU;AACV;AACA;AACAF,EAAAA,UAAU,GAAGG,SAAb;AACD;;AAED,IAAI,iBAACH,UAAD,wCAAC,YAAYI,cAAb,CAAJ,EAAiC;AAC/B;AACA;AACAJ,EAAAA,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,CACER,UAAU,CACR,gGADQ,CADZ;AAKD,GAPD;AAQD;;AAED,SAASC,UAAT","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"]}
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { ContinousBaseGesture } from './gesture';
|
2
|
+
|
2
3
|
function changeEventCalculator(current, previous) {
|
3
4
|
'worklet';
|
4
5
|
|
5
6
|
let changePayload;
|
7
|
+
|
6
8
|
if (previous === undefined) {
|
7
9
|
changePayload = {
|
8
10
|
rotationChange: current.rotation
|
@@ -12,20 +14,23 @@ function changeEventCalculator(current, previous) {
|
|
12
14
|
rotationChange: current.rotation - previous.rotation
|
13
15
|
};
|
14
16
|
}
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
return { ...current,
|
17
19
|
...changePayload
|
18
20
|
};
|
19
21
|
}
|
22
|
+
|
20
23
|
export class RotationGesture extends ContinousBaseGesture {
|
21
24
|
constructor() {
|
22
25
|
super();
|
23
26
|
this.handlerName = 'RotationGestureHandler';
|
24
27
|
}
|
28
|
+
|
25
29
|
onChange(callback) {
|
26
30
|
// @ts-ignore TS being overprotective, RotationGestureHandlerEventPayload is Record
|
27
31
|
this.handlers.changeEventCalculator = changeEventCalculator;
|
28
32
|
return super.onChange(callback);
|
29
33
|
}
|
34
|
+
|
30
35
|
}
|
31
36
|
//# sourceMappingURL=rotationGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","rotationChange","rotation","RotationGesture","constructor","handlerName","onChange","callback","handlers"],"
|
1
|
+
{"version":3,"sources":["rotationGesture.ts"],"names":["ContinousBaseGesture","changeEventCalculator","current","previous","changePayload","undefined","rotationChange","rotation","RotationGesture","constructor","handlerName","onChange","callback","handlers"],"mappings":"AAAA,SAASA,oBAAT,QAAqC,WAArC;;AAQA,SAASC,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;;AAED,OAAO,MAAMI,eAAN,SAA8BR,oBAA9B,CAGL;AACAS,EAAAA,WAAW,GAAG;AACZ;AAEA,SAAKC,WAAL,GAAmB,wBAAnB;AACD;;AAEDC,EAAAA,QAAQ,CACNC,QADM,EAMN;AACA;AACA,SAAKC,QAAL,CAAcZ,qBAAd,GAAsCA,qBAAtC;AACA,WAAO,MAAMU,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"]}
|
@@ -1,83 +1,92 @@
|
|
1
|
-
function _defineProperty(
|
2
|
-
|
3
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
+
|
4
3
|
import { BaseGesture } from './gesture';
|
5
4
|
export class TapGesture extends BaseGesture {
|
6
5
|
constructor() {
|
7
6
|
super();
|
7
|
+
|
8
8
|
_defineProperty(this, "config", {});
|
9
|
+
|
9
10
|
this.handlerName = 'TapGestureHandler';
|
10
11
|
this.shouldCancelWhenOutside(true);
|
11
12
|
}
|
12
|
-
|
13
13
|
/**
|
14
14
|
* Minimum number of pointers (fingers) required to be placed before the gesture activates.
|
15
15
|
* Should be a positive integer. The default value is 1.
|
16
16
|
* @param minPointers
|
17
17
|
*/
|
18
|
+
|
19
|
+
|
18
20
|
minPointers(minPointers) {
|
19
21
|
this.config.minPointers = minPointers;
|
20
22
|
return this;
|
21
23
|
}
|
22
|
-
|
23
24
|
/**
|
24
25
|
* Number of tap gestures required to activate the gesture.
|
25
26
|
* The default value is 1.
|
26
27
|
* @param count
|
27
28
|
*/
|
29
|
+
|
30
|
+
|
28
31
|
numberOfTaps(count) {
|
29
32
|
this.config.numberOfTaps = count;
|
30
33
|
return this;
|
31
34
|
}
|
32
|
-
|
33
35
|
/**
|
34
36
|
* Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a tap gesture.
|
35
37
|
* @param maxDist
|
36
38
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdistancevalue-number
|
37
39
|
*/
|
40
|
+
|
41
|
+
|
38
42
|
maxDistance(maxDist) {
|
39
43
|
this.config.maxDist = maxDist;
|
40
44
|
return this;
|
41
45
|
}
|
42
|
-
|
43
46
|
/**
|
44
47
|
* Maximum time, expressed in milliseconds, that defines how fast a finger must be released after a touch.
|
45
48
|
* The default value is 500.
|
46
49
|
* @param duration
|
47
50
|
*/
|
51
|
+
|
52
|
+
|
48
53
|
maxDuration(duration) {
|
49
54
|
this.config.maxDurationMs = duration;
|
50
55
|
return this;
|
51
56
|
}
|
52
|
-
|
53
57
|
/**
|
54
58
|
* Maximum time, expressed in milliseconds, that can pass before the next tap — if many taps are required.
|
55
59
|
* The default value is 500.
|
56
60
|
* @param delay
|
57
61
|
*/
|
62
|
+
|
63
|
+
|
58
64
|
maxDelay(delay) {
|
59
65
|
this.config.maxDelayMs = delay;
|
60
66
|
return this;
|
61
67
|
}
|
62
|
-
|
63
68
|
/**
|
64
69
|
* Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the X axis during a tap gesture.
|
65
70
|
* @param delta
|
66
71
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltaxvalue-number
|
67
72
|
*/
|
73
|
+
|
74
|
+
|
68
75
|
maxDeltaX(delta) {
|
69
76
|
this.config.maxDeltaX = delta;
|
70
77
|
return this;
|
71
78
|
}
|
72
|
-
|
73
79
|
/**
|
74
80
|
* Maximum distance, expressed in points, that defines how far the finger is allowed to travel along the Y axis during a tap gesture.
|
75
81
|
* @param delta
|
76
82
|
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#maxdeltayvalue-number
|
77
83
|
*/
|
84
|
+
|
85
|
+
|
78
86
|
maxDeltaY(delta) {
|
79
87
|
this.config.maxDeltaY = delta;
|
80
88
|
return this;
|
81
89
|
}
|
90
|
+
|
82
91
|
}
|
83
92
|
//# sourceMappingURL=tapGesture.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseGesture","TapGesture","constructor","
|
1
|
+
{"version":3,"sources":["tapGesture.ts"],"names":["BaseGesture","TapGesture","constructor","handlerName","shouldCancelWhenOutside","minPointers","config","numberOfTaps","count","maxDistance","maxDist","maxDuration","duration","maxDurationMs","maxDelay","delay","maxDelayMs","maxDeltaX","delta","maxDeltaY"],"mappings":";;AAAA,SAA4BA,WAA5B,QAA+C,WAA/C;AAIA,OAAO,MAAMC,UAAN,SAAyBD,WAAzB,CAAoE;AAGzEE,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;AAEA,OAAO,SAASC,iBAAT,GAAqC;AAC1C,SAAOD,UAAU,EAAjB;AACD","sourcesContent":["let handlerTag = 1;\n\nexport function getNextHandlerTag(): number {\n return handlerTag++;\n}\n"]}
|
@@ -5,6 +5,7 @@ const oldHandlers = new Map();
|
|
5
5
|
const testIDs = new Map();
|
6
6
|
export function registerHandler(handlerTag, handler, testID) {
|
7
7
|
gestures.set(handlerTag, handler);
|
8
|
+
|
8
9
|
if (isTestEnv() && testID) {
|
9
10
|
testIDs.set(testID, handlerTag);
|
10
11
|
}
|
@@ -17,6 +18,7 @@ export function unregisterOldGestureHandler(handlerTag) {
|
|
17
18
|
}
|
18
19
|
export function unregisterHandler(handlerTag, testID) {
|
19
20
|
gestures.delete(handlerTag);
|
21
|
+
|
20
22
|
if (isTestEnv() && testID) {
|
21
23
|
testIDs.delete(testID);
|
22
24
|
}
|
@@ -29,10 +31,13 @@ export function findOldGestureHandler(handlerTag) {
|
|
29
31
|
}
|
30
32
|
export function findHandlerByTestID(testID) {
|
31
33
|
const handlerTag = testIDs.get(testID);
|
34
|
+
|
32
35
|
if (handlerTag !== undefined) {
|
33
36
|
var _findHandler;
|
37
|
+
|
34
38
|
return (_findHandler = findHandler(handlerTag)) !== null && _findHandler !== void 0 ? _findHandler : null;
|
35
39
|
}
|
40
|
+
|
36
41
|
return null;
|
37
42
|
}
|
38
43
|
//# sourceMappingURL=handlersRegistry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isTestEnv","handlerIDToTag","gestures","Map","oldHandlers","testIDs","registerHandler","handlerTag","handler","testID","set","registerOldGestureHandler","unregisterOldGestureHandler","delete","unregisterHandler","findHandler","get","findOldGestureHandler","findHandlerByTestID","undefined"
|
1
|
+
{"version":3,"sources":["handlersRegistry.ts"],"names":["isTestEnv","handlerIDToTag","gestures","Map","oldHandlers","testIDs","registerHandler","handlerTag","handler","testID","set","registerOldGestureHandler","unregisterOldGestureHandler","delete","unregisterHandler","findHandler","get","findOldGestureHandler","findHandlerByTestID","undefined"],"mappings":"AAAA,SAASA,SAAT,QAA0B,UAA1B;AAIA,OAAO,MAAMC,cAAsC,GAAG,EAA/C;AACP,MAAMC,QAAQ,GAAG,IAAIC,GAAJ,EAAjB;AACA,MAAMC,WAAW,GAAG,IAAID,GAAJ,EAApB;AACA,MAAME,OAAO,GAAG,IAAIF,GAAJ,EAAhB;AAEA,OAAO,SAASG,eAAT,CACLC,UADK,EAELC,OAFK,EAGLC,MAHK,EAIL;AACAP,EAAAA,QAAQ,CAACQ,GAAT,CAAaH,UAAb,EAAyBC,OAAzB;;AACA,MAAIR,SAAS,MAAMS,MAAnB,EAA2B;AACzBJ,IAAAA,OAAO,CAACK,GAAR,CAAYD,MAAZ,EAAoBF,UAApB;AACD;AACF;AAED,OAAO,SAASI,yBAAT,CACLJ,UADK,EAELC,OAFK,EAGL;AACAJ,EAAAA,WAAW,CAACM,GAAZ,CAAgBH,UAAhB,EAA4BC,OAA5B;AACD;AAED,OAAO,SAASI,2BAAT,CAAqCL,UAArC,EAAyD;AAC9DH,EAAAA,WAAW,CAACS,MAAZ,CAAmBN,UAAnB;AACD;AAED,OAAO,SAASO,iBAAT,CAA2BP,UAA3B,EAA+CE,MAA/C,EAAgE;AACrEP,EAAAA,QAAQ,CAACW,MAAT,CAAgBN,UAAhB;;AACA,MAAIP,SAAS,MAAMS,MAAnB,EAA2B;AACzBJ,IAAAA,OAAO,CAACQ,MAAR,CAAeJ,MAAf;AACD;AACF;AAED,OAAO,SAASM,WAAT,CAAqBR,UAArB,EAAyC;AAC9C,SAAOL,QAAQ,CAACc,GAAT,CAAaT,UAAb,CAAP;AACD;AAED,OAAO,SAASU,qBAAT,CAA+BV,UAA/B,EAAmD;AACxD,SAAOH,WAAW,CAACY,GAAZ,CAAgBT,UAAhB,CAAP;AACD;AAED,OAAO,SAASW,mBAAT,CAA6BT,MAA7B,EAA6C;AAClD,QAAMF,UAAU,GAAGF,OAAO,CAACW,GAAR,CAAYP,MAAZ,CAAnB;;AACA,MAAIF,UAAU,KAAKY,SAAnB,EAA8B;AAAA;;AAC5B,2BAAOJ,WAAW,CAACR,UAAD,CAAlB,uDAAkC,IAAlC;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import { isTestEnv } from '../utils';\nimport { GestureType } from './gestures/gesture';\nimport { GestureEvent, HandlerStateChangeEvent } from './gestureHandlerCommon';\n\nexport const handlerIDToTag: Record<string, number> = {};\nconst gestures = new Map<number, GestureType>();\nconst oldHandlers = new Map<number, GestureHandlerCallbacks>();\nconst testIDs = new Map<string, number>();\n\nexport function registerHandler(\n handlerTag: number,\n handler: GestureType,\n testID?: string\n) {\n gestures.set(handlerTag, handler);\n if (isTestEnv() && testID) {\n testIDs.set(testID, handlerTag);\n }\n}\n\nexport function registerOldGestureHandler(\n handlerTag: number,\n handler: GestureHandlerCallbacks\n) {\n oldHandlers.set(handlerTag, handler);\n}\n\nexport function unregisterOldGestureHandler(handlerTag: number) {\n oldHandlers.delete(handlerTag);\n}\n\nexport function unregisterHandler(handlerTag: number, testID?: string) {\n gestures.delete(handlerTag);\n if (isTestEnv() && testID) {\n testIDs.delete(testID);\n }\n}\n\nexport function findHandler(handlerTag: number) {\n return gestures.get(handlerTag);\n}\n\nexport function findOldGestureHandler(handlerTag: number) {\n return oldHandlers.get(handlerTag);\n}\n\nexport function findHandlerByTestID(testID: string) {\n const handlerTag = testIDs.get(testID);\n if (handlerTag !== undefined) {\n return findHandler(handlerTag) ?? null;\n }\n return null;\n}\n\nexport interface GestureHandlerCallbacks {\n onGestureEvent: (event: GestureEvent<any>) => void;\n onGestureStateChange: (event: HandlerStateChangeEvent<any>) => void;\n}\n"]}
|