From a314d5b2e44c75b4c88e74520744784c069f34f1 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Sat, 17 Feb 2018 12:23:45 -0800 Subject: [PATCH] [change] MIT license Now possible to license under MIT following the change to React Native's license. https://github.com/facebook/react-native/commit/26684cf3adf4094eb6c405d345a75bf8c7c0bf88 Fix #828 --- LICENSE | 45 ++--- README.md | 4 +- package.json | 2 +- packages/react-native-web/package.json | 2 +- .../src/exports/ActivityIndicator/index.js | 3 +- .../src/exports/Animated/index.js | 6 +- .../src/exports/AppRegistry/AppContainer.js | 3 +- .../src/exports/AppRegistry/index.js | 3 +- .../exports/AppRegistry/renderApplication.js | 3 +- .../src/exports/AppState/index.js | 3 +- .../src/exports/AsyncStorage/index.js | 3 +- .../src/exports/BackHandler/index.js | 3 +- .../src/exports/Button/index.js | 4 +- .../src/exports/CheckBox/index.js | 3 +- .../src/exports/Clipboard/index.js | 3 +- .../src/exports/ColorPropType/index.js | 6 +- .../src/exports/Dimensions/index.js | 3 +- .../src/exports/Easing/index.js | 3 +- .../src/exports/EdgeInsetsPropType/index.js | 6 +- .../src/exports/I18nManager/index.js | 3 +- .../src/exports/Image/index.js | 3 +- .../src/exports/ImageBackground/index.js | 6 +- .../src/exports/InteractionManager/index.js | 3 +- .../src/exports/Keyboard/index.js | 3 +- .../src/exports/KeyboardAvoidingView/index.js | 3 +- .../src/exports/Linking/index.js | 3 +- .../src/exports/NetInfo/index.js | 3 +- .../src/exports/Picker/PickerItemPropType.js | 3 +- .../exports/Picker/PickerStylePropTypes.js | 3 +- .../src/exports/Picker/index.js | 3 +- .../src/exports/PixelRatio/index.js | 3 +- .../src/exports/Platform/index.js | 3 +- .../src/exports/PointPropType/index.js | 6 +- .../src/exports/ProgressBar/index.js | 3 +- .../src/exports/RefreshControl/index.js | 3 +- .../src/exports/SafeAreaView/index.js | 6 +- .../src/exports/ScrollView/ScrollViewBase.js | 3 +- .../src/exports/ScrollView/index.js | 3 +- .../src/exports/StatusBar/index.js | 3 +- .../StyleSheet/ReactNativeStyleResolver.js | 9 +- .../src/exports/StyleSheet/StyleSheet.js | 3 +- .../exports/StyleSheet/StyleSheetManager.js | 3 +- .../StyleSheet/StyleSheetValidation.js | 3 +- .../src/exports/StyleSheet/WebStyleSheet.js | 3 +- .../StyleSheet/__tests__/flattenStyle-test.js | 6 +- .../exports/StyleSheet/createReactDOMStyle.js | 15 +- .../src/exports/StyleSheet/createRuleBlock.js | 3 +- .../src/exports/StyleSheet/flattenStyle.js | 3 +- .../src/exports/StyleSheet/i18nStyle.js | 3 +- .../src/exports/StyleSheet/initialRules.js | 3 +- .../src/exports/StyleSheet/normalizeValue.js | 3 +- .../src/exports/StyleSheet/styleResolver.js | 3 +- .../src/exports/Switch/index.js | 3 +- .../src/exports/Text/TextPropTypes.js | 3 +- .../src/exports/Text/TextStylePropTypes.js | 3 +- .../src/exports/Text/index.js | 3 +- .../TextInput/TextInputStylePropTypes.js | 3 +- .../src/exports/TextInput/index.js | 3 +- .../exports/Touchable/BoundingDimensions.js | 3 +- .../src/exports/Touchable/Position.js | 3 +- .../Touchable/ensurePositiveDelayProps.js | 3 +- .../src/exports/Touchable/index.js | 3 +- .../src/exports/TouchableHighlight/index.js | 3 +- .../exports/TouchableNativeFeedback/index.js | 3 +- .../src/exports/TouchableOpacity/index.js | 3 +- .../exports/TouchableWithoutFeedback/index.js | 3 +- .../src/exports/UIManager/index.js | 3 +- .../src/exports/Vibration/index.js | 3 +- .../src/exports/View/ViewPropTypes.js | 3 +- .../src/exports/View/ViewStylePropTypes.js | 3 +- .../src/exports/createElement/index.js | 3 +- .../src/exports/findNodeHandle/index.js | 3 +- .../src/exports/processColor/index.js | 3 +- .../src/exports/render/index.js | 3 +- .../exports/unmountComponentAtNode/index.js | 3 +- .../src/modules/AccessibilityUtil/index.js | 3 +- .../modules/AccessibilityUtil/isDisabled.js | 3 +- .../propsToAccessibilityComponent.js | 3 +- .../AccessibilityUtil/propsToAriaRole.js | 3 +- .../AccessibilityUtil/propsToTabIndex.js | 3 +- .../src/modules/AnimationPropTypes/index.js | 3 +- .../src/modules/AssetRegistry/index.js | 6 +- .../src/modules/BorderPropTypes/index.js | 3 +- .../src/modules/ImageLoader/index.js | 3 +- .../src/modules/LayoutPropTypes/index.js | 3 +- .../src/modules/NativeEventEmitter/index.js | 6 +- .../src/modules/NativeMethodsMixin/index.js | 3 +- .../modules/ReactNativePropRegistry/index.js | 3 +- .../src/modules/ScrollResponder/index.js | 3 +- .../src/modules/ShadowPropTypes/index.js | 3 +- .../src/modules/StaticContainer/index.js | 3 +- .../src/modules/StaticRenderer/index.js | 3 +- .../src/modules/StyleSheetPropType/index.js | 3 +- .../src/modules/TextInputState/index.js | 3 +- .../src/modules/TransformPropTypes/index.js | 3 +- .../src/modules/UnimplementedView/index.js | 6 +- .../src/modules/applyLayout/index.js | 3 +- .../src/modules/applyNativeMethods/index.js | 3 +- .../src/modules/createDOMProps/index.js | 3 +- .../createStrictShapeTypeChecker/index.js | 6 +- .../src/modules/dismissKeyboard/index.js | 3 +- .../modules/ensureComponentIsNative/index.js | 3 +- .../src/modules/hydrate/index.js | 3 +- .../modules/multiplyStyleLengthValue/index.js | 3 +- .../src/modules/normalizeNativeEvent/index.js | 3 +- .../src/modules/prefixStyles/index.js | 3 +- .../src/modules/requestIdleCallback/index.js | 3 +- .../src/vendor/Animated/AnimatedEvent.js | 58 ++---- .../vendor/Animated/AnimatedImplementation.js | 187 ++++++++---------- .../src/vendor/Animated/Easing.js | 35 ++-- .../vendor/Animated/NativeAnimatedHelper.js | 82 +++----- .../src/vendor/Animated/SpringConfig.js | 41 ++-- .../vendor/Animated/animations/Animation.js | 14 +- .../Animated/animations/DecayAnimation.js | 30 ++- .../Animated/animations/SpringAnimation.js | 59 +++--- .../Animated/animations/TimingAnimation.js | 40 ++-- .../Animated/createAnimatedComponent.js | 27 +-- .../vendor/Animated/nodes/AnimatedAddition.js | 10 +- .../Animated/nodes/AnimatedDiffClamp.js | 10 +- .../vendor/Animated/nodes/AnimatedDivision.js | 10 +- .../Animated/nodes/AnimatedInterpolation.js | 56 +++--- .../vendor/Animated/nodes/AnimatedModulo.js | 14 +- .../Animated/nodes/AnimatedMultiplication.js | 10 +- .../src/vendor/Animated/nodes/AnimatedNode.js | 20 +- .../vendor/Animated/nodes/AnimatedProps.js | 40 ++-- .../vendor/Animated/nodes/AnimatedStyle.js | 10 +- .../vendor/Animated/nodes/AnimatedTracking.js | 14 +- .../Animated/nodes/AnimatedTransform.js | 12 +- .../vendor/Animated/nodes/AnimatedValue.js | 24 ++- .../vendor/Animated/nodes/AnimatedValueXY.js | 91 ++++----- .../Animated/nodes/AnimatedWithChildren.js | 15 +- .../src/vendor/PanResponder/index.js | 103 +++++----- .../src/vendor/PooledClass/index.js | 6 +- .../src/vendor/dangerousStyleValue/index.js | 6 +- .../src/vendor/setValueForStyles/index.js | 7 +- .../src/vendor/warnValidStyle/index.js | 8 +- types/fbjs.js | 6 +- .../1-components/View/examples/transforms.js | 17 +- 138 files changed, 562 insertions(+), 914 deletions(-) diff --git a/LICENSE b/LICENSE index d6a83ef9..7ba8a382 100644 --- a/LICENSE +++ b/LICENSE @@ -1,31 +1,22 @@ -BSD License +MIT License -For React Native software +Copyright (c) 2015-present, Nicolas Gallagher. +Copyright (c) 2015-present, Facebook, Inc. -Copyright (c) 2015-present, Nicolas Gallagher. All rights reserved. -Copyright (c) 2015-present, Facebook, Inc. All rights reserved. +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 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - * 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. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index a59c777a..6832e147 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,9 @@ relatively limited scope. This is a great place to get started. ## License -React Native for Web is [BSD licensed](./LICENSE). +React Native for Web is [MIT licensed](./LICENSE). By contributing to React +Native for Web, you agree that your contributions will be licensed under its +MIT license. [package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat [package-url]: https://yarnpkg.com/en/package/react-native-web diff --git a/package.json b/package.json index 9fdb7bf4..1e085443 100644 --- a/package.json +++ b/package.json @@ -69,5 +69,5 @@ "singleQuote": true }, "author": "Nicolas Gallagher", - "license": "BSD-3-Clause" + "license": "MIT" } diff --git a/packages/react-native-web/package.json b/packages/react-native-web/package.json index b5d88a40..ea428df1 100644 --- a/packages/react-native-web/package.json +++ b/packages/react-native-web/package.json @@ -27,7 +27,7 @@ "react-dom": "16.x.x" }, "author": "Nicolas Gallagher", - "license": "BSD-3-Clause", + "license": "MIT", "repository": { "type": "git", "url": "git://github.com/necolas/react-native-web.git" diff --git a/packages/react-native-web/src/exports/ActivityIndicator/index.js b/packages/react-native-web/src/exports/ActivityIndicator/index.js index 5d88e4b1..4994cbcc 100644 --- a/packages/react-native-web/src/exports/ActivityIndicator/index.js +++ b/packages/react-native-web/src/exports/ActivityIndicator/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ActivityIndicator diff --git a/packages/react-native-web/src/exports/Animated/index.js b/packages/react-native-web/src/exports/Animated/index.js index 06e7eb84..1b0fe4ad 100644 --- a/packages/react-native-web/src/exports/Animated/index.js +++ b/packages/react-native-web/src/exports/Animated/index.js @@ -1,10 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * 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. * * @providesModule Animated * @flow diff --git a/packages/react-native-web/src/exports/AppRegistry/AppContainer.js b/packages/react-native-web/src/exports/AppRegistry/AppContainer.js index fe44e1de..97a717b0 100644 --- a/packages/react-native-web/src/exports/AppRegistry/AppContainer.js +++ b/packages/react-native-web/src/exports/AppRegistry/AppContainer.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/AppRegistry/index.js b/packages/react-native-web/src/exports/AppRegistry/index.js index a90eb301..6aafc696 100644 --- a/packages/react-native-web/src/exports/AppRegistry/index.js +++ b/packages/react-native-web/src/exports/AppRegistry/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule AppRegistry diff --git a/packages/react-native-web/src/exports/AppRegistry/renderApplication.js b/packages/react-native-web/src/exports/AppRegistry/renderApplication.js index 44dd33fb..9673d86e 100644 --- a/packages/react-native-web/src/exports/AppRegistry/renderApplication.js +++ b/packages/react-native-web/src/exports/AppRegistry/renderApplication.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/AppState/index.js b/packages/react-native-web/src/exports/AppState/index.js index f3eef3d5..6b8ed029 100644 --- a/packages/react-native-web/src/exports/AppState/index.js +++ b/packages/react-native-web/src/exports/AppState/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule AppState diff --git a/packages/react-native-web/src/exports/AsyncStorage/index.js b/packages/react-native-web/src/exports/AsyncStorage/index.js index 10506a4f..c71e9809 100644 --- a/packages/react-native-web/src/exports/AsyncStorage/index.js +++ b/packages/react-native-web/src/exports/AsyncStorage/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule AsyncStorage diff --git a/packages/react-native-web/src/exports/BackHandler/index.js b/packages/react-native-web/src/exports/BackHandler/index.js index fb4542d0..d9553983 100644 --- a/packages/react-native-web/src/exports/BackHandler/index.js +++ b/packages/react-native-web/src/exports/BackHandler/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule BackHandler diff --git a/packages/react-native-web/src/exports/Button/index.js b/packages/react-native-web/src/exports/Button/index.js index 0af6cd52..f9914e5b 100644 --- a/packages/react-native-web/src/exports/Button/index.js +++ b/packages/react-native-web/src/exports/Button/index.js @@ -1,9 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Button diff --git a/packages/react-native-web/src/exports/CheckBox/index.js b/packages/react-native-web/src/exports/CheckBox/index.js index ffd6f5d2..cadc9ace 100644 --- a/packages/react-native-web/src/exports/CheckBox/index.js +++ b/packages/react-native-web/src/exports/CheckBox/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. * Copyright (c) 2017-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule CheckBox diff --git a/packages/react-native-web/src/exports/Clipboard/index.js b/packages/react-native-web/src/exports/Clipboard/index.js index 0f7c8357..03b9a0ba 100644 --- a/packages/react-native-web/src/exports/Clipboard/index.js +++ b/packages/react-native-web/src/exports/Clipboard/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Clipboard diff --git a/packages/react-native-web/src/exports/ColorPropType/index.js b/packages/react-native-web/src/exports/ColorPropType/index.js index a02ee868..379aed8f 100644 --- a/packages/react-native-web/src/exports/ColorPropType/index.js +++ b/packages/react-native-web/src/exports/ColorPropType/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule ColorPropType * @noflow diff --git a/packages/react-native-web/src/exports/Dimensions/index.js b/packages/react-native-web/src/exports/Dimensions/index.js index b32e9a35..4369bb1a 100644 --- a/packages/react-native-web/src/exports/Dimensions/index.js +++ b/packages/react-native-web/src/exports/Dimensions/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Dimensions diff --git a/packages/react-native-web/src/exports/Easing/index.js b/packages/react-native-web/src/exports/Easing/index.js index d004d3e6..26440c36 100644 --- a/packages/react-native-web/src/exports/Easing/index.js +++ b/packages/react-native-web/src/exports/Easing/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/EdgeInsetsPropType/index.js b/packages/react-native-web/src/exports/EdgeInsetsPropType/index.js index f0ef65e4..b85a6abe 100644 --- a/packages/react-native-web/src/exports/EdgeInsetsPropType/index.js +++ b/packages/react-native-web/src/exports/EdgeInsetsPropType/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule EdgeInsetsPropType * @flow diff --git a/packages/react-native-web/src/exports/I18nManager/index.js b/packages/react-native-web/src/exports/I18nManager/index.js index 7cfed3ad..195ffb50 100644 --- a/packages/react-native-web/src/exports/I18nManager/index.js +++ b/packages/react-native-web/src/exports/I18nManager/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule I18nManager diff --git a/packages/react-native-web/src/exports/Image/index.js b/packages/react-native-web/src/exports/Image/index.js index f1029143..9d7b8df0 100644 --- a/packages/react-native-web/src/exports/Image/index.js +++ b/packages/react-native-web/src/exports/Image/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Image diff --git a/packages/react-native-web/src/exports/ImageBackground/index.js b/packages/react-native-web/src/exports/ImageBackground/index.js index 63d6d015..38da8283 100644 --- a/packages/react-native-web/src/exports/ImageBackground/index.js +++ b/packages/react-native-web/src/exports/ImageBackground/index.js @@ -1,10 +1,8 @@ /** * 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. * * @flow */ diff --git a/packages/react-native-web/src/exports/InteractionManager/index.js b/packages/react-native-web/src/exports/InteractionManager/index.js index 6367f24e..e4a81d1d 100644 --- a/packages/react-native-web/src/exports/InteractionManager/index.js +++ b/packages/react-native-web/src/exports/InteractionManager/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule InteractionManager diff --git a/packages/react-native-web/src/exports/Keyboard/index.js b/packages/react-native-web/src/exports/Keyboard/index.js index f92d7ea9..21cd18e1 100644 --- a/packages/react-native-web/src/exports/Keyboard/index.js +++ b/packages/react-native-web/src/exports/Keyboard/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Keyboard diff --git a/packages/react-native-web/src/exports/KeyboardAvoidingView/index.js b/packages/react-native-web/src/exports/KeyboardAvoidingView/index.js index 1714ba3b..8289e25b 100644 --- a/packages/react-native-web/src/exports/KeyboardAvoidingView/index.js +++ b/packages/react-native-web/src/exports/KeyboardAvoidingView/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule KeyboardAvoidingView diff --git a/packages/react-native-web/src/exports/Linking/index.js b/packages/react-native-web/src/exports/Linking/index.js index 4871ba9f..0e363364 100644 --- a/packages/react-native-web/src/exports/Linking/index.js +++ b/packages/react-native-web/src/exports/Linking/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Linking diff --git a/packages/react-native-web/src/exports/NetInfo/index.js b/packages/react-native-web/src/exports/NetInfo/index.js index a7ad0835..2d3fb0a4 100644 --- a/packages/react-native-web/src/exports/NetInfo/index.js +++ b/packages/react-native-web/src/exports/NetInfo/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule NetInfo diff --git a/packages/react-native-web/src/exports/Picker/PickerItemPropType.js b/packages/react-native-web/src/exports/Picker/PickerItemPropType.js index 531a2bf0..aa3fa6a0 100644 --- a/packages/react-native-web/src/exports/Picker/PickerItemPropType.js +++ b/packages/react-native-web/src/exports/Picker/PickerItemPropType.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/Picker/PickerStylePropTypes.js b/packages/react-native-web/src/exports/Picker/PickerStylePropTypes.js index deb8c45d..baf202c5 100644 --- a/packages/react-native-web/src/exports/Picker/PickerStylePropTypes.js +++ b/packages/react-native-web/src/exports/Picker/PickerStylePropTypes.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/Picker/index.js b/packages/react-native-web/src/exports/Picker/index.js index 0b673098..dd6e00cf 100644 --- a/packages/react-native-web/src/exports/Picker/index.js +++ b/packages/react-native-web/src/exports/Picker/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Picker diff --git a/packages/react-native-web/src/exports/PixelRatio/index.js b/packages/react-native-web/src/exports/PixelRatio/index.js index 8ca51967..3201f3ef 100644 --- a/packages/react-native-web/src/exports/PixelRatio/index.js +++ b/packages/react-native-web/src/exports/PixelRatio/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule PixelRatio diff --git a/packages/react-native-web/src/exports/Platform/index.js b/packages/react-native-web/src/exports/Platform/index.js index fdc99f5a..13160e43 100644 --- a/packages/react-native-web/src/exports/Platform/index.js +++ b/packages/react-native-web/src/exports/Platform/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Platform diff --git a/packages/react-native-web/src/exports/PointPropType/index.js b/packages/react-native-web/src/exports/PointPropType/index.js index 9e4ac093..0139a088 100644 --- a/packages/react-native-web/src/exports/PointPropType/index.js +++ b/packages/react-native-web/src/exports/PointPropType/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule PointPropType * @flow diff --git a/packages/react-native-web/src/exports/ProgressBar/index.js b/packages/react-native-web/src/exports/ProgressBar/index.js index 8637fdba..5301a06c 100644 --- a/packages/react-native-web/src/exports/ProgressBar/index.js +++ b/packages/react-native-web/src/exports/ProgressBar/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ProgressBar diff --git a/packages/react-native-web/src/exports/RefreshControl/index.js b/packages/react-native-web/src/exports/RefreshControl/index.js index 871b960b..952b64d1 100644 --- a/packages/react-native-web/src/exports/RefreshControl/index.js +++ b/packages/react-native-web/src/exports/RefreshControl/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule RefreshControl diff --git a/packages/react-native-web/src/exports/SafeAreaView/index.js b/packages/react-native-web/src/exports/SafeAreaView/index.js index e959f4fa..decb5d67 100644 --- a/packages/react-native-web/src/exports/SafeAreaView/index.js +++ b/packages/react-native-web/src/exports/SafeAreaView/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule SafeAreaView * @flow diff --git a/packages/react-native-web/src/exports/ScrollView/ScrollViewBase.js b/packages/react-native-web/src/exports/ScrollView/ScrollViewBase.js index b53ebcf5..60e580c4 100644 --- a/packages/react-native-web/src/exports/ScrollView/ScrollViewBase.js +++ b/packages/react-native-web/src/exports/ScrollView/ScrollViewBase.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/ScrollView/index.js b/packages/react-native-web/src/exports/ScrollView/index.js index a29c775e..92562aa9 100644 --- a/packages/react-native-web/src/exports/ScrollView/index.js +++ b/packages/react-native-web/src/exports/ScrollView/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ScrollView diff --git a/packages/react-native-web/src/exports/StatusBar/index.js b/packages/react-native-web/src/exports/StatusBar/index.js index bc4cd964..0a639d53 100644 --- a/packages/react-native-web/src/exports/StatusBar/index.js +++ b/packages/react-native-web/src/exports/StatusBar/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule StatusBar diff --git a/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js b/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js index 55e33ea8..4b8d593e 100644 --- a/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js +++ b/packages/react-native-web/src/exports/StyleSheet/ReactNativeStyleResolver.js @@ -1,14 +1,15 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * + * @noflow + */ + +/** * WARNING: changes to this file in particular can cause significant changes to * the results of render performance benchmarks. - * - * @noflow */ import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment'; diff --git a/packages/react-native-web/src/exports/StyleSheet/StyleSheet.js b/packages/react-native-web/src/exports/StyleSheet/StyleSheet.js index 5c35aedf..68708917 100644 --- a/packages/react-native-web/src/exports/StyleSheet/StyleSheet.js +++ b/packages/react-native-web/src/exports/StyleSheet/StyleSheet.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule StyleSheet diff --git a/packages/react-native-web/src/exports/StyleSheet/StyleSheetManager.js b/packages/react-native-web/src/exports/StyleSheet/StyleSheetManager.js index 5afa4659..7cf65677 100644 --- a/packages/react-native-web/src/exports/StyleSheet/StyleSheetManager.js +++ b/packages/react-native-web/src/exports/StyleSheet/StyleSheetManager.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/StyleSheet/StyleSheetValidation.js b/packages/react-native-web/src/exports/StyleSheet/StyleSheetValidation.js index 4896a5a2..5a435bae 100644 --- a/packages/react-native-web/src/exports/StyleSheet/StyleSheetValidation.js +++ b/packages/react-native-web/src/exports/StyleSheet/StyleSheetValidation.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule StyleSheetValidation diff --git a/packages/react-native-web/src/exports/StyleSheet/WebStyleSheet.js b/packages/react-native-web/src/exports/StyleSheet/WebStyleSheet.js index 071eaeb2..ec93b100 100644 --- a/packages/react-native-web/src/exports/StyleSheet/WebStyleSheet.js +++ b/packages/react-native-web/src/exports/StyleSheet/WebStyleSheet.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/StyleSheet/__tests__/flattenStyle-test.js b/packages/react-native-web/src/exports/StyleSheet/__tests__/flattenStyle-test.js index 81352ed3..0fb21a3b 100644 --- a/packages/react-native-web/src/exports/StyleSheet/__tests__/flattenStyle-test.js +++ b/packages/react-native-web/src/exports/StyleSheet/__tests__/flattenStyle-test.js @@ -2,11 +2,9 @@ /** * 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. */ import flattenStyle from '../flattenStyle'; diff --git a/packages/react-native-web/src/exports/StyleSheet/createReactDOMStyle.js b/packages/react-native-web/src/exports/StyleSheet/createReactDOMStyle.js index 30635611..33d7a534 100644 --- a/packages/react-native-web/src/exports/StyleSheet/createReactDOMStyle.js +++ b/packages/react-native-web/src/exports/StyleSheet/createReactDOMStyle.js @@ -1,10 +1,16 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * + * @noflow + */ + +import normalizeValue from './normalizeValue'; +import processColor from '../processColor'; + +/** * The browser implements the CSS cascade, where the order of properties is a * factor in determining which styles to paint. React Native is different. It * gives giving precedence to the more specific style property. For example, @@ -13,13 +19,8 @@ * This module creates mutally exclusive style declarations by expanding all of * React Native's supported shortform properties (e.g. `padding`) to their * longfrom equivalents. - * - * @noflow */ -import normalizeValue from './normalizeValue'; -import processColor from '../processColor'; - const emptyObject = {}; const styleShortFormProperties = { borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'], diff --git a/packages/react-native-web/src/exports/StyleSheet/createRuleBlock.js b/packages/react-native-web/src/exports/StyleSheet/createRuleBlock.js index 92b6457b..34e5b5c3 100644 --- a/packages/react-native-web/src/exports/StyleSheet/createRuleBlock.js +++ b/packages/react-native-web/src/exports/StyleSheet/createRuleBlock.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/StyleSheet/flattenStyle.js b/packages/react-native-web/src/exports/StyleSheet/flattenStyle.js index 518b64b1..89fb7b1d 100644 --- a/packages/react-native-web/src/exports/StyleSheet/flattenStyle.js +++ b/packages/react-native-web/src/exports/StyleSheet/flattenStyle.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule flattenStyle diff --git a/packages/react-native-web/src/exports/StyleSheet/i18nStyle.js b/packages/react-native-web/src/exports/StyleSheet/i18nStyle.js index 6a363d82..b24ea38f 100644 --- a/packages/react-native-web/src/exports/StyleSheet/i18nStyle.js +++ b/packages/react-native-web/src/exports/StyleSheet/i18nStyle.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/StyleSheet/initialRules.js b/packages/react-native-web/src/exports/StyleSheet/initialRules.js index 100245bd..ebb289af 100644 --- a/packages/react-native-web/src/exports/StyleSheet/initialRules.js +++ b/packages/react-native-web/src/exports/StyleSheet/initialRules.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/StyleSheet/normalizeValue.js b/packages/react-native-web/src/exports/StyleSheet/normalizeValue.js index 281ebf85..72b367b8 100644 --- a/packages/react-native-web/src/exports/StyleSheet/normalizeValue.js +++ b/packages/react-native-web/src/exports/StyleSheet/normalizeValue.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/StyleSheet/styleResolver.js b/packages/react-native-web/src/exports/StyleSheet/styleResolver.js index 58dc8f78..44856dc3 100644 --- a/packages/react-native-web/src/exports/StyleSheet/styleResolver.js +++ b/packages/react-native-web/src/exports/StyleSheet/styleResolver.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/Switch/index.js b/packages/react-native-web/src/exports/Switch/index.js index 8d7c060d..b2cfa553 100644 --- a/packages/react-native-web/src/exports/Switch/index.js +++ b/packages/react-native-web/src/exports/Switch/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Switch diff --git a/packages/react-native-web/src/exports/Text/TextPropTypes.js b/packages/react-native-web/src/exports/Text/TextPropTypes.js index 232bf978..75ca651e 100644 --- a/packages/react-native-web/src/exports/Text/TextPropTypes.js +++ b/packages/react-native-web/src/exports/Text/TextPropTypes.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TextPropTypes diff --git a/packages/react-native-web/src/exports/Text/TextStylePropTypes.js b/packages/react-native-web/src/exports/Text/TextStylePropTypes.js index f56c4278..3867fcdf 100644 --- a/packages/react-native-web/src/exports/Text/TextStylePropTypes.js +++ b/packages/react-native-web/src/exports/Text/TextStylePropTypes.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/Text/index.js b/packages/react-native-web/src/exports/Text/index.js index fdd68a88..c3d081c0 100644 --- a/packages/react-native-web/src/exports/Text/index.js +++ b/packages/react-native-web/src/exports/Text/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Text diff --git a/packages/react-native-web/src/exports/TextInput/TextInputStylePropTypes.js b/packages/react-native-web/src/exports/TextInput/TextInputStylePropTypes.js index b32b7fcf..1d16e2f8 100644 --- a/packages/react-native-web/src/exports/TextInput/TextInputStylePropTypes.js +++ b/packages/react-native-web/src/exports/TextInput/TextInputStylePropTypes.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/TextInput/index.js b/packages/react-native-web/src/exports/TextInput/index.js index 995e4d88..f41fc2b4 100644 --- a/packages/react-native-web/src/exports/TextInput/index.js +++ b/packages/react-native-web/src/exports/TextInput/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TextInput diff --git a/packages/react-native-web/src/exports/Touchable/BoundingDimensions.js b/packages/react-native-web/src/exports/Touchable/BoundingDimensions.js index f7547b0a..a22a8063 100644 --- a/packages/react-native-web/src/exports/Touchable/BoundingDimensions.js +++ b/packages/react-native-web/src/exports/Touchable/BoundingDimensions.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/Touchable/Position.js b/packages/react-native-web/src/exports/Touchable/Position.js index 209afdae..1cb5012e 100644 --- a/packages/react-native-web/src/exports/Touchable/Position.js +++ b/packages/react-native-web/src/exports/Touchable/Position.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/Touchable/ensurePositiveDelayProps.js b/packages/react-native-web/src/exports/Touchable/ensurePositiveDelayProps.js index f5a32a16..b228c23c 100644 --- a/packages/react-native-web/src/exports/Touchable/ensurePositiveDelayProps.js +++ b/packages/react-native-web/src/exports/Touchable/ensurePositiveDelayProps.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ensurePositiveDelayProps diff --git a/packages/react-native-web/src/exports/Touchable/index.js b/packages/react-native-web/src/exports/Touchable/index.js index 13ba5873..82a12258 100644 --- a/packages/react-native-web/src/exports/Touchable/index.js +++ b/packages/react-native-web/src/exports/Touchable/index.js @@ -3,9 +3,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Touchable diff --git a/packages/react-native-web/src/exports/TouchableHighlight/index.js b/packages/react-native-web/src/exports/TouchableHighlight/index.js index 5a9dea6f..67accb9b 100644 --- a/packages/react-native-web/src/exports/TouchableHighlight/index.js +++ b/packages/react-native-web/src/exports/TouchableHighlight/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TouchableHighlight diff --git a/packages/react-native-web/src/exports/TouchableNativeFeedback/index.js b/packages/react-native-web/src/exports/TouchableNativeFeedback/index.js index 8c1d99f9..f8af6ff4 100644 --- a/packages/react-native-web/src/exports/TouchableNativeFeedback/index.js +++ b/packages/react-native-web/src/exports/TouchableNativeFeedback/index.js @@ -1,8 +1,7 @@ /** * Copyright 2017-present, Nicolas Gallagher - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/TouchableOpacity/index.js b/packages/react-native-web/src/exports/TouchableOpacity/index.js index 940ca76f..39ee304e 100644 --- a/packages/react-native-web/src/exports/TouchableOpacity/index.js +++ b/packages/react-native-web/src/exports/TouchableOpacity/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TouchableOpacity diff --git a/packages/react-native-web/src/exports/TouchableWithoutFeedback/index.js b/packages/react-native-web/src/exports/TouchableWithoutFeedback/index.js index 2d3d0072..e98dd0cb 100644 --- a/packages/react-native-web/src/exports/TouchableWithoutFeedback/index.js +++ b/packages/react-native-web/src/exports/TouchableWithoutFeedback/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TouchableWithoutFeedback diff --git a/packages/react-native-web/src/exports/UIManager/index.js b/packages/react-native-web/src/exports/UIManager/index.js index 842b963a..381245bd 100644 --- a/packages/react-native-web/src/exports/UIManager/index.js +++ b/packages/react-native-web/src/exports/UIManager/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule UIManager diff --git a/packages/react-native-web/src/exports/Vibration/index.js b/packages/react-native-web/src/exports/Vibration/index.js index 2504cb4e..b97cdf75 100644 --- a/packages/react-native-web/src/exports/Vibration/index.js +++ b/packages/react-native-web/src/exports/Vibration/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule Vibration diff --git a/packages/react-native-web/src/exports/View/ViewPropTypes.js b/packages/react-native-web/src/exports/View/ViewPropTypes.js index 8bd2fc68..8daf06bf 100644 --- a/packages/react-native-web/src/exports/View/ViewPropTypes.js +++ b/packages/react-native-web/src/exports/View/ViewPropTypes.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ViewPropTypes diff --git a/packages/react-native-web/src/exports/View/ViewStylePropTypes.js b/packages/react-native-web/src/exports/View/ViewStylePropTypes.js index 59d2ca8e..d48ef3f2 100644 --- a/packages/react-native-web/src/exports/View/ViewStylePropTypes.js +++ b/packages/react-native-web/src/exports/View/ViewStylePropTypes.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/exports/createElement/index.js b/packages/react-native-web/src/exports/createElement/index.js index 72868a19..f726eff6 100644 --- a/packages/react-native-web/src/exports/createElement/index.js +++ b/packages/react-native-web/src/exports/createElement/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/findNodeHandle/index.js b/packages/react-native-web/src/exports/findNodeHandle/index.js index 9c8c263a..d3ce9adb 100644 --- a/packages/react-native-web/src/exports/findNodeHandle/index.js +++ b/packages/react-native-web/src/exports/findNodeHandle/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule findNodeHandle diff --git a/packages/react-native-web/src/exports/processColor/index.js b/packages/react-native-web/src/exports/processColor/index.js index 7c90d57a..0ec46c8d 100644 --- a/packages/react-native-web/src/exports/processColor/index.js +++ b/packages/react-native-web/src/exports/processColor/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule processColor diff --git a/packages/react-native-web/src/exports/render/index.js b/packages/react-native-web/src/exports/render/index.js index e1b3a284..fc183aa3 100644 --- a/packages/react-native-web/src/exports/render/index.js +++ b/packages/react-native-web/src/exports/render/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/exports/unmountComponentAtNode/index.js b/packages/react-native-web/src/exports/unmountComponentAtNode/index.js index 9b19d6b8..2907a858 100644 --- a/packages/react-native-web/src/exports/unmountComponentAtNode/index.js +++ b/packages/react-native-web/src/exports/unmountComponentAtNode/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/AccessibilityUtil/index.js b/packages/react-native-web/src/modules/AccessibilityUtil/index.js index 3fcf3ff8..114977d1 100644 --- a/packages/react-native-web/src/modules/AccessibilityUtil/index.js +++ b/packages/react-native-web/src/modules/AccessibilityUtil/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/AccessibilityUtil/isDisabled.js b/packages/react-native-web/src/modules/AccessibilityUtil/isDisabled.js index 306fb2fd..6330d6a4 100644 --- a/packages/react-native-web/src/modules/AccessibilityUtil/isDisabled.js +++ b/packages/react-native-web/src/modules/AccessibilityUtil/isDisabled.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js b/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js index c6fb31c4..6b70f0e6 100644 --- a/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js +++ b/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js b/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js index 2e1c7605..bfc67e60 100644 --- a/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js +++ b/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/AccessibilityUtil/propsToTabIndex.js b/packages/react-native-web/src/modules/AccessibilityUtil/propsToTabIndex.js index 9edfe5e9..5631812f 100644 --- a/packages/react-native-web/src/modules/AccessibilityUtil/propsToTabIndex.js +++ b/packages/react-native-web/src/modules/AccessibilityUtil/propsToTabIndex.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/AnimationPropTypes/index.js b/packages/react-native-web/src/modules/AnimationPropTypes/index.js index d4285230..fe2b2d05 100644 --- a/packages/react-native-web/src/modules/AnimationPropTypes/index.js +++ b/packages/react-native-web/src/modules/AnimationPropTypes/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2017-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/AssetRegistry/index.js b/packages/react-native-web/src/modules/AssetRegistry/index.js index 8231631d..c761a066 100644 --- a/packages/react-native-web/src/modules/AssetRegistry/index.js +++ b/packages/react-native-web/src/modules/AssetRegistry/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AssetRegistry * @flow diff --git a/packages/react-native-web/src/modules/BorderPropTypes/index.js b/packages/react-native-web/src/modules/BorderPropTypes/index.js index e6c3290c..5ce1922d 100644 --- a/packages/react-native-web/src/modules/BorderPropTypes/index.js +++ b/packages/react-native-web/src/modules/BorderPropTypes/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/ImageLoader/index.js b/packages/react-native-web/src/modules/ImageLoader/index.js index 7ff0c58d..314a2ba9 100644 --- a/packages/react-native-web/src/modules/ImageLoader/index.js +++ b/packages/react-native-web/src/modules/ImageLoader/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/LayoutPropTypes/index.js b/packages/react-native-web/src/modules/LayoutPropTypes/index.js index 3a256524..5cb570ee 100644 --- a/packages/react-native-web/src/modules/LayoutPropTypes/index.js +++ b/packages/react-native-web/src/modules/LayoutPropTypes/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/NativeEventEmitter/index.js b/packages/react-native-web/src/modules/NativeEventEmitter/index.js index c716b9a3..b6aba905 100644 --- a/packages/react-native-web/src/modules/NativeEventEmitter/index.js +++ b/packages/react-native-web/src/modules/NativeEventEmitter/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule NativeEventEmitter * @noflow diff --git a/packages/react-native-web/src/modules/NativeMethodsMixin/index.js b/packages/react-native-web/src/modules/NativeMethodsMixin/index.js index 1e59b32a..770b0573 100644 --- a/packages/react-native-web/src/modules/NativeMethodsMixin/index.js +++ b/packages/react-native-web/src/modules/NativeMethodsMixin/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule NativeMethodsMixin diff --git a/packages/react-native-web/src/modules/ReactNativePropRegistry/index.js b/packages/react-native-web/src/modules/ReactNativePropRegistry/index.js index 8f1b049e..dab84d4b 100644 --- a/packages/react-native-web/src/modules/ReactNativePropRegistry/index.js +++ b/packages/react-native-web/src/modules/ReactNativePropRegistry/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ReactNativePropRegistry diff --git a/packages/react-native-web/src/modules/ScrollResponder/index.js b/packages/react-native-web/src/modules/ScrollResponder/index.js index 46a319dc..3a777ded 100644 --- a/packages/react-native-web/src/modules/ScrollResponder/index.js +++ b/packages/react-native-web/src/modules/ScrollResponder/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ScrollResponder diff --git a/packages/react-native-web/src/modules/ShadowPropTypes/index.js b/packages/react-native-web/src/modules/ShadowPropTypes/index.js index 66e0f364..e0efb4d6 100644 --- a/packages/react-native-web/src/modules/ShadowPropTypes/index.js +++ b/packages/react-native-web/src/modules/ShadowPropTypes/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/StaticContainer/index.js b/packages/react-native-web/src/modules/StaticContainer/index.js index 813bd211..8a5d94ed 100644 --- a/packages/react-native-web/src/modules/StaticContainer/index.js +++ b/packages/react-native-web/src/modules/StaticContainer/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule StaticContainer diff --git a/packages/react-native-web/src/modules/StaticRenderer/index.js b/packages/react-native-web/src/modules/StaticRenderer/index.js index a87adb0a..65056eb5 100644 --- a/packages/react-native-web/src/modules/StaticRenderer/index.js +++ b/packages/react-native-web/src/modules/StaticRenderer/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule StaticRenderer diff --git a/packages/react-native-web/src/modules/StyleSheetPropType/index.js b/packages/react-native-web/src/modules/StyleSheetPropType/index.js index 4582e568..bfb77664 100644 --- a/packages/react-native-web/src/modules/StyleSheetPropType/index.js +++ b/packages/react-native-web/src/modules/StyleSheetPropType/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule StyleSheetPropType diff --git a/packages/react-native-web/src/modules/TextInputState/index.js b/packages/react-native-web/src/modules/TextInputState/index.js index 2f2b160d..bcc542d8 100644 --- a/packages/react-native-web/src/modules/TextInputState/index.js +++ b/packages/react-native-web/src/modules/TextInputState/index.js @@ -1,9 +1,8 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TextInputState diff --git a/packages/react-native-web/src/modules/TransformPropTypes/index.js b/packages/react-native-web/src/modules/TransformPropTypes/index.js index 7734de97..f80eb007 100644 --- a/packages/react-native-web/src/modules/TransformPropTypes/index.js +++ b/packages/react-native-web/src/modules/TransformPropTypes/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule TransformPropTypes diff --git a/packages/react-native-web/src/modules/UnimplementedView/index.js b/packages/react-native-web/src/modules/UnimplementedView/index.js index 2b44f8e9..09df72d0 100644 --- a/packages/react-native-web/src/modules/UnimplementedView/index.js +++ b/packages/react-native-web/src/modules/UnimplementedView/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule UnimplementedView * @flow diff --git a/packages/react-native-web/src/modules/applyLayout/index.js b/packages/react-native-web/src/modules/applyLayout/index.js index 2e170253..ecfbd669 100644 --- a/packages/react-native-web/src/modules/applyLayout/index.js +++ b/packages/react-native-web/src/modules/applyLayout/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/applyNativeMethods/index.js b/packages/react-native-web/src/modules/applyNativeMethods/index.js index d70c431e..337e495a 100644 --- a/packages/react-native-web/src/modules/applyNativeMethods/index.js +++ b/packages/react-native-web/src/modules/applyNativeMethods/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/createDOMProps/index.js b/packages/react-native-web/src/modules/createDOMProps/index.js index 22b83ae9..934c0650 100644 --- a/packages/react-native-web/src/modules/createDOMProps/index.js +++ b/packages/react-native-web/src/modules/createDOMProps/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/createStrictShapeTypeChecker/index.js b/packages/react-native-web/src/modules/createStrictShapeTypeChecker/index.js index b25811e7..7bc870aa 100644 --- a/packages/react-native-web/src/modules/createStrictShapeTypeChecker/index.js +++ b/packages/react-native-web/src/modules/createStrictShapeTypeChecker/index.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule createStrictShapeTypeChecker * @flow diff --git a/packages/react-native-web/src/modules/dismissKeyboard/index.js b/packages/react-native-web/src/modules/dismissKeyboard/index.js index c527f503..479de5cf 100644 --- a/packages/react-native-web/src/modules/dismissKeyboard/index.js +++ b/packages/react-native-web/src/modules/dismissKeyboard/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule dismissKeyboard diff --git a/packages/react-native-web/src/modules/ensureComponentIsNative/index.js b/packages/react-native-web/src/modules/ensureComponentIsNative/index.js index a3599616..fd018c6d 100644 --- a/packages/react-native-web/src/modules/ensureComponentIsNative/index.js +++ b/packages/react-native-web/src/modules/ensureComponentIsNative/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule ensureComponentIsNative diff --git a/packages/react-native-web/src/modules/hydrate/index.js b/packages/react-native-web/src/modules/hydrate/index.js index 5062302f..b869d5d8 100644 --- a/packages/react-native-web/src/modules/hydrate/index.js +++ b/packages/react-native-web/src/modules/hydrate/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2016-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/multiplyStyleLengthValue/index.js b/packages/react-native-web/src/modules/multiplyStyleLengthValue/index.js index 8ac32208..92f19a06 100644 --- a/packages/react-native-web/src/modules/multiplyStyleLengthValue/index.js +++ b/packages/react-native-web/src/modules/multiplyStyleLengthValue/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noflow diff --git a/packages/react-native-web/src/modules/normalizeNativeEvent/index.js b/packages/react-native-web/src/modules/normalizeNativeEvent/index.js index 5c855f7c..fbd5d2c2 100644 --- a/packages/react-native-web/src/modules/normalizeNativeEvent/index.js +++ b/packages/react-native-web/src/modules/normalizeNativeEvent/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/prefixStyles/index.js b/packages/react-native-web/src/modules/prefixStyles/index.js index d3b47440..5d3096e0 100644 --- a/packages/react-native-web/src/modules/prefixStyles/index.js +++ b/packages/react-native-web/src/modules/prefixStyles/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/modules/requestIdleCallback/index.js b/packages/react-native-web/src/modules/requestIdleCallback/index.js index f1c170f7..693dea48 100644 --- a/packages/react-native-web/src/modules/requestIdleCallback/index.js +++ b/packages/react-native-web/src/modules/requestIdleCallback/index.js @@ -1,8 +1,7 @@ /** * Copyright (c) 2015-present, Nicolas Gallagher. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the + * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow diff --git a/packages/react-native-web/src/vendor/Animated/AnimatedEvent.js b/packages/react-native-web/src/vendor/Animated/AnimatedEvent.js index 126edf8d..e063f02d 100644 --- a/packages/react-native-web/src/vendor/Animated/AnimatedEvent.js +++ b/packages/react-native-web/src/vendor/Animated/AnimatedEvent.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedEvent * @noflow @@ -17,19 +15,15 @@ const NativeAnimatedHelper = require('./NativeAnimatedHelper'); const findNodeHandle = require('../../exports/findNodeHandle').default; const invariant = require('fbjs/lib/invariant'); -const {shouldUseNativeDriver} = require('./NativeAnimatedHelper'); +const { shouldUseNativeDriver } = require('./NativeAnimatedHelper'); -export type Mapping = {[key: string]: Mapping} | AnimatedValue; +export type Mapping = { [key: string]: Mapping } | AnimatedValue; export type EventConfig = { listener?: ?Function, - useNativeDriver?: boolean, + useNativeDriver?: boolean }; -function attachNativeEvent( - viewRef: any, - eventName: string, - argMapping: Array, -) { +function attachNativeEvent(viewRef: any, eventName: string, argMapping: Array) { // Find animated values in `argMapping` and create an array representing their // key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x']. const eventMappings = []; @@ -40,7 +34,7 @@ function attachNativeEvent( eventMappings.push({ nativeEventPath: path, - animatedValueTag: value.__getNativeTag(), + animatedValueTag: value.__getNativeTag() }); } else if (typeof value === 'object') { for (const key in value) { @@ -51,7 +45,7 @@ function attachNativeEvent( invariant( argMapping[0] && argMapping[0].nativeEvent, - 'Native driven events only support animated values contained inside `nativeEvent`.', + 'Native driven events only support animated values contained inside `nativeEvent`.' ); // Assume that the event containing `nativeEvent` is always the first argument. @@ -60,11 +54,7 @@ function attachNativeEvent( const viewTag = findNodeHandle(viewRef); eventMappings.forEach(mapping => { - NativeAnimatedHelper.API.addAnimatedEventToView( - viewTag, - eventName, - mapping, - ); + NativeAnimatedHelper.API.addAnimatedEventToView(viewTag, eventName, mapping); }); return { @@ -73,10 +63,10 @@ function attachNativeEvent( NativeAnimatedHelper.API.removeAnimatedEventFromView( viewTag, eventName, - mapping.animatedValueTag, + mapping.animatedValueTag ); }); - }, + } }; } @@ -85,7 +75,7 @@ class AnimatedEvent { _listeners: Array = []; _callListeners: Function; _attachedEvent: ?{ - detach: () => void, + detach: () => void }; __isNative: boolean; @@ -112,23 +102,13 @@ class AnimatedEvent { } __attach(viewRef: any, eventName: string) { - invariant( - this.__isNative, - 'Only native driven events need to be attached.', - ); + invariant(this.__isNative, 'Only native driven events need to be attached.'); - this._attachedEvent = attachNativeEvent( - viewRef, - eventName, - this._argMapping, - ); + this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping); } __detach(viewTag: any, eventName: string) { - invariant( - this.__isNative, - 'Only native driven events need to be detached.', - ); + invariant(this.__isNative, 'Only native driven events need to be detached.'); this._attachedEvent && this._attachedEvent.detach(); } @@ -174,17 +154,17 @@ class AnimatedEvent { typeof recMapping + ' for key ' + key + - ', event value must map to AnimatedValue', + ', event value must map to AnimatedValue' ); return; } invariant( typeof recMapping === 'object', - 'Bad mapping of type ' + typeof recMapping + ' for key ' + key, + 'Bad mapping of type ' + typeof recMapping + ' for key ' + key ); invariant( typeof recEvt === 'object', - 'Bad event of type ' + typeof recEvt + ' for key ' + key, + 'Bad event of type ' + typeof recEvt + ' for key ' + key ); for (const mappingKey in recMapping) { traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey); @@ -193,4 +173,4 @@ class AnimatedEvent { } } -module.exports = {AnimatedEvent, attachNativeEvent}; +module.exports = { AnimatedEvent, attachNativeEvent }; diff --git a/packages/react-native-web/src/vendor/Animated/AnimatedImplementation.js b/packages/react-native-web/src/vendor/Animated/AnimatedImplementation.js index ef566927..30a3e7eb 100644 --- a/packages/react-native-web/src/vendor/Animated/AnimatedImplementation.js +++ b/packages/react-native-web/src/vendor/Animated/AnimatedImplementation.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedImplementation * @flow @@ -13,7 +11,7 @@ */ 'use strict'; -const {AnimatedEvent, attachNativeEvent} = require('./AnimatedEvent'); +const { AnimatedEvent, attachNativeEvent } = require('./AnimatedEvent'); const AnimatedAddition = require('./nodes/AnimatedAddition'); const AnimatedDiffClamp = require('./nodes/AnimatedDiffClamp'); const AnimatedDivision = require('./nodes/AnimatedDivision'); @@ -31,41 +29,31 @@ const TimingAnimation = require('./animations/TimingAnimation'); const createAnimatedComponent = require('./createAnimatedComponent'); -import type { - AnimationConfig, - EndCallback, - EndResult, -} from './animations/Animation'; -import type {TimingAnimationConfig} from './animations/TimingAnimation'; -import type {DecayAnimationConfig} from './animations/DecayAnimation'; -import type {SpringAnimationConfig} from './animations/SpringAnimation'; -import type {Mapping, EventConfig} from './AnimatedEvent'; +import type { AnimationConfig, EndCallback, EndResult } from './animations/Animation'; +import type { TimingAnimationConfig } from './animations/TimingAnimation'; +import type { DecayAnimationConfig } from './animations/DecayAnimation'; +import type { SpringAnimationConfig } from './animations/SpringAnimation'; +import type { Mapping, EventConfig } from './AnimatedEvent'; type CompositeAnimation = { start: (callback?: ?EndCallback) => void, stop: () => void, reset: () => void, _startNativeLoop: (iterations?: number) => void, - _isUsingNativeDriver: () => boolean, + _isUsingNativeDriver: () => boolean }; -const add = function( - a: AnimatedNode | number, - b: AnimatedNode | number, -): AnimatedAddition { +const add = function(a: AnimatedNode | number, b: AnimatedNode | number): AnimatedAddition { return new AnimatedAddition(a, b); }; -const divide = function( - a: AnimatedNode | number, - b: AnimatedNode | number, -): AnimatedDivision { +const divide = function(a: AnimatedNode | number, b: AnimatedNode | number): AnimatedDivision { return new AnimatedDivision(a, b); }; const multiply = function( a: AnimatedNode | number, - b: AnimatedNode | number, + b: AnimatedNode | number ): AnimatedMultiplication { return new AnimatedMultiplication(a, b); }; @@ -74,18 +62,11 @@ const modulo = function(a: AnimatedNode, modulus: number): AnimatedModulo { return new AnimatedModulo(a, modulus); }; -const diffClamp = function( - a: AnimatedNode, - min: number, - max: number, -): AnimatedDiffClamp { +const diffClamp = function(a: AnimatedNode, min: number, max: number): AnimatedDiffClamp { return new AnimatedDiffClamp(a, min, max); }; -const _combineCallbacks = function( - callback: ?EndCallback, - config: AnimationConfig, -) { +const _combineCallbacks = function(callback: ?EndCallback, config: AnimationConfig) { if (callback && config.onComplete) { return (...args) => { config.onComplete && config.onComplete(...args); @@ -99,13 +80,13 @@ const _combineCallbacks = function( const maybeVectorAnim = function( value: AnimatedValue | AnimatedValueXY, config: Object, - anim: (value: AnimatedValue, config: Object) => CompositeAnimation, + anim: (value: AnimatedValue, config: Object) => CompositeAnimation ): ?CompositeAnimation { if (value instanceof AnimatedValueXY) { - const configX = {...config}; - const configY = {...config}; + const configX = { ...config }; + const configY = { ...config }; for (const key in config) { - const {x, y} = config[key]; + const { x, y } = config[key]; if (x !== undefined && y !== undefined) { configX[key] = x; configY[key] = y; @@ -115,19 +96,19 @@ const maybeVectorAnim = function( const aY = anim((value: AnimatedValueXY).y, configY); // We use `stopTogether: false` here because otherwise tracking will break // because the second animation will get stopped before it can update. - return parallel([aX, aY], {stopTogether: false}); + return parallel([aX, aY], { stopTogether: false }); } return null; }; const spring = function( value: AnimatedValue | AnimatedValueXY, - config: SpringAnimationConfig, + config: SpringAnimationConfig ): CompositeAnimation { const start = function( animatedValue: AnimatedValue | AnimatedValueXY, configuration: SpringAnimationConfig, - callback?: ?EndCallback, + callback?: ?EndCallback ): void { callback = _combineCallbacks(callback, configuration); const singleValue: any = animatedValue; @@ -140,8 +121,8 @@ const spring = function( configuration.toValue, SpringAnimation, singleConfig, - callback, - ), + callback + ) ); } else { singleValue.animate(new SpringAnimation(singleConfig), callback); @@ -162,25 +143,25 @@ const spring = function( }, _startNativeLoop: function(iterations?: number): void { - const singleConfig = {...config, iterations}; + const singleConfig = { ...config, iterations }; start(value, singleConfig); }, _isUsingNativeDriver: function(): boolean { return config.useNativeDriver || false; - }, + } } ); }; const timing = function( value: AnimatedValue | AnimatedValueXY, - config: TimingAnimationConfig, + config: TimingAnimationConfig ): CompositeAnimation { const start = function( animatedValue: AnimatedValue | AnimatedValueXY, configuration: TimingAnimationConfig, - callback?: ?EndCallback, + callback?: ?EndCallback ): void { callback = _combineCallbacks(callback, configuration); const singleValue: any = animatedValue; @@ -193,8 +174,8 @@ const timing = function( configuration.toValue, TimingAnimation, singleConfig, - callback, - ), + callback + ) ); } else { singleValue.animate(new TimingAnimation(singleConfig), callback); @@ -216,25 +197,25 @@ const timing = function( }, _startNativeLoop: function(iterations?: number): void { - const singleConfig = {...config, iterations}; + const singleConfig = { ...config, iterations }; start(value, singleConfig); }, _isUsingNativeDriver: function(): boolean { return config.useNativeDriver || false; - }, + } } ); }; const decay = function( value: AnimatedValue | AnimatedValueXY, - config: DecayAnimationConfig, + config: DecayAnimationConfig ): CompositeAnimation { const start = function( animatedValue: AnimatedValue | AnimatedValueXY, configuration: DecayAnimationConfig, - callback?: ?EndCallback, + callback?: ?EndCallback ): void { callback = _combineCallbacks(callback, configuration); const singleValue: any = animatedValue; @@ -258,20 +239,18 @@ const decay = function( }, _startNativeLoop: function(iterations?: number): void { - const singleConfig = {...config, iterations}; + const singleConfig = { ...config, iterations }; start(value, singleConfig); }, _isUsingNativeDriver: function(): boolean { return config.useNativeDriver || false; - }, + } } ); }; -const sequence = function( - animations: Array, -): CompositeAnimation { +const sequence = function(animations: Array): CompositeAnimation { let current = 0; return { start: function(callback?: ?EndCallback) { @@ -292,7 +271,7 @@ const sequence = function( }; if (animations.length === 0) { - callback && callback({finished: true}); + callback && callback({ finished: true }); } else { animations[current].start(onComplete); } @@ -315,22 +294,22 @@ const sequence = function( _startNativeLoop: function() { throw new Error( - 'Loops run using the native driver cannot contain Animated.sequence animations', + 'Loops run using the native driver cannot contain Animated.sequence animations' ); }, _isUsingNativeDriver: function(): boolean { return false; - }, + } }; }; type ParallelConfig = { - stopTogether?: boolean, // If one is stopped, stop all. default: true + stopTogether?: boolean // If one is stopped, stop all. default: true }; const parallel = function( animations: Array, - config?: ?ParallelConfig, + config?: ?ParallelConfig ): CompositeAnimation { let doneCount = 0; // Make sure we only call stop() at most once for each animation @@ -340,7 +319,7 @@ const parallel = function( const result = { start: function(callback?: ?EndCallback) { if (doneCount === animations.length) { - callback && callback({finished: true}); + callback && callback({ finished: true }); return; } @@ -360,7 +339,7 @@ const parallel = function( }; if (!animation) { - cb({finished: true}); + cb({ finished: true }); } else { animation.start(cb); } @@ -384,13 +363,13 @@ const parallel = function( _startNativeLoop: function() { throw new Error( - 'Loops run using the native driver cannot contain Animated.parallel animations', + 'Loops run using the native driver cannot contain Animated.parallel animations' ); }, _isUsingNativeDriver: function(): boolean { return false; - }, + } }; return result; @@ -398,36 +377,29 @@ const parallel = function( const delay = function(time: number): CompositeAnimation { // Would be nice to make a specialized implementation - return timing(new AnimatedValue(0), {toValue: 0, delay: time, duration: 0}); + return timing(new AnimatedValue(0), { toValue: 0, delay: time, duration: 0 }); }; -const stagger = function( - time: number, - animations: Array, -): CompositeAnimation { +const stagger = function(time: number, animations: Array): CompositeAnimation { return parallel( animations.map((animation, i) => { return sequence([delay(time * i), animation]); - }), + }) ); }; -type LoopAnimationConfig = {iterations: number}; +type LoopAnimationConfig = { iterations: number }; const loop = function( animation: CompositeAnimation, - {iterations = -1}: LoopAnimationConfig = {}, + { iterations = -1 }: LoopAnimationConfig = {} ): CompositeAnimation { let isFinished = false; let iterationsSoFar = 0; return { start: function(callback?: ?EndCallback) { - const restart = function(result: EndResult = {finished: true}): void { - if ( - isFinished || - iterationsSoFar === iterations || - result.finished === false - ) { + const restart = function(result: EndResult = { finished: true }): void { + if (isFinished || iterationsSoFar === iterations || result.finished === false) { callback && callback(result); } else { iterationsSoFar++; @@ -436,7 +408,7 @@ const loop = function( } }; if (!animation || iterations === 0) { - callback && callback({finished: true}); + callback && callback({ finished: true }); } else { if (animation._isUsingNativeDriver()) { animation._startNativeLoop(iterations); @@ -458,20 +430,18 @@ const loop = function( }, _startNativeLoop: function() { - throw new Error( - 'Loops run using the native driver cannot contain Animated.loop animations', - ); + throw new Error('Loops run using the native driver cannot contain Animated.loop animations'); }, _isUsingNativeDriver: function(): boolean { return animation._isUsingNativeDriver(); - }, + } }; }; function forkEvent( event: ?AnimatedEvent | ?Function, - listener: Function, + listener: Function ): AnimatedEvent | Function { if (!event) { return listener; @@ -486,10 +456,7 @@ function forkEvent( } } -function unforkEvent( - event: ?AnimatedEvent | ?Function, - listener: Function, -): void { +function unforkEvent(event: ?AnimatedEvent | ?Function, listener: Function): void { if (event && event instanceof AnimatedEvent) { event.__removeListener(listener); } @@ -528,14 +495,14 @@ module.exports = { ValueXY: AnimatedValueXY, /** * Exported to use the Interpolation type in flow. - * + * * See http://facebook.github.io/react-native/docs/animated.html#interpolation */ Interpolation: AnimatedInterpolation, /** * Exported for ease of type checking. All animated values derive from this * class. - * + * * See http://facebook.github.io/react-native/docs/animated.html#node */ Node: AnimatedNode, @@ -557,7 +524,7 @@ module.exports = { /** * Animates a value according to an analytical spring model based on * damped harmonic oscillation. - * + * * See http://facebook.github.io/react-native/docs/animated.html#spring */ spring, @@ -565,7 +532,7 @@ module.exports = { /** * Creates a new Animated value composed from two Animated values added * together. - * + * * See http://facebook.github.io/react-native/docs/animated.html#add */ add, @@ -573,7 +540,7 @@ module.exports = { /** * Creates a new Animated value composed by dividing the first Animated value * by the second Animated value. - * + * * See http://facebook.github.io/react-native/docs/animated.html#divide */ divide, @@ -581,7 +548,7 @@ module.exports = { /** * Creates a new Animated value composed from two Animated values multiplied * together. - * + * * See http://facebook.github.io/react-native/docs/animated.html#multiply */ multiply, @@ -589,7 +556,7 @@ module.exports = { /** * Creates a new Animated value that is the (non-negative) modulo of the * provided Animated value. - * + * * See http://facebook.github.io/react-native/docs/animated.html#modulo */ modulo, @@ -598,14 +565,14 @@ module.exports = { * Create a new Animated value that is limited between 2 values. It uses the * difference between the last value so even if the value is far from the * bounds it will start changing when the value starts getting closer again. - * + * * See http://facebook.github.io/react-native/docs/animated.html#diffclamp */ diffClamp, /** * Starts an animation after the given delay. - * + * * See http://facebook.github.io/react-native/docs/animated.html#delay */ delay, @@ -613,7 +580,7 @@ module.exports = { * Starts an array of animations in order, waiting for each to complete * before starting the next. If the current running animation is stopped, no * following animations will be started. - * + * * See http://facebook.github.io/react-native/docs/animated.html#sequence */ sequence, @@ -621,44 +588,44 @@ module.exports = { * Starts an array of animations all at the same time. By default, if one * of the animations is stopped, they will all be stopped. You can override * this with the `stopTogether` flag. - * + * * See http://facebook.github.io/react-native/docs/animated.html#parallel */ parallel, /** * Array of animations may run in parallel (overlap), but are started in * sequence with successive delays. Nice for doing trailing effects. - * + * * See http://facebook.github.io/react-native/docs/animated.html#stagger */ stagger, /** * Loops a given animation continuously, so that each time it reaches the * end, it resets and begins again from the start. - * + * * See http://facebook.github.io/react-native/docs/animated.html#loop - */ + */ loop, /** * Takes an array of mappings and extracts values from each arg accordingly, * then calls `setValue` on the mapped outputs. - * + * * See http://facebook.github.io/react-native/docs/animated.html#event */ event, /** * Make any React component Animatable. Used to create `Animated.View`, etc. - * + * * See http://facebook.github.io/react-native/docs/animated.html#createanimatedcomponent */ createAnimatedComponent, /** - * Imperative API to attach an animated value to an event on a view. Prefer + * Imperative API to attach an animated value to an event on a view. Prefer * using `Animated.event` with `useNativeDrive: true` if possible. - * + * * See http://facebook.github.io/react-native/docs/animated.html#attachnativeevent */ attachNativeEvent, @@ -666,11 +633,11 @@ module.exports = { /** * Advanced imperative API for snooping on animated events that are passed in * through props. Use values directly where possible. - * + * * See http://facebook.github.io/react-native/docs/animated.html#forkevent */ forkEvent, unforkEvent, - __PropsOnlyForTests: AnimatedProps, + __PropsOnlyForTests: AnimatedProps }; diff --git a/packages/react-native-web/src/vendor/Animated/Easing.js b/packages/react-native-web/src/vendor/Animated/Easing.js index 988f8164..1de2762f 100644 --- a/packages/react-native-web/src/vendor/Animated/Easing.js +++ b/packages/react-native-web/src/vendor/Animated/Easing.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule Easing * @flow @@ -152,7 +150,7 @@ class Easing { * error is because an exported function parameter is missing an * annotation. Without an annotation, these parameters are uncovered by * Flow. */ - return (t) => Math.pow(t, n); + return t => Math.pow(t, n); } /** @@ -206,7 +204,7 @@ class Easing { */ static elastic(bounciness: number = 1): (t: number) => number { const p = bounciness * Math.PI; - return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); + return t => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); } /** @@ -221,7 +219,7 @@ class Easing { if (s === undefined) { s = 1.70158; } - return (t) => t * t * ((s + 1) * t - s); + return t => t * t * ((s + 1) * t - s); } /** @@ -255,12 +253,7 @@ class Easing { * A useful tool to visualize cubic bezier curves can be found at * http://cubic-bezier.com/ */ - static bezier( - x1: number, - y1: number, - x2: number, - y2: number - ): (t: number) => number { + static bezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number { const _bezier = require('./bezier'); return _bezier(x1, y1, x2, y2); } @@ -268,19 +261,15 @@ class Easing { /** * Runs an easing function forwards. */ - static in( - easing: (t: number) => number, - ): (t: number) => number { + static in(easing: (t: number) => number): (t: number) => number { return easing; } /** * Runs an easing function backwards. */ - static out( - easing: (t: number) => number, - ): (t: number) => number { - return (t) => 1 - easing(1 - t); + static out(easing: (t: number) => number): (t: number) => number { + return t => 1 - easing(1 - t); } /** @@ -288,10 +277,8 @@ class Easing { * forwards for half of the duration, then backwards for the rest of the * duration. */ - static inOut( - easing: (t: number) => number, - ): (t: number) => number { - return (t) => { + static inOut(easing: (t: number) => number): (t: number) => number { + return t => { if (t < 0.5) { return easing(t * 2) / 2; } diff --git a/packages/react-native-web/src/vendor/Animated/NativeAnimatedHelper.js b/packages/react-native-web/src/vendor/Animated/NativeAnimatedHelper.js index 3e90cd3a..1b266ce2 100644 --- a/packages/react-native-web/src/vendor/Animated/NativeAnimatedHelper.js +++ b/packages/react-native-web/src/vendor/Animated/NativeAnimatedHelper.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule NativeAnimatedHelper * @flow @@ -16,19 +14,19 @@ const invariant = require('fbjs/lib/invariant'); const NativeModules = require('../../exports/NativeModules'); const NativeEventEmitter = require('../../modules/NativeEventEmitter'); -import type {AnimationConfig} from './animations/Animation'; -import type {EventConfig} from './AnimatedEvent'; +import type { AnimationConfig } from './animations/Animation'; +import type { EventConfig } from './AnimatedEvent'; const NativeAnimatedModule = NativeModules.NativeAnimatedModule; let __nativeAnimatedNodeTagCount = 1; /* used for animated nodes */ let __nativeAnimationIdCount = 1; /* used for started animations */ -type EndResult = {finished: boolean}; +type EndResult = { finished: boolean }; type EndCallback = (result: EndResult) => void; type EventMapping = { nativeEventPath: Array, - animatedValueTag: ?number, + animatedValueTag: ?number }; let nativeEventEmitter; @@ -54,10 +52,7 @@ const API = { assertNativeAnimatedModule(); NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag); }, - disconnectAnimatedNodes: function( - parentTag: ?number, - childTag: ?number, - ): void { + disconnectAnimatedNodes: function(parentTag: ?number, childTag: ?number): void { assertNativeAnimatedModule(); NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag); }, @@ -65,15 +60,10 @@ const API = { animationId: ?number, nodeTag: ?number, config: Object, - endCallback: EndCallback, + endCallback: EndCallback ): void { assertNativeAnimatedModule(); - NativeAnimatedModule.startAnimatingNode( - animationId, - nodeTag, - config, - endCallback, - ); + NativeAnimatedModule.startAnimatingNode(animationId, nodeTag, config, endCallback); }, stopAnimation: function(animationId: ?number) { assertNativeAnimatedModule(); @@ -95,17 +85,11 @@ const API = { assertNativeAnimatedModule(); NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag); }, - connectAnimatedNodeToView: function( - nodeTag: ?number, - viewTag: ?number, - ): void { + connectAnimatedNodeToView: function(nodeTag: ?number, viewTag: ?number): void { assertNativeAnimatedModule(); NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag); }, - disconnectAnimatedNodeFromView: function( - nodeTag: ?number, - viewTag: ?number, - ): void { + disconnectAnimatedNodeFromView: function(nodeTag: ?number, viewTag: ?number): void { assertNativeAnimatedModule(); NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag); }, @@ -116,27 +100,15 @@ const API = { addAnimatedEventToView: function( viewTag: ?number, eventName: string, - eventMapping: EventMapping, + eventMapping: EventMapping ) { assertNativeAnimatedModule(); - NativeAnimatedModule.addAnimatedEventToView( - viewTag, - eventName, - eventMapping, - ); + NativeAnimatedModule.addAnimatedEventToView(viewTag, eventName, eventMapping); }, - removeAnimatedEventFromView( - viewTag: ?number, - eventName: string, - animatedNodeTag: ?number, - ) { + removeAnimatedEventFromView(viewTag: ?number, eventName: string, animatedNodeTag: ?number) { assertNativeAnimatedModule(); - NativeAnimatedModule.removeAnimatedEventFromView( - viewTag, - eventName, - animatedNodeTag, - ); - }, + NativeAnimatedModule.removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag); + } }; /** @@ -155,7 +127,7 @@ const STYLES_WHITELIST = { scaleX: true, scaleY: true, translateX: true, - translateY: true, + translateY: true }; const TRANSFORM_WHITELIST = { @@ -167,15 +139,13 @@ const TRANSFORM_WHITELIST = { rotate: true, rotateX: true, rotateY: true, - perspective: true, + perspective: true }; function validateTransform(configs: Array): void { configs.forEach(config => { if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) { - throw new Error( - `Property '${config.property}' is not supported by native animated module`, - ); + throw new Error(`Property '${config.property}' is not supported by native animated module`); } }); } @@ -183,9 +153,7 @@ function validateTransform(configs: Array): void { function validateStyles(styles: Object): void { for (var key in styles) { if (!STYLES_WHITELIST.hasOwnProperty(key)) { - throw new Error( - `Style property '${key}' is not supported by native animated module`, - ); + throw new Error(`Style property '${key}' is not supported by native animated module`); } } } @@ -196,13 +164,11 @@ function validateInterpolation(config: Object): void { outputRange: true, extrapolate: true, extrapolateRight: true, - extrapolateLeft: true, + extrapolateLeft: true }; for (var key in config) { if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(key)) { - throw new Error( - `Interpolation property '${key}' is not supported by native animated module`, - ); + throw new Error(`Interpolation property '${key}' is not supported by native animated module`); } } } @@ -229,7 +195,7 @@ function shouldUseNativeDriver(config: AnimationConfig | EventConfig): boolean { 'animated module is missing. Falling back to JS-based animation. To ' + 'resolve this, add `RCTAnimation` module to this app, or remove ' + '`useNativeDriver`. ' + - 'More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420', + 'More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420' ); _warnedMissingNativeAnimated = true; } @@ -253,7 +219,7 @@ const NativeAnimatedHelper = { nativeEventEmitter = new NativeEventEmitter(NativeAnimatedModule); } return nativeEventEmitter; - }, + } }; module.exports = NativeAnimatedHelper; diff --git a/packages/react-native-web/src/vendor/Animated/SpringConfig.js b/packages/react-native-web/src/vendor/Animated/SpringConfig.js index e74d167e..0850e211 100644 --- a/packages/react-native-web/src/vendor/Animated/SpringConfig.js +++ b/packages/react-native-web/src/vendor/Animated/SpringConfig.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule SpringConfig * @flow @@ -14,7 +12,7 @@ type SpringConfigType = { stiffness: number, - damping: number, + damping: number }; function stiffnessFromOrigamiValue(oValue) { @@ -25,26 +23,20 @@ function dampingFromOrigamiValue(oValue) { return (oValue - 8) * 3 + 25; } -function fromOrigamiTensionAndFriction( - tension: number, - friction: number, -): SpringConfigType { +function fromOrigamiTensionAndFriction(tension: number, friction: number): SpringConfigType { return { stiffness: stiffnessFromOrigamiValue(tension), - damping: dampingFromOrigamiValue(friction), + damping: dampingFromOrigamiValue(friction) }; } -function fromBouncinessAndSpeed( - bounciness: number, - speed: number, -): SpringConfigType { +function fromBouncinessAndSpeed(bounciness: number, speed: number): SpringConfigType { function normalize(value, startValue, endValue) { return (value - startValue) / (endValue - startValue); } function projectNormal(n, start, end) { - return start + (n * (end - start)); + return start + n * (end - start); } function linearInterpolation(t, start, end) { @@ -56,18 +48,15 @@ function fromBouncinessAndSpeed( } function b3Friction1(x) { - return (0.0007 * Math.pow(x, 3)) - - (0.031 * Math.pow(x, 2)) + 0.64 * x + 1.28; + return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28; } function b3Friction2(x) { - return (0.000044 * Math.pow(x, 3)) - - (0.006 * Math.pow(x, 2)) + 0.36 * x + 2; + return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2; } function b3Friction3(x) { - return (0.00000045 * Math.pow(x, 3)) - - (0.000332 * Math.pow(x, 2)) + 0.1078 * x + 5.84; + return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84; } function b3Nobounce(tension) { @@ -84,19 +73,15 @@ function fromBouncinessAndSpeed( b = projectNormal(b, 0, 0.8); var s = normalize(speed / 1.7, 0, 20); var bouncyTension = projectNormal(s, 0.5, 200); - var bouncyFriction = quadraticOutInterpolation( - b, - b3Nobounce(bouncyTension), - 0.01 - ); + var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01); return { stiffness: stiffnessFromOrigamiValue(bouncyTension), - damping: dampingFromOrigamiValue(bouncyFriction), + damping: dampingFromOrigamiValue(bouncyFriction) }; } module.exports = { fromOrigamiTensionAndFriction, - fromBouncinessAndSpeed, + fromBouncinessAndSpeed }; diff --git a/packages/react-native-web/src/vendor/Animated/animations/Animation.js b/packages/react-native-web/src/vendor/Animated/animations/Animation.js index 2ee6a6f9..76c7c905 100644 --- a/packages/react-native-web/src/vendor/Animated/animations/Animation.js +++ b/packages/react-native-web/src/vendor/Animated/animations/Animation.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule Animation * @flow @@ -16,14 +14,14 @@ const NativeAnimatedHelper = require('../NativeAnimatedHelper'); import type AnimatedValue from '../nodes/AnimatedValue'; -export type EndResult = {finished: boolean}; +export type EndResult = { finished: boolean }; export type EndCallback = (result: EndResult) => void; export type AnimationConfig = { isInteraction?: boolean, useNativeDriver?: boolean, onComplete?: ?EndCallback, - iterations?: number, + iterations?: number }; // Important note: start() and stop() will only be called at most once. @@ -40,7 +38,7 @@ class Animation { onUpdate: (value: number) => void, onEnd: ?EndCallback, previousAnimation: ?Animation, - animatedValue: AnimatedValue, + animatedValue: AnimatedValue ): void {} stop(): void { if (this.__nativeId) { @@ -65,7 +63,7 @@ class Animation { this.__nativeId, animatedValue.__getNativeTag(), this.__getNativeAnimationConfig(), - this.__debouncedOnEnd.bind(this), + this.__debouncedOnEnd.bind(this) ); } } diff --git a/packages/react-native-web/src/vendor/Animated/animations/DecayAnimation.js b/packages/react-native-web/src/vendor/Animated/animations/DecayAnimation.js index 652bd9c9..c23a47f1 100644 --- a/packages/react-native-web/src/vendor/Animated/animations/DecayAnimation.js +++ b/packages/react-native-web/src/vendor/Animated/animations/DecayAnimation.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule DecayAnimation * @flow @@ -14,19 +12,19 @@ const Animation = require('./Animation'); -const {shouldUseNativeDriver} = require('../NativeAnimatedHelper'); +const { shouldUseNativeDriver } = require('../NativeAnimatedHelper'); -import type {AnimationConfig, EndCallback} from './Animation'; +import type { AnimationConfig, EndCallback } from './Animation'; import type AnimatedValue from '../nodes/AnimatedValue'; export type DecayAnimationConfig = AnimationConfig & { - velocity: number | {x: number, y: number}, - deceleration?: number, + velocity: number | { x: number, y: number }, + deceleration?: number }; export type DecayAnimationConfigSingle = AnimationConfig & { velocity: number, - deceleration?: number, + deceleration?: number }; class DecayAnimation extends Animation { @@ -41,12 +39,10 @@ class DecayAnimation extends Animation { constructor(config: DecayAnimationConfigSingle) { super(); - this._deceleration = - config.deceleration !== undefined ? config.deceleration : 0.998; + this._deceleration = config.deceleration !== undefined ? config.deceleration : 0.998; this._velocity = config.velocity; this._useNativeDriver = shouldUseNativeDriver(config); - this.__isInteraction = - config.isInteraction !== undefined ? config.isInteraction : true; + this.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true; this.__iterations = config.iterations !== undefined ? config.iterations : 1; } @@ -55,7 +51,7 @@ class DecayAnimation extends Animation { type: 'decay', deceleration: this._deceleration, velocity: this._velocity, - iterations: this.__iterations, + iterations: this.__iterations }; } @@ -64,7 +60,7 @@ class DecayAnimation extends Animation { onUpdate: (value: number) => void, onEnd: ?EndCallback, previousAnimation: ?Animation, - animatedValue: AnimatedValue, + animatedValue: AnimatedValue ): void { this.__active = true; this._lastValue = fromValue; @@ -91,7 +87,7 @@ class DecayAnimation extends Animation { this._onUpdate(value); if (Math.abs(this._lastValue - value) < 0.1) { - this.__debouncedOnEnd({finished: true}); + this.__debouncedOnEnd({ finished: true }); return; } @@ -105,7 +101,7 @@ class DecayAnimation extends Animation { super.stop(); this.__active = false; global.cancelAnimationFrame(this._animationFrame); - this.__debouncedOnEnd({finished: false}); + this.__debouncedOnEnd({ finished: false }); } } diff --git a/packages/react-native-web/src/vendor/Animated/animations/SpringAnimation.js b/packages/react-native-web/src/vendor/Animated/animations/SpringAnimation.js index 67dee081..9276344c 100644 --- a/packages/react-native-web/src/vendor/Animated/animations/SpringAnimation.js +++ b/packages/react-native-web/src/vendor/Animated/animations/SpringAnimation.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule SpringAnimation * @flow @@ -18,16 +16,16 @@ const Animation = require('./Animation'); const SpringConfig = require('../SpringConfig'); const invariant = require('fbjs/lib/invariant'); -const {shouldUseNativeDriver} = require('../NativeAnimatedHelper'); +const { shouldUseNativeDriver } = require('../NativeAnimatedHelper'); -import type {AnimationConfig, EndCallback} from './Animation'; +import type { AnimationConfig, EndCallback } from './Animation'; export type SpringAnimationConfig = AnimationConfig & { - toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY, + toValue: number | AnimatedValue | { x: number, y: number } | AnimatedValueXY, overshootClamping?: boolean, restDisplacementThreshold?: number, restSpeedThreshold?: number, - velocity?: number | {x: number, y: number}, + velocity?: number | { x: number, y: number }, bounciness?: number, speed?: number, tension?: number, @@ -35,7 +33,7 @@ export type SpringAnimationConfig = AnimationConfig & { stiffness?: number, damping?: number, mass?: number, - delay?: number, + delay?: number }; export type SpringAnimationConfigSingle = AnimationConfig & { @@ -51,7 +49,7 @@ export type SpringAnimationConfigSingle = AnimationConfig & { stiffness?: number, damping?: number, mass?: number, - delay?: number, + delay?: number }; function withDefault(value: ?T, defaultValue: T): T { @@ -87,18 +85,14 @@ class SpringAnimation extends Animation { super(); this._overshootClamping = withDefault(config.overshootClamping, false); - this._restDisplacementThreshold = withDefault( - config.restDisplacementThreshold, - 0.001, - ); + this._restDisplacementThreshold = withDefault(config.restDisplacementThreshold, 0.001); this._restSpeedThreshold = withDefault(config.restSpeedThreshold, 0.001); this._initialVelocity = withDefault(config.velocity, 0); this._lastVelocity = withDefault(config.velocity, 0); this._toValue = config.toValue; this._delay = withDefault(config.delay, 0); this._useNativeDriver = shouldUseNativeDriver(config); - this.__isInteraction = - config.isInteraction !== undefined ? config.isInteraction : true; + this.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true; this.__iterations = config.iterations !== undefined ? config.iterations : 1; if ( @@ -111,7 +105,7 @@ class SpringAnimation extends Animation { config.speed === undefined && config.tension === undefined && config.friction === undefined, - 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one', + 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one' ); this._stiffness = withDefault(config.stiffness, 100); this._damping = withDefault(config.damping, 10); @@ -125,11 +119,11 @@ class SpringAnimation extends Animation { config.stiffness === undefined && config.damping === undefined && config.mass === undefined, - 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one', + 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one' ); const springConfig = SpringConfig.fromBouncinessAndSpeed( withDefault(config.bounciness, 8), - withDefault(config.speed, 12), + withDefault(config.speed, 12) ); this._stiffness = springConfig.stiffness; this._damping = springConfig.damping; @@ -139,7 +133,7 @@ class SpringAnimation extends Animation { // We assume mass is 1. const springConfig = SpringConfig.fromOrigamiTensionAndFriction( withDefault(config.tension, 40), - withDefault(config.friction, 7), + withDefault(config.friction, 7) ); this._stiffness = springConfig.stiffness; this._damping = springConfig.damping; @@ -162,7 +156,7 @@ class SpringAnimation extends Animation { mass: this._mass, initialVelocity: withDefault(this._initialVelocity, this._lastVelocity), toValue: this._toValue, - iterations: this.__iterations, + iterations: this.__iterations }; } @@ -171,7 +165,7 @@ class SpringAnimation extends Animation { onUpdate: (value: number) => void, onEnd: ?EndCallback, previousAnimation: ?Animation, - animatedValue: AnimatedValue, + animatedValue: AnimatedValue ): void { this.__active = true; this._startPosition = fromValue; @@ -211,7 +205,7 @@ class SpringAnimation extends Animation { return { lastPosition: this._lastPosition, lastVelocity: this._lastVelocity, - lastTime: this._lastTime, + lastTime: this._lastTime }; } @@ -269,25 +263,21 @@ class SpringAnimation extends Animation { position = this._toValue - envelope * - ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + - x0 * Math.cos(omega1 * t)); + ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t)); // This looks crazy -- it's actually just the derivative of the // oscillation function velocity = zeta * omega0 * envelope * - (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + - x0 * Math.cos(omega1 * t)) - + (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * - (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - - omega1 * x0 * Math.sin(omega1 * t)); + (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t)); } else { // Critically damped const envelope = Math.exp(-omega0 * t); position = this._toValue - envelope * (x0 + (v0 + omega0 * x0) * t); - velocity = - envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0)); + velocity = envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0)); } this._lastTime = now; @@ -312,8 +302,7 @@ class SpringAnimation extends Animation { const isVelocity = Math.abs(velocity) <= this._restSpeedThreshold; let isDisplacement = true; if (this._stiffness !== 0) { - isDisplacement = - Math.abs(this._toValue - position) <= this._restDisplacementThreshold; + isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold; } if (isOvershooting || (isVelocity && isDisplacement)) { @@ -324,7 +313,7 @@ class SpringAnimation extends Animation { this._onUpdate(this._toValue); } - this.__debouncedOnEnd({finished: true}); + this.__debouncedOnEnd({ finished: true }); return; } this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); @@ -335,7 +324,7 @@ class SpringAnimation extends Animation { this.__active = false; clearTimeout(this._timeout); global.cancelAnimationFrame(this._animationFrame); - this.__debouncedOnEnd({finished: false}); + this.__debouncedOnEnd({ finished: false }); } } diff --git a/packages/react-native-web/src/vendor/Animated/animations/TimingAnimation.js b/packages/react-native-web/src/vendor/Animated/animations/TimingAnimation.js index 14d3e3dc..6d96250a 100644 --- a/packages/react-native-web/src/vendor/Animated/animations/TimingAnimation.js +++ b/packages/react-native-web/src/vendor/Animated/animations/TimingAnimation.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule TimingAnimation * @flow @@ -16,22 +14,22 @@ const AnimatedValue = require('../nodes/AnimatedValue'); const AnimatedValueXY = require('../nodes/AnimatedValueXY'); const Animation = require('./Animation'); -const {shouldUseNativeDriver} = require('../NativeAnimatedHelper'); +const { shouldUseNativeDriver } = require('../NativeAnimatedHelper'); -import type {AnimationConfig, EndCallback} from './Animation'; +import type { AnimationConfig, EndCallback } from './Animation'; export type TimingAnimationConfig = AnimationConfig & { - toValue: number | AnimatedValue | {x: number, y: number} | AnimatedValueXY, + toValue: number | AnimatedValue | { x: number, y: number } | AnimatedValueXY, easing?: (value: number) => number, duration?: number, - delay?: number, + delay?: number }; export type TimingAnimationConfigSingle = AnimationConfig & { toValue: number | AnimatedValue, easing?: (value: number) => number, duration?: number, - delay?: number, + delay?: number }; let _easeInOut; @@ -62,8 +60,7 @@ class TimingAnimation extends Animation { this._duration = config.duration !== undefined ? config.duration : 500; this._delay = config.delay !== undefined ? config.delay : 0; this.__iterations = config.iterations !== undefined ? config.iterations : 1; - this.__isInteraction = - config.isInteraction !== undefined ? config.isInteraction : true; + this.__isInteraction = config.isInteraction !== undefined ? config.isInteraction : true; this._useNativeDriver = shouldUseNativeDriver(config); } @@ -78,7 +75,7 @@ class TimingAnimation extends Animation { type: 'frames', frames, toValue: this._toValue, - iterations: this.__iterations, + iterations: this.__iterations }; } @@ -87,7 +84,7 @@ class TimingAnimation extends Animation { onUpdate: (value: number) => void, onEnd: ?EndCallback, previousAnimation: ?Animation, - animatedValue: AnimatedValue, + animatedValue: AnimatedValue ): void { this.__active = true; this._fromValue = fromValue; @@ -100,15 +97,13 @@ class TimingAnimation extends Animation { // not cause intermixed JS and native animations. if (this._duration === 0 && !this._useNativeDriver) { this._onUpdate(this._toValue); - this.__debouncedOnEnd({finished: true}); + this.__debouncedOnEnd({ finished: true }); } else { this._startTime = Date.now(); if (this._useNativeDriver) { this.__startNativeAnimation(animatedValue); } else { - this._animationFrame = requestAnimationFrame( - this.onUpdate.bind(this), - ); + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); } } }; @@ -125,18 +120,15 @@ class TimingAnimation extends Animation { if (this._duration === 0) { this._onUpdate(this._toValue); } else { - this._onUpdate( - this._fromValue + this._easing(1) * (this._toValue - this._fromValue), - ); + this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue)); } - this.__debouncedOnEnd({finished: true}); + this.__debouncedOnEnd({ finished: true }); return; } this._onUpdate( this._fromValue + - this._easing((now - this._startTime) / this._duration) * - (this._toValue - this._fromValue), + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue) ); if (this.__active) { this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); @@ -148,7 +140,7 @@ class TimingAnimation extends Animation { this.__active = false; clearTimeout(this._timeout); global.cancelAnimationFrame(this._animationFrame); - this.__debouncedOnEnd({finished: false}); + this.__debouncedOnEnd({ finished: false }); } } diff --git a/packages/react-native-web/src/vendor/Animated/createAnimatedComponent.js b/packages/react-native-web/src/vendor/Animated/createAnimatedComponent.js index 435b14b5..bea7e0b3 100644 --- a/packages/react-native-web/src/vendor/Animated/createAnimatedComponent.js +++ b/packages/react-native-web/src/vendor/Animated/createAnimatedComponent.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule createAnimatedComponent * @flow @@ -12,7 +10,7 @@ */ 'use strict'; -const {AnimatedEvent} = require('./AnimatedEvent'); +const { AnimatedEvent } = require('./AnimatedEvent'); const AnimatedProps = require('./nodes/AnimatedProps'); const React = require('react'); const ViewStylePropTypes = require('../../exports/View/ViewStylePropTypes').default; @@ -96,14 +94,12 @@ function createAnimatedComponent(Component: any): any { ) { this.forceUpdate(); } else if (!this._propsAnimated.__isNative) { - this._component.setNativeProps( - this._propsAnimated.__getAnimatedValue(), - ); + this._component.setNativeProps(this._propsAnimated.__getAnimatedValue()); } else { throw new Error( 'Attempting to run JS driven animation on animated ' + 'node that has been moved to "native" earlier by starting an ' + - 'animation with `useNativeDriver: true`', + 'animation with `useNativeDriver: true`' ); } }; @@ -111,10 +107,7 @@ function createAnimatedComponent(Component: any): any { _attachProps(nextProps) { const oldPropsAnimated = this._propsAnimated; - this._propsAnimated = new AnimatedProps( - nextProps, - this._animatedPropsCallback, - ); + this._propsAnimated = new AnimatedProps(nextProps, this._animatedPropsCallback); // When you call detach, it removes the element from the parent list // of children. If it goes to 0, then the parent also detaches itself @@ -151,9 +144,7 @@ function createAnimatedComponent(Component: any): any { // have to make sure the view doesn't get optimized away because it cannot // go through the NativeViewHierachyManager since it operates on the shadow // thread. - collapsable={ - this._propsAnimated.__isNative ? false : props.collapsable - } + collapsable={this._propsAnimated.__isNative ? false : props.collapsable} /> ); } @@ -187,11 +178,11 @@ function createAnimatedComponent(Component: any): any { 'should nest it in a style object. ' + 'E.g. `{ style: { ' + key + - ': ... } }`', + ': ... } }`' ); } } - }, + } }; return AnimatedComponent; diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedAddition.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedAddition.js index 53d33883..3c775492 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedAddition.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedAddition.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedAddition * @flow @@ -17,7 +15,7 @@ const AnimatedNode = require('./AnimatedNode'); const AnimatedValue = require('./AnimatedValue'); const AnimatedWithChildren = require('./AnimatedWithChildren'); -import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type { InterpolationConfigType } from './AnimatedInterpolation'; class AnimatedAddition extends AnimatedWithChildren { _a: AnimatedNode; @@ -57,7 +55,7 @@ class AnimatedAddition extends AnimatedWithChildren { __getNativeConfig(): any { return { type: 'addition', - input: [this._a.__getNativeTag(), this._b.__getNativeTag()], + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDiffClamp.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDiffClamp.js index eac26a10..15bdf711 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDiffClamp.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDiffClamp.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedDiffClamp * @flow @@ -16,7 +14,7 @@ const AnimatedInterpolation = require('./AnimatedInterpolation'); const AnimatedNode = require('./AnimatedNode'); const AnimatedWithChildren = require('./AnimatedWithChildren'); -import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type { InterpolationConfigType } from './AnimatedInterpolation'; class AnimatedDiffClamp extends AnimatedWithChildren { _a: AnimatedNode; @@ -65,7 +63,7 @@ class AnimatedDiffClamp extends AnimatedWithChildren { type: 'diffclamp', input: this._a.__getNativeTag(), min: this._min, - max: this._max, + max: this._max }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDivision.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDivision.js index 8d658f45..076d5bb5 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDivision.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedDivision.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedDivision * @flow @@ -17,7 +15,7 @@ const AnimatedNode = require('./AnimatedNode'); const AnimatedValue = require('./AnimatedValue'); const AnimatedWithChildren = require('./AnimatedWithChildren'); -import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type { InterpolationConfigType } from './AnimatedInterpolation'; class AnimatedDivision extends AnimatedWithChildren { _a: AnimatedNode; @@ -62,7 +60,7 @@ class AnimatedDivision extends AnimatedWithChildren { __getNativeConfig(): any { return { type: 'division', - input: [this._a.__getNativeTag(), this._b.__getNativeTag()], + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedInterpolation.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedInterpolation.js index 8d66c216..e0e850a6 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedInterpolation.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedInterpolation.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedInterpolation * @flow @@ -32,7 +30,7 @@ export type InterpolationConfigType = { easing?: (input: number) => number, extrapolate?: ExtrapolateType, extrapolateLeft?: ExtrapolateType, - extrapolateRight?: ExtrapolateType, + extrapolateRight?: ExtrapolateType }; const linear = t => t; @@ -41,9 +39,7 @@ const linear = t => t; * Very handy helper to map input ranges to output ranges with an easing * function and custom behavior outside of the ranges. */ -function createInterpolation( - config: InterpolationConfigType, -): (input: number) => number | string { +function createInterpolation(config: InterpolationConfigType): (input: number) => number | string { if (config.outputRange && typeof config.outputRange[0] === 'string') { return createInterpolationFromStringOutputRange(config); } @@ -61,7 +57,7 @@ function createInterpolation( inputRange.length + ') and outputRange (' + outputRange.length + - ') must have the same length', + ') must have the same length' ); const easing = config.easing || linear; @@ -81,10 +77,7 @@ function createInterpolation( } return input => { - invariant( - typeof input === 'number', - 'Cannot interpolation an input which is not a number', - ); + invariant(typeof input === 'number', 'Cannot interpolation an input which is not a number'); const range = findRange(input, inputRange); return interpolate( @@ -95,7 +88,7 @@ function createInterpolation( outputRange[range + 1], easing, extrapolateLeft, - extrapolateRight, + extrapolateRight ); }; } @@ -108,7 +101,7 @@ function interpolate( outputMax: number, easing: (input: number) => number, extrapolateLeft: ExtrapolateType, - extrapolateRight: ExtrapolateType, + extrapolateRight: ExtrapolateType ) { let result = input; @@ -195,7 +188,7 @@ const stringShapeRegex = /[0-9\.-]+/g; * -45deg // values with units */ function createInterpolationFromStringOutputRange( - config: InterpolationConfigType, + config: InterpolationConfigType ): (input: number) => string { let outputRange: Array = (config.outputRange: any); invariant(outputRange.length >= 2, 'Bad output range'); @@ -226,14 +219,12 @@ function createInterpolationFromStringOutputRange( /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to * guard against this possibility. */ - const interpolations = outputRange[0] - .match(stringShapeRegex) - .map((value, i) => { - return createInterpolation({ - ...config, - outputRange: outputRanges[i], - }); + const interpolations = outputRange[0].match(stringShapeRegex).map((value, i) => { + return createInterpolation({ + ...config, + outputRange: outputRanges[i] }); + }); // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to // round the opacity (4th column). @@ -246,8 +237,7 @@ function createInterpolationFromStringOutputRange( // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...' return outputRange[0].replace(stringShapeRegex, () => { const val = +interpolations[i++](input); - const rounded = - shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000; + const rounded = shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000; return String(rounded); }); }; @@ -262,7 +252,7 @@ function checkPattern(arr: Array) { for (let i = 1; i < arr.length; ++i) { invariant( pattern === arr[i].replace(stringShapeRegex, ''), - 'invalid pattern ' + arr[0] + ' and ' + arr[i], + 'invalid pattern ' + arr[0] + ' and ' + arr[i] ); } } @@ -288,7 +278,7 @@ function checkValidInputRange(arr: Array) { * mean this implicit string conversion, you can do something like * String(myThing) */ - 'inputRange must be monotonically increasing ' + arr, + 'inputRange must be monotonically increasing ' + arr ); } } @@ -303,7 +293,7 @@ function checkInfiniteRange(name: string, arr: Array) { * this implicit string conversion, you can do something like * String(myThing) */ - name + 'cannot be ]-infinity;+infinity[ ' + arr, + name + 'cannot be ]-infinity;+infinity[ ' + arr ); } @@ -331,7 +321,7 @@ class AnimatedInterpolation extends AnimatedWithChildren { const parentValue: number = this._parent.__getValue(); invariant( typeof parentValue === 'number', - 'Cannot interpolate an input which is not a number.', + 'Cannot interpolate an input which is not a number.' ); return this._interpolation(parentValue); } @@ -376,11 +366,9 @@ class AnimatedInterpolation extends AnimatedWithChildren { inputRange: this._config.inputRange, // Only the `outputRange` can contain strings so we don't need to tranform `inputRange` here outputRange: this.__transformDataType(this._config.outputRange), - extrapolateLeft: - this._config.extrapolateLeft || this._config.extrapolate || 'extend', - extrapolateRight: - this._config.extrapolateRight || this._config.extrapolate || 'extend', - type: 'interpolation', + extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend', + extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend', + type: 'interpolation' }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedModulo.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedModulo.js index 3ff75e73..2748875a 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedModulo.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedModulo.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedModulo * @flow @@ -16,7 +14,7 @@ const AnimatedInterpolation = require('./AnimatedInterpolation'); const AnimatedNode = require('./AnimatedNode'); const AnimatedWithChildren = require('./AnimatedWithChildren'); -import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type { InterpolationConfigType } from './AnimatedInterpolation'; class AnimatedModulo extends AnimatedWithChildren { _a: AnimatedNode; @@ -34,9 +32,7 @@ class AnimatedModulo extends AnimatedWithChildren { } __getValue(): number { - return ( - (this._a.__getValue() % this._modulus + this._modulus) % this._modulus - ); + return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus; } interpolate(config: InterpolationConfigType): AnimatedInterpolation { @@ -56,7 +52,7 @@ class AnimatedModulo extends AnimatedWithChildren { return { type: 'modulus', input: this._a.__getNativeTag(), - modulus: this._modulus, + modulus: this._modulus }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedMultiplication.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedMultiplication.js index d30ce259..53e2537f 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedMultiplication.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedMultiplication.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedMultiplication * @flow @@ -17,7 +15,7 @@ const AnimatedNode = require('./AnimatedNode'); const AnimatedValue = require('./AnimatedValue'); const AnimatedWithChildren = require('./AnimatedWithChildren'); -import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type { InterpolationConfigType } from './AnimatedInterpolation'; class AnimatedMultiplication extends AnimatedWithChildren { _a: AnimatedNode; @@ -57,7 +55,7 @@ class AnimatedMultiplication extends AnimatedWithChildren { __getNativeConfig(): any { return { type: 'multiplication', - input: [this._a.__getNativeTag(), this._b.__getNativeTag()], + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedNode.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedNode.js index c29f4b7f..a3ee9ec4 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedNode.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedNode.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedNode * @flow @@ -46,24 +44,16 @@ class AnimatedNode { } __getNativeTag(): ?number { NativeAnimatedHelper.assertNativeAnimatedModule(); - invariant( - this.__isNative, - 'Attempt to get native tag from node not marked as "native"', - ); + invariant(this.__isNative, 'Attempt to get native tag from node not marked as "native"'); if (this.__nativeTag == null) { const nativeTag: ?number = NativeAnimatedHelper.generateNewNodeTag(); - NativeAnimatedHelper.API.createAnimatedNode( - nativeTag, - this.__getNativeConfig(), - ); + NativeAnimatedHelper.API.createAnimatedNode(nativeTag, this.__getNativeConfig()); this.__nativeTag = nativeTag; } return this.__nativeTag; } __getNativeConfig(): Object { - throw new Error( - 'This JS animated node type cannot be used as native animated node', - ); + throw new Error('This JS animated node type cannot be used as native animated node'); } toJSON(): any { return this.__getValue(); diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedProps.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedProps.js index 5d9c2b96..f0e37f8f 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedProps.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedProps.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedProps * @flow @@ -12,7 +10,7 @@ */ 'use strict'; -const {AnimatedEvent} = require('../AnimatedEvent'); +const { AnimatedEvent } = require('../AnimatedEvent'); const AnimatedNode = require('./AnimatedNode'); const AnimatedStyle = require('./AnimatedStyle'); const NativeAnimatedHelper = require('../NativeAnimatedHelper'); @@ -30,7 +28,7 @@ class AnimatedProps extends AnimatedNode { if (props.style) { props = { ...props, - style: new AnimatedStyle(props.style), + style: new AnimatedStyle(props.style) }; } this._props = props; @@ -121,32 +119,16 @@ class AnimatedProps extends AnimatedNode { __connectAnimatedView(): void { invariant(this.__isNative, 'Expected node to be marked as "native"'); - const nativeViewTag: ?number = findNodeHandle( - this._animatedView, - ); - invariant( - nativeViewTag != null, - 'Unable to locate attached view in the native tree', - ); - NativeAnimatedHelper.API.connectAnimatedNodeToView( - this.__getNativeTag(), - nativeViewTag, - ); + const nativeViewTag: ?number = findNodeHandle(this._animatedView); + invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + NativeAnimatedHelper.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag); } __disconnectAnimatedView(): void { invariant(this.__isNative, 'Expected node to be marked as "native"'); - const nativeViewTag: ?number = findNodeHandle( - this._animatedView, - ); - invariant( - nativeViewTag != null, - 'Unable to locate attached view in the native tree', - ); - NativeAnimatedHelper.API.disconnectAnimatedNodeFromView( - this.__getNativeTag(), - nativeViewTag, - ); + const nativeViewTag: ?number = findNodeHandle(this._animatedView); + invariant(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag); } __getNativeConfig(): Object { @@ -159,7 +141,7 @@ class AnimatedProps extends AnimatedNode { } return { type: 'props', - props: propsConfig, + props: propsConfig }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedStyle.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedStyle.js index a3c38cca..a494f952 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedStyle.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedStyle.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedStyle * @noflow @@ -29,7 +27,7 @@ class AnimatedStyle extends AnimatedWithChildren { if (style.transform) { style = { ...style, - transform: new AnimatedTransform(style.transform), + transform: new AnimatedTransform(style.transform) }; } this._style = style; @@ -120,7 +118,7 @@ class AnimatedStyle extends AnimatedWithChildren { NativeAnimatedHelper.validateStyles(styleConfig); return { type: 'style', - style: styleConfig, + style: styleConfig }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTracking.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTracking.js index 1a54f78a..856ffae7 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTracking.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTracking.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedTracking * @flow @@ -15,7 +13,7 @@ const AnimatedValue = require('./AnimatedValue'); const AnimatedNode = require('./AnimatedNode'); -import type {EndCallback} from '../animations/Animation'; +import type { EndCallback } from '../animations/Animation'; class AnimatedTracking extends AnimatedNode { _value: AnimatedValue; @@ -29,7 +27,7 @@ class AnimatedTracking extends AnimatedNode { parent: AnimatedNode, animationClass: any, animationConfig: Object, - callback?: ?EndCallback, + callback?: ?EndCallback ) { super(); this._value = value; @@ -57,9 +55,9 @@ class AnimatedTracking extends AnimatedNode { this._value.animate( new this._animationClass({ ...this._animationConfig, - toValue: (this._animationConfig.toValue: any).__getValue(), + toValue: (this._animationConfig.toValue: any).__getValue() }), - this._callback, + this._callback ); } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTransform.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTransform.js index c95aa16f..be2f0e90 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTransform.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedTransform.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedTransform * @flow @@ -100,13 +98,13 @@ class AnimatedTransform extends AnimatedWithChildren { transConfigs.push({ type: 'animated', property: key, - nodeTag: value.__getNativeTag(), + nodeTag: value.__getNativeTag() }); } else { transConfigs.push({ type: 'static', property: key, - value, + value }); } } @@ -115,7 +113,7 @@ class AnimatedTransform extends AnimatedWithChildren { NativeAnimatedHelper.validateTransform(transConfigs); return { type: 'transform', - transforms: transConfigs, + transforms: transConfigs }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValue.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValue.js index afe92adf..51af47cb 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValue.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValue.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedValue * @flow @@ -18,12 +16,12 @@ const AnimatedWithChildren = require('./AnimatedWithChildren'); const InteractionManager = require('../../../exports/InteractionManager').default; const NativeAnimatedHelper = require('../NativeAnimatedHelper'); -import type Animation, {EndCallback} from '../animations/Animation'; -import type {InterpolationConfigType} from './AnimatedInterpolation'; +import type Animation, { EndCallback } from '../animations/Animation'; +import type { InterpolationConfigType } from './AnimatedInterpolation'; const NativeAnimatedAPI = NativeAnimatedHelper.API; -type ValueListenerCallback = (state: {value: number}) => void; +type ValueListenerCallback = (state: { value: number }) => void; let _uniqueId = 1; @@ -77,7 +75,7 @@ class AnimatedValue extends AnimatedWithChildren { _offset: number; _animation: ?Animation; _tracking: ?AnimatedNode; - _listeners: {[key: string]: ValueListenerCallback}; + _listeners: { [key: string]: ValueListenerCallback }; __nativeAnimatedValueListener: ?any; constructor(value: number) { @@ -118,7 +116,7 @@ class AnimatedValue extends AnimatedWithChildren { } this._updateValue( value, - !this.__isNative /* don't perform a flush for natively driven values */, + !this.__isNative /* don't perform a flush for natively driven values */ ); if (this.__isNative) { NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value); @@ -221,7 +219,7 @@ class AnimatedValue extends AnimatedWithChildren { return; } this._updateValue(data.value, false /* flush */); - }, + } ); } @@ -296,7 +294,7 @@ class AnimatedValue extends AnimatedWithChildren { callback && callback(result); }, previousAnimation, - this, + this ); } @@ -322,7 +320,7 @@ class AnimatedValue extends AnimatedWithChildren { _flush(this); } for (const key in this._listeners) { - this._listeners[key]({value: this.__getValue()}); + this._listeners[key]({ value: this.__getValue() }); } } @@ -330,7 +328,7 @@ class AnimatedValue extends AnimatedWithChildren { return { type: 'value', value: this._value, - offset: this._offset, + offset: this._offset }; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValueXY.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValueXY.js index d04fe094..e33c5cf3 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValueXY.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedValueXY.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedValueXY * @flow @@ -17,34 +15,31 @@ const AnimatedWithChildren = require('./AnimatedWithChildren'); const invariant = require('fbjs/lib/invariant'); -type ValueXYListenerCallback = (value: {x: number, y: number}) => void; +type ValueXYListenerCallback = (value: { x: number, y: number }) => void; let _uniqueId = 1; /** - * 2D Value for driving 2D animations, such as pan gestures. Almost identical + * 2D Value for driving 2D animations, such as pan gestures. Almost identical * API to normal `Animated.Value`, but multiplexed. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html */ class AnimatedValueXY extends AnimatedWithChildren { x: AnimatedValue; y: AnimatedValue; - _listeners: {[key: string]: {x: string, y: string}}; + _listeners: { [key: string]: { x: string, y: string } }; - constructor( - valueIn?: ?{x: number | AnimatedValue, y: number | AnimatedValue}, - ) { + constructor(valueIn?: ?{ x: number | AnimatedValue, y: number | AnimatedValue }) { super(); - const value: any = valueIn || {x: 0, y: 0}; // @flowfixme: shouldn't need `: any` + const value: any = valueIn || { x: 0, y: 0 }; // @flowfixme: shouldn't need `: any` if (typeof value.x === 'number' && typeof value.y === 'number') { this.x = new AnimatedValue(value.x); this.y = new AnimatedValue(value.y); } else { invariant( value.x instanceof AnimatedValue && value.y instanceof AnimatedValue, - 'AnimatedValueXY must be initalized with an object of numbers or ' + - 'AnimatedValues.', + 'AnimatedValueXY must be initalized with an object of numbers or ' + 'AnimatedValues.' ); this.x = value.x; this.y = value.y; @@ -55,30 +50,30 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Directly set the value. This will stop any animations running on the value * and update all the bound properties. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setvalue */ - setValue(value: {x: number, y: number}) { + setValue(value: { x: number, y: number }) { this.x.setValue(value.x); this.y.setValue(value.y); } /** - * Sets an offset that is applied on top of whatever value is set, whether - * via `setValue`, an animation, or `Animated.event`. Useful for compensating + * Sets an offset that is applied on top of whatever value is set, whether + * via `setValue`, an animation, or `Animated.event`. Useful for compensating * things like the start of a pan gesture. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#setoffset */ - setOffset(offset: {x: number, y: number}) { + setOffset(offset: { x: number, y: number }) { this.x.setOffset(offset.x); this.y.setOffset(offset.y); } /** - * Merges the offset value into the base value and resets the offset to zero. + * Merges the offset value into the base value and resets the offset to zero. * The final output of the value is unchanged. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#flattenoffset */ flattenOffset(): void { @@ -87,9 +82,9 @@ class AnimatedValueXY extends AnimatedWithChildren { } /** - * Sets the offset value to the base value, and resets the base value to + * Sets the offset value to the base value, and resets the base value to * zero. The final output of the value is unchanged. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#extractoffset */ extractOffset(): void { @@ -97,62 +92,62 @@ class AnimatedValueXY extends AnimatedWithChildren { this.y.extractOffset(); } - __getValue(): {x: number, y: number} { + __getValue(): { x: number, y: number } { return { x: this.x.__getValue(), - y: this.y.__getValue(), + y: this.y.__getValue() }; } /** * Stops any animation and resets the value to its original. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#resetanimation */ - resetAnimation(callback?: (value: {x: number, y: number}) => void): void { + resetAnimation(callback?: (value: { x: number, y: number }) => void): void { this.x.resetAnimation(); this.y.resetAnimation(); callback && callback(this.__getValue()); } /** - * Stops any running animation or tracking. `callback` is invoked with the - * final value after stopping the animation, which is useful for updating + * Stops any running animation or tracking. `callback` is invoked with the + * final value after stopping the animation, which is useful for updating * state to match the animation position with layout. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#stopanimation */ - stopAnimation(callback?: (value: {x: number, y: number}) => void): void { + stopAnimation(callback?: (value: { x: number, y: number }) => void): void { this.x.stopAnimation(); this.y.stopAnimation(); callback && callback(this.__getValue()); } /** - * Adds an asynchronous listener to the value so you can observe updates from - * animations. This is useful because there is no way to synchronously read + * Adds an asynchronous listener to the value so you can observe updates from + * animations. This is useful because there is no way to synchronously read * the value because it might be driven natively. - * + * * Returns a string that serves as an identifier for the listener. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#addlistener */ addListener(callback: ValueXYListenerCallback): string { const id = String(_uniqueId++); - const jointCallback = ({value: number}) => { + const jointCallback = ({ value: number }) => { callback(this.__getValue()); }; this._listeners[id] = { x: this.x.addListener(jointCallback), - y: this.y.addListener(jointCallback), + y: this.y.addListener(jointCallback) }; return id; } /** - * Unregister a listener. The `id` param shall match the identifier - * previously returned by `addListener()`. - * + * Unregister a listener. The `id` param shall match the identifier + * previously returned by `addListener()`. + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removelistener */ removeListener(id: string): void { @@ -163,7 +158,7 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Remove all registered listeners. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#removealllisteners */ removeAllListeners(): void { @@ -174,23 +169,23 @@ class AnimatedValueXY extends AnimatedWithChildren { /** * Converts `{x, y}` into `{left, top}` for use in style. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#getlayout */ - getLayout(): {[key: string]: AnimatedValue} { + getLayout(): { [key: string]: AnimatedValue } { return { left: this.x, - top: this.y, + top: this.y }; } /** * Converts `{x, y}` into a useable translation transform. - * + * * See http://facebook.github.io/react-native/docs/animatedvaluexy.html#gettranslatetransform */ - getTranslateTransform(): Array<{[key: string]: AnimatedValue}> { - return [{translateX: this.x}, {translateY: this.y}]; + getTranslateTransform(): Array<{ [key: string]: AnimatedValue }> { + return [{ translateX: this.x }, { translateY: this.y }]; } } diff --git a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedWithChildren.js b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedWithChildren.js index 4676437a..92157bb7 100644 --- a/packages/react-native-web/src/vendor/Animated/nodes/AnimatedWithChildren.js +++ b/packages/react-native-web/src/vendor/Animated/nodes/AnimatedWithChildren.js @@ -1,10 +1,8 @@ /** * 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. * * @providesModule AnimatedWithChildren * @flow @@ -30,7 +28,7 @@ class AnimatedWithChildren extends AnimatedNode { child.__makeNative(); NativeAnimatedHelper.API.connectAnimatedNodes( this.__getNativeTag(), - child.__getNativeTag(), + child.__getNativeTag() ); } } @@ -44,10 +42,7 @@ class AnimatedWithChildren extends AnimatedNode { if (this.__isNative) { // Only accept "native" animated nodes as children child.__makeNative(); - NativeAnimatedHelper.API.connectAnimatedNodes( - this.__getNativeTag(), - child.__getNativeTag(), - ); + NativeAnimatedHelper.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); } } @@ -60,7 +55,7 @@ class AnimatedWithChildren extends AnimatedNode { if (this.__isNative && child.__isNative) { NativeAnimatedHelper.API.disconnectAnimatedNodes( this.__getNativeTag(), - child.__getNativeTag(), + child.__getNativeTag() ); } this._children.splice(index, 1); diff --git a/packages/react-native-web/src/vendor/PanResponder/index.js b/packages/react-native-web/src/vendor/PanResponder/index.js index 3c6aad7a..5791a87c 100644 --- a/packages/react-native-web/src/vendor/PanResponder/index.js +++ b/packages/react-native-web/src/vendor/PanResponder/index.js @@ -1,10 +1,8 @@ /** * Copyright (c) 2013-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. * * @providesModule PanResponder */ @@ -14,10 +12,14 @@ const InteractionManager = require('../../exports/InteractionManager').default; const TouchHistoryMath = require('../TouchHistoryMath'); -const currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter; -const currentCentroidYOfTouchesChangedAfter = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter; -const previousCentroidXOfTouchesChangedAfter = TouchHistoryMath.previousCentroidXOfTouchesChangedAfter; -const previousCentroidYOfTouchesChangedAfter = TouchHistoryMath.previousCentroidYOfTouchesChangedAfter; +const currentCentroidXOfTouchesChangedAfter = + TouchHistoryMath.currentCentroidXOfTouchesChangedAfter; +const currentCentroidYOfTouchesChangedAfter = + TouchHistoryMath.currentCentroidYOfTouchesChangedAfter; +const previousCentroidXOfTouchesChangedAfter = + TouchHistoryMath.previousCentroidXOfTouchesChangedAfter; +const previousCentroidYOfTouchesChangedAfter = + TouchHistoryMath.previousCentroidYOfTouchesChangedAfter; const currentCentroidX = TouchHistoryMath.currentCentroidX; const currentCentroidY = TouchHistoryMath.currentCentroidY; @@ -120,7 +122,6 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY; */ const PanResponder = { - /** * * A graphical explanation of the touch data flow: @@ -184,7 +185,7 @@ const PanResponder = { * - vx/vy: Velocity. */ - _initializeGestureState: function (gestureState) { + _initializeGestureState: function(gestureState) { gestureState.moveX = 0; gestureState.moveY = 0; gestureState.x0 = 0; @@ -222,10 +223,16 @@ const PanResponder = { * typical responder callback pattern (without using `PanResponder`), but * avoids more dispatches than necessary. */ - _updateGestureStateOnMove: function (gestureState, touchHistory) { + _updateGestureStateOnMove: function(gestureState, touchHistory) { gestureState.numberActiveTouches = touchHistory.numberActiveTouches; - gestureState.moveX = currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo); - gestureState.moveY = currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo); + gestureState.moveX = currentCentroidXOfTouchesChangedAfter( + touchHistory, + gestureState._accountsForMovesUpTo + ); + gestureState.moveY = currentCentroidYOfTouchesChangedAfter( + touchHistory, + gestureState._accountsForMovesUpTo + ); const movedAfter = gestureState._accountsForMovesUpTo; const prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter); const x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter); @@ -276,39 +283,39 @@ const PanResponder = { * accordingly. (numberActiveTouches) may not be totally accurate unless you * are the responder. */ - create: function (config) { + create: function(config) { const interactionState = { - handle: (null: ?number), + handle: (null: ?number) }; const gestureState = { // Useful for debugging - stateID: Math.random(), + stateID: Math.random() }; PanResponder._initializeGestureState(gestureState); const panHandlers = { - onStartShouldSetResponder: function (e) { - return config.onStartShouldSetPanResponder === undefined ? - false : - config.onStartShouldSetPanResponder(e, gestureState); + onStartShouldSetResponder: function(e) { + return config.onStartShouldSetPanResponder === undefined + ? false + : config.onStartShouldSetPanResponder(e, gestureState); }, - onMoveShouldSetResponder: function (e) { - return config.onMoveShouldSetPanResponder === undefined ? - false : - config.onMoveShouldSetPanResponder(e, gestureState); + onMoveShouldSetResponder: function(e) { + return config.onMoveShouldSetPanResponder === undefined + ? false + : config.onMoveShouldSetPanResponder(e, gestureState); }, - onStartShouldSetResponderCapture: function (e) { + onStartShouldSetResponderCapture: function(e) { // TODO: Actually, we should reinitialize the state any time // touches.length increases from 0 active to > 0 active. if (e.nativeEvent.touches.length === 1) { PanResponder._initializeGestureState(gestureState); } gestureState.numberActiveTouches = e.touchHistory.numberActiveTouches; - return config.onStartShouldSetPanResponderCapture !== undefined ? - config.onStartShouldSetPanResponderCapture(e, gestureState) : - false; + return config.onStartShouldSetPanResponderCapture !== undefined + ? config.onStartShouldSetPanResponderCapture(e, gestureState) + : false; }, - onMoveShouldSetResponderCapture: function (e) { + onMoveShouldSetResponderCapture: function(e) { const touchHistory = e.touchHistory; // Responder system incorrectly dispatches should* to current responder // Filter out any touch moves past the first one - we would have @@ -317,12 +324,12 @@ const PanResponder = { return false; } PanResponder._updateGestureStateOnMove(gestureState, touchHistory); - return config.onMoveShouldSetPanResponderCapture ? - config.onMoveShouldSetPanResponderCapture(e, gestureState) : - false; + return config.onMoveShouldSetPanResponderCapture + ? config.onMoveShouldSetPanResponderCapture(e, gestureState) + : false; }, - onResponderGrant: function (e) { + onResponderGrant: function(e) { if (!interactionState.handle) { interactionState.handle = InteractionManager.createInteractionHandle(); } @@ -334,21 +341,21 @@ const PanResponder = { config.onPanResponderGrant(e, gestureState); } // TODO: t7467124 investigate if this can be removed - return config.onShouldBlockNativeResponder === undefined ? - true : - config.onShouldBlockNativeResponder(); + return config.onShouldBlockNativeResponder === undefined + ? true + : config.onShouldBlockNativeResponder(); }, - onResponderReject: function (e) { + onResponderReject: function(e) { clearInteractionHandle(interactionState, config.onPanResponderReject, e, gestureState); }, - onResponderRelease: function (e) { + onResponderRelease: function(e) { clearInteractionHandle(interactionState, config.onPanResponderRelease, e, gestureState); PanResponder._initializeGestureState(gestureState); }, - onResponderStart: function (e) { + onResponderStart: function(e) { const touchHistory = e.touchHistory; gestureState.numberActiveTouches = touchHistory.numberActiveTouches; if (config.onPanResponderStart) { @@ -356,7 +363,7 @@ const PanResponder = { } }, - onResponderMove: function (e) { + onResponderMove: function(e) { const touchHistory = e.touchHistory; // Guard against the dispatch of two touch moves when there are two // simultaneously changed touches. @@ -371,34 +378,34 @@ const PanResponder = { } }, - onResponderEnd: function (e) { + onResponderEnd: function(e) { const touchHistory = e.touchHistory; gestureState.numberActiveTouches = touchHistory.numberActiveTouches; clearInteractionHandle(interactionState, config.onPanResponderEnd, e, gestureState); }, - onResponderTerminate: function (e) { + onResponderTerminate: function(e) { clearInteractionHandle(interactionState, config.onPanResponderTerminate, e, gestureState); PanResponder._initializeGestureState(gestureState); }, - onResponderTerminationRequest: function (e) { - return config.onPanResponderTerminationRequest === undefined ? - true : - config.onPanResponderTerminationRequest(e, gestureState); + onResponderTerminationRequest: function(e) { + return config.onPanResponderTerminationRequest === undefined + ? true + : config.onPanResponderTerminationRequest(e, gestureState); } }; return { panHandlers, getInteractionHandle(): ?number { return interactionState.handle; - }, + } }; } }; function clearInteractionHandle( - interactionState: {handle: ?number}, + interactionState: { handle: ?number }, callback: Function, event: Object, gestureState: Object diff --git a/packages/react-native-web/src/vendor/PooledClass/index.js b/packages/react-native-web/src/vendor/PooledClass/index.js index 16c758a6..8bf23d61 100644 --- a/packages/react-native-web/src/vendor/PooledClass/index.js +++ b/packages/react-native-web/src/vendor/PooledClass/index.js @@ -2,11 +2,9 @@ /** * Copyright 2013-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. * * From React 16.0.0 */ diff --git a/packages/react-native-web/src/vendor/dangerousStyleValue/index.js b/packages/react-native-web/src/vendor/dangerousStyleValue/index.js index 38f8bc01..18c760d2 100644 --- a/packages/react-native-web/src/vendor/dangerousStyleValue/index.js +++ b/packages/react-native-web/src/vendor/dangerousStyleValue/index.js @@ -2,11 +2,9 @@ /** * Copyright 2013-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. * * @providesModule dangerousStyleValue * From React 16.0.0 diff --git a/packages/react-native-web/src/vendor/setValueForStyles/index.js b/packages/react-native-web/src/vendor/setValueForStyles/index.js index 0901bb8b..8db2f33a 100644 --- a/packages/react-native-web/src/vendor/setValueForStyles/index.js +++ b/packages/react-native-web/src/vendor/setValueForStyles/index.js @@ -4,11 +4,10 @@ * Copyright 2013-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. * - * From React 16.0.0 + * Based on React 16.3.0 */ import dangerousStyleValue from '../dangerousStyleValue'; diff --git a/packages/react-native-web/src/vendor/warnValidStyle/index.js b/packages/react-native-web/src/vendor/warnValidStyle/index.js index 69bf70ce..ce4f65d2 100644 --- a/packages/react-native-web/src/vendor/warnValidStyle/index.js +++ b/packages/react-native-web/src/vendor/warnValidStyle/index.js @@ -2,14 +2,12 @@ /** * Copyright 2013-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. * * @providesModule warnValidStyle - * From React 16.0.0 + * Based on React 16.3.0 */ var emptyFunction = require('fbjs/lib/emptyFunction'); diff --git a/types/fbjs.js b/types/fbjs.js index 45cbe8ab..c5406e25 100644 --- a/types/fbjs.js +++ b/types/fbjs.js @@ -1,10 +1,8 @@ /** * Copyright (c) 2013-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. */ declare module 'fbjs/lib/invariant' { diff --git a/website/storybook/1-components/View/examples/transforms.js b/website/storybook/1-components/View/examples/transforms.js index d18863b4..652d816b 100644 --- a/website/storybook/1-components/View/examples/transforms.js +++ b/website/storybook/1-components/View/examples/transforms.js @@ -2,23 +2,10 @@ /** * Copyright (c) 2013-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. * - * The examples provided by Facebook are for non-commercial testing and - * evaluation purposes only. - * - * Facebook reserves all rights not expressly granted. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL - * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * @flow */