Skip to content

Commit 0da2004

Browse files
brentvatnefacebook-github-bot-4
authored andcommitted
Expose additional private modules
Summary: - TextInputState as TextInput.State - Touchable - flattenStyle as StyleSheet.flatten - ReactNativeART as ART Original discussion in facebook#1821 Closes facebook#3308 Reviewed By: sebmarkbage Differential Revision: D2527152 Pulled By: javache fb-gh-sync-id: 19d4ef9d4c0e6587b9f0793e1ca624aebb034f3b
1 parent 7af7524 commit 0da2004

File tree

6 files changed

+27
-2
lines changed

6 files changed

+27
-2
lines changed

Libraries/ART/ReactNativeART.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,14 @@ function Pattern(url, width, height, left, top) {
566566
this._brush = [PATTERN, url, +left || 0, +top || 0, +width, +height];
567567
}
568568

569-
var ReactART = {
569+
// This doesn't work on iOS and is just a placeholder to get Spectrum running.
570+
// I will try to eliminate this dependency in Spectrum and remove it from
571+
// ReactART proper.
572+
function CSSBackgroundPattern() {
573+
return new Color('rgba(0,0,0,0)');
574+
}
570575

576+
var ReactART = {
571577
LinearGradient: LinearGradient,
572578
RadialGradient: RadialGradient,
573579
Pattern: Pattern,
@@ -578,7 +584,7 @@ var ReactART = {
578584
ClippingRectangle: ClippingRectangle,
579585
Shape: Shape,
580586
Text: Text,
581-
587+
CSSBackgroundPattern: CSSBackgroundPattern
582588
};
583589

584590
module.exports = ReactART;

Libraries/Components/TextInput/TextInput.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ type Event = Object;
8686
* ```
8787
*/
8888
var TextInput = React.createClass({
89+
statics: {
90+
/* TODO(brentvatne) docs are needed for this */
91+
State: TextInputState,
92+
},
93+
8994
propTypes: {
9095
/**
9196
* Can tell TextInput to automatically capitalize certain characters.

Libraries/StyleSheet/StyleSheet.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
var StyleSheetRegistry = require('StyleSheetRegistry');
1515
var StyleSheetValidation = require('StyleSheetValidation');
16+
var flattenStyle = require('flattenStyle');
1617

1718
/**
1819
* A StyleSheet is an abstraction similar to CSS StyleSheets
@@ -59,6 +60,8 @@ var StyleSheetValidation = require('StyleSheetValidation');
5960
* subsequent uses are going to refer an id (not implemented yet).
6061
*/
6162
class StyleSheet {
63+
static flatten: typeof flattenStyle;
64+
6265
static create(obj: {[key: string]: any}): {[key: string]: number} {
6366
var result = {};
6467
for (var key in obj) {
@@ -69,4 +72,7 @@ class StyleSheet {
6972
}
7073
}
7174

75+
/* TODO(brentvatne) docs are needed for this */
76+
StyleSheet.flatten = flattenStyle;
77+
7278
module.exports = StyleSheet;

Libraries/react-native/react-native.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
var ReactNative = Object.assign(Object.create(require('React')), {
2121
// Components
2222
ActivityIndicatorIOS: require('ActivityIndicatorIOS'),
23+
ART: require('ReactNativeART'),
2324
DatePickerIOS: require('DatePickerIOS'),
2425
DrawerLayoutAndroid: require('DrawerLayoutAndroid'),
2526
Image: require('Image'),
@@ -43,6 +44,7 @@ var ReactNative = Object.assign(Object.create(require('React')), {
4344
TextInput: require('TextInput'),
4445
ToastAndroid: require('ToastAndroid'),
4546
ToolbarAndroid: require('ToolbarAndroid'),
47+
Touchable: require('Touchable'),
4648
TouchableHighlight: require('TouchableHighlight'),
4749
TouchableNativeFeedback: require('TouchableNativeFeedback'),
4850
TouchableOpacity: require('TouchableOpacity'),

npm-shrinkwrap.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
},
5555
"dependencies": {
5656
"absolute-path": "^0.0.0",
57+
"art": "^0.10.0",
5758
"babel": "^5.8.23",
5859
"babel-core": "^5.8.23",
5960
"bser": "^1.0.2",

0 commit comments

Comments
 (0)