@office-iss/react-native-win32 0.74.4 → 0.75.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 (214) hide show
  1. package/.flowconfig +9 -4
  2. package/CHANGELOG.json +569 -51
  3. package/CHANGELOG.md +173 -30
  4. package/Libraries/Animated/AnimatedImplementation.js +2 -0
  5. package/Libraries/Animated/NativeAnimatedHelper.js +4 -0
  6. package/Libraries/Animated/NativeAnimatedHelper.win32.js +4 -0
  7. package/Libraries/Animated/createAnimatedComponent.js +10 -4
  8. package/Libraries/Animated/useAnimatedProps.js +56 -28
  9. package/Libraries/BatchedBridge/MessageQueue.js +1 -0
  10. package/Libraries/Components/Button.js +10 -5
  11. package/Libraries/Components/Button.win32.js +1 -0
  12. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +11 -2
  13. package/Libraries/Components/Pressable/Pressable.js +13 -6
  14. package/Libraries/Components/Pressable/Pressable.win32.js +13 -6
  15. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +4 -0
  16. package/Libraries/Components/ScrollView/ScrollView.js +109 -29
  17. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +6 -0
  18. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +13 -1
  19. package/Libraries/Components/StatusBar/StatusBar.js +1 -21
  20. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +0 -15
  21. package/Libraries/Components/TextInput/InputAccessoryView.js +10 -1
  22. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +0 -12
  23. package/Libraries/Components/TextInput/TextInput.d.ts +0 -19
  24. package/Libraries/Components/TextInput/TextInput.js +14 -70
  25. package/Libraries/Components/TextInput/TextInput.win32.js +15 -72
  26. package/Libraries/Components/Touchable/Touchable.js +2 -2
  27. package/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -10
  28. package/Libraries/Components/Touchable/TouchableHighlight.js +3 -1
  29. package/Libraries/Components/Touchable/TouchableOpacity.d.ts +4 -32
  30. package/Libraries/Components/Touchable/TouchableOpacity.js +3 -1
  31. package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +8 -0
  32. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +117 -111
  33. package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -0
  34. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  35. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  36. package/Libraries/Components/View/View.js +0 -11
  37. package/Libraries/Components/View/View.win32.js +0 -11
  38. package/Libraries/Components/View/ViewAccessibility.js +4 -4
  39. package/Libraries/Components/View/ViewAccessibility.win32.js +6 -6
  40. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -49
  41. package/Libraries/Components/View/ViewPropTypes.js +7 -0
  42. package/Libraries/Components/View/ViewPropTypes.win32.js +7 -0
  43. package/Libraries/Core/Devtools/loadBundleFromServer.js +3 -3
  44. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +153 -0
  45. package/Libraries/Core/Devtools/parseErrorStack.js +5 -5
  46. package/Libraries/Core/Devtools/parseHermesStack.js +22 -16
  47. package/Libraries/Core/ErrorHandlers.js +116 -0
  48. package/Libraries/Core/ExceptionsManager.js +2 -2
  49. package/Libraries/Core/ReactNativeVersion.js +3 -3
  50. package/Libraries/Core/setUpDeveloperTools.js +3 -1
  51. package/Libraries/Core/setUpPerformance.js +6 -4
  52. package/Libraries/Core/setUpReactDevTools.js +70 -10
  53. package/Libraries/Core/setUpTimers.js +50 -31
  54. package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
  55. package/Libraries/Image/Image.android.js +23 -13
  56. package/Libraries/Image/Image.d.ts +14 -15
  57. package/Libraries/Image/Image.ios.js +21 -11
  58. package/Libraries/Image/Image.win32.js +5 -3
  59. package/Libraries/Image/ImageProps.js +16 -5
  60. package/Libraries/Image/ImageTypes.flow.js +7 -2
  61. package/Libraries/Image/ImageUtils.js +1 -0
  62. package/Libraries/Image/ImageViewNativeComponent.js +2 -1
  63. package/Libraries/Inspector/ElementBox.js +6 -3
  64. package/Libraries/Inspector/ElementProperties.js +1 -1
  65. package/Libraries/Interaction/TouchHistoryMath.js +4 -4
  66. package/Libraries/IntersectionObserver/IntersectionObserverManager.js +6 -26
  67. package/Libraries/JSInspector/NetworkAgent.js +1 -1
  68. package/Libraries/LogBox/Data/LogBoxData.js +39 -29
  69. package/Libraries/LogBox/Data/LogBoxLog.js +114 -2
  70. package/Libraries/LogBox/Data/parseLogBoxLog.js +168 -53
  71. package/Libraries/LogBox/LogBox.js +29 -12
  72. package/Libraries/LogBox/LogBoxNotificationContainer.js +4 -0
  73. package/Libraries/LogBox/UI/LogBoxInspector.js +8 -70
  74. package/Libraries/LogBox/UI/LogBoxInspectorBody.js +87 -0
  75. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -42
  76. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +58 -0
  77. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +5 -66
  78. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +8 -52
  79. package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +76 -0
  80. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +8 -5
  81. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +8 -5
  82. package/Libraries/LogBox/UI/LogBoxNotification.js +13 -152
  83. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +63 -0
  84. package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +67 -0
  85. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +57 -0
  86. package/Libraries/NativeComponent/BaseViewConfig.android.js +5 -0
  87. package/Libraries/NativeComponent/BaseViewConfig.ios.js +5 -0
  88. package/Libraries/NativeComponent/BaseViewConfig.win32.js +5 -0
  89. package/Libraries/NativeComponent/NativeComponentRegistry.js +12 -5
  90. package/Libraries/NativeComponent/StaticViewConfigValidator.js +3 -0
  91. package/Libraries/Network/XMLHttpRequest.js +5 -1
  92. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +3 -3
  93. package/Libraries/Pressability/Pressability.js +3 -51
  94. package/Libraries/Pressability/Pressability.win32.js +3 -51
  95. package/Libraries/ReactNative/AppContainer-dev.js +3 -2
  96. package/Libraries/ReactNative/AppContainer-prod.js +2 -1
  97. package/Libraries/ReactNative/AppContainer.js +2 -0
  98. package/Libraries/ReactNative/AppRegistry.d.ts +7 -0
  99. package/Libraries/ReactNative/AppRegistry.js +10 -4
  100. package/Libraries/ReactNative/BridgelessUIManager.js +1 -21
  101. package/Libraries/ReactNative/FabricUIManager.js +0 -51
  102. package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +1 -0
  103. package/Libraries/ReactNative/RendererImplementation.js +20 -2
  104. package/Libraries/ReactNative/UIManager.d.ts +0 -21
  105. package/Libraries/ReactNative/UIManagerProperties.js +0 -3
  106. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +5 -341
  107. package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -8
  108. package/Libraries/ReactNative/renderApplication.js +3 -0
  109. package/Libraries/Renderer/implementations/ReactFabric-dev.js +15682 -27088
  110. package/Libraries/Renderer/implementations/ReactFabric-prod.js +5082 -4381
  111. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3480 -2571
  112. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +15943 -27543
  113. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5303 -4606
  114. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3450 -2572
  115. package/Libraries/Renderer/shims/ReactFabric.js +2 -2
  116. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  117. package/Libraries/Renderer/shims/ReactNative.js +2 -3
  118. package/Libraries/Renderer/shims/ReactNativeTypes.js +24 -3
  119. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -2
  120. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  121. package/Libraries/Share/Share.d.ts +16 -10
  122. package/Libraries/Share/Share.js +14 -15
  123. package/Libraries/StyleSheet/StyleSheet.d.ts +1 -1
  124. package/Libraries/StyleSheet/StyleSheet.js +3 -10
  125. package/Libraries/StyleSheet/StyleSheet.win32.js +3 -10
  126. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +21 -21
  127. package/Libraries/StyleSheet/StyleSheetTypes.js +24 -18
  128. package/Libraries/StyleSheet/flattenStyle.js +1 -0
  129. package/Libraries/StyleSheet/processFilter.js +132 -0
  130. package/Libraries/StyleSheet/processTransform.js +18 -3
  131. package/Libraries/Text/Text.js +151 -128
  132. package/Libraries/Text/Text.win32.js +163 -138
  133. package/Libraries/Text/TextNativeComponent.js +5 -4
  134. package/Libraries/Text/TextNativeComponent.win32.js +5 -4
  135. package/Libraries/Text/TextProps.js +6 -6
  136. package/Libraries/Text/TextProps.win32.js +6 -6
  137. package/Libraries/TurboModule/TurboModuleRegistry.js +2 -1
  138. package/Libraries/Types/CodegenTypes.js +3 -0
  139. package/Libraries/Utilities/{LoadingView.android.js → DevLoadingView.js} +33 -11
  140. package/Libraries/Utilities/Dimensions.js +1 -0
  141. package/Libraries/Utilities/Dimensions.win32.js +1 -0
  142. package/Libraries/Utilities/HMRClient.js +36 -8
  143. package/Libraries/Utilities/HMRClientProdShim.js +1 -0
  144. package/Libraries/Utilities/Platform.android.js +5 -5
  145. package/Libraries/Utilities/Platform.d.ts +1 -1
  146. package/Libraries/Utilities/Platform.flow.js +2 -2
  147. package/Libraries/Utilities/Platform.flow.win32.js +3 -3
  148. package/Libraries/Utilities/Platform.ios.js +1 -1
  149. package/Libraries/Utilities/Platform.win32.js +1 -1
  150. package/Libraries/Utilities/RCTLog.js +1 -0
  151. package/Libraries/Utilities/ReactNativeTestTools.js +12 -24
  152. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +11 -6
  153. package/Libraries/__tests__/ButtonWin32-test.js +7 -6
  154. package/Libraries/promiseRejectionTrackingOptions.js +1 -0
  155. package/jest/mockComponent.js +7 -0
  156. package/jest/renderer.js +25 -14
  157. package/jest/setup.js +19 -13
  158. package/jest.config.js +2 -1
  159. package/overrides.json +32 -31
  160. package/package.json +27 -25
  161. package/rn-get-polyfills.js +1 -0
  162. package/src/private/core/composeStyles.js +27 -0
  163. package/src/private/featureflags/ReactNativeFeatureFlags.js +93 -33
  164. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
  165. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +56 -0
  166. package/src/private/fusebox/setUpFuseboxReactDevToolsDispatcher.js +108 -0
  167. package/src/private/specs/modules/NativeBlobModule.js +4 -2
  168. package/src/private/specs/modules/NativeDevSettings.js +1 -0
  169. package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
  170. package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
  171. package/src/private/specs/modules/NativePlatformConstantsWin.js +1 -1
  172. package/src/private/specs/modules/NativePushNotificationManagerIOS.js +0 -4
  173. package/src/private/specs/modules/NativeUIManager.js +0 -7
  174. package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +24 -24
  175. package/src/private/webapis/dom/nodes/ReactNativeElement.js +11 -14
  176. package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +2 -3
  177. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +24 -54
  178. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -13
  179. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +468 -0
  180. package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +413 -0
  181. package/src/private/webapis/dom/oldstylecollections/DOMRectList.js +4 -4
  182. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +4 -4
  183. package/src/private/webapis/dom/oldstylecollections/NodeList.js +5 -5
  184. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +34 -0
  185. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +21 -0
  186. package/src/private/webapis/performance/EventCounts.js +1 -1
  187. package/src/private/webapis/performance/MemoryInfo.js +9 -9
  188. package/src/private/webapis/performance/Performance.js +10 -56
  189. package/src/private/webapis/performance/PerformanceObserver.js +30 -22
  190. package/src/private/webapis/performance/RawPerformanceEntry.js +2 -7
  191. package/src/private/webapis/performance/ReactNativeStartupTiming.js +18 -18
  192. package/src/private/webapis/performance/UserTiming.js +63 -0
  193. package/src/private/webapis/performance/{NativePerformance.js → specs/NativePerformance.js} +3 -2
  194. package/src/private/webapis/performance/{NativePerformanceObserver.js → specs/NativePerformanceObserver.js} +2 -2
  195. package/src/private/webapis/performance/{__mocks__ → specs/__mocks__}/NativePerformance.js +1 -1
  196. package/src/private/webapis/performance/{__mocks__ → specs/__mocks__}/NativePerformanceObserver.js +3 -4
  197. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -49
  198. package/types/modules/globals.d.ts +4 -0
  199. package/Libraries/Components/ScrollView/ScrollView.win32.js +0 -1915
  200. package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +0 -13
  201. package/Libraries/Utilities/LoadingView.ios.js +0 -50
  202. package/Libraries/Utilities/LoadingView.js +0 -16
  203. package/jest/ReactNativeInternalFeatureFlagsMock.js +0 -13
  204. package/src/private/featureflags/NativeReactNativeFeatureFlags.js +0 -44
  205. package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js +0 -92
  206. package/src/private/specs/modules/NativeAnimationsDebugModule.js +0 -20
  207. package/src/private/webapis/dom/oldstylecollections/__tests__/DOMRectList-test.js +0 -85
  208. package/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-test.js +0 -80
  209. package/src/private/webapis/dom/oldstylecollections/__tests__/NodeList-test.js +0 -161
  210. package/src/private/webapis/performance/__tests__/EventCounts-test.js +0 -116
  211. package/src/private/webapis/performance/__tests__/NativePerformanceMock-test.js +0 -82
  212. package/src/private/webapis/performance/__tests__/NativePerformanceObserverMock-test.js +0 -108
  213. package/src/private/webapis/performance/__tests__/Performance-test.js +0 -117
  214. package/src/private/webapis/performance/__tests__/PerformanceObserver-test.js +0 -208
