diff --git a/FacebookLicense/LICENSE b/FacebookLicense/LICENSE deleted file mode 100644 index 8085fec497c..00000000000 --- a/FacebookLicense/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For React Native software - -Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/FacebookLicense/PATENTS b/FacebookLicense/PATENTS deleted file mode 100644 index f26186660aa..00000000000 --- a/FacebookLicense/PATENTS +++ /dev/null @@ -1,33 +0,0 @@ -Additional Grant of Patent Rights Version 2 - -"Software" means the React Native software distributed by Facebook, Inc. - -Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software -(“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable -(subject to the termination provision below) license under any Necessary -Claims, to make, have made, use, sell, offer to sell, import, and otherwise -transfer the Software. For avoidance of doubt, no license is granted under -Facebook's rights in any patent claims that are infringed by (i) modifications -to the Software made by you or any third party or (ii) the Software in -combination with any software or other technology. - -The license granted hereunder will terminate, automatically and without notice, -if you (or any of your subsidiaries, corporate affiliates or agents) initiate -directly or indirectly, or take a direct financial interest in, any Patent -Assertion: (i) against Facebook or any of its subsidiaries or corporate -affiliates, (ii) against any party if such Patent Assertion arises in whole or -in part from any software, technology, product or service of Facebook or any of -its subsidiaries or corporate affiliates, or (iii) against any party relating -to the Software. Notwithstanding the foregoing, if Facebook or any of its -subsidiaries or corporate affiliates files a lawsuit alleging patent -infringement against you in the first instance, and you respond by filing a -patent infringement counterclaim in that lawsuit against that party that is -unrelated to the Software, the license granted hereunder will not terminate -under section (i) of this paragraph due to such counterclaim. - -A "Necessary Claim" is a claim of a patent owned by Facebook that is -necessarily infringed by the Software standing alone. - -A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, -or contributory infringement or inducement to infringe any patent, including a -cross-claim or counterclaim. diff --git a/FacebookLicense/README.md b/FacebookLicense/README.md deleted file mode 100644 index d15c0d9b7dc..00000000000 --- a/FacebookLicense/README.md +++ /dev/null @@ -1,20 +0,0 @@ -## Facebook License and Grant of Patent Rights - -A subset of the source code in React Native Windows is derived from React Native. Files that are derived from React Native contain the following copyright headers: - -``` -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -``` - -In React Native Windows, the BSD-style license referred to above can be found in the [LICENSE](LICENSE) file in this folder. The grant of patent rights can be found in the [PATENTS](PATENTS) file in this folder. - -A non-exhaustive list of that source code can be found in the following directories: -- [Libraries](/Libraries) -- [RNTester](https://github.com/Microsoft/react-native-windows/tree/rntester) diff --git a/LICENSE b/LICENSE index d1ed057e124..b4f554e2b73 100644 --- a/LICENSE +++ b/LICENSE @@ -2,6 +2,10 @@ The MIT License (MIT) Copyright (c) Microsoft Corporation and contributors. All rights reserved. +Portions derived from React Native: + +Copyright (c) 2015-present, Facebook, Inc. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/Libraries/Alert/Alert.windows.js b/Libraries/Alert/Alert.windows.js index 3b0e59accc2..d7faddb60cb 100644 --- a/Libraries/Alert/Alert.windows.js +++ b/Libraries/Alert/Alert.windows.js @@ -1,11 +1,14 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * + * Portions copyright for react-native-windows: + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * * @providesModule Alert * @flow */ @@ -17,7 +20,7 @@ const Platform = require('Platform'); import type { AlertType, AlertButtonStyle } from 'AlertIOS'; -type Buttons = Array<{ +export type Buttons = Array<{ text?: string, onPress?: ?Function, style?: AlertButtonStyle, @@ -31,71 +34,15 @@ type Options = { /** * Launches an alert dialog with the specified title and message. * - * Optionally provide a list of buttons. Tapping any button will fire the - * respective onPress callback and dismiss the alert. By default, the only - * button will be an 'OK' button. - * - * This is an API that works both on iOS and Android and can show static - * alerts. To show an alert that prompts the user to enter some information, - * see `AlertIOS`; entering text in an alert is common on iOS only. - * - * ## iOS - * - * On iOS you can specify any number of buttons. Each button can optionally - * specify a style, which is one of 'default', 'cancel' or 'destructive'. - * - * ## Android - * - * On Android at most three buttons can be specified. Android has a concept - * of a neutral, negative and a positive button: - * - * - If you specify one button, it will be the 'positive' one (such as 'OK') - * - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK') - * - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK') - * - * By default alerts on Android can be dismissed by tapping outside of the alert - * box. This event can be handled by providing an optional `options` parameter, - * with an `onDismiss` callback property `{ onDismiss: () => {} }`. - * - * Alternatively, the dismissing behavior can be disabled altogether by providing - * an optional `options` parameter with the `cancelable` property set to `false` - * i.e. `{ cancelable: false }` - * - * Example usage: - * ``` - * // Works on both iOS and Android - * Alert.alert( - * 'Alert Title', - * 'My Alert Msg', - * [ - * {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, - * {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, - * {text: 'OK', onPress: () => console.log('OK Pressed')}, - * ], - * { cancelable: false } - * ) - * ``` - * ## Windows - * - * On Windows at most two buttons can be specified. - * - * - If you specify one button, it will be the 'positive' one (such as 'OK') - * - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK') - * - * ``` - * // Works on iOS, Android, and Windows - * Alert.alert( - * 'Alert Title', - * 'My Alert Msg', - * [ - * {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, - * {text: 'OK', onPress: () => console.log('OK Pressed')}, - * ] - * ) - * ``` + * See http://facebook.github.io/react-native/docs/alert.html */ class Alert { + /** + * Launches an alert dialog with the specified title and message. + * + * See http://facebook.github.io/react-native/docs/alert.html#alert + */ static alert( title: ?string, message?: ?string, diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js index ee75022c979..3e845a76373 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js @@ -1,11 +1,14 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * + * Portions copyright for react-native-windows: + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * * @providesModule AccessibilityInfo * @flow */ diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.windows.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.windows.js index 1746155494a..5998172f1a9 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.windows.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.windows.js @@ -1,10 +1,13 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * Portions copyright for react-native-windows: + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. * * @providesModule ActivityIndicator * @flow @@ -14,13 +17,14 @@ const ColorPropType = require('ColorPropType'); const NativeMethodsMixin = require('NativeMethodsMixin'); const Platform = require('Platform'); -const React = require('React'); -const createReactClass = require('create-react-class'); +const ProgressBarAndroid = require('ProgressBarAndroid'); const PropTypes = require('prop-types'); +const React = require('React'); const StyleSheet = require('StyleSheet'); const View = require('View'); const ViewPropTypes = require('ViewPropTypes'); +const createReactClass = require('create-react-class'); const requireNativeComponent = require('requireNativeComponent'); const GRAY = '#999999'; @@ -36,6 +40,8 @@ type DefaultProps = { /** * Displays a circular loading indicator. + * + * See http://facebook.github.io/react-native/docs/activityindicator.html */ const ActivityIndicator = createReactClass({ displayName: 'ActivityIndicator', @@ -45,15 +51,21 @@ const ActivityIndicator = createReactClass({ ...ViewPropTypes, /** * Whether to show the indicator (true, the default) or hide it (false). + * + * See http://facebook.github.io/react-native/docs/activityindicator.html#animating */ animating: PropTypes.bool, /** * The foreground color of the spinner (default is gray). + * + * See http://facebook.github.io/react-native/docs/activityindicator.html#color */ color: ColorPropType, /** * Size of the indicator (default is 'small'). * Passing a number to the size prop is only supported on Android. + * + * See http://facebook.github.io/react-native/docs/activityindicator.html#size */ size: PropTypes.oneOfType([ PropTypes.oneOf([ 'small', 'large' ]), @@ -63,6 +75,8 @@ const ActivityIndicator = createReactClass({ * Whether the indicator should hide when not animating (true by default). * * @platform ios + * + * See http://facebook.github.io/react-native/docs/activityindicator.html#hideswhenstopped */ hidesWhenStopped: PropTypes.bool, }, @@ -92,19 +106,23 @@ const ActivityIndicator = createReactClass({ break; } + const nativeProps = { + ...props, + style: sizeStyle, + styleAttr: 'Normal', + indeterminate: true, + }; + return ( - - + + {Platform.OS !== 'android' ? ( + + ) : ( + + )} ); - }, + } }); const styles = StyleSheet.create({ @@ -128,17 +146,6 @@ if (Platform.OS === 'ios') { ActivityIndicator, {nativeOnly: {activityIndicatorViewStyle: true}}, ); -} else if (Platform.OS === 'android') { - var RCTActivityIndicator = requireNativeComponent( - 'AndroidProgressBar', - ActivityIndicator, - // Ignore props that are specific to non inderterminate ProgressBar. - {nativeOnly: { - indeterminate: true, - progress: true, - styleAttr: true, - }}, - ); } else if (Platform.OS === 'windows') { var RCTActivityIndicator = requireNativeComponent( 'WindowsProgressRing', diff --git a/Libraries/Components/AppleTV/TVEventHandler.windows.js b/Libraries/Components/AppleTV/TVEventHandler.windows.js index 6d52d0d5eff..718fa84a8de 100644 --- a/Libraries/Components/AppleTV/TVEventHandler.windows.js +++ b/Libraries/Components/AppleTV/TVEventHandler.windows.js @@ -1,31 +1,8 @@ /** - * Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. + * Copyright (c) 2015-present, Facebook, Inc. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * Facebook, Inc. ("Facebook") owns all right, title and interest, including - * all intellectual property and other proprietary rights, in and to the React - * Native CustomComponents software (the "Software"). Subject to your - * compliance with these terms, you are hereby granted a non-exclusive, - * worldwide, royalty-free copyright license to (1) use and copy the Software; - * and (2) reproduce and distribute the Software as part of your own software - * ("Your Software"). Facebook reserves all rights not expressly granted to - * you in this license agreement. - * - * THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. - * IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR - * EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * * @providesModule TVEventHandler * @flow diff --git a/Libraries/Components/Button.windows.js b/Libraries/Components/Button.windows.js index b2c50b0270b..18bed8c4138 100644 --- a/Libraries/Components/Button.windows.js +++ b/Libraries/Components/Button.windows.js @@ -1,11 +1,14 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * + * Portions copyright for react-native-windows: + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * * @providesModule Button * @flow */ @@ -32,7 +35,6 @@ const KEY_CODE_SPACE = FocusableView.keys.Space; const DOWN_KEYCODES = [KEY_CODE_SPACE, KEY_CODE_ENTER]; const UP_KEYCODES = [KEY_CODE_SPACE]; - /** * A basic button component that should render nicely on any platform. Supports * a minimal level of customization. @@ -48,6 +50,9 @@ const UP_KEYCODES = [KEY_CODE_SPACE]; * Example usage: * * ``` + * import { Button } from 'react-native'; + * ... + * *