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

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.
Files changed (211) hide show
  1. package/harmony/gesture_handler/BuildProfile.ets +5 -0
  2. package/harmony/gesture_handler/build-profile.json5 +18 -7
  3. package/harmony/gesture_handler/hvigorfile.ts +2 -2
  4. package/harmony/gesture_handler/index.ets +3 -3
  5. package/harmony/gesture_handler/oh-package-lock.json5 +17 -0
  6. package/harmony/gesture_handler/oh-package.json5 +12 -11
  7. package/harmony/gesture_handler/src/main/cpp/CMakeLists.txt +8 -8
  8. package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.cpp +103 -34
  9. package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +21 -15
  10. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +36 -60
  11. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentInstance.h +27 -0
  12. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonJSIBinder.h +32 -0
  13. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +22 -17
  14. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +15 -12
  15. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerPackage.h +72 -0
  16. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +36 -60
  17. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentInstance.h +78 -0
  18. package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewJSIBinder.h +25 -0
  19. package/harmony/gesture_handler/src/main/ets/CircularBuffer.ts +42 -42
  20. package/harmony/gesture_handler/src/main/ets/Event.ts +67 -67
  21. package/harmony/gesture_handler/src/main/ets/EventDispatcher.ts +52 -37
  22. package/harmony/gesture_handler/src/main/ets/GestureHandler.ts +663 -663
  23. package/harmony/gesture_handler/src/main/ets/{GestureHandlerArkUIAdapter.ets → GestureHandlerArkUIAdapter.ts} +202 -201
  24. package/harmony/gesture_handler/src/main/ets/GestureHandlerFactory.ts +44 -44
  25. package/harmony/gesture_handler/src/main/ets/GestureHandlerOrchestrator.ts +280 -280
  26. package/harmony/gesture_handler/src/main/ets/GestureHandlerPackage.ts +22 -22
  27. package/harmony/gesture_handler/src/main/ets/GestureHandlerRegistry.ts +27 -27
  28. package/harmony/gesture_handler/src/main/ets/InteractionManager.ts +108 -108
  29. package/harmony/gesture_handler/src/main/ets/LeastSquareSolver.ts +182 -182
  30. package/harmony/gesture_handler/src/main/ets/NativeViewGestureHandler.ts +114 -114
  31. package/harmony/gesture_handler/src/main/ets/OutgoingEvent.ts +33 -33
  32. package/harmony/gesture_handler/src/main/ets/PanGestureHandler.ts +327 -327
  33. package/harmony/gesture_handler/src/main/ets/PointerTracker.ts +239 -239
  34. package/harmony/gesture_handler/src/main/ets/RNGHError.ts +4 -4
  35. package/harmony/gesture_handler/src/main/ets/RNGHLogger.ts +47 -28
  36. package/harmony/gesture_handler/src/main/ets/{RNGHRootTouchHandler.ets → RNGHRootTouchHandlerArkTS.ts} +59 -57
  37. package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandlerCAPI.ts +87 -0
  38. package/harmony/gesture_handler/src/main/ets/RNGestureHandlerButton.ets +37 -36
  39. package/harmony/gesture_handler/src/main/ets/RNGestureHandlerModule.ts +183 -125
  40. package/harmony/gesture_handler/src/main/ets/RNGestureHandlerRootView.ets +52 -55
  41. package/harmony/gesture_handler/src/main/ets/RNOHScrollLocker.ts +23 -11
  42. package/harmony/gesture_handler/src/main/ets/State.ts +46 -46
  43. package/harmony/gesture_handler/src/main/ets/TapGestureHandler.ts +205 -205
  44. package/harmony/gesture_handler/src/main/ets/Vector2D.ts +36 -36
  45. package/harmony/gesture_handler/src/main/ets/VelocityTracker.ts +98 -98
  46. package/harmony/gesture_handler/src/main/ets/View.ts +70 -70
  47. package/harmony/gesture_handler/src/main/ets/ViewRegistry.ts +42 -42
  48. package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerButton.ts +140 -0
  49. package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerModule.ts +25 -0
  50. package/harmony/gesture_handler/src/main/ets/namespace/RNGestureHandlerRootView.ts +101 -0
  51. package/harmony/gesture_handler/src/main/ets/namespace/ts.ts +3 -0
  52. package/harmony/gesture_handler/src/main/ets/pages/Index.ets +16 -16
  53. package/harmony/gesture_handler/src/main/ets/types.ts +25 -0
  54. package/harmony/gesture_handler/src/main/ets/webviewability/WebviewAbility.ts +41 -41
  55. package/harmony/gesture_handler/src/main/module.json5 +7 -7
  56. package/harmony/gesture_handler/src/main/resources/base/element/color.json +7 -7
  57. package/harmony/gesture_handler/src/main/resources/base/element/string.json +15 -15
  58. package/harmony/gesture_handler/src/main/resources/base/profile/main_pages.json +5 -5
  59. package/harmony/gesture_handler/src/main/resources/en_US/element/string.json +15 -15
  60. package/harmony/gesture_handler/src/main/resources/zh_CN/element/string.json +15 -15
  61. package/harmony/gesture_handler/ts.ts +2 -1
  62. package/harmony/gesture_handler.har +0 -0
  63. package/lib/commonjs/RNGestureHandlerModule.js +6 -3
  64. package/lib/commonjs/RNGestureHandlerModule.js.map +1 -1
  65. package/lib/commonjs/components/GestureHandlerRootView.js +5 -13
  66. package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -1
  67. package/lib/commonjs/handlers/createHandler.js +31 -28
  68. package/lib/commonjs/handlers/createHandler.js.map +1 -1
  69. package/lib/commonjs/index.js +42 -19
  70. package/lib/commonjs/index.js.map +1 -1
  71. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js +10 -0
  72. package/lib/commonjs/specs/NativeRNGestureHandlerModule.js.map +1 -0
  73. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js +11 -0
  74. package/lib/commonjs/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
  75. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js +11 -0
  76. package/lib/commonjs/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
  77. package/lib/module/RNGestureHandlerModule.js +3 -2
  78. package/lib/module/RNGestureHandlerModule.js.map +1 -1
  79. package/lib/module/components/GestureHandlerRootView.js +3 -11
  80. package/lib/module/components/GestureHandlerRootView.js.map +1 -1
  81. package/lib/module/handlers/createHandler.js +20 -19
  82. package/lib/module/handlers/createHandler.js.map +1 -1
  83. package/lib/module/index.js +6 -14
  84. package/lib/module/index.js.map +1 -1
  85. package/lib/module/specs/NativeRNGestureHandlerModule.js +3 -0
  86. package/lib/module/specs/NativeRNGestureHandlerModule.js.map +1 -0
  87. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js +3 -0
  88. package/lib/module/specs/RNGestureHandlerButtonNativeComponent.js.map +1 -0
  89. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js +3 -0
  90. package/lib/module/specs/RNGestureHandlerRootViewNativeComponent.js.map +1 -0
  91. package/lib/typescript/RNGestureHandlerModule.d.ts +2 -6
  92. package/lib/typescript/RNGestureHandlerModule.d.ts.map +1 -1
  93. package/lib/typescript/components/GestureHandlerRootView.d.ts +6 -6
  94. package/lib/typescript/components/GestureHandlerRootView.d.ts.map +1 -1
  95. package/lib/typescript/handlers/createHandler.d.ts +11 -11
  96. package/lib/typescript/handlers/createHandler.d.ts.map +1 -1
  97. package/lib/typescript/index.d.ts +9 -8
  98. package/lib/typescript/index.d.ts.map +1 -1
  99. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts +15 -0
  100. package/lib/typescript/specs/NativeRNGestureHandlerModule.d.ts.map +1 -0
  101. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts +15 -0
  102. package/lib/typescript/specs/RNGestureHandlerButtonNativeComponent.d.ts.map +1 -0
  103. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts +7 -0
  104. package/lib/typescript/specs/RNGestureHandlerRootViewNativeComponent.d.ts.map +1 -0
  105. package/package.json +66 -70
  106. package/src/RNGestureHandlerModule.ts +5 -6
  107. package/src/components/GestureHandlerRootView.tsx +23 -34
  108. package/src/handlers/createHandler.tsx +534 -535
  109. package/src/index.ts +172 -172
  110. package/src/specs/NativeRNGestureHandlerModule.ts +26 -0
  111. package/src/specs/RNGestureHandlerButtonNativeComponent.ts +18 -0
  112. package/src/specs/RNGestureHandlerRootViewNativeComponent.ts +6 -0
  113. package/README.md +0 -1
  114. package/lib/commonjs/components/GestureButtons.js +0 -186
  115. package/lib/commonjs/components/GestureButtons.js.map +0 -1
  116. package/lib/commonjs/components/GestureHandlerButton.js +0 -9
  117. package/lib/commonjs/components/GestureHandlerButton.js.map +0 -1
  118. package/lib/commonjs/components/RNGestureHandlerButton.js +0 -23
  119. package/lib/commonjs/components/RNGestureHandlerButton.js.map +0 -1
  120. package/lib/commonjs/components/touchables/GenericTouchable.js +0 -247
  121. package/lib/commonjs/components/touchables/GenericTouchable.js.map +0 -1
  122. package/lib/commonjs/components/touchables/TouchableOpacity.js +0 -58
  123. package/lib/commonjs/components/touchables/TouchableOpacity.js.map +0 -1
  124. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js +0 -18
  125. package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +0 -1
  126. package/lib/commonjs/components/touchables/index.js +0 -21
  127. package/lib/commonjs/components/touchables/index.js.map +0 -1
  128. package/lib/commonjs/handlers/NativeViewGestureHandler.js +0 -19
  129. package/lib/commonjs/handlers/NativeViewGestureHandler.js.map +0 -1
  130. package/lib/commonjs/handlers/PanGestureHandler.js +0 -103
  131. package/lib/commonjs/handlers/PanGestureHandler.js.map +0 -1
  132. package/lib/commonjs/handlers/TapGestureHandler.js +0 -22
  133. package/lib/commonjs/handlers/TapGestureHandler.js.map +0 -1
  134. package/lib/commonjs/handlers/createNativeWrapper.js +0 -64
  135. package/lib/commonjs/handlers/createNativeWrapper.js.map +0 -1
  136. package/lib/commonjs/handlers/gestureHandlerCommon.js +0 -22
  137. package/lib/commonjs/handlers/gestureHandlerCommon.js.map +0 -1
  138. package/lib/commonjs/handlers/gestures/GestureDetector.js +0 -554
  139. package/lib/commonjs/handlers/gestures/GestureDetector.js.map +0 -1
  140. package/lib/commonjs/init.js +0 -24
  141. package/lib/commonjs/init.js.map +0 -1
  142. package/lib/module/components/GestureButtons.js +0 -168
  143. package/lib/module/components/GestureButtons.js.map +0 -1
  144. package/lib/module/components/GestureHandlerButton.js +0 -3
  145. package/lib/module/components/GestureHandlerButton.js.map +0 -1
  146. package/lib/module/components/RNGestureHandlerButton.js +0 -17
  147. package/lib/module/components/RNGestureHandlerButton.js.map +0 -1
  148. package/lib/module/components/touchables/GenericTouchable.js +0 -238
  149. package/lib/module/components/touchables/GenericTouchable.js.map +0 -1
  150. package/lib/module/components/touchables/TouchableOpacity.js +0 -49
  151. package/lib/module/components/touchables/TouchableOpacity.js.map +0 -1
  152. package/lib/module/components/touchables/TouchableWithoutFeedback.js +0 -9
  153. package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +0 -1
  154. package/lib/module/components/touchables/index.js +0 -8
  155. package/lib/module/components/touchables/index.js.map +0 -1
  156. package/lib/module/handlers/NativeViewGestureHandler.js +0 -12
  157. package/lib/module/handlers/NativeViewGestureHandler.js.map +0 -1
  158. package/lib/module/handlers/PanGestureHandler.js +0 -92
  159. package/lib/module/handlers/PanGestureHandler.js.map +0 -1
  160. package/lib/module/handlers/TapGestureHandler.js +0 -14
  161. package/lib/module/handlers/TapGestureHandler.js.map +0 -1
  162. package/lib/module/handlers/createNativeWrapper.js +0 -57
  163. package/lib/module/handlers/createNativeWrapper.js.map +0 -1
  164. package/lib/module/handlers/gestureHandlerCommon.js +0 -15
  165. package/lib/module/handlers/gestureHandlerCommon.js.map +0 -1
  166. package/lib/module/handlers/gestures/GestureDetector.js +0 -543
  167. package/lib/module/handlers/gestures/GestureDetector.js.map +0 -1
  168. package/lib/module/init.js +0 -17
  169. package/lib/module/init.js.map +0 -1
  170. package/lib/typescript/components/GestureButtons.d.ts +0 -122
  171. package/lib/typescript/components/GestureButtons.d.ts.map +0 -1
  172. package/lib/typescript/components/GestureHandlerButton.d.ts +0 -5
  173. package/lib/typescript/components/GestureHandlerButton.d.ts.map +0 -1
  174. package/lib/typescript/components/RNGestureHandlerButton.d.ts +0 -2
  175. package/lib/typescript/components/RNGestureHandlerButton.d.ts.map +0 -1
  176. package/lib/typescript/components/touchables/GenericTouchable.d.ts +0 -68
  177. package/lib/typescript/components/touchables/GenericTouchable.d.ts.map +0 -1
  178. package/lib/typescript/components/touchables/TouchableOpacity.d.ts +0 -26
  179. package/lib/typescript/components/touchables/TouchableOpacity.d.ts.map +0 -1
  180. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +0 -8
  181. package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts.map +0 -1
  182. package/lib/typescript/components/touchables/index.d.ts +0 -4
  183. package/lib/typescript/components/touchables/index.d.ts.map +0 -1
  184. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +0 -29
  185. package/lib/typescript/handlers/NativeViewGestureHandler.d.ts.map +0 -1
  186. package/lib/typescript/handlers/PanGestureHandler.d.ts +0 -140
  187. package/lib/typescript/handlers/PanGestureHandler.d.ts.map +0 -1
  188. package/lib/typescript/handlers/TapGestureHandler.d.ts +0 -58
  189. package/lib/typescript/handlers/TapGestureHandler.d.ts.map +0 -1
  190. package/lib/typescript/handlers/createNativeWrapper.d.ts +0 -4
  191. package/lib/typescript/handlers/createNativeWrapper.d.ts.map +0 -1
  192. package/lib/typescript/handlers/gestureHandlerCommon.d.ts +0 -2
  193. package/lib/typescript/handlers/gestureHandlerCommon.d.ts.map +0 -1
  194. package/lib/typescript/handlers/gestures/GestureDetector.d.ts +0 -24
  195. package/lib/typescript/handlers/gestures/GestureDetector.d.ts.map +0 -1
  196. package/lib/typescript/init.d.ts +0 -3
  197. package/lib/typescript/init.d.ts.map +0 -1
  198. package/src/components/GestureButtons.tsx +0 -334
  199. package/src/components/GestureHandlerButton.tsx +0 -5
  200. package/src/components/RNGestureHandlerButton.tsx +0 -23
  201. package/src/components/touchables/GenericTouchable.tsx +0 -301
  202. package/src/components/touchables/TouchableOpacity.tsx +0 -76
  203. package/src/components/touchables/TouchableWithoutFeedback.tsx +0 -14
  204. package/src/components/touchables/index.ts +0 -7
  205. package/src/handlers/NativeViewGestureHandler.ts +0 -55
  206. package/src/handlers/PanGestureHandler.ts +0 -327
  207. package/src/handlers/TapGestureHandler.ts +0 -95
  208. package/src/handlers/createNativeWrapper.tsx +0 -81
  209. package/src/handlers/gestureHandlerCommon.ts +0 -15
  210. package/src/handlers/gestures/GestureDetector.tsx +0 -823
  211. package/src/init.ts +0 -18
