@react-native-oh-tpl/react-native-gesture-handler 2.12.9 → 2.14.4-1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/DrawerLayout/index.ts +2 -0
  2. package/Swipeable/index.ts +2 -0
  3. package/harmony/gesture_handler.har +0 -0
  4. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  5. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  6. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  7. package/lib/commonjs/index.js +91 -137
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -1
  10. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  11. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  12. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  13. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  14. package/lib/module/handlers/createHandler.js.map +1 -1
  15. package/lib/module/index.js +10 -141
  16. package/lib/module/index.js.map +1 -1
  17. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -1
  18. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -1
  19. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -1
  20. package/lib/typescript/RNGestureHandlerModule.d.ts +2 -2
  21. package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -6
  22. package/lib/typescript/handlers/createHandler.d.ts +11 -11
  23. package/lib/typescript/index.d.ts +42 -9
  24. package/lib/typescript/index.d.ts.map +1 -1
  25. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +14 -14
  26. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +14 -14
  27. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +6 -6
  28. package/package.json +69 -66
  29. package/src/RNGestureHandlerModule.ts +4 -4
  30. package/src/components/GestureHandlerRootView.tsx +23 -23
  31. package/src/handlers/createHandler.tsx +534 -534
  32. package/src/index.ts +172 -172
  33. package/src/specs/NativeRNGestureHandlerModule.ts +26 -26
  34. package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -18
  35. package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -6
  36. package/harmony/gesture_handler/BuildProfile.ets +0 -5
  37. package/harmony/gesture_handler/build-profile.json5 +0 -19
  38. package/harmony/gesture_handler/hvigorfile.ts +0 -2
  39. package/harmony/gesture_handler/index.ets +0 -3
  40. package/harmony/gesture_handler/oh-package-lock.json5 +0 -17
  41. package/harmony/gesture_handler/oh-package.json5 +0 -12
  42. package/harmony/gesture_handler/src/main/cpp/CMakeLists.txt +0 -8
  43. package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.cpp +0 -103
  44. package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +0 -21
  45. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +0 -36
  46. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentInstance.h +0 -27
  47. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonJSIBinder.h +0 -32
  48. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +0 -22
  49. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +0 -15
  50. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerPackage.h +0 -72
  51. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +0 -36
  52. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentInstance.h +0 -78
  53. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewJSIBinder.h +0 -25
  54. package/harmony/gesture_handler/src/main/ets/CircularBuffer.ts +0 -42
  55. package/harmony/gesture_handler/src/main/ets/Event.ts +0 -68
  56. package/harmony/gesture_handler/src/main/ets/EventDispatcher.ts +0 -53
  57. package/harmony/gesture_handler/src/main/ets/GestureHandler.ts +0 -663
  58. package/harmony/gesture_handler/src/main/ets/GestureHandlerArkUIAdapter.ts +0 -203
  59. package/harmony/gesture_handler/src/main/ets/GestureHandlerFactory.ts +0 -45
  60. package/harmony/gesture_handler/src/main/ets/GestureHandlerOrchestrator.ts +0 -280
  61. package/harmony/gesture_handler/src/main/ets/GestureHandlerPackage.ts +0 -22
  62. package/harmony/gesture_handler/src/main/ets/GestureHandlerRegistry.ts +0 -28
  63. package/harmony/gesture_handler/src/main/ets/InteractionManager.ts +0 -109
  64. package/harmony/gesture_handler/src/main/ets/LeastSquareSolver.ts +0 -182
  65. package/harmony/gesture_handler/src/main/ets/NativeViewGestureHandler.ts +0 -115
  66. package/harmony/gesture_handler/src/main/ets/OutgoingEvent.ts +0 -34
  67. package/harmony/gesture_handler/src/main/ets/PanGestureHandler.ts +0 -328
  68. package/harmony/gesture_handler/src/main/ets/PointerTracker.ts +0 -239
  69. package/harmony/gesture_handler/src/main/ets/RNGHError.ts +0 -5
  70. package/harmony/gesture_handler/src/main/ets/RNGHLogger.ts +0 -48
  71. package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandlerArkTS.ts +0 -60
  72. package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandlerCAPI.ts +0 -87
  73. package/harmony/gesture_handler/src/main/ets/RNGestureHandlerButton.ets +0 -38
  74. package/harmony/gesture_handler/src/main/ets/RNGestureHandlerModule.ts +0 -183
  75. package/harmony/gesture_handler/src/main/ets/RNGestureHandlerRootView.ets +0 -53
  76. package/harmony/gesture_handler/src/main/ets/RNOHScrollLocker.ts +0 -23
  77. package/harmony/gesture_handler/src/main/ets/State.ts +0 -47
  78. package/harmony/gesture_handler/src/main/ets/TapGestureHandler.ts +0 -206
  79. package/harmony/gesture_handler/src/main/ets/Vector2D.ts +0 -36
  80. package/harmony/gesture_handler/src/main/ets/VelocityTracker.ts +0 -98
  81. package/harmony/gesture_handler/src/main/ets/View.ts +0 -71
  82. package/harmony/gesture_handler/src/main/ets/ViewRegistry.ts +0 -43
  83. package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerButton.ts +0 -140
  84. package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerModule.ts +0 -25
  85. package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerRootView.ts +0 -101
  86. package/harmony/gesture_handler/src/main/ets/namespace/ts.ts +0 -3
  87. package/harmony/gesture_handler/src/main/ets/pages/Index.ets +0 -17
  88. package/harmony/gesture_handler/src/main/ets/types.ts +0 -25
  89. package/harmony/gesture_handler/src/main/ets/webviewability/WebviewAbility.ts +0 -41
  90. package/harmony/gesture_handler/src/main/module.json5 +0 -7
  91. package/harmony/gesture_handler/src/main/resources/base/element/color.json +0 -8
  92. package/harmony/gesture_handler/src/main/resources/base/element/string.json +0 -16
  93. package/harmony/gesture_handler/src/main/resources/base/media/icon.png +0 -0
  94. package/harmony/gesture_handler/src/main/resources/base/profile/main_pages.json +0 -5
  95. package/harmony/gesture_handler/src/main/resources/en_US/element/string.json +0 -16
  96. package/harmony/gesture_handler/src/main/resources/zh_CN/element/string.json +0 -16
  97. package/harmony/gesture_handler/ts.ts +0 -2
