@office-iss/react-native-win32 0.71.5 → 0.72.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 (326) hide show
  1. package/.flowconfig +15 -3
  2. package/CHANGELOG.json +321 -45
  3. package/CHANGELOG.md +149 -26
  4. package/IntegrationTests/IntegrationTestHarnessTest.js +1 -0
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +1 -1
  6. package/Libraries/Alert/Alert.d.ts +4 -4
  7. package/Libraries/Alert/Alert.win32.js +1 -0
  8. package/Libraries/Animated/Animated.d.ts +17 -6
  9. package/Libraries/Animated/NativeAnimatedHelper.js +18 -6
  10. package/Libraries/Animated/NativeAnimatedHelper.win32.js +606 -0
  11. package/Libraries/Animated/bezier.js +1 -1
  12. package/Libraries/Animated/components/AnimatedFlatList.js +8 -3
  13. package/Libraries/Animated/components/AnimatedScrollView.js +4 -1
  14. package/Libraries/Animated/components/AnimatedSectionList.js +12 -3
  15. package/Libraries/Animated/createAnimatedComponent.js +26 -239
  16. package/Libraries/Animated/nodes/AnimatedColor.js +47 -80
  17. package/Libraries/Animated/nodes/AnimatedInterpolation.js +167 -121
  18. package/Libraries/Animated/nodes/AnimatedNode.js +3 -5
  19. package/Libraries/Animated/nodes/AnimatedProps.js +7 -6
  20. package/Libraries/Animated/nodes/AnimatedStyle.js +42 -8
  21. package/Libraries/Animated/nodes/AnimatedTransform.js +1 -1
  22. package/Libraries/Animated/nodes/AnimatedValue.js +8 -12
  23. package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -1
  24. package/Libraries/Animated/useAnimatedProps.js +7 -10
  25. package/Libraries/BatchedBridge/MessageQueue.js +2 -1
  26. package/Libraries/BatchedBridge/NativeModules.d.ts +1 -1
  27. package/Libraries/BatchedBridge/NativeModules.js +1 -0
  28. package/Libraries/Blob/Blob.js +4 -0
  29. package/Libraries/Blob/FileReader.js +30 -2
  30. package/Libraries/Blob/URL.js +3 -1
  31. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +2 -2
  32. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -3
  33. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +2 -3
  34. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +6 -4
  35. package/Libraries/Components/Button.js +3 -2
  36. package/Libraries/Components/Button.win32.js +451 -0
  37. package/Libraries/Components/Clipboard/Clipboard.js +1 -1
  38. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
  39. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +1 -0
  40. package/Libraries/Components/Pressable/Pressable.d.ts +1 -1
  41. package/Libraries/Components/Pressable/Pressable.js +1 -1
  42. package/Libraries/Components/RefreshControl/RefreshControl.js +1 -0
  43. package/Libraries/Components/SafeAreaView/SafeAreaView.js +1 -2
  44. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +1 -2
  45. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +12 -6
  46. package/Libraries/Components/ScrollView/ScrollView.d.ts +2 -2
  47. package/Libraries/Components/ScrollView/ScrollView.js +149 -91
  48. package/Libraries/Components/ScrollView/ScrollView.win32.js +1939 -0
  49. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -6
  50. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -7
  51. package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +1 -1
  52. package/Libraries/Components/StatusBar/StatusBar.js +3 -0
  53. package/Libraries/Components/Switch/Switch.js +3 -1
  54. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +21 -11
  55. package/Libraries/Components/TextInput/InputAccessoryView.d.ts +1 -1
  56. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +11 -5
  57. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +51 -0
  58. package/Libraries/Components/TextInput/TextInput.Types.win32.js +3 -0
  59. package/Libraries/Components/TextInput/TextInput.Types.win32.js.map +1 -0
  60. package/Libraries/Components/TextInput/TextInput.d.ts +15 -5
  61. package/Libraries/Components/TextInput/TextInput.flow.js +1 -1
  62. package/Libraries/Components/TextInput/TextInput.js +130 -103
  63. package/Libraries/Components/TextInput/TextInput.win32.js +202 -890
  64. package/Libraries/Components/Touchable/Touchable.d.ts +1 -1
  65. package/Libraries/Components/Touchable/Touchable.flow.js +30 -4
  66. package/Libraries/Components/Touchable/Touchable.js +6 -3
  67. package/Libraries/Components/Touchable/Touchable.win32.js +6 -3
  68. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  69. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
  70. package/Libraries/Components/Touchable/TouchableOpacity.js +3 -0
  71. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  72. package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +1 -1
  73. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
  74. package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +179 -0
  75. package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlayNativeComponent.js +43 -0
  76. package/Libraries/Components/View/ReactNativeStyleAttributes.js +26 -0
  77. package/Libraries/Components/View/View.js +35 -16
  78. package/Libraries/Components/View/View.win32.js +38 -16
  79. package/Libraries/Components/View/ViewAccessibility.d.ts +6 -6
  80. package/Libraries/Components/View/ViewAccessibility.js +10 -1
  81. package/Libraries/Components/View/ViewAccessibility.win32.d.ts +5 -5
  82. package/Libraries/Components/View/ViewNativeComponent.js +32 -8
  83. package/Libraries/Components/View/ViewPropTypes.d.ts +1 -1
  84. package/Libraries/Components/View/ViewPropTypes.js +1 -1
  85. package/Libraries/Components/View/ViewPropTypes.win32.d.ts +1 -1
  86. package/Libraries/Components/View/ViewPropTypes.win32.js +1 -1
  87. package/Libraries/Components/View/ViewWin32.js +2 -35
  88. package/Libraries/Core/Devtools/openFileInEditor.js +1 -0
  89. package/Libraries/Core/Devtools/openURLInBrowser.js +1 -0
  90. package/Libraries/Core/Devtools/parseErrorStack.js +2 -2
  91. package/Libraries/Core/Devtools/parseHermesStack.js +54 -34
  92. package/Libraries/Core/ExceptionsManager.js +2 -2
  93. package/Libraries/Core/InitializeCore.js +2 -1
  94. package/Libraries/Core/ReactNativeVersion.js +3 -3
  95. package/Libraries/Core/ReactNativeVersionCheck.js +4 -8
  96. package/Libraries/Core/ReactNativeVersionCheck.win32.js +4 -8
  97. package/Libraries/Core/Timers/JSTimers.js +1 -1
  98. package/Libraries/Core/Timers/immediateShim.js +1 -0
  99. package/Libraries/Core/Timers/queueMicrotask.js +1 -1
  100. package/Libraries/Core/setUpAlert.js +1 -1
  101. package/Libraries/Core/setUpDOM.js +18 -0
  102. package/Libraries/Core/setUpDeveloperTools.js +1 -1
  103. package/Libraries/Core/setUpGlobals.js +5 -2
  104. package/Libraries/Core/setUpNavigator.js +6 -5
  105. package/Libraries/Core/setUpPerformance.js +23 -13
  106. package/Libraries/Core/setUpReactDevTools.js +2 -0
  107. package/Libraries/Core/setUpSegmentFetcher.js +0 -41
  108. package/Libraries/Core/setUpTimers.js +2 -2
  109. package/Libraries/DOM/Geometry/DOMRect.js +82 -0
  110. package/Libraries/DOM/Geometry/DOMRectReadOnly.js +188 -0
  111. package/Libraries/DOM/Nodes/ReactNativeElement.js +75 -0
  112. package/Libraries/DOM/Nodes/ReadOnlyElement.js +89 -0
  113. package/Libraries/DOM/Nodes/ReadOnlyNode.js +167 -0
  114. package/Libraries/DOM/OldStyleCollections/ArrayLikeUtils.js +46 -0
  115. package/Libraries/DOM/OldStyleCollections/DOMRectList.js +76 -0
  116. package/Libraries/DOM/OldStyleCollections/HTMLCollection.js +82 -0
  117. package/Libraries/DOM/OldStyleCollections/NodeList.js +104 -0
  118. package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +35 -0
  119. package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +20 -0
  120. package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +49 -0
  121. package/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js +35 -0
  122. package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +24 -0
  123. package/Libraries/EventEmitter/NativeEventEmitter.d.ts +1 -2
  124. package/Libraries/EventEmitter/RCTDeviceEventEmitter.d.ts +1 -2
  125. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +9 -1
  126. package/Libraries/Events/EventPolyfill.js +1 -1
  127. package/Libraries/Image/AssetRegistry.js +1 -1
  128. package/Libraries/Image/AssetSourceResolver.js +3 -3
  129. package/Libraries/Image/Image.android.js +4 -1
  130. package/Libraries/Image/Image.d.ts +63 -2
  131. package/Libraries/Image/Image.ios.js +3 -0
  132. package/Libraries/Image/Image.win32.js +3 -0
  133. package/Libraries/Image/ImageBackground.js +1 -0
  134. package/Libraries/Image/ImageProps.js +1 -1
  135. package/Libraries/Image/ImageViewNativeComponent.js +4 -4
  136. package/Libraries/Image/RelativeImageStub.js +1 -1
  137. package/Libraries/Image/TextInlineImageNativeComponent.js +1 -1
  138. package/Libraries/Image/resolveAssetSource.js +1 -1
  139. package/Libraries/Inspector/DevtoolsOverlay.js +26 -19
  140. package/Libraries/Inspector/ElementBox.js +4 -1
  141. package/Libraries/Inspector/Inspector.js +5 -6
  142. package/Libraries/Inspector/Inspector.win32.js +7 -6
  143. package/Libraries/Inspector/InspectorOverlay.js +3 -3
  144. package/Libraries/Inspector/InspectorOverlay.win32.js +2 -1
  145. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  146. package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -1
  147. package/Libraries/Interaction/PanResponder.js +5 -6
  148. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -1
  149. package/Libraries/Linking/Linking.js +1 -4
  150. package/Libraries/Lists/FillRateHelper.js +4 -238
  151. package/Libraries/Lists/FlatList.d.ts +15 -22
  152. package/Libraries/Lists/FlatList.js +9 -6
  153. package/Libraries/Lists/SectionList.d.ts +10 -6
  154. package/Libraries/Lists/SectionList.js +5 -3
  155. package/Libraries/Lists/SectionListModern.js +3 -3
  156. package/Libraries/Lists/ViewabilityHelper.js +8 -344
  157. package/Libraries/Lists/VirtualizeUtils.js +4 -244
  158. package/Libraries/Lists/VirtualizedList.js +10 -1867
  159. package/Libraries/Lists/VirtualizedListContext.js +6 -104
  160. package/Libraries/Lists/VirtualizedSectionList.js +9 -602
  161. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +1 -0
  162. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
  163. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  164. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  165. package/Libraries/LogBox/LogBox.js +1 -1
  166. package/Libraries/LogBox/UI/LogBoxInspector.js +1 -3
  167. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +168 -0
  168. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +3 -0
  169. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +193 -0
  170. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -0
  171. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -2
  172. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.win32.js +7 -3
  173. package/Libraries/LogBox/UI/LogBoxMessage.js +87 -5
  174. package/Libraries/LogBox/UI/LogBoxNotification.js +5 -7
  175. package/Libraries/Modal/Modal.js +2 -2
  176. package/Libraries/NativeComponent/BaseViewConfig.android.js +32 -12
  177. package/Libraries/NativeComponent/BaseViewConfig.ios.js +43 -19
  178. package/Libraries/NativeComponent/BaseViewConfig.win32.js +43 -19
  179. package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +4 -1
  180. package/Libraries/NativeComponent/ViewConfig.js +1 -0
  181. package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -4
  182. package/Libraries/Network/RCTNetworking.android.js +2 -2
  183. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  184. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  185. package/Libraries/Network/XMLHttpRequest.js +1 -1
  186. package/Libraries/Pressability/Pressability.js +10 -4
  187. package/Libraries/Pressability/Pressability.win32.js +9 -3
  188. package/Libraries/ReactNative/AppContainer.js +7 -1
  189. package/Libraries/ReactNative/AppRegistry.d.ts +1 -1
  190. package/Libraries/ReactNative/AppRegistry.js +10 -13
  191. package/Libraries/ReactNative/FabricUIManager.js +24 -8
  192. package/Libraries/ReactNative/NativeUIManager.js +5 -5
  193. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +10 -10
  194. package/Libraries/ReactNative/UIManager.js +168 -1
  195. package/Libraries/ReactNative/getCachedComponentWithDebugName.js +5 -5
  196. package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
  197. package/Libraries/ReactNative/requireNativeComponent.d.ts +1 -1
  198. package/Libraries/ReactNative/requireNativeComponent.js +1 -1
  199. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
  200. package/Libraries/Renderer/implementations/ReactFabric-dev.js +26 -3
  201. package/Libraries/Renderer/implementations/ReactFabric-prod.js +13 -1
  202. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +13 -1
  203. package/Libraries/Renderer/public/ReactFabricPublicInstanceUtils.js +38 -0
  204. package/Libraries/Renderer/shims/ReactNativeTypes.js +6 -6
  205. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +7 -7
  206. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  207. package/Libraries/Share/Share.js +1 -1
  208. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
  209. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  210. package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
  211. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +115 -76
  212. package/Libraries/StyleSheet/StyleSheetTypes.js +188 -33
  213. package/Libraries/StyleSheet/flattenStyle.js +2 -0
  214. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  215. package/Libraries/StyleSheet/processColor.js +1 -1
  216. package/Libraries/Text/Text.d.ts +12 -2
  217. package/Libraries/Text/Text.js +50 -41
  218. package/Libraries/Text/TextProps.js +3 -4
  219. package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
  220. package/Libraries/Types/CodegenTypes.js +1 -0
  221. package/Libraries/UTFSequence.js +3 -1
  222. package/Libraries/Utilities/Appearance.d.ts +10 -0
  223. package/Libraries/Utilities/Appearance.js +13 -0
  224. package/Libraries/Utilities/Dimensions.js +1 -1
  225. package/Libraries/Utilities/Dimensions.win32.js +1 -1
  226. package/Libraries/Utilities/GlobalPerformanceLogger.js +12 -1
  227. package/Libraries/Utilities/HMRClient.js +16 -10
  228. package/Libraries/Utilities/{createPerformanceLogger.d.ts → IPerformanceLogger.d.ts} +4 -4
  229. package/Libraries/Utilities/IPerformanceLogger.js +49 -0
  230. package/Libraries/Utilities/LoadingView.android.js +28 -11
  231. package/Libraries/Utilities/NativeAppearance.js +1 -0
  232. package/Libraries/Utilities/NativePlatformConstantsWin.js +1 -1
  233. package/Libraries/Utilities/PixelRatio.js +2 -2
  234. package/Libraries/Utilities/Platform.win32.js +1 -1
  235. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  236. package/Libraries/Utilities/__mocks__/PixelRatio.js +1 -1
  237. package/Libraries/Utilities/codegenNativeCommands.js +2 -0
  238. package/Libraries/Utilities/createPerformanceLogger.js +55 -43
  239. package/Libraries/Utilities/stringifySafe.js +2 -7
  240. package/Libraries/Utilities/useColorScheme.win32.js +26 -0
  241. package/Libraries/Utilities/useWindowDimensions.js +3 -3
  242. package/Libraries/WebPerformance/EventCounts.js +78 -0
  243. package/Libraries/WebPerformance/MemoryInfo.js +54 -0
  244. package/Libraries/WebPerformance/NativePerformance.js +38 -0
  245. package/Libraries/WebPerformance/NativePerformanceObserver.js +22 -7
  246. package/Libraries/WebPerformance/Performance.js +312 -0
  247. package/Libraries/WebPerformance/PerformanceEntry.js +45 -0
  248. package/Libraries/WebPerformance/PerformanceEventTiming.js +38 -0
  249. package/Libraries/WebPerformance/PerformanceObserver.js +196 -101
  250. package/Libraries/WebPerformance/RawPerformanceEntry.js +87 -0
  251. package/Libraries/WebPerformance/ReactNativeStartupTiming.js +65 -0
  252. package/Libraries/WebPerformance/__mocks__/NativePerformance.js +65 -0
  253. package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +101 -0
  254. package/Libraries/YellowBox/YellowBoxDeprecated.js +1 -1
  255. package/Libraries/vendor/core/ErrorUtils.js +1 -1
  256. package/Libraries/vendor/emitter/EventEmitter.d.ts +2 -2
  257. package/Libraries/vendor/emitter/EventEmitter.js +9 -1
  258. package/flow/global.js +29 -4
  259. package/flow/jest.js +258 -164
  260. package/flow/use-sync-external-store.js +1 -0
  261. package/index.js +56 -42
  262. package/index.win32.js +56 -42
  263. package/interface.js +1 -1
  264. package/jest/local-setup.js +33 -0
  265. package/jest/mockComponent.js +4 -2
  266. package/jest/mockNativeComponent.js +1 -1
  267. package/jest/mockScrollView.js +2 -1
  268. package/jest/react-native-env.js +1 -3
  269. package/jest/setup.js +11 -8
  270. package/overrides.json +122 -85
  271. package/package.json +40 -30
  272. package/rn-get-polyfills.js +1 -1
  273. package/src/Libraries/Components/TextInput/TextInput.Types.win32.ts +68 -0
  274. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +3 -3
  275. package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +5 -5
  276. package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +1 -1
  277. package/types/index.d.ts +2 -6
  278. package/types/modules/Codegen.d.ts +4 -4
  279. package/types/modules/globals.d.ts +27 -25
  280. package/types/public/DeprecatedPropertiesAlias.d.ts +0 -20
  281. package/types/public/ReactNativeRenderer.d.ts +2 -7
  282. package/Libraries/Animated/createAnimatedComponentInjection.js +0 -48
  283. package/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js +0 -48
  284. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.flow.js +0 -208
  285. package/Libraries/Components/ActivityIndicator/ActivityIndicator.flow.js +0 -58
  286. package/Libraries/Components/DatePicker/DatePickerIOS.android.js +0 -47
  287. package/Libraries/Components/DatePicker/DatePickerIOS.d.ts +0 -92
  288. package/Libraries/Components/DatePicker/DatePickerIOS.flow.android.js +0 -14
  289. package/Libraries/Components/DatePicker/DatePickerIOS.flow.ios.js +0 -113
  290. package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +0 -242
  291. package/Libraries/Components/DatePicker/DatePickerIOS.win32.js +0 -47
  292. package/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +0 -60
  293. package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +0 -26
  294. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +0 -45
  295. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.d.ts +0 -62
  296. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +0 -75
  297. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.win32.js +0 -45
  298. package/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +0 -33
  299. package/Libraries/Components/SafeAreaView/SafeAreaView.flow.js +0 -19
  300. package/Libraries/Components/Slider/Slider.d.ts +0 -132
  301. package/Libraries/Components/Slider/Slider.js +0 -282
  302. package/Libraries/Components/Slider/SliderNativeComponent.js +0 -56
  303. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +0 -23
  304. package/Libraries/Interaction/Batchinator.js +0 -76
  305. package/Libraries/Interaction/BridgeSpyStallHandler.js +0 -63
  306. package/Libraries/Interaction/InteractionStallDebugger.js +0 -23
  307. package/Libraries/Interaction/PanResponder.flow.js +0 -257
  308. package/Libraries/Lists/CellRenderMask.js +0 -155
  309. package/Libraries/Lists/ChildListCollection.js +0 -72
  310. package/Libraries/Lists/StateSafePureComponent.js +0 -85
  311. package/Libraries/Lists/VirtualizedList.d.ts +0 -347
  312. package/Libraries/Lists/VirtualizedListCellRenderer.js +0 -259
  313. package/Libraries/Lists/VirtualizedListProps.js +0 -279
  314. package/Libraries/Performance/PureComponentDebug.js +0 -74
  315. package/Libraries/Reliability/UserFlow.js +0 -158
  316. package/Libraries/Renderer/implementations/ReactNativeRenderer.d.ts +0 -149
  317. package/Libraries/Renderer/shims/ReactNativeTypes.d.ts +0 -141
  318. package/Libraries/Utilities/MatrixMath.js +0 -748
  319. package/Libraries/Utilities/buildStyleInterpolator.js +0 -209
  320. package/Libraries/Utilities/clamp.js +0 -23
  321. package/Libraries/Utilities/deprecatedPropType.js +0 -36
  322. package/Libraries/Utilities/groupByEveryN.js +0 -51
  323. package/Libraries/Utilities/mergeIntoFast.js +0 -26
  324. package/Libraries/Utilities/setAndForwardRef.js +0 -71
  325. package/Libraries/Utilities/truncate.js +0 -51
  326. package/flow/JSITimerInternalType.js +0 -30
