react-native-windows 0.66.3 → 0.67.0-preview.3

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 (262) hide show
  1. package/.flowconfig +2 -1
  2. package/CHANGELOG.json +917 -85
  3. package/CHANGELOG.md +352 -37
  4. package/Chakra/Chakra.vcxitems +0 -1
  5. package/Chakra/Chakra.vcxitems.filters +0 -3
  6. package/Chakra/ChakraHelpers.cpp +0 -267
  7. package/Chakra/ChakraInstanceArgs.h +0 -5
  8. package/Chakra/ChakraPlatform.h +0 -4
  9. package/Chakra/ChakraTracing.cpp +0 -33
  10. package/Chakra/ChakraValue.h +0 -4
  11. package/Chakra/Utf8DebugExtensions.cpp +0 -5
  12. package/Chakra/Utf8DebugExtensions.h +0 -6
  13. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -1
  14. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -0
  15. package/Libraries/Alert/Alert.windows.js +48 -21
  16. package/Libraries/Alert/NativeDialogManagerWindows.js +49 -0
  17. package/Libraries/Animated/AnimatedEvent.js +23 -4
  18. package/Libraries/Animated/NativeAnimatedHelper.js +2 -2
  19. package/Libraries/Animated/components/AnimatedImage.js +3 -3
  20. package/Libraries/Animated/components/AnimatedScrollView.js +3 -3
  21. package/Libraries/Animated/components/AnimatedText.js +3 -3
  22. package/Libraries/Animated/components/AnimatedView.js +1 -3
  23. package/Libraries/Animated/createAnimatedComponent.js +3 -34
  24. package/Libraries/Components/Button.js +3 -0
  25. package/Libraries/Components/Button.windows.js +70 -38
  26. package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
  27. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
  28. package/Libraries/Components/Flyout/Flyout.js +3 -3
  29. package/Libraries/Components/Flyout/Flyout.js.map +1 -1
  30. package/Libraries/Components/Flyout/FlyoutProps.d.ts +4 -0
  31. package/Libraries/Components/Flyout/FlyoutProps.js.map +1 -1
  32. package/Libraries/Components/Glyph/Glyph.js +2 -2
  33. package/Libraries/Components/Glyph/Glyph.js.map +1 -1
  34. package/Libraries/Components/Keyboard/KeyboardExt.js +4 -3
  35. package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
  36. package/Libraries/Components/Popup/Popup.js +3 -3
  37. package/Libraries/Components/Popup/Popup.js.map +1 -1
  38. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
  39. package/Libraries/Components/ScrollView/ScrollView.js +17 -16
  40. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
  41. package/Libraries/Components/View/View.js +1 -1
  42. package/Libraries/Components/View/View.windows.js +1 -1
  43. package/Libraries/Components/View/ViewAccessibility.js +1 -1
  44. package/Libraries/Components/View/ViewAccessibility.windows.js +1 -1
  45. package/Libraries/Components/View/ViewWindows.js +1 -1
  46. package/Libraries/Components/View/ViewWindows.js.map +1 -1
  47. package/Libraries/Components/View/ViewWindowsProps.d.ts +42 -2
  48. package/Libraries/Components/View/ViewWindowsProps.js.map +1 -1
  49. package/Libraries/Core/ExceptionsManager.js +45 -80
  50. package/Libraries/Core/ExtendedError.js +0 -1
  51. package/Libraries/Core/ReactNativeVersion.js +2 -2
  52. package/Libraries/Core/setUpBatchedBridge.js +1 -1
  53. package/Libraries/Core/setUpGlobals.js +2 -4
  54. package/Libraries/Core/setUpTimers.js +2 -2
  55. package/Libraries/Image/Image.ios.js +6 -0
  56. package/Libraries/Image/Image.windows.js +6 -0
  57. package/Libraries/Image/ImageBackground.js +10 -8
  58. package/Libraries/Image/ImageProps.js +28 -0
  59. package/Libraries/LogBox/Data/LogBoxData.js +18 -19
  60. package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
  61. package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
  62. package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
  63. package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
  64. package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
  65. package/Libraries/NewAppScreen/components/logo.png +0 -0
  66. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +2 -1
  67. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +2 -0
  68. package/Libraries/Pressability/Pressability.js +13 -13
  69. package/Libraries/Pressability/Pressability.windows.js +13 -13
  70. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
  71. package/Libraries/ReactNative/AppRegistry.js +4 -2
  72. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1569 -875
  73. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +529 -319
  74. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +570 -362
  75. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1592 -891
  76. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +521 -311
  77. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +562 -354
  78. package/Libraries/Share/Share.js +1 -1
  79. package/Libraries/StyleSheet/normalizeColor.js +2 -2
  80. package/Libraries/Text/Text.windows.js +1 -0
  81. package/Libraries/Text/TextNativeComponent.windows.js +72 -0
  82. package/Libraries/Text/TextProps.js +1 -7
  83. package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
  84. package/Libraries/Utilities/HMRClient.js +1 -1
  85. package/Microsoft.ReactNative/ABIViewManager.cpp +10 -1
  86. package/Microsoft.ReactNative/ABIViewManager.h +3 -0
  87. package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +0 -6
  88. package/Microsoft.ReactNative/IReactDispatcher.cpp +16 -1
  89. package/Microsoft.ReactNative/IViewManager.idl +25 -0
  90. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +35 -8
  91. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +60 -0
  92. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +3 -4
  93. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +3 -3
  94. package/Microsoft.ReactNative/Modules/AlertModule.cpp +57 -14
  95. package/Microsoft.ReactNative/Modules/AlertModule.h +17 -24
  96. package/Microsoft.ReactNative/Modules/Animated/InterpolationAnimatedNode.cpp +4 -2
  97. package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +3 -1
  98. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +8 -6
  99. package/Microsoft.ReactNative/Modules/AppStateModule.h +6 -9
  100. package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +34 -22
  101. package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +8 -4
  102. package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +6 -4
  103. package/Microsoft.ReactNative/Modules/I18nManagerModule.h +3 -2
  104. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +47 -95
  105. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +28 -17
  106. package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +14 -4
  107. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +1 -1
  108. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +82 -66
  109. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +14 -1
  110. package/Microsoft.ReactNative/ReactInstanceSettings.idl +3 -1
  111. package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +37 -0
  112. package/Microsoft.ReactNative/ReactPointerEventArgs.h +28 -0
  113. package/Microsoft.ReactNative/ReactPointerEventArgs.idl +67 -0
  114. package/Microsoft.ReactNative/Utils/TextTransform.h +1 -1
  115. package/Microsoft.ReactNative/Utils/XamlIslandUtils.cpp +24 -10
  116. package/Microsoft.ReactNative/Utils/XamlIslandUtils.h +4 -2
  117. package/Microsoft.ReactNative/Version.rc +2 -19
  118. package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +57 -2
  119. package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +3 -0
  120. package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +7 -2
  121. package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +16 -6
  122. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +18 -11
  123. package/Microsoft.ReactNative/Views/Image/ReactImage.h +3 -1
  124. package/Microsoft.ReactNative/Views/RawTextViewManager.cpp +4 -53
  125. package/Microsoft.ReactNative/Views/RawTextViewManager.h +0 -3
  126. package/Microsoft.ReactNative/Views/ShadowNodeBase.h +5 -0
  127. package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.cpp +52 -0
  128. package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.h +37 -0
  129. package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.cpp +343 -0
  130. package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.h +13 -0
  131. package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.cpp +76 -0
  132. package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.h +32 -0
  133. package/Microsoft.ReactNative/Views/Text/TextParentVisitor.cpp +12 -0
  134. package/Microsoft.ReactNative/Views/Text/TextParentVisitor.h +19 -0
  135. package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.cpp +80 -0
  136. package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.h +43 -0
  137. package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.cpp +21 -0
  138. package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +23 -0
  139. package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.cpp +70 -0
  140. package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.h +34 -0
  141. package/Microsoft.ReactNative/Views/Text/TextVisitor.cpp +56 -0
  142. package/Microsoft.ReactNative/Views/Text/TextVisitor.h +34 -0
  143. package/Microsoft.ReactNative/Views/Text/TextVisitorScope.h +35 -0
  144. package/Microsoft.ReactNative/Views/Text/TextVisitors.h +47 -0
  145. package/Microsoft.ReactNative/Views/TextViewManager.cpp +112 -103
  146. package/Microsoft.ReactNative/Views/TextViewManager.h +6 -12
  147. package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +171 -129
  148. package/Microsoft.ReactNative/Views/TouchEventHandler.h +19 -15
  149. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +31 -0
  150. package/Microsoft.ReactNative/Views/ViewManagerBase.h +2 -0
  151. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +0 -5
  152. package/Microsoft.ReactNative/Views/VirtualTextViewManager.cpp +21 -91
  153. package/Microsoft.ReactNative/Views/VirtualTextViewManager.h +5 -8
  154. package/Microsoft.ReactNative/XamlView.h +3 -3
  155. package/Microsoft.ReactNative/packages.config +1 -1
  156. package/Microsoft.ReactNative.Cxx/NativeModules.h +114 -0
  157. package/Microsoft.ReactNative.Cxx/VersionMacros.h +19 -0
  158. package/PropertySheets/External/Microsoft.ReactNative.Common.props +2 -0
  159. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.props +1 -0
  160. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +1 -0
  161. package/PropertySheets/Generated/PackageVersion.g.props +19 -0
  162. package/PropertySheets/PackageVersionDefinitions.props +28 -0
  163. package/PropertySheets/React.Cpp.props +2 -0
  164. package/PropertySheets/WinUI.props +1 -1
  165. package/Scripts/Microsoft.ReactNative.Managed.nuspec +1 -1
  166. package/Scripts/copyRNLibraries.js +12 -0
  167. package/Scripts/rnw-dependencies.ps1 +25 -24
  168. package/Shared/HermesSamplingProfiler.cpp +3 -21
  169. package/Shared/JSI/ChakraApi.cpp +1 -37
  170. package/Shared/JSI/ChakraApi.h +0 -4
  171. package/Shared/JSI/ChakraJsiRuntime_edgemode.cpp +1 -5
  172. package/Shared/JSI/ChakraRuntime.cpp +0 -12
  173. package/Shared/JSI/ChakraRuntimeFactory.h +0 -2
  174. package/Shared/Modules/PlatformConstantsModule.cpp +1 -15
  175. package/Shared/OInstance.cpp +6 -19
  176. package/Shared/Shared.vcxitems +0 -1
  177. package/Shared/Shared.vcxitems.filters +0 -3
  178. package/Shared/Utils.cpp +58 -0
  179. package/Shared/Utils.h +3 -0
  180. package/codegen/NativeAccessibilityInfoSpec.g.h +9 -9
  181. package/codegen/NativeAccessibilityManagerSpec.g.h +49 -21
  182. package/codegen/NativeActionSheetManagerSpec.g.h +62 -6
  183. package/codegen/NativeAlertManagerSpec.g.h +4 -4
  184. package/codegen/NativeAnimatedModuleSpec.g.h +10 -10
  185. package/codegen/NativeAnimatedTurboModuleSpec.g.h +10 -10
  186. package/codegen/NativeAppStateSpec.g.h +25 -3
  187. package/codegen/NativeAppearanceSpec.g.h +3 -3
  188. package/codegen/NativeAsyncLocalStorageSpec.g.h +66 -18
  189. package/codegen/NativeAsyncSQLiteDBStorageSpec.g.h +66 -18
  190. package/codegen/NativeBlobModuleSpec.g.h +24 -6
  191. package/codegen/NativeBugReportingSpec.g.h +3 -3
  192. package/codegen/NativeDatePickerAndroidSpec.g.h +3 -3
  193. package/codegen/NativeDevLoadingViewSpec.g.h +3 -3
  194. package/codegen/NativeDeviceInfoSpec.g.h +18 -0
  195. package/codegen/NativeDialogManagerAndroidSpec.g.h +28 -4
  196. package/codegen/NativeDialogManagerWindowsSpec.g.h +77 -0
  197. package/codegen/NativeExceptionsManagerSpec.g.h +11 -11
  198. package/codegen/NativeFileReaderModuleSpec.g.h +6 -6
  199. package/codegen/NativeFrameRateLoggerSpec.g.h +11 -3
  200. package/codegen/NativeI18nManagerSpec.g.h +20 -0
  201. package/codegen/NativeImageEditorSpec.g.h +30 -6
  202. package/codegen/NativeImageLoaderAndroidSpec.g.h +6 -6
  203. package/codegen/NativeImageLoaderIOSSpec.g.h +6 -6
  204. package/codegen/NativeImagePickerIOSSpec.g.h +28 -12
  205. package/codegen/NativeImageStoreAndroidSpec.g.h +3 -3
  206. package/codegen/NativeImageStoreIOSSpec.g.h +21 -9
  207. package/codegen/NativeIntentAndroidSpec.g.h +3 -3
  208. package/codegen/NativeJSCHeapCaptureSpec.g.h +3 -3
  209. package/codegen/NativeJSCSamplingProfilerSpec.g.h +3 -3
  210. package/codegen/NativeJSDevSupportSpec.g.h +18 -0
  211. package/codegen/NativeNetworkingAndroidSpec.g.h +6 -6
  212. package/codegen/NativeNetworkingIOSSpec.g.h +26 -6
  213. package/codegen/NativePermissionsAndroidSpec.g.h +3 -3
  214. package/codegen/NativePlatformConstantsAndroidSpec.g.h +48 -0
  215. package/codegen/NativePlatformConstantsIOSSpec.g.h +38 -0
  216. package/codegen/NativePlatformConstantsWinSpec.g.h +32 -0
  217. package/codegen/NativePushNotificationManagerIOSSpec.g.h +35 -25
  218. package/codegen/NativeRedBoxSpec.g.h +3 -3
  219. package/codegen/NativeSampleTurboModuleSpec.g.h +32 -12
  220. package/codegen/NativeSegmentFetcherSpec.g.h +6 -6
  221. package/codegen/NativeSettingsManagerSpec.g.h +22 -6
  222. package/codegen/NativeShareModuleSpec.g.h +11 -3
  223. package/codegen/NativeSourceCodeSpec.g.h +16 -0
  224. package/codegen/NativeStatusBarManagerAndroidSpec.g.h +21 -3
  225. package/codegen/NativeStatusBarManagerIOSSpec.g.h +30 -6
  226. package/codegen/NativeToastAndroidSpec.g.h +24 -0
  227. package/codegen/NativeUIManagerSpec.g.h +63 -63
  228. package/codegen/NativeVibrationSpec.g.h +3 -3
  229. package/codegen/NativeWebSocketModuleSpec.g.h +9 -3
  230. package/index.js +15 -10
  231. package/index.windows.js +15 -10
  232. package/jest/mockModal.js +31 -0
  233. package/jest/setup.js +5 -3
  234. package/just-task.js +2 -1
  235. package/package.json +23 -20
  236. package/rntypes/BatchedBridge.d.ts +23 -0
  237. package/rntypes/Devtools.d.ts +20 -0
  238. package/rntypes/LaunchScreen.d.ts +9 -0
  239. package/rntypes/globals.d.ts +496 -0
  240. package/rntypes/index.d.ts +9966 -0
  241. package/rntypes/legacy-properties.d.ts +266 -0
  242. package/template/cpp-app/proj/MyApp.vcxproj +0 -5
  243. package/template/cpp-app/src/pch.h +1 -0
  244. package/template/cpp-lib/src/pch.h +3 -0
  245. package/template/cs-app/proj/MyApp.csproj +0 -6
  246. package/typings-index.d.ts +2 -1
  247. package/typings-index.js +7 -5
  248. package/typings-index.js.map +1 -1
  249. package/Chakra/ChakraCoreDebugger.h +0 -147
  250. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
  251. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
  252. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.windows.js +0 -30
  253. package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
  254. package/Libraries/Components/StaticContainer.react.js +0 -51
  255. package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -25
  256. package/Libraries/Interaction/InteractionMixin.js +0 -54
  257. package/Libraries/ReactNative/queryLayoutByID.js +0 -58
  258. package/Scripts/Microsoft.ChakraCore.ARM64.nuspec +0 -50
  259. package/Scripts/Microsoft.ChakraCore.ARM64.targets +0 -15
  260. package/Shared/JSI/ChakraCoreRuntime.h +0 -59
  261. package/template/cpp-app/keys/MyApp_TemporaryKey.pfx +0 -0
  262. package/template/cs-app/keys/MyApp_TemporaryKey.pfx +0 -0
