Browse Source

Rename module to @react-native-community/webview

Jason Safaiyeh 4 years ago
parent
commit
1954112e34

+ 1
- 1
.all-contributorsrc View File

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

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

@@ -39,4 +39,4 @@ If applicable, add screenshots to help explain your problem.
39 39
  - OS:
40 40
  - OS version:
41 41
  - react-native version:
42
- - react-native-webview version:
42
+ - webview version:

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


+ 9
- 9
docs/Contributing.md View File

@@ -9,10 +9,10 @@ Secondly, we'd like the contribution experience to be as good as possible. While
9 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 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 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 17
 #### For all platforms:
18 18
 ```
@@ -49,8 +49,8 @@ The Metro Bundler will now be running in the Terminal for react-native-macos.  I
49 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 56
 You may run into a problem where the `jest-haste-map` module map says react-native was added twice:
@@ -58,13 +58,13 @@ You may run into a problem where the `jest-haste-map` module map says react-nati
58 58
 ```
59 59
 Loading dependency graph...(node:32651) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
60 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 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 70
 And then re-run the packager:
@@ -73,11 +73,11 @@ And then re-run the packager:
73 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 83
 ## Notes

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

@@ -105,7 +105,7 @@ public class NavigationCompletedEvent extends Event<NavigationCompletedEvent> {
105 105
 
106 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 110
 ```java
111 111
 public class NavigationCompletedEvent extends Event<NavigationCompletedEvent> {
@@ -176,7 +176,7 @@ To get your native component, you must use `requireNativeComponent`: the same as
176 176
 ```javascript
177 177
 import React, {Component, PropTypes} from 'react';
178 178
 import {requireNativeComponent} from 'react-native';
179
-import {WebView} from 'react-native-webview';
179
+import {WebView} from 'webview';
180 180
 
181 181
 export default class CustomWebView extends Component {
182 182
   static propTypes = WebView.propTypes;
@@ -199,7 +199,7 @@ If you want to add custom props to your native component, you can use `nativeCon
199 199
 
200 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 204
 ```javascript
205 205
 export default class CustomWebView extends Component {

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

@@ -2,16 +2,16 @@
2 2
 
3 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 webview to your dependencies
6 6
 
7 7
 ```
8
-$ yarn add react-native-webview
8
+$ yarn add webview
9 9
 ```
10 10
  (or)
11 11
  
12 12
  For npm use
13 13
 ```
14
-$ npm install --save react-native-webview
14
+$ npm install --save webview
15 15
 ```
16 16
 
17 17
 ## 2. Link native dependencies
@@ -21,10 +21,10 @@ From react-native 0.60 autolinking will take care of the link step but don't for
21 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 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 webview` to unlink it._
28 28
 
29 29
 ### iOS:
30 30
 
@@ -38,10 +38,10 @@ If you wish to use cocoapods and haven't set it up yet, please instead refer to
38 38
 
39 39
 ### Android:
40 40
 
41
-Android - react-native-webview version <6:
41
+Android - webview version <6:
42 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 - webview version >=6.X.X:
45 45
 Please make sure AndroidX is enabled in your project by editting `android/gradle.properties` and adding 2 lines:
46 46
 
47 47
 ```
@@ -55,13 +55,13 @@ For Android manual installation, please refer to [this article](https://engineer
55 55
 
56 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/webview/macos/RNCWebView.xcodeproj` project in your main project and link the `RNCWebView-macOS.a` library. 
59 59
 
60 60
 ## 3. Import the webview into your component
61 61
 
62 62
 ```js
63 63
 import React, { Component } from 'react';
64
-import { WebView } from 'react-native-webview';
64
+import { WebView } from 'webview';
65 65
 
66 66
 class MyWeb extends Component {
67 67
   render() {
@@ -79,7 +79,7 @@ Minimal example with inline HTML:
79 79
 
80 80
 ```js
81 81
 import React, { Component } from 'react';
82
-import { WebView } from 'react-native-webview';
82
+import { WebView } from 'webview';
83 83
 
84 84
 class MyInlineWeb extends Component {
85 85
   render() {

+ 13
- 13
docs/Guide.md View File

@@ -22,7 +22,7 @@ The simplest way to use the WebView is to simply pipe in the HTML you want to di
22 22
 
23 23
 ```js
24 24
 import React, { Component } from 'react';
25
-import { WebView } from 'react-native-webview';
25
+import { WebView } from 'webview';
26 26
 
27 27
 class MyInlineWeb extends Component {
28 28
   render() {
@@ -44,7 +44,7 @@ This is the most common use-case for WebView.
44 44
 
45 45
 ```js
46 46
 import React, { Component } from 'react';
47
-import { WebView } from 'react-native-webview';
47
+import { WebView } from 'webview';
48 48
 
49 49
 class MyWeb extends Component {
50 50
   render() {
@@ -61,7 +61,7 @@ Sometimes you would have bundled an HTML file along with the app and would like
61 61
 
62 62
 ```js
63 63
 import React, { Component } from 'react';
64
-import { WebView } from 'react-native-webview';
64
+import { WebView } from 'webview';
65 65
 
66 66
 const myHtmlFile = require("./my-asset-folder/local-site.html");
67 67
 
@@ -78,7 +78,7 @@ However on Android, you need to place the HTML file inside your android project'
78 78
 
79 79
 ```js
80 80
 import React, { Component } from 'react';
81
-import { WebView } from 'react-native-webview';
81
+import { WebView } from 'webview';
82 82
 
83 83
 class MyWeb extends Component {
84 84
   render() {
@@ -95,7 +95,7 @@ Sometimes you want to intercept a user tapping on a link in your webview and do
95 95
 
96 96
 ```js
97 97
 import React, { Component } from 'react';
98
-import { WebView } from 'react-native-webview';
98
+import { WebView } from 'webview';
99 99
 
100 100
 class MyWeb extends Component {
101 101
   webview = null;
@@ -196,7 +196,7 @@ Add permission in AndroidManifest.xml:
196 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 "react-native-webview";
199
+import { WebView } from "webview";
200 200
 
201 201
 WebView.isFileUploadSupported().then(res => {
202 202
   if (res === true) {
@@ -265,7 +265,7 @@ This is a script that runs immediately after the web page loads for the first ti
265 265
 ```jsx
266 266
 import React, { Component } from 'react';
267 267
 import { View } from 'react-native';
268
-import { WebView } from 'react-native-webview';
268
+import { WebView } from 'webview';
269 269
 
270 270
 export default class App extends Component {
271 271
   render() {
@@ -279,7 +279,7 @@ export default class App extends Component {
279 279
         <WebView
280 280
           source={{
281 281
             uri:
282
-              'https://github.com/react-native-community/react-native-webview',
282
+              'https://github.com/react-native-community/webview',
283 283
           }}
284 284
           injectedJavaScript={runFirst}
285 285
         />
@@ -306,7 +306,7 @@ This is a script that runs **before** the web page loads for the first time. It
306 306
 ```jsx
307 307
 import React, { Component } from 'react';
308 308
 import { View } from 'react-native';
309
-import { WebView } from 'react-native-webview';
309
+import { WebView } from 'webview';
310 310
 
311 311
 export default class App extends Component {
312 312
   render() {
@@ -319,7 +319,7 @@ export default class App extends Component {
319 319
         <WebView
320 320
           source={{
321 321
             uri:
322
-              'https://github.com/react-native-community/react-native-webview',
322
+              'https://github.com/react-native-community/webview',
323 323
           }}
324 324
           injectedJavaScriptBeforeContentLoaded={runFirst}
325 325
         />
@@ -338,7 +338,7 @@ While convenient, the downside to the previously mentioned `injectedJavaScript`
338 338
 ```jsx
339 339
 import React, { Component } from 'react';
340 340
 import { View } from 'react-native';
341
-import { WebView } from 'react-native-webview';
341
+import { WebView } from 'webview';
342 342
 
343 343
 export default class App extends Component {
344 344
   render() {
@@ -357,7 +357,7 @@ export default class App extends Component {
357 357
           ref={r => (this.webref = r)}
358 358
           source={{
359 359
             uri:
360
-              'https://github.com/react-native-community/react-native-webview',
360
+              'https://github.com/react-native-community/webview',
361 361
           }}
362 362
         />
363 363
       </View>
@@ -386,7 +386,7 @@ You _must_ set `onMessage` or the `window.ReactNativeWebView.postMessage` method
386 386
 ```jsx
387 387
 import React, { Component } from 'react';
388 388
 import { View } from 'react-native';
389
-import { WebView } from 'react-native-webview';
389
+import { WebView } from 'webview';
390 390
 
391 391
 export default class App extends Component {
392 392
   render() {

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


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

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

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

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

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

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

+ 1
- 1
example/ios/Podfile View File

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

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

@@ -182,7 +182,7 @@ PODS:
182 182
     - React-cxxreact (= 0.61.5)
183 183
     - React-jsi (= 0.61.5)
184 184
   - React-jsinspector (0.61.5)
185
-  - react-native-webview (8.0.6):
185
+  - webview (8.0.6):
186 186
     - React
187 187
   - React-RCTActionSheet (0.61.5):
188 188
     - React-Core/RCTActionSheetHeaders (= 0.61.5)
@@ -238,7 +238,7 @@ DEPENDENCIES:
238 238
   - React-jsi (from `../../node_modules/react-native/ReactCommon/jsi`)
239 239
   - React-jsiexecutor (from `../../node_modules/react-native/ReactCommon/jsiexecutor`)
240 240
   - React-jsinspector (from `../../node_modules/react-native/ReactCommon/jsinspector`)
241
-  - react-native-webview (from `../..`)
241
+  - webview (from `../..`)
242 242
   - React-RCTActionSheet (from `../../node_modules/react-native/Libraries/ActionSheetIOS`)
243 243
   - React-RCTAnimation (from `../../node_modules/react-native/Libraries/NativeAnimation`)
244 244
   - React-RCTBlob (from `../../node_modules/react-native/Libraries/Blob`)
@@ -285,7 +285,7 @@ EXTERNAL SOURCES:
285 285
     :path: "../../node_modules/react-native/ReactCommon/jsiexecutor"
286 286
   React-jsinspector:
287 287
     :path: "../../node_modules/react-native/ReactCommon/jsinspector"
288
-  react-native-webview:
288
+  webview:
289 289
     :path: "../.."
290 290
   React-RCTActionSheet:
291 291
     :path: "../../node_modules/react-native/Libraries/ActionSheetIOS"
@@ -326,7 +326,7 @@ SPEC CHECKSUMS:
326 326
   React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
327 327
   React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
328 328
   React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
329
-  react-native-webview: 222d83c9c489e09b5d3541519110a637490ad4fa
329
+  webview: 222d83c9c489e09b5d3541519110a637490ad4fa
330 330
   React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
331 331
   React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
332 332
   React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72

+ 2
- 2
ios/RNCWebView.m View File

@@ -94,7 +94,7 @@ static NSDictionary* customCertificatesForHost;
94 94
   BOOL _savedKeyboardDisplayRequiresUserAction;
95 95
 
96 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 98
   BOOL _isFullScreenVideoOpen;
99 99
 #if !TARGET_OS_OSX
100 100
   UIStatusBarStyle _savedStatusBarStyle;
@@ -146,7 +146,7 @@ static NSDictionary* customCertificatesForHost;
146 146
       name:UIKeyboardWillShowNotification object:nil];
147 147
 
148 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 150
       [[NSNotificationCenter defaultCenter] addObserver:self
151 151
                                                selector:@selector(showFullScreenVideoStatusBars)
152 152
                                                    name:UIWindowDidBecomeVisibleNotification

+ 4
- 4
package.json View File

@@ -1,5 +1,5 @@
1 1
 {
2
-  "name": "react-native-webview",
2
+  "name": "webview",
3 3
   "description": "React Native WebView component for iOS, Android, and macOS",
4 4
   "main": "index.js",
5 5
   "typings": "index.d.ts",
@@ -9,7 +9,7 @@
9 9
   ],
10 10
   "license": "MIT",
11 11
   "version": "8.1.0",
12
-  "homepage": "https://github.com/react-native-community/react-native-webview#readme",
12
+  "homepage": "https://github.com/react-native-community/webview#readme",
13 13
   "scripts": {
14 14
     "start": "node node_modules/react-native/local-cli/cli.js start",
15 15
     "start:android": "react-native run-android --root example/",
@@ -66,7 +66,7 @@
66 66
   },
67 67
   "repository": {
68 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 71
   "files": [
72 72
     "android",
@@ -75,6 +75,6 @@
75 75
     "lib",
76 76
     "index.js",
77 77
     "index.d.ts",
78
-    "react-native-webview.podspec"
78
+    "webview.podspec"
79 79
   ]
80 80
 }

react-native-webview.podspec → webview.podspec View File

@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12 12
   s.homepage     = package['homepage']
13 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 16
   s.source_files  = "ios/**/*.{h,m}"
17 17
 
18 18
   s.dependency 'React'