react-native-windows 0.69.4 → 0.70.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 (298) hide show
  1. package/.flowconfig +5 -1
  2. package/Chakra/ChakraHelpers.cpp +1 -1
  3. package/Chakra/ChakraPlatform.cpp +1 -1
  4. package/Chakra/ChakraValue.cpp +6 -3
  5. package/Chakra/ChakraValue.h +1 -1
  6. package/Directory.Build.props +7 -7
  7. package/Folly/Folly.vcxproj +20 -13
  8. package/Folly/cgmanifest.json +14 -0
  9. package/Libraries/Alert/Alert.js +18 -4
  10. package/Libraries/Alert/Alert.windows.js +4 -0
  11. package/Libraries/Alert/NativeAlertManager.js +1 -0
  12. package/Libraries/Animated/Animated.js +2 -2
  13. package/Libraries/Animated/AnimatedEvent.js +7 -4
  14. package/Libraries/Animated/AnimatedImplementation.js +17 -3
  15. package/Libraries/Animated/AnimatedMock.js +7 -2
  16. package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
  17. package/Libraries/Animated/NativeAnimatedModule.js +3 -0
  18. package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
  19. package/Libraries/Animated/animations/SpringAnimation.js +3 -3
  20. package/Libraries/Animated/animations/TimingAnimation.js +3 -3
  21. package/Libraries/Animated/createAnimatedComponent.js +8 -1
  22. package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
  23. package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
  24. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
  25. package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
  26. package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
  27. package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
  28. package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
  29. package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
  30. package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
  31. package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
  32. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
  33. package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
  34. package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
  35. package/Libraries/Animated/useAnimatedProps.js +1 -0
  36. package/Libraries/AppState/AppState.js +0 -32
  37. package/Libraries/AppTheme/AppTheme.js +14 -8
  38. package/Libraries/AppTheme/AppThemeTypes.d.ts +0 -3
  39. package/Libraries/BatchedBridge/MessageQueue.js +21 -15
  40. package/Libraries/BatchedBridge/NativeModules.js +3 -4
  41. package/Libraries/Blob/FileReader.js +0 -6
  42. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
  43. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +0 -20
  44. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
  45. package/Libraries/Components/Keyboard/Keyboard.js +0 -11
  46. package/Libraries/Components/Pressable/Pressable.js +2 -0
  47. package/Libraries/Components/Pressable/Pressable.windows.js +2 -0
  48. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
  49. package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
  50. package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +4 -30
  51. package/Libraries/Components/ScrollView/ScrollView.js +13 -11
  52. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
  53. package/Libraries/Components/StatusBar/StatusBar.js +10 -7
  54. package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
  55. package/Libraries/Components/TextInput/TextInput.js +12 -2
  56. package/Libraries/Components/TextInput/TextInput.windows.js +12 -2
  57. package/Libraries/Components/Touchable/PooledClass.js +16 -4
  58. package/Libraries/Components/Touchable/Touchable.js +50 -1
  59. package/Libraries/Components/Touchable/Touchable.windows.js +972 -0
  60. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
  61. package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
  62. package/Libraries/Components/View/ViewPropTypes.js +3 -8
  63. package/Libraries/Components/View/ViewPropTypes.windows.js +3 -8
  64. package/Libraries/Core/ExceptionsManager.js +2 -0
  65. package/Libraries/Core/ReactNativeVersion.js +2 -2
  66. package/Libraries/Core/Timers/JSTimers.js +2 -2
  67. package/Libraries/Core/polyfillPromise.js +0 -32
  68. package/Libraries/Core/setUpBatchedBridge.js +5 -1
  69. package/Libraries/Core/setUpPerformance.js +1 -1
  70. package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
  71. package/Libraries/Image/AssetSourceResolver.js +2 -2
  72. package/Libraries/Image/Image.android.js +5 -3
  73. package/Libraries/Image/Image.ios.js +6 -3
  74. package/Libraries/Image/Image.windows.js +6 -3
  75. package/Libraries/Image/ImageSource.js +7 -5
  76. package/Libraries/Inspector/ElementBox.js +2 -2
  77. package/Libraries/Inspector/NetworkOverlay.js +13 -8
  78. package/Libraries/Interaction/PanResponder.js +16 -14
  79. package/Libraries/Linking/Linking.js +0 -11
  80. package/Libraries/Lists/FlatList.js +3 -2
  81. package/Libraries/Lists/SectionList.js +2 -0
  82. package/Libraries/Lists/ViewabilityHelper.js +7 -3
  83. package/Libraries/Lists/VirtualizeUtils.js +33 -20
  84. package/Libraries/Lists/VirtualizedList.js +93 -47
  85. package/Libraries/Lists/VirtualizedListContext.js +1 -0
  86. package/Libraries/Lists/VirtualizedSectionList.js +14 -9
  87. package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
  88. package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
  89. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  90. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  91. package/Libraries/LogBox/LogBox.js +3 -1
  92. package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
  93. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
  94. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
  95. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
  96. package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
  97. package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
  98. package/Libraries/NativeComponent/BaseViewConfig.windows.js +26 -12
  99. package/Libraries/Network/XMLHttpRequest.js +9 -11
  100. package/Libraries/Performance/PureComponentDebug.js +1 -0
  101. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
  102. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
  103. package/Libraries/Pressability/Pressability.js +26 -16
  104. package/Libraries/Pressability/Pressability.windows.js +30 -17
  105. package/Libraries/Promise.js +0 -1
  106. package/Libraries/ReactNative/AppRegistry.js +16 -13
  107. package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
  108. package/Libraries/ReactNative/PaperUIManager.js +9 -9
  109. package/Libraries/ReactNative/PaperUIManager.windows.js +7 -8
  110. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
  111. package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
  112. package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
  113. package/Libraries/ReactNative/renderApplication.js +1 -1
  114. package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
  115. package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
  116. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
  117. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
  118. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
  119. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
  120. package/Libraries/Storage/AsyncStorage.js +7 -1
  121. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
  122. package/Libraries/StyleSheet/flattenStyle.js +1 -1
  123. package/Libraries/StyleSheet/processTransform.js +2 -0
  124. package/Libraries/StyleSheet/processTransform.windows.js +2 -0
  125. package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
  126. package/Libraries/Text/Text.js +15 -7
  127. package/Libraries/Text/Text.windows.js +14 -7
  128. package/Libraries/Types/CoreEventTypes.js +137 -11
  129. package/Libraries/Types/CoreEventTypes.windows.js +147 -22
  130. package/Libraries/Utilities/Dimensions.js +0 -13
  131. package/Libraries/Utilities/HMRClient.js +3 -3
  132. package/Libraries/Utilities/Platform.ios.js +0 -7
  133. package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
  134. package/Libraries/Utilities/codegenNativeCommands.js +11 -2
  135. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
  136. package/Libraries/Utilities/stringifySafe.js +3 -1
  137. package/Libraries/Utilities/truncate.js +1 -1
  138. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
  139. package/Libraries/Vibration/Vibration.js +1 -1
  140. package/Libraries/WebSocket/WebSocket.js +1 -0
  141. package/Libraries/vendor/emitter/EventEmitter.js +105 -12
  142. package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
  143. package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +24 -12
  144. package/Microsoft.ReactNative/CoreApp.cpp +303 -0
  145. package/Microsoft.ReactNative/CoreAppPage.cpp +21 -0
  146. package/Microsoft.ReactNative/CoreAppPage.h +15 -0
  147. package/Microsoft.ReactNative/CoreAppPage.idl +12 -0
  148. package/Microsoft.ReactNative/CoreAppPage.xaml +14 -0
  149. package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.cpp +1 -2
  150. package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.h +1 -1
  151. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
  152. package/Microsoft.ReactNative/Fabric/ImageComponentView.cpp +1 -1
  153. package/Microsoft.ReactNative/Fabric/ImageComponentView.h +1 -1
  154. package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +1 -1
  155. package/Microsoft.ReactNative/Fabric/ParagraphComponentView.h +1 -1
  156. package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +1 -1
  157. package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.h +1 -1
  158. package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +1 -1
  159. package/Microsoft.ReactNative/Fabric/SliderComponentView.h +1 -1
  160. package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +1 -1
  161. package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +1 -1
  162. package/Microsoft.ReactNative/Fabric/TextComponentView.cpp +1 -1
  163. package/Microsoft.ReactNative/Fabric/TextComponentView.h +1 -1
  164. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +1 -1
  165. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +1 -1
  166. package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +1 -1
  167. package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -1
  168. package/Microsoft.ReactNative/GlyphViewManager.cpp +1 -0
  169. package/Microsoft.ReactNative/IReactDispatcher.cpp +18 -0
  170. package/Microsoft.ReactNative/IReactDispatcher.h +18 -3
  171. package/Microsoft.ReactNative/IReactDispatcher.idl +15 -0
  172. package/Microsoft.ReactNative/IReactNotificationService.cpp +197 -70
  173. package/Microsoft.ReactNative/IReactNotificationService.h +11 -30
  174. package/Microsoft.ReactNative/IReactPropertyBag.cpp +9 -0
  175. package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
  176. package/Microsoft.ReactNative/IReactPropertyBag.idl +3 -0
  177. package/Microsoft.ReactNative/JsiApi.cpp +41 -1
  178. package/Microsoft.ReactNative/JsiApi.h +3 -0
  179. package/Microsoft.ReactNative/JsiApi.idl +19 -1
  180. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +18 -2
  181. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +7 -7
  182. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +1 -1
  183. package/Microsoft.ReactNative/Modules/AlertModule.cpp +15 -12
  184. package/Microsoft.ReactNative/Modules/AlertModule.h +1 -1
  185. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +45 -9
  186. package/Microsoft.ReactNative/Modules/AppStateModule.h +9 -3
  187. package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +1 -1
  188. package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
  189. package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
  190. package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +1 -1
  191. package/Microsoft.ReactNative/Modules/I18nManagerModule.h +1 -1
  192. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
  193. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +1 -1
  194. package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
  195. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -1
  196. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +66 -39
  197. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +41 -11
  198. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +1 -1
  199. package/Microsoft.ReactNative/QuirkSettings.cpp +22 -0
  200. package/Microsoft.ReactNative/QuirkSettings.h +10 -0
  201. package/Microsoft.ReactNative/QuirkSettings.idl +7 -0
  202. package/Microsoft.ReactNative/ReactApplication.cpp +44 -0
  203. package/Microsoft.ReactNative/ReactApplication.h +40 -5
  204. package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.cpp +5 -2
  205. package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.h +1 -0
  206. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +23 -4
  207. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
  208. package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
  209. package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -0
  210. package/Microsoft.ReactNative/Utils/Helpers.cpp +1 -1
  211. package/Microsoft.ReactNative/Utils/Helpers.h +1 -1
  212. package/Microsoft.ReactNative/Utils/PropertyUtils.h +1 -1
  213. package/Microsoft.ReactNative/Utils/TransformableText.h +1 -1
  214. package/Microsoft.ReactNative/Utils/ValueUtils.cpp +12 -8
  215. package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +9 -7
  216. package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +3 -3
  217. package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +13 -1
  218. package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +1 -1
  219. package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +63 -13
  220. package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +2 -2
  221. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +5 -6
  222. package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -4
  223. package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +1 -1
  224. package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +21 -2
  225. package/Microsoft.ReactNative/Views/TextViewManager.cpp +6 -3
  226. package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +1 -1
  227. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +7 -1
  228. package/Microsoft.ReactNative/Views/ViewPanel.cpp +4 -0
  229. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +8 -3
  230. package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +2 -0
  231. package/Microsoft.ReactNative/microsoft.reactnative.def +4 -1
  232. package/Microsoft.ReactNative.Cxx/AppModelHelpers.h +17 -0
  233. package/Microsoft.ReactNative.Cxx/CoreApp.h +60 -0
  234. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +65 -0
  235. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +13 -0
  236. package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.cpp +53 -0
  237. package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.h +32 -0
  238. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +14 -2
  239. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -0
  240. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +7 -0
  241. package/Microsoft.ReactNative.Managed/packages.lock.json +1 -24
  242. package/Mso/dispatchQueue/dispatchQueue.h +12 -4
  243. package/Mso/src/dispatchQueue/looperScheduler.cpp +36 -9
  244. package/Mso/src/dispatchQueue/queueService.cpp +2 -2
  245. package/Mso/src/dispatchQueue/queueService.h +2 -2
  246. package/Mso/src/memoryApi/memoryApi.cpp +3 -0
  247. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  248. package/PropertySheets/JSEngine.props +1 -1
  249. package/PropertySheets/Release.props +6 -0
  250. package/ReactCommon/ReactCommon.vcxproj +11 -21
  251. package/ReactCommon/ReactCommon.vcxproj.filters +64 -46
  252. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +145 -0
  253. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +344 -0
  254. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/BaseTextProps.cpp +313 -0
  255. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.cpp +455 -0
  256. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ConcreteComponentDescriptor.h +216 -0
  257. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/PropsMacros.h +91 -0
  258. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/graphics/RectangleEdges.h +100 -0
  259. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/CompactValue.h +3 -1
  260. package/Scripts/Microsoft.ReactNative.nuspec +6 -0
  261. package/Scripts/Microsoft.ReactNative.targets +7 -0
  262. package/Shared/DevSettings.h +4 -0
  263. package/Shared/JSI/ChakraRuntime.cpp +11 -2
  264. package/Shared/JSI/ChakraRuntime.h +2 -0
  265. package/Shared/Modules/BlobModule.cpp +4 -4
  266. package/Shared/Modules/BlobModule.h +1 -1
  267. package/Shared/Modules/FileReaderModule.cpp +3 -2
  268. package/Shared/Modules/IBlobPersistor.h +1 -1
  269. package/Shared/Networking/IHttpResource.h +1 -0
  270. package/Shared/Networking/OriginPolicyHttpFilter.cpp +16 -10
  271. package/Shared/Networking/WinRTHttpResource.cpp +34 -2
  272. package/Shared/OInstance.cpp +14 -6
  273. package/Shared/Threading/BatchingQueueThread.cpp +23 -12
  274. package/Shared/Utils.cpp +2 -5
  275. package/codegen/NativeAlertManagerSpec.g.h +2 -0
  276. package/codegen/NativeAnimatedModuleSpec.g.h +6 -0
  277. package/codegen/NativeAnimatedTurboModuleSpec.g.h +6 -0
  278. package/codegen/react/components/rnwcore/Props.cpp +2 -2
  279. package/codegen/react/components/rnwcore/Props.h +1 -1
  280. package/fmt/cgmanifest.json +14 -0
  281. package/fmt/fmt.vcxproj +25 -11
  282. package/jest/assetFileTransformer.js +3 -2
  283. package/jest/setup.js +4 -0
  284. package/package.json +27 -28
  285. package/rntypes/index.d.ts +0 -1
  286. package/template/cs-app-WinAppSDK/proj/{NuGet.Config → NuGet_Config} +0 -0
  287. package/template/metro.devMode.config.js +49 -2
  288. package/template/shared-app/proj/{NuGet.Config → NuGet_Config} +0 -0
  289. package/template/shared-lib/proj/{NuGet.Config → NuGet_Config} +0 -0
  290. package/Libraries/vendor/emitter/EventSubscription.js +0 -19
  291. package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
  292. package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
  293. package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
  294. package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
  295. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +0 -87
  296. package/Scripts/copyRNLibraries.js +0 -99
  297. package/jest/preprocessor.js +0 -40
  298. package/jest/preprocessor_DO_NOT_USE.js +0 -122
