Jason Safaiyeh 4 years ago
parent
commit
f6be6469d5
No account linked to committer's email address

+ 1
- 1
.all-contributorsrc View File

1
 {
1
 {
2
-  "projectName": "react-native-webview",
2
+  "projectName": "@react-native-community/webview",
3
   "projectOwner": "react-native-community",
3
   "projectOwner": "react-native-community",
4
   "repoType": "github",
4
   "repoType": "github",
5
   "repoHost": "https://github.com",
5
   "repoHost": "https://github.com",

+ 1
- 1
.github/ISSUE_TEMPLATE/bug-report.md View File

39
  - OS:
39
  - OS:
40
  - OS version:
40
  - OS version:
41
  - react-native version:
41
  - react-native version:
42
- - react-native-webview version:
42
+ - @react-native-community/webview version:

+ 16
- 16
README.md
File diff suppressed because it is too large
View File


+ 9
- 9
docs/Contributing.md View File

9
 After you fork the repo, clone it to your machine, and make your changes, you'll want to test them in an app.
9
 After you fork the repo, clone it to your machine, and make your changes, you'll want to test them in an app.
10
 
10
 
11
 There are two methods of testing:
11
 There are two methods of testing:
12
-1) Testing within a clone of react-native-webview
12
+1) Testing within a clone of webview
13
 2) Testing in a new `react-native init` project
13
 2) Testing in a new `react-native init` project
14
 
14
 
15
-### Testing within react-native-webview
15
+### Testing within webview
16
 
16
 
17
 #### For all platforms:
17
 #### For all platforms:
18
 ```
18
 ```
49
 In a new `react-native init` project, do this:
49
 In a new `react-native init` project, do this:
50
 
50
 
51
 ```
51
 ```
52
-$ yarn add ../react-native-webview
53
-$ react-native link react-native-webview
52
+$ yarn add ../webview
53
+$ react-native link webview
54
 ```
54
 ```
55
 
55
 
56
 You may run into a problem where the `jest-haste-map` module map says react-native was added twice:
56
 You may run into a problem where the `jest-haste-map` module map says react-native was added twice:
58
 ```
58
 ```
59
 Loading dependency graph...(node:32651) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
59
 Loading dependency graph...(node:32651) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
60
   Duplicate module name: react-native
60
   Duplicate module name: react-native
61
-  Paths: /Users/myuser/TestApp/node_modules/react-native/package.json collides with /Users/myuser/TestApp/node_modules/react-native-webview/node_modules/react-native/package.json
61
+  Paths: /Users/myuser/TestApp/node_modules/react-native/package.json collides with /Users/myuser/TestApp/node_modules/webview/node_modules/react-native/package.json
62
 ```
62
 ```
63
 
63
 
64
 Just remove the second path like this:
64
 Just remove the second path like this:
65
 
65
 
66
 ```
66
 ```
67
-$ rm -rf ./node_modules/react-native-webview/node_modules/react-native
67
+$ rm -rf ./node_modules/webview/node_modules/react-native
68
 ```
68
 ```
69
 
69
 
70
 And then re-run the packager:
70
 And then re-run the packager:
73
 $ react-native start --reset-cache
73
 $ react-native start --reset-cache
74
 ```
74
 ```
75
 
75
 
76
-When you make a change, you'll probably need to unlink, remove, re-add, and re-link `react-native-webview`:
76
+When you make a change, you'll probably need to unlink, remove, re-add, and re-link `webview`:
77
 
77
 
78
 ```
78
 ```
79
-$ react-native unlink react-native-webview && yarn remove react-native-webview
80
-$ yarn add ../react-native-webview && react-native link react-native-webview
79
+$ react-native unlink webview && yarn remove webview
80
+$ yarn add ../webview && react-native link webview
81
 ```
81
 ```
82
 
82
 
83
 ## Notes
83
 ## Notes

+ 3
- 3
docs/Custom-Android.md View File

105
 
105
 
106
 You can trigger the event in your web view client. You can hook existing handlers if your events are based on them.
106
 You can trigger the event in your web view client. You can hook existing handlers if your events are based on them.
107
 
107
 
