@office-iss/react-native-win32 0.0.0-canary.285 → 0.0.0-canary.286

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 (217) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +16 -1
  3. package/CHANGELOG.md +16 -8
  4. package/IntegrationTests/LayoutEventsTest.js +16 -11
  5. package/Libraries/Alert/Alert.js +51 -5
  6. package/Libraries/Alert/Alert.win32.js +50 -5
  7. package/Libraries/Animated/animations/Animation.js +1 -4
  8. package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
  9. package/Libraries/AppState/AppState.js +24 -7
  10. package/Libraries/BatchedBridge/MessageQueue.js +3 -2
  11. package/Libraries/BatchedBridge/NativeModules.js +2 -1
  12. package/Libraries/Blob/Blob.js +1 -1
  13. package/Libraries/Blob/FileReader_old.js +9 -9
  14. package/Libraries/Blob/URL.js +1 -1
  15. package/Libraries/Blob/URLSearchParams.js +9 -9
  16. package/Libraries/Components/Button.js +3 -3
  17. package/Libraries/Components/Button.win32.js +3 -6
  18. package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -1
  19. package/Libraries/Components/Pressable/Pressable.js +9 -9
  20. package/Libraries/Components/Pressable/Pressable.win32.js +9 -9
  21. package/Libraries/Components/Pressable/useAndroidRippleForView.js +7 -7
  22. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +7 -1
  23. package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
  24. package/Libraries/Components/ScrollView/ScrollView.js +74 -59
  25. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -5
  26. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +5 -2
  27. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -3
  28. package/Libraries/Components/Switch/Switch.js +2 -2
  29. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +3 -1
  30. package/Libraries/Components/TextInput/TextInput.flow.js +15 -13
  31. package/Libraries/Components/TextInput/TextInput.js +16 -14
  32. package/Libraries/Components/TextInput/TextInput.win32.js +16 -14
  33. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  34. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  35. package/Libraries/Components/Touchable/Touchable.js +16 -16
  36. package/Libraries/Components/Touchable/Touchable.win32.js +16 -16
  37. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
  38. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +7 -7
  39. package/Libraries/Components/View/ReactNativeStyleAttributes.js +16 -2
  40. package/Libraries/Components/View/ViewAccessibility.js +243 -3
  41. package/Libraries/Components/View/ViewAccessibility.win32.js +243 -3
  42. package/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
  43. package/Libraries/Components/View/ViewPropTypes.js +35 -226
  44. package/Libraries/Components/View/ViewPropTypes.win32.js +37 -229
  45. package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
  46. package/Libraries/Core/InitializeCore.js +2 -1
  47. package/Libraries/Core/ReactNativeVersion.js +1 -1
  48. package/Libraries/Core/Timers/JSTimers.js +6 -4
  49. package/Libraries/Core/setUpBatchedBridge.js +9 -5
  50. package/Libraries/Core/setUpDeveloperTools.js +3 -29
  51. package/Libraries/Core/setUpReactDevTools.js +1 -1
  52. package/Libraries/Core/setUpReactRefresh.js +1 -1
  53. package/Libraries/Core/setUpXHR.js +5 -2
  54. package/Libraries/EventEmitter/NativeEventEmitter.js +8 -2
  55. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -4
  56. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -2
  57. package/Libraries/Events/CustomEvent.js +1 -1
  58. package/Libraries/Events/EventPolyfill.js +2 -2
  59. package/Libraries/Image/AssetSourceResolver.js +1 -1
  60. package/Libraries/Image/ImageProps.js +8 -5
  61. package/Libraries/Image/ImageViewNativeComponent.js +1 -1
  62. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  63. package/Libraries/Interaction/InteractionManager.js +1 -1
  64. package/Libraries/Interaction/InteractionManagerStub.js +9 -1
  65. package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -1
  66. package/Libraries/Interaction/PanResponder.js +32 -29
  67. package/Libraries/Interaction/TaskQueue.js +1 -1
  68. package/Libraries/LayoutAnimation/LayoutAnimation.js +18 -4
  69. package/Libraries/Lists/FillRateHelper.js +3 -3
  70. package/Libraries/Lists/FlatList.js +13 -13
  71. package/Libraries/Lists/SectionList.js +3 -1
  72. package/Libraries/Lists/SectionListModern.js +3 -1
  73. package/Libraries/Lists/ViewabilityHelper.js +3 -2
  74. package/Libraries/Lists/VirtualizeUtils.js +3 -3
  75. package/Libraries/Lists/VirtualizedList.js +5 -5
  76. package/Libraries/Lists/VirtualizedListContext.js +4 -2
  77. package/Libraries/Lists/VirtualizedSectionList.js +4 -2
  78. package/Libraries/LogBox/LogBox.js +9 -1
  79. package/Libraries/LogBox/UI/AnsiHighlight.js +7 -3
  80. package/Libraries/LogBox/UI/LogBoxButton.js +4 -2
  81. package/Libraries/LogBox/UI/LogBoxInspector.js +1 -1
  82. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +11 -3
  83. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +2 -0
  84. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
  85. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +8 -2
  86. package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +2 -0
  87. package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +4 -2
  88. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -1
  89. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +3 -1
  90. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +2 -2
  91. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +5 -3
  92. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.win32.js +5 -3
  93. package/Libraries/LogBox/UI/LogBoxNotification.js +6 -2
  94. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +3 -1
  95. package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +2 -0
  96. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +4 -1
  97. package/Libraries/Modal/Modal.js +74 -81
  98. package/Libraries/NativeComponent/BaseViewConfig.android.js +16 -6
  99. package/Libraries/NativeComponent/BaseViewConfig.ios.js +19 -9
  100. package/Libraries/NativeComponent/BaseViewConfig.win32.js +19 -9
  101. package/Libraries/NativeComponent/StaticViewConfigValidator.js +5 -1
  102. package/Libraries/Network/FormData.js +1 -1
  103. package/Libraries/Network/XMLHttpRequest.js +5 -6
  104. package/Libraries/Network/XMLHttpRequest_new.js +3 -2
  105. package/Libraries/Network/XMLHttpRequest_old.js +3 -2
  106. package/Libraries/Network/convertRequestBody.js +4 -3
  107. package/Libraries/Network/fetch.js +4 -3
  108. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +63 -61
  109. package/Libraries/Pressability/Pressability.js +23 -23
  110. package/Libraries/Pressability/Pressability.win32.js +23 -23
  111. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +119 -16
  112. package/Libraries/ReactNative/AppContainer-dev.js +2 -1
  113. package/Libraries/ReactNative/AppRegistry.js +3 -3
  114. package/Libraries/ReactNative/PaperUIManager.js +3 -2
  115. package/Libraries/ReactNative/PaperUIManager.win32.js +3 -2
  116. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +2 -1
  117. package/Libraries/ReactNative/RootTag.js +1 -1
  118. package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -4
  119. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +6 -4
  120. package/Libraries/Renderer/shims/ReactNativeTypes.js +4 -5
  121. package/Libraries/Settings/Settings.js +2 -2
  122. package/Libraries/Settings/Settings.win32.js +2 -2
  123. package/Libraries/Share/Share.js +10 -3
  124. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
  125. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  126. package/Libraries/StyleSheet/StyleSheet.win32.js +2 -2
  127. package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +1 -1
  128. package/Libraries/StyleSheet/flattenStyle.js +1 -1
  129. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  130. package/Libraries/StyleSheet/processAspectRatio.js +1 -1
  131. package/Libraries/StyleSheet/processColor.js +2 -2
  132. package/Libraries/StyleSheet/processFilter.js +4 -0
  133. package/Libraries/StyleSheet/processFontVariant.js +1 -1
  134. package/Libraries/StyleSheet/processTransform.js +1 -1
  135. package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
  136. package/Libraries/Text/Text.js +15 -15
  137. package/Libraries/Text/Text.win32.js +15 -15
  138. package/Libraries/Text/TextAncestor.js +1 -1
  139. package/Libraries/Text/TextNativeComponent.js +2 -2
  140. package/Libraries/Text/TextNativeComponent.win32.js +2 -2
  141. package/Libraries/Text/TextProps.js +11 -11
  142. package/Libraries/Text/TextProps.win32.js +11 -11
  143. package/Libraries/Types/CodegenTypes.js +3 -3
  144. package/Libraries/Types/CoreEventTypes.js +103 -72
  145. package/Libraries/Types/CoreEventTypes.win32.js +115 -79
  146. package/Libraries/UTFSequence.js +2 -1
  147. package/Libraries/Utilities/BackHandler.android.js +1 -1
  148. package/Libraries/Utilities/BackHandler.ios.js +5 -5
  149. package/Libraries/Utilities/BackHandler.win32.js +1 -1
  150. package/Libraries/Utilities/DevLoadingView.js +1 -1
  151. package/Libraries/Utilities/DevSettings.js +1 -1
  152. package/Libraries/Utilities/DeviceInfo.js +1 -1
  153. package/Libraries/Utilities/DeviceInfo.win32.js +1 -1
  154. package/Libraries/Utilities/FeatureDetection.js +2 -4
  155. package/Libraries/Utilities/FocusManager.win32.js +3 -3
  156. package/Libraries/Utilities/GlobalPerformanceLogger.js +1 -1
  157. package/Libraries/Utilities/HMRClient.js +5 -33
  158. package/Libraries/Utilities/HMRClientProdShim.js +1 -2
  159. package/Libraries/Utilities/Platform.android.js +2 -2
  160. package/Libraries/Utilities/Platform.ios.js +2 -2
  161. package/Libraries/Utilities/Platform.win32.js +2 -2
  162. package/Libraries/Utilities/{Platform.flow.win32.js → PlatformTypes.js} +1 -0
  163. package/Libraries/Utilities/PolyfillFunctions.js +3 -5
  164. package/Libraries/Utilities/RCTLog.js +1 -1
  165. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  166. package/Libraries/Utilities/SceneTracker.js +1 -1
  167. package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +2 -2
  168. package/Libraries/Utilities/binaryToBase64.js +1 -1
  169. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +1 -1
  170. package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
  171. package/Libraries/Utilities/differ/deepDiffer.js +3 -3
  172. package/Libraries/Utilities/differ/insetsDiffer.js +3 -3
  173. package/Libraries/Utilities/differ/matricesDiffer.js +3 -6
  174. package/Libraries/Utilities/differ/pointsDiffer.js +3 -3
  175. package/Libraries/Utilities/differ/sizesDiffer.js +3 -3
  176. package/Libraries/Utilities/dismissKeyboard.js +1 -1
  177. package/Libraries/Utilities/infoLog.js +1 -1
  178. package/Libraries/Utilities/logError.js +1 -1
  179. package/Libraries/Utilities/mapWithSeparator.js +1 -1
  180. package/Libraries/Utilities/warnOnce.js +1 -1
  181. package/Libraries/Vibration/Vibration.js +3 -3
  182. package/Libraries/vendor/emitter/EventEmitter.js +21 -9
  183. package/index.js +113 -199
  184. package/index.win32.js +21 -13
  185. package/jest/setup.js +9 -2
  186. package/overrides.json +35 -34
  187. package/package.json +15 -15
  188. package/src/private/devmenu/DevMenu.js +1 -1
  189. package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -23
  190. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +4 -7
  191. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -4
  192. package/src/private/inspector/BoxInspector.js +1 -1
  193. package/src/private/inspector/ElementBox.js +3 -2
  194. package/src/private/inspector/ElementProperties.js +5 -3
  195. package/src/private/inspector/Inspector.js +2 -2
  196. package/src/private/inspector/InspectorOverlay.js +4 -4
  197. package/src/private/inspector/InspectorPanel.js +1 -1
  198. package/src/private/inspector/NetworkOverlay.js +4 -4
  199. package/src/private/inspector/PerformanceOverlay.js +3 -2
  200. package/src/private/inspector/ReactDevToolsOverlay.js +3 -3
  201. package/src/private/inspector/StyleInspector.js +1 -1
  202. package/src/private/inspector/XHRInterceptor.js +5 -2
  203. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -1
  204. package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +1 -1
  205. package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +5 -4
  206. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +92 -19
  207. package/src/private/webapis/dom/events/CustomEvent.js +5 -7
  208. package/src/private/webapis/dom/events/Event.js +5 -5
  209. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -0
  210. package/src/private/webapis/html/events/MessageEvent.js +12 -19
  211. package/src/private/webapis/websockets/events/CloseEvent.js +9 -11
  212. package/src/private/webapis/xhr/events/ProgressEvent.js +9 -11
  213. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
  214. package/Libraries/Alert/Alert.flow.js +0 -62
  215. package/Libraries/Alert/RCTAlertManager.flow.js +0 -20
  216. package/Libraries/Utilities/Platform.flow.js +0 -91
  217. package/flow/react.js +0 -15
