react-native-gesture-handler 2.13.3 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/RNGestureHandler.podspec +19 -25
- package/android/build.gradle +3 -2
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +36 -72
- package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +13 -9
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +12 -14
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +8 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +34 -88
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +18 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +22 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +33 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +18 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +42 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/jni/CMakeLists.txt +14 -2
- package/ios/Handlers/RNHoverHandler.m +15 -14
- package/ios/RNGestureHandler.m +11 -0
- package/ios/RNGestureHandlerButtonComponentView.mm +2 -0
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +22 -0
- package/lib/commonjs/getReactNativeVersion.js.map +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js +11 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +8 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/utils.js +0 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +4 -15
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +27 -29
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +11 -3
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/getReactNativeVersion.js +10 -0
- package/lib/module/getReactNativeVersion.js.map +1 -0
- package/lib/module/getReactNativeVersion.web.js +4 -0
- package/lib/module/getReactNativeVersion.web.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector.js +12 -3
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +8 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/utils.js +0 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +4 -15
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +27 -29
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +11 -3
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/typescript/ActionType.d.ts +1 -1
- package/lib/typescript/Directions.d.ts +1 -1
- package/lib/typescript/PlatformConstants.d.ts +1 -1
- package/lib/typescript/RNGestureHandlerModule.d.ts +1 -1
- package/lib/typescript/State.d.ts +1 -1
- package/lib/typescript/TouchEventType.d.ts +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +9 -9
- package/lib/typescript/components/GestureButtons.d.ts +3 -3
- package/lib/typescript/components/GestureComponents.d.ts +6 -6
- package/lib/typescript/components/GestureComponents.web.d.ts +1 -1
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +2 -1
- package/lib/typescript/components/GestureHandlerRootView.d.ts +2 -1
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +2 -1
- package/lib/typescript/components/Swipeable.d.ts +4 -4
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +4 -3
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +4 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +7 -6
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +3 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +1 -1
- package/lib/typescript/getReactNativeVersion.d.ts +4 -0
- package/lib/typescript/getReactNativeVersion.web.d.ts +1 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +3 -3
- package/lib/typescript/handlers/PanGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/TapGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/createHandler.d.ts +1 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +11 -10
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +32 -32
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +2 -2
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/gesture.d.ts +7 -5
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +4 -4
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +3 -3
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/panGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +1 -1
- package/lib/typescript/jestUtils/jestUtils.d.ts +6 -6
- package/lib/typescript/typeUtils.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -5
- package/lib/typescript/web/interfaces.d.ts +4 -3
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +0 -1
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -1
- package/lib/typescript/web_hammer/GestureHandler.d.ts +2 -2
- package/package.json +7 -7
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -1
- package/src/getReactNativeVersion.ts +11 -0
- package/src/getReactNativeVersion.web.ts +3 -0
- package/src/handlers/gestureHandlerCommon.ts +6 -1
- package/src/handlers/gestures/GestureDetector.tsx +9 -6
- package/src/handlers/gestures/gesture.ts +9 -1
- package/src/utils.ts +0 -8
- package/src/web/handlers/GestureHandler.ts +1 -1
- package/src/web/interfaces.ts +1 -0
- package/src/web/tools/GestureHandlerOrchestrator.ts +4 -13
- package/src/web/tools/InteractionManager.ts +37 -30
- package/src/web/tools/PointerEventManager.ts +12 -3
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +0 -8
- /package/android/{src/fabric → fabric/src/main}/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +0 -0
- /package/android/{src/fabric → fabric/src/main}/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["PointerEventManager.ts"],"names":["EventTypes","PointerType","EventManager","isPointerInBounds","PointerEventManager","Set","setListeners","view","addEventListener","event","pointerType","TOUCH","x","clientX","y","clientY","adaptedEvent","mapEvent","DOWN","target","setPointerCapture","pointerId","markAsInBounds","trackedPointers","add","activePointersCounter","eventType","ADDITIONAL_POINTER_DOWN","onPointerAdd","onPointerDown","UP","releasePointerCapture","markAsOutOfBounds","delete","ADDITIONAL_POINTER_UP","onPointerRemove","onPointerUp","MOVE","hasPointerCapture","inBounds","pointerIndex","pointersInBounds","indexOf","ENTER","onPointerEnter","onPointerMove","LEAVE","onPointerLeave","onPointerOutOfBounds","CANCEL","onPointerCancel","clear","onPointerMoveOver","onPointerMoveOut","has","offsetX","offsetY","buttons","time","timeStamp","resetManager"],"mappings":";;AAAA,SAAuBA,UAAvB,EAAmCC,WAAnC,QAAsD,eAAtD;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,SAASC,iBAAT,QAAkC,UAAlC;AAEA,eAAe,MAAMC,mBAAN,SAAkCF,YAAlC,CAA4D;AAAA;AAAA;;AAAA,6CAC/C,IAAIG,GAAJ,EAD+C;AAAA;;AAGlEC,EAAAA,YAAY,GAAS;AAC1B,SAAKC,IAAL,CAAUC,gBAAV,CAA2B,aAA3B,EAA2CC,KAAD,IAA+B;AACvE,UAAIA,KAAK,CAACC,WAAN,KAAsBT,WAAW,CAACU,KAAtC,EAA6C;AAC3C;AACD;;AACD,UACE,CAACR,iBAAiB,CAAC,KAAKI,IAAN,EAAY;AAAEK,QAAAA,CAAC,EAAEH,KAAK,CAACI,OAAX;AAAoBC,QAAAA,CAAC,EAAEL,KAAK,CAACM;AAA7B,OAAZ,CADpB,EAEE;AACA;AACD;;AAED,YAAMC,YAA0B,GAAG,KAAKC,QAAL,CAAcR,KAAd,EAAqBT,UAAU,CAACkB,IAAhC,CAAnC;AACA,YAAMC,MAAM,GAAGV,KAAK,CAACU,MAArB;AAEAA,MAAAA,MAAM,CAACC,iBAAP,CAAyBJ,YAAY,CAACK,SAAtC;AACA,WAAKC,cAAL,CAAoBN,YAAY,CAACK,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eAAL,CAAqB4B,KAArB;AACD;AACF,KAhBH;AAkBD;;AAESlC,EAAAA,QAAQ,CAACR,KAAD,EAAsBiB,SAAtB,EAA2D;AAC3E,WAAO;AACLd,MAAAA,CAAC,EAAEH,KAAK,CAACI,OADJ;AAELC,MAAAA,CAAC,EAAEL,KAAK,CAACM,OAFJ;AAGLwC,MAAAA,OAAO,EAAE9C,KAAK,CAAC8C,OAHV;AAILC,MAAAA,OAAO,EAAE/C,KAAK,CAAC+C,OAJV;AAKLnC,MAAAA,SAAS,EAAEZ,KAAK,CAACY,SALZ;AAMLK,MAAAA,SAAS,EAAEA,SANN;AAOLhB,MAAAA,WAAW,EAAED,KAAK,CAACC,WAPd;AAQL+C,MAAAA,OAAO,EAAEhD,KAAK,CAACgD,OARV;AASLC,MAAAA,IAAI,EAAEjD,KAAK,CAACkD;AATP,KAAP;AAWD;;AAEMC,EAAAA,YAAY,GAAS;AAC1B,UAAMA,YAAN;AACA,SAAKrC,eAAL,CAAqB4B,KAArB;AACD;;AA3LwE","sourcesContent":["import { AdaptedEvent, EventTypes, PointerType } from '../interfaces';\nimport EventManager from './EventManager';\nimport { isPointerInBounds } from '../utils';\n\nexport default class PointerEventManager extends EventManager<HTMLElement> {\n private trackedPointers = new Set<number>();\n\n public setListeners(): void {\n this.view.addEventListener('pointerdown', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n if (\n !isPointerInBounds(this.view, { x: event.clientX, y: event.clientY })\n ) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.DOWN);\n const target = event.target as HTMLElement;\n\n target.setPointerCapture(adaptedEvent.pointerId);\n this.markAsInBounds(adaptedEvent.pointerId);\n this.trackedPointers.add(adaptedEvent.pointerId);\n\n if (++this.activePointersCounter > 1) {\n adaptedEvent.eventType = EventTypes.ADDITIONAL_POINTER_DOWN;\n this.onPointerAdd(adaptedEvent);\n } else {\n this.onPointerDown(adaptedEvent);\n }\n });\n\n this.view.addEventListener('pointerup', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n // When we call reset on gesture handlers, it also resets their event managers\n // In some handlers (like RotationGestureHandler) reset is called before all pointers leave view\n // This means, that activePointersCounter will be set to 0, while there are still remaining pointers on view\n // Removing them will end in activePointersCounter going below 0, therefore handlers won't behave properly\n if (this.activePointersCounter === 0) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.UP);\n const target = event.target as HTMLElement;\n\n target.releasePointerCapture(adaptedEvent.pointerId);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n this.trackedPointers.delete(adaptedEvent.pointerId);\n\n if (--this.activePointersCounter > 0) {\n adaptedEvent.eventType = EventTypes.ADDITIONAL_POINTER_UP;\n this.onPointerRemove(adaptedEvent);\n } else {\n this.onPointerUp(adaptedEvent);\n }\n });\n\n this.view.addEventListener('pointermove', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.MOVE);\n const target = event.target as HTMLElement;\n\n // You may be wondering why are we setting pointer capture here, when we\n // already set it in `pointerdown` handler. Well, that's a great question,\n // for which I don't have an answer. Specification (https://www.w3.org/TR/pointerevents2/#dom-element-setpointercapture)\n // says that the requirement for `setPointerCapture` to work is that pointer\n // must be in 'active buttons state`, otherwise it will fail silently, which\n // is lovely. Obviously, when `pointerdown` is fired, one of the buttons\n // (when using mouse) is pressed, but that doesn't mean that `setPointerCapture`\n // will succeed, for some reason. Since it fails silently, we don't actually know\n // if it worked or not (there's `gotpointercapture` event, but the complexity of\n // incorporating it here seems stupid), so we just call it again here, every time\n // pointer moves until it succeeds.\n // God, I do love web development.\n if (!target.hasPointerCapture(event.pointerId)) {\n target.setPointerCapture(event.pointerId);\n }\n\n const inBounds: boolean = isPointerInBounds(this.view, {\n x: adaptedEvent.x,\n y: adaptedEvent.y,\n });\n\n const pointerIndex: number = this.pointersInBounds.indexOf(\n adaptedEvent.pointerId\n );\n\n if (inBounds) {\n if (pointerIndex < 0) {\n adaptedEvent.eventType = EventTypes.ENTER;\n this.onPointerEnter(adaptedEvent);\n this.markAsInBounds(adaptedEvent.pointerId);\n } else {\n this.onPointerMove(adaptedEvent);\n }\n } else {\n if (pointerIndex >= 0) {\n adaptedEvent.eventType = EventTypes.LEAVE;\n this.onPointerLeave(adaptedEvent);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n } else {\n this.onPointerOutOfBounds(adaptedEvent);\n }\n }\n });\n\n this.view.addEventListener('pointercancel', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.CANCEL\n );\n\n this.onPointerCancel(adaptedEvent);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n this.activePointersCounter = 0;\n this.trackedPointers.clear();\n });\n\n // onPointerEnter and onPointerLeave are triggered by a custom logic responsible for\n // handling shouldCancelWhenOutside flag, and are unreliable unless the pointer is down.\n // We therefore use pointerenter and pointerleave events to handle the hover gesture,\n // mapping them to onPointerMoveOver and onPointerMoveOut respectively.\n\n this.view.addEventListener('pointerenter', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.ENTER);\n\n this.onPointerMoveOver(adaptedEvent);\n });\n\n this.view.addEventListener('pointerleave', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.LEAVE);\n\n this.onPointerMoveOut(adaptedEvent);\n });\n\n this.view.addEventListener(\n 'lostpointercapture',\n (event: PointerEvent): void => {\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.CANCEL\n );\n\n if (this.trackedPointers.has(adaptedEvent.pointerId)) {\n // in some cases the `pointerup` event is not fired, but `lostpointercapture` is\n // we simulate the `pointercancel` event here to make sure the gesture handler stops tracking it\n this.onPointerCancel(adaptedEvent);\n\n this.activePointersCounter = 0;\n this.trackedPointers.clear();\n }\n }\n );\n }\n\n protected mapEvent(event: PointerEvent, eventType: EventTypes): AdaptedEvent {\n return {\n x: event.clientX,\n y: event.clientY,\n offsetX: event.offsetX,\n offsetY: event.offsetY,\n pointerId: event.pointerId,\n eventType: eventType,\n pointerType: event.pointerType as PointerType,\n buttons: event.buttons,\n time: event.timeStamp,\n };\n }\n\n public resetManager(): void {\n super.resetManager();\n this.trackedPointers.clear();\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["PointerEventManager.ts"],"names":["EventTypes","PointerType","EventManager","isPointerInBounds","PointerEventManager","Set","setListeners","view","addEventListener","event","pointerType","TOUCH","x","clientX","y","clientY","adaptedEvent","mapEvent","DOWN","target","HTMLDivElement","setPointerCapture","pointerId","markAsInBounds","trackedPointers","add","activePointersCounter","eventType","ADDITIONAL_POINTER_DOWN","onPointerAdd","onPointerDown","UP","releasePointerCapture","markAsOutOfBounds","delete","ADDITIONAL_POINTER_UP","onPointerRemove","onPointerUp","MOVE","hasPointerCapture","inBounds","pointerIndex","pointersInBounds","indexOf","ENTER","onPointerEnter","onPointerMove","LEAVE","onPointerLeave","onPointerOutOfBounds","CANCEL","onPointerCancel","clear","onPointerMoveOver","onPointerMoveOut","has","offsetX","offsetY","buttons","time","timeStamp","resetManager"],"mappings":";;AAAA,SAAuBA,UAAvB,EAAmCC,WAAnC,QAAsD,eAAtD;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,SAASC,iBAAT,QAAkC,UAAlC;AAEA,eAAe,MAAMC,mBAAN,SAAkCF,YAAlC,CAA4D;AAAA;AAAA;;AAAA,6CAC/C,IAAIG,GAAJ,EAD+C;AAAA;;AAGlEC,EAAAA,YAAY,GAAS;AAC1B,SAAKC,IAAL,CAAUC,gBAAV,CAA2B,aAA3B,EAA2CC,KAAD,IAA+B;AACvE,UAAIA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{ AdaptedEvent, EventTypes, PointerType } from '../interfaces';\nimport EventManager from './EventManager';\nimport { isPointerInBounds } from '../utils';\n\nexport default class PointerEventManager extends EventManager<HTMLElement> {\n private trackedPointers = new Set<number>();\n\n public setListeners(): void {\n this.view.addEventListener('pointerdown', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n if (\n !isPointerInBounds(this.view, { x: event.clientX, y: event.clientY })\n ) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.DOWN);\n const target = event.target as HTMLElement;\n\n if (target instanceof HTMLDivElement) {\n target.setPointerCapture(adaptedEvent.pointerId);\n }\n\n this.markAsInBounds(adaptedEvent.pointerId);\n this.trackedPointers.add(adaptedEvent.pointerId);\n\n if (++this.activePointersCounter > 1) {\n adaptedEvent.eventType = EventTypes.ADDITIONAL_POINTER_DOWN;\n this.onPointerAdd(adaptedEvent);\n } else {\n this.onPointerDown(adaptedEvent);\n }\n });\n\n this.view.addEventListener('pointerup', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n // When we call reset on gesture handlers, it also resets their event managers\n // In some handlers (like RotationGestureHandler) reset is called before all pointers leave view\n // This means, that activePointersCounter will be set to 0, while there are still remaining pointers on view\n // Removing them will end in activePointersCounter going below 0, therefore handlers won't behave properly\n if (this.activePointersCounter === 0) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.UP);\n const target = event.target as HTMLElement;\n\n if (target instanceof HTMLDivElement) {\n target.releasePointerCapture(adaptedEvent.pointerId);\n }\n\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n this.trackedPointers.delete(adaptedEvent.pointerId);\n\n if (--this.activePointersCounter > 0) {\n adaptedEvent.eventType = EventTypes.ADDITIONAL_POINTER_UP;\n this.onPointerRemove(adaptedEvent);\n } else {\n this.onPointerUp(adaptedEvent);\n }\n });\n\n this.view.addEventListener('pointermove', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.MOVE);\n const target = event.target as HTMLElement;\n\n // You may be wondering why are we setting pointer capture here, when we\n // already set it in `pointerdown` handler. Well, that's a great question,\n // for which I don't have an answer. Specification (https://www.w3.org/TR/pointerevents2/#dom-element-setpointercapture)\n // says that the requirement for `setPointerCapture` to work is that pointer\n // must be in 'active buttons state`, otherwise it will fail silently, which\n // is lovely. Obviously, when `pointerdown` is fired, one of the buttons\n // (when using mouse) is pressed, but that doesn't mean that `setPointerCapture`\n // will succeed, for some reason. Since it fails silently, we don't actually know\n // if it worked or not (there's `gotpointercapture` event, but the complexity of\n // incorporating it here seems stupid), so we just call it again here, every time\n // pointer moves until it succeeds.\n // God, I do love web development.\n if (\n !target.hasPointerCapture(event.pointerId) &&\n target instanceof HTMLDivElement\n ) {\n target.setPointerCapture(event.pointerId);\n }\n\n const inBounds: boolean = isPointerInBounds(this.view, {\n x: adaptedEvent.x,\n y: adaptedEvent.y,\n });\n\n const pointerIndex: number = this.pointersInBounds.indexOf(\n adaptedEvent.pointerId\n );\n\n if (inBounds) {\n if (pointerIndex < 0) {\n adaptedEvent.eventType = EventTypes.ENTER;\n this.onPointerEnter(adaptedEvent);\n this.markAsInBounds(adaptedEvent.pointerId);\n } else {\n this.onPointerMove(adaptedEvent);\n }\n } else {\n if (pointerIndex >= 0) {\n adaptedEvent.eventType = EventTypes.LEAVE;\n this.onPointerLeave(adaptedEvent);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n } else {\n this.onPointerOutOfBounds(adaptedEvent);\n }\n }\n });\n\n this.view.addEventListener('pointercancel', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.CANCEL\n );\n\n this.onPointerCancel(adaptedEvent);\n this.markAsOutOfBounds(adaptedEvent.pointerId);\n this.activePointersCounter = 0;\n this.trackedPointers.clear();\n });\n\n // onPointerEnter and onPointerLeave are triggered by a custom logic responsible for\n // handling shouldCancelWhenOutside flag, and are unreliable unless the pointer is down.\n // We therefore use pointerenter and pointerleave events to handle the hover gesture,\n // mapping them to onPointerMoveOver and onPointerMoveOut respectively.\n\n this.view.addEventListener('pointerenter', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.ENTER);\n\n this.onPointerMoveOver(adaptedEvent);\n });\n\n this.view.addEventListener('pointerleave', (event: PointerEvent): void => {\n if (event.pointerType === PointerType.TOUCH) {\n return;\n }\n\n const adaptedEvent: AdaptedEvent = this.mapEvent(event, EventTypes.LEAVE);\n\n this.onPointerMoveOut(adaptedEvent);\n });\n\n this.view.addEventListener(\n 'lostpointercapture',\n (event: PointerEvent): void => {\n const adaptedEvent: AdaptedEvent = this.mapEvent(\n event,\n EventTypes.CANCEL\n );\n\n if (this.trackedPointers.has(adaptedEvent.pointerId)) {\n // in some cases the `pointerup` event is not fired, but `lostpointercapture` is\n // we simulate the `pointercancel` event here to make sure the gesture handler stops tracking it\n this.onPointerCancel(adaptedEvent);\n\n this.activePointersCounter = 0;\n this.trackedPointers.clear();\n }\n }\n );\n }\n\n protected mapEvent(event: PointerEvent, eventType: EventTypes): AdaptedEvent {\n return {\n x: event.clientX,\n y: event.clientY,\n offsetX: event.offsetX,\n offsetY: event.offsetY,\n pointerId: event.pointerId,\n eventType: eventType,\n pointerType: event.pointerType as PointerType,\n buttons: event.buttons,\n time: event.timeStamp,\n };\n }\n\n public resetManager(): void {\n super.resetManager();\n this.trackedPointers.clear();\n }\n}\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ActionType } from './ActionType';
|
2
|
-
export
|
2
|
+
export type RNGestureHandlerModuleProps = {
|
3
3
|
handleSetJSResponder: (tag: number, blockNativeResponder: boolean) => void;
|
4
4
|
handleClearJSResponder: () => void;
|
5
5
|
createGestureHandler: (handlerName: string, handlerTag: number, config: Readonly<Record<string, unknown>>) => void;
|
@@ -5,4 +5,4 @@ export declare const TouchEventType: {
|
|
5
5
|
readonly TOUCHES_UP: 3;
|
6
6
|
readonly TOUCHES_CANCELLED: 4;
|
7
7
|
};
|
8
|
-
export
|
8
|
+
export type TouchEventType = typeof TouchEventType[keyof typeof TouchEventType];
|
@@ -3,12 +3,12 @@ import { Component } from 'react';
|
|
3
3
|
import { Animated, StatusBarAnimation, StyleProp, ViewStyle } from 'react-native';
|
4
4
|
import { UserSelect, ActiveCursor } from '../handlers/gestureHandlerCommon';
|
5
5
|
import { PanGestureHandler } from '../handlers/PanGestureHandler';
|
6
|
-
export
|
7
|
-
export
|
8
|
-
export
|
9
|
-
export
|
10
|
-
export
|
11
|
-
|
6
|
+
export type DrawerPosition = 'left' | 'right';
|
7
|
+
export type DrawerState = 'Idle' | 'Dragging' | 'Settling';
|
8
|
+
export type DrawerType = 'front' | 'back' | 'slide';
|
9
|
+
export type DrawerLockMode = 'unlocked' | 'locked-closed' | 'locked-open';
|
10
|
+
export type DrawerKeyboardDismissMode = 'none' | 'on-drag';
|
11
|
+
type AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;
|
12
12
|
export interface DrawerLayoutProps {
|
13
13
|
/**
|
14
14
|
* This attribute is present in the standard implementation already and is one
|
@@ -94,7 +94,7 @@ export interface DrawerLayoutProps {
|
|
94
94
|
*/
|
95
95
|
activeCursor?: ActiveCursor;
|
96
96
|
}
|
97
|
-
export
|
97
|
+
export type DrawerLayoutState = {
|
98
98
|
dragX: Animated.Value;
|
99
99
|
touchX: Animated.Value;
|
100
100
|
drawerTranslation: Animated.Value;
|
@@ -102,7 +102,7 @@ export declare type DrawerLayoutState = {
|
|
102
102
|
drawerState: DrawerState;
|
103
103
|
drawerOpened: boolean;
|
104
104
|
};
|
105
|
-
export
|
105
|
+
export type DrawerMovementOption = {
|
106
106
|
velocity?: number;
|
107
107
|
speed?: number;
|
108
108
|
};
|
@@ -143,6 +143,6 @@ export default class DrawerLayout extends Component<DrawerLayoutProps, DrawerLay
|
|
143
143
|
private renderOverlay;
|
144
144
|
private renderDrawer;
|
145
145
|
private setPanGestureRef;
|
146
|
-
render(): JSX.Element;
|
146
|
+
render(): React.JSX.Element;
|
147
147
|
}
|
148
148
|
export {};
|
@@ -96,7 +96,7 @@ export declare class BaseButton extends React.Component<BaseButtonProps> {
|
|
96
96
|
private onLongPress;
|
97
97
|
private onHandlerStateChange;
|
98
98
|
private onGestureEvent;
|
99
|
-
render(): JSX.Element;
|
99
|
+
render(): React.JSX.Element;
|
100
100
|
}
|
101
101
|
export declare class RectButton extends React.Component<RectButtonProps> {
|
102
102
|
static defaultProps: {
|
@@ -106,7 +106,7 @@ export declare class RectButton extends React.Component<RectButtonProps> {
|
|
106
106
|
private opacity;
|
107
107
|
constructor(props: RectButtonProps);
|
108
108
|
private onActiveStateChange;
|
109
|
-
render(): JSX.Element;
|
109
|
+
render(): React.JSX.Element;
|
110
110
|
}
|
111
111
|
export declare class BorderlessButton extends React.Component<BorderlessButtonProps> {
|
112
112
|
static defaultProps: {
|
@@ -116,6 +116,6 @@ export declare class BorderlessButton extends React.Component<BorderlessButtonPr
|
|
116
116
|
private opacity;
|
117
117
|
constructor(props: BorderlessButtonProps);
|
118
118
|
private onActiveStateChange;
|
119
|
-
render(): JSX.Element;
|
119
|
+
render(): React.JSX.Element;
|
120
120
|
}
|
121
121
|
export { default as PureNativeButton } from './GestureHandlerButton';
|
@@ -3,20 +3,20 @@ import { PropsWithChildren, ForwardedRef, RefAttributes, ReactElement } from 're
|
|
3
3
|
import { ScrollView as RNScrollView, ScrollViewProps as RNScrollViewProps, Switch as RNSwitch, SwitchProps as RNSwitchProps, TextInput as RNTextInput, TextInputProps as RNTextInputProps, DrawerLayoutAndroid as RNDrawerLayoutAndroid, DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps, FlatList as RNFlatList, FlatListProps as RNFlatListProps, RefreshControl as RNRefreshControl } from 'react-native';
|
4
4
|
import { NativeViewGestureHandlerProps } from '../handlers/NativeViewGestureHandler';
|
5
5
|
export declare const RefreshControl: React.ForwardRefExoticComponent<import("react-native").RefreshControlProps & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
6
|
-
export
|
6
|
+
export type RefreshControl = typeof RefreshControl & RNRefreshControl;
|
7
7
|
declare const GHScrollView: React.ForwardRefExoticComponent<RNScrollViewProps & {
|
8
8
|
children?: React.ReactNode;
|
9
9
|
} & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
10
10
|
export declare const ScrollView: React.ForwardRefExoticComponent<RNScrollViewProps & NativeViewGestureHandlerProps & React.RefAttributes<RNScrollView>>;
|
11
|
-
export
|
11
|
+
export type ScrollView = typeof GHScrollView & RNScrollView;
|
12
12
|
export declare const Switch: React.ForwardRefExoticComponent<RNSwitchProps & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
13
|
-
export
|
13
|
+
export type Switch = typeof Switch & RNSwitch;
|
14
14
|
export declare const TextInput: React.ForwardRefExoticComponent<RNTextInputProps & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
15
|
-
export
|
15
|
+
export type TextInput = typeof TextInput & RNTextInput;
|
16
16
|
export declare const DrawerLayoutAndroid: React.ForwardRefExoticComponent<RNDrawerLayoutAndroidProps & {
|
17
17
|
children?: React.ReactNode;
|
18
18
|
} & NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
19
|
-
export
|
19
|
+
export type DrawerLayoutAndroid = typeof DrawerLayoutAndroid & RNDrawerLayoutAndroid;
|
20
20
|
export declare const FlatList: <ItemT = any>(props: React.PropsWithChildren<RNFlatListProps<ItemT> & React.RefAttributes<FlatList<ItemT>> & NativeViewGestureHandlerProps>, ref: React.ForwardedRef<FlatList<ItemT>>) => ReactElement | null;
|
21
|
-
export
|
21
|
+
export type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;
|
22
22
|
export {};
|
@@ -3,6 +3,6 @@ import { FlatListProps } from 'react-native';
|
|
3
3
|
export declare const ScrollView: React.ForwardRefExoticComponent<import("react-native").ScrollViewProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
4
4
|
export declare const Switch: React.ForwardRefExoticComponent<import("react-native").SwitchProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
5
5
|
export declare const TextInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
6
|
-
export declare const DrawerLayoutAndroid: () => JSX.Element;
|
6
|
+
export declare const DrawerLayoutAndroid: () => React.JSX.Element;
|
7
7
|
export declare const RefreshControl: React.ForwardRefExoticComponent<import("react-native").ViewProps & import("..").NativeViewGestureHandlerProps & React.RefAttributes<React.ComponentType<any>>>;
|
8
8
|
export declare const FlatList: React.ForwardRefExoticComponent<FlatListProps<unknown> & React.RefAttributes<unknown>>;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
import { PropsWithChildren } from 'react';
|
2
3
|
import { ViewProps } from 'react-native';
|
3
4
|
export interface GestureHandlerRootViewProps extends PropsWithChildren<ViewProps> {
|
4
5
|
}
|
5
|
-
export default function GestureHandlerRootView(props: GestureHandlerRootViewProps): JSX.Element;
|
6
|
+
export default function GestureHandlerRootView(props: GestureHandlerRootViewProps): React.JSX.Element;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
import { PropsWithChildren } from 'react';
|
2
3
|
import { ViewProps } from 'react-native';
|
3
4
|
export interface GestureHandlerRootViewProps extends PropsWithChildren<ViewProps> {
|
4
5
|
}
|
5
|
-
export default function GestureHandlerRootView(props: GestureHandlerRootViewProps): JSX.Element;
|
6
|
+
export default function GestureHandlerRootView(props: GestureHandlerRootViewProps): React.JSX.Element;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
import { PropsWithChildren } from 'react';
|
2
3
|
import { ViewProps } from 'react-native';
|
3
4
|
export interface GestureHandlerRootViewProps extends PropsWithChildren<ViewProps> {
|
4
5
|
}
|
5
|
-
export default function GestureHandlerRootView(props: GestureHandlerRootViewProps): JSX.Element;
|
6
|
+
export default function GestureHandlerRootView(props: GestureHandlerRootViewProps): React.JSX.Element;
|
@@ -2,8 +2,8 @@ import * as React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
3
3
|
import { Animated, StyleProp, ViewStyle } from 'react-native';
|
4
4
|
import { PanGestureHandlerProps } from '../handlers/PanGestureHandler';
|
5
|
-
|
6
|
-
|
5
|
+
type SwipeableExcludes = Exclude<keyof PanGestureHandlerProps, 'onGestureEvent' | 'onHandlerStateChange'>;
|
6
|
+
type AnimatedInterpolation = ReturnType<Animated.Value['interpolate']>;
|
7
7
|
export interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableExcludes> {
|
8
8
|
/**
|
9
9
|
* Enables two-finger gestures on supported devices, for example iPads with
|
@@ -140,7 +140,7 @@ export interface SwipeableProps extends Pick<PanGestureHandlerProps, SwipeableEx
|
|
140
140
|
*/
|
141
141
|
childrenContainerStyle?: StyleProp<ViewStyle>;
|
142
142
|
}
|
143
|
-
|
143
|
+
type SwipeableState = {
|
144
144
|
dragX: Animated.Value;
|
145
145
|
rowTranslation: Animated.Value;
|
146
146
|
rowState: number;
|
@@ -173,6 +173,6 @@ export default class Swipeable extends Component<SwipeableProps, SwipeableState>
|
|
173
173
|
openLeft: () => void;
|
174
174
|
openRight: () => void;
|
175
175
|
reset: () => void;
|
176
|
-
render(): JSX.Element;
|
176
|
+
render(): React.JSX.Element;
|
177
177
|
}
|
178
178
|
export {};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
import { Component } from 'react';
|
2
3
|
import { StyleProp, ViewStyle, TouchableWithoutFeedbackProps, Insets } from 'react-native';
|
3
4
|
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlerCommon';
|
@@ -15,7 +16,7 @@ export declare const TOUCHABLE_STATE: {
|
|
15
16
|
readonly BEGAN: 1;
|
16
17
|
readonly MOVED_OUTSIDE: 2;
|
17
18
|
};
|
18
|
-
|
19
|
+
type TouchableState = typeof TOUCHABLE_STATE[keyof typeof TOUCHABLE_STATE];
|
19
20
|
export interface GenericTouchableProps extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
20
21
|
onPress?: () => void;
|
21
22
|
onPressIn?: () => void;
|
@@ -31,7 +32,7 @@ interface InternalProps {
|
|
31
32
|
extraButtonProps: TouchableNativeFeedbackExtraProps;
|
32
33
|
onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
|
33
34
|
}
|
34
|
-
|
35
|
+
type Timeout = ReturnType<typeof setTimeout> | null | undefined;
|
35
36
|
/**
|
36
37
|
* GenericTouchable is not intented to be used as it is.
|
37
38
|
* Should be treated as a source for the rest of touchables
|
@@ -62,6 +63,6 @@ export default class GenericTouchable extends Component<GenericTouchableProps &
|
|
62
63
|
componentWillUnmount(): void;
|
63
64
|
onMoveIn(): void;
|
64
65
|
onMoveOut(): void;
|
65
|
-
render(): JSX.Element;
|
66
|
+
render(): React.JSX.Element;
|
66
67
|
}
|
67
68
|
export {};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import * as React from 'react';
|
1
2
|
import { Component } from 'react';
|
2
3
|
import { GenericTouchableProps } from './GenericTouchable';
|
3
4
|
import { TouchableHighlightProps as RNTouchableHighlightProps, ColorValue } from 'react-native';
|
@@ -9,7 +10,7 @@ interface State {
|
|
9
10
|
backgroundColor?: ColorValue;
|
10
11
|
};
|
11
12
|
}
|
12
|
-
export
|
13
|
+
export type TouchableHighlightProps = RNTouchableHighlightProps & GenericTouchableProps;
|
13
14
|
/**
|
14
15
|
* TouchableHighlight follows RN's implementation
|
15
16
|
*/
|
@@ -28,8 +29,8 @@ export default class TouchableHighlight extends Component<TouchableHighlightProp
|
|
28
29
|
showUnderlay: () => void;
|
29
30
|
hasPressHandler: () => (((event: import("react-native").GestureResponderEvent) => void) & (() => void)) | undefined;
|
30
31
|
hideUnderlay: () => void;
|
31
|
-
renderChildren(): JSX.Element;
|
32
|
+
renderChildren(): React.JSX.Element;
|
32
33
|
onStateChange: (_from: number, to: number) => void;
|
33
|
-
render(): JSX.Element;
|
34
|
+
render(): React.JSX.Element;
|
34
35
|
}
|
35
36
|
export {};
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps, ColorValue } from 'react-native';
|
2
|
+
import * as React from 'react';
|
2
3
|
import { Component } from 'react';
|
3
4
|
import { GenericTouchableProps } from './GenericTouchable';
|
4
|
-
export
|
5
|
+
export type TouchableNativeFeedbackExtraProps = {
|
5
6
|
borderless?: boolean;
|
6
7
|
rippleColor?: number | null;
|
7
8
|
rippleRadius?: number | null;
|
8
9
|
foreground?: boolean;
|
9
10
|
};
|
10
|
-
export
|
11
|
+
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps & GenericTouchableProps;
|
11
12
|
/**
|
12
13
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
13
14
|
* There's small difference with handling long press ripple since RN's implementation calls
|
@@ -22,17 +23,17 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
|
|
22
23
|
};
|
23
24
|
delayLongPress: number;
|
24
25
|
};
|
25
|
-
static SelectableBackground: (rippleRadius?: number
|
26
|
+
static SelectableBackground: (rippleRadius?: number) => {
|
26
27
|
type: string;
|
27
28
|
attribute: string;
|
28
29
|
rippleRadius: number | undefined;
|
29
30
|
};
|
30
|
-
static SelectableBackgroundBorderless: (rippleRadius?: number
|
31
|
+
static SelectableBackgroundBorderless: (rippleRadius?: number) => {
|
31
32
|
type: string;
|
32
33
|
attribute: string;
|
33
34
|
rippleRadius: number | undefined;
|
34
35
|
};
|
35
|
-
static Ripple: (color: ColorValue, borderless: boolean, rippleRadius?: number
|
36
|
+
static Ripple: (color: ColorValue, borderless: boolean, rippleRadius?: number) => {
|
36
37
|
type: string;
|
37
38
|
color: ColorValue;
|
38
39
|
borderless: boolean;
|
@@ -40,5 +41,5 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
|
|
40
41
|
};
|
41
42
|
static canUseNativeForeground: () => boolean;
|
42
43
|
getExtraButtonProps(): TouchableNativeFeedbackExtraProps;
|
43
|
-
render(): JSX.Element;
|
44
|
+
render(): React.JSX.Element;
|
44
45
|
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { Animated, TouchableOpacityProps as RNTouchableOpacityProps } from 'react-native';
|
2
2
|
import { GenericTouchableProps } from './GenericTouchable';
|
3
|
+
import * as React from 'react';
|
3
4
|
import { Component } from 'react';
|
4
|
-
export
|
5
|
+
export type TouchableOpacityProps = RNTouchableOpacityProps & GenericTouchableProps & {
|
5
6
|
useNativeAnimations?: boolean;
|
6
7
|
};
|
7
8
|
/**
|
@@ -20,5 +21,5 @@ export default class TouchableOpacity extends Component<TouchableOpacityProps> {
|
|
20
21
|
opacity: Animated.Value;
|
21
22
|
setOpacityTo: (value: number, duration: number) => void;
|
22
23
|
onStateChange: (_from: number, to: number) => void;
|
23
|
-
render(): JSX.Element;
|
24
|
+
render(): React.JSX.Element;
|
24
25
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import GenericTouchable, { GenericTouchableProps } from './GenericTouchable';
|
3
|
-
export
|
3
|
+
export type TouchableWithoutFeedbackProps = GenericTouchable;
|
4
4
|
declare const TouchableWithoutFeedback: React.ForwardRefExoticComponent<GenericTouchableProps & {
|
5
5
|
children?: React.ReactNode;
|
6
6
|
} & React.RefAttributes<GenericTouchable>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function getReactNativeVersion(): void;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
2
|
export declare const flingGestureHandlerProps: readonly ["numberOfPointers", "direction"];
|
3
|
-
export
|
3
|
+
export type FlingGestureHandlerEventPayload = {
|
4
4
|
x: number;
|
5
5
|
y: number;
|
6
6
|
absoluteX: number;
|
@@ -30,5 +30,5 @@ export interface FlingGestureConfig {
|
|
30
30
|
export interface FlingGestureHandlerProps extends BaseGestureHandlerProps<FlingGestureHandlerEventPayload>, FlingGestureConfig {
|
31
31
|
}
|
32
32
|
export declare const flingHandlerName = "FlingGestureHandler";
|
33
|
-
export
|
33
|
+
export type FlingGestureHandler = typeof FlingGestureHandler;
|
34
34
|
export declare const FlingGestureHandler: import("react").ComponentType<FlingGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -6,7 +6,7 @@ declare class ForceTouchFallback extends React.Component<PropsWithChildren<unkno
|
|
6
6
|
componentDidMount(): void;
|
7
7
|
render(): React.ReactNode;
|
8
8
|
}
|
9
|
-
export
|
9
|
+
export type ForceTouchGestureHandlerEventPayload = {
|
10
10
|
x: number;
|
11
11
|
y: number;
|
12
12
|
absoluteX: number;
|
@@ -36,7 +36,7 @@ export interface ForceTouchGestureConfig {
|
|
36
36
|
}
|
37
37
|
export interface ForceTouchGestureHandlerProps extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>, ForceTouchGestureConfig {
|
38
38
|
}
|
39
|
-
export
|
39
|
+
export type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & {
|
40
40
|
forceTouchAvailable: boolean;
|
41
41
|
};
|
42
42
|
export declare const forceTouchHandlerName = "ForceTouchGestureHandler";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
2
|
export declare const longPressGestureHandlerProps: readonly ["minDurationMs", "maxDist"];
|
3
|
-
export
|
3
|
+
export type LongPressGestureHandlerEventPayload = {
|
4
4
|
/**
|
5
5
|
* X coordinate, expressed in points, of the current position of the pointer
|
6
6
|
* (finger or a leading pointer when there are multiple fingers placed)
|
@@ -52,5 +52,5 @@ export interface LongPressGestureConfig {
|
|
52
52
|
export interface LongPressGestureHandlerProps extends BaseGestureHandlerProps<LongPressGestureHandlerEventPayload>, LongPressGestureConfig {
|
53
53
|
}
|
54
54
|
export declare const longPressHandlerName = "LongPressGestureHandler";
|
55
|
-
export
|
55
|
+
export type LongPressGestureHandler = typeof LongPressGestureHandler;
|
56
56
|
export declare const LongPressGestureHandler: import("react").ComponentType<LongPressGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -16,13 +16,13 @@ export interface NativeViewGestureConfig {
|
|
16
16
|
}
|
17
17
|
export interface NativeViewGestureHandlerProps extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>, NativeViewGestureConfig {
|
18
18
|
}
|
19
|
-
export
|
19
|
+
export type NativeViewGestureHandlerPayload = {
|
20
20
|
/**
|
21
21
|
* True if gesture was performed inside of containing view, false otherwise.
|
22
22
|
*/
|
23
23
|
pointerInside: boolean;
|
24
24
|
};
|
25
|
-
export declare const nativeViewProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "waitFor", "simultaneousHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange", "shouldActivateOnStart", "disallowInterruption"];
|
25
|
+
export declare const nativeViewProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "waitFor", "simultaneousHandlers", "blocksHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange", "shouldActivateOnStart", "disallowInterruption"];
|
26
26
|
export declare const nativeViewHandlerName = "NativeViewGestureHandler";
|
27
|
-
export
|
27
|
+
export type NativeViewGestureHandler = typeof NativeViewGestureHandler;
|
28
28
|
export declare const NativeViewGestureHandler: import("react").ComponentType<NativeViewGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
2
|
export declare const panGestureHandlerProps: readonly ["activeOffsetY", "activeOffsetX", "failOffsetY", "failOffsetX", "minDist", "minVelocity", "minVelocityX", "minVelocityY", "minPointers", "maxPointers", "avgTouches", "enableTrackpadTwoFingerGesture", "activateAfterLongPress"];
|
3
3
|
export declare const panGestureHandlerCustomNativeProps: readonly ["activeOffsetYStart", "activeOffsetYEnd", "activeOffsetXStart", "activeOffsetXEnd", "failOffsetYStart", "failOffsetYEnd", "failOffsetXStart", "failOffsetXEnd"];
|
4
|
-
export
|
4
|
+
export type PanGestureHandlerEventPayload = {
|
5
5
|
/**
|
6
6
|
* X coordinate of the current position of the pointer (finger or a leading
|
7
7
|
* pointer when there are multiple fingers placed) relative to the view
|
@@ -133,7 +133,7 @@ export interface PanGestureHandlerProps extends BaseGestureHandlerProps<PanGestu
|
|
133
133
|
failOffsetX?: number | number[];
|
134
134
|
}
|
135
135
|
export declare const panHandlerName = "PanGestureHandler";
|
136
|
-
export
|
136
|
+
export type PanGestureHandler = typeof PanGestureHandler;
|
137
137
|
export declare const PanGestureHandler: import("react").ComponentType<PanGestureHandlerProps & import("react").RefAttributes<any>>;
|
138
138
|
export declare function managePanProps(props: PanGestureHandlerProps): PanGestureHandlerProps & Partial<Record<"activeOffsetXStart" | "activeOffsetXEnd" | "failOffsetXStart" | "failOffsetXEnd" | "activeOffsetYStart" | "activeOffsetYEnd" | "failOffsetYStart" | "failOffsetYEnd", number>>;
|
139
139
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
-
export
|
2
|
+
export type PinchGestureHandlerEventPayload = {
|
3
3
|
/**
|
4
4
|
* The scale factor relative to the points of the two touches in screen
|
5
5
|
* coordinates.
|
@@ -25,5 +25,5 @@ export declare type PinchGestureHandlerEventPayload = {
|
|
25
25
|
export interface PinchGestureHandlerProps extends BaseGestureHandlerProps<PinchGestureHandlerEventPayload> {
|
26
26
|
}
|
27
27
|
export declare const pinchHandlerName = "PinchGestureHandler";
|
28
|
-
export
|
28
|
+
export type PinchGestureHandler = typeof PinchGestureHandler;
|
29
29
|
export declare const PinchGestureHandler: import("react").ComponentType<PinchGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
|
-
export
|
2
|
+
export type RotationGestureHandlerEventPayload = {
|
3
3
|
/**
|
4
4
|
* Amount rotated, expressed in radians, from the gesture's focal point
|
5
5
|
* (anchor).
|
@@ -25,5 +25,5 @@ export declare type RotationGestureHandlerEventPayload = {
|
|
25
25
|
export interface RotationGestureHandlerProps extends BaseGestureHandlerProps<RotationGestureHandlerEventPayload> {
|
26
26
|
}
|
27
27
|
export declare const rotationHandlerName = "RotationGestureHandler";
|
28
|
-
export
|
28
|
+
export type RotationGestureHandler = typeof RotationGestureHandler;
|
29
29
|
export declare const RotationGestureHandler: import("react").ComponentType<RotationGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
2
2
|
export declare const tapGestureHandlerProps: readonly ["maxDurationMs", "maxDelayMs", "numberOfTaps", "maxDeltaX", "maxDeltaY", "maxDist", "minPointers"];
|
3
|
-
export
|
3
|
+
export type TapGestureHandlerEventPayload = {
|
4
4
|
x: number;
|
5
5
|
y: number;
|
6
6
|
absoluteX: number;
|
@@ -53,5 +53,5 @@ export interface TapGestureConfig {
|
|
53
53
|
export interface TapGestureHandlerProps extends BaseGestureHandlerProps<TapGestureHandlerEventPayload>, TapGestureConfig {
|
54
54
|
}
|
55
55
|
export declare const tapHandlerName = "TapGestureHandler";
|
56
|
-
export
|
56
|
+
export type TapGestureHandler = typeof TapGestureHandler;
|
57
57
|
export declare const TapGestureHandler: import("react").ComponentType<TapGestureHandlerProps & import("react").RefAttributes<any>>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
3
|
-
|
3
|
+
type CreateHandlerArgs<HandlerPropsT extends Record<string, unknown>> = Readonly<{
|
4
4
|
name: string;
|
5
5
|
allowedProps: Readonly<Extract<keyof HandlerPropsT, string>[]>;
|
6
6
|
config: Readonly<Record<string, unknown>>;
|