@amazon-devices/react-native-gesture-handler 2.0.1758683737
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/DrawerLayout/package.json +6 -0
- package/LICENSE +7 -0
- package/README.kepler.md +167 -0
- package/RNGestureHandler.podspec +41 -0
- package/Swipeable/package.json +6 -0
- package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.bundle +67466 -0
- package/SystemBundles/88ca607de4fbd504c736d8d5ce354ea9743ea4ae485d956b5af49e9af508e705.map +1 -0
- package/SystemModules/amzn__react-native-gesture-handler-2.modules.txt +338 -0
- package/SystemModules/amzn__react-native-gesture-handler-2.private.modules.txt +96 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +578 -0
- package/android/build.gradle +205 -0
- package/android/common/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +5 -0
- package/android/gradle.properties +19 -0
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +10 -0
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +17 -0
- package/android/src/fabric/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +29 -0
- package/android/src/fabric/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +12 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +21 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +807 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +707 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +47 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +120 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +11 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +257 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +9 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +322 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +103 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +23 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +125 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +93 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ScaleGestureDetector.java +558 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +168 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/ViewConfigurationHelper.kt +10 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +16 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +419 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +15 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +77 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +67 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +756 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +100 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +142 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootInterface.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +78 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +51 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +72 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +69 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +51 -0
- package/android/src/main/jni/CMakeLists.txt +25 -0
- package/android/src/main/jni/cpp-adapter.cpp +44 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +50 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +23 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +16 -0
- package/android/src/paper/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +13 -0
- package/ios/Handlers/RNFlingHandler.h +4 -0
- package/ios/Handlers/RNFlingHandler.m +152 -0
- package/ios/Handlers/RNForceTouchHandler.h +4 -0
- package/ios/Handlers/RNForceTouchHandler.m +175 -0
- package/ios/Handlers/RNHoverHandler.h +12 -0
- package/ios/Handlers/RNHoverHandler.m +152 -0
- package/ios/Handlers/RNLongPressHandler.h +12 -0
- package/ios/Handlers/RNLongPressHandler.m +183 -0
- package/ios/Handlers/RNManualHandler.h +4 -0
- package/ios/Handlers/RNManualHandler.m +88 -0
- package/ios/Handlers/RNNativeViewHandler.h +15 -0
- package/ios/Handlers/RNNativeViewHandler.mm +193 -0
- package/ios/Handlers/RNPanHandler.h +12 -0
- package/ios/Handlers/RNPanHandler.m +331 -0
- package/ios/Handlers/RNPinchHandler.h +12 -0
- package/ios/Handlers/RNPinchHandler.m +95 -0
- package/ios/Handlers/RNRotationHandler.h +12 -0
- package/ios/Handlers/RNRotationHandler.m +93 -0
- package/ios/Handlers/RNTapHandler.h +12 -0
- package/ios/Handlers/RNTapHandler.m +265 -0
- package/ios/RNGHTouchEventType.h +9 -0
- package/ios/RNGestureHandler.h +90 -0
- package/ios/RNGestureHandler.m +482 -0
- package/ios/RNGestureHandler.xcodeproj/project.pbxproj +690 -0
- package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNGestureHandlerActionType.h +10 -0
- package/ios/RNGestureHandlerButton.h +19 -0
- package/ios/RNGestureHandlerButton.m +77 -0
- package/ios/RNGestureHandlerButtonComponentView.h +17 -0
- package/ios/RNGestureHandlerButtonComponentView.mm +62 -0
- package/ios/RNGestureHandlerButtonManager.h +5 -0
- package/ios/RNGestureHandlerButtonManager.m +34 -0
- package/ios/RNGestureHandlerDirection.h +8 -0
- package/ios/RNGestureHandlerEvents.h +65 -0
- package/ios/RNGestureHandlerEvents.m +260 -0
- package/ios/RNGestureHandlerManager.h +35 -0
- package/ios/RNGestureHandlerManager.mm +367 -0
- package/ios/RNGestureHandlerModule.h +7 -0
- package/ios/RNGestureHandlerModule.mm +320 -0
- package/ios/RNGestureHandlerPointerTracker.h +25 -0
- package/ios/RNGestureHandlerPointerTracker.m +243 -0
- package/ios/RNGestureHandlerRegistry.h +21 -0
- package/ios/RNGestureHandlerRegistry.m +63 -0
- package/ios/RNGestureHandlerRootViewComponentView.mm +21 -0
- package/ios/RNGestureHandlerState.h +10 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/RNManualActivationRecognizer.h +10 -0
- package/ios/RNManualActivationRecognizer.m +88 -0
- package/ios/RNRootViewGestureRecognizer.h +17 -0
- package/ios/RNRootViewGestureRecognizer.m +106 -0
- package/jest-utils/package.json +6 -0
- package/jestSetup.js +7 -0
- package/kepler-compatibility.json +8 -0
- package/kepler-transformed-package-info.json +3 -0
- package/lib/commonjs/ActionType.js +15 -0
- package/lib/commonjs/ActionType.js.map +1 -0
- package/lib/commonjs/Directions.js +15 -0
- package/lib/commonjs/Directions.js.map +1 -0
- package/lib/commonjs/EnableNewWebImplementation.js +29 -0
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js +10 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/commonjs/PlatformConstants.js +10 -0
- package/lib/commonjs/PlatformConstants.js.map +1 -0
- package/lib/commonjs/PlatformConstants.web.js +12 -0
- package/lib/commonjs/PlatformConstants.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.js +23 -0
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.kepler.js +33 -0
- package/lib/commonjs/RNGestureHandlerModule.kepler.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js +113 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js +123 -0
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js +121 -0
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/commonjs/RNRenderer.js +14 -0
- package/lib/commonjs/RNRenderer.js.map +1 -0
- package/lib/commonjs/RNRenderer.web.js +10 -0
- package/lib/commonjs/RNRenderer.web.js.map +1 -0
- package/lib/commonjs/State.js +19 -0
- package/lib/commonjs/State.js.map +1 -0
- package/lib/commonjs/TouchEventType.js +16 -0
- package/lib/commonjs/TouchEventType.js.map +1 -0
- package/lib/commonjs/components/DrawerLayout.js +512 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -0
- package/lib/commonjs/components/GestureButtons.js +194 -0
- package/lib/commonjs/components/GestureButtons.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.js +104 -0
- package/lib/commonjs/components/GestureComponents.js.map +1 -0
- package/lib/commonjs/components/GestureComponents.web.js +38 -0
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.js +10 -0
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js +16 -0
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js +23 -0
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.js +23 -0
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.kepler.js +18 -0
- package/lib/commonjs/components/GestureHandlerRootView.kepler.js.map +1 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js +18 -0
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +345 -0
- package/lib/commonjs/components/Swipeable.js.map +1 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js +31 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +253 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js +90 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +84 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +9 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js +64 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +18 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/commonjs/components/touchables/index.js +35 -0
- package/lib/commonjs/components/touchables/index.js.map +1 -0
- package/lib/commonjs/getShadowNodeFromRef.js +27 -0
- package/lib/commonjs/getShadowNodeFromRef.js.map +1 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js +14 -0
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js +18 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +37 -0
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js +20 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +19 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PanGestureHandler.js +99 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js +17 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js +13 -0
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +11 -0
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js +17 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/TapGestureHandler.js +20 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/handlers/createHandler.js +402 -0
- package/lib/commonjs/handlers/createHandler.js.map +1 -0
- package/lib/commonjs/handlers/createNativeWrapper.js +63 -0
- package/lib/commonjs/handlers/createNativeWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +86 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +6 -0
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +1 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js +548 -0
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js +125 -0
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js +27 -0
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +54 -0
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gesture.js +196 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js +90 -0
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js +73 -0
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +60 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +27 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js +60 -0
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js +28 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js +25 -0
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js +27 -0
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/panGesture.js +124 -0
- package/lib/commonjs/handlers/gestures/panGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js +38 -0
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +30 -0
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js +38 -0
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js +48 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/commonjs/handlers/handlersRegistry.js +52 -0
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -0
- package/lib/commonjs/index.js +241 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/init.js +25 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/jestUtils/index.js +19 -0
- package/lib/commonjs/jestUtils/index.js.map +1 -0
- package/lib/commonjs/jestUtils/jestUtils.js +312 -0
- package/lib/commonjs/jestUtils/jestUtils.js.map +1 -0
- package/lib/commonjs/mocks.js +61 -0
- package/lib/commonjs/mocks.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js +20 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/commonjs/typeUtils.js +2 -0
- package/lib/commonjs/typeUtils.js.map +1 -0
- package/lib/commonjs/utils.js +64 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/constants.js +14 -0
- package/lib/commonjs/web/constants.js.map +1 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +129 -0
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +127 -0
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +127 -0
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/GestureHandler.js +668 -0
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +48 -0
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +119 -0
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +49 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +140 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js +347 -0
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +136 -0
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +146 -0
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js +219 -0
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web/interfaces.js +44 -0
- package/lib/commonjs/web/interfaces.js.map +1 -0
- package/lib/commonjs/web/tools/CircularBuffer.js +47 -0
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
- package/lib/commonjs/web/tools/EventManager.js +95 -0
- package/lib/commonjs/web/tools/EventManager.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +6 -0
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +305 -0
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +93 -0
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/commonjs/web/tools/InteractionManager.js +99 -0
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js +167 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/commonjs/web/tools/NodeManager.js +41 -0
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +171 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerTracker.js +202 -0
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -0
- package/lib/commonjs/web/tools/TouchEventManager.js +126 -0
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/VelocityTracker.js +89 -0
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
- package/lib/commonjs/web/utils.js +14 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +93 -0
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +43 -0
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/Errors.js +13 -0
- package/lib/commonjs/web_hammer/Errors.js.map +1 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +139 -0
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/GestureHandler.js +491 -0
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +45 -0
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +57 -0
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +58 -0
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/NodeManager.js +40 -0
- package/lib/commonjs/web_hammer/NodeManager.js.map +1 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js +167 -0
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +31 -0
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js +160 -0
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +33 -0
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js +173 -0
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/commonjs/web_hammer/constants.js +51 -0
- package/lib/commonjs/web_hammer/constants.js.map +1 -0
- package/lib/commonjs/web_hammer/utils.js +32 -0
- package/lib/commonjs/web_hammer/utils.js.map +1 -0
- package/lib/module/ActionType.js +9 -0
- package/lib/module/ActionType.js.map +1 -0
- package/lib/module/Directions.js +9 -0
- package/lib/module/Directions.js.map +1 -0
- package/lib/module/EnableNewWebImplementation.js +21 -0
- package/lib/module/EnableNewWebImplementation.js.map +1 -0
- package/lib/module/GestureHandlerRootViewContext.js +3 -0
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/module/PlatformConstants.js +4 -0
- package/lib/module/PlatformConstants.js.map +1 -0
- package/lib/module/PlatformConstants.web.js +6 -0
- package/lib/module/PlatformConstants.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +17 -0
- package/lib/module/RNGestureHandlerModule.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.kepler.js +24 -0
- package/lib/module/RNGestureHandlerModule.kepler.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.macos.js +104 -0
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.web.js +114 -0
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.windows.js +112 -0
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -0
- package/lib/module/RNRenderer.js +4 -0
- package/lib/module/RNRenderer.js.map +1 -0
- package/lib/module/RNRenderer.web.js +4 -0
- package/lib/module/RNRenderer.web.js.map +1 -0
- package/lib/module/State.js +13 -0
- package/lib/module/State.js.map +1 -0
- package/lib/module/TouchEventType.js +10 -0
- package/lib/module/TouchEventType.js.map +1 -0
- package/lib/module/components/DrawerLayout.js +504 -0
- package/lib/module/components/DrawerLayout.js.map +1 -0
- package/lib/module/components/GestureButtons.js +176 -0
- package/lib/module/components/GestureButtons.js.map +1 -0
- package/lib/module/components/GestureComponents.js +95 -0
- package/lib/module/components/GestureComponents.js.map +1 -0
- package/lib/module/components/GestureComponents.web.js +28 -0
- package/lib/module/components/GestureComponents.web.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.js +3 -0
- package/lib/module/components/GestureHandlerButton.js.map +1 -0
- package/lib/module/components/GestureHandlerButton.web.js +8 -0
- package/lib/module/components/GestureHandlerButton.web.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.android.js +14 -0
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.js +14 -0
- package/lib/module/components/GestureHandlerRootView.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.kepler.js +9 -0
- package/lib/module/components/GestureHandlerRootView.kepler.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.web.js +9 -0
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/module/components/Swipeable.js +338 -0
- package/lib/module/components/Swipeable.js.map +1 -0
- package/lib/module/components/gestureHandlerRootHOC.js +22 -0
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/module/components/touchables/GenericTouchable.js +244 -0
- package/lib/module/components/touchables/GenericTouchable.js.map +1 -0
- package/lib/module/components/touchables/TouchableHighlight.js +81 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +74 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js +3 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -0
- package/lib/module/components/touchables/TouchableOpacity.js +55 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +9 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -0
- package/lib/module/components/touchables/index.js +5 -0
- package/lib/module/components/touchables/index.js.map +1 -0
- package/lib/module/getShadowNodeFromRef.js +21 -0
- package/lib/module/getShadowNodeFromRef.js.map +1 -0
- package/lib/module/getShadowNodeFromRef.web.js +8 -0
- package/lib/module/getShadowNodeFromRef.web.js.map +1 -0
- package/lib/module/handlers/FlingGestureHandler.js +11 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js +30 -0
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -0
- package/lib/module/handlers/LongPressGestureHandler.js +13 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/handlers/NativeViewGestureHandler.js +12 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/handlers/PanGestureHandler.js +90 -0
- package/lib/module/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/handlers/PinchGestureHandler.js +10 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/handlers/PressabilityDebugView.js +3 -0
- package/lib/module/handlers/PressabilityDebugView.js.map +1 -0
- package/lib/module/handlers/PressabilityDebugView.web.js +5 -0
- package/lib/module/handlers/PressabilityDebugView.web.js.map +1 -0
- package/lib/module/handlers/RotationGestureHandler.js +10 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/handlers/TapGestureHandler.js +13 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/handlers/createHandler.js +395 -0
- package/lib/module/handlers/createHandler.js.map +1 -0
- package/lib/module/handlers/createNativeWrapper.js +56 -0
- package/lib/module/handlers/createNativeWrapper.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +76 -0
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js +2 -0
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +1 -0
- package/lib/module/handlers/gestures/GestureDetector.js +538 -0
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -0
- package/lib/module/handlers/gestures/eventReceiver.js +116 -0
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -0
- package/lib/module/handlers/gestures/flingGesture.js +20 -0
- package/lib/module/handlers/gestures/flingGesture.js.map +1 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js +47 -0
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/gesture.js +188 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -0
- package/lib/module/handlers/gestures/gestureComposition.js +81 -0
- package/lib/module/handlers/gestures/gestureComposition.js.map +1 -0
- package/lib/module/handlers/gestures/gestureObjects.js +67 -0
- package/lib/module/handlers/gestures/gestureObjects.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.js +54 -0
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js +20 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/module/handlers/gestures/hoverGesture.js +53 -0
- package/lib/module/handlers/gestures/hoverGesture.js.map +1 -0
- package/lib/module/handlers/gestures/longPressGesture.js +21 -0
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -0
- package/lib/module/handlers/gestures/manualGesture.js +18 -0
- package/lib/module/handlers/gestures/manualGesture.js.map +1 -0
- package/lib/module/handlers/gestures/nativeGesture.js +20 -0
- package/lib/module/handlers/gestures/nativeGesture.js.map +1 -0
- package/lib/module/handlers/gestures/panGesture.js +117 -0
- package/lib/module/handlers/gestures/panGesture.js.map +1 -0
- package/lib/module/handlers/gestures/pinchGesture.js +31 -0
- package/lib/module/handlers/gestures/pinchGesture.js.map +1 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js +25 -0
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -0
- package/lib/module/handlers/gestures/rotationGesture.js +31 -0
- package/lib/module/handlers/gestures/rotationGesture.js.map +1 -0
- package/lib/module/handlers/gestures/tapGesture.js +41 -0
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -0
- package/lib/module/handlers/handlersRegistry.js +39 -0
- package/lib/module/handlers/handlersRegistry.js.map +1 -0
- package/lib/module/index.js +25 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/init.js +17 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/jestUtils/index.js +2 -0
- package/lib/module/jestUtils/index.js.map +1 -0
- package/lib/module/jestUtils/jestUtils.js +305 -0
- package/lib/module/jestUtils/jestUtils.js.map +1 -0
- package/lib/module/mocks.js +55 -0
- package/lib/module/mocks.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +4 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js +12 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.kepler.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +4 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/module/typeUtils.js +2 -0
- package/lib/module/typeUtils.js.map +1 -0
- package/lib/module/utils.js +50 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/constants.js +8 -0
- package/lib/module/web/constants.js.map +1 -0
- package/lib/module/web/detectors/RotationGestureDetector.js +122 -0
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js +120 -0
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -0
- package/lib/module/web/handlers/FlingGestureHandler.js +119 -0
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/GestureHandler.js +661 -0
- package/lib/module/web/handlers/GestureHandler.js.map +1 -0
- package/lib/module/web/handlers/HoverGestureHandler.js +40 -0
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js +111 -0
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/ManualGestureHandler.js +41 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js +132 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PanGestureHandler.js +339 -0
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/PinchGestureHandler.js +128 -0
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/RotationGestureHandler.js +138 -0
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/TapGestureHandler.js +211 -0
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -0
- package/lib/module/web/interfaces.js +38 -0
- package/lib/module/web/interfaces.js.map +1 -0
- package/lib/module/web/tools/CircularBuffer.js +40 -0
- package/lib/module/web/tools/CircularBuffer.js.map +1 -0
- package/lib/module/web/tools/EventManager.js +88 -0
- package/lib/module/web/tools/EventManager.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js +2 -0
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +297 -0
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +85 -0
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -0
- package/lib/module/web/tools/InteractionManager.js +92 -0
- package/lib/module/web/tools/InteractionManager.js.map +1 -0
- package/lib/module/web/tools/LeastSquareSolver.js +160 -0
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/module/web/tools/NodeManager.js +34 -0
- package/lib/module/web/tools/NodeManager.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +163 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -0
- package/lib/module/web/tools/PointerTracker.js +194 -0
- package/lib/module/web/tools/PointerTracker.js.map +1 -0
- package/lib/module/web/tools/TouchEventManager.js +118 -0
- package/lib/module/web/tools/TouchEventManager.js.map +1 -0
- package/lib/module/web/tools/VelocityTracker.js +81 -0
- package/lib/module/web/tools/VelocityTracker.js.map +1 -0
- package/lib/module/web/utils.js +8 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js +85 -0
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js +35 -0
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/Errors.js +6 -0
- package/lib/module/web_hammer/Errors.js.map +1 -0
- package/lib/module/web_hammer/FlingGestureHandler.js +131 -0
- package/lib/module/web_hammer/FlingGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/GestureHandler.js +485 -0
- package/lib/module/web_hammer/GestureHandler.js.map +1 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +39 -0
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js +49 -0
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/NativeViewGestureHandler.js +49 -0
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/NodeManager.js +31 -0
- package/lib/module/web_hammer/NodeManager.js.map +1 -0
- package/lib/module/web_hammer/PanGestureHandler.js +160 -0
- package/lib/module/web_hammer/PanGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PinchGestureHandler.js +24 -0
- package/lib/module/web_hammer/PinchGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/PressGestureHandler.js +153 -0
- package/lib/module/web_hammer/PressGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/RotationGestureHandler.js +26 -0
- package/lib/module/web_hammer/RotationGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/TapGestureHandler.js +166 -0
- package/lib/module/web_hammer/TapGestureHandler.js.map +1 -0
- package/lib/module/web_hammer/constants.js +44 -0
- package/lib/module/web_hammer/constants.js.map +1 -0
- package/lib/module/web_hammer/utils.js +19 -0
- package/lib/module/web_hammer/utils.js.map +1 -0
- package/lib/typescript/ActionType.d.ts +7 -0
- package/lib/typescript/Directions.d.ts +7 -0
- package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
- package/lib/typescript/PlatformConstants.d.ts +5 -0
- package/lib/typescript/PlatformConstants.web.d.ts +4 -0
- package/lib/typescript/RNGestureHandlerModule.d.ts +13 -0
- package/lib/typescript/RNGestureHandlerModule.kepler.d.ts +17 -0
- package/lib/typescript/RNGestureHandlerModule.macos.d.ts +47 -0
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +50 -0
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +48 -0
- package/lib/typescript/RNRenderer.d.ts +1 -0
- package/lib/typescript/RNRenderer.web.d.ts +3 -0
- package/lib/typescript/State.d.ts +9 -0
- package/lib/typescript/TouchEventType.d.ts +8 -0
- package/lib/typescript/components/DrawerLayout.d.ts +148 -0
- package/lib/typescript/components/GestureButtons.d.ts +121 -0
- package/lib/typescript/components/GestureComponents.d.ts +22 -0
- package/lib/typescript/components/GestureComponents.web.d.ts +8 -0
- package/lib/typescript/components/GestureHandlerButton.d.ts +4 -0
- package/lib/typescript/components/GestureHandlerButton.web.d.ts +4 -0
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.kepler.d.ts +6 -0
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +6 -0
- package/lib/typescript/components/Swipeable.d.ts +170 -0
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +3 -0
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +68 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +36 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +45 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +25 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +7 -0
- package/lib/typescript/components/touchables/index.d.ts +7 -0
- package/lib/typescript/getShadowNodeFromRef.d.ts +1 -0
- package/lib/typescript/getShadowNodeFromRef.web.d.ts +1 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +34 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +44 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +56 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +28 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +139 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +29 -0
- package/lib/typescript/handlers/PressabilityDebugView.d.ts +1 -0
- package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +1 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +29 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +57 -0
- package/lib/typescript/handlers/createHandler.d.ts +11 -0
- package/lib/typescript/handlers/createNativeWrapper.d.ts +3 -0
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +67 -0
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +42 -0
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +19 -0
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +4 -0
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +15 -0
- package/lib/typescript/handlers/gestures/gesture.d.ts +108 -0
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +21 -0
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +41 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +9 -0
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +32 -0
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +7 -0
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +9 -0
- package/lib/typescript/handlers/gestures/panGesture.d.ts +26 -0
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +11 -0
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +14 -0
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +12 -0
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +14 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +14 -0
- package/lib/typescript/index.d.ts +52 -0
- package/lib/typescript/init.d.ts +2 -0
- package/lib/typescript/jestUtils/index.d.ts +1 -0
- package/lib/typescript/jestUtils/jestUtils.d.ts +28 -0
- package/lib/typescript/mocks.d.ts +44 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.kepler.d.ts +7 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -0
- package/lib/typescript/typeUtils.d.ts +1 -0
- package/lib/typescript/utils.d.ts +12 -0
- package/lib/typescript/web/constants.d.ts +7 -0
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +30 -0
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +29 -0
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +27 -0
- package/lib/typescript/web/handlers/GestureHandler.d.ts +90 -0
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +10 -0
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +26 -0
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +12 -0
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +24 -0
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +55 -0
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +28 -0
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +29 -0
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +39 -0
- package/lib/typescript/web/interfaces.d.ts +140 -0
- package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
- package/lib/typescript/web/tools/EventManager.d.ts +34 -0
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +22 -0
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +30 -0
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +21 -0
- package/lib/typescript/web/tools/InteractionManager.d.ts +16 -0
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
- package/lib/typescript/web/tools/NodeManager.d.ts +11 -0
- package/lib/typescript/web/tools/PointerEventManager.d.ts +8 -0
- package/lib/typescript/web/tools/PointerTracker.d.ts +53 -0
- package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
- package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
- package/lib/typescript/web/utils.d.ts +4 -0
- package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +20 -0
- package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +15 -0
- package/lib/typescript/web_hammer/Errors.d.ts +3 -0
- package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +43 -0
- package/lib/typescript/web_hammer/GestureHandler.d.ts +145 -0
- package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +40 -0
- package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +38 -0
- package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +7 -0
- package/lib/typescript/web_hammer/NodeManager.d.ts +8 -0
- package/lib/typescript/web_hammer/PanGestureHandler.d.ts +56 -0
- package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +13 -0
- package/lib/typescript/web_hammer/PressGestureHandler.d.ts +83 -0
- package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +13 -0
- package/lib/typescript/web_hammer/TapGestureHandler.d.ts +57 -0
- package/lib/typescript/web_hammer/constants.d.ts +39 -0
- package/lib/typescript/web_hammer/utils.d.ts +9 -0
- package/package.json +1 -0
- package/src/ActionType.ts +9 -0
- package/src/Directions.ts +9 -0
- package/src/EnableNewWebImplementation.ts +35 -0
- package/src/GestureHandlerRootViewContext.ts +3 -0
- package/src/PlatformConstants.ts +8 -0
- package/src/PlatformConstants.web.ts +5 -0
- package/src/RNGestureHandlerModule.kepler.ts +64 -0
- package/src/RNGestureHandlerModule.macos.ts +133 -0
- package/src/RNGestureHandlerModule.ts +50 -0
- package/src/RNGestureHandlerModule.web.ts +146 -0
- package/src/RNGestureHandlerModule.windows.ts +144 -0
- package/src/RNRenderer.ts +3 -0
- package/src/RNRenderer.web.ts +3 -0
- package/src/State.ts +13 -0
- package/src/TouchEventType.ts +10 -0
- package/src/components/DrawerLayout.tsx +743 -0
- package/src/components/GestureButtons.tsx +334 -0
- package/src/components/GestureComponents.tsx +148 -0
- package/src/components/GestureComponents.web.tsx +41 -0
- package/src/components/GestureHandlerButton.tsx +5 -0
- package/src/components/GestureHandlerButton.web.tsx +6 -0
- package/src/components/GestureHandlerRootView.android.tsx +24 -0
- package/src/components/GestureHandlerRootView.kepler.tsx +17 -0
- package/src/components/GestureHandlerRootView.tsx +23 -0
- package/src/components/GestureHandlerRootView.web.tsx +17 -0
- package/src/components/Swipeable.tsx +551 -0
- package/src/components/gestureHandlerRootHOC.tsx +32 -0
- package/src/components/touchables/GenericTouchable.tsx +301 -0
- package/src/components/touchables/TouchableHighlight.tsx +115 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +91 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +75 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -0
- package/src/components/touchables/index.ts +7 -0
- package/src/getShadowNodeFromRef.ts +22 -0
- package/src/getShadowNodeFromRef.web.ts +7 -0
- package/src/handlers/FlingGestureHandler.ts +59 -0
- package/src/handlers/ForceTouchGestureHandler.ts +90 -0
- package/src/handlers/LongPressGestureHandler.ts +88 -0
- package/src/handlers/NativeViewGestureHandler.ts +55 -0
- package/src/handlers/PanGestureHandler.ts +325 -0
- package/src/handlers/PinchGestureHandler.ts +48 -0
- package/src/handlers/PressabilityDebugView.tsx +2 -0
- package/src/handlers/PressabilityDebugView.web.tsx +4 -0
- package/src/handlers/RotationGestureHandler.ts +48 -0
- package/src/handlers/TapGestureHandler.ts +94 -0
- package/src/handlers/createHandler.tsx +547 -0
- package/src/handlers/createNativeWrapper.tsx +80 -0
- package/src/handlers/gestureHandlerCommon.ts +244 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +106 -0
- package/src/handlers/gestures/GestureDetector.tsx +818 -0
- package/src/handlers/gestures/eventReceiver.ts +172 -0
- package/src/handlers/gestures/flingGesture.ts +27 -0
- package/src/handlers/gestures/forceTouchGesture.ts +74 -0
- package/src/handlers/gestures/gesture.ts +341 -0
- package/src/handlers/gestures/gestureComposition.ts +122 -0
- package/src/handlers/gestures/gestureObjects.ts +84 -0
- package/src/handlers/gestures/gestureStateManager.ts +62 -0
- package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
- package/src/handlers/gestures/hoverGesture.ts +83 -0
- package/src/handlers/gestures/longPressGesture.ts +28 -0
- package/src/handlers/gestures/manualGesture.ts +31 -0
- package/src/handlers/gestures/nativeGesture.ts +27 -0
- package/src/handlers/gestures/panGesture.ts +152 -0
- package/src/handlers/gestures/pinchGesture.ts +51 -0
- package/src/handlers/gestures/reanimatedWrapper.ts +56 -0
- package/src/handlers/gestures/rotationGesture.ts +51 -0
- package/src/handlers/gestures/tapGesture.ts +53 -0
- package/src/handlers/handlersRegistry.ts +60 -0
- package/src/index.ts +174 -0
- package/src/init.ts +18 -0
- package/src/jestUtils/index.ts +1 -0
- package/src/jestUtils/jestUtils.ts +505 -0
- package/src/mocks.ts +67 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.kepler.ts +27 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +20 -0
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +7 -0
- package/src/typeUtils.ts +1 -0
- package/src/utils.ts +62 -0
- package/src/web/constants.ts +8 -0
- package/src/web/detectors/RotationGestureDetector.ts +168 -0
- package/src/web/detectors/ScaleGestureDetector.ts +172 -0
- package/src/web/handlers/FlingGestureHandler.ts +161 -0
- package/src/web/handlers/GestureHandler.ts +850 -0
- package/src/web/handlers/HoverGestureHandler.ts +43 -0
- package/src/web/handlers/LongPressGestureHandler.ts +125 -0
- package/src/web/handlers/ManualGestureHandler.ts +43 -0
- package/src/web/handlers/NativeViewGestureHandler.ts +167 -0
- package/src/web/handlers/PanGestureHandler.ts +485 -0
- package/src/web/handlers/PinchGestureHandler.ts +158 -0
- package/src/web/handlers/RotationGestureHandler.ts +172 -0
- package/src/web/handlers/TapGestureHandler.ts +273 -0
- package/src/web/interfaces.ts +166 -0
- package/src/web/tools/CircularBuffer.ts +42 -0
- package/src/web/tools/EventManager.ts +104 -0
- package/src/web/tools/GestureHandlerDelegate.ts +23 -0
- package/src/web/tools/GestureHandlerOrchestrator.ts +398 -0
- package/src/web/tools/GestureHandlerWebDelegate.ts +115 -0
- package/src/web/tools/InteractionManager.ts +123 -0
- package/src/web/tools/LeastSquareSolver.ts +182 -0
- package/src/web/tools/NodeManager.ts +43 -0
- package/src/web/tools/PointerEventManager.ts +193 -0
- package/src/web/tools/PointerTracker.ts +240 -0
- package/src/web/tools/TouchEventManager.ts +167 -0
- package/src/web/tools/VelocityTracker.ts +98 -0
- package/src/web/utils.ts +8 -0
- package/src/web_hammer/DiscreteGestureHandler.ts +82 -0
- package/src/web_hammer/DraggingGestureHandler.ts +34 -0
- package/src/web_hammer/Errors.ts +7 -0
- package/src/web_hammer/FlingGestureHandler.ts +134 -0
- package/src/web_hammer/GestureHandler.ts +598 -0
- package/src/web_hammer/IndiscreteGestureHandler.ts +33 -0
- package/src/web_hammer/LongPressGestureHandler.ts +56 -0
- package/src/web_hammer/NativeViewGestureHandler.ts +47 -0
- package/src/web_hammer/NodeManager.ts +42 -0
- package/src/web_hammer/PanGestureHandler.ts +226 -0
- package/src/web_hammer/PinchGestureHandler.ts +25 -0
- package/src/web_hammer/PressGestureHandler.ts +167 -0
- package/src/web_hammer/RotationGestureHandler.ts +25 -0
- package/src/web_hammer/TapGestureHandler.ts +172 -0
- package/src/web_hammer/constants.ts +48 -0
- package/src/web_hammer/utils.ts +24 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
|
|
8
|
+
var _State = require("../State");
|
|
9
|
+
var _PressGestureHandler = _interopRequireDefault(require("./PressGestureHandler"));
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/* eslint-disable eslint-comments/no-unlimited-disable */
|
|
13
|
+
/* eslint-disable */
|
|
14
|
+
|
|
15
|
+
class LongPressGestureHandler extends _PressGestureHandler.default {
|
|
16
|
+
get minDurationMs() {
|
|
17
|
+
// @ts-ignore FIXNE(TS)
|
|
18
|
+
return (0, _utils.isnan)(this.config.minDurationMs) ? 251 : this.config.minDurationMs;
|
|
19
|
+
}
|
|
20
|
+
get maxDist() {
|
|
21
|
+
// @ts-ignore FIXNE(TS)
|
|
22
|
+
return (0, _utils.isnan)(this.config.maxDist) ? 9 : this.config.maxDist;
|
|
23
|
+
}
|
|
24
|
+
updateHasCustomActivationCriteria({
|
|
25
|
+
maxDistSq
|
|
26
|
+
}) {
|
|
27
|
+
return !(0, _utils.isValidNumber)(maxDistSq);
|
|
28
|
+
}
|
|
29
|
+
getConfig() {
|
|
30
|
+
if (!this.hasCustomActivationCriteria) {
|
|
31
|
+
// Default config
|
|
32
|
+
// If no params have been defined then this config should emulate the native gesture as closely as possible.
|
|
33
|
+
return {
|
|
34
|
+
shouldCancelWhenOutside: true,
|
|
35
|
+
maxDistSq: 10
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return this.config;
|
|
39
|
+
}
|
|
40
|
+
getHammerConfig() {
|
|
41
|
+
return {
|
|
42
|
+
...super.getHammerConfig(),
|
|
43
|
+
// threshold: this.maxDist,
|
|
44
|
+
time: this.minDurationMs
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
getState(type) {
|
|
48
|
+
return {
|
|
49
|
+
[_hammerjs.default.INPUT_START]: _State.State.ACTIVE,
|
|
50
|
+
[_hammerjs.default.INPUT_MOVE]: _State.State.ACTIVE,
|
|
51
|
+
[_hammerjs.default.INPUT_END]: _State.State.END,
|
|
52
|
+
[_hammerjs.default.INPUT_CANCEL]: _State.State.FAILED
|
|
53
|
+
}[type];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var _default = exports.default = LongPressGestureHandler;
|
|
57
|
+
//# sourceMappingURL=LongPressGestureHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hammerjs","_interopRequireDefault","require","_State","_PressGestureHandler","_utils","e","__esModule","default","LongPressGestureHandler","PressGestureHandler","minDurationMs","isnan","config","maxDist","updateHasCustomActivationCriteria","maxDistSq","isValidNumber","getConfig","hasCustomActivationCriteria","shouldCancelWhenOutside","getHammerConfig","time","getState","type","Hammer","INPUT_START","State","ACTIVE","INPUT_MOVE","INPUT_END","END","INPUT_CANCEL","FAILED","_default","exports"],"sources":["LongPressGestureHandler.ts"],"sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport Hammer from '@egjs/hammerjs';\n\nimport { State } from '../State';\nimport PressGestureHandler from './PressGestureHandler';\nimport { isnan, isValidNumber } from './utils';\nimport { Config } from './GestureHandler';\nimport { HammerInputNames } from './constants';\n\nclass LongPressGestureHandler extends PressGestureHandler {\n get minDurationMs(): number {\n // @ts-ignore FIXNE(TS)\n return isnan(this.config.minDurationMs) ? 251 : this.config.minDurationMs;\n }\n\n get maxDist() {\n // @ts-ignore FIXNE(TS)\n return isnan(this.config.maxDist) ? 9 : this.config.maxDist;\n }\n\n updateHasCustomActivationCriteria({ maxDistSq }: Config) {\n return !isValidNumber(maxDistSq);\n }\n\n getConfig() {\n if (!this.hasCustomActivationCriteria) {\n // Default config\n // If no params have been defined then this config should emulate the native gesture as closely as possible.\n return {\n shouldCancelWhenOutside: true,\n maxDistSq: 10,\n };\n }\n return this.config;\n }\n\n getHammerConfig() {\n return {\n ...super.getHammerConfig(),\n // threshold: this.maxDist,\n time: this.minDurationMs,\n };\n }\n\n getState(type: keyof typeof HammerInputNames) {\n return {\n [Hammer.INPUT_START]: State.ACTIVE,\n [Hammer.INPUT_MOVE]: State.ACTIVE,\n [Hammer.INPUT_END]: State.END,\n [Hammer.INPUT_CANCEL]: State.FAILED,\n }[type];\n }\n}\n\nexport default LongPressGestureHandler;\n"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAA+C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAN/C;AACA;;AASA,MAAMG,uBAAuB,SAASC,4BAAmB,CAAC;EACxD,IAAIC,aAAaA,CAAA,EAAW;IAC1B;IACA,OAAO,IAAAC,YAAK,EAAC,IAAI,CAACC,MAAM,CAACF,aAAa,CAAC,GAAG,GAAG,GAAG,IAAI,CAACE,MAAM,CAACF,aAAa;EAC3E;EAEA,IAAIG,OAAOA,CAAA,EAAG;IACZ;IACA,OAAO,IAAAF,YAAK,EAAC,IAAI,CAACC,MAAM,CAACC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAACD,MAAM,CAACC,OAAO;EAC7D;EAEAC,iCAAiCA,CAAC;IAAEC;EAAkB,CAAC,EAAE;IACvD,OAAO,CAAC,IAAAC,oBAAa,EAACD,SAAS,CAAC;EAClC;EAEAE,SAASA,CAAA,EAAG;IACV,IAAI,CAAC,IAAI,CAACC,2BAA2B,EAAE;MACrC;MACA;MACA,OAAO;QACLC,uBAAuB,EAAE,IAAI;QAC7BJ,SAAS,EAAE;MACb,CAAC;IACH;IACA,OAAO,IAAI,CAACH,MAAM;EACpB;EAEAQ,eAAeA,CAAA,EAAG;IAChB,OAAO;MACL,GAAG,KAAK,CAACA,eAAe,CAAC,CAAC;MAC1B;MACAC,IAAI,EAAE,IAAI,CAACX;IACb,CAAC;EACH;EAEAY,QAAQA,CAACC,IAAmC,EAAE;IAC5C,OAAO;MACL,CAACC,iBAAM,CAACC,WAAW,GAAGC,YAAK,CAACC,MAAM;MAClC,CAACH,iBAAM,CAACI,UAAU,GAAGF,YAAK,CAACC,MAAM;MACjC,CAACH,iBAAM,CAACK,SAAS,GAAGH,YAAK,CAACI,GAAG;MAC7B,CAACN,iBAAM,CAACO,YAAY,GAAGL,YAAK,CAACM;IAC/B,CAAC,CAACT,IAAI,CAAC;EACT;AACF;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAA3B,OAAA,GAEcC,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _DiscreteGestureHandler = _interopRequireDefault(require("./DiscreteGestureHandler"));
|
|
8
|
+
var NodeManager = _interopRequireWildcard(require("./NodeManager"));
|
|
9
|
+
var _PressGestureHandler = _interopRequireDefault(require("./PressGestureHandler"));
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
class NativeViewGestureHandler extends _PressGestureHandler.default {
|
|
15
|
+
get isNative() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
onRawEvent(ev) {
|
|
19
|
+
super.onRawEvent(ev);
|
|
20
|
+
if (!ev.isFinal) {
|
|
21
|
+
// if (this.ref instanceof ScrollView) {
|
|
22
|
+
if ((0, _utils.TEST_MIN_IF_NOT_NAN)((0, _utils.VEC_LEN_SQ)({
|
|
23
|
+
x: ev.deltaX,
|
|
24
|
+
y: ev.deltaY
|
|
25
|
+
}), 10)) {
|
|
26
|
+
// @ts-ignore FIXME(TS) config type
|
|
27
|
+
if (this.config.disallowInterruption) {
|
|
28
|
+
const gestures = Object.values(NodeManager.getNodes()).filter(gesture => {
|
|
29
|
+
const {
|
|
30
|
+
handlerTag,
|
|
31
|
+
view,
|
|
32
|
+
isGestureRunning
|
|
33
|
+
} = gesture;
|
|
34
|
+
return (
|
|
35
|
+
// Check if this gesture isn't self
|
|
36
|
+
handlerTag !== this.handlerTag &&
|
|
37
|
+
// Ensure the gesture needs to be cancelled
|
|
38
|
+
isGestureRunning &&
|
|
39
|
+
// ScrollView can cancel discrete gestures like taps and presses
|
|
40
|
+
gesture instanceof _DiscreteGestureHandler.default &&
|
|
41
|
+
// Ensure a view exists and is a child of the current view
|
|
42
|
+
view &&
|
|
43
|
+
// @ts-ignore FIXME(TS) view type
|
|
44
|
+
this.view.contains(view)
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
// Cancel all of the gestures that passed the filter
|
|
48
|
+
for (const gesture of gestures) {
|
|
49
|
+
// TODO: Bacon: Send some cached event.
|
|
50
|
+
gesture.forceInvalidate(ev);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
var _default = exports.default = NativeViewGestureHandler;
|
|
58
|
+
//# sourceMappingURL=NativeViewGestureHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_DiscreteGestureHandler","_interopRequireDefault","require","NodeManager","_interopRequireWildcard","_PressGestureHandler","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","NativeViewGestureHandler","PressGestureHandler","isNative","onRawEvent","ev","isFinal","TEST_MIN_IF_NOT_NAN","VEC_LEN_SQ","x","deltaX","y","deltaY","config","disallowInterruption","gestures","values","getNodes","filter","gesture","handlerTag","view","isGestureRunning","DiscreteGestureHandler","contains","forceInvalidate","_default","exports"],"sources":["NativeViewGestureHandler.ts"],"sourcesContent":["import DiscreteGestureHandler from './DiscreteGestureHandler';\nimport { HammerInputExt } from './GestureHandler';\nimport * as NodeManager from './NodeManager';\nimport PressGestureHandler from './PressGestureHandler';\nimport { TEST_MIN_IF_NOT_NAN, VEC_LEN_SQ } from './utils';\n\nclass NativeViewGestureHandler extends PressGestureHandler {\n get isNative() {\n return true;\n }\n\n onRawEvent(ev: HammerInputExt) {\n super.onRawEvent(ev);\n if (!ev.isFinal) {\n // if (this.ref instanceof ScrollView) {\n if (TEST_MIN_IF_NOT_NAN(VEC_LEN_SQ({ x: ev.deltaX, y: ev.deltaY }), 10)) {\n // @ts-ignore FIXME(TS) config type\n if (this.config.disallowInterruption) {\n const gestures = Object.values(NodeManager.getNodes()).filter(\n (gesture) => {\n const { handlerTag, view, isGestureRunning } = gesture;\n return (\n // Check if this gesture isn't self\n handlerTag !== this.handlerTag &&\n // Ensure the gesture needs to be cancelled\n isGestureRunning &&\n // ScrollView can cancel discrete gestures like taps and presses\n gesture instanceof DiscreteGestureHandler &&\n // Ensure a view exists and is a child of the current view\n view &&\n // @ts-ignore FIXME(TS) view type\n this.view.contains(view)\n );\n }\n );\n // Cancel all of the gestures that passed the filter\n for (const gesture of gestures) {\n // TODO: Bacon: Send some cached event.\n gesture.forceInvalidate(ev);\n }\n }\n }\n }\n }\n}\n\nexport default NativeViewGestureHandler;\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA0D,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAA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AACM,eAAe,CAACpB,EAAE,CAAC;UAC7B;QACF;MACF;IACF;EACF;AACF;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEcc,wBAAwB","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createGestureHandler = createGestureHandler;
|
|
7
|
+
exports.dropGestureHandler = dropGestureHandler;
|
|
8
|
+
exports.getHandler = getHandler;
|
|
9
|
+
exports.getNodes = getNodes;
|
|
10
|
+
const gestures = {};
|
|
11
|
+
function getHandler(tag) {
|
|
12
|
+
if (tag in gestures) {
|
|
13
|
+
return gestures[tag];
|
|
14
|
+
}
|
|
15
|
+
throw new Error(`No handler for tag ${tag}`);
|
|
16
|
+
}
|
|
17
|
+
function createGestureHandler(handlerTag, handler) {
|
|
18
|
+
if (handlerTag in gestures) {
|
|
19
|
+
throw new Error(`Handler with tag ${handlerTag} already exists`);
|
|
20
|
+
}
|
|
21
|
+
gestures[handlerTag] = handler;
|
|
22
|
+
// @ts-ignore no types for web handlers yet
|
|
23
|
+
gestures[handlerTag].handlerTag = handlerTag;
|
|
24
|
+
}
|
|
25
|
+
function dropGestureHandler(handlerTag) {
|
|
26
|
+
// Since React 18, there are cases where componentWillUnmount gets called twice in a row
|
|
27
|
+
// so skip this if the tag was already removed.
|
|
28
|
+
if (!(handlerTag in gestures)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
getHandler(handlerTag).destroy();
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
33
|
+
delete gestures[handlerTag];
|
|
34
|
+
}
|
|
35
|
+
function getNodes() {
|
|
36
|
+
return {
|
|
37
|
+
...gestures
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=NodeManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["gestures","getHandler","tag","Error","createGestureHandler","handlerTag","handler","dropGestureHandler","destroy","getNodes"],"sources":["NodeManager.ts"],"sourcesContent":["import { ValueOf } from '../typeUtils';\nimport { HammerGestures } from '../RNGestureHandlerModule.web';\n\nconst gestures: Record<\n number,\n InstanceType<ValueOf<typeof HammerGestures>>\n> = {};\n\nexport function getHandler(tag: number) {\n if (tag in gestures) {\n return gestures[tag];\n }\n\n throw new Error(`No handler for tag ${tag}`);\n}\n\nexport function createGestureHandler(\n handlerTag: number,\n handler: InstanceType<ValueOf<typeof HammerGestures>>\n) {\n if (handlerTag in gestures) {\n throw new Error(`Handler with tag ${handlerTag} already exists`);\n }\n gestures[handlerTag] = handler;\n // @ts-ignore no types for web handlers yet\n gestures[handlerTag].handlerTag = handlerTag;\n}\n\nexport function dropGestureHandler(handlerTag: number) {\n // Since React 18, there are cases where componentWillUnmount gets called twice in a row\n // so skip this if the tag was already removed.\n if (!(handlerTag in gestures)) {\n return;\n }\n getHandler(handlerTag).destroy();\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete gestures[handlerTag];\n}\n\nexport function getNodes() {\n return { ...gestures };\n}\n"],"mappings":";;;;;;;;;AAGA,MAAMA,QAGL,GAAG,CAAC,CAAC;AAEC,SAASC,UAAUA,CAACC,GAAW,EAAE;EACtC,IAAIA,GAAG,IAAIF,QAAQ,EAAE;IACnB,OAAOA,QAAQ,CAACE,GAAG,CAAC;EACtB;EAEA,MAAM,IAAIC,KAAK,CAAC,sBAAsBD,GAAG,EAAE,CAAC;AAC9C;AAEO,SAASE,oBAAoBA,CAClCC,UAAkB,EAClBC,OAAqD,EACrD;EACA,IAAID,UAAU,IAAIL,QAAQ,EAAE;IAC1B,MAAM,IAAIG,KAAK,CAAC,oBAAoBE,UAAU,iBAAiB,CAAC;EAClE;EACAL,QAAQ,CAACK,UAAU,CAAC,GAAGC,OAAO;EAC9B;EACAN,QAAQ,CAACK,UAAU,CAAC,CAACA,UAAU,GAAGA,UAAU;AAC9C;AAEO,SAASE,kBAAkBA,CAACF,UAAkB,EAAE;EACrD;EACA;EACA,IAAI,EAAEA,UAAU,IAAIL,QAAQ,CAAC,EAAE;IAC7B;EACF;EACAC,UAAU,CAACI,UAAU,CAAC,CAACG,OAAO,CAAC,CAAC;EAChC;EACA,OAAOR,QAAQ,CAACK,UAAU,CAAC;AAC7B;AAEO,SAASI,QAAQA,CAAA,EAAG;EACzB,OAAO;IAAE,GAAGT;EAAS,CAAC;AACxB","ignoreList":[]}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
|
|
8
|
+
var _constants = require("./constants");
|
|
9
|
+
var _DraggingGestureHandler = _interopRequireDefault(require("./DraggingGestureHandler"));
|
|
10
|
+
var _utils = require("./utils");
|
|
11
|
+
var _State = require("../State");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
class PanGestureHandler extends _DraggingGestureHandler.default {
|
|
14
|
+
get name() {
|
|
15
|
+
return 'pan';
|
|
16
|
+
}
|
|
17
|
+
get NativeGestureClass() {
|
|
18
|
+
return _hammerjs.default.Pan;
|
|
19
|
+
}
|
|
20
|
+
getHammerConfig() {
|
|
21
|
+
return {
|
|
22
|
+
...super.getHammerConfig(),
|
|
23
|
+
direction: this.getDirection()
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getState(type) {
|
|
27
|
+
const nextState = super.getState(type);
|
|
28
|
+
// Ensure that the first state sent is `BEGAN` and not `ACTIVE`
|
|
29
|
+
if (this.previousState === _State.State.UNDETERMINED && nextState === _State.State.ACTIVE) {
|
|
30
|
+
return _State.State.BEGAN;
|
|
31
|
+
}
|
|
32
|
+
return nextState;
|
|
33
|
+
}
|
|
34
|
+
getDirection() {
|
|
35
|
+
const config = this.getConfig();
|
|
36
|
+
const {
|
|
37
|
+
activeOffsetXStart,
|
|
38
|
+
activeOffsetXEnd,
|
|
39
|
+
activeOffsetYStart,
|
|
40
|
+
activeOffsetYEnd,
|
|
41
|
+
minDist
|
|
42
|
+
} = config;
|
|
43
|
+
let directions = [];
|
|
44
|
+
let horizontalDirections = [];
|
|
45
|
+
if (!(0, _utils.isnan)(minDist)) {
|
|
46
|
+
return _hammerjs.default.DIRECTION_ALL;
|
|
47
|
+
}
|
|
48
|
+
if (!(0, _utils.isnan)(activeOffsetXStart)) {
|
|
49
|
+
horizontalDirections.push(_hammerjs.default.DIRECTION_LEFT);
|
|
50
|
+
}
|
|
51
|
+
if (!(0, _utils.isnan)(activeOffsetXEnd)) {
|
|
52
|
+
horizontalDirections.push(_hammerjs.default.DIRECTION_RIGHT);
|
|
53
|
+
}
|
|
54
|
+
if (horizontalDirections.length === 2) {
|
|
55
|
+
horizontalDirections = [_hammerjs.default.DIRECTION_HORIZONTAL];
|
|
56
|
+
}
|
|
57
|
+
directions = directions.concat(horizontalDirections);
|
|
58
|
+
let verticalDirections = [];
|
|
59
|
+
if (!(0, _utils.isnan)(activeOffsetYStart)) {
|
|
60
|
+
verticalDirections.push(_hammerjs.default.DIRECTION_UP);
|
|
61
|
+
}
|
|
62
|
+
if (!(0, _utils.isnan)(activeOffsetYEnd)) {
|
|
63
|
+
verticalDirections.push(_hammerjs.default.DIRECTION_DOWN);
|
|
64
|
+
}
|
|
65
|
+
if (verticalDirections.length === 2) {
|
|
66
|
+
verticalDirections = [_hammerjs.default.DIRECTION_VERTICAL];
|
|
67
|
+
}
|
|
68
|
+
directions = directions.concat(verticalDirections);
|
|
69
|
+
if (!directions.length) {
|
|
70
|
+
return _hammerjs.default.DIRECTION_NONE;
|
|
71
|
+
}
|
|
72
|
+
if (directions[0] === _hammerjs.default.DIRECTION_HORIZONTAL && directions[1] === _hammerjs.default.DIRECTION_VERTICAL) {
|
|
73
|
+
return _hammerjs.default.DIRECTION_ALL;
|
|
74
|
+
}
|
|
75
|
+
if (horizontalDirections.length && verticalDirections.length) {
|
|
76
|
+
return _hammerjs.default.DIRECTION_ALL;
|
|
77
|
+
}
|
|
78
|
+
return directions[0];
|
|
79
|
+
}
|
|
80
|
+
getConfig() {
|
|
81
|
+
if (!this.hasCustomActivationCriteria) {
|
|
82
|
+
// Default config
|
|
83
|
+
// If no params have been defined then this config should emulate the native gesture as closely as possible.
|
|
84
|
+
return {
|
|
85
|
+
minDistSq: 10
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return this.config;
|
|
89
|
+
}
|
|
90
|
+
shouldFailUnderCustomCriteria({
|
|
91
|
+
deltaX,
|
|
92
|
+
deltaY
|
|
93
|
+
}, criteria) {
|
|
94
|
+
return !(0, _utils.isnan)(criteria.failOffsetXStart) && deltaX < criteria.failOffsetXStart || !(0, _utils.isnan)(criteria.failOffsetXEnd) && deltaX > criteria.failOffsetXEnd || !(0, _utils.isnan)(criteria.failOffsetYStart) && deltaY < criteria.failOffsetYStart || !(0, _utils.isnan)(criteria.failOffsetYEnd) && deltaY > criteria.failOffsetYEnd;
|
|
95
|
+
}
|
|
96
|
+
shouldActivateUnderCustomCriteria({
|
|
97
|
+
deltaX,
|
|
98
|
+
deltaY,
|
|
99
|
+
velocity
|
|
100
|
+
}, criteria) {
|
|
101
|
+
return !(0, _utils.isnan)(criteria.activeOffsetXStart) && deltaX < criteria.activeOffsetXStart || !(0, _utils.isnan)(criteria.activeOffsetXEnd) && deltaX > criteria.activeOffsetXEnd || !(0, _utils.isnan)(criteria.activeOffsetYStart) && deltaY < criteria.activeOffsetYStart || !(0, _utils.isnan)(criteria.activeOffsetYEnd) && deltaY > criteria.activeOffsetYEnd || (0, _utils.TEST_MIN_IF_NOT_NAN)((0, _utils.VEC_LEN_SQ)({
|
|
102
|
+
x: deltaX,
|
|
103
|
+
y: deltaY
|
|
104
|
+
}), criteria.minDistSq) || (0, _utils.TEST_MIN_IF_NOT_NAN)(velocity.x, criteria.minVelocityX) || (0, _utils.TEST_MIN_IF_NOT_NAN)(velocity.y, criteria.minVelocityY) || (0, _utils.TEST_MIN_IF_NOT_NAN)((0, _utils.VEC_LEN_SQ)(velocity), criteria.minVelocitySq);
|
|
105
|
+
}
|
|
106
|
+
shouldMultiFingerPanFail({
|
|
107
|
+
pointerLength,
|
|
108
|
+
scale,
|
|
109
|
+
deltaRotation
|
|
110
|
+
}) {
|
|
111
|
+
if (pointerLength <= 1) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Test if the pan had too much pinching or rotating.
|
|
116
|
+
const deltaScale = Math.abs(scale - 1);
|
|
117
|
+
const absDeltaRotation = Math.abs(deltaRotation);
|
|
118
|
+
if (deltaScale > _constants.MULTI_FINGER_PAN_MAX_PINCH_THRESHOLD) {
|
|
119
|
+
// > If the threshold doesn't seem right.
|
|
120
|
+
// You can log the value which it failed at here:
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
if (absDeltaRotation > _constants.MULTI_FINGER_PAN_MAX_ROTATION_THRESHOLD) {
|
|
124
|
+
// > If the threshold doesn't seem right.
|
|
125
|
+
// You can log the value which it failed at here:
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
updateHasCustomActivationCriteria(criteria) {
|
|
131
|
+
return (0, _utils.isValidNumber)(criteria.minDistSq) || (0, _utils.isValidNumber)(criteria.minVelocityX) || (0, _utils.isValidNumber)(criteria.minVelocityY) || (0, _utils.isValidNumber)(criteria.minVelocitySq) || (0, _utils.isValidNumber)(criteria.activeOffsetXStart) || (0, _utils.isValidNumber)(criteria.activeOffsetXEnd) || (0, _utils.isValidNumber)(criteria.activeOffsetYStart) || (0, _utils.isValidNumber)(criteria.activeOffsetYEnd);
|
|
132
|
+
}
|
|
133
|
+
isGestureEnabledForEvent(props, _recognizer, inputData) {
|
|
134
|
+
if (this.shouldFailUnderCustomCriteria(inputData, props)) {
|
|
135
|
+
return {
|
|
136
|
+
failed: true
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const velocity = {
|
|
140
|
+
x: inputData.velocityX,
|
|
141
|
+
y: inputData.velocityY
|
|
142
|
+
};
|
|
143
|
+
if (this.hasCustomActivationCriteria && this.shouldActivateUnderCustomCriteria({
|
|
144
|
+
deltaX: inputData.deltaX,
|
|
145
|
+
deltaY: inputData.deltaY,
|
|
146
|
+
velocity
|
|
147
|
+
}, props)) {
|
|
148
|
+
if (this.shouldMultiFingerPanFail({
|
|
149
|
+
pointerLength: inputData.maxPointers,
|
|
150
|
+
scale: inputData.scale,
|
|
151
|
+
deltaRotation: inputData.deltaRotation
|
|
152
|
+
})) {
|
|
153
|
+
return {
|
|
154
|
+
failed: true
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
success: true
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
success: false
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var _default = exports.default = PanGestureHandler;
|
|
167
|
+
//# sourceMappingURL=PanGestureHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hammerjs","_interopRequireDefault","require","_constants","_DraggingGestureHandler","_utils","_State","e","__esModule","default","PanGestureHandler","DraggingGestureHandler","name","NativeGestureClass","Hammer","Pan","getHammerConfig","direction","getDirection","getState","type","nextState","previousState","State","UNDETERMINED","ACTIVE","BEGAN","config","getConfig","activeOffsetXStart","activeOffsetXEnd","activeOffsetYStart","activeOffsetYEnd","minDist","directions","horizontalDirections","isnan","DIRECTION_ALL","push","DIRECTION_LEFT","DIRECTION_RIGHT","length","DIRECTION_HORIZONTAL","concat","verticalDirections","DIRECTION_UP","DIRECTION_DOWN","DIRECTION_VERTICAL","DIRECTION_NONE","hasCustomActivationCriteria","minDistSq","shouldFailUnderCustomCriteria","deltaX","deltaY","criteria","failOffsetXStart","failOffsetXEnd","failOffsetYStart","failOffsetYEnd","shouldActivateUnderCustomCriteria","velocity","TEST_MIN_IF_NOT_NAN","VEC_LEN_SQ","x","y","minVelocityX","minVelocityY","minVelocitySq","shouldMultiFingerPanFail","pointerLength","scale","deltaRotation","deltaScale","Math","abs","absDeltaRotation","MULTI_FINGER_PAN_MAX_PINCH_THRESHOLD","MULTI_FINGER_PAN_MAX_ROTATION_THRESHOLD","updateHasCustomActivationCriteria","isValidNumber","isGestureEnabledForEvent","props","_recognizer","inputData","failed","velocityX","velocityY","maxPointers","success","_default","exports"],"sources":["PanGestureHandler.ts"],"sourcesContent":["import Hammer from '@egjs/hammerjs';\n\nimport {\n EventMap,\n MULTI_FINGER_PAN_MAX_PINCH_THRESHOLD,\n MULTI_FINGER_PAN_MAX_ROTATION_THRESHOLD,\n} from './constants';\nimport DraggingGestureHandler from './DraggingGestureHandler';\nimport { isValidNumber, isnan, TEST_MIN_IF_NOT_NAN, VEC_LEN_SQ } from './utils';\nimport { State } from '../State';\n\nimport { Config, HammerInputExt } from './GestureHandler';\nclass PanGestureHandler extends DraggingGestureHandler {\n get name() {\n return 'pan';\n }\n\n get NativeGestureClass() {\n return Hammer.Pan;\n }\n\n getHammerConfig() {\n return {\n ...super.getHammerConfig(),\n direction: this.getDirection(),\n };\n }\n\n getState(type: keyof typeof EventMap) {\n const nextState = super.getState(type);\n // Ensure that the first state sent is `BEGAN` and not `ACTIVE`\n if (\n this.previousState === State.UNDETERMINED &&\n nextState === State.ACTIVE\n ) {\n return State.BEGAN;\n }\n return nextState;\n }\n\n getDirection() {\n const config = this.getConfig();\n const {\n activeOffsetXStart,\n activeOffsetXEnd,\n activeOffsetYStart,\n activeOffsetYEnd,\n minDist,\n } = config;\n let directions: number[] = [];\n let horizontalDirections = [];\n\n if (!isnan(minDist)) {\n return Hammer.DIRECTION_ALL;\n }\n\n if (!isnan(activeOffsetXStart)) {\n horizontalDirections.push(Hammer.DIRECTION_LEFT);\n }\n if (!isnan(activeOffsetXEnd)) {\n horizontalDirections.push(Hammer.DIRECTION_RIGHT);\n }\n if (horizontalDirections.length === 2) {\n horizontalDirections = [Hammer.DIRECTION_HORIZONTAL];\n }\n\n directions = directions.concat(horizontalDirections);\n let verticalDirections = [];\n\n if (!isnan(activeOffsetYStart)) {\n verticalDirections.push(Hammer.DIRECTION_UP);\n }\n if (!isnan(activeOffsetYEnd)) {\n verticalDirections.push(Hammer.DIRECTION_DOWN);\n }\n\n if (verticalDirections.length === 2) {\n verticalDirections = [Hammer.DIRECTION_VERTICAL];\n }\n\n directions = directions.concat(verticalDirections);\n\n if (!directions.length) {\n return Hammer.DIRECTION_NONE;\n }\n if (\n directions[0] === Hammer.DIRECTION_HORIZONTAL &&\n directions[1] === Hammer.DIRECTION_VERTICAL\n ) {\n return Hammer.DIRECTION_ALL;\n }\n if (horizontalDirections.length && verticalDirections.length) {\n return Hammer.DIRECTION_ALL;\n }\n\n return directions[0];\n }\n\n getConfig() {\n if (!this.hasCustomActivationCriteria) {\n // Default config\n // If no params have been defined then this config should emulate the native gesture as closely as possible.\n return {\n minDistSq: 10,\n };\n }\n return this.config;\n }\n\n shouldFailUnderCustomCriteria(\n { deltaX, deltaY }: HammerInputExt,\n criteria: any\n ) {\n return (\n (!isnan(criteria.failOffsetXStart) &&\n deltaX < criteria.failOffsetXStart) ||\n (!isnan(criteria.failOffsetXEnd) && deltaX > criteria.failOffsetXEnd) ||\n (!isnan(criteria.failOffsetYStart) &&\n deltaY < criteria.failOffsetYStart) ||\n (!isnan(criteria.failOffsetYEnd) && deltaY > criteria.failOffsetYEnd)\n );\n }\n\n shouldActivateUnderCustomCriteria(\n { deltaX, deltaY, velocity }: any,\n criteria: any\n ) {\n return (\n (!isnan(criteria.activeOffsetXStart) &&\n deltaX < criteria.activeOffsetXStart) ||\n (!isnan(criteria.activeOffsetXEnd) &&\n deltaX > criteria.activeOffsetXEnd) ||\n (!isnan(criteria.activeOffsetYStart) &&\n deltaY < criteria.activeOffsetYStart) ||\n (!isnan(criteria.activeOffsetYEnd) &&\n deltaY > criteria.activeOffsetYEnd) ||\n TEST_MIN_IF_NOT_NAN(\n VEC_LEN_SQ({ x: deltaX, y: deltaY }),\n criteria.minDistSq\n ) ||\n TEST_MIN_IF_NOT_NAN(velocity.x, criteria.minVelocityX) ||\n TEST_MIN_IF_NOT_NAN(velocity.y, criteria.minVelocityY) ||\n TEST_MIN_IF_NOT_NAN(VEC_LEN_SQ(velocity), criteria.minVelocitySq)\n );\n }\n\n shouldMultiFingerPanFail({\n pointerLength,\n scale,\n deltaRotation,\n }: {\n deltaRotation: number;\n pointerLength: number;\n scale: number;\n }) {\n if (pointerLength <= 1) {\n return false;\n }\n\n // Test if the pan had too much pinching or rotating.\n const deltaScale = Math.abs(scale - 1);\n const absDeltaRotation = Math.abs(deltaRotation);\n if (deltaScale > MULTI_FINGER_PAN_MAX_PINCH_THRESHOLD) {\n // > If the threshold doesn't seem right.\n // You can log the value which it failed at here:\n return true;\n }\n if (absDeltaRotation > MULTI_FINGER_PAN_MAX_ROTATION_THRESHOLD) {\n // > If the threshold doesn't seem right.\n // You can log the value which it failed at here:\n return true;\n }\n\n return false;\n }\n\n updateHasCustomActivationCriteria(\n criteria: Config & { minVelocityX?: number; minVelocityY?: number }\n ) {\n return (\n isValidNumber(criteria.minDistSq) ||\n isValidNumber(criteria.minVelocityX) ||\n isValidNumber(criteria.minVelocityY) ||\n isValidNumber(criteria.minVelocitySq) ||\n isValidNumber(criteria.activeOffsetXStart) ||\n isValidNumber(criteria.activeOffsetXEnd) ||\n isValidNumber(criteria.activeOffsetYStart) ||\n isValidNumber(criteria.activeOffsetYEnd)\n );\n }\n\n isGestureEnabledForEvent(\n props: any,\n _recognizer: any,\n inputData: HammerInputExt & { deltaRotation: number }\n ) {\n if (this.shouldFailUnderCustomCriteria(inputData, props)) {\n return { failed: true };\n }\n\n const velocity = { x: inputData.velocityX, y: inputData.velocityY };\n if (\n this.hasCustomActivationCriteria &&\n this.shouldActivateUnderCustomCriteria(\n { deltaX: inputData.deltaX, deltaY: inputData.deltaY, velocity },\n props\n )\n ) {\n if (\n this.shouldMultiFingerPanFail({\n pointerLength: inputData.maxPointers,\n scale: inputData.scale,\n deltaRotation: inputData.deltaRotation,\n })\n ) {\n return {\n failed: true,\n };\n }\n return { success: true };\n }\n return { success: false };\n }\n}\n\nexport default PanGestureHandler;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,uBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAiC,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjC,MAAMG,iBAAiB,SAASC,+BAAsB,CAAC;EACrD,IAAIC,IAAIA,CAAA,EAAG;IACT,OAAO,KAAK;EACd;EAEA,IAAIC,kBAAkBA,CAAA,EAAG;IACvB,OAAOC,iBAAM,CAACC,GAAG;EACnB;EAEAC,eAAeA,CAAA,EAAG;IAChB,OAAO;MACL,GAAG,KAAK,CAACA,eAAe,CAAC,CAAC;MAC1BC,SAAS,EAAE,IAAI,CAACC,YAAY,CAAC;IAC/B,CAAC;EACH;EAEAC,QAAQA,CAACC,IAA2B,EAAE;IACpC,MAAMC,SAAS,GAAG,KAAK,CAACF,QAAQ,CAACC,IAAI,CAAC;IACtC;IACA,IACE,IAAI,CAACE,aAAa,KAAKC,YAAK,CAACC,YAAY,IACzCH,SAAS,KAAKE,YAAK,CAACE,MAAM,EAC1B;MACA,OAAOF,YAAK,CAACG,KAAK;IACpB;IACA,OAAOL,SAAS;EAClB;EAEAH,YAAYA,CAAA,EAAG;IACb,MAAMS,MAAM,GAAG,IAAI,CAACC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AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAEcC,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
|
|
8
|
+
var _IndiscreteGestureHandler = _interopRequireDefault(require("./IndiscreteGestureHandler"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class PinchGestureHandler extends _IndiscreteGestureHandler.default {
|
|
11
|
+
get name() {
|
|
12
|
+
return 'pinch';
|
|
13
|
+
}
|
|
14
|
+
get NativeGestureClass() {
|
|
15
|
+
return _hammerjs.default.Pinch;
|
|
16
|
+
}
|
|
17
|
+
transformNativeEvent({
|
|
18
|
+
scale,
|
|
19
|
+
velocity,
|
|
20
|
+
center
|
|
21
|
+
}) {
|
|
22
|
+
return {
|
|
23
|
+
focalX: center.x,
|
|
24
|
+
focalY: center.y,
|
|
25
|
+
velocity,
|
|
26
|
+
scale
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
var _default = exports.default = PinchGestureHandler;
|
|
31
|
+
//# sourceMappingURL=PinchGestureHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hammerjs","_interopRequireDefault","require","_IndiscreteGestureHandler","e","__esModule","default","PinchGestureHandler","IndiscreteGestureHandler","name","NativeGestureClass","Hammer","Pinch","transformNativeEvent","scale","velocity","center","focalX","x","focalY","y","_default","exports"],"sources":["PinchGestureHandler.ts"],"sourcesContent":["import Hammer from '@egjs/hammerjs';\nimport { HammerInputExt } from './GestureHandler';\n\nimport IndiscreteGestureHandler from './IndiscreteGestureHandler';\n\nclass PinchGestureHandler extends IndiscreteGestureHandler {\n get name() {\n return 'pinch';\n }\n\n get NativeGestureClass() {\n return Hammer.Pinch;\n }\n\n transformNativeEvent({ scale, velocity, center }: HammerInputExt) {\n return {\n focalX: center.x,\n focalY: center.y,\n velocity,\n scale,\n };\n }\n}\n\nexport default PinchGestureHandler;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,yBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAkE,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElE,MAAMG,mBAAmB,SAASC,iCAAwB,CAAC;EACzD,IAAIC,IAAIA,CAAA,EAAG;IACT,OAAO,OAAO;EAChB;EAEA,IAAIC,kBAAkBA,CAAA,EAAG;IACvB,OAAOC,iBAAM,CAACC,KAAK;EACrB;EAEAC,oBAAoBA,CAAC;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAuB,CAAC,EAAE;IAChE,OAAO;MACLC,MAAM,EAAED,MAAM,CAACE,CAAC;MAChBC,MAAM,EAAEH,MAAM,CAACI,CAAC;MAChBL,QAAQ;MACRD;IACF,CAAC;EACH;AACF;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAEcC,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
|
|
8
|
+
var _State = require("../State");
|
|
9
|
+
var _constants = require("./constants");
|
|
10
|
+
var _DiscreteGestureHandler = _interopRequireDefault(require("./DiscreteGestureHandler"));
|
|
11
|
+
var _utils = require("./utils");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
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); }
|
|
16
|
+
class PressGestureHandler extends _DiscreteGestureHandler.default {
|
|
17
|
+
constructor(...args) {
|
|
18
|
+
super(...args);
|
|
19
|
+
_defineProperty(this, "visualFeedbackTimer", void 0);
|
|
20
|
+
_defineProperty(this, "initialEvent", null);
|
|
21
|
+
_defineProperty(this, "shouldDelayTouches", true);
|
|
22
|
+
}
|
|
23
|
+
get name() {
|
|
24
|
+
return 'press';
|
|
25
|
+
}
|
|
26
|
+
get minDurationMs() {
|
|
27
|
+
// @ts-ignore FIXME(TS)
|
|
28
|
+
return (0, _utils.isnan)(this.config.minDurationMs) ? 5 : this.config.minDurationMs;
|
|
29
|
+
}
|
|
30
|
+
get maxDist() {
|
|
31
|
+
return (0, _utils.isnan)(this.config.maxDist) ? 9 : this.config.maxDist;
|
|
32
|
+
}
|
|
33
|
+
get NativeGestureClass() {
|
|
34
|
+
return _hammerjs.default.Press;
|
|
35
|
+
}
|
|
36
|
+
simulateCancelEvent(inputData) {
|
|
37
|
+
// Long press never starts so we can't rely on the running event boolean.
|
|
38
|
+
this.hasGestureFailed = true;
|
|
39
|
+
this.cancelEvent(inputData);
|
|
40
|
+
}
|
|
41
|
+
updateHasCustomActivationCriteria({
|
|
42
|
+
shouldCancelWhenOutside,
|
|
43
|
+
maxDistSq
|
|
44
|
+
}) {
|
|
45
|
+
return shouldCancelWhenOutside || !(0, _utils.isValidNumber)(maxDistSq);
|
|
46
|
+
}
|
|
47
|
+
getState(type) {
|
|
48
|
+
return {
|
|
49
|
+
[_hammerjs.default.INPUT_START]: _State.State.BEGAN,
|
|
50
|
+
[_hammerjs.default.INPUT_MOVE]: _State.State.ACTIVE,
|
|
51
|
+
[_hammerjs.default.INPUT_END]: _State.State.END,
|
|
52
|
+
[_hammerjs.default.INPUT_CANCEL]: _State.State.CANCELLED
|
|
53
|
+
}[type];
|
|
54
|
+
}
|
|
55
|
+
getConfig() {
|
|
56
|
+
if (!this.hasCustomActivationCriteria) {
|
|
57
|
+
// Default config
|
|
58
|
+
// If no params have been defined then this config should emulate the native gesture as closely as possible.
|
|
59
|
+
return {
|
|
60
|
+
shouldCancelWhenOutside: true,
|
|
61
|
+
maxDistSq: 10
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return this.config;
|
|
65
|
+
}
|
|
66
|
+
getHammerConfig() {
|
|
67
|
+
return {
|
|
68
|
+
...super.getHammerConfig(),
|
|
69
|
+
// threshold: this.maxDist,
|
|
70
|
+
time: this.minDurationMs
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
onGestureActivated(ev) {
|
|
74
|
+
this.onGestureStart(ev);
|
|
75
|
+
}
|
|
76
|
+
shouldDelayTouchForEvent({
|
|
77
|
+
pointerType
|
|
78
|
+
}) {
|
|
79
|
+
// Don't disable event for mouse input
|
|
80
|
+
return this.shouldDelayTouches && pointerType === 'touch';
|
|
81
|
+
}
|
|
82
|
+
onGestureStart(ev) {
|
|
83
|
+
this.isGestureRunning = true;
|
|
84
|
+
clearTimeout(this.visualFeedbackTimer);
|
|
85
|
+
this.initialEvent = ev;
|
|
86
|
+
this.visualFeedbackTimer = (0, _utils.fireAfterInterval)(() => {
|
|
87
|
+
this.sendGestureStartedEvent(this.initialEvent);
|
|
88
|
+
this.initialEvent = null;
|
|
89
|
+
}, this.shouldDelayTouchForEvent(ev) && _constants.CONTENT_TOUCHES_DELAY);
|
|
90
|
+
}
|
|
91
|
+
sendGestureStartedEvent(ev) {
|
|
92
|
+
clearTimeout(this.visualFeedbackTimer);
|
|
93
|
+
this.visualFeedbackTimer = null;
|
|
94
|
+
this.sendEvent({
|
|
95
|
+
...ev,
|
|
96
|
+
eventType: _hammerjs.default.INPUT_MOVE,
|
|
97
|
+
isFirst: true
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
forceInvalidate(event) {
|
|
101
|
+
super.forceInvalidate(event);
|
|
102
|
+
clearTimeout(this.visualFeedbackTimer);
|
|
103
|
+
this.visualFeedbackTimer = null;
|
|
104
|
+
this.initialEvent = null;
|
|
105
|
+
}
|
|
106
|
+
onRawEvent(ev) {
|
|
107
|
+
super.onRawEvent(ev);
|
|
108
|
+
if (this.isGestureRunning) {
|
|
109
|
+
if (ev.isFinal) {
|
|
110
|
+
let timeout;
|
|
111
|
+
if (this.visualFeedbackTimer) {
|
|
112
|
+
// Aesthetic timing for a quick tap.
|
|
113
|
+
// We haven't activated the tap right away to emulate iOS `delaysContentTouches`
|
|
114
|
+
// Now we must send the initial activation event and wait a set amount of time before firing the end event.
|
|
115
|
+
timeout = _constants.CONTENT_TOUCHES_QUICK_TAP_END_DELAY;
|
|
116
|
+
this.sendGestureStartedEvent(this.initialEvent);
|
|
117
|
+
this.initialEvent = null;
|
|
118
|
+
}
|
|
119
|
+
(0, _utils.fireAfterInterval)(() => {
|
|
120
|
+
this.sendEvent({
|
|
121
|
+
...ev,
|
|
122
|
+
eventType: _hammerjs.default.INPUT_END,
|
|
123
|
+
isFinal: true
|
|
124
|
+
});
|
|
125
|
+
// @ts-ignore -- this should explicitly support undefined
|
|
126
|
+
this.onGestureEnded();
|
|
127
|
+
}, timeout);
|
|
128
|
+
} else {
|
|
129
|
+
this.sendEvent({
|
|
130
|
+
...ev,
|
|
131
|
+
eventType: _hammerjs.default.INPUT_MOVE,
|
|
132
|
+
isFinal: false
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
updateGestureConfig({
|
|
138
|
+
shouldActivateOnStart = false,
|
|
139
|
+
disallowInterruption = false,
|
|
140
|
+
shouldCancelWhenOutside = true,
|
|
141
|
+
minDurationMs = Number.NaN,
|
|
142
|
+
maxDist = Number.NaN,
|
|
143
|
+
minPointers = 1,
|
|
144
|
+
maxPointers = 1,
|
|
145
|
+
...props
|
|
146
|
+
}) {
|
|
147
|
+
return super.updateGestureConfig({
|
|
148
|
+
shouldActivateOnStart,
|
|
149
|
+
disallowInterruption,
|
|
150
|
+
shouldCancelWhenOutside,
|
|
151
|
+
minDurationMs,
|
|
152
|
+
maxDist,
|
|
153
|
+
minPointers,
|
|
154
|
+
maxPointers,
|
|
155
|
+
...props
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
var _default = exports.default = PressGestureHandler;
|
|
160
|
+
//# sourceMappingURL=PressGestureHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hammerjs","_interopRequireDefault","require","_State","_constants","_DiscreteGestureHandler","_utils","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","PressGestureHandler","DiscreteGestureHandler","constructor","args","name","minDurationMs","isnan","config","maxDist","NativeGestureClass","Hammer","Press","simulateCancelEvent","inputData","hasGestureFailed","cancelEvent","updateHasCustomActivationCriteria","shouldCancelWhenOutside","maxDistSq","isValidNumber","getState","type","INPUT_START","State","BEGAN","INPUT_MOVE","ACTIVE","INPUT_END","END","INPUT_CANCEL","CANCELLED","getConfig","hasCustomActivationCriteria","getHammerConfig","time","onGestureActivated","ev","onGestureStart","shouldDelayTouchForEvent","pointerType","shouldDelayTouches","isGestureRunning","clearTimeout","visualFeedbackTimer","initialEvent","fireAfterInterval","sendGestureStartedEvent","CONTENT_TOUCHES_DELAY","sendEvent","eventType","isFirst","forceInvalidate","event","onRawEvent","isFinal","timeout","CONTENT_TOUCHES_QUICK_TAP_END_DELAY","onGestureEnded","updateGestureConfig","shouldActivateOnStart","disallowInterruption","NaN","minPointers","maxPointers","props","_default","exports"],"sources":["PressGestureHandler.ts"],"sourcesContent":["import Hammer from '@egjs/hammerjs';\n\nimport { State } from '../State';\nimport {\n CONTENT_TOUCHES_DELAY,\n CONTENT_TOUCHES_QUICK_TAP_END_DELAY,\n HammerInputNames,\n} from './constants';\nimport DiscreteGestureHandler from './DiscreteGestureHandler';\nimport { Config, HammerInputExt } from './GestureHandler';\nimport { fireAfterInterval, isValidNumber, isnan } from './utils';\n\nclass PressGestureHandler extends DiscreteGestureHandler {\n private visualFeedbackTimer: any;\n private initialEvent: HammerInputExt | null = null;\n get name() {\n return 'press';\n }\n\n get minDurationMs() {\n // @ts-ignore FIXME(TS)\n return isnan(this.config.minDurationMs) ? 5 : this.config.minDurationMs;\n }\n\n get maxDist() {\n return isnan(this.config.maxDist) ? 9 : this.config.maxDist;\n }\n\n get NativeGestureClass() {\n return Hammer.Press;\n }\n\n shouldDelayTouches = true;\n\n simulateCancelEvent(inputData: HammerInputExt) {\n // Long press never starts so we can't rely on the running event boolean.\n this.hasGestureFailed = true;\n this.cancelEvent(inputData);\n }\n\n updateHasCustomActivationCriteria({\n shouldCancelWhenOutside,\n maxDistSq,\n }: Config & { shouldCancelWhenOutside: boolean }) {\n return shouldCancelWhenOutside || !isValidNumber(maxDistSq);\n }\n\n getState(type: keyof typeof HammerInputNames): State {\n return {\n [Hammer.INPUT_START]: State.BEGAN,\n [Hammer.INPUT_MOVE]: State.ACTIVE,\n [Hammer.INPUT_END]: State.END,\n [Hammer.INPUT_CANCEL]: State.CANCELLED,\n }[type];\n }\n\n getConfig() {\n if (!this.hasCustomActivationCriteria) {\n // Default config\n // If no params have been defined then this config should emulate the native gesture as closely as possible.\n return {\n shouldCancelWhenOutside: true,\n maxDistSq: 10,\n };\n }\n return this.config;\n }\n\n getHammerConfig() {\n return {\n ...super.getHammerConfig(),\n // threshold: this.maxDist,\n time: this.minDurationMs,\n };\n }\n\n onGestureActivated(ev: HammerInputExt) {\n this.onGestureStart(ev);\n }\n\n shouldDelayTouchForEvent({ pointerType }: HammerInputExt) {\n // Don't disable event for mouse input\n return this.shouldDelayTouches && pointerType === 'touch';\n }\n\n onGestureStart(ev: HammerInputExt) {\n this.isGestureRunning = true;\n clearTimeout(this.visualFeedbackTimer);\n this.initialEvent = ev;\n this.visualFeedbackTimer = fireAfterInterval(() => {\n this.sendGestureStartedEvent(this.initialEvent as HammerInputExt);\n this.initialEvent = null;\n }, this.shouldDelayTouchForEvent(ev) && CONTENT_TOUCHES_DELAY);\n }\n\n sendGestureStartedEvent(ev: HammerInputExt) {\n clearTimeout(this.visualFeedbackTimer);\n this.visualFeedbackTimer = null;\n this.sendEvent({\n ...ev,\n eventType: Hammer.INPUT_MOVE,\n isFirst: true,\n });\n }\n\n forceInvalidate(event: HammerInputExt) {\n super.forceInvalidate(event);\n clearTimeout(this.visualFeedbackTimer);\n this.visualFeedbackTimer = null;\n this.initialEvent = null;\n }\n\n onRawEvent(ev: HammerInputExt) {\n super.onRawEvent(ev);\n if (this.isGestureRunning) {\n if (ev.isFinal) {\n let timeout;\n if (this.visualFeedbackTimer) {\n // Aesthetic timing for a quick tap.\n // We haven't activated the tap right away to emulate iOS `delaysContentTouches`\n // Now we must send the initial activation event and wait a set amount of time before firing the end event.\n timeout = CONTENT_TOUCHES_QUICK_TAP_END_DELAY;\n this.sendGestureStartedEvent(this.initialEvent as HammerInputExt);\n this.initialEvent = null;\n }\n fireAfterInterval(() => {\n this.sendEvent({\n ...ev,\n eventType: Hammer.INPUT_END,\n isFinal: true,\n });\n // @ts-ignore -- this should explicitly support undefined\n this.onGestureEnded();\n }, timeout);\n } else {\n this.sendEvent({\n ...ev,\n eventType: Hammer.INPUT_MOVE,\n isFinal: false,\n });\n }\n }\n }\n\n updateGestureConfig({\n shouldActivateOnStart = false,\n disallowInterruption = false,\n shouldCancelWhenOutside = true,\n minDurationMs = Number.NaN,\n maxDist = Number.NaN,\n minPointers = 1,\n maxPointers = 1,\n ...props\n }) {\n return super.updateGestureConfig({\n shouldActivateOnStart,\n disallowInterruption,\n shouldCancelWhenOutside,\n minDurationMs,\n maxDist,\n minPointers,\n maxPointers,\n ...props,\n });\n }\n}\nexport default PressGestureHandler;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAKA,IAAAG,uBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAAkE,SAAAD,uBAAAM,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,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAElE,MAAMg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O;MACPsD,WAAW;MACXC,WAAW;MACX,GAAGC;IACL,CAAC,CAAC;EACJ;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArF,OAAA,GACcmB,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _hammerjs = _interopRequireDefault(require("@egjs/hammerjs"));
|
|
8
|
+
var _constants = require("./constants");
|
|
9
|
+
var _IndiscreteGestureHandler = _interopRequireDefault(require("./IndiscreteGestureHandler"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
class RotationGestureHandler extends _IndiscreteGestureHandler.default {
|
|
12
|
+
get name() {
|
|
13
|
+
return 'rotate';
|
|
14
|
+
}
|
|
15
|
+
get NativeGestureClass() {
|
|
16
|
+
return _hammerjs.default.Rotate;
|
|
17
|
+
}
|
|
18
|
+
transformNativeEvent({
|
|
19
|
+
rotation,
|
|
20
|
+
velocity,
|
|
21
|
+
center
|
|
22
|
+
}) {
|
|
23
|
+
var _this$initialRotation;
|
|
24
|
+
return {
|
|
25
|
+
rotation: (rotation - ((_this$initialRotation = this.initialRotation) !== null && _this$initialRotation !== void 0 ? _this$initialRotation : 0)) * _constants.DEG_RAD,
|
|
26
|
+
anchorX: center.x,
|
|
27
|
+
anchorY: center.y,
|
|
28
|
+
velocity
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
var _default = exports.default = RotationGestureHandler;
|
|
33
|
+
//# sourceMappingURL=RotationGestureHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hammerjs","_interopRequireDefault","require","_constants","_IndiscreteGestureHandler","e","__esModule","default","RotationGestureHandler","IndiscreteGestureHandler","name","NativeGestureClass","Hammer","Rotate","transformNativeEvent","rotation","velocity","center","_this$initialRotation","initialRotation","DEG_RAD","anchorX","x","anchorY","y","_default","exports"],"sources":["RotationGestureHandler.ts"],"sourcesContent":["import Hammer from '@egjs/hammerjs';\n\nimport { DEG_RAD } from './constants';\nimport { HammerInputExt } from './GestureHandler';\nimport IndiscreteGestureHandler from './IndiscreteGestureHandler';\n\nclass RotationGestureHandler extends IndiscreteGestureHandler {\n get name() {\n return 'rotate';\n }\n\n get NativeGestureClass() {\n return Hammer.Rotate;\n }\n\n transformNativeEvent({ rotation, velocity, center }: HammerInputExt) {\n return {\n rotation: (rotation - (this.initialRotation ?? 0)) * DEG_RAD,\n anchorX: center.x,\n anchorY: center.y,\n velocity,\n };\n }\n}\nexport default RotationGestureHandler;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,yBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAkE,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElE,MAAMG,sBAAsB,SAASC,iCAAwB,CAAC;EAC5D,IAAIC,IAAIA,CAAA,EAAG;IACT,OAAO,QAAQ;EACjB;EAEA,IAAIC,kBAAkBA,CAAA,EAAG;IACvB,OAAOC,iBAAM,CAACC,MAAM;EACtB;EAEAC,oBAAoBA,CAAC;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC;EAAuB,CAAC,EAAE;IAAA,IAAAC,qBAAA;IACnE,OAAO;MACLH,QAAQ,EAAE,CAACA,QAAQ,KAAAG,qBAAA,GAAI,IAAI,CAACC,eAAe,cAAAD,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC,IAAIE,kBAAO;MAC5DC,OAAO,EAAEJ,MAAM,CAACK,CAAC;MACjBC,OAAO,EAAEN,MAAM,CAACO,CAAC;MACjBR;IACF,CAAC;EACH;AACF;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GACcC,sBAAsB","ignoreList":[]}
|