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
@@ -72,9 +72,10 @@ HRESULT UiaNavigateHelper(
72
72
  auto parentCV = view.Parent().as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>();
73
73
  if (parentCV != nullptr) {
74
74
  auto children = parentCV->Children();
75
- for (auto it = children.end(); it != children.begin(); --it) {
76
- if (*it == view) {
77
- uiaProvider = (*it)
75
+ for (auto i = children.Size() - 1; i > 0; i--) {
76
+ auto child = children.GetAt(i);
77
+ if (child == view) {
78
+ uiaProvider = children.GetAt(i - 1)
78
79
  .as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>()
79
80
  ->EnsureUiaProvider();
80
81
  break;
@@ -121,7 +122,9 @@ HRESULT UiaSetFocusHelper(::Microsoft::ReactNative::ReactTaggedView &view) noexc
121
122
  if (rootCV == nullptr)
122
123
  return UIA_E_ELEMENTNOTAVAILABLE;
123
124
 
124
- return rootCV->TrySetFocusedComponent(strongView) ? S_OK : E_FAIL;
125
+ return rootCV->TrySetFocusedComponent(strongView, winrt::Microsoft::ReactNative::FocusNavigationDirection::None)
126
+ ? S_OK
127
+ : E_FAIL;
125
128
  }
126
129
 
127
130
  bool WasUiaPropertyAdvised(winrt::com_ptr<IRawElementProviderSimple> &providerSimple, PROPERTYID propId) noexcept {
@@ -181,4 +184,26 @@ std::string extractAccessibilityValue(const facebook::react::AccessibilityValue
181
184
  }
182
185
  }
183
186
 
187
+ void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept {
188
+ auto strongView = view.view();
189
+
190
+ if (!strongView)
191
+ return;
192
+
193
+ auto baseView = strongView.try_as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>();
194
+ if (baseView == nullptr)
195
+ return;
196
+
197
+ auto props = std::static_pointer_cast<const facebook::react::ViewProps>(baseView->props());
198
+ if (props == nullptr)
199
+ return;
200
+
201
+ auto accessibilityActions = props->accessibilityActions;
202
+ for (size_t i = 0; i < accessibilityActions.size(); i++) {
203
+ if (accessibilityActions[i].name == action) {
204
+ baseView->GetEventEmitter()->onAccessibilityAction(action);
205
+ }
206
+ }
207
+ }
208
+
184
209
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -33,4 +33,6 @@ long GetLiveSetting(const std::string &liveRegion) noexcept;
33
33
 
34
34
  std::string extractAccessibilityValue(const facebook::react::AccessibilityValue &value) noexcept;
35
35
 
36
+ void DispatchAccessibilityAction(::Microsoft::ReactNative::ReactTaggedView &view, const std::string &action) noexcept;
37
+
36
38
  } // namespace winrt::Microsoft::ReactNative::implementation
@@ -37,8 +37,7 @@ winrt::Microsoft::ReactNative::ComponentView UnimplementedNativeViewComponentVie
37
37
  }
38
38
 
39
39
  void UnimplementedNativeViewComponentView::HandleCommand(
40
- winrt::hstring commandName,
41
- const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept {
40
+ const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
42
41
  // Do not call base to avoid unknown command asserts
43
42
  }
44
43
 
@@ -25,8 +25,7 @@ struct UnimplementedNativeViewComponentView
25
25
  facebook::react::LayoutMetrics const &layoutMetrics,
26
26
  facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
27
27
 
28
- void HandleCommand(winrt::hstring commandName, const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept
29
- override;
28
+ void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
30
29
 
31
30
  UnimplementedNativeViewComponentView(
32
31
  const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
@@ -2,12 +2,15 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  #include "pch.h"
5
+ #include "HandleCommandArgs.g.cpp"
6
+ #include "HandleCommandArgs.g.h"
5
7
  #include <AsynchronousEventBeat.h>
6
8
  #include <DynamicReader.h>
7
9
  #include <DynamicWriter.h>
8
10
  #include <Fabric/ComponentView.h>
9
11
  #include <Fabric/Composition/CompositionUIService.h>
10
12
  #include <Fabric/Composition/CompositionViewComponentView.h>
13
+ #include <Fabric/Composition/ReactNativeIsland.h>
11
14
  #include <Fabric/Composition/RootComponentView.h>
12
15
  #include <Fabric/FabricUIManagerModule.h>
13
16
  #include <Fabric/ReactNativeConfigProperties.h>
@@ -109,15 +112,6 @@ void FabricUIManager::installFabricUIManager() noexcept {
109
112
  };
110
113
  toolbox.runtimeExecutor = runtimeExecutor;
111
114
  toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
112
- toolbox.backgroundExecutor = [context = m_context,
113
- dispatcher = Mso::DispatchQueue::MakeLooperQueue()](std::function<void()> &&callback) {
114
- if (context.UIDispatcher().HasThreadAccess()) {
115
- callback();
116
- return;
117
- }
118
-
119
- dispatcher.Post(std::move(callback));
120
- };
121
115
 
122
116
  m_scheduler = std::make_shared<facebook::react::Scheduler>(
123
117
  toolbox, (/*animationDriver_ ? animationDriver_.get() :*/ nullptr), this);
@@ -148,7 +142,7 @@ void FabricUIManager::startSurface(
148
142
 
149
143
  facebook::react::LayoutContext layoutContext;
150
144
  layoutContext.pointScaleFactor = rootView.ScaleFactor();
151
- layoutContext.fontSizeMultiplier = rootView.ScaleFactor();
145
+ layoutContext.fontSizeMultiplier = rootView.FontSizeMultiplier();
152
146
 
153
147
  m_surfaceManager->startSurface(
154
148
  surfaceId,
@@ -377,6 +371,28 @@ void FabricUIManager::schedulerDidRequestPreliminaryViewAllocation(const faceboo
377
371
  */
378
372
  }
379
373
 
374
+ struct HandleCommandArgs : public winrt::Microsoft::ReactNative::implementation::HandleCommandArgsT<HandleCommandArgs> {
375
+ HandleCommandArgs(winrt::hstring commandName, folly::dynamic const &arg) : m_commandName(commandName), m_args(arg) {}
376
+
377
+ winrt::hstring CommandName() const noexcept {
378
+ return m_commandName;
379
+ }
380
+ winrt::Microsoft::ReactNative::IJSValueReader CommandArgs() const noexcept {
381
+ return winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(m_args);
382
+ }
383
+ bool Handled() const noexcept {
384
+ return m_handled;
385
+ }
386
+ void Handled(bool value) noexcept {
387
+ m_handled = value;
388
+ }
389
+
390
+ private:
391
+ folly::dynamic const &m_args;
392
+ const winrt::hstring m_commandName;
393
+ bool m_handled{false};
394
+ };
395
+
380
396
  void FabricUIManager::schedulerDidDispatchCommand(
381
397
  facebook::react::ShadowView const &shadowView,
382
398
  std::string const &commandName,
@@ -384,7 +400,7 @@ void FabricUIManager::schedulerDidDispatchCommand(
384
400
  if (m_context.UIDispatcher().HasThreadAccess()) {
385
401
  auto descriptor = m_registry.componentViewDescriptorWithTag(shadowView.tag);
386
402
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(descriptor.view)
387
- ->HandleCommand(winrt::to_hstring(commandName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(arg));
403
+ ->HandleCommand(winrt::make<HandleCommandArgs>(winrt::to_hstring(commandName), arg));
388
404
  } else {
389
405
  m_context.UIDispatcher().Post(
390
406
  [wkThis = weak_from_this(), commandName, tag = shadowView.tag, args = folly::dynamic(arg)]() {
@@ -392,7 +408,7 @@ void FabricUIManager::schedulerDidDispatchCommand(
392
408
  auto view = pThis->m_registry.findComponentViewWithTag(tag);
393
409
  if (view) {
394
410
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(view)->HandleCommand(
395
- winrt::to_hstring(commandName), winrt::make<winrt::Microsoft::ReactNative::DynamicReader>(args));
411
+ winrt::make<HandleCommandArgs>(winrt::to_hstring(commandName), args));
396
412
  }
397
413
  }
398
414
  });
@@ -58,6 +58,39 @@ inline Color hostPlatformColorFromComponents(ColorComponents components) {
58
58
  /* .m_platformColor = */ {}};
59
59
  }
60
60
 
61
+ inline Color hostPlatformColorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
62
+ // Create ColorComponents from RGBA values normalized to the range [0.0f, 1.0f]
63
+ float ratio = 255.0f;
64
+ const auto colorComponents = ColorComponents{
65
+ .red = static_cast<float>(r) / ratio,
66
+ .green = static_cast<float>(g) / ratio,
67
+ .blue = static_cast<float>(b) / ratio,
68
+ .alpha = static_cast<float>(a) / ratio,
69
+ };
70
+
71
+ return hostPlatformColorFromComponents(colorComponents);
72
+ }
73
+
74
+ inline float alphaFromHostPlatformColor(Color color) {
75
+ float ratio = 255.0f;
76
+ return static_cast<float>(color.m_color.A) / ratio;
77
+ }
78
+
79
+ inline float redFromHostPlatformColor(Color color) {
80
+ float ratio = 255.0f;
81
+ return static_cast<float>(color.m_color.R) / ratio;
82
+ }
83
+
84
+ inline float greenFromHostPlatformColor(Color color) {
85
+ float ratio = 255.0f;
86
+ return static_cast<float>(color.m_color.G) / ratio;
87
+ }
88
+
89
+ inline float blueFromHostPlatformColor(Color color) {
90
+ float ratio = 255.0f;
91
+ return static_cast<float>(color.m_color.B) / ratio;
92
+ }
93
+
61
94
  inline ColorComponents colorComponentsFromHostPlatformColor(Color color) {
62
95
  float ratio = 255;
63
96
  const auto windowsColor = color.AsWindowsColor();
@@ -17,10 +17,11 @@
17
17
  namespace facebook::react {
18
18
 
19
19
  void TextLayoutManager::GetTextLayout(
20
- const AttributedString &attributedString,
20
+ const AttributedStringBox &attributedStringBox,
21
21
  const ParagraphAttributes &paragraphAttributes,
22
22
  Size size,
23
23
  winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept {
24
+ const auto &attributedString = attributedStringBox.getValue();
24
25
  auto fragments = attributedString.getFragments();
25
26
  auto outerFragment = fragments[0];
26
27
 
@@ -40,7 +41,10 @@ void TextLayoutManager::GetTextLayout(
40
41
  static_cast<facebook::react::FontWeight>(DWRITE_FONT_WEIGHT_REGULAR))),
41
42
  style,
42
43
  DWRITE_FONT_STRETCH_NORMAL,
43
- outerFragment.textAttributes.fontSize,
44
+ (outerFragment.textAttributes.allowFontScaling.value_or(true) &&
45
+ !std::isnan(outerFragment.textAttributes.fontSizeMultiplier))
46
+ ? (outerFragment.textAttributes.fontSizeMultiplier * outerFragment.textAttributes.fontSize)
47
+ : outerFragment.textAttributes.fontSize,
44
48
  L"",
45
49
  spTextFormat.put()));
46
50
 
@@ -83,7 +87,7 @@ void TextLayoutManager::GetTextLayout(
83
87
  }
84
88
  winrt::check_hresult(spTextFormat->SetTextAlignment(alignment));
85
89
 
86
- auto str = GetTransformedText(attributedString);
90
+ auto str = GetTransformedText(attributedStringBox);
87
91
 
88
92
  winrt::check_hresult(Microsoft::ReactNative::DWriteFactory()->CreateTextLayout(
89
93
  str.c_str(), // The string to be laid out and formatted.
@@ -115,7 +119,11 @@ void TextLayoutManager::GetTextLayout(
115
119
  attributes.fontWeight.value_or(static_cast<facebook::react::FontWeight>(DWRITE_FONT_WEIGHT_REGULAR))),
116
120
  range));
117
121
  winrt::check_hresult(spTextLayout->SetFontStyle(fragmentStyle, range));
118
- winrt::check_hresult(spTextLayout->SetFontSize(attributes.fontSize, range));
122
+ winrt::check_hresult(spTextLayout->SetFontSize(
123
+ (attributes.allowFontScaling.value_or(true) && !std::isnan(attributes.fontSizeMultiplier))
124
+ ? (attributes.fontSizeMultiplier * attributes.fontSize)
125
+ : attributes.fontSize,
126
+ range));
119
127
 
120
128
  if (!isnan(attributes.letterSpacing)) {
121
129
  winrt::check_hresult(
@@ -134,7 +142,7 @@ void TextLayoutManager::GetTextLayout(
134
142
  if (attributedStringBox.getValue().isEmpty())
135
143
  return;
136
144
 
137
- GetTextLayout(attributedStringBox.getValue(), paragraphAttributes, layoutConstraints.maximumSize, spTextLayout);
145
+ GetTextLayout(attributedStringBox, paragraphAttributes, layoutConstraints.maximumSize, spTextLayout);
138
146
  }
139
147
 
140
148
  TextMeasurement TextLayoutManager::measure(
@@ -218,14 +226,14 @@ Microsoft::ReactNative::TextTransform ConvertTextTransform(std::optional<TextTra
218
226
  }
219
227
 
220
228
  LinesMeasurements TextLayoutManager::measureLines(
221
- const AttributedString &attributedString,
229
+ const AttributedStringBox &attributedStringBox,
222
230
  const ParagraphAttributes &paragraphAttributes,
223
231
  Size size) const {
224
232
  LinesMeasurements lineMeasurements{};
225
233
 
226
234
  winrt::com_ptr<IDWriteTextLayout> spTextLayout;
227
235
 
228
- GetTextLayout(attributedString, paragraphAttributes, size, spTextLayout);
236
+ GetTextLayout(attributedStringBox, paragraphAttributes, size, spTextLayout);
229
237
 
230
238
  if (spTextLayout) {
231
239
  std::vector<DWRITE_LINE_METRICS> lineMetrics;
@@ -265,6 +273,7 @@ LinesMeasurements TextLayoutManager::measureLines(
265
273
  }
266
274
 
267
275
  std::string str;
276
+ const auto &attributedString = attributedStringBox.getValue();
268
277
  for (const auto &fragment : attributedString.getFragments()) {
269
278
  str = str +
270
279
  winrt::to_string(Microsoft::ReactNative::TransformableText::TransformText(
@@ -290,7 +299,7 @@ LinesMeasurements TextLayoutManager::measureLines(
290
299
  }
291
300
 
292
301
  std::shared_ptr<void> TextLayoutManager::getHostTextStorage(
293
- const AttributedString &attributedString,
302
+ const AttributedStringBox &attributedStringBox,
294
303
  const ParagraphAttributes &paragraphAttributes,
295
304
  LayoutConstraints layoutConstraints) const {
296
305
  return nullptr;
@@ -300,8 +309,16 @@ void *TextLayoutManager::getNativeTextLayoutManager() const {
300
309
  return (void *)this;
301
310
  }
302
311
 
303
- winrt::hstring TextLayoutManager::GetTransformedText(const AttributedString &attributedString) {
312
+ Float TextLayoutManager::baseline(
313
+ AttributedStringBox attributedStringBox,
314
+ ParagraphAttributes paragraphAttributes,
315
+ Size size) const {
316
+ return 0;
317
+ }
318
+
319
+ winrt::hstring TextLayoutManager::GetTransformedText(const AttributedStringBox &attributedStringBox) {
304
320
  winrt::hstring result{};
321
+ const auto &attributedString = attributedStringBox.getValue();
305
322
  for (const auto &fragment : attributedString.getFragments()) {
306
323
  result = result +
307
324
  Microsoft::ReactNative::TransformableText::TransformText(
@@ -45,12 +45,12 @@ class TextLayoutManager {
45
45
  * infrastructure.
46
46
  */
47
47
  LinesMeasurements measureLines(
48
- const AttributedString &attributedString,
48
+ const AttributedStringBox &attributedStringBox,
49
49
  const ParagraphAttributes &paragraphAttributes,
50
50
  Size size) const;
51
51
 
52
52
  std::shared_ptr<void> getHostTextStorage(
53
- const AttributedString &attributedString,
53
+ const AttributedStringBox &attributedStringBox,
54
54
  const ParagraphAttributes &paragraphAttributes,
55
55
  LayoutConstraints layoutConstraints) const;
56
56
 
@@ -63,6 +63,12 @@ class TextLayoutManager {
63
63
  const ParagraphAttributes &paragraphAttributes,
64
64
  LayoutConstraints layoutConstraints) const;
65
65
 
66
+ /*
67
+ * Calculates baseline of `attributedString` using native text rendering
68
+ * infrastructure.
69
+ */
70
+ Float baseline(AttributedStringBox attributedStringBox, ParagraphAttributes paragraphAttributes, Size size) const;
71
+
66
72
  /*
67
73
  * Returns an opaque pointer to platform-specific TextLayoutManager.
68
74
  * Is used on a native views layer to delegate text rendering to the manager.
@@ -78,9 +84,9 @@ class TextLayoutManager {
78
84
  #pragma endregion
79
85
 
80
86
  private:
81
- static winrt::hstring GetTransformedText(const AttributedString &attributedString);
87
+ static winrt::hstring GetTransformedText(const AttributedStringBox &attributedStringBox);
82
88
  static void GetTextLayout(
83
- const AttributedString &attributedString,
89
+ const AttributedStringBox &attributedStringBox,
84
90
  const ParagraphAttributes &paragraphAttributes,
85
91
  Size size,
86
92
  winrt::com_ptr<IDWriteTextLayout> &spTextLayout) noexcept;
@@ -129,6 +129,11 @@ void ReactModuleBuilder::AddSyncMethod(hstring const &name, SyncMethodDelegate c
129
129
  m_methods.push_back(std::move(cxxMethod));
130
130
  }
131
131
 
132
+ void ReactModuleBuilder::AddEventEmitter(hstring const &, EventEmitterInitializerDelegate const &) {
133
+ throw std::runtime_error(
134
+ "This module requires that it is registered as a TurboModule. If the module is being manually registered ensure you are using packageBuilder.AddTurboModule instead of packageBuilder.AddModule.");
135
+ }
136
+
132
137
  /*static*/ MethodResultCallback ReactModuleBuilder::MakeMethodResultCallback(CxxModule::Callback &&callback) noexcept {
133
138
  if (callback) {
134
139
  return [callback = std::move(callback)](const IJSValueWriter &outputWriter) noexcept {
@@ -15,6 +15,7 @@ struct ReactModuleBuilder : winrt::implements<ReactModuleBuilder, IReactModuleBu
15
15
  void AddConstantProvider(ConstantProviderDelegate const &constantProvider) noexcept;
16
16
  void AddMethod(hstring const &name, MethodReturnType returnType, MethodDelegate const &method) noexcept;
17
17
  void AddSyncMethod(hstring const &name, SyncMethodDelegate const &method) noexcept;
18
+ void AddEventEmitter(hstring const &name, EventEmitterInitializerDelegate const &emitter);
18
19
 
19
20
  public:
20
21
  std::unique_ptr<facebook::xplat::module::CxxModule> MakeCxxModule(
@@ -34,6 +34,12 @@ namespace Microsoft.ReactNative
34
34
  MethodResultCallback resolve,
35
35
  MethodResultCallback reject);
36
36
 
37
+ DOC_STRING("A delegate gets the arguments for an event emit on a EventEmitter.")
38
+ delegate void EmitEventSetterDelegate(JSValueArgWriter argWriter);
39
+
40
+ DOC_STRING("A delegate to call a turbo module EventEmitter.")
41
+ delegate void EventEmitterInitializerDelegate(EmitEventSetterDelegate emitter);
42
+
37
43
  DOC_STRING("A delegate to call native synchronous method.")
38
44
  delegate void SyncMethodDelegate(IJSValueReader inputReader, IJSValueWriter outputWriter);
39
45
 
@@ -62,5 +68,8 @@ namespace Microsoft.ReactNative
62
68
 
63
69
  DOC_STRING("Adds a synchronous method to the native module. See @SyncMethodDelegate.")
64
70
  void AddSyncMethod(String name, SyncMethodDelegate method);
71
+
72
+ DOC_STRING("Adds an EventEmitter to the turbo module. See @EventEmitterInitializerDelegate.")
73
+ void AddEventEmitter(String name, EventEmitterInitializerDelegate emitter);
65
74
  };
66
75
  } // namespace Microsoft.ReactNative
@@ -47,6 +47,13 @@ namespace Microsoft.ReactNative
47
47
  UInt32 Index { get; };
48
48
  };
49
49
 
50
+ [experimental]
51
+ runtimeclass HandleCommandArgs {
52
+ String CommandName { get; };
53
+ IJSValueReader CommandArgs { get; };
54
+ Boolean Handled;
55
+ };
56
+
50
57
  [experimental]
51
58
  DOC_STRING("A delegate that creates a @IComponentProps object for an instance of @ViewProps. See @IReactViewComponentBuilder.SetCreateProps")
52
59
  delegate IComponentProps ViewPropsFactory(ViewProps props);
@@ -71,7 +78,7 @@ namespace Microsoft.ReactNative
71
78
  delegate void ComponentViewInitializer(ComponentView view);
72
79
 
73
80
  [experimental]
74
- delegate void HandleCommandDelegate(ComponentView source, String commandName, IJSValueReader args);
81
+ delegate void HandleCommandDelegate(ComponentView source, HandleCommandArgs args);
75
82
 
76
83
  [experimental]
77
84
  delegate void UpdateFinalizerDelegate(ComponentView source, ComponentViewUpdateMask updateMask);
@@ -78,6 +78,8 @@
78
78
  <ImportGroup Label="PropertySheets">
79
79
  <Import Project="PropertySheet.props" />
80
80
  <Import Project="..\PropertySheets\WinUI.props" />
81
+ <!-- Added since we build this project with Paper/Fabric. -->
82
+ <Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.LockFile.props" />
81
83
  </ImportGroup>
82
84
  <PropertyGroup Label="UserMacros" />
83
85
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -117,7 +117,9 @@ void Alert::ProcessPendingAlertRequestsXaml() noexcept {
117
117
  // https://github.com/microsoft/microsoft-ui-xaml/issues/2331
118
118
  dialog.Opened([useXamlRootForThemeBugWorkaround](winrt::IInspectable const &sender, auto &&) {
119
119
  auto contentDialog = sender.as<xaml::Controls::ContentDialog>();
120
- auto popups = xaml::Media::VisualTreeHelper::GetOpenPopupsForXamlRoot(contentDialog.XamlRoot());
120
+ auto popups = useXamlRootForThemeBugWorkaround
121
+ ? xaml::Media::VisualTreeHelper::GetOpenPopupsForXamlRoot(contentDialog.XamlRoot())
122
+ : xaml::Media::VisualTreeHelper::GetOpenPopups(xaml::Window::Current());
121
123
 
122
124
  auto contentAsFrameworkElement = useXamlRootForThemeBugWorkaround
123
125
  ? contentDialog.XamlRoot().Content().try_as<xaml::FrameworkElement>()
@@ -68,7 +68,7 @@ void Appearance::RequeryTheme() noexcept {
68
68
  auto oldTheme = winrt::unbox_value_or<ApplicationTheme>(oldThemeBoxed, ApplicationTheme::Light);
69
69
 
70
70
  if (oldTheme != theme) {
71
- appearanceChanged(ToString(theme));
71
+ appearanceChanged({ToString(theme)});
72
72
  }
73
73
  }
74
74
 
@@ -9,6 +9,12 @@
9
9
 
10
10
  namespace Microsoft::ReactNative {
11
11
 
12
+ REACT_STRUCT(AppearanceChangeArgs)
13
+ struct AppearanceChangeArgs {
14
+ REACT_FIELD(colorScheme)
15
+ std::string colorScheme;
16
+ };
17
+
12
18
  REACT_MODULE(Appearance)
13
19
  struct Appearance : std::enable_shared_from_this<Appearance> {
14
20
  using ApplicationTheme = xaml::ApplicationTheme;
@@ -31,7 +37,7 @@ struct Appearance : std::enable_shared_from_this<Appearance> {
31
37
  void removeListeners(double count) noexcept;
32
38
 
33
39
  REACT_EVENT(appearanceChanged);
34
- std::function<void(std::string const &)> appearanceChanged;
40
+ std::function<void(AppearanceChangeArgs const &)> appearanceChanged;
35
41
 
36
42
  // This function allows the module to get the current theme on the UI thread before it is requested by any JS thread
37
43
  static void InitOnUIThread(const Mso::React::IReactContext &context) noexcept;
@@ -50,12 +50,12 @@ void DevSettings::toggleElementInspector() noexcept {
50
50
  "RCTDeviceEventEmitter", "emit", folly::dynamic::array("toggleElementInspector", nullptr));
51
51
  }
52
52
 
53
- void DevSettings::openDebugger() noexcept {
53
+ void DevSettings::addMenuItem(std::string title) noexcept {
54
54
  assert(false);
55
55
  }
56
56
 
57
- void DevSettings::addMenuItem(std::string title) noexcept {
58
- assert(false);
57
+ void DevSettings::openDebugger() noexcept {
58
+ // TODO: implement openDebugger() #13437
59
59
  }
60
60
 
61
61
  void DevSettings::setIsShakeToShowDevMenuEnabled(bool enabled) noexcept {
@@ -24,8 +24,8 @@ struct DevSettings {
24
24
  REACT_METHOD(setIsDebuggingRemotely) void setIsDebuggingRemotely(bool isDebuggingRemotelyEnabled) noexcept;
25
25
  REACT_METHOD(setProfilingEnabled) void setProfilingEnabled(bool isProfilingEnabled) noexcept;
26
26
  REACT_METHOD(toggleElementInspector) void toggleElementInspector() noexcept;
27
- REACT_METHOD(openDebugger) void openDebugger() noexcept;
28
27
  REACT_METHOD(addMenuItem) void addMenuItem(std::string title) noexcept;
28
+ REACT_METHOD(openDebugger) void openDebugger() noexcept;
29
29
  REACT_METHOD(setIsShakeToShowDevMenuEnabled) void setIsShakeToShowDevMenuEnabled(bool enabled) noexcept;
30
30
 
31
31
  REACT_METHOD(addListener)
@@ -109,11 +109,11 @@ void LinkingManager::HandleOpenUri(winrt::hstring const &uri) noexcept {
109
109
  // no-op
110
110
  }
111
111
 
112
- /*static*/ void LinkingManager::getInitialURL(::React::ReactPromise<std::string> &&result) noexcept {
112
+ /*static*/ void LinkingManager::getInitialURL(::React::ReactPromise<std::optional<std::string>> &&result) noexcept {
113
113
  if (s_initialUri) {
114
114
  result.Resolve(to_string(s_initialUri.AbsoluteUri()));
115
115
  } else {
116
- result.Resolve("");
116
+ result.Resolve(std::nullopt);
117
117
  }
118
118
  }
119
119
 
@@ -39,7 +39,7 @@ struct LinkingManager {
39
39
  static void removeListeners(double count) noexcept;
40
40
 
41
41
  REACT_METHOD(getInitialURL)
42
- static void getInitialURL(winrt::Microsoft::ReactNative::ReactPromise<std::string> &&result) noexcept;
42
+ static void getInitialURL(winrt::Microsoft::ReactNative::ReactPromise<std::optional<std::string>> &&result) noexcept;
43
43
 
44
44
  static void OpenUri(winrt::Windows::Foundation::Uri const &uri) noexcept;
45
45
 
@@ -19,6 +19,15 @@
19
19
 
20
20
  namespace Microsoft::ReactNative {
21
21
 
22
+ LogBox::~LogBox() {
23
+ #ifdef USE_FABRIC
24
+ if (m_hwnd) {
25
+ m_context.UIDispatcher().Post([hwnd = m_hwnd]() { DestroyWindow(hwnd); });
26
+ m_hwnd = nullptr;
27
+ }
28
+ #endif
29
+ }
30
+
22
31
  #ifdef USE_FABRIC
23
32
  constexpr PCWSTR c_logBoxWindowClassName = L"MS_REACTNATIVE_LOGBOX";
24
33
  constexpr auto CompHostProperty = L"CompHost";
@@ -14,6 +14,8 @@ REACT_MODULE(LogBox)
14
14
  struct LogBox : public std::enable_shared_from_this<LogBox> {
15
15
  using ModuleSpec = ReactNativeSpecs::LogBoxSpec;
16
16
 
17
+ ~LogBox();
18
+
17
19
  REACT_INIT(Initialize)
18
20
  void Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept;
19
21