@office-iss/react-native-win32 0.68.0-preview.3 → 0.69.0-preview.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 (180) hide show
  1. package/.flowconfig +1 -3
  2. package/CHANGELOG.json +388 -22
  3. package/CHANGELOG.md +162 -13
  4. package/IntegrationTests/BUCK +4 -1
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
  6. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
  7. package/Libraries/Alert/Alert.win32.js +1 -1
  8. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  9. package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
  10. package/Libraries/Animated/NativeAnimatedModule.js +1 -0
  11. package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
  12. package/Libraries/Animated/animations/TimingAnimation.js +6 -11
  13. package/Libraries/Animated/createAnimatedComponent.js +2 -2
  14. package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
  15. package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
  16. package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
  17. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  18. package/Libraries/AppState/AppState.js +1 -1
  19. package/Libraries/Blob/URL.js +7 -1
  20. package/Libraries/Components/Button.js +3 -0
  21. package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
  22. package/Libraries/Components/Pressable/Pressable.js +3 -3
  23. package/Libraries/Components/Pressable/Pressable.win32.js +3 -3
  24. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
  25. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
  26. package/Libraries/Components/ScrollView/ScrollView.js +1 -1
  27. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
  28. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
  29. package/Libraries/Components/Slider/Slider.js +0 -2
  30. package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
  31. package/Libraries/Components/StatusBar/StatusBar.js +6 -1
  32. package/Libraries/Components/Switch/Switch.js +13 -2
  33. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
  34. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
  35. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
  36. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
  37. package/Libraries/Components/TextInput/TextInput.js +1 -8
  38. package/Libraries/Components/TextInput/TextInputState.js +10 -2
  39. package/Libraries/Components/TextInput/TextInputState.win32.js +10 -2
  40. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  41. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  42. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
  43. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
  44. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
  45. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +3 -1
  46. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  47. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
  48. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  49. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  50. package/Libraries/Components/View/View.win32.js +33 -1
  51. package/Libraries/Components/View/ViewNativeComponent.js +68 -8
  52. package/Libraries/Components/View/ViewPropTypes.js +36 -4
  53. package/Libraries/Components/View/ViewPropTypes.win32.js +36 -4
  54. package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -1
  55. package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
  56. package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
  57. package/Libraries/Core/ExceptionsManager.js +1 -1
  58. package/Libraries/Core/RawEventEmitter.js +38 -0
  59. package/Libraries/Core/ReactNativeVersion.js +2 -2
  60. package/Libraries/Core/polyfillPromise.js +32 -0
  61. package/Libraries/Core/setUpReactDevTools.js +3 -2
  62. package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
  63. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
  64. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
  65. package/Libraries/Events/CustomEvent.js +32 -0
  66. package/Libraries/Events/EventPolyfill.js +239 -0
  67. package/Libraries/Image/Image.android.js +0 -6
  68. package/Libraries/Image/Image.ios.js +0 -6
  69. package/Libraries/Image/Image.win32.js +2 -8
  70. package/Libraries/Image/ImageViewNativeComponent.js +18 -3
  71. package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
  72. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  73. package/Libraries/Inspector/Inspector.js +2 -4
  74. package/Libraries/Inspector/Inspector.win32.js +7 -9
  75. package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
  76. package/Libraries/Interaction/InteractionManager.js +1 -12
  77. package/Libraries/Interaction/TaskQueue.js +5 -4
  78. package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
  79. package/Libraries/Linking/Linking.js +1 -1
  80. package/Libraries/Lists/FlatList.js +27 -6
  81. package/Libraries/Lists/VirtualizedList.js +71 -55
  82. package/Libraries/Lists/VirtualizedListContext.js +7 -3
  83. package/Libraries/Lists/VirtualizedSectionList.js +2 -2
  84. package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
  85. package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
  86. package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
  87. package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
  88. package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +92 -43
  89. package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +16 -14
  90. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  91. package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
  92. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  93. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  94. package/Libraries/LogBox/LogBox.js +2 -21
  95. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
  96. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
  97. package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
  98. package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
  99. package/Libraries/NativeComponent/BaseViewConfig.win32.js +334 -0
  100. package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
  101. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
  102. package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
  103. package/Libraries/NativeComponent/ViewConfig.js +4 -4
  104. package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
  105. package/Libraries/Network/FormData.js +7 -1
  106. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  107. package/Libraries/Pressability/Pressability.js +115 -46
  108. package/Libraries/Pressability/Pressability.win32.js +174 -69
  109. package/Libraries/Pressability/PressabilityDebug.js +5 -9
  110. package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
  111. package/Libraries/ReactNative/AppContainer.js +1 -1
  112. package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
  113. package/Libraries/ReactNative/PaperUIManager.win32.js +5 -5
  114. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
  115. package/Libraries/ReactNative/UIManager.js +2 -3
  116. package/Libraries/ReactNative/renderApplication.js +4 -0
  117. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
  118. package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
  119. package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
  120. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
  121. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
  122. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
  123. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
  124. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  125. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
  126. package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
  127. package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
  128. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  129. package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
  130. package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
  131. package/Libraries/Text/Text.js +13 -7
  132. package/Libraries/Text/TextNativeComponent.js +2 -0
  133. package/Libraries/Text/TextNativeComponent.win32.js +2 -0
  134. package/Libraries/Text/TextProps.js +10 -0
  135. package/Libraries/Types/CoreEventTypes.js +13 -1
  136. package/Libraries/Types/CoreEventTypes.win32.js +26 -1
  137. package/Libraries/Utilities/Appearance.js +0 -8
  138. package/Libraries/Utilities/HMRClient.js +1 -1
  139. package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
  140. package/Libraries/Utilities/codegenNativeComponent.js +17 -6
  141. package/Libraries/Utilities/stringifySafe.js +4 -1
  142. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
  143. package/Libraries/WebSocket/WebSocket.js +1 -1
  144. package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
  145. package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
  146. package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
  147. package/index.js +30 -25
  148. package/index.win32.js +30 -25
  149. package/jest/preprocessor.js +24 -107
  150. package/jest/preprocessor_DO_NOT_USE.js +122 -0
  151. package/metro.config.js +3 -47
  152. package/overrides.json +39 -46
  153. package/package.json +28 -27
  154. package/rntypes/index.d.ts +19 -7
  155. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +1 -1
  156. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +3 -1
  157. package/src/Libraries/Components/View/ViewWin32.Props.ts +1 -0
  158. package/src/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +427 -0
  159. package/src/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap +391 -0
  160. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +3 -0
  161. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +4565 -0
  162. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedSectionList-test.js.snap +1153 -0
  163. package/src/rntypes/index.d.ts +19 -7
  164. package/typings-index.js +5 -1
  165. package/typings-index.js.map +1 -1
  166. package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
  167. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
  168. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
  169. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.js +0 -45
  170. package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
  171. package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +0 -401
  172. package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
  173. package/Libraries/ReactNative/UIManagerInjection.js +0 -15
  174. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
  175. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
  176. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
  177. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
  178. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
  179. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
  180. package/flow/Promise.js +0 -47
