@exodus/react-native-webview 9.4.0-no-android.0 → 11.26.1-exodus.1

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 (49) hide show
  1. package/README.md +21 -18
  2. package/android/.editorconfig +6 -0
  3. package/android/build.gradle +137 -0
  4. package/android/gradle.properties +6 -0
  5. package/android/src/main/AndroidManifest.xml +15 -0
  6. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewFileProvider.java +14 -0
  7. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +1650 -0
  8. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java +550 -0
  9. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewPackage.kt +15 -0
  10. package/android/src/main/java/com/reactnativecommunity/webview/WebViewConfig.java +12 -0
  11. package/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt +25 -0
  12. package/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.kt +25 -0
  13. package/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.kt +24 -0
  14. package/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingProgressEvent.kt +24 -0
  15. package/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingStartEvent.kt +25 -0
  16. package/android/src/main/java/com/reactnativecommunity/webview/events/TopMessageEvent.kt +24 -0
  17. package/android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt +26 -0
  18. package/android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt +29 -0
  19. package/android/src/main/res/xml/file_provider_paths.xml +6 -0
  20. package/apple/RNCWKProcessPoolManager.h +15 -0
  21. package/apple/RNCWKProcessPoolManager.m +36 -0
  22. package/apple/RNCWebView.h +117 -0
  23. package/apple/RNCWebView.m +1532 -0
  24. package/apple/RNCWebViewManager.h +13 -0
  25. package/apple/RNCWebViewManager.m +288 -0
  26. package/index.d.ts +65 -0
  27. package/index.js +4 -0
  28. package/ios/RNCWebView.xcodeproj/project.pbxproj +2 -0
  29. package/lib/WebView.android.d.ts +7 -0
  30. package/lib/WebView.android.js +125 -1
  31. package/lib/WebView.d.ts +7 -0
  32. package/lib/WebView.ios.d.ts +7 -0
  33. package/lib/WebView.ios.js +148 -202
  34. package/lib/WebView.js +9 -2
  35. package/lib/WebView.styles.d.ts +12 -0
  36. package/lib/WebView.styles.js +7 -7
  37. package/lib/WebViewNativeComponent.android.d.ts +4 -0
  38. package/lib/WebViewNativeComponent.android.js +3 -0
  39. package/lib/WebViewNativeComponent.ios.d.ts +4 -0
  40. package/lib/WebViewNativeComponent.ios.js +3 -0
  41. package/lib/WebViewShared.d.ts +37 -0
  42. package/lib/WebViewShared.js +121 -24
  43. package/lib/WebViewTypes.d.ts +873 -0
  44. package/lib/WebViewTypes.js +31 -16
  45. package/lib/index.d.ts +4 -0
  46. package/lib/index.js +3 -0
  47. package/package.json +83 -87
  48. package/react-native-webview.podspec +4 -4
  49. package/react-native.config.js +37 -0
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # React Native WebView - a Modern, Cross-Platform WebView for React Native
2
2
 
