react-native-windows 0.74.7 → 0.74.9

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 (49) hide show
  1. package/Libraries/ReactNative/AppContainer-dev.js +3 -2
  2. package/Libraries/ReactNative/AppContainer-prod.js +2 -1
  3. package/Libraries/ReactNative/AppContainer.js +2 -0
  4. package/Libraries/ReactNative/AppRegistry.d.ts +7 -0
  5. package/Libraries/ReactNative/AppRegistry.js +8 -0
  6. package/Libraries/ReactNative/renderApplication.js +3 -0
  7. package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +1 -2
  8. package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -1
  9. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +18 -18
  10. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +2 -2
  11. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +4 -4
  12. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.h +1 -1
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +3 -3
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +3 -3
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +5 -5
  16. package/Microsoft.ReactNative/Fabric/Composition/{CompositionRootView.cpp → ReactNativeIsland.cpp} +59 -51
  17. package/Microsoft.ReactNative/Fabric/Composition/{CompositionRootView.h → ReactNativeIsland.h} +8 -8
  18. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +7 -8
  19. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +2 -2
  20. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +2 -2
  21. package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +82 -17
  22. package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.h +79 -0
  23. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +2 -2
  24. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +3 -3
  25. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +191 -119
  26. package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +11 -0
  27. package/Microsoft.ReactNative/HttpSettings.idl +19 -0
  28. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +15 -11
  29. package/Microsoft.ReactNative/{CompositionRootView.idl → ReactNativeIsland.idl} +10 -10
  30. package/Microsoft.ReactNative/UriImageManager.idl +35 -17
  31. package/Microsoft.ReactNative/Utils/ImageUtils.cpp +22 -3
  32. package/Microsoft.ReactNative/Utils/ImageUtils.h +3 -1
  33. package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
  34. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +13 -4
  35. package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -2
  36. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  37. package/Shared/Modules/FileReaderModule.cpp +3 -4
  38. package/Shared/Modules/WebSocketModule.cpp +14 -16
  39. package/Shared/Networking/DefaultBlobResource.cpp +6 -14
  40. package/Shared/Networking/NetworkPropertyIds.cpp +60 -0
  41. package/Shared/Networking/NetworkPropertyIds.h +41 -0
  42. package/Shared/Networking/RedirectHttpFilter.cpp +18 -9
  43. package/Shared/Networking/RedirectHttpFilter.h +6 -3
  44. package/Shared/Networking/WinRTHttpResource.cpp +36 -8
  45. package/Shared/Networking/WinRTHttpResource.h +17 -0
  46. package/Shared/Shared.vcxitems +6 -4
  47. package/Shared/Shared.vcxitems.filters +5 -3
  48. package/package.json +1 -1
  49. package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -2
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  #include "pch.h"
4
- #include "CompositionRootView.h"
5
- #include "CompositionRootView.g.cpp"
4
+ #include "ReactNativeIsland.h"
6
5
  #include "FocusNavigationRequest.g.cpp"
6
+ #include "ReactNativeIsland.g.cpp"
7
7
  #include <RootViewSizeChangedEventArgs.g.h>
8
8
 
9
9
  #include <AutoDraw.h>
@@ -49,7 +49,7 @@ constexpr float loadingTextHorizontalOffset = 48.0f;
49
49
  struct CompositionReactViewInstance
50
50
  : public winrt::implements<CompositionReactViewInstance, winrt::Microsoft::ReactNative::IReactViewInstance> {
51
51
  CompositionReactViewInstance(
52
- winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::CompositionRootView> &&weakRootControl) noexcept;
52
+ winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland> &&weakRootControl) noexcept;
53
53
 
54
54
  void InitRootView(
55
55
  winrt::Microsoft::ReactNative::IReactContext context,
@@ -63,12 +63,12 @@ struct CompositionReactViewInstance
63
63
  Mso::Future<void> PostInUIQueue(TAction &&action) noexcept;
64
64
 
65
65
  private:
66
- winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::CompositionRootView> m_weakRootControl;
66
+ winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland> m_weakRootControl;
67
67
  IReactDispatcher m_uiDispatcher{nullptr};
68
68
  };
