Selaa lähdekoodia

WIP: Migrating to WKWebView

Jamon Holmgren 6 vuotta sitten
vanhempi
commit
2fd5612422

+ 1
- 1
README.md Näytä tiedosto

@@ -51,7 +51,7 @@ _Guide coming soon_
51 51
 
52 52
 ### Contributor Notes
53 53
 
54
-* I'm currently shimming `ViewAccessibility`, `deprecatedPropType`, and `DeprecatedViewPropTypes` because I'm building my test app for React Native 0.56.0. If I upgrade to a version that exports these and we agree to only support that version going forward, then I'll remove them and pull in from React Native core. You can find these shims in `./js/shims`.
54
+* I've removed all PropTypes for now. Instead, we'll be moving toward Flow or TypeScript at some later date
55 55
 
56 56
 ## Maintainers
57 57
 

ios/RCTWKWebView.xcodeproj/project.pbxproj → ios/RNCWebView.xcodeproj/project.pbxproj Näytä tiedosto

@@ -7,8 +7,8 @@
7 7
 	objects = {
8 8
 
9 9
 /* Begin PBXBuildFile section */
10
-		E91B3466214383EF00F9801F /* RCTWKWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B3464214383EF00F9801F /* RCTWKWebViewManager.m */; };
11
-		E91B3467214383EF00F9801F /* RCTWKWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B3465214383EF00F9801F /* RCTWKWebView.m */; };
10
+		E91B351D21446E6C00F9801F /* RCTWKWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RCTWKWebViewManager.m */; };
11
+		E91B351E21446E6C00F9801F /* RCTWKWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RCTWKWebView.m */; };
12 12
 /* End PBXBuildFile section */
13 13
 
14 14
 /* Begin PBXCopyFilesBuildPhase section */
@@ -24,11 +24,11 @@
24 24
 /* End PBXCopyFilesBuildPhase section */
25 25
 
26 26
 /* Begin PBXFileReference section */
27
-		134814201AA4EA6300B7C361 /* libRCTWKWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWKWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
28
-		E91B3462214383EF00F9801F /* RCTWKWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWKWebViewManager.h; sourceTree = "<group>"; };
29
-		E91B3463214383EF00F9801F /* RCTWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWKWebView.h; sourceTree = "<group>"; };
30
-		E91B3464214383EF00F9801F /* RCTWKWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWKWebViewManager.m; sourceTree = "<group>"; };
31
-		E91B3465214383EF00F9801F /* RCTWKWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWKWebView.m; sourceTree = "<group>"; };
27
+		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
28
+		E91B351921446E6C00F9801F /* RCTWKWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWKWebViewManager.h; sourceTree = "<group>"; };
29
+		E91B351A21446E6C00F9801F /* RCTWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWKWebView.h; sourceTree = "<group>"; };
30
+		E91B351B21446E6C00F9801F /* RCTWKWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWKWebViewManager.m; sourceTree = "<group>"; };
31
+		E91B351C21446E6C00F9801F /* RCTWKWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWKWebView.m; sourceTree = "<group>"; };
32 32
 /* End PBXFileReference section */
33 33
 
34 34
 /* Begin PBXFrameworksBuildPhase section */
@@ -45,7 +45,7 @@
45 45
 		134814211AA4EA7D00B7C361 /* Products */ = {
46 46
 			isa = PBXGroup;
47 47
 			children = (
48
-				134814201AA4EA6300B7C361 /* libRCTWKWebView.a */,
48
+				134814201AA4EA6300B7C361 /* libRNCWebView.a */,
49 49
 			);
50 50
 			name = Products;
51 51
 			sourceTree = "<group>";
@@ -53,10 +53,10 @@
53 53
 		58B511D21A9E6C8500147676 = {
54 54
 			isa = PBXGroup;
55 55
 			children = (
56
-				E91B3463214383EF00F9801F /* RCTWKWebView.h */,
57
-				E91B3465214383EF00F9801F /* RCTWKWebView.m */,
58
-				E91B3462214383EF00F9801F /* RCTWKWebViewManager.h */,
59
-				E91B3464214383EF00F9801F /* RCTWKWebViewManager.m */,
56
+				E91B351A21446E6C00F9801F /* RCTWKWebView.h */,
57
+				E91B351C21446E6C00F9801F /* RCTWKWebView.m */,
58
+				E91B351921446E6C00F9801F /* RCTWKWebViewManager.h */,
59
+				E91B351B21446E6C00F9801F /* RCTWKWebViewManager.m */,
60 60
 				134814211AA4EA7D00B7C361 /* Products */,
61 61
 			);
62 62
 			sourceTree = "<group>";
@@ -64,9 +64,9 @@
64 64
 /* End PBXGroup section */
65 65
 
66 66
 /* Begin PBXNativeTarget section */
67
-		58B511DA1A9E6C8500147676 /* RCTWKWebView */ = {
67
+		58B511DA1A9E6C8500147676 /* RNCWebView */ = {
68 68
 			isa = PBXNativeTarget;
69
-			buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTWKWebView" */;
69
+			buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */;
70 70
 			buildPhases = (
71 71
 				58B511D71A9E6C8500147676 /* Sources */,
72 72
 				58B511D81A9E6C8500147676 /* Frameworks */,
@@ -76,9 +76,9 @@
76 76
 			);
77 77
 			dependencies = (
78 78
 			);
79
-			name = RCTWKWebView;
79
+			name = RNCWebView;
80 80
 			productName = RCTDataManager;
81
-			productReference = 134814201AA4EA6300B7C361 /* libRCTWKWebView.a */;
81
+			productReference = 134814201AA4EA6300B7C361 /* libRNCWebView.a */;
82 82
 			productType = "com.apple.product-type.library.static";
83 83
 		};
84 84
 /* End PBXNativeTarget section */
@@ -95,7 +95,7 @@
95 95
 					};
96 96
 				};
97 97
 			};
98
-			buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTWKWebView" */;
98
+			buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */;
99 99
 			compatibilityVersion = "Xcode 3.2";
