react-native-webview-bootpay 13.8.42 → 13.13.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/README.md +53 -69
- package/android/build.gradle +1 -11
- package/android/gradle.properties +0 -42
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/AndroidManifestNew.xml +13 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +54 -10
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +101 -68
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +68 -60
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +119 -65
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewMessagingModule.kt +9 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +4 -12
- package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewManager.java +118 -109
- package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewModule.java +1 -1
- package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewManager.java +63 -58
- package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewModule.java +1 -1
- package/apple/BPCWebView.mm +21 -12
- package/apple/BPCWebViewImpl.h +11 -1
- package/apple/BPCWebViewImpl.m +278 -216
- package/apple/BPCWebViewManager.mm +5 -24
- package/apple/BPCWebViewModule.h +23 -0
- package/apple/BPCWebViewModule.mm +34 -0
- package/apple/RCTConvert+WKDataDetectorTypes.h +11 -0
- package/apple/RCTConvert+WKDataDetectorTypes.m +27 -0
- package/ios/RNCWebView.xcodeproj/project.pbxproj +24 -24
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/taesupyoon.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNCWebView.xcodeproj/xcuserdata/taesupyoon.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/BPCWebViewNativeComponent.d.ts +24 -25
- package/lib/BPCWebViewNativeComponent.js +1 -1
- package/lib/{NativeBPCWebView.d.ts → NativeBPCWebViewModule.d.ts} +2 -5
- package/lib/{NativeBPCWebView.js → NativeBPCWebViewModule.js} +1 -1
- package/lib/WebView.android.d.ts +0 -1
- package/lib/WebView.android.js +1 -1
- package/lib/WebView.d.ts +0 -1
- package/lib/WebView.ios.d.ts +0 -1
- package/lib/WebView.ios.js +1 -1
- package/lib/WebView.js +1 -1
- package/lib/WebView.macos.d.ts +0 -1
- package/lib/WebView.macos.js +1 -1
- package/lib/WebView.styles.d.ts +37 -11
- package/lib/WebView.styles.js +1 -1
- package/lib/WebView.windows.d.ts +0 -1
- package/lib/WebView.windows.js +1 -1
- package/lib/WebViewNativeComponent.macos.d.ts +1 -2
- package/lib/WebViewNativeComponent.windows.d.ts +1 -2
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.js +1 -1
- package/lib/WebViewTypes.d.ts +51 -3
- package/lib/WebViewTypes.js +1 -1
- package/lib/index.d.ts +0 -1
- package/macos/RNCWebView.xcodeproj/project.pbxproj +36 -36
- package/package.json +13 -12
- package/react-native.config.js +1 -5
- package/src/BPCWebViewNativeComponent.ts +143 -79
- package/src/NativeBPCWebViewModule.ts +13 -0
- package/src/WebView.android.tsx +295 -190
- package/src/WebView.ios.tsx +253 -186
- package/src/WebView.macos.tsx +220 -152
- package/src/WebView.styles.ts +9 -12
- package/src/WebView.tsx +14 -7
- package/src/WebView.windows.tsx +180 -126
- package/src/WebViewNativeComponent.macos.ts +4 -5
- package/src/WebViewNativeComponent.windows.ts +6 -8
- package/src/WebViewShared.tsx +139 -91
- package/src/WebViewTypes.ts +80 -35
- package/src/__tests__/WebViewShared-test.js +170 -55
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +8 -17
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +5 -1
- package/windows/ReactNativeWebView/ReactWebView.cpp +73 -6
- package/windows/ReactNativeWebView/ReactWebView.h +11 -1
- package/windows/ReactNativeWebView/ReactWebView.idl +12 -3
- package/windows/ReactNativeWebView/ReactWebView2.cpp +294 -129
- package/windows/ReactNativeWebView/ReactWebView2.h +42 -5
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +60 -34
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +4 -4
- package/windows/ReactNativeWebView/ReactWebViewHelpers.cpp +70 -0
- package/windows/ReactNativeWebView/ReactWebViewHelpers.h +16 -0
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +22 -3
- package/windows/ReactNativeWebView/ReactWebViewManager.h +6 -1
- package/windows/ReactNativeWebView/pch.h +11 -7
- package/windows/ReactNativeWebView.sln +14 -14
- package/ios/main.jsbundle +0 -457
- package/lib/BPCWebViewNativeComponent.d.ts.map +0 -1
- package/lib/NativeBPCWebView.d.ts.map +0 -1
- package/lib/WebView.android.d.ts.map +0 -1
- package/lib/WebView.d.ts.map +0 -1
- package/lib/WebView.ios.d.ts.map +0 -1
- package/lib/WebView.macos.d.ts.map +0 -1
- package/lib/WebView.styles.d.ts.map +0 -1
- package/lib/WebView.windows.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
- package/lib/WebViewShared.d.ts.map +0 -1
- package/lib/WebViewTypes.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/react-native-webview-bootpay.podspec +0 -46
- package/src/NativeBPCWebView.ts +0 -14
- package/windows/ReactNativeWebView/packages.config +0 -5
- /package/android/src/main/java/kr/co/bootpay/webview/{BPCWebviewWrapper.kt → BPCWebViewWrapper.kt} +0 -0
package/src/WebView.ios.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
11
|
-
import BPCWebViewModule from
|
|
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(
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
155
|
-
|
|
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
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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;
|