@@ -12,7 +12,7 @@
12
12
 
13
13
  import type {ImageStyleProp, TextStyleProp} from '../StyleSheet';
14
14
 
15
- const StyleSheet = require('../StyleSheet');
15
+ const StyleSheet = require('../StyleSheet').default;
16
16
  const imageStyle = {tintColor: 'rgb(0, 0, 0)'};
17
17
  const textStyle = {color: 'rgb(0, 0, 0)'};
18
18
 
@@ -43,4 +43,4 @@ function flattenStyle<TStyleProp: DangerouslyImpreciseStyleProp>(
43
43
  return result;
44
44
  }
45
45
 
46
- module.exports = flattenStyle;
46
+ export default flattenStyle;
@@ -31,4 +31,4 @@ function normalizeColor(
31
31
  }
32
32
  }
33
33
 
34
- module.exports = normalizeColor;
34
+ export default normalizeColor;
@@ -60,4 +60,4 @@ function processAspectRatio(aspectRatio?: number | string): ?number {
60
60
  return Number(matches[0]);
61
61
  }
62
62
 
63
- module.exports = processAspectRatio;
63
+ export default processAspectRatio;
@@ -12,8 +12,8 @@
12
12
 
13
13
  import type {ColorValue, NativeColorValue} from './StyleSheet';
