react-native-gesture-handler 2.22.1 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNGestureHandler.podspec +8 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +14 -0
- package/android/src/main/jni/cpp-adapter.cpp +19 -12
- package/apple/RNGestureHandler.mm +15 -8
- package/apple/RNGestureHandlerButton.mm +12 -2
- package/apple/RNGestureHandlerModule.mm +17 -5
- package/lib/commonjs/RNGestureHandlerModule.web.js +2 -2
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js +6 -0
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureButtons.js +11 -2
- package/lib/commonjs/components/GestureButtons.js.map +1 -1
- package/lib/commonjs/components/Pressable/Pressable.js +21 -5
- package/lib/commonjs/components/Pressable/Pressable.js.map +1 -1
- package/lib/commonjs/components/Pressable/index.js.map +1 -1
- package/lib/commonjs/components/ReanimatedSwipeable.js +49 -20
- package/lib/commonjs/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/commonjs/components/Text.js +10 -4
- package/lib/commonjs/components/Text.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableHighlight.js +2 -0
- package/lib/commonjs/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +2 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js +5 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +2 -0
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +3 -0
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/findNodeHandle.web.js +9 -1
- package/lib/commonjs/findNodeHandle.web.js.map +1 -1
- package/lib/commonjs/handlers/FlingGestureHandler.js +8 -0
- package/lib/commonjs/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js +5 -1
- package/lib/commonjs/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js +8 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +8 -0
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +8 -0
- package/lib/commonjs/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/PinchGestureHandler.js +8 -0
- package/lib/commonjs/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/RotationGestureHandler.js +8 -0
- package/lib/commonjs/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +8 -0
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +6 -2
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js +2 -2
- package/lib/commonjs/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/commonjs/handlers/handlersRegistry.js +7 -2
- package/lib/commonjs/handlers/handlersRegistry.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +3 -3
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +22 -22
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +24 -24
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +6 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +112 -92
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/HoverGestureHandler.js +2 -2
- package/lib/commonjs/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +6 -6
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +13 -13
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +15 -15
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +15 -15
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +12 -12
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +4 -4
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +15 -15
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +40 -40
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js +32 -13
- package/lib/commonjs/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +16 -18
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js +2 -2
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +18 -18
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/Vector.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +2 -2
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/components/DrawerLayout.js +7 -0
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureButtons.js +10 -2
- package/lib/module/components/GestureButtons.js.map +1 -1
- package/lib/module/components/Pressable/Pressable.js +22 -6
- package/lib/module/components/Pressable/Pressable.js.map +1 -1
- package/lib/module/components/Pressable/index.js.map +1 -1
- package/lib/module/components/ReanimatedSwipeable.js +49 -20
- package/lib/module/components/ReanimatedSwipeable.js.map +1 -1
- package/lib/module/components/Text.js +8 -3
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/touchables/TouchableHighlight.js +2 -0
- package/lib/module/components/touchables/TouchableHighlight.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +2 -0
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js +6 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.js.map +1 -1
- package/lib/module/components/touchables/TouchableOpacity.js +5 -0
- package/lib/module/components/touchables/TouchableOpacity.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +4 -0
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/findNodeHandle.web.js +8 -1
- package/lib/module/findNodeHandle.web.js.map +1 -1
- package/lib/module/handlers/FlingGestureHandler.js +7 -0
- package/lib/module/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js +5 -1
- package/lib/module/handlers/ForceTouchGestureHandler.js.map +1 -1
- package/lib/module/handlers/LongPressGestureHandler.js +7 -0
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +7 -0
- package/lib/module/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/handlers/PanGestureHandler.js +7 -0
- package/lib/module/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/handlers/PinchGestureHandler.js +11 -0
- package/lib/module/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/handlers/RotationGestureHandler.js +11 -0
- package/lib/module/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +7 -0
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +9 -4
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/index.js +2 -2
- package/lib/module/handlers/gestures/GestureDetector/index.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js +2 -2
- package/lib/module/handlers/gestures/GestureDetector/useViewRefHandler.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector/utils.js +2 -2
- package/lib/module/handlers/gestures/GestureDetector/utils.js.map +1 -1
- package/lib/module/handlers/handlersRegistry.js +6 -3
- package/lib/module/handlers/handlersRegistry.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +2 -2
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +22 -22
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +24 -24
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +6 -6
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +112 -92
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/HoverGestureHandler.js +2 -2
- package/lib/module/web/handlers/HoverGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +6 -6
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +13 -13
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +15 -15
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +15 -15
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +12 -12
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +4 -4
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +15 -15
- package/lib/module/web/tools/CircularBuffer.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +40 -40
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerWebDelegate.js +32 -13
- package/lib/module/web/tools/GestureHandlerWebDelegate.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +16 -16
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js +2 -2
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +18 -18
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/Vector.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +1 -1
- package/lib/module/web/tools/VelocityTracker.js.map +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +27 -0
- package/lib/typescript/components/GestureButtonsProps.d.ts +18 -2
- package/lib/typescript/components/Pressable/PressableProps.d.ts +3 -10
- package/lib/typescript/components/Pressable/index.d.ts +1 -1
- package/lib/typescript/components/ReanimatedSwipeable.d.ts +6 -0
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +2 -0
- package/lib/typescript/components/touchables/TouchableNativeFeedback.d.ts +5 -1
- package/lib/typescript/components/touchables/TouchableNativeFeedbackProps.d.ts +3 -0
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +5 -0
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +6 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PanGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/TapGestureHandler.d.ts +9 -0
- package/lib/typescript/handlers/handlersRegistry.d.ts +1 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -1
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +8 -8
- package/lib/typescript/web/handlers/GestureHandler.d.ts +33 -28
- package/lib/typescript/web/handlers/IGestureHandler.d.ts +12 -13
- package/lib/typescript/web/tools/CircularBuffer.d.ts +3 -3
- package/lib/typescript/web/tools/GestureHandlerDelegate.d.ts +1 -1
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +2 -2
- package/lib/typescript/web/tools/GestureHandlerWebDelegate.d.ts +3 -2
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -2
- package/lib/typescript/web/tools/NodeManager.d.ts +1 -1
- package/lib/typescript/web/tools/PointerTracker.d.ts +4 -4
- package/lib/typescript/web/tools/VelocityTracker.d.ts +1 -1
- package/package.json +2 -2
- package/src/RNGestureHandlerModule.web.ts +2 -2
- package/src/components/DrawerLayout.tsx +29 -0
- package/src/components/GestureButtons.tsx +13 -2
- package/src/components/GestureButtonsProps.ts +31 -2
- package/src/components/Pressable/Pressable.tsx +22 -5
- package/src/components/Pressable/PressableProps.tsx +4 -11
- package/src/components/Pressable/index.ts +4 -1
- package/src/components/ReanimatedSwipeable.tsx +97 -66
- package/src/components/Text.tsx +13 -4
- package/src/components/touchables/TouchableHighlight.tsx +5 -0
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -0
- package/src/components/touchables/TouchableNativeFeedback.tsx +6 -1
- package/src/components/touchables/TouchableNativeFeedbackProps.tsx +3 -0
- package/src/components/touchables/TouchableOpacity.tsx +5 -0
- package/src/components/touchables/TouchableWithoutFeedback.tsx +6 -0
- package/src/findNodeHandle.web.ts +6 -0
- package/src/handlers/FlingGestureHandler.ts +10 -0
- package/src/handlers/ForceTouchGestureHandler.ts +9 -0
- package/src/handlers/LongPressGestureHandler.ts +10 -0
- package/src/handlers/NativeViewGestureHandler.ts +10 -0
- package/src/handlers/PanGestureHandler.ts +10 -0
- package/src/handlers/PinchGestureHandler.ts +10 -0
- package/src/handlers/RotationGestureHandler.ts +10 -0
- package/src/handlers/TapGestureHandler.ts +10 -0
- package/src/handlers/createHandler.tsx +11 -4
- package/src/handlers/gestures/GestureDetector/index.tsx +2 -2
- package/src/handlers/gestures/GestureDetector/useViewRefHandler.ts +3 -3
- package/src/handlers/gestures/GestureDetector/utils.ts +2 -2
- package/src/handlers/handlersRegistry.ts +7 -3
- package/src/index.ts +4 -1
- package/src/utils.ts +2 -2
- package/src/web/detectors/RotationGestureDetector.ts +22 -22
- package/src/web/detectors/ScaleGestureDetector.ts +24 -24
- package/src/web/handlers/FlingGestureHandler.ts +6 -7
- package/src/web/handlers/GestureHandler.ts +115 -105
- package/src/web/handlers/HoverGestureHandler.ts +2 -2
- package/src/web/handlers/IGestureHandler.ts +12 -13
- package/src/web/handlers/LongPressGestureHandler.ts +7 -7
- package/src/web/handlers/NativeViewGestureHandler.ts +14 -19
- package/src/web/handlers/PanGestureHandler.ts +17 -17
- package/src/web/handlers/PinchGestureHandler.ts +17 -21
- package/src/web/handlers/RotationGestureHandler.ts +12 -12
- package/src/web/handlers/TapGestureHandler.ts +4 -6
- package/src/web/tools/CircularBuffer.ts +15 -15
- package/src/web/tools/GestureHandlerDelegate.ts +1 -1
- package/src/web/tools/GestureHandlerOrchestrator.ts +42 -42
- package/src/web/tools/GestureHandlerWebDelegate.ts +32 -13
- package/src/web/tools/InteractionManager.ts +16 -16
- package/src/web/tools/NodeManager.ts +2 -2
- package/src/web/tools/PointerTracker.ts +20 -20
- package/src/web/tools/Vector.ts +1 -1
- package/src/web/tools/VelocityTracker.ts +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["TouchableNativeFeedback.android.tsx"],"names":["TouchableNativeFeedback","Component","getExtraButtonProps","extraProps","background","props","type","borderless","color","attribute","rippleRadius","useForeground","render","style","rest","GenericTouchable","defaultProps","extraButtonProps","rippleColor","Platform","OS","Version"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMA,uBAAN,SAAsCC,eAAtC,CAA8E;AAU3F;AA0BAC,EAAAA,mBAAmB,GAAG;AACpB,UAAMC,UAA6C,GAAG,EAAtD;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAiB,KAAKC,KAA5B;;AACA,QAAID,UAAJ,EAAgB;AACd;AACA;AACA,UAAIA,UAAU,CAACE,IAAX,KAAoB,eAAxB,EAAyC;AACvCH,QAAAA,UAAU,CAAC,YAAD,CAAV,GAA2BC,UAAU,CAACG,UAAtC;AACAJ,QAAAA,UAAU,CAAC,aAAD,CAAV,GAA4BC,UAAU,CAACI,KAAvC;AACD,OAHD,MAGO,IAAIJ,UAAU,CAACE,IAAX,KAAoB,kBA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import { Platform, ColorValue } from 'react-native';\nimport * as React from 'react';\nimport { Component } from 'react';\nimport GenericTouchable from './GenericTouchable';\nimport {\n TouchableNativeFeedbackProps,\n TouchableNativeFeedbackExtraProps,\n} from './TouchableNativeFeedbackProps';\n\n/**\n * TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.\n * There's small difference with handling long press ripple since RN's implementation calls\n * ripple animation via bridge. This solution leaves all animations' handling for native components so\n * it follows native behaviours.\n */\nexport default class TouchableNativeFeedback extends Component<TouchableNativeFeedbackProps> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n useForeground: true,\n extraButtonProps: {\n // Disable hiding ripple on Android\n rippleColor: null,\n },\n };\n\n // Could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change\n static SelectableBackground = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n // I added `attribute` prop to clone the implementation of RN and be able to use only 2 types\n attribute: 'selectableItemBackground',\n rippleRadius,\n });\n static SelectableBackgroundBorderless = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n attribute: 'selectableItemBackgroundBorderless',\n rippleRadius,\n });\n static Ripple = (\n color: ColorValue,\n borderless: boolean,\n rippleRadius?: number\n ) => ({\n type: 'RippleAndroid',\n color,\n borderless,\n rippleRadius,\n });\n\n static canUseNativeForeground = () =>\n Platform.OS === 'android' && Platform.Version >= 23;\n\n getExtraButtonProps() {\n const extraProps: TouchableNativeFeedbackExtraProps = {};\n const { background } = this.props;\n if (background) {\n // I changed type values to match those used in RN\n // TODO(TS): check if it works the same as previous implementation - looks like it works the same as RN component, so it should be ok\n if (background.type === 'RippleAndroid') {\n extraProps['borderless'] = background.borderless;\n extraProps['rippleColor'] = background.color;\n } else if (background.type === 'ThemeAttrAndroid') {\n extraProps['borderless'] =\n background.attribute === 'selectableItemBackgroundBorderless';\n }\n // I moved it from above since it should be available in all options\n extraProps['rippleRadius'] = background.rippleRadius;\n }\n extraProps['foreground'] = this.props.useForeground;\n return extraProps;\n }\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n <GenericTouchable\n {...rest}\n style={style}\n extraButtonProps={this.getExtraButtonProps()}\n />\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["TouchableNativeFeedback.android.tsx"],"names":["TouchableNativeFeedback","Component","getExtraButtonProps","extraProps","background","props","type","borderless","color","attribute","rippleRadius","useForeground","render","style","rest","GenericTouchable","defaultProps","extraButtonProps","rippleColor","Platform","OS","Version"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMA,uBAAN,SAAsCC,eAAtC,CAA8E;AAU3F;AA0BAC,EAAAA,mBAAmB,GAAG;AACpB,UAAMC,UAA6C,GAAG,EAAtD;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAiB,KAAKC,KAA5B;;AACA,QAAID,UAAJ,EAAgB;AACd;AACA;AACA,UAAIA,UAAU,CAACE,IAAX,KAAoB,eAAxB,EAAyC;AACvCH,QAAAA,UAAU,CAAC,YAAD,CAAV,GAA2BC,UAAU,CAACG,UAAtC;AACAJ,QAAAA,UAAU,CAAC,aAAD,CAAV,GAA4BC,UAAU,CAACI,KAAvC;AACD,OAHD,MAGO,IAAIJ,UAAU,CAACE,IAAX,KAAoB,kBAAxB,EAA4C;AACjDH,QAAAA,UAAU,CAAC,YAAD,CAAV,GACEC,UAAU,CAACK,SAAX,KAAyB,oCAD3B;AAED,OATa,CAUd;;;AACAN,MAAAA,UAAU,CAAC,cAAD,CAAV,GAA6BC,UAAU,CAACM,YAAxC;AACD;;AACDP,IAAAA,UAAU,CAAC,YAAD,CAAV,GAA2B,KAAKE,KAAL,CAAWM,aAAtC;AACA,WAAOR,UAAP;AACD;;AACDS,EAAAA,MAAM,GAAG;AACP,UAAM;AAAEC,MAAAA,KAAK,GAAG,EAAV;AAAc,SAAGC;AAAjB,QAA0B,KAAKT,KAArC;AACA,wBACE,oBAAC,yBAAD,eACMS,IADN;AAEE,MAAA,KAAK,EAAED,KAFT;AAGE,MAAA,gBAAgB,EAAE,KAAKX,mBAAL;AAHpB,OADF;AAOD;;AAhE0F;;;;gBAAxEF,uB,kBACG,EACpB,GAAGe,0BAAiBC,YADA;AAEpBL,EAAAA,aAAa,EAAE,IAFK;AAGpBM,EAAAA,gBAAgB,EAAE;AAChB;AACAC,IAAAA,WAAW,EAAE;AAFG;AAHE,C;;gBADHlB,uB,0BAWYU,YAAD,KAA4B;AACxDJ,EAAAA,IAAI,EAAE,kBADkD;AAExD;AACAG,EAAAA,SAAS,EAAE,0BAH6C;AAIxDC,EAAAA;AAJwD,CAA5B,C;;gBAXXV,uB,oCAiBsBU,YAAD,KAA4B;AAClEJ,EAAAA,IAAI,EAAE,kBAD4D;AAElEG,EAAAA,SAAS,EAAE,oCAFuD;AAGlEC,EAAAA;AAHkE,CAA5B,C;;gBAjBrBV,uB,YAsBH,CACdQ,KADc,EAEdD,UAFc,EAGdG,YAHc,MAIV;AACJJ,EAAAA,IAAI,EAAE,eADF;AAEJE,EAAAA,KAFI;AAGJD,EAAAA,UAHI;AAIJG,EAAAA;AAJI,CAJU,C;;gBAtBGV,uB,4BAiCa,MAC9BmB,sBAASC,EAAT,KAAgB,SAAhB,IAA6BD,sBAASE,OAAT,IAAoB,E","sourcesContent":["import { Platform, ColorValue } from 'react-native';\nimport * as React from 'react';\nimport { Component } from 'react';\nimport GenericTouchable from './GenericTouchable';\nimport {\n TouchableNativeFeedbackProps,\n TouchableNativeFeedbackExtraProps,\n} from './TouchableNativeFeedbackProps';\n\n/**\n * @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.\n *\n * TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.\n * There's small difference with handling long press ripple since RN's implementation calls\n * ripple animation via bridge. This solution leaves all animations' handling for native components so\n * it follows native behaviours.\n */\nexport default class TouchableNativeFeedback extends Component<TouchableNativeFeedbackProps> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n useForeground: true,\n extraButtonProps: {\n // Disable hiding ripple on Android\n rippleColor: null,\n },\n };\n\n // Could be taken as RNTouchableNativeFeedback.SelectableBackground etc. but the API may change\n static SelectableBackground = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n // I added `attribute` prop to clone the implementation of RN and be able to use only 2 types\n attribute: 'selectableItemBackground',\n rippleRadius,\n });\n static SelectableBackgroundBorderless = (rippleRadius?: number) => ({\n type: 'ThemeAttrAndroid',\n attribute: 'selectableItemBackgroundBorderless',\n rippleRadius,\n });\n static Ripple = (\n color: ColorValue,\n borderless: boolean,\n rippleRadius?: number\n ) => ({\n type: 'RippleAndroid',\n color,\n borderless,\n rippleRadius,\n });\n\n static canUseNativeForeground = () =>\n Platform.OS === 'android' && Platform.Version >= 23;\n\n getExtraButtonProps() {\n const extraProps: TouchableNativeFeedbackExtraProps = {};\n const { background } = this.props;\n if (background) {\n // I changed type values to match those used in RN\n // TODO(TS): check if it works the same as previous implementation - looks like it works the same as RN component, so it should be ok\n if (background.type === 'RippleAndroid') {\n extraProps['borderless'] = background.borderless;\n extraProps['rippleColor'] = background.color;\n } else if (background.type === 'ThemeAttrAndroid') {\n extraProps['borderless'] =\n background.attribute === 'selectableItemBackgroundBorderless';\n }\n // I moved it from above since it should be available in all options\n extraProps['rippleRadius'] = background.rippleRadius;\n }\n extraProps['foreground'] = this.props.useForeground;\n return extraProps;\n }\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n <GenericTouchable\n {...rest}\n style={style}\n extraButtonProps={this.getExtraButtonProps()}\n />\n );\n }\n}\n"]}
|
@@ -7,6 +7,10 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _reactNative = require("react-native");
|
9
9
|
|
10
|
-
|
10
|
+
/**
|
11
|
+
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
12
|
+
*/
|
13
|
+
const TouchableNativeFeedback = _reactNative.TouchableNativeFeedback;
|
14
|
+
var _default = TouchableNativeFeedback;
|
11
15
|
exports.default = _default;
|
12
16
|
//# sourceMappingURL=TouchableNativeFeedback.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["TouchableNativeFeedback.tsx"],"names":["TouchableNativeFeedback"],"mappings":";;;;;;;AAAA;;
|
1
|
+
{"version":3,"sources":["TouchableNativeFeedback.tsx"],"names":["TouchableNativeFeedback","RNTouchableNativeFeedback"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACA,MAAMA,uBAAuB,GAAGC,oCAAhC;eAEeD,uB","sourcesContent":["import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';\n\n/**\n * @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.\n */\nconst TouchableNativeFeedback = RNTouchableNativeFeedback;\n\nexport default TouchableNativeFeedback;\n"]}
|
@@ -20,6 +20,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
20
20
|
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; }
|
21
21
|
|
22
22
|
/**
|
23
|
+
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
|
24
|
+
*
|
23
25
|
* TouchableOpacity bases on timing animation which has been used in RN's core
|
24
26
|
*/
|
25
27
|
class TouchableOpacity extends React.Component {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["TouchableOpacity.tsx"],"names":["TouchableOpacity","Component","childStyle","StyleSheet","flatten","props","style","opacity","valueOf","Animated","Value","getChildStyleOpacityWithDefault","value","duration","timing","toValue","easing","Easing","inOut","quad","useNativeDriver","useNativeAnimations","start","_from","to","TOUCHABLE_STATE","BEGAN","setOpacityTo","activeOpacity","UNDETERMINED","MOVED_OUTSIDE","render","rest","onStateChange","children","GenericTouchable","defaultProps"],"mappings":";;;;;;;AAAA;;AAOA;;AAEA;;;;;;;;;;
|
1
|
+
{"version":3,"sources":["TouchableOpacity.tsx"],"names":["TouchableOpacity","Component","childStyle","StyleSheet","flatten","props","style","opacity","valueOf","Animated","Value","getChildStyleOpacityWithDefault","value","duration","timing","toValue","easing","Easing","inOut","quad","useNativeDriver","useNativeAnimations","start","_from","to","TOUCHABLE_STATE","BEGAN","setOpacityTo","activeOpacity","UNDETERMINED","MOVED_OUTSIDE","render","rest","onStateChange","children","GenericTouchable","defaultProps"],"mappings":";;;;;;;AAAA;;AAOA;;AAEA;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACe,MAAMA,gBAAN,SAA+BC,eAA/B,CAAgE;AAAA;AAAA;;AAAA,6DAO3C,MAAM;AACtC,YAAMC,UAAU,GAAGC,wBAAWC,OAAX,CAAmB,KAAKC,KAAL,CAAWC,KAA9B,KAAwC,EAA3D;AACA,aAAOJ,UAAU,CAACK,OAAX,IAAsB,IAAtB,GACH,CADG,GAEFL,UAAU,CAACK,OAAX,CAAmBC,OAAnB,EAFL;AAGD,KAZ4E;;AAAA,qCAcnE,IAAIC,sBAASC,KAAb,CAAmB,KAAKC,+BAAL,EAAnB,CAdmE;;AAAA,0CAgB9D,CAACC,KAAD,EAAgBC,QAAhB,KAAqC;AAAA;;AAClDJ,4BAASK,MAAT,CAAgB,KAAKP,OAArB,EAA8B;AAC5BQ,QAAAA,OAAO,EAAEH,KADmB;AAE5BC,QAAAA,QAAQ,EAAEA,QAFkB;AAG5BG,QAAAA,MAAM,EAAEC,oBAAOC,KAAP,CAAaD,oBAAOE,IAApB,CAHoB;AAI5BC,QAAAA,eAAe,2BAAE,KAAKf,KAAL,CAAWgB,mBAAb,yEAAoC;AAJvB,OAA9B,EAKGC,KALH;AAMD,KAvB4E;;AAAA,2CAyB7D,CAACC,KAAD,EAAgBC,EAAhB,KAA+B;AAC7C,UAAIA,EAAE,KAAKC,kCAAgBC,KAA3B,EAAkC;AAChC,aAAKC,YAAL,CAAkB,KAAKtB,KAAL,CAAWuB,aAA7B,EAA6C,CAA7C;AACD,OAFD,MAEO,IACLJ,EAAE,KAAKC,kCAAgBI,YAAvB,IACAL,EAAE,KAAKC,kCAAgBK,aAFlB,EAGL;AACA,aAAKH,YAAL,CAAkB,KAAKhB,+BAAL,EAAlB,EAA0D,GAA1D;AACD;AACF,KAlC4E;AAAA;;AAoC7EoB,EAAAA,MAAM,GAAG;AACP,UAAM;AAAEzB,MAAAA,KAAK,GAAG,EAAV;AAAc,SAAG0B;AAAjB,QAA0B,KAAK3B,KAArC;AACA,wBACE,oBAAC,yBAAD,eACM2B,IADN;AAEE,MAAA,KAAK,EAAE,CACL1B,KADK,EAEL;AACEC,QAAAA,OAAO,EAAE,KAAKA,OADhB,CAC8C;;AAD9C,OAFK,CAFT;AAQE,MAAA,aAAa,EAAE,KAAK0B;AARtB,QASG,KAAK5B,KAAL,CAAW6B,QAAX,GAAsB,KAAK7B,KAAL,CAAW6B,QAAjC,gBAA4C,oBAAC,iBAAD,OAT/C,CADF;AAaD;;AAnD4E;;;;gBAA1DlC,gB,kBACG,EACpB,GAAGmC,0BAAiBC,YADA;AAEpBR,EAAAA,aAAa,EAAE;AAFK,C","sourcesContent":["import {\n Animated,\n Easing,\n StyleSheet,\n View,\n TouchableOpacityProps as RNTouchableOpacityProps,\n} from 'react-native';\nimport GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';\nimport type { GenericTouchableProps } from './GenericTouchableProps';\nimport * as React from 'react';\nimport { Component } from 'react';\n\n/**\n * @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.\n */\nexport type TouchableOpacityProps = RNTouchableOpacityProps &\n GenericTouchableProps & {\n useNativeAnimations?: boolean;\n };\n\n/**\n * @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.\n *\n * TouchableOpacity bases on timing animation which has been used in RN's core\n */\nexport default class TouchableOpacity extends Component<TouchableOpacityProps> {\n static defaultProps = {\n ...GenericTouchable.defaultProps,\n activeOpacity: 0.2,\n };\n\n // Opacity is 1 one by default but could be overwritten\n getChildStyleOpacityWithDefault = () => {\n const childStyle = StyleSheet.flatten(this.props.style) || {};\n return childStyle.opacity == null\n ? 1\n : (childStyle.opacity.valueOf() as number);\n };\n\n opacity = new Animated.Value(this.getChildStyleOpacityWithDefault());\n\n setOpacityTo = (value: number, duration: number) => {\n Animated.timing(this.opacity, {\n toValue: value,\n duration: duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: this.props.useNativeAnimations ?? true,\n }).start();\n };\n\n onStateChange = (_from: number, to: number) => {\n if (to === TOUCHABLE_STATE.BEGAN) {\n this.setOpacityTo(this.props.activeOpacity!, 0);\n } else if (\n to === TOUCHABLE_STATE.UNDETERMINED ||\n to === TOUCHABLE_STATE.MOVED_OUTSIDE\n ) {\n this.setOpacityTo(this.getChildStyleOpacityWithDefault(), 150);\n }\n };\n\n render() {\n const { style = {}, ...rest } = this.props;\n return (\n <GenericTouchable\n {...rest}\n style={[\n style,\n {\n opacity: this.opacity as unknown as number, // TODO: fix this\n },\n ]}\n onStateChange={this.onStateChange}>\n {this.props.children ? this.props.children : <View />}\n </GenericTouchable>\n );\n }\n}\n"]}
|
@@ -17,6 +17,9 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
17
17
|
|
18
18
|
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); }
|
19
19
|
|
20
|
+
/**
|
21
|
+
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
|
22
|
+
*/
|
20
23
|
const TouchableWithoutFeedback = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(_GenericTouchable.default, _extends({
|
21
24
|
ref: ref
|
22
25
|
}, props)));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["TouchableWithoutFeedback.tsx"],"names":["TouchableWithoutFeedback","React","forwardRef","props","ref","defaultProps","GenericTouchable"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;;;
|
1
|
+
{"version":3,"sources":["TouchableWithoutFeedback.tsx"],"names":["TouchableWithoutFeedback","React","forwardRef","props","ref","defaultProps","GenericTouchable"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;;;;;AAQA;AACA;AACA;AACA,MAAMA,wBAAwB,gBAAGC,KAAK,CAACC,UAAN,CAG/B,CAACC,KAAD,EAAQC,GAAR,kBAAgB,oBAAC,yBAAD;AAAkB,EAAA,GAAG,EAAEA;AAAvB,GAAgCD,KAAhC,EAHe,CAAjC;AAKAH,wBAAwB,CAACK,YAAzB,GAAwCC,0BAAiBD,YAAzD;eAEeL,wB","sourcesContent":["import * as React from 'react';\nimport { PropsWithChildren } from 'react';\nimport GenericTouchable from './GenericTouchable';\nimport type { GenericTouchableProps } from './GenericTouchableProps';\n\n/**\n * @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.\n */\nexport type TouchableWithoutFeedbackProps = GenericTouchableProps;\n\n/**\n * @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.\n */\nconst TouchableWithoutFeedback = React.forwardRef<\n GenericTouchable,\n PropsWithChildren<TouchableWithoutFeedbackProps>\n>((props, ref) => <GenericTouchable ref={ref} {...props} />);\n\nTouchableWithoutFeedback.defaultProps = GenericTouchable.defaultProps;\n\nexport default TouchableWithoutFeedback;\n"]}
|
@@ -5,12 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = findNodeHandle;
|
7
7
|
|
8
|
+
var _reactNative = require("react-native");
|
9
|
+
|
8
10
|
var _utils = require("./web/utils");
|
9
11
|
|
10
12
|
function findNodeHandle(viewRef) {
|
11
|
-
//
|
13
|
+
// TODO: Remove this once we remove old API.
|
14
|
+
if (viewRef instanceof _reactNative.FlatList) {
|
15
|
+
// @ts-ignore This is the only way to get the scroll ref from FlatList.
|
16
|
+
return viewRef._listRef._scrollRef.firstChild;
|
17
|
+
} // Old API assumes that child handler is HTMLElement.
|
12
18
|
// However, if we nest handlers, we will get ref to another handler.
|
13
19
|
// In that case, we want to recursively call findNodeHandle with new handler viewTag (which can also be ref to another handler).
|
20
|
+
|
21
|
+
|
14
22
|
if ((viewRef === null || viewRef === void 0 ? void 0 : viewRef.viewTag) !== undefined) {
|
15
23
|
return findNodeHandle(viewRef.viewTag);
|
16
24
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["findNodeHandle.web.ts"],"names":["findNodeHandle","viewRef","viewTag","undefined","Element","style","display","
|
1
|
+
{"version":3,"sources":["findNodeHandle.web.ts"],"names":["findNodeHandle","viewRef","FlatList","_listRef","_scrollRef","firstChild","viewTag","undefined","Element","style","display","elementRef","current","element"],"mappings":";;;;;;;AAAA;;AAEA;;AAEe,SAASA,cAAT,CACbC,OADa,EAEsB;AACnC;AACA,MAAIA,OAAO,YAAYC,qBAAvB,EAAiC;AAC/B;AACA,WAAOD,OAAO,CAACE,QAAR,CAAiBC,UAAjB,CAA4BC,UAAnC;AACD,GALkC,CAMnC;AACA;AACA;;;AACA,MAAI,CAACJ,OAAD,aAACA,OAAD,uBAACA,OAAD,CAAgCK,OAAhC,MAA4CC,SAAhD,EAA2D;AACzD,WAAOP,cAAc,CAAEC,OAAD,CAA+BK,OAAhC,CAArB;AACD;;AAED,MAAIL,OAAO,YAAYO,OAAvB,EAAgC;AAC9B,QAAIP,OAAO,CAACQ,KAAR,CAAcC,OAAd,KAA0B,UAA9B,EAA0C;AACxC,aAAOV,cAAc,CAACC,OAAO,CAACI,UAAT,CAArB;AACD;;AAED,WAAOJ,OAAP;AACD;;AAED,MAAI,2BAAeA,OAAf,CAAJ,EAA6B;AAC3B,WAAQA,OAAD,CAAoBU,UAApB,CAA+BC,OAAtC;AACD,GAvBkC,CAyBnC;AACA;;;AACA,MAAIC,OAAO,GAAIZ,OAAJ,aAAIA,OAAJ,uBAAIA,OAAD,CAAgCW,OAA9C;;AAEA,SAAOC,OAAO,IAAIA,OAAO,CAACJ,KAAR,CAAcC,OAAd,KAA0B,UAA5C,EAAwD;AACtDG,IAAAA,OAAO,GAAGA,OAAO,CAACR,UAAlB;AACD;;AAED,SAAOQ,OAAP;AACD","sourcesContent":["import { FlatList } from 'react-native';\nimport type { GestureHandlerRef, SVGRef } from './web/interfaces';\nimport { isRNSVGElement } from './web/utils';\n\nexport default function findNodeHandle(\n viewRef: GestureHandlerRef | SVGRef | HTMLElement | SVGElement\n): HTMLElement | SVGElement | number {\n // TODO: Remove this once we remove old API.\n if (viewRef instanceof FlatList) {\n // @ts-ignore This is the only way to get the scroll ref from FlatList.\n return viewRef._listRef._scrollRef.firstChild;\n }\n // Old API assumes that child handler is HTMLElement.\n // However, if we nest handlers, we will get ref to another handler.\n // In that case, we want to recursively call findNodeHandle with new handler viewTag (which can also be ref to another handler).\n if ((viewRef as GestureHandlerRef)?.viewTag !== undefined) {\n return findNodeHandle((viewRef as GestureHandlerRef).viewTag);\n }\n\n if (viewRef instanceof Element) {\n if (viewRef.style.display === 'contents') {\n return findNodeHandle(viewRef.firstChild as HTMLElement);\n }\n\n return viewRef;\n }\n\n if (isRNSVGElement(viewRef)) {\n return (viewRef as SVGRef).elementRef.current;\n }\n\n // In new API, we receive ref object which `current` field points to wrapper `div` with `display: contents;`.\n // We want to return the first descendant (in DFS order) that doesn't have this property.\n let element = (viewRef as GestureHandlerRef)?.current;\n\n while (element && element.style.display === 'contents') {\n element = element.firstChild as HTMLElement;\n }\n\n return element;\n}\n"]}
|
@@ -14,7 +14,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
14
14
|
const flingGestureHandlerProps = ['numberOfPointers', 'direction'];
|
15
15
|
exports.flingGestureHandlerProps = flingGestureHandlerProps;
|
16
16
|
const flingHandlerName = 'FlingGestureHandler';
|
17
|
+
/**
|
18
|
+
* @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.
|
19
|
+
*/
|
20
|
+
|
17
21
|
exports.flingHandlerName = flingHandlerName;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.
|
25
|
+
*/
|
18
26
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
19
27
|
const FlingGestureHandler = (0, _createHandler.default)({
|
20
28
|
name: flingHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["FlingGestureHandler.ts"],"names":["flingGestureHandlerProps","flingHandlerName","FlingGestureHandler","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,wBAAwB,GAAG,CACtC,kBADsC,EAEtC,WAFsC,CAAjC;;
|
1
|
+
{"version":3,"sources":["FlingGestureHandler.ts"],"names":["flingGestureHandlerProps","flingHandlerName","FlingGestureHandler","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,wBAAwB,GAAG,CACtC,kBADsC,EAEtC,WAFsC,CAAjC;;AAmCA,MAAMC,gBAAgB,GAAG,qBAAzB;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAG,4BAGjC;AACAC,EAAAA,IAAI,EAAEF,gBADN;AAEAG,EAAAA,YAAY,EAAE,CACZ,GAAGC,6CADS,EAEZ,GAAGL,wBAFS,CAFd;AAMAM,EAAAA,MAAM,EAAE;AANR,CAHiC,CAA5B","sourcesContent":["import type { FlingGestureHandlerEventPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const flingGestureHandlerProps = [\n 'numberOfPointers',\n 'direction',\n] as const;\n\nexport interface FlingGestureConfig {\n /**\n * Expressed allowed direction of movement. It's possible to pass one or many\n * directions in one parameter:\n *\n * ```js\n * direction={Directions.RIGHT | Directions.LEFT}\n * ```\n *\n * or\n *\n * ```js\n * direction={Directions.DOWN}\n * ```\n */\n direction?: number;\n\n /**\n * Determine exact number of points required to handle the fling gesture.\n */\n numberOfPointers?: number;\n}\n\n/**\n * @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.\n */\nexport interface FlingGestureHandlerProps\n extends BaseGestureHandlerProps<FlingGestureHandlerEventPayload>,\n FlingGestureConfig {}\n\nexport const flingHandlerName = 'FlingGestureHandler';\n\n/**\n * @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.\n */\nexport type FlingGestureHandler = typeof FlingGestureHandler;\n\n/**\n * @deprecated FlingGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Fling()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const FlingGestureHandler = createHandler<\n FlingGestureHandlerProps,\n FlingGestureHandlerEventPayload\n>({\n name: flingHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...flingGestureHandlerProps,\n ] as const,\n config: {},\n});\n"]}
|
@@ -36,7 +36,11 @@ class ForceTouchFallback extends _react.default.Component {
|
|
36
36
|
|
37
37
|
_defineProperty(ForceTouchFallback, "forceTouchAvailable", false);
|
38
38
|
|
39
|
-
const forceTouchHandlerName = 'ForceTouchGestureHandler';
|
39
|
+
const forceTouchHandlerName = 'ForceTouchGestureHandler';
|
40
|
+
/**
|
41
|
+
* @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.
|
42
|
+
*/
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
40
44
|
|
41
45
|
exports.forceTouchHandlerName = forceTouchHandlerName;
|
42
46
|
const ForceTouchGestureHandler = _PlatformConstants.default !== null && _PlatformConstants.default !== void 0 && _PlatformConstants.default.forceTouchAvailable ? (0, _createHandler.default)({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ForceTouchGestureHandler.ts"],"names":["forceTouchGestureHandlerProps","ForceTouchFallback","React","Component","componentDidMount","console","warn","render","props","children","forceTouchHandlerName","ForceTouchGestureHandler","PlatformConstants","forceTouchAvailable","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMO,MAAMA,6BAA6B,GAAG,CAC3C,UAD2C,EAE3C,UAF2C,EAG3C,sBAH2C,CAAtC,C,CAMP;;;;AACA,MAAMC,kBAAN,SAAiCC,eAAMC,SAAvC,CAA6E;AAE3EC,EAAAA,iBAAiB,GAAG;AAClBC,IAAAA,OAAO,CAACC,IAAR,CACE,uBACE,8NADF,CADF;AAKD;;AACDC,EAAAA,MAAM,GAAG;AACP,WAAO,KAAKC,KAAL,CAAWC,QAAlB;AACD;;AAX0E;;gBAAvER,kB,yBACyB,K;;
|
1
|
+
{"version":3,"sources":["ForceTouchGestureHandler.ts"],"names":["forceTouchGestureHandlerProps","ForceTouchFallback","React","Component","componentDidMount","console","warn","render","props","children","forceTouchHandlerName","ForceTouchGestureHandler","PlatformConstants","forceTouchAvailable","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMO,MAAMA,6BAA6B,GAAG,CAC3C,UAD2C,EAE3C,UAF2C,EAG3C,sBAH2C,CAAtC,C,CAMP;;;;AACA,MAAMC,kBAAN,SAAiCC,eAAMC,SAAvC,CAA6E;AAE3EC,EAAAA,iBAAiB,GAAG;AAClBC,IAAAA,OAAO,CAACC,IAAR,CACE,uBACE,8NADF,CADF;AAKD;;AACDC,EAAAA,MAAM,GAAG;AACP,WAAO,KAAKC,KAAL,CAAWC,QAAlB;AACD;;AAX0E;;gBAAvER,kB,yBACyB,K;;AAgDxB,MAAMS,qBAAqB,GAAG,0BAA9B;AAEP;AACA;AACA;AACA;;;AACO,MAAMC,wBAAwB,GAAGC,2GAAmBC,mBAAnB,GACpC,4BAGE;AACAC,EAAAA,IAAI,EAAEJ,qBADN;AAEAK,EAAAA,YAAY,EAAE,CACZ,GAAGC,6CADS,EAEZ,GAAGhB,6BAFS,CAFd;AAMAiB,EAAAA,MAAM,EAAE;AANR,CAHF,CADoC,GAYpChB,kBAZG;;AAcNU,wBAAD,CAAuDE,mBAAvD,GACE,oHAAmBA,mBAAnB,KAA0C,KAD5C","sourcesContent":["import React, { PropsWithChildren } from 'react';\nimport { tagMessage } from '../utils';\nimport PlatformConstants from '../PlatformConstants';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\nimport type { ForceTouchGestureHandlerEventPayload } from './GestureHandlerEventPayload';\n\nexport const forceTouchGestureHandlerProps = [\n 'minForce',\n 'maxForce',\n 'feedbackOnActivation',\n] as const;\n\n// implicit `children` prop has been removed in @types/react^18.0.0\nclass ForceTouchFallback extends React.Component<PropsWithChildren<unknown>> {\n static forceTouchAvailable = false;\n componentDidMount() {\n console.warn(\n tagMessage(\n 'ForceTouchGestureHandler is not available on this platform. Please use ForceTouchGestureHandler.forceTouchAvailable to conditionally render other components that would provide a fallback behavior specific to your usecase'\n )\n );\n }\n render() {\n return this.props.children;\n }\n}\n\nexport interface ForceTouchGestureConfig {\n /**\n *\n * A minimal pressure that is required before handler can activate. Should be a\n * value from range `[0.0, 1.0]`. Default is `0.2`.\n */\n minForce?: number;\n\n /**\n * A maximal pressure that could be applied for handler. If the pressure is\n * greater, handler fails. Should be a value from range `[0.0, 1.0]`.\n */\n maxForce?: number;\n\n /**\n * Boolean value defining if haptic feedback has to be performed on\n * activation.\n */\n feedbackOnActivation?: boolean;\n}\n\n/**\n * @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.\n */\nexport interface ForceTouchGestureHandlerProps\n extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>,\n ForceTouchGestureConfig {}\n\n/**\n * @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.\n */\nexport type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & {\n forceTouchAvailable: boolean;\n};\n\nexport const forceTouchHandlerName = 'ForceTouchGestureHandler';\n\n/**\n * @deprecated ForceTouchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.ForceTouch()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const ForceTouchGestureHandler = PlatformConstants?.forceTouchAvailable\n ? createHandler<\n ForceTouchGestureHandlerProps,\n ForceTouchGestureHandlerEventPayload\n >({\n name: forceTouchHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...forceTouchGestureHandlerProps,\n ] as const,\n config: {},\n })\n : ForceTouchFallback;\n\n(ForceTouchGestureHandler as ForceTouchGestureHandler).forceTouchAvailable =\n PlatformConstants?.forceTouchAvailable || false;\n"]}
|
@@ -14,7 +14,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
14
14
|
const longPressGestureHandlerProps = ['minDurationMs', 'maxDist', 'numberOfPointers'];
|
15
15
|
exports.longPressGestureHandlerProps = longPressGestureHandlerProps;
|
16
16
|
const longPressHandlerName = 'LongPressGestureHandler';
|
17
|
+
/**
|
18
|
+
* @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.
|
19
|
+
*/
|
20
|
+
|
17
21
|
exports.longPressHandlerName = longPressHandlerName;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.
|
25
|
+
*/
|
18
26
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
19
27
|
const LongPressGestureHandler = (0, _createHandler.default)({
|
20
28
|
name: longPressHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["LongPressGestureHandler.ts"],"names":["longPressGestureHandlerProps","longPressHandlerName","LongPressGestureHandler","name","allowedProps","baseGestureHandlerProps","config","shouldCancelWhenOutside"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,4BAA4B,GAAG,CAC1C,eAD0C,EAE1C,SAF0C,EAG1C,kBAH0C,CAArC;;
|
1
|
+
{"version":3,"sources":["LongPressGestureHandler.ts"],"names":["longPressGestureHandlerProps","longPressHandlerName","LongPressGestureHandler","name","allowedProps","baseGestureHandlerProps","config","shouldCancelWhenOutside"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,4BAA4B,GAAG,CAC1C,eAD0C,EAE1C,SAF0C,EAG1C,kBAH0C,CAArC;;AAkCA,MAAMC,oBAAoB,GAAG,yBAA7B;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAG,4BAGrC;AACAC,EAAAA,IAAI,EAAEF,oBADN;AAEAG,EAAAA,YAAY,EAAE,CACZ,GAAGC,6CADS,EAEZ,GAAGL,4BAFS,CAFd;AAMAM,EAAAA,MAAM,EAAE;AACNC,IAAAA,uBAAuB,EAAE;AADnB;AANR,CAHqC,CAAhC","sourcesContent":["import { LongPressGestureHandlerEventPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const longPressGestureHandlerProps = [\n 'minDurationMs',\n 'maxDist',\n 'numberOfPointers',\n] as const;\n\nexport interface LongPressGestureConfig {\n /**\n * Minimum time, expressed in milliseconds, that a finger must remain pressed on\n * the corresponding view. The default value is 500.\n */\n minDurationMs?: number;\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is\n * allowed to travel during a long press gesture. If the finger travels\n * further than the defined distance and the handler hasn't yet activated, it\n * will fail to recognize the gesture. The default value is 10.\n */\n maxDist?: number;\n\n /**\n * Determine exact number of points required to handle the long press gesture.\n */\n numberOfPointers?: number;\n}\n\n/**\n * @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.\n */\nexport interface LongPressGestureHandlerProps\n extends BaseGestureHandlerProps<LongPressGestureHandlerEventPayload>,\n LongPressGestureConfig {}\n\nexport const longPressHandlerName = 'LongPressGestureHandler';\n\n/**\n * @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.\n */\nexport type LongPressGestureHandler = typeof LongPressGestureHandler;\n\n/**\n * @deprecated LongPressGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.LongPress()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const LongPressGestureHandler = createHandler<\n LongPressGestureHandlerProps,\n LongPressGestureHandlerEventPayload\n>({\n name: longPressHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...longPressGestureHandlerProps,\n ] as const,\n config: {\n shouldCancelWhenOutside: true,\n },\n});\n"]}
|
@@ -16,7 +16,15 @@ exports.nativeViewGestureHandlerProps = nativeViewGestureHandlerProps;
|
|
16
16
|
const nativeViewProps = [..._gestureHandlerCommon.baseGestureHandlerProps, ...nativeViewGestureHandlerProps];
|
17
17
|
exports.nativeViewProps = nativeViewProps;
|
18
18
|
const nativeViewHandlerName = 'NativeViewGestureHandler';
|
19
|
+
/**
|
20
|
+
* @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.
|
21
|
+
*/
|
22
|
+
|
19
23
|
exports.nativeViewHandlerName = nativeViewHandlerName;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.
|
27
|
+
*/
|
20
28
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
21
29
|
const NativeViewGestureHandler = (0, _createHandler.default)({
|
22
30
|
name: nativeViewHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["NativeViewGestureHandler.ts"],"names":["nativeViewGestureHandlerProps","nativeViewProps","baseGestureHandlerProps","nativeViewHandlerName","NativeViewGestureHandler","name","allowedProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,6BAA6B,GAAG,CAC3C,uBAD2C,EAE3C,sBAF2C,CAAtC;;
|
1
|
+
{"version":3,"sources":["NativeViewGestureHandler.ts"],"names":["nativeViewGestureHandlerProps","nativeViewProps","baseGestureHandlerProps","nativeViewHandlerName","NativeViewGestureHandler","name","allowedProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,6BAA6B,GAAG,CAC3C,uBAD2C,EAE3C,sBAF2C,CAAtC;;AA4BA,MAAMC,eAAe,GAAG,CAC7B,GAAGC,6CAD0B,EAE7B,GAAGF,6BAF0B,CAAxB;;AAKA,MAAMG,qBAAqB,GAAG,0BAA9B;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG,4BAGtC;AACAC,EAAAA,IAAI,EAAEF,qBADN;AAEAG,EAAAA,YAAY,EAAEL,eAFd;AAGAM,EAAAA,MAAM,EAAE;AAHR,CAHsC,CAAjC","sourcesContent":["import type { NativeViewGestureHandlerPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const nativeViewGestureHandlerProps = [\n 'shouldActivateOnStart',\n 'disallowInterruption',\n] as const;\n\nexport interface NativeViewGestureConfig {\n /**\n * Android only.\n *\n * Determines whether the handler should check for an existing touch event on\n * instantiation.\n */\n shouldActivateOnStart?: boolean;\n\n /**\n * When `true`, cancels all other gesture handlers when this\n * `NativeViewGestureHandler` receives an `ACTIVE` state event.\n */\n disallowInterruption?: boolean;\n}\n\n/**\n * @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.\n */\nexport interface NativeViewGestureHandlerProps\n extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>,\n NativeViewGestureConfig {}\n\nexport const nativeViewProps = [\n ...baseGestureHandlerProps,\n ...nativeViewGestureHandlerProps,\n] as const;\n\nexport const nativeViewHandlerName = 'NativeViewGestureHandler';\n\n/**\n * @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.\n */\nexport type NativeViewGestureHandler = typeof NativeViewGestureHandler;\n\n/**\n * @deprecated NativeViewGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Native()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const NativeViewGestureHandler = createHandler<\n NativeViewGestureHandlerProps,\n NativeViewGestureHandlerPayload\n>({\n name: nativeViewHandlerName,\n allowedProps: nativeViewProps,\n config: {},\n});\n"]}
|
@@ -17,7 +17,15 @@ exports.panGestureHandlerProps = panGestureHandlerProps;
|
|
17
17
|
const panGestureHandlerCustomNativeProps = ['activeOffsetYStart', 'activeOffsetYEnd', 'activeOffsetXStart', 'activeOffsetXEnd', 'failOffsetYStart', 'failOffsetYEnd', 'failOffsetXStart', 'failOffsetXEnd'];
|
18
18
|
exports.panGestureHandlerCustomNativeProps = panGestureHandlerCustomNativeProps;
|
19
19
|
const panHandlerName = 'PanGestureHandler';
|
20
|
+
/**
|
21
|
+
* @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.
|
22
|
+
*/
|
23
|
+
|
20
24
|
exports.panHandlerName = panHandlerName;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.
|
28
|
+
*/
|
21
29
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
22
30
|
const PanGestureHandler = (0, _createHandler.default)({
|
23
31
|
name: panHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["PanGestureHandler.ts"],"names":["panGestureHandlerProps","panGestureHandlerCustomNativeProps","panHandlerName","PanGestureHandler","name","allowedProps","baseGestureHandlerProps","config","transformProps","managePanProps","customNativeProps","validatePanGestureHandlerProps","props","Array","isArray","activeOffsetX","Error","activeOffsetY","failOffsetX","failOffsetY","minDist","transformPanGestureHandlerProps","res","undefined","activeOffsetXStart","activeOffsetXEnd","activeOffsetYStart","activeOffsetYEnd","failOffsetXStart","failOffsetXEnd","failOffsetYStart","failOffsetYEnd","__DEV__"],"mappings":";;;;;;;;AACA;;AACA;;;;AAKO,MAAMA,sBAAsB,GAAG,CACpC,eADoC,EAEpC,eAFoC,EAGpC,aAHoC,EAIpC,aAJoC,EAKpC,SALoC,EAMpC,aANoC,EAOpC,cAPoC,EAQpC,cARoC,EASpC,aAToC,EAUpC,aAVoC,EAWpC,YAXoC,EAYpC,gCAZoC,EAapC,wBAboC,CAA/B;;AAgBA,MAAMC,kCAAkC,GAAG,CAChD,oBADgD,EAEhD,kBAFgD,EAGhD,oBAHgD,EAIhD,kBAJgD,EAKhD,kBALgD,EAMhD,gBANgD,EAOhD,kBAPgD,EAQhD,gBARgD,CAA3C;;AA6GA,MAAMC,cAAc,GAAG,mBAAvB;;AAGP;AACO,MAAMC,iBAAiB,GAAG,4BAG/B;AACAC,EAAAA,IAAI,EAAEF,cADN;AAEAG,EAAAA,YAAY,EAAE,CACZ,GAAGC,6CADS,EAEZ,GAAGN,sBAFS,CAFd;AAMAO,EAAAA,MAAM,EAAE,EANR;AAOAC,EAAAA,cAAc,EAAEC,cAPhB;AAQAC,EAAAA,iBAAiB,EAAET;AARnB,CAH+B,CAA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load } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const panGestureHandlerProps = [\n 'activeOffsetY',\n 'activeOffsetX',\n 'failOffsetY',\n 'failOffsetX',\n 'minDist',\n 'minVelocity',\n 'minVelocityX',\n 'minVelocityY',\n 'minPointers',\n 'maxPointers',\n 'avgTouches',\n 'enableTrackpadTwoFingerGesture',\n 'activateAfterLongPress',\n] as const;\n\nexport const panGestureHandlerCustomNativeProps = [\n 'activeOffsetYStart',\n 'activeOffsetYEnd',\n 'activeOffsetXStart',\n 'activeOffsetXEnd',\n 'failOffsetYStart',\n 'failOffsetYEnd',\n 'failOffsetXStart',\n 'failOffsetXEnd',\n] as const;\n\ninterface CommonPanProperties {\n /**\n * Minimum distance the finger (or multiple finger) need to travel before the\n * handler activates. Expressed in points.\n */\n minDist?: number;\n\n /**\n * Android only.\n */\n avgTouches?: boolean;\n\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 * A number of fingers that is required to be placed before handler can\n * activate. Should be a higher or equal to 0 integer.\n */\n minPointers?: number;\n\n /**\n * When the given number of fingers is placed on the screen and handler hasn't\n * yet activated it will fail recognizing the gesture. Should be a higher or\n * equal to 0 integer.\n */\n maxPointers?: number;\n\n minVelocity?: number;\n minVelocityX?: number;\n minVelocityY?: number;\n activateAfterLongPress?: number;\n}\n\nexport interface PanGestureConfig extends CommonPanProperties {\n activeOffsetYStart?: number;\n activeOffsetYEnd?: number;\n activeOffsetXStart?: number;\n activeOffsetXEnd?: number;\n failOffsetYStart?: number;\n failOffsetYEnd?: number;\n failOffsetXStart?: number;\n failOffsetXEnd?: number;\n}\n\nexport interface PanGestureHandlerProps\n extends BaseGestureHandlerProps<PanGestureHandlerEventPayload>,\n CommonPanProperties {\n /**\n * Range along X axis (in points) where fingers travels without activation of\n * handler. Moving outside of this range implies activation of handler. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n activeOffsetY?:\n | number\n | [activeOffsetYStart: number, activeOffsetYEnd: number];\n\n /**\n * Range along X axis (in points) where fingers travels without activation of\n * handler. Moving outside of this range implies activation of handler. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n activeOffsetX?:\n | number\n | [activeOffsetXStart: number, activeOffsetXEnd: number];\n\n /**\n * When the finger moves outside this range (in points) along Y axis and\n * handler hasn't yet activated it will fail recognizing the gesture. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number];\n\n /**\n * When the finger moves outside this range (in points) along X axis and\n * handler hasn't yet activated it will fail recognizing the gesture. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number];\n}\n\nexport const panHandlerName = 'PanGestureHandler';\n\nexport type PanGestureHandler = typeof PanGestureHandler;\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const PanGestureHandler = createHandler<\n PanGestureHandlerProps,\n PanGestureHandlerEventPayload\n>({\n name: panHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...panGestureHandlerProps,\n ] as const,\n config: {},\n transformProps: managePanProps,\n customNativeProps: panGestureHandlerCustomNativeProps,\n});\n\nfunction validatePanGestureHandlerProps(props: PanGestureHandlerProps) {\n if (\n Array.isArray(props.activeOffsetX) &&\n (props.activeOffsetX[0] > 0 || props.activeOffsetX[1] < 0)\n ) {\n throw new Error(\n `First element of activeOffsetX should be negative, a the second one should be positive`\n );\n }\n\n if (\n Array.isArray(props.activeOffsetY) &&\n (props.activeOffsetY[0] > 0 || props.activeOffsetY[1] < 0)\n ) {\n throw new Error(\n `First element of activeOffsetY should be negative, a the second one should be positive`\n );\n }\n\n if (\n Array.isArray(props.failOffsetX) &&\n (props.failOffsetX[0] > 0 || props.failOffsetX[1] < 0)\n ) {\n throw new Error(\n `First element of failOffsetX should be negative, a the second one should be positive`\n );\n }\n\n if (\n Array.isArray(props.failOffsetY) &&\n (props.failOffsetY[0] > 0 || props.failOffsetY[1] < 0)\n ) {\n throw new Error(\n `First element of failOffsetY should be negative, a the second one should be positive`\n );\n }\n\n if (props.minDist && (props.failOffsetX || props.failOffsetY)) {\n throw new Error(\n `It is not supported to use minDist with failOffsetX or failOffsetY, use activeOffsetX and activeOffsetY instead`\n );\n }\n\n if (props.minDist && (props.activeOffsetX || props.activeOffsetY)) {\n throw new Error(\n `It is not supported to use minDist with activeOffsetX or activeOffsetY`\n );\n }\n}\n\nfunction transformPanGestureHandlerProps(props: PanGestureHandlerProps) {\n type InternalPanGHKeys =\n | 'activeOffsetXStart'\n | 'activeOffsetXEnd'\n | 'failOffsetXStart'\n | 'failOffsetXEnd'\n | 'activeOffsetYStart'\n | 'activeOffsetYEnd'\n | 'failOffsetYStart'\n | 'failOffsetYEnd';\n type PanGestureHandlerInternalProps = PanGestureHandlerProps &\n Partial<Record<InternalPanGHKeys, number>>;\n\n const res: PanGestureHandlerInternalProps = { ...props };\n\n if (props.activeOffsetX !== undefined) {\n delete res.activeOffsetX;\n if (Array.isArray(props.activeOffsetX)) {\n res.activeOffsetXStart = props.activeOffsetX[0];\n res.activeOffsetXEnd = props.activeOffsetX[1];\n } else if (props.activeOffsetX < 0) {\n res.activeOffsetXStart = props.activeOffsetX;\n } else {\n res.activeOffsetXEnd = props.activeOffsetX;\n }\n }\n\n if (props.activeOffsetY !== undefined) {\n delete res.activeOffsetY;\n if (Array.isArray(props.activeOffsetY)) {\n res.activeOffsetYStart = props.activeOffsetY[0];\n res.activeOffsetYEnd = props.activeOffsetY[1];\n } else if (props.activeOffsetY < 0) {\n res.activeOffsetYStart = props.activeOffsetY;\n } else {\n res.activeOffsetYEnd = props.activeOffsetY;\n }\n }\n\n if (props.failOffsetX !== undefined) {\n delete res.failOffsetX;\n if (Array.isArray(props.failOffsetX)) {\n res.failOffsetXStart = props.failOffsetX[0];\n res.failOffsetXEnd = props.failOffsetX[1];\n } else if (props.failOffsetX < 0) {\n res.failOffsetXStart = props.failOffsetX;\n } else {\n res.failOffsetXEnd = props.failOffsetX;\n }\n }\n\n if (props.failOffsetY !== undefined) {\n delete res.failOffsetY;\n if (Array.isArray(props.failOffsetY)) {\n res.failOffsetYStart = props.failOffsetY[0];\n res.failOffsetYEnd = props.failOffsetY[1];\n } else if (props.failOffsetY < 0) {\n res.failOffsetYStart = props.failOffsetY;\n } else {\n res.failOffsetYEnd = props.failOffsetY;\n }\n }\n\n return res;\n}\n\nexport function managePanProps(props: PanGestureHandlerProps) {\n if (__DEV__) {\n validatePanGestureHandlerProps(props);\n }\n return transformPanGestureHandlerProps(props);\n}\n"]}
|
1
|
+
{"version":3,"sources":["PanGestureHandler.ts"],"names":["panGestureHandlerProps","panGestureHandlerCustomNativeProps","panHandlerName","PanGestureHandler","name","allowedProps","baseGestureHandlerProps","config","transformProps","managePanProps","customNativeProps","validatePanGestureHandlerProps","props","Array","isArray","activeOffsetX","Error","activeOffsetY","failOffsetX","failOffsetY","minDist","transformPanGestureHandlerProps","res","undefined","activeOffsetXStart","activeOffsetXEnd","activeOffsetYStart","activeOffsetYEnd","failOffsetXStart","failOffsetXEnd","failOffsetYStart","failOffsetYEnd","__DEV__"],"mappings":";;;;;;;;AACA;;AACA;;;;AAKO,MAAMA,sBAAsB,GAAG,CACpC,eADoC,EAEpC,eAFoC,EAGpC,aAHoC,EAIpC,aAJoC,EAKpC,SALoC,EAMpC,aANoC,EAOpC,cAPoC,EAQpC,cARoC,EASpC,aAToC,EAUpC,aAVoC,EAWpC,YAXoC,EAYpC,gCAZoC,EAapC,wBAboC,CAA/B;;AAgBA,MAAMC,kCAAkC,GAAG,CAChD,oBADgD,EAEhD,kBAFgD,EAGhD,oBAHgD,EAIhD,kBAJgD,EAKhD,kBALgD,EAMhD,gBANgD,EAOhD,kBAPgD,EAQhD,gBARgD,CAA3C;;AAgHA,MAAMC,cAAc,GAAG,mBAAvB;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAG,4BAG/B;AACAC,EAAAA,IAAI,EAAEF,cADN;AAEAG,EAAAA,YAAY,EAAE,CACZ,GAAGC,6CADS,EAEZ,GAAGN,sBAFS,CAFd;AAMAO,EAAAA,MAAM,EAAE,EANR;AAOAC,EAAAA,cAAc,EAAEC,cAPhB;AAQAC,EAAAA,iBAAiB,EAAET;AARnB,CAH+B,CAA1B;;;AAcP,SAASU,8BAAT,CAAwCC,KAAxC,EAAuE;AACrE,MACEC,KAAK,CAACC,OAAN,CAAcF,KAAK,CAACG,aAApB,MACCH,KAAK,CAACG,aAAN,CAAoB,CAApB,IAAyB,CAAzB,IAA8BH,KAAK,CAACG,aAAN,CAAoB,CAApB,IAAyB,CADxD,CADF,EAGE;AACA,UAAM,IAAIC,KAAJ,CACH,wFADG,CAAN;AAGD;;AAED,MACEH,KAAK,CAACC,OAAN,CAAcF,KAAK,CAACK,aAApB,MACCL,KAAK,CAACK,aAAN,CAAoB,CAApB,IAAyB,CAAzB,IAA8BL,KAAK,CAACK,aAAN,CAAoB,CAApB,IAAyB,CADxD,CADF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cAAJ,GAAqBjB,KAAK,CAACM,WAA3B;AACD;AACF;;AAED,MAAIN,KAAK,CAACO,WAAN,KAAsBI,SAA1B,EAAqC;AACnC,WAAOD,GAAG,CAACH,WAAX;;AACA,QAAIN,KAAK,CAACC,OAAN,CAAcF,KAAK,CAACO,WAApB,CAAJ,EAAsC;AACpCG,MAAAA,GAAG,CAACQ,gBAAJ,GAAuBlB,KAAK,CAACO,WAAN,CAAkB,CAAlB,CAAvB;AACAG,MAAAA,GAAG,CAACS,cAAJ,GAAqBnB,KAAK,CAACO,WAAN,CAAkB,CAAlB,CAArB;AACD,KAHD,MAGO,IAAIP,KAAK,CAACO,WAAN,GAAoB,CAAxB,EAA2B;AAChCG,MAAAA,GAAG,CAACQ,gBAAJ,GAAuBlB,KAAK,CAACO,WAA7B;AACD,KAFM,MAEA;AACLG,MAAAA,GAAG,CAACS,cAAJ,GAAqBnB,KAAK,CAACO,WAA3B;AACD;AACF;;AAED,SAAOG,GAAP;AACD;;AAEM,SAASb,cAAT,CAAwBG,KAAxB,EAAuD;AAC5D,MAAIoB,OAAJ,EAAa;AACXrB,IAAAA,8BAA8B,CAACC,KAAD,CAA9B;AACD;;AACD,SAAOS,+BAA+B,CAACT,KAAD,CAAtC;AACD","sourcesContent":["import type { PanGestureHandlerEventPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const panGestureHandlerProps = [\n 'activeOffsetY',\n 'activeOffsetX',\n 'failOffsetY',\n 'failOffsetX',\n 'minDist',\n 'minVelocity',\n 'minVelocityX',\n 'minVelocityY',\n 'minPointers',\n 'maxPointers',\n 'avgTouches',\n 'enableTrackpadTwoFingerGesture',\n 'activateAfterLongPress',\n] as const;\n\nexport const panGestureHandlerCustomNativeProps = [\n 'activeOffsetYStart',\n 'activeOffsetYEnd',\n 'activeOffsetXStart',\n 'activeOffsetXEnd',\n 'failOffsetYStart',\n 'failOffsetYEnd',\n 'failOffsetXStart',\n 'failOffsetXEnd',\n] as const;\n\ninterface CommonPanProperties {\n /**\n * Minimum distance the finger (or multiple finger) need to travel before the\n * handler activates. Expressed in points.\n */\n minDist?: number;\n\n /**\n * Android only.\n */\n avgTouches?: boolean;\n\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 * A number of fingers that is required to be placed before handler can\n * activate. Should be a higher or equal to 0 integer.\n */\n minPointers?: number;\n\n /**\n * When the given number of fingers is placed on the screen and handler hasn't\n * yet activated it will fail recognizing the gesture. Should be a higher or\n * equal to 0 integer.\n */\n maxPointers?: number;\n\n minVelocity?: number;\n minVelocityX?: number;\n minVelocityY?: number;\n activateAfterLongPress?: number;\n}\n\nexport interface PanGestureConfig extends CommonPanProperties {\n activeOffsetYStart?: number;\n activeOffsetYEnd?: number;\n activeOffsetXStart?: number;\n activeOffsetXEnd?: number;\n failOffsetYStart?: number;\n failOffsetYEnd?: number;\n failOffsetXStart?: number;\n failOffsetXEnd?: number;\n}\n\n/**\n * @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.\n */\nexport interface PanGestureHandlerProps\n extends BaseGestureHandlerProps<PanGestureHandlerEventPayload>,\n CommonPanProperties {\n /**\n * Range along X axis (in points) where fingers travels without activation of\n * handler. Moving outside of this range implies activation of handler. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n activeOffsetY?:\n | number\n | [activeOffsetYStart: number, activeOffsetYEnd: number];\n\n /**\n * Range along X axis (in points) where fingers travels without activation of\n * handler. Moving outside of this range implies activation of handler. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n activeOffsetX?:\n | number\n | [activeOffsetXStart: number, activeOffsetXEnd: number];\n\n /**\n * When the finger moves outside this range (in points) along Y axis and\n * handler hasn't yet activated it will fail recognizing the gesture. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number];\n\n /**\n * When the finger moves outside this range (in points) along X axis and\n * handler hasn't yet activated it will fail recognizing the gesture. Range\n * can be given as an array or a single number. If range is set as an array,\n * first value must be lower or equal to 0, a the second one higher or equal\n * to 0. If only one number `p` is given a range of `(-inf, p)` will be used\n * if `p` is higher or equal to 0 and `(-p, inf)` otherwise.\n */\n failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number];\n}\n\nexport const panHandlerName = 'PanGestureHandler';\n\n/**\n * @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.\n */\nexport type PanGestureHandler = typeof PanGestureHandler;\n\n/**\n * @deprecated PanGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pan()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const PanGestureHandler = createHandler<\n PanGestureHandlerProps,\n PanGestureHandlerEventPayload\n>({\n name: panHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...panGestureHandlerProps,\n ] as const,\n config: {},\n transformProps: managePanProps,\n customNativeProps: panGestureHandlerCustomNativeProps,\n});\n\nfunction validatePanGestureHandlerProps(props: PanGestureHandlerProps) {\n if (\n Array.isArray(props.activeOffsetX) &&\n (props.activeOffsetX[0] > 0 || props.activeOffsetX[1] < 0)\n ) {\n throw new Error(\n `First element of activeOffsetX should be negative, a the second one should be positive`\n );\n }\n\n if (\n Array.isArray(props.activeOffsetY) &&\n (props.activeOffsetY[0] > 0 || props.activeOffsetY[1] < 0)\n ) {\n throw new Error(\n `First element of activeOffsetY should be negative, a the second one should be positive`\n );\n }\n\n if (\n Array.isArray(props.failOffsetX) &&\n (props.failOffsetX[0] > 0 || props.failOffsetX[1] < 0)\n ) {\n throw new Error(\n `First element of failOffsetX should be negative, a the second one should be positive`\n );\n }\n\n if (\n Array.isArray(props.failOffsetY) &&\n (props.failOffsetY[0] > 0 || props.failOffsetY[1] < 0)\n ) {\n throw new Error(\n `First element of failOffsetY should be negative, a the second one should be positive`\n );\n }\n\n if (props.minDist && (props.failOffsetX || props.failOffsetY)) {\n throw new Error(\n `It is not supported to use minDist with failOffsetX or failOffsetY, use activeOffsetX and activeOffsetY instead`\n );\n }\n\n if (props.minDist && (props.activeOffsetX || props.activeOffsetY)) {\n throw new Error(\n `It is not supported to use minDist with activeOffsetX or activeOffsetY`\n );\n }\n}\n\nfunction transformPanGestureHandlerProps(props: PanGestureHandlerProps) {\n type InternalPanGHKeys =\n | 'activeOffsetXStart'\n | 'activeOffsetXEnd'\n | 'failOffsetXStart'\n | 'failOffsetXEnd'\n | 'activeOffsetYStart'\n | 'activeOffsetYEnd'\n | 'failOffsetYStart'\n | 'failOffsetYEnd';\n type PanGestureHandlerInternalProps = PanGestureHandlerProps &\n Partial<Record<InternalPanGHKeys, number>>;\n\n const res: PanGestureHandlerInternalProps = { ...props };\n\n if (props.activeOffsetX !== undefined) {\n delete res.activeOffsetX;\n if (Array.isArray(props.activeOffsetX)) {\n res.activeOffsetXStart = props.activeOffsetX[0];\n res.activeOffsetXEnd = props.activeOffsetX[1];\n } else if (props.activeOffsetX < 0) {\n res.activeOffsetXStart = props.activeOffsetX;\n } else {\n res.activeOffsetXEnd = props.activeOffsetX;\n }\n }\n\n if (props.activeOffsetY !== undefined) {\n delete res.activeOffsetY;\n if (Array.isArray(props.activeOffsetY)) {\n res.activeOffsetYStart = props.activeOffsetY[0];\n res.activeOffsetYEnd = props.activeOffsetY[1];\n } else if (props.activeOffsetY < 0) {\n res.activeOffsetYStart = props.activeOffsetY;\n } else {\n res.activeOffsetYEnd = props.activeOffsetY;\n }\n }\n\n if (props.failOffsetX !== undefined) {\n delete res.failOffsetX;\n if (Array.isArray(props.failOffsetX)) {\n res.failOffsetXStart = props.failOffsetX[0];\n res.failOffsetXEnd = props.failOffsetX[1];\n } else if (props.failOffsetX < 0) {\n res.failOffsetXStart = props.failOffsetX;\n } else {\n res.failOffsetXEnd = props.failOffsetX;\n }\n }\n\n if (props.failOffsetY !== undefined) {\n delete res.failOffsetY;\n if (Array.isArray(props.failOffsetY)) {\n res.failOffsetYStart = props.failOffsetY[0];\n res.failOffsetYEnd = props.failOffsetY[1];\n } else if (props.failOffsetY < 0) {\n res.failOffsetYStart = props.failOffsetY;\n } else {\n res.failOffsetYEnd = props.failOffsetY;\n }\n }\n\n return res;\n}\n\nexport function managePanProps(props: PanGestureHandlerProps) {\n if (__DEV__) {\n validatePanGestureHandlerProps(props);\n }\n return transformPanGestureHandlerProps(props);\n}\n"]}
|
@@ -12,7 +12,15 @@ var _gestureHandlerCommon = require("./gestureHandlerCommon");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
|
14
14
|
const pinchHandlerName = 'PinchGestureHandler';
|
15
|
+
/**
|
16
|
+
* @deprecated PinchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pinch()` instead.
|
17
|
+
*/
|
18
|
+
|
15
19
|
exports.pinchHandlerName = pinchHandlerName;
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @deprecated PinchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pinch()` instead.
|
23
|
+
*/
|
16
24
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
17
25
|
const PinchGestureHandler = (0, _createHandler.default)({
|
18
26
|
name: pinchHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["PinchGestureHandler.ts"],"names":["pinchHandlerName","PinchGestureHandler","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;
|
1
|
+
{"version":3,"sources":["PinchGestureHandler.ts"],"names":["pinchHandlerName","PinchGestureHandler","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;AAWO,MAAMA,gBAAgB,GAAG,qBAAzB;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAG,4BAGjC;AACAC,EAAAA,IAAI,EAAEF,gBADN;AAEAG,EAAAA,YAAY,EAAEC,6CAFd;AAGAC,EAAAA,MAAM,EAAE;AAHR,CAHiC,CAA5B","sourcesContent":["import { PinchGestureHandlerEventPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\n/**\n * @deprecated PinchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pinch()` instead.\n */\nexport interface PinchGestureHandlerProps\n extends BaseGestureHandlerProps<PinchGestureHandlerEventPayload> {}\n\nexport const pinchHandlerName = 'PinchGestureHandler';\n\n/**\n * @deprecated PinchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pinch()` instead.\n */\nexport type PinchGestureHandler = typeof PinchGestureHandler;\n\n/**\n * @deprecated PinchGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Pinch()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const PinchGestureHandler = createHandler<\n PinchGestureHandlerProps,\n PinchGestureHandlerEventPayload\n>({\n name: pinchHandlerName,\n allowedProps: baseGestureHandlerProps,\n config: {},\n});\n"]}
|
@@ -12,7 +12,15 @@ var _gestureHandlerCommon = require("./gestureHandlerCommon");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
|
14
14
|
const rotationHandlerName = 'RotationGestureHandler';
|
15
|
+
/**
|
16
|
+
* @deprecated RotationGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Rotation()` instead.
|
17
|
+
*/
|
18
|
+
|
15
19
|
exports.rotationHandlerName = rotationHandlerName;
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @deprecated RotationGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Rotation()` instead.
|
23
|
+
*/
|
16
24
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
17
25
|
const RotationGestureHandler = (0, _createHandler.default)({
|
18
26
|
name: rotationHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["RotationGestureHandler.ts"],"names":["rotationHandlerName","RotationGestureHandler","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;
|
1
|
+
{"version":3,"sources":["RotationGestureHandler.ts"],"names":["rotationHandlerName","RotationGestureHandler","name","allowedProps","baseGestureHandlerProps","config"],"mappings":";;;;;;;AACA;;AACA;;;;AAWO,MAAMA,mBAAmB,GAAG,wBAA5B;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAG,4BAGpC;AACAC,EAAAA,IAAI,EAAEF,mBADN;AAEAG,EAAAA,YAAY,EAAEC,6CAFd;AAGAC,EAAAA,MAAM,EAAE;AAHR,CAHoC,CAA/B","sourcesContent":["import { RotationGestureHandlerEventPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\n/**\n * @deprecated RotationGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Rotation()` instead.\n */\nexport interface RotationGestureHandlerProps\n extends BaseGestureHandlerProps<RotationGestureHandlerEventPayload> {}\n\nexport const rotationHandlerName = 'RotationGestureHandler';\n\n/**\n * @deprecated RotationGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Rotation()` instead.\n */\nexport type RotationGestureHandler = typeof RotationGestureHandler;\n\n/**\n * @deprecated RotationGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Rotation()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const RotationGestureHandler = createHandler<\n RotationGestureHandlerProps,\n RotationGestureHandlerEventPayload\n>({\n name: rotationHandlerName,\n allowedProps: baseGestureHandlerProps,\n config: {},\n});\n"]}
|
@@ -14,7 +14,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
14
14
|
const tapGestureHandlerProps = ['maxDurationMs', 'maxDelayMs', 'numberOfTaps', 'maxDeltaX', 'maxDeltaY', 'maxDist', 'minPointers'];
|
15
15
|
exports.tapGestureHandlerProps = tapGestureHandlerProps;
|
16
16
|
const tapHandlerName = 'TapGestureHandler';
|
17
|
+
/**
|
18
|
+
* @deprecated TapGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Tap()` instead.
|
19
|
+
*/
|
20
|
+
|
17
21
|
exports.tapHandlerName = tapHandlerName;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @deprecated TapGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Tap()` instead.
|
25
|
+
*/
|
18
26
|
// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file
|
19
27
|
const TapGestureHandler = (0, _createHandler.default)({
|
20
28
|
name: tapHandlerName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["TapGestureHandler.ts"],"names":["tapGestureHandlerProps","tapHandlerName","TapGestureHandler","name","allowedProps","baseGestureHandlerProps","config","shouldCancelWhenOutside"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,sBAAsB,GAAG,CACpC,eADoC,EAEpC,YAFoC,EAGpC,cAHoC,EAIpC,WAJoC,EAKpC,WALoC,EAMpC,SANoC,EAOpC,aAPoC,CAA/B;;
|
1
|
+
{"version":3,"sources":["TapGestureHandler.ts"],"names":["tapGestureHandlerProps","tapHandlerName","TapGestureHandler","name","allowedProps","baseGestureHandlerProps","config","shouldCancelWhenOutside"],"mappings":";;;;;;;AACA;;AACA;;;;AAKO,MAAMA,sBAAsB,GAAG,CACpC,eADoC,EAEpC,YAFoC,EAGpC,cAHoC,EAIpC,WAJoC,EAKpC,WALoC,EAMpC,SANoC,EAOpC,aAPoC,CAA/B;;AAoEA,MAAMC,cAAc,GAAG,mBAAvB;AAEP;AACA;AACA;;;;AAGA;AACA;AACA;AACA;AACO,MAAMC,iBAAiB,GAAG,4BAG/B;AACAC,EAAAA,IAAI,EAAEF,cADN;AAEAG,EAAAA,YAAY,EAAE,CACZ,GAAGC,6CADS,EAEZ,GAAGL,sBAFS,CAFd;AAMAM,EAAAA,MAAM,EAAE;AACNC,IAAAA,uBAAuB,EAAE;AADnB;AANR,CAH+B,CAA1B","sourcesContent":["import type { TapGestureHandlerEventPayload } from './GestureHandlerEventPayload';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const tapGestureHandlerProps = [\n 'maxDurationMs',\n 'maxDelayMs',\n 'numberOfTaps',\n 'maxDeltaX',\n 'maxDeltaY',\n 'maxDist',\n 'minPointers',\n] as const;\n\nexport interface TapGestureConfig {\n /**\n * Minimum number of pointers (fingers) required to be placed before the\n * handler activates. Should be a positive integer.\n * The default value is 1.\n */\n minPointers?: number;\n\n /**\n * Maximum time, expressed in milliseconds, that defines how fast a finger\n * must be released after a touch. The default value is 500.\n */\n maxDurationMs?: number;\n\n /**\n * Maximum time, expressed in milliseconds, that can pass before the next tap\n * if many taps are required. The default value is 500.\n */\n maxDelayMs?: number;\n\n /**\n * Number of tap gestures required to activate the handler. The default value\n * is 1.\n */\n numberOfTaps?: number;\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is\n * allowed to travel along the X axis during a tap gesture. If the finger\n * travels further than the defined distance along the X axis and the handler\n * hasn't yet activated, it will fail to recognize the gesture.\n */\n maxDeltaX?: number;\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is\n * allowed to travel along the Y axis during a tap gesture. If the finger\n * travels further than the defined distance along the Y axis and the handler\n * hasn't yet activated, it will fail to recognize the gesture.\n */\n maxDeltaY?: number;\n\n /**\n * Maximum distance, expressed in points, that defines how far the finger is\n * allowed to travel during a tap gesture. If the finger travels further than\n * the defined distance and the handler hasn't yet\n * activated, it will fail to recognize the gesture.\n */\n maxDist?: number;\n}\n\n/**\n * @deprecated TapGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Tap()` instead.\n */\nexport interface TapGestureHandlerProps\n extends BaseGestureHandlerProps<TapGestureHandlerEventPayload>,\n TapGestureConfig {}\n\nexport const tapHandlerName = 'TapGestureHandler';\n\n/**\n * @deprecated TapGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Tap()` instead.\n */\nexport type TapGestureHandler = typeof TapGestureHandler;\n\n/**\n * @deprecated TapGestureHandler will be removed in the future version of Gesture Handler. Use `Gesture.Tap()` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const TapGestureHandler = createHandler<\n TapGestureHandlerProps,\n TapGestureHandlerEventPayload\n>({\n name: tapHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...tapGestureHandlerProps,\n ] as const,\n config: {\n shouldCancelWhenOutside: true,\n },\n});\n"]}
|
@@ -347,6 +347,10 @@ function createHandler({
|
|
347
347
|
(_this$inspectorToggle = this.inspectorToggleListener) === null || _this$inspectorToggle === void 0 ? void 0 : _this$inspectorToggle.remove();
|
348
348
|
this.isMountedRef.current = false;
|
349
349
|
|
350
|
+
if (_reactNative.Platform.OS !== 'web') {
|
351
|
+
(0, _handlersRegistry.unregisterOldGestureHandler)(this.handlerTag);
|
352
|
+
}
|
353
|
+
|
350
354
|
_RNGestureHandlerModule.default.dropGestureHandler(this.handlerTag);
|
351
355
|
|
352
356
|
(0, _utils.scheduleFlushOperations)(); // We can't use this.props.id directly due to TS generic type narrowing bug, see https://github.com/microsoft/TypeScript/issues/13995 for more context
|
@@ -394,7 +398,7 @@ function createHandler({
|
|
394
398
|
render() {
|
395
399
|
var _this$props$testID;
|
396
400
|
|
397
|
-
if (__DEV__ && !this.context && !(0, _utils2.
|
401
|
+
if (__DEV__ && !this.context && !(0, _utils2.isTestEnv)() && _reactNative.Platform.OS !== 'web') {
|
398
402
|
throw new Error(name + ' must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.');
|
399
403
|
}
|
400
404
|
|
@@ -469,7 +473,7 @@ function createHandler({
|
|
469
473
|
return /*#__PURE__*/React.cloneElement(child, {
|
470
474
|
ref: this.refHandler,
|
471
475
|
collapsable: false,
|
472
|
-
...((0, _utils2.
|
476
|
+
...((0, _utils2.isTestEnv)() ? {
|
473
477
|
handlerType: name,
|
474
478
|
handlerTag: this.handlerTag,
|
475
479
|
enabled: this.props.enabled
|