@@ -11,6 +11,9 @@
11
11
  import type {RootTag} from '../Types/RootTagTypes';
12
12
  import type {Spec} from './NativeUIManager';
13
13
 
14
+ import {getFabricUIManager} from './FabricUIManager';
15
+ import nullthrows from 'nullthrows';
16
+
14
17
  export interface UIManagerJSInterface extends Spec {
15
18
  +getViewManagerConfig: (viewManagerName: string) => Object;
16
19
  +hasViewManagerConfig: (viewManagerName: string) => boolean;
@@ -31,9 +34,173 @@ export interface UIManagerJSInterface extends Spec {
31
34
  ) => void;
32
35
  }
33
36
 
34
- const UIManager: UIManagerJSInterface =
37
+ function isFabricReactTag(reactTag: number): boolean {
38
+ // React reserves even numbers for Fabric.
39
+ return reactTag % 2 === 0;
40
+ }
41
+
42
+ const UIManagerImpl: UIManagerJSInterface =
35
43
  global.RN$Bridgeless === true
36
44
  ? require('./BridgelessUIManager')
37
45
  : require('./PaperUIManager');
38
46
 
47
+ // $FlowFixMe[cannot-spread-interface]
48
+ const UIManager = {
49
+ ...UIManagerImpl,
50
+ measure(
51
+ reactTag: number,
52
+ callback: (
53
+ left: number,
54
+ top: number,
55
+ width: number,
56
+ height: number,
57
+ pageX: number,
58
+ pageY: number,
59
+ ) => void,
60
+ ): void {
61
+ if (isFabricReactTag(reactTag)) {
62
+ const FabricUIManager = nullthrows(getFabricUIManager());
63
+ const shadowNode =
64
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
65
+ if (shadowNode) {
66
+ FabricUIManager.measure(shadowNode, callback);
67
+ } else {
68
+ console.warn(`measure cannot find view with tag #${reactTag}`);
69
+ // $FlowFixMe[incompatible-call]
70
+ callback();
71
+ }
72
+ } else {
73
+ // Paper
74
+ UIManagerImpl.measure(reactTag, callback);
75
+ }
76
+ },
77
+
78
+ measureInWindow(
79
+ reactTag: number,
80
+ callback: (
81
+ left: number,
82
+ top: number,
83
+ width: number,
84
+ height: number,
85
+ ) => void,
86
+ ): void {
87
+ if (isFabricReactTag(reactTag)) {
88
+ const FabricUIManager = nullthrows(getFabricUIManager());
89
+ const shadowNode =
90
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
91
+ if (shadowNode) {
92
+ FabricUIManager.measureInWindow(shadowNode, callback);
93
+ } else {
94
+ console.warn(`measure cannot find view with tag #${reactTag}`);
95
+ // $FlowFixMe[incompatible-call]
96
+ callback();
97
+ }
98
+ } else {
99
+ // Paper
100
+ UIManagerImpl.measureInWindow(reactTag, callback);
101
+ }
102
+ },
103
+
104
+ measureLayout(
105
+ reactTag: number,
106
+ ancestorReactTag: number,
107
+ errorCallback: (error: Object) => void,
108
+ callback: (
109
+ left: number,
110
+ top: number,
111
+ width: number,
112
+ height: number,
113
+ ) => void,
114
+ ): void {
115
+ if (isFabricReactTag(reactTag)) {
116
+ const FabricUIManager = nullthrows(getFabricUIManager());
117
+ const shadowNode =
118
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
119
+ const ancestorShadowNode =
120
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(ancestorReactTag);
121
+
122
+ if (!shadowNode || !ancestorShadowNode) {
123
+ return;
124
+ }
125
+
126
+ FabricUIManager.measureLayout(
127
+ shadowNode,
128
+ ancestorShadowNode,
129
+ errorCallback,
130
+ callback,
131
+ );
132
+ } else {
133
+ // Paper
134
+ UIManagerImpl.measureLayout(
135
+ reactTag,
136
+ ancestorReactTag,
137
+ errorCallback,
138
+ callback,
139
+ );
140
+ }
141
+ },
142
+
143
+ measureLayoutRelativeToParent(
144
+ reactTag: number,
145
+ errorCallback: (error: Object) => void,
146
+ callback: (
147
+ left: number,
148
+ top: number,
149
+ width: number,
150
+ height: number,
151
+ ) => void,
152
+ ): void {
153
+ if (isFabricReactTag(reactTag)) {
154
+ console.warn(
155
+ 'RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450',
156
+ );
157
+ const FabricUIManager = nullthrows(getFabricUIManager());
158
+ const shadowNode =
159
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
160
+ if (shadowNode) {
161
+ FabricUIManager.measure(
162
+ shadowNode,
163
+ (left, top, width, height, pageX, pageY) => {
164
+ callback(left, top, width, height);
165
+ },
166
+ );
167
+ }
168
+ } else {
169
+ // Paper
170
+ UIManagerImpl.measureLayoutRelativeToParent(
171
+ reactTag,
172
+ errorCallback,
173
+ callback,
174
+ );
175
+ }
176
+ },
177
+
178
+ dispatchViewManagerCommand(
179
+ reactTag: number,
180
+ commandName: number | string,
181
+ commandArgs: any[],
182
+ ) {
183
+ if (isFabricReactTag(reactTag)) {
184
+ const FabricUIManager = nullthrows(getFabricUIManager());
185
+ const shadowNode =
186
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
187
+ if (shadowNode) {
188
+ // Transform the accidental CommandID into a CommandName which is the stringified number.
189
+ // The interop layer knows how to convert this number into the right method name.
190
+ // Stringify a string is a no-op, so it's safe.
191
+ commandName = `${commandName}`;
192
+ FabricUIManager.dispatchCommand(shadowNode, commandName, commandArgs);
193
+ }
194
+ } else {
195
+ UIManagerImpl.dispatchViewManagerCommand(
196
+ reactTag,
197
+ // We have some legacy components that are actually already using strings. ¯\_(ツ)_/¯
198
+ // $FlowFixMe[incompatible-call]
199
+ commandName,
200
+ commandArgs,
201
+ );
202
+ }
203
+ },
204
+ };
205
+
39
206
  module.exports = UIManager;
