diff --git a/deprecated-react-native-prop-types/CHANGELOG.md b/deprecated-react-native-prop-types/CHANGELOG.md index 6f685a3..71b9647 100644 --- a/deprecated-react-native-prop-types/CHANGELOG.md +++ b/deprecated-react-native-prop-types/CHANGELOG.md @@ -29,5 +29,6 @@ ImagePropTypes` - Removed deprecated props: `decomposedMatrix`, `rotation`, `scaleX`, `scaleY`, `transformMatrix`, `translateX`, `translateY` - Improvements to `ViewPropTypes` - Changed `hitSlop` to accept a number. - - Added `accessibilityLabelledBy`, `accessibilityLanguage`, `aria-busy`, `aria-checked`, `aria-disabled`, `aria-expanded`, `aria-hidden`, `aria-label`, `aria-labelledby`, `aria-live`, `aria-modal`, `aria-selected`, `aria-valuemax`, `aria-valuemin`, `aria-valuenow`, `aria-valuetext`, `id`, `role`, and `tabIndex.` + - Added `accessibilityLabelledBy`, `accessibilityLanguage`, `aria-busy`, `aria-checked`, `aria-disabled`, `aria-expanded`, `aria-hidden`, `aria-label`, `aria-labelledby`, `aria-live`, `aria-modal`, `aria-selected`, `aria-valuemax`, `aria-valuemin`, `aria-valuenow`, `aria-valuetext`, `focusable`, `id`, `nativeBackgroundAndroid`, `nativeForegroundAndroid`, `onAccessibilityEscape`, `onClick`, `role`, and `tabIndex.` + - Added mouse, pointer, focus, and touch event props. - Added `borderCurve` and `pointerEvents` to `style`. diff --git a/deprecated-react-native-prop-types/DeprecatedViewPropTypes.js b/deprecated-react-native-prop-types/DeprecatedViewPropTypes.js index c332617..1daa33d 100644 --- a/deprecated-react-native-prop-types/DeprecatedViewPropTypes.js +++ b/deprecated-react-native-prop-types/DeprecatedViewPropTypes.js @@ -21,10 +21,73 @@ const { const DeprecatedViewStylePropTypes = require('./DeprecatedViewStylePropTypes'); const PropTypes = require('prop-types'); +const MouseEventPropTypes = { + onMouseEnter: PropTypes.func, + onMouseLeave: PropTypes.func, +}; + +// 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, +}; + +const FocusEventPropTypes = { + onBlur: PropTypes.func, + onBlurCapture: PropTypes.func, + onFocus: PropTypes.func, + onFocusCapture: PropTypes.func, +}; + +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, +}; + +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, @@ -59,6 +122,7 @@ const DeprecatedViewPropTypes = { accessibilityViewIsModal: PropTypes.bool, accessible: PropTypes.bool, collapsable: PropTypes.bool, + focusable: PropTypes.bool, hitSlop: PropTypes.oneOfType([ DeprecatedEdgeInsetsPropType, PropTypes.number, @@ -69,22 +133,16 @@ const DeprecatedViewPropTypes = { 'no-hide-descendants', 'yes', ]), + nativeBackgroundAndroid: PropTypes.object, + nativeForegroundAndroid: PropTypes.object, nativeID: PropTypes.string, needsOffscreenAlphaCompositing: PropTypes.bool, onAccessibilityAction: PropTypes.func, + onAccessibilityEscape: PropTypes.func, onAccessibilityTap: PropTypes.func, + onClick: PropTypes.func, onLayout: PropTypes.func, onMagicTap: PropTypes.func, - onMoveShouldSetResponder: PropTypes.func, - onMoveShouldSetResponderCapture: PropTypes.func, - onResponderGrant: PropTypes.func, - onResponderMove: PropTypes.func, - onResponderReject: PropTypes.func, - onResponderRelease: PropTypes.func, - onResponderTerminate: PropTypes.func, - onResponderTerminationRequest: PropTypes.func, - onStartShouldSetResponder: PropTypes.func, - onStartShouldSetResponderCapture: PropTypes.func, pointerEvents: PropTypes.oneOf(['auto', 'box-none', 'box-only', 'none']), removeClippedSubviews: PropTypes.bool, renderToHardwareTextureAndroid: PropTypes.bool,