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,398 +0,0 @@
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
-
|
3
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
-
|
5
|
-
// Similarily to the DrawerLayout component this deserves to be put in a
|
6
|
-
// separate repo. Although, keeping it here for the time being will allow us to
|
7
|
-
// move faster and fix possible issues quicker
|
8
|
-
import * as React from 'react';
|
9
|
-
import { Component } from 'react';
|
10
|
-
import { Animated, StyleSheet, View, I18nManager } from 'react-native';
|
11
|
-
import { PanGestureHandler } from '../handlers/PanGestureHandler';
|
12
|
-
import { TapGestureHandler } from '../handlers/TapGestureHandler';
|
13
|
-
import { State } from '../State';
|
14
|
-
const DRAG_TOSS = 0.05;
|
15
|
-
|
16
|
-
/**
|
17
|
-
* @deprecated use Reanimated version of Swipeable instead
|
18
|
-
*
|
19
|
-
* This component allows for implementing swipeable rows or similar interaction.
|
20
|
-
*/
|
21
|
-
export default class Swipeable extends Component {
|
22
|
-
constructor(_props) {
|
23
|
-
super(_props);
|
24
|
-
|
25
|
-
_defineProperty(this, "onGestureEvent", void 0);
|
26
|
-
|
27
|
-
_defineProperty(this, "transX", void 0);
|
28
|
-
|
29
|
-
_defineProperty(this, "showLeftAction", void 0);
|
30
|
-
|
31
|
-
_defineProperty(this, "leftActionTranslate", void 0);
|
32
|
-
|
33
|
-
_defineProperty(this, "showRightAction", void 0);
|
34
|
-
|
35
|
-
_defineProperty(this, "rightActionTranslate", void 0);
|
36
|
-
|
37
|
-
_defineProperty(this, "updateAnimatedEvent", (props, state) => {
|
38
|
-
const {
|
39
|
-
friction,
|
40
|
-
overshootFriction
|
41
|
-
} = props;
|
42
|
-
const {
|
43
|
-
dragX,
|
44
|
-
rowTranslation,
|
45
|
-
leftWidth = 0,
|
46
|
-
rowWidth = 0
|
47
|
-
} = state;
|
48
|
-
const {
|
49
|
-
rightOffset = rowWidth
|
50
|
-
} = state;
|
51
|
-
const rightWidth = Math.max(0, rowWidth - rightOffset);
|
52
|
-
const {
|
53
|
-
overshootLeft = leftWidth > 0,
|
54
|
-
overshootRight = rightWidth > 0
|
55
|
-
} = props;
|
56
|
-
const transX = Animated.add(rowTranslation, dragX.interpolate({
|
57
|
-
inputRange: [0, friction],
|
58
|
-
outputRange: [0, 1]
|
59
|
-
})).interpolate({
|
60
|
-
inputRange: [-rightWidth - 1, -rightWidth, leftWidth, leftWidth + 1],
|
61
|
-
outputRange: [-rightWidth - (overshootRight ? 1 / overshootFriction : 0), -rightWidth, leftWidth, leftWidth + (overshootLeft ? 1 / overshootFriction : 0)]
|
62
|
-
});
|
63
|
-
this.transX = transX;
|
64
|
-
this.showLeftAction = leftWidth > 0 ? transX.interpolate({
|
65
|
-
inputRange: [-1, 0, leftWidth],
|
66
|
-
outputRange: [0, 0, 1]
|
67
|
-
}) : new Animated.Value(0);
|
68
|
-
this.leftActionTranslate = this.showLeftAction.interpolate({
|
69
|
-
inputRange: [0, Number.MIN_VALUE],
|
70
|
-
outputRange: [-10000, 0],
|
71
|
-
extrapolate: 'clamp'
|
72
|
-
});
|
73
|
-
this.showRightAction = rightWidth > 0 ? transX.interpolate({
|
74
|
-
inputRange: [-rightWidth, 0, 1],
|
75
|
-
outputRange: [1, 0, 0]
|
76
|
-
}) : new Animated.Value(0);
|
77
|
-
this.rightActionTranslate = this.showRightAction.interpolate({
|
78
|
-
inputRange: [0, Number.MIN_VALUE],
|
79
|
-
outputRange: [-10000, 0],
|
80
|
-
extrapolate: 'clamp'
|
81
|
-
});
|
82
|
-
});
|
83
|
-
|
84
|
-
_defineProperty(this, "onTapHandlerStateChange", ({
|
85
|
-
nativeEvent
|
86
|
-
}) => {
|
87
|
-
if (nativeEvent.oldState === State.ACTIVE) {
|
88
|
-
this.close();
|
89
|
-
}
|
90
|
-
});
|
91
|
-
|
92
|
-
_defineProperty(this, "onHandlerStateChange", ev => {
|
93
|
-
if (ev.nativeEvent.oldState === State.ACTIVE) {
|
94
|
-
this.handleRelease(ev);
|
95
|
-
}
|
96
|
-
|
97
|
-
if (ev.nativeEvent.state === State.ACTIVE) {
|
98
|
-
const {
|
99
|
-
velocityX,
|
100
|
-
translationX: dragX
|
101
|
-
} = ev.nativeEvent;
|
102
|
-
const {
|
103
|
-
rowState
|
104
|
-
} = this.state;
|
105
|
-
const {
|
106
|
-
friction
|
107
|
-
} = this.props;
|
108
|
-
const translationX = (dragX + DRAG_TOSS * velocityX) / friction;
|
109
|
-
const direction = rowState === -1 ? 'right' : rowState === 1 ? 'left' : translationX > 0 ? 'left' : 'right';
|
110
|
-
|
111
|
-
if (rowState === 0) {
|
112
|
-
var _this$props$onSwipeab, _this$props;
|
113
|
-
|
114
|
-
(_this$props$onSwipeab = (_this$props = this.props).onSwipeableOpenStartDrag) === null || _this$props$onSwipeab === void 0 ? void 0 : _this$props$onSwipeab.call(_this$props, direction);
|
115
|
-
} else {
|
116
|
-
var _this$props$onSwipeab2, _this$props2;
|
117
|
-
|
118
|
-
(_this$props$onSwipeab2 = (_this$props2 = this.props).onSwipeableCloseStartDrag) === null || _this$props$onSwipeab2 === void 0 ? void 0 : _this$props$onSwipeab2.call(_this$props2, direction);
|
119
|
-
}
|
120
|
-
}
|
121
|
-
});
|
122
|
-
|
123
|
-
_defineProperty(this, "handleRelease", ev => {
|
124
|
-
const {
|
125
|
-
velocityX,
|
126
|
-
translationX: dragX
|
127
|
-
} = ev.nativeEvent;
|
128
|
-
const {
|
129
|
-
leftWidth = 0,
|
130
|
-
rowWidth = 0,
|
131
|
-
rowState
|
132
|
-
} = this.state;
|
133
|
-
const {
|
134
|
-
rightOffset = rowWidth
|
135
|
-
} = this.state;
|
136
|
-
const rightWidth = rowWidth - rightOffset;
|
137
|
-
const {
|
138
|
-
friction,
|
139
|
-
leftThreshold = leftWidth / 2,
|
140
|
-
rightThreshold = rightWidth / 2
|
141
|
-
} = this.props;
|
142
|
-
const startOffsetX = this.currentOffset() + dragX / friction;
|
143
|
-
const translationX = (dragX + DRAG_TOSS * velocityX) / friction;
|
144
|
-
let toValue = 0;
|
145
|
-
|
146
|
-
if (rowState === 0) {
|
147
|
-
if (translationX > leftThreshold) {
|
148
|
-
toValue = leftWidth;
|
149
|
-
} else if (translationX < -rightThreshold) {
|
150
|
-
toValue = -rightWidth;
|
151
|
-
}
|
152
|
-
} else if (rowState === 1) {
|
153
|
-
// Swiped to left
|
154
|
-
if (translationX > -leftThreshold) {
|
155
|
-
toValue = leftWidth;
|
156
|
-
}
|
157
|
-
} else {
|
158
|
-
// Swiped to right
|
159
|
-
if (translationX < rightThreshold) {
|
160
|
-
toValue = -rightWidth;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
this.animateRow(startOffsetX, toValue, velocityX / friction);
|
165
|
-
});
|
166
|
-
|
167
|
-
_defineProperty(this, "animateRow", (fromValue, toValue, velocityX) => {
|
168
|
-
const {
|
169
|
-
dragX,
|
170
|
-
rowTranslation
|
171
|
-
} = this.state;
|
172
|
-
dragX.setValue(0);
|
173
|
-
rowTranslation.setValue(fromValue);
|
174
|
-
this.setState({
|
175
|
-
rowState: Math.sign(toValue)
|
176
|
-
});
|
177
|
-
Animated.spring(rowTranslation, {
|
178
|
-
restSpeedThreshold: 1.7,
|
179
|
-
restDisplacementThreshold: 0.4,
|
180
|
-
velocity: velocityX,
|
181
|
-
bounciness: 0,
|
182
|
-
toValue,
|
183
|
-
useNativeDriver: this.props.useNativeAnimations,
|
184
|
-
...this.props.animationOptions
|
185
|
-
}).start(({
|
186
|
-
finished
|
187
|
-
}) => {
|
188
|
-
if (finished) {
|
189
|
-
if (toValue > 0) {
|
190
|
-
var _this$props$onSwipeab3, _this$props3, _this$props$onSwipeab4, _this$props4;
|
191
|
-
|
192
|
-
(_this$props$onSwipeab3 = (_this$props3 = this.props).onSwipeableLeftOpen) === null || _this$props$onSwipeab3 === void 0 ? void 0 : _this$props$onSwipeab3.call(_this$props3);
|
193
|
-
(_this$props$onSwipeab4 = (_this$props4 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab4 === void 0 ? void 0 : _this$props$onSwipeab4.call(_this$props4, 'left', this);
|
194
|
-
} else if (toValue < 0) {
|
195
|
-
var _this$props$onSwipeab5, _this$props5, _this$props$onSwipeab6, _this$props6;
|
196
|
-
|
197
|
-
(_this$props$onSwipeab5 = (_this$props5 = this.props).onSwipeableRightOpen) === null || _this$props$onSwipeab5 === void 0 ? void 0 : _this$props$onSwipeab5.call(_this$props5);
|
198
|
-
(_this$props$onSwipeab6 = (_this$props6 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab6 === void 0 ? void 0 : _this$props$onSwipeab6.call(_this$props6, 'right', this);
|
199
|
-
} else {
|
200
|
-
var _this$props$onSwipeab7, _this$props7;
|
201
|
-
|
202
|
-
const closingDirection = fromValue > 0 ? 'left' : 'right';
|
203
|
-
(_this$props$onSwipeab7 = (_this$props7 = this.props).onSwipeableClose) === null || _this$props$onSwipeab7 === void 0 ? void 0 : _this$props$onSwipeab7.call(_this$props7, closingDirection, this);
|
204
|
-
}
|
205
|
-
}
|
206
|
-
});
|
207
|
-
|
208
|
-
if (toValue > 0) {
|
209
|
-
var _this$props$onSwipeab8, _this$props8, _this$props$onSwipeab9, _this$props9;
|
210
|
-
|
211
|
-
(_this$props$onSwipeab8 = (_this$props8 = this.props).onSwipeableLeftWillOpen) === null || _this$props$onSwipeab8 === void 0 ? void 0 : _this$props$onSwipeab8.call(_this$props8);
|
212
|
-
(_this$props$onSwipeab9 = (_this$props9 = this.props).onSwipeableWillOpen) === null || _this$props$onSwipeab9 === void 0 ? void 0 : _this$props$onSwipeab9.call(_this$props9, 'left');
|
213
|
-
} else if (toValue < 0) {
|
214
|
-
var _this$props$onSwipeab10, _this$props10, _this$props$onSwipeab11, _this$props11;
|
215
|
-
|
216
|
-
(_this$props$onSwipeab10 = (_this$props10 = this.props).onSwipeableRightWillOpen) === null || _this$props$onSwipeab10 === void 0 ? void 0 : _this$props$onSwipeab10.call(_this$props10);
|
217
|
-
(_this$props$onSwipeab11 = (_this$props11 = this.props).onSwipeableWillOpen) === null || _this$props$onSwipeab11 === void 0 ? void 0 : _this$props$onSwipeab11.call(_this$props11, 'right');
|
218
|
-
} else {
|
219
|
-
var _this$props$onSwipeab12, _this$props12;
|
220
|
-
|
221
|
-
const closingDirection = fromValue > 0 ? 'left' : 'right';
|
222
|
-
(_this$props$onSwipeab12 = (_this$props12 = this.props).onSwipeableWillClose) === null || _this$props$onSwipeab12 === void 0 ? void 0 : _this$props$onSwipeab12.call(_this$props12, closingDirection);
|
223
|
-
}
|
224
|
-
});
|
225
|
-
|
226
|
-
_defineProperty(this, "onRowLayout", ({
|
227
|
-
nativeEvent
|
228
|
-
}) => {
|
229
|
-
this.setState({
|
230
|
-
rowWidth: nativeEvent.layout.width
|
231
|
-
});
|
232
|
-
});
|
233
|
-
|
234
|
-
_defineProperty(this, "currentOffset", () => {
|
235
|
-
const {
|
236
|
-
leftWidth = 0,
|
237
|
-
rowWidth = 0,
|
238
|
-
rowState
|
239
|
-
} = this.state;
|
240
|
-
const {
|
241
|
-
rightOffset = rowWidth
|
242
|
-
} = this.state;
|
243
|
-
const rightWidth = rowWidth - rightOffset;
|
244
|
-
|
245
|
-
if (rowState === 1) {
|
246
|
-
return leftWidth;
|
247
|
-
} else if (rowState === -1) {
|
248
|
-
return -rightWidth;
|
249
|
-
}
|
250
|
-
|
251
|
-
return 0;
|
252
|
-
});
|
253
|
-
|
254
|
-
_defineProperty(this, "close", () => {
|
255
|
-
this.animateRow(this.currentOffset(), 0);
|
256
|
-
});
|
257
|
-
|
258
|
-
_defineProperty(this, "openLeft", () => {
|
259
|
-
const {
|
260
|
-
leftWidth = 0
|
261
|
-
} = this.state;
|
262
|
-
this.animateRow(this.currentOffset(), leftWidth);
|
263
|
-
});
|
264
|
-
|
265
|
-
_defineProperty(this, "openRight", () => {
|
266
|
-
const {
|
267
|
-
rowWidth = 0
|
268
|
-
} = this.state;
|
269
|
-
const {
|
270
|
-
rightOffset = rowWidth
|
271
|
-
} = this.state;
|
272
|
-
const rightWidth = rowWidth - rightOffset;
|
273
|
-
this.animateRow(this.currentOffset(), -rightWidth);
|
274
|
-
});
|
275
|
-
|
276
|
-
_defineProperty(this, "reset", () => {
|
277
|
-
const {
|
278
|
-
dragX,
|
279
|
-
rowTranslation
|
280
|
-
} = this.state;
|
281
|
-
dragX.setValue(0);
|
282
|
-
rowTranslation.setValue(0);
|
283
|
-
this.setState({
|
284
|
-
rowState: 0
|
285
|
-
});
|
286
|
-
});
|
287
|
-
|
288
|
-
const _dragX = new Animated.Value(0);
|
289
|
-
|
290
|
-
this.state = {
|
291
|
-
dragX: _dragX,
|
292
|
-
rowTranslation: new Animated.Value(0),
|
293
|
-
rowState: 0,
|
294
|
-
leftWidth: undefined,
|
295
|
-
rightOffset: undefined,
|
296
|
-
rowWidth: undefined
|
297
|
-
};
|
298
|
-
this.updateAnimatedEvent(_props, this.state);
|
299
|
-
this.onGestureEvent = Animated.event([{
|
300
|
-
nativeEvent: {
|
301
|
-
translationX: _dragX
|
302
|
-
}
|
303
|
-
}], {
|
304
|
-
useNativeDriver: _props.useNativeAnimations
|
305
|
-
});
|
306
|
-
}
|
307
|
-
|
308
|
-
shouldComponentUpdate(props, state) {
|
309
|
-
if (this.props.friction !== props.friction || this.props.overshootLeft !== props.overshootLeft || this.props.overshootRight !== props.overshootRight || this.props.overshootFriction !== props.overshootFriction || this.state.leftWidth !== state.leftWidth || this.state.rightOffset !== state.rightOffset || this.state.rowWidth !== state.rowWidth) {
|
310
|
-
this.updateAnimatedEvent(props, state);
|
311
|
-
}
|
312
|
-
|
313
|
-
return true;
|
314
|
-
}
|
315
|
-
|
316
|
-
render() {
|
317
|
-
const {
|
318
|
-
rowState
|
319
|
-
} = this.state;
|
320
|
-
const {
|
321
|
-
children,
|
322
|
-
renderLeftActions,
|
323
|
-
renderRightActions,
|
324
|
-
dragOffsetFromLeftEdge = 10,
|
325
|
-
dragOffsetFromRightEdge = 10
|
326
|
-
} = this.props;
|
327
|
-
const left = renderLeftActions && /*#__PURE__*/React.createElement(Animated.View, {
|
328
|
-
style: [styles.leftActions, // All those and below parameters can have ! since they are all
|
329
|
-
// asigned in constructor in `updateAnimatedEvent` but TS cannot spot
|
330
|
-
// it for some reason
|
331
|
-
{
|
332
|
-
transform: [{
|
333
|
-
translateX: this.leftActionTranslate
|
334
|
-
}]
|
335
|
-
}]
|
336
|
-
}, renderLeftActions(this.showLeftAction, this.transX, this), /*#__PURE__*/React.createElement(View, {
|
337
|
-
onLayout: ({
|
338
|
-
nativeEvent
|
339
|
-
}) => this.setState({
|
340
|
-
leftWidth: nativeEvent.layout.x
|
341
|
-
})
|
342
|
-
}));
|
343
|
-
const right = renderRightActions && /*#__PURE__*/React.createElement(Animated.View, {
|
344
|
-
style: [styles.rightActions, {
|
345
|
-
transform: [{
|
346
|
-
translateX: this.rightActionTranslate
|
347
|
-
}]
|
348
|
-
}]
|
349
|
-
}, renderRightActions(this.showRightAction, this.transX, this), /*#__PURE__*/React.createElement(View, {
|
350
|
-
onLayout: ({
|
351
|
-
nativeEvent
|
352
|
-
}) => this.setState({
|
353
|
-
rightOffset: nativeEvent.layout.x
|
354
|
-
})
|
355
|
-
}));
|
356
|
-
return /*#__PURE__*/React.createElement(PanGestureHandler, _extends({
|
357
|
-
activeOffsetX: [-dragOffsetFromRightEdge, dragOffsetFromLeftEdge],
|
358
|
-
touchAction: "pan-y"
|
359
|
-
}, this.props, {
|
360
|
-
onGestureEvent: this.onGestureEvent,
|
361
|
-
onHandlerStateChange: this.onHandlerStateChange
|
362
|
-
}), /*#__PURE__*/React.createElement(Animated.View, {
|
363
|
-
onLayout: this.onRowLayout,
|
364
|
-
style: [styles.container, this.props.containerStyle]
|
365
|
-
}, left, right, /*#__PURE__*/React.createElement(TapGestureHandler, {
|
366
|
-
enabled: rowState !== 0,
|
367
|
-
touchAction: "pan-y",
|
368
|
-
onHandlerStateChange: this.onTapHandlerStateChange
|
369
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
370
|
-
pointerEvents: rowState === 0 ? 'auto' : 'box-only',
|
371
|
-
style: [{
|
372
|
-
transform: [{
|
373
|
-
translateX: this.transX
|
374
|
-
}]
|
375
|
-
}, this.props.childrenContainerStyle]
|
376
|
-
}, children))));
|
377
|
-
}
|
378
|
-
|
379
|
-
}
|
380
|
-
|
381
|
-
_defineProperty(Swipeable, "defaultProps", {
|
382
|
-
friction: 1,
|
383
|
-
overshootFriction: 1,
|
384
|
-
useNativeAnimations: true
|
385
|
-
});
|
386
|
-
|
387
|
-
const styles = StyleSheet.create({
|
388
|
-
container: {
|
389
|
-
overflow: 'hidden'
|
390
|
-
},
|
391
|
-
leftActions: { ...StyleSheet.absoluteFillObject,
|
392
|
-
flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row'
|
393
|
-
},
|
394
|
-
rightActions: { ...StyleSheet.absoluteFillObject,
|
395
|
-
flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse'
|
396
|
-
}
|
397
|
-
});
|
398
|
-
//# sourceMappingURL=Swipeable.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["Swipeable.tsx"],"names":["React","Component","Animated","StyleSheet","View","I18nManager","PanGestureHandler","TapGestureHandler","State","DRAG_TOSS","Swipeable","constructor","props","state","friction","overshootFriction","dragX","rowTranslation","leftWidth","rowWidth","rightOffset","rightWidth","Math","max","overshootLeft","overshootRight","transX","add","interpolate","inputRange","outputRange","showLeftAction","Value","leftActionTranslate","Number","MIN_VALUE","extrapolate","showRightAction","rightActionTranslate","nativeEvent","oldState","ACTIVE","close","ev","handleRelease","velocityX","translationX","rowState","direction","onSwipeableOpenStartDrag","onSwipeableCloseStartDrag","leftThreshold","rightThreshold","startOffsetX","currentOffset","toValue","animateRow","fromValue","setValue","setState","sign","spring","restSpeedThreshold","restDisplacementThreshold","velocity","bounciness","useNativeDriver","useNativeAnimations","animationOptions","start","finished","onSwipeableLeftOpen","onSwipeableOpen","onSwipeableRightOpen","closingDirection","onSwipeableClose","onSwipeableLeftWillOpen","onSwipeableWillOpen","onSwipeableRightWillOpen","onSwipeableWillClose","layout","width","undefined","updateAnimatedEvent","onGestureEvent","event","shouldComponentUpdate","render","children","renderLeftActions","renderRightActions","dragOffsetFromLeftEdge","dragOffsetFromRightEdge","left","styles","leftActions","transform","translateX","x","right","rightActions","onHandlerStateChange","onRowLayout","container","containerStyle","onTapHandlerStateChange","childrenContainerStyle","create","overflow","absoluteFillObject","flexDirection","isRTL"],"mappings":";;;;AAAA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,SACEC,QADF,EAEEC,UAFF,EAGEC,IAHF,EAIEC,WAJF,QAQO,cARP;AAcA,SACEC,iBADF,QAGO,+BAHP;AAQA,SAASC,iBAAT,QAAkC,+BAAlC;AACA,SAASC,KAAT,QAAsB,UAAtB;AAEA,MAAMC,SAAS,GAAG,IAAlB;;AAiMA;AACA;AACA;AACA;AACA;AAEA,eAAe,MAAMC,SAAN,SAAwBT,SAAxB,CAGb;AAOAU,EAAAA,WAAW,CAACC,MAAD,EAAwB;AACjC,UAAMA,MAAN;;AADiC;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA,iDA4CL,CAC5BA,KAD4B,EAE5BC,KAF4B,KAGzB;AACH,YAAM;AAAEC,QAAAA,QAAF;AAAYC,QAAAA;AAAZ,UAAkCH,KAAxC;AACA,YAAM;AAAEI,QAAAA,KAAF;AAASC,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AAE;AADD,GADoB;AAI/Bb,EAAAA,WAAW,EAAE,EACX,GAAG5F,UAAU,CAAC0G,kBADH;AAEXC,IAAAA,aAAa,EAAEzG,WAAW,CAAC0G,KAAZ,GAAoB,aAApB,GAAoC;AAFxC,GAJkB;AAQ/BX,EAAAA,YAAY,EAAE,EACZ,GAAGjG,UAAU,CAAC0G,kBADF;AAEZC,IAAAA,aAAa,EAAEzG,WAAW,CAAC0G,KAAZ,GAAoB,KAApB,GAA4B;AAF/B;AARiB,CAAlB,CAAf","sourcesContent":["// Similarily to the DrawerLayout component this deserves to be put in a\n// separate repo. Although, keeping it here for the time being will allow us to\n// move faster and fix possible issues quicker\n\nimport * as React from 'react';\nimport { Component } from 'react';\nimport {\n Animated,\n StyleSheet,\n View,\n I18nManager,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\n\nimport {\n GestureEvent,\n HandlerStateChangeEvent,\n} from '../handlers/gestureHandlerCommon';\nimport {\n PanGestureHandler,\n PanGestureHandlerProps,\n} from '../handlers/PanGestureHandler';\nimport {\n PanGestureHandlerEventPayload,\n TapGestureHandlerEventPayload,\n} from '../handlers/GestureHandlerEventPayload';\nimport { TapGestureHandler } from '../handlers/TapGestureHandler';\nimport { State } from '../State';\n\nconst DRAG_TOSS = 0.05;\n\ntype SwipeableExcludes = Exclude<\n keyof PanGestureHandlerProps,\n 'onGestureEvent' | 'onHandlerStateChange'\n>;\n\n// Animated.AnimatedInterpolation has been converted to a generic type\n// in @types/react-native 0.70. This way we can maintain compatibility\n// with all versions of @types/react-native\ntype AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;\n\nexport interface SwipeableProps\n extends Pick<PanGestureHandlerProps, SwipeableExcludes> {\n /**\n * Enables two-finger gestures on supported devices, for example iPads with\n * trackpads. If not enabled the gesture will require click + drag, with\n * `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger\n * the gesture.\n */\n enableTrackpadTwoFingerGesture?: boolean;\n\n /**\n * Specifies how much the visual interaction will be delayed compared to the\n * gesture distance. e.g. value of 1 will indicate that the swipeable panel\n * should exactly follow the gesture, 2 means it is going to be two times\n * \"slower\".\n */\n friction?: number;\n\n /**\n * Distance from the left edge at which released panel will animate to the\n * open state (or the open panel will animate into the closed state). By\n * default it's a half of the panel's width.\n */\n leftThreshold?: number;\n\n /**\n * Distance from the right edge at which released panel will animate to the\n * open state (or the open panel will animate into the closed state). By\n * default it's a half of the panel's width.\n */\n rightThreshold?: number;\n\n /**\n * Distance that the panel must be dragged from the left edge to be considered\n * a swipe. The default value is 10.\n */\n dragOffsetFromLeftEdge?: number;\n\n /**\n * Distance that the panel must be dragged from the right edge to be considered\n * a swipe. The default value is 10.\n */\n dragOffsetFromRightEdge?: number;\n\n /**\n * Value indicating if the swipeable panel can be pulled further than the left\n * actions panel's width. It is set to true by default as long as the left\n * panel render method is present.\n */\n overshootLeft?: boolean;\n\n /**\n * Value indicating if the swipeable panel can be pulled further than the\n * right actions panel's width. It is set to true by default as long as the\n * right panel render method is present.\n */\n overshootRight?: boolean;\n\n /**\n * Specifies how much the visual interaction will be delayed compared to the\n * gesture distance at overshoot. Default value is 1, it mean no friction, for\n * a native feel, try 8 or above.\n */\n overshootFriction?: number;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableOpen()\n *\n * Called when left action panel gets open.\n */\n onSwipeableLeftOpen?: () => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableOpen()\n *\n * Called when right action panel gets open.\n */\n onSwipeableRightOpen?: () => void;\n\n /**\n * Called when action panel gets open (either right or left).\n */\n onSwipeableOpen?: (direction: 'left' | 'right', swipeable: Swipeable) => void;\n\n /**\n * Called when action panel is closed.\n */\n onSwipeableClose?: (\n direction: 'left' | 'right',\n swipeable: Swipeable\n ) => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableWillOpen()\n *\n * Called when left action panel starts animating on open.\n */\n onSwipeableLeftWillOpen?: () => void;\n\n /**\n * @deprecated Use `direction` argument of onSwipeableWillOpen()\n *\n * Called when right action panel starts animating on open.\n */\n onSwipeableRightWillOpen?: () => void;\n\n /**\n * Called when action panel starts animating on open (either right or left).\n */\n onSwipeableWillOpen?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts animating on close.\n */\n onSwipeableWillClose?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts being shown on dragging to open.\n */\n onSwipeableOpenStartDrag?: (direction: 'left' | 'right') => void;\n\n /**\n * Called when action panel starts being shown on dragging to close.\n */\n onSwipeableCloseStartDrag?: (direction: 'left' | 'right') => void;\n\n /**\n *\n * This map describes the values to use as inputRange for extra interpolation:\n * AnimatedValue: [startValue, endValue]\n *\n * progressAnimatedValue: [0, 1] dragAnimatedValue: [0, +]\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderLeftActions?: (\n progressAnimatedValue: AnimatedInterpolation,\n dragAnimatedValue: AnimatedInterpolation,\n swipeable: Swipeable\n ) => React.ReactNode;\n /**\n *\n * This map describes the values to use as inputRange for extra interpolation:\n * AnimatedValue: [startValue, endValue]\n *\n * progressAnimatedValue: [0, 1] dragAnimatedValue: [0, -]\n *\n * To support `rtl` flexbox layouts use `flexDirection` styling.\n * */\n renderRightActions?: (\n progressAnimatedValue: AnimatedInterpolation,\n dragAnimatedValue: AnimatedInterpolation,\n swipeable: Swipeable\n ) => React.ReactNode;\n\n useNativeAnimations?: boolean;\n\n animationOptions?: Record<string, unknown>;\n\n /**\n * Style object for the container (`Animated.View`), for example to override\n * `overflow: 'hidden'`.\n */\n containerStyle?: StyleProp<ViewStyle>;\n\n /**\n * Style object for the children container (`Animated.View`), for example to\n * apply `flex: 1`\n */\n childrenContainerStyle?: StyleProp<ViewStyle>;\n}\n\ntype SwipeableState = {\n dragX: Animated.Value;\n rowTranslation: Animated.Value;\n rowState: number;\n leftWidth?: number;\n rightOffset?: number;\n rowWidth?: number;\n};\n\n/**\n * @deprecated use Reanimated version of Swipeable instead\n *\n * This component allows for implementing swipeable rows or similar interaction.\n */\n\nexport default class Swipeable extends Component<\n SwipeableProps,\n SwipeableState\n> {\n static defaultProps = {\n friction: 1,\n overshootFriction: 1,\n useNativeAnimations: true,\n };\n\n constructor(props: SwipeableProps) {\n super(props);\n const dragX = new Animated.Value(0);\n this.state = {\n dragX,\n rowTranslation: new Animated.Value(0),\n rowState: 0,\n leftWidth: undefined,\n rightOffset: undefined,\n rowWidth: undefined,\n };\n this.updateAnimatedEvent(props, this.state);\n\n this.onGestureEvent = Animated.event(\n [{ nativeEvent: { translationX: dragX } }],\n { useNativeDriver: props.useNativeAnimations! }\n );\n }\n\n shouldComponentUpdate(props: SwipeableProps, state: SwipeableState) {\n if (\n this.props.friction !== props.friction ||\n this.props.overshootLeft !== props.overshootLeft ||\n this.props.overshootRight !== props.overshootRight ||\n this.props.overshootFriction !== props.overshootFriction ||\n this.state.leftWidth !== state.leftWidth ||\n this.state.rightOffset !== state.rightOffset ||\n this.state.rowWidth !== state.rowWidth\n ) {\n this.updateAnimatedEvent(props, state);\n }\n\n return true;\n }\n\n private onGestureEvent?: (\n event: GestureEvent<PanGestureHandlerEventPayload>\n ) => void;\n private transX?: AnimatedInterpolation;\n private showLeftAction?: AnimatedInterpolation | Animated.Value;\n private leftActionTranslate?: AnimatedInterpolation;\n private showRightAction?: AnimatedInterpolation | Animated.Value;\n private rightActionTranslate?: AnimatedInterpolation;\n\n private updateAnimatedEvent = (\n props: SwipeableProps,\n state: SwipeableState\n ) => {\n const { friction, overshootFriction } = props;\n const { dragX, rowTranslation, leftWidth = 0, rowWidth = 0 } = state;\n const { rightOffset = rowWidth } = state;\n const rightWidth = Math.max(0, rowWidth - rightOffset);\n\n const { overshootLeft = leftWidth > 0, overshootRight = rightWidth > 0 } =\n props;\n\n const transX = Animated.add(\n rowTranslation,\n dragX.interpolate({\n inputRange: [0, friction!],\n outputRange: [0, 1],\n })\n ).interpolate({\n inputRange: [-rightWidth - 1, -rightWidth, leftWidth, leftWidth + 1],\n outputRange: [\n -rightWidth - (overshootRight ? 1 / overshootFriction! : 0),\n -rightWidth,\n leftWidth,\n leftWidth + (overshootLeft ? 1 / overshootFriction! : 0),\n ],\n });\n this.transX = transX;\n this.showLeftAction =\n leftWidth > 0\n ? transX.interpolate({\n inputRange: [-1, 0, leftWidth],\n outputRange: [0, 0, 1],\n })\n : new Animated.Value(0);\n this.leftActionTranslate = this.showLeftAction.interpolate({\n inputRange: [0, Number.MIN_VALUE],\n outputRange: [-10000, 0],\n extrapolate: 'clamp',\n });\n this.showRightAction =\n rightWidth > 0\n ? transX.interpolate({\n inputRange: [-rightWidth, 0, 1],\n outputRange: [1, 0, 0],\n })\n : new Animated.Value(0);\n this.rightActionTranslate = this.showRightAction.interpolate({\n inputRange: [0, Number.MIN_VALUE],\n outputRange: [-10000, 0],\n extrapolate: 'clamp',\n });\n };\n\n private onTapHandlerStateChange = ({\n nativeEvent,\n }: HandlerStateChangeEvent<TapGestureHandlerEventPayload>) => {\n if (nativeEvent.oldState === State.ACTIVE) {\n this.close();\n }\n };\n\n private onHandlerStateChange = (\n ev: HandlerStateChangeEvent<PanGestureHandlerEventPayload>\n ) => {\n if (ev.nativeEvent.oldState === State.ACTIVE) {\n this.handleRelease(ev);\n }\n\n if (ev.nativeEvent.state === State.ACTIVE) {\n const { velocityX, translationX: dragX } = ev.nativeEvent;\n const { rowState } = this.state;\n const { friction } = this.props;\n\n const translationX = (dragX + DRAG_TOSS * velocityX) / friction!;\n\n const direction =\n rowState === -1\n ? 'right'\n : rowState === 1\n ? 'left'\n : translationX > 0\n ? 'left'\n : 'right';\n\n if (rowState === 0) {\n this.props.onSwipeableOpenStartDrag?.(direction);\n } else {\n this.props.onSwipeableCloseStartDrag?.(direction);\n }\n }\n };\n\n private handleRelease = (\n ev: HandlerStateChangeEvent<PanGestureHandlerEventPayload>\n ) => {\n const { velocityX, translationX: dragX } = ev.nativeEvent;\n const { leftWidth = 0, rowWidth = 0, rowState } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n const {\n friction,\n leftThreshold = leftWidth / 2,\n rightThreshold = rightWidth / 2,\n } = this.props;\n\n const startOffsetX = this.currentOffset() + dragX / friction!;\n const translationX = (dragX + DRAG_TOSS * velocityX) / friction!;\n\n let toValue = 0;\n if (rowState === 0) {\n if (translationX > leftThreshold) {\n toValue = leftWidth;\n } else if (translationX < -rightThreshold) {\n toValue = -rightWidth;\n }\n } else if (rowState === 1) {\n // Swiped to left\n if (translationX > -leftThreshold) {\n toValue = leftWidth;\n }\n } else {\n // Swiped to right\n if (translationX < rightThreshold) {\n toValue = -rightWidth;\n }\n }\n\n this.animateRow(startOffsetX, toValue, velocityX / friction!);\n };\n\n private animateRow = (\n fromValue: number,\n toValue: number,\n velocityX?:\n | number\n | {\n x: number;\n y: number;\n }\n ) => {\n const { dragX, rowTranslation } = this.state;\n dragX.setValue(0);\n rowTranslation.setValue(fromValue);\n\n this.setState({ rowState: Math.sign(toValue) });\n Animated.spring(rowTranslation, {\n restSpeedThreshold: 1.7,\n restDisplacementThreshold: 0.4,\n velocity: velocityX,\n bounciness: 0,\n toValue,\n useNativeDriver: this.props.useNativeAnimations!,\n ...this.props.animationOptions,\n }).start(({ finished }) => {\n if (finished) {\n if (toValue > 0) {\n this.props.onSwipeableLeftOpen?.();\n this.props.onSwipeableOpen?.('left', this);\n } else if (toValue < 0) {\n this.props.onSwipeableRightOpen?.();\n this.props.onSwipeableOpen?.('right', this);\n } else {\n const closingDirection = fromValue > 0 ? 'left' : 'right';\n this.props.onSwipeableClose?.(closingDirection, this);\n }\n }\n });\n if (toValue > 0) {\n this.props.onSwipeableLeftWillOpen?.();\n this.props.onSwipeableWillOpen?.('left');\n } else if (toValue < 0) {\n this.props.onSwipeableRightWillOpen?.();\n this.props.onSwipeableWillOpen?.('right');\n } else {\n const closingDirection = fromValue > 0 ? 'left' : 'right';\n this.props.onSwipeableWillClose?.(closingDirection);\n }\n };\n\n private onRowLayout = ({ nativeEvent }: LayoutChangeEvent) => {\n this.setState({ rowWidth: nativeEvent.layout.width });\n };\n\n private currentOffset = () => {\n const { leftWidth = 0, rowWidth = 0, rowState } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n if (rowState === 1) {\n return leftWidth;\n } else if (rowState === -1) {\n return -rightWidth;\n }\n return 0;\n };\n\n close = () => {\n this.animateRow(this.currentOffset(), 0);\n };\n\n openLeft = () => {\n const { leftWidth = 0 } = this.state;\n this.animateRow(this.currentOffset(), leftWidth);\n };\n\n openRight = () => {\n const { rowWidth = 0 } = this.state;\n const { rightOffset = rowWidth } = this.state;\n const rightWidth = rowWidth - rightOffset;\n this.animateRow(this.currentOffset(), -rightWidth);\n };\n\n reset = () => {\n const { dragX, rowTranslation } = this.state;\n dragX.setValue(0);\n rowTranslation.setValue(0);\n this.setState({ rowState: 0 });\n };\n\n render() {\n const { rowState } = this.state;\n const {\n children,\n renderLeftActions,\n renderRightActions,\n dragOffsetFromLeftEdge = 10,\n dragOffsetFromRightEdge = 10,\n } = this.props;\n\n const left = renderLeftActions && (\n <Animated.View\n style={[\n styles.leftActions,\n // All those and below parameters can have ! since they are all\n // asigned in constructor in `updateAnimatedEvent` but TS cannot spot\n // it for some reason\n { transform: [{ translateX: this.leftActionTranslate! }] },\n ]}>\n {renderLeftActions(this.showLeftAction!, this.transX!, this)}\n <View\n onLayout={({ nativeEvent }) =>\n this.setState({ leftWidth: nativeEvent.layout.x })\n }\n />\n </Animated.View>\n );\n\n const right = renderRightActions && (\n <Animated.View\n style={[\n styles.rightActions,\n { transform: [{ translateX: this.rightActionTranslate! }] },\n ]}>\n {renderRightActions(this.showRightAction!, this.transX!, this)}\n <View\n onLayout={({ nativeEvent }) =>\n this.setState({ rightOffset: nativeEvent.layout.x })\n }\n />\n </Animated.View>\n );\n\n return (\n <PanGestureHandler\n activeOffsetX={[-dragOffsetFromRightEdge, dragOffsetFromLeftEdge]}\n touchAction=\"pan-y\"\n {...this.props}\n onGestureEvent={this.onGestureEvent}\n onHandlerStateChange={this.onHandlerStateChange}>\n <Animated.View\n onLayout={this.onRowLayout}\n style={[styles.container, this.props.containerStyle]}>\n {left}\n {right}\n <TapGestureHandler\n enabled={rowState !== 0}\n touchAction=\"pan-y\"\n onHandlerStateChange={this.onTapHandlerStateChange}>\n <Animated.View\n pointerEvents={rowState === 0 ? 'auto' : 'box-only'}\n style={[\n {\n transform: [{ translateX: this.transX! }],\n },\n this.props.childrenContainerStyle,\n ]}>\n {children}\n </Animated.View>\n </TapGestureHandler>\n </Animated.View>\n </PanGestureHandler>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n },\n leftActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row',\n },\n rightActions: {\n ...StyleSheet.absoluteFillObject,\n flexDirection: I18nManager.isRTL ? 'row' : 'row-reverse',\n },\n});\n"]}
|
@@ -1,53 +0,0 @@
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
-
|
3
|
-
import React, { forwardRef, useEffect, useRef } from 'react';
|
4
|
-
import { Platform, Text as RNText } from 'react-native';
|
5
|
-
import { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';
|
6
|
-
import { GestureDetector } from '../handlers/gestures/GestureDetector';
|
7
|
-
export const Text = /*#__PURE__*/forwardRef((props, ref) => {
|
8
|
-
const {
|
9
|
-
onPress,
|
10
|
-
onLongPress,
|
11
|
-
...rest
|
12
|
-
} = props;
|
13
|
-
const textRef = useRef(null);
|
14
|
-
const native = Gesture.Native().runOnJS(true);
|
15
|
-
|
16
|
-
const refHandler = node => {
|
17
|
-
textRef.current = node;
|
18
|
-
|
19
|
-
if (ref === null) {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
|
23
|
-
if (typeof ref === 'function') {
|
24
|
-
ref(node);
|
25
|
-
} else {
|
26
|
-
ref.current = node;
|
27
|
-
}
|
28
|
-
}; // This is a special case for `Text` component. After https://github.com/software-mansion/react-native-gesture-handler/pull/3379 we check for
|
29
|
-
// `displayName` field. However, `Text` from RN has this field set to `Text`, but is also present in `RNSVGElements` set.
|
30
|
-
// We don't want to treat our `Text` as the one from `SVG`, therefore we add special field to ref.
|
31
|
-
|
32
|
-
|
33
|
-
refHandler.rngh = true;
|
34
|
-
useEffect(() => {
|
35
|
-
if (Platform.OS !== 'web') {
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
|
39
|
-
const textElement = ref ? ref.current : textRef.current; // At this point we are sure that textElement is div in HTML tree
|
40
|
-
|
41
|
-
textElement === null || textElement === void 0 ? void 0 : textElement.setAttribute('rnghtext', 'true');
|
42
|
-
}, []);
|
43
|
-
return onPress || onLongPress ? /*#__PURE__*/React.createElement(GestureDetector, {
|
44
|
-
gesture: native
|
45
|
-
}, /*#__PURE__*/React.createElement(RNText, _extends({
|
46
|
-
onPress: onPress,
|
47
|
-
onLongPress: onLongPress,
|
48
|
-
ref: refHandler
|
49
|
-
}, rest))) : /*#__PURE__*/React.createElement(RNText, _extends({
|
50
|
-
ref: ref
|
51
|
-
}, rest));
|
52
|
-
}); // eslint-disable-next-line @typescript-eslint/no-redeclare
|
53
|
-
//# sourceMappingURL=Text.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["Text.tsx"],"names":["React","forwardRef","useEffect","useRef","Platform","Text","RNText","GestureObjects","Gesture","GestureDetector","props","ref","onPress","onLongPress","rest","textRef","native","Native","runOnJS","refHandler","node","current","rngh","OS","textElement","setAttribute"],"mappings":";;AAAA,OAAOA,KAAP,IAEEC,UAFF,EAIEC,SAJF,EAKEC,MALF,QAMO,OANP;AAOA,SACEC,QADF,EAEEC,IAAI,IAAIC,MAFV,QAIO,cAJP;AAMA,SAASC,cAAc,IAAIC,OAA3B,QAA0C,qCAA1C;AACA,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,CADK,gBAUL,oBAAC,MAAD;AAAQ,IAAA,GAAG,EAAEH;AAAb,KAAsBG,IAAtB,EAVF;AAYD,CAtD2B,CAAvB,C,CAwDP","sourcesContent":["import React, {\n ForwardedRef,\n forwardRef,\n RefObject,\n useEffect,\n useRef,\n} from 'react';\nimport {\n Platform,\n Text as RNText,\n TextProps as RNTextProps,\n} from 'react-native';\n\nimport { GestureObjects as Gesture } from '../handlers/gestures/gestureObjects';\nimport { GestureDetector } from '../handlers/gestures/GestureDetector';\n\nexport const Text = forwardRef(\n (props: RNTextProps, ref: ForwardedRef<RNText>) => {\n const { onPress, onLongPress, ...rest } = props;\n\n const textRef = useRef<RNText | null>(null);\n const native = Gesture.Native().runOnJS(true);\n\n const refHandler = (node: any) => {\n textRef.current = node;\n\n if (ref === null) {\n return;\n }\n\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n };\n\n // This is a special case for `Text` component. After https://github.com/software-mansion/react-native-gesture-handler/pull/3379 we check for\n // `displayName` field. However, `Text` from RN has this field set to `Text`, but is also present in `RNSVGElements` set.\n // We don't want to treat our `Text` as the one from `SVG`, therefore we add special field to ref.\n refHandler.rngh = true;\n\n useEffect(() => {\n if (Platform.OS !== 'web') {\n return;\n }\n\n const textElement = ref\n ? (ref as RefObject<RNText>).current\n : textRef.current;\n\n // At this point we are sure that textElement is div in HTML tree\n (textElement as unknown as HTMLDivElement)?.setAttribute(\n 'rnghtext',\n 'true'\n );\n }, []);\n\n return onPress || onLongPress ? (\n <GestureDetector gesture={native}>\n <RNText\n onPress={onPress}\n onLongPress={onLongPress}\n ref={refHandler}\n {...rest}\n />\n </GestureDetector>\n ) : (\n <RNText ref={ref} {...rest} />\n );\n }\n);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Text = typeof Text & RNText;\n"]}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { StyleSheet } from 'react-native';
|
3
|
-
import hoistNonReactStatics from 'hoist-non-react-statics';
|
4
|
-
import GestureHandlerRootView from './GestureHandlerRootView';
|
5
|
-
export default function gestureHandlerRootHOC(Component, containerStyles) {
|
6
|
-
function Wrapper(props) {
|
7
|
-
return /*#__PURE__*/React.createElement(GestureHandlerRootView, {
|
8
|
-
style: [styles.container, containerStyles]
|
9
|
-
}, /*#__PURE__*/React.createElement(Component, props));
|
10
|
-
}
|
11
|
-
|
12
|
-
Wrapper.displayName = `gestureHandlerRootHOC(${Component.displayName || Component.name})`; // @ts-ignore - hoistNonReactStatics uses old version of @types/react
|
13
|
-
|
14
|
-
hoistNonReactStatics(Wrapper, Component);
|
15
|
-
return Wrapper;
|
16
|
-
}
|
17
|
-
const styles = StyleSheet.create({
|
18
|
-
container: {
|
19
|
-
flex: 1
|
20
|
-
}
|
21
|
-
});
|
22
|
-
//# sourceMappingURL=gestureHandlerRootHOC.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["gestureHandlerRootHOC.tsx"],"names":["React","StyleSheet","hoistNonReactStatics","GestureHandlerRootView","gestureHandlerRootHOC","Component","containerStyles","Wrapper","props","styles","container","displayName","name","create","flex"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,QAAiD,cAAjD;AACA,OAAOC,oBAAP,MAAiC,yBAAjC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AAEA,eAAe,SAASC,qBAAT,CACbC,SADa,EAEbC,eAFa,EAGW;AACxB,WAASC,OAAT,CAAiBC,KAAjB,EAA2B;AACzB,wBACE,oBAAC,sBAAD;AAAwB,MAAA,KAAK,EAAE,CAACC,MAAM,CAACC,SAAR,EAAmBJ,eAAnB;AAA/B,oBACE,oBAAC,SAAD,EAAeE,KAAf,CADF,CADF;AAKD;;AAEDD,EAAAA,OAAO,CAACI,WAAR,GAAuB,yBACrBN,SAAS,CAACM,WAAV,IAAyBN,SAAS,CAACO,IACpC,GAFD,CATwB,CAaxB;;AACAV,EAAAA,oBAAoB,CAACK,OAAD,EAAUF,SAAV,CAApB;AAEA,SAAOE,OAAP;AACD;AAED,MAAME,MAAM,GAAGR,UAAU,CAACY,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AAAEI,IAAAA,IAAI,EAAE;AAAR;AADoB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { StyleSheet, StyleProp, ViewStyle } from 'react-native';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport GestureHandlerRootView from './GestureHandlerRootView';\n\nexport default function gestureHandlerRootHOC<P extends object>(\n Component: React.ComponentType<P>,\n containerStyles?: StyleProp<ViewStyle>\n): React.ComponentType<P> {\n function Wrapper(props: P) {\n return (\n <GestureHandlerRootView style={[styles.container, containerStyles]}>\n <Component {...props} />\n </GestureHandlerRootView>\n );\n }\n\n Wrapper.displayName = `gestureHandlerRootHOC(${\n Component.displayName || Component.name\n })`;\n\n // @ts-ignore - hoistNonReactStatics uses old version of @types/react\n hoistNonReactStatics(Wrapper, Component);\n\n return Wrapper;\n}\n\nconst styles = StyleSheet.create({\n container: { flex: 1 },\n});\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|