2015-02-19 20:10:52 -08:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-03-23 13:35:08 -07:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-02-19 20:10:52 -08:00
|
|
|
*
|
2018-09-28 00:48:09 -07:00
|
|
|
* @format strict-local
|
2015-03-24 18:33:05 -07:00
|
|
|
* @flow
|
2015-02-19 20:10:52 -08:00
|
|
|
*/
|
|
|
|
|
2015-04-16 18:17:19 -07:00
|
|
|
'use strict';
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-09-28 23:13:03 -07:00
|
|
|
const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
|
2018-03-03 15:04:46 -08:00
|
|
|
const TextStylePropTypes = require('TextStylePropTypes');
|
2018-10-01 12:13:06 -07:00
|
|
|
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-03-03 15:04:46 -08:00
|
|
|
const processColor = require('processColor');
|
|
|
|
const processTransform = require('processTransform');
|
|
|
|
const sizesDiffer = require('sizesDiffer');
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-09-28 00:48:09 -07:00
|
|
|
const ReactNativeStyleAttributes = {};
|
|
|
|
|
|
|
|
for (const attributeName of Object.keys({
|
2018-10-01 12:13:06 -07:00
|
|
|
...DeprecatedViewStylePropTypes,
|
2018-09-28 00:48:09 -07:00
|
|
|
...TextStylePropTypes,
|
2018-09-28 23:13:03 -07:00
|
|
|
...DeprecatedImageStylePropTypes,
|
2018-09-28 00:48:09 -07:00
|
|
|
})) {
|
|
|
|
ReactNativeStyleAttributes[attributeName] = true;
|
|
|
|
}
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-05-10 19:06:46 -07:00
|
|
|
ReactNativeStyleAttributes.transform = {process: processTransform};
|
|
|
|
ReactNativeStyleAttributes.shadowOffset = {diff: sizesDiffer};
|
2015-02-19 20:10:52 -08:00
|
|
|
|
2018-05-10 19:06:46 -07:00
|
|
|
const colorAttributes = {process: processColor};
|
2015-09-17 08:36:08 -07:00
|
|
|
ReactNativeStyleAttributes.backgroundColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.borderBottomColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.borderColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.borderLeftColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.borderRightColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.borderTopColor = colorAttributes;
|
2017-10-18 19:29:42 -07:00
|
|
|
ReactNativeStyleAttributes.borderStartColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.borderEndColor = colorAttributes;
|
2015-09-17 08:36:08 -07:00
|
|
|
ReactNativeStyleAttributes.color = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.shadowColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.textDecorationColor = colorAttributes;
|
|
|
|
ReactNativeStyleAttributes.tintColor = colorAttributes;
|
2016-01-01 09:32:59 -08:00
|
|
|
ReactNativeStyleAttributes.textShadowColor = colorAttributes;
|
2016-01-24 13:59:36 -08:00
|
|
|
ReactNativeStyleAttributes.overlayColor = colorAttributes;
|
2015-09-17 08:36:08 -07:00
|
|
|
|
2015-05-08 09:45:43 -07:00
|
|
|
module.exports = ReactNativeStyleAttributes;
|