deprecated-react-native-prop-types
Advanced tools
Comparing version 2.3.0 to 3.0.0
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -14,2 +14,5 @@ * This source code is licensed under the MIT license found in the | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
const colorPropType = function( | ||
@@ -16,0 +19,0 @@ isRequired, |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -4,0 +4,0 @@ * This source code is licensed under the MIT license found in the |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -14,9 +14,12 @@ * This source code is licensed under the MIT license found in the | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/Rect.js | ||
*/ | ||
const DeprecatedEdgeInsetsPropType = PropTypes.shape({ | ||
top: PropTypes.number, | ||
bottom: PropTypes.number, | ||
left: PropTypes.number, | ||
bottom: PropTypes.number, | ||
right: PropTypes.number, | ||
top: PropTypes.number, | ||
}); | ||
module.exports = DeprecatedEdgeInsetsPropType; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -12,2 +12,3 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedColorPropType = require('./DeprecatedColorPropType'); | ||
const DeprecatedEdgeInsetsPropType = require('./DeprecatedEdgeInsetsPropType'); | ||
@@ -17,27 +18,42 @@ const DeprecatedImageSourcePropType = require('./DeprecatedImageSourcePropType'); | ||
const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType'); | ||
const DeprecatedViewPropTypes = require('./DeprecatedViewPropTypes'); | ||
const PropTypes = require('prop-types'); | ||
module.exports = { | ||
style: DeprecatedStyleSheetPropType(DeprecatedImageStylePropTypes), | ||
source: DeprecatedImageSourcePropType, | ||
defaultSource: PropTypes.oneOfType([ | ||
/** | ||
* @see facebook/react-native/Libraries/Image/ImageProps.js | ||
*/ | ||
const DeprecatedImagePropType = { | ||
...DeprecatedViewPropTypes, | ||
alt: PropTypes.string, | ||
blurRadius: PropTypes.number, | ||
capInsets: DeprecatedEdgeInsetsPropType, | ||
crossOrigin: PropTypes.oneOf(['anonymous', 'use-credentials']), | ||
defaultSource: DeprecatedImageSourcePropType, | ||
fadeDuration: PropTypes.number, | ||
height: PropTypes.number, | ||
internal_analyticTag: PropTypes.string, | ||
loadingIndicatorSource: PropTypes.oneOfType([ | ||
PropTypes.shape({ | ||
uri: PropTypes.string, | ||
width: PropTypes.number, | ||
height: PropTypes.number, | ||
scale: PropTypes.number, | ||
}), | ||
PropTypes.number, | ||
]), | ||
accessible: PropTypes.bool, | ||
accessibilityLabel: PropTypes.node, | ||
blurRadius: PropTypes.number, | ||
capInsets: DeprecatedEdgeInsetsPropType, | ||
onError: PropTypes.func, | ||
onLoad: PropTypes.func, | ||
onLoadEnd: PropTypes.func, | ||
onLoadStart: PropTypes.func, | ||
onPartialLoad: PropTypes.func, | ||
onProgress: PropTypes.func, | ||
progressiveRenderingEnabled: PropTypes.bool, | ||
referrerPolicy: PropTypes.oneOf([ | ||
'no-referrer', | ||
'no-referrer-when-downgrade', | ||
'origin', | ||
'origin-when-cross-origin', | ||
'same-origin', | ||
'strict-origin', | ||
'strict-origin-when-cross-origin', | ||
'unsafe-url', | ||
]), | ||
resizeMethod: PropTypes.oneOf(['auto', 'resize', 'scale']), | ||
resizeMode: PropTypes.oneOf([ | ||
@@ -50,18 +66,11 @@ 'cover', | ||
]), | ||
source: DeprecatedImageSourcePropType, | ||
src: PropTypes.string, | ||
srcSet: PropTypes.string, | ||
style: DeprecatedStyleSheetPropType(DeprecatedImageStylePropTypes), | ||
testID: PropTypes.string, | ||
tintColor: DeprecatedColorPropType, | ||
width: PropTypes.number, | ||
}; | ||
onLayout: PropTypes.func, | ||
onLoadStart: PropTypes.func, | ||
onProgress: PropTypes.func, | ||
onError: PropTypes.func, | ||
onPartialLoad: PropTypes.func, | ||
onLoad: PropTypes.func, | ||
onLoadEnd: PropTypes.func, | ||
}; | ||
module.exports = DeprecatedImagePropType; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -14,17 +14,20 @@ * This source code is licensed under the MIT license found in the | ||
/** | ||
* @see facebook/react-native/Libraries/Image/ImageSource.js | ||
*/ | ||
const ImageURISourcePropType = PropTypes.shape({ | ||
uri: PropTypes.string, | ||
body: PropTypes.string, | ||
bundle: PropTypes.string, | ||
method: PropTypes.string, | ||
headers: PropTypes.objectOf(PropTypes.string), | ||
body: PropTypes.string, | ||
cache: PropTypes.oneOf([ | ||
'default', | ||
'reload', | ||
'force-cache', | ||
'only-if-cached', | ||
'reload', | ||
]), | ||
width: PropTypes.number, | ||
headers: PropTypes.objectOf(PropTypes.string), | ||
height: PropTypes.number, | ||
method: PropTypes.string, | ||
scale: PropTypes.number, | ||
uri: PropTypes.string, | ||
width: PropTypes.number, | ||
}); | ||
@@ -34,5 +37,3 @@ | ||
ImageURISourcePropType, | ||
// Opaque type returned by require('./image.jpg') | ||
PropTypes.number, | ||
// Multiple sources | ||
PropTypes.arrayOf(ImageURISourcePropType), | ||
@@ -39,0 +40,0 @@ ]); |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -16,9 +16,26 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedTransformPropTypes = require('./DeprecatedTransformPropTypes'); | ||
const ReactPropTypes = require('prop-types'); | ||
const PropTypes = require('prop-types'); | ||
const ImageStylePropTypes = { | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
const DeprecatedImageStylePropTypes = { | ||
...DeprecatedLayoutPropTypes, | ||
...DeprecatedShadowPropTypesIOS, | ||
...DeprecatedTransformPropTypes, | ||
resizeMode: ReactPropTypes.oneOf([ | ||
backfaceVisibility: PropTypes.oneOf(['hidden', 'visible']), | ||
backgroundColor: DeprecatedColorPropType, | ||
borderBottomLeftRadius: PropTypes.number, | ||
borderBottomRightRadius: PropTypes.number, | ||
borderColor: DeprecatedColorPropType, | ||
borderRadius: PropTypes.number, | ||
borderTopLeftRadius: PropTypes.number, | ||
borderTopRightRadius: PropTypes.number, | ||
borderWidth: PropTypes.number, | ||
objectFit: PropTypes.oneOf(['contain', 'cover', 'fill', 'scale-down']), | ||
opacity: PropTypes.number, | ||
overflow: PropTypes.oneOf(['hidden', 'visible']), | ||
overlayColor: PropTypes.string, | ||
tintColor: DeprecatedColorPropType, | ||
resizeMode: PropTypes.oneOf([ | ||
'center', | ||
@@ -30,40 +47,4 @@ 'contain', | ||
]), | ||
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']), | ||
backgroundColor: DeprecatedColorPropType, | ||
borderColor: DeprecatedColorPropType, | ||
borderWidth: ReactPropTypes.number, | ||
borderRadius: ReactPropTypes.number, | ||
overflow: ReactPropTypes.oneOf(['visible', 'hidden']), | ||
/** | ||
* Changes the color of all the non-transparent pixels to the tintColor. | ||
*/ | ||
tintColor: DeprecatedColorPropType, | ||
opacity: ReactPropTypes.number, | ||
/** | ||
* When the image has rounded corners, specifying an overlayColor will | ||
* cause the remaining space in the corners to be filled with a solid color. | ||
* This is useful in cases which are not supported by the Android | ||
* implementation of rounded corners: | ||
* - Certain resize modes, such as 'contain' | ||
* - Animated GIFs | ||
* | ||
* A typical way to use this prop is with images displayed on a solid | ||
* background and setting the `overlayColor` to the same color | ||
* as the background. | ||
* | ||
* For details of how this works under the hood, see | ||
* http://frescolib.org/docs/rounded-corners-and-circles.html | ||
* | ||
* @platform android | ||
*/ | ||
overlayColor: ReactPropTypes.string, | ||
// Android-Specific styles | ||
borderTopLeftRadius: ReactPropTypes.number, | ||
borderTopRightRadius: ReactPropTypes.number, | ||
borderBottomLeftRadius: ReactPropTypes.number, | ||
borderBottomRightRadius: ReactPropTypes.number, | ||
}; | ||
module.exports = ImageStylePropTypes; | ||
module.exports = DeprecatedImageStylePropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -12,179 +12,115 @@ * This source code is licensed under the MIT license found in the | ||
const ReactPropTypes = require('prop-types'); | ||
const PropTypes = require('prop-types'); | ||
const LayoutPropTypes = { | ||
display: ReactPropTypes.oneOf(['none', 'flex']), | ||
width: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
height: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
start: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
end: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), | ||
top: ReactPropTypes.oneOfType([ReactPropTypes.number, ReactPropTypes.string]), | ||
left: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
right: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
bottom: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
minWidth: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
maxWidth: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
minHeight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
maxHeight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
margin: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginVertical: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginHorizontal: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginTop: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginBottom: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginLeft: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginRight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginStart: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
marginEnd: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
padding: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingVertical: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingHorizontal: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingTop: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingBottom: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingLeft: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingRight: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingStart: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
paddingEnd: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
borderWidth: ReactPropTypes.number, | ||
borderTopWidth: ReactPropTypes.number, | ||
borderStartWidth: ReactPropTypes.number, | ||
borderEndWidth: ReactPropTypes.number, | ||
borderRightWidth: ReactPropTypes.number, | ||
borderBottomWidth: ReactPropTypes.number, | ||
borderLeftWidth: ReactPropTypes.number, | ||
position: ReactPropTypes.oneOf(['absolute', 'relative']), | ||
flexDirection: ReactPropTypes.oneOf([ | ||
'row', | ||
'row-reverse', | ||
'column', | ||
'column-reverse', | ||
]), | ||
flexWrap: ReactPropTypes.oneOf(['wrap', 'nowrap', 'wrap-reverse']), | ||
justifyContent: ReactPropTypes.oneOf([ | ||
const DimensionValuePropType = PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.string, | ||
]); | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
const DeprecatedLayoutPropTypes = { | ||
alignContent: PropTypes.oneOf([ | ||
'center', | ||
'flex-end', | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'space-around', | ||
'space-between', | ||
'space-around', | ||
'space-evenly', | ||
'stretch', | ||
]), | ||
alignItems: ReactPropTypes.oneOf([ | ||
alignItems: PropTypes.oneOf([ | ||
'baseline', | ||
'center', | ||
'flex-end', | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'stretch', | ||
'baseline', | ||
]), | ||
alignSelf: ReactPropTypes.oneOf([ | ||
alignSelf: PropTypes.oneOf([ | ||
'auto', | ||
'baseline', | ||
'center', | ||
'flex-end', | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'stretch', | ||
'baseline', | ||
]), | ||
alignContent: ReactPropTypes.oneOf([ | ||
aspectRatio: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
borderBottomWidth: PropTypes.number, | ||
borderEndWidth: PropTypes.number, | ||
borderLeftWidth: PropTypes.number, | ||
borderRightWidth: PropTypes.number, | ||
borderStartWidth: PropTypes.number, | ||
borderTopWidth: PropTypes.number, | ||
borderWidth: PropTypes.number, | ||
bottom: DimensionValuePropType, | ||
columnGap: PropTypes.number, | ||
direction: PropTypes.oneOf(['inherit', 'ltr', 'rtl']), | ||
display: PropTypes.oneOf(['flex', 'none']), | ||
end: DimensionValuePropType, | ||
flex: PropTypes.number, | ||
flexBasis: DimensionValuePropType, | ||
flexDirection: PropTypes.oneOf([ | ||
'column', | ||
'column-reverse', | ||
'row', | ||
'row-reverse', | ||
]), | ||
flexGrow: PropTypes.number, | ||
flexShrink: PropTypes.number, | ||
flexWrap: PropTypes.oneOf(['nowrap', 'wrap', 'wrap-reverse']), | ||
gap: PropTypes.number, | ||
height: DimensionValuePropType, | ||
justifyContent: PropTypes.oneOf([ | ||
'center', | ||
'flex-end', | ||
'flex-start', | ||
'flex-end', | ||
'center', | ||
'stretch', | ||
'space-around', | ||
'space-between', | ||
'space-around', | ||
'space-evenly', | ||
]), | ||
overflow: ReactPropTypes.oneOf(['visible', 'hidden', 'scroll']), | ||
flex: ReactPropTypes.number, | ||
flexGrow: ReactPropTypes.number, | ||
flexShrink: ReactPropTypes.number, | ||
flexBasis: ReactPropTypes.oneOfType([ | ||
ReactPropTypes.number, | ||
ReactPropTypes.string, | ||
]), | ||
aspectRatio: ReactPropTypes.number, | ||
zIndex: ReactPropTypes.number, | ||
direction: ReactPropTypes.oneOf(['inherit', 'ltr', 'rtl']), | ||
left: DimensionValuePropType, | ||
margin: DimensionValuePropType, | ||
marginBlock: DimensionValuePropType, | ||
marginBlockEnd: DimensionValuePropType, | ||
marginBlockStart: DimensionValuePropType, | ||
marginBottom: DimensionValuePropType, | ||
marginEnd: DimensionValuePropType, | ||
marginHorizontal: DimensionValuePropType, | ||
marginInline: DimensionValuePropType, | ||
marginInlineEnd: DimensionValuePropType, | ||
marginInlineStart: DimensionValuePropType, | ||
marginLeft: DimensionValuePropType, | ||
marginRight: DimensionValuePropType, | ||
marginStart: DimensionValuePropType, | ||
marginTop: DimensionValuePropType, | ||
marginVertical: DimensionValuePropType, | ||
maxHeight: DimensionValuePropType, | ||
maxWidth: DimensionValuePropType, | ||
minHeight: DimensionValuePropType, | ||
minWidth: DimensionValuePropType, | ||
overflow: PropTypes.oneOf(['hidden', 'scroll', 'visible']), | ||
padding: DimensionValuePropType, | ||
paddingBlock: DimensionValuePropType, | ||
paddingBlockEnd: DimensionValuePropType, | ||
paddingBlockStart: DimensionValuePropType, | ||
paddingBottom: DimensionValuePropType, | ||
paddingEnd: DimensionValuePropType, | ||
paddingHorizontal: DimensionValuePropType, | ||
paddingInline: DimensionValuePropType, | ||
paddingInlineEnd: DimensionValuePropType, | ||
paddingInlineStart: DimensionValuePropType, | ||
paddingLeft: DimensionValuePropType, | ||
paddingRight: DimensionValuePropType, | ||
paddingStart: DimensionValuePropType, | ||
paddingTop: DimensionValuePropType, | ||
paddingVertical: DimensionValuePropType, | ||
position: PropTypes.oneOf(['absolute', 'relative']), | ||
right: DimensionValuePropType, | ||
rowGap: PropTypes.number, | ||
start: DimensionValuePropType, | ||
top: DimensionValuePropType, | ||
width: DimensionValuePropType, | ||
zIndex: PropTypes.number, | ||
}; | ||
module.exports = LayoutPropTypes; | ||
module.exports = DeprecatedLayoutPropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -14,2 +14,5 @@ * This source code is licensed under the MIT license found in the | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
const PointPropType = PropTypes.shape({ | ||
@@ -16,0 +19,0 @@ x: PropTypes.number, |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -13,14 +13,17 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedColorPropType = require('./DeprecatedColorPropType'); | ||
const ReactPropTypes = require('prop-types'); | ||
const PropTypes = require('prop-types'); | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
const DeprecatedShadowPropTypesIOS = { | ||
shadowColor: DeprecatedColorPropType, | ||
shadowOffset: ReactPropTypes.shape({ | ||
width: ReactPropTypes.number, | ||
height: ReactPropTypes.number, | ||
shadowOffset: PropTypes.shape({ | ||
height: PropTypes.number, | ||
width: PropTypes.number, | ||
}), | ||
shadowOpacity: ReactPropTypes.number, | ||
shadowRadius: ReactPropTypes.number, | ||
shadowOpacity: PropTypes.number, | ||
shadowRadius: PropTypes.number, | ||
}; | ||
module.exports = DeprecatedShadowPropTypesIOS; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -4,0 +4,0 @@ * This source code is licensed under the MIT license found in the |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -18,471 +18,193 @@ * This source code is licensed under the MIT license found in the | ||
const DataDetectorTypes = [ | ||
'phoneNumber', | ||
'link', | ||
'address', | ||
'all', | ||
'calendarEvent', | ||
'link', | ||
'none', | ||
'all', | ||
'phoneNumber', | ||
]; | ||
module.exports = { | ||
/** | ||
* @see facebook/react-native/Libraries/TextInput/TextInput.js | ||
*/ | ||
const DeprecatedTextInputPropTypes = { | ||
...DeprecatedViewPropTypes, | ||
/** | ||
* Can tell `TextInput` to automatically capitalize certain characters. | ||
* | ||
* - `characters`: all characters. | ||
* - `words`: first letter of each word. | ||
* - `sentences`: first letter of each sentence (*default*). | ||
* - `none`: don't auto capitalize anything. | ||
*/ | ||
allowFontScaling: PropTypes.bool, | ||
autoCapitalize: PropTypes.oneOf(['none', 'sentences', 'words', 'characters']), | ||
/** | ||
* Determines which content to suggest on auto complete, e.g.`username`. | ||
* To disable auto complete, use `off`. | ||
* | ||
* *Android Only* | ||
* | ||
* The following values work on Android only: | ||
* | ||
* - `username` | ||
* - `password` | ||
* - `email` | ||
* - `name` | ||
* - `tel` | ||
* - `street-address` | ||
* - `postal-code` | ||
* - `cc-number` | ||
* - `cc-csc` | ||
* - `cc-exp` | ||
* - `cc-exp-month` | ||
* - `cc-exp-year` | ||
* - `off` | ||
* | ||
* @platform android | ||
*/ | ||
autoCompleteType: PropTypes.oneOf([ | ||
autoComplete: PropTypes.oneOf([ | ||
'additional-name', | ||
'address-line1', | ||
'address-line2', | ||
'bday', | ||
'bday-day', | ||
'bday-month', | ||
'bday-year', | ||
'birthdate-day', | ||
'birthdate-full', | ||
'birthdate-month', | ||
'birthdate-year', | ||
'cc-csc', | ||
'cc-exp', | ||
'cc-exp-day', | ||
'cc-exp-month', | ||
'cc-exp-year', | ||
'cc-number', | ||
'country', | ||
'current-password', | ||
'email', | ||
'family-name', | ||
'gender', | ||
'given-name', | ||
'honorific-prefix', | ||
'honorific-suffix', | ||
'name', | ||
'name-family', | ||
'name-given', | ||
'name-middle', | ||
'name-middle-initial', | ||
'name-prefix', | ||
'name-suffix', | ||
'new-password', | ||
'nickname', | ||
'off', | ||
'one-time-code', | ||
'organization', | ||
'organization-title', | ||
'password', | ||
'password-new', | ||
'postal-address', | ||
'postal-address-country', | ||
'postal-address-extended', | ||
'postal-address-extended-postal-code', | ||
'postal-address-locality', | ||
'postal-address-region', | ||
'postal-code', | ||
'sex', | ||
'sms-otp', | ||
'street-address', | ||
'tel', | ||
'tel-country-code', | ||
'tel-device', | ||
'tel-national', | ||
'url', | ||
'username', | ||
'off', | ||
'username-new', | ||
]), | ||
/** | ||
* If `false`, disables auto-correct. The default value is `true`. | ||
*/ | ||
autoCorrect: PropTypes.bool, | ||
/** | ||
* If `false`, disables spell-check style (i.e. red underlines). | ||
* The default value is inherited from `autoCorrect`. | ||
* @platform ios | ||
*/ | ||
spellCheck: PropTypes.bool, | ||
/** | ||
* If `true`, focuses the input on `componentDidMount`. | ||
* The default value is `false`. | ||
*/ | ||
autoFocus: PropTypes.bool, | ||
/** | ||
* Specifies whether fonts should scale to respect Text Size accessibility settings. The | ||
* default is `true`. | ||
*/ | ||
allowFontScaling: PropTypes.bool, | ||
/** | ||
* Specifies largest possible scale a font can reach when `allowFontScaling` is enabled. | ||
* Possible values: | ||
* `null/undefined` (default): inherit from the parent node or the global default (0) | ||
* `0`: no max, ignore parent/global default | ||
* `>= 1`: sets the maxFontSizeMultiplier of this node to this value | ||
*/ | ||
maxFontSizeMultiplier: PropTypes.number, | ||
/** | ||
* If `false`, text is not editable. The default value is `true`. | ||
*/ | ||
blurOnSubmit: PropTypes.bool, | ||
caretHidden: PropTypes.bool, | ||
clearButtonMode: PropTypes.oneOf([ | ||
'always', | ||
'never', | ||
'unless-editing', | ||
'while-editing', | ||
]), | ||
clearTextOnFocus: PropTypes.bool, | ||
cursorColor: DeprecatedColorPropType, | ||
contextMenuHidden: PropTypes.bool, | ||
dataDetectorTypes: PropTypes.oneOfType([ | ||
PropTypes.oneOf(DataDetectorTypes), | ||
PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)), | ||
]), | ||
defaultValue: PropTypes.string, | ||
disableFullscreenUI: PropTypes.bool, | ||
editable: PropTypes.bool, | ||
/** | ||
* Determines which keyboard to open, e.g.`numeric`. | ||
* | ||
* The following values work across platforms: | ||
* | ||
* - `default` | ||
* - `numeric` | ||
* - `number-pad` | ||
* - `decimal-pad` | ||
* - `email-address` | ||
* - `phone-pad` | ||
* | ||
* *iOS Only* | ||
* | ||
* The following values work on iOS only: | ||
* | ||
* - `ascii-capable` | ||
* - `numbers-and-punctuation` | ||
* - `url` | ||
* - `name-phone-pad` | ||
* - `twitter` | ||
* - `web-search` | ||
* - `ascii-capable-number-pad` | ||
* | ||
* *Android Only* | ||
* | ||
* The following values work on Android only: | ||
* | ||
* - `visible-password` | ||
*/ | ||
enablesReturnKeyAutomatically: PropTypes.bool, | ||
enterKeyHint: PropTypes.oneOf([ | ||
'done', | ||
'enter', | ||
'go', | ||
'next', | ||
'previous', | ||
'search', | ||
'send', | ||
]), | ||
inlineImageLeft: PropTypes.string, | ||
inlineImagePadding: PropTypes.number, | ||
inputAccessoryViewID: PropTypes.string, | ||
inputMode: PropTypes.oneOf([ | ||
'decimal', | ||
'email', | ||
'none', | ||
'numeric', | ||
'search', | ||
'tel', | ||
'text', | ||
'url', | ||
]), | ||
keyboardAppearance: PropTypes.oneOf(['default', 'dark', 'light']), | ||
keyboardType: PropTypes.oneOf([ | ||
// Cross-platform | ||
'ascii-capable', | ||
'ascii-capable-number-pad', | ||
'decimal-pad', | ||
'default', | ||
'email-address', | ||
'name-phone-pad', | ||
'number-pad', | ||
'numbers-and-punctuation', | ||
'numeric', | ||
'phone-pad', | ||
'number-pad', | ||
// iOS-only | ||
'ascii-capable', | ||
'numbers-and-punctuation', | ||
'twitter', | ||
'url', | ||
'name-phone-pad', | ||
'decimal-pad', | ||
'twitter', | ||
'visible-password', | ||
'web-search', | ||
// iOS 10+ only | ||
'ascii-capable-number-pad', | ||
// Android-only | ||
'visible-password', | ||
]), | ||
/** | ||
* Determines the color of the keyboard. | ||
* @platform ios | ||
*/ | ||
keyboardAppearance: PropTypes.oneOf(['default', 'light', 'dark']), | ||
/** | ||
* Determines how the return key should look. On Android you can also use | ||
* `returnKeyLabel`. | ||
* | ||
* *Cross platform* | ||
* | ||
* The following values work across platforms: | ||
* | ||
* - `done` | ||
* - `go` | ||
* - `next` | ||
* - `search` | ||
* - `send` | ||
* | ||
* *Android Only* | ||
* | ||
* The following values work on Android only: | ||
* | ||
* - `none` | ||
* - `previous` | ||
* | ||
* *iOS Only* | ||
* | ||
* The following values work on iOS only: | ||
* | ||
* - `default` | ||
* - `emergency-call` | ||
* - `google` | ||
* - `join` | ||
* - `route` | ||
* - `yahoo` | ||
*/ | ||
returnKeyType: PropTypes.oneOf([ | ||
// Cross-platform | ||
'done', | ||
'go', | ||
'next', | ||
'search', | ||
'send', | ||
// Android-only | ||
lineBreakStrategyIOS: PropTypes.oneOf([ | ||
'hangul-word', | ||
'none', | ||
'previous', | ||
// iOS-only | ||
'default', | ||
'emergency-call', | ||
'google', | ||
'join', | ||
'route', | ||
'yahoo', | ||
'push-out', | ||
'standard', | ||
]), | ||
/** | ||
* Sets the return key to the label. Use it instead of `returnKeyType`. | ||
* @platform android | ||
*/ | ||
returnKeyLabel: PropTypes.string, | ||
/** | ||
* Limits the maximum number of characters that can be entered. Use this | ||
* instead of implementing the logic in JS to avoid flicker. | ||
*/ | ||
maxFontSizeMultiplier: PropTypes.number, | ||
maxLength: PropTypes.number, | ||
/** | ||
* Sets the number of lines for a `TextInput`. Use it with multiline set to | ||
* `true` to be able to fill the lines. | ||
* @platform android | ||
*/ | ||
multiline: PropTypes.bool, | ||
numberOfLines: PropTypes.number, | ||
/** | ||
* When `false`, if there is a small amount of space available around a text input | ||
* (e.g. landscape orientation on a phone), the OS may choose to have the user edit | ||
* the text inside of a full screen text input mode. When `true`, this feature is | ||
* disabled and users will always edit the text directly inside of the text input. | ||
* Defaults to `false`. | ||
* @platform android | ||
*/ | ||
disableFullscreenUI: PropTypes.bool, | ||
/** | ||
* If `true`, the keyboard disables the return key when there is no text and | ||
* automatically enables it when there is text. The default value is `false`. | ||
* @platform ios | ||
*/ | ||
enablesReturnKeyAutomatically: PropTypes.bool, | ||
/** | ||
* If `true`, the text input can be multiple lines. | ||
* The default value is `false`. | ||
*/ | ||
multiline: PropTypes.bool, | ||
/** | ||
* Set text break strategy on Android API Level 23+, possible values are `simple`, `highQuality`, `balanced` | ||
* The default value is `simple`. | ||
* @platform android | ||
*/ | ||
textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']), | ||
/** | ||
* Callback that is called when the text input is blurred. | ||
*/ | ||
onBlur: PropTypes.func, | ||
/** | ||
* Callback that is called when the text input is focused. | ||
*/ | ||
onFocus: PropTypes.func, | ||
/** | ||
* Callback that is called when the text input's text changes. | ||
*/ | ||
onChange: PropTypes.func, | ||
/** | ||
* Callback that is called when the text input's text changes. | ||
* Changed text is passed as an argument to the callback handler. | ||
*/ | ||
onChangeText: PropTypes.func, | ||
/** | ||
* Callback that is called when the text input's content size changes. | ||
* This will be called with | ||
* `{ nativeEvent: { contentSize: { width, height } } }`. | ||
* | ||
* Only called for multiline text inputs. | ||
*/ | ||
onContentSizeChange: PropTypes.func, | ||
onTextInput: PropTypes.func, | ||
/** | ||
* Callback that is called when text input ends. | ||
*/ | ||
onEndEditing: PropTypes.func, | ||
/** | ||
* Callback that is called when the text input selection is changed. | ||
* This will be called with | ||
* `{ nativeEvent: { selection: { start, end } } }`. | ||
*/ | ||
onSelectionChange: PropTypes.func, | ||
/** | ||
* Callback that is called when the text input's submit button is pressed. | ||
* Invalid if `multiline={true}` is specified. | ||
*/ | ||
onSubmitEditing: PropTypes.func, | ||
/** | ||
* Callback that is called when a key is pressed. | ||
* This will be called with `{ nativeEvent: { key: keyValue } }` | ||
* where `keyValue` is `'Enter'` or `'Backspace'` for respective keys and | ||
* the typed-in character otherwise including `' '` for space. | ||
* Fires before `onChange` callbacks. | ||
*/ | ||
onFocus: PropTypes.func, | ||
onKeyPress: PropTypes.func, | ||
/** | ||
* Invoked on mount and layout changes with `{x, y, width, height}`. | ||
*/ | ||
onLayout: PropTypes.func, | ||
/** | ||
* Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`. | ||
* May also contain other properties from ScrollEvent but on Android contentSize | ||
* is not provided for performance reasons. | ||
*/ | ||
onScroll: PropTypes.func, | ||
/** | ||
* The string that will be rendered before text input has been entered. | ||
*/ | ||
onSelectionChange: PropTypes.func, | ||
onSubmitEditing: PropTypes.func, | ||
onTextInput: PropTypes.func, | ||
placeholder: PropTypes.string, | ||
/** | ||
* The text color of the placeholder string. | ||
*/ | ||
placeholderTextColor: DeprecatedColorPropType, | ||
/** | ||
* If `false`, scrolling of the text view will be disabled. | ||
* The default value is `true`. Does only work with 'multiline={true}'. | ||
* @platform ios | ||
*/ | ||
readOnly: PropTypes.bool, | ||
rejectResponderTermination: PropTypes.bool, | ||
returnKeyLabel: PropTypes.string, | ||
returnKeyType: PropTypes.oneOf([ | ||
'default', | ||
'done', | ||
'emergency-call', | ||
'go', | ||
'google', | ||
'join', | ||
'next', | ||
'none', | ||
'previous', | ||
'route', | ||
'search', | ||
'send', | ||
'yahoo', | ||
]), | ||
rows: PropTypes.number, | ||
scrollEnabled: PropTypes.bool, | ||
/** | ||
* If `true`, the text input obscures the text entered so that sensitive text | ||
* like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'. | ||
*/ | ||
secureTextEntry: PropTypes.bool, | ||
/** | ||
* The highlight and cursor color of the text input. | ||
*/ | ||
selectionColor: DeprecatedColorPropType, | ||
/** | ||
* The start and end of the text input's selection. Set start and end to | ||
* the same value to position the cursor. | ||
*/ | ||
selection: PropTypes.shape({ | ||
end: PropTypes.number, | ||
start: PropTypes.number.isRequired, | ||
end: PropTypes.number, | ||
}), | ||
/** | ||
* The value to show for the text input. `TextInput` is a controlled | ||
* component, which means the native value will be forced to match this | ||
* value prop if provided. For most uses, this works great, but in some | ||
* cases this may cause flickering - one common cause is preventing edits | ||
* by keeping value the same. In addition to simply setting the same value, | ||
* either set `editable={false}`, or set/update `maxLength` to prevent | ||
* unwanted edits without flicker. | ||
*/ | ||
value: PropTypes.string, | ||
/** | ||
* Provides an initial value that will change when the user starts typing. | ||
* Useful for simple use-cases where you do not want to deal with listening | ||
* to events and updating the value prop to keep the controlled state in sync. | ||
*/ | ||
defaultValue: PropTypes.string, | ||
/** | ||
* When the clear button should appear on the right side of the text view. | ||
* This property is supported only for single-line TextInput component. | ||
* @platform ios | ||
*/ | ||
clearButtonMode: PropTypes.oneOf([ | ||
'never', | ||
'while-editing', | ||
'unless-editing', | ||
'always', | ||
]), | ||
/** | ||
* If `true`, clears the text field automatically when editing begins. | ||
* @platform ios | ||
*/ | ||
clearTextOnFocus: PropTypes.bool, | ||
/** | ||
* If `true`, all text will automatically be selected on focus. | ||
*/ | ||
selectionColor: DeprecatedColorPropType, | ||
selectTextOnFocus: PropTypes.bool, | ||
/** | ||
* If `true`, the text field will blur when submitted. | ||
* The default value is true for single-line fields and false for | ||
* multiline fields. Note that for multiline fields, setting `blurOnSubmit` | ||
* to `true` means that pressing return will blur the field and trigger the | ||
* `onSubmitEditing` event instead of inserting a newline into the field. | ||
*/ | ||
blurOnSubmit: PropTypes.bool, | ||
/** | ||
* Note that not all Text styles are supported, an incomplete list of what is not supported includes: | ||
* | ||
* - `borderLeftWidth` | ||
* - `borderTopWidth` | ||
* - `borderRightWidth` | ||
* - `borderBottomWidth` | ||
* - `borderTopLeftRadius` | ||
* - `borderTopRightRadius` | ||
* - `borderBottomRightRadius` | ||
* - `borderBottomLeftRadius` | ||
* | ||
* see [Issue#7070](https://github.com/facebook/react-native/issues/7070) | ||
* for more detail. | ||
* | ||
* [Styles](docs/style.html) | ||
*/ | ||
showSoftInputOnFocus: PropTypes.bool, | ||
spellCheck: PropTypes.bool, | ||
style: DeprecatedTextPropTypes.style, | ||
/** | ||
* The color of the `TextInput` underline. | ||
* @platform android | ||
*/ | ||
underlineColorAndroid: DeprecatedColorPropType, | ||
/** | ||
* If defined, the provided image resource will be rendered on the left. | ||
* The image resource must be inside `/android/app/src/main/res/drawable` and referenced | ||
* like | ||
* ``` | ||
* <TextInput | ||
* inlineImageLeft='search_icon' | ||
* /> | ||
* ``` | ||
* @platform android | ||
*/ | ||
inlineImageLeft: PropTypes.string, | ||
/** | ||
* Padding between the inline image, if any, and the text input itself. | ||
* @platform android | ||
*/ | ||
inlineImagePadding: PropTypes.number, | ||
/** | ||
* If `true`, allows TextInput to pass touch events to the parent component. | ||
* This allows components such as SwipeableListView to be swipeable from the TextInput on iOS, | ||
* as is the case on Android by default. | ||
* If `false`, TextInput always asks to handle the input (except when disabled). | ||
* @platform ios | ||
*/ | ||
rejectResponderTermination: PropTypes.bool, | ||
/** | ||
* Determines the types of data converted to clickable URLs in the text input. | ||
* Only valid if `multiline={true}` and `editable={false}`. | ||
* By default no data types are detected. | ||
* | ||
* You can provide one type or an array of many types. | ||
* | ||
* Possible values for `dataDetectorTypes` are: | ||
* | ||
* - `'phoneNumber'` | ||
* - `'link'` | ||
* - `'address'` | ||
* - `'calendarEvent'` | ||
* - `'none'` | ||
* - `'all'` | ||
* | ||
* @platform ios | ||
*/ | ||
dataDetectorTypes: PropTypes.oneOfType([ | ||
PropTypes.oneOf(DataDetectorTypes), | ||
PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)), | ||
]), | ||
/** | ||
* If `true`, caret is hidden. The default value is `false`. | ||
* This property is supported only for single-line TextInput component on iOS. | ||
*/ | ||
caretHidden: PropTypes.bool, | ||
/* | ||
* If `true`, contextMenuHidden is hidden. The default value is `false`. | ||
*/ | ||
contextMenuHidden: PropTypes.bool, | ||
/** | ||
* An optional identifier which links a custom InputAccessoryView to | ||
* this text input. The InputAccessoryView is rendered above the | ||
* keyboard when this text input is focused. | ||
* @platform ios | ||
*/ | ||
inputAccessoryViewID: PropTypes.string, | ||
/** | ||
* Give the keyboard and the system information about the | ||
* expected semantic meaning for the content that users enter. | ||
* @platform ios | ||
*/ | ||
submitBehavior: PropTypes.oneOf(['blurAndSubmit', 'newline', 'submit']), | ||
textBreakStrategy: PropTypes.oneOf(['balanced', 'highQuality', 'simple']), | ||
textContentType: PropTypes.oneOf([ | ||
'none', | ||
'URL', | ||
'addressCity', | ||
@@ -503,4 +225,8 @@ 'addressCityAndState', | ||
'nameSuffix', | ||
'newPassword', | ||
'nickname', | ||
'none', | ||
'oneTimeCode', | ||
'organizationName', | ||
'password', | ||
'postalCode', | ||
@@ -511,12 +237,9 @@ 'streetAddressLine1', | ||
'telephoneNumber', | ||
'URL', | ||
'username', | ||
'password', | ||
'newPassword', | ||
'oneTimeCode', | ||
]), | ||
/** | ||
* When `false`, it will prevent the soft keyboard from showing when the field is focused. | ||
* Defaults to `true`. | ||
*/ | ||
showSoftInputOnFocus: PropTypes.bool, | ||
underlineColorAndroid: DeprecatedColorPropType, | ||
value: PropTypes.string, | ||
}; | ||
module.exports = DeprecatedTextInputPropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -15,131 +15,92 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType'); | ||
const DeprecatedTextStylePropTypes = require('./DeprecatedTextStylePropTypes'); | ||
const { | ||
AccessibilityActionInfoPropType, | ||
AccessibilityRolePropType, | ||
AccessibilityStatePropType, | ||
AccessibilityValuePropType, | ||
RolePropType, | ||
} = require('./DeprecatedViewAccessibility'); | ||
const PropTypes = require('prop-types'); | ||
const DeprecatedTextStylePropTypes = require('./DeprecatedTextStylePropTypes'); | ||
const stylePropType = DeprecatedStyleSheetPropType( | ||
DeprecatedTextStylePropTypes, | ||
); | ||
const DataDetectorTypes = ['phoneNumber', 'link', 'email', 'none', 'all']; | ||
module.exports = { | ||
/** | ||
* When `numberOfLines` is set, this prop defines how text will be | ||
* truncated. | ||
* | ||
* See https://reactnative.dev/docs/text.html#ellipsizemode | ||
*/ | ||
ellipsizeMode: PropTypes.oneOf(['head', 'middle', 'tail', 'clip']), | ||
/** | ||
* Used to truncate the text with an ellipsis. | ||
* | ||
* See https://reactnative.dev/docs/text.html#numberoflines | ||
*/ | ||
/** | ||
* @see facebook/react-native/Libraries/Text/TextProps.js | ||
*/ | ||
const DeprecatedTextPropTypes = { | ||
'aria-busy': PropTypes.bool, | ||
'aria-checked': PropTypes.oneOfType([ | ||
PropTypes.bool, | ||
PropTypes.oneOf(['mixed']), | ||
]), | ||
'aria-disabled': PropTypes.bool, | ||
'aria-expanded': PropTypes.bool, | ||
'aria-label': PropTypes.string, | ||
'aria-labelledby': PropTypes.string, | ||
'aria-selected': PropTypes.bool, | ||
accessibilityActions: PropTypes.arrayOf(AccessibilityActionInfoPropType), | ||
accessibilityHint: PropTypes.string, | ||
accessibilityLabel: PropTypes.string, | ||
accessibilityLanguage: PropTypes.string, | ||
accessibilityRole: AccessibilityRolePropType, | ||
accessibilityState: AccessibilityStatePropType, | ||
accessible: PropTypes.bool, | ||
adjustsFontSizeToFit: PropTypes.bool, | ||
allowFontScaling: PropTypes.bool, | ||
dataDetectorType: PropTypes.oneOf([ | ||
'all', | ||
'email', | ||
'link', | ||
'none', | ||
'phoneNumber', | ||
]), | ||
disabled: PropTypes.bool, | ||
dynamicTypeRamp: PropTypes.oneOf([ | ||
'body', | ||
'callout', | ||
'caption1', | ||
'caption2', | ||
'footnote', | ||
'headline', | ||
'largeTitle', | ||
'subheadline', | ||
'title1', | ||
'title2', | ||
'title3', | ||
]), | ||
ellipsizeMode: PropTypes.oneOf(['clip', 'head', 'middle', 'tail']), | ||
id: PropTypes.string, | ||
lineBreakStrategyIOS: PropTypes.oneOf([ | ||
'hangul-word', | ||
'none', | ||
'push-out', | ||
'standard', | ||
]), | ||
maxFontSizeMultiplier: PropTypes.number, | ||
minimumFontScale: PropTypes.number, | ||
nativeID: PropTypes.string, | ||
numberOfLines: PropTypes.number, | ||
/** | ||
* Set text break strategy on Android. | ||
* | ||
* See https://reactnative.dev/docs/text.html#textbreakstrategy | ||
*/ | ||
textBreakStrategy: PropTypes.oneOf(['simple', 'highQuality', 'balanced']), | ||
/** | ||
* Invoked on mount and layout changes. | ||
* | ||
* See https://reactnative.dev/docs/text.html#onlayout | ||
*/ | ||
onAccessibilityAction: PropTypes.func, | ||
onLayout: PropTypes.func, | ||
/** | ||
* This function is called on press. | ||
* | ||
* See https://reactnative.dev/docs/text.html#onpress | ||
*/ | ||
onLongPress: PropTypes.func, | ||
onMoveShouldSetResponder: PropTypes.func, | ||
onPress: PropTypes.func, | ||
/** | ||
* This function is called on long press. | ||
* | ||
* See https://reactnative.dev/docs/text.html#onlongpress | ||
*/ | ||
onLongPress: PropTypes.func, | ||
/** | ||
* Defines how far your touch may move off of the button, before | ||
* deactivating the button. | ||
* | ||
* See https://reactnative.dev/docs/text.html#pressretentionoffset | ||
*/ | ||
onPressIn: PropTypes.func, | ||
onPressOut: PropTypes.func, | ||
onResponderGrant: PropTypes.func, | ||
onResponderMove: PropTypes.func, | ||
onResponderRelease: PropTypes.func, | ||
onResponderTerminate: PropTypes.func, | ||
onResponderTerminationRequest: PropTypes.func, | ||
onStartShouldSetResponder: PropTypes.func, | ||
onTextLayout: PropTypes.func, | ||
pressRetentionOffset: DeprecatedEdgeInsetsPropType, | ||
/** | ||
* Lets the user select text. | ||
* | ||
* See https://reactnative.dev/docs/text.html#selectable | ||
*/ | ||
role: RolePropType, | ||
selectable: PropTypes.bool, | ||
/** | ||
* The highlight color of the text. | ||
* | ||
* See https://reactnative.dev/docs/text.html#selectioncolor | ||
*/ | ||
selectionColor: DeprecatedColorPropType, | ||
/** | ||
* When `true`, no visual change is made when text is pressed down. | ||
* | ||
* See https://reactnative.dev/docs/text.html#supperhighlighting | ||
*/ | ||
style: DeprecatedStyleSheetPropType(DeprecatedTextStylePropTypes), | ||
suppressHighlighting: PropTypes.bool, | ||
style: stylePropType, | ||
/** | ||
* Used to locate this view in end-to-end tests. | ||
* | ||
* See https://reactnative.dev/docs/text.html#testid | ||
*/ | ||
testID: PropTypes.string, | ||
/** | ||
* Used to locate this view from native code. | ||
* | ||
* See https://reactnative.dev/docs/text.html#nativeid | ||
*/ | ||
nativeID: PropTypes.string, | ||
/** | ||
* Whether fonts should scale to respect Text Size accessibility settings. | ||
* | ||
* See https://reactnative.dev/docs/text.html#allowfontscaling | ||
*/ | ||
allowFontScaling: PropTypes.bool, | ||
/** | ||
* Specifies largest possible scale a font can reach when `allowFontScaling` is enabled. | ||
* Possible values: | ||
* `null/undefined` (default): inherit from the parent node or the global default (0) | ||
* `0`: no max, ignore parent/global default | ||
* `>= 1`: sets the maxFontSizeMultiplier of this node to this value | ||
*/ | ||
maxFontSizeMultiplier: PropTypes.number, | ||
/** | ||
* Indicates whether the view is an accessibility element. | ||
* | ||
* See https://reactnative.dev/docs/text.html#accessible | ||
*/ | ||
accessible: PropTypes.bool, | ||
/** | ||
* Whether font should be scaled down automatically. | ||
* | ||
* See https://reactnative.dev/docs/text.html#adjustsfontsizetofit | ||
*/ | ||
adjustsFontSizeToFit: PropTypes.bool, | ||
/** | ||
* Smallest possible scale a font can reach. | ||
* | ||
* See https://reactnative.dev/docs/text.html#minimumfontscale | ||
*/ | ||
minimumFontScale: PropTypes.number, | ||
/** | ||
* Specifies the disabled state of the text view for testing purposes. | ||
* | ||
* See https://reactnative.dev/docs/text.html#disabled | ||
*/ | ||
disabled: PropTypes.bool, | ||
/** | ||
* Determines the types of data converted to clickable URLs in text. | ||
* | ||
* See https://reactnative.dev/docs/text.html#dataDetectorType | ||
*/ | ||
dataDetectorType: PropTypes.oneOf(DataDetectorTypes), | ||
textBreakStrategy: PropTypes.oneOf(['balanced', 'highQuality', 'simple']), | ||
}; | ||
module.exports = DeprecatedTextPropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -14,19 +14,46 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedViewStylePropTypes = require('./DeprecatedViewStylePropTypes'); | ||
const ReactPropTypes = require('prop-types'); | ||
const PropTypes = require('prop-types'); | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
const DeprecatedTextStylePropTypes = { | ||
...DeprecatedViewStylePropTypes, | ||
color: DeprecatedColorPropType, | ||
fontFamily: ReactPropTypes.string, | ||
fontSize: ReactPropTypes.number, | ||
fontStyle: ReactPropTypes.oneOf(['normal', 'italic']), | ||
/** | ||
* Specifies font weight. The values 'normal' and 'bold' are supported for | ||
* most fonts. Not all fonts have a variant for each of the numeric values, | ||
* in that case the closest one is chosen. | ||
*/ | ||
fontWeight: ReactPropTypes.oneOf([ | ||
'normal' /*default*/, | ||
'bold', | ||
fontFamily: PropTypes.string, | ||
fontSize: PropTypes.number, | ||
fontStyle: PropTypes.oneOf(['italic', 'normal']), | ||
fontVariant: PropTypes.oneOfType([ | ||
PropTypes.arrayOf( | ||
PropTypes.oneOf([ | ||
'lining-nums', | ||
'oldstyle-nums', | ||
'proportional-nums', | ||
'small-caps', | ||
'stylistic-eight', | ||
'stylistic-eighteen', | ||
'stylistic-eleven', | ||
'stylistic-fifteen', | ||
'stylistic-five', | ||
'stylistic-four', | ||
'stylistic-fourteen', | ||
'stylistic-nine', | ||
'stylistic-nineteen', | ||
'stylistic-one', | ||
'stylistic-seven', | ||
'stylistic-seventeen', | ||
'stylistic-six', | ||
'stylistic-sixteen', | ||
'stylistic-ten', | ||
'stylistic-thirteen', | ||
'stylistic-three', | ||
'stylistic-twelve', | ||
'stylistic-twenty', | ||
'stylistic-two', | ||
'tabular-nums', | ||
]), | ||
), | ||
PropTypes.string, | ||
]), | ||
fontWeight: PropTypes.oneOf([ | ||
'100', | ||
@@ -41,81 +68,54 @@ '200', | ||
'900', | ||
'black', | ||
'bold', | ||
'condensed', | ||
'condensedBold', | ||
'heavy', | ||
'light', | ||
'medium', | ||
'normal', | ||
'regular', | ||
'semibold', | ||
'thin', | ||
'ultralight', | ||
100, | ||
200, | ||
300, | ||
400, | ||
500, | ||
600, | ||
700, | ||
800, | ||
900, | ||
]), | ||
fontVariant: ReactPropTypes.arrayOf( | ||
ReactPropTypes.oneOf([ | ||
'small-caps', | ||
'oldstyle-nums', | ||
'lining-nums', | ||
'tabular-nums', | ||
'proportional-nums', | ||
]), | ||
), | ||
textShadowOffset: ReactPropTypes.shape({ | ||
width: ReactPropTypes.number, | ||
height: ReactPropTypes.number, | ||
}), | ||
textShadowRadius: ReactPropTypes.number, | ||
textShadowColor: DeprecatedColorPropType, | ||
/** | ||
* @platform ios | ||
*/ | ||
letterSpacing: ReactPropTypes.number, | ||
lineHeight: ReactPropTypes.number, | ||
/** | ||
* Specifies text alignment. The value 'justify' is only supported on iOS and | ||
* fallbacks to `left` on Android. | ||
*/ | ||
textAlign: ReactPropTypes.oneOf([ | ||
'auto' /*default*/, | ||
'left', | ||
'right', | ||
'center', | ||
'justify', | ||
]), | ||
/** | ||
* @platform android | ||
*/ | ||
textAlignVertical: ReactPropTypes.oneOf([ | ||
'auto' /*default*/, | ||
'top', | ||
'bottom', | ||
'center', | ||
]), | ||
/** | ||
* Set to `false` to remove extra font padding intended to make space for certain ascenders / descenders. | ||
* With some fonts, this padding can make text look slightly misaligned when centered vertically. | ||
* For best results also set `textAlignVertical` to `center`. Default is true. | ||
* @platform android | ||
*/ | ||
includeFontPadding: ReactPropTypes.bool, | ||
textDecorationLine: ReactPropTypes.oneOf([ | ||
'none' /*default*/, | ||
'underline', | ||
includeFontPadding: PropTypes.bool, | ||
letterSpacing: PropTypes.number, | ||
lineHeight: PropTypes.number, | ||
textAlign: PropTypes.oneOf(['auto', 'center', 'justify', 'left', 'right']), | ||
textAlignVertical: PropTypes.oneOf(['auto', 'bottom', 'center', 'top']), | ||
textDecorationColor: DeprecatedColorPropType, | ||
textDecorationLine: PropTypes.oneOf([ | ||
'line-through', | ||
'none', | ||
'underline line-through', | ||
'underline', | ||
]), | ||
/** | ||
* @platform ios | ||
*/ | ||
textDecorationStyle: ReactPropTypes.oneOf([ | ||
'solid' /*default*/, | ||
'double', | ||
'dotted', | ||
'dashed', | ||
]), | ||
/** | ||
* @platform ios | ||
*/ | ||
textDecorationColor: DeprecatedColorPropType, | ||
textTransform: ReactPropTypes.oneOf([ | ||
'none' /*default*/, | ||
textDecorationStyle: PropTypes.oneOf(['dashed', 'dotted', 'double', 'solid']), | ||
textShadowColor: DeprecatedColorPropType, | ||
textShadowOffset: PropTypes.shape({ | ||
height: PropTypes.number, | ||
width: PropTypes.number, | ||
}), | ||
textShadowRadius: PropTypes.number, | ||
textTransform: PropTypes.oneOf([ | ||
'capitalize', | ||
'lowercase', | ||
'none', | ||
'uppercase', | ||
'lowercase', | ||
]), | ||
/** | ||
* @platform ios | ||
*/ | ||
writingDirection: ReactPropTypes.oneOf(['auto' /*default*/, 'ltr', 'rtl']), | ||
userSelect: PropTypes.oneOf(['all', 'auto', 'contain', 'none', 'text']), | ||
verticalAlign: PropTypes.oneOf(['auto', 'bottom', 'middle', 'top']), | ||
writingDirection: PropTypes.oneOf(['auto', 'ltr', 'rtl']), | ||
}; | ||
module.exports = DeprecatedTextStylePropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -12,78 +12,26 @@ * This source code is licensed under the MIT license found in the | ||
const ReactPropTypes = require('prop-types'); | ||
const PropTypes = require('prop-types'); | ||
const TransformMatrixPropType = function(props, propName, componentName) { | ||
if (props[propName]) { | ||
return new Error( | ||
'The transformMatrix style property is deprecated. ' + | ||
'Use `transform: [{ matrix: ... }]` instead.', | ||
); | ||
} | ||
}; | ||
const DecomposedMatrixPropType = function(props, propName, componentName) { | ||
if (props[propName]) { | ||
return new Error( | ||
'The decomposedMatrix style property is deprecated. ' + | ||
'Use `transform: [...]` instead.', | ||
); | ||
} | ||
}; | ||
/** | ||
* @see facebook/react-native/Libraries/StyleSheet/private/_TransformStyle.js | ||
*/ | ||
const DeprecatedTransformPropTypes = { | ||
transform: ReactPropTypes.arrayOf( | ||
ReactPropTypes.oneOfType([ | ||
ReactPropTypes.shape({perspective: ReactPropTypes.number}), | ||
ReactPropTypes.shape({rotate: ReactPropTypes.string}), | ||
ReactPropTypes.shape({rotateX: ReactPropTypes.string}), | ||
ReactPropTypes.shape({rotateY: ReactPropTypes.string}), | ||
ReactPropTypes.shape({rotateZ: ReactPropTypes.string}), | ||
ReactPropTypes.shape({scale: ReactPropTypes.number}), | ||
ReactPropTypes.shape({scaleX: ReactPropTypes.number}), | ||
ReactPropTypes.shape({scaleY: ReactPropTypes.number}), | ||
ReactPropTypes.shape({translateX: ReactPropTypes.number}), | ||
ReactPropTypes.shape({translateY: ReactPropTypes.number}), | ||
ReactPropTypes.shape({skewX: ReactPropTypes.string}), | ||
ReactPropTypes.shape({skewY: ReactPropTypes.string}), | ||
transform: PropTypes.arrayOf( | ||
PropTypes.oneOfType([ | ||
PropTypes.shape({perspective: PropTypes.number}), | ||
PropTypes.shape({rotate: PropTypes.string}), | ||
PropTypes.shape({rotateX: PropTypes.string}), | ||
PropTypes.shape({rotateY: PropTypes.string}), | ||
PropTypes.shape({rotateZ: PropTypes.string}), | ||
PropTypes.shape({scale: PropTypes.number}), | ||
PropTypes.shape({scaleX: PropTypes.number}), | ||
PropTypes.shape({scaleY: PropTypes.number}), | ||
PropTypes.shape({skewX: PropTypes.string}), | ||
PropTypes.shape({skewY: PropTypes.string}), | ||
PropTypes.shape({translateX: PropTypes.number}), | ||
PropTypes.shape({translateY: PropTypes.number}), | ||
]), | ||
), | ||
transformMatrix: TransformMatrixPropType, | ||
decomposedMatrix: DecomposedMatrixPropType, | ||
scaleX: deprecatedPropType( | ||
ReactPropTypes.number, | ||
'Use the transform prop instead.', | ||
), | ||
scaleY: deprecatedPropType( | ||
ReactPropTypes.number, | ||
'Use the transform prop instead.', | ||
), | ||
rotation: deprecatedPropType( | ||
ReactPropTypes.number, | ||
'Use the transform prop instead.', | ||
), | ||
translateX: deprecatedPropType( | ||
ReactPropTypes.number, | ||
'Use the transform prop instead.', | ||
), | ||
translateY: deprecatedPropType( | ||
ReactPropTypes.number, | ||
'Use the transform prop instead.', | ||
), | ||
}; | ||
/** | ||
* Adds a deprecation warning when the prop is used. | ||
*/ | ||
function deprecatedPropType(propType, explanation) { | ||
return function validate(props, propName, componentName, ...rest) { | ||
if (props[propName] !== undefined) { | ||
console.warn( | ||
`\`${propName}\` supplied to \`${componentName}\` has been deprecated. ${explanation}`, | ||
); | ||
} | ||
return propType(props, propName, componentName, ...rest); | ||
}; | ||
} | ||
module.exports = DeprecatedTransformPropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -12,34 +12,122 @@ * This source code is licensed under the MIT license found in the | ||
module.exports = { | ||
// This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m | ||
DeprecatedAccessibilityRoles: [ | ||
'none', | ||
const PropTypes = require('prop-types'); | ||
/** | ||
* @see facebook/react-native/Libraries/Components/View/ViewAccessibility.js | ||
*/ | ||
const DeprecatedViewAccessibility = { | ||
AccessibilityRolePropType: PropTypes.oneOf([ | ||
'adjustable', | ||
'alert', | ||
'button', | ||
'togglebutton', | ||
'checkbox', | ||
'combobox', | ||
'drawerlayout', | ||
'dropdownlist', | ||
'grid', | ||
'header', | ||
'horizontalscrollview', | ||
'iconmenu', | ||
'image', | ||
'imagebutton', | ||
'keyboardkey', | ||
'link', | ||
'list', | ||
'menu', | ||
'menubar', | ||
'menuitem', | ||
'none', | ||
'pager', | ||
'progressbar', | ||
'radio', | ||
'radiogroup', | ||
'scrollbar', | ||
'scrollview', | ||
'search', | ||
'image', | ||
'keyboardkey', | ||
'slidingdrawer', | ||
'spinbutton', | ||
'summary', | ||
'switch', | ||
'tab', | ||
'tabbar', | ||
'tablist', | ||
'text', | ||
'adjustable', | ||
'imagebutton', | ||
'header', | ||
'summary', | ||
'timer', | ||
'togglebutton', | ||
'toolbar', | ||
'viewgroup', | ||
'webview', | ||
]), | ||
AccessibilityStatePropType: PropTypes.object, | ||
AccessibilityActionInfoPropType: PropTypes.object, | ||
AccessibilityValuePropType: PropTypes.object, | ||
RolePropType: PropTypes.oneOf([ | ||
'alert', | ||
'alertdialog', | ||
'application', | ||
'article', | ||
'banner', | ||
'button', | ||
'cell', | ||
'checkbox', | ||
'columnheader', | ||
'combobox', | ||
'complementary', | ||
'contentinfo', | ||
'definition', | ||
'dialog', | ||
'directory', | ||
'document', | ||
'feed', | ||
'figure', | ||
'form', | ||
'grid', | ||
'group', | ||
'heading', | ||
'img', | ||
'link', | ||
'list', | ||
'listitem', | ||
'log', | ||
'main', | ||
'marquee', | ||
'math', | ||
'menu', | ||
'menubar', | ||
'menuitem', | ||
'meter', | ||
'navigation', | ||
'none', | ||
'note', | ||
'option', | ||
'presentation', | ||
'progressbar', | ||
'radio', | ||
'radiogroup', | ||
'region', | ||
'row', | ||
'rowgroup', | ||
'rowheader', | ||
'scrollbar', | ||
'searchbox', | ||
'separator', | ||
'slider', | ||
'spinbutton', | ||
'status', | ||
'summary', | ||
'switch', | ||
'tab', | ||
'table', | ||
'tablist', | ||
'tabpanel', | ||
'term', | ||
'timer', | ||
'toolbar', | ||
], | ||
'tooltip', | ||
'tree', | ||
'treegrid', | ||
'treeitem', | ||
]), | ||
}; | ||
module.exports = DeprecatedViewAccessibility; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -14,354 +14,144 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedStyleSheetPropType = require('./DeprecatedStyleSheetPropType'); | ||
const { | ||
AccessibilityActionInfoPropType, | ||
AccessibilityRolePropType, | ||
AccessibilityStatePropType, | ||
AccessibilityValuePropType, | ||
RolePropType, | ||
} = require('./DeprecatedViewAccessibility'); | ||
const DeprecatedViewStylePropTypes = require('./DeprecatedViewStylePropTypes'); | ||
const PropTypes = require('prop-types'); | ||
const {DeprecatedAccessibilityRoles} = require('./DeprecatedViewAccessibility'); | ||
const MouseEventPropTypes = { | ||
onMouseEnter: PropTypes.func, | ||
onMouseLeave: PropTypes.func, | ||
}; | ||
const stylePropType = DeprecatedStyleSheetPropType( | ||
DeprecatedViewStylePropTypes, | ||
); | ||
// Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use) | ||
const PointerEventPropTypes = { | ||
onPointerEnter: PropTypes.func, | ||
onPointerEnterCapture: PropTypes.func, | ||
onPointerLeave: PropTypes.func, | ||
onPointerLeaveCapture: PropTypes.func, | ||
onPointerMove: PropTypes.func, | ||
onPointerMoveCapture: PropTypes.func, | ||
onPointerCancel: PropTypes.func, | ||
onPointerCancelCapture: PropTypes.func, | ||
onPointerDown: PropTypes.func, | ||
onPointerDownCapture: PropTypes.func, | ||
onPointerUp: PropTypes.func, | ||
onPointerUpCapture: PropTypes.func, | ||
onPointerOver: PropTypes.func, | ||
onPointerOverCapture: PropTypes.func, | ||
onPointerOut: PropTypes.func, | ||
onPointerOutCapture: PropTypes.func, | ||
}; | ||
module.exports = { | ||
/** | ||
* When `true`, indicates that the view is an accessibility element. | ||
* By default, all the touchable elements are accessible. | ||
* | ||
* See https://reactnative.dev/docs/view.html#accessible | ||
*/ | ||
accessible: PropTypes.bool, | ||
const FocusEventPropTypes = { | ||
onBlur: PropTypes.func, | ||
onBlurCapture: PropTypes.func, | ||
onFocus: PropTypes.func, | ||
onFocusCapture: PropTypes.func, | ||
}; | ||
/** | ||
* Overrides the text that's read by the screen reader when the user interacts | ||
* with the element. By default, the label is constructed by traversing all | ||
* the children and accumulating all the `Text` nodes separated by space. | ||
* | ||
* See https://reactnative.dev/docs/view.html#accessibilitylabel | ||
*/ | ||
accessibilityLabel: PropTypes.node, | ||
const TouchEventPropTypes = { | ||
onTouchCancel: PropTypes.func, | ||
onTouchCancelCapture: PropTypes.func, | ||
onTouchEnd: PropTypes.func, | ||
onTouchEndCapture: PropTypes.func, | ||
onTouchMove: PropTypes.func, | ||
onTouchMoveCapture: PropTypes.func, | ||
onTouchStart: PropTypes.func, | ||
onTouchStartCapture: PropTypes.func, | ||
}; | ||
/** | ||
* An accessibility hint helps users understand what will happen when they perform | ||
* an action on the accessibility element when that result is not obvious from the | ||
* accessibility label. | ||
* | ||
* | ||
* See https://reactnative.dev/docs/view.html#accessibilityHint | ||
*/ | ||
const GestureResponderEventPropTypes = { | ||
onMoveShouldSetResponder: PropTypes.func, | ||
onMoveShouldSetResponderCapture: PropTypes.func, | ||
onResponderEnd: PropTypes.func, | ||
onResponderGrant: PropTypes.func, | ||
onResponderMove: PropTypes.func, | ||
onResponderReject: PropTypes.func, | ||
onResponderRelease: PropTypes.func, | ||
onResponderStart: PropTypes.func, | ||
onResponderTerminate: PropTypes.func, | ||
onResponderTerminationRequest: PropTypes.func, | ||
onStartShouldSetResponder: PropTypes.func, | ||
onStartShouldSetResponderCapture: PropTypes.func, | ||
}; | ||
/** | ||
* @see facebook/react-native/Libraries/Components/View/ViewPropTypes.js | ||
*/ | ||
const DeprecatedViewPropTypes = { | ||
...MouseEventPropTypes, | ||
...PointerEventPropTypes, | ||
...FocusEventPropTypes, | ||
...TouchEventPropTypes, | ||
...GestureResponderEventPropTypes, | ||
'aria-busy': PropTypes.bool, | ||
'aria-checked': PropTypes.oneOfType([ | ||
PropTypes.bool, | ||
PropTypes.oneOf(['mixed']), | ||
]), | ||
'aria-disabled': PropTypes.bool, | ||
'aria-expanded': PropTypes.bool, | ||
'aria-hidden': PropTypes.bool, | ||
'aria-label': PropTypes.string, | ||
'aria-labelledby': PropTypes.string, | ||
'aria-live': 'polite' | 'assertive' | 'off', | ||
'aria-modal': PropTypes.bool, | ||
'aria-selected': PropTypes.bool, | ||
'aria-valuemax': PropTypes.number, | ||
'aria-valuemin': PropTypes.number, | ||
'aria-valuenow': PropTypes.number, | ||
'aria-valuetext': PropTypes.string, | ||
accessibilityActions: PropTypes.arrayOf(AccessibilityActionInfoPropType), | ||
accessibilityElementsHidden: PropTypes.bool, | ||
accessibilityHint: PropTypes.string, | ||
/** | ||
* Provides an array of custom actions available for accessibility. | ||
* | ||
* @platform ios | ||
*/ | ||
accessibilityActions: PropTypes.arrayOf(PropTypes.string), | ||
/** | ||
* Prevents view from being inverted if set to true and color inversion is turned on. | ||
* | ||
* @platform ios | ||
*/ | ||
accessibilityIgnoresInvertColors: PropTypes.bool, | ||
/** | ||
* Indicates to accessibility services to treat UI component like a specific role. | ||
*/ | ||
accessibilityRole: PropTypes.oneOf(DeprecatedAccessibilityRoles), | ||
accessibilityState: PropTypes.object, | ||
accessibilityValue: PropTypes.object, | ||
/** | ||
* Indicates to accessibility services whether the user should be notified | ||
* when this view changes. Works for Android API >= 19 only. | ||
* | ||
* @platform android | ||
* | ||
* See https://reactnative.dev/docs/view.html#accessibilityliveregion | ||
*/ | ||
accessibilityLiveRegion: PropTypes.oneOf(['none', 'polite', 'assertive']), | ||
/** | ||
* Controls how view is important for accessibility which is if it | ||
* fires accessibility events and if it is reported to accessibility services | ||
* that query the screen. Works for Android only. | ||
* | ||
* @platform android | ||
* | ||
* See https://reactnative.dev/docs/view.html#importantforaccessibility | ||
*/ | ||
accessibilityLabel: PropTypes.node, | ||
accessibilityLabelledBy: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.arrayOf(PropTypes.string), | ||
]), | ||
accessibilityLanguage: PropTypes.string, | ||
accessibilityLiveRegion: PropTypes.oneOf(['assertive', 'none', 'polite']), | ||
accessibilityRole: AccessibilityRolePropType, | ||
accessibilityState: AccessibilityStatePropType, | ||
accessibilityValue: AccessibilityValuePropType, | ||
accessibilityViewIsModal: PropTypes.bool, | ||
accessible: PropTypes.bool, | ||
collapsable: PropTypes.bool, | ||
focusable: PropTypes.bool, | ||
hitSlop: PropTypes.oneOfType([ | ||
DeprecatedEdgeInsetsPropType, | ||
PropTypes.number, | ||
]), | ||
importantForAccessibility: PropTypes.oneOf([ | ||
'auto', | ||
'yes', | ||
'no', | ||
'no-hide-descendants', | ||
'yes', | ||
]), | ||
/** | ||
* A value indicating whether VoiceOver should ignore the elements | ||
* within views that are siblings of the receiver. | ||
* Default is `false`. | ||
* | ||
* @platform ios | ||
* | ||
* See https://reactnative.dev/docs/view.html#accessibilityviewismodal | ||
*/ | ||
accessibilityViewIsModal: PropTypes.bool, | ||
/** | ||
* A value indicating whether the accessibility elements contained within | ||
* this accessibility element are hidden. | ||
* | ||
* @platform ios | ||
* | ||
* See https://reactnative.dev/docs/view.html#accessibilityElementsHidden | ||
*/ | ||
accessibilityElementsHidden: PropTypes.bool, | ||
/** | ||
* When `accessible` is true, the system will try to invoke this function | ||
* when the user performs an accessibility custom action. | ||
* | ||
* @platform ios | ||
*/ | ||
nativeBackgroundAndroid: PropTypes.object, | ||
nativeForegroundAndroid: PropTypes.object, | ||
nativeID: PropTypes.string, | ||
needsOffscreenAlphaCompositing: PropTypes.bool, | ||
onAccessibilityAction: PropTypes.func, | ||
/** | ||
* When `accessible` is true, the system will try to invoke this function | ||
* when the user performs accessibility tap gesture. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onaccessibilitytap | ||
*/ | ||
onAccessibilityEscape: PropTypes.func, | ||
onAccessibilityTap: PropTypes.func, | ||
/** | ||
* When `accessible` is `true`, the system will invoke this function when the | ||
* user performs the magic tap gesture. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onmagictap | ||
*/ | ||
onClick: PropTypes.func, | ||
onLayout: PropTypes.func, | ||
onMagicTap: PropTypes.func, | ||
/** | ||
* Used to locate this view in end-to-end tests. | ||
* | ||
* > This disables the 'layout-only view removal' optimization for this view! | ||
* | ||
* See https://reactnative.dev/docs/view.html#testid | ||
*/ | ||
testID: PropTypes.string, | ||
/** | ||
* Used to locate this view from native classes. | ||
* | ||
* > This disables the 'layout-only view removal' optimization for this view! | ||
* | ||
* See https://reactnative.dev/docs/view.html#nativeid | ||
*/ | ||
nativeID: PropTypes.string, | ||
/** | ||
* For most touch interactions, you'll simply want to wrap your component in | ||
* `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`, | ||
* `ScrollResponder.js` and `ResponderEventPlugin.js` for more discussion. | ||
*/ | ||
/** | ||
* The View is now responding for touch events. This is the time to highlight | ||
* and show the user what is happening. | ||
* | ||
* `View.props.onResponderGrant: (event) => {}`, where `event` is a synthetic | ||
* touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onrespondergrant | ||
*/ | ||
onResponderGrant: PropTypes.func, | ||
/** | ||
* The user is moving their finger. | ||
* | ||
* `View.props.onResponderMove: (event) => {}`, where `event` is a synthetic | ||
* touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onrespondermove | ||
*/ | ||
onResponderMove: PropTypes.func, | ||
/** | ||
* Another responder is already active and will not release it to that `View` | ||
* asking to be the responder. | ||
* | ||
* `View.props.onResponderReject: (event) => {}`, where `event` is a | ||
* synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onresponderreject | ||
*/ | ||
onResponderReject: PropTypes.func, | ||
/** | ||
* Fired at the end of the touch. | ||
* | ||
* `View.props.onResponderRelease: (event) => {}`, where `event` is a | ||
* synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onresponderrelease | ||
*/ | ||
onResponderRelease: PropTypes.func, | ||
/** | ||
* The responder has been taken from the `View`. Might be taken by other | ||
* views after a call to `onResponderTerminationRequest`, or might be taken | ||
* by the OS without asking (e.g., happens with control center/ notification | ||
* center on iOS) | ||
* | ||
* `View.props.onResponderTerminate: (event) => {}`, where `event` is a | ||
* synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onresponderterminate | ||
*/ | ||
onResponderTerminate: PropTypes.func, | ||
/** | ||
* Some other `View` wants to become responder and is asking this `View` to | ||
* release its responder. Returning `true` allows its release. | ||
* | ||
* `View.props.onResponderTerminationRequest: (event) => {}`, where `event` | ||
* is a synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onresponderterminationrequest | ||
*/ | ||
onResponderTerminationRequest: PropTypes.func, | ||
/** | ||
* Does this view want to become responder on the start of a touch? | ||
* | ||
* `View.props.onStartShouldSetResponder: (event) => [true | false]`, where | ||
* `event` is a synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onstartshouldsetresponder | ||
*/ | ||
onStartShouldSetResponder: PropTypes.func, | ||
/** | ||
* If a parent `View` wants to prevent a child `View` from becoming responder | ||
* on a touch start, it should have this handler which returns `true`. | ||
* | ||
* `View.props.onStartShouldSetResponderCapture: (event) => [true | false]`, | ||
* where `event` is a synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onstartshouldsetrespondercapture | ||
*/ | ||
onStartShouldSetResponderCapture: PropTypes.func, | ||
/** | ||
* Does this view want to "claim" touch responsiveness? This is called for | ||
* every touch move on the `View` when it is not the responder. | ||
* | ||
* `View.props.onMoveShouldSetResponder: (event) => [true | false]`, where | ||
* `event` is a synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onmoveshouldsetresponder | ||
*/ | ||
onMoveShouldSetResponder: PropTypes.func, | ||
/** | ||
* If a parent `View` wants to prevent a child `View` from becoming responder | ||
* on a move, it should have this handler which returns `true`. | ||
* | ||
* `View.props.onMoveShouldSetResponderCapture: (event) => [true | false]`, | ||
* where `event` is a synthetic touch event as described above. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onMoveShouldsetrespondercapture | ||
*/ | ||
onMoveShouldSetResponderCapture: PropTypes.func, | ||
/** | ||
* This defines how far a touch event can start away from the view. | ||
* Typical interface guidelines recommend touch targets that are at least | ||
* 30 - 40 points/density-independent pixels. | ||
* | ||
* > The touch area never extends past the parent view bounds and the Z-index | ||
* > of sibling views always takes precedence if a touch hits two overlapping | ||
* > views. | ||
* | ||
* See https://reactnative.dev/docs/view.html#hitslop | ||
*/ | ||
hitSlop: DeprecatedEdgeInsetsPropType, | ||
/** | ||
* Invoked on mount and layout changes with: | ||
* | ||
* `{nativeEvent: { layout: {x, y, width, height}}}` | ||
* | ||
* This event is fired immediately once the layout has been calculated, but | ||
* the new layout may not yet be reflected on the screen at the time the | ||
* event is received, especially if a layout animation is in progress. | ||
* | ||
* See https://reactnative.dev/docs/view.html#onlayout | ||
*/ | ||
onLayout: PropTypes.func, | ||
/** | ||
* Controls whether the `View` can be the target of touch events. | ||
* | ||
* See https://reactnative.dev/docs/view.html#pointerevents | ||
*/ | ||
pointerEvents: PropTypes.oneOf(['box-none', 'none', 'box-only', 'auto']), | ||
/** | ||
* See https://reactnative.dev/docs/style.html | ||
*/ | ||
style: stylePropType, | ||
/** | ||
* This is a special performance property exposed by `RCTView` and is useful | ||
* for scrolling content when there are many subviews, most of which are | ||
* offscreen. For this property to be effective, it must be applied to a | ||
* view that contains many subviews that extend outside its bound. The | ||
* subviews must also have `overflow: hidden`, as should the containing view | ||
* (or one of its superviews). | ||
* | ||
* See https://reactnative.dev/docs/view.html#removeclippedsubviews | ||
*/ | ||
pointerEvents: PropTypes.oneOf(['auto', 'box-none', 'box-only', 'none']), | ||
removeClippedSubviews: PropTypes.bool, | ||
/** | ||
* Whether this `View` should render itself (and all of its children) into a | ||
* single hardware texture on the GPU. | ||
* | ||
* @platform android | ||
* | ||
* See https://reactnative.dev/docs/view.html#rendertohardwaretextureandroid | ||
*/ | ||
renderToHardwareTextureAndroid: PropTypes.bool, | ||
/** | ||
* Whether this `View` should be rendered as a bitmap before compositing. | ||
* | ||
* @platform ios | ||
* | ||
* See https://reactnative.dev/docs/view.html#shouldrasterizeios | ||
*/ | ||
role: RolePropType, | ||
shouldRasterizeIOS: PropTypes.bool, | ||
style: DeprecatedStyleSheetPropType(DeprecatedViewStylePropTypes), | ||
tabIndex: PropTypes.oneOf([0, -1]), | ||
testID: PropTypes.string, | ||
}; | ||
/** | ||
* Views that are only used to layout their children or otherwise don't draw | ||
* anything may be automatically removed from the native hierarchy as an | ||
* optimization. Set this property to `false` to disable this optimization and | ||
* ensure that this `View` exists in the native view hierarchy. | ||
* | ||
* @platform android | ||
* | ||
* See https://reactnative.dev/docs/view.html#collapsable | ||
*/ | ||
collapsable: PropTypes.bool, | ||
/** | ||
* Whether this `View` needs to rendered offscreen and composited with an | ||
* alpha in order to preserve 100% correct colors and blending behavior. | ||
* | ||
* @platform android | ||
* | ||
* See https://reactnative.dev/docs/view.html#needsoffscreenalphacompositing | ||
*/ | ||
needsOffscreenAlphaCompositing: PropTypes.bool, | ||
}; | ||
module.exports = DeprecatedViewPropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -16,6 +16,6 @@ * This source code is licensed under the MIT license found in the | ||
const DeprecatedTransformPropTypes = require('./DeprecatedTransformPropTypes'); | ||
const ReactPropTypes = require('prop-types'); | ||
const PropTypes = require('prop-types'); | ||
/** | ||
* Warning: Some of these properties may not be supported in all releases. | ||
* @see facebook/react-native/Libraries/StyleSheet/StyleSheetTypes.js | ||
*/ | ||
@@ -26,37 +26,32 @@ const DeprecatedViewStylePropTypes = { | ||
...DeprecatedTransformPropTypes, | ||
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']), | ||
backfaceVisibility: PropTypes.oneOf(['hidden', 'visible']), | ||
backgroundColor: DeprecatedColorPropType, | ||
borderBottomColor: DeprecatedColorPropType, | ||
borderBottomEndRadius: PropTypes.number, | ||
borderBottomLeftRadius: PropTypes.number, | ||
borderBottomRightRadius: PropTypes.number, | ||
borderBottomStartRadius: PropTypes.number, | ||
borderBottomWidth: PropTypes.number, | ||
borderColor: DeprecatedColorPropType, | ||
borderTopColor: DeprecatedColorPropType, | ||
borderCurve: PropTypes.oneOf(['circular', 'continuous']), | ||
borderEndColor: DeprecatedColorPropType, | ||
borderLeftColor: DeprecatedColorPropType, | ||
borderLeftWidth: PropTypes.number, | ||
borderRadius: PropTypes.number, | ||
borderRightColor: DeprecatedColorPropType, | ||
borderBottomColor: DeprecatedColorPropType, | ||
borderLeftColor: DeprecatedColorPropType, | ||
borderRightWidth: PropTypes.number, | ||
borderStartColor: DeprecatedColorPropType, | ||
borderEndColor: DeprecatedColorPropType, | ||
borderRadius: ReactPropTypes.number, | ||
borderTopLeftRadius: ReactPropTypes.number, | ||
borderTopRightRadius: ReactPropTypes.number, | ||
borderTopStartRadius: ReactPropTypes.number, | ||
borderTopEndRadius: ReactPropTypes.number, | ||
borderBottomLeftRadius: ReactPropTypes.number, | ||
borderBottomRightRadius: ReactPropTypes.number, | ||
borderBottomStartRadius: ReactPropTypes.number, | ||
borderBottomEndRadius: ReactPropTypes.number, | ||
borderStyle: ReactPropTypes.oneOf(['solid', 'dotted', 'dashed']), | ||
borderWidth: ReactPropTypes.number, | ||
borderTopWidth: ReactPropTypes.number, | ||
borderRightWidth: ReactPropTypes.number, | ||
borderBottomWidth: ReactPropTypes.number, | ||
borderLeftWidth: ReactPropTypes.number, | ||
opacity: ReactPropTypes.number, | ||
/** | ||
* (Android-only) Sets the elevation of a view, using Android's underlying | ||
* [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation). | ||
* This adds a drop shadow to the item and affects z-order for overlapping views. | ||
* Only supported on Android 5.0+, has no effect on earlier versions. | ||
* @platform android | ||
*/ | ||
elevation: ReactPropTypes.number, | ||
borderStyle: PropTypes.oneOf(['dashed', 'dotted', 'solid']), | ||
borderTopColor: DeprecatedColorPropType, | ||
borderTopEndRadius: PropTypes.number, | ||
borderTopLeftRadius: PropTypes.number, | ||
borderTopRightRadius: PropTypes.number, | ||
borderTopStartRadius: PropTypes.number, | ||
borderTopWidth: PropTypes.number, | ||
borderWidth: PropTypes.number, | ||
elevation: PropTypes.number, | ||
opacity: PropTypes.number, | ||
pointerEvents: PropTypes.oneOf(['auto', 'box-none', 'box-only', 'none']), | ||
}; | ||
module.exports = DeprecatedViewStylePropTypes; |
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -4,0 +4,0 @@ * This source code is licensed under the MIT license found in the |
{ | ||
"name": "deprecated-react-native-prop-types", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"description": "Deprecated prop-types from React Native.", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:facebookarchive/react-native-deprecated-modules.git" | ||
}, | ||
"repository": "github:facebook/react-native-deprecated-modules", | ||
"dependencies": { | ||
@@ -15,2 +12,5 @@ "@react-native/normalize-color": "*", | ||
}, | ||
"scripts": { | ||
"test": "node -e \"Object.values(require('.'))\"" | ||
}, | ||
"prettier": { | ||
@@ -17,0 +17,0 @@ "requirePragma": true, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43600
1359
1
1