@office-iss/react-native-win32 0.71.0 → 0.71.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.flowconfig +1 -0
  2. package/CHANGELOG.json +12667 -12652
  3. package/CHANGELOG.md +23 -15
  4. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +2 -2
  5. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  6. package/Libraries/Components/Button/ButtonWin32.js +6 -4
  7. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  8. package/Libraries/Components/Pressable/Pressable.win32.js +0 -1
  9. package/Libraries/Components/Text/TextWin32.Props.d.ts +3 -9
  10. package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
  11. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  12. package/Libraries/Components/Text/TextWin32.js.map +1 -1
  13. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +9 -9
  14. package/Libraries/Components/TextInput/TextInput.win32.js +1150 -154
  15. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +4 -4
  16. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  17. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -16
  18. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +99 -24
  19. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +2 -2
  20. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  21. package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +9 -9
  22. package/Libraries/Components/Touchable/TouchableWin32.js +5 -6
  23. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  24. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +29 -10
  25. package/Libraries/Components/View/Tests/ViewWin32Test.js +31 -51
  26. package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
  27. package/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  28. package/Libraries/Components/View/ViewAccessibility.win32.js +178 -0
  29. package/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  30. package/Libraries/Components/View/ViewPropTypes.win32.js +23 -0
  31. package/Libraries/Components/View/ViewWin32.d.ts +30 -12
  32. package/Libraries/Components/View/ViewWin32.js +161 -71
  33. package/Libraries/Image/Image.win32.js +0 -1
  34. package/Libraries/Pressability/Pressability.win32.js +2 -2
  35. package/Libraries/Utilities/AcessibilityMapping.win32.js +156 -0
  36. package/Libraries/__tests__/ButtonWin32-test.js +1 -1
  37. package/Libraries/platform-types.d.ts +7 -13
  38. package/index.win32.js +1 -1
  39. package/jest.config.js +2 -4
  40. package/overrides.json +38 -8
  41. package/package.json +5 -5
  42. package/src/Libraries/Components/Button/ButtonWin32.tsx +8 -8
  43. package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -15
  44. package/src/Libraries/Components/Text/TextWin32.tsx +6 -2
  45. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +5 -5
  46. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -0
  47. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
  48. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +6 -7
  49. package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +28 -52
  50. package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  51. package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  52. package/src/Libraries/Components/View/ViewWin32.d.ts +30 -0
  53. package/src/Libraries/platform-types.d.ts +7 -13
  54. package/types/modules/BatchedBridge.d.ts +32 -0
  55. package/types/modules/Codegen.d.ts +74 -0
  56. package/types/modules/Devtools.d.ts +31 -0
  57. package/types/modules/LaunchScreen.d.ts +18 -0
  58. package/types/modules/globals.d.ts +577 -0
  59. package/types/private/TimerMixin.d.ts +19 -0
  60. package/types/private/Utilities.d.ts +10 -0
  61. package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
  62. package/types/public/Insets.d.ts +15 -0
  63. package/types/public/ReactNativeRenderer.d.ts +149 -0
  64. package/types/public/ReactNativeTypes.d.ts +143 -0
  65. package/Libraries/Components/TextInput/TextInput.win32.d.ts +0 -68
  66. package/Libraries/Components/TextInput/TextInput.win32.js.map +0 -1
  67. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.d.ts +0 -7
  68. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js +0 -3
  69. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js.map +0 -1
  70. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +0 -1
  71. package/Libraries/Components/View/ViewWin32.Props.d.ts +0 -174
  72. package/Libraries/Components/View/ViewWin32.Props.js +0 -11
  73. package/Libraries/Components/View/ViewWin32.Props.js.map +0 -1
  74. package/Libraries/Components/View/ViewWin32.js.map +0 -1
  75. package/src/Libraries/Components/TextInput/TextInput.win32.tsx +0 -217
  76. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts +0 -9
  77. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx +0 -27
  78. package/src/Libraries/Components/View/ViewWin32.Props.ts +0 -281
  79. package/src/Libraries/Components/View/ViewWin32.tsx +0 -119