@@ -115,7 +115,7 @@
115
115
  $(GeneratedFilesDir);
116
116
  %(AdditionalIncludeDirectories)
117
117
  </AdditionalIncludeDirectories>
118
- <PreprocessorDefinitions>FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;_USE_MATH_DEFINES;RN_EXPORT=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118
+ <PreprocessorDefinitions>DISABLE_XAML_GENERATED_MAIN;FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;_USE_MATH_DEFINES;RN_EXPORT=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
119
119
  <!--
120
120
  REACTWINDOWS_BUILD - building with REACTWINDOWS_API as dll exports
121
121
  OLD_CPPWINRT is a workaround to make target version to 19H1
@@ -184,6 +184,10 @@
184
184
  <ClInclude Include="Base\CoreNativeModules.h" />
185
185
  <ClInclude Include="Base\CxxReactIncludes.h" />
186
186
  <ClInclude Include="Base\FollyIncludes.h" />
187
+ <ClInclude Include="CoreAppPage.h">
188
+ <DependentUpon>CoreAppPage.xaml</DependentUpon>
189
+ <SubType>Code</SubType>
190
+ </ClInclude>
187
191
  <ClInclude Include="ReactHost\JSCallInvokerScheduler.h" />
188
192
  <ClInclude Include="Utils\ShadowNodeTypeUtils.h" />
