react-native-webview-bootpay 13.8.41 → 13.13.4-4.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +53 -69
  2. package/android/build.gradle +1 -11
  3. package/android/gradle.properties +5 -47
  4. package/android/src/main/AndroidManifest.xml +9 -5
  5. package/android/src/main/AndroidManifestNew.xml +97 -0
  6. package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +57 -11
  7. package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +101 -68
  8. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +70 -56
  9. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +119 -65
  10. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewMessagingModule.kt +9 -0
  11. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +1 -1
  12. package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +91 -75
  13. package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewManager.java +118 -109
  14. package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewModule.java +1 -1
  15. package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewManager.java +63 -58
  16. package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewModule.java +1 -1
  17. package/apple/BPCWebView.mm +21 -12
  18. package/apple/BPCWebViewImpl.h +10 -0
  19. package/apple/BPCWebViewImpl.m +267 -205
  20. package/apple/BPCWebViewManager.mm +5 -24
  21. package/apple/BPCWebViewModule.h +23 -0
  22. package/apple/BPCWebViewModule.mm +34 -0
  23. package/apple/RCTConvert+WKDataDetectorTypes.h +11 -0
  24. package/apple/RCTConvert+WKDataDetectorTypes.m +27 -0
  25. package/index.d.ts +54 -48
  26. package/ios/RNCWebView.xcodeproj/project.pbxproj +24 -24
  27. package/ios/RNCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  28. package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/taesupyoon.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  29. package/ios/RNCWebView.xcodeproj/xcuserdata/taesupyoon.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  30. package/lib/BPCWebViewNativeComponent.d.ts +24 -25
  31. package/lib/BPCWebViewNativeComponent.js +1 -1
  32. package/lib/{NativeBPCWebView.d.ts → NativeBPCWebViewModule.d.ts} +2 -5
  33. package/lib/{NativeBPCWebView.js → NativeBPCWebViewModule.js} +1 -1
  34. package/lib/WebView.android.d.ts +0 -1
  35. package/lib/WebView.android.js +1 -1
  36. package/lib/WebView.d.ts +0 -1
  37. package/lib/WebView.ios.d.ts +0 -1
  38. package/lib/WebView.ios.js +1 -1
  39. package/lib/WebView.js +1 -1
  40. package/lib/WebView.macos.d.ts +0 -1
  41. package/lib/WebView.macos.js +1 -1
  42. package/lib/WebView.styles.d.ts +37 -11
  43. package/lib/WebView.styles.js +1 -1
  44. package/lib/WebView.windows.d.ts +0 -1
  45. package/lib/WebView.windows.js +1 -1
  46. package/lib/WebViewNativeComponent.macos.d.ts +1 -2
  47. package/lib/WebViewNativeComponent.windows.d.ts +1 -2
  48. package/lib/WebViewShared.d.ts +0 -1
  49. package/lib/WebViewShared.js +1 -1
  50. package/lib/WebViewTypes.d.ts +51 -3
  51. package/lib/WebViewTypes.js +1 -1
  52. package/lib/index.d.ts +0 -1
  53. package/macos/RNCWebView.xcodeproj/project.pbxproj +36 -36
  54. package/package.json +12 -11
  55. package/react-native-webview-bootpay.podspec +2 -2
  56. package/react-native.config.js +1 -5
  57. package/src/BPCWebViewNativeComponent.ts +143 -79
  58. package/src/NativeBPCWebViewModule.ts +13 -0
  59. package/src/WebView.android.tsx +295 -190
  60. package/src/WebView.ios.tsx +253 -186
  61. package/src/WebView.macos.tsx +220 -152
  62. package/src/WebView.styles.ts +9 -12
  63. package/src/WebView.tsx +14 -7
  64. package/src/WebView.windows.tsx +180 -126
  65. package/src/WebViewNativeComponent.macos.ts +4 -5
  66. package/src/WebViewNativeComponent.windows.ts +6 -8
  67. package/src/WebViewShared.tsx +139 -91
  68. package/src/WebViewTypes.ts +80 -35
  69. package/src/__tests__/WebViewShared-test.js +170 -55
  70. package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +8 -17
  71. package/windows/ReactNativeWebView/ReactPackageProvider.cpp +5 -1
  72. package/windows/ReactNativeWebView/ReactWebView.cpp +73 -6
  73. package/windows/ReactNativeWebView/ReactWebView.h +11 -1
  74. package/windows/ReactNativeWebView/ReactWebView.idl +12 -3
  75. package/windows/ReactNativeWebView/ReactWebView2.cpp +294 -129
  76. package/windows/ReactNativeWebView/ReactWebView2.h +42 -5
  77. package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +60 -34
  78. package/windows/ReactNativeWebView/ReactWebView2Manager.h +4 -4
  79. package/windows/ReactNativeWebView/ReactWebViewHelpers.cpp +70 -0
  80. package/windows/ReactNativeWebView/ReactWebViewHelpers.h +16 -0
  81. package/windows/ReactNativeWebView/ReactWebViewManager.cpp +22 -3
  82. package/windows/ReactNativeWebView/ReactWebViewManager.h +6 -1
  83. package/windows/ReactNativeWebView/pch.h +11 -7
  84. package/windows/ReactNativeWebView.sln +14 -14
  85. package/ios/main.jsbundle +0 -457
  86. package/lib/BPCWebViewNativeComponent.d.ts.map +0 -1
  87. package/lib/NativeBPCWebView.d.ts.map +0 -1
  88. package/lib/WebView.android.d.ts.map +0 -1
  89. package/lib/WebView.d.ts.map +0 -1
  90. package/lib/WebView.ios.d.ts.map +0 -1
  91. package/lib/WebView.macos.d.ts.map +0 -1
  92. package/lib/WebView.styles.d.ts.map +0 -1
  93. package/lib/WebView.windows.d.ts.map +0 -1
  94. package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
  95. package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
  96. package/lib/WebViewShared.d.ts.map +0 -1
  97. package/lib/WebViewTypes.d.ts.map +0 -1
  98. package/lib/index.d.ts.map +0 -1
  99. package/src/NativeBPCWebView.ts +0 -14
  100. package/windows/ReactNativeWebView/packages.config +0 -5
  101. /package/android/src/main/java/kr/co/bootpay/webview/{BPCWebviewWrapper.kt → BPCWebViewWrapper.kt} +0 -0
