Browse Source

Fix doc imports, update example app

Jason Safaiyeh 4 years ago
parent
commit
92e4af6f21

+ 1
- 1
.all-contributorsrc View File

1
 {
1
 {
2
-  "projectName": "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
- - webview version:
42
+ - @react-native-community/webview version:

+ 2
- 2
README.md View File

55
 
55
 
56
 ## Usage
56
 ## Usage
57
 
57
 
58
-Import the `WebView` component from `webview` and use it like so:
58
+Import the `WebView` component from `@react-native-community/webview` and use it like so:
59
 
59
 
60
 ```jsx
60
 ```jsx
61
 import React, { Component } from 'react';
61
 import React, { Component } from 'react';
62
 import { StyleSheet, Text, View } from 'react-native';
62
 import { StyleSheet, Text, View } from 'react-native';
63
-import { WebView } from 'webview';
63
+import { WebView } from '@react-native-community/webview';
64
 
64
 
65
 // ...
65
 // ...
66
 class MyWebComponent extends Component {
66
 class MyWebComponent extends Component {

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

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 '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;

+ 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 webview to your dependencies
5
+## 1. Add @react-native-community/webview to your dependencies
6
 
6
 
7
 ```
7
 ```
8
-$ yarn add 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 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 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 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 - 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 - 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/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 '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 '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() {

+ 10
- 10
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 '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 '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 '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 '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 '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;
196
 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)):
196
 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)):
197
 
197
 
198
 ```
198
 ```
199
-import { WebView } from "webview";
199
+import { WebView } from "@react-native-community/webview";
200
 
200
 
201
 WebView.isFileUploadSupported().then(res => {
201
 WebView.isFileUploadSupported().then(res => {
202
   if (res === true) {
202
   if (res === true) {
265
 ```jsx
265
 ```jsx
266
 import React, { Component } from 'react';
266
 import React, { Component } from 'react';
267
 import { View } from 'react-native';
267
 import { View } from 'react-native';
268
-import { WebView } from 'webview';
268
+import { WebView } from '@react-native-community/webview';
269
 
269
 
270
 export default class App extends Component {
270
 export default class App extends Component {
271
   render() {
271
   render() {
306
 ```jsx
306
 ```jsx
307
 import React, { Component } from 'react';
307
 import React, { Component } from 'react';
308
 import { View } from 'react-native';
308
 import { View } from 'react-native';
309
-import { WebView } from 'webview';
309
+import { WebView } from '@react-native-community/webview';
310
 
310
 
311
 export default class App extends Component {
311
 export default class App extends Component {
312
   render() {
312
   render() {
338
 ```jsx
338
 ```jsx
339
 import React, { Component } from 'react';
339
 import React, { Component } from 'react';
340
 import { View } from 'react-native';
340
 import { View } from 'react-native';
341
-import { WebView } from 'webview';
341
+import { WebView } from '@react-native-community/webview';
342
 
342
 
343
 export default class App extends Component {
343
 export default class App extends Component {
344
   render() {
344
   render() {
386
 ```jsx
386
 ```jsx
387
 import React, { Component } from 'react';
387
 import React, { Component } from 'react';
388
 import { View } from 'react-native';
388
 import { View } from 'react-native';
389
-import { WebView } from 'webview';
389
+import { WebView } from '@react-native-community/webview';
390
 
390
 
391
 export default class App extends Component {
391
 export default class App extends Component {
392
   render() {
392
   render() {

+ 1
- 1
docs/README.portuguese.md View File

57
 ```jsx
57
 ```jsx
58
 import React, { Component } from 'react';
58
 import React, { Component } from 'react';
59
 import { StyleSheet, Text, View } from 'react-native';
59
 import { StyleSheet, Text, View } from 'react-native';
60
-import { WebView } from 'webview';
60
+import { WebView } from '@react-native-community/webview';
61
 
61
 
62
 // ...
62
 // ...
63
 class MyWebComponent extends Component {
63
 class MyWebComponent extends Component {

+ 1
- 1
example/ios/Podfile View File

5
 
5
 
6
 target 'example' do
6
 target 'example' do
7
   # Pods for example
7
   # Pods for example
8
-  pod 'webview', :path => "../.."
8
+  pod 'react-native-webview', :path => "../.."
9
   pod 'FBLazyVector', :path => "../../node_modules/react-native/Libraries/FBLazyVector"
9
   pod 'FBLazyVector', :path => "../../node_modules/react-native/Libraries/FBLazyVector"
10
   pod 'FBReactNativeSpec', :path => "../../node_modules/react-native/Libraries/FBReactNativeSpec"
10
   pod 'FBReactNativeSpec', :path => "../../node_modules/react-native/Libraries/FBReactNativeSpec"
11
   pod 'RCTRequired', :path => "../../node_modules/react-native/Libraries/RCTRequired"
11
   pod 'RCTRequired', :path => "../../node_modules/react-native/Libraries/RCTRequired"

+ 4
- 4
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
-  - 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)
238
   - React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)
238
   - React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)
239
   - React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)
239
   - React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)
240
   - React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)
240
   - React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)
241
-  - webview (from `../..`)
241
+  - react-native-webview (from `../..`)
242
   - React-RCTActionSheet (from `../../node_modules/react-native/Libraries/ActionSheetIOS`)
242
   - React-RCTActionSheet (from `../../node_modules/react-native/Libraries/ActionSheetIOS`)
243
   - React-RCTAnimation (from `../../node_modules/react-native/Libraries/NativeAnimation`)
243
   - React-RCTAnimation (from `../../node_modules/react-native/Libraries/NativeAnimation`)
244
   - React-RCTBlob (from `../../node_modules/react-native/Libraries/Blob`)
244
   - React-RCTBlob (from `../../node_modules/react-native/Libraries/Blob`)
285
     :path: "../../node_modules/react-native/ReactCommon/jsiexecutor"
285
     :path: "../../node_modules/react-native/ReactCommon/jsiexecutor"
286
   React-jsinspector:
286
   React-jsinspector:
287
     :path: "../../node_modules/react-native/ReactCommon/jsinspector"
287
     :path: "../../node_modules/react-native/ReactCommon/jsinspector"
288
-  webview:
288
+  react-native-webview:
289
     :path: "../.."
289
     :path: "../.."
290
   React-RCTActionSheet:
290
   React-RCTActionSheet:
291
     :path: "../../node_modules/react-native/Libraries/ActionSheetIOS"
291
     :path: "../../node_modules/react-native/Libraries/ActionSheetIOS"
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
-  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

+ 1
- 1
package.json View File

1
 {
1
 {
2
-  "name": "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",

webview.podspec → 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']