189
193
  <ClInclude Include="Utils\BatchingEventEmitter.h" />
@@ -427,6 +431,11 @@
427
431
  <ClCompile Include="ABIViewManager.cpp" />
428
432
  <ClCompile Include="Base\CoreNativeModules.cpp" />
429
433
  <ClCompile Include="Base\CoreUIManagers.cpp" />
434
+ <ClCompile Include="CoreAppPage.cpp">
435
+ <DependentUpon>CoreAppPage.xaml</DependentUpon>
436
+ <SubType>Code</SubType>
437
+ </ClCompile>
438
+ <ClCompile Include="CoreApp.cpp" />
430
439
  <ClCompile Include="Utils\BatchingEventEmitter.cpp" />
431
440
  <ClCompile Include="CxxReactUWP\JSBigString.cpp" />
432
441
  <ClCompile Include="DevMenuControl.cpp">
@@ -630,6 +639,10 @@
630
639
  </ClCompile>
631
640
  </ItemGroup>
632
641
  <ItemGroup>
642
+ <Midl Include="CoreAppPage.idl">
643
+ <DependentUpon>CoreAppPage.xaml</DependentUpon>
644
+ <SubType>Code</SubType>
645
+ </Midl>
633
646
  <Midl Include="DesktopWindowMessage.idl" />