@@ -1,14 +1,14 @@
1
- import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
2
- import {
3
- Image,
4
- View,
5
- ImageSourcePropType,
6
- HostComponent,
7
- } from 'react-native';
1
+ import React, {
2
+ forwardRef,
3
+ useCallback,
4
+ useImperativeHandle,
5
+ useRef,
6
+ } from 'react';
7
+ import { Image, View, ImageSourcePropType, HostComponent } from 'react-native';
8
8
  import invariant from 'invariant';
9
9
 
10
- import BPCWebView, {Commands, NativeProps} from "./BPCWebViewNativeComponent";
11
- import BPCWebViewModule from "./NativeBPCWebView";
10
+ import BPCWebView, { Commands, NativeProps } from './BPCWebViewNativeComponent';
11
+ import BPCWebViewModule from './NativeBPCWebViewModule';
12
12
 
13
13
  import {
14
14
  defaultOriginWhitelist,
@@ -24,11 +24,9 @@ import {
24
24
 
25
25
  import styles from './WebView.styles';
26
26
 
27
-
28
-
29
27
  const { resolveAssetSource } = Image;
30
28
  const processDecelerationRate = (
31
- decelerationRate: DecelerationRateConstant | number | undefined,
29
+ decelerationRate: DecelerationRateConstant | number | undefined
32
30
  ) => {
33
31
  let newDecelerationRate = decelerationRate;
34
32
  if (newDecelerationRate === 'normal') {
@@ -42,191 +40,260 @@ const processDecelerationRate = (
42
40
  const useWarnIfChanges = <T extends unknown>(value: T, name: string) => {
43
41
  const ref = useRef(value);
44
42
  if (ref.current !== value) {
45
- console.warn(`Changes to property ${name} do nothing after the initial render.`);
43
+ console.warn(
44
+ `Changes to property ${name} do nothing after the initial render.`
45
+ );
46
46
  ref.current = value;
47
47
  }
48
- }
49
-
50
- const WebViewComponent = forwardRef<{}, IOSWebViewProps>(({
51
- fraudulentWebsiteWarningEnabled = true,
52
- javaScriptEnabled = true,
53
- cacheEnabled = true,
54
- originWhitelist = defaultOriginWhitelist,
55
- useSharedProcessPool= true,
56
- textInteractionEnabled= true,
57
- injectedJavaScript,
58
- injectedJavaScriptBeforeContentLoaded,
59
- injectedJavaScriptForMainFrameOnly = true,
60
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly = true,
61
- startInLoadingState,
62
- onNavigationStateChange,
63
- onLoadStart,
64
- onError,
65
- onLoad,
66
- onLoadEnd,
67
- onLoadProgress,
68
- onContentProcessDidTerminate: onContentProcessDidTerminateProp,
69
- onFileDownload,
70
- onHttpError: onHttpErrorProp,
71
- onMessage: onMessageProp,
72
- onOpenWindow: onOpenWindowProp,
73
- renderLoading,
74
- renderError,
75
- style,
76
- containerStyle,
77
- source,
78
- nativeConfig,
79
- allowsInlineMediaPlayback,
80
- allowsAirPlayForMediaPlayback,
81
- mediaPlaybackRequiresUserAction,
82
- dataDetectorTypes,
83
- incognito,
84
- decelerationRate: decelerationRateProp,
85
- onShouldStartLoadWithRequest: onShouldStartLoadWithRequestProp,
86
- ...otherProps
87
- }, ref) => {
88
- const webViewRef = useRef<React.ComponentRef<HostComponent<NativeProps>> | null>(null);
89
-
90
- const onShouldStartLoadWithRequestCallback = useCallback((
91
- shouldStart: boolean,
92
- _url: string,
93
- lockIdentifier = 0,
94
- ) => {
95
- BPCWebViewModule.shouldStartLoadWithLockIdentifier(shouldStart, lockIdentifier);
96
- }, []);
97
-
98
- const { onLoadingStart, onShouldStartLoadWithRequest, onMessage, viewState, setViewState, lastErrorEvent, onHttpError, onLoadingError, onLoadingFinish, onLoadingProgress, onOpenWindow, onContentProcessDidTerminate } = useWebViewLogic({
99
- onNavigationStateChange,
100
- onLoad,
101
- onError,
102
- onHttpErrorProp,
103
- onLoadEnd,
104
- onLoadProgress,
105
- onLoadStart,
106
- onMessageProp,
107
- onOpenWindowProp,
108
- startInLoadingState,
109
- originWhitelist,
110
- onShouldStartLoadWithRequestProp,
111
- onShouldStartLoadWithRequestCallback,
112
- onContentProcessDidTerminateProp,
113
- });
114
-
115
- useImperativeHandle(ref, () => ({
116
- goForward: () => webViewRef.current && Commands.goForward(webViewRef.current),
117
- goBack: () => webViewRef.current && Commands.goBack(webViewRef.current),
118
- reload: () => {
119
- setViewState(
120
- 'LOADING',
121
- );
122
- if (webViewRef.current) {
123
- Commands.reload(webViewRef.current)
124
- }
48
+ };
49
+
50
+ const WebViewComponent = forwardRef<{}, IOSWebViewProps>(
51
+ (
52
+ {
53
+ fraudulentWebsiteWarningEnabled = true,
54
+ javaScriptEnabled = true,
55
+ cacheEnabled = true,
56
+ originWhitelist = defaultOriginWhitelist,
57
+ useSharedProcessPool = true,
58
+ textInteractionEnabled = true,
59
+ injectedJavaScript,
60
+ injectedJavaScriptBeforeContentLoaded,
61
+ injectedJavaScriptForMainFrameOnly = true,
62
+ injectedJavaScriptBeforeContentLoadedForMainFrameOnly = true,
63
+ injectedJavaScriptObject,
64
+ startInLoadingState,
65
+ onNavigationStateChange,
66
+ onLoadStart,
67
+ onError,
68
+ onLoad,
69
+ onLoadEnd,
70
+ onLoadProgress,
71
+ onContentProcessDidTerminate: onContentProcessDidTerminateProp,
72
+ onFileDownload,
73
+ onHttpError: onHttpErrorProp,
74
+ onMessage: onMessageProp,
75
+ onOpenWindow: onOpenWindowProp,
76
+ renderLoading,
77
+ renderError,
78
+ style,
79
+ containerStyle,
80
+ source,
81
+ nativeConfig,
82
+ allowsInlineMediaPlayback,
83
+ allowsPictureInPictureMediaPlayback = true,
84
+ allowsAirPlayForMediaPlayback,
85
+ mediaPlaybackRequiresUserAction,
86
+ dataDetectorTypes,
87
+ incognito,
88
+ decelerationRate: decelerationRateProp,
89
+ onShouldStartLoadWithRequest: onShouldStartLoadWithRequestProp,
90
+ ...otherProps
125
91
  },
126
- stopLoading: () => webViewRef.current && Commands.stopLoading(webViewRef.current),
127
- postMessage: (data: string) => webViewRef.current && Commands.postMessage(webViewRef.current, data),
128
- injectJavaScript: (data: string) => webViewRef.current && Commands.injectJavaScript(webViewRef.current, data),
129
- requestFocus: () => webViewRef.current && Commands.requestFocus(webViewRef.current),
130
- clearCache: (includeDiskFiles: boolean) => webViewRef.current && Commands.clearCache(webViewRef.current, includeDiskFiles),
131
- }), [setViewState, webViewRef]);
132
-
133
-
134
- useWarnIfChanges(allowsInlineMediaPlayback, 'allowsInlineMediaPlayback');
135
- useWarnIfChanges(allowsAirPlayForMediaPlayback, 'allowsAirPlayForMediaPlayback');
136
- useWarnIfChanges(incognito, 'incognito');
137
- useWarnIfChanges(mediaPlaybackRequiresUserAction, 'mediaPlaybackRequiresUserAction');
138
- useWarnIfChanges(dataDetectorTypes, 'dataDetectorTypes');
139
-
140
- let otherView = null;
141
- if (viewState === 'LOADING') {
142
- otherView = (renderLoading || defaultRenderLoading)();
143
- } else if (viewState === 'ERROR') {
144
- invariant(lastErrorEvent != null, 'lastErrorEvent expected to be non-null');
145
- otherView = (renderError || defaultRenderError)(
146
- lastErrorEvent?.domain,
147
- lastErrorEvent?.code ?? 0,
148
- lastErrorEvent?.description ?? '',
92
+ ref
93
+ ) => {
94
+ const webViewRef = useRef<React.ComponentRef<
95
+ HostComponent<NativeProps>
96
+ > | null>(null);
97
+
98
+ const onShouldStartLoadWithRequestCallback = useCallback(
99
+ (shouldStart: boolean, _url: string, lockIdentifier = 0) => {
100
+ BPCWebViewModule.shouldStartLoadWithLockIdentifier(
101
+ shouldStart,
102
+ lockIdentifier
103
+ );
104
+ },
105
+ []
149
106
  );
150
- } else if (viewState !== 'IDLE') {
151
- console.error(`BPCWebView invalid state encountered: ${viewState}`);
152
- }
153
107
 
154
- const webViewStyles = [styles.container, styles.webView, style];
155
- const webViewContainerStyle = [styles.container, containerStyle];
108
+ const {
109
+ onLoadingStart,
110
+ onShouldStartLoadWithRequest,
111
+ onMessage,
112
+ viewState,
113
+ setViewState,
114
+ lastErrorEvent,
115
+ onHttpError,
116
+ onLoadingError,
117
+ onLoadingFinish,
118
+ onLoadingProgress,
119
+ onOpenWindow,
120
+ onContentProcessDidTerminate,
121
+ } = useWebViewLogic({
122
+ onNavigationStateChange,
123
+ onLoad,
124
+ onError,
125
+ onHttpErrorProp,
126
+ onLoadEnd,
127
+ onLoadProgress,
128
+ onLoadStart,
129
+ onMessageProp,
130
+ onOpenWindowProp,
131
+ startInLoadingState,
132
+ originWhitelist,
133
+ onShouldStartLoadWithRequestProp,
134
+ onShouldStartLoadWithRequestCallback,
135
+ onContentProcessDidTerminateProp,
136
+ });
156
137
 
157
- const decelerationRate = processDecelerationRate(decelerationRateProp);
138
+ useImperativeHandle(
139
+ ref,
140
+ () => ({
141
+ goForward: () =>
142
+ webViewRef.current && Commands.goForward(webViewRef.current),
143
+ goBack: () => webViewRef.current && Commands.goBack(webViewRef.current),
144
+ reload: () => {
145
+ setViewState('LOADING');
146
+ if (webViewRef.current) {
147
+ Commands.reload(webViewRef.current);
148
+ }
149
+ },
150
+ stopLoading: () =>
151
+ webViewRef.current && Commands.stopLoading(webViewRef.current),
152
+ postMessage: (data: string) =>
153
+ webViewRef.current && Commands.postMessage(webViewRef.current, data),
154
+ injectJavaScript: (data: string) =>
155
+ webViewRef.current &&
156
+ Commands.injectJavaScript(webViewRef.current, data),
157
+ requestFocus: () =>
158
+ webViewRef.current && Commands.requestFocus(webViewRef.current),
159
+ clearCache: (includeDiskFiles: boolean) =>
160
+ webViewRef.current &&
161
+ Commands.clearCache(webViewRef.current, includeDiskFiles),
162
+ }),
163
+ [setViewState, webViewRef]
164
+ );
158
165
 
159
- const NativeWebView
160
- = (nativeConfig?.component as typeof BPCWebView | undefined)
161
- || BPCWebView;
166
+ useWarnIfChanges(allowsInlineMediaPlayback, 'allowsInlineMediaPlayback');
167
+ useWarnIfChanges(
168
+ allowsPictureInPictureMediaPlayback,
169
+ 'allowsPictureInPictureMediaPlayback'
170
+ );
171
+ useWarnIfChanges(
172
+ allowsAirPlayForMediaPlayback,
173
+ 'allowsAirPlayForMediaPlayback'
174
+ );
175
+ useWarnIfChanges(incognito, 'incognito');
176
+ useWarnIfChanges(
177
+ mediaPlaybackRequiresUserAction,
178
+ 'mediaPlaybackRequiresUserAction'
179
+ );
180
+ useWarnIfChanges(dataDetectorTypes, 'dataDetectorTypes');
162
181
 
163
- const sourceResolved = resolveAssetSource(source as ImageSourcePropType)
164
- const newSource = typeof sourceResolved === "object" ? Object.entries(sourceResolved as WebViewSourceUri).reduce((prev, [currKey, currValue]) => {
165
- return {
166
- ...prev,
167
- [currKey]: currKey === "headers" && currValue && typeof currValue === "object" ? Object.entries(currValue).map(
168
- ([key, value]) => {
169
- return {
170
- name: key,
171
- value
172
- }
173
- }) : currValue
182
+ let otherView = null;
183
+ if (viewState === 'LOADING') {
184
+ otherView = (renderLoading || defaultRenderLoading)();
185
+ } else if (viewState === 'ERROR') {
186
+ invariant(
187
+ lastErrorEvent != null,
188
+ 'lastErrorEvent expected to be non-null'
189
+ );
190
+ otherView = (renderError || defaultRenderError)(
191
+ lastErrorEvent?.domain,
192
+ lastErrorEvent?.code ?? 0,
193
+ lastErrorEvent?.description ?? ''
194
+ );
195
+ } else if (viewState !== 'IDLE') {
196
+ console.error(`BPCWebView invalid state encountered: ${viewState}`);
174
197
  }
175
- }, {}) : sourceResolved
176
-
177
- const webView = (
178
- <NativeWebView
179
- key="webViewKey"
180
- {...otherProps}
181
- fraudulentWebsiteWarningEnabled={fraudulentWebsiteWarningEnabled}
182
- javaScriptEnabled={javaScriptEnabled}
183
- cacheEnabled={cacheEnabled}
184
- useSharedProcessPool={useSharedProcessPool}
185
- textInteractionEnabled={textInteractionEnabled}
186
- decelerationRate={decelerationRate}
187
- messagingEnabled={typeof onMessageProp === 'function'}
188
- messagingModuleName="" // android ONLY
189
- onLoadingError={onLoadingError}
190
- onLoadingFinish={onLoadingFinish}
191
- onLoadingProgress={onLoadingProgress}
192
- onFileDownload={onFileDownload}
193
- onLoadingStart={onLoadingStart}
194
- onHttpError={onHttpError}
195
- onMessage={onMessage}
196
- onOpenWindow={onOpenWindowProp && onOpenWindow}
197
- hasOnOpenWindowEvent={onOpenWindowProp !== undefined}
198
- onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
199
- onContentProcessDidTerminate={onContentProcessDidTerminate}
200
- injectedJavaScript={injectedJavaScript}
201
- injectedJavaScriptBeforeContentLoaded={injectedJavaScriptBeforeContentLoaded}
202
- injectedJavaScriptForMainFrameOnly={injectedJavaScriptForMainFrameOnly}
203
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly={injectedJavaScriptBeforeContentLoadedForMainFrameOnly}
204
- dataDetectorTypes={!dataDetectorTypes || Array.isArray(dataDetectorTypes) ? dataDetectorTypes : [dataDetectorTypes]}
205
- allowsAirPlayForMediaPlayback={allowsAirPlayForMediaPlayback}
206
- allowsInlineMediaPlayback={allowsInlineMediaPlayback}
207
- incognito={incognito}
208
- mediaPlaybackRequiresUserAction={mediaPlaybackRequiresUserAction}
209
- newSource={newSource}
210
- style={webViewStyles}
211
- hasOnFileDownload={!!onFileDownload}
212
- ref={webViewRef}
213
- // @ts-expect-error old arch only
214
- source={sourceResolved}
215
- {...nativeConfig?.props}
216
- />
217
- );
218
-
219
- return (
220
- <View style={webViewContainerStyle}>
221
- {webView}
222
- {otherView}
223
- </View>
224
- );})
198
+
199
+ const webViewStyles = [styles.container, styles.webView, style];
200
+ const webViewContainerStyle = [styles.container, containerStyle];
201
+
202
+ const decelerationRate = processDecelerationRate(decelerationRateProp);
203
+
204
+ const NativeWebView =
205
+ (nativeConfig?.component as typeof BPCWebView | undefined) || BPCWebView;
206
+
207
+ const sourceResolved = resolveAssetSource(source as ImageSourcePropType);
208
+ const newSource =
209
+ typeof sourceResolved === 'object'
210
+ ? Object.entries(sourceResolved as WebViewSourceUri).reduce(
211
+ (prev, [currKey, currValue]) => {
212
+ return {
213
+ ...prev,
214
+ [currKey]:
215
+ currKey === 'headers' &&
216
+ currValue &&
217
+ typeof currValue === 'object'
218
+ ? Object.entries(currValue).map(([key, value]) => {
219
+ return {
220
+ name: key,
221
+ value,
222
+ };
223
+ })
224
+ : currValue,
225
+ };
226
+ },
227
+ {}
228
+ )
229
+ : sourceResolved;
230
+
231
+ const webView = (
232
+ <NativeWebView
233
+ key="webViewKey"
234
+ {...otherProps}
235
+ fraudulentWebsiteWarningEnabled={fraudulentWebsiteWarningEnabled}
236
+ javaScriptEnabled={javaScriptEnabled}
237
+ cacheEnabled={cacheEnabled}
238
+ useSharedProcessPool={useSharedProcessPool}
239
+ textInteractionEnabled={textInteractionEnabled}
240
+ decelerationRate={decelerationRate}
241
+ messagingEnabled={typeof onMessageProp === 'function'}
242
+ messagingModuleName="" // android ONLY
243
+ onLoadingError={onLoadingError}
244
+ onLoadingFinish={onLoadingFinish}
245
+ onLoadingProgress={onLoadingProgress}
246
+ onFileDownload={onFileDownload}
247
+ onLoadingStart={onLoadingStart}
248
+ onHttpError={onHttpError}
249
+ onMessage={onMessage}
250
+ onOpenWindow={onOpenWindowProp && onOpenWindow}
251
+ hasOnOpenWindowEvent={onOpenWindowProp !== undefined}
252
+ onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
253
+ onContentProcessDidTerminate={onContentProcessDidTerminate}
254
+ injectedJavaScript={injectedJavaScript}
255
+ injectedJavaScriptBeforeContentLoaded={
256
+ injectedJavaScriptBeforeContentLoaded
257
+ }
258
+ injectedJavaScriptForMainFrameOnly={injectedJavaScriptForMainFrameOnly}
259
+ injectedJavaScriptBeforeContentLoadedForMainFrameOnly={
260
+ injectedJavaScriptBeforeContentLoadedForMainFrameOnly
261
+ }
262
+ injectedJavaScriptObject={JSON.stringify(injectedJavaScriptObject)}
263
+ dataDetectorTypes={
264
+ !dataDetectorTypes || Array.isArray(dataDetectorTypes)
265
+ ? dataDetectorTypes
266
+ : [dataDetectorTypes]
267
+ }
268
+ allowsAirPlayForMediaPlayback={allowsAirPlayForMediaPlayback}
269
+ allowsInlineMediaPlayback={allowsInlineMediaPlayback}
270
+ allowsPictureInPictureMediaPlayback={
271
+ allowsPictureInPictureMediaPlayback
272
+ }
273
+ incognito={incognito}
274
+ mediaPlaybackRequiresUserAction={mediaPlaybackRequiresUserAction}
275
+ newSource={newSource}
276
+ style={webViewStyles}
277
+ hasOnFileDownload={!!onFileDownload}
278
+ ref={webViewRef}
279
+ // @ts-expect-error old arch only
280
+ source={sourceResolved}
281
+ {...nativeConfig?.props}
282
+ />
283
+ );
284
+
285
+ return (
286
+ <View style={webViewContainerStyle}>
287
+ {webView}
288
+ {otherView}
289
+ </View>
290
+ );
291
+ }
292
+ );
225
293
 
226
294
  // no native implementation for iOS, depends only on permissions
227
- const isFileUploadSupported: () => Promise<boolean>
228
- = async () => true;
295
+ const isFileUploadSupported: () => Promise<boolean> = async () => true;
229
296
 
230
- const WebView = Object.assign(WebViewComponent, {isFileUploadSupported});
297
+ const WebView = Object.assign(WebViewComponent, { isFileUploadSupported });
231
298
 
232
299
  export default WebView;