@@ -161,12 +161,12 @@ class TouchableWin32HighlightComponent extends react_1.default.Component {
161
161
  this._touchableHandleKeyPressDown = (ev) => {
162
162
  this.props.onKeyPressDown && this.props.onKeyPressDown(ev);
163
163
  };
164
- this._mouseEnter = () => {
165
- this.props.onMouseEnter && this.props.onMouseEnter();
164
+ this._mouseEnter = (mouseEvent) => {
165
+ this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);
166
166
  this.setState({ isMouseIn: true });
167
167
  };
168
- this._mouseLeave = () => {
169
- this.props.onMouseLeave && this.props.onMouseLeave();
168
+ this._mouseLeave = (mouseEvent) => {
169
+ this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);
170
170
  this.setState({ isMouseIn: false });
171
171
  };
172
172
  this._onFocus = (ev) => {
@@ -1 +1 @@
1
- {"version":3,"file":"TouchableWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb,kDAAyB;AACzB,+CAAgF;AAEhF,oDAAiD;AACjD,oDAAiD;AAEjD,sDAAmD;AAInD;;GAEG;AACH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACT,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,cAAc;QAC9B,YAAY,EAAE,QAAQ;QACtB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,cAAc;QAC9B,YAAY,EAAE,QAAQ;QACtB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,sBAAsB,GAAW;IACrC,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;CACZ,CAAC;AAkBF;;;;;GAKG;AACH,MAAM,6BA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AAO,CACL,8BAAC,qBAAS,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc;QACrC,8BAAC,uBAAuB,IAAC,OAAO,EAAE,YAAY;YAC5C,8BAAC,mBAAI,sCAAmC,CAChB;QAE1B,8BAAC,uBAAuB,IACtB,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM;YAEd,8BAAC,mBAAI,QAAE,WAAW,GAAG,OAAO,CAAQ,CACZ,CAChB,CACb,CAAC;AACJ,CAAC,CAAA;AAEY,QAAA,WAAW,GAAG,yBAAyB,CAAC;AACxC,QAAA,KAAK,GAAG,gBAAgB,CAAC;AACzB,QAAA,WAAW,GAAG,0EAA0E,CAAC;AAEzF,QAAA,QAAQ,GAAG;IACtB;QACE,KAAK,EAAE,kCAAkC;QACzC,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,+BAA+B,OAAG,CAAC;QAC7C,CAAC;KACF;IACD;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,yBAAyB,OAAG,CAAC;QACvC,CAAC;KACF;IACD;QACE,KAAK,EAAE,4CAA4C;QACnD,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,qBAAqB,OAAG,CAAC;QACnC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\n\nimport React from 'react'\nimport {NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\nimport { TextWin32 } from '../../Text/TextWin32';\nimport { ViewWin32 } from '../../View/ViewWin32';\nimport { IViewWin32Props, IKeyboardEvent } from '../../View/ViewWin32.Props';\nimport { TouchableWin32 } from '../TouchableWin32';\nimport { IPressEvent, IRenderChild } from '../TouchableWin32.Types';\nimport { ITouchableWin32State } from '../TouchableWin32.Props';\n\n/**\n * Styles used across both examples\n */\nconst styles = StyleSheet.create({\n largeContainer: {\n height: 200,\n width: 600,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexDirection: 'row',\n },\n smallContainer: {\n height: 90,\n width: 90,\n justifyContent: 'center',\n alignContent: 'center',\n },\n highlight: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n outerTouch: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n innerTouch: {\n height: 90,\n width: 90,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\n/**\n * Constant press rect offset, used to demonstrate press geometry\n */\nconst PRESS_RETENTION_OFFSET: Insets = {\n top: 100,\n left: 100,\n right: 100,\n bottom: 100,\n};\n\ninterface ITouchableWin32WithoutFeedbackProps extends IViewWin32Props {\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n}\n\ninterface ITouchableWin32WithoutFeedbackState {\n isFocused: boolean;\n}\n\n/**\n * Example implementation of TouchableWithoutFeedback - not meant for use outside these examples\n * This is mainly there to show the ability to respond to touches without providing visual feedback,\n * though we do show a red border on focus to know where starts start and end and whether press rect\n * offsets are respected.\n */\nclass TouchableWin32WithoutFeedback extends React.Component<ITouchableWin32WithoutFeedbackProps, ITouchableWin32WithoutFeedbackState> {\n constructor(props) {\n super(props);\n\n this.state = { isFocused: false };\n }\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={true}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n renderStyle={this._generateStyle}\n >\n {React.Children.only(this.props.children)}\n </TouchableWin32>\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n };\n\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n };\n\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n };\n\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n\n private readonly _touchableGetHitSlop = (): Insets => {\n return this.props.hitSlop;\n };\n\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayPressIn || 0;\n };\n\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;\n };\n\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n\n private readonly _onFocus = () => {\n this.setState({ isFocused: true });\n };\n\n private readonly _onBlur = () => {\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded border width values\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {\n borderWidth: state.isFocused ? 5 : 0,\n borderColor: 'red',\n };\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\ninterface ITouchableWin32HighlightProps extends Omit <IViewWin32Props, 'children'> {\n delayLongPress?: number;\n delayLongPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n onKeyPress?: (e: IKeyboardEvent) => void;\n onKeyPressDown?: (e: IKeyboardEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n underlayColor?: string;\n children?: IRenderChild<ITouchableWin32State>;\n}\n\ninterface ITouchableWin32HighlightComponentProps extends ITouchableWin32HighlightProps {\n // Used as an imperative handle to the TouchableWin32 interface - primarily for focus()\n innerRef?: React.Ref<TouchableWin32>;\n}\n\n/**\n * Example implementation of TouchableHighlight - not meant for use outside these examples\n * The main difference between a ful TouchableHiglight implementation and this example is that\n * TouchableHighlight should manipulate the opacity of the wrapped view to display the underlay color.\n * This example merely uses hard coded color values to distinguish between different control states\n */\nclass TouchableWin32HighlightComponent extends React.Component<ITouchableWin32HighlightComponentProps, {}> {\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={this.props.rejectResponderTermination}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n touchableHandleKeyPress={this._touchableHandleKeyPress}\n touchableHandleKeyPressDown={this._touchableHandleKeyPressDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n onMouseEnter={this._mouseEnter}\n onMouseLeave={this._mouseLeave}\n renderStyle={this._generateStyle}\n children={this.props.children}\n ref={this.props.innerRef}\n />\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n this.setState({ isPressed: true });\n };\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n private readonly _touchableGetHitSlop = (): Insets => {\n return { left: 100, right: 100, top: 100, bottom: 100 };\n };\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayLongPressIn || 0;\n };\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress || 500;\n };\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n private readonly _touchableHandleKeyPress = (ev: IKeyboardEvent) => {\n this.props.onKeyPress && this.props.onKeyPress(ev);\n }\n private readonly _touchableHandleKeyPressDown = (ev: IKeyboardEvent) => {\n this.props.onKeyPressDown && this.props.onKeyPressDown(ev);\n }\n private readonly _mouseEnter = (): void => {\n this.props.onMouseEnter && this.props.onMouseEnter();\n this.setState({ isMouseIn: true });\n };\n private readonly _mouseLeave = (): void => {\n this.props.onMouseLeave && this.props.onMouseLeave();\n this.setState({ isMouseIn: false });\n };\n private readonly _onFocus = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onFocus && this.props.onFocus(ev);\n this.setState({ isFocused: true });\n };\n private readonly _onBlur = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onBlur && this.props.onBlur(ev);\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded color values,\n * though it is trivial to pass these values as props.\n * This is an example of a render style (one that is a\n * funtion passed on to TouchableWin32 and resolved according\n * to the internal state of TouchableWin32).\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {};\n finalStyle.borderColor = state.isFocused ? 'red' : 'blue';\n finalStyle.borderWidth = state.isFocused ? 10 : 5;\n if (state.isHovered) {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'black';\n } else {\n finalStyle.backgroundColor = 'gray';\n }\n } else {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'green';\n } else {\n finalStyle.backgroundColor = 'white';\n }\n }\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\n// Demonstrating ref forwarding - forwarding a ref using an innerRef prop on a class component\nconst TouchableWin32Highlight = React.forwardRef<TouchableWin32, ITouchableWin32HighlightProps>(\n (props, ref) => {\n return (\n <TouchableWin32HighlightComponent innerRef={ref} {...props} />\n );\n }\n);\n\n/**\n * Both examples merely track number of presses\n */\ninterface IExampleState {\n numberOfPresses: number;\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableWithoutFeedbackExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>Press me</TextWin32>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32WithoutFeedback style={styles.innerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>You can also have nested Touchables</TextWin32>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n <TextWin32>{'Number of Recognized Presses: ' + this.state.numberOfPresses}</TextWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableHighlightExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>Press me</TextWin32>\n </ViewWin32>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32Highlight style={styles.innerTouch} onPress={this._onPress} children={this._getChildrenOfInnerTouchable} />\n </ViewWin32>\n </TouchableWin32Highlight>\n <TextWin32 style={{ color: 'red' }} textStyle=\"None\">\n {'Number of Recognized Presses: ' + this.state.numberOfPresses}\n </TextWin32>\n </ViewWin32>\n );\n }\n\n /**\n * This is primarily to demonstrate render children as a function\n * of state, here we change text color depending on interaction state.\n */\n private readonly _getChildrenOfInnerTouchable = (state: ITouchableWin32State) => {\n return (\n <ViewWin32\n style={{\n borderColor: state.isFocused ? 'green' : 'pink',\n borderWidth: state.isHovered ? 10 : 5,\n height: 70,\n width: 70,\n }}\n >\n <TextWin32\n style={{\n color: this._pickColor(state.isHovered, state.isPressed),\n fontSize: state.isFocused ? 8 : 10,\n }}\n textStyle=\"None\"\n >\n Press Me!\n </TextWin32>\n </ViewWin32>\n );\n };\n\n private _pickColor(hovered: boolean, pressed: boolean) {\n if (hovered) {\n if (pressed) {\n return 'white';\n } else {\n return 'red';\n }\n } else {\n if (pressed) {\n return 'purple';\n } else {\n return 'black';\n }\n }\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\nconst TouchableFocusExample = () => {\n const [focused, setFocused] = React.useState(false);\n const focusableRef = React.useRef<TouchableWin32>(null);\n\n // onPress callback\n const focusOnPress = React.useCallback(() => {\n focusableRef.current && focusableRef.current.focus();\n focused || setFocused(true);\n }, [focused]);\n\n // onFocus and onBlur callbacks\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, []);\n const onBlur = React.useCallback(() => {\n setFocused(false);\n }, []);\n\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight onPress={focusOnPress}>\n <Text>Press me to focus my friend</Text>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight\n ref={focusableRef}\n onFocus={onFocus}\n onBlur={onBlur}\n >\n <Text>{'Focused: ' + focused}</Text>\n </TouchableWin32Highlight>\n </ViewWin32>\n );\n}\n\nexport const displayName = 'TouchableWin32 Examples';\nexport const title = 'TouchableWin32';\nexport const description = 'Demonstration of touchable + focus + hover behavior all in one component';\n\nexport const examples = [\n {\n title: 'TouchableWithoutFeedback Example',\n description: 'A simple example implementation of without feedback behavior',\n render(): JSX.Element {\n return <TouchableWithoutFeedbackExample />;\n },\n },\n {\n title: 'TouchableHighlight Example',\n description: 'A simple example implementation of highlight behavior',\n render(): JSX.Element {\n return <TouchableHighlightExample />;\n },\n },\n {\n title: 'Imperative Focus on TouchableWin32 Example',\n description: 'A simple example implementation of imperative focus behavior',\n render(): JSX.Element {\n return <TouchableFocusExample />;\n },\n }\n];\n"]}
1
+ {"version":3,"file":"TouchableWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb,kDAAyB;AACzB,+CAAgF;AAEhF,oDAAiD;AACjD,oDAAiD;AAEjD,sDAAmD;AAInD;;GAEG;AACH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS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ACJ,OAAO,8BAAC,+BAA+B,OAAG,CAAC;QAC7C,CAAC;KACF;IACD;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,yBAAyB,OAAG,CAAC;QACvC,CAAC;KACF;IACD;QACE,KAAK,EAAE,4CAA4C;QACnD,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,qBAAqB,OAAG,CAAC;QACnC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\n\nimport React from 'react'\nimport {NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\nimport { TextWin32 } from '../../Text/TextWin32';\nimport { ViewWin32 } from '../../View/ViewWin32';\nimport { IViewWin32Props, IKeyboardEvent } from '../../View/ViewPropTypes.win32';\nimport { TouchableWin32 } from '../TouchableWin32';\nimport { IPressEvent, IRenderChild } from '../TouchableWin32.Types';\nimport { ITouchableWin32State } from '../TouchableWin32.Props';\n\n/**\n * Styles used across both examples\n */\nconst styles = StyleSheet.create({\n largeContainer: {\n height: 200,\n width: 600,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexDirection: 'row',\n },\n smallContainer: {\n height: 90,\n width: 90,\n justifyContent: 'center',\n alignContent: 'center',\n },\n highlight: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n outerTouch: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n innerTouch: {\n height: 90,\n width: 90,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\n/**\n * Constant press rect offset, used to demonstrate press geometry\n */\nconst PRESS_RETENTION_OFFSET: Insets = {\n top: 100,\n left: 100,\n right: 100,\n bottom: 100,\n};\n\ninterface ITouchableWin32WithoutFeedbackProps extends IViewWin32Props {\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n}\n\ninterface ITouchableWin32WithoutFeedbackState {\n isFocused: boolean;\n}\n\n/**\n * Example implementation of TouchableWithoutFeedback - not meant for use outside these examples\n * This is mainly there to show the ability to respond to touches without providing visual feedback,\n * though we do show a red border on focus to know where starts start and end and whether press rect\n * offsets are respected.\n */\nclass TouchableWin32WithoutFeedback extends React.Component<ITouchableWin32WithoutFeedbackProps, ITouchableWin32WithoutFeedbackState> {\n constructor(props) {\n super(props);\n\n this.state = { isFocused: false };\n }\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={true}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n renderStyle={this._generateStyle}\n >\n {React.Children.only(this.props.children)}\n </TouchableWin32>\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n };\n\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n };\n\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n };\n\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n\n private readonly _touchableGetHitSlop = (): Insets => {\n return this.props.hitSlop;\n };\n\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayPressIn || 0;\n };\n\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;\n };\n\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n\n private readonly _onFocus = () => {\n this.setState({ isFocused: true });\n };\n\n private readonly _onBlur = () => {\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded border width values\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {\n borderWidth: state.isFocused ? 5 : 0,\n borderColor: 'red',\n };\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\ninterface ITouchableWin32HighlightProps extends Omit <IViewWin32Props, 'children'> {\n delayLongPress?: number;\n delayLongPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n onKeyPress?: (e: IKeyboardEvent) => void;\n onKeyPressDown?: (e: IKeyboardEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n underlayColor?: string;\n children?: IRenderChild<ITouchableWin32State>;\n}\n\ninterface ITouchableWin32HighlightComponentProps extends ITouchableWin32HighlightProps {\n // Used as an imperative handle to the TouchableWin32 interface - primarily for focus()\n innerRef?: React.Ref<TouchableWin32>;\n}\n\n/**\n * Example implementation of TouchableHighlight - not meant for use outside these examples\n * The main difference between a ful TouchableHiglight implementation and this example is that\n * TouchableHighlight should manipulate the opacity of the wrapped view to display the underlay color.\n * This example merely uses hard coded color values to distinguish between different control states\n */\nclass TouchableWin32HighlightComponent extends React.Component<ITouchableWin32HighlightComponentProps, {}> {\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={this.props.rejectResponderTermination}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n touchableHandleKeyPress={this._touchableHandleKeyPress}\n touchableHandleKeyPressDown={this._touchableHandleKeyPressDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n onMouseEnter={this._mouseEnter}\n onMouseLeave={this._mouseLeave}\n renderStyle={this._generateStyle}\n children={this.props.children}\n ref={this.props.innerRef}\n />\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n this.setState({ isPressed: true });\n };\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n private readonly _touchableGetHitSlop = (): Insets => {\n return { left: 100, right: 100, top: 100, bottom: 100 };\n };\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayLongPressIn || 0;\n };\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress || 500;\n };\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n private readonly _touchableHandleKeyPress = (ev: IKeyboardEvent) => {\n this.props.onKeyPress && this.props.onKeyPress(ev);\n }\n private readonly _touchableHandleKeyPressDown = (ev: IKeyboardEvent) => {\n this.props.onKeyPressDown && this.props.onKeyPressDown(ev);\n }\n private readonly _mouseEnter = (mouseEvent): void => {\n this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);\n this.setState({ isMouseIn: true });\n };\n private readonly _mouseLeave = (mouseEvent): void => {\n this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);\n this.setState({ isMouseIn: false });\n };\n private readonly _onFocus = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onFocus && this.props.onFocus(ev);\n this.setState({ isFocused: true });\n };\n private readonly _onBlur = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onBlur && this.props.onBlur(ev);\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded color values,\n * though it is trivial to pass these values as props.\n * This is an example of a render style (one that is a\n * funtion passed on to TouchableWin32 and resolved according\n * to the internal state of TouchableWin32).\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {};\n finalStyle.borderColor = state.isFocused ? 'red' : 'blue';\n finalStyle.borderWidth = state.isFocused ? 10 : 5;\n if (state.isHovered) {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'black';\n } else {\n finalStyle.backgroundColor = 'gray';\n }\n } else {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'green';\n } else {\n finalStyle.backgroundColor = 'white';\n }\n }\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\n// Demonstrating ref forwarding - forwarding a ref using an innerRef prop on a class component\nconst TouchableWin32Highlight = React.forwardRef<TouchableWin32, ITouchableWin32HighlightProps>(\n (props, ref) => {\n return (\n <TouchableWin32HighlightComponent innerRef={ref} {...props} />\n );\n }\n);\n\n/**\n * Both examples merely track number of presses\n */\ninterface IExampleState {\n numberOfPresses: number;\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableWithoutFeedbackExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>Press me</TextWin32>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32WithoutFeedback style={styles.innerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>You can also have nested Touchables</TextWin32>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n <TextWin32>{'Number of Recognized Presses: ' + this.state.numberOfPresses}</TextWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableHighlightExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>Press me</TextWin32>\n </ViewWin32>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32Highlight style={styles.innerTouch} onPress={this._onPress} children={this._getChildrenOfInnerTouchable} />\n </ViewWin32>\n </TouchableWin32Highlight>\n <TextWin32 style={{ color: 'red' }} textStyle=\"None\">\n {'Number of Recognized Presses: ' + this.state.numberOfPresses}\n </TextWin32>\n </ViewWin32>\n );\n }\n\n /**\n * This is primarily to demonstrate render children as a function\n * of state, here we change text color depending on interaction state.\n */\n private readonly _getChildrenOfInnerTouchable = (state: ITouchableWin32State) => {\n return (\n <ViewWin32\n style={{\n borderColor: state.isFocused ? 'green' : 'pink',\n borderWidth: state.isHovered ? 10 : 5,\n height: 70,\n width: 70,\n }}\n >\n <TextWin32\n style={{\n color: this._pickColor(state.isHovered, state.isPressed),\n fontSize: state.isFocused ? 8 : 10,\n }}\n textStyle=\"None\"\n >\n Press Me!\n </TextWin32>\n </ViewWin32>\n );\n };\n\n private _pickColor(hovered: boolean, pressed: boolean) {\n if (hovered) {\n if (pressed) {\n return 'white';\n } else {\n return 'red';\n }\n } else {\n if (pressed) {\n return 'purple';\n } else {\n return 'black';\n }\n }\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\nconst TouchableFocusExample = () => {\n const [focused, setFocused] = React.useState(false);\n const focusableRef = React.useRef<TouchableWin32>(null);\n\n // onPress callback\n const focusOnPress = React.useCallback(() => {\n focusableRef.current && focusableRef.current.focus();\n focused || setFocused(true);\n }, [focused]);\n\n // onFocus and onBlur callbacks\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, []);\n const onBlur = React.useCallback(() => {\n setFocused(false);\n }, []);\n\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight onPress={focusOnPress}>\n <Text>Press me to focus my friend</Text>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight\n ref={focusableRef}\n onFocus={onFocus}\n onBlur={onBlur}\n >\n <Text>{'Focused: ' + focused}</Text>\n </TouchableWin32Highlight>\n </ViewWin32>\n );\n}\n\nexport const displayName = 'TouchableWin32 Examples';\nexport const title = 'TouchableWin32';\nexport const description = 'Demonstration of touchable + focus + hover behavior all in one component';\n\nexport const examples = [\n {\n title: 'TouchableWithoutFeedback Example',\n description: 'A simple example implementation of without feedback behavior',\n render(): JSX.Element {\n return <TouchableWithoutFeedbackExample />;\n },\n },\n {\n title: 'TouchableHighlight Example',\n description: 'A simple example implementation of highlight behavior',\n render(): JSX.Element {\n return <TouchableHighlightExample />;\n },\n },\n {\n title: 'Imperative Focus on TouchableWin32 Example',\n description: 'A simple example implementation of imperative focus behavior',\n render(): JSX.Element {\n return <TouchableFocusExample />;\n },\n }\n];\n"]}
@@ -1,16 +1,119 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule TouchableNativeFeedback
10
- */
11
- import React from 'react';
12
- import { ITouchableNativeFeedbackProps } from './TouchableNativeFeedback.Props';
13
- declare class TouchableNativeFeedback extends React.Component<ITouchableNativeFeedbackProps, {}> {
14
- render(): JSX.Element;
15
- }
16
- export = TouchableNativeFeedback;
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ import type * as React from 'react';
11
+ import {Constructor} from '../../../types/private/Utilities';
12
+ import {ColorValue} from '../../StyleSheet/StyleSheet';
13
+ import {TouchableMixin} from './Touchable';
14
+
15
+ import type {TVProps} from './TouchableOpacity';
16
+ import {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
17
+
18
+ interface BaseBackgroundPropType {
19
+ type: string;
20
+ rippleRadius?: number | null | undefined;
21
+ }
22
+
23
+ interface RippleBackgroundPropType extends BaseBackgroundPropType {
24
+ type: 'RippleAndroid';
25
+ borderless: boolean;
26
+ color?: number | null | undefined;
27
+ }
28
+
29
+ interface ThemeAttributeBackgroundPropType extends BaseBackgroundPropType {
30
+ type: 'ThemeAttrAndroid';
31
+ attribute: string;
32
+ }
33
+
34
+ type BackgroundPropType =
35
+ | RippleBackgroundPropType
36
+ | ThemeAttributeBackgroundPropType;
37
+
38
+ /**
39
+ * @see https://reactnative.dev/docs/touchablenativefeedback#props
40
+ */
41
+ export interface TouchableNativeFeedbackProps
42
+ extends TouchableWithoutFeedbackProps,
43
+ TVProps {
44
+ /**
45
+ * Determines the type of background drawable that's going to be used to display feedback.
46
+ * It takes an object with type property and extra data depending on the type.
47
+ * It's recommended to use one of the following static methods to generate that dictionary:
48
+ * 1) TouchableNativeFeedback.SelectableBackground() - will create object that represents android theme's
49
+ * default background for selectable elements (?android:attr/selectableItemBackground)
50
+ * 2) TouchableNativeFeedback.SelectableBackgroundBorderless() - will create object that represent android
51
+ * theme's default background for borderless selectable elements
52
+ * (?android:attr/selectableItemBackgroundBorderless). Available on android API level 21+
53
+ * 3) TouchableNativeFeedback.Ripple(color, borderless) - will create object that represents ripple drawable
54
+ * with specified color (as a string). If property borderless evaluates to true the ripple will render
55
+ * outside of the view bounds (see native actionbar buttons as an example of that behavior). This background
56
+ * type is available on Android API level 21+
57
+ */
58
+ background?: BackgroundPropType | undefined;
59
+ useForeground?: boolean | undefined;
60
+
61
+ tooltip?: string; // Win32
62
+ }
63
+
64
+ /**
65
+ * A wrapper for making views respond properly to touches (Android only).
66
+ * On Android this component uses native state drawable to display touch feedback.
67
+ * At the moment it only supports having a single View instance as a child node,
68
+ * as it's implemented by replacing that View with another instance of RCTView node with some additional properties set.
69
+ *
70
+ * Background drawable of native feedback touchable can be customized with background property.
71
+ *
72
+ * @see https://reactnative.dev/docs/touchablenativefeedback#content
73
+ */
74
+ declare class TouchableNativeFeedbackComponent extends React.Component<TouchableNativeFeedbackProps> {}
75
+ declare const TouchableNativeFeedbackBase: Constructor<TouchableMixin> &
76
+ typeof TouchableNativeFeedbackComponent;
77
+ export class TouchableNativeFeedback extends TouchableNativeFeedbackBase {
78
+ /**
79
+ * Creates an object that represents android theme's default background for
80
+ * selectable elements (?android:attr/selectableItemBackground).
81
+ *
82
+ * @param rippleRadius The radius of ripple effect
83
+ */
84
+ static SelectableBackground(
85
+ rippleRadius?: number | null,
86
+ ): ThemeAttributeBackgroundPropType;
87
+
88
+ /**
89
+ * Creates an object that represent android theme's default background for borderless
90
+ * selectable elements (?android:attr/selectableItemBackgroundBorderless).
91
+ * Available on android API level 21+.
92
+ *
93
+ * @param rippleRadius The radius of ripple effect
94
+ */
95
+ static SelectableBackgroundBorderless(
96
+ rippleRadius?: number | null,
97
+ ): ThemeAttributeBackgroundPropType;
98
+
99
+ /**
100
+ * Creates an object that represents ripple drawable with specified color (as a
101
+ * string). If property `borderless` evaluates to true the ripple will
102
+ * render outside of the view bounds (see native actionbar buttons as an
103
+ * example of that behavior). This background type is available on Android
104
+ * API level 21+.
105
+ *
106
+ * @param color The ripple color
107
+ * @param borderless If the ripple can render outside it's bounds
108
+ * @param rippleRadius The radius of ripple effect
109
+ */
110
+ static Ripple(
111
+ color: ColorValue,
112
+ borderless: boolean,
113
+ rippleRadius?: number | null,
114
+ ): RippleBackgroundPropType;
115
+ static canUseNativeForeground(): boolean;
116
+ }
117
+
118
+ // For backcompat
119
+ export type ITouchableNativeFeedbackProps = TouchableNativeFeedbackProps;
@@ -1,24 +1,99 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule TouchableNativeFeedback
10
- */
11
- 'use strict';
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- const react_1 = __importDefault(require("react"));
16
- const react_native_1 = require("react-native");
17
- class TouchableNativeFeedback extends react_1.default.Component {
18
- render() {
19
- return react_1.default.createElement(RCTTouchableNativeFeedback, { ...this.props }, this.props.children);
20
- }
21
- }
22
- const RCTTouchableNativeFeedback = (0, react_native_1.requireNativeComponent)('RCTTouchableNativeFeedback');
23
- module.exports = TouchableNativeFeedback;
24
- //# sourceMappingURL=TouchableNativeFeedback.win32.js.map
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @flow strict-local
6
+ * @format
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ import * as React from 'react';
12
+ import requireNativeComponent from '../../ReactNative/requireNativeComponent';
13
+ import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback';
14
+
15
+ type Props = $ReadOnly<{|
16
+ ...React.ElementConfig<TouchableWithoutFeedback>,
17
+
18
+ /**
19
+ * Determines the type of background drawable that's going to be used to
20
+ * display feedback. It takes an object with `type` property and extra data
21
+ * depending on the `type`. It's recommended to use one of the static
22
+ * methods to generate that dictionary.
23
+ */
24
+ background?: ?(
25
+ | $ReadOnly<{|
26
+ type: 'ThemeAttrAndroid',
27
+ attribute:
28
+ | 'selectableItemBackground'
29
+ | 'selectableItemBackgroundBorderless',
30
+ rippleRadius: ?number,
31
+ |}>
32
+ | $ReadOnly<{|
33
+ type: 'RippleAndroid',
34
+ color: ?number,
35
+ borderless: boolean,
36
+ rippleRadius: ?number,
37
+ |}>
38
+ ),
39
+
40
+ /**
41
+ * TV preferred focus (see documentation for the View component).
42
+ */
43
+ hasTVPreferredFocus?: ?boolean,
44
+
45
+ /**
46
+ * TV next focus down (see documentation for the View component).
47
+ */
48
+ nextFocusDown?: ?number,
49
+
50
+ /**
51
+ * TV next focus forward (see documentation for the View component).
52
+ */
53
+ nextFocusForward?: ?number,
54
+
55
+ /**
56
+ * TV next focus left (see documentation for the View component).
57
+ */
58
+ nextFocusLeft?: ?number,
59
+
60
+ /**
61
+ * TV next focus right (see documentation for the View component).
62
+ */
63
+ nextFocusRight?: ?number,
64
+
65
+ /**
66
+ * TV next focus up (see documentation for the View component).
67
+ */
68
+ nextFocusUp?: ?number,
69
+
70
+ /**
71
+ * Set to true to add the ripple effect to the foreground of the view, instead
72
+ * of the background. This is useful if one of your child views has a
73
+ * background of its own, or you're e.g. displaying images, and you don't want
74
+ * the ripple to be covered by them.
75
+ *
76
+ * Check TouchableNativeFeedback.canUseNativeForeground() first, as this is
77
+ * only available on Android 6.0 and above. If you try to use this on older
78
+ * versions, this will fallback to background.
79
+ */
80
+ useForeground?: ?boolean,
81
+
82
+ tooltip?: string, // Win32
83
+ |}>;
84
+
85
+ const RCTTouchableNativeFeedback = requireNativeComponent<Props>(
86
+ 'RCTTouchableNativeFeedback',
87
+ );
88
+
89
+ class TouchableNativeFeedback extends React.Component<Props, {}> {
90
+ render(): React.Node {
91
+ return (
92
+ <RCTTouchableNativeFeedback {...this.props}>
93
+ {this.props.children}
94
+ </RCTTouchableNativeFeedback>
95
+ );
96
+ }
97
+ }
98
+
99
+ module.exports = TouchableNativeFeedback;
@@ -1,13 +1,13 @@
1
1
  import { ViewStyle } from 'react-native';
2
2
  import { Insets } from 'react-native/types/public/Insets';
3
3
  import { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';
4
- import { IViewWin32Props, IKeyboardEvent } from '../View/ViewWin32.Props';
4
+ import { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes.win32';
5
5
  export interface ITouchableWin32State {
6
6
  isPressed: boolean;
7
7
  isFocused: boolean;
8
8
  isHovered: boolean;
9
9
  }
10
- declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
10
+ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
11
11
  export interface ITouchableWin32Props extends Omit<IViewWin32Props, 'children'> {
12
12
  rejectResponderTermination?: boolean;
13
13
  disabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"TouchableWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.Props.tsx"],"names":[],"mappings":"","sourcesContent":["import {ViewStyle} from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\n\nimport { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';\nimport { IViewWin32Props, IKeyboardEvent } from '../View/ViewWin32.Props';\n\nexport interface ITouchableWin32State {\n isPressed: boolean;\n isFocused: boolean;\n isHovered: boolean;\n}\n\ntype Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>\n\nexport interface ITouchableWin32Props extends Omit <IViewWin32Props, 'children'> {\n rejectResponderTermination?: boolean;\n disabled?: boolean;\n touchableHandleActivePressIn?: (e: IPressEvent) => void;\n touchableHandleActivePressOut?: (e: IPressEvent) => void;\n touchableHandlePress?: (e: IPressEvent) => void;\n touchableHandleKeyPress?: (e: IKeyboardEvent) => void;\n touchableHandleKeyPressDown?: (e: IKeyboardEvent) => void;\n touchableHandleLongPress?: (e: IPressEvent) => void;\n touchableGetHighlightDelayMS?: () => number;\n touchableGetPressRectOffset?: () => Insets;\n touchableGetLongPressDelayMS?: () => number;\n touchableGetPressOutDelayMS?: () => number;\n touchableGetHitSlop?: () => Insets;\n touchSoundDisabled?: boolean;\n onLongPress?: () => void;\n children?: IRenderChild<ITouchableWin32State>;\n // Typescript will not allow an extension of the IView* interface\n // that allows style to take on a function value. This is not a problem\n // with children, presumably because function components are valid as children.\n // As such, a renderStyle prop that takes a function value is provided\n // instead, in conjunction with the base style prop (StyleProp<ViewStyle>).\n // The style prop will only be used if a renderStyle is not provided.\n renderStyle?: IRenderStyle<ITouchableWin32State, ViewStyle>;\n /**\n * Filters keys for touchableHandleKeyPress / touchableHandleKeyPressDown events.\n * Space and Enter keys result in touchableHandleKeyPress(Down) in the event\n * that no filterKeys function is provided as a callback. All keyboard events\n * will result in onKeyUp and onKeyDown getting fired regardless of filterKeys.\n */\n filterKeys?: (str: string) => boolean;\n}\n"]}
1
+ {"version":3,"file":"TouchableWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.Props.tsx"],"names":[],"mappings":"","sourcesContent":["import {ViewStyle} from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\n\nimport { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';\nimport { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes.win32';\n\nexport interface ITouchableWin32State {\n isPressed: boolean;\n isFocused: boolean;\n isHovered: boolean;\n}\n\ntype Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>\n\nexport interface ITouchableWin32Props extends Omit <IViewWin32Props, 'children'> {\n rejectResponderTermination?: boolean;\n disabled?: boolean;\n touchableHandleActivePressIn?: (e: IPressEvent) => void;\n touchableHandleActivePressOut?: (e: IPressEvent) => void;\n touchableHandlePress?: (e: IPressEvent) => void;\n touchableHandleKeyPress?: (e: IKeyboardEvent) => void;\n touchableHandleKeyPressDown?: (e: IKeyboardEvent) => void;\n touchableHandleLongPress?: (e: IPressEvent) => void;\n touchableGetHighlightDelayMS?: () => number;\n touchableGetPressRectOffset?: () => Insets;\n touchableGetLongPressDelayMS?: () => number;\n touchableGetPressOutDelayMS?: () => number;\n touchableGetHitSlop?: () => Insets;\n touchSoundDisabled?: boolean;\n onLongPress?: () => void;\n children?: IRenderChild<ITouchableWin32State>;\n // Typescript will not allow an extension of the IView* interface\n // that allows style to take on a function value. This is not a problem\n // with children, presumably because function components are valid as children.\n // As such, a renderStyle prop that takes a function value is provided\n // instead, in conjunction with the base style prop (StyleProp<ViewStyle>).\n // The style prop will only be used if a renderStyle is not provided.\n renderStyle?: IRenderStyle<ITouchableWin32State, ViewStyle>;\n /**\n * Filters keys for touchableHandleKeyPress / touchableHandleKeyPressDown events.\n * Space and Enter keys result in touchableHandleKeyPress(Down) in the event\n * that no filterKeys function is provided as a callback. All keyboard events\n * will result in onKeyUp and onKeyDown getting fired regardless of filterKeys.\n */\n filterKeys?: (str: string) => boolean;\n}\n"]}
@@ -3,26 +3,26 @@ import { GestureResponderEvent, StyleProp, NativeSyntheticEvent } from 'react-na
3
3
  /**
4
4
  * Gesture responder states
5
5
  */
6
- export declare type IState = 'NOT_RESPONDER' | 'RESPONDER_INACTIVE_PRESS_IN' | 'RESPONDER_INACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_PRESS_IN' | 'RESPONDER_ACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_LONG_PRESS_IN' | 'RESPONDER_ACTIVE_LONG_PRESS_OUT' | 'ERROR';
6
+ export type IState = 'NOT_RESPONDER' | 'RESPONDER_INACTIVE_PRESS_IN' | 'RESPONDER_INACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_PRESS_IN' | 'RESPONDER_ACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_LONG_PRESS_IN' | 'RESPONDER_ACTIVE_LONG_PRESS_OUT' | 'ERROR';
7
7
  /**
8
8
  * Signals into the gesture responder system
9
9
  */
10
- export declare type ISignal = 'DELAY' | 'RESPONDER_GRANT' | 'RESPONDER_RELEASE' | 'RESPONDER_TERMINATED' | 'ENTER_PRESS_RECT' | 'LEAVE_PRESS_RECT' | 'LONG_PRESS_DETECTED';
11
- declare type ISignalTransitions = {
10
+ export type ISignal = 'DELAY' | 'RESPONDER_GRANT' | 'RESPONDER_RELEASE' | 'RESPONDER_TERMINATED' | 'ENTER_PRESS_RECT' | 'LEAVE_PRESS_RECT' | 'LONG_PRESS_DETECTED';
11
+ type ISignalTransitions = {
12
12
  [P in ISignal]: IState;
13
13
  };
14
14
  /**
15
15
  * Map of State to [Signal to State],
16
16
  * describing state transition maps
17
17
  */
18
- export declare type ITransitions = {
18
+ export type ITransitions = {
19
19
  [P in IState]: ISignalTransitions;
20
20
  };
21
21
  /**
22
22
  * Describes lookup maps of states meeting
23
23
  * some specified criteria
24
24
  */
25
- export declare type IStateConditions = {
25
+ export type IStateConditions = {
26
26
  [P in IState]: boolean;
27
27
  };
28
28
  /**
@@ -69,7 +69,7 @@ export interface IResponderSyntheticEvent<T> extends NativeSyntheticEvent<T> {
69
69
  * This encompasses all information used by TouchableWin32 based controls
70
70
  * during callbacks and in response to press events
71
71
  */
72
- export declare type IPressEvent = IResponderSyntheticEvent<{
72
+ export type IPressEvent = IResponderSyntheticEvent<{
73
73
  changedTouches: IPressEvent[];
74
74
  force: number;
75
75
  identifier: number;
@@ -94,7 +94,7 @@ export interface IPressInLocation {
94
94
  * Used by IRenderChild, it simply describes a function that takes
95
95
  * some generic state type T and returns a ReactNode
96
96
  */
97
- export declare type IChildAsFunction<T> = (state: T) => React.ReactNode;
97
+ export type IChildAsFunction<T> = (state: T) => React.ReactNode;
98
98
  /**
99
99
  * An IRenderChild describes children as a function that take the current
100
100
  * state of the parent component. It is up to the parent to invoke the function
@@ -103,12 +103,12 @@ export declare type IChildAsFunction<T> = (state: T) => React.ReactNode;
103
103
  * knowledge of the interaction state of their parent to properly render themselves
104
104
  * (e.g. foreground color of a text child)
105
105
  */
106
- export declare type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;
106
+ export type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;
107
107
  /**
108
108
  * An IRenderStyle describes style as a function that takes the current
109
109
  * state of the parent component. It is up to the parent to invoke the function
110
110
  * and make proper use of the more typical StyleProp<S> object that is returned
111
111
  * This is convenient for when styles need to be calculated depending on interaction states.
112
112
  */
113
- export declare type IRenderStyle<T, S> = (state: T) => StyleProp<S>;
113
+ export type IRenderStyle<T, S> = (state: T) => StyleProp<S>;
114
114
  export {};
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.TouchableWin32 = void 0;
17
17
  const react_1 = __importDefault(require("react"));
18
18
  const react_native_1 = require("react-native");
19
- const ViewWin32_1 = require("../View/ViewWin32");
20
19
  const BoundingDimensions = require('./BoundingDimensions');
21
20
  const Position = require('./Position');
22
21
  const { findNodeHandle } = require('../../Renderer/shims/ReactNative');
@@ -409,13 +408,13 @@ class TouchableWin32 extends react_1.default.Component {
409
408
  }
410
409
  }
411
410
  };
412
- this._onMouseEnter = () => {
411
+ this._onMouseEnter = (mouseEvent) => {
413
412
  this.setState({ isHovered: true });
414
- this.props.onMouseEnter && this.props.onMouseEnter();
413
+ this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);
415
414
  };
416
- this._onMouseLeave = () => {
415
+ this._onMouseLeave = (mouseEvent) => {
417
416
  this.setState({ isHovered: false });
418
- this.props.onMouseLeave && this.props.onMouseLeave();
417
+ this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);
419
418
  };
420
419
  this._onFocus = (ev) => {
421
420
  this.setState({ isFocused: true });
@@ -487,7 +486,7 @@ class TouchableWin32 extends react_1.default.Component {
487
486
  else if (style) {
488
487
  computedStyle = style;
489
488
  }
490
- return (react_1.default.createElement(ViewWin32_1.ViewWin32
489
+ return (react_1.default.createElement(react_native_1.ViewWin32
491
490
  // Forward most of the props
492
491
  , { ...rest,
493
492
  // Hooks into Gesture Responder System