69
69
 
70
70
  CompositionReactViewInstance::CompositionReactViewInstance(
71
- winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::CompositionRootView> &&weakRootControl) noexcept
71
+ winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland> &&weakRootControl) noexcept
72
72
  : m_weakRootControl{std::move(weakRootControl)} {}
73
73
 
74
74
  void CompositionReactViewInstance::InitRootView(
@@ -125,14 +125,14 @@ inline Mso::Future<void> CompositionReactViewInstance::PostInUIQueue(TAction &&a
125
125
  return promise.AsFuture();
126
126
  }
127
127
 
128
- CompositionRootView::CompositionRootView() noexcept {}
128
+ ReactNativeIsland::ReactNativeIsland() noexcept {}
129
129
 
130
130
  #ifdef USE_WINUI3
131
- CompositionRootView::CompositionRootView(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept
131
+ ReactNativeIsland::ReactNativeIsland(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept
132
132
  : m_compositor(compositor) {}
133
133
  #endif
134
134
 
135
- CompositionRootView::~CompositionRootView() noexcept {
135
+ ReactNativeIsland::~ReactNativeIsland() noexcept {
136
136
  #ifdef USE_WINUI3
137
137
  if (m_island && m_island.IsConnected()) {
138
138
  m_island.AutomationProviderRequested(m_islandAutomationProviderRequestedToken);
@@ -145,11 +145,11 @@ CompositionRootView::~CompositionRootView() noexcept {
145
145
  }
146
146
  }
147
147
 
148
- ReactNative::IReactViewHost CompositionRootView::ReactViewHost() noexcept {
148
+ ReactNative::IReactViewHost ReactNativeIsland::ReactViewHost() noexcept {
149
149
  return m_reactViewHost;
150
150
  }
151
151
 
152
- void CompositionRootView::ReactViewHost(winrt::Microsoft::ReactNative::IReactViewHost const &value) noexcept {
152
+ void ReactNativeIsland::ReactViewHost(winrt::Microsoft::ReactNative::IReactViewHost const &value) noexcept {
153
153
  if (m_reactViewHost == value) {
154
154
  return;
155
155
  }
@@ -166,16 +166,16 @@ void CompositionRootView::ReactViewHost(winrt::Microsoft::ReactNative::IReactVie
166
166
  }
167
167
  }
168
168
 
169
- winrt::Microsoft::UI::Composition::Visual CompositionRootView::RootVisual() noexcept {
169
+ winrt::Microsoft::UI::Composition::Visual ReactNativeIsland::RootVisual() noexcept {
170
170
  return winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual(
171
171
  m_rootVisual);
172
172
  }
173
173
 
174
- winrt::Microsoft::ReactNative::Composition::Experimental::IVisual CompositionRootView::InternalRootVisual() noexcept {
174
+ winrt::Microsoft::ReactNative::Composition::Experimental::IVisual ReactNativeIsland::InternalRootVisual() noexcept {
175
175
  return m_rootVisual;
176
176
  }
177
177
 
178
- void CompositionRootView::InternalRootVisual(
178
+ void ReactNativeIsland::InternalRootVisual(
179
179
  winrt::Microsoft::ReactNative::Composition::Experimental::IVisual const &value) noexcept {
180
180
  if (m_rootVisual != value) {
181
181
  assert(!m_rootVisual);
@@ -184,21 +184,21 @@ void CompositionRootView::InternalRootVisual(
184
184
  }
185
185
  }
186
186
 
187
- void CompositionRootView::AddRenderedVisual(
187
+ void ReactNativeIsland::AddRenderedVisual(
188
188
  const winrt::Microsoft::ReactNative::Composition::Experimental::IVisual &visual) noexcept {
189
189
  assert(!m_hasRenderedVisual);
190
190
  InternalRootVisual().InsertAt(visual, 0);
191
191
  m_hasRenderedVisual = true;
192
192
  }
193
193
 
194
- void CompositionRootView::RemoveRenderedVisual(
194
+ void ReactNativeIsland::RemoveRenderedVisual(
195
195
  const winrt::Microsoft::ReactNative::Composition::Experimental::IVisual &visual) noexcept {
196
196
  assert(m_hasRenderedVisual);
197
197
  InternalRootVisual().Remove(visual);
198
198
  m_hasRenderedVisual = false;
199
199
  }
200
200
 
201
- bool CompositionRootView::TrySetFocus() noexcept {
201
+ bool ReactNativeIsland::TrySetFocus() noexcept {
202
202
  #ifdef USE_WINUI3
203
203
  if (m_island && m_island.IsConnected()) {
204
204
  auto focusController = winrt::Microsoft::UI::Input::InputFocusController::GetForIsland(m_island);
@@ -208,23 +208,23 @@ bool CompositionRootView::TrySetFocus() noexcept {
208
208
  return false;
209
209
  }
210
210
 
211
- winrt::Windows::Foundation::Size CompositionRootView::Size() noexcept {
211
+ winrt::Windows::Foundation::Size ReactNativeIsland::Size() noexcept {
212
212
  return m_size;
213
213
  }
214
214
 
215
- void CompositionRootView::Size(winrt::Windows::Foundation::Size value) noexcept {
215
+ void ReactNativeIsland::Size(winrt::Windows::Foundation::Size value) noexcept {
216
216
  m_size = value;
217
217
  UpdateRootVisualSize();
218
218
  }
219
219
 
220
- void CompositionRootView::UpdateRootVisualSize() noexcept {
220
+ void ReactNativeIsland::UpdateRootVisualSize() noexcept {
221
221
  if (m_rootVisual)
222
222
  m_rootVisual.Size({m_size.Width * m_scaleFactor, m_size.Height * m_scaleFactor});
223
223
 
224
224
  UpdateLoadingVisualSize();
225
225
  }
226
226
 
227
- void CompositionRootView::UpdateLoadingVisualSize() noexcept {
227
+ void ReactNativeIsland::UpdateLoadingVisualSize() noexcept {
228
228
  if (m_loadingVisual) {
229
229
  auto drawingSurface = CreateLoadingVisualBrush();
230
230
  m_loadingVisual.Brush(drawingSurface);
@@ -238,11 +238,11 @@ void CompositionRootView::UpdateLoadingVisualSize() noexcept {
238
238
  }
239
239
  }
240
240
 
241
- float CompositionRootView::ScaleFactor() noexcept {
241
+ float ReactNativeIsland::ScaleFactor() noexcept {
242
242
  return m_scaleFactor;
243
243
  }
244
244
 
245
- void CompositionRootView::ScaleFactor(float value) noexcept {
245
+ void ReactNativeIsland::ScaleFactor(float value) noexcept {
246
246
  if (m_scaleFactor != value) {
247
247
  m_scaleFactor = value;
248
248
  // Lifted ContentIslands apply a scale that we need to reverse
@@ -254,15 +254,15 @@ void CompositionRootView::ScaleFactor(float value) noexcept {
254
254
  }
255
255
  }
256
256
 
257
- int64_t CompositionRootView::RootTag() const noexcept {
257
+ int64_t ReactNativeIsland::RootTag() const noexcept {
258
258
  return m_rootTag;
259
259
  }
260
260
 
261
- winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader CompositionRootView::Resources() noexcept {
261
+ winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader ReactNativeIsland::Resources() noexcept {
262
262
  return m_resources;
263
263
  }
264
264
 
265
- void CompositionRootView::Resources(
265
+ void ReactNativeIsland::Resources(
266
266
  const winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader &resources) noexcept {
267
267
  m_resources = resources;
268
268
 
@@ -271,7 +271,7 @@ void CompositionRootView::Resources(
271
271
  }
272
272
  }
273
273
 
274
- winrt::Microsoft::ReactNative::Composition::Theme CompositionRootView::Theme() noexcept {
274
+ winrt::Microsoft::ReactNative::Composition::Theme ReactNativeIsland::Theme() noexcept {
275
275
  if (!m_theme) {
276
276
  assert(m_context);
277
277
  if (m_resources) {
@@ -283,7 +283,7 @@ winrt::Microsoft::ReactNative::Composition::Theme CompositionRootView::Theme() n
283
283
  return m_theme;
284
284
  }
285
285
 
286
- void CompositionRootView::Theme(const winrt::Microsoft::ReactNative::Composition::Theme &value) noexcept {
286
+ void ReactNativeIsland::Theme(const winrt::Microsoft::ReactNative::Composition::Theme &value) noexcept {
287
287
  if (value == m_theme)
288
288
  return;
289
289
 
@@ -315,7 +315,7 @@ void CompositionRootView::Theme(const winrt::Microsoft::ReactNative::Composition
315
315
  }
316
316
  }
317
317
 
318
- winrt::IInspectable CompositionRootView::GetUiaProvider() noexcept {
318
+ winrt::IInspectable ReactNativeIsland::GetUiaProvider() noexcept {
319
319
  if (m_uiaProvider == nullptr) {
320
320
  m_uiaProvider =
321
321
  winrt::make<winrt::Microsoft::ReactNative::implementation::CompositionRootAutomationProvider>(*this);
@@ -331,11 +331,11 @@ winrt::IInspectable CompositionRootView::GetUiaProvider() noexcept {
331
331
  return m_uiaProvider;
332
332
  }
333
333
 
334
- void CompositionRootView::SetWindow(uint64_t hwnd) noexcept {
334
+ void ReactNativeIsland::SetWindow(uint64_t hwnd) noexcept {
335
335
  m_hwnd = reinterpret_cast<HWND>(hwnd);
336
336
  }
337
337
 
338
- int64_t CompositionRootView::SendMessage(uint32_t msg, uint64_t wParam, int64_t lParam) noexcept {
338
+ int64_t ReactNativeIsland::SendMessage(uint32_t msg, uint64_t wParam, int64_t lParam) noexcept {
339
339
  if (m_rootTag == -1)
340
340
  return 0;
341
341
 
@@ -351,7 +351,7 @@ int64_t CompositionRootView::SendMessage(uint32_t msg, uint64_t wParam, int64_t
351
351
  return 0;
352
352
  }
353
353
 
354
- bool CompositionRootView::CapturePointer(
354
+ bool ReactNativeIsland::CapturePointer(
355
355
  const winrt::Microsoft::ReactNative::Composition::Input::Pointer &pointer,
356
356
  facebook::react::Tag tag) noexcept {
357
357
  if (m_hwnd) {
@@ -360,7 +360,7 @@ bool CompositionRootView::CapturePointer(
360
360
  return m_CompositionEventHandler->CapturePointer(pointer, tag);
361
361
  }
362
362
 
363
- void CompositionRootView::ReleasePointerCapture(
363
+ void ReactNativeIsland::ReleasePointerCapture(
364
364
  const winrt::Microsoft::ReactNative::Composition::Input::Pointer &pointer,
365
365
  facebook::react::Tag tag) noexcept {
366
366
  if (m_CompositionEventHandler->ReleasePointerCapture(pointer, tag)) {
@@ -372,7 +372,7 @@ void CompositionRootView::ReleasePointerCapture(
372
372
  }
373
373
  }
374
374
 
375
- void CompositionRootView::InitRootView(
375
+ void ReactNativeIsland::InitRootView(
376
376
  winrt::Microsoft::ReactNative::IReactContext &&context,
377
377
  winrt::Microsoft::ReactNative::ReactViewOptions &&viewOptions) noexcept {
378
378
  m_uiDispatcher = context.Properties()
@@ -393,13 +393,13 @@ void CompositionRootView::InitRootView(
393
393
  m_isInitialized = true;
394
394
  }
395
395
 
396
- void CompositionRootView::UpdateRootView() noexcept {
396
+ void ReactNativeIsland::UpdateRootView() noexcept {
397
397
  VerifyElseCrash(m_uiDispatcher.HasThreadAccess());
398
398
  VerifyElseCrash(m_isInitialized);
399
399
  UpdateRootViewInternal();
400
400
  }
401
401
 
402
- void CompositionRootView::UpdateRootViewInternal() noexcept {
402
+ void ReactNativeIsland::UpdateRootViewInternal() noexcept {
403
403
  switch (m_context.Handle().LoadingState()) {
404
404
  case winrt::Microsoft::ReactNative::LoadingState::Loading:
405
405
  ShowInstanceLoading();
@@ -415,7 +415,7 @@ void CompositionRootView::UpdateRootViewInternal() noexcept {
415
415
  }
416
416
  }
417
417
 
418
- void CompositionRootView::UninitRootView() noexcept {
418
+ void ReactNativeIsland::UninitRootView() noexcept {
419
419
  if (!m_isInitialized) {
420
420
  return;
421
421
  }
@@ -446,7 +446,7 @@ void CompositionRootView::UninitRootView() noexcept {
446
446
  m_isInitialized = false;
447
447
  }
448
448
 
449
- void CompositionRootView::ClearLoadingUI() noexcept {
449
+ void ReactNativeIsland::ClearLoadingUI() noexcept {
450
450
  if (!m_loadingVisual)
451
451
  return;
452
452
 
@@ -456,9 +456,9 @@ void CompositionRootView::ClearLoadingUI() noexcept {
456
456
  m_loadingActivityVisual = nullptr;
457
457
  }
458
458
 
459
- void CompositionRootView::EnsureLoadingUI() noexcept {}
459
+ void ReactNativeIsland::EnsureLoadingUI() noexcept {}
460
460
 
461
- void CompositionRootView::ShowInstanceLoaded() noexcept {
461
+ void ReactNativeIsland::ShowInstanceLoaded() noexcept {
462
462
  if (m_rootVisual) {
463
463
  ClearLoadingUI();
464
464
 
@@ -504,13 +504,13 @@ facebook::react::Size MeasureLoading(const facebook::react::LayoutConstraints &l
504
504
  {loadingActivityHorizontalOffset * scaleFactor + tm.width, loadingBarHeight * scaleFactor});
505
505
  }
506
506
 
507
- winrt::event_token CompositionRootView::SizeChanged(
507
+ winrt::event_token ReactNativeIsland::SizeChanged(
508
508
  winrt::Windows::Foundation::EventHandler<winrt::Microsoft::ReactNative::RootViewSizeChangedEventArgs> const
509
509
  &handler) noexcept {
510
510
  return m_sizeChangedEvent.add(handler);
511
511
  }
512
512
 
513
- void CompositionRootView::SizeChanged(winrt::event_token const &token) noexcept {
513
+ void ReactNativeIsland::SizeChanged(winrt::event_token const &token) noexcept {
514
514
  m_sizeChangedEvent.remove(token);
515
515
  }
516
516
 
@@ -524,7 +524,7 @@ struct RootViewSizeChangedEventArgs : RootViewSizeChangedEventArgsT<RootViewSize
524
524
  const winrt::Windows::Foundation::Size m_size;
525
525
  };
526
526
 
527
- void CompositionRootView::NotifySizeChanged() noexcept {
527
+ void ReactNativeIsland::NotifySizeChanged() noexcept {
528
528
  auto oldSize = m_size;
529
529
  facebook::react::Size size;
530
530
  auto rootComponentView = GetComponentView();
@@ -541,11 +541,11 @@ void CompositionRootView::NotifySizeChanged() noexcept {
541
541
  }
542
542
  }
543
543
 
544
- void CompositionRootView::ShowInstanceError() noexcept {
544
+ void ReactNativeIsland::ShowInstanceError() noexcept {
545
545
  ClearLoadingUI();
546
546
  }
547
547
 
548
- Composition::Experimental::IDrawingSurfaceBrush CompositionRootView::CreateLoadingVisualBrush() noexcept {
548
+ Composition::Experimental::IDrawingSurfaceBrush ReactNativeIsland::CreateLoadingVisualBrush() noexcept {
549
549
  auto compContext =
550
550
  winrt::Microsoft::ReactNative::Composition::implementation::CompositionUIService::GetCompositionContext(
551
551
  m_context.Properties().Handle());
@@ -600,7 +600,7 @@ Composition::Experimental::IDrawingSurfaceBrush CompositionRootView::CreateLoadi
600
600
  return drawingSurface;
601
601
  }
602
602
 
603
- void CompositionRootView::ShowInstanceLoading() noexcept {
603
+ void ReactNativeIsland::ShowInstanceLoading() noexcept {
604
604
  if (!Mso::React::ReactOptions::UseDeveloperSupport(m_context.Properties().Handle()))
605
605
  return;
606
606
 
@@ -634,7 +634,7 @@ void ApplyConstraints(
634
634
  static_cast<facebook::react::LayoutDirection>(layoutConstraintsIn.LayoutDirection);
635
635
  }
636
636
 
637
- winrt::Windows::Foundation::Size CompositionRootView::Measure(
637
+ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
638
638
  const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
639
639
  const winrt::Windows::Foundation::Point &viewportOffset) const noexcept {
640
640
  facebook::react::Size size{0, 0};
@@ -661,7 +661,7 @@ winrt::Windows::Foundation::Size CompositionRootView::Measure(
661
661
  return {clampedSize.width, clampedSize.height};
662
662
  }
663
663
 
664
- void CompositionRootView::Arrange(
664
+ void ReactNativeIsland::Arrange(
665
665
  const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
666
666
  const winrt::Windows::Foundation::Point &viewportOffset) noexcept {
667
667
  ApplyConstraints(layoutConstraints, m_layoutConstraints);
@@ -685,13 +685,21 @@ void CompositionRootView::Arrange(
685
685
  }
686
686
 
687
687
  #ifdef USE_WINUI3
688
- winrt::Microsoft::UI::Content::ContentIsland CompositionRootView::Island() noexcept {
688
+ winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
689
689
  if (!m_compositor) {
690
690
  return nullptr;
691
691
  }
692
692
 
693
693
  if (!m_island) {
694
- auto rootVisual = m_compositor.CreateSpriteVisual();
694
+ winrt::Microsoft::UI::Composition::SpriteVisual rootVisual{nullptr};
695
+ try {
696
+ rootVisual = m_compositor.CreateSpriteVisual();
697
+ } catch (const winrt::hresult_error &e) {
698
+ // If the compositor has been shutdown, then we shouldn't attempt to initialize the island
699
+ if (e.code() == RO_E_CLOSED)
700
+ return nullptr;
701
+ throw e;
702
+ }
695
703
 
696
704
  InternalRootVisual(
697
705
  winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::CreateVisual(
@@ -727,7 +735,7 @@ winrt::Microsoft::UI::Content::ContentIsland CompositionRootView::Island() noexc
727
735
  #endif
728
736
 
729
737
  winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView *
730
- CompositionRootView::GetComponentView() noexcept {
738
+ ReactNativeIsland::GetComponentView() noexcept {
731
739
  if (!m_context || m_context.Handle().LoadingState() != winrt::Microsoft::ReactNative::LoadingState::Loaded ||
732
740
  m_rootTag == -1)
733
741
  return nullptr;
@@ -743,7 +751,7 @@ CompositionRootView::GetComponentView() noexcept {
743
751
  return nullptr;
744
752
  }
745
753
 
746
- winrt::Microsoft::ReactNative::FocusNavigationResult CompositionRootView::NavigateFocus(
754
+ winrt::Microsoft::ReactNative::FocusNavigationResult ReactNativeIsland::NavigateFocus(
747
755
  const winrt::Microsoft::ReactNative::FocusNavigationRequest &request) noexcept {
748
756
  if (auto view = GetComponentView()) {
749
757
  return winrt::make<winrt::Microsoft::ReactNative::implementation::FocusNavigationResult>(
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
  #pragma once
4
4
 
5
- #include "CompositionRootView.g.h"
5
+ #include "ReactNativeIsland.g.h"
6
6
  #include <FocusNavigationRequest.g.h>
7
7
  #include <FocusNavigationResult.g.h>
8
8
 
@@ -41,14 +41,14 @@ struct FocusNavigationResult : FocusNavigationResultT<FocusNavigationResult> {
41
41
  const bool m_wasFocusMoved;
42
42
  };
43
43
 
44
- struct CompositionRootView
45
- : CompositionRootViewT<CompositionRootView, Composition::Experimental::IInternalCompositionRootView> {
46
- CompositionRootView() noexcept;
47
- ~CompositionRootView() noexcept;
44
+ struct ReactNativeIsland
45
+ : ReactNativeIslandT<ReactNativeIsland, Composition::Experimental::IInternalCompositionRootView> {
46
+ ReactNativeIsland() noexcept;
47
+ ~ReactNativeIsland() noexcept;
48
48
 
49
49
  #ifdef USE_WINUI3
50
- CompositionRootView(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept;
51
- winrt::Microsoft::UI::Content::ContentIsland Island() noexcept;
50
+ ReactNativeIsland(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept;
51
+ winrt::Microsoft::UI::Content::ContentIsland Island();
52
52
  #endif
53
53
 
54
54
  // property ReactViewHost
@@ -165,7 +165,7 @@ struct CompositionRootView
165
165
  } // namespace winrt::Microsoft::ReactNative::implementation
166
166
 
167
167
  namespace winrt::Microsoft::ReactNative::factory_implementation {
168
- struct CompositionRootView : CompositionRootViewT<CompositionRootView, implementation::CompositionRootView> {};
168
+ struct ReactNativeIsland : ReactNativeIslandT<ReactNativeIsland, implementation::ReactNativeIsland> {};
169
169
  struct FocusNavigationRequest
170
170
  : FocusNavigationRequestT<FocusNavigationRequest, implementation::FocusNavigationRequest> {};
171
171
  } // namespace winrt::Microsoft::ReactNative::factory_implementation
@@ -8,7 +8,7 @@
8
8
 
9
9
  #include <Fabric/FabricUIManagerModule.h>
10
10
  #include "CompositionRootAutomationProvider.h"
11
- #include "CompositionRootView.h"
11
+ #include "ReactNativeIsland.h"
12
12
  #include "Theme.h"
13
13
 
14
14
  namespace winrt::Microsoft::ReactNative::Composition::implementation {
@@ -29,7 +29,7 @@ RootComponentView::RootComponentView(
29
29
 
30
30
  RootComponentView::~RootComponentView() {
31
31
  if (auto rootView = m_wkRootView.get()) {
32
- winrt::get_self<winrt::Microsoft::ReactNative::implementation::CompositionRootView>(rootView)->RemoveRenderedVisual(
32
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->RemoveRenderedVisual(
33
33
  OuterVisual());
34
34
  }
35
35
  }
@@ -53,8 +53,7 @@ void RootComponentView::updateLayoutMetrics(
53
53
  if (oldLayoutMetrics.frame != layoutMetrics.frame ||
54
54
  oldLayoutMetrics.pointScaleFactor != layoutMetrics.pointScaleFactor) {
55
55
  if (auto rootView = m_wkRootView.get()) {
56
- winrt::get_self<winrt::Microsoft::ReactNative::implementation::CompositionRootView>(rootView)
57
- ->NotifySizeChanged();
56
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->NotifySizeChanged();
58
57
  }
59
58
  }
60
59
  }
@@ -74,7 +73,7 @@ void RootComponentView::SetFocusedComponent(const winrt::Microsoft::ReactNative:
74
73
 
75
74
  if (value) {
76
75
  if (auto rootView = m_wkRootView.get()) {
77
- winrt::get_self<winrt::Microsoft::ReactNative::implementation::CompositionRootView>(rootView)->TrySetFocus();
76
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->TrySetFocus();
78
77
  }
79
78
  auto args = winrt::make<winrt::Microsoft::ReactNative::implementation::GotFocusEventArgs>(value);
80
79
  winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(value)->onGotFocus(args);
@@ -162,7 +161,7 @@ HRESULT RootComponentView::GetFragmentRoot(IRawElementProviderFragmentRoot **pRe
162
161
  if (uiManager == nullptr)
163
162
  return UIA_E_ELEMENTNOTAVAILABLE;
164
163
 
165
- auto rootView = uiManager->GetCompositionRootView(Tag());
164
+ auto rootView{uiManager->GetReactNativeIsland(Tag())};
166
165
  if (!rootView) {
167
166
  return UIA_E_ELEMENTNOTAVAILABLE;
168
167
  }
@@ -179,8 +178,8 @@ uint32_t RootComponentView::overlayIndex() noexcept {
179
178
  return 1;
180
179
  }
181
180
 
182
- void RootComponentView::start(const winrt::Microsoft::ReactNative::CompositionRootView &rootView) noexcept {
183
- winrt::get_self<winrt::Microsoft::ReactNative::implementation::CompositionRootView>(rootView)->AddRenderedVisual(
181
+ void RootComponentView::start(const winrt::Microsoft::ReactNative::ReactNativeIsland &rootView) noexcept {
182
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->AddRenderedVisual(
184
183
  OuterVisual());
185
184
  m_wkRootView = rootView;
186
185
  }
@@ -38,7 +38,7 @@ struct RootComponentView : RootComponentViewT<RootComponentView, ViewComponentVi
38
38
 
39
39
  // Index that visuals can be inserted into OuterVisual for debugging UI
40
40
  uint32_t overlayIndex() noexcept;
41
- void start(const winrt::Microsoft::ReactNative::CompositionRootView &rootView) noexcept;
41
+ void start(const winrt::Microsoft::ReactNative::ReactNativeIsland &rootView) noexcept;
42
42
 
43
43
  HRESULT GetFragmentRoot(IRawElementProviderFragmentRoot **pRetVal) noexcept;
44
44
  winrt::Microsoft::ReactNative::implementation::ClipState getClipState() noexcept override;
@@ -64,7 +64,7 @@ struct RootComponentView : RootComponentViewT<RootComponentView, ViewComponentVi
64
64
  // be clearing its focus But being a reactTaggedView might make it easier to identify cases where that isn't
65
65
  // happening.
66
66
  winrt::Microsoft::ReactNative::ComponentView m_focusedComponent{nullptr};
67
- winrt::weak_ref<winrt::Microsoft::ReactNative::CompositionRootView> m_wkRootView{nullptr};
67
+ winrt::weak_ref<winrt::Microsoft::ReactNative::ReactNativeIsland> m_wkRootView{nullptr};
68
68
  };
69
69
 
70
70
  } // namespace winrt::Microsoft::ReactNative::Composition::implementation
@@ -736,7 +736,7 @@ void WindowsTextInputComponentView::OnPointerMoved(
736
736
  msg = WM_MOUSEMOVE;
737
737
  wParam = PointerRoutedEventArgsToMouseWParam(args);
738
738
  } else {
739
- msg = WM_POINTERUP;
739
+ msg = WM_POINTERUPDATE;
740
740
  wParam = PointerPointToPointerWParam(pp);
741
741
  }
742
742
 
@@ -1411,7 +1411,7 @@ winrt::com_ptr<::IDWriteTextLayout> WindowsTextInputComponentView::CreatePlaceho
1411
1411
 
1412
1412
  void WindowsTextInputComponentView::DrawText() noexcept {
1413
1413
  m_needsRedraw = true;
1414
- if (m_cDrawBlock || theme()->IsEmpty()) {
1414
+ if (m_cDrawBlock || theme()->IsEmpty() || !m_textServices) {
1415
1415
  return;
1416
1416
  }
1417
1417