react-native-gesture-handler 2.25.0 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/RNGestureHandler.podspec +1 -0
- package/android/build.gradle +41 -42
- package/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +1 -1
- package/android/gradle.properties +1 -1
- package/android/noreanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +2 -2
- package/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +4 -1
- package/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt +1 -1
- package/android/{package77/src → src}/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +14 -19
- package/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt +29 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +229 -114
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerInteractionController.kt +4 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +91 -49
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerRegistry.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureUtils.kt +13 -4
- package/android/src/main/java/com/swmansion/gesturehandler/core/HoverGestureHandler.kt +20 -6
- package/android/src/main/java/com/swmansion/gesturehandler/core/LongPressGestureHandler.kt +52 -21
- package/android/src/main/java/com/swmansion/gesturehandler/core/ManualGestureHandler.kt +12 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +65 -35
- package/android/src/main/java/com/swmansion/gesturehandler/core/OnTouchEventListener.kt +3 -3
- package/android/src/main/java/com/swmansion/gesturehandler/core/PanGestureHandler.kt +187 -92
- package/android/src/main/java/com/swmansion/gesturehandler/core/PinchGestureHandler.kt +12 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/PointerEventsConfig.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureDetector.kt +3 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +12 -5
- package/android/src/main/java/com/swmansion/gesturehandler/core/StylusData.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/TapGestureHandler.kt +55 -33
- package/android/src/main/java/com/swmansion/gesturehandler/core/Vector.kt +13 -18
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +27 -21
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEnabledRootView.kt +7 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +13 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDispatcher.kt +189 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerFactoryUtil.kt +34 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +7 -11
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +29 -590
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRegistry.kt +8 -14
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt +26 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +15 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt +2 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +17 -16
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerTouchEvent.kt +6 -4
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNViewConfigurationHelper.kt +7 -5
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +2 -1
- package/android/src/main/jni/CMakeLists.txt +8 -18
- package/android/svg/src/main/java/com/swmansion/gesturehandler/RNSVGHitTester.kt +1 -3
- package/apple/RNGestureHandlerButton.mm +6 -2
- package/package.json +29 -47
- package/src/components/DrawerLayout.tsx +5 -2
- package/src/components/GestureButtons.tsx +2 -2
- package/src/components/GestureComponents.web.tsx +1 -1
- package/src/components/GestureHandlerButton.web.tsx +3 -3
- package/src/components/Pressable/Pressable.tsx +362 -425
- package/src/components/Pressable/PressableProps.tsx +34 -0
- package/src/components/Pressable/StateMachine.tsx +49 -0
- package/src/components/Pressable/stateDefinitions.ts +125 -0
- package/src/components/Pressable/utils.ts +11 -7
- package/src/components/ReanimatedSwipeable.tsx +55 -33
- package/src/components/Swipeable.tsx +3 -0
- package/src/components/Text.tsx +5 -2
- package/src/components/utils.ts +26 -0
- package/src/getShadowNodeFromRef.ts +2 -2
- package/src/handlers/GestureHandlerEventPayload.ts +3 -0
- package/src/handlers/createHandler.tsx +1 -0
- package/src/handlers/gestureHandlerTypesCompat.ts +9 -0
- package/src/handlers/gestures/forceTouchGesture.ts +9 -0
- package/src/handlers/gestures/gestureObjects.ts +3 -1
- package/src/handlers/gestures/reanimatedWrapper.ts +0 -1
- package/src/handlers/utils.ts +1 -1
- package/src/utils.ts +0 -1
- package/src/web/detectors/RotationGestureDetector.ts +4 -0
- package/src/web/handlers/FlingGestureHandler.ts +4 -0
- package/src/web/handlers/GestureHandler.ts +9 -3
- package/src/web/handlers/PanGestureHandler.ts +25 -36
- package/src/web/handlers/TapGestureHandler.ts +14 -19
- package/src/web/tools/GestureHandlerOrchestrator.ts +1 -0
- package/src/web/tools/PointerEventManager.ts +1 -1
- package/src/web/tools/PointerTracker.ts +17 -15
- package/src/web/tools/Vector.ts +1 -1
- package/src/web_hammer/DiscreteGestureHandler.ts +1 -1
- package/src/web_hammer/DraggingGestureHandler.ts +1 -1
- package/src/web_hammer/FlingGestureHandler.ts +1 -1
- package/src/web_hammer/GestureHandler.ts +2 -1
- package/src/web_hammer/LongPressGestureHandler.ts +1 -1
- package/android/packageDeprecated/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt +0 -85
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -60
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -26
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -26
- package/android/paper77/src/main/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -16
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/NativeRNGestureHandlerModuleSpec.java +0 -67
- package/android/paper77/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -13
- package/lib/commonjs/ActionType.js +0 -15
- package/lib/commonjs/ActionType.js.map +0 -1
- package/lib/commonjs/Directions.js +0 -28
- package/lib/commonjs/Directions.js.map +0 -1
- package/lib/commonjs/EnableNewWebImplementation.js +0 -48
- package/lib/commonjs/EnableNewWebImplementation.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootViewContext.js +0 -15
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +0 -1
- package/lib/commonjs/PlatformConstants.js +0 -15
- package/lib/commonjs/PlatformConstants.js.map +0 -1
- package/lib/commonjs/PlatformConstants.web.js +0 -14
- package/lib/commonjs/PlatformConstants.web.js.map +0 -1
- package/lib/commonjs/PointerType.js +0 -17
- package/lib/commonjs/PointerType.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.js +0 -16
- package/lib/commonjs/RNGestureHandlerModule.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +0 -122
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +0 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +0 -66
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +0 -1
- package/lib/commonjs/RNRenderer.js +0 -16
- package/lib/commonjs/RNRenderer.js.map +0 -1
- package/lib/commonjs/RNRenderer.web.js +0 -11
- package/lib/commonjs/RNRenderer.web.js.map +0 -1
- package/lib/commonjs/State.js +0 -18
- package/lib/commonjs/State.js.map +0 -1
- package/lib/commonjs/TouchEventType.js +0 -16
- package/lib/commonjs/TouchEventType.js.map +0 -1
- package/lib/commonjs/components/DrawerLayout.js +0 -574
- package/lib/commonjs/components/DrawerLayout.js.map +0 -1
- package/lib/commonjs/components/GestureButtons.js +0 -269
- package/lib/commonjs/components/GestureButtons.js.map +0 -1
- package/lib/commonjs/components/GestureButtonsProps.js +0 -6
- package/lib/commonjs/components/GestureButtonsProps.js.map +0 -1
- package/lib/commonjs/components/GestureComponents.js +0 -115
- package/lib/commonjs/components/GestureComponents.js.map +0 -1
- package/lib/commonjs/components/GestureComponents.web.js +0 -52
- package/lib/commonjs/components/GestureComponents.web.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.js +0 -14
- package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.web.js +0 -24
- package/lib/commonjs/components/GestureHandlerButton.web.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.android.js +0 -46
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +0 -44
- package/lib/commonjs/components/GestureHandlerRootView.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js +0 -38
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +0 -1
- package/lib/commonjs/components/Pressable/Pressable.js +0 -370
- package/lib/commonjs/components/Pressable/Pressable.js.map +0 -1
- package/lib/commonjs/components/Pressable/PressableProps.js +0 -6
- package/lib/commonjs/components/Pressable/PressableProps.js.map +0 -1
- package/lib/commonjs/components/Pressable/index.js +0 -16
- package/lib/commonjs/components/Pressable/index.js.map +0 -1
- package/lib/commonjs/components/Pressable/utils.js +0 -114
- package/lib/commonjs/components/Pressable/utils.js.map +0 -1
- package/lib/commonjs/components/ReanimatedDrawerLayout.js +0 -393
- package/lib/commonjs/components/ReanimatedDrawerLayout.js.map +0 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +0 -367
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +0 -1
- package/lib/commonjs/components/Swipeable.js +0 -415
- package/lib/commonjs/components/Swipeable.js.map +0 -1
- package/lib/commonjs/components/Text.js +0 -71
- package/lib/commonjs/components/Text.js.map +0 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js +0 -40
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +0 -1
- package/lib/commonjs/components/touchables/ExtraButtonProps.js +0 -2
- package/lib/commonjs/components/touchables/ExtraButtonProps.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +0 -290
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchableProps.js +0 -6
- package/lib/commonjs/components/touchables/GenericTouchableProps.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +0 -111
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +0 -102
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +0 -16
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js +0 -6
- package/lib/commonjs/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -79
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -37
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/index.js +0 -40
- package/lib/commonjs/components/touchables/index.js.map +0 -1
- package/lib/commonjs/findNodeHandle.js +0 -12
- package/lib/commonjs/findNodeHandle.js.map +0 -1
- package/lib/commonjs/findNodeHandle.web.js +0 -48
- package/lib/commonjs/findNodeHandle.web.js.map +0 -1
- package/lib/commonjs/getShadowNodeFromRef.js +0 -52
- package/lib/commonjs/getShadowNodeFromRef.js.map +0 -1
- package/lib/commonjs/getShadowNodeFromRef.web.js +0 -15
- package/lib/commonjs/getShadowNodeFromRef.web.js.map +0 -1
- package/lib/commonjs/ghQueueMicrotask.js +0 -11
- package/lib/commonjs/ghQueueMicrotask.js.map +0 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +0 -33
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +0 -53
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js +0 -6
- package/lib/commonjs/handlers/GestureHandlerEventPayload.js.map +0 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +0 -35
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -35
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +0 -131
- package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +0 -31
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.js +0 -14
- package/lib/commonjs/handlers/PressabilityDebugView.js.map +0 -1
- package/lib/commonjs/handlers/PressabilityDebugView.web.js +0 -12
- package/lib/commonjs/handlers/PressabilityDebugView.web.js.map +0 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +0 -31
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +0 -35
- package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/createHandler.js +0 -494
- package/lib/commonjs/handlers/createHandler.js.map +0 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +0 -87
- package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.js +0 -14
- package/lib/commonjs/handlers/customDirectEventTypes.js.map +0 -1
- package/lib/commonjs/handlers/customDirectEventTypes.web.js +0 -11
- package/lib/commonjs/handlers/customDirectEventTypes.web.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -28
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js +0 -6
- package/lib/commonjs/handlers/gestureHandlerTypesCompat.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js +0 -42
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js +0 -49
- package/lib/commonjs/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js +0 -87
- package/lib/commonjs/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js +0 -29
- package/lib/commonjs/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +0 -148
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js +0 -25
- package/lib/commonjs/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js +0 -6
- package/lib/commonjs/handlers/gestures/GestureDetector/types.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js +0 -77
- package/lib/commonjs/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -180
- package/lib/commonjs/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -57
- package/lib/commonjs/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js +0 -48
- package/lib/commonjs/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -49
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +0 -172
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +0 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +0 -147
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +0 -1
- package/lib/commonjs/handlers/gestures/flingGesture.js +0 -47
- package/lib/commonjs/handlers/gestures/flingGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js +0 -82
- package/lib/commonjs/handlers/gestures/forceTouchGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gesture.js +0 -381
- package/lib/commonjs/handlers/gestures/gesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureComposition.js +0 -107
- package/lib/commonjs/handlers/gestures/gestureComposition.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureObjects.js +0 -156
- package/lib/commonjs/handlers/gestures/gestureObjects.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +0 -75
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +0 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +0 -32
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +0 -1
- package/lib/commonjs/handlers/gestures/hoverGesture.js +0 -74
- package/lib/commonjs/handlers/gestures/hoverGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +0 -57
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/manualGesture.js +0 -31
- package/lib/commonjs/handlers/gestures/manualGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/nativeGesture.js +0 -44
- package/lib/commonjs/handlers/gestures/nativeGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/panGesture.js +0 -225
- package/lib/commonjs/handlers/gestures/panGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/pinchGesture.js +0 -45
- package/lib/commonjs/handlers/gestures/pinchGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +0 -37
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +0 -1
- package/lib/commonjs/handlers/gestures/rotationGesture.js +0 -45
- package/lib/commonjs/handlers/gestures/rotationGesture.js.map +0 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +0 -102
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +0 -1
- package/lib/commonjs/handlers/getNextHandlerTag.js +0 -12
- package/lib/commonjs/handlers/getNextHandlerTag.js.map +0 -1
- package/lib/commonjs/handlers/handlersRegistry.js +0 -66
- package/lib/commonjs/handlers/handlersRegistry.js.map +0 -1
- package/lib/commonjs/handlers/utils.js +0 -92
- package/lib/commonjs/handlers/utils.js.map +0 -1
- package/lib/commonjs/index.js +0 -298
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/init.js +0 -32
- package/lib/commonjs/init.js.map +0 -1
- package/lib/commonjs/jestUtils/index.js +0 -20
- package/lib/commonjs/jestUtils/index.js.map +0 -1
- package/lib/commonjs/jestUtils/jestUtils.js +0 -383
- package/lib/commonjs/jestUtils/jestUtils.js.map +0 -1
- package/lib/commonjs/mocks.js +0 -81
- package/lib/commonjs/mocks.js.map +0 -1
- package/lib/commonjs/mountRegistry.js +0 -49
- package/lib/commonjs/mountRegistry.js.map +0 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +0 -13
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +0 -1
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +0 -15
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +0 -15
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
- package/lib/commonjs/typeUtils.js +0 -2
- package/lib/commonjs/typeUtils.js.map +0 -1
- package/lib/commonjs/utils.js +0 -116
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/commonjs/web/Gestures.js +0 -66
- package/lib/commonjs/web/Gestures.js.map +0 -1
- package/lib/commonjs/web/constants.js +0 -11
- package/lib/commonjs/web/constants.js.map +0 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +0 -163
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +0 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +0 -155
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +0 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -190
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +0 -821
- package/lib/commonjs/web/handlers/GestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +0 -65
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/IGestureHandler.js +0 -2
- package/lib/commonjs/web/handlers/IGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +0 -194
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -48
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -189
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +0 -530
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -165
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -173
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -286
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/web/interfaces.js +0 -40
- package/lib/commonjs/web/interfaces.js.map +0 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +0 -59
- package/lib/commonjs/web/tools/CircularBuffer.js.map +0 -1
- package/lib/commonjs/web/tools/EventManager.js +0 -133
- package/lib/commonjs/web/tools/EventManager.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js +0 -6
- package/lib/commonjs/web/tools/GestureHandlerDelegate.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +0 -340
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +0 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +0 -217
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +0 -1
- package/lib/commonjs/web/tools/InteractionManager.js +0 -119
- package/lib/commonjs/web/tools/InteractionManager.js.map +0 -1
- package/lib/commonjs/web/tools/KeyboardEventManager.js +0 -110
- package/lib/commonjs/web/tools/KeyboardEventManager.js.map +0 -1
- package/lib/commonjs/web/tools/LeastSquareSolver.js +0 -204
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +0 -1
- package/lib/commonjs/web/tools/NodeManager.js +0 -49
- package/lib/commonjs/web/tools/NodeManager.js.map +0 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +0 -229
- package/lib/commonjs/web/tools/PointerEventManager.js.map +0 -1
- package/lib/commonjs/web/tools/PointerTracker.js +0 -234
- package/lib/commonjs/web/tools/PointerTracker.js.map +0 -1
- package/lib/commonjs/web/tools/Vector.js +0 -61
- package/lib/commonjs/web/tools/Vector.js.map +0 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +0 -111
- package/lib/commonjs/web/tools/VelocityTracker.js.map +0 -1
- package/lib/commonjs/web/tools/WheelEventManager.js +0 -74
- package/lib/commonjs/web/tools/WheelEventManager.js.map +0 -1
- package/lib/commonjs/web/utils.js +0 -270
- package/lib/commonjs/web/utils.js.map +0 -1
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js +0 -105
- package/lib/commonjs/web_hammer/DiscreteGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js +0 -53
- package/lib/commonjs/web_hammer/DraggingGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/Errors.js +0 -16
- package/lib/commonjs/web_hammer/Errors.js.map +0 -1
- package/lib/commonjs/web_hammer/FlingGestureHandler.js +0 -170
- package/lib/commonjs/web_hammer/FlingGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/GestureHandler.js +0 -579
- package/lib/commonjs/web_hammer/GestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js +0 -54
- package/lib/commonjs/web_hammer/IndiscreteGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js +0 -71
- package/lib/commonjs/web_hammer/LongPressGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js +0 -66
- package/lib/commonjs/web_hammer/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/NodeManager.js +0 -48
- package/lib/commonjs/web_hammer/NodeManager.js.map +0 -1
- package/lib/commonjs/web_hammer/PanGestureHandler.js +0 -208
- package/lib/commonjs/web_hammer/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/PinchGestureHandler.js +0 -40
- package/lib/commonjs/web_hammer/PinchGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/PressGestureHandler.js +0 -188
- package/lib/commonjs/web_hammer/PressGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/RotationGestureHandler.js +0 -44
- package/lib/commonjs/web_hammer/RotationGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/TapGestureHandler.js +0 -192
- package/lib/commonjs/web_hammer/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/web_hammer/constants.js +0 -64
- package/lib/commonjs/web_hammer/constants.js.map +0 -1
- package/lib/commonjs/web_hammer/utils.js +0 -42
- package/lib/commonjs/web_hammer/utils.js.map +0 -1
- package/lib/module/ActionType.js +0 -7
- package/lib/module/ActionType.js.map +0 -1
- package/lib/module/Directions.js +0 -19
- package/lib/module/Directions.js.map +0 -1
- package/lib/module/EnableNewWebImplementation.js +0 -35
- package/lib/module/EnableNewWebImplementation.js.map +0 -1
- package/lib/module/GestureHandlerRootViewContext.js +0 -3
- package/lib/module/GestureHandlerRootViewContext.js.map +0 -1
- package/lib/module/PlatformConstants.js +0 -5
- package/lib/module/PlatformConstants.js.map +0 -1
- package/lib/module/PlatformConstants.web.js +0 -7
- package/lib/module/PlatformConstants.web.js.map +0 -1
- package/lib/module/PointerType.js +0 -10
- package/lib/module/PointerType.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.js +0 -5
- package/lib/module/RNGestureHandlerModule.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.web.js +0 -98
- package/lib/module/RNGestureHandlerModule.web.js.map +0 -1
- package/lib/module/RNGestureHandlerModule.windows.js +0 -47
- package/lib/module/RNGestureHandlerModule.windows.js.map +0 -1
- package/lib/module/RNRenderer.js +0 -4
- package/lib/module/RNRenderer.js.map +0 -1
- package/lib/module/RNRenderer.web.js +0 -4
- package/lib/module/RNRenderer.web.js.map +0 -1
- package/lib/module/State.js +0 -10
- package/lib/module/State.js.map +0 -1
- package/lib/module/TouchEventType.js +0 -8
- package/lib/module/TouchEventType.js.map +0 -1
- package/lib/module/components/DrawerLayout.js +0 -560
- package/lib/module/components/DrawerLayout.js.map +0 -1
- package/lib/module/components/GestureButtons.js +0 -237
- package/lib/module/components/GestureButtons.js.map +0 -1
- package/lib/module/components/GestureButtonsProps.js +0 -2
- package/lib/module/components/GestureButtonsProps.js.map +0 -1
- package/lib/module/components/GestureComponents.js +0 -90
- package/lib/module/components/GestureComponents.js.map +0 -1
- package/lib/module/components/GestureComponents.web.js +0 -28
- package/lib/module/components/GestureComponents.web.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.js +0 -3
- package/lib/module/components/GestureHandlerButton.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.web.js +0 -9
- package/lib/module/components/GestureHandlerButton.web.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.android.js +0 -27
- package/lib/module/components/GestureHandlerRootView.android.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.js +0 -26
- package/lib/module/components/GestureHandlerRootView.js.map +0 -1
- package/lib/module/components/GestureHandlerRootView.web.js +0 -21
- package/lib/module/components/GestureHandlerRootView.web.js.map +0 -1
- package/lib/module/components/Pressable/Pressable.js +0 -346
- package/lib/module/components/Pressable/Pressable.js.map +0 -1
- package/lib/module/components/Pressable/PressableProps.js +0 -2
- package/lib/module/components/Pressable/PressableProps.js.map +0 -1
- package/lib/module/components/Pressable/index.js +0 -2
- package/lib/module/components/Pressable/index.js.map +0 -1
- package/lib/module/components/Pressable/utils.js +0 -99
- package/lib/module/components/Pressable/utils.js.map +0 -1
- package/lib/module/components/ReanimatedDrawerLayout.js +0 -369
- package/lib/module/components/ReanimatedDrawerLayout.js.map +0 -1
- package/lib/module/components/ReanimatedSwipeable.js +0 -350
- package/lib/module/components/ReanimatedSwipeable.js.map +0 -1
- package/lib/module/components/Swipeable.js +0 -398
- package/lib/module/components/Swipeable.js.map +0 -1
- package/lib/module/components/Text.js +0 -53
- package/lib/module/components/Text.js.map +0 -1
- package/lib/module/components/gestureHandlerRootHOC.js +0 -22
- package/lib/module/components/gestureHandlerRootHOC.js.map +0 -1
- package/lib/module/components/touchables/ExtraButtonProps.js +0 -2
- package/lib/module/components/touchables/ExtraButtonProps.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchable.js +0 -274
- package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchableProps.js +0 -2
- package/lib/module/components/touchables/GenericTouchableProps.js.map +0 -1
- package/lib/module/components/touchables/TouchableHighlight.js +0 -97
- package/lib/module/components/touchables/TouchableHighlight.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +0 -86
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +0 -8
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +0 -1
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js +0 -2
- package/lib/module/components/touchables/TouchableNativeFeedbackProps.js.map +0 -1
- package/lib/module/components/touchables/TouchableOpacity.js +0 -68
- package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -22
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/module/components/touchables/index.js +0 -5
- package/lib/module/components/touchables/index.js.map +0 -1
- package/lib/module/findNodeHandle.js +0 -3
- package/lib/module/findNodeHandle.js.map +0 -1
- package/lib/module/findNodeHandle.web.js +0 -39
- package/lib/module/findNodeHandle.web.js.map +0 -1
- package/lib/module/getShadowNodeFromRef.js +0 -45
- package/lib/module/getShadowNodeFromRef.js.map +0 -1
- package/lib/module/getShadowNodeFromRef.web.js +0 -8
- package/lib/module/getShadowNodeFromRef.web.js.map +0 -1
- package/lib/module/ghQueueMicrotask.js +0 -4
- package/lib/module/ghQueueMicrotask.js.map +0 -1
- package/lib/module/handlers/FlingGestureHandler.js +0 -18
- package/lib/module/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +0 -35
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +0 -1
- package/lib/module/handlers/GestureHandlerEventPayload.js +0 -2
- package/lib/module/handlers/GestureHandlerEventPayload.js.map +0 -1
- package/lib/module/handlers/LongPressGestureHandler.js +0 -20
- package/lib/module/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -19
- package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/handlers/PanGestureHandler.js +0 -114
- package/lib/module/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/handlers/PinchGestureHandler.js +0 -21
- package/lib/module/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/module/handlers/PressabilityDebugView.js +0 -3
- package/lib/module/handlers/PressabilityDebugView.js.map +0 -1
- package/lib/module/handlers/PressabilityDebugView.web.js +0 -5
- package/lib/module/handlers/PressabilityDebugView.web.js.map +0 -1
- package/lib/module/handlers/RotationGestureHandler.js +0 -21
- package/lib/module/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -20
- package/lib/module/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/handlers/createHandler.js +0 -460
- package/lib/module/handlers/createHandler.js.map +0 -1
- package/lib/module/handlers/createNativeWrapper.js +0 -75
- package/lib/module/handlers/createNativeWrapper.js.map +0 -1
- package/lib/module/handlers/customDirectEventTypes.js +0 -3
- package/lib/module/handlers/customDirectEventTypes.js.map +0 -1
- package/lib/module/handlers/customDirectEventTypes.web.js +0 -5
- package/lib/module/handlers/customDirectEventTypes.web.js.map +0 -1
- package/lib/module/handlers/gestureHandlerCommon.js +0 -19
- package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/module/handlers/gestureHandlerTypesCompat.js +0 -2
- package/lib/module/handlers/gestureHandlerTypesCompat.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js +0 -26
- package/lib/module/handlers/gestures/GestureDetector/Wrap.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js +0 -32
- package/lib/module/handlers/gestures/GestureDetector/Wrap.web.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js +0 -68
- package/lib/module/handlers/gestures/GestureDetector/attachHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js +0 -14
- package/lib/module/handlers/gestures/GestureDetector/dropHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +0 -118
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js +0 -18
- package/lib/module/handlers/gestures/GestureDetector/needsToReattach.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/types.js +0 -2
- package/lib/module/handlers/gestures/GestureDetector/types.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js +0 -61
- package/lib/module/handlers/gestures/GestureDetector/updateHandlers.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js +0 -165
- package/lib/module/handlers/gestures/GestureDetector/useAnimatedGesture.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js +0 -41
- package/lib/module/handlers/gestures/GestureDetector/useDetectorUpdater.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js +0 -39
- package/lib/module/handlers/gestures/GestureDetector/useMountReactions.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +0 -36
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +0 -139
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +0 -1
- package/lib/module/handlers/gestures/eventReceiver.js +0 -131
- package/lib/module/handlers/gestures/eventReceiver.js.map +0 -1
- package/lib/module/handlers/gestures/flingGesture.js +0 -37
- package/lib/module/handlers/gestures/flingGesture.js.map +0 -1
- package/lib/module/handlers/gestures/forceTouchGesture.js +0 -73
- package/lib/module/handlers/gestures/forceTouchGesture.js.map +0 -1
- package/lib/module/handlers/gestures/gesture.js +0 -362
- package/lib/module/handlers/gestures/gesture.js.map +0 -1
- package/lib/module/handlers/gestures/gestureComposition.js +0 -92
- package/lib/module/handlers/gestures/gestureComposition.js.map +0 -1
- package/lib/module/handlers/gestures/gestureObjects.js +0 -138
- package/lib/module/handlers/gestures/gestureObjects.js.map +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +0 -64
- package/lib/module/handlers/gestures/gestureStateManager.js.map +0 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +0 -21
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +0 -1
- package/lib/module/handlers/gestures/hoverGesture.js +0 -62
- package/lib/module/handlers/gestures/hoverGesture.js.map +0 -1
- package/lib/module/handlers/gestures/longPressGesture.js +0 -47
- package/lib/module/handlers/gestures/longPressGesture.js.map +0 -1
- package/lib/module/handlers/gestures/manualGesture.js +0 -22
- package/lib/module/handlers/gestures/manualGesture.js.map +0 -1
- package/lib/module/handlers/gestures/nativeGesture.js +0 -34
- package/lib/module/handlers/gestures/nativeGesture.js.map +0 -1
- package/lib/module/handlers/gestures/panGesture.js +0 -216
- package/lib/module/handlers/gestures/panGesture.js.map +0 -1
- package/lib/module/handlers/gestures/pinchGesture.js +0 -36
- package/lib/module/handlers/gestures/pinchGesture.js.map +0 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +0 -30
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +0 -1
- package/lib/module/handlers/gestures/rotationGesture.js +0 -36
- package/lib/module/handlers/gestures/rotationGesture.js.map +0 -1
- package/lib/module/handlers/gestures/tapGesture.js +0 -92
- package/lib/module/handlers/gestures/tapGesture.js.map +0 -1
- package/lib/module/handlers/getNextHandlerTag.js +0 -5
- package/lib/module/handlers/getNextHandlerTag.js.map +0 -1
- package/lib/module/handlers/handlersRegistry.js +0 -43
- package/lib/module/handlers/handlersRegistry.js.map +0 -1
- package/lib/module/handlers/utils.js +0 -71
- package/lib/module/handlers/utils.js.map +0 -1
- package/lib/module/index.js +0 -29
- package/lib/module/index.js.map +0 -1
- package/lib/module/init.js +0 -16
- package/lib/module/init.js.map +0 -1
- package/lib/module/jestUtils/index.js +0 -2
- package/lib/module/jestUtils/index.js.map +0 -1
- package/lib/module/jestUtils/jestUtils.js +0 -358
- package/lib/module/jestUtils/jestUtils.js.map +0 -1
- package/lib/module/mocks.js +0 -68
- package/lib/module/mocks.js.map +0 -1
- package/lib/module/mountRegistry.js +0 -40
- package/lib/module/mountRegistry.js.map +0 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js +0 -3
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +0 -1
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +0 -3
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +0 -1
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +0 -3
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +0 -1
- package/lib/module/typeUtils.js +0 -2
- package/lib/module/typeUtils.js.map +0 -1
- package/lib/module/utils.js +0 -87
- package/lib/module/utils.js.map +0 -1
- package/lib/module/web/Gestures.js +0 -39
- package/lib/module/web/Gestures.js.map +0 -1
- package/lib/module/web/constants.js +0 -3
- package/lib/module/web/constants.js.map +0 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +0 -153
- package/lib/module/web/detectors/RotationGestureDetector.js.map +0 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +0 -144
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +0 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +0 -173
- package/lib/module/web/handlers/FlingGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/GestureHandler.js +0 -801
- package/lib/module/web/handlers/GestureHandler.js.map +0 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +0 -50
- package/lib/module/web/handlers/HoverGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/IGestureHandler.js +0 -2
- package/lib/module/web/handlers/IGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +0 -180
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -36
- package/lib/module/web/handlers/ManualGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -174
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/PanGestureHandler.js +0 -514
- package/lib/module/web/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +0 -150
- package/lib/module/web/handlers/PinchGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +0 -158
- package/lib/module/web/handlers/RotationGestureHandler.js.map +0 -1
- package/lib/module/web/handlers/TapGestureHandler.js +0 -271
- package/lib/module/web/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/web/interfaces.js +0 -31
- package/lib/module/web/interfaces.js.map +0 -1
- package/lib/module/web/tools/CircularBuffer.js +0 -50
- package/lib/module/web/tools/CircularBuffer.js.map +0 -1
- package/lib/module/web/tools/EventManager.js +0 -124
- package/lib/module/web/tools/EventManager.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerDelegate.js +0 -2
- package/lib/module/web/tools/GestureHandlerDelegate.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +0 -326
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +0 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +0 -199
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +0 -1
- package/lib/module/web/tools/InteractionManager.js +0 -110
- package/lib/module/web/tools/InteractionManager.js.map +0 -1
- package/lib/module/web/tools/KeyboardEventManager.js +0 -96
- package/lib/module/web/tools/KeyboardEventManager.js.map +0 -1
- package/lib/module/web/tools/LeastSquareSolver.js +0 -195
- package/lib/module/web/tools/LeastSquareSolver.js.map +0 -1
- package/lib/module/web/tools/NodeManager.js +0 -40
- package/lib/module/web/tools/NodeManager.js.map +0 -1
- package/lib/module/web/tools/PointerEventManager.js +0 -212
- package/lib/module/web/tools/PointerEventManager.js.map +0 -1
- package/lib/module/web/tools/PointerTracker.js +0 -221
- package/lib/module/web/tools/PointerTracker.js.map +0 -1
- package/lib/module/web/tools/Vector.js +0 -50
- package/lib/module/web/tools/Vector.js.map +0 -1
- package/lib/module/web/tools/VelocityTracker.js +0 -98
- package/lib/module/web/tools/VelocityTracker.js.map +0 -1
- package/lib/module/web/tools/WheelEventManager.js +0 -60
- package/lib/module/web/tools/WheelEventManager.js.map +0 -1
- package/lib/module/web/utils.js +0 -243
- package/lib/module/web/utils.js.map +0 -1
- package/lib/module/web_hammer/DiscreteGestureHandler.js +0 -94
- package/lib/module/web_hammer/DiscreteGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/DraggingGestureHandler.js +0 -40
- package/lib/module/web_hammer/DraggingGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/Errors.js +0 -7
- package/lib/module/web_hammer/Errors.js.map +0 -1
- package/lib/module/web_hammer/FlingGestureHandler.js +0 -156
- package/lib/module/web_hammer/FlingGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/GestureHandler.js +0 -563
- package/lib/module/web_hammer/GestureHandler.js.map +0 -1
- package/lib/module/web_hammer/IndiscreteGestureHandler.js +0 -44
- package/lib/module/web_hammer/IndiscreteGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/LongPressGestureHandler.js +0 -58
- package/lib/module/web_hammer/LongPressGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/NativeViewGestureHandler.js +0 -49
- package/lib/module/web_hammer/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/NodeManager.js +0 -33
- package/lib/module/web_hammer/NodeManager.js.map +0 -1
- package/lib/module/web_hammer/PanGestureHandler.js +0 -194
- package/lib/module/web_hammer/PanGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/PinchGestureHandler.js +0 -29
- package/lib/module/web_hammer/PinchGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/PressGestureHandler.js +0 -174
- package/lib/module/web_hammer/PressGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/RotationGestureHandler.js +0 -32
- package/lib/module/web_hammer/RotationGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/TapGestureHandler.js +0 -180
- package/lib/module/web_hammer/TapGestureHandler.js.map +0 -1
- package/lib/module/web_hammer/constants.js +0 -43
- package/lib/module/web_hammer/constants.js.map +0 -1
- package/lib/module/web_hammer/utils.js +0 -19
- package/lib/module/web_hammer/utils.js.map +0 -1
- package/lib/typescript/ActionType.d.ts +0 -7
- package/lib/typescript/Directions.d.ts +0 -14
- package/lib/typescript/EnableNewWebImplementation.d.ts +0 -9
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +0 -3
- package/lib/typescript/PlatformConstants.d.ts +0 -5
- package/lib/typescript/PlatformConstants.web.d.ts +0 -4
- package/lib/typescript/PointerType.d.ts +0 -7
- package/lib/typescript/RNGestureHandlerModule.d.ts +0 -2
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +0 -15
- package/lib/typescript/RNGestureHandlerModule.windows.d.ts +0 -32
- package/lib/typescript/RNRenderer.d.ts +0 -1
- package/lib/typescript/RNRenderer.web.d.ts +0 -3
- package/lib/typescript/State.d.ts +0 -9
- package/lib/typescript/TouchEventType.d.ts +0 -8
- package/lib/typescript/components/DrawerLayout.d.ts +0 -185
- package/lib/typescript/components/GestureButtons.d.ts +0 -7
- package/lib/typescript/components/GestureButtonsProps.d.ts +0 -115
- package/lib/typescript/components/GestureComponents.d.ts +0 -22
- package/lib/typescript/components/GestureComponents.web.d.ts +0 -8
- package/lib/typescript/components/GestureHandlerButton.d.ts +0 -4
- package/lib/typescript/components/GestureHandlerButton.web.d.ts +0 -4
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +0 -6
- package/lib/typescript/components/GestureHandlerRootView.d.ts +0 -6
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +0 -6
- package/lib/typescript/components/Pressable/Pressable.d.ts +0 -5
- package/lib/typescript/components/Pressable/PressableProps.d.ts +0 -109
- package/lib/typescript/components/Pressable/index.d.ts +0 -2
- package/lib/typescript/components/Pressable/utils.d.ts +0 -13
- package/lib/typescript/components/ReanimatedDrawerLayout.d.ts +0 -167
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +0 -137
- package/lib/typescript/components/Swipeable.d.ts +0 -183
- package/lib/typescript/components/Text.d.ts +0 -4
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +0 -3
- package/lib/typescript/components/touchables/ExtraButtonProps.d.ts +0 -7
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -55
- package/lib/typescript/components/touchables/GenericTouchableProps.d.ts +0 -16
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +0 -41
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +0 -40
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +0 -6
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +0 -8
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -30
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -14
- package/lib/typescript/components/touchables/index.d.ts +0 -7
- package/lib/typescript/findNodeHandle.d.ts +0 -2
- package/lib/typescript/findNodeHandle.web.d.ts +0 -2
- package/lib/typescript/getShadowNodeFromRef.d.ts +0 -1
- package/lib/typescript/getShadowNodeFromRef.web.d.ts +0 -1
- package/lib/typescript/ghQueueMicrotask.d.ts +0 -1
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +0 -39
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +0 -44
- package/lib/typescript/handlers/GestureHandlerEventPayload.d.ts +0 -194
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +0 -36
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -33
- package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -100
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +0 -17
- package/lib/typescript/handlers/PressabilityDebugView.d.ts +0 -1
- package/lib/typescript/handlers/PressabilityDebugView.web.d.ts +0 -1
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +0 -17
- package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -62
- package/lib/typescript/handlers/createHandler.d.ts +0 -11
- package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -3
- package/lib/typescript/handlers/customDirectEventTypes.d.ts +0 -1
- package/lib/typescript/handlers/customDirectEventTypes.web.d.ts +0 -2
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -78
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +0 -43
- package/lib/typescript/handlers/gestures/GestureDetector/Wrap.d.ts +0 -13
- package/lib/typescript/handlers/gestures/GestureDetector/Wrap.web.d.ts +0 -7
- package/lib/typescript/handlers/gestures/GestureDetector/attachHandlers.d.ts +0 -13
- package/lib/typescript/handlers/gestures/GestureDetector/dropHandlers.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/index.d.ts +0 -49
- package/lib/typescript/handlers/gestures/GestureDetector/needsToReattach.d.ts +0 -3
- package/lib/typescript/handlers/gestures/GestureDetector/types.d.ts +0 -21
- package/lib/typescript/handlers/gestures/GestureDetector/updateHandlers.d.ts +0 -4
- package/lib/typescript/handlers/gestures/GestureDetector/useAnimatedGesture.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/useDetectorUpdater.d.ts +0 -5
- package/lib/typescript/handlers/gestures/GestureDetector/useMountReactions.d.ts +0 -2
- package/lib/typescript/handlers/gestures/GestureDetector/useViewRefHandler.d.ts +0 -3
- package/lib/typescript/handlers/gestures/GestureDetector/utils.d.ts +0 -13
- package/lib/typescript/handlers/gestures/eventReceiver.d.ts +0 -4
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +0 -21
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +0 -30
- package/lib/typescript/handlers/gestures/gesture.d.ts +0 -218
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +0 -21
- package/lib/typescript/handlers/gestures/gestureObjects.d.ts +0 -98
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +0 -11
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +0 -4
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +0 -27
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +0 -25
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +0 -7
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +0 -18
- package/lib/typescript/handlers/gestures/panGesture.d.ts +0 -90
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +0 -11
- package/lib/typescript/handlers/gestures/reanimatedWrapper.d.ts +0 -14
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +0 -12
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +0 -50
- package/lib/typescript/handlers/getNextHandlerTag.d.ts +0 -1
- package/lib/typescript/handlers/handlersRegistry.d.ts +0 -14
- package/lib/typescript/handlers/utils.d.ts +0 -7
- package/lib/typescript/index.d.ts +0 -58
- package/lib/typescript/init.d.ts +0 -2
- package/lib/typescript/jestUtils/index.d.ts +0 -1
- package/lib/typescript/jestUtils/jestUtils.d.ts +0 -30
- package/lib/typescript/mocks.d.ts +0 -46
- package/lib/typescript/mountRegistry.d.ts +0 -17
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +0 -14
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +0 -17
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +0 -6
- package/lib/typescript/typeUtils.d.ts +0 -1
- package/lib/typescript/utils.d.ts +0 -20
- package/lib/typescript/web/Gestures.d.ts +0 -36
- package/lib/typescript/web/constants.d.ts +0 -2
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +0 -30
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +0 -29
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -26
- package/lib/typescript/web/handlers/GestureHandler.d.ts +0 -103
- package/lib/typescript/web/handlers/HoverGestureHandler.d.ts +0 -10
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +0 -37
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +0 -31
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -10
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -26
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -61
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -28
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -28
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -38
- package/lib/typescript/web/interfaces.d.ts +0 -157
- package/lib/typescript/web/tools/CircularBuffer.d.ts +0 -11
- package/lib/typescript/web/tools/EventManager.d.ts +0 -39
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +0 -24
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +0 -31
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +0 -35
- package/lib/typescript/web/tools/InteractionManager.d.ts +0 -17
- package/lib/typescript/web/tools/KeyboardEventManager.d.ts +0 -13
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +0 -12
- package/lib/typescript/web/tools/NodeManager.d.ts +0 -12
- package/lib/typescript/web/tools/PointerEventManager.d.ts +0 -19
- package/lib/typescript/web/tools/PointerTracker.d.ts +0 -50
- package/lib/typescript/web/tools/Vector.d.ts +0 -15
- package/lib/typescript/web/tools/VelocityTracker.d.ts +0 -13
- package/lib/typescript/web/tools/WheelEventManager.d.ts +0 -11
- package/lib/typescript/web/utils.d.ts +0 -14
- package/lib/typescript/web_hammer/DiscreteGestureHandler.d.ts +0 -20
- package/lib/typescript/web_hammer/DraggingGestureHandler.d.ts +0 -15
- package/lib/typescript/web_hammer/Errors.d.ts +0 -3
- package/lib/typescript/web_hammer/FlingGestureHandler.d.ts +0 -43
- package/lib/typescript/web_hammer/GestureHandler.d.ts +0 -145
- package/lib/typescript/web_hammer/IndiscreteGestureHandler.d.ts +0 -40
- package/lib/typescript/web_hammer/LongPressGestureHandler.d.ts +0 -38
- package/lib/typescript/web_hammer/NativeViewGestureHandler.d.ts +0 -7
- package/lib/typescript/web_hammer/NodeManager.d.ts +0 -7
- package/lib/typescript/web_hammer/PanGestureHandler.d.ts +0 -56
- package/lib/typescript/web_hammer/PinchGestureHandler.d.ts +0 -13
- package/lib/typescript/web_hammer/PressGestureHandler.d.ts +0 -83
- package/lib/typescript/web_hammer/RotationGestureHandler.d.ts +0 -13
- package/lib/typescript/web_hammer/TapGestureHandler.d.ts +0 -57
- package/lib/typescript/web_hammer/constants.d.ts +0 -39
- package/lib/typescript/web_hammer/utils.d.ts +0 -9
- /package/android/{common → noreanimated}/src/main/java/com/swmansion/common/GestureHandlerStateManager.kt +0 -0
@@ -1,19 +0,0 @@
|
|
1
|
-
// Previous types exported gesture handlers as classes which creates an interface and variable, both named the same as class.
|
2
|
-
// Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof
|
3
|
-
// e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.
|
4
|
-
// See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.
|
5
|
-
const commonProps = ['id', 'enabled', 'shouldCancelWhenOutside', 'hitSlop', 'cancelsTouchesInView', 'userSelect', 'activeCursor', 'mouseButton', 'enableContextMenu', 'touchAction'];
|
6
|
-
const componentInteractionProps = ['waitFor', 'simultaneousHandlers', 'blocksHandlers'];
|
7
|
-
export const baseGestureHandlerProps = [...commonProps, ...componentInteractionProps, 'onBegan', 'onFailed', 'onCancelled', 'onActivated', 'onEnded', 'onGestureEvent', 'onHandlerStateChange'];
|
8
|
-
export const baseGestureHandlerWithDetectorProps = [...commonProps, 'needsPointerData', 'manualActivation'];
|
9
|
-
export let MouseButton;
|
10
|
-
|
11
|
-
(function (MouseButton) {
|
12
|
-
MouseButton[MouseButton["LEFT"] = 1] = "LEFT";
|
13
|
-
MouseButton[MouseButton["RIGHT"] = 2] = "RIGHT";
|
14
|
-
MouseButton[MouseButton["MIDDLE"] = 4] = "MIDDLE";
|
15
|
-
MouseButton[MouseButton["BUTTON_4"] = 8] = "BUTTON_4";
|
16
|
-
MouseButton[MouseButton["BUTTON_5"] = 16] = "BUTTON_5";
|
17
|
-
MouseButton[MouseButton["ALL"] = 31] = "ALL";
|
18
|
-
})(MouseButton || (MouseButton = {}));
|
19
|
-
//# sourceMappingURL=gestureHandlerCommon.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["gestureHandlerCommon.ts"],"names":["commonProps","componentInteractionProps","baseGestureHandlerProps","baseGestureHandlerWithDetectorProps","MouseButton"],"mappings":"AAAA;AACA;AACA;AACA;AAQA,MAAMA,WAAW,GAAG,CAClB,IADkB,EAElB,SAFkB,EAGlB,yBAHkB,EAIlB,SAJkB,EAKlB,sBALkB,EAMlB,YANkB,EAOlB,cAPkB,EAQlB,aARkB,EASlB,mBATkB,EAUlB,aAVkB,CAApB;AAaA,MAAMC,yBAAyB,GAAG,CAChC,SADgC,EAEhC,sBAFgC,EAGhC,gBAHgC,CAAlC;AAMA,OAAO,MAAMC,uBAAuB,GAAG,CACrC,GAAGF,WADkC,EAErC,GAAGC,yBAFkC,EAGrC,SAHqC,EAIrC,UAJqC,EAKrC,aALqC,EAMrC,aANqC,EAOrC,SAPqC,EAQrC,gBARqC,EASrC,sBATqC,CAAhC;AAYP,OAAO,MAAME,mCAAmC,GAAG,CACjD,GAAGH,WAD8C,EAEjD,kBAFiD,EAGjD,kBAHiD,CAA5C;AAsEP,WAAYI,WAAZ;;WAAYA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;AAAAA,EAAAA,W,CAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["// Previous types exported gesture handlers as classes which creates an interface and variable, both named the same as class.\n// Without those types, we'd introduce breaking change, forcing users to prefix every handler type specification with typeof\n// e.g. React.createRef<TapGestureHandler> -> React.createRef<typeof TapGestureHandler>.\n// See https://www.typescriptlang.org/docs/handbook/classes.html#constructor-functions for reference.\nimport * as React from 'react';\n\nimport { State } from '../State';\nimport { TouchEventType } from '../TouchEventType';\nimport { ValueOf } from '../typeUtils';\nimport { PointerType } from '../PointerType';\n\nconst commonProps = [\n 'id',\n 'enabled',\n 'shouldCancelWhenOutside',\n 'hitSlop',\n 'cancelsTouchesInView',\n 'userSelect',\n 'activeCursor',\n 'mouseButton',\n 'enableContextMenu',\n 'touchAction',\n] as const;\n\nconst componentInteractionProps = [\n 'waitFor',\n 'simultaneousHandlers',\n 'blocksHandlers',\n] as const;\n\nexport const baseGestureHandlerProps = [\n ...commonProps,\n ...componentInteractionProps,\n 'onBegan',\n 'onFailed',\n 'onCancelled',\n 'onActivated',\n 'onEnded',\n 'onGestureEvent',\n 'onHandlerStateChange',\n] as const;\n\nexport const baseGestureHandlerWithDetectorProps = [\n ...commonProps,\n 'needsPointerData',\n 'manualActivation',\n];\n\nexport interface GestureEventPayload {\n handlerTag: number;\n numberOfPointers: number;\n state: ValueOf<typeof State>;\n pointerType: PointerType;\n}\nexport interface HandlerStateChangeEventPayload extends GestureEventPayload {\n oldState: ValueOf<typeof State>;\n}\n\nexport type HitSlop =\n | number\n | null\n | undefined\n | Partial<\n Record<\n 'left' | 'right' | 'top' | 'bottom' | 'vertical' | 'horizontal',\n number\n >\n >\n | Record<'width' | 'left', number>\n | Record<'width' | 'right', number>\n | Record<'height' | 'top', number>\n | Record<'height' | 'bottom', number>;\n\nexport type UserSelect = 'none' | 'auto' | 'text';\nexport type ActiveCursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'e-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'col-resize'\n | 'row-resize'\n | 'all-scroll'\n | 'zoom-in'\n | 'zoom-out';\n\nexport enum MouseButton {\n LEFT = 1,\n RIGHT = 2,\n MIDDLE = 4,\n BUTTON_4 = 8,\n BUTTON_5 = 16,\n ALL = 31,\n}\n\nexport type TouchAction =\n | 'auto'\n | 'none'\n | 'pan-x'\n | 'pan-left'\n | 'pan-right'\n | 'pan-y'\n | 'pan-up'\n | 'pan-down'\n | 'pinch-zoom'\n | 'manipulation'\n | 'inherit'\n | 'initial'\n | 'revert'\n | 'revert-layer'\n | 'unset';\n\n// TODO(TS) events in handlers\n\nexport interface GestureEvent<ExtraEventPayloadT = Record<string, unknown>> {\n nativeEvent: Readonly<GestureEventPayload & ExtraEventPayloadT>;\n}\nexport interface HandlerStateChangeEvent<\n ExtraEventPayloadT = Record<string, unknown>,\n> {\n nativeEvent: Readonly<HandlerStateChangeEventPayload & ExtraEventPayloadT>;\n}\n\nexport type TouchData = {\n id: number;\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n};\n\nexport type GestureTouchEvent = {\n handlerTag: number;\n numberOfTouches: number;\n state: ValueOf<typeof State>;\n eventType: TouchEventType;\n allTouches: TouchData[];\n changedTouches: TouchData[];\n pointerType: PointerType;\n};\n\nexport type GestureUpdateEvent<GestureEventPayloadT = Record<string, unknown>> =\n GestureEventPayload & GestureEventPayloadT;\n\nexport type GestureStateChangeEvent<\n GestureStateChangeEventPayloadT = Record<string, unknown>,\n> = HandlerStateChangeEventPayload & GestureStateChangeEventPayloadT;\n\nexport type CommonGestureConfig = {\n enabled?: boolean;\n shouldCancelWhenOutside?: boolean;\n hitSlop?: HitSlop;\n userSelect?: UserSelect;\n activeCursor?: ActiveCursor;\n mouseButton?: MouseButton;\n enableContextMenu?: boolean;\n touchAction?: TouchAction;\n};\n\n// Events payloads are types instead of interfaces due to TS limitation.\n// See https://github.com/microsoft/TypeScript/issues/15300 for more info.\nexport type BaseGestureHandlerProps<\n ExtraEventPayloadT extends Record<string, unknown> = Record<string, unknown>,\n> = CommonGestureConfig & {\n id?: string;\n waitFor?: React.Ref<unknown> | React.Ref<unknown>[];\n simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[];\n blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[];\n testID?: string;\n cancelsTouchesInView?: boolean;\n // TODO(TS) - fix event types\n onBegan?: (event: HandlerStateChangeEvent) => void;\n onFailed?: (event: HandlerStateChangeEvent) => void;\n onCancelled?: (event: HandlerStateChangeEvent) => void;\n onActivated?: (event: HandlerStateChangeEvent) => void;\n onEnded?: (event: HandlerStateChangeEvent) => void;\n\n // TODO(TS) consider using NativeSyntheticEvent\n onGestureEvent?: (event: GestureEvent<ExtraEventPayloadT>) => void;\n onHandlerStateChange?: (\n event: HandlerStateChangeEvent<ExtraEventPayloadT>\n ) => void;\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?: React.ReactNode;\n};\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
var _Reanimated$default$c, _Reanimated$default;
|
2
|
-
|
3
|
-
import React from 'react';
|
4
|
-
import { Reanimated } from '../reanimatedWrapper';
|
5
|
-
import { tagMessage } from '../../../utils';
|
6
|
-
export class Wrap extends React.Component {
|
7
|
-
render() {
|
8
|
-
try {
|
9
|
-
// I don't think that fighting with types over such a simple function is worth it
|
10
|
-
// The only thing it does is add 'collapsable: false' to the child component
|
11
|
-
// to make sure it is in the native view hierarchy so the detector can find
|
12
|
-
// correct viewTag to attach to.
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
14
|
-
const child = React.Children.only(this.props.children);
|
15
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
16
|
-
collapsable: false
|
17
|
-
}, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
18
|
-
child.props.children);
|
19
|
-
} catch (e) {
|
20
|
-
throw new Error(tagMessage(`GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
}
|
25
|
-
export const AnimatedWrap = (_Reanimated$default$c = Reanimated === null || Reanimated === void 0 ? void 0 : (_Reanimated$default = Reanimated.default) === null || _Reanimated$default === void 0 ? void 0 : _Reanimated$default.createAnimatedComponent(Wrap)) !== null && _Reanimated$default$c !== void 0 ? _Reanimated$default$c : Wrap;
|
26
|
-
//# sourceMappingURL=Wrap.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["Wrap.tsx"],"names":["React","Reanimated","tagMessage","Wrap","Component","render","child","Children","only","props","children","cloneElement","collapsable","e","Error","AnimatedWrap","default","createAnimatedComponent"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,UAAT,QAA2B,sBAA3B;AACA,SAASC,UAAT,QAA2B,gBAA3B;AAEA,OAAO,MAAMC,IAAN,SAAmBH,KAAK,CAACI,SAAzB,CAIJ;AACDC,EAAAA,MAAM,GAAG;AACP,QAAI;AACF;AACA;AACA;AACA;AACA;AACA,YAAMC,KAAU,GAAGN,KAAK,CAACO,QAAN,CAAeC,IAAf,CAAoB,KAAKC,KAAL,CAAWC,QAA/B,CAAnB;AACA,0BAAOV,KAAK,CAACW,YAAN,CACLL,KADK,EAEL;AAAEM,QAAAA,WAAW,EAAE;AAAf,OAFK,EAGL;AACAN,MAAAA,KAAK,CAACG,KAAN,CAAYC,QAJP,CAAP;AAMD,KAbD,CAaE,OAAOG,CAAP,EAAU;AACV,YAAM,IAAIC,KAAJ,CACJZ,UAAU,CACP,2KADO,CADN,CAAN;AAKD;AACF;;AAtBA;AAyBH,OAAO,MAAMa,YAAY,4BACvBd,UADuB,aACvBA,UADuB,8CACvBA,UAAU,CAAEe,OADW,wDACvB,oBAAqBC,uBAArB,CAA6Cd,IAA7C,CADuB,yEAC+BA,IADjD","sourcesContent":["import React from 'react';\nimport { Reanimated } from '../reanimatedWrapper';\nimport { tagMessage } from '../../../utils';\n\nexport class Wrap extends React.Component<{\n onGestureHandlerEvent?: unknown;\n // Implicit `children` prop has been removed in @types/react^18.0.0\n children?: React.ReactNode;\n}> {\n render() {\n try {\n // I don't think that fighting with types over such a simple function is worth it\n // The only thing it does is add 'collapsable: false' to the child component\n // to make sure it is in the native view hierarchy so the detector can find\n // correct viewTag to attach to.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(this.props.children);\n return React.cloneElement(\n child,\n { collapsable: false },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n } catch (e) {\n throw new Error(\n tagMessage(\n `GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n }\n}\n\nexport const AnimatedWrap =\n Reanimated?.default?.createAnimatedComponent(Wrap) ?? Wrap;\n"]}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import React, { forwardRef } from 'react';
|
2
|
-
import { tagMessage } from '../../../utils';
|
3
|
-
import { isRNSVGNode } from '../../../web/utils';
|
4
|
-
export const Wrap = /*#__PURE__*/forwardRef(({
|
5
|
-
children
|
6
|
-
}, ref) => {
|
7
|
-
try {
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9
|
-
const child = React.Children.only(children);
|
10
|
-
|
11
|
-
if (isRNSVGNode(child)) {
|
12
|
-
const clone = /*#__PURE__*/React.cloneElement(child, {
|
13
|
-
ref
|
14
|
-
}, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
15
|
-
child.props.children);
|
16
|
-
return clone;
|
17
|
-
}
|
18
|
-
|
19
|
-
return /*#__PURE__*/React.createElement("div", {
|
20
|
-
ref: ref,
|
21
|
-
style: {
|
22
|
-
display: 'contents'
|
23
|
-
}
|
24
|
-
}, child);
|
25
|
-
} catch (e) {
|
26
|
-
throw new Error(tagMessage(`GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`));
|
27
|
-
}
|
28
|
-
}); // On web we never take a path with Reanimated,
|
29
|
-
// therefore we can simply export Wrap
|
30
|
-
|
31
|
-
export const AnimatedWrap = Wrap;
|
32
|
-
//# sourceMappingURL=Wrap.web.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["Wrap.web.tsx"],"names":["React","forwardRef","tagMessage","isRNSVGNode","Wrap","children","ref","child","Children","only","clone","cloneElement","props","display","e","Error","AnimatedWrap"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,UAAhB,QAAkC,OAAlC;AAEA,SAASC,UAAT,QAA2B,gBAA3B;AACA,SAASC,WAAT,QAA4B,oBAA5B;AAEA,OAAO,MAAMC,IAAI,gBAAGH,UAAU,CAC5B,CAAC;AAAEI,EAAAA;AAAF,CAAD,EAAeC,GAAf,KAAuB;AACrB,MAAI;AACF;AACA,UAAMC,KAAU,GAAGP,KAAK,CAACQ,QAAN,CAAeC,IAAf,CAAoBJ,QAApB,CAAnB;;AAEA,QAAIF,WAAW,CAACI,KAAD,CAAf,EAAwB;AACtB,YAAMG,KAAK,gBAAGV,KAAK,CAACW,YAAN,CACZJ,KADY,EAEZ;AAAED,QAAAA;AAAF,OAFY,EAGZ;AACAC,MAAAA,KAAK,CAACK,KAAN,CAAYP,QAJA,CAAd;AAOA,aAAOK,KAAP;AACD;;AAED,wBACE;AACE,MAAA,GAAG,EAAEJ,GADP;AAEE,MAAA,KAAK,EAAE;AAAEO,QAAAA,OAAO,EAAE;AAAX;AAFT,OAGGN,KAHH,CADF;AAOD,GAtBD,CAsBE,OAAOO,CAAP,EAAU;AACV,UAAM,IAAIC,KAAJ,CACJb,UAAU,CACP,2KADO,CADN,CAAN;AAKD;AACF,CA/B2B,CAAvB,C,CAkCP;AACA;;AACA,OAAO,MAAMc,YAAY,GAAGZ,IAArB","sourcesContent":["import React, { forwardRef } from 'react';\nimport type { LegacyRef, PropsWithChildren } from 'react';\nimport { tagMessage } from '../../../utils';\nimport { isRNSVGNode } from '../../../web/utils';\n\nexport const Wrap = forwardRef<HTMLDivElement, PropsWithChildren<{}>>(\n ({ children }, ref) => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const child: any = React.Children.only(children);\n\n if (isRNSVGNode(child)) {\n const clone = React.cloneElement(\n child,\n { ref },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n child.props.children\n );\n\n return clone;\n }\n\n return (\n <div\n ref={ref as LegacyRef<HTMLDivElement>}\n style={{ display: 'contents' }}>\n {child}\n </div>\n );\n } catch (e) {\n throw new Error(\n tagMessage(\n `GestureDetector got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view.`\n )\n );\n }\n }\n);\n\n// On web we never take a path with Reanimated,\n// therefore we can simply export Wrap\nexport const AnimatedWrap = Wrap;\n"]}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { registerHandler } from '../../handlersRegistry';
|
2
|
-
import RNGestureHandlerModule from '../../../RNGestureHandlerModule';
|
3
|
-
import { filterConfig, scheduleFlushOperations } from '../../utils';
|
4
|
-
import { ActionType } from '../../../ActionType';
|
5
|
-
import { Platform } from 'react-native';
|
6
|
-
import { ghQueueMicrotask } from '../../../ghQueueMicrotask';
|
7
|
-
import { extractGestureRelations, checkGestureCallbacksForWorklets, ALLOWED_PROPS } from './utils';
|
8
|
-
import { MountRegistry } from '../../../mountRegistry';
|
9
|
-
export function attachHandlers({
|
10
|
-
preparedGesture,
|
11
|
-
gestureConfig,
|
12
|
-
gesturesToAttach,
|
13
|
-
viewTag,
|
14
|
-
webEventHandlersRef
|
15
|
-
}) {
|
16
|
-
gestureConfig.initialize(); // Use queueMicrotask to extract handlerTags, because all refs should be initialized
|
17
|
-
// when it's ran
|
18
|
-
|
19
|
-
ghQueueMicrotask(() => {
|
20
|
-
if (!preparedGesture.isMounted) {
|
21
|
-
return;
|
22
|
-
}
|
23
|
-
|
24
|
-
gestureConfig.prepare();
|
25
|
-
});
|
26
|
-
|
27
|
-
for (const handler of gesturesToAttach) {
|
28
|
-
checkGestureCallbacksForWorklets(handler);
|
29
|
-
RNGestureHandlerModule.createGestureHandler(handler.handlerName, handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS));
|
30
|
-
registerHandler(handler.handlerTag, handler, handler.config.testId);
|
31
|
-
} // Use queueMicrotask to extract handlerTags, because all refs should be initialized
|
32
|
-
// when it's ran
|
33
|
-
|
34
|
-
|
35
|
-
ghQueueMicrotask(() => {
|
36
|
-
if (!preparedGesture.isMounted) {
|
37
|
-
return;
|
38
|
-
}
|
39
|
-
|
40
|
-
for (const handler of gesturesToAttach) {
|
41
|
-
RNGestureHandlerModule.updateGestureHandler(handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS, extractGestureRelations(handler)));
|
42
|
-
}
|
43
|
-
|
44
|
-
scheduleFlushOperations();
|
45
|
-
});
|
46
|
-
|
47
|
-
for (const gesture of gesturesToAttach) {
|
48
|
-
const actionType = gesture.shouldUseReanimated ? ActionType.REANIMATED_WORKLET : ActionType.JS_FUNCTION_NEW_API;
|
49
|
-
|
50
|
-
if (Platform.OS === 'web') {
|
51
|
-
RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, ActionType.JS_FUNCTION_OLD_API, // Ignored on web
|
52
|
-
webEventHandlersRef);
|
53
|
-
} else {
|
54
|
-
RNGestureHandlerModule.attachGestureHandler(gesture.handlerTag, viewTag, actionType);
|
55
|
-
}
|
56
|
-
|
57
|
-
MountRegistry.gestureWillMount(gesture);
|
58
|
-
}
|
59
|
-
|
60
|
-
preparedGesture.attachedGestures = gesturesToAttach;
|
61
|
-
|
62
|
-
if (preparedGesture.animatedHandlers) {
|
63
|
-
const isAnimatedGesture = g => g.shouldUseReanimated;
|
64
|
-
|
65
|
-
preparedGesture.animatedHandlers.value = gesturesToAttach.filter(isAnimatedGesture).map(g => g.handlers);
|
66
|
-
}
|
67
|
-
}
|
68
|
-
//# sourceMappingURL=attachHandlers.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["attachHandlers.ts"],"names":["registerHandler","RNGestureHandlerModule","filterConfig","scheduleFlushOperations","ActionType","Platform","ghQueueMicrotask","extractGestureRelations","checkGestureCallbacksForWorklets","ALLOWED_PROPS","MountRegistry","attachHandlers","preparedGesture","gestureConfig","gesturesToAttach","viewTag","webEventHandlersRef","initialize","isMounted","prepare","handler","createGestureHandler","handlerName","handlerTag","config","testId","updateGestureHandler","gesture","actionType","shouldUseReanimated","REANIMATED_WORKLET","JS_FUNCTION_NEW_API","OS","attachGestureHandler","JS_FUNCTION_OLD_API","gestureWillMount","attachedGestures","animatedHandlers","isAnimatedGesture","g","value","filter","map","handlers"],"mappings":"AAEA,SAASA,eAAT,QAAgC,wBAAhC;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,SAASC,YAAT,EAAuBC,uBAAvB,QAAsD,aAAtD;AAEA,SAASC,UAAT,QAA2B,qBAA3B;AACA,SAASC,QAAT,QAAyB,cAAzB;AAEA,SAASC,gBAAT,QAAiC,2BAAjC;AAEA,SACEC,uBADF,EAEEC,gCAFF,EAGEC,aAHF,QAIO,SAJP;AAKA,SAASC,aAAT,QAA8B,wBAA9B;AAUA,OAAO,SAASC,cAAT,CAAwB;AAC7BC,EAAAA,eAD6B;AAE7BC,EAAAA,aAF6B;AAG7BC,EAAAA,gBAH6B;AAI7BC,EAAAA,OAJ6B;AAK7BC,EAAAA;AAL6B,CAAxB,EAMkB;AACvBH,EAAAA,aAAa,CAACI,UAAd,GADuB,CAGvB;AACA;;AACAX,EAAAA,gBAAgB,CAAC,MAAM;AACrB,QAAI,CAACM,eAAe,CAACM,SAArB,EAAgC;AAC9B;AACD;;AACDL,IAAAA,aAAa,CAACM,OAAd;AACD,GALe,CAAhB;;AAOA,OAAK,MAAMC,OAAX,IAAsBN,gBAAtB,EAAwC;AACtCN,IAAAA,gCAAgC,CAACY,OAAD,CAAhC;AACAnB,IAAAA,sBAAsB,CAACoB,oBAAvB,CACED,OAAO,CAACE,WADV,EAEEF,OAAO,CAACG,UAFV,EAGErB,YAAY,CAACkB,OAAO,CAACI,MAAT,EAAiBf,aAAjB,CAHd;AAMAT,IAAAA,eAAe,CAACoB,OAAO,CAACG,UAAT,EAAqBH,OAArB,EAA8BA,OAAO,CAACI,MAAR,CAAeC,MAA7C,CAAf;AACD,GArBsB,CAuBvB;AACA;;;AACAnB,EAAAA,gBAAgB,CAAC,MAAM;AACrB,QAAI,CAACM,eAAe,CAACM,SAArB,EAAgC;AAC9B;AACD;;AACD,SAAK,MAAME,OAAX,IAAsBN,gBAAtB,EAAwC;AACtCb,MAAAA,sBAAsB,CAACyB,oBAAvB,CACEN,OAAO,CAACG,UADV,EAEErB,YAAY,CACVkB,OAAO,CAACI,MADE,EAEVf,aAFU,EAGVF,uBAAuB,CAACa,OAAD,CAHb,CAFd;AAQD;;AAEDjB,IAAAA,uBAAuB;AACxB,GAhBe,CAAhB;;AAkBA,OAAK,MAAMwB,OAAX,IAAsBb,gBAAtB,EAAwC;AACtC,UAAMc,UAAU,GAAGD,OAAO,CAACE,mBAAR,GACfzB,UAAU,CAAC0B,kBADI,GAEf1B,UAAU,CAAC2B,mBAFf;;AAIA,QAAI1B,QAAQ,CAAC2B,EAAT,KAAgB,KAApB,EAA2B;AAEvB/B,MAAAA,sBAAsB,CAACgC,oBADzB,CAGEN,OAAO,CAACJ,UAHV,EAIER,OAJF,EAKEX,UAAU,CAAC8B,mBALb,EAKkC;AAChClB,MAAAA,mBANF;AAQD,KATD,MASO;AACLf,MAAAA,sBAAsB,CAACgC,oBAAvB,CACEN,OAAO,CAACJ,UADV,EAEER,OAFF,EAGEa,UAHF;AAKD;;AAEDlB,IAAAA,aAAa,CAACyB,gBAAd,CAA+BR,OAA/B;AACD;;AAEDf,EAAAA,eAAe,CAACwB,gBAAhB,GAAmCtB,gBAAnC;;AAEA,MAAIF,eAAe,CAACyB,gBAApB,EAAsC;AACpC,UAAMC,iBAAiB,GAAIC,CAAD,IAAoBA,CAAC,CAACV,mBAAhD;;AAEAjB,IAAAA,eAAe,CAACyB,gBAAhB,CAAiCG,KAAjC,GAAyC1B,gBAAgB,CACtD2B,MADsC,CAC/BH,iBAD+B,EAEtCI,GAFsC,CAEjCH,CAAD,IAAOA,CAAC,CAACI,QAFyB,CAAzC;AAKD;AACF","sourcesContent":["import React from 'react';\nimport { GestureType, HandlerCallbacks } from '../gesture';\nimport { registerHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { filterConfig, scheduleFlushOperations } from '../../utils';\nimport { ComposedGesture } from '../gestureComposition';\nimport { ActionType } from '../../../ActionType';\nimport { Platform } from 'react-native';\nimport type RNGestureHandlerModuleWeb from '../../../RNGestureHandlerModule.web';\nimport { ghQueueMicrotask } from '../../../ghQueueMicrotask';\nimport { AttachedGestureState, WebEventHandler } from './types';\nimport {\n extractGestureRelations,\n checkGestureCallbacksForWorklets,\n ALLOWED_PROPS,\n} from './utils';\nimport { MountRegistry } from '../../../mountRegistry';\n\ninterface AttachHandlersConfig {\n preparedGesture: AttachedGestureState;\n gestureConfig: ComposedGesture | GestureType;\n gesturesToAttach: GestureType[];\n viewTag: number;\n webEventHandlersRef: React.RefObject<WebEventHandler>;\n}\n\nexport function attachHandlers({\n preparedGesture,\n gestureConfig,\n gesturesToAttach,\n viewTag,\n webEventHandlersRef,\n}: AttachHandlersConfig) {\n gestureConfig.initialize();\n\n // Use queueMicrotask to extract handlerTags, because all refs should be initialized\n // when it's ran\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n gestureConfig.prepare();\n });\n\n for (const handler of gesturesToAttach) {\n checkGestureCallbacksForWorklets(handler);\n RNGestureHandlerModule.createGestureHandler(\n handler.handlerName,\n handler.handlerTag,\n filterConfig(handler.config, ALLOWED_PROPS)\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n // Use queueMicrotask to extract handlerTags, because all refs should be initialized\n // when it's ran\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n for (const handler of gesturesToAttach) {\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(\n handler.config,\n ALLOWED_PROPS,\n extractGestureRelations(handler)\n )\n );\n }\n\n scheduleFlushOperations();\n });\n\n for (const gesture of gesturesToAttach) {\n const actionType = gesture.shouldUseReanimated\n ? ActionType.REANIMATED_WORKLET\n : ActionType.JS_FUNCTION_NEW_API;\n\n if (Platform.OS === 'web') {\n (\n RNGestureHandlerModule.attachGestureHandler as typeof RNGestureHandlerModuleWeb.attachGestureHandler\n )(\n gesture.handlerTag,\n viewTag,\n ActionType.JS_FUNCTION_OLD_API, // Ignored on web\n webEventHandlersRef\n );\n } else {\n RNGestureHandlerModule.attachGestureHandler(\n gesture.handlerTag,\n viewTag,\n actionType\n );\n }\n\n MountRegistry.gestureWillMount(gesture);\n }\n\n preparedGesture.attachedGestures = gesturesToAttach;\n\n if (preparedGesture.animatedHandlers) {\n const isAnimatedGesture = (g: GestureType) => g.shouldUseReanimated;\n\n preparedGesture.animatedHandlers.value = gesturesToAttach\n .filter(isAnimatedGesture)\n .map((g) => g.handlers) as unknown as HandlerCallbacks<\n Record<string, unknown>\n >[];\n }\n}\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { unregisterHandler } from '../../handlersRegistry';
|
2
|
-
import RNGestureHandlerModule from '../../../RNGestureHandlerModule';
|
3
|
-
import { scheduleFlushOperations } from '../../utils';
|
4
|
-
import { MountRegistry } from '../../../mountRegistry';
|
5
|
-
export function dropHandlers(preparedGesture) {
|
6
|
-
for (const handler of preparedGesture.attachedGestures) {
|
7
|
-
RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);
|
8
|
-
unregisterHandler(handler.handlerTag, handler.config.testId);
|
9
|
-
MountRegistry.gestureWillUnmount(handler);
|
10
|
-
}
|
11
|
-
|
12
|
-
scheduleFlushOperations();
|
13
|
-
}
|
14
|
-
//# sourceMappingURL=dropHandlers.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["dropHandlers.ts"],"names":["unregisterHandler","RNGestureHandlerModule","scheduleFlushOperations","MountRegistry","dropHandlers","preparedGesture","handler","attachedGestures","dropGestureHandler","handlerTag","config","testId","gestureWillUnmount"],"mappings":"AAAA,SAASA,iBAAT,QAAkC,wBAAlC;AACA,OAAOC,sBAAP,MAAmC,iCAAnC;AACA,SAASC,uBAAT,QAAwC,aAAxC;AAEA,SAASC,aAAT,QAA8B,wBAA9B;AAEA,OAAO,SAASC,YAAT,CAAsBC,eAAtB,EAA6D;AAClE,OAAK,MAAMC,OAAX,IAAsBD,eAAe,CAACE,gBAAtC,EAAwD;AACtDN,IAAAA,sBAAsB,CAACO,kBAAvB,CAA0CF,OAAO,CAACG,UAAlD;AAEAT,IAAAA,iBAAiB,CAACM,OAAO,CAACG,UAAT,EAAqBH,OAAO,CAACI,MAAR,CAAeC,MAApC,CAAjB;AAEAR,IAAAA,aAAa,CAACS,kBAAd,CAAiCN,OAAjC;AACD;;AAEDJ,EAAAA,uBAAuB;AACxB","sourcesContent":["import { unregisterHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { scheduleFlushOperations } from '../../utils';\nimport { AttachedGestureState } from './types';\nimport { MountRegistry } from '../../../mountRegistry';\n\nexport function dropHandlers(preparedGesture: AttachedGestureState) {\n for (const handler of preparedGesture.attachedGestures) {\n RNGestureHandlerModule.dropGestureHandler(handler.handlerTag);\n\n unregisterHandler(handler.handlerTag, handler.config.testId);\n\n MountRegistry.gestureWillUnmount(handler);\n }\n\n scheduleFlushOperations();\n}\n"]}
|
@@ -1,118 +0,0 @@
|
|
1
|
-
/* eslint-disable react/no-unused-prop-types */
|
2
|
-
import React, { useContext, useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
3
|
-
import { Platform } from 'react-native';
|
4
|
-
import findNodeHandle from '../../../findNodeHandle';
|
5
|
-
import { isTestEnv } from '../../../utils';
|
6
|
-
import GestureHandlerRootViewContext from '../../../GestureHandlerRootViewContext';
|
7
|
-
import { useAnimatedGesture } from './useAnimatedGesture';
|
8
|
-
import { attachHandlers } from './attachHandlers';
|
9
|
-
import { needsToReattach } from './needsToReattach';
|
10
|
-
import { dropHandlers } from './dropHandlers';
|
11
|
-
import { useWebEventHandlers } from './utils';
|
12
|
-
import { Wrap, AnimatedWrap } from './Wrap';
|
13
|
-
import { useDetectorUpdater } from './useDetectorUpdater';
|
14
|
-
import { useViewRefHandler } from './useViewRefHandler';
|
15
|
-
import { useMountReactions } from './useMountReactions';
|
16
|
-
|
17
|
-
function propagateDetectorConfig(props, gesture) {
|
18
|
-
const keysToPropagate = ['userSelect', 'enableContextMenu', 'touchAction'];
|
19
|
-
|
20
|
-
for (const key of keysToPropagate) {
|
21
|
-
const value = props[key];
|
22
|
-
|
23
|
-
if (value === undefined) {
|
24
|
-
continue;
|
25
|
-
}
|
26
|
-
|
27
|
-
for (const g of gesture.toGestureArray()) {
|
28
|
-
const config = g.config;
|
29
|
-
config[key] = value;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
/**
|
35
|
-
* `GestureDetector` is responsible for creating and updating native gesture handlers based on the config of provided gesture.
|
36
|
-
*
|
37
|
-
* ### Props
|
38
|
-
* - `gesture`
|
39
|
-
* - `userSelect` (**Web only**)
|
40
|
-
* - `enableContextMenu` (**Web only**)
|
41
|
-
* - `touchAction` (**Web only**)
|
42
|
-
*
|
43
|
-
* ### Remarks
|
44
|
-
* - Gesture Detector will use first native view in its subtree to recognize gestures, however if this view is used only to group its children it may get automatically collapsed.
|
45
|
-
* - Using the same instance of a gesture across multiple Gesture Detectors is not possible.
|
46
|
-
*
|
47
|
-
* @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture-detector
|
48
|
-
*/
|
49
|
-
export const GestureDetector = props => {
|
50
|
-
const rootViewContext = useContext(GestureHandlerRootViewContext);
|
51
|
-
|
52
|
-
if (__DEV__ && !rootViewContext && !isTestEnv() && Platform.OS !== 'web') {
|
53
|
-
throw new Error('GestureDetector must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.');
|
54
|
-
} // Gesture config should be wrapped with useMemo to prevent unnecessary re-renders
|
55
|
-
|
56
|
-
|
57
|
-
const gestureConfig = props.gesture;
|
58
|
-
propagateDetectorConfig(props, gestureConfig);
|
59
|
-
const gesturesToAttach = useMemo(() => gestureConfig.toGestureArray(), [gestureConfig]);
|
60
|
-
const shouldUseReanimated = gesturesToAttach.some(g => g.shouldUseReanimated);
|
61
|
-
const webEventHandlersRef = useWebEventHandlers(); // Store state in ref to prevent unnecessary renders
|
62
|
-
|
63
|
-
const state = useRef({
|
64
|
-
firstRender: true,
|
65
|
-
viewRef: null,
|
66
|
-
previousViewTag: -1,
|
67
|
-
forceRebuildReanimatedEvent: false
|
68
|
-
}).current;
|
69
|
-
const preparedGesture = React.useRef({
|
70
|
-
attachedGestures: [],
|
71
|
-
animatedEventHandler: null,
|
72
|
-
animatedHandlers: null,
|
73
|
-
shouldUseReanimated: shouldUseReanimated,
|
74
|
-
isMounted: false
|
75
|
-
}).current;
|
76
|
-
const updateAttachedGestures = useDetectorUpdater(state, preparedGesture, gesturesToAttach, gestureConfig, webEventHandlersRef);
|
77
|
-
const refHandler = useViewRefHandler(state, updateAttachedGestures); // Reanimated event should be rebuilt only when gestures are reattached, otherwise
|
78
|
-
// config update will be enough as all necessary items are stored in shared values anyway
|
79
|
-
|
80
|
-
const needsToRebuildReanimatedEvent = state.firstRender || state.forceRebuildReanimatedEvent || needsToReattach(preparedGesture, gesturesToAttach);
|
81
|
-
state.forceRebuildReanimatedEvent = false;
|
82
|
-
useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);
|
83
|
-
useLayoutEffect(() => {
|
84
|
-
const viewTag = findNodeHandle(state.viewRef);
|
85
|
-
preparedGesture.isMounted = true;
|
86
|
-
attachHandlers({
|
87
|
-
preparedGesture,
|
88
|
-
gestureConfig,
|
89
|
-
gesturesToAttach,
|
90
|
-
webEventHandlersRef,
|
91
|
-
viewTag
|
92
|
-
});
|
93
|
-
return () => {
|
94
|
-
preparedGesture.isMounted = false;
|
95
|
-
dropHandlers(preparedGesture);
|
96
|
-
};
|
97
|
-
}, []);
|
98
|
-
useEffect(() => {
|
99
|
-
if (state.firstRender) {
|
100
|
-
state.firstRender = false;
|
101
|
-
} else {
|
102
|
-
updateAttachedGestures();
|
103
|
-
}
|
104
|
-
}, [props]);
|
105
|
-
useMountReactions(updateAttachedGestures, preparedGesture);
|
106
|
-
|
107
|
-
if (shouldUseReanimated) {
|
108
|
-
return /*#__PURE__*/React.createElement(AnimatedWrap, {
|
109
|
-
ref: refHandler,
|
110
|
-
onGestureHandlerEvent: preparedGesture.animatedEventHandler
|
111
|
-
}, props.children);
|
112
|
-
} else {
|
113
|
-
return /*#__PURE__*/React.createElement(Wrap, {
|
114
|
-
ref: refHandler
|
115
|
-
}, props.children);
|
116
|
-
}
|
117
|
-
};
|
118
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":["React","useContext","useEffect","useLayoutEffect","useMemo","useRef","Platform","findNodeHandle","isTestEnv","GestureHandlerRootViewContext","useAnimatedGesture","attachHandlers","needsToReattach","dropHandlers","useWebEventHandlers","Wrap","AnimatedWrap","useDetectorUpdater","useViewRefHandler","useMountReactions","propagateDetectorConfig","props","gesture","keysToPropagate","key","value","undefined","g","toGestureArray","config","GestureDetector","rootViewContext","__DEV__","OS","Error","gestureConfig","gesturesToAttach","shouldUseReanimated","some","webEventHandlersRef","state","firstRender","viewRef","previousViewTag","forceRebuildReanimatedEvent","current","preparedGesture","attachedGestures","animatedEventHandler","animatedHandlers","isMounted","updateAttachedGestures","refHandler","needsToRebuildReanimatedEvent","viewTag","children"],"mappings":"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","sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, {\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n} from 'react';\nimport { Platform } from 'react-native';\nimport findNodeHandle from '../../../findNodeHandle';\nimport { GestureType } from '../gesture';\nimport { UserSelect, TouchAction } from '../../gestureHandlerCommon';\nimport { ComposedGesture } from '../gestureComposition';\nimport { isTestEnv } from '../../../utils';\n\nimport GestureHandlerRootViewContext from '../../../GestureHandlerRootViewContext';\nimport { AttachedGestureState, GestureDetectorState } from './types';\nimport { useAnimatedGesture } from './useAnimatedGesture';\nimport { attachHandlers } from './attachHandlers';\nimport { needsToReattach } from './needsToReattach';\nimport { dropHandlers } from './dropHandlers';\nimport { useWebEventHandlers } from './utils';\nimport { Wrap, AnimatedWrap } from './Wrap';\nimport { useDetectorUpdater } from './useDetectorUpdater';\nimport { useViewRefHandler } from './useViewRefHandler';\nimport { useMountReactions } from './useMountReactions';\n\nfunction propagateDetectorConfig(\n props: GestureDetectorProps,\n gesture: ComposedGesture | GestureType\n) {\n const keysToPropagate: (keyof GestureDetectorProps)[] = [\n 'userSelect',\n 'enableContextMenu',\n 'touchAction',\n ];\n\n for (const key of keysToPropagate) {\n const value = props[key];\n if (value === undefined) {\n continue;\n }\n\n for (const g of gesture.toGestureArray()) {\n const config = g.config as { [key: string]: unknown };\n config[key] = value;\n }\n }\n}\n\ninterface GestureDetectorProps {\n children?: React.ReactNode;\n /**\n * A gesture object containing the configuration and callbacks.\n * Can be any of:\n * - base gestures (`Tap`, `Pan`, ...)\n * - `ComposedGesture` (`Race`, `Simultaneous`, `Exclusive`)\n */\n gesture: ComposedGesture | GestureType;\n /**\n * #### Web only\n * This parameter allows to specify which `userSelect` property should be applied to underlying view.\n * Possible values are `\"none\" | \"auto\" | \"text\"`. Default value is set to `\"none\"`.\n */\n userSelect?: UserSelect;\n /**\n * #### Web only\n * Specifies whether context menu should be enabled after clicking on underlying view with right mouse button.\n * Default value is set to `false`.\n */\n enableContextMenu?: boolean;\n /**\n * #### Web only\n * This parameter allows to specify which `touchAction` property should be applied to underlying view.\n * Supports all CSS touch-action values (e.g. `\"none\"`, `\"pan-y\"`). Default value is set to `\"none\"`.\n */\n touchAction?: TouchAction;\n}\n\n/**\n * `GestureDetector` is responsible for creating and updating native gesture handlers based on the config of provided gesture.\n *\n * ### Props\n * - `gesture`\n * - `userSelect` (**Web only**)\n * - `enableContextMenu` (**Web only**)\n * - `touchAction` (**Web only**)\n *\n * ### Remarks\n * - Gesture Detector will use first native view in its subtree to recognize gestures, however if this view is used only to group its children it may get automatically collapsed.\n * - Using the same instance of a gesture across multiple Gesture Detectors is not possible.\n *\n * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture-detector\n */\nexport const GestureDetector = (props: GestureDetectorProps) => {\n const rootViewContext = useContext(GestureHandlerRootViewContext);\n if (__DEV__ && !rootViewContext && !isTestEnv() && Platform.OS !== 'web') {\n throw new Error(\n 'GestureDetector must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.'\n );\n }\n\n // Gesture config should be wrapped with useMemo to prevent unnecessary re-renders\n const gestureConfig = props.gesture;\n propagateDetectorConfig(props, gestureConfig);\n\n const gesturesToAttach = useMemo(\n () => gestureConfig.toGestureArray(),\n [gestureConfig]\n );\n const shouldUseReanimated = gesturesToAttach.some(\n (g) => g.shouldUseReanimated\n );\n\n const webEventHandlersRef = useWebEventHandlers();\n // Store state in ref to prevent unnecessary renders\n const state = useRef<GestureDetectorState>({\n firstRender: true,\n viewRef: null,\n previousViewTag: -1,\n forceRebuildReanimatedEvent: false,\n }).current;\n\n const preparedGesture = React.useRef<AttachedGestureState>({\n attachedGestures: [],\n animatedEventHandler: null,\n animatedHandlers: null,\n shouldUseReanimated: shouldUseReanimated,\n isMounted: false,\n }).current;\n\n const updateAttachedGestures = useDetectorUpdater(\n state,\n preparedGesture,\n gesturesToAttach,\n gestureConfig,\n webEventHandlersRef\n );\n\n const refHandler = useViewRefHandler(state, updateAttachedGestures);\n\n // Reanimated event should be rebuilt only when gestures are reattached, otherwise\n // config update will be enough as all necessary items are stored in shared values anyway\n const needsToRebuildReanimatedEvent =\n state.firstRender ||\n state.forceRebuildReanimatedEvent ||\n needsToReattach(preparedGesture, gesturesToAttach);\n state.forceRebuildReanimatedEvent = false;\n\n useAnimatedGesture(preparedGesture, needsToRebuildReanimatedEvent);\n\n useLayoutEffect(() => {\n const viewTag = findNodeHandle(state.viewRef) as number;\n preparedGesture.isMounted = true;\n\n attachHandlers({\n preparedGesture,\n gestureConfig,\n gesturesToAttach,\n webEventHandlersRef,\n viewTag,\n });\n\n return () => {\n preparedGesture.isMounted = false;\n dropHandlers(preparedGesture);\n };\n }, []);\n\n useEffect(() => {\n if (state.firstRender) {\n state.firstRender = false;\n } else {\n updateAttachedGestures();\n }\n }, [props]);\n\n useMountReactions(updateAttachedGestures, preparedGesture);\n\n if (shouldUseReanimated) {\n return (\n <AnimatedWrap\n ref={refHandler}\n onGestureHandlerEvent={preparedGesture.animatedEventHandler}>\n {props.children}\n </AnimatedWrap>\n );\n } else {\n return <Wrap ref={refHandler}>{props.children}</Wrap>;\n }\n};\n"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
// Checks whether the gesture should be reattached to the view, this will happen when:
|
2
|
-
// - The number of gestures in the preparedGesture is different than the number of gestures in the gesture
|
3
|
-
// - The handlerName is different in any of the gestures
|
4
|
-
// - At least one of the gestures changed the thread it runs on
|
5
|
-
export function needsToReattach(preparedGesture, newGestures) {
|
6
|
-
if (newGestures.length !== preparedGesture.attachedGestures.length) {
|
7
|
-
return true;
|
8
|
-
}
|
9
|
-
|
10
|
-
for (let i = 0; i < newGestures.length; i++) {
|
11
|
-
if (newGestures[i].handlerName !== preparedGesture.attachedGestures[i].handlerName || newGestures[i].shouldUseReanimated !== preparedGesture.attachedGestures[i].shouldUseReanimated) {
|
12
|
-
return true;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
return false;
|
17
|
-
}
|
18
|
-
//# sourceMappingURL=needsToReattach.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["needsToReattach.ts"],"names":["needsToReattach","preparedGesture","newGestures","length","attachedGestures","i","handlerName","shouldUseReanimated"],"mappings":"AAGA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAT,CACLC,eADK,EAELC,WAFK,EAGL;AACA,MAAIA,WAAW,CAACC,MAAZ,KAAuBF,eAAe,CAACG,gBAAhB,CAAiCD,MAA5D,EAAoE;AAClE,WAAO,IAAP;AACD;;AACD,OAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,WAAW,CAACC,MAAhC,EAAwCE,CAAC,EAAzC,EAA6C;AAC3C,QACEH,WAAW,CAACG,CAAD,CAAX,CAAeC,WAAf,KACEL,eAAe,CAACG,gBAAhB,CAAiCC,CAAjC,EAAoCC,WADtC,IAEAJ,WAAW,CAACG,CAAD,CAAX,CAAeE,mBAAf,KACEN,eAAe,CAACG,gBAAhB,CAAiCC,CAAjC,EAAoCE,mBAJxC,EAKE;AACA,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD","sourcesContent":["import { GestureType } from '../gesture';\nimport { AttachedGestureState } from './types';\n\n// Checks whether the gesture should be reattached to the view, this will happen when:\n// - The number of gestures in the preparedGesture is different than the number of gestures in the gesture\n// - The handlerName is different in any of the gestures\n// - At least one of the gestures changed the thread it runs on\nexport function needsToReattach(\n preparedGesture: AttachedGestureState,\n newGestures: GestureType[]\n) {\n if (newGestures.length !== preparedGesture.attachedGestures.length) {\n return true;\n }\n for (let i = 0; i < newGestures.length; i++) {\n if (\n newGestures[i].handlerName !==\n preparedGesture.attachedGestures[i].handlerName ||\n newGestures[i].shouldUseReanimated !==\n preparedGesture.attachedGestures[i].shouldUseReanimated\n ) {\n return true;\n }\n }\n\n return false;\n}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import { registerHandler } from '../../handlersRegistry';
|
2
|
-
import RNGestureHandlerModule from '../../../RNGestureHandlerModule';
|
3
|
-
import { filterConfig, scheduleFlushOperations } from '../../utils';
|
4
|
-
import { ghQueueMicrotask } from '../../../ghQueueMicrotask';
|
5
|
-
import { extractGestureRelations, checkGestureCallbacksForWorklets, ALLOWED_PROPS } from './utils';
|
6
|
-
export function updateHandlers(preparedGesture, gestureConfig, newGestures) {
|
7
|
-
gestureConfig.prepare();
|
8
|
-
|
9
|
-
for (let i = 0; i < newGestures.length; i++) {
|
10
|
-
const handler = preparedGesture.attachedGestures[i];
|
11
|
-
checkGestureCallbacksForWorklets(handler); // Only update handlerTag when it's actually different, it may be the same
|
12
|
-
// if gesture config object is wrapped with useMemo
|
13
|
-
|
14
|
-
if (newGestures[i].handlerTag !== handler.handlerTag) {
|
15
|
-
newGestures[i].handlerTag = handler.handlerTag;
|
16
|
-
newGestures[i].handlers.handlerTag = handler.handlerTag;
|
17
|
-
}
|
18
|
-
} // Store attached gestures to avoid crash when gestures changed after queueing micro task
|
19
|
-
|
20
|
-
|
21
|
-
const attachedGestures = preparedGesture.attachedGestures; // Use queueMicrotask to extract handlerTags, because when it's ran, all refs should be updated
|
22
|
-
// and handlerTags in BaseGesture references should be updated in the loop above (we need to wait
|
23
|
-
// in case of external relations)
|
24
|
-
|
25
|
-
ghQueueMicrotask(() => {
|
26
|
-
if (!preparedGesture.isMounted) {
|
27
|
-
return;
|
28
|
-
} // Stop if attached gestures changed after queueing micro task
|
29
|
-
|
30
|
-
|
31
|
-
if (attachedGestures !== preparedGesture.attachedGestures) {
|
32
|
-
return;
|
33
|
-
} // If amount of gesture configs changes, we need to update the callbacks in shared value
|
34
|
-
|
35
|
-
|
36
|
-
let shouldUpdateSharedValueIfUsed = attachedGestures.length !== newGestures.length;
|
37
|
-
|
38
|
-
for (let i = 0; i < newGestures.length; i++) {
|
39
|
-
const handler = attachedGestures[i]; // If the gestureId is different (gesture isn't wrapped with useMemo or its dependencies changed),
|
40
|
-
// we need to update the shared value, assuming the gesture runs on UI thread or the thread changed
|
41
|
-
|
42
|
-
if (handler.handlers.gestureId !== newGestures[i].handlers.gestureId && (newGestures[i].shouldUseReanimated || handler.shouldUseReanimated)) {
|
43
|
-
shouldUpdateSharedValueIfUsed = true;
|
44
|
-
}
|
45
|
-
|
46
|
-
handler.config = newGestures[i].config;
|
47
|
-
handler.handlers = newGestures[i].handlers;
|
48
|
-
RNGestureHandlerModule.updateGestureHandler(handler.handlerTag, filterConfig(handler.config, ALLOWED_PROPS, extractGestureRelations(handler)));
|
49
|
-
registerHandler(handler.handlerTag, handler, handler.config.testId);
|
50
|
-
}
|
51
|
-
|
52
|
-
if (preparedGesture.animatedHandlers && shouldUpdateSharedValueIfUsed) {
|
53
|
-
const newHandlersValue = attachedGestures.filter(g => g.shouldUseReanimated) // Ignore gestures that shouldn't run on UI
|
54
|
-
.map(g => g.handlers);
|
55
|
-
preparedGesture.animatedHandlers.value = newHandlersValue;
|
56
|
-
}
|
57
|
-
|
58
|
-
scheduleFlushOperations();
|
59
|
-
});
|
60
|
-
}
|
61
|
-
//# sourceMappingURL=updateHandlers.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["updateHandlers.ts"],"names":["registerHandler","RNGestureHandlerModule","filterConfig","scheduleFlushOperations","ghQueueMicrotask","extractGestureRelations","checkGestureCallbacksForWorklets","ALLOWED_PROPS","updateHandlers","preparedGesture","gestureConfig","newGestures","prepare","i","length","handler","attachedGestures","handlerTag","handlers","isMounted","shouldUpdateSharedValueIfUsed","gestureId","shouldUseReanimated","config","updateGestureHandler","testId","animatedHandlers","newHandlersValue","filter","g","map","value"],"mappings":"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","sourcesContent":["import { GestureType, HandlerCallbacks } from '../gesture';\nimport { registerHandler } from '../../handlersRegistry';\nimport RNGestureHandlerModule from '../../../RNGestureHandlerModule';\nimport { filterConfig, scheduleFlushOperations } from '../../utils';\nimport { ComposedGesture } from '../gestureComposition';\nimport { ghQueueMicrotask } from '../../../ghQueueMicrotask';\nimport { AttachedGestureState } from './types';\nimport {\n extractGestureRelations,\n checkGestureCallbacksForWorklets,\n ALLOWED_PROPS,\n} from './utils';\n\nexport function updateHandlers(\n preparedGesture: AttachedGestureState,\n gestureConfig: ComposedGesture | GestureType,\n newGestures: GestureType[]\n) {\n gestureConfig.prepare();\n\n for (let i = 0; i < newGestures.length; i++) {\n const handler = preparedGesture.attachedGestures[i];\n checkGestureCallbacksForWorklets(handler);\n\n // Only update handlerTag when it's actually different, it may be the same\n // if gesture config object is wrapped with useMemo\n if (newGestures[i].handlerTag !== handler.handlerTag) {\n newGestures[i].handlerTag = handler.handlerTag;\n newGestures[i].handlers.handlerTag = handler.handlerTag;\n }\n }\n\n // Store attached gestures to avoid crash when gestures changed after queueing micro task\n const attachedGestures = preparedGesture.attachedGestures;\n\n // Use queueMicrotask to extract handlerTags, because when it's ran, all refs should be updated\n // and handlerTags in BaseGesture references should be updated in the loop above (we need to wait\n // in case of external relations)\n ghQueueMicrotask(() => {\n if (!preparedGesture.isMounted) {\n return;\n }\n\n // Stop if attached gestures changed after queueing micro task\n if (attachedGestures !== preparedGesture.attachedGestures) {\n return;\n }\n\n // If amount of gesture configs changes, we need to update the callbacks in shared value\n let shouldUpdateSharedValueIfUsed =\n attachedGestures.length !== newGestures.length;\n\n for (let i = 0; i < newGestures.length; i++) {\n const handler = attachedGestures[i];\n\n // If the gestureId is different (gesture isn't wrapped with useMemo or its dependencies changed),\n // we need to update the shared value, assuming the gesture runs on UI thread or the thread changed\n if (\n handler.handlers.gestureId !== newGestures[i].handlers.gestureId &&\n (newGestures[i].shouldUseReanimated || handler.shouldUseReanimated)\n ) {\n shouldUpdateSharedValueIfUsed = true;\n }\n\n handler.config = newGestures[i].config;\n handler.handlers = newGestures[i].handlers;\n\n RNGestureHandlerModule.updateGestureHandler(\n handler.handlerTag,\n filterConfig(\n handler.config,\n ALLOWED_PROPS,\n extractGestureRelations(handler)\n )\n );\n\n registerHandler(handler.handlerTag, handler, handler.config.testId);\n }\n\n if (preparedGesture.animatedHandlers && shouldUpdateSharedValueIfUsed) {\n const newHandlersValue = attachedGestures\n .filter((g) => g.shouldUseReanimated) // Ignore gestures that shouldn't run on UI\n .map((g) => g.handlers) as unknown as HandlerCallbacks<\n Record<string, unknown>\n >[];\n\n preparedGesture.animatedHandlers.value = newHandlersValue;\n }\n\n scheduleFlushOperations();\n });\n}\n"]}
|