react-native-gesture-handler 2.6.0 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- package/android/build.gradle +2 -2
- package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNGestureHandler.xcodeproj/project.xcworkspace/xcuserdata/jakubpiasecki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNGestureHandler.xcodeproj/xcuserdata/jakubpiasecki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/lib/commonjs/EnableExperimentalWebImplementation.js +7 -0
- package/lib/commonjs/EnableExperimentalWebImplementation.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js +1 -1
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.macos.js +22 -13
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +23 -10
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.js +6 -4
- package/lib/commonjs/components/GestureComponents.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +1 -1
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/Swipeable.js +4 -4
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/fabric/RNGestureHandlerButtonNativeComponent.js +1 -5
- package/lib/commonjs/fabric/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/RNGestureHandlerRootViewNativeComponent.js +1 -5
- package/lib/commonjs/fabric/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +4 -2
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/commonjs/handlers/gestures/eventReceiver.js +14 -20
- package/lib/commonjs/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js +32 -0
- package/lib/commonjs/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/commonjs/utils.js +10 -6
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/detectors/RotationGestureDetector.js +13 -17
- package/lib/commonjs/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js +3 -14
- package/lib/commonjs/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +37 -12
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +330 -79
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +23 -18
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +51 -0
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +81 -22
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +57 -40
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +43 -34
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +45 -39
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +52 -50
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js +22 -1
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/EventManager.js +40 -96
- package/lib/commonjs/web/tools/EventManager.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +109 -30
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +24 -10
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/NodeManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +130 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -0
- package/lib/commonjs/web/tools/PointerTracker.js +97 -7
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/TouchEventManager.js +138 -0
- package/lib/commonjs/web/tools/TouchEventManager.js.map +1 -0
- package/lib/commonjs/web/utils.js +15 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/module/EnableExperimentalWebImplementation.js +5 -0
- package/lib/module/EnableExperimentalWebImplementation.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.js +1 -1
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.macos.js +21 -14
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +22 -11
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/components/GestureComponents.js +6 -4
- package/lib/module/components/GestureComponents.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +1 -1
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/Swipeable.js +4 -4
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/fabric/RNGestureHandlerButtonNativeComponent.js +1 -5
- package/lib/module/fabric/RNGestureHandlerButtonNativeComponent.js.map +1 -1
- package/lib/module/fabric/RNGestureHandlerRootViewNativeComponent.js +1 -4
- package/lib/module/fabric/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector.js +5 -3
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/module/handlers/gestures/eventReceiver.js +14 -20
- package/lib/module/handlers/gestures/eventReceiver.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.web.js +21 -0
- package/lib/module/handlers/gestures/gestureStateManager.web.js.map +1 -0
- package/lib/module/utils.js +7 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/detectors/RotationGestureDetector.js +13 -17
- package/lib/module/web/detectors/RotationGestureDetector.js.map +1 -1
- package/lib/module/web/detectors/ScaleGestureDetector.js +3 -14
- package/lib/module/web/detectors/ScaleGestureDetector.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +37 -12
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +324 -79
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +23 -18
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +39 -0
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -0
- package/lib/module/web/handlers/NativeViewGestureHandler.js +80 -22
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +57 -41
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +43 -33
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +45 -38
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +52 -50
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js +19 -0
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/EventManager.js +39 -95
- package/lib/module/web/tools/EventManager.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +107 -30
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +24 -10
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/NodeManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +116 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -0
- package/lib/module/web/tools/PointerTracker.js +97 -7
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/TouchEventManager.js +124 -0
- package/lib/module/web/tools/TouchEventManager.js.map +1 -0
- package/lib/module/web/utils.js +8 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/typescript/RNGestureHandlerModule.macos.d.ts +6 -3
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +5 -2
- package/lib/typescript/components/Swipeable.d.ts +3 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +1 -1
- package/lib/typescript/fabric/RNGestureHandlerButtonNativeComponent.d.ts +3 -3
- package/lib/typescript/fabric/RNGestureHandlerRootViewNativeComponent.d.ts +3 -2
- package/lib/typescript/handlers/gestures/gestureStateManager.web.d.ts +4 -0
- package/lib/typescript/utils.d.ts +4 -0
- package/lib/typescript/web/detectors/RotationGestureDetector.d.ts +7 -7
- package/lib/typescript/web/detectors/ScaleGestureDetector.d.ts +6 -7
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +12 -10
- package/lib/typescript/web/handlers/GestureHandler.d.ts +42 -32
- package/lib/typescript/web/handlers/LongPressGestureHandler.d.ts +6 -9
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +11 -0
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +15 -6
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +15 -23
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +11 -12
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +12 -12
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +11 -14
- package/lib/typescript/web/interfaces.d.ts +50 -10
- package/lib/typescript/web/tools/EventManager.d.ts +28 -26
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +4 -2
- package/lib/typescript/web/tools/InteractionManager.d.ts +3 -0
- package/lib/typescript/web/tools/NodeManager.d.ts +3 -3
- package/lib/typescript/web/tools/PointerEventManager.d.ts +6 -0
- package/lib/typescript/web/tools/PointerTracker.d.ts +29 -5
- package/lib/typescript/web/tools/TouchEventManager.d.ts +6 -0
- package/lib/typescript/web/utils.d.ts +4 -0
- package/package.json +2 -2
- package/src/EnableExperimentalWebImplementation.ts +9 -0
- package/src/RNGestureHandlerModule.macos.ts +28 -13
- package/src/RNGestureHandlerModule.ts +4 -1
- package/src/RNGestureHandlerModule.web.ts +20 -7
- package/src/components/GestureComponents.tsx +12 -16
- package/src/components/GestureComponents.web.tsx +1 -1
- package/src/components/Swipeable.tsx +11 -7
- package/src/fabric/RNGestureHandlerButtonNativeComponent.ts +2 -12
- package/src/fabric/RNGestureHandlerRootViewNativeComponent.ts +2 -8
- package/src/handlers/gestures/GestureDetector.tsx +8 -4
- package/src/handlers/gestures/eventReceiver.ts +23 -24
- package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
- package/src/utils.ts +6 -6
- package/src/web/detectors/RotationGestureDetector.ts +20 -52
- package/src/web/detectors/ScaleGestureDetector.ts +9 -45
- package/src/web/handlers/FlingGestureHandler.ts +45 -22
- package/src/web/handlers/GestureHandler.ts +365 -97
- package/src/web/handlers/LongPressGestureHandler.ts +30 -24
- package/src/web/handlers/ManualGestureHandler.ts +39 -0
- package/src/web/handlers/NativeViewGestureHandler.ts +81 -24
- package/src/web/handlers/PanGestureHandler.ts +68 -53
- package/src/web/handlers/PinchGestureHandler.ts +47 -44
- package/src/web/handlers/RotationGestureHandler.ts +52 -51
- package/src/web/handlers/TapGestureHandler.ts +74 -56
- package/src/web/interfaces.ts +57 -10
- package/src/web/tools/EventManager.ts +58 -148
- package/src/web/tools/GestureHandlerOrchestrator.ts +115 -47
- package/src/web/tools/InteractionManager.ts +25 -9
- package/src/web/tools/NodeManager.ts +6 -6
- package/src/web/tools/PointerEventManager.ts +134 -0
- package/src/web/tools/PointerTracker.ts +120 -10
- package/src/web/tools/TouchEventManager.ts +167 -0
- package/src/web/utils.ts +8 -0
package/android/build.gradle
CHANGED
@@ -54,7 +54,7 @@ def safeExtGet(prop, fallback) {
|
|
54
54
|
|
55
55
|
// Check whether Reanimated 2.3 or higher is installed alongside Gesture Handler
|
56
56
|
def shouldUseCommonInterfaceFromReanimated() {
|
57
|
-
def reanimated = rootProject.subprojects.find { it.name == 'react-native-reanimated' }
|
57
|
+
def reanimated = rootProject.subprojects.find { it.name == 'react-native-reanimated' }
|
58
58
|
if (reanimated != null) {
|
59
59
|
def inputFile = new File(reanimated.projectDir, '../package.json')
|
60
60
|
def json = new JsonSlurper().parseText(inputFile.text)
|
@@ -201,7 +201,7 @@ dependencies {
|
|
201
201
|
|
202
202
|
if (shouldUseCommonInterfaceFromReanimated()) {
|
203
203
|
// Include Reanimated as dependency to load the common interface
|
204
|
-
implementation (
|
204
|
+
implementation (rootProject.subprojects.find { it.name == 'react-native-reanimated' }) {
|
205
205
|
exclude group:'com.facebook.fbjni' // resolves "Duplicate class com.facebook.jni.CppException"
|
206
206
|
}
|
207
207
|
}
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>SchemeUserState</key>
|
6
|
+
<dict>
|
7
|
+
<key>RNGestureHandler-tvOS.xcscheme_^#shared#^_</key>
|
8
|
+
<dict>
|
9
|
+
<key>orderHint</key>
|
10
|
+
<integer>0</integer>
|
11
|
+
</dict>
|
12
|
+
<key>RNGestureHandler.xcscheme_^#shared#^_</key>
|
13
|
+
<dict>
|
14
|
+
<key>orderHint</key>
|
15
|
+
<integer>1</integer>
|
16
|
+
</dict>
|
17
|
+
</dict>
|
18
|
+
</dict>
|
19
|
+
</plist>
|
@@ -5,10 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.enableExperimentalWebImplementation = enableExperimentalWebImplementation;
|
7
7
|
exports.isExperimentalWebImplementationEnabled = isExperimentalWebImplementationEnabled;
|
8
|
+
|
9
|
+
var _reactNative = require("react-native");
|
10
|
+
|
8
11
|
let EXPERIMENTAL_WEB_IMPLEMENTATION = false;
|
9
12
|
let getWasCalled = false;
|
10
13
|
|
11
14
|
function enableExperimentalWebImplementation(shouldEnable = true) {
|
15
|
+
if (_reactNative.Platform.OS !== 'web' || EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
|
12
19
|
if (getWasCalled) {
|
13
20
|
console.error('Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.');
|
14
21
|
return;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["EnableExperimentalWebImplementation.ts"],"names":["EXPERIMENTAL_WEB_IMPLEMENTATION","getWasCalled","enableExperimentalWebImplementation","shouldEnable","console","error","isExperimentalWebImplementationEnabled"],"mappings":"
|
1
|
+
{"version":3,"sources":["EnableExperimentalWebImplementation.ts"],"names":["EXPERIMENTAL_WEB_IMPLEMENTATION","getWasCalled","enableExperimentalWebImplementation","shouldEnable","Platform","OS","console","error","isExperimentalWebImplementationEnabled"],"mappings":";;;;;;;;AAAA;;AAEA,IAAIA,+BAA+B,GAAG,KAAtC;AACA,IAAIC,YAAY,GAAG,KAAnB;;AAEO,SAASC,mCAAT,CAA6CC,YAAY,GAAG,IAA5D,EAAwE;AAC7E,MACEC,sBAASC,EAAT,KAAgB,KAAhB,IACAL,+BAA+B,KAAKG,YAFtC,EAGE;AACA;AACD;;AAED,MAAIF,YAAJ,EAAkB;AAChBK,IAAAA,OAAO,CAACC,KAAR,CACE,4KADF;AAGA;AACD;;AAEDP,EAAAA,+BAA+B,GAAGG,YAAlC;AACD;;AAEM,SAASK,sCAAT,GAA2D;AAChEP,EAAAA,YAAY,GAAG,IAAf;AACA,SAAOD,+BAAP;AACD","sourcesContent":["import { Platform } from 'react-native';\n\nlet EXPERIMENTAL_WEB_IMPLEMENTATION = false;\nlet getWasCalled = false;\n\nexport function enableExperimentalWebImplementation(shouldEnable = true): void {\n if (\n Platform.OS !== 'web' ||\n EXPERIMENTAL_WEB_IMPLEMENTATION === shouldEnable\n ) {\n return;\n }\n\n if (getWasCalled) {\n console.error(\n 'Some parts of this application have already started using old gesture handler implementation. No changes will be applied. You can try enabling new implementation earlier.'\n );\n return;\n }\n\n EXPERIMENTAL_WEB_IMPLEMENTATION = shouldEnable;\n}\n\nexport function isExperimentalWebImplementationEnabled(): boolean {\n getWasCalled = true;\n return EXPERIMENTAL_WEB_IMPLEMENTATION;\n}\n"]}
|
@@ -19,7 +19,7 @@ if (RNGestureHandlerModule == null) {
|
|
19
19
|
For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation`.split('\n').map(line => line.trim()).join('\n')));
|
20
20
|
}
|
21
21
|
|
22
|
-
if (RNGestureHandlerModule.flushOperations === undefined) {
|
22
|
+
if (RNGestureHandlerModule && RNGestureHandlerModule.flushOperations === undefined) {
|
23
23
|
RNGestureHandlerModule.flushOperations = () => {// NO-OP if not defined
|
24
24
|
};
|
25
25
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["RNGestureHandlerModule","NativeModules","console","error","split","map","line","trim","join","flushOperations","undefined"],"mappings":";;;;;;;AAAA;;AAEA;;AACA,MAAM;AAAEA,EAAAA;AAAF,IAA6BC,0BAAnC;;AAEA,IAAID,sBAAsB,IAAI,IAA9B,EAAoC;AAClCE,EAAAA,OAAO,CAACC,KAAR,CACE,uBACG;AACP;AACA,gIAFM,CAGGC,KAHH,CAGS,IAHT,EAIGC,GAJH,CAIQC,IAAD,IAAUA,IAAI,CAACC,IAAL,EAJjB,EAKGC,IALH,CAKQ,IALR,CADF,CADF;AAUD;;AAED,
|
1
|
+
{"version":3,"sources":["RNGestureHandlerModule.ts"],"names":["RNGestureHandlerModule","NativeModules","console","error","split","map","line","trim","join","flushOperations","undefined"],"mappings":";;;;;;;AAAA;;AAEA;;AACA,MAAM;AAAEA,EAAAA;AAAF,IAA6BC,0BAAnC;;AAEA,IAAID,sBAAsB,IAAI,IAA9B,EAAoC;AAClCE,EAAAA,OAAO,CAACC,KAAR,CACE,uBACG;AACP;AACA,gIAFM,CAGGC,KAHH,CAGS,IAHT,EAIGC,GAJH,CAIQC,IAAD,IAAUA,IAAI,CAACC,IAAL,EAJjB,EAKGC,IALH,CAKQ,IALR,CADF,CADF;AAUD;;AAED,IACER,sBAAsB,IACtBA,sBAAsB,CAACS,eAAvB,KAA2CC,SAF7C,EAGE;AACAV,EAAAA,sBAAsB,CAACS,eAAvB,GAAyC,MAAM,CAC7C;AACD,GAFD;AAGD;;eAwBcT,sB","sourcesContent":["import { NativeModules } from 'react-native';\nimport { ActionType } from './ActionType';\nimport { tagMessage } from './utils';\nconst { RNGestureHandlerModule } = NativeModules;\n\nif (RNGestureHandlerModule == null) {\n console.error(\n tagMessage(\n `react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).\n\n For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation`\n .split('\\n')\n .map((line) => line.trim())\n .join('\\n')\n )\n );\n}\n\nif (\n RNGestureHandlerModule &&\n RNGestureHandlerModule.flushOperations === undefined\n) {\n RNGestureHandlerModule.flushOperations = () => {\n // NO-OP if not defined\n };\n}\n\nexport type RNGestureHandlerModuleProps = {\n handleSetJSResponder: (tag: number, blockNativeResponder: boolean) => void;\n handleClearJSResponder: () => void;\n createGestureHandler: (\n handlerName: string,\n handlerTag: number,\n config: Readonly<Record<string, unknown>>\n ) => void;\n attachGestureHandler: (\n handlerTag: number,\n newView: number,\n actionType: ActionType\n ) => void;\n updateGestureHandler: (\n handlerTag: number,\n newConfig: Readonly<Record<string, unknown>>\n ) => void;\n dropGestureHandler: (handlerTag: number) => void;\n install: () => void;\n flushOperations: () => void;\n};\n\nexport default RNGestureHandlerModule as RNGestureHandlerModuleProps;\n"]}
|
@@ -25,6 +25,8 @@ var _FlingGestureHandler = _interopRequireDefault(require("./web/handlers/FlingG
|
|
25
25
|
|
26
26
|
var _NativeViewGestureHandler = _interopRequireDefault(require("./web/handlers/NativeViewGestureHandler"));
|
27
27
|
|
28
|
+
var _ManualGestureHandler = _interopRequireDefault(require("./web/handlers/ManualGestureHandler"));
|
29
|
+
|
28
30
|
var HammerNodeManager = _interopRequireWildcard(require("./web_hammer/NodeManager"));
|
29
31
|
|
30
32
|
var _NativeViewGestureHandler2 = _interopRequireDefault(require("./web_hammer/NativeViewGestureHandler"));
|
@@ -56,7 +58,8 @@ const Gestures = {
|
|
56
58
|
LongPressGestureHandler: _LongPressGestureHandler.default,
|
57
59
|
PinchGestureHandler: _PinchGestureHandler.default,
|
58
60
|
RotationGestureHandler: _RotationGestureHandler.default,
|
59
|
-
FlingGestureHandler: _FlingGestureHandler.default
|
61
|
+
FlingGestureHandler: _FlingGestureHandler.default,
|
62
|
+
ManualGestureHandler: _ManualGestureHandler.default
|
60
63
|
};
|
61
64
|
exports.Gestures = Gestures;
|
62
65
|
const HammerGestures = {
|
@@ -70,35 +73,39 @@ const HammerGestures = {
|
|
70
73
|
};
|
71
74
|
exports.HammerGestures = HammerGestures;
|
72
75
|
var _default = {
|
73
|
-
//
|
74
|
-
handleSetJSResponder(tag, blockNativeResponder) {
|
75
|
-
console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
|
76
|
+
handleSetJSResponder(_tag, _blockNativeResponder) {// NO-OP
|
76
77
|
},
|
77
78
|
|
78
|
-
handleClearJSResponder() {
|
79
|
-
console.warn('handleClearJSResponder: ');
|
79
|
+
handleClearJSResponder() {// NO-OP
|
80
80
|
},
|
81
81
|
|
82
82
|
createGestureHandler(handlerName, handlerTag, config) {
|
83
83
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
84
|
-
if (!(handlerName in Gestures))
|
85
|
-
|
84
|
+
if (!(handlerName in Gestures)) {
|
85
|
+
throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
|
86
|
+
}
|
87
|
+
|
86
88
|
const GestureClass = Gestures[handlerName];
|
87
89
|
|
88
90
|
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass());
|
89
91
|
|
90
|
-
|
92
|
+
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
|
91
93
|
} else {
|
92
|
-
if (!(handlerName in HammerGestures))
|
93
|
-
|
94
|
+
if (!(handlerName in HammerGestures)) {
|
95
|
+
throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
|
96
|
+
} // @ts-ignore If it doesn't exist, the error is thrown
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
98
|
+
|
99
|
+
|
100
|
+
const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
101
|
+
|
94
102
|
HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
|
95
103
|
}
|
96
104
|
|
97
105
|
this.updateGestureHandler(handlerTag, config);
|
98
106
|
},
|
99
107
|
|
100
|
-
attachGestureHandler(handlerTag, newView,
|
101
|
-
_actionType, propsRef) {
|
108
|
+
attachGestureHandler(handlerTag, newView, _actionType, propsRef) {
|
102
109
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
103
110
|
_NodeManager.default.getHandler(handlerTag).init(newView, propsRef);
|
104
111
|
} else {
|
@@ -109,6 +116,8 @@ var _default = {
|
|
109
116
|
updateGestureHandler(handlerTag, newConfig) {
|
110
117
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
111
118
|
_NodeManager.default.getHandler(handlerTag).updateGestureConfig(newConfig);
|
119
|
+
|
120
|
+
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), newConfig);
|
112
121
|
} else {
|
113
122
|
HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
|
114
123
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerModule.macos.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","
|
1
|
+
{"version":3,"sources":["RNGestureHandlerModule.macos.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","_tag","_blockNativeResponder","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":";;;;;;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AApBA;AAYA;AAWO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,wBAAwB,EAAxBA,iCADsB;AAEtBC,EAAAA,iBAAiB,EAAjBA,0BAFsB;AAGtBC,EAAAA,iBAA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5CI,2BAAYgB,kBAAZ,CAA+BpB,UAA/B;AACD,KAFD,MAEO;AACLS,MAAAA,iBAAiB,CAACW,kBAAlB,CAAqCpB,UAArC;AACD;AACF,GA9EY;;AA+Eb;AACAqB,EAAAA,eAAe,GAAG,CAAE;;AAhFP,C","sourcesContent":["import { ActionType } from './ActionType';\nimport { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(_tag: number, _blockNativeResponder: boolean) {\n // NO-OP\n },\n handleClearJSResponder() {\n // NO-OP\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(handlerTag, new GestureClass());\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n (config as unknown) as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, (config as unknown) as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n newView: number,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = exports.HammerGestures = exports.Gestures = void 0;
|
7
7
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _EnableExperimentalWebImplementation = require("./EnableExperimentalWebImplementation");
|
11
|
+
|
8
12
|
var _InteractionManager = _interopRequireDefault(require("./web/tools/InteractionManager"));
|
9
13
|
|
10
14
|
var _NodeManager = _interopRequireDefault(require("./web/tools/NodeManager"));
|
@@ -23,6 +27,8 @@ var _FlingGestureHandler = _interopRequireDefault(require("./web/handlers/FlingG
|
|
23
27
|
|
24
28
|
var _NativeViewGestureHandler = _interopRequireDefault(require("./web/handlers/NativeViewGestureHandler"));
|
25
29
|
|
30
|
+
var _ManualGestureHandler = _interopRequireDefault(require("./web/handlers/ManualGestureHandler"));
|
31
|
+
|
26
32
|
var HammerNodeManager = _interopRequireWildcard(require("./web_hammer/NodeManager"));
|
27
33
|
|
28
34
|
var _NativeViewGestureHandler2 = _interopRequireDefault(require("./web_hammer/NativeViewGestureHandler"));
|
@@ -39,8 +45,6 @@ var _RotationGestureHandler2 = _interopRequireDefault(require("./web_hammer/Rota
|
|
39
45
|
|
40
46
|
var _FlingGestureHandler2 = _interopRequireDefault(require("./web_hammer/FlingGestureHandler"));
|
41
47
|
|
42
|
-
var _EnableExperimentalWebImplementation = require("./EnableExperimentalWebImplementation");
|
43
|
-
|
44
48
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
45
49
|
|
46
50
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -56,7 +60,8 @@ const Gestures = {
|
|
56
60
|
LongPressGestureHandler: _LongPressGestureHandler.default,
|
57
61
|
PinchGestureHandler: _PinchGestureHandler.default,
|
58
62
|
RotationGestureHandler: _RotationGestureHandler.default,
|
59
|
-
FlingGestureHandler: _FlingGestureHandler.default
|
63
|
+
FlingGestureHandler: _FlingGestureHandler.default,
|
64
|
+
ManualGestureHandler: _ManualGestureHandler.default
|
60
65
|
};
|
61
66
|
exports.Gestures = Gestures;
|
62
67
|
const HammerGestures = {
|
@@ -69,9 +74,7 @@ const HammerGestures = {
|
|
69
74
|
FlingGestureHandler: _FlingGestureHandler2.default
|
70
75
|
};
|
71
76
|
exports.HammerGestures = HammerGestures;
|
72
|
-
const interactionManager = new _InteractionManager.default();
|
73
77
|
var _default = {
|
74
|
-
// Direction,
|
75
78
|
handleSetJSResponder(tag, blockNativeResponder) {
|
76
79
|
console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
|
77
80
|
},
|
@@ -90,23 +93,33 @@ var _default = {
|
|
90
93
|
|
91
94
|
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass());
|
92
95
|
|
93
|
-
|
96
|
+
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
|
94
97
|
} else {
|
95
98
|
if (!(handlerName in HammerGestures)) {
|
96
99
|
throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
|
97
|
-
}
|
100
|
+
} // @ts-ignore If it doesn't exist, the error is thrown
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
102
|
+
|
103
|
+
|
104
|
+
const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
98
105
|
|
99
|
-
const GestureClass = HammerGestures[handlerName];
|
100
106
|
HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
|
101
107
|
}
|
102
108
|
|
103
109
|
this.updateGestureHandler(handlerTag, config);
|
104
110
|
},
|
105
111
|
|
106
|
-
attachGestureHandler(handlerTag,
|
112
|
+
attachGestureHandler(handlerTag, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
113
|
+
newView, _actionType, propsRef) {
|
114
|
+
if (!(newView instanceof HTMLElement || newView instanceof _react.default.Component)) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
|
107
118
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
119
|
+
//@ts-ignore Types should be HTMLElement or React.Component
|
108
120
|
_NodeManager.default.getHandler(handlerTag).init(newView, propsRef);
|
109
121
|
} else {
|
122
|
+
//@ts-ignore Types should be HTMLElement or React.Component
|
110
123
|
HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);
|
111
124
|
}
|
112
125
|
},
|
@@ -115,7 +128,7 @@ var _default = {
|
|
115
128
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
116
129
|
_NodeManager.default.getHandler(handlerTag).updateGestureConfig(newConfig);
|
117
130
|
|
118
|
-
|
131
|
+
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), newConfig);
|
119
132
|
} else {
|
120
133
|
HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
|
121
134
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerModule.web.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","
|
1
|
+
{"version":3,"sources":["RNGestureHandlerModule.web.ts"],"names":["Gestures","NativeViewGestureHandler","PanGestureHandler","TapGestureHandler","LongPressGestureHandler","PinchGestureHandler","RotationGestureHandler","FlingGestureHandler","ManualGestureHandler","HammerGestures","HammerNativeViewGestureHandler","HammerPanGestureHandler","HammerTapGestureHandler","HammerLongPressGestureHandler","HammerPinchGestureHandler","HammerRotationGestureHandler","HammerFlingGestureHandler","handleSetJSResponder","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","Error","GestureClass","NodeManager","InteractionManager","getInstance","configureInteractions","getHandler","HammerNodeManager","updateGestureHandler","attachGestureHandler","newView","_actionType","propsRef","HTMLElement","React","Component","init","setView","newConfig","updateGestureConfig","getGestureHandlerNode","dropGestureHandler","flushOperations"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AApBA;AAYA;AAWO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,wBAAwB,EAAxBA,iCADsB;AAEtBC,EAAAA,iBAAiB,EAAjBA,0BAFsB;AAGtBC,EAAAA,iBAAiB,EAAjBA,0BAHsB;AAItBC,EAAAA,uBAAuB,EAAvBA,gCAJsB;AAKtBC,EAAAA,mBAAmB,EAAnBA,4BALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA,+BANsB;AAOtBC,EAAAA,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AiFbuB,EAAAA,kBAAkB,CAACvB,UAAD,EAAqB;AACrC,QAAI,kFAAJ,EAA8C;AAC5CI,2BAAYmB,kBAAZ,CAA+BvB,UAA/B;AACD,KAFD,MAEO;AACLS,MAAAA,iBAAiB,CAACc,kBAAlB,CAAqCvB,UAArC;AACD;AACF,GAvFY;;AAwFb;AACAwB,EAAAA,eAAe,GAAG,CAAE;;AAzFP,C","sourcesContent":["import React from 'react';\n\nimport { ActionType } from './ActionType';\nimport { isExperimentalWebImplementationEnabled } from './EnableExperimentalWebImplementation';\n\n//GestureHandlers\nimport InteractionManager from './web/tools/InteractionManager';\nimport NodeManager from './web/tools/NodeManager';\nimport PanGestureHandler from './web/handlers/PanGestureHandler';\nimport TapGestureHandler from './web/handlers/TapGestureHandler';\nimport LongPressGestureHandler from './web/handlers/LongPressGestureHandler';\nimport PinchGestureHandler from './web/handlers/PinchGestureHandler';\nimport RotationGestureHandler from './web/handlers/RotationGestureHandler';\nimport FlingGestureHandler from './web/handlers/FlingGestureHandler';\nimport NativeViewGestureHandler from './web/handlers/NativeViewGestureHandler';\nimport ManualGestureHandler from './web/handlers/ManualGestureHandler';\n\n//Hammer Handlers\nimport * as HammerNodeManager from './web_hammer/NodeManager';\nimport HammerNativeViewGestureHandler from './web_hammer/NativeViewGestureHandler';\nimport HammerPanGestureHandler from './web_hammer/PanGestureHandler';\nimport HammerTapGestureHandler from './web_hammer/TapGestureHandler';\nimport HammerLongPressGestureHandler from './web_hammer/LongPressGestureHandler';\nimport HammerPinchGestureHandler from './web_hammer/PinchGestureHandler';\nimport HammerRotationGestureHandler from './web_hammer/RotationGestureHandler';\nimport HammerFlingGestureHandler from './web_hammer/FlingGestureHandler';\nimport { Config } from './web/interfaces';\n\nexport const Gestures = {\n NativeViewGestureHandler,\n PanGestureHandler,\n TapGestureHandler,\n LongPressGestureHandler,\n PinchGestureHandler,\n RotationGestureHandler,\n FlingGestureHandler,\n ManualGestureHandler,\n};\n\nexport const HammerGestures = {\n NativeViewGestureHandler: HammerNativeViewGestureHandler,\n PanGestureHandler: HammerPanGestureHandler,\n TapGestureHandler: HammerTapGestureHandler,\n LongPressGestureHandler: HammerLongPressGestureHandler,\n PinchGestureHandler: HammerPinchGestureHandler,\n RotationGestureHandler: HammerRotationGestureHandler,\n FlingGestureHandler: HammerFlingGestureHandler,\n};\n\nexport default {\n handleSetJSResponder(tag: number, blockNativeResponder: boolean) {\n console.warn('handleSetJSResponder: ', tag, blockNativeResponder);\n },\n handleClearJSResponder() {\n console.warn('handleClearJSResponder: ');\n },\n createGestureHandler<T>(\n handlerName: keyof typeof Gestures,\n handlerTag: number,\n config: T\n ) {\n if (isExperimentalWebImplementationEnabled()) {\n if (!(handlerName in Gestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n const GestureClass = Gestures[handlerName];\n NodeManager.createGestureHandler(handlerTag, new GestureClass());\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n (config as unknown) as Config\n );\n } else {\n if (!(handlerName in HammerGestures)) {\n throw new Error(\n `react-native-gesture-handler: ${handlerName} is not supported on web.`\n );\n }\n\n // @ts-ignore If it doesn't exist, the error is thrown\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const GestureClass = HammerGestures[handlerName];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());\n }\n\n this.updateGestureHandler(handlerTag, (config as unknown) as Config);\n },\n attachGestureHandler(\n handlerTag: number,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n newView: any,\n _actionType: ActionType,\n propsRef: React.RefObject<unknown>\n ) {\n if (\n !(newView instanceof HTMLElement || newView instanceof React.Component)\n ) {\n return;\n }\n\n if (isExperimentalWebImplementationEnabled()) {\n //@ts-ignore Types should be HTMLElement or React.Component\n NodeManager.getHandler(handlerTag).init(newView, propsRef);\n } else {\n //@ts-ignore Types should be HTMLElement or React.Component\n HammerNodeManager.getHandler(handlerTag).setView(newView, propsRef);\n }\n },\n updateGestureHandler(handlerTag: number, newConfig: Config) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n\n InteractionManager.getInstance().configureInteractions(\n NodeManager.getHandler(handlerTag),\n newConfig\n );\n } else {\n HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);\n }\n },\n getGestureHandlerNode(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\n return NodeManager.getHandler(handlerTag);\n } else {\n return HammerNodeManager.getHandler(handlerTag);\n }\n },\n dropGestureHandler(handlerTag: number) {\n if (isExperimentalWebImplementationEnabled()) {\n NodeManager.dropGestureHandler(handlerTag);\n } else {\n HammerNodeManager.dropGestureHandler(handlerTag);\n }\n },\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n flushOperations() {},\n};\n"]}
|
@@ -45,9 +45,10 @@ const ScrollView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
45
45
|
ref: ref,
|
46
46
|
waitFor: [...(0, _utils.toArray)(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef] // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
|
47
47
|
,
|
48
|
-
refreshControl: refreshControl ? /*#__PURE__*/React.
|
48
|
+
refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
|
49
|
+
// @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
|
49
50
|
ref: refreshControlGestureRef
|
50
|
-
})
|
51
|
+
}) : undefined
|
51
52
|
}));
|
52
53
|
}); // backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457
|
53
54
|
// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.
|
@@ -102,9 +103,10 @@ const FlatList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
102
103
|
waitFor: [...(0, _utils.toArray)(waitFor !== null && waitFor !== void 0 ? waitFor : []), refreshControlGestureRef]
|
103
104
|
})) // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref
|
104
105
|
,
|
105
|
-
refreshControl: refreshControl ? /*#__PURE__*/React.
|
106
|
+
refreshControl: refreshControl ? /*#__PURE__*/React.cloneElement(refreshControl, {
|
107
|
+
// @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS
|
106
108
|
ref: refreshControlGestureRef
|
107
|
-
})
|
109
|
+
}) : undefined
|
108
110
|
}))
|
109
111
|
);
|
110
112
|
}); // eslint-disable-next-line @typescript-eslint/no-redeclare
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["GestureComponents.tsx"],"names":["RefreshControl","RNRefreshControl","disallowInterruption","shouldCancelWhenOutside","GHScrollView","RNScrollView","ScrollView","React","forwardRef","props","ref","refreshControlGestureRef","useRef","refreshControl","waitFor","rest","Switch","RNSwitch","shouldActivateOnStart","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","flatListProps","scrollViewProps","propName","value","Object","entries","nativeViewProps","includes","scrollProps"],"mappings":";;;;;;;AAAA;;AAOA;;AAcA;;AAEA;;AAKA;;;;;;;;;;AAEO,MAAMA,cAAc,GAAG,kCAAoBC,2BAApB,EAAsC;AAClEC,EAAAA,oBAAoB,EAAE,IAD4C;AAElEC,EAAAA,uBAAuB,EAAE;AAFyC,CAAtC,CAAvB,C,CAIP;;;AAGA,MAAMC,YAAY,GAAG,kCACnBC,uBADmB,EAEnB;AACEH,EAAAA,oBAAoB,EAAE,IADxB;AAEEC,EAAAA,uBAAuB,EAAE;AAF3B,CAFmB,CAArB;AAOO,MAAMG,UAAU,gBAAGC,KAAK,CAACC,UAAN,CAGxB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChB,QAAMC,wBAAwB,GAAGJ,KAAK,CAACK,MAAN,CAA6B,IAA7B,CAAjC;AACA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,OAAlB;AAA2B,OAAGC;AAA9B,MAAuCN,KAA7C;AAEA,sBACE,oBAAC,YAAD,eACMM,IADN;AAEE;AACA,IAAA,GAAG,EAAEL,GAHP;AAIE,IAAA,OAAO,EAAE,CAAC,GAAG,oBAAQI,OAAR,aAAQA,OAAR,cAAQA,OAAR,GAAmB,EAAnB,CAAJ,EAA4BH,wBAA5B,CAJX,CAKE;AALF;AAME,IAAA,cAAc,EACZE,cAAc,
|
1
|
+
{"version":3,"sources":["GestureComponents.tsx"],"names":["RefreshControl","RNRefreshControl","disallowInterruption","shouldCancelWhenOutside","GHScrollView","RNScrollView","ScrollView","React","forwardRef","props","ref","refreshControlGestureRef","useRef","refreshControl","waitFor","rest","cloneElement","undefined","Switch","RNSwitch","shouldActivateOnStart","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","FlatList","flatListProps","scrollViewProps","propName","value","Object","entries","nativeViewProps","includes","scrollProps"],"mappings":";;;;;;;AAAA;;AAOA;;AAcA;;AAEA;;AAKA;;;;;;;;;;AAEO,MAAMA,cAAc,GAAG,kCAAoBC,2BAApB,EAAsC;AAClEC,EAAAA,oBAAoB,EAAE,IAD4C;AAElEC,EAAAA,uBAAuB,EAAE;AAFyC,CAAtC,CAAvB,C,CAIP;;;AAGA,MAAMC,YAAY,GAAG,kCACnBC,uBADmB,EAEnB;AACEH,EAAAA,oBAAoB,EAAE,IADxB;AAEEC,EAAAA,uBAAuB,EAAE;AAF3B,CAFmB,CAArB;AAOO,MAAMG,UAAU,gBAAGC,KAAK,CAACC,UAAN,CAGxB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChB,QAAMC,wBAAwB,GAAGJ,KAAK,CAACK,MAAN,CAA6B,IAA7B,CAAjC;AACA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,OAAlB;AAA2B,OAAGC;AAA9B,MAAuCN,KAA7C;AAEA,sBACE,oBAAC,YAAD,eACMM,IADN;AA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eAAe,CAACC,QAAD,CAAf,GAA4BC,KAA5B;AACD,KAJD,MAIO;AACL;AACA;AACAH,MAAAA,aAAa,CAACE,QAAD,CAAb,GAA0BC,KAA1B;AACD;AACF;;AAED;AAAA;AACE;AACA,wBAAC,qBAAD;AACE,MAAA,GAAG,EAAEnB;AADP,OAEMgB,aAFN;AAGE,MAAA,qBAAqB,EAAGQ,WAAD,iBACrB,oBAAC,UAAD,eAEOA,WAFP,EAGOP,eAHP;AAIIb,QAAAA,OAAO,EAAE,CAAC,GAAG,oBAAQA,OAAR,aAAQA,OAAR,cAAQA,OAAR,GAAmB,EAAnB,CAAJ,EAA4BH,wBAA5B;AAJb,SAJJ,CAYE;AAZF;AAaE,MAAA,cAAc,EACZE,cAAc,gBACVN,KAAK,CAACS,YAAN,CAAmBH,cAAnB,EAAmC;AACjC;AACAH,QAAAA,GAAG,EAAEC;AAF4B,OAAnC,CADU,GAKVM;AAnBR;AAFF;AAyBD,CA7CuB,CAAjB,C,CAqDP","sourcesContent":["import * as React from 'react';\nimport {\n PropsWithChildren,\n ForwardedRef,\n RefAttributes,\n ReactElement,\n} from 'react';\nimport {\n ScrollView as RNScrollView,\n ScrollViewProps as RNScrollViewProps,\n Switch as RNSwitch,\n SwitchProps as RNSwitchProps,\n TextInput as RNTextInput,\n TextInputProps as RNTextInputProps,\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n DrawerLayoutAndroidProps as RNDrawerLayoutAndroidProps,\n FlatList as RNFlatList,\n FlatListProps as RNFlatListProps,\n RefreshControl as RNRefreshControl,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nimport {\n NativeViewGestureHandlerProps,\n nativeViewProps,\n} from '../handlers/NativeViewGestureHandler';\n\nimport { toArray } from '../utils';\n\nexport const RefreshControl = createNativeWrapper(RNRefreshControl, {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type RefreshControl = typeof RefreshControl & RNRefreshControl;\n\nconst GHScrollView = createNativeWrapper<PropsWithChildren<RNScrollViewProps>>(\n RNScrollView,\n {\n disallowInterruption: true,\n shouldCancelWhenOutside: false,\n }\n);\nexport const ScrollView = React.forwardRef<\n RNScrollView,\n RNScrollViewProps & NativeViewGestureHandlerProps\n>((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n const { refreshControl, waitFor, ...rest } = props;\n\n return (\n <GHScrollView\n {...rest}\n // @ts-ignore `ref` exists on `GHScrollView`\n ref={ref}\n waitFor={[...toArray(waitFor ?? []), refreshControlGestureRef]}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n});\n// backward type compatibility with https://github.com/software-mansion/react-native-gesture-handler/blob/db78d3ca7d48e8ba57482d3fe9b0a15aa79d9932/react-native-gesture-handler.d.ts#L440-L457\n// include methods of wrapped components by creating an intersection type with the RN component instead of duplicating them.\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type ScrollView = typeof GHScrollView & RNScrollView;\n\nexport const Switch = createNativeWrapper<RNSwitchProps>(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type Switch = typeof Switch & RNSwitch;\n\nexport const TextInput = createNativeWrapper<RNTextInputProps>(RNTextInput);\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type TextInput = typeof TextInput & RNTextInput;\n\nexport const DrawerLayoutAndroid = createNativeWrapper<\n PropsWithChildren<RNDrawerLayoutAndroidProps>\n>(RNDrawerLayoutAndroid, { disallowInterruption: true });\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type DrawerLayoutAndroid = typeof DrawerLayoutAndroid &\n RNDrawerLayoutAndroid;\n\nexport const FlatList = React.forwardRef((props, ref) => {\n const refreshControlGestureRef = React.useRef<RefreshControl>(null);\n\n const { waitFor, refreshControl, ...rest } = props;\n\n const flatListProps = {};\n const scrollViewProps = {};\n for (const [propName, value] of Object.entries(rest)) {\n // https://github.com/microsoft/TypeScript/issues/26255\n if ((nativeViewProps as readonly string[]).includes(propName)) {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n scrollViewProps[propName] = value;\n } else {\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n flatListProps[propName] = value;\n }\n }\n\n return (\n // @ts-ignore - this function cannot have generic type so we have to ignore this error\n <RNFlatList\n ref={ref}\n {...flatListProps}\n renderScrollComponent={(scrollProps) => (\n <ScrollView\n {...{\n ...scrollProps,\n ...scrollViewProps,\n waitFor: [...toArray(waitFor ?? []), refreshControlGestureRef],\n }}\n />\n )}\n // @ts-ignore we don't pass `refreshing` prop as we only want to override the ref\n refreshControl={\n refreshControl\n ? React.cloneElement(refreshControl, {\n // @ts-ignore for reasons unknown to me, `ref` doesn't exist on the type inferred by TS\n ref: refreshControlGestureRef,\n })\n : undefined\n }\n />\n );\n}) as <ItemT = any>(\n props: PropsWithChildren<\n RNFlatListProps<ItemT> &\n RefAttributes<FlatList<ItemT>> &\n NativeViewGestureHandlerProps\n >,\n ref: ForwardedRef<FlatList<ItemT>>\n) => ReactElement | null;\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport type FlatList<ItemT = any> = typeof FlatList & RNFlatList<ItemT>;\n"]}
|
@@ -20,7 +20,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
20
20
|
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); }
|
21
21
|
|
22
22
|
const ScrollView = (0, _createNativeWrapper.default)(_reactNative.ScrollView, {
|
23
|
-
disallowInterruption:
|
23
|
+
disallowInterruption: false
|
24
24
|
});
|
25
25
|
exports.ScrollView = ScrollView;
|
26
26
|
const Switch = (0, _createNativeWrapper.default)(_reactNative.Switch, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["GestureComponents.web.tsx"],"names":["ScrollView","RNScrollView","disallowInterruption","Switch","RNSwitch","shouldCancelWhenOutside","shouldActivateOnStart","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","positions","RefreshControl","View","FlatList","React","forwardRef","props","ref","scrollProps"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;;;;;;;;;AAEO,MAAMA,UAAU,GAAG,kCAAoBC,uBAApB,EAAkC;AAC1DC,EAAAA,oBAAoB,EAAE;AADoC,CAAlC,CAAnB;;AAIA,MAAMC,MAAM,GAAG,kCAAoBC,mBAApB,EAA8B;AAClDC,EAAAA,uBAAuB,EAAE,KADyB;AAElDC,EAAAA,qBAAqB,EAAE,IAF2B;AAGlDJ,EAAAA,oBAAoB,EAAE;AAH4B,CAA9B,CAAf;;AAKA,MAAMK,SAAS,GAAG,kCAAoBC,sBAApB,CAAlB;;AACA,MAAMC,mBAAmB,GAAG,kCAAoBC,gCAApB,EAA2C;AAC5ER,EAAAA,oBAAoB,EAAE;AADsD,CAA3C,CAA5B,C,CAGP;;;AACAO,mBAAmB,CAACE,SAApB,GAAgCD,iCAAsBC,SAAtD,C,CACA;AACA;AACA;;AACO,MAAMC,cAAc,GAAG,kCAAoBC,iBAApB,CAAvB;;AAEA,MAAMC,QAAQ,gBAAGC,KAAK,CAACC,UAAN,CACtB,CAAoBC,KAApB,EAAiDC,GAAjD,kBACE,oBAAC,qBAAD;AACE,EAAA,GAAG,EAAEA;AADP,GAEMD,KAFN;AAGE,EAAA,qBAAqB,EAAGE,WAAD,iBAAiB,oBAAC,UAAD,EAAgBA,WAAhB;AAH1C,GAFoB,CAAjB","sourcesContent":["import * as React from 'react';\nimport {\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n FlatList as RNFlatList,\n Switch as RNSwitch,\n TextInput as RNTextInput,\n ScrollView as RNScrollView,\n FlatListProps,\n View,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nexport const ScrollView = createNativeWrapper(RNScrollView, {\n disallowInterruption:
|
1
|
+
{"version":3,"sources":["GestureComponents.web.tsx"],"names":["ScrollView","RNScrollView","disallowInterruption","Switch","RNSwitch","shouldCancelWhenOutside","shouldActivateOnStart","TextInput","RNTextInput","DrawerLayoutAndroid","RNDrawerLayoutAndroid","positions","RefreshControl","View","FlatList","React","forwardRef","props","ref","scrollProps"],"mappings":";;;;;;;AAAA;;AACA;;AAUA;;;;;;;;;;AAEO,MAAMA,UAAU,GAAG,kCAAoBC,uBAApB,EAAkC;AAC1DC,EAAAA,oBAAoB,EAAE;AADoC,CAAlC,CAAnB;;AAIA,MAAMC,MAAM,GAAG,kCAAoBC,mBAApB,EAA8B;AAClDC,EAAAA,uBAAuB,EAAE,KADyB;AAElDC,EAAAA,qBAAqB,EAAE,IAF2B;AAGlDJ,EAAAA,oBAAoB,EAAE;AAH4B,CAA9B,CAAf;;AAKA,MAAMK,SAAS,GAAG,kCAAoBC,sBAApB,CAAlB;;AACA,MAAMC,mBAAmB,GAAG,kCAAoBC,gCAApB,EAA2C;AAC5ER,EAAAA,oBAAoB,EAAE;AADsD,CAA3C,CAA5B,C,CAGP;;;AACAO,mBAAmB,CAACE,SAApB,GAAgCD,iCAAsBC,SAAtD,C,CACA;AACA;AACA;;AACO,MAAMC,cAAc,GAAG,kCAAoBC,iBAApB,CAAvB;;AAEA,MAAMC,QAAQ,gBAAGC,KAAK,CAACC,UAAN,CACtB,CAAoBC,KAApB,EAAiDC,GAAjD,kBACE,oBAAC,qBAAD;AACE,EAAA,GAAG,EAAEA;AADP,GAEMD,KAFN;AAGE,EAAA,qBAAqB,EAAGE,WAAD,iBAAiB,oBAAC,UAAD,EAAgBA,WAAhB;AAH1C,GAFoB,CAAjB","sourcesContent":["import * as React from 'react';\nimport {\n DrawerLayoutAndroid as RNDrawerLayoutAndroid,\n FlatList as RNFlatList,\n Switch as RNSwitch,\n TextInput as RNTextInput,\n ScrollView as RNScrollView,\n FlatListProps,\n View,\n} from 'react-native';\n\nimport createNativeWrapper from '../handlers/createNativeWrapper';\n\nexport const ScrollView = createNativeWrapper(RNScrollView, {\n disallowInterruption: false,\n});\n\nexport const Switch = createNativeWrapper(RNSwitch, {\n shouldCancelWhenOutside: false,\n shouldActivateOnStart: true,\n disallowInterruption: true,\n});\nexport const TextInput = createNativeWrapper(RNTextInput);\nexport const DrawerLayoutAndroid = createNativeWrapper(RNDrawerLayoutAndroid, {\n disallowInterruption: true,\n});\n// @ts-ignore -- TODO(TS) to investigate if it's needed\nDrawerLayoutAndroid.positions = RNDrawerLayoutAndroid.positions;\n// RefreshControl is implemented as a functional component, rendering a View\n// NativeViewGestureHandler needs to set a ref on its child, which cannot be done\n// on functional components\nexport const RefreshControl = createNativeWrapper(View);\n\nexport const FlatList = React.forwardRef(\n <ItemT extends any>(props: FlatListProps<ItemT>, ref: any) => (\n <RNFlatList\n ref={ref}\n {...props}\n renderScrollComponent={(scrollProps) => <ScrollView {...scrollProps} />}\n />\n )\n);\n"]}
|
@@ -175,17 +175,17 @@ class Swipeable extends React.Component {
|
|
175
175
|
var _this$props$onSwipeab, _this$props, _this$props$onSwipeab2, _this$props2;
|
176
176
|
|
177
177
|
(_this$props$onSwipeab = (_this$props = this.props).onSwipeableLeftOpen) === null || _this$props$onSwipeab === void 0 ? void 0 : _this$props$onSwipeab.call(_this$props);
|
178
|
-
(_this$props$onSwipeab2 = (_this$props2 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab2 === void 0 ? void 0 : _this$props$onSwipeab2.call(_this$props2, 'left');
|
178
|
+
(_this$props$onSwipeab2 = (_this$props2 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab2 === void 0 ? void 0 : _this$props$onSwipeab2.call(_this$props2, 'left', this);
|
179
179
|
} else if (toValue < 0) {
|
180
180
|
var _this$props$onSwipeab3, _this$props3, _this$props$onSwipeab4, _this$props4;
|
181
181
|
|
182
182
|
(_this$props$onSwipeab3 = (_this$props3 = this.props).onSwipeableRightOpen) === null || _this$props$onSwipeab3 === void 0 ? void 0 : _this$props$onSwipeab3.call(_this$props3);
|
183
|
-
(_this$props$onSwipeab4 = (_this$props4 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab4 === void 0 ? void 0 : _this$props$onSwipeab4.call(_this$props4, 'right');
|
183
|
+
(_this$props$onSwipeab4 = (_this$props4 = this.props).onSwipeableOpen) === null || _this$props$onSwipeab4 === void 0 ? void 0 : _this$props$onSwipeab4.call(_this$props4, 'right', this);
|
184
184
|
} else {
|
185
185
|
var _this$props$onSwipeab5, _this$props5;
|
186
186
|
|
187
187
|
const closingDirection = fromValue > 0 ? 'left' : 'right';
|
188
|
-
(_this$props$onSwipeab5 = (_this$props5 = this.props).onSwipeableClose) === null || _this$props$onSwipeab5 === void 0 ? void 0 : _this$props$onSwipeab5.call(_this$props5, closingDirection);
|
188
|
+
(_this$props$onSwipeab5 = (_this$props5 = this.props).onSwipeableClose) === null || _this$props$onSwipeab5 === void 0 ? void 0 : _this$props$onSwipeab5.call(_this$props5, closingDirection, this);
|
189
189
|
}
|
190
190
|
}
|
191
191
|
});
|
@@ -317,7 +317,7 @@ class Swipeable extends React.Component {
|
|
317
317
|
translateX: this.rightActionTranslate
|
318
318
|
}]
|
319
319
|
}]
|
320
|
-
}, renderRightActions(this.showRightAction, this.transX), /*#__PURE__*/React.createElement(_reactNative.View, {
|
320
|
+
}, renderRightActions(this.showRightAction, this.transX, this), /*#__PURE__*/React.createElement(_reactNative.View, {
|
321
321
|
onLayout: ({
|
322
322
|
nativeEvent
|
323
323
|
}) => this.setState({
|