react-native-windows 0.74.5 → 0.74.7

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 (26) hide show
  1. package/Microsoft.ReactNative/ComponentView.idl +26 -0
  2. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
  3. package/Microsoft.ReactNative/CompositionRootView.idl +13 -3
  4. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +83 -12
  5. package/Microsoft.ReactNative/Fabric/ComponentView.h +33 -2
  6. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +6 -6
  7. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +3 -2
  8. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.cpp +131 -79
  9. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.h +20 -13
  10. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +37 -23
  11. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +8 -2
  12. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +152 -0
  13. package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +85 -0
  14. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +54 -40
  15. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +9 -1
  16. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +7 -5
  17. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +2 -2
  18. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +6 -12
  19. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +1 -0
  20. package/Microsoft.ReactNative/FocusManager.idl +22 -0
  21. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  22. package/Shared/Shared.vcxitems +6 -5
  23. package/package.json +1 -1
  24. package/templates/cpp-app/windows/MyApp/MyApp.cpp +3 -2
  25. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView_emptyimpl.cpp +0 -149
  26. package/Microsoft.ReactNative/Views/ICompositionRootView.h +0 -18
@@ -49,8 +49,8 @@ struct WindowsTextInputComponentView
49
49
  void HandleCommand(winrt::hstring commandName, const winrt::Microsoft::ReactNative::IJSValueReader &args) noexcept
50
50
  override;
51
51
  void OnRenderingDeviceLost() noexcept override;
52
- void onFocusLost() noexcept override;
53
- void onFocusGained() noexcept override;
52
+ void onLostFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override;
53
+ void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override;
54
54
  std::string DefaultControlType() const noexcept override;
55
55
  std::string DefaultAccessibleName() const noexcept override;
56
56
  std::string DefaultHelpText() const noexcept override;
@@ -12,7 +12,6 @@
12
12
  #include <Fabric/FabricUIManagerModule.h>
13
13
  #include <Fabric/ReactNativeConfigProperties.h>
14
14
  #include <Fabric/WindowsComponentDescriptorRegistry.h>
15
- #include <ICompositionRootView.h>
16
15
  #include <IReactContext.h>
17
16
  #include <IReactRootView.h>
18
17
  #include <JSI/jsi.h>
@@ -144,6 +143,7 @@ const IComponentViewRegistry &FabricUIManager::GetViewRegistry() const noexcept
144
143
  void FabricUIManager::startSurface(
145
144
  const winrt::Microsoft::ReactNative::CompositionRootView &rootView,
146
145
  facebook::react::SurfaceId surfaceId,
146
+ const facebook::react::LayoutConstraints &layoutConstraints,
147
147
  const std::string &moduleName,
148
148
  const folly::dynamic &initialProps) noexcept {
149
149
  m_surfaceRegistry.insert({surfaceId, {rootView}});
@@ -158,22 +158,16 @@ void FabricUIManager::startSurface(
158
158
  root->start(rootView);
159
159
  });
160
160
 
161
- facebook::react::LayoutContext context;
162
- facebook::react::LayoutConstraints constraints;
163
- context.pointScaleFactor = rootView.ScaleFactor();
164
- context.fontSizeMultiplier = rootView.ScaleFactor();
165
- constraints.minimumSize.height = rootView.Size().Height;
166
- constraints.minimumSize.width = rootView.Size().Width;
167
- constraints.maximumSize.height = rootView.Size().Height;
168
- constraints.maximumSize.width = rootView.Size().Width;
169
- constraints.layoutDirection = facebook::react::LayoutDirection::LeftToRight;
161
+ facebook::react::LayoutContext layoutContext;
162
+ layoutContext.pointScaleFactor = rootView.ScaleFactor();
163
+ layoutContext.fontSizeMultiplier = rootView.ScaleFactor();
170
164
 
171
165
  m_surfaceManager->startSurface(
172
166
  surfaceId,
173
167
  moduleName,
174
168
  initialProps,
175
- constraints, // layout constraints
176
- context // layout context
169
+ layoutConstraints,
170
+ layoutContext // layout context
177
171
  );
178
172
  }
179
173
 
@@ -31,6 +31,7 @@ struct FabricUIManager final : public std::enable_shared_from_this<FabricUIManag
31
31
  void startSurface(
32
32
  const winrt::Microsoft::ReactNative::CompositionRootView &rootView,
33
33
  facebook::react::SurfaceId surfaceId,
34
+ const facebook::react::LayoutConstraints &layoutConstraints,
34
35
  const std::string &moduleName,
35
36
  const folly::dynamic &initialProps) noexcept;
