10
10
*/
11
11
'use strict' ;
12
12
13
- const ColorPropType = require ( 'ColorPropType' ) ;
14
- const EdgeInsetsPropType = require ( 'EdgeInsetsPropType' ) ;
15
13
const NativeMethodsMixin = require ( 'NativeMethodsMixin' ) ;
16
14
const React = require ( 'React' ) ;
17
- const PropTypes = require ( 'prop-types' ) ;
18
15
const ReactNativeViewAttributes = require ( 'ReactNativeViewAttributes' ) ;
19
- const StyleSheetPropType = require ( 'StyleSheetPropType' ) ;
20
- const TextStylePropTypes = require ( 'TextStylePropTypes' ) ;
16
+ const TextPropTypes = require ( 'TextPropTypes' ) ;
21
17
const Touchable = require ( 'Touchable' ) ;
22
18
const UIManager = require ( 'UIManager' ) ;
23
19
@@ -27,8 +23,6 @@ const mergeFast = require('mergeFast');
27
23
const processColor = require ( 'processColor' ) ;
28
24
const { ViewContextTypes} = require ( 'ViewContext' ) ;
29
25
30
- const stylePropType = StyleSheetPropType ( TextStylePropTypes ) ;
31
-
32
26
const viewConfig = {
33
27
validAttributes : mergeFast ( ReactNativeViewAttributes . UIView , {
34
28
isHighlighted : true ,
@@ -55,113 +49,7 @@ import type {ViewChildContext} from 'ViewContext';
55
49
56
50
const Text = createReactClass ( {
57
51
displayName : 'Text' ,
58
- propTypes : {
59
- /**
60
- * When `numberOfLines` is set, this prop defines how text will be
61
- * truncated.
62
- *
63
- * See https://facebook.github.io/react-native/docs/text.html#ellipsizemode
64
- */
65
- ellipsizeMode : PropTypes . oneOf ( [ 'head' , 'middle' , 'tail' , 'clip' ] ) ,
66
- /**
67
- * Used to truncate the text with an ellipsis.
68
- *
69
- * See https://facebook.github.io/react-native/docs/text.html#numberoflines
70
- */
71
- numberOfLines : PropTypes . number ,
72
- /**
73
- * Set text break strategy on Android.
74
- *
75
- * See https://facebook.github.io/react-native/docs/text.html#textbreakstrategy
76
- */
77
- textBreakStrategy : PropTypes . oneOf ( [ 'simple' , 'highQuality' , 'balanced' ] ) ,
78
- /**
79
- * Invoked on mount and layout changes.
80
- *
81
- * See https://facebook.github.io/react-native/docs/text.html#onlayout
82
- */
83
- onLayout : PropTypes . func ,
84
- /**
85
- * This function is called on press.
86
- *
87
- * See https://facebook.github.io/react-native/docs/text.html#onpress
88
- */
89
- onPress : PropTypes . func ,
90
- /**
91
- * This function is called on long press.
92
- *
93
- * See https://facebook.github.io/react-native/docs/text.html#onlongpress
94
- */
95
- onLongPress : PropTypes . func ,
96
- /**
97
- * Defines how far your touch may move off of the button, before
98
- * deactivating the button.
99
- *
100
- * See https://facebook.github.io/react-native/docs/text.html#pressretentionoffset
101
- */
102
- pressRetentionOffset : EdgeInsetsPropType ,
103
- /**
104
- * Lets the user select text.
105
- *
106
- * See https://facebook.github.io/react-native/docs/text.html#selectable
107
- */
108
- selectable : PropTypes . bool ,
109
- /**
110
- * The highlight color of the text.
111
- *
112
- * See https://facebook.github.io/react-native/docs/text.html#selectioncolor
113
- */
114
- selectionColor : ColorPropType ,
115
- /**
116
- * When `true`, no visual change is made when text is pressed down.
117
- *
118
- * See https://facebook.github.io/react-native/docs/text.html#supperhighlighting
119
- */
120
- suppressHighlighting : PropTypes . bool ,
121
- style : stylePropType ,
122
- /**
123
- * Used to locate this view in end-to-end tests.
124
- *
125
- * See https://facebook.github.io/react-native/docs/text.html#testid
126
- */
127
- testID : PropTypes . string ,
128
- /**
129
- * Used to locate this view from native code.
130
- *
131
- * See https://facebook.github.io/react-native/docs/text.html#nativeid
132
- */
133
- nativeID : PropTypes . string ,
134
- /**
135
- * Whether fonts should scale to respect Text Size accessibility settings.
136
- *
137
- * See https://facebook.github.io/react-native/docs/text.html#allowfontscaling
138
- */
139
- allowFontScaling : PropTypes . bool ,
140
- /**
141
- * Indicates whether the view is an accessibility element.
142
- *
143
- * See https://facebook.github.io/react-native/docs/text.html#accessible
144
- */
145
- accessible : PropTypes . bool ,
146
- /**
147
- * Whether font should be scaled down automatically.
148
- *
149
- * See https://facebook.github.io/react-native/docs/text.html#adjustsfontsizetofit
150
- */
151
- adjustsFontSizeToFit : PropTypes . bool ,
152
- /**
153
- * Smallest possible scale a font can reach.
154
- *
155
- * See https://facebook.github.io/react-native/docs/text.html#minimumfontscale
156
- */
157
- minimumFontScale : PropTypes . number ,
158
- /**
159
- * Specifies the disabled state of the text view for testing purposes.
160
- *
161
- * See https://facebook.github.io/react-native/docs/text.html#disabled
162
- */
163
- disabled : PropTypes . bool ,
164
- } ,
52
+ propTypes : TextPropTypes ,
165
53
getDefaultProps ( ) : Object {
166
54
return {
167
55
accessible : true ,
0 commit comments