@office-iss/react-native-win32 0.83.0-preview.1 → 0.84.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 (193) hide show
  1. package/.flowconfig +2 -2
  2. package/CHANGELOG.json +57 -6
  3. package/CHANGELOG.md +30 -5
  4. package/IntegrationTests/AccessibilityManagerTest.js +10 -7
  5. package/IntegrationTests/ImageCachePolicyTest.js +8 -8
  6. package/IntegrationTests/IntegrationTestsApp.js +3 -3
  7. package/IntegrationTests/LayoutEventsTest.js +1 -1
  8. package/IntegrationTests/TimersTest.js +1 -1
  9. package/IntegrationTests/WebSocketTest.js +1 -1
  10. package/Libraries/Animated/AnimatedEvent.js +2 -2
  11. package/Libraries/Animated/animations/Animation.js +1 -3
  12. package/Libraries/Animated/createAnimatedComponent.js +8 -5
  13. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  14. package/Libraries/Animated/nodes/AnimatedInterpolation.js +40 -4
  15. package/Libraries/Animated/nodes/AnimatedNode.js +3 -3
  16. package/Libraries/Animated/nodes/AnimatedObject.js +16 -11
  17. package/Libraries/Animated/nodes/AnimatedProps.js +43 -12
  18. package/Libraries/Animated/nodes/AnimatedStyle.js +12 -12
  19. package/Libraries/Animated/nodes/AnimatedValue.js +6 -3
  20. package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
  21. package/Libraries/BatchedBridge/MessageQueue.js +24 -22
  22. package/Libraries/Blob/URL.js +34 -3
  23. package/Libraries/Blob/URLSearchParams.js +1 -0
  24. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +6 -0
  25. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +6 -1
  26. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +8 -1
  27. package/Libraries/Components/Button.js +2 -5
  28. package/Libraries/Components/Button.win32.js +2 -5
  29. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  30. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +4 -4
  31. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  32. package/Libraries/Components/Pressable/Pressable.js +8 -8
  33. package/Libraries/Components/Pressable/Pressable.win32.js +14 -13
  34. package/Libraries/Components/TextInput/TextInput.flow.js +13 -13
  35. package/Libraries/Components/TextInput/TextInput.flow.win32.js +13 -13
  36. package/Libraries/Components/TextInput/TextInput.js +33 -34
  37. package/Libraries/Components/TextInput/TextInput.win32.js +39 -39
  38. package/Libraries/Components/Touchable/PooledClass.js +2 -2
  39. package/Libraries/Components/Touchable/TouchableBounce.js +3 -3
  40. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  41. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +1 -1
  42. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +9 -9
  43. package/Libraries/Components/View/View.win32.js +5 -5
  44. package/Libraries/Components/View/ViewPropTypes.js +16 -6
  45. package/Libraries/Components/View/ViewPropTypes.win32.js +20 -10
  46. package/Libraries/Core/Devtools/loadBundleFromServer.js +6 -3
  47. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +6 -3
  48. package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
  49. package/Libraries/Core/ExceptionsManager.js +3 -3
  50. package/Libraries/Core/RawEventEmitter.js +1 -1
  51. package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
  52. package/Libraries/Core/ReactNativeVersion.js +3 -3
  53. package/Libraries/Core/setUpDeveloperTools.js +1 -1
  54. package/Libraries/Core/setUpErrorHandling.js +1 -1
  55. package/Libraries/EventEmitter/NativeEventEmitter.js +2 -2
  56. package/Libraries/Image/Image.android.js +2 -2
  57. package/Libraries/Image/Image.ios.js +2 -2
  58. package/Libraries/Image/Image.win32.js +1 -1
  59. package/Libraries/Image/ImageProps.js +1 -1
  60. package/Libraries/Image/ImageTypes.flow.js +2 -2
  61. package/Libraries/Interaction/InteractionManager.js +3 -3
  62. package/Libraries/Interaction/PanResponder.js +1 -1
  63. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  64. package/Libraries/Linking/Linking.js +1 -1
  65. package/Libraries/Lists/FlatList.js +2 -2
  66. package/Libraries/LogBox/Data/LogBoxData.js +31 -4
  67. package/Libraries/LogBox/Data/LogBoxLog.js +2 -2
  68. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  69. package/Libraries/LogBox/Data/parseLogBoxLog.js +5 -5
  70. package/Libraries/LogBox/LogBox.js +7 -7
  71. package/Libraries/NativeComponent/BaseViewConfig.android.js +12 -0
  72. package/Libraries/NativeComponent/StaticViewConfigValidator.js +4 -4
  73. package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
  74. package/Libraries/Network/RCTNetworking.android.js +3 -3
  75. package/Libraries/Network/RCTNetworking.ios.js +2 -2
  76. package/Libraries/Network/RCTNetworking.js.flow +2 -2
  77. package/Libraries/Network/RCTNetworking.win32.js +2 -2
  78. package/Libraries/Pressability/Pressability.js +9 -9
  79. package/Libraries/Pressability/Pressability.win32.js +17 -16
  80. package/Libraries/ReactNative/AppRegistry.flow.js +1 -1
  81. package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
  82. package/Libraries/ReactNative/FabricUIManager.js +1 -1
  83. package/Libraries/ReactNative/PaperUIManager.js +1 -1
  84. package/Libraries/ReactNative/PaperUIManager.win32.js +1 -1
  85. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
  86. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +2 -2
  87. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +1 -1
  88. package/Libraries/ReactNative/RendererImplementation.js +1 -1
  89. package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
  90. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -2
  91. package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
  92. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
  93. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
  94. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +11 -4
  95. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +11 -4
  96. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +11 -4
  97. package/Libraries/Renderer/shims/ReactFabric.js +3 -1
  98. package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
  99. package/Libraries/Renderer/shims/ReactNative.js +2 -2
  100. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
  101. package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +3 -1
  102. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
  103. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
  104. package/Libraries/Settings/Settings.ios.js +1 -1
  105. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
  106. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
  107. package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +4 -2
  108. package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
  109. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +99 -4
  110. package/Libraries/StyleSheet/StyleSheetTypes.js +6 -8
  111. package/Libraries/StyleSheet/processFilter.js +1 -1
  112. package/Libraries/Text/Text.js +46 -6
  113. package/Libraries/Text/Text.win32.js +46 -6
  114. package/Libraries/Text/TextNativeComponent.js +1 -1
  115. package/Libraries/Text/TextNativeComponent.win32.js +1 -1
  116. package/Libraries/Text/TextProps.js +7 -7
  117. package/Libraries/Text/TextProps.win32.js +7 -7
  118. package/Libraries/Types/CodegenTypes.js +1 -1
  119. package/Libraries/Types/CoreEventTypes.js +31 -0
  120. package/Libraries/Types/CoreEventTypes.win32.js +30 -13
  121. package/Libraries/Types/ReactDevToolsTypes.js +2 -2
  122. package/Libraries/Utilities/Appearance.js +2 -2
  123. package/Libraries/Utilities/DevLoadingView.js +8 -1
  124. package/Libraries/Utilities/DevSettings.js +3 -3
  125. package/Libraries/Utilities/HMRClient.js +4 -3
  126. package/Libraries/Utilities/RCTLog.js +3 -3
  127. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  128. package/Libraries/Utilities/SceneTracker.js +1 -1
  129. package/Libraries/Utilities/codegenNativeCommands.js +1 -1
  130. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
  131. package/Libraries/Utilities/logError.js +1 -1
  132. package/Libraries/Utilities/stringifySafe.js +7 -7
  133. package/Libraries/Utilities/useRefEffect.js +1 -1
  134. package/Libraries/WebSocket/WebSocketInterceptor.js +3 -3
  135. package/Libraries/promiseRejectionTrackingOptions.js +8 -8
  136. package/Libraries/vendor/core/ErrorUtils.js +10 -10
  137. package/Libraries/vendor/emitter/EventEmitter.js +6 -6
  138. package/flow/HermesInternalType.js +6 -6
  139. package/flow/bom.js.flow +35 -28
  140. package/flow/cssom.js.flow +3 -3
  141. package/flow/dom.js.flow +34 -33
  142. package/index.js +3 -0
  143. package/index.win32.js +3 -0
  144. package/index.win32.js.flow +8 -0
  145. package/jest/mock.js +2 -2
  146. package/jest/mockComponent.js +1 -1
  147. package/jest/setup.js +1 -1
  148. package/overrides.json +23 -23
  149. package/package.json +19 -18
  150. package/src/private/animated/NativeAnimatedHelper.js +130 -125
  151. package/src/private/animated/NativeAnimatedHelper.win32.js +130 -125
  152. package/src/private/animated/NativeAnimatedValidation.js +7 -4
  153. package/src/private/animated/createAnimatedPropsHook.js +13 -5
  154. package/src/private/animated/createAnimatedPropsMemoHook.js +10 -10
  155. package/src/private/components/virtualview/VirtualView.js +16 -9
  156. package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
  157. package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
  158. package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
  159. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +6 -25
  160. package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +1 -27
  161. package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +3 -2
  162. package/src/private/featureflags/ReactNativeFeatureFlags.js +63 -42
  163. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
  164. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +12 -9
  165. package/src/private/renderer/errorhandling/ErrorHandlers.js +7 -4
  166. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
  167. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +4 -0
  168. package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -0
  169. package/src/private/webapis/dom/events/CustomEvent.js +3 -3
  170. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
  171. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
  172. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +29 -29
  173. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +1 -1
  174. package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
  175. package/src/private/webapis/geometry/DOMRectReadOnly.js +1 -1
  176. package/src/private/webapis/html/events/MessageEvent.js +3 -3
  177. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +3 -3
  178. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +53 -5
  179. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +2 -2
  180. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +4 -4
  181. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
  182. package/src/private/webapis/mutationobserver/MutationObserver.js +1 -1
  183. package/src/private/webapis/mutationobserver/MutationRecord.js +1 -1
  184. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -4
  185. package/src/private/webapis/performance/Performance.js +1 -1
  186. package/src/private/webapis/performance/UserTiming.js +1 -1
  187. package/src/private/webapis/performance/specs/NativePerformance.js +3 -3
  188. package/src/private/webapis/structuredClone/structuredClone.js +3 -3
  189. package/src/types/globals.d.ts +30 -1
  190. package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +6 -0
  191. package/src-win/index.win32.js.flow +8 -0
  192. package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +0 -628
  193. package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +0 -66
