react-native-windows 0.74.10 → 0.74.12

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 (50) hide show
  1. package/Common/Common.vcxproj +8 -0
  2. package/Directory.Build.targets +5 -0
  3. package/Folly/Folly.vcxproj +10 -2
  4. package/Folly/Folly.vcxproj.filters +0 -7
  5. package/Libraries/Components/TextInput/TextInput.js +6 -3
  6. package/Libraries/Components/TextInput/TextInput.windows.js +6 -3
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/Text/Text.windows.js +1 -0
  9. package/Microsoft.ReactNative/Composition.Input.idl +3 -3
  10. package/Microsoft.ReactNative/CompositionSwitcher.idl +1 -0
  11. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +3 -0
  12. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +2 -2
  13. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +4 -4
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +10 -0
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +16 -27
  16. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -1
  17. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +85 -48
  18. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +4 -0
  19. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +19 -15
  20. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +4 -2
  21. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +10 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +3 -0
  23. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +42 -17
  24. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +3 -1
  25. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +42 -5
  26. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +22 -16
  27. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +30 -6
  28. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
  29. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +5 -0
  30. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +3 -2
  31. package/Microsoft.ReactNative/packages.lock.json +10 -0
  32. package/PropertySheets/ARM64EC.props +13 -0
  33. package/PropertySheets/Application/ARM64EC.props +13 -0
  34. package/PropertySheets/DynamicLibrary/ARM64EC.props +13 -0
  35. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  36. package/PropertySheets/JSEngine.props +2 -0
  37. package/PropertySheets/StaticLibrary/ARM64EC.props +13 -0
  38. package/ReactCommon/ReactCommon.vcxproj +9 -1
  39. package/ReactCommon/ReactCommon.vcxproj.filters +16 -12
  40. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +2 -0
  41. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +140 -0
  42. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +92 -0
  43. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +48 -0
  44. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +122 -0
  45. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +366 -0
  46. package/Scripts/OfficeReact.Win32.nuspec +16 -18
  47. package/Scripts/StripAdditionalPlatformsFromNuspec.ps1 +1 -1
  48. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +6 -6
  49. package/fmt/fmt.vcxproj +9 -1
  50. package/package.json +13 -13
@@ -47,6 +47,7 @@ struct ImageComponentView : ImageComponentViewT<ImageComponentView, ViewComponen
47
47
  override;
48
48
  void updateState(facebook::react::State::Shared const &state, facebook::react::State::Shared const &oldState) noexcept
49
49
  override;
50
+ void prepareForRecycle() noexcept override;
50
51
  void OnRenderingDeviceLost() noexcept override;
51
52
  void onThemeChanged() noexcept override;
52
53
 
@@ -69,13 +70,14 @@ struct ImageComponentView : ImageComponentViewT<ImageComponentView, ViewComponen
69
70
  private:
70
71
  struct WindowsImageResponseObserver : facebook::react::ImageResponseObserver {
71
72
  public:
72
- WindowsImageResponseObserver(ImageComponentView &image);
73
+ WindowsImageResponseObserver(
74
+ winrt::weak_ref<winrt::Microsoft::ReactNative::Composition::implementation::ImageComponentView> wkImage);
73
75
  void didReceiveProgress(float progress) const override;
74
76
  void didReceiveImage(facebook::react::ImageResponse const &imageResponse) const override;
75
77
  void didReceiveFailure() const override;
76
78
 
77
79
  private:
78
- winrt::com_ptr<ImageComponentView> m_image;
80
+ winrt::weak_ref<winrt::Microsoft::ReactNative::Composition::implementation::ImageComponentView> m_wkImage;
79
81
  };
80
82
 
81
83
  void ensureDrawingSurface() noexcept;
@@ -83,6 +83,16 @@ void ParagraphComponentView::updateState(
83
83
  m_textLayout = nullptr;
84
84
  }
85
85
 
