@react-native-oh-tpl/react-native-gesture-handler 2.12.6-1 → 2.12.6-2
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/LICENSE +21 -0
- package/harmony/gesture_handler/OAT.xml +44 -0
- package/harmony/gesture_handler/README.OpenSource +11 -0
- package/harmony/gesture_handler/README.md +1 -0
- package/harmony/gesture_handler/build-profile.json5 +7 -7
- package/harmony/gesture_handler/hvigorfile.ts +2 -2
- package/harmony/gesture_handler/index.ets +2 -2
- package/harmony/gesture_handler/oh-package.json5 +13 -11
- package/harmony/gesture_handler/src/main/cpp/CMakeLists.txt +8 -8
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.cpp +33 -33
- package/harmony/gesture_handler/src/main/cpp/GestureHandlerPackage.h +14 -14
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerButtonComponentDescriptor.h +60 -60
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.cpp +17 -17
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerModule.h +11 -11
- package/harmony/gesture_handler/src/main/cpp/RNGestureHandlerRootViewComponentDescriptor.h +60 -60
- 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 +37 -37
- package/harmony/gesture_handler/src/main/ets/GestureHandler.ts +663 -663
- package/harmony/gesture_handler/src/main/ets/GestureHandlerArkUIAdapter.ets +201 -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 +28 -28
- package/harmony/gesture_handler/src/main/ets/RNGHRootTouchHandler.ets +57 -57
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerButton.ets +36 -36
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerModule.ts +125 -125
- package/harmony/gesture_handler/src/main/ets/RNGestureHandlerRootView.ets +56 -55
- package/harmony/gesture_handler/src/main/ets/RNOHScrollLocker.ts +10 -10
- 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/pages/Index.ets +16 -16
- package/harmony/gesture_handler/src/main/ets/webviewability/WebviewAbility.ts +41 -41
- package/harmony/gesture_handler/src/main/module.json5 +6 -6
- 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.har +0 -0
- package/lib/commonjs/components/touchables/GenericTouchable.js +9 -9
- package/lib/commonjs/components/touchables/TouchableOpacity.js +2 -2
- package/lib/commonjs/handlers/createNativeWrapper.js +6 -6
- package/lib/commonjs/handlers/gestures/GestureDetector.js +3 -3
- package/lib/module/components/touchables/GenericTouchable.js +9 -9
- package/lib/module/components/touchables/TouchableOpacity.js +2 -2
- package/lib/module/handlers/createNativeWrapper.js +6 -6
- package/lib/module/handlers/gestures/GestureDetector.js +3 -3
- package/package.json +70 -70
- package/src/RNGestureHandlerModule.ts +6 -6
- package/src/components/GestureButtons.tsx +334 -334
- package/src/components/GestureHandlerButton.tsx +5 -5
- package/src/components/GestureHandlerRootView.tsx +34 -34
- package/src/components/RNGestureHandlerButton.tsx +23 -23
- package/src/components/touchables/GenericTouchable.tsx +301 -301
- package/src/components/touchables/TouchableOpacity.tsx +76 -76
- package/src/components/touchables/TouchableWithoutFeedback.tsx +14 -14
- package/src/components/touchables/index.ts +7 -7
- package/src/handlers/NativeViewGestureHandler.ts +55 -55
- package/src/handlers/PanGestureHandler.ts +327 -327
- package/src/handlers/TapGestureHandler.ts +95 -95
- package/src/handlers/createHandler.tsx +535 -535
- package/src/handlers/createNativeWrapper.tsx +81 -81
- package/src/handlers/gestureHandlerCommon.ts +15 -15
- package/src/handlers/gestures/GestureDetector.tsx +823 -823
- package/src/index.ts +172 -172
- package/src/init.ts +18 -18
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { DescriptorRegistry, Descriptor, Tag } from "rnoh/ts"
|
|
2
|
-
import { Vector2D } from "./Vector2D"
|
|
3
|
-
|
|
4
|
-
export type BoundingBox = {
|
|
5
|
-
x: number,
|
|
6
|
-
y: number,
|
|
7
|
-
width: number,
|
|
8
|
-
height: number
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class View {
|
|
12
|
-
constructor(private descriptorRegistry: DescriptorRegistry, private viewTag: number) {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public getChildren() {
|
|
16
|
-
return this.getDescriptor().childrenTags.map(childrenTag => {
|
|
17
|
-
return new View(this.descriptorRegistry, childrenTag)
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public getTag(): Tag {
|
|
22
|
-
return this.viewTag
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public isPositionInBounds({x, y}: {
|
|
26
|
-
x: number,
|
|
27
|
-
y: number
|
|
28
|
-
}): boolean {
|
|
29
|
-
const rect = this.getBoundingRect()
|
|
30
|
-
return x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public getBoundingRect(): BoundingBox {
|
|
34
|
-
const d = this.getDescriptor()
|
|
35
|
-
if (!d) {
|
|
36
|
-
return { x: 0, y: 0, width: 0, height: 0 }
|
|
37
|
-
}
|
|
38
|
-
const offsetToAbsolutePosition = this.getOffsetToAbsolutePosition()
|
|
39
|
-
return {
|
|
40
|
-
x: d.layoutMetrics.frame.origin.x - offsetToAbsolutePosition.x,
|
|
41
|
-
y: d.layoutMetrics.frame.origin.y - offsetToAbsolutePosition.y,
|
|
42
|
-
width: d.layoutMetrics.frame.size.width,
|
|
43
|
-
height: d.layoutMetrics.frame.size.height
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private getDescriptor() {
|
|
48
|
-
return this.descriptorRegistry.getDescriptor(this.viewTag)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
private getOffsetToAbsolutePosition(): Vector2D {
|
|
53
|
-
const currentOffset = new Vector2D()
|
|
54
|
-
let parentTag = this.getDescriptor()?.parentTag
|
|
55
|
-
while (parentTag !== undefined) {
|
|
56
|
-
const d = this.descriptorRegistry.getDescriptor(parentTag)
|
|
57
|
-
currentOffset.add(this.extractScrollOffsetFromDescriptor(d))
|
|
58
|
-
currentOffset.subtract(new Vector2D(d.layoutMetrics.frame.origin))
|
|
59
|
-
parentTag = d.parentTag
|
|
60
|
-
}
|
|
61
|
-
return currentOffset
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private extractScrollOffsetFromDescriptor(descriptor: Descriptor<any>) {
|
|
65
|
-
if (descriptor.type !== "ScrollView") {
|
|
66
|
-
return new Vector2D();
|
|
67
|
-
}
|
|
68
|
-
const scrollViewState: any = descriptor.state;
|
|
69
|
-
return new Vector2D({ x: scrollViewState.contentOffsetX, y: scrollViewState.contentOffsetY })
|
|
70
|
-
}
|
|
1
|
+
import { DescriptorRegistry, Descriptor, Tag } from "rnoh/ts"
|
|
2
|
+
import { Vector2D } from "./Vector2D"
|
|
3
|
+
|
|
4
|
+
export type BoundingBox = {
|
|
5
|
+
x: number,
|
|
6
|
+
y: number,
|
|
7
|
+
width: number,
|
|
8
|
+
height: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class View {
|
|
12
|
+
constructor(private descriptorRegistry: DescriptorRegistry, private viewTag: number) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public getChildren() {
|
|
16
|
+
return this.getDescriptor().childrenTags.map(childrenTag => {
|
|
17
|
+
return new View(this.descriptorRegistry, childrenTag)
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public getTag(): Tag {
|
|
22
|
+
return this.viewTag
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public isPositionInBounds({x, y}: {
|
|
26
|
+
x: number,
|
|
27
|
+
y: number
|
|
28
|
+
}): boolean {
|
|
29
|
+
const rect = this.getBoundingRect()
|
|
30
|
+
return x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public getBoundingRect(): BoundingBox {
|
|
34
|
+
const d = this.getDescriptor()
|
|
35
|
+
if (!d) {
|
|
36
|
+
return { x: 0, y: 0, width: 0, height: 0 }
|
|
37
|
+
}
|
|
38
|
+
const offsetToAbsolutePosition = this.getOffsetToAbsolutePosition()
|
|
39
|
+
return {
|
|
40
|
+
x: d.layoutMetrics.frame.origin.x - offsetToAbsolutePosition.x,
|
|
41
|
+
y: d.layoutMetrics.frame.origin.y - offsetToAbsolutePosition.y,
|
|
42
|
+
width: d.layoutMetrics.frame.size.width,
|
|
43
|
+
height: d.layoutMetrics.frame.size.height
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private getDescriptor() {
|
|
48
|
+
return this.descriptorRegistry.getDescriptor(this.viewTag)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
private getOffsetToAbsolutePosition(): Vector2D {
|
|
53
|
+
const currentOffset = new Vector2D()
|
|
54
|
+
let parentTag = this.getDescriptor()?.parentTag
|
|
55
|
+
while (parentTag !== undefined) {
|
|
56
|
+
const d = this.descriptorRegistry.getDescriptor(parentTag)
|
|
57
|
+
currentOffset.add(this.extractScrollOffsetFromDescriptor(d))
|
|
58
|
+
currentOffset.subtract(new Vector2D(d.layoutMetrics.frame.origin))
|
|
59
|
+
parentTag = d.parentTag
|
|
60
|
+
}
|
|
61
|
+
return currentOffset
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private extractScrollOffsetFromDescriptor(descriptor: Descriptor<any>) {
|
|
65
|
+
if (descriptor.type !== "ScrollView") {
|
|
66
|
+
return new Vector2D();
|
|
67
|
+
}
|
|
68
|
+
const scrollViewState: any = descriptor.state;
|
|
69
|
+
return new Vector2D({ x: scrollViewState.contentOffsetX, y: scrollViewState.contentOffsetY })
|
|
70
|
+
}
|
|
71
71
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { DescriptorRegistry, ComponentManagerRegistry, Tag } from "rnoh/ts"
|
|
2
|
-
import { View } from "./View"
|
|
3
|
-
|
|
4
|
-
export class ViewRegistry {
|
|
5
|
-
constructor(private descriptorRegistry: DescriptorRegistry, private componentManagerRegistry: ComponentManagerRegistry) {
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
public getViewByTag(viewTag: Tag) {
|
|
9
|
-
return this.createView(viewTag)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
private createView(tag: Tag): View {
|
|
13
|
-
return new View(this.descriptorRegistry, tag)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public getTouchableViewsAt(pos: {
|
|
17
|
-
x: number,
|
|
18
|
-
y: number
|
|
19
|
-
}, rootTag: Tag): View[] {
|
|
20
|
-
const rootView = this.createView(rootTag)
|
|
21
|
-
const results: View[] = []
|
|
22
|
-
for (const view of this.getTouchableViewsAtPosInView(pos, rootView)) {
|
|
23
|
-
results.push(view)
|
|
24
|
-
}
|
|
25
|
-
return results
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
private getTouchableViewsAtPosInView(pos: {
|
|
29
|
-
x: number,
|
|
30
|
-
y: number
|
|
31
|
-
}, view: View) {
|
|
32
|
-
if (!view.isPositionInBounds(pos))
|
|
33
|
-
return [];
|
|
34
|
-
const results: View[] = []
|
|
35
|
-
results.push(view)
|
|
36
|
-
for (const child of view.getChildren()) {
|
|
37
|
-
for (const result of this.getTouchableViewsAtPosInView(pos, child)) {
|
|
38
|
-
results.push(result)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return results
|
|
42
|
-
}
|
|
1
|
+
import { DescriptorRegistry, ComponentManagerRegistry, Tag } from "rnoh/ts"
|
|
2
|
+
import { View } from "./View"
|
|
3
|
+
|
|
4
|
+
export class ViewRegistry {
|
|
5
|
+
constructor(private descriptorRegistry: DescriptorRegistry, private componentManagerRegistry: ComponentManagerRegistry) {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
public getViewByTag(viewTag: Tag) {
|
|
9
|
+
return this.createView(viewTag)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
private createView(tag: Tag): View {
|
|
13
|
+
return new View(this.descriptorRegistry, tag)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public getTouchableViewsAt(pos: {
|
|
17
|
+
x: number,
|
|
18
|
+
y: number
|
|
19
|
+
}, rootTag: Tag): View[] {
|
|
20
|
+
const rootView = this.createView(rootTag)
|
|
21
|
+
const results: View[] = []
|
|
22
|
+
for (const view of this.getTouchableViewsAtPosInView(pos, rootView)) {
|
|
23
|
+
results.push(view)
|
|
24
|
+
}
|
|
25
|
+
return results
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private getTouchableViewsAtPosInView(pos: {
|
|
29
|
+
x: number,
|
|
30
|
+
y: number
|
|
31
|
+
}, view: View) {
|
|
32
|
+
if (!view.isPositionInBounds(pos))
|
|
33
|
+
return [];
|
|
34
|
+
const results: View[] = []
|
|
35
|
+
results.push(view)
|
|
36
|
+
for (const child of view.getChildren()) {
|
|
37
|
+
for (const result of this.getTouchableViewsAtPosInView(pos, child)) {
|
|
38
|
+
results.push(result)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return results
|
|
42
|
+
}
|
|
43
43
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"module": {
|
|
3
|
+
"name": "gesture_handler",
|
|
4
|
+
"type": "har",
|
|
5
|
+
"deviceTypes": ['default'],
|
|
6
|
+
}
|
|
7
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
|
}
|
|
Binary file
|
|
@@ -12,12 +12,12 @@ var _GestureButtons = require("../GestureButtons");
|
|
|
12
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
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
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
/**
|
|
16
|
-
* Each touchable is a states' machine which preforms transitions.
|
|
17
|
-
* On very beginning (and on the very end or recognition) touchable is
|
|
18
|
-
* UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger
|
|
19
|
-
* travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition
|
|
20
|
-
* finishes in UNDETERMINED state.
|
|
15
|
+
/**
|
|
16
|
+
* Each touchable is a states' machine which preforms transitions.
|
|
17
|
+
* On very beginning (and on the very end or recognition) touchable is
|
|
18
|
+
* UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger
|
|
19
|
+
* travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition
|
|
20
|
+
* finishes in UNDETERMINED state.
|
|
21
21
|
*/
|
|
22
22
|
const TOUCHABLE_STATE = exports.TOUCHABLE_STATE = {
|
|
23
23
|
UNDETERMINED: 0,
|
|
@@ -28,9 +28,9 @@ const TOUCHABLE_STATE = exports.TOUCHABLE_STATE = {
|
|
|
28
28
|
// TODO: maybe can be better
|
|
29
29
|
// TODO: all clearTimeout have ! added, maybe they shouldn't ?
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* GenericTouchable is not intented to be used as it is.
|
|
33
|
-
* Should be treated as a source for the rest of touchables
|
|
31
|
+
/**
|
|
32
|
+
* GenericTouchable is not intented to be used as it is.
|
|
33
|
+
* Should be treated as a source for the rest of touchables
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
class GenericTouchable extends _react.Component {
|
|
@@ -11,8 +11,8 @@ var React = _react;
|
|
|
11
11
|
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); }
|
|
12
12
|
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; }
|
|
13
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
/**
|
|
15
|
-
* TouchableOpacity bases on timing animation which has been used in RN's core
|
|
14
|
+
/**
|
|
15
|
+
* TouchableOpacity bases on timing animation which has been used in RN's core
|
|
16
16
|
*/
|
|
17
17
|
class TouchableOpacity extends _react.Component {
|
|
18
18
|
static defaultProps = {
|
|
@@ -10,12 +10,12 @@ var _NativeViewGestureHandler = require("./NativeViewGestureHandler");
|
|
|
10
10
|
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); }
|
|
11
11
|
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; }
|
|
12
12
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
-
/*
|
|
14
|
-
* This array should consist of:
|
|
15
|
-
* - All keys in propTypes from NativeGestureHandler
|
|
16
|
-
* (and all keys in GestureHandlerPropTypes)
|
|
17
|
-
* - 'onGestureHandlerEvent'
|
|
18
|
-
* - 'onGestureHandlerStateChange'
|
|
13
|
+
/*
|
|
14
|
+
* This array should consist of:
|
|
15
|
+
* - All keys in propTypes from NativeGestureHandler
|
|
16
|
+
* (and all keys in GestureHandlerPropTypes)
|
|
17
|
+
* - 'onGestureHandlerEvent'
|
|
18
|
+
* - 'onGestureHandlerStateChange'
|
|
19
19
|
*/
|
|
20
20
|
const NATIVE_WRAPPER_PROPS_FILTER = [..._NativeViewGestureHandler.nativeViewProps, 'onGestureHandlerEvent', 'onGestureHandlerStateChange'];
|
|
21
21
|
function createNativeWrapper(Component, config = {}) {
|
|
@@ -29,9 +29,9 @@ var _EnableNewWebImplementation = require("react-native-gesture-handler/src/Enab
|
|
|
29
29
|
var _NativeViewGestureHandler = require("react-native-gesture-handler/src/handlers/NativeViewGestureHandler");
|
|
30
30
|
var _GestureHandlerRootViewContext = _interopRequireDefault(require("react-native-gesture-handler/src/GestureHandlerRootViewContext"));
|
|
31
31
|
var _Reanimated$default;
|
|
32
|
-
/**
|
|
33
|
-
* Why is this file patched?
|
|
34
|
-
* - replacing import to RNGestureHandlerModule - original code uses (old) Native Modules but RNOH supports only Turbo Modules
|
|
32
|
+
/**
|
|
33
|
+
* Why is this file patched?
|
|
34
|
+
* - replacing import to RNGestureHandlerModule - original code uses (old) Native Modules but RNOH supports only Turbo Modules
|
|
35
35
|
*/
|
|
36
36
|
// RNGH: patch
|
|
37
37
|
// RNGH: patch
|
|
@@ -4,12 +4,12 @@ import { Component } from 'react';
|
|
|
4
4
|
import { Animated, Platform } from 'react-native';
|
|
5
5
|
import { State } from 'react-native-gesture-handler/src/State';
|
|
6
6
|
import { BaseButton } from '../GestureButtons';
|
|
7
|
-
/**
|
|
8
|
-
* Each touchable is a states' machine which preforms transitions.
|
|
9
|
-
* On very beginning (and on the very end or recognition) touchable is
|
|
10
|
-
* UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger
|
|
11
|
-
* travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition
|
|
12
|
-
* finishes in UNDETERMINED state.
|
|
7
|
+
/**
|
|
8
|
+
* Each touchable is a states' machine which preforms transitions.
|
|
9
|
+
* On very beginning (and on the very end or recognition) touchable is
|
|
10
|
+
* UNDETERMINED. Then it moves to BEGAN. If touchable recognizes that finger
|
|
11
|
+
* travel outside it transits to special MOVED_OUTSIDE state. Gesture recognition
|
|
12
|
+
* finishes in UNDETERMINED state.
|
|
13
13
|
*/
|
|
14
14
|
export const TOUCHABLE_STATE = {
|
|
15
15
|
UNDETERMINED: 0,
|
|
@@ -20,9 +20,9 @@ export const TOUCHABLE_STATE = {
|
|
|
20
20
|
// TODO: maybe can be better
|
|
21
21
|
// TODO: all clearTimeout have ! added, maybe they shouldn't ?
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* GenericTouchable is not intented to be used as it is.
|
|
25
|
-
* Should be treated as a source for the rest of touchables
|
|
23
|
+
/**
|
|
24
|
+
* GenericTouchable is not intented to be used as it is.
|
|
25
|
+
* Should be treated as a source for the rest of touchables
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
export default class GenericTouchable extends Component {
|
|
@@ -3,8 +3,8 @@ import { Animated, Easing, StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import GenericTouchable, { TOUCHABLE_STATE } from './GenericTouchable';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { Component } from 'react';
|
|
6
|
-
/**
|
|
7
|
-
* TouchableOpacity bases on timing animation which has been used in RN's core
|
|
6
|
+
/**
|
|
7
|
+
* TouchableOpacity bases on timing animation which has been used in RN's core
|
|
8
8
|
*/
|
|
9
9
|
export default class TouchableOpacity extends Component {
|
|
10
10
|
static defaultProps = {
|
|
@@ -3,12 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import { useImperativeHandle, useRef } from 'react';
|
|
4
4
|
import { NativeViewGestureHandler, nativeViewProps } from './NativeViewGestureHandler';
|
|
5
5
|
|
|
6
|
-
/*
|
|
7
|
-
* This array should consist of:
|
|
8
|
-
* - All keys in propTypes from NativeGestureHandler
|
|
9
|
-
* (and all keys in GestureHandlerPropTypes)
|
|
10
|
-
* - 'onGestureHandlerEvent'
|
|
11
|
-
* - 'onGestureHandlerStateChange'
|
|
6
|
+
/*
|
|
7
|
+
* This array should consist of:
|
|
8
|
+
* - All keys in propTypes from NativeGestureHandler
|
|
9
|
+
* (and all keys in GestureHandlerPropTypes)
|
|
10
|
+
* - 'onGestureHandlerEvent'
|
|
11
|
+
* - 'onGestureHandlerStateChange'
|
|
12
12
|
*/
|
|
13
13
|
const NATIVE_WRAPPER_PROPS_FILTER = [...nativeViewProps, 'onGestureHandlerEvent', 'onGestureHandlerStateChange'];
|
|
14
14
|
export default function createNativeWrapper(Component, config = {}) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _Reanimated$default;
|
|
2
|
-
/**
|
|
3
|
-
* Why is this file patched?
|
|
4
|
-
* - replacing import to RNGestureHandlerModule - original code uses (old) Native Modules but RNOH supports only Turbo Modules
|
|
2
|
+
/**
|
|
3
|
+
* Why is this file patched?
|
|
4
|
+
* - replacing import to RNGestureHandlerModule - original code uses (old) Native Modules but RNOH supports only Turbo Modules
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|