@@ -73,7 +73,7 @@ let RCTMultilineTextInputView;
73
73
  let RCTMultilineTextInputNativeCommands;
74
74
  let WindowsTextInput; // [Windows]
75
75
  let WindowsTextInputCommands; // [Windows]
76
- import type {KeyEvent} from '../../Types/CoreEventTypes'; // [Windows]
76
+ import type {KeyUpEvent, KeyDownEvent} from '../../Types/CoreEventTypes'; // [Windows]
77
77
 
78
78
  // [Windows
79
79
  if (Platform.OS === 'android') {
@@ -162,7 +162,7 @@ type TextInputStateType = $ReadOnly<{
162
162
  blurTextInput: (textField: ?HostInstance) => void,
163
163
  }>;
164
164
 
165
- type ViewCommands = $NonMaybeType<
165
+ type ViewCommands = NonNullable<
166
166
  | typeof AndroidTextInputCommands
167
167
  | typeof RCTMultilineTextInputNativeCommands
168
168
  | typeof RCTSinglelineTextInputNativeCommands,
@@ -201,8 +201,8 @@ function useTextInputStateSynchronization({
201
201
  const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
202
202
  const [lastNativeSelectionState, setLastNativeSelection] =
203
203
  useState<LastNativeSelection>({
204
- selection: {start: -1, end: -1},
205
- mostRecentEventCount: mostRecentEventCount,
204
+ mostRecentEventCount,
205
+ selection: {end: -1, start: -1},
206
206
  });
207
207
 
208
208
  const lastNativeSelection = lastNativeSelectionState.selection;
@@ -225,7 +225,7 @@ function useTextInputStateSynchronization({
225
225
  lastNativeSelection.end !== selection.end)
226
226
  ) {
227
227
  nativeUpdate.selection = selection;
228
- setLastNativeSelection({selection, mostRecentEventCount});
228
+ setLastNativeSelection({mostRecentEventCount, selection});
229
229
  }
230
230
 
231
231
  if (Object.keys(nativeUpdate).length === 0) {
@@ -253,7 +253,7 @@ function useTextInputStateSynchronization({
253
253
  viewCommands,
254
254
  ]);
255
255
 
256
- return {setLastNativeText, setLastNativeSelection};
256
+ return {setLastNativeSelection, setLastNativeText};
257
257
  }
258
258
 
259
259
  /**
@@ -392,8 +392,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
392
392
  propsSelection == null
393
393
  ? null
394
394
  : {
395
- start: propsSelection.start,
396
395
  end: propsSelection.end ?? propsSelection.start,
396
+ start: propsSelection.start,
397
397
  };
398
398
 
399
399
  const text =
@@ -413,9 +413,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
413
413
  const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
414
414
  const {setLastNativeText, setLastNativeSelection} =
415
415
  useTextInputStateSynchronization({
416
- props,
417
416
  inputRef,
418
417
  mostRecentEventCount,
418
+ props,
419
419
  selection,
420
420
  text,
421
421
  // $FlowFixMe[incompatible-call]
@@ -486,6 +486,10 @@ function InternalTextInput(props: TextInputProps): React.Node {
486
486
  );
487
487
  }
488
488
  },
489
+ getNativeRef(): ?TextInputInstance {
490
+ return inputRef.current;
491
+ },
492
+ // TODO: Fix this returning true on null === null, when no input is focused
489
493
  isFocused(): boolean {
490
494
  const currentlyFocusedInput =
491
495
  TextInputState.currentlyFocusedInput();
@@ -494,9 +498,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
494
498
  currentlyFocusedInput === inputRef.current
495
499
  );
496
500
  },
497
- getNativeRef(): ?TextInputInstance {
498
- return inputRef.current;
499
- },
500
501
  setSelection(start: number, end: number): void {
501
502
  if (inputRef.current != null) {
502
503
  viewCommands.setTextAndSelection(
@@ -546,8 +547,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
546
547
  }
547
548
 
548
549
  setLastNativeSelection({
549
- selection: event.nativeEvent.selection,
550
550
  mostRecentEventCount,
551
+ selection: event.nativeEvent.selection,
551
552
  });
552
553
  };
553
554
 
@@ -617,6 +618,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
617
618
 
618
619
  const config = useMemo(
619
620
  () => ({
621
+ cancelable: Platform.OS === 'ios' ? !rejectResponderTermination : null,
620
622
  hitSlop,
621
623
  onPress: (event: GestureResponderEvent) => {
622
624
  onPress?.(event);
@@ -626,9 +628,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
626
628
  }
627
629
  }
628
630
  },
629
- onPressIn: onPressIn,
630
- onPressOut: onPressOut,
631
- cancelable: Platform.OS === 'ios' ? !rejectResponderTermination : null,
631
+ onPressIn,
632
+ onPressOut,
632
633
  }),
633
634
  [
634
635
  editable,
@@ -651,7 +652,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
651
652
  // so omitting onBlur and onFocus pressability handlers here.
652
653
  const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
653
654
  const eventPhase = Object.freeze({Capturing: 1, Bubbling: 3});
654
- const _keyDown = (event: KeyEvent) => {
655
+ const _keyDown = (event: KeyDownEvent) => {
655
656
  const keyDownEvents = props.keyDownEvents;
656
657
  if (keyDownEvents != null && event.isPropagationStopped() !== true) {
657
658
  for (const el of keyDownEvents) {
@@ -670,7 +671,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
670
671
  props.onKeyDown && props.onKeyDown(event);
671
672
  };
672
673
 
673
- const _keyUp = (event: KeyEvent) => {
674
+ const _keyUp = (event: KeyUpEvent) => {
674
675
  const keyUpEvents = props.keyUpEvents;
675
676
  if (keyUpEvents != null && event.isPropagationStopped() !== true) {
676
677
  for (const el of keyUpEvents) {
@@ -689,7 +690,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
689
690
  props.onKeyUp && props.onKeyUp(event);
690
691
  };
691
692
 
692
- const _keyDownCapture = (event: KeyEvent) => {
693
+ const _keyDownCapture = (event: KeyDownEvent) => {
693
694
  const keyDownEvents = props.keyDownEvents;
694
695
  if (keyDownEvents != null && event.isPropagationStopped() !== true) {
695
696
  for (const el of keyDownEvents) {
@@ -708,7 +709,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
708
709
  props.onKeyDownCapture && props.onKeyDownCapture(event);
709
710
  };
710
711
 
711
- const _keyUpCapture = (event: KeyEvent) => {
712
+ const _keyUpCapture = (event: KeyUpEvent) => {
712
713
  const keyUpEvents = props.keyUpEvents;
713
714
  if (keyUpEvents != null && event.isPropagationStopped() !== true) {
714
715
  for (const el of keyUpEvents) {
@@ -848,12 +849,12 @@ function InternalTextInput(props: TextInputProps): React.Node {
848
849
  }
849
850
  // For consistency with iOS set cursor/selectionHandle color as selectionColor
850
851
  const colorProps = {
852
+ cursorColor: cursorColor === undefined ? selectionColor : cursorColor,
851
853
  selectionColor,
852
854
  selectionHandleColor:
853
855
  selectionHandleColor === undefined
854
856
  ? selectionColor
855
857
  : selectionHandleColor,
856
- cursorColor: cursorColor === undefined ? selectionColor : cursorColor,
857
858
  };
858
859
  textInput = (
859
860
  /* $FlowFixMe[prop-missing] the types for AndroidTextInput don't match up
@@ -935,8 +936,8 @@ function InternalTextInput(props: TextInputProps): React.Node {
935
936
  }
936
937
 
937
938
  const enterKeyHintToReturnTypeMap = {
938
- enter: 'default',
939
939
  done: 'done',
940
+ enter: 'default',
940
941
  go: 'go',
941
942
  next: 'next',
942
943
  previous: 'previous',
@@ -945,19 +946,20 @@ const enterKeyHintToReturnTypeMap = {
945
946
  } as const;
946
947
 
947
948
  const inputModeToKeyboardTypeMap = {
948
- none: 'default',
949
- text: 'default',
950
949
  decimal: 'decimal-pad',
950
+ email: 'email-address',
951
+ none: 'default',
951
952
  numeric: 'number-pad',
952
- tel: 'phone-pad',
953
953
  search:
954
954
  Platform.OS === 'ios' ? ('web-search' as const) : ('default' as const),
955
- email: 'email-address',
955
+ tel: 'phone-pad',
956
+ text: 'default',
956
957
  url: 'url',
957
958
  } as const;
958
959
 
959
960
  // Map HTML autocomplete values to Android autoComplete values
960
961
  const autoCompleteWebToAutoCompleteAndroidMap = {
962
+ 'additional-name': 'name-middle',
961
963
  'address-line1': 'postal-address-region',
962
964
  'address-line2': 'postal-address-locality',
963
965
  bday: 'birthdate-full',
@@ -972,12 +974,11 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
972
974
  country: 'postal-address-country',
973
975
  'current-password': 'password',
974
976
  email: 'email',
977
+ 'family-name': 'name-family',
978
+ 'given-name': 'name-given',
975
979
  'honorific-prefix': 'name-prefix',
976
980
  'honorific-suffix': 'name-suffix',
977
981
  name: 'name',
978
- 'additional-name': 'name-middle',
979
- 'family-name': 'name-family',
980
- 'given-name': 'name-given',
981
982
  'new-password': 'password-new',
982
983
  off: 'off',
983
984
  'one-time-code': 'sms-otp',
@@ -992,33 +993,33 @@ const autoCompleteWebToAutoCompleteAndroidMap = {
992
993
 
993
994
  // Map HTML autocomplete values to iOS textContentType values
994
995
  const autoCompleteWebToTextContentTypeMap = {
996
+ 'additional-name': 'middleName',
995
997
  'address-line1': 'streetAddressLine1',
996
998
  'address-line2': 'streetAddressLine2',
997
999
  bday: 'birthdate',
998
1000
  'bday-day': 'birthdateDay',
999
1001
  'bday-month': 'birthdateMonth',
1000
1002
  'bday-year': 'birthdateYear',
1003
+ 'cc-additional-name': 'creditCardMiddleName',
1001
1004
  'cc-csc': 'creditCardSecurityCode',
1005
+ 'cc-exp': 'creditCardExpiration',
1002
1006
  'cc-exp-month': 'creditCardExpirationMonth',
1003
1007
  'cc-exp-year': 'creditCardExpirationYear',
1004
- 'cc-exp': 'creditCardExpiration',
1005
- 'cc-given-name': 'creditCardGivenName',
1006
- 'cc-additional-name': 'creditCardMiddleName',
1007
1008
  'cc-family-name': 'creditCardFamilyName',
1009
+ 'cc-given-name': 'creditCardGivenName',
1008
1010
  'cc-name': 'creditCardName',
1009
1011
  'cc-number': 'creditCardNumber',
1010
1012
  'cc-type': 'creditCardType',
1011
- 'current-password': 'password',
1012
1013
  country: 'countryName',
1014
+ 'current-password': 'password',
1013
1015
  email: 'emailAddress',
1014
- name: 'name',
1015
- 'additional-name': 'middleName',
1016
1016
  'family-name': 'familyName',
1017
1017
  'given-name': 'givenName',
1018
- nickname: 'nickname',
1019
1018
  'honorific-prefix': 'namePrefix',
1020
1019
  'honorific-suffix': 'nameSuffix',
1020
+ name: 'name',
1021
1021
  'new-password': 'newPassword',
1022
+ nickname: 'nickname',
1022
1023
  off: 'none',
1023
1024
  'one-time-code': 'oneTimeCode',
1024
1025
  organization: 'organizationName',
@@ -1095,11 +1096,10 @@ TextInput.displayName = 'TextInput';
1095
1096
 
1096
1097
  // $FlowFixMe[prop-missing]
1097
1098
  TextInput.State = {
1098
- currentlyFocusedInput: TextInputState.currentlyFocusedInput,
1099
-
1099
+ blurTextInput: TextInputState.blurTextInput,
1100
1100
  currentlyFocusedField: TextInputState.currentlyFocusedField,
1101
+ currentlyFocusedInput: TextInputState.currentlyFocusedInput,
1101
1102
  focusTextInput: TextInputState.focusTextInput,
1102
- blurTextInput: TextInputState.blurTextInput,
1103
1103
  };
1104
1104
 
1105
1105
  export type TextInputComponentStatics = $ReadOnly<{
@@ -1117,9 +1117,9 @@ const styles = StyleSheet.create({
1117
1117
 
1118
1118
  const verticalAlignToTextAlignVerticalMap = {
1119
1119
  auto: 'auto',
1120
- top: 'top',
1121
1120
  bottom: 'bottom',
1122
1121
  middle: 'center',
1122
+ top: 'top',
1123
1123
  } as const;
1124
1124
 
1125
1125
  // $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe.
@@ -105,9 +105,9 @@ const addPoolingTo = function <T>(
105
105
  pooler: Pooler,
106
106
  ): Class<T> & {
107
107
  getPooled(
108
- ...args: $ReadOnlyArray<mixed>
108
+ ...args: $ReadOnlyArray<unknown>
109
109
  ): /* arguments of the constructor */ T,
110
- release(instance: mixed): void,
110
+ release(instance: unknown): void,
111
111
  ...
112
112
  } {
113
113
  // Casting as any so that flow ignores the actual implementation and trusts
@@ -211,7 +211,7 @@ class TouchableBounce extends React.Component<
211
211
  this.state.pressability.configure(this._createPressabilityConfig());
212
212
  }
213
213
 
214
- componentDidMount(): mixed {
214
+ componentDidMount(): unknown {
215
215
  this.state.pressability.configure(this._createPressabilityConfig());
216
216
  }
217
217
 
@@ -225,11 +225,11 @@ export default (function TouchableBounceWrapper({
225
225
  ref: hostRef,
226
226
  ...props
227
227
  }: {
228
- ref: React.RefSetter<mixed>,
228
+ ref: React.RefSetter<unknown>,
229
229
  ...$ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>,
230
230
  }) {
231
231
  return <TouchableBounce {...props} hostRef={hostRef} />;
232
232
  } as component(
233
- ref?: React.RefSetter<mixed>,
233
+ ref?: React.RefSetter<unknown>,
234
234
  ...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
235
235
  ));
@@ -390,7 +390,7 @@ class TouchableNativeFeedback extends React.Component<
390
390
  this.state.pressability.configure(this._createPressabilityConfig());
391
391
  }
392
392
 
393
- componentDidMount(): mixed {
393
+ componentDidMount(): unknown {
394
394
  this.state.pressability.configure(this._createPressabilityConfig());
395
395
  }
396
396
 
@@ -293,7 +293,7 @@ class TouchableNativeFeedback extends React.Component<
293
293
  this.state.pressability.configure(this._createPressabilityConfig());
294
294
  }
295
295
 
296
- componentDidMount(): mixed {
296
+ componentDidMount(): unknown {
297
297
  this.state.pressability.configure(this._createPressabilityConfig());
298
298
  }
299
299
 
@@ -79,32 +79,32 @@ export type TouchableWithoutFeedbackProps = $ReadOnly<
79
79
  | 'no-hide-descendants'
80
80
  ),
81
81
  nativeID?: ?string,
82
- onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
82
+ onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
83
83
  /**
84
84
  * When `accessible` is true (which is the default) this may be called when
85
85
  * the OS-specific concept of "blur" occurs, meaning the element lost focus.
86
86
  * Some platforms may not have the concept of blur.
87
87
  */
88
- onBlur?: ?(event: BlurEvent) => mixed,
88
+ onBlur?: ?(event: BlurEvent) => unknown,
89
89
  /**
90
90
  * When `accessible` is true (which is the default) this may be called when
91
91
  * the OS-specific concept of "focus" occurs. Some platforms may not have
92
92
  * the concept of focus.
93
93
  */
94
- onFocus?: ?(event: FocusEvent) => mixed,
94
+ onFocus?: ?(event: FocusEvent) => unknown,
95
95
  /**
96
96
  * Invoked on mount and layout changes with
97
97
  * {nativeEvent: {layout: {x, y, width, height}}}
98
98
  */
99
- onLayout?: ?(event: LayoutChangeEvent) => mixed,
100
- onLongPress?: ?(event: GestureResponderEvent) => mixed,
99
+ onLayout?: ?(event: LayoutChangeEvent) => unknown,
100
+ onLongPress?: ?(event: GestureResponderEvent) => unknown,
101
101
  /**
102
102
  * Called when the touch is released,
103
103
  * but not if cancelled (e.g. by a scroll that steals the responder lock).
104
104
  */
105
- onPress?: ?(event: GestureResponderEvent) => mixed,
106
- onPressIn?: ?(event: GestureResponderEvent) => mixed,
107
- onPressOut?: ?(event: GestureResponderEvent) => mixed,
105
+ onPress?: ?(event: GestureResponderEvent) => unknown,
106
+ onPressIn?: ?(event: GestureResponderEvent) => unknown,
107
+ onPressOut?: ?(event: GestureResponderEvent) => unknown,
108
108
  /**
109
109
  * When the scroll view is disabled, this defines how far your
110
110
  * touch may move off of the button, before deactivating the button.
@@ -250,7 +250,7 @@ export default function TouchableWithoutFeedback(
250
250
  // adopting `Pressability`, so preserve that behavior.
251
251
  const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} = eventHandlers;
252
252
 
253
- const elementProps: {[string]: mixed, ...} = {
253
+ const elementProps: {[string]: unknown, ...} = {
254
254
  ...eventHandlersWithoutBlurAndFocus,
255
255
  accessible: props.accessible !== false,
256
256
  accessibilityState:
@@ -15,7 +15,7 @@ import ViewNativeComponent from './ViewNativeComponent';
15
15
  import * as React from 'react';
16
16
  import invariant from 'invariant'; // [Windows]
17
17
  // [Windows
18
- import type {KeyEvent} from '../../Types/CoreEventTypes';
18
+ import type {KeyUpEvent, KeyDownEvent} from '../../Types/CoreEventTypes';
19
19
  // Windows]
20
20
 
21
21
  /**
@@ -111,7 +111,7 @@ const View: component(
111
111
  }
112
112
  : undefined;
113
113
 
114
- const _keyDown = (event: KeyEvent) => {
114
+ const _keyDown = (event: KeyDownEvent) => {
115
115
  const keyDownEvents = otherProps.keyDownEvents;
116
116
  if (keyDownEvents != null && event.isPropagationStopped() !== true) {
117
117
  for (const el of keyDownEvents) {
@@ -130,7 +130,7 @@ const View: component(
130
130
  otherProps.onKeyDown && otherProps.onKeyDown(event);
131
131
  };
132
132
 
133
- const _keyUp = (event: KeyEvent) => {
133
+ const _keyUp = (event: KeyUpEvent) => {
134
134
  const keyUpEvents = otherProps.keyUpEvents;
135
135
  if (keyUpEvents != null && event.isPropagationStopped() !== true) {
136
136
  for (const el of keyUpEvents) {
@@ -149,7 +149,7 @@ const View: component(
149
149
  otherProps.onKeyUp && otherProps.onKeyUp(event);
150
150
  };
151
151
 
152
- const _keyDownCapture = (event: KeyEvent) => {
152
+ const _keyDownCapture = (event: KeyDownEvent) => {
153
153
  const keyDownEvents = otherProps.keyDownEvents;
154
154
  if (keyDownEvents != null && event.isPropagationStopped() !== true) {
155
155
  for (const el of keyDownEvents) {
@@ -168,7 +168,7 @@ const View: component(
168
168
  otherProps.onKeyDownCapture && otherProps.onKeyDownCapture(event);
169
169
  };
170
170
 
171
- const _keyUpCapture = (event: KeyEvent) => {
171
+ const _keyUpCapture = (event: KeyUpEvent) => {
172
172
  const keyUpEvents = otherProps.keyUpEvents;
173
173
  if (keyUpEvents != null && event.isPropagationStopped() !== true) {
174
174
  for (const el of keyUpEvents) {
@@ -16,6 +16,8 @@ import type {
16
16
  BlurEvent,
17
17
  FocusEvent,
18
18
  GestureResponderEvent,
19
+ KeyDownEvent,
20
+ KeyUpEvent,
19
21
  LayoutChangeEvent,
20
22
  LayoutRectangle,
21
23
  MouseEvent,
@@ -37,7 +39,7 @@ type DirectEventProps = $ReadOnly<{
37
39
  * when the user performs an accessibility custom action.
38
40
  *
39
41
  */
40
- onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
42
+ onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
41
43
 
42
44
  /**
43
45
  * When `accessible` is true, the system will try to invoke this function
@@ -45,7 +47,7 @@ type DirectEventProps = $ReadOnly<{
45
47
  *
46
48
  * See https://reactnative.dev/docs/view#onaccessibilitytap
47
49
  */
48
- onAccessibilityTap?: ?() => mixed,
50
+ onAccessibilityTap?: ?() => unknown,
49
51
 
50
52
  /**
51
53
  * Invoked on mount and layout changes with:
@@ -58,7 +60,7 @@ type DirectEventProps = $ReadOnly<{
58
60
  *
59
61
  * See https://reactnative.dev/docs/view#onlayout
60
62
  */
61
- onLayout?: ?(event: LayoutChangeEvent) => mixed,
63
+ onLayout?: ?(event: LayoutChangeEvent) => unknown,
62
64
 
63
65
  /**
64
66
  * When `accessible` is `true`, the system will invoke this function when the
@@ -66,7 +68,7 @@ type DirectEventProps = $ReadOnly<{
66
68
  *
67
69
  * See https://reactnative.dev/docs/view#onmagictap
68
70
  */
69
- onMagicTap?: ?() => mixed,
71
+ onMagicTap?: ?() => unknown,
70
72
 
71
73
  /**
72
74
  * When `accessible` is `true`, the system will invoke this function when the
@@ -74,7 +76,7 @@ type DirectEventProps = $ReadOnly<{
74
76
  *
75
77
  * See https://reactnative.dev/docs/view#onaccessibilityescape
76
78
  */
77
- onAccessibilityEscape?: ?() => mixed,
79
+ onAccessibilityEscape?: ?() => unknown,
78
80
  }>;
79
81
 
80
82
  type MouseEventProps = $ReadOnly<{
@@ -115,6 +117,13 @@ type FocusEventProps = $ReadOnly<{
115
117
  onFocusCapture?: ?(event: FocusEvent) => void,
116
118
  }>;
117
119
 
120
+ type KeyEventProps = $ReadOnly<{
121
+ onKeyDown?: ?(event: KeyDownEvent) => void,
122
+ onKeyDownCapture?: ?(event: KeyDownEvent) => void,
123
+ onKeyUp?: ?(event: KeyUpEvent) => void,
124
+ onKeyUpCapture?: ?(event: KeyUpEvent) => void,
125
+ }>;
126
+
118
127
  type TouchEventProps = $ReadOnly<{
119
128
  onTouchCancel?: ?(e: GestureResponderEvent) => void,
120
129
  onTouchCancelCapture?: ?(e: GestureResponderEvent) => void,
@@ -344,7 +353,7 @@ export type ViewPropsAndroid = $ReadOnly<{
344
353
  *
345
354
  * @platform android
346
355
  */
347
- onClick?: ?(event: GestureResponderEvent) => mixed,
356
+ onClick?: ?(event: GestureResponderEvent) => unknown,
348
357
  }>;
349
358
 
350
359
  export type TVViewPropsIOS = $ReadOnly<{
@@ -505,6 +514,7 @@ export type ViewProps = $ReadOnly<{
505
514
  ...MouseEventProps,
506
515
  ...PointerEventProps,
507
516
  ...FocusEventProps,
517
+ ...KeyEventProps,
508
518
  ...TouchEventProps,
509
519
  ...ViewPropsAndroid,
510
520
  ...ViewPropsIOS,
@@ -16,6 +16,8 @@ import type {
16
16
  BlurEvent,
17
17
  FocusEvent,
18
18
  GestureResponderEvent,
19
+ KeyDownEvent,
20
+ KeyUpEvent,
19
21
  LayoutChangeEvent,
20
22
  LayoutRectangle,
21
23
  MouseEvent,
@@ -38,7 +40,7 @@ type DirectEventProps = $ReadOnly<{
38
40
  * when the user performs an accessibility custom action.
39
41
  *
40
42
  */
41
- onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
43
+ onAccessibilityAction?: ?(event: AccessibilityActionEvent) => unknown,
42
44
 
43
45
  /**
44
46
  * When `accessible` is true, the system will try to invoke this function
@@ -46,7 +48,7 @@ type DirectEventProps = $ReadOnly<{
46
48
  *
47
49
  * See https://reactnative.dev/docs/view#onaccessibilitytap
48
50
  */
49
- onAccessibilityTap?: ?() => mixed,
51
+ onAccessibilityTap?: ?() => unknown,
50
52
 
51
53
  /**
52
54
  * Invoked on mount and layout changes with:
@@ -59,7 +61,7 @@ type DirectEventProps = $ReadOnly<{
59
61
  *
60
62
  * See https://reactnative.dev/docs/view#onlayout
61
63
  */
62
- onLayout?: ?(event: LayoutChangeEvent) => mixed,
64
+ onLayout?: ?(event: LayoutChangeEvent) => unknown,
63
65
 
64
66
  /**
65
67
  * When `accessible` is `true`, the system will invoke this function when the
@@ -67,7 +69,7 @@ type DirectEventProps = $ReadOnly<{
67
69
  *
68
70
  * See https://reactnative.dev/docs/view#onmagictap
69
71
  */
70
- onMagicTap?: ?() => mixed,
72
+ onMagicTap?: ?() => unknown,
71
73
 
72
74
  /**
73
75
  * When `accessible` is `true`, the system will invoke this function when the
@@ -75,7 +77,7 @@ type DirectEventProps = $ReadOnly<{
75
77
  *
76
78
  * See https://reactnative.dev/docs/view#onaccessibilityescape
77
79
  */
78
- onAccessibilityEscape?: ?() => mixed,
80
+ onAccessibilityEscape?: ?() => unknown,
79
81
  }>;
80
82
 
81
83
  type MouseEventProps = $ReadOnly<{
@@ -116,6 +118,13 @@ type FocusEventProps = $ReadOnly<{
116
118
  onFocusCapture?: ?(event: FocusEvent) => void,
117
119
  }>;
118
120
 
121
+ type KeyEventProps = $ReadOnly<{
122
+ onKeyDown?: ?(event: KeyDownEvent) => void,
123
+ onKeyDownCapture?: ?(event: KeyDownEvent) => void,
124
+ onKeyUp?: ?(event: KeyUpEvent) => void,
125
+ onKeyUpCapture?: ?(event: KeyUpEvent) => void,
126
+ }>;
127
+
119
128
  type TouchEventProps = $ReadOnly<{
120
129
  onTouchCancel?: ?(e: GestureResponderEvent) => void,
121
130
  onTouchCancelCapture?: ?(e: GestureResponderEvent) => void,
@@ -345,7 +354,7 @@ export type ViewPropsAndroid = $ReadOnly<{
345
354
  *
346
355
  * @platform android
347
356
  */
348
- onClick?: ?(event: GestureResponderEvent) => mixed,
357
+ onClick?: ?(event: GestureResponderEvent) => unknown,
349
358
  }>;
350
359
 
351
360
  export type TVViewPropsIOS = $ReadOnly<{
@@ -539,12 +548,12 @@ type ViewPropsWindows = $ReadOnly<{|
539
548
  *
540
549
  * @platform windows
541
550
  */
542
- onKeyUp?: ?(e: KeyEvent) => void,
543
- onKeyUpCapture?: ?(e: KeyEvent) => void,
551
+ onKeyUp?: ?(e: KeyUpEvent) => void,
552
+ onKeyUpCapture?: ?(e: KeyUpEvent) => void,
544
553
  keyUpEvents?: ?$ReadOnlyArray<HandledKeyboardEvent>,
545
554
 
546
- onKeyDown?: ?(e: KeyEvent) => void,
547
- onKeyDownCapture?: ?(e: KeyEvent) => void,
555
+ onKeyDown?: ?(e: KeyDownEvent) => void,
556
+ onKeyDownCapture?: ?(e: KeyDownEvent) => void,
548
557
  keyDownEvents?: ?$ReadOnlyArray<HandledKeyboardEvent>,
549
558
  /**
550
559
  * Specifies the Tooltip for the view
@@ -587,6 +596,7 @@ export type ViewProps = $ReadOnly<{
587
596
  ...MouseEventProps,
588
597
  ...PointerEventProps,
589
598
  ...FocusEventProps,
599
+ ...KeyEventProps,
590
600
  ...TouchEventProps,
591
601
  ...ViewPropsAndroid,
592
602
  ...ViewPropsIOS,
@@ -13,7 +13,10 @@ import DevLoadingView from '../../Utilities/DevLoadingView';
13
13
  import HMRClient from '../../Utilities/HMRClient';
14
14
  import getDevServer from './getDevServer';
15
15
 
16
- declare var global: {globalEvalWithSourceUrl?: (string, string) => mixed, ...};
16
+ declare var global: {
17
+ globalEvalWithSourceUrl?: (string, string) => unknown,
18
+ ...
19
+ };
17
20
 
18
21
  let pendingRequests = 0;
19
22
 
@@ -26,7 +29,7 @@ export class LoadBundleFromServerError extends Error {
26
29
  message: string,
27
30
  url: string,
28
31
  isTimeout: boolean,
29
- options?: {cause: mixed, ...},
32
+ options?: {cause: unknown, ...},
30
33
  ): void {
31
34
  super(message, options);
32
35
  this.url = url;
@@ -40,7 +43,7 @@ export class LoadBundleFromServerRequestError extends LoadBundleFromServerError
40
43
  message: string,
41
44
  url: string,
42
45
  isTimeout: boolean,
43
- options?: {cause: mixed, ...},
46
+ options?: {cause: unknown, ...},
44
47
  ): void {
45
48
  super(message, url, isTimeout, options);
46
49
  this.name = 'LoadBundleFromServerRequestError';
@@ -13,7 +13,10 @@ import DevLoadingView from '../../Utilities/DevLoadingView';
13
13
  import HMRClient from '../../Utilities/HMRClient';
14
14
  import getDevServer from './getDevServer';
15
15
 
16
- declare var global: {globalEvalWithSourceUrl?: (string, string) => mixed, ...};
16
+ declare var global: {
17
+ globalEvalWithSourceUrl?: (string, string) => unknown,
18
+ ...
19
+ };
17
20
 
18
21
  let pendingRequests = 0;
19
22
 
@@ -26,7 +29,7 @@ export class LoadBundleFromServerError extends Error {
26
29
  message: string,
27
30
  url: string,
28
31
  isTimeout: boolean,
29
- options?: {cause: mixed, ...},
32
+ options?: {cause: unknown, ...},
30
33
  ): void {
31
34
  super(message, options);
32
35
  this.url = url;
@@ -40,7 +43,7 @@ export class LoadBundleFromServerRequestError extends LoadBundleFromServerError
40
43
  message: string,
41
44
  url: string,
42
45
  isTimeout: boolean,
43
- options?: {cause: mixed, ...},
46
+ options?: {cause: unknown, ...},
44
47
  ): void {
45
48
  super(message, url, isTimeout, options);
46
49
  this.name = 'LoadBundleFromServerRequestError';
@@ -31,7 +31,7 @@ export type SymbolicatedStackTrace = $ReadOnly<{
31
31
 
32
32
  export default async function symbolicateStackTrace(
33
33
  stack: Array<StackFrame>,
34
- extraData?: mixed,
34
+ extraData?: unknown,
35
35
  ): Promise<SymbolicatedStackTrace> {
36
36
  const devServer = getDevServer();
37
37
  if (!devServer.bundleLoadedFromServer) {