86
+ void ParagraphComponentView::updateLayoutMetrics(
87
+ facebook::react::LayoutMetrics const &layoutMetrics,
88
+ facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept {
89
+ Super::updateLayoutMetrics(layoutMetrics, oldLayoutMetrics);
90
+
91
+ if (layoutMetrics.pointScaleFactor != oldLayoutMetrics.pointScaleFactor) {
92
+ m_textLayout = nullptr;
93
+ }
94
+ }
95
+
86
96
  void ParagraphComponentView::FinalizeUpdates(
87
97
  winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept {
88
98
  ensureVisual();
@@ -34,6 +34,9 @@ struct ParagraphComponentView : ParagraphComponentViewT<ParagraphComponentView,
34
34
  void updateProps(facebook::react::Props::Shared const &props, facebook::react::Props::Shared const &oldProps) noexcept
35
35
  override;
36
36
  void updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept override;
37
+ void updateLayoutMetrics(
38
+ facebook::react::LayoutMetrics const &layoutMetrics,
39
+ facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
37
40
  void updateState(facebook::react::State::Shared const &state, facebook::react::State::Shared const &oldState) noexcept
38
41
  override;
39
42
  void FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept override;
@@ -125,6 +125,15 @@ inline Mso::Future<void> CompositionReactViewInstance::PostInUIQueue(TAction &&a
125
125
  return promise.AsFuture();
126
126
  }
127
127
 
128
+ void ApplyConstraints(
129
+ const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraintsIn,
130
+ facebook::react::LayoutConstraints &layoutConstraintsOut) noexcept {
131
+ layoutConstraintsOut.minimumSize = {layoutConstraintsIn.MinimumSize.Width, layoutConstraintsIn.MinimumSize.Height};
132
+ layoutConstraintsOut.maximumSize = {layoutConstraintsIn.MaximumSize.Width, layoutConstraintsIn.MaximumSize.Height};
133
+ layoutConstraintsOut.layoutDirection =
134
+ static_cast<facebook::react::LayoutDirection>(layoutConstraintsIn.LayoutDirection);
135
+ }
136
+
128
137
  ReactNativeIsland::ReactNativeIsland() noexcept {}
129
138
 
130
139
  #ifdef USE_WINUI3
@@ -136,6 +145,7 @@ ReactNativeIsland::~ReactNativeIsland() noexcept {
136
145
  #ifdef USE_WINUI3
137
146
  if (m_island && m_island.IsConnected()) {
138
147
  m_island.AutomationProviderRequested(m_islandAutomationProviderRequestedToken);
148
+ m_island.StateChanged(m_islandStateChangedToken);
139
149
  }
140
150
  #endif
141
151
 
@@ -251,6 +261,7 @@ void ReactNativeIsland::ScaleFactor(float value) noexcept {
251
261
  rootView.Scale({invScale, invScale, invScale});
252
262
  }
253
263
  UpdateRootVisualSize();
264
+ Arrange(m_layoutConstraints, m_viewportOffset);
254
265
  }
255
266
  }
256
267
 
@@ -471,10 +482,14 @@ void ReactNativeIsland::ShowInstanceLoaded() noexcept {
471
482
  initProps = folly::dynamic::object();
472
483
  }
473
484
  initProps["concurrentRoot"] = true;
485
+
486
+ facebook::react::LayoutConstraints fbLayoutConstraints;
487
+ ApplyConstraints(m_layoutConstraints, fbLayoutConstraints);
488
+
474
489
  uiManager->startSurface(
475
490
  *this,
476
491
  static_cast<facebook::react::SurfaceId>(m_rootTag),
477
- m_layoutConstraints,
492
+ fbLayoutConstraints,
478
493
  to_string(m_reactViewOptions.ComponentName()),
479
494
  initProps);
480
495
 
@@ -491,16 +506,21 @@ facebook::react::AttributedStringBox CreateLoadingAttributedString() noexcept {
491
506
  return facebook::react::AttributedStringBox{attributedString};
492
507
  }
493
508
 
494
- facebook::react::Size MeasureLoading(const facebook::react::LayoutConstraints &layoutConstraints, float scaleFactor) {
509
+ facebook::react::Size MeasureLoading(
510
+ const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
511
+ float scaleFactor) {
512
+ facebook::react::LayoutConstraints fbLayoutConstraints;
513
+ ApplyConstraints(layoutConstraints, fbLayoutConstraints);
514
+
495
515
  auto attributedStringBox = CreateLoadingAttributedString();
496
516
  winrt::com_ptr<::IDWriteTextLayout> textLayout;
497
517
  facebook::react::TextLayoutManager::GetTextLayout(
498
- attributedStringBox, {} /*paragraphAttributes*/, layoutConstraints, textLayout);
518
+ attributedStringBox, {} /*paragraphAttributes*/, fbLayoutConstraints, textLayout);
499
519
 
500
520
  DWRITE_TEXT_METRICS tm;
501
521
  textLayout->GetMetrics(&tm);
502
522
 
503
- return layoutConstraints.clamp(
523
+ return fbLayoutConstraints.clamp(
504
524
  {loadingActivityHorizontalOffset * scaleFactor + tm.width, loadingBarHeight * scaleFactor});
505
525
  }
506
526
 
@@ -625,15 +645,6 @@ void ReactNativeIsland::ShowInstanceLoading() noexcept {
625
645
  InternalRootVisual().InsertAt(m_loadingVisual, m_hasRenderedVisual ? 1 : 0);
626
646
  }
627
647
 
628
- void ApplyConstraints(
629
- const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraintsIn,
630
- facebook::react::LayoutConstraints &layoutConstraintsOut) noexcept {
631
- layoutConstraintsOut.minimumSize = {layoutConstraintsIn.MinimumSize.Width, layoutConstraintsIn.MinimumSize.Height};
632
- layoutConstraintsOut.maximumSize = {layoutConstraintsIn.MaximumSize.Width, layoutConstraintsIn.MaximumSize.Height};
633
- layoutConstraintsOut.layoutDirection =
634
- static_cast<facebook::react::LayoutDirection>(layoutConstraintsIn.LayoutDirection);
635
- }
636
-
637
648
  winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
638
649
  const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
639
650
  const winrt::Windows::Foundation::Point &viewportOffset) const noexcept {
@@ -654,7 +665,7 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
654
665
  size = fabricuiManager->measureSurface(static_cast<facebook::react::SurfaceId>(m_rootTag), constraints, context);
655
666
  }
656
667
  } else if (m_loadingVisual) {
657
- size = MeasureLoading(constraints, m_scaleFactor);
668
+ size = MeasureLoading(layoutConstraints, m_scaleFactor);
658
669
  }
659
670
 
660
671
  auto clampedSize = constraints.clamp(size);
@@ -664,7 +675,10 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
664
675
  void ReactNativeIsland::Arrange(
665
676
  const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
666
677
  const winrt::Windows::Foundation::Point &viewportOffset) noexcept {
667
- ApplyConstraints(layoutConstraints, m_layoutConstraints);
678
+ m_layoutConstraints = layoutConstraints;
679
+ m_viewportOffset = viewportOffset;
680
+ facebook::react::LayoutConstraints fbLayoutConstraints;
681
+ ApplyConstraints(layoutConstraints, fbLayoutConstraints);
668
682
 
669
683
  if (m_isInitialized && m_rootTag != -1) {
670
684
  if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
@@ -675,11 +689,11 @@ void ReactNativeIsland::Arrange(
675
689
  context.viewportOffset = {viewportOffset.X, viewportOffset.Y};
676
690
 
677
691
  fabricuiManager->constraintSurfaceLayout(
678
- static_cast<facebook::react::SurfaceId>(m_rootTag), m_layoutConstraints, context);
692
+ static_cast<facebook::react::SurfaceId>(m_rootTag), fbLayoutConstraints, context);
679
693
  }
680
694
  } else if (m_loadingVisual) {
681
695
  // TODO: Resize to align loading
682
- auto s = m_layoutConstraints.clamp(MeasureLoading(m_layoutConstraints, m_scaleFactor));
696
+ auto s = fbLayoutConstraints.clamp(MeasureLoading(layoutConstraints, m_scaleFactor));
683
697
  NotifySizeChanged();
684
698
  }
685
699
  }
@@ -729,6 +743,17 @@ winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
729
743
  pThis->m_island = nullptr;
730
744
  }
