react-native-windows 0.74.6 → 0.74.8
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/Libraries/ReactNative/AppContainer-dev.js +3 -2
- package/Libraries/ReactNative/AppContainer-prod.js +2 -1
- package/Libraries/ReactNative/AppContainer.js +2 -0
- package/Libraries/ReactNative/AppRegistry.d.ts +7 -0
- package/Libraries/ReactNative/AppRegistry.js +8 -0
- package/Libraries/ReactNative/renderApplication.js +3 -0
- package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +1 -2
- package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +21 -21
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +7 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +3 -3
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +3 -3
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +9 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/{CompositionRootView.cpp → ReactNativeIsland.cpp} +160 -115
- package/Microsoft.ReactNative/Fabric/Composition/{CompositionRootView.h → ReactNativeIsland.h} +25 -20
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +19 -6
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +6 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +82 -17
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.h +79 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +8 -14
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +4 -3
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +191 -119
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +11 -0
- package/Microsoft.ReactNative/HttpSettings.idl +19 -0
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +15 -11
- package/Microsoft.ReactNative/{CompositionRootView.idl → ReactNativeIsland.idl} +23 -13
- package/Microsoft.ReactNative/UriImageManager.idl +35 -17
- package/Microsoft.ReactNative/Utils/ImageUtils.cpp +22 -3
- package/Microsoft.ReactNative/Utils/ImageUtils.h +3 -1
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +13 -4
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -2
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Shared/Modules/FileReaderModule.cpp +3 -4
- package/Shared/Modules/WebSocketModule.cpp +14 -16
- package/Shared/Networking/DefaultBlobResource.cpp +6 -14
- package/Shared/Networking/NetworkPropertyIds.cpp +60 -0
- package/Shared/Networking/NetworkPropertyIds.h +41 -0
- package/Shared/Networking/RedirectHttpFilter.cpp +18 -9
- package/Shared/Networking/RedirectHttpFilter.h +6 -3
- package/Shared/Networking/WinRTHttpResource.cpp +36 -8
- package/Shared/Networking/WinRTHttpResource.h +17 -0
- package/Shared/Shared.vcxitems +6 -9
- package/Shared/Shared.vcxitems.filters +5 -3
- package/package.json +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +5 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView_emptyimpl.cpp +0 -149
- package/Microsoft.ReactNative/Views/ICompositionRootView.h +0 -18
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#include "WinRTHttpResource.h"
|
|
7
7
|
|
|
8
|
+
#include "HttpSettings.g.cpp"
|
|
8
9
|
#include <CppRuntimeOptions.h>
|
|
9
10
|
#include <Networking/IBlobResource.h>
|
|
10
11
|
#include <ReactPropertyBag.h>
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
#include <Utils/WinRTConversions.h>
|
|
13
14
|
#include <utilities.h>
|
|
14
15
|
#include "IRedirectEventSource.h"
|
|
16
|
+
#include "Networking/NetworkPropertyIds.h"
|
|
15
17
|
#include "OriginPolicyHttpFilter.h"
|
|
16
18
|
#include "RedirectHttpFilter.h"
|
|
17
19
|
|
|
@@ -310,7 +312,9 @@ void WinRTHttpResource::SendRequest(
|
|
|
310
312
|
m_onError(requestId, Utilities::HResultToString(e), false);
|
|
311
313
|
}
|
|
312
314
|
} catch (...) {
|
|
313
|
-
m_onError
|
|
315
|
+
if (m_onError) {
|
|
316
|
+
m_onError(requestId, "Unidentified error sending HTTP request", false);
|
|
317
|
+
}
|
|
314
318
|
}
|
|
315
319
|
}
|
|
316
320
|
|
|
@@ -329,7 +333,9 @@ void WinRTHttpResource::AbortRequest(int64_t requestId) noexcept /*override*/ {
|
|
|
329
333
|
try {
|
|
330
334
|
request.Cancel();
|
|
331
335
|
} catch (hresult_error const &e) {
|
|
332
|
-
|
|
336
|
+
if (m_onError) {
|
|
337
|
+
m_onError(requestId, Utilities::HResultToString(e), false);
|
|
338
|
+
}
|
|
333
339
|
}
|
|
334
340
|
}
|
|
335
341
|
|
|
@@ -645,7 +651,20 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
|
|
|
645
651
|
using namespace winrt::Microsoft::ReactNative;
|
|
646
652
|
using winrt::Windows::Web::Http::HttpClient;
|
|
647
653
|
|
|
648
|
-
|
|
654
|
+
winrt::hstring defaultUserAgent;
|
|
655
|
+
if (inspectableProperties) {
|
|
656
|
+
auto propBag = ReactPropertyBag{inspectableProperties.as<IReactPropertyBag>()};
|
|
657
|
+
if (auto userAgentProp = propBag.Get(DefaultUserAgentPropertyId())) {
|
|
658
|
+
defaultUserAgent = *userAgentProp;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
auto userAgent = GetRuntimeOptionString("Http.UserAgent");
|
|
663
|
+
if (userAgent.size() > 0) {
|
|
664
|
+
defaultUserAgent = winrt::to_hstring(userAgent);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
auto redirFilter = winrt::make<RedirectHttpFilter>(defaultUserAgent);
|
|
649
668
|
HttpClient client;
|
|
650
669
|
|
|
651
670
|
if (static_cast<OriginPolicy>(GetRuntimeOptionInt("Http.OriginPolicy")) == OriginPolicy::None) {
|
|
@@ -665,14 +684,12 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
|
|
|
665
684
|
|
|
666
685
|
// Register resource as HTTP module proxy.
|
|
667
686
|
if (inspectableProperties) {
|
|
668
|
-
auto
|
|
669
|
-
auto propBag = ReactPropertyBag{inspectableProperties.try_as<IReactPropertyBag>()};
|
|
687
|
+
auto propBag = ReactPropertyBag{inspectableProperties.as<IReactPropertyBag>()};
|
|
670
688
|
auto moduleProxy = weak_ptr<IHttpModuleProxy>{result};
|
|
671
|
-
propBag.Set(
|
|
689
|
+
propBag.Set(HttpModuleProxyPropertyId(), std::move(moduleProxy));
|
|
672
690
|
|
|
673
691
|
// #11439 - Best-effort attempt to set up the HTTP handler after an initial call to addNetworkingHandler failed.
|
|
674
|
-
auto
|
|
675
|
-
if (auto prop = propBag.Get(blobRcPropId)) {
|
|
692
|
+
if (auto prop = propBag.Get(BlobResourcePropertyId())) {
|
|
676
693
|
if (auto blobRc = prop.Value().lock()) {
|
|
677
694
|
blobRc->AddNetworkingHandler();
|
|
678
695
|
}
|
|
@@ -690,3 +707,14 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
|
|
|
690
707
|
#pragma endregion IHttpResource
|
|
691
708
|
|
|
692
709
|
} // namespace Microsoft::React::Networking
|
|
710
|
+
|
|
711
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
712
|
+
|
|
713
|
+
void HttpSettings::SetDefaultUserAgent(
|
|
714
|
+
const winrt::Microsoft::ReactNative::ReactInstanceSettings &settings,
|
|
715
|
+
const winrt::hstring &userAgent) noexcept {
|
|
716
|
+
winrt::Microsoft::ReactNative::ReactPropertyBag(settings.Properties())
|
|
717
|
+
.Set(::Microsoft::React::DefaultUserAgentPropertyId(), userAgent);
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
#include "IHttpResource.h"
|
|
7
7
|
|
|
8
|
+
#include "HttpSettings.g.h"
|
|
8
9
|
#include <Modules/IHttpModuleProxy.h>
|
|
9
10
|
#include "IWinRTHttpRequestFactory.h"
|
|
10
11
|
#include "WinRTTypes.h"
|
|
@@ -108,3 +109,19 @@ class WinRTHttpResource : public IHttpResource,
|
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
} // namespace Microsoft::React::Networking
|
|
112
|
+
|
|
113
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
114
|
+
|
|
115
|
+
struct HttpSettings {
|
|
116
|
+
HttpSettings() = default;
|
|
117
|
+
|
|
118
|
+
static void SetDefaultUserAgent(
|
|
119
|
+
const winrt::Microsoft::ReactNative::ReactInstanceSettings &settings,
|
|
120
|
+
const winrt::hstring &userAgent) noexcept;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
124
|
+
|
|
125
|
+
namespace winrt::Microsoft::ReactNative::factory_implementation {
|
|
126
|
+
struct HttpSettings : HttpSettingsT<HttpSettings, implementation::HttpSettings> {};
|
|
127
|
+
} // namespace winrt::Microsoft::ReactNative::factory_implementation
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -64,14 +64,9 @@
|
|
|
64
64
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionDynamicAutomationProvider.cpp">
|
|
65
65
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
66
66
|
</ClCompile>
|
|
67
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\
|
|
67
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.cpp">
|
|
68
68
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
69
|
-
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\
|
|
70
|
-
<SubType>Code</SubType>
|
|
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>
|
|
69
|
+
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeIsland.idl</DependentUpon>
|
|
75
70
|
<SubType>Code</SubType>
|
|
76
71
|
</ClCompile>
|
|
77
72
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionUIService.cpp">
|
|
@@ -256,6 +251,7 @@
|
|
|
256
251
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\StatusBarManagerModule.cpp" />
|
|
257
252
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\WebSocketModule.cpp" />
|
|
258
253
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\DefaultBlobResource.cpp" />
|
|
254
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\NetworkPropertyIds.cpp" />
|
|
259
255
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\OriginPolicyHttpFilter.cpp" />
|
|
260
256
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\RedirectHttpFilter.cpp" />
|
|
261
257
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\WinRTHttpResource.cpp" />
|
|
@@ -287,7 +283,7 @@
|
|
|
287
283
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionHwndHost.h" />
|
|
288
284
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionRootAutomationProvider.h" />
|
|
289
285
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionDynamicAutomationProvider.h" />
|
|
290
|
-
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\
|
|
286
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.h" />
|
|
291
287
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionUIService.h" />
|
|
292
288
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionViewComponentView.h" />
|
|
293
289
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ImageComponentView.h" />
|
|
@@ -618,6 +614,7 @@
|
|
|
618
614
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\componentregistry\native\NativeComponentRegistryBinding.cpp" />
|
|
619
615
|
</ItemGroup>
|
|
620
616
|
<ItemGroup>
|
|
617
|
+
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\HttpSettings.idl" />
|
|
621
618
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueReader.idl" />
|
|
622
619
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueWriter.idl" />
|
|
623
620
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IReactContext.idl" />
|
|
@@ -643,7 +640,7 @@
|
|
|
643
640
|
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\FocusManager.idl" />
|
|
644
641
|
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionContext.idl" />
|
|
645
642
|
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionHwndHost.idl" />
|
|
646
|
-
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\
|
|
643
|
+
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeIsland.idl" />
|
|
647
644
|
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionSwitcher.idl" />
|
|
648
645
|
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionUIService.idl" />
|
|
649
646
|
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\IReactCompositionViewComponentBuilder.idl" />
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionDynamicAutomationProvider.cpp">
|
|
219
219
|
<Filter>Source Files\Fabric\Composition</Filter>
|
|
220
220
|
</ClCompile>
|
|
221
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\
|
|
221
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.cpp">
|
|
222
222
|
<Filter>Source Files\Fabric\Composition</Filter>
|
|
223
223
|
</ClCompile>
|
|
224
224
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionUIService.cpp">
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionHwndHost.cpp">
|
|
231
231
|
<Filter>Source Files\Fabric</Filter>
|
|
232
232
|
</ClCompile>
|
|
233
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\
|
|
233
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.cpp">
|
|
234
234
|
<Filter>Source Files\Fabric</Filter>
|
|
235
235
|
</ClCompile>
|
|
236
236
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionUIService.cpp">
|
|
@@ -322,6 +322,7 @@
|
|
|
322
322
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\ExecutionContext.cpp" />
|
|
323
323
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\utils\jsi-utils.cpp" />
|
|
324
324
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\TextDrawing.cpp" />
|
|
325
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\NetworkPropertyIds.cpp" />
|
|
325
326
|
</ItemGroup>
|
|
326
327
|
<ItemGroup>
|
|
327
328
|
<Filter Include="Source Files">
|
|
@@ -759,7 +760,7 @@
|
|
|
759
760
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionDynamicAutomationProvider.h">
|
|
760
761
|
<Filter>Header Files\Fabric\Composition</Filter>
|
|
761
762
|
</ClInclude>
|
|
762
|
-
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\
|
|
763
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.h">
|
|
763
764
|
<Filter>Header Files\Fabric\Composition</Filter>
|
|
764
765
|
</ClInclude>
|
|
765
766
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionUIService.h">
|
|
@@ -822,6 +823,7 @@
|
|
|
822
823
|
</None>
|
|
823
824
|
</ItemGroup>
|
|
824
825
|
<ItemGroup>
|
|
826
|
+
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\HttpSettings.idl" />
|
|
825
827
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueReader.idl" />
|
|
826
828
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueWriter.idl" />
|
|
827
829
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IReactContext.idl" />
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ float ScaleFactor(HWND hwnd) noexcept {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
void UpdateRootViewSizeToAppWindow(
|
|
28
|
-
winrt::Microsoft::ReactNative::
|
|
28
|
+
winrt::Microsoft::ReactNative::ReactNativeIsland const &rootView,
|
|
29
29
|
winrt::Microsoft::UI::Windowing::AppWindow const &window) {
|
|
30
30
|
auto hwnd = winrt::Microsoft::UI::GetWindowFromWindowId(window.Id());
|
|
31
31
|
auto scaleFactor = ScaleFactor(hwnd);
|
|
@@ -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
|
-
|
|
38
|
-
|
|
37
|
+
winrt::Microsoft::ReactNative::LayoutConstraints constraints;
|
|
38
|
+
constraints.MaximumSize = constraints.MinimumSize = size;
|
|
39
|
+
rootView.Arrange(constraints, {0,0});
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -110,7 +111,7 @@ _Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR
|
|
|
110
111
|
// Create a RootView which will present a react-native component
|
|
111
112
|
winrt::Microsoft::ReactNative::ReactViewOptions viewOptions;
|
|
112
113
|
viewOptions.ComponentName(mainComponentName);
|
|
113
|
-
auto rootView = winrt::Microsoft::ReactNative::
|
|
114
|
+
auto rootView = winrt::Microsoft::ReactNative::ReactNativeIsland(compositor);
|
|
114
115
|
rootView.ReactViewHost(winrt::Microsoft::ReactNative::ReactCoreInjection::MakeViewHost(host, viewOptions));
|
|
115
116
|
|
|
116
117
|
// Update the size of the RootView when the AppWindow changes size
|
|
@@ -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
|