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
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
#import "BPCWebViewManager.h"
|
|
4
4
|
#import "BPCWebViewImpl.h"
|
|
5
|
-
#import "BPCWebViewDecisionManager.h"
|
|
6
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
7
|
-
#import "BPCWebViewSpec/BPCWebViewSpec.h"
|
|
8
|
-
#endif
|
|
9
5
|
|
|
10
6
|
#if TARGET_OS_OSX
|
|
11
7
|
#define RNCView NSView
|
|
@@ -35,11 +31,7 @@ RCT_ENUM_CONVERTER(BPCWebViewPermissionGrantType, (@{
|
|
|
35
31
|
#endif
|
|
36
32
|
@end
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
@implementation BPCWebViewManager {
|
|
40
|
-
NSConditionLock *_shouldStartLoadLock;
|
|
41
|
-
BOOL _shouldStartLoad;
|
|
42
|
-
}
|
|
34
|
+
@implementation BPCWebViewManager
|
|
43
35
|
|
|
44
36
|
RCT_EXPORT_MODULE(BPCWebView)
|
|
45
37
|
|
|
@@ -70,6 +62,7 @@ RCT_EXPORT_VIEW_PROPERTY(javaScriptCanOpenWindowsAutomatically, BOOL)
|
|
|
70
62
|
RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL)
|
|
71
63
|
RCT_EXPORT_VIEW_PROPERTY(allowUniversalAccessFromFileURLs, BOOL)
|
|
72
64
|
RCT_EXPORT_VIEW_PROPERTY(allowsInlineMediaPlayback, BOOL)
|
|
65
|
+
RCT_EXPORT_VIEW_PROPERTY(allowsPictureInPictureMediaPlayback, BOOL)
|
|
73
66
|
RCT_EXPORT_VIEW_PROPERTY(webviewDebuggingEnabled, BOOL)
|
|
74
67
|
RCT_EXPORT_VIEW_PROPERTY(allowsAirPlayForMediaPlayback, BOOL)
|
|
75
68
|
RCT_EXPORT_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, BOOL)
|
|
@@ -132,6 +125,9 @@ RCT_EXPORT_VIEW_PROPERTY(onCustomMenuSelection, RCTDirectEventBlock)
|
|
|
132
125
|
RCT_CUSTOM_VIEW_PROPERTY(pullToRefreshEnabled, BOOL, BPCWebViewImpl) {
|
|
133
126
|
view.pullToRefreshEnabled = json == nil ? false : [RCTConvert BOOL: json];
|
|
134
127
|
}
|
|
128
|
+
RCT_CUSTOM_VIEW_PROPERTY(refreshControlLightMode, BOOL, BPCWebViewImpl) {
|
|
129
|
+
view.refreshControlLightMode = json == nil ? false : [RCTConvert BOOL: json];
|
|
130
|
+
}
|
|
135
131
|
|
|
136
132
|
RCT_CUSTOM_VIEW_PROPERTY(bounces, BOOL, BPCWebViewImpl) {
|
|
137
133
|
view.bounces = json == nil ? true : [RCTConvert BOOL: json];
|
|
@@ -216,19 +212,4 @@ QUICK_RCT_EXPORT_COMMAND_METHOD_PARAMS(postMessage, message:(NSString *)message,
|
|
|
216
212
|
QUICK_RCT_EXPORT_COMMAND_METHOD_PARAMS(injectJavaScript, script:(NSString *)script, script)
|
|
217
213
|
QUICK_RCT_EXPORT_COMMAND_METHOD_PARAMS(clearCache, includeDiskFiles:(BOOL)includeDiskFiles, includeDiskFiles)
|
|
218
214
|
|
|
219
|
-
RCT_EXPORT_METHOD(shouldStartLoadWithLockIdentifier:(BOOL)shouldStart
|
|
220
|
-
lockIdentifier:(double)lockIdentifier)
|
|
221
|
-
{
|
|
222
|
-
[[BPCWebViewDecisionManager getInstance] setResult:shouldStart forLockIdentifier:(int)lockIdentifier];
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Thanks to this guard, we won't compile this code when we build for the old architecture.
|
|
226
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
227
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
228
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
229
|
-
{
|
|
230
|
-
return std::make_shared<facebook::react::NativeBPCWebViewSpecJSI>(params);
|
|
231
|
-
}
|
|
232
|
-
#endif
|
|
233
|
-
|
|
234
215
|
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#ifndef BPCWebViewModule_h
|
|
2
|
+
#define BPCWebViewModule_h
|
|
3
|
+
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import "BPCWebViewSpec/BPCWebViewSpec.h"
|
|
6
|
+
#endif /* RCT_NEW_ARCH_ENABLED */
|
|
7
|
+
|
|
8
|
+
#import <React/RCTBridgeModule.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface BPCWebViewModule : NSObject <
|
|
13
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
14
|
+
NativeBPCWebViewModuleSpec
|
|
15
|
+
#else
|
|
16
|
+
RCTBridgeModule
|
|
17
|
+
#endif /* RCT_NEW_ARCH_ENABLED */
|
|
18
|
+
>
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_END
|
|
22
|
+
|
|
23
|
+
#endif /* BPCWebViewModule_h */
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#import "BPCWebViewModule.h"
|
|
2
|
+
|
|
3
|
+
#import "BPCWebViewDecisionManager.h"
|
|
4
|
+
|
|
5
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
6
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
7
|
+
#endif /* RCT_NEW_ARCH_ENABLED */
|
|
8
|
+
|
|
9
|
+
@implementation BPCWebViewModule
|
|
10
|
+
|
|
11
|
+
RCT_EXPORT_MODULE(BPCWebViewModule)
|
|
12
|
+
|
|
13
|
+
RCT_EXPORT_METHOD(isFileUploadSupported:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
14
|
+
if (resolve) {
|
|
15
|
+
resolve(@(YES));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
RCT_EXPORT_METHOD(shouldStartLoadWithLockIdentifier:(BOOL)shouldStart lockIdentifier:(double)lockIdentifier)
|
|
20
|
+
{
|
|
21
|
+
[[BPCWebViewDecisionManager getInstance] setResult:shouldStart forLockIdentifier:(int)lockIdentifier];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
25
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
26
|
+
return std::make_shared<facebook::react::NativeBPCWebViewModuleSpecJSI>(params);
|
|
27
|
+
}
|
|
28
|
+
#endif /* RCT_NEW_ARCH_ENABLED */
|
|
29
|
+
|
|
30
|
+
Class BPCWebViewModuleCls(void) {
|
|
31
|
+
return BPCWebViewModule.class;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#import <WebKit/WebKit.h>
|
|
2
|
+
|
|
3
|
+
#import <React/RCTConvert.h>
|
|
4
|
+
|
|
5
|
+
#if TARGET_OS_IPHONE
|
|
6
|
+
|
|
7
|
+
@implementation RCTConvert (WKDataDetectorTypes)
|
|
8
|
+
|
|
9
|
+
RCT_MULTI_ENUM_CONVERTER(
|
|
10
|
+
WKDataDetectorTypes,
|
|
11
|
+
(@{
|
|
12
|
+
@"none" : @(WKDataDetectorTypeNone),
|
|
13
|
+
@"phoneNumber" : @(WKDataDetectorTypePhoneNumber),
|
|
14
|
+
@"link" : @(WKDataDetectorTypeLink),
|
|
15
|
+
@"address" : @(WKDataDetectorTypeAddress),
|
|
16
|
+
@"calendarEvent" : @(WKDataDetectorTypeCalendarEvent),
|
|
17
|
+
@"trackingNumber" : @(WKDataDetectorTypeTrackingNumber),
|
|
18
|
+
@"flightNumber" : @(WKDataDetectorTypeFlightNumber),
|
|
19
|
+
@"lookupSuggestion" : @(WKDataDetectorTypeLookupSuggestion),
|
|
20
|
+
@"all" : @(WKDataDetectorTypeAll),
|
|
21
|
+
}),
|
|
22
|
+
WKDataDetectorTypeNone,
|
|
23
|
+
unsignedLongLongValue)
|
|
24
|
+
|
|
25
|
+
@end
|
|
26
|
+
|
|
27
|
+
#endif // TARGET_OS_IPHONE
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
3515965E21A3C86000623BFA /*
|
|
10
|
+
3515965E21A3C86000623BFA /* RNCWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */; };
|
|
11
11
|
E91B351D21446E6C00F9801F /* BPCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* BPCWebViewManager.m */; };
|
|
12
|
-
E91B351E21446E6C00F9801F /*
|
|
12
|
+
E91B351E21446E6C00F9801F /* RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RNCWebView.m */; };
|
|
13
13
|
/* End PBXBuildFile section */
|
|
14
14
|
|
|
15
15
|
/* Begin PBXCopyFilesBuildPhase section */
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
/* End PBXCopyFilesBuildPhase section */
|
|
26
26
|
|
|
27
27
|
/* Begin PBXFileReference section */
|
|
28
|
-
134814201AA4EA6300B7C361 /*
|
|
29
|
-
3515965D21A3C86000623BFA /*
|
|
30
|
-
3515965F21A3C87E00623BFA /*
|
|
28
|
+
134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
29
|
+
3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNCWKProcessPoolManager.m; path = ../apple/RNCWKProcessPoolManager.m; sourceTree = "<group>"; };
|
|
30
|
+
3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNCWKProcessPoolManager.h; path = ../apple/RNCWKProcessPoolManager.h; sourceTree = "<group>"; };
|
|
31
31
|
E91B351921446E6C00F9801F /* BPCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BPCWebViewManager.h; path = ../apple/BPCWebViewManager.h; sourceTree = "<group>"; };
|
|
32
|
-
E91B351A21446E6C00F9801F /*
|
|
32
|
+
E91B351A21446E6C00F9801F /* RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCWebView.h; path = ../apple/RNCWebView.h; sourceTree = "<group>"; };
|
|
33
33
|
E91B351B21446E6C00F9801F /* BPCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BPCWebViewManager.m; path = ../apple/BPCWebViewManager.m; sourceTree = "<group>"; };
|
|
34
|
-
E91B351C21446E6C00F9801F /*
|
|
34
|
+
E91B351C21446E6C00F9801F /* RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCWebView.m; path = ../apple/RNCWebView.m; sourceTree = "<group>"; };
|
|
35
35
|
/* End PBXFileReference section */
|
|
36
36
|
|
|
37
37
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
49
49
|
isa = PBXGroup;
|
|
50
50
|
children = (
|
|
51
|
-
134814201AA4EA6300B7C361 /*
|
|
51
|
+
134814201AA4EA6300B7C361 /* libRNCWebView.a */,
|
|
52
52
|
);
|
|
53
53
|
name = Products;
|
|
54
54
|
sourceTree = "<group>";
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
58B511D21A9E6C8500147676 = {
|
|
57
57
|
isa = PBXGroup;
|
|
58
58
|
children = (
|
|
59
|
-
E91B351A21446E6C00F9801F /*
|
|
60
|
-
E91B351C21446E6C00F9801F /*
|
|
59
|
+
E91B351A21446E6C00F9801F /* RNCWebView.h */,
|
|
60
|
+
E91B351C21446E6C00F9801F /* RNCWebView.m */,
|
|
61
61
|
E91B351921446E6C00F9801F /* BPCWebViewManager.h */,
|
|
62
62
|
E91B351B21446E6C00F9801F /* BPCWebViewManager.m */,
|
|
63
|
-
3515965F21A3C87E00623BFA /*
|
|
64
|
-
3515965D21A3C86000623BFA /*
|
|
63
|
+
3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */,
|
|
64
|
+
3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */,
|
|
65
65
|
134814211AA4EA7D00B7C361 /* Products */,
|
|
66
66
|
);
|
|
67
67
|
indentWidth = 2;
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
/* End PBXGroup section */
|
|
72
72
|
|
|
73
73
|
/* Begin PBXNativeTarget section */
|
|
74
|
-
58B511DA1A9E6C8500147676 /*
|
|
74
|
+
58B511DA1A9E6C8500147676 /* RNCWebView */ = {
|
|
75
75
|
isa = PBXNativeTarget;
|
|
76
|
-
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "
|
|
76
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */;
|
|
77
77
|
buildPhases = (
|
|
78
78
|
58B511D71A9E6C8500147676 /* Sources */,
|
|
79
79
|
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
);
|
|
84
84
|
dependencies = (
|
|
85
85
|
);
|
|
86
|
-
name =
|
|
86
|
+
name = RNCWebView;
|
|
87
87
|
productName = RCTDataManager;
|
|
88
|
-
productReference = 134814201AA4EA6300B7C361 /*
|
|
88
|
+
productReference = 134814201AA4EA6300B7C361 /* libRNCWebView.a */;
|
|
89
89
|
productType = "com.apple.product-type.library.static";
|
|
90
90
|
};
|
|
91
91
|
/* End PBXNativeTarget section */
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
|
-
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "
|
|
105
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */;
|
|
106
106
|
compatibilityVersion = "Xcode 3.2";
|
|
107
107
|
developmentRegion = en;
|
|
108
108
|
hasScannedForEncodings = 0;
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
projectDirPath = "";
|
|
115
115
|
projectRoot = "";
|
|
116
116
|
targets = (
|
|
117
|
-
58B511DA1A9E6C8500147676 /*
|
|
117
|
+
58B511DA1A9E6C8500147676 /* RNCWebView */,
|
|
118
118
|
);
|
|
119
119
|
};
|
|
120
120
|
/* End PBXProject section */
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
buildActionMask = 2147483647;
|
|
126
126
|
files = (
|
|
127
127
|
E91B351D21446E6C00F9801F /* BPCWebViewManager.m in Sources */,
|
|
128
|
-
E91B351E21446E6C00F9801F /*
|
|
129
|
-
3515965E21A3C86000623BFA /*
|
|
128
|
+
E91B351E21446E6C00F9801F /* RNCWebView.m in Sources */,
|
|
129
|
+
3515965E21A3C86000623BFA /* RNCWKProcessPoolManager.m in Sources */,
|
|
130
130
|
);
|
|
131
131
|
runOnlyForDeploymentPostprocessing = 0;
|
|
132
132
|
};
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
);
|
|
226
226
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
227
227
|
OTHER_LDFLAGS = "-ObjC";
|
|
228
|
-
PRODUCT_NAME =
|
|
228
|
+
PRODUCT_NAME = RNCWebView;
|
|
229
229
|
SKIP_INSTALL = YES;
|
|
230
230
|
};
|
|
231
231
|
name = Debug;
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
);
|
|
242
242
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
243
243
|
OTHER_LDFLAGS = "-ObjC";
|
|
244
|
-
PRODUCT_NAME =
|
|
244
|
+
PRODUCT_NAME = RNCWebView;
|
|
245
245
|
SKIP_INSTALL = YES;
|
|
246
246
|
};
|
|
247
247
|
name = Release;
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
/* End XCBuildConfiguration section */
|
|
250
250
|
|
|
251
251
|
/* Begin XCConfigurationList section */
|
|
252
|
-
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "
|
|
252
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */ = {
|
|
253
253
|
isa = XCConfigurationList;
|
|
254
254
|
buildConfigurations = (
|
|
255
255
|
58B511ED1A9E6C8500147676 /* Debug */,
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
defaultConfigurationIsVisible = 0;
|
|
259
259
|
defaultConfigurationName = Release;
|
|
260
260
|
};
|
|
261
|
-
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "
|
|
261
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */ = {
|
|
262
262
|
isa = XCConfigurationList;
|
|
263
263
|
buildConfigurations = (
|
|
264
264
|
58B511F01A9E6C8500147676 /* Debug */,
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>RNCWebView.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react-native/types/modules/Codegen" />
|
|
3
1
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
4
2
|
import { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
3
|
export type WebViewNativeEvent = Readonly<{
|
|
@@ -133,22 +131,22 @@ export interface NativeProps extends ViewProps {
|
|
|
133
131
|
onRenderProcessGone?: DirectEventHandler<WebViewRenderProcessGoneEvent>;
|
|
134
132
|
overScrollMode?: string;
|
|
135
133
|
saveFormDataDisabled?: boolean;
|
|
136
|
-
scalesPageToFit?: boolean
|
|
137
|
-
setBuiltInZoomControls?: boolean
|
|
134
|
+
scalesPageToFit?: WithDefault<boolean, true>;
|
|
135
|
+
setBuiltInZoomControls?: WithDefault<boolean, true>;
|
|
138
136
|
setDisplayZoomControls?: boolean;
|
|
139
|
-
setSupportMultipleWindows?: boolean
|
|
137
|
+
setSupportMultipleWindows?: WithDefault<boolean, true>;
|
|
140
138
|
textZoom?: Int32;
|
|
141
|
-
thirdPartyCookiesEnabled?: boolean
|
|
139
|
+
thirdPartyCookiesEnabled?: WithDefault<boolean, true>;
|
|
142
140
|
hasOnScroll?: boolean;
|
|
143
|
-
injectedJavaScriptObject?: string;
|
|
144
141
|
allowingReadAccessToURL?: string;
|
|
145
142
|
allowsBackForwardNavigationGestures?: boolean;
|
|
146
143
|
allowsInlineMediaPlayback?: boolean;
|
|
144
|
+
allowsPictureInPictureMediaPlayback?: boolean;
|
|
147
145
|
allowsAirPlayForMediaPlayback?: boolean;
|
|
148
|
-
allowsLinkPreview?: boolean
|
|
149
|
-
automaticallyAdjustContentInsets?: boolean
|
|
150
|
-
autoManageStatusBarEnabled?: boolean
|
|
151
|
-
bounces?: boolean
|
|
146
|
+
allowsLinkPreview?: WithDefault<boolean, true>;
|
|
147
|
+
automaticallyAdjustContentInsets?: WithDefault<boolean, true>;
|
|
148
|
+
autoManageStatusBarEnabled?: WithDefault<boolean, true>;
|
|
149
|
+
bounces?: WithDefault<boolean, true>;
|
|
152
150
|
contentInset?: Readonly<{
|
|
153
151
|
top?: Double;
|
|
154
152
|
left?: Double;
|
|
@@ -159,18 +157,19 @@ export interface NativeProps extends ViewProps {
|
|
|
159
157
|
contentMode?: WithDefault<'recommended' | 'mobile' | 'desktop', 'recommended'>;
|
|
160
158
|
dataDetectorTypes?: WithDefault<ReadonlyArray<'address' | 'link' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'phoneNumber' | 'all' | 'none'>, 'phoneNumber'>;
|
|
161
159
|
decelerationRate?: Double;
|
|
162
|
-
directionalLockEnabled?: boolean
|
|
160
|
+
directionalLockEnabled?: WithDefault<boolean, true>;
|
|
163
161
|
enableApplePay?: boolean;
|
|
164
162
|
hideKeyboardAccessoryView?: boolean;
|
|
165
|
-
keyboardDisplayRequiresUserAction?: boolean
|
|
163
|
+
keyboardDisplayRequiresUserAction?: WithDefault<boolean, true>;
|
|
166
164
|
limitsNavigationsToAppBoundDomains?: boolean;
|
|
167
165
|
mediaCapturePermissionGrantType?: WithDefault<'prompt' | 'grant' | 'deny' | 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny', 'prompt'>;
|
|
168
166
|
pagingEnabled?: boolean;
|
|
169
167
|
pullToRefreshEnabled?: boolean;
|
|
170
|
-
|
|
168
|
+
refreshControlLightMode?: boolean;
|
|
169
|
+
scrollEnabled?: WithDefault<boolean, true>;
|
|
171
170
|
sharedCookiesEnabled?: boolean;
|
|
172
|
-
textInteractionEnabled?: boolean
|
|
173
|
-
useSharedProcessPool?: boolean
|
|
171
|
+
textInteractionEnabled?: WithDefault<boolean, true>;
|
|
172
|
+
useSharedProcessPool?: WithDefault<boolean, true>;
|
|
174
173
|
onContentProcessDidTerminate?: DirectEventHandler<WebViewNativeEvent>;
|
|
175
174
|
onCustomMenuSelection?: DirectEventHandler<WebViewCustomMenuSelectionEvent>;
|
|
176
175
|
onFileDownload?: DirectEventHandler<WebViewDownloadEvent>;
|
|
@@ -180,7 +179,7 @@ export interface NativeProps extends ViewProps {
|
|
|
180
179
|
}>>;
|
|
181
180
|
suppressMenuItems?: Readonly<string>[];
|
|
182
181
|
hasOnFileDownload?: boolean;
|
|
183
|
-
fraudulentWebsiteWarningEnabled?: boolean
|
|
182
|
+
fraudulentWebsiteWarningEnabled?: WithDefault<boolean, true>;
|
|
184
183
|
allowFileAccessFromFileURLs?: boolean;
|
|
185
184
|
allowUniversalAccessFromFileURLs?: boolean;
|
|
186
185
|
applicationNameForUserAgent?: string;
|
|
@@ -188,16 +187,16 @@ export interface NativeProps extends ViewProps {
|
|
|
188
187
|
username: string;
|
|
189
188
|
password: string;
|
|
190
189
|
}>;
|
|
191
|
-
cacheEnabled?: boolean
|
|
190
|
+
cacheEnabled?: WithDefault<boolean, true>;
|
|
192
191
|
incognito?: boolean;
|
|
193
192
|
injectedJavaScript?: string;
|
|
194
193
|
injectedJavaScriptBeforeContentLoaded?: string;
|
|
195
|
-
injectedJavaScriptForMainFrameOnly?: boolean
|
|
196
|
-
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean
|
|
194
|
+
injectedJavaScriptForMainFrameOnly?: WithDefault<boolean, true>;
|
|
195
|
+
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: WithDefault<boolean, true>;
|
|
197
196
|
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
198
|
-
javaScriptEnabled?: boolean
|
|
197
|
+
javaScriptEnabled?: WithDefault<boolean, true>;
|
|
199
198
|
webviewDebuggingEnabled?: boolean;
|
|
200
|
-
mediaPlaybackRequiresUserAction?: boolean
|
|
199
|
+
mediaPlaybackRequiresUserAction?: WithDefault<boolean, true>;
|
|
201
200
|
messagingEnabled: boolean;
|
|
202
201
|
onLoadingError: DirectEventHandler<WebViewErrorEvent>;
|
|
203
202
|
onLoadingFinish: DirectEventHandler<WebViewNavigationEvent>;
|
|
@@ -209,8 +208,8 @@ export interface NativeProps extends ViewProps {
|
|
|
209
208
|
hasOnOpenWindowEvent?: boolean;
|
|
210
209
|
onScroll?: DirectEventHandler<ScrollEvent>;
|
|
211
210
|
onShouldStartLoadWithRequest: DirectEventHandler<ShouldStartLoadRequestEvent>;
|
|
212
|
-
showsHorizontalScrollIndicator?: boolean
|
|
213
|
-
showsVerticalScrollIndicator?: boolean
|
|
211
|
+
showsHorizontalScrollIndicator?: WithDefault<boolean, true>;
|
|
212
|
+
showsVerticalScrollIndicator?: WithDefault<boolean, true>;
|
|
214
213
|
newSource: Readonly<{
|
|
215
214
|
uri?: string;
|
|
216
215
|
method?: string;
|
|
@@ -223,6 +222,7 @@ export interface NativeProps extends ViewProps {
|
|
|
223
222
|
baseUrl?: string;
|
|
224
223
|
}>;
|
|
225
224
|
userAgent?: string;
|
|
225
|
+
injectedJavaScriptObject?: string;
|
|
226
226
|
}
|
|
227
227
|
export interface NativeCommands {
|
|
228
228
|
goBack: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
@@ -240,4 +240,3 @@ export interface NativeCommands {
|
|
|
240
240
|
export declare const Commands: NativeCommands;
|
|
241
241
|
declare const _default: HostComponent<NativeProps>;
|
|
242
242
|
export default _default;
|
|
243
|
-
//# sourceMappingURL=BPCWebViewNativeComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=exports.Commands=void 0;var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var _require2=require("react-native/Libraries/ReactNative/RendererProxy"),dispatchCommand=_require2.dispatchCommand;var nativeComponentName='BPCWebView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'BPCWebView',directEventTypes:{topContentSizeChange:{registrationName:'onContentSizeChange'},topRenderProcessGone:{registrationName:'onRenderProcessGone'},topContentProcessDidTerminate:{registrationName:'onContentProcessDidTerminate'},topCustomMenuSelection:{registrationName:'onCustomMenuSelection'},topFileDownload:{registrationName:'onFileDownload'},topLoadingError:{registrationName:'onLoadingError'},topLoadingFinish:{registrationName:'onLoadingFinish'},topLoadingProgress:{registrationName:'onLoadingProgress'},topLoadingStart:{registrationName:'onLoadingStart'},topHttpError:{registrationName:'onHttpError'},topMessage:{registrationName:'onMessage'},topOpenWindow:{registrationName:'onOpenWindow'},topScroll:{registrationName:'onScroll'},topShouldStartLoadWithRequest:{registrationName:'onShouldStartLoadWithRequest'}},validAttributes:Object.assign({allowFileAccess:true,allowsProtectedMedia:true,allowsFullscreenVideo:true,androidLayerType:true,cacheMode:true,domStorageEnabled:true,downloadingMessage:true,forceDarkOn:true,geolocationEnabled:true,lackPermissionToDownloadMessage:true,messagingModuleName:true,minimumFontSize:true,mixedContentMode:true,nestedScrollEnabled:true,overScrollMode:true,saveFormDataDisabled:true,scalesPageToFit:true,setBuiltInZoomControls:true,setDisplayZoomControls:true,setSupportMultipleWindows:true,textZoom:true,thirdPartyCookiesEnabled:true,hasOnScroll:true,
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=exports.Commands=void 0;var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var _require2=require("react-native/Libraries/ReactNative/RendererProxy"),dispatchCommand=_require2.dispatchCommand;var nativeComponentName='BPCWebView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'BPCWebView',directEventTypes:{topContentSizeChange:{registrationName:'onContentSizeChange'},topRenderProcessGone:{registrationName:'onRenderProcessGone'},topContentProcessDidTerminate:{registrationName:'onContentProcessDidTerminate'},topCustomMenuSelection:{registrationName:'onCustomMenuSelection'},topFileDownload:{registrationName:'onFileDownload'},topLoadingError:{registrationName:'onLoadingError'},topLoadingFinish:{registrationName:'onLoadingFinish'},topLoadingProgress:{registrationName:'onLoadingProgress'},topLoadingStart:{registrationName:'onLoadingStart'},topHttpError:{registrationName:'onHttpError'},topMessage:{registrationName:'onMessage'},topOpenWindow:{registrationName:'onOpenWindow'},topScroll:{registrationName:'onScroll'},topShouldStartLoadWithRequest:{registrationName:'onShouldStartLoadWithRequest'}},validAttributes:Object.assign({allowFileAccess:true,allowsProtectedMedia:true,allowsFullscreenVideo:true,androidLayerType:true,cacheMode:true,domStorageEnabled:true,downloadingMessage:true,forceDarkOn:true,geolocationEnabled:true,lackPermissionToDownloadMessage:true,messagingModuleName:true,minimumFontSize:true,mixedContentMode:true,nestedScrollEnabled:true,overScrollMode:true,saveFormDataDisabled:true,scalesPageToFit:true,setBuiltInZoomControls:true,setDisplayZoomControls:true,setSupportMultipleWindows:true,textZoom:true,thirdPartyCookiesEnabled:true,hasOnScroll:true,allowingReadAccessToURL:true,allowsBackForwardNavigationGestures:true,allowsInlineMediaPlayback:true,allowsPictureInPictureMediaPlayback:true,allowsAirPlayForMediaPlayback:true,allowsLinkPreview:true,automaticallyAdjustContentInsets:true,autoManageStatusBarEnabled:true,bounces:true,contentInset:true,contentInsetAdjustmentBehavior:true,contentMode:true,dataDetectorTypes:true,decelerationRate:true,directionalLockEnabled:true,enableApplePay:true,hideKeyboardAccessoryView:true,keyboardDisplayRequiresUserAction:true,limitsNavigationsToAppBoundDomains:true,mediaCapturePermissionGrantType:true,pagingEnabled:true,pullToRefreshEnabled:true,refreshControlLightMode:true,scrollEnabled:true,sharedCookiesEnabled:true,textInteractionEnabled:true,useSharedProcessPool:true,menuItems:true,suppressMenuItems:true,hasOnFileDownload:true,fraudulentWebsiteWarningEnabled:true,allowFileAccessFromFileURLs:true,allowUniversalAccessFromFileURLs:true,applicationNameForUserAgent:true,basicAuthCredential:true,cacheEnabled:true,incognito:true,injectedJavaScript:true,injectedJavaScriptBeforeContentLoaded:true,injectedJavaScriptForMainFrameOnly:true,injectedJavaScriptBeforeContentLoadedForMainFrameOnly:true,javaScriptCanOpenWindowsAutomatically:true,javaScriptEnabled:true,webviewDebuggingEnabled:true,mediaPlaybackRequiresUserAction:true,messagingEnabled:true,hasOnOpenWindowEvent:true,showsHorizontalScrollIndicator:true,showsVerticalScrollIndicator:true,newSource:true,userAgent:true,injectedJavaScriptObject:true},ConditionallyIgnoredEventHandlers({onContentSizeChange:true,onRenderProcessGone:true,onContentProcessDidTerminate:true,onCustomMenuSelection:true,onFileDownload:true,onLoadingError:true,onLoadingFinish:true,onLoadingProgress:true,onLoadingStart:true,onHttpError:true,onMessage:true,onOpenWindow:true,onScroll:true,onShouldStartLoadWithRequest:true}))};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});var Commands=exports.Commands={goBack:function goBack(ref){dispatchCommand(ref,"goBack",[]);},goForward:function goForward(ref){dispatchCommand(ref,"goForward",[]);},reload:function reload(ref){dispatchCommand(ref,"reload",[]);},stopLoading:function stopLoading(ref){dispatchCommand(ref,"stopLoading",[]);},injectJavaScript:function injectJavaScript(ref,javascript){dispatchCommand(ref,"injectJavaScript",[javascript]);},requestFocus:function requestFocus(ref){dispatchCommand(ref,"requestFocus",[]);},postMessage:function postMessage(ref,data){dispatchCommand(ref,"postMessage",[data]);},loadUrl:function loadUrl(ref,url){dispatchCommand(ref,"loadUrl",[url]);},clearFormData:function clearFormData(ref){dispatchCommand(ref,"clearFormData",[]);},clearCache:function clearCache(ref,includeDiskFiles){dispatchCommand(ref,"clearCache",[includeDiskFiles]);},clearHistory:function clearHistory(ref){dispatchCommand(ref,"clearHistory",[]);}};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
/// <reference types="react-native/types/modules/Codegen" />
|
|
2
1
|
import type { TurboModule } from 'react-native';
|
|
3
|
-
import {
|
|
2
|
+
import { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
3
|
export interface Spec extends TurboModule {
|
|
5
|
-
readonly getConstants: () => {};
|
|
6
4
|
isFileUploadSupported(): Promise<boolean>;
|
|
7
|
-
shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier:
|
|
5
|
+
shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier: Double): void;
|
|
8
6
|
}
|
|
9
7
|
declare const _default: Spec;
|
|
10
8
|
export default _default;
|
|
11
|
-
//# sourceMappingURL=NativeBPCWebView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _default=exports.default=_reactNative.TurboModuleRegistry.getEnforcing('
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _default=exports.default=_reactNative.TurboModuleRegistry.getEnforcing('BPCWebViewModule');
|
package/lib/WebView.android.d.ts
CHANGED
package/lib/WebView.android.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _BatchedBridge=_interopRequireDefault(require("react-native/Libraries/BatchedBridge/BatchedBridge"));var _invariant=_interopRequireDefault(require("invariant"));var _BPCWebViewNativeComponent=_interopRequireWildcard(require("./BPCWebViewNativeComponent"));var _NativeBPCWebView=_interopRequireDefault(require("./NativeBPCWebView"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["overScrollMode","javaScriptEnabled","thirdPartyCookiesEnabled","scalesPageToFit","allowsFullscreenVideo","allowFileAccess","saveFormDataDisabled","cacheEnabled","androidLayerType","originWhitelist","setSupportMultipleWindows","setBuiltInZoomControls","setDisplayZoomControls","nestedScrollEnabled","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onRenderProcessGone","onMessage","onOpenWindow","renderLoading","renderError","style","containerStyle","source","nativeConfig","onShouldStartLoadWithRequest","injectedJavaScriptObject"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.android.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var resolveAssetSource=_reactNative.Image.resolveAssetSource;var uniqueRef=0;var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$overScrollMode=_ref.overScrollMode,overScrollMode=_ref$overScrollMode===void 0?'always':_ref$overScrollMode,_ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$thirdPartyCookie=_ref.thirdPartyCookiesEnabled,thirdPartyCookiesEnabled=_ref$thirdPartyCookie===void 0?true:_ref$thirdPartyCookie,_ref$scalesPageToFit=_ref.scalesPageToFit,scalesPageToFit=_ref$scalesPageToFit===void 0?true:_ref$scalesPageToFit,_ref$allowsFullscreen=_ref.allowsFullscreenVideo,allowsFullscreenVideo=_ref$allowsFullscreen===void 0?false:_ref$allowsFullscreen,_ref$allowFileAccess=_ref.allowFileAccess,allowFileAccess=_ref$allowFileAccess===void 0?false:_ref$allowFileAccess,_ref$saveFormDataDisa=_ref.saveFormDataDisabled,saveFormDataDisabled=_ref$saveFormDataDisa===void 0?false:_ref$saveFormDataDisa,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$androidLayerType=_ref.androidLayerType,androidLayerType=_ref$androidLayerType===void 0?"none":_ref$androidLayerType,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$setSupportMultip=_ref.setSupportMultipleWindows,setSupportMultipleWindows=_ref$setSupportMultip===void 0?true:_ref$setSupportMultip,_ref$setBuiltInZoomCo=_ref.setBuiltInZoomControls,setBuiltInZoomControls=_ref$setBuiltInZoomCo===void 0?true:_ref$setBuiltInZoomCo,_ref$setDisplayZoomCo=_ref.setDisplayZoomControls,setDisplayZoomControls=_ref$setDisplayZoomCo===void 0?false:_ref$setDisplayZoomCo,_ref$nestedScrollEnab=_ref.nestedScrollEnabled,nestedScrollEnabled=_ref$nestedScrollEnab===void 0?false:_ref$nestedScrollEnab,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onRenderProcessGoneProp=_ref.onRenderProcessGone,onMessageProp=_ref.onMessage,onOpenWindowProp=_ref.onOpenWindow,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,injectedJavaScriptObject=_ref.injectedJavaScriptObject,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var messagingModuleName=(0,_react.useRef)(`WebViewMessageHandler${uniqueRef+=1}`).current;var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,url,lockIdentifier){if(lockIdentifier){_NativeBPCWebView.default.shouldStartLoadWithLockIdentifier(shouldStart,lockIdentifier);}else if(shouldStart&&webViewRef.current){_BPCWebViewNativeComponent.Commands.loadUrl(webViewRef.current,url);}},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onRenderProcessGoneProp:onRenderProcessGoneProp,onMessageProp:onMessageProp,onOpenWindowProp:onOpenWindowProp,startInLoadingState:startInLoadingState,originWhitelist:originWhitelist,onShouldStartLoadWithRequestProp:onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback:onShouldStartLoadWithRequestCallback}),onLoadingStart=_useWebViewLogic.onLoadingStart,onShouldStartLoadWithRequest=_useWebViewLogic.onShouldStartLoadWithRequest,onMessage=_useWebViewLogic.onMessage,viewState=_useWebViewLogic.viewState,setViewState=_useWebViewLogic.setViewState,lastErrorEvent=_useWebViewLogic.lastErrorEvent,onHttpError=_useWebViewLogic.onHttpError,onLoadingError=_useWebViewLogic.onLoadingError,onLoadingFinish=_useWebViewLogic.onLoadingFinish,onLoadingProgress=_useWebViewLogic.onLoadingProgress,onOpenWindow=_useWebViewLogic.onOpenWindow,onRenderProcessGone=_useWebViewLogic.onRenderProcessGone;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.goForward(webViewRef.current);},goBack:function goBack(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');if(webViewRef.current){_BPCWebViewNativeComponent.Commands.reload(webViewRef.current);}},stopLoading:function stopLoading(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.requestFocus(webViewRef.current);},clearFormData:function clearFormData(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearFormData(webViewRef.current);},clearCache:function clearCache(includeDiskFiles){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearCache(webViewRef.current,includeDiskFiles);},clearHistory:function clearHistory(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearHistory(webViewRef.current);}};},[setViewState,webViewRef]);var directEventCallbacks=(0,_react.useMemo)(function(){return{onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onMessage:onMessage};},[onMessage,onShouldStartLoadWithRequest]);(0,_react.useEffect)(function(){_BatchedBridge.default.registerCallableModule(messagingModuleName,directEventCallbacks);},[messagingModuleName,directEventCallbacks]);var otherView;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');if(lastErrorEvent){otherView=(renderError||_WebViewShared.defaultRenderError)(lastErrorEvent.domain,lastErrorEvent.code,lastErrorEvent.description);}}else if(viewState!=='IDLE'){console.error(`BPCWebView invalid state encountered: ${viewState}`);}var webViewStyles=[_WebView.default.container,_WebView.default.webView,style];var webViewContainerStyle=[_WebView.default.container,containerStyle];if(typeof source!=="number"&&source&&'method'in source){if(source.method==='POST'&&source.headers){console.warn('WebView: `source.headers` is not supported when using POST.');}else if(source.method==='GET'&&source.body){console.warn('WebView: `source.body` is not supported when using GET.');}}var NativeWebView=(nativeConfig==null?void 0:nativeConfig.component)||_BPCWebViewNativeComponent.default;var sourceResolved=resolveAssetSource(source);var newSource=typeof sourceResolved==="object"?Object.entries(sourceResolved).reduce(function(prev,_ref2){var _ref3=(0,_slicedToArray2.default)(_ref2,2),currKey=_ref3[0],currValue=_ref3[1];return Object.assign({},prev,(0,_defineProperty2.default)({},currKey,currKey==="headers"&&currValue&&typeof currValue==="object"?Object.entries(currValue).map(function(_ref4){var _ref5=(0,_slicedToArray2.default)(_ref4,2),key=_ref5[0],value=_ref5[1];return{name:key,value:value};}):currValue));},{}):sourceResolved;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{messagingEnabled:typeof onMessageProp==='function',messagingModuleName:messagingModuleName,hasOnScroll:!!otherProps.onScroll,onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onRenderProcessGone:onRenderProcessGone,onMessage:onMessage,onOpenWindow:onOpenWindow,hasOnOpenWindowEvent:onOpenWindowProp!==undefined,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,ref:webViewRef,source:sourceResolved,newSource:newSource,style:webViewStyles,overScrollMode:overScrollMode,javaScriptEnabled:javaScriptEnabled,thirdPartyCookiesEnabled:thirdPartyCookiesEnabled,scalesPageToFit:scalesPageToFit,allowsFullscreenVideo:allowsFullscreenVideo,allowFileAccess:allowFileAccess,saveFormDataDisabled:saveFormDataDisabled,cacheEnabled:cacheEnabled,androidLayerType:androidLayerType,setSupportMultipleWindows:setSupportMultipleWindows,setBuiltInZoomControls:setBuiltInZoomControls,setDisplayZoomControls:setDisplayZoomControls,nestedScrollEnabled:nestedScrollEnabled,injectedJavaScriptObject:JSON.stringify(injectedJavaScriptObject)},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=_NativeBPCWebView.default.isFileUploadSupported;var WebView=Object.assign(WebViewComponent,{isFileUploadSupported:isFileUploadSupported});var _default=exports.default=WebView;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _BatchedBridge=_interopRequireDefault(require("react-native/Libraries/BatchedBridge/BatchedBridge"));var _EventEmitter=_interopRequireDefault(require("react-native/Libraries/vendor/emitter/EventEmitter"));var _invariant=_interopRequireDefault(require("invariant"));var _BPCWebViewNativeComponent=_interopRequireWildcard(require("./BPCWebViewNativeComponent"));var _NativeBPCWebViewModule=_interopRequireDefault(require("./NativeBPCWebViewModule"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["overScrollMode","javaScriptEnabled","thirdPartyCookiesEnabled","scalesPageToFit","allowsFullscreenVideo","allowFileAccess","saveFormDataDisabled","cacheEnabled","androidLayerType","originWhitelist","setSupportMultipleWindows","setBuiltInZoomControls","setDisplayZoomControls","nestedScrollEnabled","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onRenderProcessGone","onMessage","onOpenWindow","renderLoading","renderError","style","containerStyle","source","nativeConfig","onShouldStartLoadWithRequest","injectedJavaScriptObject"],_excluded2=["messagingModuleName"],_excluded3=["messagingModuleName"];var _require$registerCall,_this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-250312/src/WebView.android.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var resolveAssetSource=_reactNative.Image.resolveAssetSource;var directEventEmitter=new _EventEmitter.default();var registerCallableModule=(_require$registerCall=require('react-native').registerCallableModule)!=null?_require$registerCall:_BatchedBridge.default.registerCallableModule.bind(_BatchedBridge.default);registerCallableModule('BPCWebViewMessagingModule',{onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(event){directEventEmitter.emit('onShouldStartLoadWithRequest',event);},onMessage:function onMessage(event){directEventEmitter.emit('onMessage',event);}});var uniqueRef=0;var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$overScrollMode=_ref.overScrollMode,overScrollMode=_ref$overScrollMode===void 0?'always':_ref$overScrollMode,_ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$thirdPartyCookie=_ref.thirdPartyCookiesEnabled,thirdPartyCookiesEnabled=_ref$thirdPartyCookie===void 0?true:_ref$thirdPartyCookie,_ref$scalesPageToFit=_ref.scalesPageToFit,scalesPageToFit=_ref$scalesPageToFit===void 0?true:_ref$scalesPageToFit,_ref$allowsFullscreen=_ref.allowsFullscreenVideo,allowsFullscreenVideo=_ref$allowsFullscreen===void 0?false:_ref$allowsFullscreen,_ref$allowFileAccess=_ref.allowFileAccess,allowFileAccess=_ref$allowFileAccess===void 0?false:_ref$allowFileAccess,_ref$saveFormDataDisa=_ref.saveFormDataDisabled,saveFormDataDisabled=_ref$saveFormDataDisa===void 0?false:_ref$saveFormDataDisa,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$androidLayerType=_ref.androidLayerType,androidLayerType=_ref$androidLayerType===void 0?'none':_ref$androidLayerType,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$setSupportMultip=_ref.setSupportMultipleWindows,setSupportMultipleWindows=_ref$setSupportMultip===void 0?true:_ref$setSupportMultip,_ref$setBuiltInZoomCo=_ref.setBuiltInZoomControls,setBuiltInZoomControls=_ref$setBuiltInZoomCo===void 0?true:_ref$setBuiltInZoomCo,_ref$setDisplayZoomCo=_ref.setDisplayZoomControls,setDisplayZoomControls=_ref$setDisplayZoomCo===void 0?false:_ref$setDisplayZoomCo,_ref$nestedScrollEnab=_ref.nestedScrollEnabled,nestedScrollEnabled=_ref$nestedScrollEnab===void 0?false:_ref$nestedScrollEnab,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onRenderProcessGoneProp=_ref.onRenderProcessGone,onMessageProp=_ref.onMessage,onOpenWindowProp=_ref.onOpenWindow,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,injectedJavaScriptObject=_ref.injectedJavaScriptObject,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var messagingModuleName=(0,_react.useRef)(`WebViewMessageHandler${uniqueRef+=1}`).current;var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,url,lockIdentifier){if(lockIdentifier){_NativeBPCWebViewModule.default.shouldStartLoadWithLockIdentifier(shouldStart,lockIdentifier);}else if(shouldStart&&webViewRef.current){_BPCWebViewNativeComponent.Commands.loadUrl(webViewRef.current,url);}},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onRenderProcessGoneProp:onRenderProcessGoneProp,onMessageProp:onMessageProp,onOpenWindowProp:onOpenWindowProp,startInLoadingState:startInLoadingState,originWhitelist:originWhitelist,onShouldStartLoadWithRequestProp:onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback:onShouldStartLoadWithRequestCallback}),onLoadingStart=_useWebViewLogic.onLoadingStart,onShouldStartLoadWithRequest=_useWebViewLogic.onShouldStartLoadWithRequest,onMessage=_useWebViewLogic.onMessage,viewState=_useWebViewLogic.viewState,setViewState=_useWebViewLogic.setViewState,lastErrorEvent=_useWebViewLogic.lastErrorEvent,onHttpError=_useWebViewLogic.onHttpError,onLoadingError=_useWebViewLogic.onLoadingError,onLoadingFinish=_useWebViewLogic.onLoadingFinish,onLoadingProgress=_useWebViewLogic.onLoadingProgress,onOpenWindow=_useWebViewLogic.onOpenWindow,onRenderProcessGone=_useWebViewLogic.onRenderProcessGone;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.goForward(webViewRef.current);},goBack:function goBack(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');if(webViewRef.current){_BPCWebViewNativeComponent.Commands.reload(webViewRef.current);}},stopLoading:function stopLoading(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.requestFocus(webViewRef.current);},clearFormData:function clearFormData(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearFormData(webViewRef.current);},clearCache:function clearCache(includeDiskFiles){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearCache(webViewRef.current,includeDiskFiles);},clearHistory:function clearHistory(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearHistory(webViewRef.current);}};},[setViewState,webViewRef]);(0,_react.useEffect)(function(){var onShouldStartLoadWithRequestSubscription=directEventEmitter.addListener('onShouldStartLoadWithRequest',function(event){if(event.messagingModuleName===messagingModuleName){var _=event.messagingModuleName,rest=(0,_objectWithoutProperties2.default)(event,_excluded2);onShouldStartLoadWithRequest(rest);}});var onMessageSubscription=directEventEmitter.addListener('onMessage',function(event){if(event.messagingModuleName===messagingModuleName){var _=event.messagingModuleName,rest=(0,_objectWithoutProperties2.default)(event,_excluded3);onMessage(rest);}});return function(){onShouldStartLoadWithRequestSubscription.remove();onMessageSubscription.remove();};},[messagingModuleName,onMessage,onShouldStartLoadWithRequest]);var otherView;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');if(lastErrorEvent){otherView=(renderError||_WebViewShared.defaultRenderError)(lastErrorEvent.domain,lastErrorEvent.code,lastErrorEvent.description);}}else if(viewState!=='IDLE'){console.error(`BPCWebView invalid state encountered: ${viewState}`);}var webViewStyles=[_WebView.default.container,_WebView.default.webView,style];var webViewContainerStyle=[_WebView.default.container,containerStyle];if(typeof source!=='number'&&source&&'method'in source){if(source.method==='POST'&&source.headers){console.warn('WebView: `source.headers` is not supported when using POST.');}else if(source.method==='GET'&&source.body){console.warn('WebView: `source.body` is not supported when using GET.');}}var NativeWebView=(nativeConfig==null?void 0:nativeConfig.component)||_BPCWebViewNativeComponent.default;var sourceResolved=resolveAssetSource(source);var newSource=typeof sourceResolved==='object'?Object.entries(sourceResolved).reduce(function(prev,_ref2){var _ref3=(0,_slicedToArray2.default)(_ref2,2),currKey=_ref3[0],currValue=_ref3[1];return Object.assign({},prev,(0,_defineProperty2.default)({},currKey,currKey==='headers'&&currValue&&typeof currValue==='object'?Object.entries(currValue).map(function(_ref4){var _ref5=(0,_slicedToArray2.default)(_ref4,2),key=_ref5[0],value=_ref5[1];return{name:key,value:value};}):currValue));},{}):sourceResolved;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{messagingEnabled:typeof onMessageProp==='function',messagingModuleName:messagingModuleName,hasOnScroll:!!otherProps.onScroll,onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onRenderProcessGone:onRenderProcessGone,onMessage:onMessage,onOpenWindow:onOpenWindow,hasOnOpenWindowEvent:onOpenWindowProp!==undefined,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,ref:webViewRef,source:sourceResolved,newSource:newSource,style:webViewStyles,overScrollMode:overScrollMode,javaScriptEnabled:javaScriptEnabled,thirdPartyCookiesEnabled:thirdPartyCookiesEnabled,scalesPageToFit:scalesPageToFit,allowsFullscreenVideo:allowsFullscreenVideo,allowFileAccess:allowFileAccess,saveFormDataDisabled:saveFormDataDisabled,cacheEnabled:cacheEnabled,androidLayerType:androidLayerType,setSupportMultipleWindows:setSupportMultipleWindows,setBuiltInZoomControls:setBuiltInZoomControls,setDisplayZoomControls:setDisplayZoomControls,nestedScrollEnabled:nestedScrollEnabled,injectedJavaScriptObject:JSON.stringify(injectedJavaScriptObject)},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=_NativeBPCWebViewModule.default.isFileUploadSupported;var WebView=Object.assign(WebViewComponent,{isFileUploadSupported:isFileUploadSupported});var _default=exports.default=WebView;
|
package/lib/WebView.d.ts
CHANGED
package/lib/WebView.ios.d.ts
CHANGED