react-native-windows 0.75.0-preview.4 → 0.75.0-preview.5
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.
- package/Common/Common.vcxproj +1 -1
- package/Common/packages.lock.json +3 -3
- package/Folly/Folly.vcxproj +1 -1
- package/Folly/packages.lock.json +3 -3
- package/Libraries/Text/Text.windows.js +1 -0
- package/Microsoft.ReactNative/Composition.Input.idl +3 -3
- package/Microsoft.ReactNative/CompositionSwitcher.idl +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +10 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +16 -27
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +85 -48
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +19 -15
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +4 -2
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +10 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +42 -17
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +3 -1
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +42 -5
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +22 -16
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +30 -6
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +5 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +3 -2
- package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.targets +1 -1
- package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.targets +2 -2
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/ReactCommon/ReactCommon.vcxproj +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +2396 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +136 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +92 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +48 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +122 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +388 -0
- package/ReactCommon/packages.lock.json +5 -5
- package/package.json +1 -1
|
@@ -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
|
|
|
@@ -480,10 +491,14 @@ void ReactNativeIsland::ShowInstanceLoaded() noexcept {
|
|
|
480
491
|
initProps = folly::dynamic::object();
|
|
481
492
|
}
|
|
482
493
|
initProps["concurrentRoot"] = true;
|
|
494
|
+
|
|
495
|
+
facebook::react::LayoutConstraints fbLayoutConstraints;
|
|
496
|
+
ApplyConstraints(m_layoutConstraints, fbLayoutConstraints);
|
|
497
|
+
|
|
483
498
|
uiManager->startSurface(
|
|
484
499
|
*this,
|
|
485
500
|
static_cast<facebook::react::SurfaceId>(m_rootTag),
|
|
486
|
-
|
|
501
|
+
fbLayoutConstraints,
|
|
487
502
|
to_string(m_reactViewOptions.ComponentName()),
|
|
488
503
|
initProps);
|
|
489
504
|
|
|
@@ -500,16 +515,21 @@ facebook::react::AttributedStringBox CreateLoadingAttributedString() noexcept {
|
|
|
500
515
|
return facebook::react::AttributedStringBox{attributedString};
|
|
501
516
|
}
|
|
502
517
|
|
|
503
|
-
facebook::react::Size MeasureLoading(
|
|
518
|
+
facebook::react::Size MeasureLoading(
|
|
519
|
+
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
520
|
+
float scaleFactor) {
|
|
521
|
+
facebook::react::LayoutConstraints fbLayoutConstraints;
|
|
522
|
+
ApplyConstraints(layoutConstraints, fbLayoutConstraints);
|
|
523
|
+
|
|
504
524
|
auto attributedStringBox = CreateLoadingAttributedString();
|
|
505
525
|
winrt::com_ptr<::IDWriteTextLayout> textLayout;
|
|
506
526
|
facebook::react::TextLayoutManager::GetTextLayout(
|
|
507
|
-
attributedStringBox, {} /*paragraphAttributes*/,
|
|
527
|
+
attributedStringBox, {} /*paragraphAttributes*/, fbLayoutConstraints, textLayout);
|
|
508
528
|
|
|
509
529
|
DWRITE_TEXT_METRICS tm;
|
|
510
530
|
winrt::check_hresult(textLayout->GetMetrics(&tm));
|
|
511
531
|
|
|
512
|
-
return
|
|
532
|
+
return fbLayoutConstraints.clamp(
|
|
513
533
|
{loadingActivityHorizontalOffset * scaleFactor + tm.width, loadingBarHeight * scaleFactor});
|
|
514
534
|
}
|
|
515
535
|
|
|
@@ -634,15 +654,6 @@ void ReactNativeIsland::ShowInstanceLoading() noexcept {
|
|
|
634
654
|
InternalRootVisual().InsertAt(m_loadingVisual, m_hasRenderedVisual ? 1 : 0);
|
|
635
655
|
}
|
|
636
656
|
|
|
637
|
-
void ApplyConstraints(
|
|
638
|
-
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraintsIn,
|
|
639
|
-
facebook::react::LayoutConstraints &layoutConstraintsOut) noexcept {
|
|
640
|
-
layoutConstraintsOut.minimumSize = {layoutConstraintsIn.MinimumSize.Width, layoutConstraintsIn.MinimumSize.Height};
|
|
641
|
-
layoutConstraintsOut.maximumSize = {layoutConstraintsIn.MaximumSize.Width, layoutConstraintsIn.MaximumSize.Height};
|
|
642
|
-
layoutConstraintsOut.layoutDirection =
|
|
643
|
-
static_cast<facebook::react::LayoutDirection>(layoutConstraintsIn.LayoutDirection);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
657
|
winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
|
|
647
658
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
648
659
|
const winrt::Windows::Foundation::Point &viewportOffset) const noexcept {
|
|
@@ -663,7 +674,7 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
|
|
|
663
674
|
size = fabricuiManager->measureSurface(static_cast<facebook::react::SurfaceId>(m_rootTag), constraints, context);
|
|
664
675
|
}
|
|
665
676
|
} else if (m_loadingVisual) {
|
|
666
|
-
size = MeasureLoading(
|
|
677
|
+
size = MeasureLoading(layoutConstraints, m_scaleFactor);
|
|
667
678
|
}
|
|
668
679
|
|
|
669
680
|
auto clampedSize = constraints.clamp(size);
|
|
@@ -673,7 +684,10 @@ winrt::Windows::Foundation::Size ReactNativeIsland::Measure(
|
|
|
673
684
|
void ReactNativeIsland::Arrange(
|
|
674
685
|
const winrt::Microsoft::ReactNative::LayoutConstraints &layoutConstraints,
|
|
675
686
|
const winrt::Windows::Foundation::Point &viewportOffset) noexcept {
|
|
676
|
-
|
|
687
|
+
m_layoutConstraints = layoutConstraints;
|
|
688
|
+
m_viewportOffset = viewportOffset;
|
|
689
|
+
facebook::react::LayoutConstraints fbLayoutConstraints;
|
|
690
|
+
ApplyConstraints(layoutConstraints, fbLayoutConstraints);
|
|
677
691
|
|
|
678
692
|
if (m_isInitialized && m_rootTag != -1) {
|
|
679
693
|
if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
|
|
@@ -684,11 +698,11 @@ void ReactNativeIsland::Arrange(
|
|
|
684
698
|
context.viewportOffset = {viewportOffset.X, viewportOffset.Y};
|
|
685
699
|
|
|
686
700
|
fabricuiManager->constraintSurfaceLayout(
|
|
687
|
-
static_cast<facebook::react::SurfaceId>(m_rootTag),
|
|
701
|
+
static_cast<facebook::react::SurfaceId>(m_rootTag), fbLayoutConstraints, context);
|
|
688
702
|
}
|
|
689
703
|
} else if (m_loadingVisual) {
|
|
690
704
|
// TODO: Resize to align loading
|
|
691
|
-
auto s =
|
|
705
|
+
auto s = fbLayoutConstraints.clamp(MeasureLoading(layoutConstraints, m_scaleFactor));
|
|
692
706
|
NotifySizeChanged();
|
|
693
707
|
}
|
|
694
708
|
}
|
|
@@ -738,6 +752,17 @@ winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
|
|
|
738
752
|
pThis->m_island = nullptr;
|
|
739
753
|
}
|
|
740
754
|
});
|
|
755
|
+
|
|
756
|
+
m_islandStateChangedToken =
|
|
757
|
+
m_island.StateChanged([weakThis = get_weak()](
|
|
758
|
+
winrt::Microsoft::UI::Content::ContentIsland const &island,
|
|
759
|
+
winrt::Microsoft::UI::Content::ContentIslandStateChangedEventArgs const &args) {
|
|
760
|
+
if (auto pThis = weakThis.get()) {
|
|
761
|
+
if (args.DidRasterizationScaleChange()) {
|
|
762
|
+
pThis->ScaleFactor(island.RasterizationScale());
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
});
|
|
741
766
|
}
|
|
742
767
|
return m_island;
|
|
743
768
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
68
|
+
UpdateColorForScrollBarRegions();
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
void
|
|
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->
|
|
829
|
-
m_horizontalScrollbarComponent->
|
|
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
|
}
|
package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
winrt::
|
|
832
|
-
bool
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -182,7 +182,17 @@ void FabricUIManager::constraintSurfaceLayout(
|
|
|
182
182
|
m_surfaceManager->constraintSurfaceLayout(surfaceId, layoutConstraints, layoutContext);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
winrt::Microsoft::ReactNative::ReactNotificationId<facebook::react::SurfaceId>
|
|
186
|
+
FabricUIManager::NotifyMountedId() noexcept {
|
|
187
|
+
return {L"ReactNative.Fabric", L"Mounted"};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
void FabricUIManager::didMountComponentsWithRootTag(facebook::react::SurfaceId surfaceId) noexcept {
|
|
191
|
+
m_context.UIDispatcher().Post([context = m_context, self = shared_from_this(), surfaceId]() {
|
|
192
|
+
self->m_scheduler->reportMount(surfaceId);
|
|
193
|
+
context.Notifications().SendNotification(NotifyMountedId(), surfaceId);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
186
196
|
|
|
187
197
|
void FabricUIManager::RCTPerformMountInstructions(
|
|
188
198
|
facebook::react::ShadowViewMutationList const &mutations,
|
|
@@ -200,11 +210,25 @@ void FabricUIManager::RCTPerformMountInstructions(
|
|
|
200
210
|
}
|
|
201
211
|
|
|
202
212
|
case facebook::react::ShadowViewMutation::Delete: {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
// #define DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
|
|
214
|
+
#ifdef DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
|
|
215
|
+
winrt::weak_ref<winrt::Microsoft::ReactNative::ComponentView> wkView;
|
|
216
|
+
#endif
|
|
217
|
+
{
|
|
218
|
+
auto &oldChildShadowView = mutation.oldChildShadowView;
|
|
219
|
+
auto &oldChildViewDescriptor = m_registry.componentViewDescriptorWithTag(oldChildShadowView.tag);
|
|
220
|
+
// observerCoordinator.unregisterViewComponentDescriptor(oldChildViewDescriptor, surfaceId);
|
|
221
|
+
#ifdef DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
|
|
222
|
+
wkView = winrt::make_weak(oldChildViewDescriptor.view);
|
|
223
|
+
#endif
|
|
224
|
+
m_registry.enqueueComponentViewWithComponentHandle(
|
|
225
|
+
oldChildShadowView.componentHandle, oldChildShadowView.tag, oldChildViewDescriptor);
|
|
226
|
+
}
|
|
227
|
+
#ifdef DETECT_COMPONENT_OUTLIVE_DELETE_MUTATION
|
|
228
|
+
// After handling a delete mutation, nothing should be holding on to the view. If there is thats an indication
|
|
229
|
+
// of a leak, or at least something holding on to a view longer than it should
|
|
230
|
+
assert(!wkView.get());
|
|
231
|
+
#endif
|
|
208
232
|
break;
|
|
209
233
|
}
|
|
210
234
|
|
|
@@ -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);
|
|
@@ -95,6 +95,11 @@ WindowsImageManager::GetImageRandomAccessStreamAsync(ReactImageSource source) co
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
winrt::Windows::Storage::StorageFile file(co_await getFileSync);
|
|
98
|
+
|
|
99
|
+
if (!file) {
|
|
100
|
+
co_return winrt::Microsoft::ReactNative::Composition::ImageFailedResponse(L"Failed to get file.");
|
|
101
|
+
}
|
|
102
|
+
|
|
98
103
|
co_return winrt::Microsoft::ReactNative::Composition::StreamImageResponse(co_await file.OpenReadAsync());
|
|
99
104
|
}
|
|
100
105
|
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
</Page>
|
|
625
625
|
</ItemGroup>
|
|
626
626
|
<ItemGroup>
|
|
627
|
-
<PackageReference Include="boost" Version="1.
|
|
627
|
+
<PackageReference Include="boost" Version="1.83.0.0" />
|
|
628
628
|
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
|
|
629
629
|
<PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" />
|
|
630
630
|
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(OverrideWinUIPackage)'!='true'" />
|
|
@@ -337,7 +337,7 @@ void ReactInstanceWin::LoadModules(
|
|
|
337
337
|
};
|
|
338
338
|
|
|
339
339
|
#ifdef USE_FABRIC
|
|
340
|
-
if (
|
|
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 =
|
|
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));
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets" />
|
|
13
13
|
|
|
14
14
|
<ItemGroup>
|
|
15
|
-
<PackageReference Include="boost" Version="1.
|
|
15
|
+
<PackageReference Include="boost" Version="1.83.0.0" />
|
|
16
16
|
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.2-rc" />
|
|
17
17
|
</ItemGroup>
|
|
18
18
|
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.targets" />
|
|
14
14
|
|
|
15
15
|
<ItemGroup>
|
|
16
|
-
<PackageReference Include="boost" Version="1.
|
|
16
|
+
<PackageReference Include="boost" Version="1.83.0.0" />
|
|
17
17
|
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.2-rc" />
|
|
18
18
|
</ItemGroup>
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
</Project>
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.75.0-preview.
|
|
13
|
+
<ReactNativeWindowsVersion>0.75.0-preview.5</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>75</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>2a861513f5dd870ebec5c0aebd152740d7076ffb</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
</ProjectReference>
|
|
198
198
|
</ItemGroup>
|
|
199
199
|
<ItemGroup>
|
|
200
|
-
<PackageReference Include="boost" Version="1.
|
|
200
|
+
<PackageReference Include="boost" Version="1.83.0.0" />
|
|
201
201
|
</ItemGroup>
|
|
202
202
|
<PropertyGroup>
|
|
203
203
|
<NodeApiJsiZipDir>$(NodeApiJsiDir)..\.node-api-jsi-zip</NodeApiJsiZipDir>
|