731
745
  });
746
+
747
+ m_islandStateChangedToken =
748
+ m_island.StateChanged([weakThis = get_weak()](
749
+ winrt::Microsoft::UI::Content::ContentIsland const &island,
750
+ winrt::Microsoft::UI::Content::ContentIslandStateChangedEventArgs const &args) {
751
+ if (auto pThis = weakThis.get()) {
752
+ if (args.DidRasterizationScaleChange()) {
753
+ pThis->ScaleFactor(island.RasterizationScale());
754
+ }
755
+ }
756
+ });
732
757
  }
733
758
  return m_island;
734
759
  }
@@ -125,6 +125,7 @@ struct ReactNativeIsland
125
125
  winrt::Microsoft::UI::Content::ContentIsland m_island{nullptr};
126
126
  winrt::event_token m_islandFrameworkClosedToken;
127
127
  winrt::event_token m_islandAutomationProviderRequestedToken;
128
+ winrt::event_token m_islandStateChangedToken;
128
129
  #endif
129
130
 
130
131
  HWND m_hwnd{0};
@@ -147,7 +148,8 @@ struct ReactNativeIsland
147
148
  winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader m_resources{nullptr};
148
149
  winrt::Microsoft::ReactNative::Composition::Theme m_theme{nullptr};
149
150
  winrt::Microsoft::ReactNative::Composition::Theme::ThemeChanged_revoker m_themeChangedRevoker;