@@ -1,140 +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
-
140
- }
@@ -1,25 +0,0 @@
1
- // This file was generated.
2
- import { Tag } from "../../ts"
3
-
4
- export namespace RNGestureHandlerModule {
5
- export const NAME = 'RNGestureHandlerModule' as const
6
-
7
- export interface Spec {
8
- handleSetJSResponder(tag: number, blockNativeResponder: boolean): void;
9
-
10
- handleClearJSResponder(): void;
11
-
12
- createGestureHandler(handlerName: string, handlerTag: number, config: Object): void;
13
-
14
- attachGestureHandler(handlerTag: number, newView: number, actionType: number): void;
15
-
16
- updateGestureHandler(handlerTag: number, newConfig: Object): void;
17
-
18
- dropGestureHandler(handlerTag: number): void;
19
-
20
- install(): boolean;
21
-
22
- flushOperations(): void;
23
-
24
- }
25
- }
@@ -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
- }
@@ -1,3 +0,0 @@
1
- export * from "./RNGestureHandlerButton"
2
- export * from "./RNGestureHandlerRootView"
3
- export * from "./RNGestureHandlerModule"
@@ -1,17 +0,0 @@
1
- @Entry
2
- @Component
3
- struct Index {
4
- @State message: string = 'Hello World'
5
-
6
- build() {
7
- Row() {
8
- Column() {
9
- Text(this.message)
10
- .fontSize(50)
11
- .fontWeight(FontWeight.Bold)
12
- }
13
- .width('100%')
14
- }
15
- .height('100%')
16
- }
17
- }
@@ -1,25 +0,0 @@
1
- export enum TouchType {
2
- Down,
3
- Up,
4
- Move,
5
- Cancel
6
- }
7
-
8
- interface BaseEvent {
9
- timestamp: number;
10
- }
11
-
12
- export interface TouchObject {
13
- type: TouchType;
14
- id: number;
15
- windowX: number;
16
- windowY: number;
17
- x: number;
18
- y: number;
19
- }
20
-
21
- export interface TouchEvent extends BaseEvent {
22
- type: TouchType;
23
- touches: TouchObject[];
24
- changedTouches: TouchObject[];
25
- }
@@ -1,41 +0,0 @@
1
- import UIAbility from '@ohos.app.ability.UIAbility';
2
- import hilog from '@ohos.hilog';
3
- import window from '@ohos.window';
4
-
5
- export default class WebviewAbility extends UIAbility {
6
- onCreate(want, launchParam) {
7
- hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
8
- }
9
-
10
- onDestroy() {
11
- hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
12
- }
13
-
14
- onWindowStageCreate(windowStage: window.WindowStage) {
15
- // Main window is created, set main page for this ability
16
- hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
17
-
18
- windowStage.loadContent('pages/Index', (err, data) => {
19
- if (err.code) {
20
- hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
21
- return;
22
- }
23
- hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
24
- });
25
- }
26
-
27
- onWindowStageDestroy() {
28
- // Main window is destroyed, release UI related resources
29
- hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
30
- }
31
-
32
- onForeground() {
33
- // Ability has brought to foreground
34
- hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
35
- }
36
-
37
- onBackground() {
38
- // Ability has back to background
39
- hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
40
- }
41
- }
@@ -1,7 +0,0 @@
1
- {
2
- module: {
3
- name: 'gesture_handler',
4
- type: 'har',
5
- deviceTypes: ['default'],
6
- },
7
- }
@@ -1,8 +0,0 @@
1
- {
2
- "color": [
3
- {
4
- "name": "start_window_background",
5
- "value": "#FFFFFF"
6
- }
7
- ]
8
- }
@@ -1,16 +0,0 @@
1
- {
2
- "string": [
3
- {
4
- "name": "module_desc",
5
- "value": "module description"
6
- },
7
- {
8
- "name": "WebviewAbility_desc",
9
- "value": "description"
10
- },
11
- {
12
- "name": "WebviewAbility_label",
13
- "value": "label"
14
- }
15
- ]
16
- }
@@ -1,5 +0,0 @@
1
- {
2
- "src": [
3
- "pages/Index"
4
- ]
5
- }
@@ -1,16 +0,0 @@
1
- {
2
- "string": [
3
- {
4
- "name": "module_desc",
5
- "value": "module description"
6
- },
7
- {
8
- "name": "WebviewAbility_desc",
9
- "value": "description"
10
- },
11
- {
12
- "name": "WebviewAbility_label",
13
- "value": "label"
14
- }
15
- ]
16
- }
@@ -1,16 +0,0 @@
1
- {
2
- "string": [
3
- {
4
- "name": "module_desc",
5
- "value": "模块描述"
6
- },
7
- {
8
- "name": "WebviewAbility_desc",
9
- "value": "description"
10
- },
11
- {
12
- "name": "WebviewAbility_label",
13
- "value": "label"
14
- }
15
- ]
16
- }
@@ -1,2 +0,0 @@
1
- export * from "./src/main/ets/GestureHandlerPackage"
2
- export * from "./src/main/ets/RNGestureHandlerModule"