react-native-webview-bootpay 13.14.1 → 13.14.3

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.
@@ -58,6 +58,7 @@
58
58
  <package android:name="kr.co.samsungcard.mpocket" /> <!-- 삼성카드 -->
59
59
  <package android:name="com.shcard.smartpay" /> <!-- 신한카드-->
60
60
  <package android:name="com.shinhan.smartcaremgr" /> <!-- 신한 쏠-->
61
+ <package android:name="com.shinhan.sbanking" /> <!-- 신한 SOL 뱅크-->
61
62
  <package android:name="com.shinhancard.smartshinhan" /> <!-- 신한카드 (ARS/일반결제/Smart결제) -->
62
63
  <package android:name="com.hyundaicard.appcard" /> <!-- 현대카드 -->
63
64
  <package android:name="nh.smart.nhallonepay" /> <!-- 농협카드 -->
@@ -66,12 +67,14 @@
66
67
  <package android:name="com.wooribank.smart.npib" /> <!-- 우리 WON 뱅킹 -->
67
68
  <package android:name="kr.co.citibank.citimobile" /> <!-- 씨티카드 -->
68
69
  <package android:name="com.mobiletoong.travelwallet" /> <!-- 트레블월렛 -->
70
+ <package android:name="net.ib.android.smcard" /> <!-- 삼성 monimo -->
69
71
 
70
72
 
71
73
 
72
74
  <!-- 계좌이체 -->
73
75
  <package android:name="com.kftc.bankpay.android" /> <!-- 뱅크페이 -->
74
76
  <package android:name="com.kbankwith.smartbank" /> <!-- 케이뱅크 -->
77
+ <package android:name="com.kakaobank.channel" /> <!-- 카카오뱅크 -->
75
78
  <package android:name="com.knb.psb" /> <!-- BNK 경남은행 모바일뱅킹 -->
76
79
  <package android:name="kr.co.kfcc.mobilebank" /> <!-- MG 새마을금고 -->
77
80
  <package android:name="com.nh.cashcardapp" /> <!-- NH앱캐시 -->
@@ -85,14 +88,21 @@
85
88
  <package android:name="com.TouchEn.mVaccine.webs" /> <!-- 신한, 씨티 -->
86
89
  <package android:name="kr.co.shiftworks.vguardweb" /> <!-- 삼성 -->
87
90
  <package android:name="com.ahnlab.v3mobileplus" /> <!-- 하나, 농협, 우리, 국민 리브 -->
91
+ <package android:name="net.nshc.droidxantivirus" /> <!-- 안심클릭 백신 -->
88
92
 
89
93
  <!-- 휴대폰 결제 -->
90
94
  <package android:name="com.kt.ktauth" /> <!-- KT 본인인증 -->
91
95
  <package android:name="kr.danal.app.damoum" /> <!-- 다모음 -->
92
96
  <package android:name="uplus.membership" /> <!-- U+ 멤버스 -->
93
97
  <package android:name="com.sktelecom.tauth" /> <!--PASS-->
98
+ <package android:name="com.om.sktelecom.tauth" /> <!--KCB휴대폰본인인증(SKT)-->
94
99
  <package android:name="com.lguplus.smartotp" /> <!--PASS-->
95
100
 
101
+ <package android:name="com.tmoney.inapp" /> <!--티머니-->
102
+ <package android:name="com.tmoney.nfc_pay" /> <!--티머니-->
103
+ <package android:name="com.ebcard.cashbeeinapp" /> <!-- 캐시비 인앱 -->
104
+ <package android:name="com.skt.skaf.A000Z00040" /> <!-- 원스토어 -->
105
+
96
106
  <!--해외결제-->
97
107
  <package android:name="com.eg.android.AlipayGphone" />
98
108
  </queries>
@@ -56,6 +56,7 @@
56
56
  <package android:name="kr.co.samsungcard.mpocket" /> <!-- 삼성카드 -->
57
57
  <package android:name="com.shcard.smartpay" /> <!-- 신한카드-->
58
58
  <package android:name="com.shinhan.smartcaremgr" /> <!-- 신한 쏠-->
59
+ <package android:name="com.shinhan.sbanking" /> <!-- 신한 SOL 뱅크-->
59
60
  <package android:name="com.shinhancard.smartshinhan" /> <!-- 신한카드 (ARS/일반결제/Smart결제) -->
60
61
  <package android:name="com.hyundaicard.appcard" /> <!-- 현대카드 -->
61
62
  <package android:name="nh.smart.nhallonepay" /> <!-- 농협카드 -->
@@ -64,12 +65,14 @@
64
65
  <package android:name="com.wooribank.smart.npib" /> <!-- 우리 WON 뱅킹 -->
65
66
  <package android:name="kr.co.citibank.citimobile" /> <!-- 씨티카드 -->
66
67
  <package android:name="com.mobiletoong.travelwallet" /> <!-- 트레블월렛 -->
68
+ <package android:name="net.ib.android.smcard" /> <!-- 삼성 monimo -->
67
69
 
68
70
 
69
71
 
70
72
  <!-- 계좌이체 -->
71
73
  <package android:name="com.kftc.bankpay.android" /> <!-- 뱅크페이 -->
72
74
  <package android:name="com.kbankwith.smartbank" /> <!-- 케이뱅크 -->
75
+ <package android:name="com.kakaobank.channel" /> <!-- 카카오뱅크 -->
73
76
  <package android:name="com.knb.psb" /> <!-- BNK 경남은행 모바일뱅킹 -->
74
77
  <package android:name="kr.co.kfcc.mobilebank" /> <!-- MG 새마을금고 -->
75
78
  <package android:name="com.nh.cashcardapp" /> <!-- NH앱캐시 -->
@@ -83,14 +86,21 @@
83
86
  <package android:name="com.TouchEn.mVaccine.webs" /> <!-- 신한, 씨티 -->
84
87
  <package android:name="kr.co.shiftworks.vguardweb" /> <!-- 삼성 -->
85
88
  <package android:name="com.ahnlab.v3mobileplus" /> <!-- 하나, 농협, 우리, 국민 리브 -->
89
+ <package android:name="net.nshc.droidxantivirus" /> <!-- 안심클릭 백신 -->
86
90
 
87
91
  <!-- 휴대폰 결제 -->
88
92
  <package android:name="com.kt.ktauth" /> <!-- KT 본인인증 -->
89
93
  <package android:name="kr.danal.app.damoum" /> <!-- 다모음 -->
90
94
  <package android:name="uplus.membership" /> <!-- U+ 멤버스 -->
91
95
  <package android:name="com.sktelecom.tauth" /> <!--PASS-->
96
+ <package android:name="com.om.sktelecom.tauth" /> <!--KCB휴대폰본인인증(SKT)-->
92
97
  <package android:name="com.lguplus.smartotp" /> <!--PASS-->
93
98
 
99
+ <package android:name="com.tmoney.inapp" /> <!--티머니-->
100
+ <package android:name="com.tmoney.nfc_pay" /> <!--티머니-->
101
+ <package android:name="com.ebcard.cashbeeinapp" /> <!-- 캐시비 인앱 -->
102
+ <package android:name="com.skt.skaf.A000Z00040" /> <!-- 원스토어 -->
103
+
94
104
  <!--해외결제-->
95
105
  <package android:name="com.eg.android.AlipayGphone" />
96
106
  </queries>