@@ -168,10 +168,13 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
168
168
  React::JSValueArray &&point,
169
169
  std::function<void(double nativeViewTag, double left, double top, double width, double height)>
170
170
  &&callback) noexcept {
171
- auto &node = m_nodeRegistry.getNode(reactTag);
172
- float x = static_cast<float>(point[0]);
173
- float y = static_cast<float>(point[1]);
174
- m_nativeUIManager->findSubviewIn(node, x, y, std::move(callback));
171
+ if (auto node = m_nodeRegistry.findNode(reactTag)) {
172
+ float x = static_cast<float>(point[0]);
173
+ float y = static_cast<float>(point[1]);
174
+ m_nativeUIManager->findSubviewIn(*node, x, y, std::move(callback));
175
+ } else {
176
+ callback(0, 0, 0, 0, 0);
177
+ }
175
178
  }
176
179
 
177
180
  void dispatchViewManagerCommand(
@@ -179,34 +182,40 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
179
182
  winrt::Microsoft::ReactNative::JSValue &&commandID,
180
183
  React::JSValueArray &&commandArgs) noexcept {
181
184
  m_nativeUIManager->ensureInBatch();
182
- auto &node = m_nodeRegistry.getNode(reactTag);
183
-
184
- if (!node.m_zombie)
185
- node.dispatchCommand(commandID.AsString(), std::move(commandArgs));
185
+ if (auto node = m_nodeRegistry.findNode(reactTag)) {
186
+ if (!node->m_zombie)
187
+ node->dispatchCommand(commandID.AsString(), std::move(commandArgs));
188
+ }
186
189
  }
