@momo-kits/webview 0.168.1-beta.9 → 0.168.1-rn.88.0
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import type { CodegenTypes } from 'react-native';
|
|
3
3
|
export interface Spec extends TurboModule {
|
|
4
4
|
isFileUploadSupported(): Promise<boolean>;
|
|
5
|
-
shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier: Double): void;
|
|
5
|
+
shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier: CodegenTypes.Double): void;
|
|
6
6
|
}
|
|
7
7
|
declare const _default: Spec;
|
|
8
8
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import type { CodegenTypes } from 'react-native';
|
|
3
3
|
export type WebViewNativeEvent = Readonly<{
|
|
4
4
|
url: string;
|
|
5
5
|
loading: boolean;
|
|
6
6
|
title: string;
|
|
7
7
|
canGoBack: boolean;
|
|
8
8
|
canGoForward: boolean;
|
|
9
|
-
lockIdentifier: Double;
|
|
9
|
+
lockIdentifier: CodegenTypes.Double;
|
|
10
10
|
}>;
|
|
11
11
|
export type WebViewCustomMenuSelectionEvent = Readonly<{
|
|
12
12
|
label: string;
|
|
@@ -19,7 +19,7 @@ export type WebViewMessageEvent = Readonly<{
|
|
|
19
19
|
title: string;
|
|
20
20
|
canGoBack: boolean;
|
|
21
21
|
canGoForward: boolean;
|
|
22
|
-
lockIdentifier: Double;
|
|
22
|
+
lockIdentifier: CodegenTypes.Double;
|
|
23
23
|
data: string;
|
|
24
24
|
}>;
|
|
25
25
|
export type WebViewOpenWindowEvent = Readonly<{
|
|
@@ -31,9 +31,9 @@ export type WebViewHttpErrorEvent = Readonly<{
|
|
|
31
31
|
title: string;
|
|
32
32
|
canGoBack: boolean;
|
|
33
33
|
canGoForward: boolean;
|
|
34
|
-
lockIdentifier: Double;
|
|
34
|
+
lockIdentifier: CodegenTypes.Double;
|
|
35
35
|
description: string;
|
|
36
|
-
statusCode: Int32;
|
|
36
|
+
statusCode: CodegenTypes.Int32;
|
|
37
37
|
}>;
|
|
38
38
|
export type WebViewErrorEvent = Readonly<{
|
|
39
39
|
url: string;
|
|
@@ -41,9 +41,9 @@ export type WebViewErrorEvent = Readonly<{
|
|
|
41
41
|
title: string;
|
|
42
42
|
canGoBack: boolean;
|
|
43
43
|
canGoForward: boolean;
|
|
44
|
-
lockIdentifier: Double;
|
|
44
|
+
lockIdentifier: CodegenTypes.Double;
|
|
45
45
|
domain?: string;
|
|
46
|
-
code: Int32;
|
|
46
|
+
code: CodegenTypes.Int32;
|
|
47
47
|
description: string;
|
|
48
48
|
}>;
|
|
49
49
|
export type WebViewNativeProgressEvent = Readonly<{
|
|
@@ -52,8 +52,8 @@ export type WebViewNativeProgressEvent = Readonly<{
|
|
|
52
52
|
title: string;
|
|
53
53
|
canGoBack: boolean;
|
|
54
54
|
canGoForward: boolean;
|
|
55
|
-
lockIdentifier: Double;
|
|
56
|
-
progress: Double;
|
|
55
|
+
lockIdentifier: CodegenTypes.Double;
|
|
56
|
+
progress: CodegenTypes.Double;
|
|
57
57
|
}>;
|
|
58
58
|
export type WebViewNavigationEvent = Readonly<{
|
|
59
59
|
url: string;
|
|
@@ -61,7 +61,7 @@ export type WebViewNavigationEvent = Readonly<{
|
|
|
61
61
|
title: string;
|
|
62
62
|
canGoBack: boolean;
|
|
63
63
|
canGoForward: boolean;
|
|
64
|
-
lockIdentifier: Double;
|
|
64
|
+
lockIdentifier: CodegenTypes.Double;
|
|
65
65
|
navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
|
|
66
66
|
mainDocumentURL?: string;
|
|
67
67
|
}>;
|
|
@@ -71,39 +71,39 @@ export type ShouldStartLoadRequestEvent = Readonly<{
|
|
|
71
71
|
title: string;
|
|
72
72
|
canGoBack: boolean;
|
|
73
73
|
canGoForward: boolean;
|
|
74
|
-
lockIdentifier: Double;
|
|
74
|
+
lockIdentifier: CodegenTypes.Double;
|
|
75
75
|
navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
|
|
76
76
|
mainDocumentURL?: string;
|
|
77
77
|
isTopFrame: boolean;
|
|
78
78
|
}>;
|
|
79
79
|
type ScrollEvent = Readonly<{
|
|
80
80
|
contentInset: {
|
|
81
|
-
bottom: Double;
|
|
82
|
-
left: Double;
|
|
83
|
-
right: Double;
|
|
84
|
-
top: Double;
|
|
81
|
+
bottom: CodegenTypes.Double;
|
|
82
|
+
left: CodegenTypes.Double;
|
|
83
|
+
right: CodegenTypes.Double;
|
|
84
|
+
top: CodegenTypes.Double;
|
|
85
85
|
};
|
|
86
86
|
contentOffset: {
|
|
87
|
-
y: Double;
|
|
88
|
-
x: Double;
|
|
87
|
+
y: CodegenTypes.Double;
|
|
88
|
+
x: CodegenTypes.Double;
|
|
89
89
|
};
|
|
90
90
|
contentSize: {
|
|
91
|
-
height: Double;
|
|
92
|
-
width: Double;
|
|
91
|
+
height: CodegenTypes.Double;
|
|
92
|
+
width: CodegenTypes.Double;
|
|
93
93
|
};
|
|
94
94
|
layoutMeasurement: {
|
|
95
|
-
height: Double;
|
|
96
|
-
width: Double;
|
|
95
|
+
height: CodegenTypes.Double;
|
|
96
|
+
width: CodegenTypes.Double;
|
|
97
97
|
};
|
|
98
98
|
targetContentOffset?: {
|
|
99
|
-
y: Double;
|
|
100
|
-
x: Double;
|
|
99
|
+
y: CodegenTypes.Double;
|
|
100
|
+
x: CodegenTypes.Double;
|
|
101
101
|
};
|
|
102
102
|
velocity?: {
|
|
103
|
-
y: Double;
|
|
104
|
-
x: Double;
|
|
103
|
+
y: CodegenTypes.Double;
|
|
104
|
+
x: CodegenTypes.Double;
|
|
105
105
|
};
|
|
106
|
-
zoomScale?: Double;
|
|
106
|
+
zoomScale?: CodegenTypes.Double;
|
|
107
107
|
responderIgnoreScroll?: boolean;
|
|
108
108
|
}>;
|
|
109
109
|
type WebViewRenderProcessGoneEvent = Readonly<{
|
|
@@ -116,70 +116,70 @@ export interface NativeProps extends ViewProps {
|
|
|
116
116
|
allowFileAccess?: boolean;
|
|
117
117
|
allowsProtectedMedia?: boolean;
|
|
118
118
|
allowsFullscreenVideo?: boolean;
|
|
119
|
-
androidLayerType?: WithDefault<'none' | 'software' | 'hardware', 'none'>;
|
|
120
|
-
cacheMode?: WithDefault<'LOAD_DEFAULT' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE' | 'LOAD_CACHE_ONLY', 'LOAD_DEFAULT'>;
|
|
119
|
+
androidLayerType?: CodegenTypes.WithDefault<'none' | 'software' | 'hardware', 'none'>;
|
|
120
|
+
cacheMode?: CodegenTypes.WithDefault<'LOAD_DEFAULT' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE' | 'LOAD_CACHE_ONLY', 'LOAD_DEFAULT'>;
|
|
121
121
|
domStorageEnabled?: boolean;
|
|
122
122
|
downloadingMessage?: string;
|
|
123
123
|
forceDarkOn?: boolean;
|
|
124
124
|
geolocationEnabled?: boolean;
|
|
125
125
|
lackPermissionToDownloadMessage?: string;
|
|
126
126
|
messagingModuleName: string;
|
|
127
|
-
minimumFontSize?: Int32;
|
|
128
|
-
mixedContentMode?: WithDefault<'never' | 'always' | 'compatibility', 'never'>;
|
|
127
|
+
minimumFontSize?: CodegenTypes.Int32;
|
|
128
|
+
mixedContentMode?: CodegenTypes.WithDefault<'never' | 'always' | 'compatibility', 'never'>;
|
|
129
129
|
nestedScrollEnabled?: boolean;
|
|
130
|
-
onContentSizeChange?: DirectEventHandler<WebViewNativeEvent>;
|
|
131
|
-
onRenderProcessGone?: DirectEventHandler<WebViewRenderProcessGoneEvent>;
|
|
130
|
+
onContentSizeChange?: CodegenTypes.DirectEventHandler<WebViewNativeEvent>;
|
|
131
|
+
onRenderProcessGone?: CodegenTypes.DirectEventHandler<WebViewRenderProcessGoneEvent>;
|
|
132
132
|
overScrollMode?: string;
|
|
133
133
|
saveFormDataDisabled?: boolean;
|
|
134
|
-
scalesPageToFit?: WithDefault<boolean, true>;
|
|
135
|
-
setBuiltInZoomControls?: WithDefault<boolean, true>;
|
|
134
|
+
scalesPageToFit?: CodegenTypes.WithDefault<boolean, true>;
|
|
135
|
+
setBuiltInZoomControls?: CodegenTypes.WithDefault<boolean, true>;
|
|
136
136
|
setDisplayZoomControls?: boolean;
|
|
137
|
-
setSupportMultipleWindows?: WithDefault<boolean, true>;
|
|
138
|
-
textZoom?: Int32;
|
|
139
|
-
thirdPartyCookiesEnabled?: WithDefault<boolean, true>;
|
|
137
|
+
setSupportMultipleWindows?: CodegenTypes.WithDefault<boolean, true>;
|
|
138
|
+
textZoom?: CodegenTypes.Int32;
|
|
139
|
+
thirdPartyCookiesEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
140
140
|
hasOnScroll?: boolean;
|
|
141
141
|
allowingReadAccessToURL?: string;
|
|
142
142
|
allowsBackForwardNavigationGestures?: boolean;
|
|
143
143
|
allowsInlineMediaPlayback?: boolean;
|
|
144
144
|
allowsPictureInPictureMediaPlayback?: boolean;
|
|
145
145
|
allowsAirPlayForMediaPlayback?: boolean;
|
|
146
|
-
allowsLinkPreview?: WithDefault<boolean, true>;
|
|
147
|
-
automaticallyAdjustContentInsets?: WithDefault<boolean, true>;
|
|
148
|
-
autoManageStatusBarEnabled?: WithDefault<boolean, true>;
|
|
149
|
-
bounces?: WithDefault<boolean, true>;
|
|
146
|
+
allowsLinkPreview?: CodegenTypes.WithDefault<boolean, true>;
|
|
147
|
+
automaticallyAdjustContentInsets?: CodegenTypes.WithDefault<boolean, true>;
|
|
148
|
+
autoManageStatusBarEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
149
|
+
bounces?: CodegenTypes.WithDefault<boolean, true>;
|
|
150
150
|
contentInset?: Readonly<{
|
|
151
|
-
top?: Double;
|
|
152
|
-
left?: Double;
|
|
153
|
-
bottom?: Double;
|
|
154
|
-
right?: Double;
|
|
151
|
+
top?: CodegenTypes.Double;
|
|
152
|
+
left?: CodegenTypes.Double;
|
|
153
|
+
bottom?: CodegenTypes.Double;
|
|
154
|
+
right?: CodegenTypes.Double;
|
|
155
155
|
}>;
|
|
156
|
-
contentInsetAdjustmentBehavior?: WithDefault<'never' | 'automatic' | 'scrollableAxes' | 'always', 'never'>;
|
|
157
|
-
contentMode?: WithDefault<'recommended' | 'mobile' | 'desktop', 'recommended'>;
|
|
158
|
-
dataDetectorTypes?: WithDefault<ReadonlyArray<'address' | 'link' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'phoneNumber' | 'all' | 'none'>, 'phoneNumber'>;
|
|
159
|
-
decelerationRate?: Double;
|
|
160
|
-
directionalLockEnabled?: WithDefault<boolean, true>;
|
|
156
|
+
contentInsetAdjustmentBehavior?: CodegenTypes.WithDefault<'never' | 'automatic' | 'scrollableAxes' | 'always', 'never'>;
|
|
157
|
+
contentMode?: CodegenTypes.WithDefault<'recommended' | 'mobile' | 'desktop', 'recommended'>;
|
|
158
|
+
dataDetectorTypes?: CodegenTypes.WithDefault<ReadonlyArray<'address' | 'link' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'phoneNumber' | 'all' | 'none'>, 'phoneNumber'>;
|
|
159
|
+
decelerationRate?: CodegenTypes.Double;
|
|
160
|
+
directionalLockEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
161
161
|
enableApplePay?: boolean;
|
|
162
162
|
hideKeyboardAccessoryView?: boolean;
|
|
163
|
-
keyboardDisplayRequiresUserAction?: WithDefault<boolean, true>;
|
|
163
|
+
keyboardDisplayRequiresUserAction?: CodegenTypes.WithDefault<boolean, true>;
|
|
164
164
|
limitsNavigationsToAppBoundDomains?: boolean;
|
|
165
|
-
mediaCapturePermissionGrantType?: WithDefault<'prompt' | 'grant' | 'deny' | 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny', 'prompt'>;
|
|
165
|
+
mediaCapturePermissionGrantType?: CodegenTypes.WithDefault<'prompt' | 'grant' | 'deny' | 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny', 'prompt'>;
|
|
166
166
|
pagingEnabled?: boolean;
|
|
167
167
|
pullToRefreshEnabled?: boolean;
|
|
168
168
|
refreshControlLightMode?: boolean;
|
|
169
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
169
|
+
scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
170
170
|
sharedCookiesEnabled?: boolean;
|
|
171
|
-
textInteractionEnabled?: WithDefault<boolean, true>;
|
|
172
|
-
useSharedProcessPool?: WithDefault<boolean, true>;
|
|
173
|
-
onContentProcessDidTerminate?: DirectEventHandler<WebViewNativeEvent>;
|
|
174
|
-
onCustomMenuSelection?: DirectEventHandler<WebViewCustomMenuSelectionEvent>;
|
|
175
|
-
onFileDownload?: DirectEventHandler<WebViewDownloadEvent>;
|
|
171
|
+
textInteractionEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
172
|
+
useSharedProcessPool?: CodegenTypes.WithDefault<boolean, true>;
|
|
173
|
+
onContentProcessDidTerminate?: CodegenTypes.DirectEventHandler<WebViewNativeEvent>;
|
|
174
|
+
onCustomMenuSelection?: CodegenTypes.DirectEventHandler<WebViewCustomMenuSelectionEvent>;
|
|
175
|
+
onFileDownload?: CodegenTypes.DirectEventHandler<WebViewDownloadEvent>;
|
|
176
176
|
menuItems?: ReadonlyArray<Readonly<{
|
|
177
177
|
label: string;
|
|
178
178
|
key: string;
|
|
179
179
|
}>>;
|
|
180
180
|
suppressMenuItems?: Readonly<string>[];
|
|
181
181
|
hasOnFileDownload?: boolean;
|
|
182
|
-
fraudulentWebsiteWarningEnabled?: WithDefault<boolean, true>;
|
|
182
|
+
fraudulentWebsiteWarningEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
183
183
|
allowFileAccessFromFileURLs?: boolean;
|
|
184
184
|
allowUniversalAccessFromFileURLs?: boolean;
|
|
185
185
|
applicationNameForUserAgent?: string;
|
|
@@ -187,30 +187,30 @@ export interface NativeProps extends ViewProps {
|
|
|
187
187
|
username: string;
|
|
188
188
|
password: string;
|
|
189
189
|
}>;
|
|
190
|
-
cacheEnabled?: WithDefault<boolean, true>;
|
|
190
|
+
cacheEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
191
191
|
incognito?: boolean;
|
|
192
192
|
injectedJavaScript?: string;
|
|
193
193
|
injectedJavaScriptBeforeContentLoaded?: string;
|
|
194
|
-
injectedJavaScriptForMainFrameOnly?: WithDefault<boolean, true>;
|
|
195
|
-
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: WithDefault<boolean, true>;
|
|
194
|
+
injectedJavaScriptForMainFrameOnly?: CodegenTypes.WithDefault<boolean, true>;
|
|
195
|
+
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: CodegenTypes.WithDefault<boolean, true>;
|
|
196
196
|
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
197
|
-
javaScriptEnabled?: WithDefault<boolean, true>;
|
|
197
|
+
javaScriptEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
198
198
|
webviewDebuggingEnabled?: boolean;
|
|
199
|
-
mediaPlaybackRequiresUserAction?: WithDefault<boolean, true>;
|
|
199
|
+
mediaPlaybackRequiresUserAction?: CodegenTypes.WithDefault<boolean, true>;
|
|
200
200
|
messagingEnabled: boolean;
|
|
201
|
-
onLoadingError: DirectEventHandler<WebViewErrorEvent>;
|
|
202
|
-
onLoadingFinish: DirectEventHandler<WebViewNavigationEvent>;
|
|
203
|
-
onLoadingProgress: DirectEventHandler<WebViewNativeProgressEvent>;
|
|
204
|
-
onLoadingStart: DirectEventHandler<WebViewNavigationEvent>;
|
|
205
|
-
onHttpError: DirectEventHandler<WebViewHttpErrorEvent>;
|
|
206
|
-
onMessage: DirectEventHandler<WebViewMessageEvent>;
|
|
207
|
-
onOpenWindow?: DirectEventHandler<WebViewOpenWindowEvent>;
|
|
201
|
+
onLoadingError: CodegenTypes.DirectEventHandler<WebViewErrorEvent>;
|
|
202
|
+
onLoadingFinish: CodegenTypes.DirectEventHandler<WebViewNavigationEvent>;
|
|
203
|
+
onLoadingProgress: CodegenTypes.DirectEventHandler<WebViewNativeProgressEvent>;
|
|
204
|
+
onLoadingStart: CodegenTypes.DirectEventHandler<WebViewNavigationEvent>;
|
|
205
|
+
onHttpError: CodegenTypes.DirectEventHandler<WebViewHttpErrorEvent>;
|
|
206
|
+
onMessage: CodegenTypes.DirectEventHandler<WebViewMessageEvent>;
|
|
207
|
+
onOpenWindow?: CodegenTypes.DirectEventHandler<WebViewOpenWindowEvent>;
|
|
208
208
|
hasOnOpenWindowEvent?: boolean;
|
|
209
|
-
onScroll?: DirectEventHandler<ScrollEvent>;
|
|
210
|
-
onShouldStartLoadWithRequest: DirectEventHandler<ShouldStartLoadRequestEvent>;
|
|
211
|
-
showsHorizontalScrollIndicator?: WithDefault<boolean, true>;
|
|
212
|
-
showsVerticalScrollIndicator?: WithDefault<boolean, true>;
|
|
213
|
-
indicatorStyle?: WithDefault<'default' | 'black' | 'white', 'default'>;
|
|
209
|
+
onScroll?: CodegenTypes.DirectEventHandler<ScrollEvent>;
|
|
210
|
+
onShouldStartLoadWithRequest: CodegenTypes.DirectEventHandler<ShouldStartLoadRequestEvent>;
|
|
211
|
+
showsHorizontalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
|
|
212
|
+
showsVerticalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
|
|
213
|
+
indicatorStyle?: CodegenTypes.WithDefault<'default' | 'black' | 'white', 'default'>;
|
|
214
214
|
newSource: Readonly<{
|
|
215
215
|
uri?: string;
|
|
216
216
|
method?: string;
|
package/package.json
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/webview",
|
|
3
|
-
"version": "0.168.1-
|
|
3
|
+
"version": "0.168.1-rn.88.0",
|
|
4
4
|
"description": "React Native WebView component for iOS, Android, macOS, and Windows",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"react-native": "src/index.ts",
|
|
8
|
-
"typings": "index.d.ts",
|
|
5
|
+
"homepage": "https://github.com/react-native-webview/react-native-webview#readme",
|
|
6
|
+
"license": "MIT",
|
|
9
7
|
"author": "Jamon Holmgren <jamon@infinite.red>",
|
|
10
8
|
"contributors": [
|
|
11
9
|
"Thibault Malbranche <malbranche.thibault@gmail.com>"
|
|
12
10
|
],
|
|
13
|
-
"
|
|
14
|
-
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/react-native-webview/react-native-webview.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"android/src",
|
|
17
|
+
"android/build.gradle",
|
|
18
|
+
"android/gradle.properties",
|
|
19
|
+
"apple",
|
|
20
|
+
"ios",
|
|
21
|
+
"macos",
|
|
22
|
+
"windows",
|
|
23
|
+
"lib",
|
|
24
|
+
"src",
|
|
25
|
+
"index.js",
|
|
26
|
+
"index.d.ts",
|
|
27
|
+
"react-native-webview.podspec",
|
|
28
|
+
"react-native.config.js"
|
|
29
|
+
],
|
|
30
|
+
"main": "index.js",
|
|
31
|
+
"typings": "index.d.ts",
|
|
32
|
+
"react-native": "src/index.ts",
|
|
15
33
|
"scripts": {
|
|
16
34
|
"android": "react-native run-android",
|
|
17
35
|
"ios": "react-native run-ios",
|
|
@@ -25,14 +43,6 @@
|
|
|
25
43
|
"prepare:types": "tsc --noEmit false --emitDeclarationOnly --declaration --rootDir src --outDir lib",
|
|
26
44
|
"prepare": "echo"
|
|
27
45
|
},
|
|
28
|
-
"rn-docs": {
|
|
29
|
-
"title": "Webview",
|
|
30
|
-
"type": "Component"
|
|
31
|
-
},
|
|
32
|
-
"peerDependencies": {
|
|
33
|
-
"react": "*",
|
|
34
|
-
"react-native": "*"
|
|
35
|
-
},
|
|
36
46
|
"dependencies": {
|
|
37
47
|
"escape-string-regexp": "^4.0.0",
|
|
38
48
|
"invariant": "2.2.4"
|
|
@@ -41,13 +51,13 @@
|
|
|
41
51
|
"@babel/cli": "^7.20.0",
|
|
42
52
|
"@babel/core": "^7.20.0",
|
|
43
53
|
"@babel/runtime": "^7.20.0",
|
|
44
|
-
"@react-native-community/cli": "
|
|
45
|
-
"@react-native-community/cli-platform-android": "
|
|
46
|
-
"@react-native-community/cli-platform-ios": "
|
|
47
|
-
"@react-native/babel-preset": "0.
|
|
48
|
-
"@react-native/eslint-config": "0.
|
|
49
|
-
"@react-native/metro-config": "0.
|
|
50
|
-
"@react-native/typescript-config": "0.
|
|
54
|
+
"@react-native-community/cli": "20.2.0",
|
|
55
|
+
"@react-native-community/cli-platform-android": "20.2.0",
|
|
56
|
+
"@react-native-community/cli-platform-ios": "20.2.0",
|
|
57
|
+
"@react-native/babel-preset": "0.88.0",
|
|
58
|
+
"@react-native/eslint-config": "0.88.0",
|
|
59
|
+
"@react-native/metro-config": "0.88.0",
|
|
60
|
+
"@react-native/typescript-config": "0.88.0",
|
|
51
61
|
"@rnx-kit/metro-config": "1.3.15",
|
|
52
62
|
"@semantic-release/git": "7.0.16",
|
|
53
63
|
"@types/invariant": "^2.2.30",
|
|
@@ -58,33 +68,20 @@
|
|
|
58
68
|
"eslint": "8.57.0",
|
|
59
69
|
"jest": "^29.6.3",
|
|
60
70
|
"prettier": "2.8.8",
|
|
61
|
-
"react": "
|
|
62
|
-
"react-native": "0.
|
|
71
|
+
"react": "19.3.0",
|
|
72
|
+
"react-native": "0.88.0",
|
|
63
73
|
"selenium-appium": "1.0.2",
|
|
64
74
|
"selenium-webdriver": "4.0.0-alpha.7",
|
|
65
75
|
"semantic-release": "15.13.24",
|
|
66
|
-
"typescript": "
|
|
76
|
+
"typescript": "7.0.2",
|
|
67
77
|
"winappdriver": "^0.0.7"
|
|
68
78
|
},
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"react": "*",
|
|
81
|
+
"react-native": "*",
|
|
82
|
+
"react-native-webview": "13.15.0"
|
|
72
83
|
},
|
|
73
|
-
"
|
|
74
|
-
"android/src",
|
|
75
|
-
"android/build.gradle",
|
|
76
|
-
"android/gradle.properties",
|
|
77
|
-
"apple",
|
|
78
|
-
"ios",
|
|
79
|
-
"macos",
|
|
80
|
-
"windows",
|
|
81
|
-
"lib",
|
|
82
|
-
"src",
|
|
83
|
-
"index.js",
|
|
84
|
-
"index.d.ts",
|
|
85
|
-
"react-native-webview.podspec",
|
|
86
|
-
"react-native.config.js"
|
|
87
|
-
],
|
|
84
|
+
"packageManager": "yarn@1.22.19",
|
|
88
85
|
"codegenConfig": {
|
|
89
86
|
"name": "RNCWebViewSpec",
|
|
90
87
|
"type": "all",
|
|
@@ -101,5 +98,9 @@
|
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
},
|
|
104
|
-
"
|
|
101
|
+
"main-internal": "src/index.ts",
|
|
102
|
+
"rn-docs": {
|
|
103
|
+
"title": "Webview",
|
|
104
|
+
"type": "Component"
|
|
105
|
+
}
|
|
105
106
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
// RN 0.87+ (Strict TS API): dùng API public thay cho deep import react-native/Libraries/*
|
|
2
|
+
import { type CodegenTypes } from 'react-native';
|
|
1
3
|
import type { TurboModule } from 'react-native';
|
|
2
4
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
-
import { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
5
|
|
|
5
6
|
export interface Spec extends TurboModule {
|
|
6
7
|
isFileUploadSupported(): Promise<boolean>;
|
|
7
8
|
shouldStartLoadWithLockIdentifier(
|
|
8
9
|
shouldStart: boolean,
|
|
9
|
-
lockIdentifier: Double
|
|
10
|
+
lockIdentifier: CodegenTypes.Double
|
|
10
11
|
): void;
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
+
// RN 0.87+ (Strict TS API): dùng API public thay cho deep import react-native/Libraries/*
|
|
2
|
+
import { codegenNativeComponent, codegenNativeCommands, type CodegenTypes } from 'react-native';
|
|
1
3
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
-
import {
|
|
4
|
-
DirectEventHandler,
|
|
5
|
-
Double,
|
|
6
|
-
Int32,
|
|
7
|
-
WithDefault,
|
|
8
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
9
|
-
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
10
4
|
|
|
11
5
|
export type WebViewNativeEvent = Readonly<{
|
|
12
6
|
url: string;
|
|
@@ -14,7 +8,7 @@ export type WebViewNativeEvent = Readonly<{
|
|
|
14
8
|
title: string;
|
|
15
9
|
canGoBack: boolean;
|
|
16
10
|
canGoForward: boolean;
|
|
17
|
-
lockIdentifier: Double;
|
|
11
|
+
lockIdentifier: CodegenTypes.Double;
|
|
18
12
|
}>;
|
|
19
13
|
export type WebViewCustomMenuSelectionEvent = Readonly<{
|
|
20
14
|
label: string;
|
|
@@ -27,7 +21,7 @@ export type WebViewMessageEvent = Readonly<{
|
|
|
27
21
|
title: string;
|
|
28
22
|
canGoBack: boolean;
|
|
29
23
|
canGoForward: boolean;
|
|
30
|
-
lockIdentifier: Double;
|
|
24
|
+
lockIdentifier: CodegenTypes.Double;
|
|
31
25
|
data: string;
|
|
32
26
|
}>;
|
|
33
27
|
export type WebViewOpenWindowEvent = Readonly<{
|
|
@@ -39,9 +33,9 @@ export type WebViewHttpErrorEvent = Readonly<{
|
|
|
39
33
|
title: string;
|
|
40
34
|
canGoBack: boolean;
|
|
41
35
|
canGoForward: boolean;
|
|
42
|
-
lockIdentifier: Double;
|
|
36
|
+
lockIdentifier: CodegenTypes.Double;
|
|
43
37
|
description: string;
|
|
44
|
-
statusCode: Int32;
|
|
38
|
+
statusCode: CodegenTypes.Int32;
|
|
45
39
|
}>;
|
|
46
40
|
|
|
47
41
|
export type WebViewErrorEvent = Readonly<{
|
|
@@ -50,9 +44,9 @@ export type WebViewErrorEvent = Readonly<{
|
|
|
50
44
|
title: string;
|
|
51
45
|
canGoBack: boolean;
|
|
52
46
|
canGoForward: boolean;
|
|
53
|
-
lockIdentifier: Double;
|
|
47
|
+
lockIdentifier: CodegenTypes.Double;
|
|
54
48
|
domain?: string;
|
|
55
|
-
code: Int32;
|
|
49
|
+
code: CodegenTypes.Int32;
|
|
56
50
|
description: string;
|
|
57
51
|
}>;
|
|
58
52
|
|
|
@@ -62,8 +56,8 @@ export type WebViewNativeProgressEvent = Readonly<{
|
|
|
62
56
|
title: string;
|
|
63
57
|
canGoBack: boolean;
|
|
64
58
|
canGoForward: boolean;
|
|
65
|
-
lockIdentifier: Double;
|
|
66
|
-
progress: Double;
|
|
59
|
+
lockIdentifier: CodegenTypes.Double;
|
|
60
|
+
progress: CodegenTypes.Double;
|
|
67
61
|
}>;
|
|
68
62
|
|
|
69
63
|
export type WebViewNavigationEvent = Readonly<{
|
|
@@ -72,7 +66,7 @@ export type WebViewNavigationEvent = Readonly<{
|
|
|
72
66
|
title: string;
|
|
73
67
|
canGoBack: boolean;
|
|
74
68
|
canGoForward: boolean;
|
|
75
|
-
lockIdentifier: Double;
|
|
69
|
+
lockIdentifier: CodegenTypes.Double;
|
|
76
70
|
navigationType:
|
|
77
71
|
| 'click'
|
|
78
72
|
| 'formsubmit'
|
|
@@ -89,7 +83,7 @@ export type ShouldStartLoadRequestEvent = Readonly<{
|
|
|
89
83
|
title: string;
|
|
90
84
|
canGoBack: boolean;
|
|
91
85
|
canGoForward: boolean;
|
|
92
|
-
lockIdentifier: Double;
|
|
86
|
+
lockIdentifier: CodegenTypes.Double;
|
|
93
87
|
navigationType:
|
|
94
88
|
| 'click'
|
|
95
89
|
| 'formsubmit'
|
|
@@ -103,32 +97,32 @@ export type ShouldStartLoadRequestEvent = Readonly<{
|
|
|
103
97
|
|
|
104
98
|
type ScrollEvent = Readonly<{
|
|
105
99
|
contentInset: {
|
|
106
|
-
bottom: Double;
|
|
107
|
-
left: Double;
|
|
108
|
-
right: Double;
|
|
109
|
-
top: Double;
|
|
100
|
+
bottom: CodegenTypes.Double;
|
|
101
|
+
left: CodegenTypes.Double;
|
|
102
|
+
right: CodegenTypes.Double;
|
|
103
|
+
top: CodegenTypes.Double;
|
|
110
104
|
};
|
|
111
105
|
contentOffset: {
|
|
112
|
-
y: Double;
|
|
113
|
-
x: Double;
|
|
106
|
+
y: CodegenTypes.Double;
|
|
107
|
+
x: CodegenTypes.Double;
|
|
114
108
|
};
|
|
115
109
|
contentSize: {
|
|
116
|
-
height: Double;
|
|
117
|
-
width: Double;
|
|
110
|
+
height: CodegenTypes.Double;
|
|
111
|
+
width: CodegenTypes.Double;
|
|
118
112
|
};
|
|
119
113
|
layoutMeasurement: {
|
|
120
|
-
height: Double;
|
|
121
|
-
width: Double;
|
|
114
|
+
height: CodegenTypes.Double;
|
|
115
|
+
width: CodegenTypes.Double;
|
|
122
116
|
};
|
|
123
117
|
targetContentOffset?: {
|
|
124
|
-
y: Double;
|
|
125
|
-
x: Double;
|
|
118
|
+
y: CodegenTypes.Double;
|
|
119
|
+
x: CodegenTypes.Double;
|
|
126
120
|
};
|
|
127
121
|
velocity?: {
|
|
128
|
-
y: Double;
|
|
129
|
-
x: Double;
|
|
122
|
+
y: CodegenTypes.Double;
|
|
123
|
+
x: CodegenTypes.Double;
|
|
130
124
|
};
|
|
131
|
-
zoomScale?: Double;
|
|
125
|
+
zoomScale?: CodegenTypes.Double;
|
|
132
126
|
responderIgnoreScroll?: boolean;
|
|
133
127
|
}>;
|
|
134
128
|
|
|
@@ -147,8 +141,8 @@ export interface NativeProps extends ViewProps {
|
|
|
147
141
|
allowFileAccess?: boolean;
|
|
148
142
|
allowsProtectedMedia?: boolean;
|
|
149
143
|
allowsFullscreenVideo?: boolean;
|
|
150
|
-
androidLayerType?: WithDefault<'none' | 'software' | 'hardware', 'none'>;
|
|
151
|
-
cacheMode?: WithDefault<
|
|
144
|
+
androidLayerType?: CodegenTypes.WithDefault<'none' | 'software' | 'hardware', 'none'>;
|
|
145
|
+
cacheMode?: CodegenTypes.WithDefault<
|
|
152
146
|
| 'LOAD_DEFAULT'
|
|
153
147
|
| 'LOAD_CACHE_ELSE_NETWORK'
|
|
154
148
|
| 'LOAD_NO_CACHE'
|
|
@@ -161,19 +155,19 @@ export interface NativeProps extends ViewProps {
|
|
|
161
155
|
geolocationEnabled?: boolean;
|
|
162
156
|
lackPermissionToDownloadMessage?: string;
|
|
163
157
|
messagingModuleName: string;
|
|
164
|
-
minimumFontSize?: Int32;
|
|
165
|
-
mixedContentMode?: WithDefault<'never' | 'always' | 'compatibility', 'never'>;
|
|
158
|
+
minimumFontSize?: CodegenTypes.Int32;
|
|
159
|
+
mixedContentMode?: CodegenTypes.WithDefault<'never' | 'always' | 'compatibility', 'never'>;
|
|
166
160
|
nestedScrollEnabled?: boolean;
|
|
167
|
-
onContentSizeChange?: DirectEventHandler<WebViewNativeEvent>;
|
|
168
|
-
onRenderProcessGone?: DirectEventHandler<WebViewRenderProcessGoneEvent>;
|
|
161
|
+
onContentSizeChange?: CodegenTypes.DirectEventHandler<WebViewNativeEvent>;
|
|
162
|
+
onRenderProcessGone?: CodegenTypes.DirectEventHandler<WebViewRenderProcessGoneEvent>;
|
|
169
163
|
overScrollMode?: string;
|
|
170
164
|
saveFormDataDisabled?: boolean;
|
|
171
|
-
scalesPageToFit?: WithDefault<boolean, true>;
|
|
172
|
-
setBuiltInZoomControls?: WithDefault<boolean, true>;
|
|
165
|
+
scalesPageToFit?: CodegenTypes.WithDefault<boolean, true>;
|
|
166
|
+
setBuiltInZoomControls?: CodegenTypes.WithDefault<boolean, true>;
|
|
173
167
|
setDisplayZoomControls?: boolean;
|
|
174
|
-
setSupportMultipleWindows?: WithDefault<boolean, true>;
|
|
175
|
-
textZoom?: Int32;
|
|
176
|
-
thirdPartyCookiesEnabled?: WithDefault<boolean, true>;
|
|
168
|
+
setSupportMultipleWindows?: CodegenTypes.WithDefault<boolean, true>;
|
|
169
|
+
textZoom?: CodegenTypes.Int32;
|
|
170
|
+
thirdPartyCookiesEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
177
171
|
// Workaround to watch if listener if defined
|
|
178
172
|
hasOnScroll?: boolean;
|
|
179
173
|
// !Android only
|
|
@@ -184,25 +178,25 @@ export interface NativeProps extends ViewProps {
|
|
|
184
178
|
allowsInlineMediaPlayback?: boolean;
|
|
185
179
|
allowsPictureInPictureMediaPlayback?: boolean;
|
|
186
180
|
allowsAirPlayForMediaPlayback?: boolean;
|
|
187
|
-
allowsLinkPreview?: WithDefault<boolean, true>;
|
|
188
|
-
automaticallyAdjustContentInsets?: WithDefault<boolean, true>;
|
|
189
|
-
autoManageStatusBarEnabled?: WithDefault<boolean, true>;
|
|
190
|
-
bounces?: WithDefault<boolean, true>;
|
|
181
|
+
allowsLinkPreview?: CodegenTypes.WithDefault<boolean, true>;
|
|
182
|
+
automaticallyAdjustContentInsets?: CodegenTypes.WithDefault<boolean, true>;
|
|
183
|
+
autoManageStatusBarEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
184
|
+
bounces?: CodegenTypes.WithDefault<boolean, true>;
|
|
191
185
|
contentInset?: Readonly<{
|
|
192
|
-
top?: Double;
|
|
193
|
-
left?: Double;
|
|
194
|
-
bottom?: Double;
|
|
195
|
-
right?: Double;
|
|
186
|
+
top?: CodegenTypes.Double;
|
|
187
|
+
left?: CodegenTypes.Double;
|
|
188
|
+
bottom?: CodegenTypes.Double;
|
|
189
|
+
right?: CodegenTypes.Double;
|
|
196
190
|
}>;
|
|
197
|
-
contentInsetAdjustmentBehavior?: WithDefault<
|
|
191
|
+
contentInsetAdjustmentBehavior?: CodegenTypes.WithDefault<
|
|
198
192
|
'never' | 'automatic' | 'scrollableAxes' | 'always',
|
|
199
193
|
'never'
|
|
200
194
|
>;
|
|
201
|
-
contentMode?: WithDefault<
|
|
195
|
+
contentMode?: CodegenTypes.WithDefault<
|
|
202
196
|
'recommended' | 'mobile' | 'desktop',
|
|
203
197
|
'recommended'
|
|
204
198
|
>;
|
|
205
|
-
dataDetectorTypes?: WithDefault<
|
|
199
|
+
dataDetectorTypes?: CodegenTypes.WithDefault<
|
|
206
200
|
ReadonlyArray<
|
|
207
201
|
| 'address'
|
|
208
202
|
| 'link'
|
|
@@ -216,13 +210,13 @@ export interface NativeProps extends ViewProps {
|
|
|
216
210
|
>,
|
|
217
211
|
'phoneNumber'
|
|
218
212
|
>;
|
|
219
|
-
decelerationRate?: Double;
|
|
220
|
-
directionalLockEnabled?: WithDefault<boolean, true>;
|
|
213
|
+
decelerationRate?: CodegenTypes.Double;
|
|
214
|
+
directionalLockEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
221
215
|
enableApplePay?: boolean;
|
|
222
216
|
hideKeyboardAccessoryView?: boolean;
|
|
223
|
-
keyboardDisplayRequiresUserAction?: WithDefault<boolean, true>;
|
|
217
|
+
keyboardDisplayRequiresUserAction?: CodegenTypes.WithDefault<boolean, true>;
|
|
224
218
|
limitsNavigationsToAppBoundDomains?: boolean;
|
|
225
|
-
mediaCapturePermissionGrantType?: WithDefault<
|
|
219
|
+
mediaCapturePermissionGrantType?: CodegenTypes.WithDefault<
|
|
226
220
|
| 'prompt'
|
|
227
221
|
| 'grant'
|
|
228
222
|
| 'deny'
|
|
@@ -233,19 +227,19 @@ export interface NativeProps extends ViewProps {
|
|
|
233
227
|
pagingEnabled?: boolean;
|
|
234
228
|
pullToRefreshEnabled?: boolean;
|
|
235
229
|
refreshControlLightMode?: boolean;
|
|
236
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
230
|
+
scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
237
231
|
sharedCookiesEnabled?: boolean;
|
|
238
|
-
textInteractionEnabled?: WithDefault<boolean, true>;
|
|
239
|
-
useSharedProcessPool?: WithDefault<boolean, true>;
|
|
240
|
-
onContentProcessDidTerminate?: DirectEventHandler<WebViewNativeEvent>;
|
|
241
|
-
onCustomMenuSelection?: DirectEventHandler<WebViewCustomMenuSelectionEvent>;
|
|
242
|
-
onFileDownload?: DirectEventHandler<WebViewDownloadEvent>;
|
|
232
|
+
textInteractionEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
233
|
+
useSharedProcessPool?: CodegenTypes.WithDefault<boolean, true>;
|
|
234
|
+
onContentProcessDidTerminate?: CodegenTypes.DirectEventHandler<WebViewNativeEvent>;
|
|
235
|
+
onCustomMenuSelection?: CodegenTypes.DirectEventHandler<WebViewCustomMenuSelectionEvent>;
|
|
236
|
+
onFileDownload?: CodegenTypes.DirectEventHandler<WebViewDownloadEvent>;
|
|
243
237
|
|
|
244
238
|
menuItems?: ReadonlyArray<Readonly<{ label: string; key: string }>>;
|
|
245
239
|
suppressMenuItems?: Readonly<string>[];
|
|
246
240
|
// Workaround to watch if listener if defined
|
|
247
241
|
hasOnFileDownload?: boolean;
|
|
248
|
-
fraudulentWebsiteWarningEnabled?: WithDefault<boolean, true>;
|
|
242
|
+
fraudulentWebsiteWarningEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
249
243
|
// !iOS only
|
|
250
244
|
|
|
251
245
|
allowFileAccessFromFileURLs?: boolean;
|
|
@@ -255,33 +249,33 @@ export interface NativeProps extends ViewProps {
|
|
|
255
249
|
username: string;
|
|
256
250
|
password: string;
|
|
257
251
|
}>;
|
|
258
|
-
cacheEnabled?: WithDefault<boolean, true>;
|
|
252
|
+
cacheEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
259
253
|
incognito?: boolean;
|
|
260
254
|
injectedJavaScript?: string;
|
|
261
255
|
injectedJavaScriptBeforeContentLoaded?: string;
|
|
262
|
-
injectedJavaScriptForMainFrameOnly?: WithDefault<boolean, true>;
|
|
263
|
-
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: WithDefault<
|
|
256
|
+
injectedJavaScriptForMainFrameOnly?: CodegenTypes.WithDefault<boolean, true>;
|
|
257
|
+
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: CodegenTypes.WithDefault<
|
|
264
258
|
boolean,
|
|
265
259
|
true
|
|
266
260
|
>;
|
|
267
261
|
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
268
|
-
javaScriptEnabled?: WithDefault<boolean, true>;
|
|
262
|
+
javaScriptEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
269
263
|
webviewDebuggingEnabled?: boolean;
|
|
270
|
-
mediaPlaybackRequiresUserAction?: WithDefault<boolean, true>;
|
|
264
|
+
mediaPlaybackRequiresUserAction?: CodegenTypes.WithDefault<boolean, true>;
|
|
271
265
|
messagingEnabled: boolean;
|
|
272
|
-
onLoadingError: DirectEventHandler<WebViewErrorEvent>;
|
|
273
|
-
onLoadingFinish: DirectEventHandler<WebViewNavigationEvent>;
|
|
274
|
-
onLoadingProgress: DirectEventHandler<WebViewNativeProgressEvent>;
|
|
275
|
-
onLoadingStart: DirectEventHandler<WebViewNavigationEvent>;
|
|
276
|
-
onHttpError: DirectEventHandler<WebViewHttpErrorEvent>;
|
|
277
|
-
onMessage: DirectEventHandler<WebViewMessageEvent>;
|
|
278
|
-
onOpenWindow?: DirectEventHandler<WebViewOpenWindowEvent>;
|
|
266
|
+
onLoadingError: CodegenTypes.DirectEventHandler<WebViewErrorEvent>;
|
|
267
|
+
onLoadingFinish: CodegenTypes.DirectEventHandler<WebViewNavigationEvent>;
|
|
268
|
+
onLoadingProgress: CodegenTypes.DirectEventHandler<WebViewNativeProgressEvent>;
|
|
269
|
+
onLoadingStart: CodegenTypes.DirectEventHandler<WebViewNavigationEvent>;
|
|
270
|
+
onHttpError: CodegenTypes.DirectEventHandler<WebViewHttpErrorEvent>;
|
|
271
|
+
onMessage: CodegenTypes.DirectEventHandler<WebViewMessageEvent>;
|
|
272
|
+
onOpenWindow?: CodegenTypes.DirectEventHandler<WebViewOpenWindowEvent>;
|
|
279
273
|
hasOnOpenWindowEvent?: boolean;
|
|
280
|
-
onScroll?: DirectEventHandler<ScrollEvent>;
|
|
281
|
-
onShouldStartLoadWithRequest: DirectEventHandler<ShouldStartLoadRequestEvent>;
|
|
282
|
-
showsHorizontalScrollIndicator?: WithDefault<boolean, true>;
|
|
283
|
-
showsVerticalScrollIndicator?: WithDefault<boolean, true>;
|
|
284
|
-
indicatorStyle?: WithDefault<'default' | 'black' | 'white', 'default'>;
|
|
274
|
+
onScroll?: CodegenTypes.DirectEventHandler<ScrollEvent>;
|
|
275
|
+
onShouldStartLoadWithRequest: CodegenTypes.DirectEventHandler<ShouldStartLoadRequestEvent>;
|
|
276
|
+
showsHorizontalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
|
|
277
|
+
showsVerticalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
|
|
278
|
+
indicatorStyle?: CodegenTypes.WithDefault<'default' | 'black' | 'white', 'default'>;
|
|
285
279
|
newSource: Readonly<{
|
|
286
280
|
uri?: string;
|
|
287
281
|
method?: string;
|
package/src/WebView.android.tsx
CHANGED
|
@@ -7,10 +7,15 @@ import React, {
|
|
|
7
7
|
useRef,
|
|
8
8
|
} from 'react';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
// RN 0.87+ (Strict TS API): EventEmitter + registerCallableModule là API public (thay deep import)
|
|
11
|
+
import {
|
|
12
|
+
Image,
|
|
13
|
+
View,
|
|
14
|
+
ImageSourcePropType,
|
|
15
|
+
HostComponent,
|
|
16
|
+
EventEmitter,
|
|
17
|
+
registerCallableModule,
|
|
18
|
+
} from 'react-native';
|
|
14
19
|
|
|
15
20
|
import invariant from 'invariant';
|
|
16
21
|
|
|
@@ -33,14 +38,14 @@ import styles from './WebView.styles';
|
|
|
33
38
|
|
|
34
39
|
const { resolveAssetSource } = Image;
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
type DirectEvents = {
|
|
42
|
+
onShouldStartLoadWithRequest: [
|
|
43
|
+
ShouldStartLoadRequestEvent & { messagingModuleName?: string },
|
|
44
|
+
];
|
|
45
|
+
onMessage: [WebViewMessageEvent & { messagingModuleName?: string }];
|
|
46
|
+
};
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
BatchedBridge.registerCallableModule.bind(BatchedBridge);
|
|
48
|
+
const directEventEmitter = new EventEmitter<DirectEvents>();
|
|
44
49
|
|
|
45
50
|
registerCallableModule('RNCWebViewMessagingModule', {
|
|
46
51
|
onShouldStartLoadWithRequest: (
|
package/src/WebView.windows.tsx
CHANGED
|
@@ -16,8 +16,7 @@ import React, {
|
|
|
16
16
|
useImperativeHandle,
|
|
17
17
|
useRef,
|
|
18
18
|
} from 'react';
|
|
19
|
-
import { View, Image, ImageSourcePropType, NativeModules } from 'react-native';
|
|
20
|
-
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
19
|
+
import { View, Image, ImageSourcePropType, NativeModules, codegenNativeCommands } from 'react-native';
|
|
21
20
|
import invariant from 'invariant';
|
|
22
21
|
import { RCTWebView, RCTWebView2 } from './WebViewNativeComponent.windows';
|
|
23
22
|
import {
|