@exodus/react-native-webview 11.26.1-exodus.1 → 11.26.1-exodus.11

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.
@@ -1,4 +1,4 @@
1
- import { ReactElement, Component } from 'react';
1
+ import { ReactElement, Component, ElementType } from 'react';
2
2
  import { NativeSyntheticEvent, ViewProps, StyleProp, ViewStyle, NativeMethodsMixin, Constructor, UIManagerStatic, NativeScrollEvent } from 'react-native';
3
3
  declare type WebViewCommands = 'goForward' | 'goBack' | 'reload' | 'stopLoading' | 'postMessage' | 'injectJavaScript' | 'loadUrl' | 'requestFocus';
4
4
  declare type AndroidWebViewCommands = 'clearHistory' | 'clearCache' | 'clearFormData';
@@ -58,9 +58,6 @@ export interface WebViewNavigation extends WebViewNativeEvent {
58
58
  export interface ShouldStartLoadRequest extends WebViewNavigation {
59
59
  isTopFrame: boolean;
60
60
  }
61
- export interface FileDownload {
62
- downloadUrl: string;
63
- }
64
61
  export declare type DecelerationRateConstant = 'normal' | 'fast';
65
62
  export interface WebViewMessage extends WebViewNativeEvent {
66
63
  data: string;
@@ -73,23 +70,12 @@ export interface WebViewError extends WebViewNativeEvent {
73
70
  code: number;
74
71
  description: string;
75
72
  }
76
- export interface WebViewHttpError extends WebViewNativeEvent {
77
- description: string;
78
- statusCode: number;
79
- }
80
- export interface WebViewRenderProcessGoneDetail {
81
- didCrash: boolean;
82
- }
83
73
  export declare type WebViewEvent = NativeSyntheticEvent<WebViewNativeEvent>;
84
74
  export declare type WebViewProgressEvent = NativeSyntheticEvent<WebViewNativeProgressEvent>;
85
75
  export declare type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
86
76
  export declare type ShouldStartLoadRequestEvent = NativeSyntheticEvent<ShouldStartLoadRequest>;
87
- export declare type FileDownloadEvent = NativeSyntheticEvent<FileDownload>;
88
77
  export declare type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
89
78
  export declare type WebViewErrorEvent = NativeSyntheticEvent<WebViewError>;
90
- export declare type WebViewTerminatedEvent = NativeSyntheticEvent<WebViewNativeEvent>;
91
- export declare type WebViewHttpErrorEvent = NativeSyntheticEvent<WebViewHttpError>;
92
- export declare type WebViewRenderProcessGoneEvent = NativeSyntheticEvent<WebViewRenderProcessGoneDetail>;
93
79
  export declare type WebViewScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
94
80
  export declare type DataDetectorTypes = 'phoneNumber' | 'link' | 'address' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'none' | 'all';
95
81
  export declare type OverScrollModeType = 'always' | 'content' | 'never';
@@ -155,13 +141,10 @@ export interface BasicAuthCredential {
155
141
  password: string;
156
142
  }
157
143
  export interface CommonNativeWebViewProps extends ViewProps {
158
- allowFileAccessFromFileURLs?: boolean;
159
144
  cacheEnabled?: boolean;
160
145
  incognito?: boolean;
161
146
  injectedJavaScript?: string;
162
147
  injectedJavaScriptBeforeContentLoaded?: string;
163
- injectedJavaScriptForMainFrameOnly?: boolean;
164
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
165
148
  mediaPlaybackRequiresUserAction?: boolean;
166
149
  messagingEnabled: boolean;
167
150
  onScroll?: (event: WebViewScrollEvent) => void;
@@ -169,7 +152,6 @@ export interface CommonNativeWebViewProps extends ViewProps {
169
152
  onLoadingFinish: (event: WebViewNavigationEvent) => void;
170
153
  onLoadingProgress: (event: WebViewProgressEvent) => void;
171
154
  onLoadingStart: (event: WebViewNavigationEvent) => void;
172
- onHttpError: (event: WebViewHttpErrorEvent) => void;
173
155
  onMessage: (event: WebViewMessageEvent) => void;
174
156
  onShouldStartLoadWithRequest: (event: ShouldStartLoadRequestEvent) => void;
175
157
  showsHorizontalScrollIndicator?: boolean;
@@ -179,15 +161,11 @@ export interface CommonNativeWebViewProps extends ViewProps {
179
161
  /**
180
162
  * Append to the existing user-agent. Overridden if `userAgent` is set.
181
163
  */
182
- applicationNameForUserAgent?: string;
183
164
  basicAuthCredential?: BasicAuthCredential;
184
165
  }
185
166
  export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps {
186
167
  cacheMode?: CacheMode;
187
- allowFileAccess?: boolean;
188
168
  scalesPageToFit?: boolean;
189
- allowsFullscreenVideo?: boolean;
190
- allowUniversalAccessFromFileURLs?: boolean;
191
169
  androidHardwareAccelerationDisabled?: boolean;
192
170
  androidLayerType?: AndroidLayerType;
193
171
  domStorageEnabled?: boolean;
@@ -195,7 +173,6 @@ export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps {
195
173
  javaScriptEnabled?: boolean;
196
174
  mixedContentMode?: 'never' | 'always' | 'compatibility';
197
175
  onContentSizeChange?: (event: WebViewEvent) => void;
198
- onRenderProcessGone?: (event: WebViewRenderProcessGoneEvent) => void;
199
176
  overScrollMode?: OverScrollModeType;
200
177
  saveFormDataDisabled?: boolean;
201
178
  setSupportMultipleWindows?: boolean;
@@ -216,12 +193,9 @@ export declare type ContentInsetAdjustmentBehavior = 'automatic' | 'scrollableAx
216
193
  export declare type MediaCapturePermissionGrantType = 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny' | 'deny' | 'grant' | 'prompt';
217
194
  export declare type ContentMode = 'recommended' | 'mobile' | 'desktop';
218
195
  export interface IOSNativeWebViewProps extends CommonNativeWebViewProps {
219
- allowingReadAccessToURL?: string;
220
196
  allowsBackForwardNavigationGestures?: boolean;
221
197
  allowsInlineMediaPlayback?: boolean;
222
- allowsAirPlayForMediaPlayback?: boolean;
223
198
  allowsLinkPreview?: boolean;
224
- allowUniversalAccessFromFileURLs?: boolean;
225
199
  automaticallyAdjustContentInsets?: boolean;
226
200
  autoManageStatusBarEnabled?: boolean;
227
201
  bounces?: boolean;
@@ -236,10 +210,6 @@ export interface IOSNativeWebViewProps extends CommonNativeWebViewProps {
236
210
  pagingEnabled?: boolean;
237
211
  scrollEnabled?: boolean;
238
212
  useSharedProcessPool?: boolean;
239
- onContentProcessDidTerminate?: (event: WebViewTerminatedEvent) => void;
240
- injectedJavaScriptForMainFrameOnly?: boolean;
241
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
242
- onFileDownload?: (event: FileDownloadEvent) => void;
243
213
  limitsNavigationsToAppBoundDomains?: boolean;
244
214
  sharedCookiesEnabled?: boolean;
245
215
  enableApplePay?: boolean;
@@ -352,11 +322,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
352
322
  * @platform ios
353
323
  */
354
324
  allowsInlineMediaPlayback?: boolean;
355
- /**
356
- * A Boolean value indicating whether AirPlay is allowed. The default value is `false`.
357
- * @platform ios
358
- */
359
- allowsAirPlayForMediaPlayback?: boolean;
360
325
  /**
361
326
  * Hide the accessory view when the keyboard is open. Default is false to be
362
327
  * backward compatible.
@@ -393,12 +358,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
393
358
  * @platform ios
394
359
  */
395
360
  sharedCookiesEnabled?: boolean;
396
- /**
397
- * When set to true the hardware silent switch is ignored.
398
- * The default value is `false`.
399
- * @platform ios
400
- */
401
- ignoreSilentHardwareSwitch?: boolean;
402
361
  /**
403
362
  * Set true if StatusBar should be light when user watch video fullscreen.
404
363
  * The default value is `true`.
@@ -423,47 +382,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
423
382
  * @platform ios
424
383
  */
425
384
  keyboardDisplayRequiresUserAction?: boolean;
426
- /**
427
- * A String value that indicates which URLs the WebView's file can then
428
- * reference in scripts, AJAX requests, and CSS imports. This is only used
429
- * for WebViews that are loaded with a source.uri set to a `'file://'` URL.
430
- *
431
- * If not provided, the default is to only allow read access to the URL
432
- * provided in source.uri itself.
433
- * @platform ios
434
- */
435
- allowingReadAccessToURL?: string;
436
- /**
437
- * Boolean that sets whether JavaScript running in the context of a file
438
- * scheme URL should be allowed to access content from other file scheme URLs.
439
- * Including accessing content from other file scheme URLs
440
- * @platform ios
441
- */
442
- allowFileAccessFromFileURLs?: boolean;
443
- /**
444
- * Boolean that sets whether JavaScript running in the context of a file
445
- * scheme URL should be allowed to access content from any origin.
446
- * Including accessing content from other file scheme URLs
447
- * @platform ios
448
- */
449
- allowUniversalAccessFromFileURLs?: boolean;
450
- /**
451
- * Function that is invoked when the WebKit WebView content process gets terminated.
452
- * @platform ios
453
- */
454
- onContentProcessDidTerminate?: (event: WebViewTerminatedEvent) => void;
455
- /**
456
- * If `true` (default), loads the `injectedJavaScript` only into the main frame.
457
- * If `false`, loads it into all frames (e.g. iframes).
458
- * @platform ios
459
- */
460
- injectedJavaScriptForMainFrameOnly?: boolean;
461
- /**
462
- * If `true` (default), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
463
- * If `false`, loads it into all frames (e.g. iframes).
464
- * @platform ios
465
- */
466
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
467
385
  /**
468
386
  * Boolean value that determines whether a pull to refresh gesture is
469
387
  * available in the `WebView`. The default value is `false`.
@@ -472,23 +390,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
472
390
  *
473
391
  */
474
392
  pullToRefreshEnabled?: boolean;
475
- /**
476
- * Function that is invoked when the client needs to download a file.
477
- *
478
- * iOS 13+ only: If the webview navigates to a URL that results in an HTTP
479
- * response with a Content-Disposition header 'attachment...', then
480
- * this will be called.
481
- *
482
- * iOS 8+: If the MIME type indicates that the content is not renderable by the
483
- * webview, that will also cause this to be called. On iOS versions before 13,
484
- * this is the only condition that will cause this function to be called.
485
- *
486
- * The application will need to provide its own code to actually download
487
- * the file.
488
- *
489
- * If not provided, the default is to let the webview try to render the file.
490
- */
491
- onFileDownload?: (event: FileDownloadEvent) => void;
492
393
  /**
493
394
  * A Boolean value which, when set to `true`, indicates to WebKit that a WKWebView
494
395
  * will only navigate to app-bound domains. Once set, any attempt to navigate away
@@ -543,13 +444,7 @@ export interface IOSWebViewProps extends WebViewSharedProps {
543
444
  onCustomMenuSelection?: (event: WebViewEvent) => void;
544
445
  }
545
446
  export interface AndroidWebViewProps extends WebViewSharedProps {
546
- onNavigationStateChange?: (event: WebViewNavigation) => void;
547
447
  onContentSizeChange?: (event: WebViewEvent) => void;
548
- /**
549
- * Function that is invoked when the `WebView` process crashes or is killed by the OS.
550
- * Works only on Android (minimum API level 26).
551
- */
552
- onRenderProcessGone?: (event: WebViewRenderProcessGoneEvent) => void;
553
448
  /**
554
449
  * https://developer.android.com/reference/android/webkit/WebSettings.html#setCacheMode(int)
555
450
  * Set the cacheMode. Possible values are:
@@ -584,25 +479,6 @@ export interface AndroidWebViewProps extends WebViewSharedProps {
584
479
  * @platform android
585
480
  */
586
481
  geolocationEnabled?: boolean;
587
- /**
588
- * Boolean that sets whether JavaScript running in the context of a file
589
- * scheme URL should be allowed to access content from other file scheme URLs.
590
- * Including accessing content from other file scheme URLs
591
- * @platform android
592
- */
593
- allowFileAccessFromFileURLs?: boolean;
594
- /**
595
- * Boolean that sets whether JavaScript running in the context of a file
596
- * scheme URL should be allowed to access content from any origin.
597
- * Including accessing content from other file scheme URLs
598
- * @platform android
599
- */
600
- allowUniversalAccessFromFileURLs?: boolean;
601
- /**
602
- * Sets whether the webview allow access to file system.
603
- * @platform android
604
- */
605
- allowFileAccess?: boolean;
606
482
  /**
607
483
  * Used on Android only, controls whether form autocomplete data should be saved
608
484
  * @platform android
@@ -673,10 +549,6 @@ export interface AndroidWebViewProps extends WebViewSharedProps {
673
549
  * @platform android
674
550
  */
675
551
  mixedContentMode?: 'never' | 'always' | 'compatibility';
676
- /**
677
- * Sets ability to open fullscreen videos on Android devices.
678
- */
679
- allowsFullscreenVideo?: boolean;
680
552
  /**
681
553
  * Configuring Dark Theme
682
554
  *
@@ -781,15 +653,6 @@ export interface WebViewSharedProps extends ViewProps {
781
653
  * Function that is invoked when the `WebView` load fails.
782
654
  */
783
655
  onError?: (event: WebViewErrorEvent) => void;
784
- /**
785
- * Function that is invoked when the `WebView` receives an error status code.
786
- * Works on iOS and Android (minimum API level 23).
787
- */
788
- onHttpError?: (event: WebViewHttpErrorEvent) => void;
789
- /**
790
- * Function that is invoked when the `WebView` loading starts or ends.
791
- */
792
- onNavigationStateChange?: (event: WebViewNavigation) => void;
793
656
  /**
794
657
  * Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`.
795
658
  * Setting this property will inject this global into your webview.
@@ -797,11 +660,7 @@ export interface WebViewSharedProps extends ViewProps {
797
660
  * `window.ReactNativeWebView.postMessage` accepts one argument, `data`, which will be
798
661
  * available on the event object, `event.nativeEvent.data`. `data` must be a string.
799
662
  */
800
- onMessage?: (event: WebViewMessageEvent) => void;
801
- /**
802
- * Function that is invoked when the `WebView` is loading.
803
- */
804
- onLoadProgress?: (event: WebViewProgressEvent) => void;
663
+ onMessage?: (event: WebViewMessage) => void;
805
664
  /**
806
665
  * Boolean value that forces the `WebView` to show the loading view
807
666
  * on the first load.
@@ -817,16 +676,6 @@ export interface WebViewSharedProps extends ViewProps {
817
676
  * once the webview is initialized but before the view loads any content.
818
677
  */
819
678
  injectedJavaScriptBeforeContentLoaded?: string;
820
- /**
821
- * If `true` (default; mandatory for Android), loads the `injectedJavaScript` only into the main frame.
822
- * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
823
- */
824
- injectedJavaScriptForMainFrameOnly?: boolean;
825
- /**
826
- * If `true` (default; mandatory for Android), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
827
- * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
828
- */
829
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
830
679
  /**
831
680
  * Boolean value that determines whether a horizontal scroll indicator is
832
681
  * shown in the `WebView`. The default value is `true`.
@@ -860,14 +709,30 @@ export interface WebViewSharedProps extends ViewProps {
860
709
  * Should caching be enabled. Default is true.
861
710
  */
862
711
  cacheEnabled?: boolean;
863
- /**
864
- * Append to the existing user-agent. Overridden if `userAgent` is set.
865
- */
866
- applicationNameForUserAgent?: string;
867
712
  /**
868
713
  * An object that specifies the credentials of a user to be used for basic authentication.
869
714
  */
870
715
  basicAuthCredential?: BasicAuthCredential;
716
+ /**
717
+ * Event metadata validation.
718
+ */
719
+ validateMeta: (event: WebViewNativeEvent) => WebViewNativeEvent;
720
+ /**
721
+ * Event data validation.
722
+ */
723
+ validateData: (data: object) => object;
724
+ /**
725
+ * Webview will refuse to work on iOS versions below this one. Required for iOS.
726
+ */
727
+ minimumIOSVersion?: string;
728
+ /**
729
+ * Webview will refuse to work on Chrome versions below this one. Required for Android.
730
+ */
731
+ minimumChromeVersion?: string;
732
+ /**
733
+ * Component to render if the OS version is not supported.
734
+ */
735
+ unsupportedVersionComponent?: ElementType;
871
736
  }
872
737
  export {};
873
738
  //# sourceMappingURL=WebViewTypes.d.ts.map
@@ -1,33 +1,6 @@
1
1
  /* eslint-disable react/no-multi-comp, max-classes-per-file */
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  import { Component } from 'react';
18
- var NativeWebViewIOS = /** @class */ (function (_super) {
19
- __extends(NativeWebViewIOS, _super);
20
- function NativeWebViewIOS() {
21
- return _super !== null && _super.apply(this, arguments) || this;
22
- }
23
- return NativeWebViewIOS;
24
- }(NativeWebViewIOSBase));
25
- export { NativeWebViewIOS };
26
- var NativeWebViewAndroid = /** @class */ (function (_super) {
27
- __extends(NativeWebViewAndroid, _super);
28
- function NativeWebViewAndroid() {
29
- return _super !== null && _super.apply(this, arguments) || this;
30
- }
31
- return NativeWebViewAndroid;
32
- }(NativeWebViewAndroidBase));
33
- export { NativeWebViewAndroid };
3
+ export class NativeWebViewIOS extends NativeWebViewIOSBase {
4
+ }
5
+ export class NativeWebViewAndroid extends NativeWebViewAndroidBase {
6
+ }
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "11.26.1-exodus.1",
12
+ "version": "11.26.1-exodus.11",
13
13
  "homepage": "https://github.com/ExodusMovement/react-native-webview#readme",
14
14
  "scripts": {
15
15
  "android": "react-native run-android",
@@ -1,15 +0,0 @@
1
- package com.reactnativecommunity.webview
2
-
3
- import com.facebook.react.ReactPackage
4
- import com.facebook.react.bridge.ReactApplicationContext
5
-
6
-
7
- class RNCWebViewPackage: ReactPackage {
8
- override fun createNativeModules(reactContext: ReactApplicationContext) = listOf(
9
- RNCWebViewModule(reactContext)
10
- )
11
-
12
- override fun createViewManagers(reactContext: ReactApplicationContext) = listOf(
13
- RNCWebViewManager()
14
- )
15
- }
@@ -1,25 +0,0 @@
1
- package com.reactnativecommunity.webview.events
2
-
3
- import com.facebook.react.bridge.WritableMap
4
- import com.facebook.react.uimanager.events.Event
5
- import com.facebook.react.uimanager.events.RCTEventEmitter
6
-
7
- /**
8
- * Event emitted when a http error is received from the server.
9
- */
10
- class TopHttpErrorEvent(viewId: Int, private val mEventData: WritableMap) :
11
- Event<TopHttpErrorEvent>(viewId) {
12
- companion object {
13
- const val EVENT_NAME = "topHttpError"
14
- }
15
-
16
- override fun getEventName(): String = EVENT_NAME
17
-
18
- override fun canCoalesce(): Boolean = false
19
-
20
- override fun getCoalescingKey(): Short = 0
21
-
22
- override fun dispatch(rctEventEmitter: RCTEventEmitter) =
23
- rctEventEmitter.receiveEvent(viewTag, eventName, mEventData)
24
-
25
- }
@@ -1,26 +0,0 @@
1
- package com.reactnativecommunity.webview.events
2
-
3
- import com.facebook.react.bridge.WritableMap
4
- import com.facebook.react.uimanager.events.Event
5
- import com.facebook.react.uimanager.events.RCTEventEmitter
6
-
7
- /**
8
- * Event emitted when the WebView's process has crashed or
9
- was killed by the OS.
10
- */
11
- class TopRenderProcessGoneEvent(viewId: Int, private val mEventData: WritableMap) :
12
- Event<TopRenderProcessGoneEvent>(viewId) {
13
- companion object {
14
- const val EVENT_NAME = "topRenderProcessGone"
15
- }
16
-
17
- override fun getEventName(): String = EVENT_NAME
18
-
19
- override fun canCoalesce(): Boolean = false
20
-
21
- override fun getCoalescingKey(): Short = 0
22
-
23
- override fun dispatch(rctEventEmitter: RCTEventEmitter) =
24
- rctEventEmitter.receiveEvent(viewTag, eventName, mEventData)
25
-
26
- }