react-native-gesture-handler 2.22.1 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
- package/android/src/main/jni/cpp-adapter.cpp +19 -12
- package/apple/RNGestureHandler.mm +15 -8
- package/apple/RNGestureHandlerModule.mm +17 -5
- package/lib/commonjs/ActionType.js +3 -3
- package/lib/commonjs/ActionType.js.map +1 -1
- package/lib/commonjs/Directions.js +11 -8
- package/lib/commonjs/Directions.js.map +1 -1
- package/lib/commonjs/EnableNewWebImplementation.js +2 -10
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +2 -7
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/commonjs/PlatformConstants.js +1 -6
- package/lib/commonjs/PlatformConstants.js.map +1 -1
- package/lib/commonjs/PlatformConstants.web.js +1 -3
- package/lib/commonjs/PlatformConstants.web.js.map +1 -1
- package/lib/commonjs/PointerType.js +3 -5
- package/lib/commonjs/PointerType.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +2 -6
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +13 -39
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +22 -32
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/RNRenderer.js +1 -3
- package/lib/commonjs/RNRenderer.js.map +1 -1
- package/lib/commonjs/RNRenderer.web.js +1 -2
- package/lib/commonjs/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/State.js +4 -3
- package/lib/commonjs/State.js.map +1 -1
- package/lib/commonjs/TouchEventType.js +3 -3
- package/lib/commonjs/TouchEventType.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +96 -115
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +36 -80
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/GestureButtonsProps.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +26 -37
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +13 -27
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +2 -6
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +4 -12
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +4 -15
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +4 -14
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +4 -13
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +46 -78
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/PressableProps.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js +1 -3
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/Pressable/utils.js +5 -20
- package/lib/commonjs/components/Pressable/utils.js.map +1 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +38 -76
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +61 -59
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +34 -75
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +18 -26
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +5 -14
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +40 -76
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +20 -33
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +17 -31
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -4
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +17 -24
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +12 -13
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/index.js +7 -12
- package/lib/commonjs/components/touchables/index.js.map +1 -1
- package/lib/commonjs/findNodeHandle.js +1 -4
- package/lib/commonjs/findNodeHandle.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +9 -10
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +1 -6
- package/lib/commonjs/getReactNativeVersion.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.web.js +0 -1
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.js +13 -14
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +0 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/commonjs/ghQueueMicrotask.js +1 -2
- package/lib/commonjs/ghQueueMicrotask.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +16 -10
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +20 -23
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +16 -10
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +17 -12
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +20 -31
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +14 -8
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +14 -8
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +16 -10
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +55 -135
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +17 -27
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +1 -2
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +9 -10
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +5 -14
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +10 -20
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +9 -29
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +1 -10
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +12 -37
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -3
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +12 -24
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -48
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +3 -13
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +2 -9
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +8 -16
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +28 -56
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -46
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +5 -12
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +8 -19
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +44 -84
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +17 -31
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +1 -27
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +3 -9
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +2 -7
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +11 -25
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +6 -14
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +0 -6
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +5 -12
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +18 -43
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +2 -9
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +1 -8
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +2 -9
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +10 -22
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +0 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +11 -21
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/handlers/utils.js +6 -26
- package/lib/commonjs/handlers/utils.js.map +1 -1
- package/lib/commonjs/index.js +75 -104
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/init.js +4 -11
- package/lib/commonjs/init.js.map +1 -1
- package/lib/commonjs/jestUtils/index.js +4 -5
- package/lib/commonjs/jestUtils/index.js.map +1 -1
- package/lib/commonjs/jestUtils/jestUtils.js +19 -83
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -1
- package/lib/commonjs/mocks.js +5 -15
- package/lib/commonjs/mocks.js.map +1 -1
- package/lib/commonjs/mountRegistry.js +3 -12
- package/lib/commonjs/mountRegistry.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +1 -5
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +2 -7
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +2 -7
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/typeUtils.js.map +1 -1
- package/lib/commonjs/utils.js +15 -30
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/Gestures.js +5 -23
- package/lib/commonjs/web/Gestures.js.map +1 -1
- package/lib/commonjs/web/constants.js +2 -4
- package/lib/commonjs/web/constants.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +26 -62
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +36 -65
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +12 -55
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +160 -273
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +8 -21
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +12 -53
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +1 -11
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +21 -62
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +23 -138
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +19 -56
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +16 -54
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +10 -71
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +9 -17
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +17 -29
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +7 -41
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +51 -118
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +37 -58
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +21 -40
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +4 -26
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +30 -67
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +9 -16
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +10 -45
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +24 -60
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js +3 -18
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +10 -32
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +4 -17
- package/lib/commonjs/web/tools/WheelEventManager.js.map +1 -1
- package/lib/commonjs/web/utils.js +26 -55
- package/lib/commonjs/web/utils.js.map +1 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +7 -19
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +3 -13
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/Errors.js +0 -3
- package/lib/commonjs/web_hammer/Errors.js.map +1 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +13 -44
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +55 -142
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +2 -11
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +5 -19
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +16 -24
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/NodeManager.js +9 -16
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +8 -49
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +2 -11
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +15 -43
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +2 -13
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +33 -52
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web_hammer/constants.js +13 -26
- package/lib/commonjs/web_hammer/constants.js.map +1 -1
- package/lib/commonjs/web_hammer/utils.js +4 -14
- package/lib/commonjs/web_hammer/utils.js.map +1 -1
- package/lib/module/ActionType.js +3 -1
- package/lib/module/ActionType.js.map +1 -1
- package/lib/module/Directions.js +9 -3
- package/lib/module/Directions.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +2 -5
- package/lib/module/EnableNewWebImplementation.js.map +1 -1
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -1
- package/lib/module/PlatformConstants.js +0 -1
- package/lib/module/PlatformConstants.js.map +1 -1
- package/lib/module/PlatformConstants.web.js +0 -1
- package/lib/module/PlatformConstants.web.js.map +1 -1
- package/lib/module/PointerType.js +3 -4
- package/lib/module/PointerType.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +1 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +12 -22
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +18 -17
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/RNRenderer.js.map +1 -1
- package/lib/module/RNRenderer.web.js.map +1 -1
- package/lib/module/State.js +4 -1
- package/lib/module/State.js.map +1 -1
- package/lib/module/TouchEventType.js +3 -1
- package/lib/module/TouchEventType.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +87 -99
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +27 -55
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/GestureButtonsProps.js.map +1 -1
- package/lib/module/components/GestureComponents.js +17 -12
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +4 -4
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.web.js +1 -2
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +1 -2
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +1 -2
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.web.js +1 -2
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +44 -61
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/PressableProps.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/Pressable/utils.js +4 -14
- package/lib/module/components/Pressable/utils.js.map +1 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +34 -56
- package/lib/module/components/ReanimatedDrawerLayout.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +57 -44
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Swipeable.js +28 -59
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/components/Text.js +14 -13
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js +2 -2
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchable.js +34 -63
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -1
- package/lib/module/components/touchables/GenericTouchableProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +16 -23
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +11 -19
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +13 -14
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -2
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/components/touchables/index.js.map +1 -1
- package/lib/module/findNodeHandle.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +9 -8
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/getReactNativeVersion.js.map +1 -1
- package/lib/module/getReactNativeVersion.web.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.js +13 -13
- package/lib/module/getShadowNodeFromRef.js.map +1 -1
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -1
- package/lib/module/ghQueueMicrotask.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +13 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +16 -8
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +13 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +13 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +15 -19
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +13 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -1
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +13 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +13 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +54 -108
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/createNativeWrapper.js +12 -17
- package/lib/module/handlers/createNativeWrapper.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.js.map +1 -1
- package/lib/module/handlers/customDirectEventTypes.web.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +9 -4
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +3 -4
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +5 -6
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +8 -16
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +9 -15
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -2
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +11 -14
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +12 -39
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +5 -5
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +2 -6
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +7 -9
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +25 -30
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +14 -38
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/flingGesture.js +5 -9
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +8 -17
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +44 -73
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureComposition.js +16 -24
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -1
- package/lib/module/handlers/gestures/gestureObjects.js +1 -14
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +3 -4
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -1
- package/lib/module/handlers/gestures/hoverGesture.js +9 -18
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +6 -11
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/manualGesture.js +0 -4
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -1
- package/lib/module/handlers/gestures/nativeGesture.js +5 -9
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -1
- package/lib/module/handlers/gestures/panGesture.js +18 -41
- package/lib/module/handlers/gestures/panGesture.js.map +1 -1
- package/lib/module/handlers/gestures/pinchGesture.js +2 -7
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -5
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/rotationGesture.js +2 -7
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +10 -19
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/handlers/getNextHandlerTag.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +6 -8
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/handlers/utils.js +4 -13
- package/lib/module/handlers/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/init.js +3 -2
- package/lib/module/init.js.map +1 -1
- package/lib/module/jestUtils/index.js.map +1 -1
- package/lib/module/jestUtils/jestUtils.js +20 -66
- package/lib/module/jestUtils/jestUtils.js.map +1 -1
- package/lib/module/mocks.js +3 -7
- package/lib/module/mocks.js.map +1 -1
- package/lib/module/mountRegistry.js +3 -10
- package/lib/module/mountRegistry.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/typeUtils.js.map +1 -1
- package/lib/module/utils.js +8 -13
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/Gestures.js +2 -1
- package/lib/module/web/Gestures.js.map +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +26 -59
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +36 -61
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +11 -45
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +159 -259
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +7 -13
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/IGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +11 -46
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -6
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +20 -54
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +22 -129
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +18 -48
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +15 -46
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +9 -63
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +9 -14
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +17 -27
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +7 -39
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +50 -111
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +36 -47
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +21 -35
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/KeyboardEventManager.js +3 -19
- package/lib/module/web/tools/KeyboardEventManager.js.map +1 -1
- package/lib/module/web/tools/LeastSquareSolver.js +30 -65
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +9 -14
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +9 -35
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +23 -54
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js +3 -14
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +9 -26
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/web/tools/WheelEventManager.js +3 -10
- package/lib/module/web/tools/WheelEventManager.js.map +1 -1
- package/lib/module/web/utils.js +21 -40
- package/lib/module/web/utils.js.map +1 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +4 -13
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +0 -5
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/Errors.js +0 -1
- package/lib/module/web_hammer/Errors.js.map +1 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +10 -35
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/GestureHandler.js +53 -130
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +1 -6
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +2 -11
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +12 -12
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/NodeManager.js +6 -8
- package/lib/module/web_hammer/NodeManager.js.map +1 -1
- package/lib/module/web_hammer/PanGestureHandler.js +6 -40
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +0 -5
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/PressGestureHandler.js +13 -34
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +0 -6
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/TapGestureHandler.js +31 -45
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -1
- package/lib/module/web_hammer/constants.js +2 -1
- package/lib/module/web_hammer/constants.js.map +1 -1
- package/lib/module/web_hammer/utils.js +2 -2
- package/lib/module/web_hammer/utils.js.map +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +27 -0
- package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
- package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
- package/lib/typescript/components/Pressable/index.d.ts +1 -1
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -1
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
- package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
- package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
- package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
- package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
- package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
- package/package.json +2 -2
- package/src/RNGestureHandlerModule.web.ts +2 -2
- package/src/components/DrawerLayout.tsx +29 -0
- package/src/components/GestureButtons.tsx +13 -2
- package/src/components/GestureButtonsProps.ts +31 -2
- package/src/components/Pressable/Pressable.tsx +22 -5
- package/src/components/Pressable/PressableProps.tsx +4 -11
- package/src/components/Pressable/index.ts +4 -1
- package/src/components/ReanimatedSwipeable.tsx +97 -66
- package/src/components/Text.tsx +13 -4
- package/src/components/touchables/TouchableHighlight.tsx +5 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +5 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
- package/src/findNodeHandle.web.ts +6 -0
- package/src/handlers/FlingGestureHandler.ts +10 -0
- package/src/handlers/ForceTouchGestureHandler.ts +9 -0
- package/src/handlers/LongPressGestureHandler.ts +10 -0
- package/src/handlers/NativeViewGestureHandler.ts +10 -0
- package/src/handlers/PanGestureHandler.ts +10 -0
- package/src/handlers/PinchGestureHandler.ts +10 -0
- package/src/handlers/RotationGestureHandler.ts +10 -0
- package/src/handlers/TapGestureHandler.ts +10 -0
- package/src/handlers/createHandler.tsx +11 -4
- package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
- package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
- package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
- package/src/handlers/handlersRegistry.ts +7 -3
- package/src/index.ts +4 -1
- package/src/utils.ts +2 -2
- package/src/web/detectors/RotationGestureDetector.ts +22 -22
- package/src/web/detectors/ScaleGestureDetector.ts +24 -24
- package/src/web/handlers/FlingGestureHandler.ts +6 -7
- package/src/web/handlers/GestureHandler.ts +115 -105
- package/src/web/handlers/HoverGestureHandler.ts +2 -2
- package/src/web/handlers/IGestureHandler.ts +12 -13
- package/src/web/handlers/LongPressGestureHandler.ts +7 -7
- package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
- package/src/web/handlers/PanGestureHandler.ts +17 -17
- package/src/web/handlers/PinchGestureHandler.ts +17 -21
- package/src/web/handlers/RotationGestureHandler.ts +12 -12
- package/src/web/handlers/TapGestureHandler.ts +4 -6
- package/src/web/tools/CircularBuffer.ts +15 -15
- package/src/web/tools/GestureHandlerDelegate.ts +1 -1
- package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
- package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
- package/src/web/tools/InteractionManager.ts +16 -16
- package/src/web/tools/NodeManager.ts +2 -2
- package/src/web/tools/PointerTracker.ts +20 -20
- package/src/web/tools/Vector.ts +1 -1
- package/src/web/tools/VelocityTracker.ts +1 -1
@@ -4,61 +4,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
var _State = require("../../State");
|
9
|
-
|
10
8
|
var _interfaces = require("../interfaces");
|
11
|
-
|
12
9
|
var _GestureHandler = _interopRequireDefault(require("./GestureHandler"));
|
13
|
-
|
14
|
-
function
|
15
|
-
|
16
|
-
function
|
17
|
-
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
13
|
+
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); }
|
18
14
|
const DEFAULT_MAX_DURATION_MS = 500;
|
19
15
|
const DEFAULT_MAX_DELAY_MS = 500;
|
20
16
|
const DEFAULT_NUMBER_OF_TAPS = 1;
|
21
17
|
const DEFAULT_MIN_NUMBER_OF_POINTERS = 1;
|
22
|
-
|
23
18
|
class TapGestureHandler extends _GestureHandler.default {
|
24
19
|
constructor(...args) {
|
25
20
|
super(...args);
|
26
|
-
|
27
21
|
_defineProperty(this, "maxDeltaX", Number.MIN_SAFE_INTEGER);
|
28
|
-
|
29
22
|
_defineProperty(this, "maxDeltaY", Number.MIN_SAFE_INTEGER);
|
30
|
-
|
31
23
|
_defineProperty(this, "maxDistSq", Number.MIN_SAFE_INTEGER);
|
32
|
-
|
33
24
|
_defineProperty(this, "maxDurationMs", DEFAULT_MAX_DURATION_MS);
|
34
|
-
|
35
25
|
_defineProperty(this, "maxDelayMs", DEFAULT_MAX_DELAY_MS);
|
36
|
-
|
37
26
|
_defineProperty(this, "numberOfTaps", DEFAULT_NUMBER_OF_TAPS);
|
38
|
-
|
39
27
|
_defineProperty(this, "minNumberOfPointers", DEFAULT_MIN_NUMBER_OF_POINTERS);
|
40
|
-
|
41
28
|
_defineProperty(this, "currentMaxNumberOfPointers", 1);
|
42
|
-
|
43
29
|
_defineProperty(this, "startX", 0);
|
44
|
-
|
45
30
|
_defineProperty(this, "startY", 0);
|
46
|
-
|
47
31
|
_defineProperty(this, "offsetX", 0);
|
48
|
-
|
49
32
|
_defineProperty(this, "offsetY", 0);
|
50
|
-
|
51
33
|
_defineProperty(this, "lastX", 0);
|
52
|
-
|
53
34
|
_defineProperty(this, "lastY", 0);
|
54
|
-
|
55
35
|
_defineProperty(this, "waitTimeout", void 0);
|
56
|
-
|
57
36
|
_defineProperty(this, "delayTimeout", void 0);
|
58
|
-
|
59
37
|
_defineProperty(this, "tapsSoFar", 0);
|
60
38
|
}
|
61
|
-
|
62
39
|
updateGestureConfig({
|
63
40
|
enabled = true,
|
64
41
|
...props
|
@@ -67,36 +44,28 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
67
44
|
enabled: enabled,
|
68
45
|
...props
|
69
46
|
});
|
70
|
-
|
71
47
|
if (this.config.numberOfTaps !== undefined) {
|
72
48
|
this.numberOfTaps = this.config.numberOfTaps;
|
73
49
|
}
|
74
|
-
|
75
50
|
if (this.config.maxDurationMs !== undefined) {
|
76
51
|
this.maxDurationMs = this.config.maxDurationMs;
|
77
52
|
}
|
78
|
-
|
79
53
|
if (this.config.maxDelayMs !== undefined) {
|
80
54
|
this.maxDelayMs = this.config.maxDelayMs;
|
81
55
|
}
|
82
|
-
|
83
56
|
if (this.config.maxDeltaX !== undefined) {
|
84
57
|
this.maxDeltaX = this.config.maxDeltaX;
|
85
58
|
}
|
86
|
-
|
87
59
|
if (this.config.maxDeltaY !== undefined) {
|
88
60
|
this.maxDeltaY = this.config.maxDeltaY;
|
89
61
|
}
|
90
|
-
|
91
62
|
if (this.config.maxDist !== undefined) {
|
92
63
|
this.maxDistSq = this.config.maxDist * this.config.maxDist;
|
93
64
|
}
|
94
|
-
|
95
65
|
if (this.config.minPointers !== undefined) {
|
96
66
|
this.minNumberOfPointers = this.config.minPointers;
|
97
67
|
}
|
98
68
|
}
|
99
|
-
|
100
69
|
resetConfig() {
|
101
70
|
super.resetConfig();
|
102
71
|
this.maxDeltaX = Number.MIN_SAFE_INTEGER;
|
@@ -107,33 +76,28 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
107
76
|
this.numberOfTaps = DEFAULT_NUMBER_OF_TAPS;
|
108
77
|
this.minNumberOfPointers = DEFAULT_MIN_NUMBER_OF_POINTERS;
|
109
78
|
}
|
110
|
-
|
111
79
|
clearTimeouts() {
|
112
80
|
clearTimeout(this.waitTimeout);
|
113
81
|
clearTimeout(this.delayTimeout);
|
114
82
|
}
|
115
|
-
|
116
83
|
startTap() {
|
117
84
|
this.clearTimeouts();
|
118
85
|
this.waitTimeout = setTimeout(() => this.fail(), this.maxDurationMs);
|
119
86
|
}
|
120
|
-
|
121
87
|
endTap() {
|
122
88
|
this.clearTimeouts();
|
123
|
-
|
124
89
|
if (++this.tapsSoFar === this.numberOfTaps && this.currentMaxNumberOfPointers >= this.minNumberOfPointers) {
|
125
90
|
this.activate();
|
126
91
|
} else {
|
127
92
|
this.delayTimeout = setTimeout(() => this.fail(), this.maxDelayMs);
|
128
93
|
}
|
129
|
-
}
|
130
|
-
|
94
|
+
}
|
131
95
|
|
96
|
+
// Handling Events
|
132
97
|
onPointerDown(event) {
|
133
98
|
if (!this.isButtonInConfig(event.button)) {
|
134
99
|
return;
|
135
100
|
}
|
136
|
-
|
137
101
|
this.tracker.addToTracker(event);
|
138
102
|
super.onPointerDown(event);
|
139
103
|
this.trySettingPosition(event);
|
@@ -144,7 +108,6 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
144
108
|
this.updateState(event);
|
145
109
|
this.tryToSendTouchEvent(event);
|
146
110
|
}
|
147
|
-
|
148
111
|
onPointerAdd(event) {
|
149
112
|
super.onPointerAdd(event);
|
150
113
|
this.tracker.addToTracker(event);
|
@@ -158,7 +121,6 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
158
121
|
this.startY = lastCoords.y;
|
159
122
|
this.updateState(event);
|
160
123
|
}
|
161
|
-
|
162
124
|
onPointerUp(event) {
|
163
125
|
super.onPointerUp(event);
|
164
126
|
const lastCoords = this.tracker.getAbsoluteCoordsAverage();
|
@@ -167,7 +129,6 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
167
129
|
this.tracker.removeFromTracker(event.pointerId);
|
168
130
|
this.updateState(event);
|
169
131
|
}
|
170
|
-
|
171
132
|
onPointerRemove(event) {
|
172
133
|
super.onPointerRemove(event);
|
173
134
|
this.tracker.removeFromTracker(event.pointerId);
|
@@ -180,7 +141,6 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
180
141
|
this.startY = this.lastY;
|
181
142
|
this.updateState(event);
|
182
143
|
}
|
183
|
-
|
184
144
|
onPointerMove(event) {
|
185
145
|
this.trySettingPosition(event);
|
186
146
|
this.tracker.track(event);
|
@@ -190,7 +150,6 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
190
150
|
this.updateState(event);
|
191
151
|
super.onPointerMove(event);
|
192
152
|
}
|
193
|
-
|
194
153
|
onPointerOutOfBounds(event) {
|
195
154
|
this.trySettingPosition(event);
|
196
155
|
this.tracker.track(event);
|
@@ -200,87 +159,67 @@ class TapGestureHandler extends _GestureHandler.default {
|
|
200
159
|
this.updateState(event);
|
201
160
|
super.onPointerOutOfBounds(event);
|
202
161
|
}
|
203
|
-
|
204
162
|
updateState(event) {
|
205
|
-
if (this.currentMaxNumberOfPointers < this.tracker.
|
206
|
-
this.currentMaxNumberOfPointers = this.tracker.
|
163
|
+
if (this.currentMaxNumberOfPointers < this.tracker.trackedPointersCount) {
|
164
|
+
this.currentMaxNumberOfPointers = this.tracker.trackedPointersCount;
|
207
165
|
}
|
208
|
-
|
209
166
|
if (this.shouldFail()) {
|
210
167
|
this.fail();
|
211
168
|
return;
|
212
169
|
}
|
213
|
-
|
214
|
-
switch (this.currentState) {
|
170
|
+
switch (this.state) {
|
215
171
|
case _State.State.UNDETERMINED:
|
216
172
|
if (event.eventType === _interfaces.EventTypes.DOWN) {
|
217
173
|
this.begin();
|
218
174
|
}
|
219
|
-
|
220
175
|
this.startTap();
|
221
176
|
break;
|
222
|
-
|
223
177
|
case _State.State.BEGAN:
|
224
178
|
if (event.eventType === _interfaces.EventTypes.UP) {
|
225
179
|
this.endTap();
|
226
180
|
}
|
227
|
-
|
228
181
|
if (event.eventType === _interfaces.EventTypes.DOWN) {
|
229
182
|
this.startTap();
|
230
183
|
}
|
231
|
-
|
232
184
|
break;
|
233
|
-
|
234
185
|
default:
|
235
186
|
break;
|
236
187
|
}
|
237
188
|
}
|
238
|
-
|
239
189
|
trySettingPosition(event) {
|
240
|
-
if (this.
|
190
|
+
if (this.state !== _State.State.UNDETERMINED) {
|
241
191
|
return;
|
242
192
|
}
|
243
|
-
|
244
193
|
this.offsetX = 0;
|
245
194
|
this.offsetY = 0;
|
246
195
|
this.startX = event.x;
|
247
196
|
this.startY = event.y;
|
248
197
|
}
|
249
|
-
|
250
198
|
shouldFail() {
|
251
199
|
const dx = this.lastX - this.startX + this.offsetX;
|
252
|
-
|
253
200
|
if (this.maxDeltaX !== Number.MIN_SAFE_INTEGER && Math.abs(dx) > this.maxDeltaX) {
|
254
201
|
return true;
|
255
202
|
}
|
256
|
-
|
257
203
|
const dy = this.lastY - this.startY + this.offsetY;
|
258
|
-
|
259
204
|
if (this.maxDeltaY !== Number.MIN_SAFE_INTEGER && Math.abs(dy) > this.maxDeltaY) {
|
260
205
|
return true;
|
261
206
|
}
|
262
|
-
|
263
207
|
const distSq = dy * dy + dx * dx;
|
264
208
|
return this.maxDistSq !== Number.MIN_SAFE_INTEGER && distSq > this.maxDistSq;
|
265
209
|
}
|
266
|
-
|
267
210
|
activate() {
|
268
211
|
super.activate();
|
269
212
|
this.end();
|
270
213
|
}
|
271
|
-
|
272
214
|
onCancel() {
|
273
215
|
this.resetProgress();
|
274
216
|
this.clearTimeouts();
|
275
217
|
}
|
276
|
-
|
277
218
|
resetProgress() {
|
278
219
|
this.clearTimeouts();
|
279
220
|
this.tapsSoFar = 0;
|
280
221
|
this.currentMaxNumberOfPointers = 0;
|
281
222
|
}
|
282
|
-
|
283
223
|
}
|
284
|
-
|
285
224
|
exports.default = TapGestureHandler;
|
286
225
|
//# sourceMappingURL=TapGestureHandler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["TapGestureHandler.ts"],"names":["DEFAULT_MAX_DURATION_MS","DEFAULT_MAX_DELAY_MS","DEFAULT_NUMBER_OF_TAPS","DEFAULT_MIN_NUMBER_OF_POINTERS","TapGestureHandler","GestureHandler","Number","MIN_SAFE_INTEGER","updateGestureConfig","enabled","props","config","numberOfTaps","undefined","maxDurationMs","maxDelayMs","maxDeltaX","maxDeltaY","maxDist","maxDistSq","minPointers","minNumberOfPointers","resetConfig","clearTimeouts","clearTimeout","waitTimeout","delayTimeout","startTap","setTimeout","fail","endTap","tapsSoFar","currentMaxNumberOfPointers","activate","onPointerDown","event","isButtonInConfig","button","tracker","addToTracker","trySettingPosition","startX","x","startY","y","lastX","lastY","updateState","tryToSendTouchEvent","onPointerAdd","offsetX","offsetY","lastCoords","getAbsoluteCoordsAverage","onPointerUp","removeFromTracker","pointerId","onPointerRemove","onPointerMove","track","onPointerOutOfBounds","getTrackedPointersCount","shouldFail","currentState","State","UNDETERMINED","eventType","EventTypes","DOWN","begin","BEGAN","UP","dx","Math","abs","dy","distSq","end","onCancel","resetProgress"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAEA,MAAMA,uBAAuB,GAAG,GAAhC;AACA,MAAMC,oBAAoB,GAAG,GAA7B;AACA,MAAMC,sBAAsB,GAAG,CAA/B;AACA,MAAMC,8BAA8B,GAAG,CAAvC;;AAEe,MAAMC,iBAAN,SAAgCC,uBAAhC,CAA+C;AAAA;AAAA;;AAAA,uCACxCC,MAAM,CAACC,gBADiC;;AAAA,uCAExCD,MAAM,CAACC,gBAFiC;;AAAA,uCAGxCD,MAAM,CAACC,gBAHiC;;AAAA,2CAIpCP,uBAJoC;;AAAA,wCAKvCC,oBALuC;;AAAA,0CAOrCC,sBAPqC;;AAAA,iDAQ9BC,8BAR8B;;AAAA,wDASvB,CATuB;;AAAA,oCAW3C,CAX2C;;AAAA,oCAY3C,CAZ2C;;AAAA,qCAa1C,CAb0C;;AAAA,qCAc1C,CAd0C;;AAAA,mCAe5C,CAf4C;;AAAA,mCAgB5C,CAhB4C;;AAAA;;AAAA;;AAAA,uCAqBxC,C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b,MAAM,CAACC,gBAA1B,IAA8CqE,MAAM,GAAG,KAAKzD,SAD9D;AAGD;;AAEMc,EAAAA,QAAQ,GAAS;AACtB,UAAMA,QAAN;AAEA,SAAK4C,GAAL;AACD;;AAESC,EAAAA,QAAQ,GAAS;AACzB,SAAKC,aAAL;AACA,SAAKxD,aAAL;AACD;;AAESwD,EAAAA,aAAa,GAAS;AAC9B,SAAKxD,aAAL;AACA,SAAKQ,SAAL,GAAiB,CAAjB;AACA,SAAKC,0BAAL,GAAkC,CAAlC;AACD;;AA7Q2D","sourcesContent":["import { State } from '../../State';\nimport { AdaptedEvent, Config, EventTypes } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\n\nconst DEFAULT_MAX_DURATION_MS = 500;\nconst DEFAULT_MAX_DELAY_MS = 500;\nconst DEFAULT_NUMBER_OF_TAPS = 1;\nconst DEFAULT_MIN_NUMBER_OF_POINTERS = 1;\n\nexport default class TapGestureHandler extends GestureHandler {\n private maxDeltaX = Number.MIN_SAFE_INTEGER;\n private maxDeltaY = Number.MIN_SAFE_INTEGER;\n private maxDistSq = Number.MIN_SAFE_INTEGER;\n private maxDurationMs = DEFAULT_MAX_DURATION_MS;\n private maxDelayMs = DEFAULT_MAX_DELAY_MS;\n\n private numberOfTaps = DEFAULT_NUMBER_OF_TAPS;\n private minNumberOfPointers = DEFAULT_MIN_NUMBER_OF_POINTERS;\n private currentMaxNumberOfPointers = 1;\n\n private startX = 0;\n private startY = 0;\n private offsetX = 0;\n private offsetY = 0;\n private lastX = 0;\n private lastY = 0;\n\n private waitTimeout: number | undefined;\n private delayTimeout: number | undefined;\n\n private tapsSoFar = 0;\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.numberOfTaps !== undefined) {\n this.numberOfTaps = this.config.numberOfTaps;\n }\n\n if (this.config.maxDurationMs !== undefined) {\n this.maxDurationMs = this.config.maxDurationMs;\n }\n\n if (this.config.maxDelayMs !== undefined) {\n this.maxDelayMs = this.config.maxDelayMs;\n }\n\n if (this.config.maxDeltaX !== undefined) {\n this.maxDeltaX = this.config.maxDeltaX;\n }\n\n if (this.config.maxDeltaY !== undefined) {\n this.maxDeltaY = this.config.maxDeltaY;\n }\n\n if (this.config.maxDist !== undefined) {\n this.maxDistSq = this.config.maxDist * this.config.maxDist;\n }\n\n if (this.config.minPointers !== undefined) {\n this.minNumberOfPointers = this.config.minPointers;\n }\n }\n\n protected resetConfig(): void {\n super.resetConfig();\n\n this.maxDeltaX = Number.MIN_SAFE_INTEGER;\n this.maxDeltaY = Number.MIN_SAFE_INTEGER;\n this.maxDistSq = Number.MIN_SAFE_INTEGER;\n this.maxDurationMs = DEFAULT_MAX_DURATION_MS;\n this.maxDelayMs = DEFAULT_MAX_DELAY_MS;\n this.numberOfTaps = DEFAULT_NUMBER_OF_TAPS;\n this.minNumberOfPointers = DEFAULT_MIN_NUMBER_OF_POINTERS;\n }\n\n private clearTimeouts(): void {\n clearTimeout(this.waitTimeout);\n clearTimeout(this.delayTimeout);\n }\n\n private startTap(): void {\n this.clearTimeouts();\n\n this.waitTimeout = setTimeout(() => this.fail(), this.maxDurationMs);\n }\n\n private endTap(): void {\n this.clearTimeouts();\n\n if (\n ++this.tapsSoFar === this.numberOfTaps &&\n this.currentMaxNumberOfPointers >= this.minNumberOfPointers\n ) {\n this.activate();\n } else {\n this.delayTimeout = setTimeout(() => this.fail(), this.maxDelayMs);\n }\n }\n\n // Handling Events\n protected onPointerDown(event: AdaptedEvent): void {\n if (!this.isButtonInConfig(event.button)) {\n return;\n }\n\n this.tracker.addToTracker(event);\n super.onPointerDown(event);\n\n this.trySettingPosition(event);\n\n this.startX = event.x;\n this.startY = event.y;\n\n this.lastX = event.x;\n this.lastY = event.y;\n\n this.updateState(event);\n\n this.tryToSendTouchEvent(event);\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n super.onPointerAdd(event);\n this.tracker.addToTracker(event);\n this.trySettingPosition(event);\n\n this.offsetX += this.lastX - this.startX;\n this.offsetY += this.lastY - this.startY;\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.startX = lastCoords.x;\n this.startY = lastCoords.y;\n\n this.updateState(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.tracker.removeFromTracker(event.pointerId);\n\n this.updateState(event);\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.tracker.removeFromTracker(event.pointerId);\n\n this.offsetX += this.lastX - this.startX;\n this.offsetY += this.lastY = this.startY;\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.startX = this.lastX;\n this.startY = this.lastY;\n\n this.updateState(event);\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.trySettingPosition(event);\n this.tracker.track(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.updateState(event);\n\n super.onPointerMove(event);\n }\n\n protected onPointerOutOfBounds(event: AdaptedEvent): void {\n this.trySettingPosition(event);\n this.tracker.track(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.updateState(event);\n\n super.onPointerOutOfBounds(event);\n }\n\n private updateState(event: AdaptedEvent): void {\n if (\n this.currentMaxNumberOfPointers < this.tracker.getTrackedPointersCount()\n ) {\n this.currentMaxNumberOfPointers = this.tracker.getTrackedPointersCount();\n }\n\n if (this.shouldFail()) {\n this.fail();\n return;\n }\n\n switch (this.currentState) {\n case State.UNDETERMINED:\n if (event.eventType === EventTypes.DOWN) {\n this.begin();\n }\n this.startTap();\n break;\n case State.BEGAN:\n if (event.eventType === EventTypes.UP) {\n this.endTap();\n }\n if (event.eventType === EventTypes.DOWN) {\n this.startTap();\n }\n break;\n default:\n break;\n }\n }\n\n private trySettingPosition(event: AdaptedEvent): void {\n if (this.currentState !== State.UNDETERMINED) {\n return;\n }\n\n this.offsetX = 0;\n this.offsetY = 0;\n this.startX = event.x;\n this.startY = event.y;\n }\n\n private shouldFail(): boolean {\n const dx = this.lastX - this.startX + this.offsetX;\n\n if (\n this.maxDeltaX !== Number.MIN_SAFE_INTEGER &&\n Math.abs(dx) > this.maxDeltaX\n ) {\n return true;\n }\n\n const dy = this.lastY - this.startY + this.offsetY;\n if (\n this.maxDeltaY !== Number.MIN_SAFE_INTEGER &&\n Math.abs(dy) > this.maxDeltaY\n ) {\n return true;\n }\n\n const distSq = dy * dy + dx * dx;\n\n return (\n this.maxDistSq !== Number.MIN_SAFE_INTEGER && distSq > this.maxDistSq\n );\n }\n\n public activate(): void {\n super.activate();\n\n this.end();\n }\n\n protected onCancel(): void {\n this.resetProgress();\n this.clearTimeouts();\n }\n\n protected resetProgress(): void {\n this.clearTimeouts();\n this.tapsSoFar = 0;\n this.currentMaxNumberOfPointers = 0;\n }\n}\n"]}
|
1
|
+
{"version":3,"names":["_State","require","_interfaces","_GestureHandler","_interopRequireDefault","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_MAX_DURATION_MS","DEFAULT_MAX_DELAY_MS","DEFAULT_NUMBER_OF_TAPS","DEFAULT_MIN_NUMBER_OF_POINTERS","TapGestureHandler","GestureHandler","constructor","args","MIN_SAFE_INTEGER","updateGestureConfig","enabled","props","config","numberOfTaps","undefined","maxDurationMs","maxDelayMs","maxDeltaX","maxDeltaY","maxDist","maxDistSq","minPointers","minNumberOfPointers","resetConfig","clearTimeouts","clearTimeout","waitTimeout","delayTimeout","startTap","setTimeout","fail","endTap","tapsSoFar","currentMaxNumberOfPointers","activate","onPointerDown","event","isButtonInConfig","button","tracker","addToTracker","trySettingPosition","startX","x","startY","y","lastX","lastY","updateState","tryToSendTouchEvent","onPointerAdd","offsetX","offsetY","lastCoords","getAbsoluteCoordsAverage","onPointerUp","removeFromTracker","pointerId","onPointerRemove","onPointerMove","track","onPointerOutOfBounds","trackedPointersCount","shouldFail","state","State","UNDETERMINED","eventType","EventTypes","DOWN","begin","BEGAN","UP","dx","Math","abs","dy","distSq","end","onCancel","resetProgress","exports"],"sources":["TapGestureHandler.ts"],"sourcesContent":["import { State } from '../../State';\nimport { AdaptedEvent, Config, EventTypes } from '../interfaces';\n\nimport GestureHandler from './GestureHandler';\n\nconst DEFAULT_MAX_DURATION_MS = 500;\nconst DEFAULT_MAX_DELAY_MS = 500;\nconst DEFAULT_NUMBER_OF_TAPS = 1;\nconst DEFAULT_MIN_NUMBER_OF_POINTERS = 1;\n\nexport default class TapGestureHandler extends GestureHandler {\n private maxDeltaX = Number.MIN_SAFE_INTEGER;\n private maxDeltaY = Number.MIN_SAFE_INTEGER;\n private maxDistSq = Number.MIN_SAFE_INTEGER;\n private maxDurationMs = DEFAULT_MAX_DURATION_MS;\n private maxDelayMs = DEFAULT_MAX_DELAY_MS;\n\n private numberOfTaps = DEFAULT_NUMBER_OF_TAPS;\n private minNumberOfPointers = DEFAULT_MIN_NUMBER_OF_POINTERS;\n private currentMaxNumberOfPointers = 1;\n\n private startX = 0;\n private startY = 0;\n private offsetX = 0;\n private offsetY = 0;\n private lastX = 0;\n private lastY = 0;\n\n private waitTimeout: number | undefined;\n private delayTimeout: number | undefined;\n\n private tapsSoFar = 0;\n\n public updateGestureConfig({ enabled = true, ...props }: Config): void {\n super.updateGestureConfig({ enabled: enabled, ...props });\n\n if (this.config.numberOfTaps !== undefined) {\n this.numberOfTaps = this.config.numberOfTaps;\n }\n\n if (this.config.maxDurationMs !== undefined) {\n this.maxDurationMs = this.config.maxDurationMs;\n }\n\n if (this.config.maxDelayMs !== undefined) {\n this.maxDelayMs = this.config.maxDelayMs;\n }\n\n if (this.config.maxDeltaX !== undefined) {\n this.maxDeltaX = this.config.maxDeltaX;\n }\n\n if (this.config.maxDeltaY !== undefined) {\n this.maxDeltaY = this.config.maxDeltaY;\n }\n\n if (this.config.maxDist !== undefined) {\n this.maxDistSq = this.config.maxDist * this.config.maxDist;\n }\n\n if (this.config.minPointers !== undefined) {\n this.minNumberOfPointers = this.config.minPointers;\n }\n }\n\n protected resetConfig(): void {\n super.resetConfig();\n\n this.maxDeltaX = Number.MIN_SAFE_INTEGER;\n this.maxDeltaY = Number.MIN_SAFE_INTEGER;\n this.maxDistSq = Number.MIN_SAFE_INTEGER;\n this.maxDurationMs = DEFAULT_MAX_DURATION_MS;\n this.maxDelayMs = DEFAULT_MAX_DELAY_MS;\n this.numberOfTaps = DEFAULT_NUMBER_OF_TAPS;\n this.minNumberOfPointers = DEFAULT_MIN_NUMBER_OF_POINTERS;\n }\n\n private clearTimeouts(): void {\n clearTimeout(this.waitTimeout);\n clearTimeout(this.delayTimeout);\n }\n\n private startTap(): void {\n this.clearTimeouts();\n\n this.waitTimeout = setTimeout(() => this.fail(), this.maxDurationMs);\n }\n\n private endTap(): void {\n this.clearTimeouts();\n\n if (\n ++this.tapsSoFar === this.numberOfTaps &&\n this.currentMaxNumberOfPointers >= this.minNumberOfPointers\n ) {\n this.activate();\n } else {\n this.delayTimeout = setTimeout(() => this.fail(), this.maxDelayMs);\n }\n }\n\n // Handling Events\n protected onPointerDown(event: AdaptedEvent): void {\n if (!this.isButtonInConfig(event.button)) {\n return;\n }\n\n this.tracker.addToTracker(event);\n super.onPointerDown(event);\n\n this.trySettingPosition(event);\n\n this.startX = event.x;\n this.startY = event.y;\n\n this.lastX = event.x;\n this.lastY = event.y;\n\n this.updateState(event);\n\n this.tryToSendTouchEvent(event);\n }\n\n protected onPointerAdd(event: AdaptedEvent): void {\n super.onPointerAdd(event);\n this.tracker.addToTracker(event);\n this.trySettingPosition(event);\n\n this.offsetX += this.lastX - this.startX;\n this.offsetY += this.lastY - this.startY;\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.startX = lastCoords.x;\n this.startY = lastCoords.y;\n\n this.updateState(event);\n }\n\n protected onPointerUp(event: AdaptedEvent): void {\n super.onPointerUp(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.tracker.removeFromTracker(event.pointerId);\n\n this.updateState(event);\n }\n\n protected onPointerRemove(event: AdaptedEvent): void {\n super.onPointerRemove(event);\n this.tracker.removeFromTracker(event.pointerId);\n\n this.offsetX += this.lastX - this.startX;\n this.offsetY += this.lastY = this.startY;\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.startX = this.lastX;\n this.startY = this.lastY;\n\n this.updateState(event);\n }\n\n protected onPointerMove(event: AdaptedEvent): void {\n this.trySettingPosition(event);\n this.tracker.track(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.updateState(event);\n\n super.onPointerMove(event);\n }\n\n protected onPointerOutOfBounds(event: AdaptedEvent): void {\n this.trySettingPosition(event);\n this.tracker.track(event);\n\n const lastCoords = this.tracker.getAbsoluteCoordsAverage();\n this.lastX = lastCoords.x;\n this.lastY = lastCoords.y;\n\n this.updateState(event);\n\n super.onPointerOutOfBounds(event);\n }\n\n private updateState(event: AdaptedEvent): void {\n if (this.currentMaxNumberOfPointers < this.tracker.trackedPointersCount) {\n this.currentMaxNumberOfPointers = this.tracker.trackedPointersCount;\n }\n\n if (this.shouldFail()) {\n this.fail();\n return;\n }\n\n switch (this.state) {\n case State.UNDETERMINED:\n if (event.eventType === EventTypes.DOWN) {\n this.begin();\n }\n this.startTap();\n break;\n case State.BEGAN:\n if (event.eventType === EventTypes.UP) {\n this.endTap();\n }\n if (event.eventType === EventTypes.DOWN) {\n this.startTap();\n }\n break;\n default:\n break;\n }\n }\n\n private trySettingPosition(event: AdaptedEvent): void {\n if (this.state !== State.UNDETERMINED) {\n return;\n }\n\n this.offsetX = 0;\n this.offsetY = 0;\n this.startX = event.x;\n this.startY = event.y;\n }\n\n private shouldFail(): boolean {\n const dx = this.lastX - this.startX + this.offsetX;\n\n if (\n this.maxDeltaX !== Number.MIN_SAFE_INTEGER &&\n Math.abs(dx) > this.maxDeltaX\n ) {\n return true;\n }\n\n const dy = this.lastY - this.startY + this.offsetY;\n if (\n this.maxDeltaY !== Number.MIN_SAFE_INTEGER &&\n Math.abs(dy) > this.maxDeltaY\n ) {\n return true;\n }\n\n const distSq = dy * dy + dx * dx;\n\n return (\n this.maxDistSq !== Number.MIN_SAFE_INTEGER && distSq > this.maxDistSq\n );\n }\n\n public activate(): void {\n super.activate();\n\n this.end();\n }\n\n protected onCancel(): void {\n this.resetProgress();\n this.clearTimeouts();\n }\n\n protected resetProgress(): void {\n this.clearTimeouts();\n this.tapsSoFar = 0;\n this.currentMaxNumberOfPointers = 0;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA8C,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,S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
|
});
|
6
6
|
exports.WheelDevice = exports.TouchEventType = exports.EventTypes = void 0;
|
7
|
-
let EventTypes
|
8
|
-
exports.EventTypes = EventTypes;
|
9
|
-
|
10
|
-
(function (EventTypes) {
|
7
|
+
let EventTypes = exports.EventTypes = /*#__PURE__*/function (EventTypes) {
|
11
8
|
EventTypes[EventTypes["DOWN"] = 0] = "DOWN";
|
12
9
|
EventTypes[EventTypes["ADDITIONAL_POINTER_DOWN"] = 1] = "ADDITIONAL_POINTER_DOWN";
|
13
10
|
EventTypes[EventTypes["UP"] = 2] = "UP";
|
@@ -16,25 +13,20 @@ exports.EventTypes = EventTypes;
|
|
16
13
|
EventTypes[EventTypes["ENTER"] = 5] = "ENTER";
|
17
14
|
EventTypes[EventTypes["LEAVE"] = 6] = "LEAVE";
|
18
15
|
EventTypes[EventTypes["CANCEL"] = 7] = "CANCEL";
|
19
|
-
|
20
|
-
|
21
|
-
let TouchEventType
|
22
|
-
exports.TouchEventType = TouchEventType;
|
23
|
-
|
24
|
-
(function (TouchEventType) {
|
16
|
+
return EventTypes;
|
17
|
+
}({});
|
18
|
+
let TouchEventType = exports.TouchEventType = /*#__PURE__*/function (TouchEventType) {
|
25
19
|
TouchEventType[TouchEventType["UNDETERMINED"] = 0] = "UNDETERMINED";
|
26
20
|
TouchEventType[TouchEventType["DOWN"] = 1] = "DOWN";
|
27
21
|
TouchEventType[TouchEventType["MOVE"] = 2] = "MOVE";
|
28
22
|
TouchEventType[TouchEventType["UP"] = 3] = "UP";
|
29
23
|
TouchEventType[TouchEventType["CANCELLED"] = 4] = "CANCELLED";
|
30
|
-
|
31
|
-
|
32
|
-
let WheelDevice
|
33
|
-
exports.WheelDevice = WheelDevice;
|
34
|
-
|
35
|
-
(function (WheelDevice) {
|
24
|
+
return TouchEventType;
|
25
|
+
}({});
|
26
|
+
let WheelDevice = exports.WheelDevice = /*#__PURE__*/function (WheelDevice) {
|
36
27
|
WheelDevice[WheelDevice["UNDETERMINED"] = 0] = "UNDETERMINED";
|
37
28
|
WheelDevice[WheelDevice["MOUSE"] = 1] = "MOUSE";
|
38
29
|
WheelDevice[WheelDevice["TOUCHPAD"] = 2] = "TOUCHPAD";
|
39
|
-
|
30
|
+
return WheelDevice;
|
31
|
+
}({});
|
40
32
|
//# sourceMappingURL=interfaces.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["EventTypes","exports","TouchEventType","WheelDevice"],"sources":["interfaces.ts"],"sourcesContent":["import {\n UserSelect,\n ActiveCursor,\n MouseButton,\n TouchAction,\n} from '../handlers/gestureHandlerCommon';\nimport { Directions } from '../Directions';\nimport { State } from '../State';\nimport { PointerType } from '../PointerType';\n\nexport interface HitSlop {\n left?: number;\n right?: number;\n top?: number;\n bottom?: number;\n horizontal?: number;\n vertical?: number;\n width?: number;\n height?: number;\n}\n\nexport interface Handler {\n handlerTag: number;\n}\n\ntype ConfigArgs =\n | number\n | boolean\n | HitSlop\n | UserSelect\n | TouchAction\n | ActiveCursor\n | Directions\n | Handler[]\n | null\n | undefined;\n\nexport interface Config extends Record<string, ConfigArgs> {\n enabled: boolean;\n simultaneousHandlers?: Handler[] | null;\n waitFor?: Handler[] | null;\n blocksHandlers?: Handler[] | null;\n hitSlop?: HitSlop;\n shouldCancelWhenOutside?: boolean;\n userSelect?: UserSelect;\n activeCursor?: ActiveCursor;\n mouseButton?: MouseButton;\n enableContextMenu?: boolean;\n touchAction?: TouchAction;\n manualActivation?: boolean;\n\n activateAfterLongPress?: number;\n failOffsetXStart?: number;\n failOffsetYStart?: number;\n failOffsetXEnd?: number;\n failOffsetYEnd?: number;\n activeOffsetXStart?: number;\n activeOffsetXEnd?: number;\n activeOffsetYStart?: number;\n activeOffsetYEnd?: number;\n minPointers?: number;\n maxPointers?: number;\n minDist?: number;\n minDistSq?: number;\n minVelocity?: number;\n minVelocityX?: number;\n minVelocityY?: number;\n minVelocitySq?: number;\n maxDist?: number;\n maxDistSq?: number;\n numberOfPointers?: number;\n minDurationMs?: number;\n numberOfTaps?: number;\n maxDurationMs?: number;\n maxDelayMs?: number;\n maxDeltaX?: number;\n maxDeltaY?: number;\n shouldActivateOnStart?: boolean;\n disallowInterruption?: boolean;\n direction?: Directions;\n enableTrackpadTwoFingerGesture?: boolean;\n}\n\ntype NativeEventArgs = number | State | boolean | undefined;\ninterface NativeEvent extends Record<string, NativeEventArgs> {\n numberOfPointers: number;\n state: State;\n pointerInside: boolean | undefined;\n handlerTag: number;\n target: number;\n oldState?: State;\n pointerType: PointerType;\n}\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface PointerData {\n id: number;\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n}\n\ntype TouchNativeArgs = number | State | TouchEventType | PointerData[];\n\ninterface NativeTouchEvent extends Record<string, TouchNativeArgs> {\n handlerTag: number;\n state: State;\n eventType: TouchEventType;\n changedTouches: PointerData[];\n allTouches: PointerData[];\n numberOfTouches: number;\n pointerType: PointerType;\n}\n\nexport interface ResultEvent extends Record<string, NativeEvent | number> {\n nativeEvent: NativeEvent;\n timeStamp: number;\n}\n\nexport interface ResultTouchEvent\n extends Record<string, NativeTouchEvent | number> {\n nativeEvent: NativeTouchEvent;\n timeStamp: number;\n}\n\nexport interface PropsRef {\n onGestureHandlerEvent: () => void;\n onGestureHandlerStateChange: () => void;\n}\n\nexport interface StylusData {\n tiltX: number;\n tiltY: number;\n azimuthAngle: number;\n altitudeAngle: number;\n pressure: number;\n}\n\nexport interface AdaptedEvent {\n x: number;\n y: number;\n offsetX: number;\n offsetY: number;\n pointerId: number;\n eventType: EventTypes;\n pointerType: PointerType;\n time: number;\n button?: MouseButton;\n stylusData?: StylusData;\n wheelDeltaY?: number;\n}\n\nexport enum EventTypes {\n DOWN,\n ADDITIONAL_POINTER_DOWN,\n UP,\n ADDITIONAL_POINTER_UP,\n MOVE,\n ENTER,\n LEAVE,\n CANCEL,\n}\n\nexport enum TouchEventType {\n UNDETERMINED,\n DOWN,\n MOVE,\n UP,\n CANCELLED,\n}\n\nexport enum WheelDevice {\n UNDETERMINED,\n MOUSE,\n TOUCHPAD,\n}\n\nexport type GestureHandlerRef = {\n viewTag: GestureHandlerRef;\n current: HTMLElement;\n};\n\nexport type SVGRef = {\n elementRef: { current: SVGElement };\n};\n"],"mappings":";;;;;;IA6JYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAWVE,cAAc,GAAAD,OAAA,CAAAC,cAAA,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IAQdC,WAAW,GAAAF,OAAA,CAAAE,WAAA,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
@@ -4,56 +4,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
|
-
function
|
9
|
-
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
|
+
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); }
|
10
10
|
class CircularBuffer {
|
11
11
|
constructor(size) {
|
12
|
-
_defineProperty(this, "
|
13
|
-
|
12
|
+
_defineProperty(this, "capacity", void 0);
|
14
13
|
_defineProperty(this, "buffer", void 0);
|
15
|
-
|
16
14
|
_defineProperty(this, "index", void 0);
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
this.bufferSize = size;
|
15
|
+
_defineProperty(this, "_size", void 0);
|
16
|
+
this.capacity = size;
|
21
17
|
this.buffer = new Array(size);
|
22
18
|
this.index = 0;
|
23
|
-
this.
|
24
|
-
}
|
25
|
-
|
26
|
-
get size() {
|
27
|
-
return this.actualSize;
|
19
|
+
this._size = 0;
|
28
20
|
}
|
29
|
-
|
30
21
|
push(element) {
|
31
22
|
this.buffer[this.index] = element;
|
32
|
-
this.index = (this.index + 1) % this.
|
33
|
-
this.
|
23
|
+
this.index = (this.index + 1) % this.capacity;
|
24
|
+
this._size = Math.min(this.size + 1, this.capacity);
|
34
25
|
}
|
35
|
-
|
36
26
|
get(at) {
|
37
|
-
if (this.
|
38
|
-
let index = (this.index + at) % this.
|
39
|
-
|
27
|
+
if (this._size === this.capacity) {
|
28
|
+
let index = (this.index + at) % this.capacity;
|
40
29
|
if (index < 0) {
|
41
|
-
index += this.
|
30
|
+
index += this.capacity;
|
42
31
|
}
|
43
|
-
|
44
32
|
return this.buffer[index];
|
45
33
|
} else {
|
46
34
|
return this.buffer[at];
|
47
35
|
}
|
48
36
|
}
|
49
|
-
|
50
37
|
clear() {
|
51
|
-
this.buffer = new Array(this.
|
38
|
+
this.buffer = new Array(this.capacity);
|
52
39
|
this.index = 0;
|
53
|
-
this.
|
40
|
+
this._size = 0;
|
41
|
+
}
|
42
|
+
get size() {
|
43
|
+
return this._size;
|
54
44
|
}
|
55
|
-
|
56
45
|
}
|
57
|
-
|
58
46
|
exports.default = CircularBuffer;
|
59
47
|
//# sourceMappingURL=CircularBuffer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["CircularBuffer","constructor","size","_defineProperty","capacity","buffer","Array","index","_size","push","element","Math","min","get","at","clear","exports","default"],"sources":["CircularBuffer.ts"],"sourcesContent":["export default class CircularBuffer<T> {\n private capacity: number;\n private buffer: T[];\n private index: number;\n private _size: number;\n\n constructor(size: number) {\n this.capacity = size;\n this.buffer = new Array<T>(size);\n this.index = 0;\n this._size = 0;\n }\n\n public push(element: T): void {\n this.buffer[this.index] = element;\n this.index = (this.index + 1) % this.capacity;\n this._size = Math.min(this.size + 1, this.capacity);\n }\n\n public get(at: number): T {\n if (this._size === this.capacity) {\n let index = (this.index + at) % this.capacity;\n if (index < 0) {\n index += this.capacity;\n }\n\n return this.buffer[index];\n } else {\n return this.buffer[at];\n }\n }\n\n public clear(): void {\n this.buffer = new Array<T>(this.capacity);\n this.index = 0;\n this._size = 0;\n }\n\n public get size() {\n return this._size;\n }\n}\n"],"mappings":";;;;;;;;;AAAe,MAAMA,cAAc,CAAI;EAMrCC,WAAWA,CAACC,IAAY,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACxB,IAAI,CAACC,QAAQ,GAAGF,IAAI;IACpB,IAAI,CAACG,MAAM,GAAG,IAAIC,KAAK,CAAIJ,IAAI,CAAC;IAChC,IAAI,CAACK,KAAK,GAAG,CAAC;IACd,IAAI,CAACC,KAAK,GAAG,CAAC;EAChB;EAEOC,IAAIA,CAACC,OAAU,EAAQ;IAC5B,IAAI,CAACL,MAAM,CAAC,IAAI,CAACE,KAAK,CAAC,GAAGG,OAAO;IACjC,IAAI,CAACH,KAAK,GAAG,CAAC,IAAI,CAACA,KAAK,GAAG,CAAC,IAAI,IAAI,CAACH,QAAQ;IAC7C,IAAI,CAACI,KAAK,GAAGG,IAAI,CAACC,GAAG,CAAC,IAAI,CAACV,IAAI,GAAG,CAAC,EAAE,IAAI,CAACE,QAAQ,CAAC;EACrD;EAEOS,GAAGA,CAACC,EAAU,EAAK;IACxB,IAAI,IAAI,CAACN,KAAK,KAAK,IAAI,CAACJ,QAAQ,EAAE;MAChC,IAAIG,KAAK,GAAG,CAAC,IAAI,CAACA,KAAK,GAAGO,EAAE,IAAI,IAAI,CAACV,QAAQ;MAC7C,IAAIG,KAAK,GAAG,CAAC,EAAE;QACbA,KAAK,IAAI,IAAI,CAACH,QAAQ;MACxB;MAEA,OAAO,IAAI,CAACC,MAAM,CAACE,KAAK,CAAC;IAC3B,CAAC,MAAM;MACL,OAAO,IAAI,CAACF,MAAM,CAACS,EAAE,CAAC;IACxB;EACF;EAEOC,KAAKA,CAAA,EAAS;IACnB,IAAI,CAACV,MAAM,GAAG,IAAIC,KAAK,CAAI,IAAI,CAACF,QAAQ,CAAC;IACzC,IAAI,CAACG,KAAK,GAAG,CAAC;IACd,IAAI,CAACC,KAAK,GAAG,CAAC;EAChB;EAEA,IAAWN,IAAIA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACM,KAAK;EACnB;AACF;AAACQ,OAAA,CAAAC,OAAA,GAAAjB,cAAA","ignoreList":[]}
|
@@ -4,118 +4,85 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
|
-
function
|
9
|
-
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
|
+
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); }
|
10
10
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
11
|
+
|
11
12
|
class EventManager {
|
12
13
|
constructor(view) {
|
13
14
|
_defineProperty(this, "view", void 0);
|
14
|
-
|
15
15
|
_defineProperty(this, "pointersInBounds", []);
|
16
|
-
|
17
16
|
_defineProperty(this, "activePointersCounter", void 0);
|
18
|
-
|
19
17
|
this.view = view;
|
20
18
|
this.activePointersCounter = 0;
|
21
19
|
}
|
22
|
-
|
23
20
|
onPointerDown(_event) {}
|
24
|
-
|
25
21
|
onPointerAdd(_event) {}
|
26
|
-
|
27
22
|
onPointerUp(_event) {}
|
28
|
-
|
29
23
|
onPointerRemove(_event) {}
|
30
|
-
|
31
24
|
onPointerMove(_event) {}
|
32
|
-
|
33
25
|
onPointerLeave(_event) {} // Called only when pointer is pressed (or touching)
|
34
|
-
|
35
|
-
|
36
26
|
onPointerEnter(_event) {} // Called only when pointer is pressed (or touching)
|
37
|
-
|
38
|
-
|
39
|
-
onPointerCancel(_event) {// When pointer cancel is triggered and there are more pointers on the view, only one pointer is cancelled
|
27
|
+
onPointerCancel(_event) {
|
28
|
+
// When pointer cancel is triggered and there are more pointers on the view, only one pointer is cancelled
|
40
29
|
// Because we want all pointers to be cancelled by that event, we are doing it manually by reseting handler and changing activePointersCounter to 0
|
41
30
|
// Events that correspond to removing the pointer (pointerup, touchend) have condition, that they don't perform any action when activePointersCounter
|
42
31
|
// is equal to 0. This prevents counter from going to negative values, when pointers are removed from view after one of them has been cancelled
|
43
32
|
}
|
44
|
-
|
45
33
|
onPointerOutOfBounds(_event) {}
|
46
|
-
|
47
34
|
onPointerMoveOver(_event) {}
|
48
|
-
|
49
35
|
onPointerMoveOut(_event) {}
|
50
|
-
|
51
36
|
onWheel(_event) {}
|
52
|
-
|
53
37
|
setOnPointerDown(callback) {
|
54
38
|
this.onPointerDown = callback;
|
55
39
|
}
|
56
|
-
|
57
40
|
setOnPointerAdd(callback) {
|
58
41
|
this.onPointerAdd = callback;
|
59
42
|
}
|
60
|
-
|
61
43
|
setOnPointerUp(callback) {
|
62
44
|
this.onPointerUp = callback;
|
63
45
|
}
|
64
|
-
|
65
46
|
setOnPointerRemove(callback) {
|
66
47
|
this.onPointerRemove = callback;
|
67
48
|
}
|
68
|
-
|
69
49
|
setOnPointerMove(callback) {
|
70
50
|
this.onPointerMove = callback;
|
71
51
|
}
|
72
|
-
|
73
52
|
setOnPointerLeave(callback) {
|
74
53
|
this.onPointerLeave = callback;
|
75
54
|
}
|
76
|
-
|
77
55
|
setOnPointerEnter(callback) {
|
78
56
|
this.onPointerEnter = callback;
|
79
57
|
}
|
80
|
-
|
81
58
|
setOnPointerCancel(callback) {
|
82
59
|
this.onPointerCancel = callback;
|
83
60
|
}
|
84
|
-
|
85
61
|
setOnPointerOutOfBounds(callback) {
|
86
62
|
this.onPointerOutOfBounds = callback;
|
87
63
|
}
|
88
|
-
|
89
64
|
setOnPointerMoveOver(callback) {
|
90
65
|
this.onPointerMoveOver = callback;
|
91
66
|
}
|
92
|
-
|
93
67
|
setOnPointerMoveOut(callback) {
|
94
68
|
this.onPointerMoveOut = callback;
|
95
69
|
}
|
96
|
-
|
97
70
|
setOnWheel(callback) {
|
98
71
|
this.onWheel = callback;
|
99
72
|
}
|
100
|
-
|
101
73
|
markAsInBounds(pointerId) {
|
102
74
|
if (this.pointersInBounds.indexOf(pointerId) >= 0) {
|
103
75
|
return;
|
104
76
|
}
|
105
|
-
|
106
77
|
this.pointersInBounds.push(pointerId);
|
107
78
|
}
|
108
|
-
|
109
79
|
markAsOutOfBounds(pointerId) {
|
110
80
|
const index = this.pointersInBounds.indexOf(pointerId);
|
111
|
-
|
112
81
|
if (index < 0) {
|
113
82
|
return;
|
114
83
|
}
|
115
|
-
|
116
84
|
this.pointersInBounds.splice(index, 1);
|
117
85
|
}
|
118
|
-
|
119
86
|
resetManager() {
|
120
87
|
// Reseting activePointersCounter is necessary to make gestures such as pinch work properly
|
121
88
|
// There are gestures that end when there is still one active pointer (like pinch/rotation)
|
@@ -123,11 +90,10 @@ class EventManager {
|
|
123
90
|
// This causes trouble, since only onPointerDown registers gesture in orchestrator, and while gestures receive
|
124
91
|
// Events from active pointer after they finished, next pointerdown event will be registered as additional pointer, not the first one
|
125
92
|
// This casues trouble like gestures getting stuck in END state, even though they should have gone to UNDETERMINED
|
93
|
+
|
126
94
|
this.activePointersCounter = 0;
|
127
95
|
this.pointersInBounds = [];
|
128
96
|
}
|
129
|
-
|
130
97
|
}
|
131
|
-
|
132
98
|
exports.default = EventManager;
|
133
99
|
//# sourceMappingURL=EventManager.js.map
|