634
647
  <Midl Include="DevMenuControl.idl">
635
648
  <DependentUpon>DevMenuControl.xaml</DependentUpon>
@@ -717,6 +730,9 @@
717
730
  </ProjectReference>
718
731
  </ItemGroup>
719
732
  <ItemGroup>
733
+ <Page Include="CoreAppPage.xaml">
734
+ <SubType>Designer</SubType>
735
+ </Page>
720
736
  <Page Include="DevMenuControl.xaml">
721
737
  <SubType>Designer</SubType>
722
738
  </Page>
@@ -772,4 +788,4 @@
772
788
  </ClCompile>
773
789
  </ItemGroup>
774
790
  </Target>
775
- </Project>
791
+ </Project>
@@ -215,9 +215,6 @@
215
215
  <ClCompile Include="Views\RawTextViewManager.cpp">
216
216
  <Filter>Views</Filter>
217
217
  </ClCompile>
218
- <ClCompile Include="Views\ReactRootControl.cpp">
219
- <Filter>Views</Filter>
220
- </ClCompile>
221
218
  <ClCompile Include="Views\RefreshControlManager.cpp">
222
219
  <Filter>Views</Filter>
223
220
  </ClCompile>
@@ -302,7 +299,6 @@
302
299
  <ClCompile Include="GlyphViewManager.cpp">
303
300
  <Filter>Modules</Filter>
304
301
  </ClCompile>
305
- <ClCompile Include="Modules\ReactRootViewTagGenerator.cpp" />
306
302
  <ClCompile Include="Modules\PaperUIManagerModule.cpp" />
307
303
  <ClCompile Include="Views\PaperShadowNode.cpp" />
308
304
  <ClCompile Include="Views\ShadowNodeRegistry.cpp" />
@@ -337,6 +333,9 @@
337
333
  <Filter>Views\Text</Filter>
338
334
  </ClCompile>
339
335
  <ClCompile Include="ReactPointerEventArgs.cpp" />
336
+ <ClCompile Include="Views\FrameworkElementTransferProperties.cpp" />
337
+ <ClCompile Include="Views\ReactViewInstance.cpp" />
338
+ <ClCompile Include="CoreApp.cpp" />
340
339
  </ItemGroup>
341
340
  <ItemGroup>
342
341
  <ClInclude Include="ABICxxModule.h" />
@@ -575,9 +574,6 @@
575
574
  <ClInclude Include="Views\RawTextViewManager.h">
576
575
  <Filter>Views</Filter>
577
576
  </ClInclude>
578
- <ClInclude Include="Views\ReactRootControl.h">
579
- <Filter>Views</Filter>
580
- </ClInclude>
581
577
  <ClInclude Include="Views\RefreshControlManager.h">
582
578
  <Filter>Views</Filter>
583
579
  </ClInclude>
@@ -734,6 +730,8 @@
734
730
  <Filter>Views\Text</Filter>
735
731
  </ClInclude>
736
732
  <ClInclude Include="ReactPointerEventArgs.h" />
733
+ <ClInclude Include="Views\FrameworkElementTransferProperties.h" />
734
+ <ClInclude Include="Views\ReactViewInstance.h" />
737
735
  </ItemGroup>
738
736
  <ItemGroup>
739
737
  <Midl Include="IJSValueReader.idl" />
@@ -772,6 +770,7 @@
772
770
  <Midl Include="DocString.idl" />
773
771
  <Midl Include="DesktopWindowMessage.idl" />
774
772
  <Midl Include="ReactPointerEventArgs.idl" />
773
+ <Midl Include="ReactCoreInjection.idl" />
775
774
  </ItemGroup>
776
775
  <ItemGroup>
777
776
  <None Include="microsoft.reactnative.def" />
@@ -826,5 +825,6 @@
826
825
  </ItemGroup>
827
826
  <ItemGroup>
828
827
  <Page Include="DevMenuControl.xaml" />
828
+ <Page Include="CoreAppPage.xaml" />
829
829
  </ItemGroup>
830
830
  </Project>
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeAccessibilityInfoSpec.g.h"
5
+ #include "codegen/NativeAccessibilityInfoSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
 