3
- [![star this repo](http://githubbadges.com/star.svg?user=react-native-community&repo=react-native-webview&style=flat)](https://github.com/react-native-community/react-native-webview)
3
+ [![star this repo](http://githubbadges.com/star.svg?user=react-native-webview&repo=react-native-webview&style=flat)](https://github.com/react-native-webview/react-native-webview)
4
4
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
5
5
  [![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors)
6
- [![Known Vulnerabilities](https://snyk.io/test/github/react-native-community/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-community/react-native-webview)
6
+ [![Known Vulnerabilities](https://snyk.io/test/github/react-native-webview/react-native-webview/badge.svg?style=flat-square)](https://snyk.io/test/github/react-native-webview/react-native-webview)
7
7
  [![NPM Version](https://img.shields.io/npm/v/react-native-webview.svg?style=flat-square)](https://www.npmjs.com/package/react-native-webview)
8
8
  [![Lean Core Extracted](https://img.shields.io/badge/Lean%20Core-Extracted-brightgreen.svg?style=flat-square)][lean-core-issue]
9
9
 
@@ -13,8 +13,10 @@
13
13
 
14
14
  _This project is maintained for free by these people using both their free time and their company work time._
15
15
 
16
- - [Thibault Malbranche](https://github.com/Titozzz) ([Twitter @titozzz](https://twitter.com/titozzz)) from [Brigad](https://brigad.co/about)
16
+ - [Thibault Malbranche](https://github.com/Titozzz) ([Twitter @titozzz](https://twitter.com/titozzz)) from [Brigad](https://www.brigad.co/en-gb/about-us)
17
17
  - [Jamon Holmgren](https://github.com/jamonholmgren) ([Twitter @jamonholmgren](https://twitter.com/jamonholmgren)) from [Infinite Red](https://infinite.red/react-native)
18
+ - [Alexander Sklar](https://github.com/asklar) ([Twitter @alexsklar](https://twitter.com/alexsklar)) from [React Native Windows @ Microsoft](https://microsoft.github.io/react-native-windows/)
19
+ - [Chiara Mooney](https://github.com/chiaramooney) from [React Native Windows @ Microsoft](https://microsoft.github.io/react-native-windows/)
18
20
 
19
21
  ## Platforms Supported
20
22
 
@@ -22,8 +24,7 @@ _This project is maintained for free by these people using both their free time
22
24
  - [x] Android
23
25
  - [x] macOS
24
26
  - [x] Windows
25
-
26
- _Note: Expo support for React Native WebView started with [Expo SDK v33.0.0](https://blog.expo.io/expo-sdk-v33-0-0-is-now-available-52d1c99dfe4c)._
27
+ - [x] Expo (Android, iOS)
27
28
 
28
29
  ## Getting Started
29
30
 
@@ -37,20 +38,20 @@ This project follows [semantic versioning](https://semver.org/). We do not hesit
37
38
 
38
39
  Current Version: ![version](https://img.shields.io/npm/v/react-native-webview.svg)
39
40
 
40
- - [8.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange now triggers with hash url changes
41
-
42
- - [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView
43
-
44
- - [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update to AndroidX. Make sure to enable it in your project's `android/gradle.properties`. See [Getting Started Guide](docs/Getting-Started.md).
45
-
46
- - [5.0.**1**](https://github.com/react-native-community/react-native-webview/releases/tag/v5.0.0) - Refactored the old postMessage implementation for communication from webview to native.
47
- - [4.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v4.0.0) - Added cache (enabled by default).
48
- - [3.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v3.0.0) - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default).
49
- - [2.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v2.0.0) - First release this is a replica of the core webview component
41
+ - [11.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v11.0.0) - Android setSupportMultipleWindows.
42
+ - [10.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v10.0.0) - Android Gradle plugin is only required when opening the project stand-alone
43
+ - [9.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v9.0.0) - props updates to injectedJavaScript are no longer immutable.
44
+ - [8.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange now triggers with hash url changes
45
+ - [7.0.1](https://github.com/react-native-webview/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView
46
+ - [6.0.**2**](https://github.com/react-native-webview/react-native-webview/releases/tag/v6.0.2) - Update to AndroidX. Make sure to enable it in your project's `android/gradle.properties`. See [Getting Started Guide](docs/Getting-Started.md).
47
+ - [5.0.**1**](https://github.com/react-native-webview/react-native-webview/releases/tag/v5.0.0) - Refactored the old postMessage implementation for communication from webview to native.
48
+ - [4.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v4.0.0) - Added cache (enabled by default).
49
+ - [3.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v3.0.0) - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default).
50
+ - [2.0.0](https://github.com/react-native-webview/react-native-webview/releases/tag/v2.0.0) - First release this is a replica of the core webview component
50
51
 
51
52
  **Upcoming:**
52
53
 
53
- - this.webView.postMessage() removal (never documented and less flexible than injectJavascript) -> [how to migrate](https://github.com/react-native-community/react-native-webview/issues/809)
54
+ - this.webView.postMessage() removal (never documented and less flexible than injectJavascript) -> [how to migrate](https://github.com/react-native-webview/react-native-webview/issues/809)
54
55
  - Kotlin rewrite
55
56
  - Maybe Swift rewrite
56
57
 
@@ -76,10 +77,11 @@ For more, read the [API Reference](./docs/Reference.md) and [Guide](./docs/Guide
76
77
  ## Common issues
77
78
 
78
79
  - If you're getting `Invariant Violation: Native component for "RNCWebView does not exist"` it likely means you forgot to run `react-native link` or there was some error with the linking process
80
+ - If you encounter a build error during the task `:app:mergeDexRelease`, you need to enable multidex support in `android/app/build.gradle` as discussed in [this issue](https://github.com/react-native-webview/react-native-webview/issues/1344#issuecomment-650544648)
79
81
 
80
82
  ## Contributing
81
83
 
82
- See [Contributing.md](https://github.com/react-native-community/react-native-webview/blob/master/docs/Contributing.md)
84
+ See [Contributing.md](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Contributing.md)
83
85
 
84
86
  ## Contributors
85
87
 
@@ -97,10 +99,11 @@ This project follows the [all-contributors](https://github.com/all-contributors/
97
99
 
98
100
  MIT
99
101
 
100
- ## Traduções
102
+ ## Translations
101
103
 
102
104
  This readme is available in:
103
105
 
104
106
  - [Brazilian portuguese](docs/README.portuguese.md)
107
+ - [French](docs/README.french.md)
105
108
 
106
109
  [lean-core-issue]: https://github.com/facebook/react-native/issues/23313
@@ -0,0 +1,6 @@
1
+ [*]
2
+ charset=utf-8
3
+ end_of_line=lf
4
+ insert_final_newline=false
5
+ indent_style=space
6
+ indent_size=2
@@ -0,0 +1,137 @@
1
+ buildscript {
2
+ ext.getExtOrDefault = {name ->
3
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
4
+ }
5
+
6
+ // The Android Gradle plugin is only required when opening the android folder stand-alone.
7
+ // This avoids unnecessary downloads and potential conflicts when the library is included as a
8
+ // module dependency in an application project.
9
+ if (project == rootProject) {
10
+ repositories {
11
+ mavenCentral()
12
+ google()
13
+ }
14
+
15
+ dependencies {
16
+ classpath("com.android.tools.build:gradle:3.6.0")
17
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
18
+ }
19
+ } else {
20
+ repositories {
21
+ mavenCentral()
22
+ }
23
+
24
+ dependencies {
25
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
26
+ }
27
+ }
28
+ }
29
+
30
+ def getExtOrIntegerDefault(name) {
31
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeWebView_' + name]).toInteger()
32
+ }
33
+
34
+ apply plugin: 'com.android.library'
35
+ apply plugin: 'kotlin-android'
36
+
37
+ android {
38
+ compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
39
+ defaultConfig {
40
+ minSdkVersion getExtOrIntegerDefault('minSdkVersion')
41
+ targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
42
+ versionCode 1
43
+ versionName "1.0"
44
+ }
45
+ buildTypes {
46
+ release {
47
+ minifyEnabled false
48
+ }
49
+ }
50
+ lintOptions {
51
+ disable 'GradleCompatible'
52
+ }
53
+ compileOptions {
54
+ sourceCompatibility JavaVersion.VERSION_1_8
55
+ targetCompatibility JavaVersion.VERSION_1_8
56
+ }
57
+ }
58
+
59
+ repositories {
60
+ mavenCentral()
61
+ google()
62
+
63
+ def found = false
64
+ def defaultDir = null
65
+ def androidSourcesName = 'React Native sources'
66
+
67
+ if (rootProject.ext.has('reactNativeAndroidRoot')) {
68
+ defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
69
+ } else {
70
+ defaultDir = new File(
71
+ projectDir,
72
+ '/../../../node_modules/react-native/android'
73
+ )
74
+ }
75
+
76
+ if (defaultDir.exists()) {
77
+ maven {
78
+ url defaultDir.toString()
79
+ name androidSourcesName
80
+ }
81
+
82
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
83
+ found = true
84
+ } else {
85
+ def parentDir = rootProject.projectDir
86
+
87
+ 1.upto(5, {
88
+ if (found) return true
89
+ parentDir = parentDir.parentFile
90
+
91
+ def androidSourcesDir = new File(
92
+ parentDir,
93
+ 'node_modules/react-native'
94
+ )
95
+
96
+ def androidPrebuiltBinaryDir = new File(
97
+ parentDir,
98
+ 'node_modules/react-native/android'
99
+ )
100
+
101
+ if (androidPrebuiltBinaryDir.exists()) {
102
+ maven {
103
+ url androidPrebuiltBinaryDir.toString()
104
+ name androidSourcesName
105
+ }
106
+
107
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
108
+ found = true
109
+ } else if (androidSourcesDir.exists()) {
110
+ maven {
111
+ url androidSourcesDir.toString()
112
+ name androidSourcesName
113
+ }
114
+
115
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
116
+ found = true
117
+ }
118
+ })
119
+ }
120
+
121
+ if (!found) {
122
+ throw new GradleException(
123
+ "${project.name}: unable to locate React Native android sources. " +
124
+ "Ensure you have you installed React Native as a dependency in your project and try again."
125
+ )
126
+ }
127
+ }
128
+
129
+ def kotlin_version = getExtOrDefault('kotlinVersion')
130
+ def webkit_version = getExtOrDefault('webkitVersion')
131
+
132
+ dependencies {
133
+ //noinspection GradleDynamicVersion
134
+ implementation 'com.facebook.react:react-native:+'
135
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
136
+ implementation "androidx.webkit:webkit:$webkit_version"
137
+ }
@@ -0,0 +1,6 @@
1
+ ReactNativeWebView_kotlinVersion=1.6.0
2
+ ReactNativeWebView_webkitVersion=1.4.0
3
+ ReactNativeWebView_compileSdkVersion=29
4
+ ReactNativeWebView_buildToolsVersion=29.0.3
5
+ ReactNativeWebView_targetSdkVersion=28
6
+ ReactNativeWebView_minSdkVersion=21
@@ -0,0 +1,15 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.reactnativecommunity.webview">
3
+
4
+ <application>
5
+ <provider
6
+ android:name=".RNCWebViewFileProvider"
7
+ android:authorities="${applicationId}.fileprovider"
8
+ android:exported="false"
9
+ android:grantUriPermissions="true">
10
+ <meta-data
11
+ android:name="android.support.FILE_PROVIDER_PATHS"
12
+ android:resource="@xml/file_provider_paths" />
13
+ </provider>
14
+ </application>
15
+ </manifest>
@@ -0,0 +1,14 @@
1
+ package com.reactnativecommunity.webview;
2
+
3
+ import androidx.core.content.FileProvider;
4
+
5
+ /**
6
+ * Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.
7
+ * <p>
8
+ * See https://developer.android.com/guide/topics/manifest/provider-element.html for details.
9
+ */
10
+ public class RNCWebViewFileProvider extends FileProvider {
11
+
12
+ // This class intentionally left blank.
13
+
14
+ }