150
- facebook::react::LayoutConstraints m_layoutConstraints;
151
+ winrt::Microsoft::ReactNative::LayoutConstraints m_layoutConstraints;
152
+ winrt::Windows::Foundation::Point m_viewportOffset{0, 0};
151
153
  winrt::event<winrt::Windows::Foundation::EventHandler<winrt::Microsoft::ReactNative::RootViewSizeChangedEventArgs>>
152
154
  m_sizeChangedEvent;
153
155
 
@@ -65,13 +65,14 @@ struct ScrollBarComponent {
65
65
 
66
66
  updateShy(true);
67
67
  onScaleChanged();
68
- OnThemeChanged();
68
+ UpdateColorForScrollBarRegions();
69
69
  }
70
70
 
71
- void OnThemeChanged() noexcept {
71
+ void UpdateColorForScrollBarRegions() noexcept {
72
72
  updateHighlight(ScrollbarHitRegion::ArrowFirst);
73
73
  updateHighlight(ScrollbarHitRegion::ArrowLast);
74
74
  updateHighlight(ScrollbarHitRegion::Thumb);
75
+
75
76
  m_trackVisual.Brush(
76
77
  winrt::get_self<winrt::Microsoft::ReactNative::Composition::implementation::Theme>(m_outer.Theme())
77
78
  ->InternalPlatformBrush(L"ScrollBarTrackFill"));
@@ -726,6 +727,14 @@ void ScrollViewComponentView::updateProps(
726
727
 
727
728
  // update BaseComponentView props
728
729
  base_type::updateProps(props, oldProps);
730
+
731
+ // Update the color only after updating the m_props in BaseComponentView
732
+ // to avoid scrollbarcomponents reading outdated scrollEnabled value.
733
+ if (!oldProps || oldViewProps.scrollEnabled != newViewProps.scrollEnabled) {
734
+ m_scrollVisual.ScrollEnabled(newViewProps.scrollEnabled);
735
+ m_horizontalScrollbarComponent->UpdateColorForScrollBarRegions();
736
+ m_verticalScrollbarComponent->UpdateColorForScrollBarRegions();
737
+ }
729
738
  }
730
739
 
731
740
  void ScrollViewComponentView::updateState(
@@ -825,8 +834,8 @@ void ScrollViewComponentView::OnPointerDown(const winrt::Windows::UI::Input::Poi
825
834
 
826
835
  void ScrollViewComponentView::onThemeChanged() noexcept {
827
836
  updateBackgroundColor(std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->backgroundColor);
828
- m_verticalScrollbarComponent->OnThemeChanged();
829
- m_horizontalScrollbarComponent->OnThemeChanged();
837
+ m_verticalScrollbarComponent->UpdateColorForScrollBarRegions();
838
+ m_horizontalScrollbarComponent->UpdateColorForScrollBarRegions();
830
839
  Super::onThemeChanged();
831
840
  }
832
841
 
@@ -919,6 +928,10 @@ void ScrollViewComponentView::OnKeyDown(
919
928
  }
920
929
 
921
930
  bool ScrollViewComponentView::scrollToEnd(bool animate) noexcept {
931
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
932
+ return false;
933
+ }
934
+
922
935
  if ((((m_contentSize.height - m_layoutMetrics.frame.size.height) * m_layoutMetrics.pointScaleFactor) -
923
936
  m_scrollVisual.ScrollPosition().y) < 1.0f) {
924
937
  return false;
@@ -931,6 +944,10 @@ bool ScrollViewComponentView::scrollToEnd(bool animate) noexcept {
931
944
  }
932
945
 
933
946
  bool ScrollViewComponentView::scrollToStart(bool animate) noexcept {
947
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
948
+ return false;
949
+ }
950
+
934
951
  m_scrollVisual.TryUpdatePosition({0.0f, 0.0f, 0.0f}, animate);
935
952
  return true;
936
953
  }
@@ -960,6 +977,10 @@ bool ScrollViewComponentView::lineRight(bool animate) noexcept {
960
977
  }
961
978
 
962
979
  bool ScrollViewComponentView::scrollDown(float delta, bool animate) noexcept {
980
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
981
+ return false;
982
+ }
983
+
963
984
  if (((m_contentSize.height - m_layoutMetrics.frame.size.height) * m_layoutMetrics.pointScaleFactor) -
964
985
  m_scrollVisual.ScrollPosition().y <
965
986
  1.0f) {
@@ -971,6 +992,10 @@ bool ScrollViewComponentView::scrollDown(float delta, bool animate) noexcept {
971
992
  }
972
993
 
973
994
  bool ScrollViewComponentView::scrollUp(float delta, bool animate) noexcept {
995
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
996
+ return false;
997
+ }
998
+
974
999
  if (m_scrollVisual.ScrollPosition().y <= 0.0f) {
975
1000
  return false;
976
1001
  }
@@ -980,6 +1005,10 @@ bool ScrollViewComponentView::scrollUp(float delta, bool animate) noexcept {
980
1005
  }
981
1006
 
982
1007
  bool ScrollViewComponentView::scrollLeft(float delta, bool animate) noexcept {
1008
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
1009
+ return false;
1010
+ }
1011
+
983
1012
  if (m_scrollVisual.ScrollPosition().x <= 0.0f) {
984
1013
  return false;
985
1014
  }
@@ -989,6 +1018,10 @@ bool ScrollViewComponentView::scrollLeft(float delta, bool animate) noexcept {
989
1018
  }
990
1019
 
991
1020
  bool ScrollViewComponentView::scrollRight(float delta, bool animate) noexcept {
1021
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
1022
+ return false;
1023
+ }
1024
+
992
1025
  if (((m_contentSize.width - m_layoutMetrics.frame.size.width) * m_layoutMetrics.pointScaleFactor) -
993
1026
  m_scrollVisual.ScrollPosition().x <
994
1027
  1.0f) {
@@ -1025,6 +1058,10 @@ void ScrollViewComponentView::HandleCommand(
1025
1058
  }
1026
1059
 
1027
1060
  void ScrollViewComponentView::scrollTo(winrt::Windows::Foundation::Numerics::float3 offset, bool animate) noexcept {
1061
+ if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
1062
+ return;
1063
+ }
1064
+
1028
1065
  m_scrollVisual.TryUpdatePosition(offset, animate);
1029
1066
  }
1030
1067
 
@@ -1097,7 +1134,7 @@ void ScrollViewComponentView::StartBringIntoView(
1097
1134
  scrollToHorizontal = options.TargetRect->getMidX() - (viewerWidth * options.HorizontalAlignmentRatio);
1098
1135
  }
1099
1136
 
1100
- if (needsScroll) {
1137
+ if (needsScroll && std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
1101
1138
  m_scrollVisual.TryUpdatePosition(
1102
1139
  {static_cast<float>(scrollToHorizontal), static_cast<float>(scrollToVertical), 0.0f}, options.AnimationDesired);
1103
1140
  }
@@ -11,6 +11,7 @@
11
11
  #include <Utils/ValueUtils.h>
12
12
  #include <tom.h>
13
13
  #include <unicode.h>
14
+ #include <winrt/Microsoft.UI.Input.h>
14
15
  #include <winrt/Windows.System.h>
15
16
  #include <winrt/Windows.UI.h>
16
17
  #include "../CompositionHelpers.h"
@@ -754,8 +755,8 @@ void WindowsTextInputComponentView::OnKeyDown(
754
755
  // Do not forward tab keys into the TextInput, since we want that to do the tab loop instead. This aligns with WinUI
755
756
  // behavior We do forward Ctrl+Tab to the textinput.
756
757
  if (args.Key() != winrt::Windows::System::VirtualKey::Tab ||
757
- source.GetKeyState(winrt::Windows::System::VirtualKey::Control) ==
758
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down) {
758
+ (source.GetKeyState(winrt::Windows::System::VirtualKey::Control) &
759
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down) {
759
760
  WPARAM wParam = static_cast<WPARAM>(args.Key());
760
761
  LPARAM lParam = 0;
761
762
  lParam = args.KeyStatus().RepeatCount; // bits 0-15
@@ -784,8 +785,8 @@ void WindowsTextInputComponentView::OnKeyUp(
784
785
  // Do not forward tab keys into the TextInput, since we want that to do the tab loop instead. This aligns with WinUI
785
786
  // behavior We do forward Ctrl+Tab to the textinput.
786
787
  if (args.Key() != winrt::Windows::System::VirtualKey::Tab ||
787
- source.GetKeyState(winrt::Windows::System::VirtualKey::Control) ==
788
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down) {
788
+ (source.GetKeyState(winrt::Windows::System::VirtualKey::Control) &
789
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down) {
789
790
  WPARAM wParam = static_cast<WPARAM>(args.Key());
790
791
  LPARAM lParam = 1;
791
792
  lParam = args.KeyStatus().RepeatCount; // bits 0-15
@@ -823,16 +824,21 @@ bool WindowsTextInputComponentView::ShouldSubmit(
823
824
  // If 'submitKeyEvents' are supplied, use them to determine whether to emit onSubmitEditing' for either
824
825
  // single-line or multi-line TextInput
825
826
  if (args.KeyCode() == '\r') {
826
- bool shiftDown = source.GetKeyState(winrt::Windows::System::VirtualKey::Shift) ==
827
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down;
828
- bool ctrlDown = source.GetKeyState(winrt::Windows::System::VirtualKey::Control) ==
829
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down;
830
- bool altDown = source.GetKeyState(winrt::Windows::System::VirtualKey::Control) ==
831
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down;
832
- bool metaDown = source.GetKeyState(winrt::Windows::System::VirtualKey::LeftWindows) ==
833
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down ||
834
- source.GetKeyState(winrt::Windows::System::VirtualKey::RightWindows) ==
835
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down;
827
+ bool shiftDown = (source.GetKeyState(winrt::Windows::System::VirtualKey::Shift) &
828
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
829
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
830
+ bool ctrlDown = (source.GetKeyState(winrt::Windows::System::VirtualKey::Control) &
831
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
832
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
833
+ bool altDown = (source.GetKeyState(winrt::Windows::System::VirtualKey::Control) &
834
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
835
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
836
+ bool metaDown = (source.GetKeyState(winrt::Windows::System::VirtualKey::LeftWindows) &
837
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
838
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down ||
839
+ (source.GetKeyState(winrt::Windows::System::VirtualKey::RightWindows) &
840
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
841
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
836
842
  return (submitKeyEvent.shiftKey && shiftDown) || (submitKeyEvent.ctrlKey && ctrlDown) ||
837
843
  (submitKeyEvent.altKey && altDown) || (submitKeyEvent.metaKey && metaDown) ||
838
844
  (!submitKeyEvent.shiftKey && !submitKeyEvent.altKey && !submitKeyEvent.metaKey && !submitKeyEvent.altKey &&
@@ -853,8 +859,8 @@ void WindowsTextInputComponentView::OnCharacterReceived(
853
859
  // Do not forward tab keys into the TextInput, since we want that to do the tab loop instead. This aligns with WinUI
854
860
  // behavior We do forward Ctrl+Tab to the textinput.
855
861
  if ((args.KeyCode() == '\t') &&
856
- (source.GetKeyState(winrt::Windows::System::VirtualKey::Control) !=
857
- winrt::Windows::UI::Core::CoreVirtualKeyStates::Down)) {
862
+ ((source.GetKeyState(winrt::Windows::System::VirtualKey::Control) &
863
+ winrt::Microsoft::UI::Input::VirtualKeyStates::Down) != winrt::Microsoft::UI::Input::VirtualKeyStates::Down)) {
858
864
  return;
859
865
  }
860
866
 
@@ -194,7 +194,17 @@ void FabricUIManager::constraintSurfaceLayout(
194
194
  m_surfaceManager->constraintSurfaceLayout(surfaceId, layoutConstraints, layoutContext);
195
195
  }
196
196
 
197
- void FabricUIManager::didMountComponentsWithRootTag(facebook::react::SurfaceId surfaceId) noexcept {}
197
+ winrt::Microsoft::ReactNative::ReactNotificationId<facebook::react::SurfaceId>
198
+ FabricUIManager::NotifyMountedId() noexcept {
199
+ return {L"ReactNative.Fabric", L"Mounted"};
200
+ }
201
+
202
+ void FabricUIManager::didMountComponentsWithRootTag(facebook::react::SurfaceId surfaceId) noexcept {
203
+ m_context.UIDispatcher().Post([context = m_context, self = shared_from_this(), surfaceId]() {
204
+ self->m_scheduler->reportMount(surfaceId);
205
+ context.Notifications().SendNotification(NotifyMountedId(), surfaceId);
206
+ });
207
+ }
198
208
 
199
209
  void FabricUIManager::RCTPerformMountInstructions(
200
210
  facebook::react::ShadowViewMutationList const &mutations,
@@ -212,11 +222,25 @@ void FabricUIManager::RCTPerformMountInstructions(
212
222
  }
213
223
 
214
224
  case facebook::react::ShadowViewMutation::Delete: {
215
- auto &oldChildShadowView = mutation.oldChildShadowView;
216
- auto &oldChildViewDescriptor = m_registry.componentViewDescriptorWithTag(oldChildShadowView.tag);
217
- // observerCoordinator.unregisterViewComponentDescriptor(oldChildViewDescriptor, surfaceId);
218
- m_registry.enqueueComponentViewWithComponentHandle(
219
- oldChildShadowView.componentHandle, oldChildShadowView.tag, oldChildViewDescriptor);
225
+ // #define DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
226
+ #ifdef DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
227
+ winrt::weak_ref<winrt::Microsoft::ReactNative::ComponentView> wkView;
228
+ #endif
229
+ {
230
+ auto &oldChildShadowView = mutation.oldChildShadowView;
231
+ auto &oldChildViewDescriptor = m_registry.componentViewDescriptorWithTag(oldChildShadowView.tag);
232
+ // observerCoordinator.unregisterViewComponentDescriptor(oldChildViewDescriptor, surfaceId);
233
+ #ifdef DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
234
+ wkView = winrt::make_weak(oldChildViewDescriptor.view);
235
+ #endif
236
+ m_registry.enqueueComponentViewWithComponentHandle(
237
+ oldChildShadowView.componentHandle, oldChildShadowView.tag, oldChildViewDescriptor);
238
+ }
239
+ #ifdef DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
240
+ // After handling a delete mutation, nothing should be holding on to the view. If there is thats an indication
241
+ // of a leak, or at least something holding on to a view longer than it should
242
+ assert(!wkView.get());
243
+ #endif
220
244
  break;
221
245
  }
222
246
 
@@ -52,6 +52,8 @@ struct FabricUIManager final : public std::enable_shared_from_this<FabricUIManag
52
52
  winrt::Microsoft::ReactNative::ReactNativeIsland GetReactNativeIsland(
53
53
  facebook::react::SurfaceId surfaceId) const noexcept;
54
54
 
55
+ static winrt::Microsoft::ReactNative::ReactNotificationId<facebook::react::SurfaceId> NotifyMountedId() noexcept;
56
+
55
57
  private:
56
58
  void installFabricUIManager() noexcept;
57
59
  void initiateTransaction(facebook::react::MountingCoordinator::Shared mountingCoordinator);
@@ -87,6 +87,11 @@ WindowsImageManager::GetImageRandomAccessStreamAsync(ReactImageSource source) co
87
87
  }
88
88
 
89
89
  winrt::Windows::Storage::StorageFile file(co_await getFileSync);
90
+
91
+ if (!file) {
92
+ co_return winrt::Microsoft::ReactNative::Composition::ImageFailedResponse(L"Failed to get file.");
93
+ }
94
+
90
95
  co_return winrt::Microsoft::ReactNative::Composition::StreamImageResponse(co_await file.OpenReadAsync());
91
96
  }
92
97
 
@@ -337,7 +337,7 @@ void ReactInstanceWin::LoadModules(
337
337
  };
338
338
 
339
339
  #ifdef USE_FABRIC
340
- if (!m_options.UseWebDebugger()) {
340
+ if (Microsoft::ReactNative::IsFabricEnabled(m_reactContext->Properties())) {
341
341
  registerTurboModule(
342
342
  L"FabricUIManagerBinding",
343
343
  winrt::Microsoft::ReactNative::MakeModuleProvider<::Microsoft::ReactNative::FabricUIManager>());
@@ -602,7 +602,8 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
602
602
 
603
603
  m_jsMessageThread.Load()->runOnQueueSync([&]() {
604
604
  ::SetThreadDescription(GetCurrentThread(), L"React-Native JavaScript Thread");
605
- auto timerRegistry = ::Microsoft::ReactNative::TimerRegistry::CreateTimerRegistry(m_options.Properties);
605
+ auto timerRegistry =
606
+ ::Microsoft::ReactNative::TimerRegistry::CreateTimerRegistry(m_reactContext->Properties());
606
607
  auto timerRegistryRaw = timerRegistry.get();
607
608
 
608
609
  auto timerManager = std::make_shared<facebook::react::TimerManager>(std::move(timerRegistry));
@@ -24,6 +24,16 @@
24
24
  "Microsoft.SourceLink.Common": "1.1.1"
25
25
  }
26
26
  },
27
+ "Microsoft.SourceLink.GitHub": {
28
+ "type": "Direct",
29
+ "requested": "[1.1.1, )",
30
+ "resolved": "1.1.1",
31
+ "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==",
32
+ "dependencies": {
33
+ "Microsoft.Build.Tasks.Git": "1.1.1",
34
+ "Microsoft.SourceLink.Common": "1.1.1"
35
+ }
36
+ },
27
37
  "Microsoft.Windows.CppWinRT": {
28
38
  "type": "Direct",
29
39
  "requested": "[2.0.230706.1, )",
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+
4
+ <PropertyGroup Label="Globals">
5
+ </PropertyGroup>
6
+
7
+ <PropertyGroup Label="Configuration">
8
+ </PropertyGroup>
9
+
10
+ <ItemDefinitionGroup>
11
+ </ItemDefinitionGroup>
12
+
13
+ </Project>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+
4
+ <PropertyGroup Label="Globals">
5
+ </PropertyGroup>
6
+
7
+ <PropertyGroup Label="Configuration">
8
+ </PropertyGroup>
9
+
10
+ <ItemDefinitionGroup>
11
+ </ItemDefinitionGroup>
12
+
13
+ </Project>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+
4
+ <PropertyGroup Label="Globals">
5
+ </PropertyGroup>
6
+
7
+ <PropertyGroup Label="Configuration">
8
+ </PropertyGroup>
9
+
10
+ <ItemDefinitionGroup>
11
+ </ItemDefinitionGroup>
12
+
13
+ </Project>
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.74.10</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.74.12</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>10</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>12</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>189a294fa10f14c96bc992d492145026eed77c32</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>696f0bbbb4ba8dde034eb8d55d5c9ae57325ae2f</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -14,12 +14,14 @@
14
14
  <HermesNoLink Condition="'$(HermesNoLink)' == '' and '$(Configuration)' == 'Release' and '$(EnableHermesInspectorInReleaseFlavor)' != 'true'">true</HermesNoLink>
15
15
  <!-- Use Hermes bytecode bundles provided by metro hermes compiler when available -->
16
16
  <EnableDevServerHBCBundles Condition="'$(EnableDevServerHBCBundles)' == ''">false</EnableDevServerHBCBundles>
17
+ <HermesPlatform Condition="'$(Platform)' == 'ARM64EC'">x64</HermesPlatform>
17
18
 
18
19
  <UseV8 Condition="'$(UseV8)' == ''">false</UseV8>
19
20
  <V8Version Condition="'$(V8Version)' == ''">0.71.8</V8Version>
20
21
  <V8PackageName>ReactNative.V8Jsi.Windows</V8PackageName>
21
22
  <V8PackageName Condition="'$(V8AppPlatform)' != 'win32'">$(V8PackageName).UWP</V8PackageName>
22
23
  <V8Package>$(NuGetPackageRoot)\$(V8PackageName).$(V8Version)</V8Package>
24
+ <V8Platform Condition="'$(Platform)' == 'ARM64EC'">x64</V8Platform>
23
25
  </PropertyGroup>
24
26
 
25
27
  </Project>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+
4
+ <PropertyGroup Label="Globals">
5
+ </PropertyGroup>
6
+
7
+ <PropertyGroup Label="Configuration">
8
+ </PropertyGroup>
9
+
10
+ <ItemDefinitionGroup>
11
+ </ItemDefinitionGroup>
12
+
13
+ </Project>
@@ -16,6 +16,10 @@
16
16
  <Configuration>Debug</Configuration>
17
17
  <Platform>ARM64</Platform>
18
18
  </ProjectConfiguration>
19
+ <ProjectConfiguration Include="Debug|ARM64EC">
20
+ <Configuration>Debug</Configuration>
21
+ <Platform>ARM64EC</Platform>
22
+ </ProjectConfiguration>
19
23
  <ProjectConfiguration Include="Release|ARM64">
20
24
  <Configuration>Release</Configuration>
21
25
  <Platform>ARM64</Platform>
@@ -24,6 +28,10 @@
24
28
  <Configuration>Debug</Configuration>
25
29
  <Platform>x64</Platform>
26
30
  </ProjectConfiguration>
31
+ <ProjectConfiguration Include="Release|ARM64EC">
32
+ <Configuration>Release</Configuration>
33
+ <Platform>ARM64EC</Platform>
34
+ </ProjectConfiguration>
27
35
  <ProjectConfiguration Include="Release|x64">
28
36
  <Configuration>Release</Configuration>
29
37
  <Platform>x64</Platform>
@@ -251,4 +259,4 @@
251
259
  <Copy DestinationFiles="@(NodeApiJsiFiles->'$(ReactNativeDir)\ReactCommon\jsi\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(NodeApiJsiFiles)" />
252
260
  <Copy DestinationFiles="@(TemporaryReactCommonPatchFiles->'$(ReactNativeDir)\ReactCommon\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(TemporaryReactCommonPatchFiles)" />
253
261
  </Target>
254
- </Project>
262
+ </Project>