8
8
  namespace Microsoft::ReactNative {
@@ -68,20 +68,23 @@ void Alert::ProcessPendingAlertRequests() noexcept {
68
68
  const auto rootSize = xamlRoot.Size();
69
69
  const auto popupRoot = xaml::Media::VisualTreeHelper::GetParent(dialog);
70
70
  const auto nChildren = xaml::Media::VisualTreeHelper::GetChildrenCount(popupRoot);
71
- if (nChildren == 2) {
72
- // The first is supposed to be the smoke screen (Rectangle), and the second the content dialog
73
- if (const auto smoke =
74
- xaml::Media::VisualTreeHelper::GetChild(popupRoot, 0).try_as<xaml::Shapes::Rectangle>()) {
75
- const auto assertDialog =
76
- xaml::Media::VisualTreeHelper::GetChild(popupRoot, 1).try_as<xaml::Controls::ContentDialog>();
77
- if (assertDialog == dialog) {
78
- smoke.Width(rootSize.Width);
79
- smoke.Height(rootSize.Height);
80
- dialog.Width(rootSize.Width);
81
- dialog.Height(rootSize.Height);
82
- }
71
+ xaml::Shapes::Rectangle smoke = nullptr;
72
+ xaml::Controls::ContentDialog assertDialog = nullptr;
73
+ for (int32_t i = 0; i < nChildren - 1; ++i) {
74
+ smoke = xaml::Media::VisualTreeHelper::GetChild(popupRoot, i).try_as<xaml::Shapes::Rectangle>();
75
+ assertDialog =
76
+ xaml::Media::VisualTreeHelper::GetChild(popupRoot, i + 1).try_as<xaml::Controls::ContentDialog>();
77
+ if (smoke && assertDialog == dialog) {
78
+ break;
83
79
  }
84
80
  }
81
+
82
+ if (smoke && assertDialog == dialog) {
83
+ smoke.Width(rootSize.Width);
84
+ smoke.Height(rootSize.Height);
85
+ dialog.Width(rootSize.Width);
86
+ dialog.Height(rootSize.Height);
87
+ }
85
88
  });
86
89
 
87
90
  dialog.Closed([=](auto &&, auto &&) { xamlRoot.Changed(rootChangedToken); });
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeDialogManagerWindowsSpec.g.h"
5
+ #include "codegen/NativeDialogManagerWindowsSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
  #include <winrt/Windows.ApplicationModel.h>
8
8
  #include <winrt/Windows.Foundation.h>
@@ -3,16 +3,20 @@
3
3
 
4
4
  #include "pch.h"
5
5
  #include "AppStateModule.h"
6
+ #include <QuirkSettings.h>
6
7
  #include <Utils/Helpers.h>
7
8
  #include <XamlUtils.h>
8
9
  #include <winrt/Windows.ApplicationModel.DataTransfer.h>
9
10
  #include "Unicode.h"
10
11
 
12
+ using namespace winrt::Windows::UI::Core;
13
+
11
14
  namespace Microsoft::ReactNative {
12
15
 
13
16
  void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept {
14
17
  m_context = reactContext;
15
- m_active = true;
18
+ m_deactivated = false;
19
+ m_enteredBackground = false;
16
20
 
17
21
  // We need to register for notifications from the XAML thread.
18
22
  if (auto dispatcher = reactContext.UIDispatcher()) {
@@ -21,13 +25,15 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
21
25
 
22
26
  if (!IsWinUI3Island() && currentApp != nullptr) {
23
27
  #ifndef USE_WINUI3
28
+ CoreWindow window = CoreWindow::GetForCurrentThread();
29
+
24
30
  m_enteredBackgroundRevoker = currentApp.EnteredBackground(
25
31
  winrt::auto_revoke,
26
32
  [weakThis = weak_from_this()](
27
33
  winrt::IInspectable const & /*sender*/,
28
34
  winrt::Windows::ApplicationModel::EnteredBackgroundEventArgs const & /*e*/) noexcept {
29
35
  if (auto strongThis = weakThis.lock()) {
30
- strongThis->SetActive(false);
36
+ strongThis->SetEnteredBackground(true);
31
37
  }
32
38
  });
33
39
 
@@ -37,9 +43,27 @@ void AppState::Initialize(winrt::Microsoft::ReactNative::ReactContext const &rea
37
43
  winrt::IInspectable const & /*sender*/,
38
44
  winrt::Windows::ApplicationModel::LeavingBackgroundEventArgs const & /*e*/) noexcept {
39
45
  if (auto strongThis = weakThis.lock()) {
40
- strongThis->SetActive(true);
46
+ strongThis->SetEnteredBackground(false);
41
47
  }
42
48
  });
49
+ if (window != nullptr &&
50
+ winrt::Microsoft::ReactNative::implementation::QuirkSettings::GetMapWindowDeactivatedToAppStateInactive(
51
+ m_context.Properties())) {
52
+ m_activatedEventRevoker = window.Activated(
53
+ winrt::auto_revoke,
54
+ [weakThis = weak_from_this()](
55
+ winrt::Windows::UI::Core::CoreWindow /*sender*/,
56
+ winrt::Windows::UI::Core::WindowActivatedEventArgs args) {
57
+ if (auto strongThis = weakThis.lock()) {
58
+ if (args.WindowActivationState() ==
59
+ winrt::Windows::UI::Core::CoreWindowActivationState::Deactivated) {
60
+ strongThis->SetDeactivated(true);
61
+ } else {
62
+ strongThis->SetDeactivated(false);
63
+ }
64
+ }
65
+ });
66
+ }
43
67
  #endif
44
68
  } else {
45
69
  assert(IsXamlIsland());
@@ -52,7 +76,7 @@ void AppState::GetCurrentAppState(
52
76
  std::function<void(AppStateChangeArgs const &)> const &success,
53
77
  std::function<void(React::JSValue const &)> const &error) noexcept {
54
78
  AppStateChangeArgs args;
55
- args.app_state = m_active ? "active" : "background";
79
+ args.app_state = GetAppState();
56
80
  success(args);
57
81
  }
58
82
 
@@ -65,12 +89,24 @@ void AppState::RemoveListeners(double /*count*/) noexcept {
65
89
  }
66
90
 
67
91
  ReactNativeSpecs::AppStateSpec_Constants AppState::GetConstants() noexcept {
68
- return {m_active ? "active" : "background"};
92
+ return {GetAppState()};
93
+ }
94
+
95
+ void AppState::SetDeactivated(bool deactivated) noexcept {
96
+ if (winrt::Microsoft::ReactNative::implementation::QuirkSettings::GetMapWindowDeactivatedToAppStateInactive(
97
+ m_context.Properties())) {
98
+ m_deactivated = deactivated;
99
+ m_context.JSDispatcher().Post([this]() { AppStateDidChange({GetAppState()}); });
100
+ }
101
+ }
102
+
103
+ void AppState::SetEnteredBackground(bool enteredBackground) noexcept {
104
+ m_enteredBackground = enteredBackground;
105
+ m_context.JSDispatcher().Post([this]() { AppStateDidChange({GetAppState()}); });
69
106
  }
70
107
 
71
- void AppState::SetActive(bool active) noexcept {
72
- m_active = active;
73
- m_context.JSDispatcher().Post([this]() { AppStateDidChange({m_active ? "active" : "background"}); });
108
+ std::string AppState::GetAppState() noexcept {
109
+ return m_enteredBackground ? "background" : (m_deactivated ? "inactive" : "active");
74
110
  }
75
111
 
76
- } // namespace Microsoft::ReactNative
112
+ } // namespace Microsoft::ReactNative
@@ -2,11 +2,13 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeAppStateSpec.g.h"
5
+ #include "codegen/NativeAppStateSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
  #include <winrt/Windows.ApplicationModel.h>
8
8
  #include <winrt/Windows.Foundation.h>
9
9
 
10
+ #include <winrt/Windows.UI.Core.h>
11
+
10
12
  namespace Microsoft::ReactNative {
11
13
 
12
14
  REACT_MODULE(AppState)
@@ -35,15 +37,19 @@ struct AppState : public std::enable_shared_from_this<AppState> {
35
37
  std::function<void(AppStateChangeArgs const &)> AppStateDidChange;
36
38
 
37
39
  private:
38
- void SetActive(bool active) noexcept;
40
+ void SetDeactivated(bool deactivated) noexcept;
41
+ void SetEnteredBackground(bool enteredBackground) noexcept;
42
+ std::string GetAppState() noexcept;
39
43
 
40
44
  std::mutex m_stateMutex;
41
- std::atomic<bool> m_active;
45
+ std::atomic<bool> m_deactivated;
46
+ std::atomic<bool> m_enteredBackground;
42
47
  char const *m_lastState{nullptr};
43
48
  React::ReactContext m_context;
44
49
  #ifndef USE_WINUI3
45
50
  xaml::Application::EnteredBackground_revoker m_enteredBackgroundRevoker;
46
51
  xaml::Application::LeavingBackground_revoker m_leavingBackgroundRevoker;
52
+ winrt::Windows::UI::Core::CoreWindow::Activated_revoker m_activatedEventRevoker;
47
53
  #endif
48
54
  };
49
55
 
@@ -9,7 +9,7 @@
9
9
  #include <cxxreact/MessageQueueThread.h>
10
10
  #include <winrt/Windows.UI.ViewManagement.h>
11
11
 
12
- #include "../../codegen/NativeAppThemeSpec.g.h"
12
+ #include "codegen/NativeAppThemeSpec.g.h"
13
13
  #include <NativeModules.h>
14
14
 
15
15
  namespace Microsoft::ReactNative {
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeClipboardSpec.g.h"
5
+ #include "codegen/NativeClipboardSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
 
8
8
  namespace Microsoft::ReactNative {
@@ -5,7 +5,7 @@
5
5
  #include <cxxreact/CxxModule.h>
6
6
  #include <functional/functor.h>
7
7
 
8
- #include "../../codegen/NativeDevSettingsSpec.g.h"
8
+ #include "codegen/NativeDevSettingsSpec.g.h"
9
9
  #include <NativeModules.h>
10
10
  #include <ReactHost/React.h>
11
11
 
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeDeviceInfoSpec.g.h"
5
+ #include "codegen/NativeDeviceInfoSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
  #include <React.h>
8
8
  #include <ReactNotificationService.h>
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeI18nManagerSpec.g.h"
5
+ #include "codegen/NativeI18nManagerSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
  #include <winrt/Windows.ApplicationModel.h>
8
8
  #include <winrt/Windows.Foundation.h>
@@ -45,7 +45,7 @@ winrt::fire_and_forget GetImageSizeAsync(
45
45
  bool needsDownload = (scheme == L"http") || (scheme == L"https");
46
46
  bool inlineData = scheme == L"data";
47
47
 
48
- winrt::InMemoryRandomAccessStream memoryStream;
48
+ winrt::IRandomAccessStream memoryStream;
49
49
  if (needsDownload) {
50
50
  memoryStream = co_await GetImageStreamAsync(source);
51
51
  } else if (inlineData) {
@@ -3,7 +3,7 @@
3
3
 
4
4
  #pragma once
5
5
 
6
- #include "../../codegen/NativeImageLoaderIOSSpec.g.h"
6
+ #include "codegen/NativeImageLoaderIOSSpec.g.h"
7
7
  #include <NativeModules.h>
8
8
  #include <winrt/Windows.ApplicationModel.h>
9
9
  #include <winrt/Windows.Foundation.h>
@@ -3,7 +3,7 @@
3
3
 
4
4
  #pragma once
5
5
 
6
- #include "../../codegen/NativeLinkingManagerSpec.g.h"
6
+ #include "codegen/NativeLinkingManagerSpec.g.h"
7
7
  #include <NativeModules.h>
8
8
  #include <winrt/Windows.ApplicationModel.h>
9
9
  #include <winrt/Windows.Foundation.h>
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "../../codegen/NativeLogBoxSpec.g.h"
5
+ #include "codegen/NativeLogBoxSpec.g.h"
6
6
  #include <NativeModules.h>
7
7
  #include <winrt/Windows.ApplicationModel.h>
8
8
  #include <winrt/Windows.Foundation.h>
@@ -7,6 +7,7 @@
7
7
  #include <UI.Xaml.Input.h>
8
8
  #include <UI.Xaml.Media.h>
9
9
  #include <Views/ShadowNodeBase.h>
10
+ #include <cxxreact/SystraceSection.h>
10
11
  #include "Modules/I18nManagerModule.h"
11
12
  #include "NativeUIManager.h"
12
13
 
@@ -24,6 +25,8 @@ using namespace xaml::Controls;
24
25
  using namespace xaml::Media;
25
26
  } // namespace winrt
26
27
 
28
+ using namespace facebook::react;
29
+
27
30
  namespace Microsoft::ReactNative {
28
31
 
29
32
  static YogaNodePtr make_yoga_node(YGConfigRef config) {
@@ -38,7 +41,7 @@ static int YogaLog(
38
41
  YGLogLevel /*level*/,
39
42
  const char *format,
40
43
  va_list args) {
41
- int len = _scprintf(format, args);
44
+ const int len = _vscprintf(format, args);
42
45
  std::string buffer(len + 1, '\0');
43
46
  vsnprintf_s(&buffer[0], len + 1, _TRUNCATE, format, args);
44
47
  buffer.resize(len);
@@ -222,6 +225,7 @@ int64_t NativeUIManager::AddMeasuredRootView(facebook::react::IReactRootView *ro
222
225
  }
223
226
 
224
227
  void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReactRootView *pReactRootView) {
228
+ SystraceSection s("NativeUIManager::AddRootView");
225
229
  auto xamlRootView = static_cast<IXamlRootView *>(pReactRootView);
226
230
  XamlView view = xamlRootView->GetXamlView();
227
231
  m_tagsToXamlReactControl.emplace(
@@ -244,11 +248,13 @@ void NativeUIManager::AddRootView(ShadowNode &shadowNode, facebook::react::IReac
244
248
  }
245
249
 
246
250
  void NativeUIManager::removeRootView(Microsoft::ReactNative::ShadowNode &shadow) {
251
+ SystraceSection s("NativeUIManager::removeRootView");
247
252
  m_tagsToXamlReactControl.erase(shadow.m_tag);
248
253
  RemoveView(shadow, true);
249
254
  }
250
255
 
251
256
  void NativeUIManager::onBatchComplete() {
257
+ SystraceSection s("NativeUIManager::onBatchComplete");
252
258
  if (m_inBatch) {
253
259
  DoLayout();
254
260
  m_inBatch = false;
@@ -768,6 +774,7 @@ static void StyleYogaNode(
768
774
  }
769
775
 
770
776
  void NativeUIManager::CreateView(ShadowNode &shadowNode, React::JSValueObject &props) {
777
+ SystraceSection s("NativeUIManager::CreateView");
771
778
  ShadowNodeBase &node = static_cast<ShadowNodeBase &>(shadowNode);
772
779
  auto *pViewManager = node.GetViewManager();
773
780
 
@@ -859,6 +866,7 @@ void NativeUIManager::ReplaceView(ShadowNode &shadowNode) {
859
866
  }
860
867
 
861
868
  void NativeUIManager::UpdateView(ShadowNode &shadowNode, winrt::Microsoft::ReactNative::JSValueObject &props) {
869
+ SystraceSection s("NativeUIManager::UpdateView");
862
870
  ShadowNodeBase &node = static_cast<ShadowNodeBase &>(shadowNode);
863
871
  auto *pViewManager = node.GetViewManager();
864
872
 
@@ -889,51 +897,70 @@ void NativeUIManager::UpdateExtraLayout(int64_t tag) {
889
897
  }
890
898
 
891
899
  void NativeUIManager::DoLayout() {
892
- // Process vector of RN controls needing extra layout here.
893
- const auto extraLayoutNodes = m_extraLayoutNodes;
894
- for (const int64_t tag : extraLayoutNodes) {
895
- ShadowNodeBase *node = static_cast<ShadowNodeBase *>(m_host->FindShadowNodeForTag(tag));
896
- if (node) {
897
- auto element = node->GetView().as<xaml::FrameworkElement>();
898
- element.UpdateLayout();
900
+ SystraceSection s("NativeUIManager::DoLayout");
901
+
902
+ {
903
+ SystraceSection s("NativeUIManager::DoLayout::UpdateLayout");
904
+ // Process vector of RN controls needing extra layout here.
905
+ const auto extraLayoutNodes = m_extraLayoutNodes;
906
+ for (const int64_t tag : extraLayoutNodes) {
907
+ ShadowNodeBase *node = static_cast<ShadowNodeBase *>(m_host->FindShadowNodeForTag(tag));
908
+ if (node) {
909
+ auto element = node->GetView().as<xaml::FrameworkElement>();
910
+ element.UpdateLayout();
911
+ }
899
912
  }
913
+ // Values need to be cleared from the vector before next call to DoLayout.
914
+ m_extraLayoutNodes.clear();
900
915
  }
901
- // Values need to be cleared from the vector before next call to DoLayout.
902
- m_extraLayoutNodes.clear();
916
+
903
917
  auto &rootTags = m_host->GetAllRootTags();
904
918
  for (int64_t rootTag : rootTags) {
905
- UpdateExtraLayout(rootTag);
919
+ {
920
+ SystraceSection s("NativeUIManager::DoLayout::UpdateExtraLayout");
921
+ UpdateExtraLayout(rootTag);
922
+ }
906
923
 
907
924
  ShadowNodeBase &rootShadowNode = static_cast<ShadowNodeBase &>(m_host->GetShadowNodeForTag(rootTag));
908
- YGNodeRef rootNode = GetYogaNode(rootTag);
909
- auto rootElement = rootShadowNode.GetView().as<xaml::FrameworkElement>();
910
-
911
- float actualWidth = static_cast<float>(rootElement.ActualWidth());
912
- float actualHeight = static_cast<float>(rootElement.ActualHeight());
913
-
914
- // We must always run layout in LTR mode, which might seem unintuitive.
915
- // We will flip the root of the tree into RTL by forcing the root XAML node's FlowDirection to RightToLeft
916
- // which will inherit down the XAML tree, allowing all native controls to pick it up.
917
- YGNodeCalculateLayout(rootNode, actualWidth, actualHeight, YGDirectionLTR);
925
+ if (YGNodeRef rootNode = GetYogaNode(rootTag)) {
926
+ auto rootElement = rootShadowNode.GetView().as<xaml::FrameworkElement>();
927
+
928
+ float actualWidth = static_cast<float>(rootElement.ActualWidth());
929
+ float actualHeight = static_cast<float>(rootElement.ActualHeight());
930
+
931
+ {
932
+ SystraceSection s("NativeUIManager::DoLayout::YGNodeCalculateLayout");
933
+ // We must always run layout in LTR mode, which might seem unintuitive.
934
+ // We will flip the root of the tree into RTL by forcing the root XAML node's FlowDirection to RightToLeft
935
+ // which will inherit down the XAML tree, allowing all native controls to pick it up.
936
+ YGNodeCalculateLayout(rootNode, actualWidth, actualHeight, YGDirectionLTR);
937
+ }
938
+ } else {
939
+ assert(false);
940
+ return;
941
+ }
918
942
  }
919
943
 
920
- for (auto &tagToYogaNode : m_tagsToYogaNodes) {
921
- int64_t tag = tagToYogaNode.first;
922
- YGNodeRef yogaNode = tagToYogaNode.second.get();
923
-
924
- if (!YGNodeGetHasNewLayout(yogaNode))
925
- continue;
926
- YGNodeSetHasNewLayout(yogaNode, false);
927
-
928
- float left = YGNodeLayoutGetLeft(yogaNode);
929
- float top = YGNodeLayoutGetTop(yogaNode);
930
- float width = YGNodeLayoutGetWidth(yogaNode);
931
- float height = YGNodeLayoutGetHeight(yogaNode);
932
-
933
- ShadowNodeBase &shadowNode = static_cast<ShadowNodeBase &>(m_host->GetShadowNodeForTag(tag));
934
- auto view = shadowNode.GetView();
935
- auto pViewManager = shadowNode.GetViewManager();
936
- pViewManager->SetLayoutProps(shadowNode, view, left, top, width, height);
944
+ {
945
+ SystraceSection s("NativeUIManager::DoLayout::SetLayoutProps");
946
+ for (auto &tagToYogaNode : m_tagsToYogaNodes) {
947
+ int64_t tag = tagToYogaNode.first;
948
+ YGNodeRef yogaNode = tagToYogaNode.second.get();
949
+
950
+ if (!YGNodeGetHasNewLayout(yogaNode))
951
+ continue;
952
+ YGNodeSetHasNewLayout(yogaNode, false);
953
+
954
+ float left = YGNodeLayoutGetLeft(yogaNode);
955
+ float top = YGNodeLayoutGetTop(yogaNode);
956
+ float width = YGNodeLayoutGetWidth(yogaNode);
957
+ float height = YGNodeLayoutGetHeight(yogaNode);
958
+
959
+ ShadowNodeBase &shadowNode = static_cast<ShadowNodeBase &>(m_host->GetShadowNodeForTag(tag));
960
+ auto view = shadowNode.GetView();
961
+ auto pViewManager = shadowNode.GetViewManager();
962
+ pViewManager->SetLayoutProps(shadowNode, view, left, top, width, height);
963
+ }
937
964
  }
938
965
  }
939
966
 
@@ -1115,7 +1142,7 @@ void NativeUIManager::findSubviewIn(
1115
1142
 
1116
1143
  void NativeUIManager::focus(int64_t reactTag) {
1117
1144
  if (auto shadowNode = static_cast<ShadowNodeBase *>(m_host->FindShadowNodeForTag(reactTag))) {
1118
- xaml::Input::FocusManager::TryFocusAsync(shadowNode->GetView(), winrt::FocusState::Keyboard);
1145
+ xaml::Input::FocusManager::TryFocusAsync(shadowNode->GetView(), winrt::FocusState::Programmatic);
1119
1146
  }
1120
1147
  }
1121
1148