36
37
 
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+
4
+ import "ComponentView.idl";
5
+ #include "DocString.h"
6
+
7
+ namespace Microsoft.ReactNative.Composition
8
+ {
9
+
10
+ [default_interface]
11
+ [webhosthidden]
12
+ [experimental]
13
+ runtimeclass FocusManager
14
+ {
15
+ DOC_STRING("Retrieves the first component that can receive focus based on the specified scope.")
16
+ static Microsoft.ReactNative.ComponentView FindFirstFocusableElement(Microsoft.ReactNative.ComponentView searchScope);
17
+
18
+ DOC_STRING("Retrieves the last component that can receive focus based on the specified scope.")
19
+ static Microsoft.ReactNative.ComponentView FindLastFocusableElement(Microsoft.ReactNative.ComponentView searchScope);
20
+ }
21
+
22
+ } // namespace Microsoft.ReactNative.Composition
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.74.5</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.74.7</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>5</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>7</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>481f89da064d5a33f4b5b79088dc760bd49f6dd2</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>92b63ecf09a8f2c61a3c972e76bfdb535707d87b</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -69,11 +69,6 @@
69
69
  <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionRootView.idl</DependentUpon>
70
70
  <SubType>Code</SubType>
71
71
  </ClCompile>
72
- <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionRootView_emptyimpl.cpp">
73
- <ExcludedFromBuild Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' != 'true'">true</ExcludedFromBuild>
74
- <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionRootView.idl</DependentUpon>
75
- <SubType>Code</SubType>
76
- </ClCompile>
77
72
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionUIService.cpp">
78
73
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
79
74
  <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionUIService.idl</DependentUpon>
@@ -84,6 +79,11 @@
84
79
  <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionUIService.idl</DependentUpon>
85
80
  <SubType>Code</SubType>
86
81
  </ClCompile>
82
+ <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\FocusManager.cpp">
83
+ <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
84
+ <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\FocusManager.idl</DependentUpon>
85
+ <SubType>Code</SubType>
86
+ </ClCompile>
87
87
  <ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\UriImageManager.cpp">
88
88
  <ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
89
89
  <DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\UriImageManager.idl</DependentUpon>
@@ -635,6 +635,7 @@
635
635
  <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\ComponentView.idl" />
636
636
  <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\Composition.Input.idl" />
637
637
  <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionComponentView.idl" />
638
+ <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\FocusManager.idl" />
638
639
  <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionContext.idl" />
639
640
  <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionHwndHost.idl" />
640
641
  <Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionRootView.idl" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.74.5",
3
+ "version": "0.74.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,8 +34,9 @@ void UpdateRootViewSizeToAppWindow(
34
34
  // Do not relayout when minimized
35
35
  if (window.Presenter().as<winrt::Microsoft::UI::Windowing::OverlappedPresenter>().State() !=
36
36
  winrt::Microsoft::UI::Windowing::OverlappedPresenterState::Minimized) {
37
- rootView.Arrange(size);
38
- rootView.Size(size);
37
+ winrt::Microsoft::ReactNative::LayoutConstraints constraints;
38
+ constraints.MaximumSize = constraints.MinimumSize = size;
39
+ rootView.Arrange(constraints, {0,0});
39
40
  }
40
41
  }
41
42
 