187
190
 
188
191
  void measure(
189
192
  int64_t reactTag,
190
193
  std::function<void(double left, double top, double width, double height, double pageX, double pageY)>
191
194
  &&callback) noexcept {
192
- auto &node = m_nodeRegistry.getNode(reactTag);
193
- int64_t rootTag = reactTag;
194
- while (true) {
195
- auto &currNode = m_nodeRegistry.getNode(rootTag);
196
- if (currNode.m_parent == -1)
197
- break;
198
- rootTag = currNode.m_parent;
199
- }
200
- auto &rootNode = m_nodeRegistry.getNode(rootTag);
195
+ if (auto node = m_nodeRegistry.findNode(reactTag)) {
196
+ int64_t rootTag = reactTag;
197
+ while (true) {
198
+ if (auto currNode = m_nodeRegistry.findNode(rootTag)) {
199
+ if (currNode->m_parent == -1) {
200
+ break;
201
+ }
202
+ rootTag = currNode->m_parent;
203
+ } else {
204
+ callback(0, 0, 0, 0, 0, 0);
205
+ return;
206
+ }
207
+ }
208
+ auto &rootNode = m_nodeRegistry.getNode(rootTag);
201
209
 
202
- m_nativeUIManager->measure(node, rootNode, std::move(callback));
210
+ m_nativeUIManager->measure(*node, rootNode, std::move(callback));
211
+ }
203
212
  }
