react-native-windows 0.75.3 → 0.76.0-preview.1

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 (310) hide show
  1. package/.flowconfig +6 -4
  2. package/Directory.Build.props +4 -0
  3. package/Directory.Build.targets +5 -0
  4. package/Libraries/Alert/Alert.js +3 -0
  5. package/Libraries/Alert/Alert.windows.js +3 -0
  6. package/Libraries/Animated/AnimatedEvent.js +1 -1
  7. package/Libraries/Animated/AnimatedImplementation.js +7 -7
  8. package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
  9. package/Libraries/Animated/animations/Animation.js +11 -1
  10. package/Libraries/Animated/animations/DecayAnimation.js +1 -1
  11. package/Libraries/Animated/animations/SpringAnimation.js +1 -1
  12. package/Libraries/Animated/animations/TimingAnimation.js +2 -1
  13. package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
  14. package/Libraries/Animated/createAnimatedComponent.js +10 -9
  15. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  16. package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
  17. package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
  18. package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
  19. package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
  20. package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
  21. package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
  22. package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
  23. package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
  24. package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
  25. package/Libraries/Animated/useAnimatedProps.js +142 -7
  26. package/Libraries/BatchedBridge/NativeModules.js +2 -0
  27. package/Libraries/Blob/FileReader.js +1 -1
  28. package/Libraries/Blob/URL.js +2 -62
  29. package/Libraries/Blob/URLSearchParams.js +71 -0
  30. package/Libraries/Components/Button.windows.js +0 -1
  31. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  32. package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
  33. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
  34. package/Libraries/Components/ScrollView/ScrollView.js +131 -169
  35. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  36. package/Libraries/Components/StatusBar/StatusBar.js +3 -1
  37. package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
  38. package/Libraries/Components/TextInput/TextInput.js +230 -94
  39. package/Libraries/Components/TextInput/TextInput.windows.js +230 -105
  40. package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
  41. package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
  42. package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +2 -0
  43. package/Libraries/Components/View/View.windows.js +32 -30
  44. package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  45. package/Libraries/Components/View/ViewNativeComponent.js +0 -1
  46. package/Libraries/Components/View/ViewPropTypes.js +14 -0
  47. package/Libraries/Components/View/ViewPropTypes.windows.js +14 -0
  48. package/Libraries/Core/ExceptionsManager.js +2 -0
  49. package/Libraries/Core/InitializeCore.js +3 -1
  50. package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
  51. package/Libraries/Core/ReactNativeVersion.js +4 -4
  52. package/Libraries/Core/setUpErrorHandling.js +7 -1
  53. package/Libraries/Core/setUpGlobals.js +1 -0
  54. package/Libraries/Core/setUpReactRefresh.js +0 -4
  55. package/Libraries/Image/AssetSourceResolver.js +28 -1
  56. package/Libraries/Image/AssetSourceResolver.windows.js +28 -1
  57. package/Libraries/Image/Image.android.js +9 -14
  58. package/Libraries/Image/Image.ios.js +11 -22
  59. package/Libraries/Image/Image.windows.js +11 -22
  60. package/Libraries/Image/ImageBackground.js +1 -8
  61. package/Libraries/Image/ImageUtils.js +9 -9
  62. package/Libraries/Image/ImageViewNativeComponent.js +1 -0
  63. package/Libraries/Inspector/Inspector.js +3 -2
  64. package/Libraries/Inspector/InspectorPanel.js +16 -10
  65. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  66. package/Libraries/Interaction/TaskQueue.js +1 -0
  67. package/Libraries/Lists/FlatList.js +1 -1
  68. package/Libraries/Lists/SectionList.js +2 -2
  69. package/Libraries/Lists/SectionListModern.js +3 -3
  70. package/Libraries/LogBox/Data/LogBoxData.js +24 -3
  71. package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
  72. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
  73. package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +9 -8
  74. package/Libraries/Modal/Modal.js +0 -1
  75. package/Libraries/NativeComponent/BaseViewConfig.android.js +8 -0
  76. package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
  77. package/Libraries/NativeComponent/BaseViewConfig.windows.js +7 -0
  78. package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
  79. package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
  80. package/Libraries/Network/XMLHttpRequest.js +4 -2
  81. package/Libraries/ReactNative/AppContainer-dev.js +1 -5
  82. package/Libraries/ReactNative/AppContainer-prod.js +1 -5
  83. package/Libraries/ReactNative/AppContainer.js +1 -2
  84. package/Libraries/ReactNative/AppRegistry.d.ts +0 -4
  85. package/Libraries/ReactNative/AppRegistry.js +1 -7
  86. package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
  87. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
  88. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
  89. package/Libraries/ReactNative/RendererImplementation.js +26 -4
  90. package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
  91. package/Libraries/ReactNative/renderApplication.js +1 -3
  92. package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
  93. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  94. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +74 -15
  95. package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
  96. package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
  97. package/Libraries/StyleSheet/processBoxShadow.js +211 -0
  98. package/Libraries/StyleSheet/processFilter.js +231 -42
  99. package/Libraries/Text/Text.js +394 -196
  100. package/Libraries/Text/Text.windows.js +476 -300
  101. package/Libraries/Text/TextNativeComponent.js +2 -1
  102. package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
  103. package/Libraries/Types/CodegenTypes.js +3 -1
  104. package/Libraries/Utilities/Appearance.js +108 -84
  105. package/Libraries/Utilities/DevLoadingView.js +2 -4
  106. package/Libraries/Utilities/HMRClient.js +2 -1
  107. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  108. package/Libraries/Utilities/createPerformanceLogger.js +0 -9
  109. package/Libraries/Utilities/stringifyViewConfig.js +22 -0
  110. package/Libraries/Utilities/useColorScheme.js +3 -3
  111. package/Libraries/WebSocket/WebSocket.js +1 -1
  112. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  113. package/Libraries/vendor/emitter/EventEmitter.js +6 -5
  114. package/Microsoft.ReactNative/ComponentView.idl +11 -0
  115. package/Microsoft.ReactNative/Composition.Input.idl +1 -0
  116. package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
  117. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +9 -9
  118. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +9 -9
  119. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +7 -9
  120. package/Microsoft.ReactNative/Fabric/ComponentView.h +5 -6
  121. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +4 -0
  122. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -0
  123. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
  124. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +42 -5
  125. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
  126. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +81 -63
  127. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -3
  128. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +8 -6
  129. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
  130. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
  131. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
  132. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +2 -3
  133. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
  134. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +72 -54
  135. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +14 -4
  136. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +26 -8
  137. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
  138. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -7
  139. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -2
  140. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +6 -6
  141. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +1 -2
  142. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +97 -140
  143. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -4
  144. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +18 -11
  145. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +5 -4
  146. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
  147. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
  148. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +29 -4
  149. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
  150. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
  151. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
  152. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +28 -12
  153. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +33 -0
  154. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +26 -9
  155. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +10 -4
  156. package/Microsoft.ReactNative/IReactModuleBuilder.cpp +5 -0
  157. package/Microsoft.ReactNative/IReactModuleBuilder.h +1 -0
  158. package/Microsoft.ReactNative/IReactModuleBuilder.idl +9 -0
  159. package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -1
  160. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
  161. package/Microsoft.ReactNative/Modules/AlertModule.cpp +3 -1
  162. package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -1
  163. package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -1
  164. package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +3 -3
  165. package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
  166. package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +2 -2
  167. package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
  168. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
  169. package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
  170. package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +121 -0
  171. package/Microsoft.ReactNative/Modules/SampleTurboModule.h +90 -0
  172. package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
  173. package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
  174. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +5 -1
  175. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
  176. package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
  177. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
  178. package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
  179. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
  180. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -0
  181. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
  182. package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
  183. package/Microsoft.ReactNative/TurboModulesProvider.cpp +45 -0
  184. package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -1
  185. package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +25 -16
  186. package/Microsoft.ReactNative/packages.fabric.lock.json +159 -0
  187. package/Microsoft.ReactNative/packages.lock.json +11 -12
  188. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -4
  189. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
  190. package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +2 -2
  191. package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +62 -4
  192. package/Microsoft.ReactNative.Cxx/NativeModules.h +131 -14
  193. package/Microsoft.ReactNative.Managed/packages.lock.json +9 -9
  194. package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +10 -2
  195. package/PropertySheets/Autolink.props +1 -1
  196. package/PropertySheets/Bundle.props +1 -1
  197. package/PropertySheets/Codegen.props +1 -1
  198. package/PropertySheets/Generated/PackageVersion.g.props +4 -4
  199. package/PropertySheets/NuGet.LockFile.props +18 -0
  200. package/README.md +29 -29
  201. package/ReactCommon/ReactCommon.vcxproj +5 -1
  202. package/ReactCommon/ReactCommon.vcxproj.filters +11 -2
  203. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -7
  204. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +441 -0
  205. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +266 -0
  206. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +56 -0
  207. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +3 -1
  208. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -2
  209. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
  210. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Convert.h +172 -0
  211. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +4 -5
  212. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +2 -2
  213. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +1 -1
  214. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +3 -2
  215. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +9 -0
  216. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +363 -0
  217. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +22 -2
  218. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +118 -51
  219. package/ReactCommon/packages.lock.json +2 -2
  220. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +8 -1
  221. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -2
  222. package/Shared/Modules/WebSocketModule.cpp +1 -2
  223. package/Shared/Networking/WinRTWebSocketResource.cpp +4 -1
  224. package/Shared/Shared.vcxitems +38 -2
  225. package/Shared/Shared.vcxitems.filters +6 -1
  226. package/Shared/TurboModuleManager.cpp +0 -3
  227. package/codegen/NativeLinkingManagerSpec.g.h +3 -3
  228. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +198 -54
  229. package/codegen/NativeSampleTurboModuleSpec.g.h +35 -0
  230. package/codegen/rnwcoreJSI-generated.cpp +245 -101
  231. package/codegen/rnwcoreJSI.h +847 -548
  232. package/index.js +3 -1
  233. package/index.windows.js +3 -1
  234. package/jest/mockComponent.js +4 -1
  235. package/jest/mockModal.js +1 -3
  236. package/jest/mockScrollView.js +1 -1
  237. package/jest/renderer.js +2 -2
  238. package/jest/setup.js +16 -13
  239. package/package.json +26 -25
  240. package/src/private/animated/NativeAnimatedHelper.js +438 -0
  241. package/src/private/animated/NativeAnimatedValidation.js +64 -0
  242. package/src/private/components/HScrollViewNativeComponents.js +56 -0
  243. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +27 -0
  244. package/src/private/components/VScrollViewNativeComponents.js +48 -0
  245. package/src/private/components/useSyncOnScroll.js +48 -0
  246. package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
  247. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
  248. package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
  249. package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
  250. package/src/private/setup/setUpDOM.js +28 -0
  251. package/src/private/setup/setUpIntersectionObserver.js +27 -0
  252. package/src/private/setup/setUpMutationObserver.js +26 -0
  253. package/src/private/setup/setUpPerformanceObserver.js +64 -0
  254. package/src/private/specs/modules/NativeAppearance.js +3 -3
  255. package/src/private/specs/modules/NativeLinkingManager.js +1 -1
  256. package/src/private/specs/modules/NativePlatformConstantsWindows.js +7 -0
  257. package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
  258. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
  259. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
  260. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
  261. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
  262. package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
  263. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
  264. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
  265. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
  266. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
  267. package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
  268. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
  269. package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
  270. package/src/private/webapis/performance/LongTasks.js +39 -0
  271. package/src/private/webapis/performance/Performance.js +22 -9
  272. package/src/private/webapis/performance/PerformanceEntry.js +36 -18
  273. package/src/private/webapis/performance/PerformanceObserver.js +29 -43
  274. package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
  275. package/src/private/webapis/performance/UserTiming.js +17 -12
  276. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
  277. package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +1 -1
  278. package/template/cpp-app/src/AutolinkedNativeModules.g.h +1 -1
  279. package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
  280. package/template/index.windows.bundle +1 -1
  281. package/template/metro.config.js +2 -2
  282. package/template/shared-app/src/AutolinkedNativeModules.g.props +1 -1
  283. package/template/shared-app/src/AutolinkedNativeModules.g.targets +1 -1
  284. package/templates/cpp-app/metro.config.js +2 -2
  285. package/templates/cpp-app/template.config.js +5 -5
  286. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +1 -1
  287. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +1 -1
  288. package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -0
  289. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
  290. package/templates/cpp-lib/example/metro.config.js +2 -2
  291. package/templates/cpp-lib/template.config.js +3 -3
  292. package/templates/cpp-lib/windows/MyLib/MyLib.h +3 -3
  293. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
  294. package/types/experimental.d.ts +20 -1
  295. package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
  296. package/Libraries/Core/setUpIntersectionObserver.js +0 -16
  297. package/Libraries/Core/setUpMutationObserver.js +0 -16
  298. package/Libraries/Core/setUpPerformanceObserver.js +0 -18
  299. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
  300. package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
  301. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
  302. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2396
  303. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -136
  304. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
  305. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +0 -48
  306. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +0 -122
  307. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +0 -388
  308. package/src/private/core/setUpDOM.js +0 -18
  309. package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
  310. /package/src/private/{core → styles}/composeStyles.js +0 -0