100 100
 			developmentRegion = English;
101 101
 			hasScannedForEncodings = 0;
@@ -107,7 +107,7 @@
107 107
 			projectDirPath = "";
108 108
 			projectRoot = "";
109 109
 			targets = (
110
-				58B511DA1A9E6C8500147676 /* RCTWKWebView */,
110
+				58B511DA1A9E6C8500147676 /* RNCWebView */,
111 111
 			);
112 112
 		};
113 113
 /* End PBXProject section */
@@ -117,8 +117,8 @@
117 117
 			isa = PBXSourcesBuildPhase;
118 118
 			buildActionMask = 2147483647;
119 119
 			files = (
120
-				E91B3466214383EF00F9801F /* RCTWKWebViewManager.m in Sources */,
121
-				E91B3467214383EF00F9801F /* RCTWKWebView.m in Sources */,
120
+				E91B351D21446E6C00F9801F /* RCTWKWebViewManager.m in Sources */,
121
+				E91B351E21446E6C00F9801F /* RCTWKWebView.m in Sources */,
122 122
 			);
123 123
 			runOnlyForDeploymentPostprocessing = 0;
124 124
 		};
@@ -217,7 +217,7 @@
217 217
 				);
218 218
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
219 219
 				OTHER_LDFLAGS = "-ObjC";
220
-				PRODUCT_NAME = RCTWKWebView;
220
+				PRODUCT_NAME = RNCWebView;
221 221
 				SKIP_INSTALL = YES;
222 222
 			};
223 223
 			name = Debug;
@@ -233,7 +233,7 @@
233 233
 				);
234 234
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
235 235
 				OTHER_LDFLAGS = "-ObjC";
236
-				PRODUCT_NAME = RCTWKWebView;
236
+				PRODUCT_NAME = RNCWebView;
237 237
 				SKIP_INSTALL = YES;
238 238
 			};
239 239
 			name = Release;
@@ -241,7 +241,7 @@
241 241
 /* End XCBuildConfiguration section */
242 242
 
243 243
 /* Begin XCConfigurationList section */
