@depup/react-native 0.85.0-depup.0 → 0.86.0-depup.49

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 (767) hide show
  1. package/Libraries/Animated/AnimatedImplementation.js +6 -6
  2. package/Libraries/Animated/NativeAnimatedAllowlist.js +21 -0
  3. package/Libraries/Animated/components/AnimatedImage.js +3 -3
  4. package/Libraries/Animated/components/AnimatedText.js +3 -3
  5. package/Libraries/Animated/createAnimatedComponent.js +7 -7
  6. package/Libraries/Animated/nodes/AnimatedAddition.js +1 -1
  7. package/Libraries/Animated/nodes/AnimatedColor.js +7 -7
  8. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +1 -1
  9. package/Libraries/Animated/nodes/AnimatedDivision.js +1 -1
  10. package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -24
  11. package/Libraries/Animated/nodes/AnimatedModulo.js +1 -1
  12. package/Libraries/Animated/nodes/AnimatedMultiplication.js +1 -1
  13. package/Libraries/Animated/nodes/AnimatedStyle.js +2 -2
  14. package/Libraries/Animated/nodes/AnimatedSubtraction.js +1 -1
  15. package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
  16. package/Libraries/Animated/nodes/AnimatedValue.js +2 -2
  17. package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +4 -0
  18. package/Libraries/AppDelegate/RCTRootViewFactory.h +5 -5
  19. package/Libraries/AppDelegate/RCTRootViewFactory.mm +2 -2
  20. package/Libraries/AppState/AppState.js +1 -1
  21. package/Libraries/BatchedBridge/NativeModules.js +1 -1
  22. package/Libraries/Blob/RCTBlobCollector.h +1 -1
  23. package/Libraries/Blob/RCTBlobCollector.mm +14 -26
  24. package/Libraries/Blob/RCTBlobManager.mm +11 -3
  25. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +29 -23
  26. package/Libraries/Components/Keyboard/Keyboard.js +4 -2
  27. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +1 -1
  28. package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -27
  29. package/Libraries/Components/Pressable/Pressable.d.ts +1 -0
  30. package/Libraries/Components/Pressable/Pressable.js +2 -2
  31. package/Libraries/Components/Pressable/useAndroidRippleForView.js +7 -8
  32. package/Libraries/Components/ScrollView/ScrollView.js +3 -3
  33. package/Libraries/Components/ScrollView/ScrollViewCommands.js +2 -2
  34. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -2
  35. package/Libraries/Components/Switch/Switch.js +1 -1
  36. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +25 -1
  37. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +1 -1
  38. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +2 -2
  39. package/Libraries/Components/TextInput/TextInput.d.ts +24 -0
  40. package/Libraries/Components/TextInput/TextInput.flow.js +24 -0
  41. package/Libraries/Components/TextInput/TextInput.js +5 -5
  42. package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +5 -5
  43. package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +5 -5
  44. package/Libraries/Components/Touchable/PooledClass.js +4 -4
  45. package/Libraries/Components/Touchable/Touchable.js +1 -1
  46. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -10
  47. package/Libraries/Components/View/ReactNativeStyleAttributes.js +10 -2
  48. package/Libraries/Components/View/View.js +82 -77
  49. package/Libraries/Components/View/ViewPropTypes.js +3 -1
  50. package/Libraries/Core/Devtools/loadBundleFromServer.js +8 -0
  51. package/Libraries/Core/ExceptionsManager.js +2 -8
  52. package/Libraries/Core/InitializeCore.js +0 -13
  53. package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
  54. package/Libraries/Core/ReactNativeVersion.js +1 -1
  55. package/Libraries/Core/ReactNativeVersionCheck.js +1 -1
  56. package/Libraries/Core/Timers/JSTimers.js +2 -2
  57. package/Libraries/Core/Timers/immediateShim.js +1 -1
  58. package/Libraries/Core/setUpBatchedBridge.js +1 -1
  59. package/Libraries/Core/setUpSegmentFetcher.js +1 -1
  60. package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
  61. package/Libraries/EventEmitter/NativeEventEmitter.js +9 -5
  62. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -2
  63. package/Libraries/Image/Image.android.js +15 -35
  64. package/Libraries/Image/RCTImageLoader.mm +4 -2
  65. package/Libraries/Image/RelativeImageStub.js +2 -2
  66. package/Libraries/LayoutAnimation/LayoutAnimation.js +12 -12
  67. package/Libraries/Linking/Linking.js +1 -1
  68. package/Libraries/Lists/FlatList.js +1 -1
  69. package/Libraries/LogBox/LogBox.js +2 -2
  70. package/Libraries/LogBox/LogBoxInspectorContainer.js +24 -2
  71. package/Libraries/LogBox/LogBoxNotificationContainer.js +27 -4
  72. package/Libraries/LogBox/UI/LogBoxButton.js +47 -24
  73. package/Libraries/LogBox/UI/LogBoxInspector.js +61 -1
  74. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -0
  75. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +3 -1
  76. package/Libraries/LogBox/UI/LogBoxNotification.js +2 -0
  77. package/Libraries/Modal/Modal.js +12 -7
  78. package/Libraries/NativeAnimation/Nodes/RCTInterpolationAnimatedNode.mm +0 -2
  79. package/Libraries/NativeComponent/BaseViewConfig.android.js +15 -0
  80. package/Libraries/NativeComponent/BaseViewConfig.ios.js +17 -0
  81. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -2
  82. package/Libraries/NativeComponent/ViewConfigIgnore.js +4 -2
  83. package/Libraries/Network/RCTNetworking.android.js +1 -1
  84. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  85. package/Libraries/Network/RCTNetworking.js.flow +1 -1
  86. package/Libraries/Network/RCTNetworking.mm +1 -2
  87. package/Libraries/Network/XMLHttpRequest.js +29 -12
  88. package/Libraries/Pressability/Pressability.js +2 -2
  89. package/Libraries/ReactNative/AppContainer-dev.js +2 -3
  90. package/Libraries/ReactNative/AppContainer-prod.js +1 -2
  91. package/Libraries/ReactNative/AppContainer.js +0 -1
  92. package/Libraries/ReactNative/AppRegistry.d.ts +1 -1
  93. package/Libraries/ReactNative/AppRegistry.flow.js +1 -2
  94. package/Libraries/ReactNative/AppRegistryImpl.js +16 -16
  95. package/Libraries/ReactNative/DeprecatedPerformanceLoggerStub.js +83 -0
  96. package/Libraries/ReactNative/FabricUIManager.js +6 -0
  97. package/Libraries/{Utilities → ReactNative}/IPerformanceLogger.d.ts +8 -5
  98. package/Libraries/{Utilities/IPerformanceLogger.js → ReactNative/IPerformanceLogger.flow.js} +12 -9
  99. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +14 -14
  100. package/Libraries/ReactNative/RendererImplementation.js +26 -142
  101. package/Libraries/ReactNative/RendererProxy.js +4 -15
  102. package/Libraries/ReactNative/renderApplication.js +33 -59
  103. package/Libraries/ReactNative/requireNativeComponent.js +3 -3
  104. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -0
  105. package/Libraries/Renderer/shims/ReactNativeTypes.js +1 -31
  106. package/Libraries/Settings/Settings.ios.js +1 -1
  107. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
  108. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +3 -3
  109. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  110. package/Libraries/StyleSheet/StyleSheet.js.flow +2 -2
  111. package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
  112. package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
  113. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +6 -8
  114. package/Libraries/StyleSheet/StyleSheetTypes.js +11 -11
  115. package/Libraries/StyleSheet/flattenStyle.js +1 -1
  116. package/Libraries/StyleSheet/private/_TransformStyle.js +1 -1
  117. package/Libraries/StyleSheet/processBackgroundImage.js +19 -9
  118. package/Libraries/StyleSheet/processBackgroundSize.js +7 -12
  119. package/Libraries/StyleSheet/processBoxShadow.js +9 -47
  120. package/Libraries/StyleSheet/processFilter.js +16 -8
  121. package/Libraries/StyleSheet/processTransformOrigin.js +10 -3
  122. package/Libraries/Text/Text.js +4 -4
  123. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +16 -2
  124. package/Libraries/Text/TextNativeComponent.js +4 -4
  125. package/Libraries/TurboModule/RCTExport.js +1 -1
  126. package/Libraries/TurboModule/TurboModuleRegistry.js +3 -3
  127. package/Libraries/Types/CodegenTypes.js +7 -4
  128. package/Libraries/Types/ReactDevToolsTypes.js +1 -1
  129. package/Libraries/Utilities/BackHandler.android.js +11 -3
  130. package/Libraries/Utilities/BackHandler.d.ts +11 -1
  131. package/Libraries/Utilities/BackHandler.ios.js +3 -1
  132. package/Libraries/Utilities/BackHandler.js.flow +6 -1
  133. package/Libraries/Utilities/HMRClient.js +28 -1
  134. package/Libraries/Utilities/HardwareBackPressEvent.js +22 -0
  135. package/Libraries/Utilities/ReactNativeTestTools.js +4 -4
  136. package/Libraries/Utilities/binaryToBase64.js +1 -1
  137. package/Libraries/Utilities/codegenNativeCommands.js +2 -2
  138. package/Libraries/Utilities/codegenNativeComponent.js +4 -4
  139. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -2
  140. package/Libraries/Utilities/stringifySafe.js +1 -1
  141. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  142. package/Libraries/vendor/core/ErrorUtils.js +4 -4
  143. package/Libraries/vendor/emitter/EventEmitter.js +27 -13
  144. package/README.md +11 -10
  145. package/React/Base/RCTBundleURLProvider.h +19 -1
  146. package/React/Base/RCTBundleURLProvider.mm +82 -0
  147. package/React/Base/RCTDefines.h +1 -1
  148. package/React/Base/RCTMultipartDataTask.h +1 -1
  149. package/React/Base/RCTMultipartDataTask.m +0 -3
  150. package/React/Base/RCTRootView.h +4 -0
  151. package/React/Base/RCTRootViewDelegate.h +5 -2
  152. package/React/Base/RCTVersion.m +1 -1
  153. package/React/Base/Surface/RCTSurface.h +3 -0
  154. package/React/Base/Surface/RCTSurfaceDelegate.h +7 -3
  155. package/React/Base/Surface/RCTSurfaceRootView.mm +1 -1
  156. package/React/Base/Surface/RCTSurfaceView.mm +2 -1
  157. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +5 -0
  158. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +26 -0
  159. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h +0 -3
  160. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +3 -1
  161. package/React/CoreModules/RCTDevLoadingView.mm +17 -0
  162. package/React/CoreModules/RCTDevMenuConfigurationDecorator.h +2 -2
  163. package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
  164. package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
  165. package/React/CoreModules/RCTRedBox+Internal.h +42 -0
  166. package/React/CoreModules/RCTRedBox.mm +30 -454
  167. package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
  168. package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
  169. package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
  170. package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
  171. package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
  172. package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
  173. package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
  174. package/React/CoreModules/RCTRedBoxController.mm +447 -0
  175. package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
  176. package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
  177. package/React/CoreModules/RCTWebSocketModule.mm +45 -6
  178. package/React/CoreModules/React-CoreModules.podspec +1 -0
  179. package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -1
  180. package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
  181. package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
  182. package/React/DevSupport/RCTInspectorDevServerHelper.mm +4 -0
  183. package/React/DevSupport/RCTPackagerConnection.mm +13 -11
  184. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +148 -43
  185. package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h +1 -0
  186. package/React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm +1 -0
  187. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +1 -1
  188. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +2 -2
  189. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +122 -8
  190. package/React/Fabric/RCTConversions.h +14 -0
  191. package/React/Fabric/RCTScheduler.mm +18 -0
  192. package/React/Fabric/RCTSurfacePointerHandler.mm +8 -2
  193. package/React/Fabric/RCTSurfaceTouchHandler.mm +1 -0
  194. package/React/Fabric/Surface/RCTFabricSurface.mm +3 -0
  195. package/React/I18n/strings/pt.lproj/fbt_language_pack.bin +0 -0
  196. package/React/Modules/RCTUIManager.mm +1 -1
  197. package/React/Profiler/RCTProfile.h +5 -0
  198. package/React/Profiler/RCTProfile.m +2 -1
  199. package/React/Profiler/RCTProfileTrampoline-arm.S +1 -1
  200. package/React/Profiler/RCTProfileTrampoline-arm64.S +1 -1
  201. package/React/Profiler/RCTProfileTrampoline-i386.S +1 -1
  202. package/React/Profiler/RCTProfileTrampoline-x86_64.S +1 -1
  203. package/React/Tests/Mounting/RCTViewComponentViewTests.mm +186 -0
  204. package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +5 -5
  205. package/React/Views/RCTLayout.m +4 -3
  206. package/React/Views/ScrollView/RCTScrollView.h +6 -2
  207. package/ReactAndroid/api/ReactAndroid.api +37 -27
  208. package/ReactAndroid/build.gradle.kts +28 -21
  209. package/ReactAndroid/gradle.properties +1 -1
  210. package/ReactAndroid/hermes-engine/build.gradle.kts +12 -13
  211. package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.kt +2 -0
  212. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +1 -3
  213. package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.kt +2 -0
  214. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +40 -110
  215. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +33 -88
  216. package/ReactAndroid/src/main/java/com/facebook/react/animated/EventAnimationDriver.kt +1 -0
  217. package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.kt +9 -99
  218. package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt +7 -28
  219. package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +2 -19
  220. package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.kt +15 -23
  221. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +36 -0
  222. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNativeJNISoLoader.kt +2 -0
  223. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactNativeJniCommonSoLoader.kt +2 -0
  224. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactSoftExceptionLogger.kt +4 -0
  225. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultSoLoader.kt +2 -0
  226. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/FpsView.kt +2 -2
  227. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorFlags.kt +6 -0
  228. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LogBoxDialogSurfaceDelegate.kt +15 -2
  229. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.kt +1 -0
  230. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/DevSupportHttpClient.kt +9 -34
  231. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +1 -1
  232. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +135 -35
  233. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkRequestListener.kt +2 -0
  234. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +10 -10
  235. package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +15 -13
  236. package/ReactAndroid/src/main/java/com/facebook/react/fabric/DevToolsReactPerfLogger.kt +4 -1
  237. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +139 -43
  238. package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +223 -0
  239. package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.kt +25 -8
  240. package/ReactAndroid/src/main/java/com/facebook/react/fabric/events/FabricEventEmitter.kt +34 -1
  241. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +104 -65
  242. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +9 -1
  243. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +172 -36
  244. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/PreAllocateViewMountItem.kt +1 -1
  245. package/ReactAndroid/src/main/java/com/facebook/react/interfaces/ExtraWindowEventListener.kt +29 -0
  246. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +71 -29
  247. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +121 -51
  248. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +25 -11
  249. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +26 -12
  250. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +134 -57
  251. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +7 -3
  252. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +1 -4
  253. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +25 -11
  254. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +5 -9
  255. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/rewrite_feature_flag_defaults.py +76 -0
  256. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/tests/test_rewrite_feature_flag_defaults.py +63 -0
  257. package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +40 -1
  258. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +3 -0
  259. package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.kt +10 -5
  260. package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobProvider.kt +1 -2
  261. package/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.kt +3 -0
  262. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/DeviceEventManagerModule.kt +2 -1
  263. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactChoreographer.kt +21 -20
  264. package/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.kt +63 -3
  265. package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +59 -62
  266. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +8 -0
  267. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +8 -0
  268. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.kt +2 -0
  269. package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +45 -36
  270. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  271. package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +5 -2
  272. package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.kt +4 -0
  273. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +68 -15
  274. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImplDevHelper.kt +8 -1
  275. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +21 -19
  276. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt +4 -0
  277. package/ReactAndroid/src/main/java/com/facebook/react/soloader/OpenSourceMergedSoMapping.kt +4 -0
  278. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt +77 -72
  279. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +7 -16
  280. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BlendModeHelper.kt +3 -2
  281. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +3 -0
  282. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt +3 -1
  283. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +25 -0
  284. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.kt +2 -2
  285. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRootViewTagGenerator.kt +3 -2
  286. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootViewUtil.kt +17 -7
  287. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +18 -0
  288. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +20 -12
  289. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +18 -24
  290. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIConstantsProviderBinding.kt +2 -0
  291. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +4 -0
  292. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.kt +11 -71
  293. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +10 -17
  294. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/common/ViewUtil.kt +29 -30
  295. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/BackgroundImageDrawable.kt +5 -3
  296. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/InsetBoxShadowDrawable.kt +12 -13
  297. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +1 -0
  298. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +1 -0
  299. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.kt +30 -0
  300. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/SynchronousEventReceiver.kt +28 -0
  301. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.kt +9 -9
  302. package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +27 -3
  303. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +4 -0
  304. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.kt +1 -14
  305. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager.kt +1 -22
  306. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +18 -20
  307. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +20 -21
  308. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +19 -20
  309. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +14 -5
  310. package/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.kt +2 -3
  311. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +5 -162
  312. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +1 -1
  313. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +71 -97
  314. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +1 -4
  315. package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/DrawCommandSpan.kt +1 -1
  316. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +7 -13
  317. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +40 -2
  318. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.kt +59 -20
  319. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +84 -20
  320. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +41 -65
  321. package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +85 -13
  322. package/ReactAndroid/src/main/java/com/facebook/soloader/annotation/SoLoaderLibrary.kt +17 -0
  323. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +5 -1
  324. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.kt +30 -0
  325. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +3 -1
  326. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +3 -1
  327. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +39 -0
  328. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +20 -12
  329. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +101 -0
  330. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +33 -0
  331. package/ReactAndroid/src/main/jni/CMakeLists.txt +17 -1
  332. package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.cpp +22 -0
  333. package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.h +2 -0
  334. package/ReactAndroid/src/main/jni/react/fabric/ComponentFactory.cpp +0 -1
  335. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +0 -2
  336. package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.cpp +26 -6
  337. package/ReactAndroid/src/main/jni/react/fabric/EventEmitterWrapper.h +3 -3
  338. package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +47 -0
  339. package/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.h +20 -6
  340. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +24 -1
  341. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +6 -0
  342. package/ReactAndroid/src/main/jni/react/fabric/FocusOrderingHelper.cpp +0 -1
  343. package/ReactAndroid/src/main/jni/react/fabric/SurfaceHandlerBinding.cpp +1 -0
  344. package/ReactAndroid/src/main/jni/react/fabric/test_helper/FabricMountingManagerTestHelper.cpp +85 -0
  345. package/ReactAndroid/src/main/jni/react/fabric/test_helper/FabricMountingManagerTestHelper.h +46 -0
  346. package/ReactAndroid/src/main/jni/react/fabric/test_helper/OnLoad.cpp +16 -0
  347. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +167 -69
  348. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +36 -15
  349. package/ReactAndroid/src/main/jni/react/hermes/instrumentation/HermesSamplingProfiler.cpp +1 -1
  350. package/ReactAndroid/src/main/jni/react/jni/OnLoad-common.cpp +0 -2
  351. package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +2 -1
  352. package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.cpp +37 -30
  353. package/ReactAndroid/src/main/jni/react/reactnativeblob/BlobCollector.h +11 -8
  354. package/ReactAndroid/src/main/jni/react/reactnativeblob/CMakeLists.txt +2 -1
  355. package/ReactAndroid/src/main/jni/react/reactnativeblob/OnLoad.cpp +1 -1
  356. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +24 -0
  357. package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +25 -4
  358. package/ReactAndroid/src/main/jni/react/tracing/CMakeLists.txt +28 -0
  359. package/ReactCommon/React-Fabric.podspec +13 -0
  360. package/ReactCommon/React-FabricComponents.podspec +1 -1
  361. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  362. package/ReactCommon/jsc/JSCRuntime.cpp +9 -0
  363. package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -0
  364. package/ReactCommon/jserrorhandler/JsErrorHandler.h +1 -1
  365. package/ReactCommon/jsi/jsi/JSIDynamic.cpp +1 -0
  366. package/ReactCommon/jsi/jsi/decorator.h +93 -0
  367. package/ReactCommon/jsi/jsi/jsi-inl.h +97 -68
  368. package/ReactCommon/jsi/jsi/jsi.cpp +208 -27
  369. package/ReactCommon/jsi/jsi/jsi.h +553 -224
  370. package/ReactCommon/jsi/jsi/test/testlib.cpp +453 -0
  371. package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +1 -1
  372. package/ReactCommon/jsinspector-modern/EmulationAgent.cpp +108 -0
  373. package/ReactCommon/jsinspector-modern/EmulationAgent.h +47 -0
  374. package/ReactCommon/jsinspector-modern/HostAgent.cpp +46 -1
  375. package/ReactCommon/jsinspector-modern/HostTarget.cpp +7 -1
  376. package/ReactCommon/jsinspector-modern/HostTarget.h +50 -0
  377. package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +1 -1
  378. package/ReactCommon/jsinspector-modern/HostTargetTracing.h +4 -4
  379. package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +18 -2
  380. package/ReactCommon/jsinspector-modern/InspectorFlags.h +17 -2
  381. package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +19 -2
  382. package/ReactCommon/jsinspector-modern/InspectorPackagerConnectionImpl.h +3 -0
  383. package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +1 -1
  384. package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +19 -0
  385. package/ReactCommon/jsinspector-modern/RuntimeAgent.h +7 -0
  386. package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +33 -0
  387. package/ReactCommon/jsinspector-modern/RuntimeTarget.h +6 -0
  388. package/ReactCommon/jsinspector-modern/TracingAgent.cpp +10 -0
  389. package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +12 -0
  390. package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +3 -2
  391. package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +1 -0
  392. package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +1 -1
  393. package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +1 -1
  394. package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +10 -0
  395. package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +3 -1
  396. package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
  397. package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +7 -3
  398. package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +52 -29
  399. package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +6 -6
  400. package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
  401. package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -0
  402. package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +12 -5
  403. package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +3 -1
  404. package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +42 -0
  405. package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
  406. package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +0 -1
  407. package/ReactCommon/logger/react_native_log.cpp +0 -1
  408. package/ReactCommon/react/bridging/Array.h +1 -1
  409. package/ReactCommon/react/debug/CMakeLists.txt +2 -1
  410. package/ReactCommon/react/debug/React-debug.podspec +7 -1
  411. package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
  412. package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
  413. package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
  414. package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
  415. package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
  416. package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
  417. package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
  418. package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
  419. package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
  420. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +49 -21
  421. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +60 -25
  422. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +267 -141
  423. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +28 -14
  424. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +48 -20
  425. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +106 -43
  426. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +11 -3
  427. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +14 -7
  428. package/ReactCommon/react/featureflags/rewrite_feature_flag_defaults.py +111 -0
  429. package/ReactCommon/react/featureflags/tests/test_rewrite_feature_flag_defaults.py +60 -0
  430. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +3 -9
  431. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +0 -1
  432. package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +2 -0
  433. package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +14 -0
  434. package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +2 -0
  435. package/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp +2 -2
  436. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +60 -25
  437. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +25 -11
  438. package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +3 -2
  439. package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +4 -0
  440. package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +66 -0
  441. package/ReactCommon/react/nativemodule/viewtransition/CMakeLists.txt +24 -0
  442. package/ReactCommon/react/nativemodule/viewtransition/NativeViewTransition.cpp +92 -0
  443. package/ReactCommon/react/nativemodule/viewtransition/NativeViewTransition.h +37 -0
  444. package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +58 -0
  445. package/ReactCommon/react/nativemodule/webperformance/NativePerformance.cpp +10 -1
  446. package/ReactCommon/react/networking/NetworkReporter.h +0 -1
  447. package/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.h +0 -1
  448. package/ReactCommon/react/performance/timeline/PerformanceEntry.h +1 -1
  449. package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
  450. package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
  451. package/ReactCommon/react/performance/timeline/tests/PerformanceEntryTest.cpp +62 -0
  452. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +28 -13
  453. package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +1 -1
  454. package/ReactCommon/react/renderer/animationbackend/AnimatedPropSerializer.cpp +3 -0
  455. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -3
  456. package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
  457. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +62 -25
  458. package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +10 -1
  459. package/ReactCommon/react/renderer/animationbackend/AnimationBackendCommitHook.h +0 -1
  460. package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +5 -0
  461. package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +8 -3
  462. package/ReactCommon/react/renderer/animations/tests/MutationComparatorTest.cpp +273 -0
  463. package/ReactCommon/react/renderer/animations/utils.h +12 -1
  464. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +1 -1
  465. package/ReactCommon/react/renderer/attributedstring/conversions.h +104 -3
  466. package/ReactCommon/react/renderer/components/image/conversions.h +2 -3
  467. package/ReactCommon/react/renderer/components/scrollview/ScrollViewEventEmitter.h +0 -1
  468. package/ReactCommon/react/renderer/components/scrollview/conversions.h +0 -1
  469. package/ReactCommon/react/renderer/components/text/stateConversions.h +0 -1
  470. package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +531 -21
  471. package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +9 -0
  472. package/ReactCommon/react/renderer/components/view/BaseTouch.cpp +3 -2
  473. package/ReactCommon/react/renderer/components/view/BaseTouch.h +7 -0
  474. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +8 -0
  475. package/ReactCommon/react/renderer/components/view/PointerEvent.cpp +2 -0
  476. package/ReactCommon/react/renderer/components/view/PointerEvent.h +5 -0
  477. package/ReactCommon/react/renderer/components/view/TouchEvent.h +0 -2
  478. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +23 -5
  479. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
  480. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +5 -0
  481. package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +33 -28
  482. package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +0 -1
  483. package/ReactCommon/react/renderer/components/view/conversions.h +44 -28
  484. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +52 -5
  485. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/NativeDrawable.h +47 -16
  486. package/ReactCommon/react/renderer/components/view/platform/cxx/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +2 -2
  487. package/ReactCommon/react/renderer/{graphics/DoubleConversions.h → components/view/platform/tvos/react/renderer/components/view/HostPlatformTouch.h} +2 -4
  488. package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewEventEmitter.h +14 -0
  489. package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewProps.cpp +38 -0
  490. package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewProps.h +29 -0
  491. package/ReactCommon/react/renderer/components/view/platform/tvos/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +30 -0
  492. package/ReactCommon/react/renderer/components/view/propsConversions.h +8 -2
  493. package/ReactCommon/react/renderer/components/view/tests/ConversionsTest.cpp +86 -0
  494. package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +34 -0
  495. package/ReactCommon/react/renderer/core/EventEmitter.cpp +67 -2
  496. package/ReactCommon/react/renderer/core/EventEmitter.h +25 -0
  497. package/ReactCommon/react/renderer/core/EventPipe.h +3 -1
  498. package/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +18 -10
  499. package/ReactCommon/react/renderer/core/EventTarget.cpp +8 -5
  500. package/ReactCommon/react/renderer/core/LayoutContext.h +9 -2
  501. package/ReactCommon/react/renderer/core/LayoutMetrics.cpp +5 -3
  502. package/ReactCommon/react/renderer/core/LayoutPrimitives.h +1 -0
  503. package/ReactCommon/react/renderer/core/Props.cpp +20 -0
  504. package/ReactCommon/react/renderer/core/RawEvent.cpp +4 -2
  505. package/ReactCommon/react/renderer/core/RawEvent.h +6 -6
  506. package/ReactCommon/react/renderer/core/ShadowNode.h +2 -2
  507. package/ReactCommon/react/renderer/core/conversions.h +4 -0
  508. package/ReactCommon/react/renderer/core/graphicsConversions.h +4 -4
  509. package/ReactCommon/react/renderer/core/propsConversions.h +1 -1
  510. package/ReactCommon/react/renderer/core/tests/EventQueueProcessorTest.cpp +52 -3
  511. package/ReactCommon/react/renderer/core/tests/EventTargetTests.cpp +26 -0
  512. package/ReactCommon/react/renderer/css/tests/CSSValueParserTest.cpp +1 -1
  513. package/ReactCommon/react/renderer/debug/DebugStringConvertible.cpp +42 -26
  514. package/ReactCommon/react/renderer/debug/DebugStringConvertible.h +4 -2
  515. package/ReactCommon/react/renderer/debug/tests/DebugStringConvertibleTest.cpp +34 -3
  516. package/ReactCommon/react/renderer/graphics/BlendMode.h +5 -0
  517. package/ReactCommon/react/renderer/graphics/CMakeLists.txt +1 -0
  518. package/ReactCommon/react/renderer/graphics/ColorStop.h +3 -0
  519. package/ReactCommon/react/renderer/graphics/LinearGradient.h +3 -0
  520. package/ReactCommon/react/renderer/graphics/RadialGradient.h +4 -0
  521. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -0
  522. package/ReactCommon/react/renderer/graphics/ValueUnit.cpp +1 -1
  523. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageFetcher.cpp +0 -5
  524. package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/ImageManager.cpp +2 -2
  525. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImagePrimitivesConversions.h +0 -4
  526. package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +5 -1
  527. package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +12 -4
  528. package/ReactCommon/react/renderer/mounting/CMakeLists.txt +1 -0
  529. package/ReactCommon/react/renderer/mounting/Differentiator.cpp +307 -4
  530. package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +27 -2
  531. package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +95 -0
  532. package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +212 -0
  533. package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +154 -0
  534. package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +314 -18
  535. package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +38 -20
  536. package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +20 -22
  537. package/ReactCommon/react/renderer/scheduler/CMakeLists.txt +1 -0
  538. package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +76 -3
  539. package/ReactCommon/react/renderer/scheduler/Scheduler.h +12 -0
  540. package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +5 -0
  541. package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +0 -7
  542. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +2 -1
  543. package/ReactCommon/react/renderer/uimanager/UIManager.cpp +16 -1
  544. package/ReactCommon/react/renderer/uimanager/UIManager.h +8 -0
  545. package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +2 -0
  546. package/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +347 -5
  547. package/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +5 -3
  548. package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +5 -0
  549. package/ReactCommon/react/renderer/uimanager/UIManagerViewTransitionDelegate.h +82 -0
  550. package/ReactCommon/react/renderer/viewtransition/CMakeLists.txt +22 -0
  551. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +520 -0
  552. package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +161 -0
  553. package/ReactCommon/react/runtime/TimerManager.cpp +4 -2
  554. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +152 -0
  555. package/ReactCommon/react/timing/PrivacyInfo.xcprivacy +21 -0
  556. package/ReactCommon/react/timing/React-timing.podspec +2 -0
  557. package/ReactCommon/react/timing/primitives.h +33 -1
  558. package/ReactCommon/{jsinspector-modern → react/utils}/Base64.h +2 -2
  559. package/ReactCommon/yoga/yoga/YGEnums.cpp +32 -0
  560. package/ReactCommon/yoga/yoga/YGEnums.h +20 -4
  561. package/ReactCommon/yoga/yoga/YGMacros.h +2 -0
  562. package/ReactCommon/yoga/yoga/YGNode.h +1 -1
  563. package/ReactCommon/yoga/yoga/YGNodeStyle.cpp +269 -0
  564. package/ReactCommon/yoga/yoga/YGNodeStyle.h +93 -1
  565. package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +40 -9
  566. package/ReactCommon/yoga/yoga/algorithm/Align.h +12 -1
  567. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +106 -14
  568. package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +22 -0
  569. package/ReactCommon/yoga/yoga/enums/Align.h +3 -1
  570. package/ReactCommon/yoga/yoga/enums/Display.h +2 -1
  571. package/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h +2 -1
  572. package/ReactCommon/yoga/yoga/enums/GridTrackType.h +43 -0
  573. package/ReactCommon/yoga/yoga/enums/Justify.h +5 -1
  574. package/ReactCommon/yoga/yoga/event/event.cpp +2 -0
  575. package/ReactCommon/yoga/yoga/event/event.h +1 -0
  576. package/ReactCommon/yoga/yoga/node/Node.cpp +6 -1
  577. package/ReactCommon/yoga/yoga/node/Node.h +4 -4
  578. package/ReactCommon/yoga/yoga/style/GridLine.h +53 -0
  579. package/ReactCommon/yoga/yoga/style/GridTrack.h +63 -0
  580. package/ReactCommon/yoga/yoga/style/Style.h +261 -71
  581. package/ReactCommon/yoga/yoga/style/StyleSizeLength.h +7 -1
  582. package/ReactCommon/yoga/yoga/style/StyleValueHandle.h +8 -0
  583. package/ReactCommon/yoga/yoga/style/StyleValuePool.h +10 -0
  584. package/changes.json +16 -12
  585. package/cli.js +1 -1
  586. package/flow/HermesInternalType.js +1 -1
  587. package/flow/bom.js.flow +95 -3
  588. package/flow/dom.js.flow +89 -89
  589. package/gradle/libs.versions.toml +3 -1
  590. package/index.js +30 -3
  591. package/index.js.flow +23 -1
  592. package/package.json +35 -31
  593. package/react-native.config.js +3 -3
  594. package/scripts/cocoapods/rncore.rb +65 -11
  595. package/scripts/cocoapods/rndependencies.rb +65 -11
  596. package/scripts/cocoapods/utils.rb +53 -0
  597. package/scripts/codegen/generate-artifacts-executor/generateAppDependencyProvider.js +4 -4
  598. package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +4 -4
  599. package/scripts/codegen/generate-artifacts-executor/generateNativeCode.js +15 -7
  600. package/scripts/codegen/generate-artifacts-executor/generatePackageSwift.js +2 -2
  601. package/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +4 -3
  602. package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +4 -3
  603. package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +19 -8
  604. package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +1 -1
  605. package/scripts/codegen/generate-artifacts-executor/generateUnstableModulesRequiringMainQueueSetupProvider.js +4 -4
  606. package/scripts/codegen/generate-artifacts-executor/index.js +2 -0
  607. package/scripts/codegen/generate-artifacts-executor/utils.js +49 -1
  608. package/scripts/codegen/generate-specs-cli-executor.js +1 -1
  609. package/scripts/generate-codegen-artifacts.js +20 -2
  610. package/scripts/generate-provider-cli.js +1 -1
  611. package/scripts/react_native_pods.rb +26 -2
  612. package/scripts/react_native_pods_utils/script_phases.rb +9 -3
  613. package/scripts/replace-rncore-version.js +91 -14
  614. package/scripts/xcode/with-environment.sh +7 -1
  615. package/sdks/.hermesv1version +1 -1
  616. package/sdks/.hermesversion +1 -1
  617. package/sdks/hermes-engine/hermes-utils.rb +92 -5
  618. package/sdks/hermes-engine/version.properties +2 -2
  619. package/src/private/animated/NativeAnimatedValidation.js +1 -1
  620. package/src/private/animated/createAnimatedPropsHook.js +2 -2
  621. package/src/private/components/virtualcollection/FlingConstants.js +21 -0
  622. package/src/private/components/virtualcollection/Virtual.js +62 -0
  623. package/src/private/components/virtualcollection/VirtualCollectionView.js +238 -0
  624. package/src/private/components/virtualcollection/column/VirtualColumn.js +43 -0
  625. package/src/private/components/virtualcollection/column/VirtualColumnGenerator.js +72 -0
  626. package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +13 -0
  627. package/src/private/components/virtualcollection/dom/getScrollParent.js +43 -0
  628. package/src/private/components/virtualcollection/dom/isScrollableNode.js +22 -0
  629. package/src/private/components/virtualcollection/row/VirtualRow.js +43 -0
  630. package/src/private/components/virtualcollection/row/VirtualRowGenerator.js +72 -0
  631. package/src/private/devsupport/devmenu/elementinspector/getInspectorDataForViewAtPoint.js +2 -2
  632. package/src/private/devsupport/devmenu/elementinspector/useExternalInspection.js +1 -1
  633. package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +1 -1
  634. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
  635. package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
  636. package/src/private/featureflags/ReactNativeFeatureFlags.js +66 -37
  637. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
  638. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +14 -7
  639. package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
  640. package/src/private/renderer/events/LegacySyntheticEvent.js +90 -0
  641. package/src/private/renderer/events/ReactNativeEventTypeMapping.js +103 -0
  642. package/src/private/renderer/events/ReactNativeResponder.js +687 -0
  643. package/src/private/renderer/events/ResponderEvent.js +40 -0
  644. package/src/private/renderer/events/ResponderTouchHistoryStore.js +258 -0
  645. package/src/private/renderer/events/dispatchNativeEvent.js +83 -0
  646. package/src/private/setup/setUpDOM.js +20 -0
  647. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
  648. package/src/private/specs_DEPRECATED/components/ActivityIndicatorViewNativeComponent.js +2 -2
  649. package/src/private/specs_DEPRECATED/components/AndroidDrawerLayoutNativeComponent.js +2 -2
  650. package/src/private/specs_DEPRECATED/components/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
  651. package/src/private/specs_DEPRECATED/components/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
  652. package/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.js +2 -2
  653. package/src/private/specs_DEPRECATED/components/DebuggingOverlayNativeComponent.js +2 -2
  654. package/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.js +2 -2
  655. package/src/private/specs_DEPRECATED/components/PullToRefreshViewNativeComponent.js +2 -2
  656. package/src/private/specs_DEPRECATED/components/RCTInputAccessoryViewNativeComponent.js +2 -2
  657. package/src/private/specs_DEPRECATED/components/RCTModalHostViewNativeComponent.js +2 -2
  658. package/src/private/specs_DEPRECATED/components/RCTSafeAreaViewNativeComponent.js +2 -2
  659. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +2 -2
  660. package/src/private/specs_DEPRECATED/components/UnimplementedNativeViewNativeComponent.js +2 -2
  661. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +1 -1
  662. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
  663. package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +1 -1
  664. package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
  665. package/src/private/specs_DEPRECATED/modules/NativeAppState.js +1 -1
  666. package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +1 -1
  667. package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +1 -1
  668. package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +1 -1
  669. package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -1
  670. package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +1 -1
  671. package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
  672. package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +1 -1
  673. package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
  674. package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +1 -1
  675. package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +1 -1
  676. package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
  677. package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +2 -2
  678. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +1 -1
  679. package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +1 -1
  680. package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
  681. package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +2 -2
  682. package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +1 -1
  683. package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
  684. package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +1 -1
  685. package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +1 -1
  686. package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +1 -1
  687. package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +1 -1
  688. package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +1 -1
  689. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -1
  690. package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +1 -1
  691. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
  692. package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +2 -2
  693. package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +2 -2
  694. package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +1 -1
  695. package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +2 -2
  696. package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +1 -1
  697. package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +2 -2
  698. package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +1 -1
  699. package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
  700. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -1
  701. package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +1 -1
  702. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +1 -1
  703. package/src/private/specs_DEPRECATED/modules/NativeVibration.js +1 -1
  704. package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +2 -2
  705. package/src/private/styles/composeStyles.js +1 -1
  706. package/src/private/types/HostComponent.js +1 -1
  707. package/src/private/utilities/toExtendedError.js +1 -1
  708. package/src/private/viewtransition/specs/NativeViewTransition.js +33 -0
  709. package/src/private/webapis/dom/events/Event.js +10 -1
  710. package/src/private/webapis/dom/events/EventTarget.js +60 -18
  711. package/src/private/webapis/dom/events/internals/EventInternals.js +18 -1
  712. package/src/private/webapis/dom/events/internals/EventTargetInternals.js +12 -0
  713. package/src/private/webapis/dom/nodes/ReactNativeElement.js +24 -0
  714. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +4 -6
  715. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +70 -1
  716. package/src/private/webapis/dom/nodes/internals/NodeInternals.js +10 -0
  717. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +1 -1
  718. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
  719. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +5 -9
  720. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +2 -2
  721. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +2 -2
  722. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +2 -2
  723. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +1 -1
  724. package/src/private/webapis/performance/specs/NativePerformance.js +1 -1
  725. package/src/private/webapis/structuredClone/structuredClone.js +1 -1
  726. package/src/private/webapis/webidl/PlatformObjects.js +4 -4
  727. package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +5 -1
  728. package/types_generated/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +3 -4
  729. package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +5 -2
  730. package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +14 -2
  731. package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +8 -6
  732. package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +4 -2
  733. package/types_generated/Libraries/Network/XMLHttpRequest.d.ts +23 -4
  734. package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +2 -3
  735. package/types_generated/Libraries/{Utilities/IPerformanceLogger.d.ts → ReactNative/IPerformanceLogger.flow.d.ts} +12 -6
  736. package/types_generated/Libraries/ReactNative/RendererImplementation.d.ts +12 -25
  737. package/types_generated/Libraries/ReactNative/RendererProxy.d.ts +1 -16
  738. package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +1 -16
  739. package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +3 -3
  740. package/types_generated/Libraries/Utilities/BackHandler.d.ts +6 -2
  741. package/types_generated/index.d.ts +11 -2
  742. package/types_generated/src/private/components/virtualcollection/FlingConstants.d.ts +20 -0
  743. package/types_generated/src/private/components/virtualcollection/Virtual.d.ts +46 -0
  744. package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +81 -0
  745. package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +23 -0
  746. package/types_generated/src/private/components/virtualcollection/column/VirtualColumnGenerator.d.ts +17 -0
  747. package/types_generated/src/private/components/virtualcollection/dom/getScrollParent.d.ts +21 -0
  748. package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +23 -0
  749. package/types_generated/src/private/webapis/dom/events/Event.d.ts +1 -9
  750. package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +1 -13
  751. package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +5 -2
  752. package/types_generated/src/private/webapis/dom/nodes/internals/NodeInternals.d.ts +8 -1
  753. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +0 -19668
  754. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +0 -11129
  755. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +0 -12930
  756. package/Libraries/Renderer/shims/ReactNative.js +0 -27
  757. package/Libraries/Utilities/GlobalPerformanceLogger.js +0 -24
  758. package/Libraries/Utilities/PerformanceLoggerContext.js +0 -33
  759. package/Libraries/Utilities/createPerformanceLogger.js +0 -329
  760. package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.kt +0 -442
  761. package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobCollector.kt +0 -31
  762. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollContainerLegacyView.kt +0 -47
  763. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIFinalizer.java +0 -31
  764. package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.java +0 -35
  765. package/ReactCommon/react/renderer/graphics/DoubleConversions.cpp +0 -38
  766. package/types_generated/Libraries/Renderer/shims/ReactNative.d.ts +0 -16
  767. package/types_generated/Libraries/Utilities/createPerformanceLogger.d.ts +0 -23
