@exodus/react-native-webview 11.26.1-exodus.9 → 13.16.0-exodus.0

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.
Files changed (94) hide show
  1. package/README.md +36 -63
  2. package/android/build.gradle +83 -110
  3. package/android/gradle.properties +3 -4
  4. package/android/src/main/AndroidManifest.xml +12 -0
  5. package/android/src/main/AndroidManifestNew.xml +26 -0
  6. package/android/src/main/java/com/reactnativecommunity/webview/RNCBasicAuthCredential.java +11 -0
  7. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java +407 -0
  8. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java +468 -0
  9. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java +330 -0
  10. package/android/src/main/java/com/reactnativecommunity/webview/{WebViewConfig.java → RNCWebViewConfig.java} +3 -4
  11. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewFileProvider.java +1 -1
  12. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManagerImpl.kt +746 -0
  13. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewMessagingModule.kt +9 -0
  14. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModuleImpl.java +554 -0
  15. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewPackage.java +57 -12
  16. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewWrapper.kt +39 -0
  17. package/android/src/main/java/com/reactnativecommunity/webview/events/SubResourceErrorEvent.kt +25 -0
  18. package/android/src/main/java/com/reactnativecommunity/webview/events/TopCustomMenuSelectionEvent.kt +24 -0
  19. package/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt +25 -0
  20. package/android/src/main/java/com/reactnativecommunity/webview/events/TopNewWindowEvent.kt +25 -0
  21. package/android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt +25 -0
  22. package/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java +570 -0
  23. package/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewModule.java +57 -0
  24. package/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java +341 -0
  25. package/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewModule.java +59 -0
  26. package/apple/RCTConvert+WKDataDetectorTypes.h +11 -0
  27. package/apple/RCTConvert+WKDataDetectorTypes.m +27 -0
  28. package/apple/RNCWebView.h +26 -100
  29. package/apple/RNCWebView.mm +555 -0
  30. package/apple/RNCWebViewDecisionManager.h +20 -0
  31. package/apple/RNCWebViewDecisionManager.m +47 -0
  32. package/apple/RNCWebViewImpl.h +164 -0
  33. package/apple/{RNCWebView.m → RNCWebViewImpl.m} +803 -226
  34. package/apple/RNCWebViewManager.h +4 -8
  35. package/apple/RNCWebViewManager.mm +221 -0
  36. package/apple/RNCWebViewModule.h +23 -0
  37. package/apple/RNCWebViewModule.mm +34 -0
  38. package/index.d.ts +2 -3
  39. package/lib/NativeRNCWebViewModule.d.ts +8 -0
  40. package/lib/NativeRNCWebViewModule.js +1 -0
  41. package/lib/RNCWebViewNativeComponent.d.ts +245 -0
  42. package/lib/RNCWebViewNativeComponent.js +1 -0
  43. package/lib/WebView.android.d.ts +0 -1
  44. package/lib/WebView.android.js +1 -135
  45. package/lib/WebView.d.ts +2 -3
  46. package/lib/WebView.ios.d.ts +0 -1
  47. package/lib/WebView.ios.js +1 -114
  48. package/lib/WebView.js +1 -11
  49. package/lib/WebView.macos.d.ts +6 -0
  50. package/lib/WebView.macos.js +1 -0
  51. package/lib/WebView.styles.d.ts +37 -11
  52. package/lib/WebView.styles.js +1 -33
  53. package/lib/WebView.windows.d.ts +17 -0
  54. package/lib/WebView.windows.js +1 -0
  55. package/lib/WebViewNativeComponent.macos.d.ts +3 -0
  56. package/lib/WebViewNativeComponent.macos.js +1 -0
  57. package/lib/WebViewNativeComponent.windows.d.ts +3 -0
  58. package/lib/WebViewNativeComponent.windows.js +1 -0
  59. package/lib/WebViewShared.d.ts +30 -9
  60. package/lib/WebViewShared.js +1 -174
  61. package/lib/WebViewTypes.d.ts +514 -98
  62. package/lib/WebViewTypes.js +1 -6
  63. package/lib/index.d.ts +0 -1
  64. package/lib/index.js +1 -3
  65. package/lib/validation.d.ts +3 -0
  66. package/lib/validation.js +1 -0
  67. package/package.json +57 -33
  68. package/react-native-webview.podspec +32 -5
  69. package/react-native.config.js +22 -18
  70. package/src/NativeRNCWebViewModule.ts +13 -0
  71. package/src/RNCWebViewNativeComponent.ts +348 -0
  72. package/src/WebView.android.tsx +345 -0
  73. package/src/WebView.ios.tsx +341 -0
  74. package/src/WebView.macos.tsx +252 -0
  75. package/src/WebView.styles.ts +41 -0
  76. package/src/WebView.tsx +25 -0
  77. package/src/WebView.windows.tsx +217 -0
  78. package/src/WebViewNativeComponent.macos.ts +7 -0
  79. package/src/WebViewNativeComponent.windows.ts +8 -0
  80. package/src/WebViewShared.tsx +476 -0
  81. package/src/WebViewTypes.ts +1402 -0
  82. package/src/__tests__/WebViewShared-test.js +323 -0
  83. package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +8 -0
  84. package/src/__tests__/validation-test.js +38 -0
  85. package/src/index.ts +4 -0
  86. package/src/validation.ts +20 -0
  87. package/android/.editorconfig +0 -6
  88. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +0 -1408
  89. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java +0 -506
  90. package/apple/RNCWebViewManager.m +0 -278
  91. package/lib/WebViewNativeComponent.android.d.ts +0 -4
  92. package/lib/WebViewNativeComponent.android.js +0 -3
  93. package/lib/WebViewNativeComponent.ios.d.ts +0 -4
  94. package/lib/WebViewNativeComponent.ios.js +0 -3
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <React/RCTView.h>
9
+ #import <React/RCTDefines.h>
10
+ #import <WebKit/WKDataDetectorTypes.h>
11
+ #import <WebKit/WebKit.h>
12
+
13
+ #if !TARGET_OS_OSX
14
+ #import <UIKit/UIScrollView.h>
15
+ #endif // !TARGET_OS_OSX
16
+
17
+ #import "RNCWebViewDecisionManager.h"
18
+
19
+ typedef enum RNCWebViewPermissionGrantType : NSUInteger {
20
+ RNCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt,
21
+ RNCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny,
22
+ RNCWebViewPermissionGrantType_Deny,
23
+ RNCWebViewPermissionGrantType_Grant,
24
+ RNCWebViewPermissionGrantType_Prompt
25
+ } RNCWebViewPermissionGrantType;
26
+
27
+ @class RNCWebViewImpl;
28
+
29
+ NS_ASSUME_NONNULL_BEGIN
30
+
31
+ @protocol RNCWebViewDelegate <NSObject>
32
+
33
+ - (BOOL)webView:(RNCWebViewImpl *)webView
34
+ shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
35
+ withCallback:(RCTDirectEventBlock)callback;
36
+
37
+ @end
38
+
39
+ @interface RNCWeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
40
+
41
+ @property (nonatomic, weak, nullable) id<WKScriptMessageHandler> scriptDelegate;
42
+
43
+ - (nullable instancetype)initWithDelegate:(id<WKScriptMessageHandler> _Nullable)scriptDelegate;
44
+
45
+ @end
46
+
47
+ #if !TARGET_OS_OSX
48
+ @interface RNCWebViewImpl : RCTView <UIEditMenuInteractionDelegate, UIGestureRecognizerDelegate>
49
+
50
+ @property (nonatomic, nullable) UIEditMenuInteraction *editMenuInteraction API_AVAILABLE(ios(16.0));
51
+ #else
52
+ @interface RNCWebViewImpl : RCTView
53
+ #endif // !TARGET_OS_OSX
54
+
55
+
56
+ @property (nonatomic, copy) RCTDirectEventBlock onFileDownload;
57
+ @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
58
+ @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
59
+ @property (nonatomic, copy) RCTDirectEventBlock onLoadingError;
60
+ @property (nonatomic, copy) RCTDirectEventBlock onLoadingProgress;
61
+ @property (nonatomic, copy) RCTDirectEventBlock onShouldStartLoadWithRequest;
62
+ @property (nonatomic, copy) RCTDirectEventBlock onHttpError;
63
+ @property (nonatomic, copy) RCTDirectEventBlock onMessage;
64
+ @property (nonatomic, copy) RCTDirectEventBlock onScroll;
65
+ @property (nonatomic, copy) RCTDirectEventBlock onContentProcessDidTerminate;
66
+ @property (nonatomic, copy) RCTDirectEventBlock onOpenWindow;
67
+
68
+
69
+ @property (nonatomic, weak) id<RNCWebViewDelegate> _Nullable delegate;
70
+ @property (nonatomic, copy) NSDictionary * _Nullable source;
71
+ @property (nonatomic, assign) BOOL messagingEnabled;
72
+ @property (nonatomic, copy) NSString * _Nullable injectedJavaScript;
73
+ @property (nonatomic, copy) NSString * _Nullable injectedJavaScriptBeforeContentLoaded;
74
+ @property (nonatomic, assign) BOOL injectedJavaScriptForMainFrameOnly;
75
+ @property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
76
+ @property (nonatomic, copy) NSString * _Nullable injectedJavaScriptObject;
77
+ @property (nonatomic, assign) BOOL scrollEnabled;
78
+ @property (nonatomic, assign) BOOL sharedCookiesEnabled;
79
+ @property (nonatomic, assign) BOOL autoManageStatusBarEnabled;
80
+ @property (nonatomic, assign) BOOL pagingEnabled;
81
+ @property (nonatomic, assign) CGFloat decelerationRate;
82
+ @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
83
+ @property (nonatomic, assign) BOOL allowsPictureInPictureMediaPlayback;
84
+ @property (nonatomic, assign) BOOL webviewDebuggingEnabled;
85
+ @property (nonatomic, assign) BOOL allowsAirPlayForMediaPlayback;
86
+ @property (nonatomic, assign) BOOL bounces;
87
+ @property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction;
88
+ @property (nonatomic, assign) UIEdgeInsets contentInset;
89
+ @property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
90
+ @property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction;
91
+ @property (nonatomic, assign) BOOL hideKeyboardAccessoryView;
92
+ @property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
93
+ @property (nonatomic, assign) BOOL incognito;
94
+ @property (nonatomic, assign) BOOL useSharedProcessPool;
95
+ @property (nonatomic, copy) NSString * _Nullable userAgent;
96
+ @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
97
+ @property (nonatomic, assign) BOOL cacheEnabled;
98
+ @property (nonatomic, assign) BOOL javaScriptEnabled;
99
+ @property (nonatomic, assign) BOOL javaScriptCanOpenWindowsAutomatically;
100
+ @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
101
+ @property (nonatomic, assign) BOOL allowUniversalAccessFromFileURLs;
102
+ @property (nonatomic, assign) BOOL allowsLinkPreview;
103
+ @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
104
+ @property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
105
+ @property (nonatomic, copy) NSString * _Nullable indicatorStyle;
106
+ @property (nonatomic, assign) BOOL directionalLockEnabled;
107
+ @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
108
+ @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
109
+ @property (nonatomic, copy) NSDictionary * _Nullable basicAuthCredential;
110
+ @property (nonatomic, assign) BOOL pullToRefreshEnabled;
111
+ @property (nonatomic, assign) BOOL refreshControlLightMode;
112
+ @property (nonatomic, assign) BOOL enableApplePay;
113
+ @property (nonatomic, copy) NSArray<NSDictionary *> * _Nullable menuItems;
114
+ @property (nonatomic, copy) NSArray<NSString *> * _Nullable suppressMenuItems;
115
+ @property (nonatomic, copy) RCTDirectEventBlock onCustomMenuSelection;
116
+ #if !TARGET_OS_OSX
117
+ @property (nonatomic, assign) WKDataDetectorTypes dataDetectorTypes;
118
+ @property (nonatomic, weak) UIRefreshControl * _Nullable refreshControl;
119
+ #endif
120
+
121
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
122
+ @property (nonatomic, assign) WKContentMode contentMode;
123
+ @property (nonatomic, assign) BOOL fraudulentWebsiteWarningEnabled;
124
+ #endif
125
+
126
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 /* iOS 14 */
127
+ @property (nonatomic, assign) BOOL limitsNavigationsToAppBoundDomains;
128
+ #endif
129
+
130
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */
131
+ @property (nonatomic, assign) BOOL textInteractionEnabled;
132
+ #endif
133
+
134
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
135
+ @property (nonatomic, assign) RNCWebViewPermissionGrantType mediaCapturePermissionGrantType;
136
+ #endif
137
+
138
+ #if !TARGET_OS_OSX
139
+ - (void)setContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)behavior;
140
+ #endif // !TARGET_OS_OSX
141
+
142
+ + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
143
+ + (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
144
+ // Exodus: Camera permission whitelist for security
145
+ + (void)setCameraPermissionOriginWhitelist:(nullable NSArray<NSString *>*)whitelist;
146
+ - (void)postMessage:(NSString *_Nullable)message;
147
+ - (void)injectJavaScript:(NSString *_Nullable)script;
148
+ - (void)goForward;
149
+ - (void)goBack;
150
+ - (void)reload;
151
+ - (void)stopLoading;
152
+ - (void)requestFocus;
153
+ - (void)clearCache:(BOOL)includeDiskFiles;
154
+ #ifdef RCT_NEW_ARCH_ENABLED
155
+ - (void)destroyWebView;
156
+ #endif
157
+ #if !TARGET_OS_OSX
158
+ - (void)addPullToRefreshControl;
159
+ - (void)pullToRefresh:(UIRefreshControl *)refreshControl;
160
+ #endif
161
+
162
+ @end
163
+
164
+ NS_ASSUME_NONNULL_END