@react-native-oh-tpl/react-native-gesture-handler 2.14.15 → 2.14.16
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/harmony/gesture_handler/BuildProfile.ets +1 -1
- package/harmony/gesture_handler/oh-package-lock.json5 +6 -5
- package/harmony/gesture_handler/oh-package.json5 +2 -2
- package/harmony/gesture_handler/src/main/cpp/RnohReactNativeHarmonyGestureHandlerPackage.cpp +0 -34
- package/harmony/gesture_handler/src/main/cpp/RnohReactNativeHarmonyGestureHandlerPackage.h +0 -6
- package/harmony/gesture_handler/src/main/cpp/componentInstances/RNGestureHandlerButtonComponentInstance.h +1 -1
- package/harmony/gesture_handler/src/main/cpp/componentInstances/RNGestureHandlerRootViewComponentInstance.h +1 -1
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGHRootViewController.ts +5 -5
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGHView.ts +4 -0
- package/harmony/gesture_handler/src/main/ets/rnoh/RNGestureHandlerModule.ts +1 -1
- package/harmony/gesture_handler.har +0 -0
- package/package.json +1 -1
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +0 -36
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonJSIBinder.h +0 -32
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +0 -22
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +0 -15
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +0 -36
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewJSIBinder.h +0 -25
- package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerModule.ts +0 -24
- package/harmony/gesture_handler/src/main/ets/namespace/components/RNGestureHandlerButton.ts +0 -139
- package/harmony/gesture_handler/src/main/ets/namespace/components/RNGestureHandlerRootView.ts +0 -101
- package/harmony/gesture_handler/src/main/ets/namespace/components/ts.ts +0 -2
- package/harmony/gesture_handler/src/main/ets/namespace/ts.ts +0 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
3
3
|
*/
|
4
|
-
export const HAR_VERSION = '2.14.
|
4
|
+
export const HAR_VERSION = '2.14.16';
|
5
5
|
export const BUILD_MODE_NAME = 'release';
|
6
6
|
export const DEBUG = false;
|
7
7
|
export const TARGET_NAME = 'default';
|
@@ -5,14 +5,15 @@
|
|
5
5
|
"lockfileVersion": 3,
|
6
6
|
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
7
7
|
"specifiers": {
|
8
|
-
"@rnoh/react-native-openharmony
|
8
|
+
"@rnoh/react-native-openharmony@0.72.38": "@rnoh/react-native-openharmony@0.72.38"
|
9
9
|
},
|
10
10
|
"packages": {
|
11
|
-
"@rnoh/react-native-openharmony
|
11
|
+
"@rnoh/react-native-openharmony@0.72.38": {
|
12
12
|
"name": "@rnoh/react-native-openharmony",
|
13
|
-
"version": "0.72.
|
14
|
-
"
|
15
|
-
"
|
13
|
+
"version": "0.72.38",
|
14
|
+
"integrity": "sha512-br5SIrbB0OarSLirenleE7eTOX1lNccMJ7nb/G7qWTyJ7kW4DalmTXVKYpoT2qaOLls1uEE7McD1OjbZZM9jug==",
|
15
|
+
"resolved": "https://ohpm.openharmony.cn/ohpm/@rnoh/react-native-openharmony/-/react-native-openharmony-0.72.38.har",
|
16
|
+
"registryType": "ohpm"
|
16
17
|
}
|
17
18
|
}
|
18
19
|
}
|
@@ -5,8 +5,8 @@
|
|
5
5
|
name: '@react-native-oh-tpl/react-native-gesture-handler',
|
6
6
|
description: '',
|
7
7
|
type: 'module',
|
8
|
-
version: '2.14.
|
8
|
+
version: '2.14.16',
|
9
9
|
dependencies: {
|
10
|
-
"@rnoh/react-native-openharmony": "
|
10
|
+
"@rnoh/react-native-openharmony": "^0.72.32"
|
11
11
|
},
|
12
12
|
}
|
package/harmony/gesture_handler/src/main/cpp/RnohReactNativeHarmonyGestureHandlerPackage.cpp
CHANGED
@@ -3,29 +3,12 @@
|
|
3
3
|
#include "RNOH/RNInstanceCAPI.h"
|
4
4
|
#include "componentInstances/RNGestureHandlerButtonComponentInstance.h"
|
5
5
|
#include "componentInstances/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
6
|
#include <glog/logging.h>
|
13
7
|
#include <react/renderer/debug/SystraceSection.h>
|
14
8
|
|
15
9
|
using namespace rnoh;
|
16
10
|
using namespace facebook;
|
17
11
|
|
18
|
-
class GestureHandlerTurboModuleFactoryDelegate : public TurboModuleFactoryDelegate {
|
19
|
-
public:
|
20
|
-
SharedTurboModule createTurboModule(Context ctx, const std::string &name) const override {
|
21
|
-
if (name == "RNGestureHandlerModule") {
|
22
|
-
return std::make_shared<RNGestureHandlerModule>(ctx, name);
|
23
|
-
}
|
24
|
-
return nullptr;
|
25
|
-
};
|
26
|
-
};
|
27
|
-
|
28
|
-
|
29
12
|
class RNGHEventEmitRequestHandler : public EventEmitRequestHandler {
|
30
13
|
void handleEvent(EventEmitRequestHandler::Context const &ctx) override {
|
31
14
|
facebook::react::SystraceSection s("RNGH::RNGHEventEmitRequestHandler::handleEvent");
|
@@ -55,23 +38,6 @@ public:
|
|
55
38
|
}
|
56
39
|
};
|
57
40
|
|
58
|
-
std::unique_ptr<TurboModuleFactoryDelegate> RnohReactNativeHarmonyGestureHandlerPackage::createTurboModuleFactoryDelegate() {
|
59
|
-
return std::make_unique<GestureHandlerTurboModuleFactoryDelegate>();
|
60
|
-
}
|
61
|
-
|
62
|
-
std::vector<react::ComponentDescriptorProvider> RnohReactNativeHarmonyGestureHandlerPackage::createComponentDescriptorProviders() {
|
63
|
-
return {
|
64
|
-
react::concreteComponentDescriptorProvider<react::RNGestureHandlerRootViewComponentDescriptor>(),
|
65
|
-
react::concreteComponentDescriptorProvider<react::RNGestureHandlerButtonComponentDescriptor>(),
|
66
|
-
};
|
67
|
-
}
|
68
|
-
|
69
|
-
ComponentJSIBinderByString RnohReactNativeHarmonyGestureHandlerPackage::createComponentJSIBinderByName() {
|
70
|
-
return {
|
71
|
-
{"RNGestureHandlerButton", std::make_shared<RNGestureHandlerButtonJSIBinder>()},
|
72
|
-
{"RNGestureHandlerRootView", std::make_shared<RNGestureHandlerRootViewJSIBinder>()},
|
73
|
-
};
|
74
|
-
};
|
75
41
|
|
76
42
|
EventEmitRequestHandlers RnohReactNativeHarmonyGestureHandlerPackage::createEventEmitRequestHandlers() {
|
77
43
|
return {
|
@@ -5,13 +5,7 @@ namespace rnoh {
|
|
5
5
|
class RnohReactNativeHarmonyGestureHandlerPackage : public Package {
|
6
6
|
public:
|
7
7
|
RnohReactNativeHarmonyGestureHandlerPackage(Package::Context ctx) : Package(ctx) {}
|
8
|
-
|
9
|
-
std::unique_ptr<TurboModuleFactoryDelegate> createTurboModuleFactoryDelegate() override;
|
10
|
-
|
11
|
-
std::vector<facebook::react::ComponentDescriptorProvider> createComponentDescriptorProviders() override;
|
12
8
|
|
13
|
-
ComponentJSIBinderByString createComponentJSIBinderByName() override;
|
14
|
-
|
15
9
|
EventEmitRequestHandlers createEventEmitRequestHandlers();
|
16
10
|
|
17
11
|
ComponentInstanceFactoryDelegate::Shared createComponentInstanceFactoryDelegate();
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#pragma once
|
2
2
|
#import "RNOH/CppComponentInstance.h"
|
3
3
|
#import "RNOH/arkui/StackNode.h"
|
4
|
-
#import "
|
4
|
+
#import "generated/RNGestureHandlerButtonComponentDescriptor.h"
|
5
5
|
|
6
6
|
namespace rnoh {
|
7
7
|
class RNGestureHandlerButtonComponentInstance
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#import "RNOH/arkui/ArkUINodeRegistry.h"
|
5
5
|
#import "RNOH/arkui/NativeNodeApi.h"
|
6
6
|
#import "RNOH/RNInstanceCAPI.h"
|
7
|
-
#import "
|
7
|
+
#import "generated/RNGestureHandlerRootViewComponentDescriptor.h"
|
8
8
|
#import "RNGestureHandlerButtonComponentInstance.h"
|
9
9
|
|
10
10
|
namespace rnoh {
|
@@ -94,11 +94,10 @@ export class RNGHRootViewController {
|
|
94
94
|
// with the child bounding box ensures that the parent handlers are called correctly.
|
95
95
|
// This approach is slightly different from Android RNGH implementation (extracting parent gesture handlers),
|
96
96
|
// however, the outcome is the same.
|
97
|
-
for (let j = i; j >
|
98
|
-
const
|
99
|
-
|
100
|
-
|
101
|
-
parentView.attachChildrenBoundingRects(currentView);
|
97
|
+
for (let j = i - 1; j > 0; j--) {
|
98
|
+
const parentView = views[j];
|
99
|
+
if (parentView.intersectsWith(view)) {
|
100
|
+
parentView.attachChildrenBoundingRects(view);
|
102
101
|
}
|
103
102
|
}
|
104
103
|
}
|
@@ -118,6 +117,7 @@ export class RNGHRootViewController {
|
|
118
117
|
|
119
118
|
if (touchEvent.type === TouchType.Up || touchEvent.type === TouchType.Cancel) {
|
120
119
|
touchableViews.forEach(view => this.touchableViewsMultiset.remove(view));
|
120
|
+
views.forEach(view => view.resetChildrenBoundingRects());
|
121
121
|
}
|
122
122
|
}
|
123
123
|
|
@@ -57,6 +57,10 @@ export class RNGHView implements View {
|
|
57
57
|
this.boundingBox = boundingBox
|
58
58
|
}
|
59
59
|
|
60
|
+
resetChildrenBoundingRects() {
|
61
|
+
this.childrenBoundingBoxes.clear()
|
62
|
+
}
|
63
|
+
|
60
64
|
attachChildrenBoundingRects(view: RNGHView) {
|
61
65
|
this.childrenBoundingBoxes.add(view.getBoundingRect())
|
62
66
|
for (const childBoundingBox of view.getChildrenBoundingRects()) {
|
Binary file
|
package/package.json
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
"type": "git",
|
18
18
|
"url": "https://github.com/react-native-oh-library/react-native-harmony-gesture-handler.git"
|
19
19
|
},
|
20
|
-
"version": "2.14.
|
20
|
+
"version": "2.14.16",
|
21
21
|
"description": "",
|
22
22
|
"react-native": "src/index.ts",
|
23
23
|
"main": "lib/commonjs/index.js",
|
@@ -1,36 +0,0 @@
|
|
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
|
@@ -1,32 +0,0 @@
|
|
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,22 +0,0 @@
|
|
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,15 +0,0 @@
|
|
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
|
@@ -1,36 +0,0 @@
|
|
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 RNGestureHandlerRootViewComponentName[] = "RNGestureHandlerRootView";
|
14
|
-
|
15
|
-
class RNGestureHandlerRootViewProps : public ViewProps {
|
16
|
-
public:
|
17
|
-
RNGestureHandlerRootViewProps() = default;
|
18
|
-
|
19
|
-
RNGestureHandlerRootViewProps(const PropsParserContext &context, const RNGestureHandlerRootViewProps &sourceProps, const RawProps &rawProps)
|
20
|
-
: ViewProps(context, sourceProps, rawProps) {}
|
21
|
-
};
|
22
|
-
|
23
|
-
using RNGestureHandlerRootViewShadowNode = ConcreteViewShadowNode<
|
24
|
-
RNGestureHandlerRootViewComponentName,
|
25
|
-
RNGestureHandlerRootViewProps,
|
26
|
-
ViewEventEmitter>;
|
27
|
-
|
28
|
-
class RNGestureHandlerRootViewComponentDescriptor final
|
29
|
-
: public ConcreteComponentDescriptor<RNGestureHandlerRootViewShadowNode> {
|
30
|
-
public:
|
31
|
-
RNGestureHandlerRootViewComponentDescriptor(ComponentDescriptorParameters const ¶meters)
|
32
|
-
: ConcreteComponentDescriptor(parameters) {}
|
33
|
-
};
|
34
|
-
|
35
|
-
} // namespace react
|
36
|
-
} // namespace facebook
|
@@ -1,25 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
// This file was generated.
|
4
|
-
|
5
|
-
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
|
6
|
-
|
7
|
-
namespace rnoh {
|
8
|
-
class RNGestureHandlerRootViewJSIBinder : public ViewComponentJSIBinder {
|
9
|
-
protected:
|
10
|
-
facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
|
11
|
-
auto object = ViewComponentJSIBinder::createNativeProps(rt);
|
12
|
-
return object;
|
13
|
-
}
|
14
|
-
|
15
|
-
facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
|
16
|
-
facebook::jsi::Object events(rt);
|
17
|
-
return events;
|
18
|
-
}
|
19
|
-
|
20
|
-
facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
|
21
|
-
facebook::jsi::Object events(rt);
|
22
|
-
return events;
|
23
|
-
}
|
24
|
-
};
|
25
|
-
} // namespace rnoh
|
@@ -1,24 +0,0 @@
|
|
1
|
-
// This file was generated.
|
2
|
-
|
3
|
-
export namespace RNGestureHandlerModule {
|
4
|
-
export const NAME = 'RNGestureHandlerModule' as const
|
5
|
-
|
6
|
-
export interface Spec {
|
7
|
-
handleSetJSResponder(tag: number, blockNativeResponder: boolean): void;
|
8
|
-
|
9
|
-
handleClearJSResponder(): void;
|
10
|
-
|
11
|
-
createGestureHandler(handlerName: string, handlerTag: number, config: Object): void;
|
12
|
-
|
13
|
-
attachGestureHandler(handlerTag: number, newView: number, actionType: number): void;
|
14
|
-
|
15
|
-
updateGestureHandler(handlerTag: number, newConfig: Object): void;
|
16
|
-
|
17
|
-
dropGestureHandler(handlerTag: number): void;
|
18
|
-
|
19
|
-
install(): boolean;
|
20
|
-
|
21
|
-
flushOperations(): void;
|
22
|
-
|
23
|
-
}
|
24
|
-
}
|
@@ -1,139 +0,0 @@
|
|
1
|
-
// This file was generated.
|
2
|
-
import {
|
3
|
-
Descriptor as ComponentDescriptor,
|
4
|
-
ViewBaseProps,
|
5
|
-
ViewRawProps,
|
6
|
-
ViewDescriptorWrapperBase,
|
7
|
-
ColorValue,
|
8
|
-
Color,
|
9
|
-
RNInstance,
|
10
|
-
Tag,
|
11
|
-
RNComponentCommandReceiver,
|
12
|
-
ViewPropsSelector,
|
13
|
-
} from '@rnoh/react-native-openharmony/ts';
|
14
|
-
|
15
|
-
|
16
|
-
export namespace RNGestureHandlerButton {
|
17
|
-
export const NAME = "RNGestureHandlerButton" as const
|
18
|
-
|
19
|
-
export interface DirectRawProps {
|
20
|
-
exclusive?: boolean;
|
21
|
-
foreground?: boolean;
|
22
|
-
borderless?: boolean;
|
23
|
-
enabled?: boolean;
|
24
|
-
rippleColor?: ColorValue;
|
25
|
-
rippleRadius?: number;
|
26
|
-
touchSoundDisabled?: boolean;
|
27
|
-
}
|
28
|
-
|
29
|
-
export interface Props extends ViewBaseProps {}
|
30
|
-
|
31
|
-
export interface State {}
|
32
|
-
|
33
|
-
export interface RawProps extends ViewRawProps, DirectRawProps {}
|
34
|
-
|
35
|
-
export class PropsSelector extends ViewPropsSelector<Props, RawProps> {
|
36
|
-
get exclusive() {
|
37
|
-
return this.rawProps.exclusive ?? true;
|
38
|
-
}
|
39
|
-
|
40
|
-
get foreground() {
|
41
|
-
return this.rawProps.foreground ?? false;
|
42
|
-
}
|
43
|
-
|
44
|
-
get borderless() {
|
45
|
-
return this.rawProps.borderless ?? false;
|
46
|
-
}
|
47
|
-
|
48
|
-
get enabled() {
|
49
|
-
return this.rawProps.enabled ?? true;
|
50
|
-
}
|
51
|
-
|
52
|
-
get rippleRadius() {
|
53
|
-
return this.rawProps.rippleRadius ?? 0;
|
54
|
-
}
|
55
|
-
|
56
|
-
get touchSoundDisabled() {
|
57
|
-
return this.rawProps.touchSoundDisabled ?? false;
|
58
|
-
}
|
59
|
-
|
60
|
-
|
61
|
-
get rippleColor() {
|
62
|
-
if (this.rawProps.rippleColor) {
|
63
|
-
return Color.fromColorValue(this.rawProps.rippleColor)
|
64
|
-
} else {
|
65
|
-
return new Color({ r: 0, g: 0, b: 0, a: 255})
|
66
|
-
}
|
67
|
-
}
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
export type Descriptor = ComponentDescriptor<
|
72
|
-
typeof NAME,
|
73
|
-
Props,
|
74
|
-
State,
|
75
|
-
RawProps
|
76
|
-
>;
|
77
|
-
|
78
|
-
export class DescriptorWrapper extends ViewDescriptorWrapperBase<
|
79
|
-
typeof NAME,
|
80
|
-
Props,
|
81
|
-
State,
|
82
|
-
RawProps,
|
83
|
-
PropsSelector
|
84
|
-
> {
|
85
|
-
protected createPropsSelector() {
|
86
|
-
return new PropsSelector(this.descriptor.props, this.descriptor.rawProps)
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
|
-
export interface EventPayloadByName {
|
91
|
-
}
|
92
|
-
|
93
|
-
export class EventEmitter {
|
94
|
-
constructor(private rnInstance: RNInstance, private tag: Tag) {}
|
95
|
-
|
96
|
-
emit<TEventName extends keyof EventPayloadByName>(eventName: TEventName, payload: EventPayloadByName[TEventName]) {
|
97
|
-
this.rnInstance.emitComponentEvent(this.tag, eventName, payload)
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
export interface CommandArgvByName {
|
102
|
-
}
|
103
|
-
|
104
|
-
export class CommandReceiver {
|
105
|
-
private listenersByCommandName = new Map<string, Set<(...args: any[]) => void>>()
|
106
|
-
private cleanUp: (() => void) | undefined = undefined
|
107
|
-
|
108
|
-
constructor(private componentCommandReceiver: RNComponentCommandReceiver, private tag: Tag) {
|
109
|
-
}
|
110
|
-
|
111
|
-
subscribe<TCommandName extends keyof CommandArgvByName>(commandName: TCommandName, listener: (argv: CommandArgvByName[TCommandName]) => void) {
|
112
|
-
if (!this.listenersByCommandName.has(commandName)) {
|
113
|
-
this.listenersByCommandName.set(commandName, new Set())
|
114
|
-
}
|
115
|
-
this.listenersByCommandName.get(commandName)!.add(listener)
|
116
|
-
const hasRegisteredCommandReceiver = !!this.cleanUp
|
117
|
-
if (!hasRegisteredCommandReceiver) {
|
118
|
-
this.cleanUp = this.componentCommandReceiver.registerCommandCallback(this.tag, (commandName: string, argv: any[]) => {
|
119
|
-
if (this.listenersByCommandName.has(commandName)) {
|
120
|
-
const listeners = this.listenersByCommandName.get(commandName)!
|
121
|
-
listeners.forEach(listener => {
|
122
|
-
listener(argv)
|
123
|
-
})
|
124
|
-
}
|
125
|
-
})
|
126
|
-
}
|
127
|
-
|
128
|
-
return () => {
|
129
|
-
this.listenersByCommandName.get(commandName)?.delete(listener)
|
130
|
-
if (this.listenersByCommandName.get(commandName)?.size ?? 0 === 0) {
|
131
|
-
this.listenersByCommandName.delete(commandName)
|
132
|
-
}
|
133
|
-
if (this.listenersByCommandName.size === 0) {
|
134
|
-
this.cleanUp?.()
|
135
|
-
}
|
136
|
-
}
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
package/harmony/gesture_handler/src/main/ets/namespace/components/RNGestureHandlerRootView.ts
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
// This file was generated.
|
2
|
-
import {
|
3
|
-
Descriptor as ComponentDescriptor,
|
4
|
-
ViewBaseProps,
|
5
|
-
ViewRawProps,
|
6
|
-
ViewDescriptorWrapperBase,
|
7
|
-
ColorValue,
|
8
|
-
Color,
|
9
|
-
RNInstance,
|
10
|
-
Tag,
|
11
|
-
RNComponentCommandReceiver,
|
12
|
-
ViewPropsSelector,
|
13
|
-
} from '@rnoh/react-native-openharmony/ts';
|
14
|
-
|
15
|
-
|
16
|
-
export namespace RNGestureHandlerRootView {
|
17
|
-
export const NAME = "RNGestureHandlerRootView" as const
|
18
|
-
|
19
|
-
export interface DirectRawProps {
|
20
|
-
}
|
21
|
-
|
22
|
-
export interface Props extends ViewBaseProps {}
|
23
|
-
|
24
|
-
export interface State {}
|
25
|
-
|
26
|
-
export interface RawProps extends ViewRawProps, DirectRawProps {}
|
27
|
-
|
28
|
-
export class PropsSelector extends ViewPropsSelector<Props, RawProps> {
|
29
|
-
|
30
|
-
}
|
31
|
-
|
32
|
-
export type Descriptor = ComponentDescriptor<
|
33
|
-
typeof NAME,
|
34
|
-
Props,
|
35
|
-
State,
|
36
|
-
RawProps
|
37
|
-
>;
|
38
|
-
|
39
|
-
export class DescriptorWrapper extends ViewDescriptorWrapperBase<
|
40
|
-
typeof NAME,
|
41
|
-
Props,
|
42
|
-
State,
|
43
|
-
RawProps,
|
44
|
-
PropsSelector
|
45
|
-
> {
|
46
|
-
protected createPropsSelector() {
|
47
|
-
return new PropsSelector(this.descriptor.props, this.descriptor.rawProps)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
export interface EventPayloadByName {
|
52
|
-
}
|
53
|
-
|
54
|
-
export class EventEmitter {
|
55
|
-
constructor(private rnInstance: RNInstance, private tag: Tag) {}
|
56
|
-
|
57
|
-
emit<TEventName extends keyof EventPayloadByName>(eventName: TEventName, payload: EventPayloadByName[TEventName]) {
|
58
|
-
this.rnInstance.emitComponentEvent(this.tag, eventName, payload)
|
59
|
-
}
|
60
|
-
}
|
61
|
-
|
62
|
-
export interface CommandArgvByName {
|
63
|
-
}
|
64
|
-
|
65
|
-
export class CommandReceiver {
|
66
|
-
private listenersByCommandName = new Map<string, Set<(...args: any[]) => void>>()
|
67
|
-
private cleanUp: (() => void) | undefined = undefined
|
68
|
-
|
69
|
-
constructor(private componentCommandReceiver: RNComponentCommandReceiver, private tag: Tag) {
|
70
|
-
}
|
71
|
-
|
72
|
-
subscribe<TCommandName extends keyof CommandArgvByName>(commandName: TCommandName, listener: (argv: CommandArgvByName[TCommandName]) => void) {
|
73
|
-
if (!this.listenersByCommandName.has(commandName)) {
|
74
|
-
this.listenersByCommandName.set(commandName, new Set())
|
75
|
-
}
|
76
|
-
this.listenersByCommandName.get(commandName)!.add(listener)
|
77
|
-
const hasRegisteredCommandReceiver = !!this.cleanUp
|
78
|
-
if (!hasRegisteredCommandReceiver) {
|
79
|
-
this.cleanUp = this.componentCommandReceiver.registerCommandCallback(this.tag, (commandName: string, argv: any[]) => {
|
80
|
-
if (this.listenersByCommandName.has(commandName)) {
|
81
|
-
const listeners = this.listenersByCommandName.get(commandName)!
|
82
|
-
listeners.forEach(listener => {
|
83
|
-
listener(argv)
|
84
|
-
})
|
85
|
-
}
|
86
|
-
})
|
87
|
-
}
|
88
|
-
|
89
|
-
return () => {
|
90
|
-
this.listenersByCommandName.get(commandName)?.delete(listener)
|
91
|
-
if (this.listenersByCommandName.get(commandName)?.size ?? 0 === 0) {
|
92
|
-
this.listenersByCommandName.delete(commandName)
|
93
|
-
}
|
94
|
-
if (this.listenersByCommandName.size === 0) {
|
95
|
-
this.cleanUp?.()
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
}
|