Expose additional private modules

Summary: - TextInputState as TextInput.State
- Touchable
- flattenStyle as StyleSheet.flatten
- ReactNativeART as ART

Original discussion in #1821
Closes https://github.com/facebook/react-native/pull/3308

Reviewed By: sebmarkbage

Differential Revision: D2527152

Pulled By: javache

fb-gh-sync-id: 19d4ef9d4c0e6587b9f0793e1ca624aebb034f3b
This commit is contained in:
Brent Vatne 2015-11-05 03:31:11 -08:00 committed by facebook-github-bot-4
parent 7af752403e
commit 0da2004e88
6 changed files with 27 additions and 2 deletions

View File

@ -566,8 +566,14 @@ function Pattern(url, width, height, left, top) {
this._brush = [PATTERN, url, +left || 0, +top || 0, +width, +height];
}
var ReactART = {
// This doesn't work on iOS and is just a placeholder to get Spectrum running.
// I will try to eliminate this dependency in Spectrum and remove it from
// ReactART proper.
function CSSBackgroundPattern() {
return new Color('rgba(0,0,0,0)');
}
var ReactART = {
LinearGradient: LinearGradient,
RadialGradient: RadialGradient,
Pattern: Pattern,
@ -578,7 +584,7 @@ var ReactART = {
ClippingRectangle: ClippingRectangle,
Shape: Shape,
Text: Text,
CSSBackgroundPattern: CSSBackgroundPattern
};
module.exports = ReactART;

View File

@ -86,6 +86,11 @@ type Event = Object;
* ```
*/
var TextInput = React.createClass({
statics: {
/* TODO(brentvatne) docs are needed for this */
State: TextInputState,
},
propTypes: {
/**
* Can tell TextInput to automatically capitalize certain characters.

View File

@ -13,6 +13,7 @@
var StyleSheetRegistry = require('StyleSheetRegistry');
var StyleSheetValidation = require('StyleSheetValidation');
var flattenStyle = require('flattenStyle');
/**
* A StyleSheet is an abstraction similar to CSS StyleSheets
@ -59,6 +60,8 @@ var StyleSheetValidation = require('StyleSheetValidation');
* subsequent uses are going to refer an id (not implemented yet).
*/
class StyleSheet {
static flatten: typeof flattenStyle;
static create(obj: {[key: string]: any}): {[key: string]: number} {
var result = {};
for (var key in obj) {
@ -69,4 +72,7 @@ class StyleSheet {
}
}
/* TODO(brentvatne) docs are needed for this */
StyleSheet.flatten = flattenStyle;
module.exports = StyleSheet;

View File

@ -20,6 +20,7 @@
var ReactNative = Object.assign(Object.create(require('React')), {
// Components
ActivityIndicatorIOS: require('ActivityIndicatorIOS'),
ART: require('ReactNativeART'),
DatePickerIOS: require('DatePickerIOS'),
DrawerLayoutAndroid: require('DrawerLayoutAndroid'),
Image: require('Image'),
@ -43,6 +44,7 @@ var ReactNative = Object.assign(Object.create(require('React')), {
TextInput: require('TextInput'),
ToastAndroid: require('ToastAndroid'),
ToolbarAndroid: require('ToolbarAndroid'),
Touchable: require('Touchable'),
TouchableHighlight: require('TouchableHighlight'),
TouchableNativeFeedback: require('TouchableNativeFeedback'),
TouchableOpacity: require('TouchableOpacity'),

5
npm-shrinkwrap.json generated
View File

@ -7,6 +7,11 @@
"from": "absolute-path@0.0.0",
"resolved": "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz"
},
"art": {
"version": "0.10.0",
"from": "art@0.10.0",
"resolved": "https://registry.npmjs.org/art/-/art-0.10.0.tgz"
},
"babel": {
"version": "5.8.23",
"from": "babel@5.8.23",

View File

@ -54,6 +54,7 @@
},
"dependencies": {
"absolute-path": "^0.0.0",
"art": "^0.10.0",
"babel": "^5.8.23",
"babel-core": "^5.8.23",
"bser": "^1.0.2",