204
213
 
205
214
  void measureInWindow(
206
215
  int64_t reactTag,
207
216
  std::function<void(double x, double y, double width, double height)> &&callback) noexcept {
208
- auto &node = m_nodeRegistry.getNode(reactTag);
209
- m_nativeUIManager->measureInWindow(node, std::move(callback));
217
+ if (auto node = m_nodeRegistry.findNode(reactTag))
218
+ m_nativeUIManager->measureInWindow(*node, std::move(callback));
210
219
  }
211
220
 
212
221
  void viewIsDescendantOf(
@@ -222,9 +231,11 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
222
231
  int64_t ancestorReactTag,
223
232
  std::function<void(React::JSValue const &)> &&errorCallback,
224
233
  std::function<void(double left, double top, double width, double height)> &&callback) noexcept {
225
- auto &node = m_nodeRegistry.getNode(reactTag);
226
- auto &ancestorNode = m_nodeRegistry.getNode(ancestorReactTag);
227
- m_nativeUIManager->measureLayout(node, ancestorNode, std::move(errorCallback), std::move(callback));
234
+ auto node = m_nodeRegistry.findNode(reactTag);
235
+ auto ancestorNode = m_nodeRegistry.findNode(ancestorReactTag);
236
+ if (node && ancestorNode) {
237
+ m_nativeUIManager->measureLayout(*node, *ancestorNode, std::move(errorCallback), std::move(callback));
238
+ }
228
239
  }
229
240
 
