@react-native-oh-tpl/react-native-gesture-handler 2.12.6-1 → 2.12.9-1
Sign up to get free protection for your applications and to get access to all the features.
- package/harmony/gesture_handler/BuildProfile.ets +6 -0
- package/harmony/gesture_handler/build-profile.json5 +18 -7
- package/harmony/gesture_handler/hvigorfile.ts +2 -2
- package/harmony/gesture_handler/index.ets +3 -3
- package/harmony/gesture_handler/oh-package-lock.json5 +18 -0
- package/harmony/gesture_handler/oh-package.json5 +12 -11
- package/harmony/gesture_handler/src/main/cpp/CMakeLists.txt +8 -8
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.cpp +103 -34
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +21 -15
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +36 -60
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentInstance.h +27 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonJSIBinder.h +32 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +22 -17
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +15 -12
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerPackage.h +72 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +36 -60
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentInstance.h +123 -0
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewJSIBinder.h +25 -0
- package/harmony/gesture_handler/src/main/ets/CircularBuffer.ts +42 -42
- package/harmony/gesture_handler/src/main/ets/Event.ts +67 -67
- package/harmony/gesture_handler/src/main/ets/EventDispatcher.ts +52 -37
- package/harmony/gesture_handler/src/main/ets/GestureHandler.ts +663 -663
- package/harmony/gesture_handler/src/main/ets/{GestureHandlerArkUIAdapter.ets → GestureHandlerArkUIAdapter.ts} +202 -201
- package/harmony/gesture_handler/src/main/ets/GestureHandlerFactory.ts +44 -44
- package/harmony/gesture_handler/src/main/ets/GestureHandlerOrchestrator.ts +280 -280
- package/harmony/gesture_handler/src/main/ets/GestureHandlerPackage.ts +22 -22
- package/harmony/gesture_handler/src/main/ets/GestureHandlerRegistry.ts +27 -27
- package/harmony/gesture_handler/src/main/ets/InteractionManager.ts +108 -108
- package/harmony/gesture_handler/src/main/ets/LeastSquareSolver.ts +182 -182
- package/harmony/gesture_handler/src/main/ets/NativeViewGestureHandler.ts +114 -114
- package/harmony/gesture_handler/src/main/ets/OutgoingEvent.ts +33 -33
- package/harmony/gesture_handler/src/main/ets/PanGestureHandler.ts +327 -327
- package/harmony/gesture_handler/src/main/ets/PointerTracker.ts +239 -239
- package/harmony/gesture_handler/src/main/ets/RNGHError.ts +4 -4
- package/harmony/gesture_handler/src/main/ets/RNGHLogger.ts +47 -28
- package/harmony/gesture_handler/src/main/ets/{RNGHRootTouchHandler.ets → RNGHRootTouchHandlerArkTS.ts} +59 -57
- package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandlerCAPI.ts +87 -0
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerButton.ets +37 -36
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerModule.ts +183 -125
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerRootView.ets +52 -55
- package/harmony/gesture_handler/src/main/ets/RNOHScrollLocker.ts +23 -11
- package/harmony/gesture_handler/src/main/ets/State.ts +46 -46
- package/harmony/gesture_handler/src/main/ets/TapGestureHandler.ts +205 -205
- package/harmony/gesture_handler/src/main/ets/Vector2D.ts +36 -36
- package/harmony/gesture_handler/src/main/ets/VelocityTracker.ts +98 -98
- package/harmony/gesture_handler/src/main/ets/View.ts +70 -70
- package/harmony/gesture_handler/src/main/ets/ViewRegistry.ts +42 -42
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerButton.ts +140 -0
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerModule.ts +25 -0
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerRootView.ts +101 -0
- package/harmony/gesture_handler/src/main/ets/namespace/ts.ts +3 -0
- package/harmony/gesture_handler/src/main/ets/pages/Index.ets +16 -16
- package/harmony/gesture_handler/src/main/ets/types.ts +25 -0
- package/harmony/gesture_handler/src/main/ets/webviewability/WebviewAbility.ts +41 -41
- package/harmony/gesture_handler/src/main/module.json5 +7 -7
- package/harmony/gesture_handler/src/main/resources/base/element/color.json +7 -7
- package/harmony/gesture_handler/src/main/resources/base/element/string.json +15 -15
- package/harmony/gesture_handler/src/main/resources/base/profile/main_pages.json +5 -5
- package/harmony/gesture_handler/src/main/resources/en_US/element/string.json +15 -15
- package/harmony/gesture_handler/src/main/resources/zh_CN/element/string.json +15 -15
- package/harmony/gesture_handler/ts.ts +2 -1
- package/harmony/gesture_handler.har +0 -0
- package/lib/commonjs/RNGestureHandlerModule.js +6 -3
- package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerRootView.js +5 -13
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +31 -28
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/index.js +42 -19
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +10 -0
- package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -0
- package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.js +3 -2
- package/lib/module/RNGestureHandlerModule.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.js +3 -11
- package/lib/module/components/GestureHandlerRootView.js.map +1 -1
- package/lib/module/handlers/createHandler.js +20 -19
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/index.js +6 -14
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeRNGestureHandlerModule.js +3 -0
- package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +3 -0
- package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
- package/lib/typescript/RNGestureHandlerModule.d.ts +2 -6
- package/lib/typescript/RNGestureHandlerModule.d.ts.map +1 -1
- package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -6
- package/lib/typescript/components/GestureHandlerRootView.d.ts.map +1 -1
- package/lib/typescript/handlers/createHandler.d.ts +11 -11
- package/lib/typescript/handlers/createHandler.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +9 -8
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +15 -0
- package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts.map +1 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +15 -0
- package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +7 -0
- package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts.map +1 -0
- package/package.json +66 -70
- package/src/RNGestureHandlerModule.ts +5 -6
- package/src/components/GestureHandlerRootView.tsx +23 -34
- package/src/handlers/createHandler.tsx +534 -535
- package/src/index.ts +172 -172
- package/src/specs/NativeRNGestureHandlerModule.ts +26 -0
- package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -0
- package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
- package/README.md +0 -1
- package/lib/commonjs/components/GestureButtons.js +0 -186
- package/lib/commonjs/components/GestureButtons.js.map +0 -1
- package/lib/commonjs/components/GestureHandlerButton.js +0 -9
- package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/RNGestureHandlerButton.js +0 -23
- package/lib/commonjs/components/RNGestureHandlerButton.js.map +0 -1
- package/lib/commonjs/components/touchables/GenericTouchable.js +0 -247
- package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -58
- package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -18
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/commonjs/components/touchables/index.js +0 -21
- package/lib/commonjs/components/touchables/index.js.map +0 -1
- package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -19
- package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/PanGestureHandler.js +0 -103
- package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +0 -22
- package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
- package/lib/commonjs/handlers/createNativeWrapper.js +0 -64
- package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -22
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +0 -554
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +0 -1
- package/lib/commonjs/init.js +0 -24
- package/lib/commonjs/init.js.map +0 -1
- package/lib/module/components/GestureButtons.js +0 -168
- package/lib/module/components/GestureButtons.js.map +0 -1
- package/lib/module/components/GestureHandlerButton.js +0 -3
- package/lib/module/components/GestureHandlerButton.js.map +0 -1
- package/lib/module/components/RNGestureHandlerButton.js +0 -17
- package/lib/module/components/RNGestureHandlerButton.js.map +0 -1
- package/lib/module/components/touchables/GenericTouchable.js +0 -238
- package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
- package/lib/module/components/touchables/TouchableOpacity.js +0 -49
- package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -9
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
- package/lib/module/components/touchables/index.js +0 -8
- package/lib/module/components/touchables/index.js.map +0 -1
- package/lib/module/handlers/NativeViewGestureHandler.js +0 -12
- package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
- package/lib/module/handlers/PanGestureHandler.js +0 -92
- package/lib/module/handlers/PanGestureHandler.js.map +0 -1
- package/lib/module/handlers/TapGestureHandler.js +0 -14
- package/lib/module/handlers/TapGestureHandler.js.map +0 -1
- package/lib/module/handlers/createNativeWrapper.js +0 -57
- package/lib/module/handlers/createNativeWrapper.js.map +0 -1
- package/lib/module/handlers/gestureHandlerCommon.js +0 -15
- package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
- package/lib/module/handlers/gestures/GestureDetector.js +0 -543
- package/lib/module/handlers/gestures/GestureDetector.js.map +0 -1
- package/lib/module/init.js +0 -17
- package/lib/module/init.js.map +0 -1
- package/lib/typescript/components/GestureButtons.d.ts +0 -122
- package/lib/typescript/components/GestureButtons.d.ts.map +0 -1
- package/lib/typescript/components/GestureHandlerButton.d.ts +0 -5
- package/lib/typescript/components/GestureHandlerButton.d.ts.map +0 -1
- package/lib/typescript/components/RNGestureHandlerButton.d.ts +0 -2
- package/lib/typescript/components/RNGestureHandlerButton.d.ts.map +0 -1
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -68
- package/lib/typescript/components/touchables/GenericTouchable.d.ts.map +0 -1
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -26
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts.map +0 -1
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -8
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts.map +0 -1
- package/lib/typescript/components/touchables/index.d.ts +0 -4
- package/lib/typescript/components/touchables/index.d.ts.map +0 -1
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -29
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts.map +0 -1
- package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -140
- package/lib/typescript/handlers/PanGestureHandler.d.ts.map +0 -1
- package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -58
- package/lib/typescript/handlers/TapGestureHandler.d.ts.map +0 -1
- package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -4
- package/lib/typescript/handlers/createNativeWrapper.d.ts.map +0 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -2
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts.map +0 -1
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +0 -24
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts.map +0 -1
- package/lib/typescript/init.d.ts +0 -3
- package/lib/typescript/init.d.ts.map +0 -1
- package/src/components/GestureButtons.tsx +0 -334
- package/src/components/GestureHandlerButton.tsx +0 -5
- package/src/components/RNGestureHandlerButton.tsx +0 -23
- package/src/components/touchables/GenericTouchable.tsx +0 -301
- package/src/components/touchables/TouchableOpacity.tsx +0 -76
- package/src/components/touchables/TouchableWithoutFeedback.tsx +0 -14
- package/src/components/touchables/index.ts +0 -7
- package/src/handlers/NativeViewGestureHandler.ts +0 -55
- package/src/handlers/PanGestureHandler.ts +0 -327
- package/src/handlers/TapGestureHandler.ts +0 -95
- package/src/handlers/createNativeWrapper.tsx +0 -81
- package/src/handlers/gestureHandlerCommon.ts +0 -15
- package/src/handlers/gestures/GestureDetector.tsx +0 -823
- package/src/init.ts +0 -18
@@ -1,8 +1,19 @@
|
|
1
|
-
{
|
2
|
-
"apiType":
|
3
|
-
"
|
4
|
-
{
|
5
|
-
"
|
6
|
-
|
7
|
-
|
1
|
+
{
|
2
|
+
"apiType": 'stageMode',
|
3
|
+
// "buildOption": {
|
4
|
+
// "externalNativeOptions": {
|
5
|
+
// "path": "./src/main/cpp/CMakeLists.txt",
|
6
|
+
// "arguments": "",
|
7
|
+
// "cppFlags": "",
|
8
|
+
// },
|
9
|
+
// },
|
10
|
+
"targets": [
|
11
|
+
{
|
12
|
+
"name": "default",
|
13
|
+
"runtimeOS": "HarmonyOS"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"name": "ohosTest",
|
17
|
+
}
|
18
|
+
]
|
8
19
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
2
|
-
export { harTasks } from '@ohos/hvigor-ohos-plugin';
|
1
|
+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
2
|
+
export { harTasks } from '@ohos/hvigor-ohos-plugin';
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from "./ts"
|
2
|
-
export * from "./src/main/ets/RNGestureHandlerRootView"
|
3
|
-
export * from "./src/main/ets/RNGestureHandlerButton"
|
1
|
+
export * from "./ts"
|
2
|
+
export * from "./src/main/ets/RNGestureHandlerRootView"
|
3
|
+
export * from "./src/main/ets/RNGestureHandlerButton"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"meta": {
|
3
|
+
"stableOrder": false
|
4
|
+
},
|
5
|
+
"lockfileVersion": 3,
|
6
|
+
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
7
|
+
"specifiers": {
|
8
|
+
"@rnoh/react-native-openharmony@../react_native_openharmony": "@rnoh/react-native-openharmony@../react_native_openharmony"
|
9
|
+
},
|
10
|
+
"packages": {
|
11
|
+
"@rnoh/react-native-openharmony@../react_native_openharmony": {
|
12
|
+
"name": "@rnoh/react-native-openharmony",
|
13
|
+
"version": "0.72.20",
|
14
|
+
"resolved": "../react_native_openharmony",
|
15
|
+
"registryType": "local"
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
@@ -1,11 +1,12 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
1
|
+
{
|
2
|
+
license: '',
|
3
|
+
devDependencies: {},
|
4
|
+
author: '',
|
5
|
+
name: '@react-native-oh-tpl/react-native-gesture-handler',
|
6
|
+
description: '',
|
7
|
+
main: 'index.ets',
|
8
|
+
version: '2.12.9-1',
|
9
|
+
dependencies: {
|
10
|
+
"@rnoh/react-native-openharmony": 'file:../react_native_openharmony',
|
11
|
+
},
|
12
|
+
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
cmake_minimum_required(VERSION 3.13)
|
2
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
3
|
-
|
4
|
-
file(GLOB rnoh_gesture_handler_SRC CONFIGURE_DEPENDS *.cpp)
|
5
|
-
add_library(rnoh_gesture_handler SHARED ${rnoh_gesture_handler_SRC})
|
6
|
-
target_include_directories(rnoh_gesture_handler PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
7
|
-
target_link_libraries(rnoh_gesture_handler PUBLIC rnoh)
|
8
|
-
|
1
|
+
cmake_minimum_required(VERSION 3.13)
|
2
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
3
|
+
|
4
|
+
file(GLOB rnoh_gesture_handler_SRC CONFIGURE_DEPENDS *.cpp)
|
5
|
+
add_library(rnoh_gesture_handler SHARED ${rnoh_gesture_handler_SRC})
|
6
|
+
target_include_directories(rnoh_gesture_handler PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
7
|
+
target_link_libraries(rnoh_gesture_handler PUBLIC rnoh)
|
8
|
+
|
@@ -1,34 +1,103 @@
|
|
1
|
-
#
|
2
|
-
#include "
|
3
|
-
#include "
|
4
|
-
#include "
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
1
|
+
#pragma once
|
2
|
+
#include "GestureHandlerPackage.h"
|
3
|
+
#include "RNOH/RNInstanceCAPI.h"
|
4
|
+
#include "RNGestureHandlerButtonComponentInstance.h"
|
5
|
+
#include "RNGestureHandlerRootViewComponentInstance.h"
|
6
|
+
#include "RNOH/ArkTSTurboModule.h"
|
7
|
+
#include "RNGestureHandlerModule.h"
|
8
|
+
#include "RNGestureHandlerButtonComponentDescriptor.h"
|
9
|
+
#include "RNGestureHandlerRootViewComponentDescriptor.h"
|
10
|
+
#include "RNGestureHandlerButtonJSIBinder.h"
|
11
|
+
#include "RNGestureHandlerRootViewJSIBinder.h"
|
12
|
+
|
13
|
+
using namespace rnoh;
|
14
|
+
using namespace facebook;
|
15
|
+
|
16
|
+
class GestureHandlerTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
17
|
+
public:
|
18
|
+
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
19
|
+
if (name == "RNGestureHandlerModule") {
|
20
|
+
return std::make_shared<RNGestureHandlerModule>(ctx, name);
|
21
|
+
}
|
22
|
+
return nullptr;
|
23
|
+
};
|
24
|
+
};
|
25
|
+
|
26
|
+
class RNGHEventEmitRequestHandler : public EventEmitRequestHandler {
|
27
|
+
void handleEvent(EventEmitRequestHandler::Context const &ctx) override {
|
28
|
+
auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::ViewEventEmitter>(ctx.tag);
|
29
|
+
if (eventEmitter == nullptr) {
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
if (ctx.eventName == "onGestureHandlerEvent") {
|
33
|
+
eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
|
34
|
+
}
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
class RNOHCorePackageComponentInstanceFactoryDelegate : public ComponentInstanceFactoryDelegate {
|
39
|
+
public:
|
40
|
+
using ComponentInstanceFactoryDelegate::ComponentInstanceFactoryDelegate;
|
41
|
+
|
42
|
+
ComponentInstance::Shared create(ComponentInstance::Context ctx) override {
|
43
|
+
if (ctx.componentName == "RNGestureHandlerButton") {
|
44
|
+
return std::make_shared<RNGestureHandlerButtonComponentInstance>(ctx);
|
45
|
+
} else if (ctx.componentName == "RNGestureHandlerRootView") {
|
46
|
+
return std::make_shared<RNGestureHandlerRootViewComponentInstance>(ctx);
|
47
|
+
}
|
48
|
+
return nullptr;
|
49
|
+
}
|
50
|
+
};
|
51
|
+
|
52
|
+
std::unique_ptr<TurboModuleFactoryDelegate> GestureHandlerPackage::createTurboModuleFactoryDelegate() {
|
53
|
+
return std::make_unique<GestureHandlerTurboModuleFactoryDelegate>();
|
54
|
+
}
|
55
|
+
|
56
|
+
std::vector<react::ComponentDescriptorProvider> GestureHandlerPackage::createComponentDescriptorProviders() {
|
57
|
+
return {
|
58
|
+
react::concreteComponentDescriptorProvider<react::RNGestureHandlerRootViewComponentDescriptor>(),
|
59
|
+
react::concreteComponentDescriptorProvider<react::RNGestureHandlerButtonComponentDescriptor>(),
|
60
|
+
};
|
61
|
+
}
|
62
|
+
|
63
|
+
ComponentJSIBinderByString GestureHandlerPackage::createComponentJSIBinderByName() {
|
64
|
+
return {
|
65
|
+
{"RNGestureHandlerButton", std::make_shared<RNGestureHandlerButtonJSIBinder>()},
|
66
|
+
{"RNGestureHandlerRootView", std::make_shared<RNGestureHandlerRootViewJSIBinder>()},
|
67
|
+
};
|
68
|
+
};
|
69
|
+
|
70
|
+
EventEmitRequestHandlers GestureHandlerPackage::createEventEmitRequestHandlers() {
|
71
|
+
return {
|
72
|
+
std::make_shared<RNGHEventEmitRequestHandler>(),
|
73
|
+
};
|
74
|
+
}
|
75
|
+
|
76
|
+
ComponentInstanceFactoryDelegate::Shared GestureHandlerPackage::createComponentInstanceFactoryDelegate() {
|
77
|
+
return std::make_shared<RNOHCorePackageComponentInstanceFactoryDelegate>();
|
78
|
+
}
|
79
|
+
|
80
|
+
class ScrollLockerArkTSMessageHandler : public ArkTSMessageHandler {
|
81
|
+
public:
|
82
|
+
void handleArkTSMessage(const Context &ctx) override {
|
83
|
+
if (ctx.messageName == "RNGH::SET_NATIVE_RESPONDERS_BLOCK") {
|
84
|
+
auto targetComponentInstanceTag = ctx.messagePayload["targetTag"].asDouble();
|
85
|
+
auto shouldBlock = ctx.messagePayload["shouldBlock"].asBool();
|
86
|
+
auto rnInstance = ctx.rnInstance.lock();
|
87
|
+
if (rnInstance != nullptr) {
|
88
|
+
auto rnInstanceCAPI = std::dynamic_pointer_cast<RNInstanceCAPI>(rnInstance);
|
89
|
+
if (rnInstanceCAPI != nullptr) {
|
90
|
+
auto tmpComponentInstance = rnInstanceCAPI->findComponentInstanceByTag(targetComponentInstanceTag);
|
91
|
+
while (tmpComponentInstance != nullptr) {
|
92
|
+
tmpComponentInstance->setNativeResponderBlocked(shouldBlock, "RNGH");
|
93
|
+
tmpComponentInstance = tmpComponentInstance->getParent().lock();
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
};
|
99
|
+
};
|
100
|
+
|
101
|
+
std::vector<ArkTSMessageHandler::Shared> GestureHandlerPackage::createArkTSMessageHandlers() {
|
102
|
+
return {std::make_shared<ScrollLockerArkTSMessageHandler>()};
|
103
|
+
}
|
@@ -1,15 +1,21 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
class GestureHandlerPackage : public Package {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
#pragma once
|
2
|
+
#include "RNOH/Package.h"
|
3
|
+
|
4
|
+
namespace rnoh {
|
5
|
+
class GestureHandlerPackage : public Package {
|
6
|
+
public:
|
7
|
+
GestureHandlerPackage(Package::Context ctx) : Package(ctx) {}
|
8
|
+
|
9
|
+
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override;
|
10
|
+
|
11
|
+
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override;
|
12
|
+
|
13
|
+
ComponentJSIBinderByString createComponentJSIBinderByName() override;
|
14
|
+
|
15
|
+
EventEmitRequestHandlers createEventEmitRequestHandlers();
|
16
|
+
|
17
|
+
ComponentInstanceFactoryDelegate::Shared createComponentInstanceFactoryDelegate();
|
18
|
+
|
19
|
+
std::vector<ArkTSMessageHandler::Shared> createArkTSMessageHandlers() override;
|
20
|
+
};
|
21
|
+
} // namespace rnoh
|
@@ -1,60 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
#include
|
7
|
-
#include
|
8
|
-
|
9
|
-
|
10
|
-
namespace
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
};
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
};
|
38
|
-
|
39
|
-
class RNGestureHandlerButtonProps : public ViewProps {
|
40
|
-
public:
|
41
|
-
RNGestureHandlerButtonProps() = default;
|
42
|
-
|
43
|
-
RNGestureHandlerButtonProps(const PropsParserContext &context, const RNGestureHandlerButtonProps &sourceProps, const RawProps &rawProps)
|
44
|
-
: ViewProps(context, sourceProps, rawProps) {}
|
45
|
-
};
|
46
|
-
|
47
|
-
using RNGestureHandlerButtonShadowNode = ConcreteViewShadowNode<
|
48
|
-
RNGestureHandlerButtonComponentName,
|
49
|
-
RNGestureHandlerButtonProps,
|
50
|
-
RNGestureHandlerButtonEventEmitter>;
|
51
|
-
|
52
|
-
class RNGestureHandlerButtonComponentDescriptor final
|
53
|
-
: public ConcreteComponentDescriptor<RNGestureHandlerButtonShadowNode> {
|
54
|
-
public:
|
55
|
-
RNGestureHandlerButtonComponentDescriptor(ComponentDescriptorParameters const ¶meters)
|
56
|
-
: ConcreteComponentDescriptor(parameters) {}
|
57
|
-
};
|
58
|
-
|
59
|
-
} // namespace react
|
60
|
-
} // namespace facebook
|
1
|
+
|
2
|
+
#pragma once
|
3
|
+
|
4
|
+
// This file was generated.
|
5
|
+
|
6
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
7
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
8
|
+
#include <react/renderer/components/view/ViewShadowNode.h>
|
9
|
+
|
10
|
+
namespace facebook {
|
11
|
+
namespace react {
|
12
|
+
|
13
|
+
extern const char RNGestureHandlerButtonComponentName[] = "RNGestureHandlerButton";
|
14
|
+
|
15
|
+
class RNGestureHandlerButtonProps : public ViewProps {
|
16
|
+
public:
|
17
|
+
RNGestureHandlerButtonProps() = default;
|
18
|
+
|
19
|
+
RNGestureHandlerButtonProps(const PropsParserContext &context, const RNGestureHandlerButtonProps &sourceProps, const RawProps &rawProps)
|
20
|
+
: ViewProps(context, sourceProps, rawProps) {}
|
21
|
+
};
|
22
|
+
|
23
|
+
using RNGestureHandlerButtonShadowNode = ConcreteViewShadowNode<
|
24
|
+
RNGestureHandlerButtonComponentName,
|
25
|
+
RNGestureHandlerButtonProps,
|
26
|
+
ViewEventEmitter>;
|
27
|
+
|
28
|
+
class RNGestureHandlerButtonComponentDescriptor final
|
29
|
+
: public ConcreteComponentDescriptor<RNGestureHandlerButtonShadowNode> {
|
30
|
+
public:
|
31
|
+
RNGestureHandlerButtonComponentDescriptor(ComponentDescriptorParameters const ¶meters)
|
32
|
+
: ConcreteComponentDescriptor(parameters) {}
|
33
|
+
};
|
34
|
+
|
35
|
+
} // namespace react
|
36
|
+
} // namespace facebook
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#pragma once
|
2
|
+
#import "RNOH/CppComponentInstance.h"
|
3
|
+
#import "RNOH/arkui/StackNode.h"
|
4
|
+
#import "RNGestureHandlerButtonComponentDescriptor.h"
|
5
|
+
|
6
|
+
namespace rnoh {
|
7
|
+
class RNGestureHandlerButtonComponentInstance
|
8
|
+
: public CppComponentInstance<facebook::react::RNGestureHandlerButtonShadowNode> {
|
9
|
+
private:
|
10
|
+
StackNode m_stackNode;
|
11
|
+
|
12
|
+
public:
|
13
|
+
RNGestureHandlerButtonComponentInstance(Context context) : CppComponentInstance(std::move(context)) {};
|
14
|
+
|
15
|
+
StackNode &getLocalRootArkUINode() override { return m_stackNode; };
|
16
|
+
|
17
|
+
void onChildInserted(ComponentInstance::Shared const &childComponentInstance, std::size_t index) override {
|
18
|
+
CppComponentInstance::onChildInserted(childComponentInstance, index);
|
19
|
+
m_stackNode.insertChild(childComponentInstance->getLocalRootArkUINode(), index);
|
20
|
+
};
|
21
|
+
|
22
|
+
void onChildRemoved(ComponentInstance::Shared const &childComponentInstance) override {
|
23
|
+
CppComponentInstance::onChildRemoved(childComponentInstance);
|
24
|
+
m_stackNode.removeChild(childComponentInstance->getLocalRootArkUINode());
|
25
|
+
};
|
26
|
+
};
|
27
|
+
} // namespace rnoh
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
// This file was generated.
|
4
|
+
|
5
|
+
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
|
6
|
+
|
7
|
+
namespace rnoh {
|
8
|
+
class RNGestureHandlerButtonJSIBinder : public ViewComponentJSIBinder {
|
9
|
+
protected:
|
10
|
+
facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
|
11
|
+
auto object = ViewComponentJSIBinder::createNativeProps(rt);
|
12
|
+
object.setProperty(rt, "exclusive", true);
|
13
|
+
object.setProperty(rt, "foreground", true);
|
14
|
+
object.setProperty(rt, "borderless", true);
|
15
|
+
object.setProperty(rt, "enabled", true);
|
16
|
+
object.setProperty(rt, "rippleColor", true);
|
17
|
+
object.setProperty(rt, "rippleRadius", true);
|
18
|
+
object.setProperty(rt, "touchSoundDisabled", true);
|
19
|
+
return object;
|
20
|
+
}
|
21
|
+
|
22
|
+
facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
|
23
|
+
facebook::jsi::Object events(rt);
|
24
|
+
return events;
|
25
|
+
}
|
26
|
+
|
27
|
+
facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
|
28
|
+
facebook::jsi::Object events(rt);
|
29
|
+
return events;
|
30
|
+
}
|
31
|
+
};
|
32
|
+
} // namespace rnoh
|
@@ -1,17 +1,22 @@
|
|
1
|
-
|
2
|
-
#include "
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
1
|
+
|
2
|
+
#include "RNGestureHandlerModule.h"
|
3
|
+
|
4
|
+
// This file was generated.
|
5
|
+
|
6
|
+
namespace rnoh {
|
7
|
+
using namespace facebook;
|
8
|
+
|
9
|
+
RNGestureHandlerModule::RNGestureHandlerModule(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
|
10
|
+
methodMap_ = {
|
11
|
+
ARK_METHOD_METADATA(handleSetJSResponder, 2),
|
12
|
+
ARK_METHOD_METADATA(handleClearJSResponder, 0),
|
13
|
+
ARK_METHOD_METADATA(createGestureHandler, 3),
|
14
|
+
ARK_METHOD_METADATA(attachGestureHandler, 3),
|
15
|
+
ARK_METHOD_METADATA(updateGestureHandler, 2),
|
16
|
+
ARK_METHOD_METADATA(dropGestureHandler, 1),
|
17
|
+
ARK_METHOD_METADATA(install, 0),
|
18
|
+
ARK_METHOD_METADATA(flushOperations, 0),
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
} // namespace rnoh
|
@@ -1,12 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
|
2
|
+
#pragma once
|
3
|
+
|
4
|
+
// This file was generated.
|
5
|
+
|
6
|
+
#include "RNOH/ArkTSTurboModule.h"
|
7
|
+
|
8
|
+
namespace rnoh {
|
9
|
+
|
10
|
+
class JSI_EXPORT RNGestureHandlerModule : public ArkTSTurboModule {
|
11
|
+
public:
|
12
|
+
RNGestureHandlerModule(const ArkTSTurboModule::Context ctx, const std::string name);
|
13
|
+
};
|
14
|
+
|
15
|
+
} // namespace rnoh
|
@@ -0,0 +1,72 @@
|
|
1
|
+
// #pragma once
|
2
|
+
//
|
3
|
+
// // This file was generated.
|
4
|
+
//
|
5
|
+
// #include "RNOH/Package.h"
|
6
|
+
// #include "RNOH/ArkTSTurboModule.h"
|
7
|
+
// #include "RNGestureHandlerModule.h"
|
8
|
+
// #include "RNGestureHandlerButtonComponentDescriptor.h"
|
9
|
+
// #include "RNGestureHandlerRootViewComponentDescriptor.h"
|
10
|
+
// #include "RNGestureHandlerButtonJSIBinder.h"
|
11
|
+
// #include "RNGestureHandlerRootViewJSIBinder.h"
|
12
|
+
//
|
13
|
+
// namespace rnoh {
|
14
|
+
//
|
15
|
+
// class RNOHGeneratedPackageTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
16
|
+
// public:
|
17
|
+
// SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
18
|
+
// if (name == "RNGestureHandlerModule") {
|
19
|
+
// return std::make_shared<RNGestureHandlerModule>(ctx, name);
|
20
|
+
// }
|
21
|
+
// return nullptr;
|
22
|
+
// };
|
23
|
+
// };
|
24
|
+
//
|
25
|
+
// class GeneratedEventEmitRequestHandler : public EventEmitRequestHandler {
|
26
|
+
// public:
|
27
|
+
// void handleEvent(Context const &ctx) override {
|
28
|
+
// auto eventEmitter = ctx.shadowViewRegistry->getEventEmitter<facebook::react::EventEmitter>(ctx.tag);
|
29
|
+
// if (eventEmitter == nullptr) {
|
30
|
+
// return;
|
31
|
+
// }
|
32
|
+
//
|
33
|
+
// std::vector<std::string> supportedEventNames = {
|
34
|
+
// "directEvent",
|
35
|
+
// "bubblingEvent",
|
36
|
+
// };
|
37
|
+
// if (std::find(supportedEventNames.begin(), supportedEventNames.end(), ctx.eventName) != supportedEventNames.end()) {
|
38
|
+
// eventEmitter->dispatchEvent(ctx.eventName, ArkJS(ctx.env).getDynamic(ctx.payload));
|
39
|
+
// }
|
40
|
+
// }
|
41
|
+
// };
|
42
|
+
//
|
43
|
+
// class RNOHGeneratedPackage : public Package {
|
44
|
+
// public:
|
45
|
+
// RNOHGeneratedPackage(Package::Context ctx) : Package(ctx){};
|
46
|
+
//
|
47
|
+
// std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override {
|
48
|
+
// return std::make_unique<RNOHGeneratedPackageTurboModuleFactoryDelegate>();
|
49
|
+
// }
|
50
|
+
//
|
51
|
+
// std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override {
|
52
|
+
// return {
|
53
|
+
// facebook::react::concreteComponentDescriptorProvider<facebook::react::RNGestureHandlerButtonComponentDescriptor>(),
|
54
|
+
// facebook::react::concreteComponentDescriptorProvider<facebook::react::RNGestureHandlerRootViewComponentDescriptor>(),
|
55
|
+
// };
|
56
|
+
// }
|
57
|
+
//
|
58
|
+
// ComponentJSIBinderByString createComponentJSIBinderByName() override {
|
59
|
+
// return {
|
60
|
+
// {"RNGestureHandlerButton", std::make_shared<RNGestureHandlerButtonJSIBinder>()},
|
61
|
+
// {"RNGestureHandlerRootView", std::make_shared<RNGestureHandlerRootViewJSIBinder>()},
|
62
|
+
// };
|
63
|
+
// };
|
64
|
+
//
|
65
|
+
// EventEmitRequestHandlers createEventEmitRequestHandlers() override {
|
66
|
+
// return {
|
67
|
+
// std::make_shared<GeneratedEventEmitRequestHandler>(),
|
68
|
+
// };
|
69
|
+
// }
|
70
|
+
// };
|
71
|
+
//
|
72
|
+
// } // namespace rnoh
|