@@ -8,9 +8,11 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {AbstractComponent, Node} from 'react';
11
+ import type {AbstractComponent} from 'react';
12
12
 
13
- type NoopComponent = AbstractComponent<{children: Node}>;
13
+ import * as React from 'react';
14
+
15
+ type NoopComponent = AbstractComponent<{children: React.Node}>;
14
16
 
15
17
  const cache: Map<
16
18
  string, // displayName
@@ -23,9 +25,7 @@ export default function getCachedComponentWithDisplayName(
23
25
  let ComponentWithDisplayName = cache.get(displayName);
24
26
 
25
27
  if (!ComponentWithDisplayName) {
26
- ComponentWithDisplayName = ({
27
- children,
28
- }: $TEMPORARY$object<{children: Node}>) => children;
28
+ ComponentWithDisplayName = ({children}: {children: React.Node}) => children;
29
29
  // $FlowFixMe[prop-missing]
30
30
  ComponentWithDisplayName.displayName = displayName;
31
31
  cache.set(displayName, ComponentWithDisplayName);
@@ -12,7 +12,7 @@
12
12
 
13
13
  const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
14
14
  const resolveAssetSource = require('../Image/resolveAssetSource');
15
- const processColor = require('../StyleSheet/processColor');
15
+ const processColor = require('../StyleSheet/processColor').default;
16
16
  const processColorArray = require('../StyleSheet/processColorArray');
17
17
  const insetsDiffer = require('../Utilities/differ/insetsDiffer');
18
18
  const matricesDiffer = require('../Utilities/differ/matricesDiffer');
@@ -7,7 +7,7 @@
7
7
  * @format
8
8
  */
9
9
 
10
- import {HostComponent} from '../../types/public//ReactNativeTypes';
10
+ import {HostComponent} from '../../types/public/ReactNativeTypes';
11
11
 
12
12
  /**
13
13
  * Creates values that can be used like React components which represent native
@@ -29,4 +29,4 @@ const requireNativeComponent = <T>(uiViewClassName: string): HostComponent<T> =>
29
29
  getNativeComponentAttributes(uiViewClassName),
30
30
  ): any): HostComponent<T>);
31
31
 
32
- module.exports = requireNativeComponent;
32
+ export default requireNativeComponent;
@@ -57,6 +57,7 @@ module.exports = {
57
57
  return require('../Utilities/deepFreezeAndThrowOnMutationInDev');
58
58
  },
59
59
  get flattenStyle(): flattenStyle<DangerouslyImpreciseStyleProp> {
60
+ // $FlowFixMe[underconstrained-implicit-instantiation]
60
61
  return require('../StyleSheet/flattenStyle');
61
62
  },
62
63
  get ReactFiberErrorDialog(): ReactFiberErrorDialog {
@@ -3419,6 +3419,23 @@ function mountSafeCallback_NOT_REALLY_SAFE(context, callback) {
3419
3419
  return callback.apply(context, arguments);
3420
3420
  };
3421
3421
  }
3422
+ function warnForStyleProps(props, validAttributes) {
3423
+ {
3424
+ for (var key in validAttributes.style) {
3425
+ if (!(validAttributes[key] || props[key] === undefined)) {
3426
+ error(
3427
+ "You are setting the style `{ %s" +
3428
+ ": ... }` as a prop. You " +
3429
+ "should nest it in a style object. " +
3430
+ "E.g. `{ style: { %s" +
3431
+ ": ... } }`",
3432
+ key,
3433
+ key
3434
+ );
3435
+ }
3436
+ }
3437
+ }
3438
+ }
3422
3439
 
3423
3440
  // Modules provided by RN:
3424
3441
  var emptyObject = {};
@@ -5100,7 +5117,8 @@ var _nativeFabricUIManage = nativeFabricUIManager,
5100
5117
  FabricDefaultPriority = _nativeFabricUIManage.unstable_DefaultEventPriority,
5101
5118
  FabricDiscretePriority = _nativeFabricUIManage.unstable_DiscreteEventPriority,
5102
5119
  fabricGetCurrentEventPriority =
5103
- _nativeFabricUIManage.unstable_getCurrentEventPriority;
5120
+ _nativeFabricUIManage.unstable_getCurrentEventPriority,
5121
+ _setNativeProps = _nativeFabricUIManage.setNativeProps;
5104
5122
  var getViewConfigForType =
5105
5123
  ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get; // Counter for uniquely identifying views.
5106
5124
  // % 10 === 1 means it is a rootTag.
@@ -5199,10 +5217,15 @@ var ReactFabricHostComponent = /*#__PURE__*/ (function() {
5199
5217
 
5200
5218
  _proto.setNativeProps = function setNativeProps(nativeProps) {
5201
5219
  {
5202
- error("Warning: setNativeProps is not currently supported in Fabric");
5220
+ warnForStyleProps(nativeProps, this.viewConfig.validAttributes);
5203
5221
  }
5204
5222
 
5205
- return;
5223
+ var updatePayload = create(nativeProps, this.viewConfig.validAttributes);
5224
+ var stateNode = this._internalInstanceHandle.stateNode;
5225
+
5226
+ if (stateNode != null && updatePayload != null) {
5227
+ _setNativeProps(stateNode.node, updatePayload);
5228
+ }
5206
5229
  }; // This API (addEventListener, removeEventListener) attempts to adhere to the
5207
5230
  // w3 Level2 Events spec as much as possible, treating HostComponent as a DOM node.
5208
5231
  //
@@ -1922,6 +1922,7 @@ var _nativeFabricUIManage = nativeFabricUIManager,
1922
1922
  FabricDiscretePriority = _nativeFabricUIManage.unstable_DiscreteEventPriority,
1923
1923
  fabricGetCurrentEventPriority =
1924
1924
  _nativeFabricUIManage.unstable_getCurrentEventPriority,
1925
+ _setNativeProps = _nativeFabricUIManage.setNativeProps,
1925
1926
  getViewConfigForType =
1926
1927
  ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get,
1927
1928
  nextReactTag = 2;
@@ -1979,7 +1980,18 @@ var ReactFabricHostComponent = (function() {
1979
1980
  );
1980
1981
  }
1981
1982
  };
1982
- _proto.setNativeProps = function() {};
1983
+ _proto.setNativeProps = function(nativeProps) {
1984
+ nativeProps = diffProperties(
1985
+ null,
1986
+ emptyObject,
1987
+ nativeProps,
1988
+ this.viewConfig.validAttributes
1989
+ );
1990
+ var stateNode = this._internalInstanceHandle.stateNode;
1991
+ null != stateNode &&
1992
+ null != nativeProps &&
1993
+ _setNativeProps(stateNode.node, nativeProps);
1994
+ };
1983
1995
  _proto.addEventListener_unstable = function(eventType, listener, options) {
1984
1996
  if ("string" !== typeof eventType)
1985
1997
  throw Error("addEventListener_unstable eventType must be a string");
@@ -1981,6 +1981,7 @@ var _nativeFabricUIManage = nativeFabricUIManager,
1981
1981
  FabricDiscretePriority = _nativeFabricUIManage.unstable_DiscreteEventPriority,
1982
1982
  fabricGetCurrentEventPriority =
1983
1983
  _nativeFabricUIManage.unstable_getCurrentEventPriority,
1984
+ _setNativeProps = _nativeFabricUIManage.setNativeProps,
1984
1985
  getViewConfigForType =
1985
1986
  ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get,
1986
1987
  nextReactTag = 2;
@@ -2038,7 +2039,18 @@ var ReactFabricHostComponent = (function() {
2038
2039
  );
2039
2040
  }
2040
2041
  };
2041
- _proto.setNativeProps = function() {};
2042
+ _proto.setNativeProps = function(nativeProps) {
2043
+ nativeProps = diffProperties(
2044
+ null,
2045
+ emptyObject,
2046
+ nativeProps,
2047
+ this.viewConfig.validAttributes
2048
+ );
2049
+ var stateNode = this._internalInstanceHandle.stateNode;
2050
+ null != stateNode &&
2051
+ null != nativeProps &&
2052
+ _setNativeProps(stateNode.node, nativeProps);
2053
+ };
2042
2054
  _proto.addEventListener_unstable = function(eventType, listener, options) {
2043
2055
  if ("string" !== typeof eventType)
2044
2056
  throw Error("addEventListener_unstable eventType must be a string");
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ * @flow strict
9
+ */
10
+
11
+ /**
12
+ * IMPORTANT!!
13
+ *
14
+ * This module cannot import `ReactFabric` (directly or indirectly)
15
+ * because it can be used by apps only using the legacy renderer.
16
+ * In that case `nativeFabricUIManager` isn't defined and `ReactFabric` throws.
17
+ */
18
+
19
+ export function isPublicInstance(maybeInstance: mixed): boolean {
20
+ return (
21
+ maybeInstance != null &&
22
+ // TODO: implement a better check when the instance is defined in the React Native repository.
23
+ (maybeInstance.__nativeTag != null ||
24
+ // TODO: remove this check when syncing the new version of the renderer from React to React Native.
25
+ isLegacyFabricInstance(maybeInstance))
26
+ );
27
+ }
28
+
29
+ function isLegacyFabricInstance(maybeInstance: mixed): boolean {
30
+ /* eslint-disable dot-notation */
31
+ return (
32
+ maybeInstance != null &&
33
+ // $FlowExpectedError[incompatible-use]
34
+ maybeInstance['_internalInstanceHandle'] != null &&
35
+ maybeInstance['_internalInstanceHandle'].stateNode != null &&
36
+ maybeInstance['_internalInstanceHandle'].stateNode.canonical != null
37
+ );
38
+ }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @flow strict
9
- * @generated SignedSource<<d9fed8e0aacc3113ceaf7d8e266300c6>>
9
+ * @generated SignedSource<<265b342f0d29323bebb711ba0bc882ec>>
10
10
  *
11
11
  * This file was sync'd from the facebook/react repository.
12
12
  */
@@ -51,7 +51,7 @@ export type AttributeConfiguration = $ReadOnly<{
51
51
  [propName: string]: AnyAttributeType,
52
52
  style: $ReadOnly<{
53
53
  [propName: string]: AnyAttributeType,
54
- ...,
54
+ ...
55
55
  }>,
56
56
  ...
57
57
  }>;
@@ -60,7 +60,7 @@ export type PartialAttributeConfiguration = $ReadOnly<{
60
60
  [propName: string]: AnyAttributeType,
61
61
  style?: $ReadOnly<{
62
62
  [propName: string]: AnyAttributeType,
63
- ...,
63
+ ...
64
64
  }>,
65
65
  ...
66
66
  }>;
@@ -79,13 +79,13 @@ export type ViewConfig = $ReadOnly<{
79
79
  skipBubbling?: ?boolean,
80
80
  }>,
81
81
  }>,
82
- ...,
82
+ ...
83
83
  }>,
84
84
  directEventTypes?: $ReadOnly<{
85
85
  [eventName: string]: $ReadOnly<{
86
86
  registrationName: string,
87
87
  }>,
88
- ...,
88
+ ...
89
89
  }>,
90
90
  uiViewClassName: string,
91
91
  validAttributes: AttributeConfiguration,
@@ -122,7 +122,7 @@ type SecretInternalsType = {
122
122
 
123
123
  type InspectorDataProps = $ReadOnly<{
124
124
  [propName: string]: string,
125
- ...,
125
+ ...
126
126
  }>;
127
127
 
128
128
  type InspectorDataSource = $ReadOnly<{
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @flow strict-local
9
- * @generated SignedSource<<bda490a01513d4526005c1e029d5ce93>>
9
+ * @generated SignedSource<<47ba85d7f43c9b591d6804827322d00e>>
10
10
  *
11
11
  * This file was sync'd from the facebook/react repository.
12
12
  */
@@ -25,20 +25,20 @@ const customBubblingEventTypes: {
25
25
  skipBubbling?: ?boolean,
26
26
  }>,
27
27
  }>,
28
- ...,
28
+ ...
29
29
  } = {};
30
30
  const customDirectEventTypes: {
31
31
  [eventName: string]: $ReadOnly<{
32
32
  registrationName: string,
33
33
  }>,
34
- ...,
34
+ ...
35
35
  } = {};
36
36
 
37
37
  exports.customBubblingEventTypes = customBubblingEventTypes;
38
38
  exports.customDirectEventTypes = customDirectEventTypes;
39
39
 
40
- const viewConfigCallbacks = new Map();
41
- const viewConfigs = new Map();
40
+ const viewConfigCallbacks = new Map<string, ?() => ViewConfig>();
41
+ const viewConfigs = new Map<string, ViewConfig>();
42
42
 
43
43
  function processEventTypes(viewConfig: ViewConfig): void {
44
44
  const {bubblingEventTypes, directEventTypes} = viewConfig;
@@ -78,7 +78,7 @@ function processEventTypes(viewConfig: ViewConfig): void {
78
78
  * A callback is provided to load the view config from UIManager.
79
79
  * The callback is deferred until the view is actually rendered.
80
80
  */
81
- exports.register = function(name: string, callback: () => ViewConfig): string {
81
+ exports.register = function (name: string, callback: () => ViewConfig): string {
82
82
  invariant(
83
83
  !viewConfigCallbacks.has(name),
84
84
  'Tried to register two views with the same name %s',
@@ -99,7 +99,7 @@ exports.register = function(name: string, callback: () => ViewConfig): string {
99
99
  * If this is the first time the view has been used,
100
100
  * This configuration will be lazy-loaded from UIManager.
101
101
  */
102
- exports.get = function(name: string): ViewConfig {
102
+ exports.get = function (name: string): ViewConfig {
103
103
  let viewConfig;
104
104
  if (!viewConfigs.has(name)) {
105
105
  const callback = viewConfigCallbacks.get(name);
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @flow strict-local
9
- * @generated SignedSource<<7d3d4090dadea2daa09d92e5e66f6e5d>>
9
+ * @generated SignedSource<<e5e369f149ed8206141b7a3c2855bb85>>
10
10
  *
11
11
  * This file was sync'd from the facebook/react repository.
12
12
  */
@@ -26,7 +26,7 @@ const {register} = ReactNativeViewConfigRegistry;
26
26
  * @param {string} config iOS View configuration.
27
27
  * @private
28
28
  */
29
- const createReactNativeComponentClass = function(
29
+ const createReactNativeComponentClass = function (
30
30
  name: string,
31
31
  callback: () => ViewConfig,
32
32
  ): string {
@@ -11,7 +11,7 @@
11
11
  import NativeActionSheetManager from '../ActionSheetIOS/NativeActionSheetManager';
12
12
  import NativeShareModule from './NativeShareModule';
13
13
 
14
- const processColor = require('../StyleSheet/processColor');
14
+ const processColor = require('../StyleSheet/processColor').default;
15
15
  const Platform = require('../Utilities/Platform');
16
16
  const invariant = require('invariant');
17
17
 
@@ -78,7 +78,7 @@ export const processColorObject = (
78
78
  color: NativeColorValue,
79
79
  ): ?NativeColorValue => {
80
80
  if ('dynamic' in color && color.dynamic != null) {
81
- const processColor = require('./processColor');
81
+ const processColor = require('./processColor').default;
82
82
  const dynamic = color.dynamic;
83
83
  const dynamicColor: NativeColorValue = {
84
84
  dynamic: {
@@ -24,7 +24,7 @@ import type {
24
24
  } from './StyleSheetTypes';
25
25
 
26
26
  const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
27
- const PixelRatio = require('../Utilities/PixelRatio');
27
+ const PixelRatio = require('../Utilities/PixelRatio').default;
28
28
  const flatten = require('./flattenStyle');
29
29
 
30
30
  /**
@@ -24,7 +24,7 @@ import type {
24
24
  } from './StyleSheetTypes';
25
25
 
26
26
  const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
27
- const PixelRatio = require('../Utilities/PixelRatio');
27
+ const PixelRatio = require('../Utilities/PixelRatio').default;
28
28
  const Platform = require('../Utilities/Platform'); // [Win32]
29
29
  const flatten = require('./flattenStyle');
30
30