230
241
  void measureLayoutRelativeToParent(
@@ -252,13 +263,13 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
252
263
 
253
264
  void removeSubviewsFromContainerWithID(int64_t containerID) noexcept {
254
265
  m_nativeUIManager->ensureInBatch();
255
- auto &containerNode = m_nodeRegistry.getNode(containerID);
256
-
257
- std::vector<int64_t> indicesToRemove(containerNode.m_children.size());
258
- for (size_t i = 0; i < containerNode.m_children.size(); i++)
259
- indicesToRemove[static_cast<size_t>(i)] = static_cast<int64_t>(i);
260
- std::vector<int64_t> emptyVec;
261
- manageChildren(containerID, emptyVec, emptyVec, emptyVec, emptyVec, indicesToRemove);
266
+ if (auto containerNode = m_nodeRegistry.findNode(containerID)) {
267
+ std::vector<int64_t> indicesToRemove(containerNode->m_children.size());
268
+ for (size_t i = 0; i < containerNode->m_children.size(); i++)
269
+ indicesToRemove[static_cast<size_t>(i)] = static_cast<int64_t>(i);
270
+ std::vector<int64_t> emptyVec;
271
+ manageChildren(containerID, emptyVec, emptyVec, emptyVec, emptyVec, indicesToRemove);
272
+ }
262
273
  }
263
274
 
264
275
  void replaceExistingNonRootView(int64_t reactTag, int64_t newReactTag) noexcept {
@@ -268,39 +279,44 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
268
279
  std::vector<int64_t> tagToAdd(1);
269
280
  tagToAdd[0] = newReactTag;
270
281
 
271
- CHECK(m_nodeRegistry.getNode(reactTag).m_parent != -1) << "oldTag must have a parent";
272
- auto &parent = m_nodeRegistry.getNode(m_nodeRegistry.getNode(reactTag).m_parent);
273
- auto it = find(parent.m_children.begin(), parent.m_children.end(), reactTag);
274
- CHECK(it != parent.m_children.end());
275
- indicesToAdd[0] = indicesToRemove[0] = it - parent.m_children.begin();
282
+ if (auto node = m_nodeRegistry.findNode(reactTag)) {
283
+ CHECK(node->m_parent != -1) << "oldTag must have a parent";
284
+ if (auto parent = m_nodeRegistry.findNode(node->m_parent)) {
285
+ auto it = find(parent->m_children.begin(), parent->m_children.end(), reactTag);
286
+ CHECK(it != parent->m_children.end());
287
+ indicesToAdd[0] = indicesToRemove[0] = it - parent->m_children.begin();
276
288
 
277
- std::vector<int64_t> emptyVec;
278
- manageChildren(parent.m_tag, emptyVec, emptyVec, tagToAdd, indicesToAdd, indicesToRemove);
289
+ std::vector<int64_t> emptyVec;
290
+ manageChildren(parent->m_tag, emptyVec, emptyVec, tagToAdd, indicesToAdd, indicesToRemove);
291
+ }
292
+ }
279
293
  }
280
294
 
281
295
  void removeRootView(int64_t rootViewTag) noexcept {
282
296
  m_nativeUIManager->ensureInBatch();
283
- auto &node = m_nodeRegistry.getRoot(rootViewTag);
284
- m_nativeUIManager->removeRootView(node);
285
- DropView(rootViewTag, true);
286
- m_nodeRegistry.removeRootView(rootViewTag);
287
- m_nativeUIManager->destroyRootShadowNode(&node);
297
+ if (auto node = m_nodeRegistry.findNode(rootViewTag)) {
298
+ m_nativeUIManager->removeRootView(*node);
299
+ DropView(rootViewTag, true);
300
+ m_nodeRegistry.removeRootView(rootViewTag);
301
+ m_nativeUIManager->destroyRootShadowNode(node);
302
+ }
288
303
  }
289
304
 
290
305
  void setChildren(int64_t containerTag, React::JSValueArray &&reactTags) noexcept {
291
306
  m_nativeUIManager->ensureInBatch();
292
- auto &parent = m_nodeRegistry.getNode(containerTag);
293
- int64_t index = 0;
294
- for (auto &&childTag : reactTags) {
295
- auto tag = childTag.AsInt64();
296
- auto &childNode = m_nodeRegistry.getNode(tag);
297
- childNode.m_parent = parent.m_tag;
298
- parent.m_children.push_back(tag);
299
- if (!parent.m_zombie)
300
- parent.AddView(childNode, index);
301
-
302
- m_nativeUIManager->AddView(parent, childNode, index);
303
- ++index;
307
+ if (auto parent = m_nodeRegistry.findNode(containerTag)) {
308
+ int64_t index = 0;
309
+ for (auto &&childTag : reactTags) {
310
+ auto tag = childTag.AsInt64();
311
+ auto childNode = m_nodeRegistry.findNode(tag);
312
+ childNode->m_parent = parent->m_tag;
313
+ parent->m_children.push_back(tag);
314
+ if (!parent->m_zombie)
315
+ parent->AddView(*childNode, index);
316
+
317
+ m_nativeUIManager->AddView(*parent, *childNode, index);
318
+ ++index;
319
+ }
304
320
  }
305
321
  }
306
322
 
@@ -483,23 +499,23 @@ class UIManagerModule : public std::enable_shared_from_this<UIManagerModule>, pu
483
499
  }
484
500
 
485
501
  void DropView(int64_t tag, bool removeChildren = true, bool zombieView = false) {
486
- auto &node = m_nodeRegistry.getNode(tag);
502
+ if (auto node = m_nodeRegistry.findNode(tag)) {
503
+ node->onDropViewInstance();
487
504
 
488
- node.onDropViewInstance();
505
+ m_nativeUIManager->RemoveView(*node, removeChildren);
489
506
 
490
- m_nativeUIManager->RemoveView(node, removeChildren);
507
+ if (zombieView)
508
+ node->m_zombie = true;
491
509
 
492
- if (zombieView)
493
- node.m_zombie = true;
510
+ for (auto childTag : node->m_children)
511
+ DropView(childTag, removeChildren, zombieView);
494
512
 
495
- for (auto childTag : node.m_children)
496
- DropView(childTag, removeChildren, zombieView);
513
+ if (removeChildren)
514
+ node->removeAllChildren();
497
515
 
498
- if (removeChildren)
499
- node.removeAllChildren();
500
-
501
- if (!zombieView)
502
- m_nodeRegistry.removeNode(tag);
516
+ if (!zombieView)
517
+ m_nodeRegistry.removeNode(tag);
518
+ }
503
519
  }
504
520
 
505
521
  winrt::Microsoft::ReactNative::ReactContext m_context;
@@ -22,7 +22,9 @@
22
22
  #include "../../codegen/NativeClipboardSpec.g.h"
23
23
  #include "../../codegen/NativeDevSettingsSpec.g.h"
24
24
  #include "../../codegen/NativeDeviceInfoSpec.g.h"
25
+ #include "../../codegen/NativeDialogManagerWindowsSpec.g.h"
25
26
  #include "../../codegen/NativeI18nManagerSpec.g.h"
27
+ #include "../../codegen/NativeImageLoaderIOSSpec.g.h"
26
28
  #include "../../codegen/NativeLogBoxSpec.g.h"
27
29
  #include "../../codegen/NativeUIManagerSpec.g.h"
28
30
  #include "NativeModules.h"
@@ -54,6 +56,7 @@
54
56
  #endif
55
57
  #include "Modules/DevSettingsModule.h"
56
58
  #ifndef CORE_ABI
59
+ #include <Modules/ImageViewManagerModule.h>
57
60
  #include "Modules/DeviceInfoModule.h"
58
61
  #include "Modules/I18nManagerModule.h"
59
62
  #include "Modules/LogBoxModule.h"
@@ -294,7 +297,11 @@ void ReactInstanceWin::LoadModules(
294
297
  ::Microsoft::ReactNative::AccessibilityInfo,
295
298
  ::Microsoft::ReactNativeSpecs::AccessibilityInfoSpec>());
296
299
 
297
- registerTurboModule(L"Alert", winrt::Microsoft::ReactNative::MakeModuleProvider<::Microsoft::ReactNative::Alert>());
300
+ registerTurboModule(
301
+ L"Alert",
302
+ winrt::Microsoft::ReactNative::MakeTurboModuleProvider<
303
+ ::Microsoft::ReactNative::Alert,
304
+ ::Microsoft::ReactNativeSpecs::DialogManagerWindowsSpec>());
298
305
 
299
306
  registerTurboModule(
300
307
  L"AppState",
@@ -316,6 +323,12 @@ void ReactInstanceWin::LoadModules(
316
323
  winrt::Microsoft::ReactNative::MakeTurboModuleProvider<
317
324
  ::Microsoft::ReactNative::DeviceInfo,
318
325
  ::Microsoft::ReactNativeSpecs::DeviceInfoSpec>());
326
+
327
+ registerTurboModule(
328
+ L"ImageLoader",
329
+ winrt::Microsoft::ReactNative::MakeTurboModuleProvider<
330
+ ::Microsoft::ReactNative::ImageLoader,
331
+ ::Microsoft::ReactNativeSpecs::ImageLoaderIOSSpec>());
319
332
  #endif
320
333
 
321
334
  registerTurboModule(
@@ -217,7 +217,9 @@ namespace Microsoft.ReactNative
217
217
 
218
218
  DOC_STRING(
219
219
  "The @JSIEngine override to be used with the React instance.\n"
220
- "In order the override to work the Microsoft.ReactNative must be compiled with support of that engine.")
220
+ "In order for the override to work, Microsoft.ReactNative must be compiled with support of that engine. "
221
+ "This override will be ignored when @.UseWebDebugger is set to true, since the browser must use its own "
222
+ "engine to debug correctly.")
221
223
  DOC_DEFAULT("JSIEngine.Chakra")
222
224
  JSIEngine JSIEngineOverride { get; set; };
223
225
 
@@ -0,0 +1,37 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "pch.h"
5
+ #include "ReactPointerEventArgs.h"
6
+ #include "ReactPointerEventArgs.g.cpp"
7
+
8
+ namespace winrt::Microsoft::ReactNative::implementation {
9
+
10
+ xaml::Input::PointerRoutedEventArgs ReactPointerEventArgs::Args() const noexcept {
11
+ return m_args;
12
+ }
13
+
14
+ PointerEventKind ReactPointerEventArgs::Kind() const noexcept {
15
+ return m_kind;
16
+ }
17
+
18
+ void ReactPointerEventArgs::Kind(PointerEventKind kind) noexcept {
19
+ // The only event type change that is supported is CaptureLost to End.
20
+ assert(kind == PointerEventKind::End && m_kind == PointerEventKind::CaptureLost);
21
+ m_kind = kind;
22
+ }
23
+
24
+ winrt::IInspectable ReactPointerEventArgs::Target() const noexcept {
25
+ return m_target;
26
+ }
27
+
28
+ void ReactPointerEventArgs::Target(winrt::IInspectable const &target) noexcept {
29
+ m_target = target;
30
+ }
31
+
32
+ ReactPointerEventArgs::ReactPointerEventArgs(
33
+ PointerEventKind kind,
34
+ xaml::Input::PointerRoutedEventArgs const &args) noexcept
35
+ : m_kind{kind}, m_args{args} {}
36
+
37
+ } // namespace winrt::Microsoft::ReactNative::implementation
@@ -0,0 +1,28 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #pragma once
5
+
6
+ #include "ReactPointerEventArgs.g.h"
7
+ #include <UI.Xaml.Input.h>
8
+
9
+ namespace winrt::Microsoft::ReactNative::implementation {
10
+ struct ReactPointerEventArgs : ReactPointerEventArgsT<ReactPointerEventArgs> {
11
+ xaml::Input::PointerRoutedEventArgs Args() const noexcept;
12
+
13
+ PointerEventKind Kind() const noexcept;
14
+ void Kind(PointerEventKind kind) noexcept;
15
+
16
+ winrt::IInspectable Target() const noexcept;
17
+ void Target(winrt::IInspectable const &target) noexcept;
18
+
19
+ // Internal use
20
+ ReactPointerEventArgs(PointerEventKind kind, xaml::Input::PointerRoutedEventArgs const &args) noexcept;
21
+
22
+ private:
23
+ PointerEventKind m_kind;
24
+ xaml::Input::PointerRoutedEventArgs const &m_args;
25
+ winrt::IInspectable m_target{nullptr};
26
+ };
27
+
28
+ } // namespace winrt::Microsoft::ReactNative::implementation
@@ -0,0 +1,67 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ #include "DocString.h"
5
+ #include "NamespaceRedirect.h"
6
+
7
+ namespace Microsoft.ReactNative {
8
+ [experimental]
9
+ [webhosthidden]
10
+ enum PointerEventKind {
11
+ DOC_STRING(
12
+ "Default pointer event kind that corresponding to events that should be "
13
+ "ignored by the React root view pointer event handler."
14
+ )
15
+ None,
16
+ DOC_STRING(
17
+ "Pointer event kind corresponding to "
18
+ "@Windows.UI.Xaml.UIElement.PointerPressedEvent on the React root view."
19
+ )
20
+ Start,
21
+ DOC_STRING(
22
+ "Pointer event kind corresponding to "
23
+ "@Windows.UI.Xaml.UIElement.PointerReleasedEvent on the React root view."
24
+ )
25
+ End,
26
+ DOC_STRING(
27
+ "Pointer event kind corresponding to "
28
+ "@Windows.UI.Xaml.UIElement.PointerMovedEvent on the React root view."
29
+ )
30
+ Move,
31
+ DOC_STRING(
32
+ "Pointer event kind corresponding to "
33
+ "@Windows.UI.Xaml.UIElement.PointerCanceledEvent on the React root view."
34
+ )
35
+ Cancel,
36
+ DOC_STRING(
37
+ "Pointer event kind corresponding to "
38
+ "@Windows.UI.Xaml.UIElement.PointerCaptureLostEvent on the React root view."
39
+ )
40
+ CaptureLost,
41
+ };
42
+
43
+ [experimental]
44
+ [webhosthidden]
45
+ DOC_STRING("Event arguments wrapper for @IViewManagerWithPointerEvents.")
46
+ runtimeclass ReactPointerEventArgs {
47
+ DOC_STRING("Gets the wrapped routed pointer event.")
48
+ XAML_NAMESPACE.Input.PointerRoutedEventArgs Args {
49
+ get;
50
+ };
51
+ DOC_STRING(
52
+ "Gets or sets the pointer event kind. The only valid override is "
53
+ "@PointerEventKind.CaptureLost to @PointerEventKind.End to handle cases "
54
+ "where PointerCaptureLost events on ReactRootView can be safely treated "
55
+ "as PointerReleased events, e.g., for pointer events on selectable text."
56
+ )
57
+ PointerEventKind Kind {
58
+ get;
59
+ set;
60
+ };
61
+ DOC_STRING("Gets or sets the React target for the pointer event.")
62
+ Object Target {
63
+ get;
64
+ set;
65
+ };
66
+ }
67
+ } // namespace Microsoft.ReactNative
@@ -4,5 +4,5 @@
4
4
  #pragma once
5
5
 
6
6
  namespace Microsoft::ReactNative {
7
- enum class TextTransform : uint8_t { Undefined, None, Uppercase, Lowercase, Capitalize };
7
+ enum class TextTransform : uint8_t { Undefined = 0, None, Uppercase, Lowercase, Capitalize };
8
8
  }
@@ -30,21 +30,35 @@ struct CustomAppBarButton : xaml::Controls::AppBarButtonT<CustomAppBarButton> {
30
30
  }
31
31
  };
32
32
 
33
- void FixProofingMenuCrashForXamlIsland(xaml::Controls::TextCommandBarFlyout const &flyout) {
33
+ void FixProofingMenuCrashForXamlIsland(xaml::Controls::Primitives::FlyoutBase const &flyout) {
34
34
  flyout.Opening([](winrt::IInspectable const &sender, auto &&) {
35
- const auto &flyout = sender.as<xaml::Controls::TextCommandBarFlyout>();
35
+ const auto &flyout = sender.as<winrt::Microsoft::UI::Xaml::Controls::TextCommandBarFlyout>();
36
36
  if (const auto &textBox = flyout.Target().try_as<xaml::Controls::TextBox>()) {
37
37
  const auto &commands = flyout.SecondaryCommands();
38
38
  for (uint32_t i = 0; i < commands.Size(); ++i) {
39
39
  if (const auto &appBarButton = commands.GetAt(i).try_as<xaml::Controls::AppBarButton>()) {
40
- if (appBarButton.Flyout() == textBox.ProofingMenuFlyout()) {
41
- // Replace the AppBarButton for the proofing menu with one that doesn't crash
42
- const auto customAppBarButton = winrt::make<CustomAppBarButton>();
43
- customAppBarButton.Label(appBarButton.Label());
44
- customAppBarButton.Icon(appBarButton.Icon());
45
- customAppBarButton.Flyout(appBarButton.Flyout());
46
- commands.RemoveAt(i);
47
- commands.InsertAt(i, customAppBarButton);
40
+ if (!appBarButton.Flyout()) {
41
+ // This works around a loss of focus from the target element when clicking on
42
+ // on the menu items.
43
+ // https://github.com/microsoft/microsoft-ui-xaml/issues/5818
44
+ appBarButton.Click([weakCommandBarFlyout = winrt::make_weak(flyout)](auto &&...) {
45
+ if (auto flyout = weakCommandBarFlyout.get()) {
46
+ xaml::Input::FocusManager::TryFocusAsync(flyout.Target(), xaml::FocusState::Programmatic);
47
+ }
48
+ });
49
+ } else if (appBarButton.Flyout() == textBox.ProofingMenuFlyout()) {
50
+ if (!appBarButton.try_as<CustomAppBarButton>()) {
51
+ // Replace the AppBarButton for the proofing menu with one that doesn't crash
52
+ const auto customAppBarButton = winrt::make<CustomAppBarButton>();
53
+ customAppBarButton.Label(appBarButton.Label());
54
+ customAppBarButton.Icon(appBarButton.Icon());
55
+ customAppBarButton.Flyout(appBarButton.Flyout());
56
+ commands.RemoveAt(i);
57
+ commands.InsertAt(i, customAppBarButton);
58
+ } else if (!textBox.IsSpellCheckEnabled()) {
59
+ // Remove proofing menu option if spell-check is disabled
60
+ commands.RemoveAt(i);
61
+ }
48
62
 
49
63
  // There is only one proofing menu option
50
64
  break;
@@ -8,9 +8,11 @@
8
8
  #include <UI.Xaml.Controls.Primitives.h>
9
9
  #include <UI.Xaml.Controls.h>
10
10
 
11
+ #include <winrt/Microsoft.UI.Xaml.Controls.h>
12
+
11
13
  namespace Microsoft::ReactNative {
12
14
 
13
- void FixProofingMenuCrashForXamlIsland(xaml::Controls::TextCommandBarFlyout const &flyout);
15
+ void FixProofingMenuCrashForXamlIsland(xaml::Controls::Primitives::FlyoutBase const &flyout);
14
16
 
15
17
  template <typename T>
16
18
  inline void EnsureUniqueTextFlyoutForXamlIsland(T const &textView) {
@@ -19,7 +21,7 @@ inline void EnsureUniqueTextFlyoutForXamlIsland(T const &textView) {
19
21
  // to show the flyout on other windows cause the first window to get focus.
20
22
  // https://github.com/microsoft/microsoft-ui-xaml/issues/5341
21
23
  if (IsXamlIsland()) {
22
- xaml::Controls::TextCommandBarFlyout flyout;
24
+ winrt::Microsoft::UI::Xaml::Controls::TextCommandBarFlyout flyout;
23
25
  flyout.Placement(xaml::Controls::Primitives::FlyoutPlacementMode::BottomEdgeAlignedLeft);
24
26
 
25
27
  // This works around a XAML Islands bug where the Proofing sub-menu for
@@ -3,29 +3,12 @@
3
3
  #define XSTRINGIZE(s) STRINGIZE(s)
4
4
  #define STRINGIZE(s) #s
5
5
 
6
- #ifdef RNW_PKG_VERSION_STR
7
- #define VER_FILEVERSION_STR XSTRINGIZE(RNW_PKG_VERSION_STR)
8
- #else
9
- #define VER_FILEVERSION_STR "Private Build"
10
- #endif
11
-
12
- #ifndef RNW_PKG_VERSION_MAJOR
13
- #define RNW_PKG_VERSION_MAJOR 1000
14
- #endif
15
-
16
- #ifndef RNW_PKG_VERSION_MINOR
17
- #define RNW_PKG_VERSION_MINOR 0
18
- #endif
19
-
20
- #ifndef RNW_PKG_VERSION_PATCH
21
- #define RNW_PKG_VERSION_PATCH 0
22
- #endif
23
-
24
6
  #ifndef RNW_PKG_VERSION_BUILD
25
7
  #define RNW_PKG_VERSION_BUILD 0
26
8
  #endif
27
9
 
28
- #define VER_FILEVERSION RNW_PKG_VERSION_MAJOR,RNW_PKG_VERSION_MINOR,RNW_PKG_VERSION_PATCH,RNW_PKG_VERSION_BUILD
10
+ #define VER_FILEVERSION_STR XSTRINGIZE(RNW_VERSION)
11
+ #define VER_FILEVERSION RNW_MAJOR,RNW_MINOR,RNW_PATCH,RNW_PKG_VERSION_BUILD
29
12
 
30
13
  #ifndef DEBUG
31
14
  #define VER_DEBUG 0
@@ -62,6 +62,12 @@ static const std::unordered_map<std::string, winrt::FlyoutPlacementMode> placeme
62
62
  {"right-edge-aligned-top", winrt::FlyoutPlacementMode::RightEdgeAlignedTop},
63
63
  {"right-edge-aligned-bottom", winrt::FlyoutPlacementMode::RightEdgeAlignedBottom}};
64
64
 
65
+ static const std::unordered_map<std::string, winrt::FlyoutShowMode> showModes = {
66
+ {"auto", winrt::FlyoutShowMode::Auto},
67
+ {"standard", winrt::FlyoutShowMode::Standard},
68
+ {"transient", winrt::FlyoutShowMode::Transient},
69
+ {"transient-with-dismiss-on-pointer-move-away", winrt::FlyoutShowMode::TransientWithDismissOnPointerMoveAway}};
70
+
65
71
  template <>
66
72
  struct json_type_traits<winrt::FlyoutPlacementMode> {
67
73
  static winrt::FlyoutPlacementMode parseJson(const winrt::Microsoft::ReactNative::JSValue &value) {
@@ -76,6 +82,19 @@ struct json_type_traits<winrt::FlyoutPlacementMode> {
76
82
  }
77
83
  };
78
84
 
85
+ template <>
86
+ struct json_type_traits<winrt::FlyoutShowMode> {
87
+ static winrt::FlyoutShowMode parseJson(const winrt::Microsoft::ReactNative::JSValue &value) {
88
+ auto iter = showModes.find(value.AsString());
89
+
90
+ if (iter != showModes.end()) {
91
+ return iter->second;
92
+ }
93
+
94
+ return winrt::FlyoutShowMode::Auto;
95
+ }
96
+ };
97
+
79
98
  namespace Microsoft::ReactNative {
80
99
 
81
100
  class FlyoutShadowNode : public ShadowNodeBase {
@@ -112,6 +131,7 @@ class FlyoutShadowNode : public ShadowNodeBase {
112
131
  float m_verticalOffset = 0;
113
132
  bool m_isFlyoutShowOptionsSupported = false;
114
133
  winrt::FlyoutShowOptions m_showOptions = nullptr;
134
+ bool m_autoFocus = false;
115
135
 
116
136
  std::unique_ptr<TouchEventHandler> m_touchEventHanadler;
117
137
  std::unique_ptr<PreviewKeyboardEventHandlerOnRoot> m_previewKeyboardEventHandlerOnRoot;
@@ -210,6 +230,17 @@ void FlyoutShadowNode::createView(const winrt::Microsoft::ReactNative::JSValueOb
210
230
  }
211
231
  }
212
232
 
233
+ if (m_autoFocus) {
234
+ if (const auto content = m_flyout.Content()) {
235
+ if (const auto elementToFocus = xaml::Input::FocusManager::FindFirstFocusableElement(content)) {
236
+ if (const auto uiManager = GetNativeUIManager(GetViewManager()->GetReactContext()).lock()) {
237
+ // NativeUIManager::focus is a no-op if the tag is not found
238
+ uiManager->focus(GetTag(elementToFocus));
239
+ }
240
+ }
241
+ }
242
+ }
243
+
213
244
  flyoutPresenter.AllowFocusOnInteraction(false);
214
245
  }
215
246
  }
@@ -327,6 +358,18 @@ void FlyoutShadowNode::updateProperties(winrt::Microsoft::ReactNative::JSValueOb
327
358
  }
328
359
 
329
360
  m_flyout.LightDismissOverlayMode(overlayMode);
361
+ } else if (propertyName == "autoFocus") {
362
+ m_autoFocus = propertyValue.AsBoolean();
363
+ } else if (propertyName == "showMode") {
364
+ const auto showMode = json_type_traits<winrt::FlyoutShowMode>::parseJson(propertyValue);
365
+ m_flyout.ShowMode(showMode);
366
+ if (m_isFlyoutShowOptionsSupported) {
367
+ m_showOptions.ShowMode(showMode);
368
+ }
369
+ } else if (propertyName == "shouldConstrainToRootBounds") {
370
+ if (propertyValue.Type() == React::JSValueType::Boolean) {
371
+ m_flyout.ShouldConstrainToRootBounds(propertyValue.AsBoolean());
372
+ }
330
373
  }
331
374
  }
332
375
 
@@ -384,7 +427,16 @@ void FlyoutShadowNode::SetTargetFrameworkElement() {
384
427
  }
385
428
  }
386
429
  } else {
387
- m_targetElement = xaml::Window::Current().Content().as<xaml::FrameworkElement>();
430
+ if (IsXamlIsland()) {
431
+ // // XamlRoot added in 19H1
432
+ if (Is19H1OrHigher()) {
433
+ if (auto xamlRoot = React::XamlUIService::GetXamlRoot(GetViewManager()->GetReactContext().Properties())) {
434
+ m_targetElement = xamlRoot.Content().as<xaml::FrameworkElement>();
435
+ }
436
+ }
437
+ } else {
438
+ m_targetElement = xaml::Window::Current().Content().as<xaml::FrameworkElement>();
439
+ }
388
440
  }
389
441
  }
390
442
 
@@ -448,10 +500,13 @@ void FlyoutViewManager::GetNativeProps(const winrt::Microsoft::ReactNative::IJSV
448
500
  React::WriteProperty(writer, L"horizontalOffset", L"number");
449
501
  React::WriteProperty(writer, L"isLightDismissEnabled", L"boolean");
450
502
  React::WriteProperty(writer, L"isOpen", L"boolean");
451
- React::WriteProperty(writer, L"placement", L"number");
503
+ React::WriteProperty(writer, L"placement", L"string");
452
504
  React::WriteProperty(writer, L"target", L"number");
453
505
  React::WriteProperty(writer, L"verticalOffset", L"number");
454
506
  React::WriteProperty(writer, L"isOverlayEnabled", L"boolean");
507
+ React::WriteProperty(writer, L"autoFocus", L"boolean");
508
+ React::WriteProperty(writer, L"showMode", L"string");
509
+ React::WriteProperty(writer, L"shouldConstrainToRootBounds", L"boolean");
455
510
  }
456
511
 
457
512
  void FlyoutViewManager::GetExportedCustomDirectEventTypeConstants(
@@ -33,6 +33,9 @@ void TransferFrameworkElementProperties(const xaml::DependencyObject &oldView, c
33
33
  // Render Properties
34
34
  TransferProperty(oldView, newView, xaml::UIElement::OpacityProperty());
35
35
 
36
+ // Hit Test Properties
37
+ TransferProperty(oldView, newView, xaml::UIElement::IsHitTestVisibleProperty());
38
+
36
39
  // Layout Properties
37
40
  TransferProperty(oldView, newView, xaml::FrameworkElement::WidthProperty());
38
41
  TransferProperty(oldView, newView, xaml::FrameworkElement::HeightProperty());
@@ -261,8 +261,13 @@ bool FrameworkElementViewManager::UpdateProperty(
261
261
  AnnounceLiveRegionChangedIfNeeded(element);
262
262
  } else if (propertyName == "accessible") {
263
263
  if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::Boolean) {
264
- if (!propertyValue.AsBoolean())
265
- xaml::Automation::AutomationProperties::SetAccessibilityView(element, winrt::Peers::AccessibilityView::Raw);
264
+ if (propertyValue.AsBoolean()) {
265
+ xaml::Automation::AutomationProperties::SetAccessibilityView(element, winrt::AccessibilityView::Content);
266
+ } else {
267
+ xaml::Automation::AutomationProperties::SetAccessibilityView(element, winrt::AccessibilityView::Raw);
268
+ }
269
+ } else if (propertyValue.IsNull()) {
270
+ element.ClearValue(xaml::Automation::AutomationProperties::AccessibilityViewProperty());
266
271
  }
267
272
  } else if (propertyName == "accessibilityLiveRegion") {
268
273
  if (propertyValue.Type() == winrt::Microsoft::ReactNative::JSValueType::String) {