14
14
 
15
- const Platform = require('../Utilities/Platform');
16
- const normalizeColor = require('./normalizeColor');
15
+ const Platform = require('../Utilities/Platform').default;
16
+ const normalizeColor = require('./normalizeColor').default;
17
17
 
18
18
  export type ProcessedColorValue = number | NativeColorValue;
19
19
 
@@ -317,5 +317,9 @@ function parseLength(length: string): ?number {
317
317
  return null;
318
318
  }
319
319
 
320
+ if (match[3] == null && match[1] !== '0') {
321
+ return null;
322
+ }
323
+
320
324
  return Number(match[1]);
321
325
  }
@@ -27,4 +27,4 @@ function processFontVariant(
27
27
  return match;
28
28
  }
29
29
 
30
- module.exports = processFontVariant;
30
+ export default processFontVariant;
@@ -266,4 +266,4 @@ function _validateTransform(
266
266
  }
267
267
  }
268
268
 
269
- module.exports = processTransform;
269
+ export default processTransform;
@@ -28,4 +28,4 @@ function setNormalizedColorAlpha(input: number, alpha: number): number {
28
28
  return ((input & 0xffffff00) | alpha) >>> 0;
29
29
  }
30
30
 
31
- module.exports = setNormalizedColorAlpha;
31
+ export default setNormalizedColorAlpha;
@@ -10,7 +10,7 @@
10
10
 