244
-		58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTWKWebView" */ = {
244
+		58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */ = {
245 245
 			isa = XCConfigurationList;
246 246
 			buildConfigurations = (
247 247
 				58B511ED1A9E6C8500147676 /* Debug */,
@@ -250,7 +250,7 @@
250 250
 			defaultConfigurationIsVisible = 0;
251 251
 			defaultConfigurationName = Release;
252 252
 		};
253
-		58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTWKWebView" */ = {
253
+		58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */ = {
254 254
 			isa = XCConfigurationList;
255 255
 			buildConfigurations = (
256 256
 				58B511F01A9E6C8500147676 /* Debug */,

ios/RCTWKWebView.xcworkspace/contents.xcworkspacedata → ios/RNCWebView.xcworkspace/contents.xcworkspacedata Näytä tiedosto


+ 0
- 200
js/WebView.android.js Näytä tiedosto

@@ -10,22 +10,17 @@
10 10
 'use strict';
11 11
 
12 12
 import React from 'react';
13
-import PropTypes from 'prop-types';
14 13
 
15 14
 import ReactNative from 'react-native';
16 15
 import {
17 16
   ActivityIndicator,
18
-  EdgeInsetsPropType,
19 17
   StyleSheet,
20 18
   UIManager,
21 19
   View,
22
-  ViewPropTypes,
23 20
   Image,
24 21
   requireNativeComponent
25 22
 } from 'react-native';
26 23
 
27
-import deprecatedPropType from './shims/deprecatedPropType';
28
-import DeprecatedViewPropTypes from './shims/DeprecatedViewPropTypes'
29 24
 import keyMirror from 'fbjs/lib/keyMirror';
30 25
 
31 26
 import WebViewShared from './WebViewShared';
@@ -50,201 +45,6 @@ const defaultRenderLoading = () => (
50 45
  * Renders a native WebView.
51 46
  */
52 47
 class WebView extends React.Component {
53
-  static propTypes = {
54
-    ...ViewPropTypes,
55
-    renderError: PropTypes.func,
56
-    renderLoading: PropTypes.func,
57
-    onLoad: PropTypes.func,
58
-    onLoadEnd: PropTypes.func,
59
-    onLoadStart: PropTypes.func,
60
-    onError: PropTypes.func,
61
-    automaticallyAdjustContentInsets: PropTypes.bool,
62
-    contentInset: EdgeInsetsPropType,
63
-    onNavigationStateChange: PropTypes.func,
64
-    onMessage: PropTypes.func,
65
-    onContentSizeChange: PropTypes.func,
66
-    startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
67
-    style: DeprecatedViewPropTypes.style,
68
-
69
-    html: deprecatedPropType(
70
-      PropTypes.string,
71
-      'Use the `source` prop instead.',
72
-    ),
73
-
74
-    url: deprecatedPropType(PropTypes.string, 'Use the `source` prop instead.'),
75
-
76
-    /**
77
-     * Loads static html or a uri (with optional headers) in the WebView.
78
-     */
79
-    source: PropTypes.oneOfType([
80
-      PropTypes.shape({
81
-        /*
82
-         * The URI to load in the WebView. Can be a local or remote file.
83
-         */
84
-        uri: PropTypes.string,
85
-        /*
86
-         * The HTTP Method to use. Defaults to GET if not specified.
87
-         * NOTE: On Android, only GET and POST are supported.
88
-         */
89
-        method: PropTypes.oneOf(['GET', 'POST']),
90
-        /*
91
-         * Additional HTTP headers to send with the request.
92
-         * NOTE: On Android, this can only be used with GET requests.
93
-         */
94
-        headers: PropTypes.object,
95
-        /*
96
-         * The HTTP body to send with the request. This must be a valid
97
-         * UTF-8 string, and will be sent exactly as specified, with no
98
-         * additional encoding (e.g. URL-escaping or base64) applied.
99
-         * NOTE: On Android, this can only be used with POST requests.
100
-         */
101
-        body: PropTypes.string,
102
-      }),
103
-      PropTypes.shape({
104
-        /*
105
-         * A static HTML page to display in the WebView.
106
-         */
107
-        html: PropTypes.string,
108
-        /*
109
-         * The base URL to be used for any relative links in the HTML.
110
-         */
111
-        baseUrl: PropTypes.string,
112
-      }),
113
-      /*
114
-       * Used internally by packager.
115
-       */
116
-      PropTypes.number,
117
-    ]),
118
-
119
-    /**
120
-     * If true, use WKWebView instead of UIWebView.
121
-     * @platform ios
122
-     */
123
-    useWebKit: PropTypes.bool,
124
-
125
-    /**
126
-     * Used on Android only, JS is enabled by default for WebView on iOS
127
-     * @platform android
128
-     */
129
-    javaScriptEnabled: PropTypes.bool,
130
-
131
-    /**
132
-     * Used on Android Lollipop and above only, third party cookies are enabled
133
-     * by default for WebView on Android Kitkat and below and on iOS
134
-     * @platform android
135
-     */
136
-    thirdPartyCookiesEnabled: PropTypes.bool,
137
-
138
-    /**
139
-     * Used on Android only, controls whether DOM Storage is enabled or not
140
-     * @platform android
141
-     */
142
-    domStorageEnabled: PropTypes.bool,
143
-
144
-    /**
145
-     * Sets whether Geolocation is enabled. The default is false.
146
-     * @platform android
147
-     */
148
-    geolocationEnabled: PropTypes.bool,
149
-
150
-    /**
151
-     * Sets the JS to be injected when the webpage loads.
152
-     */
153
-    injectedJavaScript: PropTypes.string,
154
-
155
-    /**
156
-     * Sets whether the webpage scales to fit the view and the user can change the scale.
157
-     */
158
-    scalesPageToFit: PropTypes.bool,
159
-
160
-    /**
161
-     * Sets the user-agent for this WebView. The user-agent can also be set in native using
162
-     * WebViewConfig. This prop will overwrite that config.
163
-     */
164
-    userAgent: PropTypes.string,
165
-
166
-    /**
167
-     * Used to locate this view in end-to-end tests.
168
-     */
169
-    testID: PropTypes.string,
170
-
171
-    /**
172
-     * Determines whether HTML5 audio & videos require the user to tap before they can
173
-     * start playing. The default value is `false`.
174
-     */
175
-    mediaPlaybackRequiresUserAction: PropTypes.bool,
176
-
177
-    /**
178
-     * Boolean that sets whether JavaScript running in the context of a file
179
-     * scheme URL should be allowed to access content from any origin.
180
-     * Including accessing content from other file scheme URLs
181
-     * @platform android
182
-     */
183
-    allowUniversalAccessFromFileURLs: PropTypes.bool,
184
-
185
-    /**
186
-     * List of origin strings to allow being navigated to. The strings allow
187
-     * wildcards and get matched against *just* the origin (not the full URL).
188
-     * If the user taps to navigate to a new page but the new page is not in
189
-     * this whitelist, the URL will be opened by the Android OS.
190
-     * The default whitelisted origins are "http://*" and "https://*".
191
-     */
192
-    originWhitelist: PropTypes.arrayOf(PropTypes.string),
193
-
194
-    /**
195
-     * Function that accepts a string that will be passed to the WebView and
196
-     * executed immediately as JavaScript.
197
-     */
198
-    injectJavaScript: PropTypes.func,
199
-
200
-    /**
201
-     * Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
202
-     *
203
-     * Possible values for `mixedContentMode` are:
204
-     *
205
-     * - `'never'` (default) - WebView will not allow a secure origin to load content from an insecure origin.
206
-     * - `'always'` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
207
-     * - `'compatibility'` -  WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
208
-     * @platform android
209
-     */
210
-    mixedContentMode: PropTypes.oneOf(['never', 'always', 'compatibility']),
211
-
212
-    /**
213
-     * Used on Android only, controls whether form autocomplete data should be saved
214
-     * @platform android
215
-     */
216
-    saveFormDataDisabled: PropTypes.bool,
217
-
218
-    /**
219
-     * Override the native component used to render the WebView. Enables a custom native
220
-     * WebView which uses the same JavaScript as the original WebView.
221
-     */
222
-    nativeConfig: PropTypes.shape({
223
-      /*
224
-       * The native component used to render the WebView.
225
-       */
226
-      component: PropTypes.any,
227
-      /*
228
-       * Set props directly on the native component WebView. Enables custom props which the
229
-       * original WebView doesn't pass through.
230
-       */
231
-      props: PropTypes.object,
232
-      /*
233
-       * Set the ViewManager to use for communication with the native side.
234
-       * @platform ios
235
-       */
236
-      viewManager: PropTypes.object,
237
-    }),
238
-    /*
239
-     * Used on Android only, controls whether the given list of URL prefixes should
240
-     * make {@link com.facebook.react.views.webview.ReactWebViewClient} to launch a
241
-     * default activity intent for those URL instead of loading it within the webview.
242
-     * Use this to list URLs that WebView cannot handle, e.g. a PDF url.
243
-     * @platform android
244
-     */
245
-    urlPrefixesForDefaultIntent: PropTypes.arrayOf(PropTypes.string),
246
-  };
247
-
248 48
   static defaultProps = {
249 49
     javaScriptEnabled: true,
250 50
     thirdPartyCookiesEnabled: true,

+ 1
- 295
js/WebView.ios.js Näytä tiedosto

@@ -11,12 +11,10 @@
11 11
 'use strict';
12 12
 
13 13
 import React from 'react';
14
-import PropTypes from 'prop-types';
15 14
 
16 15
 import ReactNative from 'react-native'
17 16
 import {
18 17
   ActivityIndicator,
19
-  EdgeInsetsPropType,
20 18
   Linking,
21 19
   StyleSheet,
22 20
   Text,
@@ -30,9 +28,6 @@ import {
30 28
 import invariant from 'fbjs/lib/invariant';
31 29
 import keyMirror from 'fbjs/lib/keyMirror';
32 30
 
33
-import deprecatedPropType from './shims/deprecatedPropType';
34
-import DeprecatedViewPropTypes from './shims/DeprecatedViewPropTypes'
35
-
36 31
 import WebViewShared from './WebViewShared';
37 32
 
38 33
 const resolveAssetSource = Image.resolveAssetSource;
@@ -47,7 +42,7 @@ function processDecelerationRate(decelerationRate) {
47 42
   return decelerationRate;
48 43
 }
49 44
 
50
-const RCTWebViewManager = NativeModules.WebViewManager;
45
+const RCTWebViewManager = NativeModules.WKWebViewManager;
51 46
 const RCTWKWebViewManager = NativeModules.WKWebViewManager;
52 47
 
53 48
 const BGWASH = 'rgba(255,255,255,0.8)';
@@ -129,295 +124,6 @@ const defaultRenderError = (errorDomain, errorCode, errorDesc) => (
129 124
 class WebView extends React.Component {
130 125
   static JSNavigationScheme = JSNavigationScheme;
131 126
   static NavigationType = NavigationType;
132
-  static propTypes = {
133
-    ...DeprecatedViewPropTypes,
134
-
135
-    html: deprecatedPropType(
136
-      PropTypes.string,
137
-      'Use the `source` prop instead.',
138
-    ),
139
-
140
-    url: deprecatedPropType(PropTypes.string, 'Use the `source` prop instead.'),
141
-
142
-    /**
143
-     * Loads static html or a uri (with optional headers) in the WebView.
144
-     */
145
-    source: PropTypes.oneOfType([
146
-      PropTypes.shape({
147
-        /*
148
-         * The URI to load in the `WebView`. Can be a local or remote file.
149
-         */
150
-        uri: PropTypes.string,
151
-        /*
152
-         * The HTTP Method to use. Defaults to GET if not specified.
153
-         * NOTE: On Android, only GET and POST are supported.
154
-         */
155
-        method: PropTypes.string,
156
-        /*
157
-         * Additional HTTP headers to send with the request.
158
-         * NOTE: On Android, this can only be used with GET requests.
159
-         */
160
-        headers: PropTypes.object,
161
-        /*
162
-         * The HTTP body to send with the request. This must be a valid
163
-         * UTF-8 string, and will be sent exactly as specified, with no
164
-         * additional encoding (e.g. URL-escaping or base64) applied.
165
-         * NOTE: On Android, this can only be used with POST requests.
166
-         */
167
-        body: PropTypes.string,
168
-      }),
169
-      PropTypes.shape({
170
-        /*
171
-         * A static HTML page to display in the WebView.
172
-         */
173
-        html: PropTypes.string,
174
-        /*
175
-         * The base URL to be used for any relative links in the HTML.
176
-         */
177
-        baseUrl: PropTypes.string,
178
-      }),
179
-      /*
180
-       * Used internally by packager.
181
-       */
182
-      PropTypes.number,
183
-    ]),
184
-
185
-    /**
186
-     * If true, use WKWebView instead of UIWebView.
187
-     * @platform ios
188
-     */
189
-    useWebKit: PropTypes.bool,
190
-
191
-    /**
192
-     * Function that returns a view to show if there's an error.
193
-     */
194
-    renderError: PropTypes.func, // view to show if there's an error
195
-    /**
196
-     * Function that returns a loading indicator.
197
-     */
198
-    renderLoading: PropTypes.func,
199
-    /**
200
-     * Function that is invoked when the `WebView` has finished loading.
201
-     */
202
-    onLoad: PropTypes.func,
203
-    /**
204
-     * Function that is invoked when the `WebView` load succeeds or fails.
205
-     */
206
-    onLoadEnd: PropTypes.func,
207
-    /**
208
-     * Function that is invoked when the `WebView` starts loading.
209
-     */
210
-    onLoadStart: PropTypes.func,
211
-    /**
212
-     * Function that is invoked when the `WebView` load fails.
213
-     */
214
-    onError: PropTypes.func,
215
-    /**
216
-     * Boolean value that determines whether the web view bounces
217
-     * when it reaches the edge of the content. The default value is `true`.
218
-     * @platform ios
219
-     */
220
-    bounces: PropTypes.bool,
221
-    /**
222
-     * A floating-point number that determines how quickly the scroll view
223
-     * decelerates after the user lifts their finger. You may also use the
224
-     * string shortcuts `"normal"` and `"fast"` which match the underlying iOS
225
-     * settings for `UIScrollViewDecelerationRateNormal` and
226
-     * `UIScrollViewDecelerationRateFast` respectively:
227
-     *
228
-     *   - normal: 0.998
229
-     *   - fast: 0.99 (the default for iOS web view)
230
-     * @platform ios
231
-     */
232
-    decelerationRate: PropTypes.oneOfType([
233
-      PropTypes.oneOf(['fast', 'normal']),
234
-      PropTypes.number,
235
-    ]),
236
-    /**
237
-     * Boolean value that determines whether scrolling is enabled in the
238
-     * `WebView`. The default value is `true`.
239
-     * @platform ios
240
-     */
241
-    scrollEnabled: PropTypes.bool,
242
-    /**
243
-     * Controls whether to adjust the content inset for web views that are
244
-     * placed behind a navigation bar, tab bar, or toolbar. The default value
245
-     * is `true`.
246
-     */
247
-    automaticallyAdjustContentInsets: PropTypes.bool,
248
-    /**
249
-     * The amount by which the web view content is inset from the edges of
250
-     * the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
251
-     * @platform ios
252
-     */
253
-    contentInset: EdgeInsetsPropType,
254
-    /**
255
-     * Function that is invoked when the `WebView` loading starts or ends.
256
-     */
257
-    onNavigationStateChange: PropTypes.func,
258
-    /**
259
-     * A function that is invoked when the webview calls `window.postMessage`.
260
-     * Setting this property will inject a `postMessage` global into your
261
-     * webview, but will still call pre-existing values of `postMessage`.
262
-     *
263
-     * `window.postMessage` accepts one argument, `data`, which will be
264
-     * available on the event object, `event.nativeEvent.data`. `data`
265
-     * must be a string.
266
-     */
267
-    onMessage: PropTypes.func,
268
-    /**
269
-     * Boolean value that forces the `WebView` to show the loading view
270
-     * on the first load.
271
-     */
272
-    startInLoadingState: PropTypes.bool,
273
-    /**
274
-     * The style to apply to the `WebView`.
275
-     */
276
-    style: DeprecatedViewPropTypes.style,
277
-
278
-    /**
279
-     * Determines the types of data converted to clickable URLs in the web view's content.
280
-     * By default only phone numbers are detected.
281
-     *
282
-     * You can provide one type or an array of many types.
283
-     *
284
-     * Possible values for `dataDetectorTypes` are:
285
-     *
286
-     * - `'phoneNumber'`
287
-     * - `'link'`
288
-     * - `'address'`
289
-     * - `'calendarEvent'`
290
-     * - `'none'`
291
-     * - `'all'`
292
-     *
293
-     * With the new WebKit implementation, we have three new values:
294
-     * - `'trackingNumber'`,
295
-     * - `'flightNumber'`,
296
-     * - `'lookupSuggestion'`,
297
-     *
298
-     * @platform ios
299
-     */
300
-    dataDetectorTypes: PropTypes.oneOfType([
301
-      PropTypes.oneOf(DataDetectorTypes),
302
-      PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),
303
-    ]),
304
-
305
-    /**
306
-     * Boolean value to enable JavaScript in the `WebView`. Used on Android only
307
-     * as JavaScript is enabled by default on iOS. The default value is `true`.
308
-     * @platform android
309
-     */
310
-    javaScriptEnabled: PropTypes.bool,
311
-
312
-    /**
313
-     * Boolean value to enable third party cookies in the `WebView`. Used on
314
-     * Android Lollipop and above only as third party cookies are enabled by
315
-     * default on Android Kitkat and below and on iOS. The default value is `true`.
316
-     * @platform android
317
-     */
318
-    thirdPartyCookiesEnabled: PropTypes.bool,
319
-
320
-    /**
321
-     * Boolean value to control whether DOM Storage is enabled. Used only in
322
-     * Android.
323
-     * @platform android
324
-     */
325
-    domStorageEnabled: PropTypes.bool,
326
-
327
-    /**
328
-     * Set this to provide JavaScript that will be injected into the web page
329
-     * when the view loads.
330
-     */
331
-    injectedJavaScript: PropTypes.string,
332
-
333
-    /**
334
-     * Sets the user-agent for the `WebView`.
335
-     * @platform android
336
-     */
337
-    userAgent: PropTypes.string,
338
-
339
-    /**
340
-     * Boolean that controls whether the web content is scaled to fit
341
-     * the view and enables the user to change the scale. The default value
342
-     * is `true`.
343
-     *
344
-     * On iOS, when `useWebKit=true`, this prop will not work.
345
-     */
346
-    scalesPageToFit: PropTypes.bool,
347
-
348
-    /**
349
-     * Function that allows custom handling of any web view requests. Return
350
-     * `true` from the function to continue loading the request and `false`
351
-     * to stop loading.
352
-     * @platform ios
353
-     */
354
-    onShouldStartLoadWithRequest: PropTypes.func,
355
-
356
-    /**
357
-     * Boolean that determines whether HTML5 videos play inline or use the
358
-     * native full-screen controller. The default value is `false`.
359
-     *
360
-     * **NOTE** : In order for video to play inline, not only does this
361
-     * property need to be set to `true`, but the video element in the HTML
362
-     * document must also include the `webkit-playsinline` attribute.
363
-     * @platform ios
364
-     */
365
-    allowsInlineMediaPlayback: PropTypes.bool,
366
-
367
-    /**
368
-     * Boolean that determines whether HTML5 audio and video requires the user
369
-     * to tap them before they start playing. The default value is `true`.
370
-     */
371
-    mediaPlaybackRequiresUserAction: PropTypes.bool,
372
-
373
-    /**
374
-     * List of origin strings to allow being navigated to. The strings allow
375
-     * wildcards and get matched against *just* the origin (not the full URL).
376
-     * If the user taps to navigate to a new page but the new page is not in
377
-     * this whitelist, we will open the URL in Safari.
378
-     * The default whitelisted origins are "http://*" and "https://*".
379
-     */
380
-    originWhitelist: PropTypes.arrayOf(PropTypes.string),
381
-
382
-    /**
383
-     * Function that accepts a string that will be passed to the WebView and
384
-     * executed immediately as JavaScript.
385
-     */
386
-    injectJavaScript: PropTypes.func,
387
-
388
-    /**
389
-     * Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
390
-     *
391
-     * Possible values for `mixedContentMode` are:
392
-     *
393
-     * - `'never'` (default) - WebView will not allow a secure origin to load content from an insecure origin.
394
-     * - `'always'` - WebView will allow a secure origin to load content from any other origin, even if that origin is insecure.
395
-     * - `'compatibility'` -  WebView will attempt to be compatible with the approach of a modern web browser with regard to mixed content.
396
-     * @platform android
397
-     */
398
-    mixedContentMode: PropTypes.oneOf(['never', 'always', 'compatibility']),
399
-
400
-    /**
401
-     * Override the native component used to render the WebView. Enables a custom native
402
-     * WebView which uses the same JavaScript as the original WebView.
403
-     */
404
-    nativeConfig: PropTypes.shape({
405
-      /*
406
-       * The native component used to render the WebView.
407
-       */
408
-      component: PropTypes.any,
409
-      /*
410
-       * Set props directly on the native component WebView. Enables custom props which the
411
-       * original WebView doesn't pass through.
412
-       */
413
-      props: PropTypes.object,
414
-      /*
415
-       * Set the ViewManager to use for communication with the native side.
416
-       * @platform ios
417
-       */
418
-      viewManager: PropTypes.object,
419
-    }),
420
-  };
421 127
 
422 128
   static defaultProps = {
423 129
     originWhitelist: WebViewShared.defaultOriginWhitelist,

+ 0
- 409
js/shims/DeprecatedViewPropTypes.js Näytä tiedosto

@@ -1,409 +0,0 @@
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
- * @format
8
- * @flow
9
- */
10
-
11
-'use strict';
12
-
13
-import {
14
-  EdgeInsetsPropType,
15
-  PlatformViewPropTypes,
16
-  // ViewStylePropTypes,
17
-  // StyleSheetPropType
18
-} from 'react-native';
19
-
20
-import PropTypes from 'prop-types';
21
-
22
-import ViewAccessibility from './ViewAccessibility'
23
-
24
-const {
25
-  AccessibilityComponentTypes,
26
-  AccessibilityTraits,
27
-  AccessibilityRoles,
28
-  AccessibilityStates,
29
-} = ViewAccessibility;
30
-
31
-// TODO: Figure out how to properly import StyleSheetPropType, or shim it
32
-const stylePropType = PropTypes.object; // StyleSheetPropType(ViewStylePropTypes);
33
-
34
-module.exports = {
35
-  /**
36
-   * When `true`, indicates that the view is an accessibility element.
37
-   * By default, all the touchable elements are accessible.
38
-   *
39
-   * See http://facebook.github.io/react-native/docs/view.html#accessible
40
-   */
41
-  accessible: PropTypes.bool,
42
-
43
-  /**
44
-   * Overrides the text that's read by the screen reader when the user interacts
45
-   * with the element. By default, the label is constructed by traversing all
46
-   * the children and accumulating all the `Text` nodes separated by space.
47
-   *
48
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilitylabel
49
-   */
50
-  accessibilityLabel: PropTypes.node,
51
-
52
-  /**
53
-   * An accessibility hint helps users understand what will happen when they perform
54
-   * an action on the accessibility element when that result is not obvious from the
55
-   * accessibility label.
56
-   *
57
-   *
58
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilityHint
59
-   */
60
-  accessibilityHint: PropTypes.string,
61
-
62
-  /**
63
-   * Provides an array of custom actions available for accessibility.
64
-   *
65
-   * @platform ios
66
-   */
67
-  accessibilityActions: PropTypes.arrayOf(PropTypes.string),
68
-
69
-  /**
70
-   * Prevents view from being inverted if set to true and color inversion is turned on.
71
-   *
72
-   * @platform ios
73
-   */
74
-  accessibilityIgnoresInvertColors: PropTypes.bool,
75
-
76
-  /**
77
-   * Indicates to accessibility services to treat UI component like a
78
-   * native one. Works for Android only.
79
-   *
80
-   * @platform android
81
-   *
82
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilitycomponenttype
83
-   */
84
-  accessibilityComponentType: PropTypes.oneOf(AccessibilityComponentTypes),
85
-
86
-  /**
87
-   * Indicates to accessibility services to treat UI component like a specific role.
88
-   */
89
-  accessibilityRole: PropTypes.oneOf(AccessibilityRoles),
90
-
91
-  /**
92
-   * Indicates to accessibility services that UI Component is in a specific State.
93
-   */
94
-  accessibilityStates: PropTypes.arrayOf(PropTypes.oneOf(AccessibilityStates)),
95
-  /**
96
-   * Indicates to accessibility services whether the user should be notified
97
-   * when this view changes. Works for Android API >= 19 only.
98
-   *
99
-   * @platform android
100
-   *
101
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilityliveregion
102
-   */
103
-  accessibilityLiveRegion: PropTypes.oneOf(['none', 'polite', 'assertive']),
104
-
105
-  /**
106
-   * Controls how view is important for accessibility which is if it
107
-   * fires accessibility events and if it is reported to accessibility services
108
-   * that query the screen. Works for Android only.
109
-   *
110
-   * @platform android
111
-   *
112
-   * See http://facebook.github.io/react-native/docs/view.html#importantforaccessibility
113
-   */
114
-  importantForAccessibility: PropTypes.oneOf([
115
-    'auto',
116
-    'yes',
117
-    'no',
118
-    'no-hide-descendants',
119
-  ]),
120
-
121
-  /**
122
-   * Provides additional traits to screen reader. By default no traits are
123
-   * provided unless specified otherwise in element.
124
-   *
125
-   * You can provide one trait or an array of many traits.
126
-   *
127
-   * @platform ios
128
-   *
129
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilitytraits
130
-   */
131
-  accessibilityTraits: PropTypes.oneOfType([
132
-    PropTypes.oneOf(AccessibilityTraits),
133
-    PropTypes.arrayOf(PropTypes.oneOf(AccessibilityTraits)),
134
-  ]),
135
-
136
-  /**
137
-   * A value indicating whether VoiceOver should ignore the elements
138
-   * within views that are siblings of the receiver.
139
-   * Default is `false`.
140
-   *
141
-   * @platform ios
142
-   *
143
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilityviewismodal
144
-   */
145
-  accessibilityViewIsModal: PropTypes.bool,
146
-
147
-  /**
148
-   * A value indicating whether the accessibility elements contained within
149
-   * this accessibility element are hidden.
150
-   *
151
-   * @platform ios
152
-   *
153
-   * See http://facebook.github.io/react-native/docs/view.html#accessibilityElementsHidden
154
-   */
155
-  accessibilityElementsHidden: PropTypes.bool,
156
-
157
-  /**
158
-   * When `accessible` is true, the system will try to invoke this function
159
-   * when the user performs an accessibility custom action.
160
-   *
161
-   * @platform ios
162
-   */
163
-  onAccessibilityAction: PropTypes.func,
164
-
165
-  /**
166
-   * When `accessible` is true, the system will try to invoke this function
167
-   * when the user performs accessibility tap gesture.
168
-   *
169
-   * See http://facebook.github.io/react-native/docs/view.html#onaccessibilitytap
170
-   */
171
-  onAccessibilityTap: PropTypes.func,
172
-
173
-  /**
174
-   * When `accessible` is `true`, the system will invoke this function when the
175
-   * user performs the magic tap gesture.
176
-   *
177
-   * See http://facebook.github.io/react-native/docs/view.html#onmagictap
178
-   */
179
-  onMagicTap: PropTypes.func,
180
-
181
-  /**
182
-   * Used to locate this view in end-to-end tests.
183
-   *
184
-   * > This disables the 'layout-only view removal' optimization for this view!
185
-   *
186
-   * See http://facebook.github.io/react-native/docs/view.html#testid
187
-   */
188
-  testID: PropTypes.string,
189
-
190
-  /**
191
-   * Used to locate this view from native classes.
192
-   *
193
-   * > This disables the 'layout-only view removal' optimization for this view!
194
-   *
195
-   * See http://facebook.github.io/react-native/docs/view.html#nativeid
196
-   */
197
-  nativeID: PropTypes.string,
198
-
199
-  /**
200
-   * For most touch interactions, you'll simply want to wrap your component in
201
-   * `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`,
202
-   * `ScrollResponder.js` and `ResponderEventPlugin.js` for more discussion.
203
-   */
204
-
205
-  /**
206
-   * The View is now responding for touch events. This is the time to highlight
207
-   * and show the user what is happening.
208
-   *
209
-   * `View.props.onResponderGrant: (event) => {}`, where `event` is a synthetic
210
-   * touch event as described above.
211
-   *
212
-   * See http://facebook.github.io/react-native/docs/view.html#onrespondergrant
213
-   */
214
-  onResponderGrant: PropTypes.func,
215
-
216
-  /**
217
-   * The user is moving their finger.
218
-   *
219
-   * `View.props.onResponderMove: (event) => {}`, where `event` is a synthetic
220
-   * touch event as described above.
221
-   *
222
-   * See http://facebook.github.io/react-native/docs/view.html#onrespondermove
223
-   */
224
-  onResponderMove: PropTypes.func,
225
-
226
-  /**
227
-   * Another responder is already active and will not release it to that `View`
228
-   * asking to be the responder.
229
-   *
230
-   * `View.props.onResponderReject: (event) => {}`, where `event` is a
231
-   * synthetic touch event as described above.
232
-   *
233
-   * See http://facebook.github.io/react-native/docs/view.html#onresponderreject
234
-   */
235
-  onResponderReject: PropTypes.func,
236
-
237
-  /**
238
-   * Fired at the end of the touch.
239
-   *
240
-   * `View.props.onResponderRelease: (event) => {}`, where `event` is a
241
-   * synthetic touch event as described above.
242
-   *
243
-   * See http://facebook.github.io/react-native/docs/view.html#onresponderrelease
244
-   */
245
-  onResponderRelease: PropTypes.func,
246
-
247
-  /**
248
-   * The responder has been taken from the `View`. Might be taken by other
249
-   * views after a call to `onResponderTerminationRequest`, or might be taken
250
-   * by the OS without asking (e.g., happens with control center/ notification
251
-   * center on iOS)
252
-   *
253
-   * `View.props.onResponderTerminate: (event) => {}`, where `event` is a
254
-   * synthetic touch event as described above.
255
-   *
256
-   * See http://facebook.github.io/react-native/docs/view.html#onresponderterminate
257
-   */
258
-  onResponderTerminate: PropTypes.func,
259
-
260
-  /**
261
-   * Some other `View` wants to become responder and is asking this `View` to
262
-   * release its responder. Returning `true` allows its release.
263
-   *
264
-   * `View.props.onResponderTerminationRequest: (event) => {}`, where `event`
265
-   * is a synthetic touch event as described above.
266
-   *
267
-   * See http://facebook.github.io/react-native/docs/view.html#onresponderterminationrequest
268
-   */
269
-  onResponderTerminationRequest: PropTypes.func,
270
-
271
-  /**
272
-   * Does this view want to become responder on the start of a touch?
273
-   *
274
-   * `View.props.onStartShouldSetResponder: (event) => [true | false]`, where
275
-   * `event` is a synthetic touch event as described above.
276
-   *
277
-   * See http://facebook.github.io/react-native/docs/view.html#onstartshouldsetresponder
278
-   */
279
-  onStartShouldSetResponder: PropTypes.func,
280
-
281
-  /**
282
-   * If a parent `View` wants to prevent a child `View` from becoming responder
283
-   * on a touch start, it should have this handler which returns `true`.
284
-   *
285
-   * `View.props.onStartShouldSetResponderCapture: (event) => [true | false]`,
286
-   * where `event` is a synthetic touch event as described above.
287
-   *
288
-   * See http://facebook.github.io/react-native/docs/view.html#onstartshouldsetrespondercapture
289
-   */
290
-  onStartShouldSetResponderCapture: PropTypes.func,
291
-
292
-  /**
293
-   * Does this view want to "claim" touch responsiveness? This is called for
294
-   * every touch move on the `View` when it is not the responder.
295
-   *
296
-   * `View.props.onMoveShouldSetResponder: (event) => [true | false]`, where
297
-   * `event` is a synthetic touch event as described above.
298
-   *
299
-   * See http://facebook.github.io/react-native/docs/view.html#onmoveshouldsetresponder
300
-   */
301
-  onMoveShouldSetResponder: PropTypes.func,
302
-
303
-  /**
304
-   * If a parent `View` wants to prevent a child `View` from becoming responder
305
-   * on a move, it should have this handler which returns `true`.
306
-   *
307
-   * `View.props.onMoveShouldSetResponderCapture: (event) => [true | false]`,
308
-   * where `event` is a synthetic touch event as described above.
309
-   *
310
-   * See http://facebook.github.io/react-native/docs/view.html#onMoveShouldsetrespondercapture
311
-   */
312
-  onMoveShouldSetResponderCapture: PropTypes.func,
313
-
314
-  /**
315
-   * This defines how far a touch event can start away from the view.
316
-   * Typical interface guidelines recommend touch targets that are at least
317
-   * 30 - 40 points/density-independent pixels.
318
-   *
319
-   * > The touch area never extends past the parent view bounds and the Z-index
320
-   * > of sibling views always takes precedence if a touch hits two overlapping
321
-   * > views.
322
-   *
323
-   * See http://facebook.github.io/react-native/docs/view.html#hitslop
324
-   */
325
-  hitSlop: EdgeInsetsPropType,
326
-
327
-  /**
328
-   * Invoked on mount and layout changes with:
329
-   *
330
-   * `{nativeEvent: { layout: {x, y, width, height}}}`
331
-   *
332
-   * This event is fired immediately once the layout has been calculated, but
333
-   * the new layout may not yet be reflected on the screen at the time the
334
-   * event is received, especially if a layout animation is in progress.
335
-   *
336
-   * See http://facebook.github.io/react-native/docs/view.html#onlayout
337
-   */
338
-  onLayout: PropTypes.func,
339
-
340
-  /**
341
-   * Controls whether the `View` can be the target of touch events.
342
-   *
343
-   * See http://facebook.github.io/react-native/docs/view.html#pointerevents
344
-   */
345
-  pointerEvents: PropTypes.oneOf(['box-none', 'none', 'box-only', 'auto']),
346
-
347
-  /**
348
-   * See http://facebook.github.io/react-native/docs/style.html
349
-   */
350
-  style: stylePropType,
351
-
352
-  /**
353
-   * This is a special performance property exposed by `RCTView` and is useful
354
-   * for scrolling content when there are many subviews, most of which are
355
-   * offscreen. For this property to be effective, it must be applied to a
356
-   * view that contains many subviews that extend outside its bound. The
357
-   * subviews must also have `overflow: hidden`, as should the containing view
358
-   * (or one of its superviews).
359
-   *
360
-   * See http://facebook.github.io/react-native/docs/view.html#removeclippedsubviews
361
-   */
362
-  removeClippedSubviews: PropTypes.bool,
363
-
364
-  /**
365
-   * Whether this `View` should render itself (and all of its children) into a
366
-   * single hardware texture on the GPU.
367
-   *
368
-   * @platform android
369
-   *
370
-   * See http://facebook.github.io/react-native/docs/view.html#rendertohardwaretextureandroid
371
-   */
372
-  renderToHardwareTextureAndroid: PropTypes.bool,
373
-
374
-  /**
375
-   * Whether this `View` should be rendered as a bitmap before compositing.
376
-   *
377
-   * @platform ios
378
-   *
379
-   * See http://facebook.github.io/react-native/docs/view.html#shouldrasterizeios
380
-   */
381
-  shouldRasterizeIOS: PropTypes.bool,
382
-
383
-  /**
384
-   * Views that are only used to layout their children or otherwise don't draw
385
-   * anything may be automatically removed from the native hierarchy as an
386
-   * optimization. Set this property to `false` to disable this optimization and
387
-   * ensure that this `View` exists in the native view hierarchy.
388
-   *
389
-   * @platform android
390
-   *
391
-   * See http://facebook.github.io/react-native/docs/view.html#collapsable
392
-   */
393
-  collapsable: PropTypes.bool,
394
-
395
-  /**
396
-   * Whether this `View` needs to rendered offscreen and composited with an
397
-   * alpha in order to preserve 100% correct colors and blending behavior.
398
-   *
399
-   * @platform android
400
-   *
401
-   * See http://facebook.github.io/react-native/docs/view.html#needsoffscreenalphacompositing
402
-   */
403
-  needsOffscreenAlphaCompositing: PropTypes.bool,
404
-
405
-  /**
406
-   * Any additional platform-specific view prop types, or prop type overrides.
407
-   */
408
-  ...PlatformViewPropTypes,
409
-};

+ 0
- 55
js/shims/ViewAccessibility.js Näytä tiedosto

@@ -1,55 +0,0 @@
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
- * @format
8
- * @flow strict
9
- */
10
-
11
-'use strict';
12
-
13
-module.exports = {
14
-  AccessibilityTraits: [
15
-    'none',
16
-    'button',
17
-    'link',
18
-    'header',
19
-    'search',
20
-    'image',
21
-    'selected',
22
-    'plays',
23
-    'key',
24
-    'text',
25
-    'summary',
26
-    'disabled',
27
-    'frequentUpdates',
28
-    'startsMedia',
29
-    'adjustable',
30
-    'allowsDirectInteraction',
31
-    'pageTurn',
32
-  ],
33
-  AccessibilityComponentTypes: [
34
-    'none',
35
-    'button',
36
-    'radiobutton_checked',
37
-    'radiobutton_unchecked',
38
-  ],
39
-  // This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m
40
-  AccessibilityRoles: [
41
-    'none',
42
-    'button',
43
-    'link',
44
-    'search',
45
-    'image',
46
-    'keyboardkey',
47
-    'text',
48
-    'adjustable',
49
-    'imagebutton',
50
-    'header',
51
-    'summary',
52
-  ],
53
-  // This must be kept in sync with the AccessibilityStatesMask in RCTViewManager.m
54
-  AccessibilityStates: ['selected', 'disabled'],
55
-};

+ 0
- 34
js/shims/deprecatedPropType.js Näytä tiedosto

@@ -1,34 +0,0 @@
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
- * @format
8
- * @flow strict-local
9
- */
10
-
11
-'use strict';
12
-
13
-import { UIManager } from 'react-native';
14
-
15
-/**
16
- * Adds a deprecation warning when the prop is used.
17
- */
18
-function deprecatedPropType(
19
-  propType,
20
-  explanation,
21
-) {
22
-  return function validate(props, propName, componentName, ...rest) {
23
-    // Don't warn for native components.
24
-    if (!UIManager[componentName] && props[propName] !== undefined) {
25
-      console.warn(
26
-        `\`${propName}\` supplied to \`${componentName}\` has been deprecated. ${explanation}`,
27
-      );
28
-    }
29
-
30
-    return propType(props, propName, componentName, ...rest);
31
-  };
32
-}
33
-
34
-module.exports = deprecatedPropType;