@@ -16,8 +16,9 @@ import type {TextProps} from './TextProps';
16
16
  import {createViewConfig} from '../NativeComponent/ViewConfig';
17
17
  import UIManager from '../ReactNative/UIManager';
18
18
  import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
19
+ import Platform from '../Utilities/Platform';
19
20
 
20
- type NativeTextProps = $ReadOnly<{
21
+ export type NativeTextProps = $ReadOnly<{
21
22
  ...TextProps,
22
23
  isHighlighted?: ?boolean,
23
24
  selectionColor?: ?ProcessedColorValue,
@@ -16,52 +16,25 @@ const NativeModules = require('../BatchedBridge/NativeModules');
16
16
 
17
17
  const turboModuleProxy = global.__turboModuleProxy;
18
18
 
19
- const moduleLoadHistory = {
20
- NativeModules: ([]: Array<string>),
21
- TurboModules: ([]: Array<string>),
22
- NotFound: ([]: Array<string>),
23
- };
19
+ const useLegacyNativeModuleInterop =
20
+ global.RN$Bridgeless !== true || global.RN$TurboInterop === true;
24
21
 
25
- function isBridgeless() {
26
- return global.RN$Bridgeless === true;
27
- }
28
-
29
- function isTurboModuleInteropEnabled() {
30
- return global.RN$TurboInterop === true;
31
- }
32
-
33
- // TODO(154308585): Remove "module not found" debug info logging
34
- function shouldReportDebugInfo() {
35
- return true;
36
- }
37
-
38
- // TODO(148943970): Consider reversing the lookup here:
39
- // Lookup on __turboModuleProxy, then lookup on nativeModuleProxy
40
22
  function requireModule<T: TurboModule>(name: string): ?T {
41
- if (!isBridgeless() || isTurboModuleInteropEnabled()) {
42
- // Backward compatibility layer during migration.
43
- const legacyModule = NativeModules[name];
44
- if (legacyModule != null) {
45
- if (shouldReportDebugInfo()) {
46
- moduleLoadHistory.NativeModules.push(name);
47
- }
48
- return ((legacyModule: $FlowFixMe): T);
49
- }
50
- }
51
-
52
23
  if (turboModuleProxy != null) {
53
24
  const module: ?T = turboModuleProxy(name);
54
25
  if (module != null) {
55
- if (shouldReportDebugInfo()) {
56
- moduleLoadHistory.TurboModules.push(name);
57
- }
58
26
  return module;
59
27
  }
60
28
  }
61
29
 
62
- if (shouldReportDebugInfo() && !moduleLoadHistory.NotFound.includes(name)) {
63
- moduleLoadHistory.NotFound.push(name);
30
+ if (useLegacyNativeModuleInterop) {
31
+ // Backward compatibility layer during migration.
32
+ const legacyModule: ?T = NativeModules[name];
33
+ if (legacyModule != null) {
34
+ return legacyModule;
35
+ }
64
36
  }
37
+
65
38
  return null;
66
39
  }
67
40
 
@@ -71,20 +44,10 @@ export function get<T: TurboModule>(name: string): ?T {
71
44
 
72
45
  export function getEnforcing<T: TurboModule>(name: string): T {
73
46
  const module = requireModule<T>(name);
74
- let message =
47
+ invariant(
48
+ module != null,
75
49
  `TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
76
- 'Verify that a module by this name is registered in the native binary.';
77
-
78
- if (shouldReportDebugInfo()) {
79
- message +=
80
- ' Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
81
- message +=
82
- 'TurboModule interop: ' +
83
- (isTurboModuleInteropEnabled() ? 'true' : 'false') +
84
- '. ';
85
- message += 'Modules loaded: ' + JSON.stringify(moduleLoadHistory);
86
- }
87
-
88
- invariant(module != null, message);
50
+ 'Verify that a module by this name is registered in the native binary.',
51
+ );
89
52
  return module;
90
53
  }
@@ -42,4 +42,6 @@ type DefaultTypes = number | boolean | string | $ReadOnlyArray<string>;
42
42
  // eslint-disable-next-line no-unused-vars
43
43
  export type WithDefault<Type: DefaultTypes, Value: ?Type | string> = ?Type;
44
44
 
45
- export type EventEmitter<T> = (handler: (T) => mixed) => EventSubscription;
45
+ export type EventEmitter<T> = (
46
+ handler: (T) => void | Promise<void>,
47
+ ) => EventSubscription;
@@ -8,100 +8,124 @@
8
8
  * @flow strict-local
9
9
  */
10
10
 
11
+ import type {EventSubscription} from '../vendor/emitter/EventEmitter';
12
+ import type {AppearancePreferences, ColorSchemeName} from './NativeAppearance';
13
+ import typeof INativeAppearance from './NativeAppearance';
14
+
11
15
  import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
12
- import Platform from '../Utilities/Platform';
13
- import EventEmitter, {
14
- type EventSubscription,
15
- } from '../vendor/emitter/EventEmitter';
16
+ import EventEmitter from '../vendor/emitter/EventEmitter';
16
17
  import {isAsyncDebugging} from './DebugEnvironment';
17
- import NativeAppearance, {
18
- type AppearancePreferences,
19
- type ColorSchemeName,
20
- } from './NativeAppearance';
21
18
  import invariant from 'invariant';
22
19
 
23
- type AppearanceListener = (preferences: AppearancePreferences) => void;
24
- const eventEmitter = new EventEmitter<{
25
- change: [AppearancePreferences],
26
- }>();
20
+ type Appearance = {
21
+ colorScheme: ?ColorSchemeName,
22
+ };
27
23
 
28
- type NativeAppearanceEventDefinitions = {
29
- appearanceChanged: [AppearancePreferences],
24
+ let lazyState: ?{
25
+ +NativeAppearance: INativeAppearance,
26
+ // Cache the color scheme to reduce the cost of reading it between changes.
27
+ // NOTE: If `NativeAppearance` is null, this will always be null.
28
+ appearance: ?Appearance,
29
+ // NOTE: This is non-nullable to make it easier for `onChangedListener` to
30
+ // return a non-nullable `EventSubscription` value. This is not the common
31
+ // path, so we do not have to over-optimize it.
32
+ +eventEmitter: EventEmitter<{change: [Appearance]}>,
30
33
  };
31
34
 
32
- if (NativeAppearance) {
33
- const nativeEventEmitter =
34
- new NativeEventEmitter<NativeAppearanceEventDefinitions>(
35
- // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior
36
- // If you want to use the native module on other platforms, please remove this condition and test its behavior
37
- Platform.OS !== 'ios' ? null : NativeAppearance,
38
- );
39
- nativeEventEmitter.addListener(
40
- 'appearanceChanged',
41
- (newAppearance: AppearancePreferences) => {
42
- const {colorScheme} = newAppearance;
43
- invariant(
44
- colorScheme === 'dark' ||
45
- colorScheme === 'light' ||
46
- colorScheme == null,
47
- "Unrecognized color scheme. Did you mean 'dark' or 'light'?",
48
- );
49
- eventEmitter.emit('change', {colorScheme});
50
- },
51
- );
35
+ /**
36
+ * Ensures that all state and listeners are lazily initialized correctly.
37
+ */
38
+ function getState(): $NonMaybeType<typeof lazyState> {
39
+ if (lazyState != null) {
40
+ return lazyState;
41
+ }
42
+ const eventEmitter = new EventEmitter<{change: [Appearance]}>();
43
+ // NOTE: Avoid initializing `NativeAppearance` until it is actually used.
44
+ const NativeAppearance = require('./NativeAppearance').default;
45
+ if (NativeAppearance == null) {
46
+ // Assign `null` to avoid re-initializing on subsequent invocations.
47
+ lazyState = {
48
+ NativeAppearance: null,
49
+ appearance: null,
50
+ eventEmitter,
51
+ };
52
+ } else {
53
+ const state: $NonMaybeType<typeof lazyState> = {
54
+ NativeAppearance,
55
+ appearance: null,
56
+ eventEmitter,
57
+ };
58
+ new NativeEventEmitter<{
59
+ appearanceChanged: [AppearancePreferences],
60
+ }>(NativeAppearance).addListener('appearanceChanged', newAppearance => {
61
+ state.appearance = {
62
+ colorScheme: toColorScheme(newAppearance.colorScheme),
63
+ };
64
+ eventEmitter.emit('change', state.appearance);
65
+ });
66
+ lazyState = state;
67
+ }
68
+ return lazyState;
52
69
  }
53
70
 
54
- module.exports = {
55
- /**
56
- * Note: Although color scheme is available immediately, it may change at any
57
- * time. Any rendering logic or styles that depend on this should try to call
58
- * this function on every render, rather than caching the value (for example,
59
- * using inline styles rather than setting a value in a `StyleSheet`).
60
- *
61
- * Example: `const colorScheme = Appearance.getColorScheme();`
62
- *
63
- * @returns {?ColorSchemeName} Value for the color scheme preference.
64
- */
65
- getColorScheme(): ?ColorSchemeName {
66
- if (__DEV__) {
67
- if (isAsyncDebugging) {
68
- // Hard code light theme when using the async debugger as
69
- // sync calls aren't supported
70
- return 'light';
71
- }
71
+ /**
72
+ * Returns the current color scheme preference. This value may change, so the
73
+ * value should not be cached without either listening to changes or using
74
+ * the `useColorScheme` hook.
75
+ */
76
+ export function getColorScheme(): ?ColorSchemeName {
77
+ if (__DEV__) {
78
+ if (isAsyncDebugging) {
79
+ // Hard code light theme when using the async debugger as
80
+ // sync calls aren't supported
81
+ return 'light';
72
82
  }
83
+ }
84
+ let colorScheme = null;
85
+ const state = getState();
86
+ const {NativeAppearance} = state;
87
+ if (NativeAppearance != null) {
88
+ if (state.appearance == null) {
89
+ // Lazily initialize `state.appearance`. This should only
90
+ // happen once because we never reassign a null value to it.
91
+ state.appearance = {
92
+ colorScheme: toColorScheme(NativeAppearance.getColorScheme()),
93
+ };
94
+ }
95
+ colorScheme = state.appearance.colorScheme;
96
+ }
97
+ return colorScheme;
98
+ }
73
99
 
74
- // TODO: (hramos) T52919652 Use ?ColorSchemeName once codegen supports union
75
- const nativeColorScheme: ?string =
76
- NativeAppearance == null
77
- ? null
78
- : NativeAppearance.getColorScheme() || null;
79
- invariant(
80
- nativeColorScheme === 'dark' ||
81
- nativeColorScheme === 'light' ||
82
- nativeColorScheme == null,
83
- "Unrecognized color scheme. Did you mean 'dark' or 'light'?",
84
- );
85
- return nativeColorScheme;
86
- },
87
-
88
- setColorScheme(colorScheme: ?ColorSchemeName): void {
89
- const nativeColorScheme = colorScheme == null ? 'unspecified' : colorScheme;
90
-
91
- invariant(
92
- colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null,
93
- "Unrecognized color scheme. Did you mean 'dark', 'light' or null?",
94
- );
100
+ /**
101
+ * Updates the current color scheme to the supplied value.
102
+ */
103
+ export function setColorScheme(colorScheme: ?ColorSchemeName): void {
104
+ const state = getState();
105
+ const {NativeAppearance} = state;
106
+ if (NativeAppearance != null) {
107
+ NativeAppearance.setColorScheme(colorScheme ?? 'unspecified');
108
+ state.appearance = {colorScheme};
109
+ }
110
+ }
95
111
 
96
- if (NativeAppearance != null && NativeAppearance.setColorScheme != null) {
97
- NativeAppearance.setColorScheme(nativeColorScheme);
98
- }
99
- },
112
+ /**
113
+ * Add an event handler that is fired when appearance preferences change.
114
+ */
115
+ export function addChangeListener(
116
+ listener: ({colorScheme: ?ColorSchemeName}) => void,
117
+ ): EventSubscription {
118
+ const {eventEmitter} = getState();
119
+ return eventEmitter.addListener('change', listener);
120
+ }
100
121
 
101
- /**
102
- * Add an event handler that is fired when appearance preferences change.
103
- */
104
- addChangeListener(listener: AppearanceListener): EventSubscription {
105
- return eventEmitter.addListener('change', listener);
106
- },
107
- };
122
+ /**
123
+ * TODO: (hramos) T52919652 Use ?ColorSchemeName once codegen supports union
124
+ */
125
+ function toColorScheme(colorScheme: ?string): ?ColorSchemeName {
126
+ invariant(
127
+ colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null,
128
+ "Unrecognized color scheme. Did you mean 'dark', 'light' or null?",
129
+ );
130
+ return colorScheme;
131
+ }
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import processColor from '../StyleSheet/processColor';
12
- import Appearance from './Appearance';
12
+ import {getColorScheme} from './Appearance';
13
13
  import NativeDevLoadingView from './NativeDevLoadingView';
14
14
 
15
15
  const COLOR_SCHEME = {
@@ -39,9 +39,7 @@ module.exports = {
39
39
  showMessage(message: string, type: 'load' | 'refresh') {
40
40
  if (NativeDevLoadingView) {
41
41
  const colorScheme =
42
- Appearance.getColorScheme() === 'dark'
43
- ? COLOR_SCHEME.dark
44
- : COLOR_SCHEME.default;
42
+ getColorScheme() === 'dark' ? COLOR_SCHEME.dark : COLOR_SCHEME.default;
45
43
 
46
44
  const colorSet = colorScheme[type];
47
45
 
@@ -126,7 +126,7 @@ const HMRClient: HMRClientNativeInterface = {
126
126
  data: data.map(item =>
127
127
  typeof item === 'string'
128
128
  ? item
129
- : prettyFormat(item, {
129
+ : prettyFormat.format(item, {
130
130
  escapeString: true,
131
131
  highlight: true,
132
132
  maxDepth: 3,
@@ -379,6 +379,7 @@ function showCompileError() {
379
379
 
380
380
  /* $FlowFixMe[class-object-subtyping] added when improving typing for this
381
381
  * parameters */
382
+ // $FlowFixMe[incompatible-type]
382
383
  const error: ExtendedError = new Error(message);
383
384
  // Symbolicating compile errors is wasted effort
384
385
  // because the stack trace is meaningless:
@@ -115,7 +115,7 @@ function expectNoConsoleError() {
115
115
 
116
116
  async function expectRendersMatchingSnapshot(
117
117
  name: string,
118
- ComponentProvider: () => React.Element<any>,
118
+ ComponentProvider: () => React.MixedElement,
119
119
  unmockComponent: () => mixed,
120
120
  ) {
121
121
  let instance;
@@ -15,11 +15,8 @@ import type {
15
15
  Timespan,
16
16
  } from './IPerformanceLogger';
17
17
 
18
- import * as Systrace from '../Performance/Systrace';
19
18
  import infoLog from './infoLog';
20
19
 
21
- const _cookies: {[key: string]: number, ...} = {};
22
-
23
20
  const PRINT_TO_CONSOLE: false = false; // Type as false to prevent accidentally committing `true`;
24
21
 
25
22
  export const getCurrentTimestamp: () => number =
@@ -233,7 +230,6 @@ class PerformanceLogger implements IPerformanceLogger {
233
230
  startTime: timestamp,
234
231
  startExtras: extras,
235
232
  };
236
- _cookies[key] = Systrace.beginAsyncEvent(key);
237
233
  if (PRINT_TO_CONSOLE) {
238
234
  infoLog('PerformanceLogger.js', 'start: ' + key);
239
235
  }
@@ -277,11 +273,6 @@ class PerformanceLogger implements IPerformanceLogger {
277
273
  if (PRINT_TO_CONSOLE) {
278
274
  infoLog('PerformanceLogger.js', 'end: ' + key);
279
275
  }
280
-
281
- if (_cookies[key] != null) {
282
- Systrace.endAsyncEvent(key, _cookies[key]);
283
- delete _cookies[key];
284
- }
285
276
  }
286
277
  }
287
278
 
@@ -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
+ * @format
8
+ * @flow
9
+ */
10
+
11
+ export default function stringifyViewConfig(viewConfig: any): string {
12
+ return JSON.stringify(
13
+ viewConfig,
14
+ (key, val) => {
15
+ if (typeof val === 'function') {
16
+ return `ƒ ${val.name}`;
17
+ }
18
+ return val;
19
+ },
20
+ 2,
21
+ );
22
+ }
@@ -12,14 +12,14 @@
12
12
 
13
13
  import type {ColorSchemeName} from './NativeAppearance';
14
14
 
15
- import Appearance from './Appearance';
15
+ import {addChangeListener, getColorScheme} from './Appearance';
16
16
  import {useSyncExternalStore} from 'react';
17
17
 
18
18
  const subscribe = (onStoreChange: () => void) => {
19
- const appearanceSubscription = Appearance.addChangeListener(onStoreChange);
19
+ const appearanceSubscription = addChangeListener(onStoreChange);
20
20
  return () => appearanceSubscription.remove();
21
21
  };
22
22
 
23
23
  export default function useColorScheme(): ?ColorSchemeName {
24
- return useSyncExternalStore(subscribe, Appearance.getColorScheme);
24
+ return useSyncExternalStore(subscribe, getColorScheme);
25
25
  }
@@ -68,7 +68,7 @@ type WebSocketEventDefinitions = {
68
68
  * See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
69
69
  * See https://github.com/websockets/ws
70
70
  */
71
- class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
71
+ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): typeof EventTarget) {
72
72
  static CONNECTING: number = CONNECTING;
73
73
  static OPEN: number = OPEN;
74
74
  static CLOSING: number = CLOSING;
@@ -27,7 +27,7 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
27
27
  stack = error.stack;
28
28
  } else {
29
29
  try {
30
- message = require('pretty-format')(rejection);
30
+ message = require('pretty-format').format(rejection);
31
31
  } catch {
32
32
  message =
33
33
  typeof rejection === 'string'
@@ -35,11 +35,9 @@ interface Registration<TArgs> {
35
35
  +remove: () => void;
36
36
  }
37
37
 
38
- // $FlowFixMe[deprecated-type]
39
- type Registry<TEventToArgsMap: {...}> = $ObjMap<
40
- TEventToArgsMap,
41
- <TArgs>(TArgs) => Set<Registration<TArgs>>,
42
- >;
38
+ type Registry<TEventToArgsMap: {...}> = {
39
+ [K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
40
+ };
43
41
 
44
42
  /**
45
43
  * EventEmitter manages listeners and publishes events to them.
@@ -64,6 +62,7 @@ type Registry<TEventToArgsMap: {...}> = $ObjMap<
64
62
  export default class EventEmitter<TEventToArgsMap: {...}>
65
63
  implements IEventEmitter<TEventToArgsMap>
66
64
  {
65
+ // $FlowFixMe[incompatible-type]
67
66
  #registry: Registry<TEventToArgsMap> = {};
68
67
 
69
68
  /**
@@ -113,6 +112,7 @@ export default class EventEmitter<TEventToArgsMap: {...}>
113
112
  // Copy `registrations` to take a snapshot when we invoke `emit`, in case
114
113
  // registrations are added or removed when listeners are invoked.
115
114
  for (const registration of Array.from(registrations)) {
115
+ // $FlowFixMe[incompatible-call]
116
116
  registration.listener.apply(registration.context, args);
117
117
  }
118
118
  }
@@ -125,6 +125,7 @@ export default class EventEmitter<TEventToArgsMap: {...}>
125
125
  eventType?: ?TEvent,
126
126
  ): void {
127
127
  if (eventType == null) {
128
+ // $FlowFixMe[incompatible-type]
128
129
  this.#registry = {};
129
130
  } else {
130
131
  delete this.#registry[eventType];
@@ -34,6 +34,15 @@ namespace Microsoft.ReactNative
34
34
  All = 0x0000000F,
35
35
  };
36
36
 
37
+ enum FocusNavigationDirection
38
+ {
39
+ None,
40
+ Next,
41
+ Previous,
42
+ First,
43
+ Last,
44
+ };
45
+
37
46
  [webhosthidden]
38
47
  [experimental]
39
48
  interface IComponentState
@@ -46,6 +55,7 @@ namespace Microsoft.ReactNative
46
55
  [experimental]
47
56
  [webhosthidden]
48
57
  runtimeclass LosingFocusEventArgs : Microsoft.ReactNative.Composition.Input.RoutedEventArgs {
58
+ FocusNavigationDirection Direction { get; };
49
59
  Microsoft.ReactNative.ComponentView NewFocusedComponent { get; };
50
60
  Microsoft.ReactNative.ComponentView OldFocusedComponent { get; };
51
61
 
@@ -56,6 +66,7 @@ namespace Microsoft.ReactNative
56
66
  [experimental]
57
67
  [webhosthidden]
58
68
  runtimeclass GettingFocusEventArgs : Microsoft.ReactNative.Composition.Input.RoutedEventArgs {
69
+ FocusNavigationDirection Direction { get; };
59
70
  Microsoft.ReactNative.ComponentView NewFocusedComponent { get; };
60
71
  Microsoft.ReactNative.ComponentView OldFocusedComponent { get; };
61
72
 
@@ -106,6 +106,7 @@ namespace Microsoft.ReactNative.Composition.Input
106
106
  UInt64 Timestamp { get; };
107
107
  PointerPoint GetOffsetPoint(
108
108
  Windows.Foundation.Point offset);
109
+ Microsoft.UI.Input.PointerPoint Inner { get; };
109
110
  };
110
111
 
111
112
  runtimeclass PointerRoutedEventArgs : RoutedEventArgs
@@ -3,6 +3,7 @@
3
3
 
4
4
  #include "NamespaceRedirect.h"
5
5
  #include "DocString.h"
6
+ import "Composition.Input.idl";
6
7
 
7
8
  namespace Microsoft.ReactNative.Composition.Experimental
8
9
  {
@@ -112,6 +113,8 @@ namespace Microsoft.ReactNative.Composition.Experimental
112
113
  Windows.Foundation.Numerics.Vector3 ScrollPosition { get; };
113
114
  void ScrollBy(Windows.Foundation.Numerics.Vector3 offset, Boolean animate);
114
115
  void TryUpdatePosition(Windows.Foundation.Numerics.Vector3 position, Boolean animate);
116
+ void OnPointerPressed(Microsoft.ReactNative.Composition.Input.PointerRoutedEventArgs args);
117
+ Boolean Horizontal;
115
118
  }
116
119
 
117
120
  [webhosthidden]
@@ -109,14 +109,14 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps(
109
109
  ->CreateProps(nullptr);
110
110
  shadowNodeProps->SetUserProps(userProps);
111
111
 
112
- rawProps.iterateOverValues(
113
- [&](facebook::react::RawPropsPropNameHash hash, const char *propName, facebook::react::RawValue const &fn) {
114
- shadowNodeProps.get()->setProp(context, hash, propName, fn);
115
- userProps.SetProp(
116
- hash,
117
- winrt::to_hstring(propName),
118
- winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(folly::dynamic(fn)));
119
- });
112
+ const auto &dynamic = static_cast<folly::dynamic>(rawProps);
113
+ for (const auto &pair : dynamic.items()) {
114
+ const auto &propName = pair.first.getString();
115
+ auto hash = RAW_PROPS_KEY_HASH(propName);
116
+ shadowNodeProps.get()->setProp(context, hash, propName.c_str(), facebook::react::RawValue(pair.second));
117
+ userProps.SetProp(
118
+ hash, winrt::to_hstring(propName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(pair.second));
119
+ }
120
120
 
121
121
  return shadowNodeProps;
122
122
  };
@@ -162,7 +162,7 @@ facebook::react::State::Shared AbiComponentDescriptor::createState(
162
162
  facebook::react::ShadowNodeFamily::Shared AbiComponentDescriptor::createFamily(
163
163
  facebook::react::ShadowNodeFamilyFragment const &fragment) const {
164
164
  auto eventEmitter = std::make_shared<const ConcreteEventEmitter>(
165
- std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle), eventDispatcher_);
165
+ std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle, fragment.surfaceId), eventDispatcher_);
166
166
  return std::make_shared<facebook::react::ShadowNodeFamily>(
167
167
  fragment, std::move(eventEmitter), eventDispatcher_, *this);
168
168
  }
@@ -106,14 +106,14 @@ facebook::react::Props::Shared AbiViewComponentDescriptor::cloneProps(
106
106
  ->CreateProps(viewProps);
107
107
  shadowNodeProps->SetUserProps(userProps, viewProps);
108
108
 
109
- rawProps.iterateOverValues(
110
- [&](facebook::react::RawPropsPropNameHash hash, const char *propName, facebook::react::RawValue const &fn) {
111
- shadowNodeProps.get()->setProp(context, hash, propName, fn);
112
- userProps.SetProp(
113
- hash,
114
- winrt::to_hstring(propName),
115
- winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(folly::dynamic(fn)));
116
- });
109
+ const auto &dynamic = static_cast<folly::dynamic>(rawProps);
110
+ for (const auto &pair : dynamic.items()) {
111
+ const auto &propName = pair.first.getString();
112
+ auto hash = RAW_PROPS_KEY_HASH(propName);
113
+ shadowNodeProps.get()->setProp(context, hash, propName.c_str(), facebook::react::RawValue(pair.second));
114
+ userProps.SetProp(
115
+ hash, winrt::to_hstring(propName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(pair.second));
116
+ }
117
117
 
118
118
  return shadowNodeProps;
119
119
  };
@@ -157,7 +157,7 @@ facebook::react::State::Shared AbiViewComponentDescriptor::createState(
157
157
  facebook::react::ShadowNodeFamily::Shared AbiViewComponentDescriptor::createFamily(
158
158
  facebook::react::ShadowNodeFamilyFragment const &fragment) const {
159
159
  auto eventEmitter = std::make_shared<const ConcreteEventEmitter>(
160
- std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle), eventDispatcher_);
160
+ std::make_shared<facebook::react::EventTarget>(fragment.instanceHandle, fragment.surfaceId), eventDispatcher_);
161
161
  return std::make_shared<facebook::react::ShadowNodeFamily>(
162
162
  fragment, std::move(eventEmitter), eventDispatcher_, *this);
163
163
  }