11
11
  import type {TextStyleProp} from '../StyleSheet/StyleSheet';
12
12
  import type {____TextStyle_Internal as TextStyleInternal} from '../StyleSheet/StyleSheetTypes';
13
- import type {PressEvent} from '../Types/CoreEventTypes';
13
+ import type {GestureResponderEvent} from '../Types/CoreEventTypes';
14
14
  import type {NativeTextProps} from './TextNativeComponent';
15
15
  import type {PressRetentionOffset, TextProps} from './TextProps';
16
16
 
@@ -331,14 +331,14 @@ const Text: component(
331
331
  Text.displayName = 'Text';
332
332
 
333
333
  type TextPressabilityProps = $ReadOnly<{
334
- onLongPress?: ?(event: PressEvent) => mixed,
335
- onPress?: ?(event: PressEvent) => mixed,
336
- onPressIn?: ?(event: PressEvent) => mixed,
337
- onPressOut?: ?(event: PressEvent) => mixed,
338
- onResponderGrant?: ?(event: PressEvent) => void,
339
- onResponderMove?: ?(event: PressEvent) => void,
340
- onResponderRelease?: ?(event: PressEvent) => void,
341
- onResponderTerminate?: ?(event: PressEvent) => void,
334
+ onLongPress?: ?(event: GestureResponderEvent) => mixed,
335
+ onPress?: ?(event: GestureResponderEvent) => mixed,
336
+ onPressIn?: ?(event: GestureResponderEvent) => mixed,
337
+ onPressOut?: ?(event: GestureResponderEvent) => mixed,
338
+ onResponderGrant?: ?(event: GestureResponderEvent) => void,
339
+ onResponderMove?: ?(event: GestureResponderEvent) => void,
340
+ onResponderRelease?: ?(event: GestureResponderEvent) => void,
341
+ onResponderTerminate?: ?(event: GestureResponderEvent) => void,
342
342
  onResponderTerminationRequest?: ?() => boolean,
343
343
  onStartShouldSetResponder?: ?() => boolean,
344
344
  pressRetentionOffset?: ?PressRetentionOffset,
@@ -375,12 +375,12 @@ function useTextPressability({
375
375
  // in the best case, and cause issues with text selection in the worst case. Forcing
376
376
  // the isHighlighted prop to false on all platforms except iOS.
377
377
  if (Platform.OS === 'ios') {
378
- _onPressIn = (event: PressEvent) => {
378
+ _onPressIn = (event: GestureResponderEvent) => {
379
379
  setHighlighted(suppressHighlighting == null || !suppressHighlighting);
380
380
  onPressIn?.(event);
381
381
  };
382
382
 
383
- _onPressOut = (event: PressEvent) => {
383
+ _onPressOut = (event: GestureResponderEvent) => {
384
384
  setHighlighted(false);
385
385
  onPressOut?.(event);
386
386
  };
@@ -412,25 +412,25 @@ function useTextPressability({
412
412
  eventHandlers == null
413
413
  ? null
414
414
  : {
415
- onResponderGrant(event: PressEvent) {
415
+ onResponderGrant(event: GestureResponderEvent) {
416
416
  eventHandlers.onResponderGrant(event);
417
417
  if (onResponderGrant != null) {
418
418
  onResponderGrant(event);
419
419
  }
420
420
  },
421
- onResponderMove(event: PressEvent) {
421
+ onResponderMove(event: GestureResponderEvent) {
422
422
  eventHandlers.onResponderMove(event);
423
423
  if (onResponderMove != null) {
424
424
  onResponderMove(event);
425
425
  }
426
426
  },
427
- onResponderRelease(event: PressEvent) {
427
+ onResponderRelease(event: GestureResponderEvent) {
428
428
  eventHandlers.onResponderRelease(event);
429
429
  if (onResponderRelease != null) {
430
430
  onResponderRelease(event);
431
431
  }
432
432
  },
433
- onResponderTerminate(event: PressEvent) {
433
+ onResponderTerminate(event: GestureResponderEvent) {
434
434
  eventHandlers.onResponderTerminate(event);
435
435
  if (onResponderTerminate != null) {
436
436
  onResponderTerminate(event);
@@ -10,7 +10,7 @@
10
10
 
11
11
  import type {TextStyleProp} from '../StyleSheet/StyleSheet';
12
12
  import type {____TextStyle_Internal as TextStyleInternal} from '../StyleSheet/StyleSheetTypes';
13
- import type {PressEvent} from '../Types/CoreEventTypes';
13
+ import type {GestureResponderEvent} from '../Types/CoreEventTypes';
14
14
  import type {NativeTextProps} from './TextNativeComponent';
15
15
  import type {PressRetentionOffset, TextProps} from './TextProps';
16
16
 
@@ -371,14 +371,14 @@ const Text: component(
371
371
  Text.displayName = 'Text';
372
372
 
373
373
  type TextPressabilityProps = $ReadOnly<{
374
- onLongPress?: ?(event: PressEvent) => mixed,
375
- onPress?: ?(event: PressEvent) => mixed,
376
- onPressIn?: ?(event: PressEvent) => mixed,
377
- onPressOut?: ?(event: PressEvent) => mixed,
378
- onResponderGrant?: ?(event: PressEvent) => void,
379
- onResponderMove?: ?(event: PressEvent) => void,
380
- onResponderRelease?: ?(event: PressEvent) => void,
381
- onResponderTerminate?: ?(event: PressEvent) => void,
374
+ onLongPress?: ?(event: GestureResponderEvent) => mixed,
375
+ onPress?: ?(event: GestureResponderEvent) => mixed,
376
+ onPressIn?: ?(event: GestureResponderEvent) => mixed,
377
+ onPressOut?: ?(event: GestureResponderEvent) => mixed,
378
+ onResponderGrant?: ?(event: GestureResponderEvent) => void,
379
+ onResponderMove?: ?(event: GestureResponderEvent) => void,
380
+ onResponderRelease?: ?(event: GestureResponderEvent) => void,
381
+ onResponderTerminate?: ?(event: GestureResponderEvent) => void,
382
382
  onResponderTerminationRequest?: ?() => boolean,
383
383
  onStartShouldSetResponder?: ?() => boolean,
384
384
  pressRetentionOffset?: ?PressRetentionOffset,
@@ -415,12 +415,12 @@ function useTextPressability({
415
415
  // in the best case, and cause issues with text selection in the worst case. Forcing
416
416
  // the isHighlighted prop to false on all platforms except iOS.
417
417
  if (Platform.OS === 'ios') {
418
- _onPressIn = (event: PressEvent) => {
418
+ _onPressIn = (event: GestureResponderEvent) => {
419
419
  setHighlighted(suppressHighlighting == null || !suppressHighlighting);
420
420
  onPressIn?.(event);
421
421
  };
422
422
 
423
- _onPressOut = (event: PressEvent) => {
423
+ _onPressOut = (event: GestureResponderEvent) => {
424
424
  setHighlighted(false);
425
425
  onPressOut?.(event);
426
426
  };
@@ -452,25 +452,25 @@ function useTextPressability({
452
452
  eventHandlers == null
453
453
  ? null
454
454
  : {
455
- onResponderGrant(event: PressEvent) {
455
+ onResponderGrant(event: GestureResponderEvent) {
456
456
  eventHandlers.onResponderGrant(event);
457
457
  if (onResponderGrant != null) {
458
458
  onResponderGrant(event);
459
459
  }
460
460
  },
461
- onResponderMove(event: PressEvent) {
461
+ onResponderMove(event: GestureResponderEvent) {
462
462
  eventHandlers.onResponderMove(event);
463
463
  if (onResponderMove != null) {
464
464
  onResponderMove(event);
465
465
  }
466
466
  },
467
- onResponderRelease(event: PressEvent) {
467
+ onResponderRelease(event: GestureResponderEvent) {
468
468
  eventHandlers.onResponderRelease(event);
469
469
  if (onResponderRelease != null) {
470
470
  onResponderRelease(event);
471
471
  }
472
472
  },
473
- onResponderTerminate(event: PressEvent) {
473
+ onResponderTerminate(event: GestureResponderEvent) {
474
474
  eventHandlers.onResponderTerminate(event);
475
475
  if (onResponderTerminate != null) {
476
476
  onResponderTerminate(event);
@@ -15,7 +15,7 @@ const React = require('react');
15
15
  /**
16
16
  * Whether the current element is the descendant of a <Text> element.
17
17
  */
18
- const TextAncestorContext: React$Context<boolean> = React.createContext(false);
18
+ const TextAncestorContext: React.Context<boolean> = React.createContext(false);
19
19
  if (__DEV__) {
20
20
  TextAncestorContext.displayName = 'TextAncestorContext';
21
21
  }
@@ -10,7 +10,7 @@
10
10
 
11
11
  import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type {ProcessedColorValue} from '../StyleSheet/processColor';
13
- import type {PressEvent} from '../Types/CoreEventTypes';
13
+ import type {GestureResponderEvent} from '../Types/CoreEventTypes';
14
14
  import type {TextProps} from './TextProps';
15
15
 
16
16
  import {createViewConfig} from '../NativeComponent/ViewConfig';
@@ -21,7 +21,7 @@ export type NativeTextProps = $ReadOnly<{
21
21
  ...TextProps,
22
22
  isHighlighted?: ?boolean,
23
23
  selectionColor?: ?ProcessedColorValue,
24
- onClick?: ?(event: PressEvent) => mixed,
24
+ onClick?: ?(event: GestureResponderEvent) => mixed,
25
25
  // This is only needed for platforms that optimize text hit testing, e.g.,
26
26
  // react-native-windows. It can be used to only hit test virtual text spans
27
27
  // that have pressable events attached to them.
@@ -10,7 +10,7 @@
10
10
 
11
11
  import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type {ProcessedColorValue} from '../StyleSheet/processColor';
13
- import type {PressEvent} from '../Types/CoreEventTypes';
13
+ import type {GestureResponderEvent} from '../Types/CoreEventTypes';
14
14
  import type {TextProps} from './TextProps';
15
15
 
16
16
  import {createViewConfig} from '../NativeComponent/ViewConfig';
@@ -21,7 +21,7 @@ export type NativeTextProps = $ReadOnly<{
21
21
  ...TextProps,
22
22
  isHighlighted?: ?boolean,
23
23
  selectionColor?: ?ProcessedColorValue,
24
- onClick?: ?(event: PressEvent) => mixed,
24
+ onClick?: ?(event: GestureResponderEvent) => mixed,
25
25
  // This is only needed for platforms that optimize text hit testing, e.g.,
26
26
  // react-native-windows. It can be used to only hit test virtual text spans
27
27
  // that have pressable events attached to them.
@@ -19,9 +19,9 @@ import type {
19
19
  } from '../Components/View/ViewAccessibility';
20
20
  import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet';
21
21
  import type {
22
- LayoutEvent,
22
+ LayoutChangeEvent,
23
23
  PointerEvent,
24
- PressEvent,
24
+ GestureResponderEvent,
25
25
  TextLayoutEvent,
26
26
  } from '../Types/CoreEventTypes';
27
27
  import type {Node} from 'react';
@@ -142,27 +142,27 @@ export type TextProps = $ReadOnly<{
142
142
  *
143
143
  * See https://reactnative.dev/docs/text#onlayout
144
144
  */
145
- onLayout?: ?(event: LayoutEvent) => mixed,
145
+ onLayout?: ?(event: LayoutChangeEvent) => mixed,
146
146
 
147
147
  /**
148
148
  * This function is called on long press.
149
149
  *
150
150
  * See https://reactnative.dev/docs/text#onlongpress
151
151
  */
152
- onLongPress?: ?(event: PressEvent) => mixed,
152
+ onLongPress?: ?(event: GestureResponderEvent) => mixed,
153
153
 
154
154
  /**
155
155
  * This function is called on press.
156
156
  *
157
157
  * See https://reactnative.dev/docs/text#onpress
158
158
  */
159
- onPress?: ?(event: PressEvent) => mixed,
160
- onPressIn?: ?(event: PressEvent) => mixed,
161
- onPressOut?: ?(event: PressEvent) => mixed,
162
- onResponderGrant?: ?(event: PressEvent) => void,
163
- onResponderMove?: ?(event: PressEvent) => void,
164
- onResponderRelease?: ?(event: PressEvent) => void,
165
- onResponderTerminate?: ?(event: PressEvent) => void,
159
+ onPress?: ?(event: GestureResponderEvent) => mixed,
160
+ onPressIn?: ?(event: GestureResponderEvent) => mixed,
161
+ onPressOut?: ?(event: GestureResponderEvent) => mixed,
162
+ onResponderGrant?: ?(event: GestureResponderEvent) => void,
163
+ onResponderMove?: ?(event: GestureResponderEvent) => void,
164
+ onResponderRelease?: ?(event: GestureResponderEvent) => void,
165
+ onResponderTerminate?: ?(event: GestureResponderEvent) => void,
166
166
  onResponderTerminationRequest?: ?() => boolean,
167
167
  onStartShouldSetResponder?: ?() => boolean,
168
168
  onMoveShouldSetResponder?: ?() => boolean,
@@ -19,9 +19,9 @@ import type {
19
19
  } from '../Components/View/ViewAccessibility';
20
20
  import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet';
21
21
  import type {
22
- LayoutEvent,
22
+ LayoutChangeEvent,
23
23
  PointerEvent,
24
- PressEvent,
24
+ GestureResponderEvent,
25
25
  TextLayoutEvent,
26
26
  } from '../Types/CoreEventTypes';
27
27
  import type {Node} from 'react';
@@ -155,27 +155,27 @@ export type TextProps = $ReadOnly<{
155
155
  *
156
156
  * See https://reactnative.dev/docs/text#onlayout
157
157
  */
158
- onLayout?: ?(event: LayoutEvent) => mixed,
158
+ onLayout?: ?(event: LayoutChangeEvent) => mixed,
159
159
 
160
160
  /**
161
161
  * This function is called on long press.
162
162
  *
163
163
  * See https://reactnative.dev/docs/text#onlongpress
164
164
  */
165
- onLongPress?: ?(event: PressEvent) => mixed,
165
+ onLongPress?: ?(event: GestureResponderEvent) => mixed,
166
166
 
167
167
  /**
168
168
  * This function is called on press.
169
169
  *
170
170
  * See https://reactnative.dev/docs/text#onpress
171
171
  */
172
- onPress?: ?(event: PressEvent) => mixed,
173
- onPressIn?: ?(event: PressEvent) => mixed,
174
- onPressOut?: ?(event: PressEvent) => mixed,
175
- onResponderGrant?: ?(event: PressEvent) => void,
176
- onResponderMove?: ?(event: PressEvent) => void,
177
- onResponderRelease?: ?(event: PressEvent) => void,
178
- onResponderTerminate?: ?(event: PressEvent) => void,
172
+ onPress?: ?(event: GestureResponderEvent) => mixed,
173
+ onPressIn?: ?(event: GestureResponderEvent) => mixed,
174
+ onPressOut?: ?(event: GestureResponderEvent) => mixed,
175
+ onResponderGrant?: ?(event: GestureResponderEvent) => void,
176
+ onResponderMove?: ?(event: GestureResponderEvent) => void,
177
+ onResponderRelease?: ?(event: GestureResponderEvent) => void,
178
+ onResponderTerminate?: ?(event: GestureResponderEvent) => void,
179
179
  onResponderTerminationRequest?: ?() => boolean,
180
180
  onStartShouldSetResponder?: ?() => boolean,
181
181
  onMoveShouldSetResponder?: ?() => boolean,
@@ -11,7 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  import type {EventSubscription} from '../vendor/emitter/EventEmitter';
14
- import type {SyntheticEvent} from './CoreEventTypes';
14
+ import type {NativeSyntheticEvent} from './CoreEventTypes';
15
15
 
16
16
  // Event types
17
17
  // We're not using the PaperName, it is only used to codegen view config settings
@@ -19,11 +19,11 @@ import type {SyntheticEvent} from './CoreEventTypes';
19
19
  export type BubblingEventHandler<
20
20
  T,
21
21
  PaperName: string | empty = empty, // eslint-disable-line no-unused-vars
22
- > = (event: SyntheticEvent<T>) => void | Promise<void>;
22
+ > = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
23
23
  export type DirectEventHandler<
24
24
  T,
25
25
  PaperName: string | empty = empty, // eslint-disable-line no-unused-vars
26
- > = (event: SyntheticEvent<T>) => void | Promise<void>;
26
+ > = (event: NativeSyntheticEvent<T>) => void | Promise<void>;
27
27
 
28
28
  // Prop types
29
29
  export type Double = number;
@@ -10,7 +10,7 @@
10
10
 
11
11
  import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
12
12
 
13
- export type SyntheticEvent<+T> = $ReadOnly<{
13
+ export type NativeSyntheticEvent<+T> = $ReadOnly<{
14
14
  bubbles: ?boolean,
15
15
  cancelable: ?boolean,
16
16
  currentTarget: number | HostInstance,
@@ -32,7 +32,7 @@ export type SyntheticEvent<+T> = $ReadOnly<{
32
32
  }>;
33
33
 
34
34
  export type ResponderSyntheticEvent<T> = $ReadOnly<{
35
- ...SyntheticEvent<T>,
35
+ ...NativeSyntheticEvent<T>,
36
36
  touchHistory: $ReadOnly<{
37
37
  indexOfSingleActiveTouch: number,
38
38
  mostRecentTimeStamp: number,
@@ -54,15 +54,15 @@ export type ResponderSyntheticEvent<T> = $ReadOnly<{
54
54
  }>,
55
55
  }>;
56
56
 
57
- export type Layout = $ReadOnly<{
57
+ export type LayoutRectangle = $ReadOnly<{
58
58
  x: number,
59
59
  y: number,
60
60
  width: number,
61
61
  height: number,
62
62
  }>;
63
63
 
64
- export type TextLayout = $ReadOnly<{
65
- ...Layout,
64
+ export type TextLayoutLine = $ReadOnly<{
65
+ ...LayoutRectangle,
66
66
  ascender: number,
67
67
  capHeight: number,
68
68
  descender: number,
@@ -70,17 +70,17 @@ export type TextLayout = $ReadOnly<{
70
70
  xHeight: number,
71
71
  }>;
72
72
 
73
- export type LayoutEvent = SyntheticEvent<
73
+ export type LayoutChangeEvent = NativeSyntheticEvent<
74
74
  $ReadOnly<{
75
- layout: Layout,
75
+ layout: LayoutRectangle,
76
76
  }>,
77
77
  >;
78
78
 
79
- export type TextLayoutEvent = SyntheticEvent<
80
- $ReadOnly<{
81
- lines: Array<TextLayout>,
82
- }>,
83
- >;
79
+ export type TextLayoutEventData = $ReadOnly<{
80
+ lines: Array<TextLayoutLine>,
81
+ }>;
82
+
83
+ export type TextLayoutEvent = NativeSyntheticEvent<TextLayoutEventData>;
84
84
 
85
85
  /**
86
86
  * https://developer.mozilla.org/en-US/docs/Web/API/UIEvent
@@ -218,71 +218,102 @@ export interface NativePointerEvent extends NativeMouseEvent {
218
218
  +isPrimary: boolean;
219
219
  }
220
220
 
221
- export type PointerEvent = SyntheticEvent<NativePointerEvent>;
221
+ export type PointerEvent = NativeSyntheticEvent<NativePointerEvent>;
222
222
 
223
- export type PressEvent = ResponderSyntheticEvent<
224
- $ReadOnly<{
225
- changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
226
- force?: number,
227
- identifier: number,
228
- locationX: number,
229
- locationY: number,
230
- pageX: number,
231
- pageY: number,
232
- target: ?number,
233
- timestamp: number,
234
- touches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
235
- }>,
236
- >;
223
+ export type NativeTouchEvent = $ReadOnly<{
224
+ /**
225
+ * Array of all touch events that have changed since the last event
226
+ */
227
+ changedTouches: $ReadOnlyArray<NativeTouchEvent>,
228
+ /**
229
+ * 3D Touch reported force
230
+ * @platform ios
231
+ */
232
+ force?: number,
233
+ /**
234
+ * The ID of the touch
235
+ */
236
+ identifier: number,
237
+ /**
238
+ * The X position of the touch, relative to the element
239
+ */
240
+ locationX: number,
241
+ /**
242
+ * The Y position of the touch, relative to the element
243
+ */
244
+ locationY: number,
245
+ /**
246
+ * The X position of the touch, relative to the screen
247
+ */
248
+ pageX: number,
249
+ /**
250
+ * The Y position of the touch, relative to the screen
251
+ */
252
+ pageY: number,
253
+ /**
254
+ * The node id of the element receiving the touch event
255
+ */
256
+ target: ?number,
257
+ /**
258
+ * A time identifier for the touch, useful for velocity calculation
259
+ */
260
+ timestamp: number,
261
+ /**
262
+ * Array of all current touches on the screen
263
+ */
264
+ touches: $ReadOnlyArray<NativeTouchEvent>,
265
+ }>;
237
266
 
238
- export type ScrollEvent = SyntheticEvent<
239
- $ReadOnly<{
240
- contentInset: $ReadOnly<{
241
- bottom: number,
242
- left: number,
243
- right: number,
244
- top: number,
245
- }>,
246
- contentOffset: $ReadOnly<{
247
- y: number,
248
- x: number,
249
- }>,
250
- contentSize: $ReadOnly<{
251
- height: number,
252
- width: number,
253
- }>,
254
- layoutMeasurement: $ReadOnly<{
255
- height: number,
256
- width: number,
257
- }>,
258
- targetContentOffset?: $ReadOnly<{
259
- y: number,
260
- x: number,
261
- }>,
262
- velocity?: $ReadOnly<{
263
- y: number,
264
- x: number,
265
- }>,
266
- zoomScale?: number,
267
- responderIgnoreScroll?: boolean,
268
- }>,
269
- >;
267
+ export type GestureResponderEvent = ResponderSyntheticEvent<NativeTouchEvent>;
270
268
 
271
- export type BlurEvent = SyntheticEvent<
272
- $ReadOnly<{
273
- target: number,
274
- ...
275
- }>,
276
- >;
269
+ export type NativeScrollRectangle = $ReadOnly<{
270
+ bottom: number,
271
+ left: number,
272
+ right: number,
273
+ top: number,
274
+ }>;
277
275
 
278
- export type FocusEvent = SyntheticEvent<
279
- $ReadOnly<{
280
- target: number,
281
- ...
282
- }>,
283
- >;
276
+ export type NativeScrollPoint = $ReadOnly<{
277
+ y: number,
278
+ x: number,
279
+ }>;
280
+
281
+ export type NativeScrollVelocity = $ReadOnly<{
282
+ y: number,
283
+ x: number,
284
+ }>;
285
+
286
+ export type NativeScrollSize = $ReadOnly<{
287
+ height: number,
288
+ width: number,
289
+ }>;
290
+
291
+ export type NativeScrollEvent = $ReadOnly<{
292
+ contentInset: NativeScrollRectangle,
293
+ contentOffset: NativeScrollPoint,
294
+ contentSize: NativeScrollSize,
295
+ layoutMeasurement: NativeScrollSize,
296
+ velocity?: NativeScrollVelocity,
297
+ zoomScale?: number,
298
+ responderIgnoreScroll?: boolean,
299
+ /**
300
+ * @platform ios
301
+ */
302
+ targetContentOffset?: NativeScrollPoint,
303
+ }>;
304
+
305
+ export type ScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
306
+
307
+ export type TargetedEvent = $ReadOnly<{
308
+ target: number,
309
+ ...
310
+ }>;
311
+
312
+ export type BlurEvent = NativeSyntheticEvent<TargetedEvent>;
313
+
314
+ export type FocusEvent = NativeSyntheticEvent<TargetedEvent>;
284
315
 
285
- export type MouseEvent = SyntheticEvent<
316
+ export type MouseEvent = NativeSyntheticEvent<
286
317
  $ReadOnly<{
287
318
  clientX: number,
288
319
  clientY: number,