@@ -136,33 +136,6 @@ export type PressabilityConfig = $ReadOnly<{|
136
136
  * while this pressable is responder.
137
137
  */
138
138
  blockNativeResponder?: ?boolean,
139
-
140
- /**
141
- * Returns whether a long press gesture should cancel the press gesture.
142
- * Defaults to true.
143
- *
144
- * @deprecated
145
- */
146
- onLongPressShouldCancelPress_DEPRECATED?: ?() => boolean,
147
-
148
- /**
149
- * If `cancelable` is set, this will be ignored.
150
- *
151
- * Returns whether to yield to a lock termination request (e.g. if a native
152
- * scroll gesture attempts to steal the responder lock).
153
- *
154
- * @deprecated
155
- */
156
- onResponderTerminationRequest_DEPRECATED?: ?() => boolean,
157
-
158
- /**
159
- * If `disabled` is set, this will be ignored.
160
- *
161
- * Returns whether to start a press gesture.
162
- *
163
- * @deprecated
164
- */
165
- onStartShouldSetResponder_DEPRECATED?: ?() => boolean,
166
139
  |}>;
167
140
 
168
141
  export type EventHandlers = $ReadOnly<{|
@@ -475,13 +448,7 @@ export default class Pressability {
475
448
  const responderEventHandlers = {
476
449
  onStartShouldSetResponder: (): boolean => {
477
450
  const {disabled} = this._config;
478
- if (disabled == null) {
479
- const {onStartShouldSetResponder_DEPRECATED} = this._config;
480
- return onStartShouldSetResponder_DEPRECATED == null
481
- ? true
482
- : onStartShouldSetResponder_DEPRECATED();
483
- }
484
- return !disabled;
451
+ return !disabled ?? true;
485
452
  },
486
453
 
487
454
  onResponderGrant: (event: PressEvent): void | boolean => {
@@ -559,13 +526,7 @@ export default class Pressability {
559
526
 
560
527
  onResponderTerminationRequest: (): boolean => {
561
528
  const {cancelable} = this._config;
562
- if (cancelable == null) {
563
- const {onResponderTerminationRequest_DEPRECATED} = this._config;
564
- return onResponderTerminationRequest_DEPRECATED == null
565
- ? true
566
- : onResponderTerminationRequest_DEPRECATED();
567
- }
568
- return cancelable;
529
+ return cancelable ?? true;
569
530
  },
570
531
 
571
532
  onClick: (event: PressEvent): void => {
@@ -789,9 +750,7 @@ export default class Pressability {
789
750
  const {onLongPress, onPress, android_disableSound} = this._config;
790
751
  if (onPress != null) {
791
752
  const isPressCanceledByLongPress =
792
- onLongPress != null &&
793
- prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' &&
794
- this._shouldLongPressCancelPress();
753
+ onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN';
795
754
  if (!isPressCanceledByLongPress) {
796
755
  if (Platform.OS === 'android' && android_disableSound !== true) {
797
756
  SoundManager.playTouchSound();
@@ -925,13 +884,6 @@ export default class Pressability {
925
884
  }
926
885
  }
927
886
 
928
- _shouldLongPressCancelPress(): boolean {
929
- return (
930
- this._config.onLongPressShouldCancelPress_DEPRECATED == null ||
931
- this._config.onLongPressShouldCancelPress_DEPRECATED()
932
- );
933
- }
934
-
935
887
  _cancelHoverInDelayTimeout(): void {
936
888
  if (this._hoverInDelayTimeout != null) {
937
889
  clearTimeout(this._hoverInDelayTimeout);
@@ -148,33 +148,6 @@ export type PressabilityConfig = $ReadOnly<{|
148
148
  */
149
149
  blockNativeResponder?: ?boolean,
150
150
 
151
- /**
152
- * Returns whether a long press gesture should cancel the press gesture.
153
- * Defaults to true.
154
- *
155
- * @deprecated
156
- */
157
- onLongPressShouldCancelPress_DEPRECATED?: ?() => boolean,
158
-
159
- /**
160
- * If `cancelable` is set, this will be ignored.
161
- *
162
- * Returns whether to yield to a lock termination request (e.g. if a native
163
- * scroll gesture attempts to steal the responder lock).
164
- *
165
- * @deprecated
166
- */
167
- onResponderTerminationRequest_DEPRECATED?: ?() => boolean,
168
-
169
- /**
170
- * If `disabled` is set, this will be ignored.
171
- *
172
- * Returns whether to start a press gesture.
173
- *
174
- * @deprecated
175
- */
176
- onStartShouldSetResponder_DEPRECATED?: ?() => boolean,
177
-
178
151
  // [Windows
179
152
  /**
180
153
  * Raw handler for onMouseEnter that will be preferred if set over hover
@@ -508,13 +481,7 @@ export default class Pressability {
508
481
  const responderEventHandlers = {
509
482
  onStartShouldSetResponder: (): boolean => {
510
483
  const {disabled} = this._config;
511
- if (disabled == null) {
512
- const {onStartShouldSetResponder_DEPRECATED} = this._config;
513
- return onStartShouldSetResponder_DEPRECATED == null
514
- ? true
515
- : onStartShouldSetResponder_DEPRECATED();
516
- }
517
- return !disabled;
484
+ return !disabled ?? true;
518
485
  },
519
486
 
520
487
  onResponderGrant: (event: PressEvent): void | boolean => {
@@ -592,13 +559,7 @@ export default class Pressability {
592
559
 
593
560
  onResponderTerminationRequest: (): boolean => {
594
561
  const {cancelable} = this._config;
595
- if (cancelable == null) {
596
- const {onResponderTerminationRequest_DEPRECATED} = this._config;
597
- return onResponderTerminationRequest_DEPRECATED == null
598
- ? true
599
- : onResponderTerminationRequest_DEPRECATED();
600
- }
601
- return cancelable;
562
+ return cancelable ?? true;
602
563
  },
603
564
 
604
565
  onClick: (event: PressEvent): void => {
@@ -891,9 +852,7 @@ export default class Pressability {
891
852
  this._isDefaultPressButton(getTouchFromPressEvent(event).button)
892
853
  ) {
893
854
  const isPressCanceledByLongPress =
894
- onLongPress != null &&
895
- prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' &&
896
- this._shouldLongPressCancelPress();
855
+ onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN';
897
856
  if (!isPressCanceledByLongPress) {
898
857
  if (Platform.OS === 'android' && android_disableSound !== true) {
899
858
  SoundManager.playTouchSound();
@@ -1030,13 +989,6 @@ export default class Pressability {
1030
989
  }
1031
990
  }
1032
991
 
1033
- _shouldLongPressCancelPress(): boolean {
1034
- return (
1035
- this._config.onLongPressShouldCancelPress_DEPRECATED == null ||
1036
- this._config.onLongPressShouldCancelPress_DEPRECATED()
1037
- );
1038
- }
1039
-
1040
992
  _cancelHoverInDelayTimeout(): void {
1041
993
  if (this._hoverInDelayTimeout != null) {
1042
994
  clearTimeout(this._hoverInDelayTimeout);
@@ -92,6 +92,7 @@ const AppContainer = ({
92
92
  rootTag,
93
93
  showArchitectureIndicator,
94
94
  WrapperComponent,
95
+ rootViewStyle,
95
96
  }: Props): React.Node => {
96
97
  const appContainerRootViewRef: AppContainerRootViewRef = React.useRef(null);
97
98
  const innerViewRef: InspectedViewRef = React.useRef(null);
@@ -141,7 +142,7 @@ const AppContainer = ({
141
142
  collapsable={reactDevToolsAgent == null && !shouldRenderInspector}
142
143
  pointerEvents="box-none"
143
144
  key={key}
144
- style={styles.container}
145
+ style={rootViewStyle || styles.container}
145
146
  ref={innerViewRef}>
146
147
  {children}
147
148
  </View>
@@ -167,7 +168,7 @@ const AppContainer = ({
167
168
  <RootTagContext.Provider value={createRootTag(rootTag)}>
168
169
  <View
169
170
  ref={appContainerRootViewRef}
170
- style={styles.container}
171
+ style={rootViewStyle || styles.container}
171
172
  pointerEvents="box-none">
172
173
  {innerView}
173
174
 
@@ -23,6 +23,7 @@ const AppContainer = ({
23
23
  rootTag,
24
24
  showArchitectureIndicator,
25
25
  WrapperComponent,
26
+ rootViewStyle,
26
27
  }: Props): React.Node => {
27
28
  let innerView = children;
28
29
 
@@ -39,7 +40,7 @@ const AppContainer = ({
39
40
 
40
41
  return (
41
42
  <RootTagContext.Provider value={createRootTag(rootTag)}>
42
- <View style={styles.root} pointerEvents="box-none">
43
+ <View style={rootViewStyle || styles.root} pointerEvents="box-none">
43
44
  {innerView}
44
45
  </View>
45
46
  </RootTagContext.Provider>
@@ -8,6 +8,7 @@
8
8
  * @flow
9
9
  */
10
10
 
11
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
11
12
  import type {RootTag} from './RootTag';
12
13
 
13
14
  import * as React from 'react';
@@ -19,6 +20,7 @@ export type Props = $ReadOnly<{|
19
20
  initialProps?: {...},
20
21
  showArchitectureIndicator?: boolean,
21
22
  WrapperComponent?: ?React.ComponentType<any>,
23
+ rootViewStyle?: ?ViewStyleProp,
22
24
  internal_excludeLogBox?: boolean,
23
25
  internal_excludeInspector?: boolean,
24
26
  |}>;
@@ -9,6 +9,7 @@
9
9
 
10
10
  import type * as React from 'react';
11
11
  import type {IPerformanceLogger} from '../Utilities/IPerformanceLogger';
12
+ import type {ViewStyle} from '../StyleSheet/StyleSheetTypes';
12
13
 
13
14
  type Task = (taskData: any) => Promise<void>;
14
15
  type TaskProvider = () => Task;
@@ -34,6 +35,8 @@ export type WrapperComponentProvider = (
34
35
  appParameters: any,
35
36
  ) => React.ComponentType<any>;
36
37
 
38
+ export type RootViewStyleProvider = (appParameters: any) => ViewStyle;
39
+
37
40
  /**
38
41
  * `AppRegistry` is the JS entry point to running all React Native apps. App
39
42
  * root components should register themselves with
@@ -54,6 +57,10 @@ export namespace AppRegistry {
54
57
  provider: WrapperComponentProvider,
55
58
  ): void;
56
59
 
60
+ export function setRootViewStyleProvider(
61
+ provider: RootViewStyleProvider,
62
+ ): void;
63
+
57
64
  export function registerConfig(config: AppConfig[]): void;
58
65
 
59
66
  export function registerComponent(
@@ -8,6 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
11
12
  import type {RootTag} from '../Types/RootTagTypes';
12
13
  import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
13
14
  import type {DisplayModeType} from './DisplayMode';
@@ -60,6 +61,7 @@ export type Registry = {
60
61
  export type WrapperComponentProvider = (
61
62
  appParameters: Object,
62
63
  ) => React$ComponentType<any>;
64
+ export type RootViewStyleProvider = (appParameters: Object) => ViewStyleProp;
63
65
 
64
66
  const runnables: Runnables = {};
65
67
  let runCount = 1;
@@ -70,6 +72,7 @@ let componentProviderInstrumentationHook: ComponentProviderInstrumentationHook =
70
72
  (component: ComponentProvider) => component();
71
73
 
72
74
  let wrapperComponentProvider: ?WrapperComponentProvider;
75
+ let rootViewStyleProvider: ?RootViewStyleProvider;
73
76
  let showArchitectureIndicator = false;
74
77
 
75
78
  /**
@@ -82,6 +85,10 @@ const AppRegistry = {
82
85
  wrapperComponentProvider = provider;
83
86
  },
84
87
 
88
+ setRootViewStyleProvider(provider: RootViewStyleProvider) {
89
+ rootViewStyleProvider = provider;
90
+ },
91
+
85
92
  enableArchitectureIndicator(enabled: boolean): void {
86
93
  showArchitectureIndicator = enabled;
87
94
  },
@@ -130,6 +137,7 @@ const AppRegistry = {
130
137
  appParameters.initialProps,
131
138
  appParameters.rootTag,
132
139
  wrapperComponentProvider && wrapperComponentProvider(appParameters),
140
+ rootViewStyleProvider && rootViewStyleProvider(appParameters),
133
141
  appParameters.fabric,
134
142
  showArchitectureIndicator,
135
143
  scopedPerformanceLogger,
@@ -196,10 +204,8 @@ const AppRegistry = {
196
204
  displayMode?: number,
197
205
  ): void {
198
206
  if (appKey !== 'LogBox') {
199
- const logParams = __DEV__
200
- ? '" with ' + JSON.stringify(appParameters)
201
- : '';
202
- const msg = 'Running "' + appKey + logParams;
207
+ const logParams = __DEV__ ? ` with ${JSON.stringify(appParameters)}` : '';
208
+ const msg = `Running "${appKey}"${logParams}`;
203
209
  infoLog(msg);
204
210
  BugReporting.addSource(
205
211
  'AppRegistry.runApplication' + runCount++,
@@ -160,27 +160,7 @@ const UIManagerJSUnusedInNewArchAPIs = {
160
160
  * them from React Native.
161
161
  */
162
162
  const UIManagerJSDeprecatedPlatformAPIs = Platform.select({
163
- android: {
164
- // TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
165
- showPopupMenu: (
166
- reactTag: number,
167
- items: Array<string>,
168
- error: (error: Object) => void,
169
- success: (event: string, selected?: number) => void,
170
- ): void => {
171
- raiseSoftError(
172
- 'showPopupMenu',
173
- 'Please use the <PopupMenuAndroid /> component instead.',
174
- );
175
- },
176
- // TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
177
- dismissPopupMenu: (): void => {
178
- raiseSoftError(
179
- 'dismissPopupMenu',
180
- 'Please use the <PopupMenuAndroid /> component instead.',
181
- );
182
- },
183
- },
163
+ android: {},
184
164
  });
185
165
 
186
166
  const UIManagerJSPlatformAPIs = Platform.select({
@@ -70,15 +70,7 @@ export interface Spec {
70
70
  locationY: number,
71
71
  callback: (instanceHandle: ?InternalInstanceHandle) => void,
72
72
  ) => void;
73
-
74
- /**
75
- * Support methods for the DOM-compatible APIs.
76
- */
77
- +getParentNode: (node: Node) => ?InternalInstanceHandle;
78
- +getChildNodes: (node: Node) => $ReadOnlyArray<InternalInstanceHandle>;
79
- +isConnected: (node: Node) => boolean;
80
73
  +compareDocumentPosition: (node: Node, otherNode: Node) => number;
81
- +getTextContent: (node: Node) => string;
82
74
  +getBoundingClientRect: (
83
75
  node: Node,
84
76
  includeTransform: boolean,
@@ -88,36 +80,6 @@ export interface Spec {
88
80
  /* width: */ number,
89
81
  /* height: */ number,
90
82
  ];
91
- +getOffset: (
92
- node: Node,
93
- ) => ?[
94
- /* offsetParent: */ InternalInstanceHandle,
95
- /* offsetTop: */ number,
96
- /* offsetLeft: */ number,
97
- ];
98
- +getScrollPosition: (
99
- node: Node,
100
- ) => ?[/* scrollLeft: */ number, /* scrollTop: */ number];
101
- +getScrollSize: (
102
- node: Node,
103
- ) => ?[/* scrollWidth: */ number, /* scrollHeight: */ number];
104
- +getInnerSize: (node: Node) => ?[/* width: */ number, /* height: */ number];
105
- +getBorderSize: (
106
- node: Node,
107
- ) => ?[
108
- /* topWidth: */ number,
109
- /* rightWidth: */ number,
110
- /* bottomWidth: */ number,
111
- /* leftWidth: */ number,
112
- ];
113
- +getTagName: (node: Node) => string;
114
-
115
- /**
116
- * Support methods for the Pointer Capture APIs.
117
- */
118
- +hasPointerCapture: (node: Node, pointerId: number) => boolean;
119
- +setPointerCapture: (node: Node, pointerId: number) => void;
120
- +releasePointerCapture: (node: Node, pointerId: number) => void;
121
83
  }
122
84
 
123
85
  let nativeFabricUIManagerProxy: ?Spec;
@@ -143,21 +105,8 @@ const CACHED_PROPERTIES = [
143
105
  'findShadowNodeByTag_DEPRECATED',
144
106
  'setNativeProps',
145
107
  'dispatchCommand',
146
- 'getParentNode',
147
- 'getChildNodes',
148
- 'isConnected',
149
108
  'compareDocumentPosition',
150
- 'getTextContent',
151
109
  'getBoundingClientRect',
152
- 'getOffset',
153
- 'getScrollPosition',
154
- 'getScrollSize',
155
- 'getInnerSize',
156
- 'getBorderSize',
157
- 'getTagName',
158
- 'hasPointerCapture',
159
- 'setPointerCapture',
160
- 'releasePointerCapture',
161
110
  ];
162
111
 
163
112
  // This is exposed as a getter because apps using the legacy renderer AND
@@ -16,6 +16,7 @@ export default function warnForStyleProps(
16
16
  ): void {
17
17
  if (__DEV__) {
18
18
  for (const key in validAttributes.style) {
19
+ // $FlowFixMe[invalid-computed-prop]
19
20
  if (!(validAttributes[key] || props[key] === undefined)) {
20
21
  console.error(
21
22
  'You are setting the style `{ %s' +
@@ -12,8 +12,12 @@ import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type ReactFabricHostComponent from './ReactFabricPublicInstance/ReactFabricHostComponent';
13
13
  import type {Element, ElementRef, ElementType} from 'react';
14
14
 
15
+ import {
16
+ onCaughtError,
17
+ onRecoverableError,
18
+ onUncaughtError,
19
+ } from '../Core/ErrorHandlers';
15
20
  import {type RootTag} from './RootTag';
16
-
17
21
  export function renderElement({
18
22
  element,
19
23
  rootTag,
@@ -31,9 +35,23 @@ export function renderElement({
31
35
  rootTag,
32
36
  null,
33
37
  useConcurrentRoot,
38
+ {
39
+ onCaughtError,
40
+ onUncaughtError,
41
+ onRecoverableError,
42
+ },
34
43
  );
35
44
  } else {
36
- require('../Renderer/shims/ReactNative').render(element, rootTag);
45
+ require('../Renderer/shims/ReactNative').render(
46
+ element,
47
+ rootTag,
48
+ undefined,
49
+ {
50
+ onCaughtError,
51
+ onUncaughtError,
52
+ onRecoverableError,
53
+ },
54
+ );
37
55
  }
38
56
  }
39
57
 
@@ -89,27 +89,6 @@ export interface UIManagerStatic {
89
89
  | ((value: boolean) => void)
90
90
  | undefined;
91
91
 
92
- /**
93
- * Used to display an Android PopupMenu. If a menu item is pressed, the success callback will
94
- * be called with the following arguments:
95
- *
96
- * - item - the menu item.
97
- * - index - index of the pressed item in array. Returns `undefined` if cancelled.
98
- *
99
- * To obtain a native node handle for a component, you can use
100
- * `React.findNodeHandle(component)`.
101
- *
102
- * Note that this works only on Android
103
- */
104
- showPopupMenu?:
105
- | ((
106
- node: number,
107
- items: string[],
108
- error: () => void /* currently unused */,
109
- success: (item: string, index: number | undefined) => void,
110
- ) => void)
111
- | undefined;
112
-
113
92
  getViewManagerConfig: (name: string) => {
114
93
  Commands: {[key: string]: number};
115
94
  };
@@ -30,7 +30,6 @@ module.exports = [
30
30
  'clearJSResponder',
31
31
  'configureNextLayoutAnimation',
32
32
  'createView',
33
- 'dismissPopupMenu',
34
33
  'dispatchViewManagerCommand',
35
34
  'findSubviewIn',
36
35
  'getConstantsForViewManager',
@@ -45,10 +44,8 @@ module.exports = [
45
44
  'setChildren',
46
45
  'setJSResponder',
47
46
  'setLayoutAnimationEnabledExperimental',
48
- 'showPopupMenu',
49
47
  'updateView',
50
48
  'viewIsDescendantOf',
51
- 'PopupMenu',
52
49
  'LazyViewManagersEnabled',
53
50
  'ViewManagerNames',
54
51
  'StyleConstants',