react-native-gesture-handler 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +20 -9
- 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.web.js +1 -1
- package/lib/commonjs/components/GestureComponents.web.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.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/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 +282 -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 +19 -10
- 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.web.js +1 -1
- package/lib/module/components/GestureComponents.web.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.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/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 +276 -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 +5 -2
- package/lib/typescript/RNGestureHandlerModule.web.d.ts +5 -2
- 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/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 +41 -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 +25 -10
- package/src/RNGestureHandlerModule.ts +4 -1
- package/src/RNGestureHandlerModule.web.ts +20 -7
- package/src/components/GestureComponents.web.tsx +1 -1
- package/src/fabric/RNGestureHandlerButtonNativeComponent.ts +2 -12
- package/src/fabric/RNGestureHandlerRootViewNativeComponent.ts +2 -8
- package/src/handlers/gestures/GestureDetector.tsx +0 -1
- package/src/handlers/gestures/eventReceiver.ts +23 -24
- package/src/handlers/gestures/gestureStateManager.web.ts +24 -0
- 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 +306 -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,7 +73,6 @@ const HammerGestures = {
|
|
|
70
73
|
};
|
|
71
74
|
exports.HammerGestures = HammerGestures;
|
|
72
75
|
var _default = {
|
|
73
|
-
// Direction,
|
|
74
76
|
handleSetJSResponder(tag, blockNativeResponder) {
|
|
75
77
|
console.warn('handleSetJSResponder: ', tag, blockNativeResponder);
|
|
76
78
|
},
|
|
@@ -81,24 +83,31 @@ var _default = {
|
|
|
81
83
|
|
|
82
84
|
createGestureHandler(handlerName, handlerTag, config) {
|
|
83
85
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
|
84
|
-
if (!(handlerName in Gestures))
|
|
85
|
-
|
|
86
|
+
if (!(handlerName in Gestures)) {
|
|
87
|
+
throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
|
|
88
|
+
}
|
|
89
|
+
|
|
86
90
|
const GestureClass = Gestures[handlerName];
|
|
87
91
|
|
|
88
92
|
_NodeManager.default.createGestureHandler(handlerTag, new GestureClass());
|
|
89
93
|
|
|
90
|
-
|
|
94
|
+
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), config);
|
|
91
95
|
} else {
|
|
92
|
-
if (!(handlerName in HammerGestures))
|
|
93
|
-
|
|
96
|
+
if (!(handlerName in HammerGestures)) {
|
|
97
|
+
throw new Error(`react-native-gesture-handler: ${handlerName} is not supported on web.`);
|
|
98
|
+
} // @ts-ignore If it doesn't exist, the error is thrown
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
const GestureClass = HammerGestures[handlerName]; // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
103
|
+
|
|
94
104
|
HammerNodeManager.createGestureHandler(handlerTag, new GestureClass());
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
this.updateGestureHandler(handlerTag, config);
|
|
98
108
|
},
|
|
99
109
|
|
|
100
|
-
attachGestureHandler(handlerTag, newView,
|
|
101
|
-
_actionType, propsRef) {
|
|
110
|
+
attachGestureHandler(handlerTag, newView, _actionType, propsRef) {
|
|
102
111
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
|
103
112
|
_NodeManager.default.getHandler(handlerTag).init(newView, propsRef);
|
|
104
113
|
} else {
|
|
@@ -109,6 +118,8 @@ var _default = {
|
|
|
109
118
|
updateGestureHandler(handlerTag, newConfig) {
|
|
110
119
|
if ((0, _EnableExperimentalWebImplementation.isExperimentalWebImplementationEnabled)()) {
|
|
111
120
|
_NodeManager.default.getHandler(handlerTag).updateGestureConfig(newConfig);
|
|
121
|
+
|
|
122
|
+
_InteractionManager.default.getInstance().configureInteractions(_NodeManager.default.getHandler(handlerTag), newConfig);
|
|
112
123
|
} else {
|
|
113
124
|
HammerNodeManager.getHandler(handlerTag).updateGestureConfig(newConfig);
|
|
114
125
|
}
|
|
@@ -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","tag","blockNativeResponder","console","warn","handleClearJSResponder","createGestureHandler","handlerName","handlerTag","config","
|
|
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","console","warn","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,iBAAiB,EAAjBA,0BAHsB;AAItBC,EAAAA,uBAAuB,EAAvBA,gCAJsB;AAKtBC,EAAAA,mBAAmB,EAAnBA,4BALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA,+BANsB;AAOtBC,EAAAA,mBAAmB,EAAnBA,4BAPsB;AAQtBC,EAAAA,oBAAo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AlB,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 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 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,EAA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ACtB,UAAD,EAAqB;AACxC,QAAI,kFAAJ,EAA8C;AAC5C,aAAOI,qBAAYI,UAAZ,CAAuBR,UAAvB,CAAP;AACD,KAFD,MAEO;AACL,aAAOS,iBAAiB,CAACD,UAAlB,CAA6BR,UAA7B,CAAP;AACD;AACF,GAhFY;;AAiFbuB,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"]}
|
|
@@ -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"]}
|
|
@@ -9,11 +9,7 @@ var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libra
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
14
|
-
const codegenNativeComponent = _codegenNativeComponent.default;
|
|
15
|
-
|
|
16
|
-
var _default = codegenNativeComponent('RNGestureHandlerButton');
|
|
12
|
+
var _default = (0, _codegenNativeComponent.default)('RNGestureHandlerButton');
|
|
17
13
|
|
|
18
14
|
exports.default = _default;
|
|
19
15
|
//# sourceMappingURL=RNGestureHandlerButtonNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerButtonNativeComponent.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["RNGestureHandlerButtonNativeComponent.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;eAiBe,qCAAoC,wBAApC,C","sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type {\n Int32,\n WithDefault,\n} from 'react-native/Libraries/Types/CodegenTypes';\nimport type { ViewProps, ColorValue } from 'react-native';\n\ninterface NativeProps extends ViewProps {\n exclusive?: WithDefault<boolean, true>;\n foreground?: boolean;\n borderless?: boolean;\n enabled?: WithDefault<boolean, true>;\n rippleColor?: ColorValue;\n rippleRadius?: Int32;\n touchSoundDisabled?: WithDefault<boolean, false>;\n}\n\nexport default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');\n"]}
|
|
@@ -9,11 +9,7 @@ var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libra
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
14
|
-
const codegenNativeComponent = _codegenNativeComponent.default;
|
|
15
|
-
|
|
16
|
-
var _default = codegenNativeComponent('RNGestureHandlerRootView');
|
|
12
|
+
var _default = (0, _codegenNativeComponent.default)('RNGestureHandlerRootView');
|
|
17
13
|
|
|
18
14
|
exports.default = _default;
|
|
19
15
|
//# sourceMappingURL=RNGestureHandlerRootViewNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RNGestureHandlerRootViewNativeComponent.ts"],"names":[
|
|
1
|
+
{"version":3,"sources":["RNGestureHandlerRootViewNativeComponent.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;eAKe,qCAAoC,0BAApC,C","sourcesContent":["import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps } from 'react-native';\n\ninterface NativeProps extends ViewProps {}\n\nexport default codegenNativeComponent<NativeProps>('RNGestureHandlerRootView');\n"]}
|