react-native-webview-bootpay 13.8.4 → 13.8.42

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.
@@ -2,7 +2,7 @@ import java.nio.file.Paths
2
2
 
3
3
  buildscript {
4
4
  ext.safeExtGet = {prop ->
5
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : project.properties['ReactNativeWebView_' + prop]
5
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : project.properties['ReactNativeWebViewBootpay_' + prop]
6
6
  }
7
7
  repositories {
8
8
  google()
@@ -64,7 +64,7 @@ android {
64
64
 
65
65
  sourceSets {
66
66
  main {
67
- manifest.srcFile "src/main/AndroidManifestNew.xml"
67
+ manifest.srcFile "src/main/AndroidManifest.xml"
68
68
  }
69
69
  }
70
70
  }
@@ -1,8 +1,8 @@
1
- ReactNativeWebView_kotlinVersion=1.6.0
2
- ReactNativeWebView_webkitVersion=1.4.0
3
- ReactNativeWebView_compileSdkVersion=31
4
- ReactNativeWebView_targetSdkVersion=31
5
- ReactNativeWebView_minSdkVersion=21
1
+ ReactNativeWebViewBootpay_kotlinVersion=1.6.0
2
+ ReactNativeWebViewBootpay_webkitVersion=1.4.0
3
+ ReactNativeWebViewBootpay_compileSdkVersion=31
4
+ ReactNativeWebViewBootpay_targetSdkVersion=31
5
+ ReactNativeWebViewBootpay_minSdkVersion=21
6
6
 
7
7
  # Project-wide Gradle settings.
8
8
 
@@ -11,9 +11,7 @@
11
11
  android:name="android.support.FILE_PROVIDER_PATHS"
12
12
  android:resource="@xml/file_provider_paths" />
13
13
  </provider>
14
- </application>
15
-
16
- <!-- android 11 모든 앱 접근 권한 사용 (Google Play 가이드라인 참고 - 2021-02-19 기준 못찾았음) -->
14
+ </application><!-- android 11 모든 앱 접근 권한 사용 (Google Play 가이드라인 참고 - 2021-02-19 기준 못찾았음) -->
17
15
  <!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />-->
18
16
  <!-- android 11 Package Visibility 설정 (compileSdkVersion, targetSdkVersion 30 이상 설정시 필수) -->
19
17
  <!-- 2021-02-19 -->
@@ -26,7 +24,7 @@
26
24
  <!-- 이지페이 [현대, 하나, 국민, 롯데, 삼성, BC(페이북) 신한, 하나, 농협, 씨티, 우리, 페이코] -->
27
25
  <!-- 티페이 [BC(페이북), 국민, 하나, 삼성, 신한, 현대, 롯데, 농협, 씨티, 우리] -->
28
26
  <!-- 페이레터 [BC(페이북), 국민, 하나, 삼성, 신한, 현대. 롯데, 농협, 씨티, ] -->
29
- <!-- 월컴페이먼츠 [카카오, 엘페이, 현대, BC(페이북), 국민, 삼성, 신한, 롯데, 농협, 하나, 씨티, 하나, 우리] -->
27
+ <!-- 월컴페이먼츠 [카카오스, 엘페이, 현대, BC(페이북), 국민, 삼성, 신한, 롯데, 농협, 하나, 씨티, 하나, 우리] -->
30
28
 
31
29
  <!-- 간편결제 -->
32
30
  <package android:name="com.nhnent.payapp" /> <!-- 페이코 -->
@@ -47,8 +45,7 @@
47
45
  <package android:name="com.kbcard.cxh.appcard" /> <!-- 국민카드 -->
48
46
  <package android:name="com.kbstar.liivbank" /> <!-- 국민 리브 -->
49
47
  <package android:name="com.kbstar.reboot" /> <!-- 국민 new 리브 -->
50
- <package android:name="com.kbstar.kbbank" /> <!-- KB 스타 뱅킹 -->
51
-
48
+ <package android:name="com.kbstar.kbbank" /> <!-- KB 스타뱅킹 -->
52
49
 
53
50
  <package android:name="com.samsung.android.spay" /> <!-- 삼성페이 -->
54
51
  <package android:name="com.samsung.android.spaylite" /> <!-- 삼성페이 미니 -->
@@ -58,6 +55,7 @@
58
55
  <package android:name="com.lcacApp" /> <!-- 롯데카드 -->
59
56
  <package android:name="kr.co.samsungcard.mpocket" /> <!-- 삼성카드 -->
60
57
  <package android:name="com.shcard.smartpay" /> <!-- 신한카드-->
58
+ <package android:name="com.shinhan.smartcaremgr" /> <!-- 신한 쏠-->
61
59
  <package android:name="com.shinhancard.smartshinhan" /> <!-- 신한카드 (ARS/일반결제/Smart결제) -->
62
60
  <package android:name="com.hyundaicard.appcard" /> <!-- 현대카드 -->
63
61
  <package android:name="nh.smart.nhallonepay" /> <!-- 농협카드 -->
@@ -65,6 +63,8 @@
65
63
  <package android:name="com.wooricard.smartapp" /> <!-- 우리 WON 카드 -->
66
64
  <package android:name="com.wooribank.smart.npib" /> <!-- 우리 WON 뱅킹 -->
67
65
  <package android:name="kr.co.citibank.citimobile" /> <!-- 씨티카드 -->
66
+ <package android:name="com.mobiletoong.travelwallet" /> <!-- 트레블월렛 -->
67
+
68
68
 
69
69
 
70
70
  <!-- 계좌이체 -->
@@ -88,8 +88,10 @@
88
88
  <package android:name="com.kt.ktauth" /> <!-- KT 본인인증 -->
89
89
  <package android:name="kr.danal.app.damoum" /> <!-- 다모음 -->
90
90
  <package android:name="uplus.membership" /> <!-- U+ 멤버스 -->
91
+ <package android:name="com.sktelecom.tauth" /> <!--PASS-->
92
+ <package android:name="com.lguplus.smartotp" /> <!--PASS-->
91
93
 
92
- <!-- 해외결제 -->
93
- <package android:name="com.eg.android.AlipayGphone" /> <!-- 알리페이 -->
94
+ <!--해외결제-->
95
+ <package android:name="com.eg.android.AlipayGphone" />
94
96
  </queries>
95
97
  </manifest>
@@ -49,6 +49,7 @@ import kr.co.bootpay.webview.events.TopOpenWindowEvent;
49
49
  import java.util.ArrayList;
50
50
  import java.util.Collections;
51
51
  import java.util.List;
52
+ import android.util.Log;
52
53
 
53
54
  import android.app.Dialog;
54
55
  import android.content.Context;
@@ -123,6 +124,7 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
123
124
  @Override
124
125
  public boolean shouldOverrideUrlLoading (WebView subview, String url) {
125
126
 
127
+ Log.d("bootpay url", url);
126
128
 
127
129
  // return true;
128
130
  if(BootpayUrlHelper.shouldOverrideUrlLoading(view, url)) {
@@ -175,7 +177,7 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
175
177
 
176
178
 
177
179
  void setWebSettingCopy(WebView view, WebView newWebView) {
178
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
180
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
179
181
  newWebView.getSettings().setMediaPlaybackRequiresUserGesture( view.getSettings().getMediaPlaybackRequiresUserGesture() );
180
182
  }
181
183
 
@@ -39,6 +39,7 @@ import android.app.AlertDialog;
39
39
  import android.content.DialogInterface;
40
40
  import android.content.Intent;
41
41
  import android.widget.Toast;
42
+ import android.util.Log;
42
43
 
43
44
  public class BPCWebViewClient extends WebViewClient {
44
45
  private static String TAG = "BPCWebViewClient";
@@ -61,6 +62,9 @@ public class BPCWebViewClient extends WebViewClient {
61
62
  public void onPageFinished(WebView webView, String url) {
62
63
  super.onPageFinished(webView, url);
63
64
 
65
+
66
+ Log.d("bootpay url finish", url);
67
+
64
68
  if (!mLastLoadFailed) {
65
69
  BPCWebView reactWebView = (BPCWebView) webView;
66
70
 
@@ -92,6 +96,8 @@ public class BPCWebViewClient extends WebViewClient {
92
96
 
93
97
  @Override
94
98
  public boolean shouldOverrideUrlLoading(WebView view, String url) {
99
+ Log.d("bootpay url", url);
100
+
95
101
  if(BootpayUrlHelper.shouldOverrideUrlLoading(view, url)) {
96
102
  return true;
97
103
  }
@@ -5,43 +5,54 @@ import android.content.Intent;
5
5
  import android.content.pm.PackageManager;
6
6
  import android.net.Uri;
7
7
  import android.webkit.WebView;
8
+ import android.util.Log;
8
9
 
9
10
  import java.net.URISyntaxException;
10
11
 
11
12
 
12
13
  public class BootpayUrlHelper {
13
14
  public static boolean shouldOverrideUrlLoading(WebView view, String url) {
14
- Intent intent = getIntentWithPackage(url);
15
- Context context = view.getContext();
16
-
17
- if(isIntent(url)) {
18
- if(isInstallApp(intent, context)) return startApp(intent, context);
19
- else return startGooglePlay(intent, context);
20
- } else if(isMarket(url)) {
21
- if(isInstallApp(intent, context)) return startApp(intent, context);
22
- else return startGooglePlay(intent, context);
23
- } else if(isSpecialCase(url)) {
24
- if(isInstallApp(intent, context)) return startApp(intent, context);
25
- else return startGooglePlay(intent, context);
26
- }
27
-
28
- // return url.contains("vguardend");
29
- return false;
15
+ Intent intent = getIntentWithPackage(url);
16
+ Context context = view.getContext();
17
+
18
+ Log.d("bootpay", "doDeepLinkIfPayUrl: " + url);
19
+
20
+ if(isIntent(url)) {
21
+ Log.d("isIntent", "isInstallApp called");
22
+ if(isInstallApp(intent, context)) return startApp(intent, context);
23
+ else return startGooglePlay(intent, context);
24
+ } else if(isMarket(url)) {
25
+ if(isInstallApp(intent, context)) return startApp(intent, context);
26
+ else return startGooglePlay(intent, context);
27
+ } else if(isSpecialCase(url)) {
28
+ if(isInstallApp(intent, context)) return startApp(intent, context);
29
+ else return startGooglePlay(intent, context);
30
+ }
31
+
32
+ // return url.contains("vguardend");
33
+ return false;
30
34
  }
31
35
 
32
36
  public static Boolean isSpecialCase(String url) {
33
- return url.matches("^shinhan\\S+$")
34
- || url.startsWith("kftc-bankpay://")
35
- || url.startsWith("v3mobileplusweb://")
36
- || url.startsWith("hdcardappcardansimclick://")
37
- || url.startsWith("nidlogin://")
38
- || url.startsWith("mpocket.online.ansimclick://")
39
- || url.startsWith("wooripay://")
40
- || url.startsWith("kakaotalk://");
37
+ return url.matches("^shinhan\\S+$")
38
+ || url.startsWith("kftc-bankpay://")
39
+ || url.startsWith("v3mobileplusweb://")
40
+ || url.startsWith("hdcardappcardansimclick://")
41
+ || url.startsWith("nidlogin://")
42
+ || url.startsWith("mpocket.online.ansimclick://")
43
+ || url.startsWith("wooripay://")
44
+ || url.startsWith("ispmobile://")
45
+ || url.startsWith("kakaotalk://");
41
46
  }
42
47
 
43
48
  public static Boolean isIntent(String url) {
44
- return url.startsWith("intent:");
49
+ Log.d(
50
+ "bootpay",
51
+ String.format("url %s: %s.", url, url.startsWith("intent:"))
52
+ );
53
+
54
+
55
+ return url.startsWith("intent:");
45
56
  }
46
57
  public static Boolean isMarket(String url) {
47
58
  return url.startsWith("market://");
@@ -49,47 +60,55 @@ public class BootpayUrlHelper {
49
60
 
50
61
 
51
62
  public static Intent getIntentWithPackage(String url) {
52
- try {
53
- Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
54
- if(intent.getPackage() == null) {
55
- if (url == null) return intent;
56
- if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
57
- else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
58
- else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
59
- else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
60
- else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
61
- else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
62
- else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
63
- else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
64
- else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
65
- else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
66
- else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
63
+ try {
64
+ Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
65
+ if(intent.getPackage() == null) {
66
+ if (url == null) return intent;
67
+ if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
68
+ else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
69
+ else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
70
+ else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
71
+ else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
72
+ else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
73
+ else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
74
+ else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
75
+ else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
76
+ else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
77
+ else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
67
78
  // kvp.jjy.MispAndroid320
68
- }
69
- return intent;
70
- } catch (URISyntaxException e) {
71
- e.printStackTrace();
72
- return null;
73
79
  }
80
+ return intent;
81
+ } catch (URISyntaxException e) {
82
+ e.printStackTrace();
83
+ return null;
84
+ }
74
85
  }
75
86
 
76
87
  public static boolean isInstallApp(Intent intent, Context context) {
77
- return isExistPackageInfo(intent, context) || isExistLaunchedIntent(intent, context);
78
- }
88
+ // return isExistPackageInfo(intent, context) || isExistLaunchedIntent(intent, context);
89
+ // return intent != null && intent.getPackage() != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
79
90
 
91
+ Log.d("isInstallApp", "isInstallApp called");
80
92
 
81
- private static boolean isExistPackageInfo(Intent intent, Context context) {
82
- try {
83
- return intent != null && context.getPackageManager().getPackageInfo(intent.getPackage(), PackageManager.GET_ACTIVITIES) != null;
84
- } catch (PackageManager.NameNotFoundException e) {
85
- e.printStackTrace();
86
- return false;
87
- }
93
+ if (intent == null) {
94
+ Log.d("isInstallApp", "Intent is null");
95
+ return false;
96
+ }
97
+ String packageName = intent.getPackage();
98
+ if (packageName == null) {
99
+ Log.d("isInstallApp", "Package name is null");
100
+ return false;
101
+ }
102
+ Log.d("isInstallApp", "Package name: " + packageName);
103
+ PackageManager packageManager = context.getPackageManager();
104
+ Intent launchIntent = packageManager.getLaunchIntentForPackage(packageName);
105
+ boolean isInstalled = launchIntent != null;
106
+ Log.d("isInstallApp", "Is installed: " + isInstalled);
107
+ return isInstalled;
88
108
  }
89
109
 
90
- private static boolean isExistLaunchedIntent(Intent intent, Context context) {
91
- return intent != null && intent.getPackage() != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
92
- }
110
+
111
+
93
112
 
94
113
  public static boolean startApp(Intent intent, Context context) {
95
114
  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -98,25 +117,30 @@ public class BootpayUrlHelper {
98
117
  }
99
118
 
100
119
  public static boolean startGooglePlay(Intent intent, Context context) {
101
- final String appPackageName = intent.getPackage();
102
- if(appPackageName == null) {
103
- Uri dataUri = intent.getData();
104
-
105
- try {
106
- context.startActivity(new Intent(Intent.ACTION_VIEW, intent.getData()));
107
- } catch (Exception e) {
108
- String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
109
- if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
110
-
111
- context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName)));
112
- }
113
- return true;
114
- }
120
+ final String appPackageName = intent.getPackage();
121
+
122
+ if(appPackageName == null) {
123
+ Uri dataUri = intent.getData();
124
+
115
125
  try {
116
- context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
117
- } catch (android.content.ActivityNotFoundException anfe) {
118
- context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
126
+ Intent addIntent = new Intent(Intent.ACTION_VIEW, intent.getData());
127
+ context.startActivity(addIntent);
128
+ } catch (Exception e) {
129
+ String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
130
+ if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
131
+
132
+ Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
133
+ context.startActivity(addIntent);
119
134
  }
120
135
  return true;
136
+ }
137
+ try {
138
+ Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
139
+ context.startActivity(addIntent);
140
+ } catch (android.content.ActivityNotFoundException anfe) {
141
+ Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName));
142
+ context.startActivity(addIntent);
143
+ }
144
+ return true;
121
145
  }
122
146
  }
@@ -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 _jsxRuntime=require("react/jsx-runtime");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 _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 _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 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));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 _jsxRuntime=require("react/jsx-runtime");var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");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 _excluded=["fraudulentWebsiteWarningEnabled","javaScriptEnabled","cacheEnabled","originWhitelist","useSharedProcessPool","textInteractionEnabled","injectedJavaScript","injectedJavaScriptBeforeContentLoaded","injectedJavaScriptForMainFrameOnly","injectedJavaScriptBeforeContentLoadedForMainFrameOnly","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onContentProcessDidTerminate","onFileDownload","onHttpError","onMessage","onOpenWindow","renderLoading","renderError","style","containerStyle","source","nativeConfig","allowsInlineMediaPlayback","allowsAirPlayForMediaPlayback","mediaPlaybackRequiresUserAction","dataDetectorTypes","incognito","decelerationRate","onShouldStartLoadWithRequest"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.ios.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 processDecelerationRate=function processDecelerationRate(decelerationRate){var newDecelerationRate=decelerationRate;if(newDecelerationRate==='normal'){newDecelerationRate=0.998;}else if(newDecelerationRate==='fast'){newDecelerationRate=0.99;}return newDecelerationRate;};var useWarnIfChanges=function useWarnIfChanges(value,name){var ref=(0,_react.useRef)(value);if(ref.current!==value){console.warn(`Changes to property ${name} do nothing after the initial render.`);ref.current=value;}};var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$fraudulentWebsit=_ref.fraudulentWebsiteWarningEnabled,fraudulentWebsiteWarningEnabled=_ref$fraudulentWebsit===void 0?true:_ref$fraudulentWebsit,_ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$useSharedProcess=_ref.useSharedProcessPool,useSharedProcessPool=_ref$useSharedProcess===void 0?true:_ref$useSharedProcess,_ref$textInteractionE=_ref.textInteractionEnabled,textInteractionEnabled=_ref$textInteractionE===void 0?true:_ref$textInteractionE,injectedJavaScript=_ref.injectedJavaScript,injectedJavaScriptBeforeContentLoaded=_ref.injectedJavaScriptBeforeContentLoaded,_ref$injectedJavaScri=_ref.injectedJavaScriptForMainFrameOnly,injectedJavaScriptForMainFrameOnly=_ref$injectedJavaScri===void 0?true:_ref$injectedJavaScri,_ref$injectedJavaScri2=_ref.injectedJavaScriptBeforeContentLoadedForMainFrameOnly,injectedJavaScriptBeforeContentLoadedForMainFrameOnly=_ref$injectedJavaScri2===void 0?true:_ref$injectedJavaScri2,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onContentProcessDidTerminateProp=_ref.onContentProcessDidTerminate,onFileDownload=_ref.onFileDownload,onHttpErrorProp=_ref.onHttpError,onMessageProp=_ref.onMessage,onOpenWindowProp=_ref.onOpenWindow,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,allowsInlineMediaPlayback=_ref.allowsInlineMediaPlayback,allowsAirPlayForMediaPlayback=_ref.allowsAirPlayForMediaPlayback,mediaPlaybackRequiresUserAction=_ref.mediaPlaybackRequiresUserAction,dataDetectorTypes=_ref.dataDetectorTypes,incognito=_ref.incognito,decelerationRateProp=_ref.decelerationRate,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,_url){var lockIdentifier=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_NativeBPCWebView.default.shouldStartLoadWithLockIdentifier(shouldStart,lockIdentifier);},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onMessageProp:onMessageProp,onOpenWindowProp:onOpenWindowProp,startInLoadingState:startInLoadingState,originWhitelist:originWhitelist,onShouldStartLoadWithRequestProp:onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback:onShouldStartLoadWithRequestCallback,onContentProcessDidTerminateProp:onContentProcessDidTerminateProp}),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,onContentProcessDidTerminate=_useWebViewLogic.onContentProcessDidTerminate;(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);},clearCache:function clearCache(includeDiskFiles){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearCache(webViewRef.current,includeDiskFiles);}};},[setViewState,webViewRef]);useWarnIfChanges(allowsInlineMediaPlayback,'allowsInlineMediaPlayback');useWarnIfChanges(allowsAirPlayForMediaPlayback,'allowsAirPlayForMediaPlayback');useWarnIfChanges(incognito,'incognito');useWarnIfChanges(mediaPlaybackRequiresUserAction,'mediaPlaybackRequiresUserAction');useWarnIfChanges(dataDetectorTypes,'dataDetectorTypes');var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){var _lastErrorEvent$code,_lastErrorEvent$descr;(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');otherView=(renderError||_WebViewShared.defaultRenderError)(lastErrorEvent==null?void 0:lastErrorEvent.domain,(_lastErrorEvent$code=lastErrorEvent==null?void 0:lastErrorEvent.code)!=null?_lastErrorEvent$code:0,(_lastErrorEvent$descr=lastErrorEvent==null?void 0:lastErrorEvent.description)!=null?_lastErrorEvent$descr:'');}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];var decelerationRate=processDecelerationRate(decelerationRateProp);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,{fraudulentWebsiteWarningEnabled:fraudulentWebsiteWarningEnabled,javaScriptEnabled:javaScriptEnabled,cacheEnabled:cacheEnabled,useSharedProcessPool:useSharedProcessPool,textInteractionEnabled:textInteractionEnabled,decelerationRate:decelerationRate,messagingEnabled:typeof onMessageProp==='function',messagingModuleName:"",onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onFileDownload:onFileDownload,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onOpenWindow:onOpenWindowProp&&onOpenWindow,hasOnOpenWindowEvent:onOpenWindowProp!==undefined,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onContentProcessDidTerminate:onContentProcessDidTerminate,injectedJavaScript:injectedJavaScript,injectedJavaScriptBeforeContentLoaded:injectedJavaScriptBeforeContentLoaded,injectedJavaScriptForMainFrameOnly:injectedJavaScriptForMainFrameOnly,injectedJavaScriptBeforeContentLoadedForMainFrameOnly:injectedJavaScriptBeforeContentLoadedForMainFrameOnly,dataDetectorTypes:!dataDetectorTypes||Array.isArray(dataDetectorTypes)?dataDetectorTypes:[dataDetectorTypes],allowsAirPlayForMediaPlayback:allowsAirPlayForMediaPlayback,allowsInlineMediaPlayback:allowsInlineMediaPlayback,incognito:incognito,mediaPlaybackRequiresUserAction:mediaPlaybackRequiresUserAction,newSource:newSource,style:webViewStyles,hasOnFileDownload:!!onFileDownload,ref:webViewRef,source:sourceResolved},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return true;});return function isFileUploadSupported(){return _ref6.apply(this,arguments);};}();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 _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));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 _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=["fraudulentWebsiteWarningEnabled","javaScriptEnabled","cacheEnabled","originWhitelist","useSharedProcessPool","textInteractionEnabled","injectedJavaScript","injectedJavaScriptBeforeContentLoaded","injectedJavaScriptForMainFrameOnly","injectedJavaScriptBeforeContentLoadedForMainFrameOnly","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onContentProcessDidTerminate","onFileDownload","onHttpError","onMessage","onOpenWindow","renderLoading","renderError","style","containerStyle","source","nativeConfig","allowsInlineMediaPlayback","allowsAirPlayForMediaPlayback","mediaPlaybackRequiresUserAction","dataDetectorTypes","incognito","decelerationRate","onShouldStartLoadWithRequest"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.ios.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 processDecelerationRate=function processDecelerationRate(decelerationRate){var newDecelerationRate=decelerationRate;if(newDecelerationRate==='normal'){newDecelerationRate=0.998;}else if(newDecelerationRate==='fast'){newDecelerationRate=0.99;}return newDecelerationRate;};var useWarnIfChanges=function useWarnIfChanges(value,name){var ref=(0,_react.useRef)(value);if(ref.current!==value){console.warn(`Changes to property ${name} do nothing after the initial render.`);ref.current=value;}};var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$fraudulentWebsit=_ref.fraudulentWebsiteWarningEnabled,fraudulentWebsiteWarningEnabled=_ref$fraudulentWebsit===void 0?true:_ref$fraudulentWebsit,_ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$useSharedProcess=_ref.useSharedProcessPool,useSharedProcessPool=_ref$useSharedProcess===void 0?true:_ref$useSharedProcess,_ref$textInteractionE=_ref.textInteractionEnabled,textInteractionEnabled=_ref$textInteractionE===void 0?true:_ref$textInteractionE,injectedJavaScript=_ref.injectedJavaScript,injectedJavaScriptBeforeContentLoaded=_ref.injectedJavaScriptBeforeContentLoaded,_ref$injectedJavaScri=_ref.injectedJavaScriptForMainFrameOnly,injectedJavaScriptForMainFrameOnly=_ref$injectedJavaScri===void 0?true:_ref$injectedJavaScri,_ref$injectedJavaScri2=_ref.injectedJavaScriptBeforeContentLoadedForMainFrameOnly,injectedJavaScriptBeforeContentLoadedForMainFrameOnly=_ref$injectedJavaScri2===void 0?true:_ref$injectedJavaScri2,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onContentProcessDidTerminateProp=_ref.onContentProcessDidTerminate,onFileDownload=_ref.onFileDownload,onHttpErrorProp=_ref.onHttpError,onMessageProp=_ref.onMessage,onOpenWindowProp=_ref.onOpenWindow,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,allowsInlineMediaPlayback=_ref.allowsInlineMediaPlayback,allowsAirPlayForMediaPlayback=_ref.allowsAirPlayForMediaPlayback,mediaPlaybackRequiresUserAction=_ref.mediaPlaybackRequiresUserAction,dataDetectorTypes=_ref.dataDetectorTypes,incognito=_ref.incognito,decelerationRateProp=_ref.decelerationRate,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,_url){var lockIdentifier=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_NativeBPCWebView.default.shouldStartLoadWithLockIdentifier(shouldStart,lockIdentifier);},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onMessageProp:onMessageProp,onOpenWindowProp:onOpenWindowProp,startInLoadingState:startInLoadingState,originWhitelist:originWhitelist,onShouldStartLoadWithRequestProp:onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback:onShouldStartLoadWithRequestCallback,onContentProcessDidTerminateProp:onContentProcessDidTerminateProp}),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,onContentProcessDidTerminate=_useWebViewLogic.onContentProcessDidTerminate;(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);},clearCache:function clearCache(includeDiskFiles){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearCache(webViewRef.current,includeDiskFiles);}};},[setViewState,webViewRef]);useWarnIfChanges(allowsInlineMediaPlayback,'allowsInlineMediaPlayback');useWarnIfChanges(allowsAirPlayForMediaPlayback,'allowsAirPlayForMediaPlayback');useWarnIfChanges(incognito,'incognito');useWarnIfChanges(mediaPlaybackRequiresUserAction,'mediaPlaybackRequiresUserAction');useWarnIfChanges(dataDetectorTypes,'dataDetectorTypes');var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){var _lastErrorEvent$code,_lastErrorEvent$descr;(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');otherView=(renderError||_WebViewShared.defaultRenderError)(lastErrorEvent==null?void 0:lastErrorEvent.domain,(_lastErrorEvent$code=lastErrorEvent==null?void 0:lastErrorEvent.code)!=null?_lastErrorEvent$code:0,(_lastErrorEvent$descr=lastErrorEvent==null?void 0:lastErrorEvent.description)!=null?_lastErrorEvent$descr:'');}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];var decelerationRate=processDecelerationRate(decelerationRateProp);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,{fraudulentWebsiteWarningEnabled:fraudulentWebsiteWarningEnabled,javaScriptEnabled:javaScriptEnabled,cacheEnabled:cacheEnabled,useSharedProcessPool:useSharedProcessPool,textInteractionEnabled:textInteractionEnabled,decelerationRate:decelerationRate,messagingEnabled:typeof onMessageProp==='function',messagingModuleName:"",onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onFileDownload:onFileDownload,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onOpenWindow:onOpenWindowProp&&onOpenWindow,hasOnOpenWindowEvent:onOpenWindowProp!==undefined,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onContentProcessDidTerminate:onContentProcessDidTerminate,injectedJavaScript:injectedJavaScript,injectedJavaScriptBeforeContentLoaded:injectedJavaScriptBeforeContentLoaded,injectedJavaScriptForMainFrameOnly:injectedJavaScriptForMainFrameOnly,injectedJavaScriptBeforeContentLoadedForMainFrameOnly:injectedJavaScriptBeforeContentLoadedForMainFrameOnly,dataDetectorTypes:!dataDetectorTypes||Array.isArray(dataDetectorTypes)?dataDetectorTypes:[dataDetectorTypes],allowsAirPlayForMediaPlayback:allowsAirPlayForMediaPlayback,allowsInlineMediaPlayback:allowsInlineMediaPlayback,incognito:incognito,mediaPlaybackRequiresUserAction:mediaPlaybackRequiresUserAction,newSource:newSource,style:webViewStyles,hasOnFileDownload:!!onFileDownload,ref:webViewRef,source:sourceResolved},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return true;});return function isFileUploadSupported(){return _ref6.apply(this,arguments);};}();var WebView=Object.assign(WebViewComponent,{isFileUploadSupported:isFileUploadSupported});var _default=exports.default=WebView;
package/lib/WebView.js CHANGED
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WebView=void 0;var _jsxRuntime=require("react/jsx-runtime");var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.tsx";var WebView=exports.WebView=function WebView(){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{alignSelf:'flex-start'},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:{color:'red'},children:"React Native WebView does not support this platform."})});};var _default=exports.default=WebView;
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.WebView=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.tsx";var WebView=exports.WebView=function WebView(){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:{alignSelf:'flex-start'},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:{color:'red'},children:"React Native WebView does not support this platform."})});};var _default=exports.default=WebView;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _jsxRuntime=require("react/jsx-runtime");var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _invariant=_interopRequireDefault(require("invariant"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var _WebViewNativeComponent=_interopRequireDefault(require("./WebViewNativeComponent.macos"));var _NativeBPCWebView=_interopRequireDefault(require("./NativeBPCWebView"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _excluded=["javaScriptEnabled","cacheEnabled","originWhitelist","useSharedProcessPool","injectedJavaScript","injectedJavaScriptBeforeContentLoaded","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onMessage","renderLoading","renderError","style","containerStyle","source","nativeConfig","allowsInlineMediaPlayback","allowsAirPlayForMediaPlayback","mediaPlaybackRequiresUserAction","incognito","onShouldStartLoadWithRequest"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.macos.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 Commands=(0,_codegenNativeCommands.default)({supportedCommands:['goBack','goForward','reload','stopLoading','injectJavaScript','requestFocus','postMessage','loadUrl']});var resolveAssetSource=_reactNative.Image.resolveAssetSource;var useWarnIfChanges=function useWarnIfChanges(value,name){var ref=(0,_react.useRef)(value);if(ref.current!==value){console.warn(`Changes to property ${name} do nothing after the initial render.`);ref.current=value;}};var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$useSharedProcess=_ref.useSharedProcessPool,useSharedProcessPool=_ref$useSharedProcess===void 0?true:_ref$useSharedProcess,injectedJavaScript=_ref.injectedJavaScript,injectedJavaScriptBeforeContentLoaded=_ref.injectedJavaScriptBeforeContentLoaded,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onMessageProp=_ref.onMessage,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,allowsInlineMediaPlayback=_ref.allowsInlineMediaPlayback,allowsAirPlayForMediaPlayback=_ref.allowsAirPlayForMediaPlayback,mediaPlaybackRequiresUserAction=_ref.mediaPlaybackRequiresUserAction,incognito=_ref.incognito,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,_url){var lockIdentifier=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_NativeBPCWebView.default.shouldStartLoadWithLockIdentifier(!!shouldStart,lockIdentifier);},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onMessageProp:onMessageProp,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,onContentProcessDidTerminate=_useWebViewLogic.onContentProcessDidTerminate;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return Commands.goForward(webViewRef.current);},goBack:function goBack(){return Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');Commands.reload(webViewRef.current);},stopLoading:function stopLoading(){return Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return Commands.requestFocus(webViewRef.current);}};},[setViewState,webViewRef]);useWarnIfChanges(allowsInlineMediaPlayback,'allowsInlineMediaPlayback');useWarnIfChanges(allowsAirPlayForMediaPlayback,'allowsAirPlayForMediaPlayback');useWarnIfChanges(incognito,'incognito');useWarnIfChanges(mediaPlaybackRequiresUserAction,'mediaPlaybackRequiresUserAction');var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');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];var NativeWebView=(nativeConfig==null?void 0:nativeConfig.component)||_WebViewNativeComponent.default;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{javaScriptEnabled:javaScriptEnabled,cacheEnabled:cacheEnabled,useSharedProcessPool:useSharedProcessPool,messagingEnabled:typeof onMessageProp==='function',onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onContentProcessDidTerminate:onContentProcessDidTerminate,injectedJavaScript:injectedJavaScript,injectedJavaScriptBeforeContentLoaded:injectedJavaScriptBeforeContentLoaded,allowsAirPlayForMediaPlayback:allowsAirPlayForMediaPlayback,allowsInlineMediaPlayback:allowsInlineMediaPlayback,incognito:incognito,mediaPlaybackRequiresUserAction:mediaPlaybackRequiresUserAction,ref:webViewRef,source:resolveAssetSource(source),style:webViewStyles},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){return true;});return function isFileUploadSupported(){return _ref2.apply(this,arguments);};}();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 _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _invariant=_interopRequireDefault(require("invariant"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var _WebViewNativeComponent=_interopRequireDefault(require("./WebViewNativeComponent.macos"));var _NativeBPCWebView=_interopRequireDefault(require("./NativeBPCWebView"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["javaScriptEnabled","cacheEnabled","originWhitelist","useSharedProcessPool","injectedJavaScript","injectedJavaScriptBeforeContentLoaded","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onMessage","renderLoading","renderError","style","containerStyle","source","nativeConfig","allowsInlineMediaPlayback","allowsAirPlayForMediaPlayback","mediaPlaybackRequiresUserAction","incognito","onShouldStartLoadWithRequest"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.macos.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 Commands=(0,_codegenNativeCommands.default)({supportedCommands:['goBack','goForward','reload','stopLoading','injectJavaScript','requestFocus','postMessage','loadUrl']});var resolveAssetSource=_reactNative.Image.resolveAssetSource;var useWarnIfChanges=function useWarnIfChanges(value,name){var ref=(0,_react.useRef)(value);if(ref.current!==value){console.warn(`Changes to property ${name} do nothing after the initial render.`);ref.current=value;}};var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$useSharedProcess=_ref.useSharedProcessPool,useSharedProcessPool=_ref$useSharedProcess===void 0?true:_ref$useSharedProcess,injectedJavaScript=_ref.injectedJavaScript,injectedJavaScriptBeforeContentLoaded=_ref.injectedJavaScriptBeforeContentLoaded,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onMessageProp=_ref.onMessage,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,allowsInlineMediaPlayback=_ref.allowsInlineMediaPlayback,allowsAirPlayForMediaPlayback=_ref.allowsAirPlayForMediaPlayback,mediaPlaybackRequiresUserAction=_ref.mediaPlaybackRequiresUserAction,incognito=_ref.incognito,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,_url){var lockIdentifier=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_NativeBPCWebView.default.shouldStartLoadWithLockIdentifier(!!shouldStart,lockIdentifier);},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onMessageProp:onMessageProp,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,onContentProcessDidTerminate=_useWebViewLogic.onContentProcessDidTerminate;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return Commands.goForward(webViewRef.current);},goBack:function goBack(){return Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');Commands.reload(webViewRef.current);},stopLoading:function stopLoading(){return Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return Commands.requestFocus(webViewRef.current);}};},[setViewState,webViewRef]);useWarnIfChanges(allowsInlineMediaPlayback,'allowsInlineMediaPlayback');useWarnIfChanges(allowsAirPlayForMediaPlayback,'allowsAirPlayForMediaPlayback');useWarnIfChanges(incognito,'incognito');useWarnIfChanges(mediaPlaybackRequiresUserAction,'mediaPlaybackRequiresUserAction');var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');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];var NativeWebView=(nativeConfig==null?void 0:nativeConfig.component)||_WebViewNativeComponent.default;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{javaScriptEnabled:javaScriptEnabled,cacheEnabled:cacheEnabled,useSharedProcessPool:useSharedProcessPool,messagingEnabled:typeof onMessageProp==='function',onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onContentProcessDidTerminate:onContentProcessDidTerminate,injectedJavaScript:injectedJavaScript,injectedJavaScriptBeforeContentLoaded:injectedJavaScriptBeforeContentLoaded,allowsAirPlayForMediaPlayback:allowsAirPlayForMediaPlayback,allowsInlineMediaPlayback:allowsInlineMediaPlayback,incognito:incognito,mediaPlaybackRequiresUserAction:mediaPlaybackRequiresUserAction,ref:webViewRef,source:resolveAssetSource(source),style:webViewStyles},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){return true;});return function isFileUploadSupported(){return _ref2.apply(this,arguments);};}();var WebView=Object.assign(WebViewComponent,{isFileUploadSupported:isFileUploadSupported});var _default=exports.default=WebView;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _jsxRuntime=require("react/jsx-runtime");var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var _invariant=_interopRequireDefault(require("invariant"));var _WebViewNativeComponent=require("./WebViewNativeComponent.windows");var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _excluded=["cacheEnabled","originWhitelist","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onMessage","renderLoading","renderError","style","containerStyle","source","nativeConfig","onShouldStartLoadWithRequest","useWebView2"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.windows.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 Commands=(0,_codegenNativeCommands.default)({supportedCommands:['goBack','goForward','reload','stopLoading','injectJavaScript','requestFocus','postMessage','loadUrl']});var resolveAssetSource=_reactNative.Image.resolveAssetSource;var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onMessageProp=_ref.onMessage,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,useWebView2=_ref.useWebView2,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var webViewRef=(0,_react.useRef)(null);var RCTWebViewString=useWebView2?'RCTWebView2':'RCTWebView';var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,url,lockIdentifier){if(lockIdentifier){if(RCTWebViewString==='RCTWebView'){_reactNative.NativeModules.RCTWebView.onShouldStartLoadWithRequestCallback(shouldStart,lockIdentifier);}else{_reactNative.NativeModules.RCTWebView2.onShouldStartLoadWithRequestCallback(shouldStart,lockIdentifier);}}else if(shouldStart){Commands.loadUrl(webViewRef,url);}},[RCTWebViewString]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onMessageProp:onMessageProp,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;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return Commands.goForward(webViewRef.current);},goBack:function goBack(){return Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');Commands.reload(webViewRef.current);},stopLoading:function stopLoading(){return Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return Commands.requestFocus(webViewRef.current);}};},[setViewState,webViewRef]);var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');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];var NativeWebView=useWebView2?_WebViewNativeComponent.RCTWebView2:_WebViewNativeComponent.RCTWebView;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{messagingEnabled:typeof onMessageProp==='function',onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,ref:webViewRef,source:resolveAssetSource(source),style:webViewStyles,cacheEnabled:cacheEnabled},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){return false;});return function isFileUploadSupported(){return _ref2.apply(this,arguments);};}();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 _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var _invariant=_interopRequireDefault(require("invariant"));var _WebViewNativeComponent=require("./WebViewNativeComponent.windows");var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["cacheEnabled","originWhitelist","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onMessage","renderLoading","renderError","style","containerStyle","source","nativeConfig","onShouldStartLoadWithRequest","useWebView2"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebView.windows.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 Commands=(0,_codegenNativeCommands.default)({supportedCommands:['goBack','goForward','reload','stopLoading','injectJavaScript','requestFocus','postMessage','loadUrl']});var resolveAssetSource=_reactNative.Image.resolveAssetSource;var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onMessageProp=_ref.onMessage,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,useWebView2=_ref.useWebView2,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var webViewRef=(0,_react.useRef)(null);var RCTWebViewString=useWebView2?'RCTWebView2':'RCTWebView';var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,url,lockIdentifier){if(lockIdentifier){if(RCTWebViewString==='RCTWebView'){_reactNative.NativeModules.RCTWebView.onShouldStartLoadWithRequestCallback(shouldStart,lockIdentifier);}else{_reactNative.NativeModules.RCTWebView2.onShouldStartLoadWithRequestCallback(shouldStart,lockIdentifier);}}else if(shouldStart){Commands.loadUrl(webViewRef,url);}},[RCTWebViewString]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onMessageProp:onMessageProp,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;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return Commands.goForward(webViewRef.current);},goBack:function goBack(){return Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');Commands.reload(webViewRef.current);},stopLoading:function stopLoading(){return Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return Commands.requestFocus(webViewRef.current);}};},[setViewState,webViewRef]);var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');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];var NativeWebView=useWebView2?_WebViewNativeComponent.RCTWebView2:_WebViewNativeComponent.RCTWebView;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{messagingEnabled:typeof onMessageProp==='function',onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,ref:webViewRef,source:resolveAssetSource(source),style:webViewStyles,cacheEnabled:cacheEnabled},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){return false;});return function isFileUploadSupported(){return _ref2.apply(this,arguments);};}();var WebView=Object.assign(WebViewComponent,{isFileUploadSupported:isFileUploadSupported});var _default=exports.default=WebView;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useWebViewLogic=exports.defaultRenderLoading=exports.defaultRenderError=exports.defaultOriginWhitelist=exports.createOnShouldStartLoadWithRequest=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _jsxRuntime=require("react/jsx-runtime");var _escapeStringRegexp=_interopRequireDefault(require("escape-string-regexp"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebViewShared.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 defaultOriginWhitelist=exports.defaultOriginWhitelist=['http://*','https://*'];var extractOrigin=function extractOrigin(url){var result=/^[A-Za-z][A-Za-z0-9+\-.]+:(\/\/)?[^/]*/.exec(url);return result===null?'':result[0];};var originWhitelistToRegex=function originWhitelistToRegex(originWhitelist){return`^${(0,_escapeStringRegexp.default)(originWhitelist).replace(/\\\*/g,'.*')}`;};var passesWhitelist=function passesWhitelist(compiledWhitelist,url){var origin=extractOrigin(url);return compiledWhitelist.some(function(x){return new RegExp(x).test(origin);});};var compileWhitelist=function compileWhitelist(originWhitelist){return['about:blank'].concat((0,_toConsumableArray2.default)(originWhitelist||[])).map(originWhitelistToRegex);};var createOnShouldStartLoadWithRequest=exports.createOnShouldStartLoadWithRequest=function createOnShouldStartLoadWithRequest(loadRequest,originWhitelist,onShouldStartLoadWithRequest){return function(_ref){var nativeEvent=_ref.nativeEvent;var shouldStart=true;var url=nativeEvent.url,lockIdentifier=nativeEvent.lockIdentifier;if(!passesWhitelist(compileWhitelist(originWhitelist),url)){_reactNative.Linking.canOpenURL(url).then(function(supported){if(supported){return _reactNative.Linking.openURL(url);}console.warn(`Can't open url: ${url}`);return undefined;}).catch(function(e){console.warn('Error opening URL: ',e);});shouldStart=false;}else if(onShouldStartLoadWithRequest){shouldStart=onShouldStartLoadWithRequest(nativeEvent);}loadRequest(shouldStart,url,lockIdentifier);};};var defaultRenderLoading=exports.defaultRenderLoading=function defaultRenderLoading(){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:_WebView.default.loadingOrErrorView,children:(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{})});};var defaultRenderError=exports.defaultRenderError=function defaultRenderError(errorDomain,errorCode,errorDesc){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_WebView.default.loadingOrErrorView,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorTextTitle,children:"Error loading page"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorText,children:`Domain: ${errorDomain}`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorText,children:`Error Code: ${errorCode}`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorText,children:`Description: ${errorDesc}`})]});};var useWebViewLogic=exports.useWebViewLogic=function useWebViewLogic(_ref2){var startInLoadingState=_ref2.startInLoadingState,onNavigationStateChange=_ref2.onNavigationStateChange,onLoadStart=_ref2.onLoadStart,onLoad=_ref2.onLoad,onLoadProgress=_ref2.onLoadProgress,onLoadEnd=_ref2.onLoadEnd,onError=_ref2.onError,onHttpErrorProp=_ref2.onHttpErrorProp,onMessageProp=_ref2.onMessageProp,onOpenWindowProp=_ref2.onOpenWindowProp,onRenderProcessGoneProp=_ref2.onRenderProcessGoneProp,onContentProcessDidTerminateProp=_ref2.onContentProcessDidTerminateProp,originWhitelist=_ref2.originWhitelist,onShouldStartLoadWithRequestProp=_ref2.onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback=_ref2.onShouldStartLoadWithRequestCallback;var _useState=(0,_react.useState)(startInLoadingState?"LOADING":"IDLE"),_useState2=(0,_slicedToArray2.default)(_useState,2),viewState=_useState2[0],setViewState=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),lastErrorEvent=_useState4[0],setLastErrorEvent=_useState4[1];var startUrl=(0,_react.useRef)(null);var updateNavigationState=(0,_react.useCallback)(function(event){onNavigationStateChange==null?void 0:onNavigationStateChange(event.nativeEvent);},[onNavigationStateChange]);var onLoadingStart=(0,_react.useCallback)(function(event){startUrl.current=event.nativeEvent.url;onLoadStart==null?void 0:onLoadStart(event);updateNavigationState(event);},[onLoadStart,updateNavigationState]);var onLoadingError=(0,_react.useCallback)(function(event){event.persist();if(onError){onError(event);}else{console.warn('Encountered an error loading page',event.nativeEvent);}onLoadEnd==null?void 0:onLoadEnd(event);if(event.isDefaultPrevented()){return;};setViewState('ERROR');setLastErrorEvent(event.nativeEvent);},[onError,onLoadEnd]);var onHttpError=(0,_react.useCallback)(function(event){onHttpErrorProp==null?void 0:onHttpErrorProp(event);},[onHttpErrorProp]);var onRenderProcessGone=(0,_react.useCallback)(function(event){onRenderProcessGoneProp==null?void 0:onRenderProcessGoneProp(event);},[onRenderProcessGoneProp]);var onContentProcessDidTerminate=(0,_react.useCallback)(function(event){onContentProcessDidTerminateProp==null?void 0:onContentProcessDidTerminateProp(event);},[onContentProcessDidTerminateProp]);var onLoadingFinish=(0,_react.useCallback)(function(event){onLoad==null?void 0:onLoad(event);onLoadEnd==null?void 0:onLoadEnd(event);var url=event.nativeEvent.url;if(_reactNative.Platform.OS!=="android"||url===startUrl.current){setViewState('IDLE');}updateNavigationState(event);},[onLoad,onLoadEnd,updateNavigationState]);var onMessage=(0,_react.useCallback)(function(event){onMessageProp==null?void 0:onMessageProp(event);},[onMessageProp]);var onLoadingProgress=(0,_react.useCallback)(function(event){var progress=event.nativeEvent.progress;if(_reactNative.Platform.OS==="android"&&progress===1){setViewState(function(prevViewState){return prevViewState==='LOADING'?'IDLE':prevViewState;});}onLoadProgress==null?void 0:onLoadProgress(event);},[onLoadProgress]);var onShouldStartLoadWithRequest=(0,_react.useMemo)(function(){return createOnShouldStartLoadWithRequest(onShouldStartLoadWithRequestCallback,originWhitelist,onShouldStartLoadWithRequestProp);},[originWhitelist,onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback]);var onOpenWindow=(0,_react.useCallback)(function(event){onOpenWindowProp==null?void 0:onOpenWindowProp(event);},[onOpenWindowProp]);return{onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onLoadingStart:onLoadingStart,onLoadingProgress:onLoadingProgress,onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onHttpError:onHttpError,onRenderProcessGone:onRenderProcessGone,onContentProcessDidTerminate:onContentProcessDidTerminate,onMessage:onMessage,onOpenWindow:onOpenWindow,viewState:viewState,setViewState:setViewState,lastErrorEvent:lastErrorEvent};};
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useWebViewLogic=exports.defaultRenderLoading=exports.defaultRenderError=exports.defaultOriginWhitelist=exports.createOnShouldStartLoadWithRequest=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _escapeStringRegexp=_interopRequireDefault(require("escape-string-regexp"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/taesupyoon/bootpay/client/react-native/react-native-webview-bootpay/src/WebViewShared.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 defaultOriginWhitelist=exports.defaultOriginWhitelist=['http://*','https://*'];var extractOrigin=function extractOrigin(url){var result=/^[A-Za-z][A-Za-z0-9+\-.]+:(\/\/)?[^/]*/.exec(url);return result===null?'':result[0];};var originWhitelistToRegex=function originWhitelistToRegex(originWhitelist){return`^${(0,_escapeStringRegexp.default)(originWhitelist).replace(/\\\*/g,'.*')}`;};var passesWhitelist=function passesWhitelist(compiledWhitelist,url){var origin=extractOrigin(url);return compiledWhitelist.some(function(x){return new RegExp(x).test(origin);});};var compileWhitelist=function compileWhitelist(originWhitelist){return['about:blank'].concat((0,_toConsumableArray2.default)(originWhitelist||[])).map(originWhitelistToRegex);};var createOnShouldStartLoadWithRequest=exports.createOnShouldStartLoadWithRequest=function createOnShouldStartLoadWithRequest(loadRequest,originWhitelist,onShouldStartLoadWithRequest){return function(_ref){var nativeEvent=_ref.nativeEvent;var shouldStart=true;var url=nativeEvent.url,lockIdentifier=nativeEvent.lockIdentifier;if(!passesWhitelist(compileWhitelist(originWhitelist),url)){_reactNative.Linking.canOpenURL(url).then(function(supported){if(supported){return _reactNative.Linking.openURL(url);}console.warn(`Can't open url: ${url}`);return undefined;}).catch(function(e){console.warn('Error opening URL: ',e);});shouldStart=false;}else if(onShouldStartLoadWithRequest){shouldStart=onShouldStartLoadWithRequest(nativeEvent);}loadRequest(shouldStart,url,lockIdentifier);};};var defaultRenderLoading=exports.defaultRenderLoading=function defaultRenderLoading(){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:_WebView.default.loadingOrErrorView,children:(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{})});};var defaultRenderError=exports.defaultRenderError=function defaultRenderError(errorDomain,errorCode,errorDesc){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_WebView.default.loadingOrErrorView,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorTextTitle,children:"Error loading page"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorText,children:`Domain: ${errorDomain}`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorText,children:`Error Code: ${errorCode}`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.errorText,children:`Description: ${errorDesc}`})]});};var useWebViewLogic=exports.useWebViewLogic=function useWebViewLogic(_ref2){var startInLoadingState=_ref2.startInLoadingState,onNavigationStateChange=_ref2.onNavigationStateChange,onLoadStart=_ref2.onLoadStart,onLoad=_ref2.onLoad,onLoadProgress=_ref2.onLoadProgress,onLoadEnd=_ref2.onLoadEnd,onError=_ref2.onError,onHttpErrorProp=_ref2.onHttpErrorProp,onMessageProp=_ref2.onMessageProp,onOpenWindowProp=_ref2.onOpenWindowProp,onRenderProcessGoneProp=_ref2.onRenderProcessGoneProp,onContentProcessDidTerminateProp=_ref2.onContentProcessDidTerminateProp,originWhitelist=_ref2.originWhitelist,onShouldStartLoadWithRequestProp=_ref2.onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback=_ref2.onShouldStartLoadWithRequestCallback;var _useState=(0,_react.useState)(startInLoadingState?"LOADING":"IDLE"),_useState2=(0,_slicedToArray2.default)(_useState,2),viewState=_useState2[0],setViewState=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),lastErrorEvent=_useState4[0],setLastErrorEvent=_useState4[1];var startUrl=(0,_react.useRef)(null);var updateNavigationState=(0,_react.useCallback)(function(event){onNavigationStateChange==null?void 0:onNavigationStateChange(event.nativeEvent);},[onNavigationStateChange]);var onLoadingStart=(0,_react.useCallback)(function(event){startUrl.current=event.nativeEvent.url;onLoadStart==null?void 0:onLoadStart(event);updateNavigationState(event);},[onLoadStart,updateNavigationState]);var onLoadingError=(0,_react.useCallback)(function(event){event.persist();if(onError){onError(event);}else{console.warn('Encountered an error loading page',event.nativeEvent);}onLoadEnd==null?void 0:onLoadEnd(event);if(event.isDefaultPrevented()){return;};setViewState('ERROR');setLastErrorEvent(event.nativeEvent);},[onError,onLoadEnd]);var onHttpError=(0,_react.useCallback)(function(event){onHttpErrorProp==null?void 0:onHttpErrorProp(event);},[onHttpErrorProp]);var onRenderProcessGone=(0,_react.useCallback)(function(event){onRenderProcessGoneProp==null?void 0:onRenderProcessGoneProp(event);},[onRenderProcessGoneProp]);var onContentProcessDidTerminate=(0,_react.useCallback)(function(event){onContentProcessDidTerminateProp==null?void 0:onContentProcessDidTerminateProp(event);},[onContentProcessDidTerminateProp]);var onLoadingFinish=(0,_react.useCallback)(function(event){onLoad==null?void 0:onLoad(event);onLoadEnd==null?void 0:onLoadEnd(event);var url=event.nativeEvent.url;if(_reactNative.Platform.OS!=="android"||url===startUrl.current){setViewState('IDLE');}updateNavigationState(event);},[onLoad,onLoadEnd,updateNavigationState]);var onMessage=(0,_react.useCallback)(function(event){onMessageProp==null?void 0:onMessageProp(event);},[onMessageProp]);var onLoadingProgress=(0,_react.useCallback)(function(event){var progress=event.nativeEvent.progress;if(_reactNative.Platform.OS==="android"&&progress===1){setViewState(function(prevViewState){return prevViewState==='LOADING'?'IDLE':prevViewState;});}onLoadProgress==null?void 0:onLoadProgress(event);},[onLoadProgress]);var onShouldStartLoadWithRequest=(0,_react.useMemo)(function(){return createOnShouldStartLoadWithRequest(onShouldStartLoadWithRequestCallback,originWhitelist,onShouldStartLoadWithRequestProp);},[originWhitelist,onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback]);var onOpenWindow=(0,_react.useCallback)(function(event){onOpenWindowProp==null?void 0:onOpenWindowProp(event);},[onOpenWindowProp]);return{onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onLoadingStart:onLoadingStart,onLoadingProgress:onLoadingProgress,onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onHttpError:onHttpError,onRenderProcessGone:onRenderProcessGone,onContentProcessDidTerminate:onContentProcessDidTerminate,onMessage:onMessage,onOpenWindow:onOpenWindow,viewState:viewState,setViewState:setViewState,lastErrorEvent:lastErrorEvent};};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
12
12
  ],
13
13
  "license": "MIT",
14
- "version": "13.8.4",
14
+ "version": "13.8.42",
15
15
  "homepage": "https://github.com/bootpay/react-native-webview-bootpay",
16
16
  "scripts": {
17
17
  "android": "react-native run-android",
@@ -28,7 +28,6 @@
28
28
  "test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.js",
29
29
  "add:macos": "yarn add react-native-macos@0.73.17"
30
30
  },
31
-
32
31
  "rn-docs": {
33
32
  "title": "Webview",
34
33
  "type": "Component"
@@ -89,11 +88,6 @@
89
88
  "react-native-webview-bootpay.podspec",
90
89
  "react-native.config.js"
91
90
  ],
92
- "resolutions": {
93
- "@react-native-community/cli": "10.2.4",
94
- "@react-native-community/cli-platform-android": "10.2.0",
95
- "@react-native-community/cli-platform-ios": "10.2.4"
96
- },
97
91
  "codegenConfig": {
98
92
  "name": "BPCWebViewSpec",
99
93
  "type": "all",
@@ -19,7 +19,6 @@ const project = (() => {
19
19
  },
20
20
  });
21
21
  } catch (e) {
22
- console.log('Hello?', e);
23
22
  return undefined;
24
23
  }
25
24
  })();