@@ -1,149 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- #include "pch.h"
4
-
5
- #include "CompositionRootView.h"
6
-
7
- #include "CompositionRootView.g.cpp"
8
- #include "FocusNavigationRequest.g.cpp"
9
-
10
- namespace winrt::Microsoft::ReactNative::implementation {
11
-
12
- //! This class ensures that we access ReactRootView from UI thread.
13
- struct CompositionReactViewInstance
14
- : public winrt::implements<CompositionReactViewInstance, winrt::Microsoft::ReactNative::IReactViewInstance> {
15
- CompositionReactViewInstance(
16
- winrt::weak_ref<winrt::Microsoft::ReactNative::implementation::CompositionRootView> &&) noexcept {}
17
-
18
- void InitRootView(
19
- winrt::Microsoft::ReactNative::IReactContext,
20
- winrt::Microsoft::ReactNative::ReactViewOptions) noexcept {}
21
-
22
- void UpdateRootView() noexcept {}
23
- void UninitRootView() noexcept {}
24
- };
25
-
26
- //===========================================================================
27
- // ReactViewInstance inline implementation
28
- //===========================================================================
29
-
30
- CompositionRootView::CompositionRootView() noexcept {}
31
- CompositionRootView::~CompositionRootView() noexcept {}
32
-
33
- CompositionRootView::CompositionRootView(const winrt::Microsoft::UI::Composition::Compositor &compositor) noexcept {}
34
-
35
- ReactNative::IReactViewHost CompositionRootView::ReactViewHost() noexcept {
36
- return nullptr;
37
- }
38
-
39
- void CompositionRootView::ReactViewHost(winrt::Microsoft::ReactNative::IReactViewHost const &) noexcept {}
40
-
41
- winrt::Microsoft::UI::Composition::Visual CompositionRootView::RootVisual() noexcept {
42
- return nullptr;
43
- }
44
-
45
- winrt::Microsoft::ReactNative::Composition::Experimental::IVisual CompositionRootView::InternalRootVisual() noexcept {
46
- return nullptr;
47
- }
48
-
49
- void CompositionRootView::InternalRootVisual(
50
- const winrt::Microsoft::ReactNative::Composition::Experimental::IVisual &) noexcept {}
51
-
52
- winrt::Microsoft::UI::Content::ContentIsland CompositionRootView::Island() noexcept {
53
- return nullptr;
54
- }
55
-
56
- winrt::Windows::Foundation::Size CompositionRootView::Size() noexcept {
57
- return {};
58
- }
59
-
60
- void CompositionRootView::Size(winrt::Windows::Foundation::Size) noexcept {}
61
-
62
- float CompositionRootView::ScaleFactor() noexcept {
63
- return 0;
64
- }
65
-
66
- void CompositionRootView::ScaleFactor(float) noexcept {}
67
-
68
- winrt::Microsoft::ReactNative::Composition::Theme CompositionRootView::Theme() noexcept {
69
- return nullptr;
70
- }
71
- void CompositionRootView::Theme(const winrt::Microsoft::ReactNative::Composition::Theme &) noexcept {}
72
-
73
- winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader CompositionRootView::Resources() noexcept {
74
- return nullptr;
75
- }
76
- void CompositionRootView::Resources(
77
- const winrt::Microsoft::ReactNative::Composition::ICustomResourceLoader &) noexcept {}
78
-
79
- winrt::IInspectable CompositionRootView::GetUiaProvider() noexcept {
80
- return nullptr;
81
- }
82
-
83
- std::string CompositionRootView::JSComponentName() const noexcept {
84
- return {};
85
- }
86
-
87
- int64_t CompositionRootView::GetActualHeight() const noexcept {
88
- return 0;
89
- }
90
-
91
- int64_t CompositionRootView::GetActualWidth() const noexcept {
92
- return 0;
93
- }
94
-
95
- int64_t CompositionRootView::GetTag() const noexcept {
96
- return 0;
97
- }
98
-
99
- int64_t CompositionRootView::RootTag() const noexcept {
100
- return 0;
101
- }
102
-
103
- void CompositionRootView::SetTag(int64_t) noexcept {}
104
-
105
- void CompositionRootView::SetWindow(uint64_t) noexcept {}
106
-
107
- int64_t CompositionRootView::SendMessage(uint32_t, uint64_t, int64_t) noexcept {
108
- return 0;
109
- }
110
-
111
- void CompositionRootView::InitRootView(
112
- winrt::Microsoft::ReactNative::IReactContext &&,
113
- winrt::Microsoft::ReactNative::ReactViewOptions &&) noexcept {}
114
-
115
- void CompositionRootView::UpdateRootView() noexcept {}
116
-
117
- void CompositionRootView::UpdateRootViewInternal() noexcept {}
118
-
119
- void CompositionRootView::UninitRootView() noexcept {}
120
-
121
- void CompositionRootView::ClearLoadingUI() noexcept {}
122
-
123
- void CompositionRootView::EnsureLoadingUI() noexcept {}
124
-
125
- void CompositionRootView::ShowInstanceLoaded() noexcept {}
126
-
127
- void CompositionRootView::ShowInstanceError() noexcept {}
128
-
129
- void CompositionRootView::ShowInstanceLoading() noexcept {}
130
-
131
- winrt::Windows::Foundation::Size CompositionRootView::Measure(winrt::Windows::Foundation::Size const &) const {
132
- return {};
133
- }
134
-
135
- winrt::Windows::Foundation::Size CompositionRootView::Arrange(winrt::Windows::Foundation::Size) const {
136
- return {};
137
- }
138
-
139
- winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView *
140
- CompositionRootView::GetComponentView() noexcept {
141
- return nullptr;
142
- }
143
-
144
- winrt::Microsoft::ReactNative::FocusNavigationResult CompositionRootView::NavigateFocus(
145
- const winrt::Microsoft::ReactNative::FocusNavigationRequest &) noexcept {
146
- return nullptr;
147
- }
148
-
149
- } // namespace winrt::Microsoft::ReactNative::implementation
@@ -1,18 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- #pragma once
5
-
6
- #include <Fabric/Composition/CompositionHelpers.h>
7
- #include <IReactRootView.h>
8
- #include <React.h>
9
- #include <folly/dynamic.h>
10
- #include <winrt/Windows.UI.Composition.h>
11
-
12
- namespace Microsoft::ReactNative {
13
-
14
- struct ICompositionRootView : public facebook::react::IReactRootView {
15
- virtual float ScaleFactor() noexcept = 0;
16
- };
17
-
18
- } // namespace Microsoft::ReactNative