@@ -20,7 +20,7 @@ import {
20
20
  } from '../../../Libraries/Animated/NativeAnimatedAllowlist';
21
21
 
22
22
  export function validateInterpolation<
23
- OutputT: InterpolationConfigSupportedOutputType,
23
+ OutputT extends InterpolationConfigSupportedOutputType,
24
24
  >(config: InterpolationConfigType<OutputT>): void {
25
25
  for (const key in config) {
26
26
  if (key !== 'debugID' && !isSupportedInterpolationParam(key)) {
@@ -36,7 +36,7 @@ type ReducedProps<TProps> = {
36
36
  };
37
37
  type CallbackRef<T> = T => unknown;
38
38
 
39
- export type AnimatedPropsHook = <TProps: {...}, TInstance>(
39
+ export type AnimatedPropsHook = <TProps extends {...}, TInstance>(
40
40
  props: TProps,
41
41
  ) => [ReducedProps<TProps>, CallbackRef<TInstance | null>];
42
42
 
@@ -55,7 +55,7 @@ export default function createAnimatedPropsHook(
55
55
  const useNativePropsInFabric =
56
56
  ReactNativeFeatureFlags.shouldUseSetNativePropsInFabric();
57
57
 
58
- return function useAnimatedProps<TProps: {...}, TInstance>(
58
+ return function useAnimatedProps<TProps extends {...}, TInstance>(
59
59
  props: TProps,
60
60
  ): [ReducedProps<TProps>, CallbackRef<TInstance | null>] {
61
61
  const [, scheduleUpdate] = useReducer<number, void>(count => count + 1, 0);
@@ -0,0 +1,21 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import Dimensions from '../../../../Libraries/Utilities/Dimensions';
12
+
13
+ export const DEFAULT_INITIAL_NUM_TO_RENDER = 7;
14
+
15
+ export const INITIAL_NUM_TO_RENDER: number = DEFAULT_INITIAL_NUM_TO_RENDER;
16
+
17
+ export const FALLBACK_ESTIMATED_HEIGHT: number =
18
+ Dimensions.get('window').height / DEFAULT_INITIAL_NUM_TO_RENDER;
19
+
20
+ export const FALLBACK_ESTIMATED_WIDTH: number =
21
+ Dimensions.get('window').width / DEFAULT_INITIAL_NUM_TO_RENDER;
@@ -0,0 +1,62 @@
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
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ /**
12
+ * An item to virtualize must be an item. It can optionally have a string `id`
13
+ * parameter, but that is not currently represented because it makes the Flow
14
+ * types more complicated.
15
+ */
16
+ export interface Item {}
17
+
18
+ /**
19
+ * An interface for a collection of items, without requiring that each item be
20
+ * eagerly (or lazily) allocated.
21
+ */
22
+ export interface VirtualCollection<+T extends Item> {
23
+ /**
24
+ * The number of items in the collection. This can either be a numeric scalar
25
+ * or a getter function that is computed on access. However, it should remain
26
+ * constant for the lifetime of this object.
27
+ */
28
+ +size: number;
29
+
30
+ /**
31
+ * If an item exists at the supplied index, this should return a consistent
32
+ * item for the lifetime of this object. If an item does not exist at the
33
+ * supplied index, this should throw an error.
34
+ */
35
+ at(index: number): T;
36
+ }
37
+
38
+ /**
39
+ * An implementation of `VirtualCollection` that wraps an array. Although easy to
40
+ * use, this is not recommended for larger arrays because each element of an
41
+ * array is eagerly allocated.
42
+ */
43
+ export class VirtualArray<+T extends Item> implements VirtualCollection<T> {
44
+ +size: number;
45
+ +at: (index: number) => T;
46
+
47
+ constructor(input: Readonly<$ArrayLike<T>>) {
48
+ const array = [...input];
49
+
50
+ // NOTE: This is implemented this way because Flow does not permit `input`
51
+ // to be a read-only instance property (even a private one).
52
+ this.size = array.length;
53
+ this.at = (index: number): T => {
54
+ if (index < 0 || index >= this.size) {
55
+ throw new RangeError(
56
+ `Cannot get index ${index} from a collection of size ${this.size}`,
57
+ );
58
+ }
59
+ return array[index];
60
+ };
61
+ }
62
+ }
@@ -0,0 +1,238 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type {ViewStyleProp} from '../../../../Libraries/StyleSheet/StyleSheet';
12
+ import type {ModeChangeEvent} from '../virtualview/VirtualView';
13
+ import type {Item, VirtualCollection} from './Virtual';
14
+
15
+ import VirtualView from '../virtualview/VirtualView';
16
+ import {
17
+ VirtualViewMode,
18
+ createHiddenVirtualView,
19
+ } from '../virtualview/VirtualView';
20
+ import FlingItemOverlay from './debug/FlingItemOverlay';
21
+ import * as React from 'react';
22
+ import {useCallback, useMemo, useState} from 'react';
23
+
24
+ export type VirtualCollectionLayoutComponent<TLayoutProps extends {...}> =
25
+ component(
26
+ children: ReadonlyArray<React.Node>,
27
+ spacer: React.Node,
28
+ ...TLayoutProps
29
+ );
30
+
31
+ export type VirtualCollectionGenerator = Readonly<{
32
+ initial: Readonly<{
33
+ itemCount: number,
34
+ spacerStyle: (itemCount: number) => ViewStyleProp,
35
+ }>,
36
+ next: (event: ModeChangeEvent) => {
37
+ itemCount: number,
38
+ spacerStyle: (itemCount: number) => ViewStyleProp,
39
+ },
40
+ }>;
41
+
42
+ export type VirtualCollectionViewComponent<TLayoutProps extends {...}> =
43
+ component<+TItem extends Item>(
44
+ children: (item: TItem, key: string) => React.Node,
45
+ items: VirtualCollection<TItem>,
46
+ itemToKey?: (TItem) => string,
47
+ removeClippedSubviews?: boolean,
48
+ testID?: ?string,
49
+ ...TLayoutProps
50
+ );
51
+
52
+ /**
53
+ * Creates a component that virtually renders a collection of items and manages
54
+ * lazy rendering, memoization, and pagination. The resulting component accepts
55
+ * the following base props:
56
+ *
57
+ * - `children`: A function maps an item to a React node.
58
+ * - `items`: A collection of items to render.
59
+ * - `itemToKey`: A function maps an item to a unique key.
60
+ *
61
+ * The first argument is a layout component that defines layout of the item and
62
+ * spacer. It always receives the following props:
63
+ *
64
+ * - `children`: An array of React nodes (for items rendered so far).
65
+ * - `spacer`: A React node (estimates layout for items not yet rendered).
66
+ *
67
+ * The layout component must render `children` and `spacer`. It can also define
68
+ * additional props that will be passed through from the resulting component.
69
+ *
70
+ * The second argument is a generator that defines the initial rendering and
71
+ * pagination behavior. The initial rendering behavior is defined by the
72
+ * `initial` property with the following properties:
73
+ *
74
+ * - `itemCount`: Number of items to render initially.
75
+ * - `spacerStyle`: A function that estimates the layout of the spacer. It
76
+ * receives the number of items being rendered as an argument.
77
+ *
78
+ * The pagination behavior is defined by the `next` function that receives a
79
+ * `ModeChangeEvent` and then returns an object with the following properties:
80
+ *
81
+ * - `itemCount`: Number of additional items needed to fill `thresholdRect`.
82
+ * - `spacerStyle`: A function that estimates the layout of the spacer. It
83
+ * receives the number of items being rendered as an argument.
84
+ *
85
+ */
86
+ export function createVirtualCollectionView<TLayoutProps extends {...}>(
87
+ VirtualLayout: VirtualCollectionLayoutComponent<TLayoutProps>,
88
+ {initial, next}: VirtualCollectionGenerator,
89
+ ): VirtualCollectionViewComponent<TLayoutProps> {
90
+ component VirtualCollectionView<+TItem extends Item>(
91
+ children: (item: TItem, key: string) => React.Node,
92
+ items: VirtualCollection<TItem>,
93
+ itemToKey: TItem => string = defaultItemToKey,
94
+ removeClippedSubviews: boolean = false,
95
+ testID?: ?string,
96
+ ...layoutProps: TLayoutProps
97
+ ) {
98
+ const [desiredItemCount, setDesiredItemCount] = useState(
99
+ Math.ceil(initial.itemCount),
100
+ );
101
+
102
+ const renderItem = useMemoCallback(
103
+ useCallback(
104
+ (item: TItem) => {
105
+ const key = itemToKey(item);
106
+ return (
107
+ <VirtualView
108
+ key={key}
109
+ nativeID={key}
110
+ removeClippedSubviews={removeClippedSubviews}>
111
+ {FlingItemOverlay == null ? null : (
112
+ <FlingItemOverlay nativeID={key} />
113
+ )}
114
+ {children(item, key)}
115
+ </VirtualView>
116
+ );
117
+ },
118
+ [children, itemToKey, removeClippedSubviews],
119
+ ),
120
+ );
121
+
122
+ const mountedItemCount = Math.min(desiredItemCount, items.size);
123
+ const mountedItemViews = Array.from(
124
+ {length: mountedItemCount},
125
+ (_, index) => renderItem(items.at(index)),
126
+ );
127
+
128
+ const virtualItemCount = items.size - mountedItemCount;
129
+ const virtualItemSpacer = useMemo(
130
+ () =>
131
+ virtualItemCount === 0 ? null : (
132
+ <VirtualCollectionSpacer
133
+ nativeID={`${testID ?? ''}:Spacer`}
134
+ virtualItemCount={virtualItemCount}
135
+ onRenderMoreItems={(itemCount: number) => {
136
+ setDesiredItemCount(
137
+ prevElementCount => prevElementCount + itemCount,
138
+ );
139
+ }}
140
+ />
141
+ ),
142
+ [virtualItemCount, testID],
143
+ );
144
+
145
+ return (
146
+ <VirtualLayout {...layoutProps} spacer={virtualItemSpacer}>
147
+ {mountedItemViews}
148
+ </VirtualLayout>
149
+ );
150
+ }
151
+
152
+ function createSpacerView(spacerStyle: (itemCount: number) => ViewStyleProp) {
153
+ component SpacerView(
154
+ itemCount: number,
155
+ ref?: React.RefSetter<React.RefOf<VirtualView> | null>,
156
+ ...props: Omit<React.PropsOf<VirtualView>, 'ref'>
157
+ ) {
158
+ const HiddenVirtualView = useMemo(
159
+ () => createHiddenVirtualView(spacerStyle(itemCount)),
160
+ [itemCount],
161
+ );
162
+ return <HiddenVirtualView ref={ref} {...props} />;
163
+ }
164
+ return SpacerView;
165
+ }
166
+
167
+ const initialSpacerView = {
168
+ SpacerView: createSpacerView(initial.spacerStyle),
169
+ };
170
+
171
+ component VirtualCollectionSpacer(
172
+ nativeID: string,
173
+ virtualItemCount: number,
174
+
175
+ onRenderMoreItems: (itemCount: number) => void,
176
+ ) {
177
+ // NOTE: Store `SpacerView` in a wrapper object because otherwise, `useState`
178
+ // will confuse `SpacerView` (a component) as being an updater function.
179
+ const [{SpacerView}, setSpacerView] = useState(initialSpacerView);
180
+
181
+ const handleModeChange = (event: ModeChangeEvent) => {
182
+ if (event.mode === VirtualViewMode.Hidden) {
183
+ // This should never happen; this starts hidden and otherwise unmounts.
184
+ return;
185
+ }
186
+ const {itemCount, spacerStyle} = next(event);
187
+
188
+ // Refine the estimated item size when computing spacer size.
189
+ setSpacerView({
190
+ SpacerView: createSpacerView(spacerStyle),
191
+ });
192
+
193
+ // Render more items to fill `thresholdRect`.
194
+ onRenderMoreItems(Math.min(Math.ceil(itemCount), virtualItemCount));
195
+ };
196
+
197
+ return (
198
+ <SpacerView
199
+ itemCount={virtualItemCount}
200
+ nativeID={nativeID}
201
+ onModeChange={handleModeChange}
202
+ />
203
+ );
204
+ }
205
+
206
+ return VirtualCollectionView;
207
+ }
208
+
209
+ hook useMemoCallback<TInput extends interface {}, TOutput>(
210
+ callback: TInput => TOutput,
211
+ ): TInput => TOutput {
212
+ return useMemo(() => memoize(callback), [callback]);
213
+ }
214
+
215
+ function memoize<TInput extends interface {}, TOutput>(
216
+ callback: TInput => TOutput,
217
+ ): TInput => TOutput {
218
+ const cache = new WeakMap<TInput, TOutput>();
219
+ return (input: TInput) => {
220
+ let output = cache.get(input);
221
+ if (output == null) {
222
+ output = callback(input);
223
+ cache.set(input, output);
224
+ }
225
+ return output;
226
+ };
227
+ }
228
+
229
+ function defaultItemToKey(item: Item): string {
230
+ // $FlowExpectedError[prop-missing] - Flow cannot model this dynamic pattern.
231
+ const key = item.key;
232
+ if (typeof key !== 'string') {
233
+ throw new TypeError(
234
+ `Expected 'id' of item to be a string, got: ${typeof key}`,
235
+ );
236
+ }
237
+ return key;
238
+ }
@@ -0,0 +1,43 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type {Item, VirtualCollection} from '../Virtual';
12
+
13
+ import {createVirtualCollectionView} from '../VirtualCollectionView';
14
+ import VirtualColumnGenerator from './VirtualColumnGenerator';
15
+ import * as React from 'react';
16
+
17
+ component VirtualColumnLayout(
18
+ children: ReadonlyArray<React.Node>,
19
+ spacer: React.Node,
20
+ ) {
21
+ return (
22
+ <>
23
+ {children}
24
+ {spacer}
25
+ </>
26
+ );
27
+ }
28
+
29
+ const VirtualColumn = createVirtualCollectionView(
30
+ VirtualColumnLayout,
31
+ VirtualColumnGenerator,
32
+ );
33
+
34
+ // TODO: Figure out component generic resolution.
35
+ // @see https://fb.workplace.com/groups/flow/posts/29355518614070041
36
+ // export default VirtualColumn as VirtualCollectionViewComponent<VirtualColumnLayoutProps>;
37
+ export default VirtualColumn as component<+TItem extends Item>(
38
+ children: (item: TItem, key: string) => React.Node,
39
+ items: VirtualCollection<TItem>,
40
+ itemToKey?: (TItem) => string,
41
+ removeClippedSubviews?: boolean,
42
+ testID?: ?string,
43
+ );
@@ -0,0 +1,72 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type ReadOnlyElement from '../../../webapis/dom/nodes/ReadOnlyElement';
12
+ import type {ModeChangeEvent} from '../../virtualview/VirtualView';
13
+ import type {VirtualCollectionGenerator} from '../VirtualCollectionView';
14
+
15
+ import ReactNativeElement from '../../../webapis/dom/nodes/ReactNativeElement';
16
+ import {
17
+ FALLBACK_ESTIMATED_HEIGHT,
18
+ INITIAL_NUM_TO_RENDER,
19
+ } from '../FlingConstants';
20
+
21
+ function isVirtualView(element: ReadOnlyElement) {
22
+ // True for `VirtualView` and `VirtualViewExperimental`.
23
+ return element.nodeName.startsWith('RN:VirtualView');
24
+ }
25
+
26
+ const VirtualColumnGenerator: VirtualCollectionGenerator = {
27
+ initial: {
28
+ itemCount: INITIAL_NUM_TO_RENDER,
29
+ spacerStyle: (itemCount: number) => ({
30
+ height: itemCount * FALLBACK_ESTIMATED_HEIGHT,
31
+ }),
32
+ },
33
+ next({target, targetRect, thresholdRect}: ModeChangeEvent) {
34
+ if (!(target instanceof ReactNativeElement)) {
35
+ throw new Error(
36
+ 'Expected target to be a ReactNativeElement. VirtualColumn requires DOM APIs to be enabled in React Native.',
37
+ );
38
+ }
39
+
40
+ const heightToFill =
41
+ Math.min(
42
+ targetRect.y + targetRect.height,
43
+ thresholdRect.y + thresholdRect.height,
44
+ ) - Math.max(targetRect.y, thresholdRect.y);
45
+
46
+ // Estimate each item's size by averaging up to the 3 last items.
47
+ let previous: ReadOnlyElement = target;
48
+ let count = 0;
49
+ let maybePrevious = previous.previousElementSibling;
50
+ while (count < 3 && maybePrevious != null && isVirtualView(maybePrevious)) {
51
+ previous = maybePrevious;
52
+ count++;
53
+ maybePrevious = previous.previousElementSibling;
54
+ }
55
+
56
+ const itemHeight =
57
+ count > 0
58
+ ? (target.getBoundingClientRect().top -
59
+ previous.getBoundingClientRect().top) /
60
+ count
61
+ : FALLBACK_ESTIMATED_HEIGHT;
62
+
63
+ return {
64
+ itemCount: heightToFill / itemHeight,
65
+ spacerStyle: (itemCount: number) => ({
66
+ height: itemCount * itemHeight,
67
+ }),
68
+ };
69
+ },
70
+ };
71
+
72
+ export default VirtualColumnGenerator;
@@ -0,0 +1,13 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ const FlingItemOverlay: ?component(nativeID: string) = null;
12
+
13
+ export default FlingItemOverlay;
@@ -0,0 +1,43 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import ReactNativeElement from '../../../webapis/dom/nodes/ReactNativeElement';
12
+ import isScrollableNode from './isScrollableNode';
13
+
14
+ /**
15
+ * Finds the nearest ancestor of the supplied node that is a scrollable node.
16
+ *
17
+ * Unlike the web-equivalent function, the return type is nullable because the
18
+ * root is not an implicitly scrollable node.
19
+ */
20
+ export default function getScrollParent(
21
+ node: ReactNativeElement,
22
+ ): ReactNativeElement | null {
23
+ let element: ReactNativeElement | null = node;
24
+ while (element != null) {
25
+ if (isScrollableNode(element)) {
26
+ return element;
27
+ }
28
+ const parent = element.parentElement;
29
+ // Currently, the only subclass of `ReadOnlyNode` is `ReactNativeElement`.
30
+ if (parent instanceof ReactNativeElement || parent == null) {
31
+ element = parent;
32
+ } else {
33
+ console.error(
34
+ 'Expected `element.parentElement` to be `?ReactNativeElement`, got: %s',
35
+ parent,
36
+ );
37
+ element = null;
38
+ }
39
+ // So this is equivalent to a null check with type safety.
40
+ element = parent instanceof ReactNativeElement ? parent : null;
41
+ }
42
+ return null;
43
+ }
@@ -0,0 +1,22 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type ReactNativeElement from '../../../webapis/dom/nodes/ReactNativeElement';
12
+
13
+ /**
14
+ * Checks whether the supplied node is a scrollable node, ignoring whether
15
+ * there is sufficient content to scroll or whether scrolling is disabled.
16
+ */
17
+ export default function isScrollableNode(node: ReactNativeElement): boolean {
18
+ // Applies for vertical and horizontal `ScrollView` on both Android and iOS.
19
+ // The content container might have a different `nodeName`, but its parent
20
+ // always has this `nodeName`.
21
+ return node.nodeName === 'RN:ScrollView';
22
+ }
@@ -0,0 +1,43 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type {Item, VirtualCollection} from '../Virtual';
12
+
13
+ import {createVirtualCollectionView} from '../VirtualCollectionView';
14
+ import VirtualRowGenerator from './VirtualRowGenerator';
15
+ import * as React from 'react';
16
+
17
+ component VirtualRowLayout(
18
+ children: ReadonlyArray<React.Node>,
19
+ spacer: React.Node,
20
+ ) {
21
+ return (
22
+ <>
23
+ {children}
24
+ {spacer}
25
+ </>
26
+ );
27
+ }
28
+
29
+ const VirtualRow = createVirtualCollectionView(
30
+ VirtualRowLayout,
31
+ VirtualRowGenerator,
32
+ );
33
+
34
+ // TODO: Figure out component generic resolution.
35
+ // @see https://fb.workplace.com/groups/flow/posts/29355518614070041
36
+ // export default VirtualRow as VirtualCollectionViewComponent<VirtualRowLayoutProps>;
37
+ export default VirtualRow as component<+TItem extends Item>(
38
+ children: (item: TItem, key: string) => React.Node,
39
+ items: VirtualCollection<TItem>,
40
+ itemToKey?: (TItem) => string,
41
+ removeClippedSubviews?: boolean,
42
+ testID?: ?string,
43
+ );
@@ -0,0 +1,72 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import type ReadOnlyElement from '../../../webapis/dom/nodes/ReadOnlyElement';
12
+ import type {ModeChangeEvent} from '../../virtualview/VirtualView';
13
+ import type {VirtualCollectionGenerator} from '../VirtualCollectionView';
14
+
15
+ import ReactNativeElement from '../../../webapis/dom/nodes/ReactNativeElement';
16
+ import {
17
+ FALLBACK_ESTIMATED_WIDTH,
18
+ INITIAL_NUM_TO_RENDER,
19
+ } from '../FlingConstants';
20
+
21
+ function isVirtualView(element: ReadOnlyElement) {
22
+ // True for `VirtualView` and `VirtualViewExperimental`.
23
+ return element.nodeName.startsWith('RN:VirtualView');
24
+ }
25
+
26
+ const VirtualRowGenerator: VirtualCollectionGenerator = {
27
+ initial: {
28
+ itemCount: INITIAL_NUM_TO_RENDER,
29
+ spacerStyle: (itemCount: number) => ({
30
+ width: itemCount * FALLBACK_ESTIMATED_WIDTH,
31
+ }),
32
+ },
33
+ next({target, targetRect, thresholdRect}: ModeChangeEvent) {
34
+ if (!(target instanceof ReactNativeElement)) {
35
+ throw new Error(
36
+ 'Expected target to be a ReactNativeElement. VirtualRow requires DOM APIs to be enabled in React Native.',
37
+ );
38
+ }
39
+
40
+ const widthToFill =
41
+ Math.min(
42
+ targetRect.x + targetRect.width,
43
+ thresholdRect.x + thresholdRect.width,
44
+ ) - Math.max(targetRect.x, thresholdRect.x);
45
+
46
+ // Estimate each item's size by averaging up to the 3 last items.
47
+ let previous: ReadOnlyElement = target;
48
+ let count = 0;
49
+ let maybePrevious = previous.previousElementSibling;
50
+ while (count < 3 && maybePrevious != null && isVirtualView(maybePrevious)) {
51
+ previous = maybePrevious;
52
+ count++;
53
+ maybePrevious = previous.previousElementSibling;
54
+ }
55
+
56
+ const itemWidth =
57
+ count > 0
58
+ ? (target.getBoundingClientRect().left -
59
+ previous.getBoundingClientRect().left) /
60
+ count
61
+ : FALLBACK_ESTIMATED_WIDTH;
62
+
63
+ return {
64
+ itemCount: widthToFill / itemWidth,
65
+ spacerStyle: (itemCount: number) => ({
66
+ width: itemCount * itemWidth,
67
+ }),
68
+ };
69
+ },
70
+ };
71
+
72
+ export default VirtualRowGenerator;
@@ -26,14 +26,14 @@ export type ReactRenderer = {
26
26
  };
27
27
  type AttachedRendererEventPayload = {id: number, renderer: ReactRenderer};
28
28
 
29
- const reactDevToolsHook = (window: any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
29
+ const reactDevToolsHook = (window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
30
30
  invariant(
31
31
  Boolean(reactDevToolsHook),
32
32
  'getInspectorDataForViewAtPoint should not be used if React DevTools hook is not injected',
33
33
  );
34
34
 
35
35
  const renderers: Array<ReactRenderer> = Array.from(
36
- (window: any).__REACT_DEVTOOLS_GLOBAL_HOOK__.renderers.values(),
36
+ (window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__.renderers.values(),
37
37
  );
38
38
 
39
39
  const appendRenderer = ({renderer}: AttachedRendererEventPayload) =>
@@ -44,7 +44,7 @@ function ensureExternalInspectionAPI(
44
44
  disable: onDisable,
45
45
  };
46
46
  // $FlowFixMe[prop-missing] Initializing global API for DevTools communication
47
- (global: $FlowFixMe).__EXTERNAL_INSPECTION__ = api;
47
+ (global as $FlowFixMe).__EXTERNAL_INSPECTION__ = api;
48
48
  return api;
49
49
  }
50
50
  __EXTERNAL_INSPECTION__.enable = onEnable;