@react-native-ohos/react-native-webview 13.15.1-rc.1 → 13.15.1-rc.4
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/LICENSE +20 -20
- package/README.OpenSource +10 -10
- package/README.md +12 -12
- package/harmony/rn_webview/OAT.xml +44 -44
- package/harmony/rn_webview/build-profile.json5 +28 -28
- package/harmony/rn_webview/index.ets +12 -12
- package/harmony/rn_webview/oh-package.json5 +13 -13
- package/harmony/rn_webview/src/main/cpp/CMakeLists.txt +9 -9
- package/harmony/rn_webview/src/main/cpp/WebViewPackage.h +16 -16
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/BaseReactNativeWebviewPackage.h +95 -95
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/components/RNCWebViewJSIBinder.h +119 -119
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.cpp +18 -18
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.h +16 -16
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.cpp +17 -17
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.h +16 -16
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ComponentDescriptors.h +24 -24
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.cpp +241 -241
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.h +263 -263
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.cpp +103 -103
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.h +509 -509
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.cpp +17 -17
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.h +32 -32
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.cpp +16 -16
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.h +28 -28
- package/harmony/rn_webview/src/main/ets/CutomReference.ts +29 -29
- package/harmony/rn_webview/src/main/ets/Logger.ts +43 -43
- package/harmony/rn_webview/src/main/ets/Magic.ets +184 -184
- package/harmony/rn_webview/src/main/ets/RNCWebView.ets +645 -570
- package/harmony/rn_webview/src/main/ets/RNCWebViewPackage.ets +37 -37
- package/harmony/rn_webview/src/main/ets/ShouldRequestUrl.ts +47 -47
- package/harmony/rn_webview/src/main/ets/WebViewBaseOperate.ets +457 -443
- package/harmony/rn_webview/src/main/ets/WebViewTurboModule.ets +57 -57
- package/harmony/rn_webview/src/main/ets/generated/components/RNCWebView.ts +524 -524
- package/harmony/rn_webview/src/main/ets/generated/components/ts.ts +5 -5
- package/harmony/rn_webview/src/main/ets/generated/index.ets +5 -5
- package/harmony/rn_webview/src/main/ets/generated/ts.ts +6 -6
- package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebView.ts +18 -18
- package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebViewModule.ts +16 -16
- package/harmony/rn_webview/src/main/ets/generated/turboModules/ts.ts +6 -6
- package/harmony/rn_webview/src/main/module.json5 +10 -10
- package/harmony/rn_webview/src/main/resources/base/element/string.json +39 -39
- package/harmony/rn_webview/src/main/resources/en_US/element/string.json +39 -39
- package/harmony/rn_webview/src/main/resources/zh_CN/element/string.json +39 -39
- package/harmony/rn_webview/src/test/List.test.ets +4 -4
- package/harmony/rn_webview/src/test/LocalUnit.test.ets +32 -32
- package/harmony/rn_webview/ts.ets +8 -8
- package/harmony/rn_webview.har +0 -0
- package/package.json +99 -99
- package/src/NativeRNCWebView.ts +21 -21
- package/src/NativeRNCWebViewModule.ts +19 -19
- package/src/RNCWebViewNativeComponent.ts +354 -354
- package/src/WebView.harmony.tsx +342 -342
- package/src/WebView.tsx +10 -10
- package/src/codegenUtils.ts +10 -10
- package/src/index.ts +10 -10
- package/harmony/rn_webview/BuildProfile.ets +0 -17
|
@@ -1,524 +1,524 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Descriptor as ComponentDescriptor,
|
|
7
|
-
ViewBaseProps,
|
|
8
|
-
ViewRawProps,
|
|
9
|
-
ViewDescriptorWrapperBase,
|
|
10
|
-
ColorValue,
|
|
11
|
-
Color,
|
|
12
|
-
RNInstance,
|
|
13
|
-
Tag,
|
|
14
|
-
RNComponentCommandReceiver,
|
|
15
|
-
ViewPropsSelector,
|
|
16
|
-
} from '@rnoh/react-native-openharmony/ts';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export namespace RNCWebView {
|
|
20
|
-
export const NAME = "RNCWebView" as const
|
|
21
|
-
|
|
22
|
-
export interface DirectRawProps {
|
|
23
|
-
allowFileAccess?: boolean;
|
|
24
|
-
allowsProtectedMedia?: boolean;
|
|
25
|
-
allowsFullscreenVideo?: boolean;
|
|
26
|
-
androidLayerType?: 'none' | 'software' | 'hardware';
|
|
27
|
-
cacheMode?: 'LOAD_DEFAULT' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE' | 'LOAD_CACHE_ONLY';
|
|
28
|
-
domStorageEnabled?: boolean;
|
|
29
|
-
downloadingMessage?: string;
|
|
30
|
-
forceDarkOn?: boolean;
|
|
31
|
-
geolocationEnabled?: boolean;
|
|
32
|
-
lackPermissionToDownloadMessage?: string;
|
|
33
|
-
messagingModuleName: string;
|
|
34
|
-
minimumFontSize?: number;
|
|
35
|
-
mixedContentMode?: 'never' | 'always' | 'compatibility';
|
|
36
|
-
nestedScrollEnabled?: boolean;
|
|
37
|
-
overScrollMode?: string;
|
|
38
|
-
saveFormDataDisabled?: boolean;
|
|
39
|
-
scalesPageToFit?: boolean;
|
|
40
|
-
setBuiltInZoomControls?: boolean;
|
|
41
|
-
setDisplayZoomControls?: boolean;
|
|
42
|
-
setSupportMultipleWindows?: boolean;
|
|
43
|
-
textZoom?: number;
|
|
44
|
-
thirdPartyCookiesEnabled?: boolean;
|
|
45
|
-
hasOnScroll?: boolean;
|
|
46
|
-
injectedJavaScriptObject?: string;
|
|
47
|
-
paymentRequestEnabled?: boolean;
|
|
48
|
-
allowingReadAccessToURL?: string;
|
|
49
|
-
allowsBackForwardNavigationGestures?: boolean;
|
|
50
|
-
allowsInlineMediaPlayback?: boolean;
|
|
51
|
-
allowsPictureInPictureMediaPlayback?: boolean;
|
|
52
|
-
allowsAirPlayForMediaPlayback?: boolean;
|
|
53
|
-
allowsLinkPreview?: boolean;
|
|
54
|
-
automaticallyAdjustContentInsets?: boolean;
|
|
55
|
-
ignoreSilentHardwareSwitch?: boolean;
|
|
56
|
-
autoManageStatusBarEnabled?: boolean;
|
|
57
|
-
bounces?: boolean;
|
|
58
|
-
contentInset?: {top?: number, left?: number, bottom?: number, right?: number};
|
|
59
|
-
contentInsetAdjustmentBehavior?: 'never' | 'automatic' | 'scrollableAxes' | 'always';
|
|
60
|
-
contentMode?: 'recommended' | 'mobile' | 'desktop';
|
|
61
|
-
dataDetectorTypes?: 'address' | 'link' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'phoneNumber' | 'all' | 'none'[];
|
|
62
|
-
decelerationRate?: number;
|
|
63
|
-
directionalLockEnabled?: boolean;
|
|
64
|
-
enableApplePay?: boolean;
|
|
65
|
-
hideKeyboardAccessoryView?: boolean;
|
|
66
|
-
keyboardDisplayRequiresUserAction?: boolean;
|
|
67
|
-
limitsNavigationsToAppBoundDomains?: boolean;
|
|
68
|
-
mediaCapturePermissionGrantType?: 'prompt' | 'grant' | 'deny' | 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny';
|
|
69
|
-
pagingEnabled?: boolean;
|
|
70
|
-
pullToRefreshEnabled?: boolean;
|
|
71
|
-
refreshControlLightMode?: boolean;
|
|
72
|
-
scrollEnabled?: boolean;
|
|
73
|
-
sharedCookiesEnabled?: boolean;
|
|
74
|
-
textInteractionEnabled?: boolean;
|
|
75
|
-
useSharedProcessPool?: boolean;
|
|
76
|
-
menuItems?: {label: string, key: string}[];
|
|
77
|
-
suppressMenuItems?: string[];
|
|
78
|
-
hasOnFileDownload?: boolean;
|
|
79
|
-
fraudulentWebsiteWarningEnabled?: boolean;
|
|
80
|
-
allowFileAccessFromFileURLs?: boolean;
|
|
81
|
-
allowUniversalAccessFromFileURLs?: boolean;
|
|
82
|
-
applicationNameForUserAgent?: string;
|
|
83
|
-
basicAuthCredential?: {username: string, password: string};
|
|
84
|
-
cacheEnabled?: boolean;
|
|
85
|
-
incognito?: boolean;
|
|
86
|
-
injectedJavaScript?: string;
|
|
87
|
-
injectedJavaScriptBeforeContentLoaded?: string;
|
|
88
|
-
injectedJavaScriptForMainFrameOnly?: boolean;
|
|
89
|
-
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
|
|
90
|
-
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
91
|
-
javaScriptEnabled?: boolean;
|
|
92
|
-
webviewDebuggingEnabled?: boolean;
|
|
93
|
-
mediaPlaybackRequiresUserAction?: boolean;
|
|
94
|
-
messagingEnabled: boolean;
|
|
95
|
-
shouldStartLoadWithRequestEnabled: boolean;
|
|
96
|
-
hasOnOpenWindowEvent?: boolean;
|
|
97
|
-
showsHorizontalScrollIndicator?: boolean;
|
|
98
|
-
showsVerticalScrollIndicator?: boolean;
|
|
99
|
-
indicatorStyle?: 'default' | 'black' | 'white';
|
|
100
|
-
newSource: {uri?: string, method?: string, body?: string, headers?: {name: string, value: string}[], html?: string, baseUrl?: string};
|
|
101
|
-
userAgent?: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface Props extends ViewBaseProps {}
|
|
105
|
-
|
|
106
|
-
export interface State {}
|
|
107
|
-
|
|
108
|
-
export interface RawProps extends ViewRawProps, DirectRawProps {}
|
|
109
|
-
|
|
110
|
-
export class PropsSelector extends ViewPropsSelector<Props, RawProps> {
|
|
111
|
-
get allowFileAccess() {
|
|
112
|
-
return this.rawProps.allowFileAccess ?? false;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
get allowsProtectedMedia() {
|
|
116
|
-
return this.rawProps.allowsProtectedMedia ?? false;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
get allowsFullscreenVideo() {
|
|
120
|
-
return this.rawProps.allowsFullscreenVideo ?? false;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
get androidLayerType() {
|
|
124
|
-
return this.rawProps.androidLayerType ?? 'none';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
get cacheMode() {
|
|
128
|
-
return this.rawProps.cacheMode ?? 'LOAD_DEFAULT';
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
get domStorageEnabled() {
|
|
132
|
-
return this.rawProps.domStorageEnabled ?? false;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
get downloadingMessage() {
|
|
136
|
-
return this.rawProps.downloadingMessage;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
get forceDarkOn() {
|
|
140
|
-
return this.rawProps.forceDarkOn ?? false;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
get geolocationEnabled() {
|
|
144
|
-
return this.rawProps.geolocationEnabled ?? false;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
get lackPermissionToDownloadMessage() {
|
|
148
|
-
return this.rawProps.lackPermissionToDownloadMessage;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
get messagingModuleName() {
|
|
152
|
-
return this.rawProps.messagingModuleName;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
get minimumFontSize() {
|
|
156
|
-
return this.rawProps.minimumFontSize ?? 0;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
get mixedContentMode() {
|
|
160
|
-
return this.rawProps.mixedContentMode ?? 'never';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
get nestedScrollEnabled() {
|
|
164
|
-
return this.rawProps.nestedScrollEnabled ?? false;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
get overScrollMode() {
|
|
168
|
-
return this.rawProps.overScrollMode;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
get saveFormDataDisabled() {
|
|
172
|
-
return this.rawProps.saveFormDataDisabled ?? false;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
get scalesPageToFit() {
|
|
176
|
-
return this.rawProps.scalesPageToFit ?? true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
get setBuiltInZoomControls() {
|
|
180
|
-
return this.rawProps.setBuiltInZoomControls ?? true;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
get setDisplayZoomControls() {
|
|
184
|
-
return this.rawProps.setDisplayZoomControls ?? false;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
get setSupportMultipleWindows() {
|
|
188
|
-
return this.rawProps.setSupportMultipleWindows ?? true;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
get textZoom() {
|
|
192
|
-
return this.rawProps.textZoom ?? 0;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
get thirdPartyCookiesEnabled() {
|
|
196
|
-
return this.rawProps.thirdPartyCookiesEnabled ?? true;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
get hasOnScroll() {
|
|
200
|
-
return this.rawProps.hasOnScroll ?? false;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
get injectedJavaScriptObject() {
|
|
204
|
-
return this.rawProps.injectedJavaScriptObject;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
get paymentRequestEnabled() {
|
|
208
|
-
return this.rawProps.paymentRequestEnabled ?? false;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
get allowingReadAccessToURL() {
|
|
212
|
-
return this.rawProps.allowingReadAccessToURL;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
get allowsBackForwardNavigationGestures() {
|
|
216
|
-
return this.rawProps.allowsBackForwardNavigationGestures ?? false;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
get allowsInlineMediaPlayback() {
|
|
220
|
-
return this.rawProps.allowsInlineMediaPlayback ?? false;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
get allowsPictureInPictureMediaPlayback() {
|
|
224
|
-
return this.rawProps.allowsPictureInPictureMediaPlayback ?? false;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
get allowsAirPlayForMediaPlayback() {
|
|
228
|
-
return this.rawProps.allowsAirPlayForMediaPlayback ?? false;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
get allowsLinkPreview() {
|
|
232
|
-
return this.rawProps.allowsLinkPreview ?? true;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
get automaticallyAdjustContentInsets() {
|
|
236
|
-
return this.rawProps.automaticallyAdjustContentInsets ?? true;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
get ignoreSilentHardwareSwitch() {
|
|
240
|
-
return this.rawProps.ignoreSilentHardwareSwitch ?? false;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
get autoManageStatusBarEnabled() {
|
|
244
|
-
return this.rawProps.autoManageStatusBarEnabled ?? true;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
get bounces() {
|
|
248
|
-
return this.rawProps.bounces ?? true;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
get contentInset() {
|
|
252
|
-
return this.rawProps.contentInset;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
get contentInsetAdjustmentBehavior() {
|
|
256
|
-
return this.rawProps.contentInsetAdjustmentBehavior ?? 'never';
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
get contentMode() {
|
|
260
|
-
return this.rawProps.contentMode ?? 'recommended';
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
get dataDetectorTypes() {
|
|
264
|
-
return this.rawProps.dataDetectorTypes;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
get decelerationRate() {
|
|
268
|
-
return this.rawProps.decelerationRate ?? 0;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
get directionalLockEnabled() {
|
|
272
|
-
return this.rawProps.directionalLockEnabled ?? true;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
get enableApplePay() {
|
|
276
|
-
return this.rawProps.enableApplePay ?? false;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
get hideKeyboardAccessoryView() {
|
|
280
|
-
return this.rawProps.hideKeyboardAccessoryView ?? false;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
get keyboardDisplayRequiresUserAction() {
|
|
284
|
-
return this.rawProps.keyboardDisplayRequiresUserAction ?? true;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
get limitsNavigationsToAppBoundDomains() {
|
|
288
|
-
return this.rawProps.limitsNavigationsToAppBoundDomains ?? false;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
get mediaCapturePermissionGrantType() {
|
|
292
|
-
return this.rawProps.mediaCapturePermissionGrantType ?? 'prompt';
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
get pagingEnabled() {
|
|
296
|
-
return this.rawProps.pagingEnabled ?? false;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
get pullToRefreshEnabled() {
|
|
300
|
-
return this.rawProps.pullToRefreshEnabled ?? false;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
get refreshControlLightMode() {
|
|
304
|
-
return this.rawProps.refreshControlLightMode ?? false;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
get scrollEnabled() {
|
|
308
|
-
return this.rawProps.scrollEnabled ?? true;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
get sharedCookiesEnabled() {
|
|
312
|
-
return this.rawProps.sharedCookiesEnabled ?? false;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
get textInteractionEnabled() {
|
|
316
|
-
return this.rawProps.textInteractionEnabled ?? true;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
get useSharedProcessPool() {
|
|
320
|
-
return this.rawProps.useSharedProcessPool ?? true;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
get menuItems() {
|
|
324
|
-
return this.rawProps.menuItems;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
get suppressMenuItems() {
|
|
328
|
-
return this.rawProps.suppressMenuItems;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
get hasOnFileDownload() {
|
|
332
|
-
return this.rawProps.hasOnFileDownload ?? false;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
get fraudulentWebsiteWarningEnabled() {
|
|
336
|
-
return this.rawProps.fraudulentWebsiteWarningEnabled ?? true;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
get allowFileAccessFromFileURLs() {
|
|
340
|
-
return this.rawProps.allowFileAccessFromFileURLs ?? false;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
get allowUniversalAccessFromFileURLs() {
|
|
344
|
-
return this.rawProps.allowUniversalAccessFromFileURLs ?? false;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
get applicationNameForUserAgent() {
|
|
348
|
-
return this.rawProps.applicationNameForUserAgent;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
get basicAuthCredential() {
|
|
352
|
-
return this.rawProps.basicAuthCredential;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
get cacheEnabled() {
|
|
356
|
-
return this.rawProps.cacheEnabled ?? true;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
get incognito() {
|
|
360
|
-
return this.rawProps.incognito ?? false;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
get injectedJavaScript() {
|
|
364
|
-
return this.rawProps.injectedJavaScript;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
get injectedJavaScriptBeforeContentLoaded() {
|
|
368
|
-
return this.rawProps.injectedJavaScriptBeforeContentLoaded;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
get injectedJavaScriptForMainFrameOnly() {
|
|
372
|
-
return this.rawProps.injectedJavaScriptForMainFrameOnly ?? true;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
get injectedJavaScriptBeforeContentLoadedForMainFrameOnly() {
|
|
376
|
-
return this.rawProps.injectedJavaScriptBeforeContentLoadedForMainFrameOnly ?? true;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
get javaScriptCanOpenWindowsAutomatically() {
|
|
380
|
-
return this.rawProps.javaScriptCanOpenWindowsAutomatically ?? false;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
get javaScriptEnabled() {
|
|
384
|
-
return this.rawProps.javaScriptEnabled ?? true;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
get webviewDebuggingEnabled() {
|
|
388
|
-
return this.rawProps.webviewDebuggingEnabled ?? false;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
get mediaPlaybackRequiresUserAction() {
|
|
392
|
-
return this.rawProps.mediaPlaybackRequiresUserAction ?? true;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
get messagingEnabled() {
|
|
396
|
-
return this.rawProps.messagingEnabled ?? false;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
get shouldStartLoadWithRequestEnabled() {
|
|
400
|
-
return this.rawProps.shouldStartLoadWithRequestEnabled ?? false;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
get hasOnOpenWindowEvent() {
|
|
404
|
-
return this.rawProps.hasOnOpenWindowEvent ?? false;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
get showsHorizontalScrollIndicator() {
|
|
408
|
-
return this.rawProps.showsHorizontalScrollIndicator ?? true;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
get showsVerticalScrollIndicator() {
|
|
412
|
-
return this.rawProps.showsVerticalScrollIndicator ?? true;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
get indicatorStyle() {
|
|
416
|
-
return this.rawProps.indicatorStyle ?? 'default';
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
get newSource() {
|
|
420
|
-
return this.rawProps.newSource;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
get userAgent() {
|
|
424
|
-
return this.rawProps.userAgent;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export type Descriptor = ComponentDescriptor<
|
|
431
|
-
typeof NAME,
|
|
432
|
-
Props,
|
|
433
|
-
State,
|
|
434
|
-
RawProps
|
|
435
|
-
>;
|
|
436
|
-
|
|
437
|
-
export class DescriptorWrapper extends ViewDescriptorWrapperBase<
|
|
438
|
-
typeof NAME,
|
|
439
|
-
Props,
|
|
440
|
-
State,
|
|
441
|
-
RawProps,
|
|
442
|
-
PropsSelector
|
|
443
|
-
> {
|
|
444
|
-
protected createPropsSelector() {
|
|
445
|
-
return new PropsSelector(this.descriptor.props, this.descriptor.rawProps)
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
export interface EventPayloadByName {
|
|
450
|
-
"contentSizeChange": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number}
|
|
451
|
-
"renderProcessGone": {didCrash: boolean}
|
|
452
|
-
"contentProcessDidTerminate": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number}
|
|
453
|
-
"customMenuSelection": {label: string, key: string, selectedText: string}
|
|
454
|
-
"fileDownload": {downloadUrl: string}
|
|
455
|
-
"loadingError": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, domain?: string, code: number, description: string}
|
|
456
|
-
"loadingFinish": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other', mainDocumentURL?: string}
|
|
457
|
-
"loadingProgress": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, progress: number}
|
|
458
|
-
"loadingStart": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other', mainDocumentURL?: string}
|
|
459
|
-
"httpError": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, description: string, statusCode: number}
|
|
460
|
-
"message": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, data: string}
|
|
461
|
-
"openWindow": {targetUrl: string}
|
|
462
|
-
"scroll": {contentInset: {bottom: number, left: number, right: number, top: number}, contentOffset: {y: number, x: number}, contentSize: {height: number, width: number}, layoutMeasurement: {height: number, width: number}, targetContentOffset?: {y: number, x: number}, velocity?: {y: number, x: number}, zoomScale?: number, responderIgnoreScroll?: boolean}
|
|
463
|
-
"shouldStartLoadWithRequest": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other', mainDocumentURL?: string, isTopFrame: boolean}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
export class EventEmitter {
|
|
467
|
-
constructor(private rnInstance: RNInstance, private tag: Tag) {}
|
|
468
|
-
|
|
469
|
-
emit<TEventName extends keyof EventPayloadByName>(eventName: TEventName, payload: EventPayloadByName[TEventName]) {
|
|
470
|
-
this.rnInstance.emitComponentEvent(this.tag, eventName, payload)
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
export interface CommandArgvByName {
|
|
475
|
-
"goBack": []
|
|
476
|
-
"goForward": []
|
|
477
|
-
"reload": []
|
|
478
|
-
"stopLoading": []
|
|
479
|
-
"injectJavaScript": [string]
|
|
480
|
-
"requestFocus": []
|
|
481
|
-
"postMessage": [string]
|
|
482
|
-
"loadUrl": [string]
|
|
483
|
-
"clearFormData": []
|
|
484
|
-
"clearCache": [boolean]
|
|
485
|
-
"clearHistory": []
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export class CommandReceiver {
|
|
489
|
-
private listenersByCommandName = new Map<string, Set<(...args: any[]) => void>>()
|
|
490
|
-
private cleanUp: (() => void) | undefined = undefined
|
|
491
|
-
|
|
492
|
-
constructor(private componentCommandReceiver: RNComponentCommandReceiver, private tag: Tag) {
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
subscribe<TCommandName extends keyof CommandArgvByName>(commandName: TCommandName, listener: (argv: CommandArgvByName[TCommandName]) => void) {
|
|
496
|
-
if (!this.listenersByCommandName.has(commandName)) {
|
|
497
|
-
this.listenersByCommandName.set(commandName, new Set())
|
|
498
|
-
}
|
|
499
|
-
this.listenersByCommandName.get(commandName)!.add(listener)
|
|
500
|
-
const hasRegisteredCommandReceiver = !!this.cleanUp
|
|
501
|
-
if (!hasRegisteredCommandReceiver) {
|
|
502
|
-
this.cleanUp = this.componentCommandReceiver.registerCommandCallback(this.tag, (commandName: string, argv: any[]) => {
|
|
503
|
-
if (this.listenersByCommandName.has(commandName)) {
|
|
504
|
-
const listeners = this.listenersByCommandName.get(commandName)!
|
|
505
|
-
listeners.forEach(listener => {
|
|
506
|
-
listener(argv)
|
|
507
|
-
})
|
|
508
|
-
}
|
|
509
|
-
})
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
return () => {
|
|
513
|
-
this.listenersByCommandName.get(commandName)?.delete(listener)
|
|
514
|
-
if (this.listenersByCommandName.get(commandName)?.size ?? 0 === 0) {
|
|
515
|
-
this.listenersByCommandName.delete(commandName)
|
|
516
|
-
}
|
|
517
|
-
if (this.listenersByCommandName.size === 0) {
|
|
518
|
-
this.cleanUp?.()
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by "react-native codegen-lib-harmony"
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Descriptor as ComponentDescriptor,
|
|
7
|
+
ViewBaseProps,
|
|
8
|
+
ViewRawProps,
|
|
9
|
+
ViewDescriptorWrapperBase,
|
|
10
|
+
ColorValue,
|
|
11
|
+
Color,
|
|
12
|
+
RNInstance,
|
|
13
|
+
Tag,
|
|
14
|
+
RNComponentCommandReceiver,
|
|
15
|
+
ViewPropsSelector,
|
|
16
|
+
} from '@rnoh/react-native-openharmony/ts';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export namespace RNCWebView {
|
|
20
|
+
export const NAME = "RNCWebView" as const
|
|
21
|
+
|
|
22
|
+
export interface DirectRawProps {
|
|
23
|
+
allowFileAccess?: boolean;
|
|
24
|
+
allowsProtectedMedia?: boolean;
|
|
25
|
+
allowsFullscreenVideo?: boolean;
|
|
26
|
+
androidLayerType?: 'none' | 'software' | 'hardware';
|
|
27
|
+
cacheMode?: 'LOAD_DEFAULT' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE' | 'LOAD_CACHE_ONLY';
|
|
28
|
+
domStorageEnabled?: boolean;
|
|
29
|
+
downloadingMessage?: string;
|
|
30
|
+
forceDarkOn?: boolean;
|
|
31
|
+
geolocationEnabled?: boolean;
|
|
32
|
+
lackPermissionToDownloadMessage?: string;
|
|
33
|
+
messagingModuleName: string;
|
|
34
|
+
minimumFontSize?: number;
|
|
35
|
+
mixedContentMode?: 'never' | 'always' | 'compatibility';
|
|
36
|
+
nestedScrollEnabled?: boolean;
|
|
37
|
+
overScrollMode?: string;
|
|
38
|
+
saveFormDataDisabled?: boolean;
|
|
39
|
+
scalesPageToFit?: boolean;
|
|
40
|
+
setBuiltInZoomControls?: boolean;
|
|
41
|
+
setDisplayZoomControls?: boolean;
|
|
42
|
+
setSupportMultipleWindows?: boolean;
|
|
43
|
+
textZoom?: number;
|
|
44
|
+
thirdPartyCookiesEnabled?: boolean;
|
|
45
|
+
hasOnScroll?: boolean;
|
|
46
|
+
injectedJavaScriptObject?: string;
|
|
47
|
+
paymentRequestEnabled?: boolean;
|
|
48
|
+
allowingReadAccessToURL?: string;
|
|
49
|
+
allowsBackForwardNavigationGestures?: boolean;
|
|
50
|
+
allowsInlineMediaPlayback?: boolean;
|
|
51
|
+
allowsPictureInPictureMediaPlayback?: boolean;
|
|
52
|
+
allowsAirPlayForMediaPlayback?: boolean;
|
|
53
|
+
allowsLinkPreview?: boolean;
|
|
54
|
+
automaticallyAdjustContentInsets?: boolean;
|
|
55
|
+
ignoreSilentHardwareSwitch?: boolean;
|
|
56
|
+
autoManageStatusBarEnabled?: boolean;
|
|
57
|
+
bounces?: boolean;
|
|
58
|
+
contentInset?: {top?: number, left?: number, bottom?: number, right?: number};
|
|
59
|
+
contentInsetAdjustmentBehavior?: 'never' | 'automatic' | 'scrollableAxes' | 'always';
|
|
60
|
+
contentMode?: 'recommended' | 'mobile' | 'desktop';
|
|
61
|
+
dataDetectorTypes?: 'address' | 'link' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'phoneNumber' | 'all' | 'none'[];
|
|
62
|
+
decelerationRate?: number;
|
|
63
|
+
directionalLockEnabled?: boolean;
|
|
64
|
+
enableApplePay?: boolean;
|
|
65
|
+
hideKeyboardAccessoryView?: boolean;
|
|
66
|
+
keyboardDisplayRequiresUserAction?: boolean;
|
|
67
|
+
limitsNavigationsToAppBoundDomains?: boolean;
|
|
68
|
+
mediaCapturePermissionGrantType?: 'prompt' | 'grant' | 'deny' | 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny';
|
|
69
|
+
pagingEnabled?: boolean;
|
|
70
|
+
pullToRefreshEnabled?: boolean;
|
|
71
|
+
refreshControlLightMode?: boolean;
|
|
72
|
+
scrollEnabled?: boolean;
|
|
73
|
+
sharedCookiesEnabled?: boolean;
|
|
74
|
+
textInteractionEnabled?: boolean;
|
|
75
|
+
useSharedProcessPool?: boolean;
|
|
76
|
+
menuItems?: {label: string, key: string}[];
|
|
77
|
+
suppressMenuItems?: string[];
|
|
78
|
+
hasOnFileDownload?: boolean;
|
|
79
|
+
fraudulentWebsiteWarningEnabled?: boolean;
|
|
80
|
+
allowFileAccessFromFileURLs?: boolean;
|
|
81
|
+
allowUniversalAccessFromFileURLs?: boolean;
|
|
82
|
+
applicationNameForUserAgent?: string;
|
|
83
|
+
basicAuthCredential?: {username: string, password: string};
|
|
84
|
+
cacheEnabled?: boolean;
|
|
85
|
+
incognito?: boolean;
|
|
86
|
+
injectedJavaScript?: string;
|
|
87
|
+
injectedJavaScriptBeforeContentLoaded?: string;
|
|
88
|
+
injectedJavaScriptForMainFrameOnly?: boolean;
|
|
89
|
+
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
|
|
90
|
+
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
91
|
+
javaScriptEnabled?: boolean;
|
|
92
|
+
webviewDebuggingEnabled?: boolean;
|
|
93
|
+
mediaPlaybackRequiresUserAction?: boolean;
|
|
94
|
+
messagingEnabled: boolean;
|
|
95
|
+
shouldStartLoadWithRequestEnabled: boolean;
|
|
96
|
+
hasOnOpenWindowEvent?: boolean;
|
|
97
|
+
showsHorizontalScrollIndicator?: boolean;
|
|
98
|
+
showsVerticalScrollIndicator?: boolean;
|
|
99
|
+
indicatorStyle?: 'default' | 'black' | 'white';
|
|
100
|
+
newSource: {uri?: string, method?: string, body?: string, headers?: {name: string, value: string}[], html?: string, baseUrl?: string};
|
|
101
|
+
userAgent?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface Props extends ViewBaseProps {}
|
|
105
|
+
|
|
106
|
+
export interface State {}
|
|
107
|
+
|
|
108
|
+
export interface RawProps extends ViewRawProps, DirectRawProps {}
|
|
109
|
+
|
|
110
|
+
export class PropsSelector extends ViewPropsSelector<Props, RawProps> {
|
|
111
|
+
get allowFileAccess() {
|
|
112
|
+
return this.rawProps.allowFileAccess ?? false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
get allowsProtectedMedia() {
|
|
116
|
+
return this.rawProps.allowsProtectedMedia ?? false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
get allowsFullscreenVideo() {
|
|
120
|
+
return this.rawProps.allowsFullscreenVideo ?? false;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
get androidLayerType() {
|
|
124
|
+
return this.rawProps.androidLayerType ?? 'none';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
get cacheMode() {
|
|
128
|
+
return this.rawProps.cacheMode ?? 'LOAD_DEFAULT';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
get domStorageEnabled() {
|
|
132
|
+
return this.rawProps.domStorageEnabled ?? false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
get downloadingMessage() {
|
|
136
|
+
return this.rawProps.downloadingMessage;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
get forceDarkOn() {
|
|
140
|
+
return this.rawProps.forceDarkOn ?? false;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
get geolocationEnabled() {
|
|
144
|
+
return this.rawProps.geolocationEnabled ?? false;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
get lackPermissionToDownloadMessage() {
|
|
148
|
+
return this.rawProps.lackPermissionToDownloadMessage;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
get messagingModuleName() {
|
|
152
|
+
return this.rawProps.messagingModuleName;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
get minimumFontSize() {
|
|
156
|
+
return this.rawProps.minimumFontSize ?? 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
get mixedContentMode() {
|
|
160
|
+
return this.rawProps.mixedContentMode ?? 'never';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
get nestedScrollEnabled() {
|
|
164
|
+
return this.rawProps.nestedScrollEnabled ?? false;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
get overScrollMode() {
|
|
168
|
+
return this.rawProps.overScrollMode;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
get saveFormDataDisabled() {
|
|
172
|
+
return this.rawProps.saveFormDataDisabled ?? false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
get scalesPageToFit() {
|
|
176
|
+
return this.rawProps.scalesPageToFit ?? true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
get setBuiltInZoomControls() {
|
|
180
|
+
return this.rawProps.setBuiltInZoomControls ?? true;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
get setDisplayZoomControls() {
|
|
184
|
+
return this.rawProps.setDisplayZoomControls ?? false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
get setSupportMultipleWindows() {
|
|
188
|
+
return this.rawProps.setSupportMultipleWindows ?? true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
get textZoom() {
|
|
192
|
+
return this.rawProps.textZoom ?? 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
get thirdPartyCookiesEnabled() {
|
|
196
|
+
return this.rawProps.thirdPartyCookiesEnabled ?? true;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
get hasOnScroll() {
|
|
200
|
+
return this.rawProps.hasOnScroll ?? false;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
get injectedJavaScriptObject() {
|
|
204
|
+
return this.rawProps.injectedJavaScriptObject;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
get paymentRequestEnabled() {
|
|
208
|
+
return this.rawProps.paymentRequestEnabled ?? false;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
get allowingReadAccessToURL() {
|
|
212
|
+
return this.rawProps.allowingReadAccessToURL;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
get allowsBackForwardNavigationGestures() {
|
|
216
|
+
return this.rawProps.allowsBackForwardNavigationGestures ?? false;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
get allowsInlineMediaPlayback() {
|
|
220
|
+
return this.rawProps.allowsInlineMediaPlayback ?? false;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
get allowsPictureInPictureMediaPlayback() {
|
|
224
|
+
return this.rawProps.allowsPictureInPictureMediaPlayback ?? false;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
get allowsAirPlayForMediaPlayback() {
|
|
228
|
+
return this.rawProps.allowsAirPlayForMediaPlayback ?? false;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
get allowsLinkPreview() {
|
|
232
|
+
return this.rawProps.allowsLinkPreview ?? true;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
get automaticallyAdjustContentInsets() {
|
|
236
|
+
return this.rawProps.automaticallyAdjustContentInsets ?? true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
get ignoreSilentHardwareSwitch() {
|
|
240
|
+
return this.rawProps.ignoreSilentHardwareSwitch ?? false;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
get autoManageStatusBarEnabled() {
|
|
244
|
+
return this.rawProps.autoManageStatusBarEnabled ?? true;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
get bounces() {
|
|
248
|
+
return this.rawProps.bounces ?? true;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
get contentInset() {
|
|
252
|
+
return this.rawProps.contentInset;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
get contentInsetAdjustmentBehavior() {
|
|
256
|
+
return this.rawProps.contentInsetAdjustmentBehavior ?? 'never';
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
get contentMode() {
|
|
260
|
+
return this.rawProps.contentMode ?? 'recommended';
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
get dataDetectorTypes() {
|
|
264
|
+
return this.rawProps.dataDetectorTypes;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
get decelerationRate() {
|
|
268
|
+
return this.rawProps.decelerationRate ?? 0;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
get directionalLockEnabled() {
|
|
272
|
+
return this.rawProps.directionalLockEnabled ?? true;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
get enableApplePay() {
|
|
276
|
+
return this.rawProps.enableApplePay ?? false;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
get hideKeyboardAccessoryView() {
|
|
280
|
+
return this.rawProps.hideKeyboardAccessoryView ?? false;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
get keyboardDisplayRequiresUserAction() {
|
|
284
|
+
return this.rawProps.keyboardDisplayRequiresUserAction ?? true;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
get limitsNavigationsToAppBoundDomains() {
|
|
288
|
+
return this.rawProps.limitsNavigationsToAppBoundDomains ?? false;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
get mediaCapturePermissionGrantType() {
|
|
292
|
+
return this.rawProps.mediaCapturePermissionGrantType ?? 'prompt';
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
get pagingEnabled() {
|
|
296
|
+
return this.rawProps.pagingEnabled ?? false;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
get pullToRefreshEnabled() {
|
|
300
|
+
return this.rawProps.pullToRefreshEnabled ?? false;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
get refreshControlLightMode() {
|
|
304
|
+
return this.rawProps.refreshControlLightMode ?? false;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
get scrollEnabled() {
|
|
308
|
+
return this.rawProps.scrollEnabled ?? true;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
get sharedCookiesEnabled() {
|
|
312
|
+
return this.rawProps.sharedCookiesEnabled ?? false;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
get textInteractionEnabled() {
|
|
316
|
+
return this.rawProps.textInteractionEnabled ?? true;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
get useSharedProcessPool() {
|
|
320
|
+
return this.rawProps.useSharedProcessPool ?? true;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
get menuItems() {
|
|
324
|
+
return this.rawProps.menuItems;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
get suppressMenuItems() {
|
|
328
|
+
return this.rawProps.suppressMenuItems;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
get hasOnFileDownload() {
|
|
332
|
+
return this.rawProps.hasOnFileDownload ?? false;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
get fraudulentWebsiteWarningEnabled() {
|
|
336
|
+
return this.rawProps.fraudulentWebsiteWarningEnabled ?? true;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
get allowFileAccessFromFileURLs() {
|
|
340
|
+
return this.rawProps.allowFileAccessFromFileURLs ?? false;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
get allowUniversalAccessFromFileURLs() {
|
|
344
|
+
return this.rawProps.allowUniversalAccessFromFileURLs ?? false;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
get applicationNameForUserAgent() {
|
|
348
|
+
return this.rawProps.applicationNameForUserAgent;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
get basicAuthCredential() {
|
|
352
|
+
return this.rawProps.basicAuthCredential;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
get cacheEnabled() {
|
|
356
|
+
return this.rawProps.cacheEnabled ?? true;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
get incognito() {
|
|
360
|
+
return this.rawProps.incognito ?? false;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
get injectedJavaScript() {
|
|
364
|
+
return this.rawProps.injectedJavaScript;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
get injectedJavaScriptBeforeContentLoaded() {
|
|
368
|
+
return this.rawProps.injectedJavaScriptBeforeContentLoaded;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
get injectedJavaScriptForMainFrameOnly() {
|
|
372
|
+
return this.rawProps.injectedJavaScriptForMainFrameOnly ?? true;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
get injectedJavaScriptBeforeContentLoadedForMainFrameOnly() {
|
|
376
|
+
return this.rawProps.injectedJavaScriptBeforeContentLoadedForMainFrameOnly ?? true;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
get javaScriptCanOpenWindowsAutomatically() {
|
|
380
|
+
return this.rawProps.javaScriptCanOpenWindowsAutomatically ?? false;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
get javaScriptEnabled() {
|
|
384
|
+
return this.rawProps.javaScriptEnabled ?? true;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
get webviewDebuggingEnabled() {
|
|
388
|
+
return this.rawProps.webviewDebuggingEnabled ?? false;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
get mediaPlaybackRequiresUserAction() {
|
|
392
|
+
return this.rawProps.mediaPlaybackRequiresUserAction ?? true;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
get messagingEnabled() {
|
|
396
|
+
return this.rawProps.messagingEnabled ?? false;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
get shouldStartLoadWithRequestEnabled() {
|
|
400
|
+
return this.rawProps.shouldStartLoadWithRequestEnabled ?? false;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
get hasOnOpenWindowEvent() {
|
|
404
|
+
return this.rawProps.hasOnOpenWindowEvent ?? false;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
get showsHorizontalScrollIndicator() {
|
|
408
|
+
return this.rawProps.showsHorizontalScrollIndicator ?? true;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
get showsVerticalScrollIndicator() {
|
|
412
|
+
return this.rawProps.showsVerticalScrollIndicator ?? true;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
get indicatorStyle() {
|
|
416
|
+
return this.rawProps.indicatorStyle ?? 'default';
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
get newSource() {
|
|
420
|
+
return this.rawProps.newSource;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
get userAgent() {
|
|
424
|
+
return this.rawProps.userAgent;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export type Descriptor = ComponentDescriptor<
|
|
431
|
+
typeof NAME,
|
|
432
|
+
Props,
|
|
433
|
+
State,
|
|
434
|
+
RawProps
|
|
435
|
+
>;
|
|
436
|
+
|
|
437
|
+
export class DescriptorWrapper extends ViewDescriptorWrapperBase<
|
|
438
|
+
typeof NAME,
|
|
439
|
+
Props,
|
|
440
|
+
State,
|
|
441
|
+
RawProps,
|
|
442
|
+
PropsSelector
|
|
443
|
+
> {
|
|
444
|
+
protected createPropsSelector() {
|
|
445
|
+
return new PropsSelector(this.descriptor.props, this.descriptor.rawProps)
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface EventPayloadByName {
|
|
450
|
+
"contentSizeChange": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number}
|
|
451
|
+
"renderProcessGone": {didCrash: boolean}
|
|
452
|
+
"contentProcessDidTerminate": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number}
|
|
453
|
+
"customMenuSelection": {label: string, key: string, selectedText: string}
|
|
454
|
+
"fileDownload": {downloadUrl: string}
|
|
455
|
+
"loadingError": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, domain?: string, code: number, description: string}
|
|
456
|
+
"loadingFinish": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other', mainDocumentURL?: string}
|
|
457
|
+
"loadingProgress": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, progress: number}
|
|
458
|
+
"loadingStart": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other', mainDocumentURL?: string}
|
|
459
|
+
"httpError": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, description: string, statusCode: number}
|
|
460
|
+
"message": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, data: string}
|
|
461
|
+
"openWindow": {targetUrl: string}
|
|
462
|
+
"scroll": {contentInset: {bottom: number, left: number, right: number, top: number}, contentOffset: {y: number, x: number}, contentSize: {height: number, width: number}, layoutMeasurement: {height: number, width: number}, targetContentOffset?: {y: number, x: number}, velocity?: {y: number, x: number}, zoomScale?: number, responderIgnoreScroll?: boolean}
|
|
463
|
+
"shouldStartLoadWithRequest": {url: string, loading: boolean, title: string, canGoBack: boolean, canGoForward: boolean, lockIdentifier: number, navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other', mainDocumentURL?: string, isTopFrame: boolean}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export class EventEmitter {
|
|
467
|
+
constructor(private rnInstance: RNInstance, private tag: Tag) {}
|
|
468
|
+
|
|
469
|
+
emit<TEventName extends keyof EventPayloadByName>(eventName: TEventName, payload: EventPayloadByName[TEventName]) {
|
|
470
|
+
this.rnInstance.emitComponentEvent(this.tag, eventName, payload)
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export interface CommandArgvByName {
|
|
475
|
+
"goBack": []
|
|
476
|
+
"goForward": []
|
|
477
|
+
"reload": []
|
|
478
|
+
"stopLoading": []
|
|
479
|
+
"injectJavaScript": [string]
|
|
480
|
+
"requestFocus": []
|
|
481
|
+
"postMessage": [string]
|
|
482
|
+
"loadUrl": [string]
|
|
483
|
+
"clearFormData": []
|
|
484
|
+
"clearCache": [boolean]
|
|
485
|
+
"clearHistory": []
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export class CommandReceiver {
|
|
489
|
+
private listenersByCommandName = new Map<string, Set<(...args: any[]) => void>>()
|
|
490
|
+
private cleanUp: (() => void) | undefined = undefined
|
|
491
|
+
|
|
492
|
+
constructor(private componentCommandReceiver: RNComponentCommandReceiver, private tag: Tag) {
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
subscribe<TCommandName extends keyof CommandArgvByName>(commandName: TCommandName, listener: (argv: CommandArgvByName[TCommandName]) => void) {
|
|
496
|
+
if (!this.listenersByCommandName.has(commandName)) {
|
|
497
|
+
this.listenersByCommandName.set(commandName, new Set())
|
|
498
|
+
}
|
|
499
|
+
this.listenersByCommandName.get(commandName)!.add(listener)
|
|
500
|
+
const hasRegisteredCommandReceiver = !!this.cleanUp
|
|
501
|
+
if (!hasRegisteredCommandReceiver) {
|
|
502
|
+
this.cleanUp = this.componentCommandReceiver.registerCommandCallback(this.tag, (commandName: string, argv: any[]) => {
|
|
503
|
+
if (this.listenersByCommandName.has(commandName)) {
|
|
504
|
+
const listeners = this.listenersByCommandName.get(commandName)!
|
|
505
|
+
listeners.forEach(listener => {
|
|
506
|
+
listener(argv)
|
|
507
|
+
})
|
|
508
|
+
}
|
|
509
|
+
})
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
return () => {
|
|
513
|
+
this.listenersByCommandName.get(commandName)?.delete(listener)
|
|
514
|
+
if (this.listenersByCommandName.get(commandName)?.size ?? 0 === 0) {
|
|
515
|
+
this.listenersByCommandName.delete(commandName)
|
|
516
|
+
}
|
|
517
|
+
if (this.listenersByCommandName.size === 0) {
|
|
518
|
+
this.cleanUp?.()
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
}
|