@@ -73,7 +73,7 @@ function blurField(textFieldID: ?number) {
73
73
  /**
74
74
  * @param {number} TextInputID id of the text field to focus
75
75
  * Focuses the specified text field
76
- * noop if the text field was already focused
76
+ * noop if the text field was already focused or if the field is not editable
77
77
  */
78
78
  function focusTextInput(textField: ?ComponentRef) {
79
79
  if (typeof textField === 'number') {
@@ -86,7 +86,15 @@ function focusTextInput(textField: ?ComponentRef) {
86
86
  return;
87
87
  }
88
88
 
89
- if (currentlyFocusedInputRef !== textField && textField != null) {
89
+ if (textField != null) {
90
+ const fieldCanBeFocused =
91
+ currentlyFocusedInputRef !== textField &&
92
+ // $FlowFixMe - `currentProps` is missing in `NativeMethods`
93
+ textField.currentProps?.editable !== false;
94
+
95
+ if (!fieldCanBeFocused) {
96
+ return;
97
+ }
90
98
  focusInput(textField);
91
99
  if (Platform.OS === 'ios') {
92
100
  // This isn't necessarily a single line text input
@@ -74,7 +74,7 @@ function blurField(textFieldID: ?number) {
74
74
  /**
75
75
  * @param {number} TextInputID id of the text field to focus
76
76
  * Focuses the specified text field
77
- * noop if the text field was already focused
77
+ * noop if the text field was already focused or if the field is not editable
78
78
  */
79
79
  function focusTextInput(textField: ?ComponentRef) {
80
80
  if (typeof textField === 'number') {
@@ -87,7 +87,15 @@ function focusTextInput(textField: ?ComponentRef) {
87
87
  return;
88
88
  }
89
89
 
90
- if (currentlyFocusedInputRef !== textField && textField != null) {
90
+ if (textField != null) {
91
+ const fieldCanBeFocused =
92
+ currentlyFocusedInputRef !== textField &&
93
+ // $FlowFixMe - `currentProps` is missing in `NativeMethods`
94
+ textField.currentProps?.editable !== false;
95
+
96
+ if (!fieldCanBeFocused) {
97
+ return;
98
+ }
91
99
  focusInput(textField);
92
100
  if (Platform.OS === 'ios') {
93
101
  // This isn't necessarily a single line text input
@@ -1 +1 @@
1
- {"version":3,"file":"TouchableWin32Test.js","sourceR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AAE,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 { Insets, NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';\n\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 IViewWin32Props {\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,+CAAyF;AAEzF,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;Q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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 { Insets, NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';\n\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"]}
@@ -137,6 +137,7 @@ class TouchableBounce extends React.Component<Props, State> {
137
137
  accessible={this.props.accessible !== false}
138
138
  accessibilityLabel={this.props.accessibilityLabel}
139
139
  accessibilityHint={this.props.accessibilityHint}
140
+ accessibilityLanguage={this.props.accessibilityLanguage}
140
141
  accessibilityRole={this.props.accessibilityRole}
141
142
  accessibilityState={this.props.accessibilityState}
142
143
  accessibilityActions={this.props.accessibilityActions}
@@ -296,6 +296,7 @@ class TouchableHighlight extends React.Component<Props, State> {
296
296
  accessible={this.props.accessible !== false}
297
297
  accessibilityLabel={this.props.accessibilityLabel}
298
298
  accessibilityHint={this.props.accessibilityHint}
299
+ accessibilityLanguage={this.props.accessibilityLanguage}
299
300
  accessibilityRole={this.props.accessibilityRole}
300
301
  accessibilityState={accessibilityState}
301
302
  accessibilityValue={this.props.accessibilityValue}
@@ -271,6 +271,7 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
271
271
  ),
272
272
  accessible: this.props.accessible !== false,
273
273
  accessibilityHint: this.props.accessibilityHint,
274
+ accessibilityLanguage: this.props.accessibilityLanguage,
274
275
  accessibilityLabel: this.props.accessibilityLabel,
275
276
  accessibilityRole: this.props.accessibilityRole,
276
277
  accessibilityState: accessibilityState,
@@ -225,6 +225,7 @@ class TouchableOpacity extends React.Component<Props, State> {
225
225
  accessible={this.props.accessible !== false}
226
226
  accessibilityLabel={this.props.accessibilityLabel}
227
227
  accessibilityHint={this.props.accessibilityHint}
228
+ accessibilityLanguage={this.props.accessibilityLanguage}
228
229
  accessibilityRole={this.props.accessibilityRole}
229
230
  accessibilityState={accessibilityState}
230
231
  accessibilityActions={this.props.accessibilityActions}
@@ -260,7 +261,12 @@ class TouchableOpacity extends React.Component<Props, State> {
260
261
 
261
262
  componentDidUpdate(prevProps: Props, prevState: State) {
262
263
  this.state.pressability.configure(this._createPressabilityConfig());
263
- if (this.props.disabled !== prevProps.disabled) {
264
+ if (
265
+ this.props.disabled !== prevProps.disabled ||
266
+ (flattenStyle(prevProps.style)?.opacity !==
267
+ flattenStyle(this.props.style)?.opacity) !==
268
+ undefined
269
+ ) {
264
270
  this._opacityInactive(250);
265
271
  }
266
272
  }
@@ -6,7 +6,8 @@ export interface ITouchableWin32State {
6
6
  isFocused: boolean;
7
7
  isHovered: boolean;
8
8
  }
9
- export interface ITouchableWin32Props extends IViewWin32Props {
9
+ declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
10
+ export interface ITouchableWin32Props extends Omit<IViewWin32Props, 'children'> {
10
11
  rejectResponderTermination?: boolean;
11
12
  disabled?: boolean;
12
13
  touchableHandleActivePressIn?: (e: IPressEvent) => void;
@@ -32,3 +33,4 @@ export interface ITouchableWin32Props extends IViewWin32Props {
32
33
  */
33
34
  filterKeys?: (str: string) => boolean;
34
35
  }
36
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"TouchableWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.Props.tsx"],"names":[],"mappings":"","sourcesContent":["import { Insets, ViewStyle } from 'react-native';\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\nexport interface ITouchableWin32Props extends IViewWin32Props {\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 { Insets, ViewStyle } from 'react-native';\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"]}
@@ -33,6 +33,7 @@ type Props = $ReadOnly<{|
33
33
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
34
34
  accessibilityElementsHidden?: ?boolean,
35
35
  accessibilityHint?: ?Stringish,
36
+ accessibilityLanguage?: ?Stringish,
36
37
  accessibilityIgnoresInvertColors?: ?boolean,
37
38
  accessibilityLabel?: ?Stringish,
38
39
  accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'),
@@ -72,6 +73,7 @@ const PASSTHROUGH_PROPS = [
72
73
  'accessibilityActions',
73
74
  'accessibilityElementsHidden',
74
75
  'accessibilityHint',
76
+ 'accessibilityLanguage',
75
77
  'accessibilityIgnoresInvertColors',
76
78
  'accessibilityLabel',
77
79
  'accessibilityLiveRegion',
@@ -21,6 +21,7 @@ const UIView = {
21
21
  accessibilityState: true,
22
22
  accessibilityValue: true,
23
23
  accessibilityHint: true,
24
+ accessibilityLanguage: true,
24
25
  importantForAccessibility: true,
25
26
  nativeID: true,
26
27
  testID: true,
@@ -21,6 +21,7 @@ const UIView = {
21
21
  accessibilityState: true,
22
22
  accessibilityValue: true,
23
23
  accessibilityHint: true,
24
+ accessibilityLanguage: true,
24
25
  importantForAccessibility: true,
25
26
  nativeID: true,
26
27
  testID: true,
@@ -75,13 +75,33 @@ const View: React.AbstractComponent<
75
75
  props.onKeyUpCapture && props.onKeyUpCapture(event);
76
76
  };
77
77
 
78
+ // [Windows
79
+ const childrenWithImportantForAccessibility = children => {
80
+ return React.Children.map(children, child => {
81
+ if (React.isValidElement(child)) {
82
+ if (child.props.children) {
83
+ return React.cloneElement(child, {
84
+ accessible: false,
85
+ children: childrenWithImportantForAccessibility(
86
+ child.props.children,
87
+ ),
88
+ });
89
+ } else {
90
+ return React.cloneElement(child, {accessible: false});
91
+ }
92
+ }
93
+ return child;
94
+ });
95
+ };
96
+ // Windows]
97
+
78
98
  return (
79
99
  // [Windows
80
100
  // In core this is a TextAncestor.Provider value={false} See
81
101
  // https://github.com/facebook/react-native/commit/66601e755fcad10698e61d20878d52194ad0e90c
82
102
  // But since Views are not currently supported in Text, we do not need the extra provider
83
103
  <TextAncestor.Consumer>
84
- {(hasTextAncestor) => {
104
+ {hasTextAncestor => {
85
105
  invariant(
86
106
  !hasTextAncestor,
87
107
  'Nesting of <View> within <Text> is not currently supported.',
@@ -94,6 +114,18 @@ const View: React.AbstractComponent<
94
114
  onKeyDownCapture={_keyDownCapture}
95
115
  onKeyUp={_keyUp}
96
116
  onKeyUpCapture={_keyUpCapture}
117
+ // [Windows
118
+ accessible={
119
+ props.importantForAccessibility === 'no-hide-descendants'
120
+ ? false
121
+ : props.accessible
122
+ }
123
+ children={
124
+ props.importantForAccessibility === 'no-hide-descendants'
125
+ ? childrenWithImportantForAccessibility(props.children)
126
+ : props.children
127
+ }
128
+ // Windows]
97
129
  />
98
130
  );
99
131
  }}
@@ -9,19 +9,79 @@
9
9
  */
10
10
 
11
11
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
12
- import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
13
- import Platform from '../../Utilities/Platform';
12
+ import type {
13
+ HostComponent,
14
+ PartialViewConfig,
15
+ } from '../../Renderer/shims/ReactNativeTypes';
14
16
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
15
- import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid';
16
17
  import {type ViewProps as Props} from './ViewPropTypes';
18
+ import Platform from '../../Utilities/Platform';
19
+
17
20
  import * as React from 'react';
18
21
 
22
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
23
+ Platform.OS === 'android'
24
+ ? {
25
+ uiViewClassName: 'RCTView',
26
+ validAttributes: {
27
+ // ReactClippingViewManager @ReactProps
28
+ removeClippedSubviews: true,
29
+
30
+ // ReactViewManager @ReactProps
31
+ accessible: true,
32
+ hasTVPreferredFocus: true,
33
+ nextFocusDown: true,
34
+ nextFocusForward: true,
35
+ nextFocusLeft: true,
36
+ nextFocusRight: true,
37
+ nextFocusUp: true,
38
+
39
+ borderRadius: true,
40
+ borderTopLeftRadius: true,
41
+ borderTopRightRadius: true,
42
+ borderBottomRightRadius: true,
43
+ borderBottomLeftRadius: true,
44
+ borderTopStartRadius: true,
45
+ borderTopEndRadius: true,
46
+ borderBottomStartRadius: true,
47
+ borderBottomEndRadius: true,
48
+
49
+ borderStyle: true,
50
+ hitSlop: true,
51
+ pointerEvents: true,
52
+ nativeBackgroundAndroid: true,
53
+ nativeForegroundAndroid: true,
54
+ needsOffscreenAlphaCompositing: true,
55
+
56
+ borderWidth: true,
57
+ borderLeftWidth: true,
58
+ borderRightWidth: true,
59
+ borderTopWidth: true,
60
+ borderBottomWidth: true,
61
+ borderStartWidth: true,
62
+ borderEndWidth: true,
63
+
64
+ borderColor: {process: require('../../StyleSheet/processColor')},
65
+ borderLeftColor: {process: require('../../StyleSheet/processColor')},
66
+ borderRightColor: {process: require('../../StyleSheet/processColor')},
67
+ borderTopColor: {process: require('../../StyleSheet/processColor')},
68
+ borderBottomColor: {
69
+ process: require('../../StyleSheet/processColor'),
70
+ },
71
+ borderStartColor: {process: require('../../StyleSheet/processColor')},
72
+ borderEndColor: {process: require('../../StyleSheet/processColor')},
73
+
74
+ focusable: true,
75
+ overflow: true,
76
+ backfaceVisibility: true,
77
+ },
78
+ }
79
+ : {
80
+ uiViewClassName: 'RCTView',
81
+ };
82
+
19
83
  const ViewNativeComponent: HostComponent<Props> =
20
- NativeComponentRegistry.get<Props>('RCTView', () =>
21
- Platform.OS === 'android'
22
- ? ReactNativeViewViewConfigAndroid
23
- : {uiViewClassName: 'RCTView'},
24
- );
84
+ NativeComponentRegistry.get<Props>('RCTView', () => __INTERNAL_VIEW_CONFIG);
25
85
 
26
86
  interface NativeCommands {
27
87
  +hotspotUpdate: (
@@ -14,11 +14,12 @@ import type {
14
14
  BlurEvent,
15
15
  FocusEvent,
16
16
  MouseEvent,
17
+ PointerEvent,
17
18
  PressEvent,
18
19
  Layout,
19
20
  LayoutEvent,
20
21
  } from '../../Types/CoreEventTypes';
21
- import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
22
+ import type {EdgeInsetsOrSizeProp} from '../../StyleSheet/EdgeInsetsPropType';
22
23
  import type {Node} from 'react';
23
24
  import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
24
25
  import type {
@@ -84,8 +85,29 @@ type DirectEventProps = $ReadOnly<{|
84
85
  |}>;
85
86
 
86
87
  type MouseEventProps = $ReadOnly<{|
87
- onMouseEnter?: (event: MouseEvent) => void,
88
- onMouseLeave?: (event: MouseEvent) => void,
88
+ onMouseEnter?: ?(event: MouseEvent) => void,
89
+ onMouseLeave?: ?(event: MouseEvent) => void,
90
+ |}>;
91
+
92
+ // Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
93
+ type PointerEventProps = $ReadOnly<{|
94
+ onPointerEnter?: ?(event: PointerEvent) => void,
95
+ onPointerLeave?: ?(event: PointerEvent) => void,
96
+ onPointerMove?: ?(event: PointerEvent) => void,
97
+ onPointerCancel?: ?(e: PointerEvent) => void,
98
+ onPointerCancelCapture?: ?(e: PointerEvent) => void,
99
+ onPointerDown?: ?(e: PointerEvent) => void,
100
+ onPointerDownCapture?: ?(e: PointerEvent) => void,
101
+ onPointerUp?: ?(e: PointerEvent) => void,
102
+ onPointerUpCapture?: ?(e: PointerEvent) => void,
103
+
104
+ // FIXME: these events are temporary while we converge pointer event handling
105
+ onPointerEnter2?: ?(e: PointerEvent) => void,
106
+ onPointerEnter2Capture?: ?(e: PointerEvent) => void,
107
+ onPointerLeave2?: ?(e: PointerEvent) => void,
108
+ onPointerLeave2Capture?: ?(e: PointerEvent) => void,
109
+ onPointerMove2?: ?(e: PointerEvent) => void,
110
+ onPointerMove2Capture?: ?(e: PointerEvent) => void,
89
111
  |}>;
90
112
 
91
113
  type TouchEventProps = $ReadOnly<{|
@@ -381,6 +403,7 @@ export type ViewProps = $ReadOnly<{|
381
403
  ...DirectEventProps,
382
404
  ...GestureResponderEventProps,
383
405
  ...MouseEventProps,
406
+ ...PointerEventProps,
384
407
  ...TouchEventProps,
385
408
  ...AndroidViewProps,
386
409
  ...IOSViewProps,
@@ -415,6 +438,15 @@ export type ViewProps = $ReadOnly<{|
415
438
  */
416
439
  accessibilityHint?: ?Stringish,
417
440
 
441
+ /**
442
+ * Indicates to the accessibility services that the UI component is in
443
+ * a specific language. The provided string should be formatted following
444
+ * the BCP 47 specification (https://www.rfc-editor.org/info/bcp47).
445
+ *
446
+ * @platform ios
447
+ */
448
+ accessibilityLanguage?: ?Stringish,
449
+
418
450
  /**
419
451
  * Indicates to accessibility services to treat UI component like a specific role.
420
452
  */
@@ -481,7 +513,7 @@ export type ViewProps = $ReadOnly<{|
481
513
  *
482
514
  * See https://reactnative.dev/docs/view#hitslop
483
515
  */
484
- hitSlop?: ?EdgeInsetsProp,
516
+ hitSlop?: ?EdgeInsetsOrSizeProp,
485
517
 
486
518
  /**
487
519
  * Controls whether the `View` can be the target of touch events.
@@ -14,12 +14,13 @@ import type {
14
14
  BlurEvent,
15
15
  FocusEvent,
16
16
  MouseEvent,
17
+ PointerEvent,
17
18
  PressEvent,
18
19
  Layout,
19
20
  LayoutEvent,
20
21
  KeyEvent, // [Windows]
21
22
  } from '../../Types/CoreEventTypes';
22
- import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
23
+ import type {EdgeInsetsOrSizeProp} from '../../StyleSheet/EdgeInsetsPropType';
23
24
  import type {Node} from 'react';
24
25
  import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
25
26
  import type {
@@ -85,8 +86,29 @@ type DirectEventProps = $ReadOnly<{|
85
86
  |}>;
86
87
 
87
88
  type MouseEventProps = $ReadOnly<{|
88
- onMouseEnter?: (event: MouseEvent) => void,
89
- onMouseLeave?: (event: MouseEvent) => void,
89
+ onMouseEnter?: ?(event: MouseEvent) => void,
90
+ onMouseLeave?: ?(event: MouseEvent) => void,
91
+ |}>;
92
+
93
+ // Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
94
+ type PointerEventProps = $ReadOnly<{|
95
+ onPointerEnter?: ?(event: PointerEvent) => void,
96
+ onPointerLeave?: ?(event: PointerEvent) => void,
97
+ onPointerMove?: ?(event: PointerEvent) => void,
98
+ onPointerCancel?: ?(e: PointerEvent) => void,
99
+ onPointerCancelCapture?: ?(e: PointerEvent) => void,
100
+ onPointerDown?: ?(e: PointerEvent) => void,
101
+ onPointerDownCapture?: ?(e: PointerEvent) => void,
102
+ onPointerUp?: ?(e: PointerEvent) => void,
103
+ onPointerUpCapture?: ?(e: PointerEvent) => void,
104
+
105
+ // FIXME: these events are temporary while we converge pointer event handling
106
+ onPointerEnter2?: ?(e: PointerEvent) => void,
107
+ onPointerEnter2Capture?: ?(e: PointerEvent) => void,
108
+ onPointerLeave2?: ?(e: PointerEvent) => void,
109
+ onPointerLeave2Capture?: ?(e: PointerEvent) => void,
110
+ onPointerMove2?: ?(e: PointerEvent) => void,
111
+ onPointerMove2Capture?: ?(e: PointerEvent) => void,
90
112
  |}>;
91
113
 
92
114
  type TouchEventProps = $ReadOnly<{|
@@ -429,6 +451,7 @@ export type ViewProps = $ReadOnly<{|
429
451
  ...DirectEventProps,
430
452
  ...GestureResponderEventProps,
431
453
  ...MouseEventProps,
454
+ ...PointerEventProps,
432
455
  ...TouchEventProps,
433
456
  ...AndroidViewProps,
434
457
  ...IOSViewProps,
@@ -464,6 +487,15 @@ export type ViewProps = $ReadOnly<{|
464
487
  */
465
488
  accessibilityHint?: ?Stringish,
466
489
 
490
+ /**
491
+ * Indicates to the accessibility services that the UI component is in
492
+ * a specific language. The provided string should be formatted following
493
+ * the BCP 47 specification (https://www.rfc-editor.org/info/bcp47).
494
+ *
495
+ * @platform ios
496
+ */
497
+ accessibilityLanguage?: ?Stringish,
498
+
467
499
  /**
468
500
  * Indicates to accessibility services to treat UI component like a specific role.
469
501
  */
@@ -530,7 +562,7 @@ export type ViewProps = $ReadOnly<{|
530
562
  *
531
563
  * See https://reactnative.dev/docs/view#hitslop
532
564
  */
533
- hitSlop?: ?EdgeInsetsProp,
565
+ hitSlop?: ?EdgeInsetsOrSizeProp,
534
566
 
535
567
  /**
536
568
  * Controls whether the `View` can be the target of touch events.
@@ -25,7 +25,7 @@ export declare type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEve
25
25
  export interface IViewWin32 {
26
26
  focus: () => void;
27
27
  }
28
- export declare type ARIARole = 'alert' | 'alertdialog' | 'application' | 'button' | 'checkbox' | 'combobox' | 'dialog' | 'group' | 'link' | 'menu' | 'menubar' | 'menuitem' | 'none' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'search' | 'spinbutton' | 'switch' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'timer' | 'toolbar' | 'tree' | 'treeitem';
28
+ export declare type ARIARole = 'alert' | 'alertdialog' | 'application' | 'button' | 'checkbox' | 'combobox' | 'dialog' | 'group' | 'link' | 'listitem' | 'menu' | 'menubar' | 'menuitem' | 'none' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'search' | 'spinbutton' | 'switch' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'timer' | 'toolbar' | 'tree' | 'treeitem';
29
29
  export declare type AnnotationType = 'AdvanceProofingIssue' | 'Author' | 'CircularReferenceError' | 'Comment' | 'ConflictingChange' | 'DataValidationError' | 'DeletionChange' | 'EditingLockedChange' | 'Endnote' | 'ExternalChange' | 'Footer' | 'Footnote' | 'FormatChange' | 'FormulaError' | 'GrammarError' | 'Header' | 'Highlighted' | 'InsertionChange' | 'Mathematics' | 'MoveChange' | 'SpellingError' | 'TrackChanges' | 'Unknown' | 'UnsyncedChange';
30
30
  export declare type AccessibilityAnnotationInfo = Readonly<{
31
31
  typeID: AnnotationType;