108
-You should refer to [RNCWebViewManager.java](https://github.com/react-native-community/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java) in the react-native-webview codebase to see what handlers are available and how they are implemented. You can extend any methods here to provide extra functionality.
108
+You should refer to [RNCWebViewManager.java](https://github.com/react-native-community/webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java) in the webview codebase to see what handlers are available and how they are implemented. You can extend any methods here to provide extra functionality.
109
 
109
 
110
 ```java
110
 ```java
111
 public class NavigationCompletedEvent extends Event<NavigationCompletedEvent> {
111
 public class NavigationCompletedEvent extends Event<NavigationCompletedEvent> {
176
 ```javascript
176
 ```javascript
177
 import React, {Component, PropTypes} from 'react';
177
 import React, {Component, PropTypes} from 'react';
178
 import {requireNativeComponent} from 'react-native';
178
 import {requireNativeComponent} from 'react-native';
179
-import {WebView} from 'react-native-webview';
179
+import {WebView} from '@react-native-community/webview';
180
 
180
 
181
 export default class CustomWebView extends Component {
181
 export default class CustomWebView extends Component {
182
   static propTypes = WebView.propTypes;
182
   static propTypes = WebView.propTypes;
199
 
199
 
200
 For events, the event handler must always be set to a function. This means it isn't safe to use the event handler directly from `this.props`, as the user might not have provided one. The standard approach is to create a event handler in your class, and then invoking the event handler given in `this.props` if it exists.
200
 For events, the event handler must always be set to a function. This means it isn't safe to use the event handler directly from `this.props`, as the user might not have provided one. The standard approach is to create a event handler in your class, and then invoking the event handler given in `this.props` if it exists.
201
 
201
 
202
-If you are unsure how something should be implemented from the JS side, look at [WebView.android.js](https://github.com/react-native-community/react-native-webview/blob/master/js/WebView.android.js) in the React Native source.
202
+If you are unsure how something should be implemented from the JS side, look at [WebView.android.js](https://github.com/react-native-community/webview/blob/master/js/WebView.android.js) in the React Native source.
203
 
203
 
204
 ```javascript
204
 ```javascript
205
 export default class CustomWebView extends Component {
205
 export default class CustomWebView extends Component {

+ 10
- 10
docs/Getting-Started.md View File

2
 
2
 
3
 Here's how to get started quickly with the React Native WebView.
3
 Here's how to get started quickly with the React Native WebView.
4
 
4
 
5
-## 1. Add react-native-webview to your dependencies
5
+## 1. Add @react-native-community/webview to your dependencies
6
 
6
 
7
 ```
7
 ```
8
-$ yarn add react-native-webview
8
+$ yarn add @react-native-community/webview
9
 ```
9
 ```
10
  (or)
10
  (or)
11
  
11
  
12
  For npm use
12
  For npm use
13
 ```
13
 ```
14
-$ npm install --save react-native-webview
14
+$ npm install --save @react-native-community/webview
15
 ```
15
 ```
16
 
16
 
17
 ## 2. Link native dependencies
17
 ## 2. Link native dependencies
21
 React Native modules that include native Objective-C, Swift, Java, or Kotlin code have to be "linked" so that the compiler knows to include them in the app.
21
 React Native modules that include native Objective-C, Swift, Java, or Kotlin code have to be "linked" so that the compiler knows to include them in the app.
22
 
22
 
23
 ```
23
 ```
24
-$ react-native link react-native-webview
24
+$ react-native link @react-native-community/webview
25
 ```
25
 ```
26
 
26
 
27
-_NOTE: If you ever need to uninstall React Native WebView, run `react-native unlink react-native-webview` to unlink it._
27
+_NOTE: If you ever need to uninstall React Native WebView, run `react-native unlink @react-native-community/webview` to unlink it._
28
 
28
 
29
 ### iOS:
29
 ### iOS:
30
 
30
 
38
 
38
 
39
 ### Android:
39
 ### Android:
40
 
40
 
41
-Android - react-native-webview version <6:
41
+Android - @react-native-community/webview version <6:
42
 This module does not require any extra step after running the link command 🎉
42
 This module does not require any extra step after running the link command 🎉
43
 
43
 
44
-Android - react-native-webview version >=6.X.X:
44
+Android - @react-native-community/webview version >=6.X.X:
45
 Please make sure AndroidX is enabled in your project by editting `android/gradle.properties` and adding 2 lines:
45
 Please make sure AndroidX is enabled in your project by editting `android/gradle.properties` and adding 2 lines:
46
 
46
 
47
 ```
47
 ```
55
 
55
 
56
 Cocoapod and autolinking is not yet support for react-native macOS but is coming soon.  In the meantime you must manually link.
56
 Cocoapod and autolinking is not yet support for react-native macOS but is coming soon.  In the meantime you must manually link.
57
 
57
 
58
-The method is nearly identical to the [manual linking method for iOS](https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking) except that you will include the `node_modules/react-native-webview/macos/RNCWebView.xcodeproj` project in your main project and link the `RNCWebView-macOS.a` library. 
58
+The method is nearly identical to the [manual linking method for iOS](https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking) except that you will include the `node_modules/@react-native-community/webview/macos/RNCWebView.xcodeproj` project in your main project and link the `RNCWebView-macOS.a` library. 
59
 
59
 
60
 ## 3. Import the webview into your component
60
 ## 3. Import the webview into your component
61
 
61
 
62
 ```js
62
 ```js
63
 import React, { Component } from 'react';
63
 import React, { Component } from 'react';
64
-import { WebView } from 'react-native-webview';
64
+import { WebView } from '@react-native-community/webview';
65
 
65
 
66
 class MyWeb extends Component {
66
 class MyWeb extends Component {
67
   render() {
67
   render() {
79
 
79
 
80
 ```js
80
 ```js
81
 import React, { Component } from 'react';
81
 import React, { Component } from 'react';
82
-import { WebView } from 'react-native-webview';
82
+import { WebView } from '@react-native-community/webview';
83
 
83
 
84
 class MyInlineWeb extends Component {
84
 class MyInlineWeb extends Component {
85
   render() {
85
   render() {

+ 13
- 13
docs/Guide.md View File

22
 
22
 
23
 ```js
23
 ```js
24
 import React, { Component } from 'react';
24
 import React, { Component } from 'react';
25
-import { WebView } from 'react-native-webview';
25
+import { WebView } from '@react-native-community/webview';
26
 
26
 
27
 class MyInlineWeb extends Component {
27
 class MyInlineWeb extends Component {
28
   render() {
28
   render() {
44
 
44
 
45
 ```js
45
 ```js
46
 import React, { Component } from 'react';
46
 import React, { Component } from 'react';
47
-import { WebView } from 'react-native-webview';
47
+import { WebView } from '@react-native-community/webview';
48
 
48
 
49
 class MyWeb extends Component {
49
 class MyWeb extends Component {
50
   render() {
50
   render() {
61
 
61
 
62
 ```js
62
 ```js
63
 import React, { Component } from 'react';
63
 import React, { Component } from 'react';
64
-import { WebView } from 'react-native-webview';
64
+import { WebView } from '@react-native-community/webview';
65
 
65
 
66
 const myHtmlFile = require("./my-asset-folder/local-site.html");
66
 const myHtmlFile = require("./my-asset-folder/local-site.html");
67
 
67
 
78
 
78
 
79
 ```js
79
 ```js
80
 import React, { Component } from 'react';
80
 import React, { Component } from 'react';
81
-import { WebView } from 'react-native-webview';
81
+import { WebView } from '@react-native-community/webview';
82
 
82
 
83
 class MyWeb extends Component {
83
 class MyWeb extends Component {
84
   render() {
84
   render() {
95
 
95
 
96
 ```js
96
 ```js
97
 import React, { Component } from 'react';
97
 import React, { Component } from 'react';
98
-import { WebView } from 'react-native-webview';
98
+import { WebView } from '@react-native-community/webview';
99
 
99
 
100
 class MyWeb extends Component {
100
 class MyWeb extends Component {
101
   webview = null;
101
   webview = null;
202
 File Upload using `<input type="file" />` is not supported for Android 4.4 KitKat (see [details](https://github.com/delight-im/Android-AdvancedWebView/issues/4#issuecomment-70372146)):
202
 File Upload using `<input type="file" />` is not supported for Android 4.4 KitKat (see [details](https://github.com/delight-im/Android-AdvancedWebView/issues/4#issuecomment-70372146)):
203
 
203
 
204
 ```
204
 ```
205
-import { WebView } from "react-native-webview";
205
+import { WebView } from "@react-native-community/webview";
206
 
206
 
207
 WebView.isFileUploadSupported().then(res => {
207
 WebView.isFileUploadSupported().then(res => {
208
   if (res === true) {
208
   if (res === true) {
271
 ```jsx
271
 ```jsx
272
 import React, { Component } from 'react';
272
 import React, { Component } from 'react';
273
 import { View } from 'react-native';
273
 import { View } from 'react-native';
274
-import { WebView } from 'react-native-webview';
274
+import { WebView } from '@react-native-community/webview';
275
 
275
 
276
 export default class App extends Component {
276
 export default class App extends Component {
277
   render() {
277
   render() {
285
         <WebView
285
         <WebView
286
           source={{
286
           source={{
287
             uri:
287
             uri:
288
-              'https://github.com/react-native-community/react-native-webview',
288
+              'https://github.com/react-native-community/webview',
289
           }}
289
           }}
290
           injectedJavaScript={runFirst}
290
           injectedJavaScript={runFirst}
291
         />
291
         />
312
 ```jsx
312
 ```jsx
313
 import React, { Component } from 'react';
313
 import React, { Component } from 'react';
314
 import { View } from 'react-native';
314
 import { View } from 'react-native';
315
-import { WebView } from 'react-native-webview';
315
+import { WebView } from '@react-native-community/webview';
316
 
316
 
317
 export default class App extends Component {
317
 export default class App extends Component {
318
   render() {
318
   render() {
325
         <WebView
325
         <WebView
326
           source={{
326
           source={{
327
             uri:
327
             uri:
328
-              'https://github.com/react-native-community/react-native-webview',
328
+              'https://github.com/react-native-community/webview',
329
           }}
329
           }}
330
           injectedJavaScriptBeforeContentLoaded={runFirst}
330
           injectedJavaScriptBeforeContentLoaded={runFirst}
331
         />
331
         />
344
 ```jsx
344
 ```jsx
345
 import React, { Component } from 'react';
345
 import React, { Component } from 'react';
346
 import { View } from 'react-native';
346
 import { View } from 'react-native';
347
-import { WebView } from 'react-native-webview';
347
+import { WebView } from '@react-native-community/webview';
348
 
348
 
349
 export default class App extends Component {
349
 export default class App extends Component {
350
   render() {
350
   render() {
363
           ref={r => (this.webref = r)}
363
           ref={r => (this.webref = r)}
364
           source={{
364
           source={{
365
             uri:
365
             uri:
366
-              'https://github.com/react-native-community/react-native-webview',
366
+              'https://github.com/react-native-community/webview',
367
           }}
367
           }}
368
         />
368
         />
369
       </View>
369
       </View>
392
 ```jsx
392
 ```jsx
393
 import React, { Component } from 'react';
393
 import React, { Component } from 'react';
394
 import { View } from 'react-native';
394
 import { View } from 'react-native';
395
-import { WebView } from 'react-native-webview';
395
+import { WebView } from '@react-native-community/webview';
396
 
396
 
397
 export default class App extends Component {
397
 export default class App extends Component {
398
   render() {
398
   render() {

+ 15
- 17
docs/README.portuguese.md
File diff suppressed because it is too large
View File


+ 1
- 1
example/examples/Alerts.tsx View File

1
 import React, {Component} from 'react';
1
 import React, {Component} from 'react';
2
 import {Text, View} from 'react-native';
2
 import {Text, View} from 'react-native';
3
 
3
 
4
-import WebView from 'react-native-webview';
4
+import WebView from '@react-native-community/webview';
5
 
5
 
6
 const HTML = `
6
 const HTML = `
7
 <!DOCTYPE html>\n
7
 <!DOCTYPE html>\n

+ 1
- 1
example/examples/Background.tsx View File

1
 import React, {Component} from 'react';
1
 import React, {Component} from 'react';
2
 import {Text, View} from 'react-native';
2
 import {Text, View} from 'react-native';
3
 
3
 
4
-import WebView from 'react-native-webview';
4
+import WebView from '@react-native-community/webview';
5
 
5
 
6
 const HTML = `
6
 const HTML = `
7
 <!DOCTYPE html>\n
7
 <!DOCTYPE html>\n

+ 1
- 1
example/examples/Scrolling.tsx View File

1
 import React, {Component} from 'react';
1
 import React, {Component} from 'react';
2
 import {Button, Text, View} from 'react-native';
2
 import {Button, Text, View} from 'react-native';
3
 
3
 
4
-import WebView from 'react-native-webview';
4
+import WebView from '@react-native-community/webview';
5
 
5
 
6
 const HTML = `
6
 const HTML = `
7
 <!DOCTYPE html>\n
7
 <!DOCTYPE html>\n

+ 2
- 2
example/ios/Podfile.lock View File

182
     - React-cxxreact (= 0.61.5)
182
     - React-cxxreact (= 0.61.5)
183
     - React-jsi (= 0.61.5)
183
     - React-jsi (= 0.61.5)
184
   - React-jsinspector (0.61.5)
184
   - React-jsinspector (0.61.5)
185
-  - react-native-webview (8.0.6):
185
+  - react-native-webview (8.1.0):
186
     - React
186
     - React
187
   - React-RCTActionSheet (0.61.5):
187
   - React-RCTActionSheet (0.61.5):
188
     - React-Core/RCTActionSheetHeaders (= 0.61.5)
188
     - React-Core/RCTActionSheetHeaders (= 0.61.5)
326
   React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
326
   React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
327
   React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
327
   React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
328
   React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
328
   React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
329
-  react-native-webview: 222d83c9c489e09b5d3541519110a637490ad4fa
329
+  react-native-webview: 6a787655a50a59c309ea032561ea8a8d8b8d1c45
330
   React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
330
   React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
331
   React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
331
   React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
332
   React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
332
   React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72

+ 2
- 2
ios/RNCWebView.m View File

94
   BOOL _savedKeyboardDisplayRequiresUserAction;
94
   BOOL _savedKeyboardDisplayRequiresUserAction;
95
 
95
 
96
   // Workaround for StatusBar appearance bug for iOS 12
96
   // Workaround for StatusBar appearance bug for iOS 12
97
-  // https://github.com/react-native-community/react-native-webview/issues/62
97
+  // https://github.com/react-native-community/webview/issues/62
98
   BOOL _isFullScreenVideoOpen;
98
   BOOL _isFullScreenVideoOpen;
99
 #if !TARGET_OS_OSX
99
 #if !TARGET_OS_OSX
100
   UIStatusBarStyle _savedStatusBarStyle;
100
   UIStatusBarStyle _savedStatusBarStyle;
146
       name:UIKeyboardWillShowNotification object:nil];
146
       name:UIKeyboardWillShowNotification object:nil];
147
 
147
 
148
     // Workaround for StatusBar appearance bug for iOS 12
148
     // Workaround for StatusBar appearance bug for iOS 12
149
-    // https://github.com/react-native-community/react-native-webview/issues/62
149
+    // https://github.com/react-native-community/webview/issues/62
150
       [[NSNotificationCenter defaultCenter] addObserver:self
150
       [[NSNotificationCenter defaultCenter] addObserver:self
151
                                                selector:@selector(showFullScreenVideoStatusBars)
151
                                                selector:@selector(showFullScreenVideoStatusBars)
152
                                                    name:UIWindowDidBecomeVisibleNotification
152
                                                    name:UIWindowDidBecomeVisibleNotification

+ 3
- 3
package.json View File

1
 {
1
 {
2
-  "name": "react-native-webview",
2
+  "name": "@react-native-community/webview",
3
   "description": "React Native WebView component for iOS, Android, and macOS",
3
   "description": "React Native WebView component for iOS, Android, and macOS",
4
   "main": "index.js",
4
   "main": "index.js",
5
   "typings": "index.d.ts",
5
   "typings": "index.d.ts",
9
   ],
9
   ],
10
   "license": "MIT",
10
   "license": "MIT",
11
   "version": "8.1.1",
11
   "version": "8.1.1",
12
-  "homepage": "https://github.com/react-native-community/react-native-webview#readme",
12
+  "homepage": "https://github.com/react-native-community/webview#readme",
13
   "scripts": {
13
   "scripts": {
14
     "start": "node node_modules/react-native/local-cli/cli.js start",
14
     "start": "node node_modules/react-native/local-cli/cli.js start",
15
     "start:android": "react-native run-android --root example/",
15
     "start:android": "react-native run-android --root example/",
66
   },
66
   },
67
   "repository": {
67
   "repository": {
68
     "type": "git",
68
     "type": "git",
69
-    "url": "https://github.com/react-native-community/react-native-webview.git"
69
+    "url": "https://github.com/react-native-community/webview.git"
70
   },
70
   },
71
   "files": [
71
   "files": [
72
     "android",
72
     "android",

+ 2
- 2
react-native-webview.podspec View File

3
 package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
3
 package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
 
4
 
5
 Pod::Spec.new do |s|
5
 Pod::Spec.new do |s|
6
-  s.name         = package['name']
6
+  s.name         = "react-native-webview"
7
   s.version      = package['version']
7
   s.version      = package['version']
8
   s.summary      = package['description']
8
   s.summary      = package['description']
9
   s.license      = package['license']
9
   s.license      = package['license']
12
   s.homepage     = package['homepage']
12
   s.homepage     = package['homepage']
13
   s.platform     = :ios, "9.0"
13
   s.platform     = :ios, "9.0"
14
 
14
 
15
-  s.source       = { :git => "https://github.com/react-native-community/react-native-webview.git", :tag => "v#{s.version}" }
15
+  s.source       = { :git => "https://github.com/react-native-community/webview.git", :tag => "v#{s.version}" }
16
   s.source_files  = "ios/**/*.{h,m}"
16
   s.source_files  = "ios/**/*.{h,m}"
17
 
17
 
18
   s.dependency 'React'
18
   s.dependency 'React'