@@ -0,0 +1,101 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./RNGestureHandlerButton"
2
+ export * from "./RNGestureHandlerRootView"
3
+ export * from "./RNGestureHandlerModule"
@@ -1,17 +1,17 @@
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
- }
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
17
  }
@@ -0,0 +1,25 @@
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 +1,41 @@
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
+ 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 +1,7 @@
1
- {
2
- "module": {
3
- "name": "gesture_handler",
4
- "type": "har",
5
- "deviceTypes": ['default'],
6
- }
7
- }
1
+ {
2
+ module: {
3
+ name: 'gesture_handler',
4
+ type: 'har',
5
+ deviceTypes: ['default'],
6
+ },
7
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "color": [
3
- {
4
- "name": "start_window_background",
5
- "value": "#FFFFFF"
6
- }
7
- ]
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
8
  }
@@ -1,16 +1,16 @@
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
- ]
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
16
  }
@@ -1,5 +1,5 @@
1
- {
2
- "src": [
3
- "pages/Index"
4
- ]
5
- }
1
+ {
2
+ "src": [
3
+ "pages/Index"
4
+ ]
5
+ }
@@ -1,16 +1,16 @@
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
- ]
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
16
  }
@@ -1,16 +1,16 @@
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
- ]
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
16
  }
@@ -1 +1,2 @@
1
- export * from "./src/main/ets/GestureHandlerPackage"
1
+ export * from "./src/main/ets/GestureHandlerPackage"
2
+ export * from "./src/main/ets/RNGestureHandlerModule"
Binary file
@@ -3,7 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.RNGestureHandlerModule = void 0;
7
- var _reactNative = require("react-native");
8
- const RNGestureHandlerModule = exports.RNGestureHandlerModule = _reactNative.TurboModuleRegistry.get('RNGestureHandlerModule');
6
+ exports.default = void 0;
7
+ var _NativeRNGestureHandlerModule = _interopRequireDefault(require("../src/specs/NativeRNGestureHandlerModule"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const RNGestureHandlerModule = _NativeRNGestureHandlerModule.default;
10
+ var _default = RNGestureHandlerModule;
11
+ exports.default = _default;
9
12
  //# sourceMappingURL=RNGestureHandlerModule.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","RNGestureHandlerModule","exports","TurboModuleRegistry","get"],"sourceRoot":"..\\..\\src","sources":["RNGestureHandlerModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKO,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAGE,gCAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAE"}
1
+ {"version":3,"names":["_NativeRNGestureHandlerModule","_interopRequireDefault","require","obj","__esModule","default","RNGestureHandlerModule","NativeRNGestureHandlerModule","_default","exports"],"sourceRoot":"../../src","sources":["RNGestureHandlerModule.ts"],"mappings":";;;;;;AAAA,IAAAA,6BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAqF,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErF,MAAMG,sBAAsB,GAAGC,qCAA4B;AAAC,IAAAC,QAAA,GAE7CF,sBAAsB;AAAAG,OAAA,CAAAJ,OAAA,GAAAG,QAAA"}
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = GestureHandlerRootView;
7
- var _reactNativeHarmony = require("react-native-harmony");
8
7
  var React = _interopRequireWildcard(require("react"));
9
- var _init = require("../init");
8
+ var _init = require("react-native-gesture-handler/src/init");
10
9
  var _GestureHandlerRootViewContext = _interopRequireDefault(require("react-native-gesture-handler/src/GestureHandlerRootViewContext"));
10
+ var _RNGestureHandlerRootViewNativeComponent = _interopRequireDefault(require("../specs/RNGestureHandlerRootViewNativeComponent"));
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
- const GestureHandlerRootViewNativeComponent = (0, _reactNativeHarmony.registerViewConfig)('RNGestureHandlerRootView', () => ({
15
- uiViewClassName: 'RNGestureHandlerRootView',
16
- bubblingEventTypes: {},
17
- directEventTypes: {},
18
- validAttributes: {
19
- ..._reactNativeHarmony.ReactNativeViewAttributes.UIView
20
- }
21
- }));
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
22
14
  function GestureHandlerRootView(props) {
23
15
  // try initialize fabric on the first render, at this point we can
24
16
  // reliably check if fabric is enabled (the function contains a flag
@@ -26,6 +18,6 @@ function GestureHandlerRootView(props) {
26
18
  (0, _init.maybeInitializeFabric)();
27
19
  return /*#__PURE__*/React.createElement(_GestureHandlerRootViewContext.default.Provider, {
28
20
  value: true
29
- }, /*#__PURE__*/React.createElement(GestureHandlerRootViewNativeComponent, props));
21
+ }, /*#__PURE__*/React.createElement(_RNGestureHandlerRootViewNativeComponent.default, props));
30
22
  }
31
23
  //# sourceMappingURL=GestureHandlerRootView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeHarmony","require","React","_interopRequireWildcard","_init","_GestureHandlerRootViewContext","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","GestureHandlerRootViewNativeComponent","registerViewConfig","uiViewClassName","bubblingEventTypes","directEventTypes","validAttributes","ReactNativeViewAttributes","UIView","GestureHandlerRootView","props","maybeInitializeFabric","createElement","Provider","value"],"sourceRoot":"..\\..\\..\\src","sources":["components/GestureHandlerRootView.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AAGA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,8BAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA2G,SAAAK,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAY,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAX,CAAA,EAAAY,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAZ,CAAA,CAAAY,CAAA,YAAAN,CAAA,CAAAR,OAAA,GAAAE,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAc,GAAA,CAAAjB,CAAA,EAAAM,CAAA,GAAAA,CAAA;AAG3G,MAAMY,qCAAqC,GAAG,IAAAC,sCAAkB,EAAC,0BAA0B,EAAE,OAAO;EAClGC,eAAe,EAAE,0BAA0B;EAC3CC,kBAAkB,EAAE,CAAC,CAAC;EACtBC,gBAAgB,EAAE,CAAC,CAAC;EACpBC,eAAe,EAAE;IACf,GAAGC,6CAAyB,CAACC;EAC/B;AACF,CAAC,CAAC,CAAC;AAKY,SAASC,sBAAsBA,CAC5CC,KAAkC,EAClC;EACA;EACA;EACA;EACA,IAAAC,2BAAqB,EAAC,CAAC;EAEvB,oBACErC,KAAA,CAAAsC,aAAA,CAACnC,8BAAA,CAAAI,OAA6B,CAACgC,QAAQ;IAACC,KAAK;EAAA,gBAC3CxC,KAAA,CAAAsC,aAAA,CAACX,qCAAqC,EAAKS,KAAQ,CACb,CAAC;AAE7C"}
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_init","_GestureHandlerRootViewContext","_interopRequireDefault","_RNGestureHandlerRootViewNativeComponent","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","GestureHandlerRootView","props","maybeInitializeFabric","createElement","Provider","value"],"sourceRoot":"../../../src","sources":["components/GestureHandlerRootView.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,8BAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,wCAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAuG,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAAgB,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAf,GAAA,EAAAgB,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAhB,GAAA,CAAAgB,GAAA,SAAAL,MAAA,CAAAT,OAAA,GAAAF,GAAA,MAAAQ,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAArB,GAAA,EAAAW,MAAA,YAAAA,MAAA;AAIxF,SAASW,sBAAsBA,CAC5CC,KAAkC,EAClC;EACA;EACA;EACA;EACA,IAAAC,2BAAqB,EAAC,CAAC;EAEvB,oBACE/B,KAAA,CAAAgC,aAAA,CAAC5B,8BAAA,CAAAK,OAA6B,CAACwB,QAAQ;IAACC,KAAK;EAAA,gBAC3ClC,KAAA,CAAAgC,aAAA,CAAC1B,wCAAA,CAAAG,OAAuC,EAAKqB,KAAQ,CACf,CAAC;AAE7C"}