UNPKG

react-native-gesture-handler

Version:

Declarative API exposing native platform touch and gesture system to React Native

29 lines (27 loc) 2.21 kB
"use strict"; import { SingleGestureName } from '../../types'; import { FlingNativeProperties } from '../gestures/fling/FlingTypes'; import { HoverNativeProperties } from '../gestures/hover/HoverTypes'; import { LongPressNativeProperties } from '../gestures/longPress/LongPressTypes'; import { NativeHandlerNativeProperties } from '../gestures/native/NativeTypes'; import { PanNativeProperties } from '../gestures/pan/PanTypes'; import { TapNativeProperties } from '../gestures/tap/TapTypes'; const CommonConfig = new Set(['enabled', 'shouldCancelWhenOutside', 'hitSlop', 'activeCursor', 'mouseButton', 'testID', 'cancelsTouchesInView', 'cancelsJSResponder', 'manualActivation']); const ExternalRelationsConfig = new Set(['simultaneousWith', 'requireToFail', 'block']); export const allowedNativeProps = new Set([...CommonConfig, // InternalConfigProps 'userSelect', 'enableContextMenu', 'touchAction', 'dispatchesReanimatedEvents', 'dispatchesAnimatedEvents', 'needsPointerData']); // Don't pass testID to the native side in production if (!__DEV__) { allowedNativeProps.delete('testID'); } export const HandlerCallbacks = new Set(['onBegin', 'onActivate', 'onUpdate', 'onDeactivate', 'onFinalize', 'onTouchesDown', 'onTouchesMove', 'onTouchesUp', 'onTouchesCancel']); export const PropsToFilter = new Set([...HandlerCallbacks, ...ExternalRelationsConfig, // Config props 'fillInDefaultValues', 'changeEventCalculator', 'disableReanimated', 'shouldUseReanimatedDetector', 'useAnimated', 'runOnJS', // Pan offset props before remapping: 'activeOffsetY', 'failOffsetX', 'failOffsetY', 'activeOffsetX']); export const PropsWhiteLists = new Map([[SingleGestureName.Pan, PanNativeProperties], [SingleGestureName.Tap, TapNativeProperties], [SingleGestureName.Native, NativeHandlerNativeProperties], [SingleGestureName.Fling, FlingNativeProperties], [SingleGestureName.Hover, HoverNativeProperties], [SingleGestureName.LongPress, LongPressNativeProperties]]); export const EMPTY_WHITE_LIST = new Set(); export const NativeWrapperProps = new Set([...CommonConfig, ...HandlerCallbacks, ...NativeHandlerNativeProperties, ...ExternalRelationsConfig, 'disableReanimated']); //# sourceMappingURL=propsWhiteList.js.map