@@ -17,6 +17,16 @@ public class BootpayUrlHelper {
17
17
 
18
18
  Log.i("bootpay", "doDeepLinkIfPayUrl: " + url);
19
19
 
20
+ // mpocket.online.ansimclick://는 삼성카드 mPOCKET / 삼성 모니모 둘 다 handle 가능.
21
+ // mPOCKET 미설치 + 모니모 설치 상태에서 무조건 mPOCKET으로 지정해 결제가 끊기는 것을 방지.
22
+ if (url != null && url.startsWith("mpocket.online.ansimclick")
23
+ && intent != null
24
+ && "kr.co.samsungcard.mpocket".equals(intent.getPackage())
25
+ && !isPackageInstalled(context, "kr.co.samsungcard.mpocket")
26
+ && isPackageInstalled(context, "net.ib.android.smcard")) {
27
+ intent.setPackage("net.ib.android.smcard");
28
+ }
29
+
20
30
  if(isIntent(url)) {
21
31
  Log.i("isIntent", "isInstallApp called");
22
32
  if(isInstallApp(intent, context)) return startApp(intent, context);
@@ -42,7 +52,19 @@ public class BootpayUrlHelper {
42
52
  || url.startsWith("mpocket.online.ansimclick://")
43
53
  || url.startsWith("wooripay://")
44
54
  || url.startsWith("ispmobile://")
45
- || url.startsWith("kakaotalk://");
55
+ || url.startsWith("kakaotalk://")
56
+ || url.startsWith("kakaobank://")
57
+ || url.startsWith("monimopay://")
58
+ || url.startsWith("smcard://");
59
+ }
60
+
61
+ private static boolean isPackageInstalled(Context context, String packageName) {
62
+ if (context == null || packageName == null) return false;
63
+ try {
64
+ return context.getPackageManager().getLaunchIntentForPackage(packageName) != null;
65
+ } catch (Exception e) {
66
+ return false;
67
+ }
46
68
  }
47
69
 
48
70
  public static Boolean isIntent(String url) {
@@ -75,6 +97,8 @@ public class BootpayUrlHelper {
75
97
  else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
76
98
  else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
77
99
  else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
100
+ else if (url.startsWith("kakaobank")) intent.setPackage("com.kakaobank.channel");
101
+ else if (url.startsWith("monimopay") || url.startsWith("smcard")) intent.setPackage("net.ib.android.smcard");
78
102
  // kvp.jjy.MispAndroid320
79
103
  }
80
104
  return intent;
@@ -109,28 +133,43 @@ public class BootpayUrlHelper {
109
133
  }
110
134
 
111
135
  public static boolean startGooglePlay(Intent intent, Context context) {
112
- final String appPackageName = intent.getPackage();
136
+ // intent:// URL의 표준 fallback (S.browser_fallback_url) 우선 처리
137
+ String fallbackUrl = intent != null ? intent.getStringExtra("browser_fallback_url") : null;
138
+ if (fallbackUrl != null && !fallbackUrl.isEmpty()) {
139
+ try {
140
+ Intent fallback = new Intent(Intent.ACTION_VIEW, Uri.parse(fallbackUrl));
141
+ fallback.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
142
+ context.startActivity(fallback);
143
+ return true;
144
+ } catch (Exception ignored) { /* fall through */ }
145
+ }
146
+
147
+ final String appPackageName = intent != null ? intent.getPackage() : null;
113
148
 
114
149
  if(appPackageName == null) {
115
- Uri dataUri = intent.getData();
150
+ Uri dataUri = intent != null ? intent.getData() : null;
116
151
 
117
152
  try {
118
- Intent addIntent = new Intent(Intent.ACTION_VIEW, intent.getData());
153
+ Intent addIntent = new Intent(Intent.ACTION_VIEW, dataUri);
154
+ addIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
119
155
  context.startActivity(addIntent);
120
156
  } catch (Exception e) {
121
157
  String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
122
158
  if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
123
159
 
124
160
  Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
161
+ addIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
125
162
  context.startActivity(addIntent);
126
163
  }
127
164
  return true;
128
165
  }
129
166
  try {
130
167
  Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
168
+ addIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
131
169
  context.startActivity(addIntent);
132
170
  } catch (android.content.ActivityNotFoundException anfe) {
133
171
  Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName));
172
+ addIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
134
173
  context.startActivity(addIntent);
135
174
  }
136
175
  return true;
@@ -0,0 +1,242 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
3
+ export type WebViewNativeEvent = Readonly<{
4
+ url: string;
5
+ loading: boolean;
6
+ title: string;
7
+ canGoBack: boolean;
8
+ canGoForward: boolean;
9
+ lockIdentifier: Double;
10
+ }>;
11
+ export type WebViewCustomMenuSelectionEvent = Readonly<{
12
+ label: string;
13
+ key: string;
14
+ selectedText: string;
15
+ }>;
16
+ export type WebViewMessageEvent = Readonly<{
17
+ url: string;
18
+ loading: boolean;
19
+ title: string;
20
+ canGoBack: boolean;
21
+ canGoForward: boolean;
22
+ lockIdentifier: Double;
23
+ data: string;
24
+ }>;
25
+ export type WebViewOpenWindowEvent = Readonly<{
26
+ targetUrl: string;
27
+ }>;
28
+ export type WebViewHttpErrorEvent = Readonly<{
29
+ url: string;
30
+ loading: boolean;
31
+ title: string;
32
+ canGoBack: boolean;
33
+ canGoForward: boolean;
34
+ lockIdentifier: Double;
35
+ description: string;
36
+ statusCode: Int32;
37
+ }>;
38
+ export type WebViewErrorEvent = Readonly<{
39
+ url: string;
40
+ loading: boolean;
41
+ title: string;
42
+ canGoBack: boolean;
43
+ canGoForward: boolean;
44
+ lockIdentifier: Double;
45
+ domain?: string;
46
+ code: Int32;
47
+ description: string;
48
+ }>;
49
+ export type WebViewNativeProgressEvent = Readonly<{
50
+ url: string;
51
+ loading: boolean;
52
+ title: string;
53
+ canGoBack: boolean;
54
+ canGoForward: boolean;
55
+ lockIdentifier: Double;
56
+ progress: Double;
57
+ }>;
58
+ export type WebViewNavigationEvent = Readonly<{
59
+ url: string;
60
+ loading: boolean;
61
+ title: string;
62
+ canGoBack: boolean;
63
+ canGoForward: boolean;
64
+ lockIdentifier: Double;
65
+ navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
66
+ mainDocumentURL?: string;
67
+ }>;
68
+ export type ShouldStartLoadRequestEvent = Readonly<{
69
+ url: string;
70
+ loading: boolean;
71
+ title: string;
72
+ canGoBack: boolean;
73
+ canGoForward: boolean;
74
+ lockIdentifier: Double;
75
+ navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
76
+ mainDocumentURL?: string;
77
+ isTopFrame: boolean;
78
+ }>;
79
+ type ScrollEvent = Readonly<{
80
+ contentInset: {
81
+ bottom: Double;
82
+ left: Double;
83
+ right: Double;
84
+ top: Double;
85
+ };
86
+ contentOffset: {
87
+ y: Double;
88
+ x: Double;
89
+ };
90
+ contentSize: {
91
+ height: Double;
92
+ width: Double;
93
+ };
94
+ layoutMeasurement: {
95
+ height: Double;
96
+ width: Double;
97
+ };
98
+ targetContentOffset?: {
99
+ y: Double;
100
+ x: Double;
101
+ };
102
+ velocity?: {
103
+ y: Double;
104
+ x: Double;
105
+ };
106
+ zoomScale?: Double;
107
+ responderIgnoreScroll?: boolean;
108
+ }>;
109
+ type WebViewRenderProcessGoneEvent = Readonly<{
110
+ didCrash: boolean;
111
+ }>;
112
+ type WebViewDownloadEvent = Readonly<{
113
+ downloadUrl: string;
114
+ }>;
115
+ export interface NativeProps extends ViewProps {
116
+ allowFileAccess?: boolean;
117
+ allowsProtectedMedia?: boolean;
118
+ allowsFullscreenVideo?: boolean;
119
+ androidLayerType?: WithDefault<'none' | 'software' | 'hardware', 'none'>;
120
+ cacheMode?: WithDefault<'LOAD_DEFAULT' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE' | 'LOAD_CACHE_ONLY', 'LOAD_DEFAULT'>;
121
+ domStorageEnabled?: boolean;
122
+ downloadingMessage?: string;
123
+ forceDarkOn?: boolean;
124
+ geolocationEnabled?: boolean;
125
+ lackPermissionToDownloadMessage?: string;
126
+ messagingModuleName: string;
127
+ minimumFontSize?: Int32;
128
+ mixedContentMode?: WithDefault<'never' | 'always' | 'compatibility', 'never'>;
129
+ nestedScrollEnabled?: boolean;
130
+ onContentSizeChange?: DirectEventHandler<WebViewNativeEvent>;
131
+ onRenderProcessGone?: DirectEventHandler<WebViewRenderProcessGoneEvent>;
132
+ overScrollMode?: string;
133
+ saveFormDataDisabled?: boolean;
134
+ scalesPageToFit?: WithDefault<boolean, true>;
135
+ setBuiltInZoomControls?: WithDefault<boolean, true>;
136
+ setDisplayZoomControls?: boolean;
137
+ setSupportMultipleWindows?: WithDefault<boolean, true>;
138
+ textZoom?: Int32;
139
+ thirdPartyCookiesEnabled?: WithDefault<boolean, true>;
140
+ hasOnScroll?: boolean;
141
+ allowingReadAccessToURL?: string;
142
+ allowsBackForwardNavigationGestures?: boolean;
143
+ allowsInlineMediaPlayback?: boolean;
144
+ allowsPictureInPictureMediaPlayback?: boolean;
145
+ allowsAirPlayForMediaPlayback?: boolean;
146
+ allowsLinkPreview?: WithDefault<boolean, true>;
147
+ automaticallyAdjustContentInsets?: WithDefault<boolean, true>;
148
+ autoManageStatusBarEnabled?: WithDefault<boolean, true>;
149
+ bounces?: WithDefault<boolean, true>;
150
+ contentInset?: Readonly<{
151
+ top?: Double;
152
+ left?: Double;
153
+ bottom?: Double;
154
+ right?: Double;
155
+ }>;
156
+ contentInsetAdjustmentBehavior?: WithDefault<'never' | 'automatic' | 'scrollableAxes' | 'always', 'never'>;
157
+ contentMode?: WithDefault<'recommended' | 'mobile' | 'desktop', 'recommended'>;
158
+ dataDetectorTypes?: WithDefault<ReadonlyArray<'address' | 'link' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'phoneNumber' | 'all' | 'none'>, 'phoneNumber'>;
159
+ decelerationRate?: Double;
160
+ directionalLockEnabled?: WithDefault<boolean, true>;
161
+ enableApplePay?: boolean;
162
+ hideKeyboardAccessoryView?: boolean;
163
+ keyboardDisplayRequiresUserAction?: WithDefault<boolean, true>;
164
+ limitsNavigationsToAppBoundDomains?: boolean;
165
+ mediaCapturePermissionGrantType?: WithDefault<'prompt' | 'grant' | 'deny' | 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny', 'prompt'>;
166
+ pagingEnabled?: boolean;
167
+ pullToRefreshEnabled?: boolean;
168
+ refreshControlLightMode?: boolean;
169
+ scrollEnabled?: WithDefault<boolean, true>;
170
+ sharedCookiesEnabled?: boolean;
171
+ textInteractionEnabled?: WithDefault<boolean, true>;
172
+ useSharedProcessPool?: WithDefault<boolean, true>;
173
+ onContentProcessDidTerminate?: DirectEventHandler<WebViewNativeEvent>;
174
+ onCustomMenuSelection?: DirectEventHandler<WebViewCustomMenuSelectionEvent>;
175
+ onFileDownload?: DirectEventHandler<WebViewDownloadEvent>;
176
+ menuItems?: ReadonlyArray<Readonly<{
177
+ label: string;
178
+ key: string;
179
+ }>>;
180
+ suppressMenuItems?: Readonly<string>[];
181
+ hasOnFileDownload?: boolean;
182
+ fraudulentWebsiteWarningEnabled?: WithDefault<boolean, true>;
183
+ allowFileAccessFromFileURLs?: boolean;
184
+ allowUniversalAccessFromFileURLs?: boolean;
185
+ applicationNameForUserAgent?: string;
186
+ basicAuthCredential?: Readonly<{
187
+ username: string;
188
+ password: string;
189
+ }>;
190
+ cacheEnabled?: WithDefault<boolean, true>;
191
+ incognito?: boolean;
192
+ injectedJavaScript?: string;
193
+ injectedJavaScriptBeforeContentLoaded?: string;
194
+ injectedJavaScriptForMainFrameOnly?: WithDefault<boolean, true>;
195
+ injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: WithDefault<boolean, true>;
196
+ javaScriptCanOpenWindowsAutomatically?: boolean;
197
+ javaScriptEnabled?: WithDefault<boolean, true>;
198
+ webviewDebuggingEnabled?: boolean;
199
+ mediaPlaybackRequiresUserAction?: WithDefault<boolean, true>;
200
+ messagingEnabled: boolean;
201
+ onLoadingError: DirectEventHandler<WebViewErrorEvent>;
202
+ onLoadingFinish: DirectEventHandler<WebViewNavigationEvent>;
203
+ onLoadingProgress: DirectEventHandler<WebViewNativeProgressEvent>;
204
+ onLoadingStart: DirectEventHandler<WebViewNavigationEvent>;
205
+ onHttpError: DirectEventHandler<WebViewHttpErrorEvent>;
206
+ onMessage: DirectEventHandler<WebViewMessageEvent>;
207
+ onOpenWindow?: DirectEventHandler<WebViewOpenWindowEvent>;
208
+ hasOnOpenWindowEvent?: boolean;
209
+ onScroll?: DirectEventHandler<ScrollEvent>;
210
+ onShouldStartLoadWithRequest: DirectEventHandler<ShouldStartLoadRequestEvent>;
211
+ showsHorizontalScrollIndicator?: WithDefault<boolean, true>;
212
+ showsVerticalScrollIndicator?: WithDefault<boolean, true>;
213
+ newSource: Readonly<{
214
+ uri?: string;
215
+ method?: string;
216
+ body?: string;
217
+ headers?: ReadonlyArray<Readonly<{
218
+ name: string;
219
+ value: string;
220
+ }>>;
221
+ html?: string;
222
+ baseUrl?: string;
223
+ }>;
224
+ userAgent?: string;
225
+ injectedJavaScriptObject?: string;
226
+ }
227
+ export interface NativeCommands {
228
+ goBack: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
229
+ goForward: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
230
+ reload: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
231
+ stopLoading: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
232
+ injectJavaScript: (viewRef: React.ElementRef<HostComponent<NativeProps>>, javascript: string) => void;
233
+ requestFocus: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
234
+ postMessage: (viewRef: React.ElementRef<HostComponent<NativeProps>>, data: string) => void;
235
+ loadUrl: (viewRef: React.ElementRef<HostComponent<NativeProps>>, url: string) => void;
236
+ clearFormData: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
237
+ clearCache: (viewRef: React.ElementRef<HostComponent<NativeProps>>, includeDiskFiles: boolean) => void;
238
+ clearHistory: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
239
+ }
240
+ export declare const Commands: NativeCommands;
241
+ declare const _default: HostComponent<NativeProps>;
242
+ export default _default;
@@ -0,0 +1 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=exports.Commands=void 0;var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var _require2=require("react-native/Libraries/ReactNative/RendererProxy"),dispatchCommand=_require2.dispatchCommand;var nativeComponentName='BPCWebView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'BPCWebView',directEventTypes:{topContentSizeChange:{registrationName:'onContentSizeChange'},topRenderProcessGone:{registrationName:'onRenderProcessGone'},topContentProcessDidTerminate:{registrationName:'onContentProcessDidTerminate'},topCustomMenuSelection:{registrationName:'onCustomMenuSelection'},topFileDownload:{registrationName:'onFileDownload'},topLoadingError:{registrationName:'onLoadingError'},topLoadingFinish:{registrationName:'onLoadingFinish'},topLoadingProgress:{registrationName:'onLoadingProgress'},topLoadingStart:{registrationName:'onLoadingStart'},topHttpError:{registrationName:'onHttpError'},topMessage:{registrationName:'onMessage'},topOpenWindow:{registrationName:'onOpenWindow'},topScroll:{registrationName:'onScroll'},topShouldStartLoadWithRequest:{registrationName:'onShouldStartLoadWithRequest'}},validAttributes:Object.assign({allowFileAccess:true,allowsProtectedMedia:true,allowsFullscreenVideo:true,androidLayerType:true,cacheMode:true,domStorageEnabled:true,downloadingMessage:true,forceDarkOn:true,geolocationEnabled:true,lackPermissionToDownloadMessage:true,messagingModuleName:true,minimumFontSize:true,mixedContentMode:true,nestedScrollEnabled:true,overScrollMode:true,saveFormDataDisabled:true,scalesPageToFit:true,setBuiltInZoomControls:true,setDisplayZoomControls:true,setSupportMultipleWindows:true,textZoom:true,thirdPartyCookiesEnabled:true,hasOnScroll:true,allowingReadAccessToURL:true,allowsBackForwardNavigationGestures:true,allowsInlineMediaPlayback:true,allowsPictureInPictureMediaPlayback:true,allowsAirPlayForMediaPlayback:true,allowsLinkPreview:true,automaticallyAdjustContentInsets:true,autoManageStatusBarEnabled:true,bounces:true,contentInset:true,contentInsetAdjustmentBehavior:true,contentMode:true,dataDetectorTypes:true,decelerationRate:true,directionalLockEnabled:true,enableApplePay:true,hideKeyboardAccessoryView:true,keyboardDisplayRequiresUserAction:true,limitsNavigationsToAppBoundDomains:true,mediaCapturePermissionGrantType:true,pagingEnabled:true,pullToRefreshEnabled:true,refreshControlLightMode:true,scrollEnabled:true,sharedCookiesEnabled:true,textInteractionEnabled:true,useSharedProcessPool:true,menuItems:true,suppressMenuItems:true,hasOnFileDownload:true,fraudulentWebsiteWarningEnabled:true,allowFileAccessFromFileURLs:true,allowUniversalAccessFromFileURLs:true,applicationNameForUserAgent:true,basicAuthCredential:true,cacheEnabled:true,incognito:true,injectedJavaScript:true,injectedJavaScriptBeforeContentLoaded:true,injectedJavaScriptForMainFrameOnly:true,injectedJavaScriptBeforeContentLoadedForMainFrameOnly:true,javaScriptCanOpenWindowsAutomatically:true,javaScriptEnabled:true,webviewDebuggingEnabled:true,mediaPlaybackRequiresUserAction:true,messagingEnabled:true,hasOnOpenWindowEvent:true,showsHorizontalScrollIndicator:true,showsVerticalScrollIndicator:true,newSource:true,userAgent:true,injectedJavaScriptObject:true},ConditionallyIgnoredEventHandlers({onContentSizeChange:true,onRenderProcessGone:true,onContentProcessDidTerminate:true,onCustomMenuSelection:true,onFileDownload:true,onLoadingError:true,onLoadingFinish:true,onLoadingProgress:true,onLoadingStart:true,onHttpError:true,onMessage:true,onOpenWindow:true,onScroll:true,onShouldStartLoadWithRequest:true}))};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});var Commands=exports.Commands={goBack:function goBack(ref){dispatchCommand(ref,"goBack",[]);},goForward:function goForward(ref){dispatchCommand(ref,"goForward",[]);},reload:function reload(ref){dispatchCommand(ref,"reload",[]);},stopLoading:function stopLoading(ref){dispatchCommand(ref,"stopLoading",[]);},injectJavaScript:function injectJavaScript(ref,javascript){dispatchCommand(ref,"injectJavaScript",[javascript]);},requestFocus:function requestFocus(ref){dispatchCommand(ref,"requestFocus",[]);},postMessage:function postMessage(ref,data){dispatchCommand(ref,"postMessage",[data]);},loadUrl:function loadUrl(ref,url){dispatchCommand(ref,"loadUrl",[url]);},clearFormData:function clearFormData(ref){dispatchCommand(ref,"clearFormData",[]);},clearCache:function clearCache(ref,includeDiskFiles){dispatchCommand(ref,"clearCache",[includeDiskFiles]);},clearHistory:function clearHistory(ref){dispatchCommand(ref,"clearHistory",[]);}};
@@ -14,5 +14,5 @@ export interface Spec extends TurboModule {
14
14
  */
15
15
  releaseWarmUp(): void;
16
16
  }
17
- declare const _default: any;
17
+ declare const _default: Spec;
18
18
  export default _default;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _default=exports.default=_reactNative.TurboModuleRegistry.getEnforcing('BPCWebViewModule');
@@ -1,2 +1,6 @@
1
- declare const WebView: any;
1
+ import React from 'react';
2
+ import { AndroidWebViewProps } from './WebViewTypes';
3
+ declare const WebView: React.ForwardRefExoticComponent<AndroidWebViewProps & React.RefAttributes<{}>> & {
4
+ isFileUploadSupported: () => Promise<boolean>;
5
+ };
2
6
  export default WebView;
@@ -0,0 +1 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _BatchedBridge=_interopRequireDefault(require("react-native/Libraries/BatchedBridge/BatchedBridge"));var _EventEmitter=_interopRequireDefault(require("react-native/Libraries/vendor/emitter/EventEmitter"));var _invariant=_interopRequireDefault(require("invariant"));var _BPCWebViewNativeComponent=_interopRequireWildcard(require("./BPCWebViewNativeComponent"));var _NativeBPCWebViewModule=_interopRequireDefault(require("./NativeBPCWebViewModule"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["overScrollMode","javaScriptEnabled","thirdPartyCookiesEnabled","scalesPageToFit","allowsFullscreenVideo","allowFileAccess","saveFormDataDisabled","cacheEnabled","androidLayerType","originWhitelist","setSupportMultipleWindows","setBuiltInZoomControls","setDisplayZoomControls","nestedScrollEnabled","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onRenderProcessGone","onMessage","onOpenWindow","renderLoading","renderError","style","containerStyle","source","nativeConfig","onShouldStartLoadWithRequest","injectedJavaScriptObject"],_excluded2=["messagingModuleName"],_excluded3=["messagingModuleName"];var _require$registerCall,_this=this,_jsxFileName="/Users/taesupyoon/bootpay-commerce/multi-sdk/client/react-native/react-native-webview-bootpay/src/WebView.android.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var resolveAssetSource=_reactNative.Image.resolveAssetSource;var directEventEmitter=new _EventEmitter.default();var registerCallableModule=(_require$registerCall=require('react-native').registerCallableModule)!=null?_require$registerCall:_BatchedBridge.default.registerCallableModule.bind(_BatchedBridge.default);registerCallableModule('BPCWebViewMessagingModule',{onShouldStartLoadWithRequest:function onShouldStartLoadWithRequest(event){directEventEmitter.emit('onShouldStartLoadWithRequest',event);},onMessage:function onMessage(event){directEventEmitter.emit('onMessage',event);}});var uniqueRef=0;var WebViewComponent=(0,_react.forwardRef)(function(_ref,ref){var _ref$overScrollMode=_ref.overScrollMode,overScrollMode=_ref$overScrollMode===void 0?'always':_ref$overScrollMode,_ref$javaScriptEnable=_ref.javaScriptEnabled,javaScriptEnabled=_ref$javaScriptEnable===void 0?true:_ref$javaScriptEnable,_ref$thirdPartyCookie=_ref.thirdPartyCookiesEnabled,thirdPartyCookiesEnabled=_ref$thirdPartyCookie===void 0?true:_ref$thirdPartyCookie,_ref$scalesPageToFit=_ref.scalesPageToFit,scalesPageToFit=_ref$scalesPageToFit===void 0?true:_ref$scalesPageToFit,_ref$allowsFullscreen=_ref.allowsFullscreenVideo,allowsFullscreenVideo=_ref$allowsFullscreen===void 0?false:_ref$allowsFullscreen,_ref$allowFileAccess=_ref.allowFileAccess,allowFileAccess=_ref$allowFileAccess===void 0?false:_ref$allowFileAccess,_ref$saveFormDataDisa=_ref.saveFormDataDisabled,saveFormDataDisabled=_ref$saveFormDataDisa===void 0?false:_ref$saveFormDataDisa,_ref$cacheEnabled=_ref.cacheEnabled,cacheEnabled=_ref$cacheEnabled===void 0?true:_ref$cacheEnabled,_ref$androidLayerType=_ref.androidLayerType,androidLayerType=_ref$androidLayerType===void 0?'none':_ref$androidLayerType,_ref$originWhitelist=_ref.originWhitelist,originWhitelist=_ref$originWhitelist===void 0?_WebViewShared.defaultOriginWhitelist:_ref$originWhitelist,_ref$setSupportMultip=_ref.setSupportMultipleWindows,setSupportMultipleWindows=_ref$setSupportMultip===void 0?true:_ref$setSupportMultip,_ref$setBuiltInZoomCo=_ref.setBuiltInZoomControls,setBuiltInZoomControls=_ref$setBuiltInZoomCo===void 0?true:_ref$setBuiltInZoomCo,_ref$setDisplayZoomCo=_ref.setDisplayZoomControls,setDisplayZoomControls=_ref$setDisplayZoomCo===void 0?false:_ref$setDisplayZoomCo,_ref$nestedScrollEnab=_ref.nestedScrollEnabled,nestedScrollEnabled=_ref$nestedScrollEnab===void 0?false:_ref$nestedScrollEnab,startInLoadingState=_ref.startInLoadingState,onNavigationStateChange=_ref.onNavigationStateChange,onLoadStart=_ref.onLoadStart,onError=_ref.onError,onLoad=_ref.onLoad,onLoadEnd=_ref.onLoadEnd,onLoadProgress=_ref.onLoadProgress,onHttpErrorProp=_ref.onHttpError,onRenderProcessGoneProp=_ref.onRenderProcessGone,onMessageProp=_ref.onMessage,onOpenWindowProp=_ref.onOpenWindow,renderLoading=_ref.renderLoading,renderError=_ref.renderError,style=_ref.style,containerStyle=_ref.containerStyle,source=_ref.source,nativeConfig=_ref.nativeConfig,onShouldStartLoadWithRequestProp=_ref.onShouldStartLoadWithRequest,injectedJavaScriptObject=_ref.injectedJavaScriptObject,otherProps=(0,_objectWithoutProperties2.default)(_ref,_excluded);var messagingModuleName=(0,_react.useRef)(`WebViewMessageHandler${uniqueRef+=1}`).current;var webViewRef=(0,_react.useRef)(null);var onShouldStartLoadWithRequestCallback=(0,_react.useCallback)(function(shouldStart,url,lockIdentifier){if(lockIdentifier){_NativeBPCWebViewModule.default.shouldStartLoadWithLockIdentifier(shouldStart,lockIdentifier);}else if(shouldStart&&webViewRef.current){_BPCWebViewNativeComponent.Commands.loadUrl(webViewRef.current,url);}},[]);var _useWebViewLogic=(0,_WebViewShared.useWebViewLogic)({onNavigationStateChange:onNavigationStateChange,onLoad:onLoad,onError:onError,onHttpErrorProp:onHttpErrorProp,onLoadEnd:onLoadEnd,onLoadProgress:onLoadProgress,onLoadStart:onLoadStart,onRenderProcessGoneProp:onRenderProcessGoneProp,onMessageProp:onMessageProp,onOpenWindowProp:onOpenWindowProp,startInLoadingState:startInLoadingState,originWhitelist:originWhitelist,onShouldStartLoadWithRequestProp:onShouldStartLoadWithRequestProp,onShouldStartLoadWithRequestCallback:onShouldStartLoadWithRequestCallback}),onLoadingStart=_useWebViewLogic.onLoadingStart,onShouldStartLoadWithRequest=_useWebViewLogic.onShouldStartLoadWithRequest,onMessage=_useWebViewLogic.onMessage,viewState=_useWebViewLogic.viewState,setViewState=_useWebViewLogic.setViewState,lastErrorEvent=_useWebViewLogic.lastErrorEvent,onHttpError=_useWebViewLogic.onHttpError,onLoadingError=_useWebViewLogic.onLoadingError,onLoadingFinish=_useWebViewLogic.onLoadingFinish,onLoadingProgress=_useWebViewLogic.onLoadingProgress,onOpenWindow=_useWebViewLogic.onOpenWindow,onRenderProcessGone=_useWebViewLogic.onRenderProcessGone;(0,_react.useImperativeHandle)(ref,function(){return{goForward:function goForward(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.goForward(webViewRef.current);},goBack:function goBack(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.goBack(webViewRef.current);},reload:function reload(){setViewState('LOADING');if(webViewRef.current){_BPCWebViewNativeComponent.Commands.reload(webViewRef.current);}},stopLoading:function stopLoading(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.stopLoading(webViewRef.current);},postMessage:function postMessage(data){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.postMessage(webViewRef.current,data);},injectJavaScript:function injectJavaScript(data){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.injectJavaScript(webViewRef.current,data);},requestFocus:function requestFocus(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.requestFocus(webViewRef.current);},clearFormData:function clearFormData(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearFormData(webViewRef.current);},clearCache:function clearCache(includeDiskFiles){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearCache(webViewRef.current,includeDiskFiles);},clearHistory:function clearHistory(){return webViewRef.current&&_BPCWebViewNativeComponent.Commands.clearHistory(webViewRef.current);}};},[setViewState,webViewRef]);(0,_react.useEffect)(function(){var onShouldStartLoadWithRequestSubscription=directEventEmitter.addListener('onShouldStartLoadWithRequest',function(event){if(event.messagingModuleName===messagingModuleName){var _=event.messagingModuleName,rest=(0,_objectWithoutProperties2.default)(event,_excluded2);onShouldStartLoadWithRequest(rest);}});var onMessageSubscription=directEventEmitter.addListener('onMessage',function(event){if(event.messagingModuleName===messagingModuleName){var _=event.messagingModuleName,rest=(0,_objectWithoutProperties2.default)(event,_excluded3);onMessage(rest);}});return function(){onShouldStartLoadWithRequestSubscription.remove();onMessageSubscription.remove();};},[messagingModuleName,onMessage,onShouldStartLoadWithRequest]);var otherView;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');if(lastErrorEvent){otherView=(renderError||_WebViewShared.defaultRenderError)(lastErrorEvent.domain,lastErrorEvent.code,lastErrorEvent.description);}}else if(viewState!=='IDLE'){console.error(`BPCWebView invalid state encountered: ${viewState}`);}var webViewStyles=[_WebView.default.container,_WebView.default.webView,style];var webViewContainerStyle=[_WebView.default.container,containerStyle];if(typeof source!=='number'&&source&&'method'in source){if(source.method==='POST'&&source.headers){console.warn('WebView: `source.headers` is not supported when using POST.');}else if(source.method==='GET'&&source.body){console.warn('WebView: `source.body` is not supported when using GET.');}}var NativeWebView=(nativeConfig==null?void 0:nativeConfig.component)||_BPCWebViewNativeComponent.default;var sourceResolved=resolveAssetSource(source);var newSource=typeof sourceResolved==='object'?Object.entries(sourceResolved).reduce(function(prev,_ref2){var _ref3=(0,_slicedToArray2.default)(_ref2,2),currKey=_ref3[0],currValue=_ref3[1];return Object.assign({},prev,(0,_defineProperty2.default)({},currKey,currKey==='headers'&&currValue&&typeof currValue==='object'?Object.entries(currValue).map(function(_ref4){var _ref5=(0,_slicedToArray2.default)(_ref4,2),key=_ref5[0],value=_ref5[1];return{name:key,value:value};}):currValue));},{}):sourceResolved;var webView=(0,_jsxRuntime.jsx)(NativeWebView,Object.assign({},otherProps,{messagingEnabled:typeof onMessageProp==='function',messagingModuleName:messagingModuleName,hasOnScroll:!!otherProps.onScroll,onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onRenderProcessGone:onRenderProcessGone,onMessage:onMessage,onOpenWindow:onOpenWindow,hasOnOpenWindowEvent:onOpenWindowProp!==undefined,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,ref:webViewRef,source:sourceResolved,newSource:newSource,style:webViewStyles,overScrollMode:overScrollMode,javaScriptEnabled:javaScriptEnabled,thirdPartyCookiesEnabled:thirdPartyCookiesEnabled,scalesPageToFit:scalesPageToFit,allowsFullscreenVideo:allowsFullscreenVideo,allowFileAccess:allowFileAccess,saveFormDataDisabled:saveFormDataDisabled,cacheEnabled:cacheEnabled,androidLayerType:androidLayerType,setSupportMultipleWindows:setSupportMultipleWindows,setBuiltInZoomControls:setBuiltInZoomControls,setDisplayZoomControls:setDisplayZoomControls,nestedScrollEnabled:nestedScrollEnabled,injectedJavaScriptObject:JSON.stringify(injectedJavaScriptObject)},nativeConfig==null?void 0:nativeConfig.props),"webViewKey");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:webViewContainerStyle,children:[webView,otherView]});});var isFileUploadSupported=_NativeBPCWebViewModule.default.isFileUploadSupported;var WebView=Object.assign(WebViewComponent,{isFileUploadSupported:isFileUploadSupported});var _default=exports.default=WebView;
@@ -1,2 +1,6 @@
1
- declare const WebView: any;
1
+ import React from 'react';
2
+ import { IOSWebViewProps } from './WebViewTypes';
3
+ declare const WebView: React.ForwardRefExoticComponent<IOSWebViewProps & React.RefAttributes<{}>> & {
4
+ isFileUploadSupported: () => Promise<boolean>;
5
+ };
2
6
  export default WebView;
@@ -0,0 +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 _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _invariant=_interopRequireDefault(require("invariant"));var _BPCWebViewNativeComponent=_interopRequireWildcard(require("./BPCWebViewNativeComponent"));var _NativeBPCWebViewModule=_interopRequireDefault(require("./NativeBPCWebViewModule"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["fraudulentWebsiteWarningEnabled","javaScriptEnabled","cacheEnabled","originWhitelist","useSharedProcessPool","textInteractionEnabled","injectedJavaScript","injectedJavaScriptBeforeContentLoaded","injectedJavaScriptForMainFrameOnly","injectedJavaScriptBeforeContentLoadedForMainFrameOnly","injectedJavaScriptObject","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onContentProcessDidTerminate","onFileDownload","onHttpError","onMessage","onOpenWindow","renderLoading","renderError","style","containerStyle","source","nativeConfig","allowsInlineMediaPlayback","allowsPictureInPictureMediaPlayback","allowsAirPlayForMediaPlayback","mediaPlaybackRequiresUserAction","dataDetectorTypes","incognito","decelerationRate","onShouldStartLoadWithRequest"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay-commerce/multi-sdk/client/react-native/react-native-webview-bootpay/src/WebView.ios.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}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,injectedJavaScriptObject=_ref.injectedJavaScriptObject,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,_ref$allowsPictureInP=_ref.allowsPictureInPictureMediaPlayback,allowsPictureInPictureMediaPlayback=_ref$allowsPictureInP===void 0?true:_ref$allowsPictureInP,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;_NativeBPCWebViewModule.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(allowsPictureInPictureMediaPlayback,'allowsPictureInPictureMediaPlayback');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,injectedJavaScriptObject:JSON.stringify(injectedJavaScriptObject),dataDetectorTypes:!dataDetectorTypes||Array.isArray(dataDetectorTypes)?dataDetectorTypes:[dataDetectorTypes],allowsAirPlayForMediaPlayback:allowsAirPlayForMediaPlayback,allowsInlineMediaPlayback:allowsInlineMediaPlayback,allowsPictureInPictureMediaPlayback:allowsPictureInPictureMediaPlayback,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 ADDED
@@ -0,0 +1 @@
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 _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/Users/taesupyoon/bootpay-commerce/multi-sdk/client/react-native/react-native-webview-bootpay/src/WebView.tsx";var WebView=exports.WebView=function WebView(){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:_WebView.default.flexStart,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_WebView.default.colorRed,children:"React Native WebView does not support this platform."})});};var _default=exports.default=WebView;
@@ -1,2 +1,6 @@
1
- declare const WebView: any;
1
+ import React from 'react';
2
+ import { MacOSWebViewProps } from './WebViewTypes';
3
+ declare const WebView: React.ForwardRefExoticComponent<MacOSWebViewProps & React.RefAttributes<{}>> & {
4
+ isFileUploadSupported: () => Promise<boolean>;
5
+ };
2
6
  export default WebView;
@@ -0,0 +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 _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _invariant=_interopRequireDefault(require("invariant"));var _BPCWebViewNativeComponent=_interopRequireWildcard(require("./BPCWebViewNativeComponent"));var _NativeBPCWebViewModule=_interopRequireDefault(require("./NativeBPCWebViewModule"));var _WebViewShared=require("./WebViewShared");var _WebView=_interopRequireDefault(require("./WebView.styles"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["javaScriptEnabled","cacheEnabled","originWhitelist","useSharedProcessPool","injectedJavaScript","injectedJavaScriptBeforeContentLoaded","startInLoadingState","onNavigationStateChange","onLoadStart","onError","onLoad","onLoadEnd","onLoadProgress","onHttpError","onMessage","renderLoading","renderError","style","containerStyle","source","nativeConfig","allowsInlineMediaPlayback","allowsPictureInPictureMediaPlayback","allowsAirPlayForMediaPlayback","mediaPlaybackRequiresUserAction","incognito","onShouldStartLoadWithRequest"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay-commerce/multi-sdk/client/react-native/react-native-webview-bootpay/src/WebView.macos.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}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,_ref$allowsPictureInP=_ref.allowsPictureInPictureMediaPlayback,allowsPictureInPictureMediaPlayback=_ref$allowsPictureInP===void 0?true:_ref$allowsPictureInP,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;_NativeBPCWebViewModule.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 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);}};},[setViewState,webViewRef]);useWarnIfChanges(allowsInlineMediaPlayback,'allowsInlineMediaPlayback');useWarnIfChanges(allowsPictureInPictureMediaPlayback,'allowsPictureInPictureMediaPlayback');useWarnIfChanges(allowsAirPlayForMediaPlayback,'allowsAirPlayForMediaPlayback');useWarnIfChanges(incognito,'incognito');useWarnIfChanges(mediaPlaybackRequiresUserAction,'mediaPlaybackRequiresUserAction');var otherView=null;if(viewState==='LOADING'){otherView=(renderLoading||_WebViewShared.defaultRenderLoading)();}else if(viewState==='ERROR'){var _lastErrorEvent$descr;(0,_invariant.default)(lastErrorEvent!=null,'lastErrorEvent expected to be non-null');otherView=(renderError||_WebViewShared.defaultRenderError)(lastErrorEvent==null?void 0:lastErrorEvent.domain,(lastErrorEvent==null?void 0: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 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,{javaScriptEnabled:javaScriptEnabled,cacheEnabled:cacheEnabled,useSharedProcessPool:useSharedProcessPool,messagingEnabled:typeof onMessageProp==='function',newSource:newSource,onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onContentProcessDidTerminate:onContentProcessDidTerminate,injectedJavaScript:injectedJavaScript,injectedJavaScriptBeforeContentLoaded:injectedJavaScriptBeforeContentLoaded,allowsAirPlayForMediaPlayback:allowsAirPlayForMediaPlayback,allowsInlineMediaPlayback:allowsInlineMediaPlayback,allowsPictureInPictureMediaPlayback:allowsPictureInPictureMediaPlayback,incognito:incognito,mediaPlaybackRequiresUserAction:mediaPlaybackRequiresUserAction,ref:webViewRef,source:sourceResolved,style:webViewStyles},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,2 +1,38 @@
1
- declare const styles: any;
1
+ declare const styles: {
2
+ container: {
3
+ flex: number;
4
+ overflow: "hidden";
5
+ };
6
+ loadingOrErrorView: {
7
+ position: "absolute";
8
+ flex: number;
9
+ justifyContent: "center";
10
+ alignItems: "center";
11
+ height: "100%";
12
+ width: "100%";
13
+ backgroundColor: string;
14
+ };
15
+ loadingProgressBar: {
16
+ height: number;
17
+ };
18
+ errorText: {
19
+ fontSize: number;
20
+ textAlign: "center";
21
+ marginBottom: number;
22
+ };
23
+ errorTextTitle: {
24
+ fontSize: number;
25
+ fontWeight: "500";
26
+ marginBottom: number;
27
+ };
28
+ webView: {
29
+ backgroundColor: string;
30
+ };
31
+ flexStart: {
32
+ alignSelf: "flex-start";
33
+ };
34
+ colorRed: {
35
+ color: string;
36
+ };
37
+ };
2
38
  export default styles;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var styles=_reactNative.StyleSheet.create({container:{flex:1,overflow:'hidden'},loadingOrErrorView:{position:'absolute',flex:1,justifyContent:'center',alignItems:'center',height:'100%',width:'100%',backgroundColor:'white'},loadingProgressBar:{height:20},errorText:{fontSize:14,textAlign:'center',marginBottom:2},errorTextTitle:{fontSize:15,fontWeight:'500',marginBottom:10},webView:{backgroundColor:'#ffffff'},flexStart:{alignSelf:'flex-start'},colorRed:{color:'red'}});var _default=exports.default=styles;
@@ -9,5 +9,9 @@
9
9
  * Copyright (c) Microsoft Corporation. All rights reserved.
10
10
  * Licensed under the MIT License.
11
11
  */
12
- declare const WebView: any;
12
+ import React from 'react';
13
+ import { WindowsWebViewProps } from './WebViewTypes';
14
+ declare const WebView: React.ForwardRefExoticComponent<WindowsWebViewProps & React.RefAttributes<{}>> & {
15
+ isFileUploadSupported: () => Promise<boolean>;
16
+ };
13
17
  export default WebView;
@@ -0,0 +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 _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","onOpenWindow","onSourceChanged","onHttpError","onMessage","renderLoading","renderError","style","containerStyle","source","nativeConfig","onShouldStartLoadWithRequest","useWebView2"];var _this=this,_jsxFileName="/Users/taesupyoon/bootpay-commerce/multi-sdk/client/react-native/react-native-webview-bootpay/src/WebView.windows.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var Commands=(0,_codegenNativeCommands.default)({supportedCommands:['goBack','goForward','reload','stopLoading','injectJavaScript','requestFocus','clearCache','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,onOpenWindowProp=_ref.onOpenWindow,onSourceChanged=_ref.onSourceChanged,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,onOpenWindowProp:onOpenWindowProp}),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;(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);},clearCache:function clearCache(){return Commands.clearCache(webViewRef.current);},loadUrl:function loadUrl(url){return Commands.loadUrl(webViewRef.current,url);}};},[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',linkHandlingEnabled:typeof onOpenWindowProp==='function',onLoadingError:onLoadingError,onLoadingFinish:onLoadingFinish,onLoadingProgress:onLoadingProgress,onLoadingStart:onLoadingStart,onHttpError:onHttpError,onMessage:onMessage,onShouldStartLoadWithRequest:onShouldStartLoadWithRequest,onOpenWindow:onOpenWindow,onSourceChanged:onSourceChanged,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;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var BPCWebView=(0,_reactNative.requireNativeComponent)('BPCWebView');var _default=exports.default=BPCWebView;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.RCTWebView2=exports.RCTWebView=void 0;var _reactNative=require("react-native");var RCTWebView=exports.RCTWebView=(0,_reactNative.requireNativeComponent)('RCTWebView');var RCTWebView2=exports.RCTWebView2=(0,_reactNative.requireNativeComponent)('RCTWebView2');
@@ -1,37 +1,38 @@
1
- import { OnShouldStartLoadWithRequest, WebViewError, WebViewErrorEvent, WebViewHttpErrorEvent, WebViewMessageEvent, WebViewNavigation, WebViewNavigationEvent, WebViewOpenWindowEvent, WebViewProgressEvent, WebViewRenderProcessGoneEvent, WebViewTerminatedEvent } from './WebViewTypes';
1
+ import React from 'react';
2
+ import { OnShouldStartLoadWithRequest, ShouldStartLoadRequestEvent, WebViewError, WebViewErrorEvent, WebViewHttpErrorEvent, WebViewMessageEvent, WebViewNavigation, WebViewNavigationEvent, WebViewOpenWindowEvent, WebViewProgressEvent, WebViewRenderProcessGoneEvent, WebViewTerminatedEvent } from './WebViewTypes';
2
3
  declare const defaultOriginWhitelist: readonly ["http://*", "https://*"];
3
- declare const createOnShouldStartLoadWithRequest: (loadRequest: (shouldStart: boolean, url: string, lockIdentifier: number) => void, originWhitelist: readonly string[], onShouldStartLoadWithRequest?: OnShouldStartLoadWithRequest) => ({ nativeEvent }: NativeSyntheticEvent<import("./WebViewTypes").ShouldStartLoadRequest>) => void;
4
- declare const defaultRenderLoading: () => any;
5
- declare const defaultRenderError: (errorDomain: string | undefined, errorCode: number, errorDesc: string) => any;
4
+ declare const createOnShouldStartLoadWithRequest: (loadRequest: (shouldStart: boolean, url: string, lockIdentifier: number) => void, originWhitelist: readonly string[], onShouldStartLoadWithRequest?: OnShouldStartLoadWithRequest) => ({ nativeEvent }: ShouldStartLoadRequestEvent) => void;
5
+ declare const defaultRenderLoading: () => React.JSX.Element;
6
+ declare const defaultRenderError: (errorDomain: string | undefined, errorCode: number, errorDesc: string) => React.JSX.Element;
6
7
  export { defaultOriginWhitelist, createOnShouldStartLoadWithRequest, defaultRenderLoading, defaultRenderError, };
7
8
  export declare const useWebViewLogic: ({ startInLoadingState, onNavigationStateChange, onLoadStart, onLoad, onLoadProgress, onLoadEnd, onError, onHttpErrorProp, onMessageProp, onOpenWindowProp, onRenderProcessGoneProp, onContentProcessDidTerminateProp, originWhitelist, onShouldStartLoadWithRequestProp, onShouldStartLoadWithRequestCallback, }: {
8
9
  startInLoadingState?: boolean;
9
10
  onNavigationStateChange?: (event: WebViewNavigation) => void;
10
- onLoadStart?: (event: NativeSyntheticEvent<WebViewNavigation>) => void;
11
- onLoad?: (event: NativeSyntheticEvent<WebViewNavigation>) => void;
12
- onLoadProgress?: (event: NativeSyntheticEvent<import("./WebViewTypes").WebViewNativeProgressEvent>) => void;
11
+ onLoadStart?: (event: WebViewNavigationEvent) => void;
12
+ onLoad?: (event: WebViewNavigationEvent) => void;
13
+ onLoadProgress?: (event: WebViewProgressEvent) => void;
13
14
  onLoadEnd?: (event: WebViewNavigationEvent | WebViewErrorEvent) => void;
14
- onError?: (event: NativeSyntheticEvent<WebViewError>) => void;
15
- onHttpErrorProp?: (event: NativeSyntheticEvent<import("./WebViewTypes").WebViewHttpError>) => void;
16
- onMessageProp?: (event: NativeSyntheticEvent<import("./WebViewTypes").WebViewMessage>) => void;
17
- onOpenWindowProp?: (event: NativeSyntheticEvent<import("./WebViewTypes").WebViewOpenWindow>) => void;
18
- onRenderProcessGoneProp?: (event: NativeSyntheticEvent<import("./WebViewTypes").WebViewRenderProcessGoneDetail>) => void;
19
- onContentProcessDidTerminateProp?: (event: NativeSyntheticEvent<import("./WebViewTypes").WebViewNativeEvent>) => void;
15
+ onError?: (event: WebViewErrorEvent) => void;
16
+ onHttpErrorProp?: (event: WebViewHttpErrorEvent) => void;
17
+ onMessageProp?: (event: WebViewMessageEvent) => void;
18
+ onOpenWindowProp?: (event: WebViewOpenWindowEvent) => void;
19
+ onRenderProcessGoneProp?: (event: WebViewRenderProcessGoneEvent) => void;
20
+ onContentProcessDidTerminateProp?: (event: WebViewTerminatedEvent) => void;
20
21
  originWhitelist: readonly string[];
21
22
  onShouldStartLoadWithRequestProp?: OnShouldStartLoadWithRequest;
22
23
  onShouldStartLoadWithRequestCallback: (shouldStart: boolean, url: string, lockIdentifier?: number | undefined) => void;
23
24
  }) => {
24
- onShouldStartLoadWithRequest: any;
25
- onLoadingStart: any;
26
- onLoadingProgress: any;
27
- onLoadingError: any;
28
- onLoadingFinish: any;
29
- onHttpError: any;
30
- onRenderProcessGone: any;
31
- onContentProcessDidTerminate: any;
32
- onMessage: any;
33
- onOpenWindow: any;
34
- viewState: any;
35
- setViewState: any;
36
- lastErrorEvent: any;
25
+ onShouldStartLoadWithRequest: ({ nativeEvent }: ShouldStartLoadRequestEvent) => void;
26
+ onLoadingStart: (event: WebViewNavigationEvent) => void;
27
+ onLoadingProgress: (event: WebViewProgressEvent) => void;
28
+ onLoadingError: (event: WebViewErrorEvent) => void;
29
+ onLoadingFinish: (event: WebViewNavigationEvent) => void;
30
+ onHttpError: (event: WebViewHttpErrorEvent) => void;
31
+ onRenderProcessGone: (event: WebViewRenderProcessGoneEvent) => void;
32
+ onContentProcessDidTerminate: (event: WebViewTerminatedEvent) => void;
33
+ onMessage: (event: WebViewMessageEvent) => void;
34
+ onOpenWindow: (event: WebViewOpenWindowEvent) => void;
35
+ viewState: "IDLE" | "LOADING" | "ERROR";
36
+ setViewState: React.Dispatch<React.SetStateAction<"IDLE" | "LOADING" | "ERROR">>;
37
+ lastErrorEvent: WebViewError | null;
37
38
  };
@@ -0,0 +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 _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-commerce/multi-sdk/client/react-native/react-native-webview-bootpay/src/WebViewShared.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}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||onNavigationStateChange(event.nativeEvent);},[onNavigationStateChange]);var onLoadingStart=(0,_react.useCallback)(function(event){startUrl.current=event.nativeEvent.url;onLoadStart==null||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||onLoadEnd(event);if(event.isDefaultPrevented()){return;}setViewState('ERROR');setLastErrorEvent(event.nativeEvent);},[onError,onLoadEnd]);var onHttpError=(0,_react.useCallback)(function(event){onHttpErrorProp==null||onHttpErrorProp(event);},[onHttpErrorProp]);var onRenderProcessGone=(0,_react.useCallback)(function(event){onRenderProcessGoneProp==null||onRenderProcessGoneProp(event);},[onRenderProcessGoneProp]);var onContentProcessDidTerminate=(0,_react.useCallback)(function(event){onContentProcessDidTerminateProp==null||onContentProcessDidTerminateProp(event);},[onContentProcessDidTerminateProp]);var onLoadingFinish=(0,_react.useCallback)(function(event){onLoad==null||onLoad(event);onLoadEnd==null||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||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||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||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};};
@@ -0,0 +1 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.NativeWebViewWindows=exports.NativeWebViewMacOS=void 0;var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=require("react");function _callSuper(t,o,e){return o=(0,_getPrototypeOf2.default)(o),(0,_possibleConstructorReturn2.default)(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2.default)(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var NativeWebViewMacOS=exports.NativeWebViewMacOS=function(_NativeWebViewMacOSBa){function NativeWebViewMacOS(){(0,_classCallCheck2.default)(this,NativeWebViewMacOS);return _callSuper(this,NativeWebViewMacOS,arguments);}(0,_inherits2.default)(NativeWebViewMacOS,_NativeWebViewMacOSBa);return(0,_createClass2.default)(NativeWebViewMacOS);}(NativeWebViewMacOSBase);var NativeWebViewWindows=exports.NativeWebViewWindows=function(_NativeWebViewWindows){function NativeWebViewWindows(){(0,_classCallCheck2.default)(this,NativeWebViewWindows);return _callSuper(this,NativeWebViewWindows,arguments);}(0,_inherits2.default)(NativeWebViewWindows,_NativeWebViewWindows);return(0,_createClass2.default)(NativeWebViewWindows);}(NativeWebViewWindowsBase);
package/lib/index.js ADDED
@@ -0,0 +1 @@
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"WebView",{enumerable:true,get:function get(){return _WebView.default;}});exports.default=void 0;var _WebView=_interopRequireDefault(require("./WebView"));var _default=exports.default=_WebView.default;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
11
11
  ],
12
12
  "license": "MIT",
13
- "version": "13.14.1",
13
+ "version": "13.14.3",
14
14
  "homepage": "https://github.com/bootpay/react-native-webview-bootpay#readme",
15
15
  "scripts": {
16
16
  "android": "react-native run-android",