react-native-windows 0.75.9 → 0.75.11
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/Modal/Modal.windows.js +352 -0
- package/Microsoft.ReactNative/CompositionComponentView.idl +2 -1
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +4 -1
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +7 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.h +2 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +45 -50
- package/Microsoft.ReactNative/Fabric/ComponentView.h +14 -22
- package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp +931 -0
- package/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.h +80 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +31 -13
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +187 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +10 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +8 -32
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +316 -911
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +32 -29
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +9 -2
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +181 -123
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +16 -8
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +99 -37
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +25 -3
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +63 -2
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +51 -3
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -8
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +54 -5
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +11 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +26 -0
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +1 -1
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +25 -129
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +5 -13
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +13 -34
- package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -2
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +129 -18
- package/Microsoft.ReactNative/ReactNativeWin32App.h +14 -5
- package/Microsoft.ReactNative/ViewProps.idl +2 -0
- package/Microsoft.ReactNative.Cxx/ComponentView.Experimental.interop.h +14 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Shared/Shared.vcxitems +3 -10
- package/Shared/Shared.vcxitems.filters +1 -0
- package/codegen/NativeAccessibilityInfoSpec.g.h +1 -0
- package/codegen/NativeAccessibilityManagerSpec.g.h +1 -0
- package/codegen/NativeActionSheetManagerSpec.g.h +1 -0
- package/codegen/NativeAlertManagerSpec.g.h +1 -0
- package/codegen/NativeAnimatedModuleSpec.g.h +1 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +1 -0
- package/codegen/NativeAppStateSpec.g.h +1 -0
- package/codegen/NativeAppThemeSpec.g.h +1 -0
- package/codegen/NativeAppearanceSpec.g.h +1 -0
- package/codegen/NativeBlobModuleSpec.g.h +1 -0
- package/codegen/NativeBugReportingSpec.g.h +1 -0
- package/codegen/NativeClipboardSpec.g.h +1 -0
- package/codegen/NativeDOMSpec.g.h +1 -0
- package/codegen/NativeDevLoadingViewSpec.g.h +1 -0
- package/codegen/NativeDevMenuSpec.g.h +1 -0
- package/codegen/NativeDevSettingsSpec.g.h +1 -0
- package/codegen/NativeDevToolsSettingsManagerSpec.g.h +1 -0
- package/codegen/NativeDeviceEventManagerSpec.g.h +1 -0
- package/codegen/NativeDeviceInfoSpec.g.h +1 -0
- package/codegen/NativeDialogManagerAndroidSpec.g.h +1 -0
- package/codegen/NativeDialogManagerWindowsSpec.g.h +1 -0
- package/codegen/NativeExceptionsManagerSpec.g.h +1 -0
- package/codegen/NativeFileReaderModuleSpec.g.h +1 -0
- package/codegen/NativeFrameRateLoggerSpec.g.h +1 -0
- package/codegen/NativeHeadlessJsTaskSupportSpec.g.h +1 -0
- package/codegen/NativeI18nManagerSpec.g.h +1 -0
- package/codegen/NativeIdleCallbacksSpec.g.h +1 -0
- package/codegen/NativeImageEditorSpec.g.h +1 -0
- package/codegen/NativeImageLoaderAndroidSpec.g.h +1 -0
- package/codegen/NativeImageLoaderIOSSpec.g.h +1 -0
- package/codegen/NativeImageStoreAndroidSpec.g.h +1 -0
- package/codegen/NativeImageStoreIOSSpec.g.h +1 -0
- package/codegen/NativeIntentAndroidSpec.g.h +1 -0
- package/codegen/NativeIntersectionObserverSpec.g.h +1 -0
- package/codegen/NativeJSCHeapCaptureSpec.g.h +1 -0
- package/codegen/NativeJSCSamplingProfilerSpec.g.h +1 -0
- package/codegen/NativeKeyboardObserverSpec.g.h +1 -0
- package/codegen/NativeLinkingManagerSpec.g.h +1 -0
- package/codegen/NativeLogBoxSpec.g.h +1 -0
- package/codegen/NativeMicrotasksSpec.g.h +1 -0
- package/codegen/NativeModalManagerSpec.g.h +1 -0
- package/codegen/NativeMutationObserverSpec.g.h +1 -0
- package/codegen/NativeNetworkingAndroidSpec.g.h +1 -0
- package/codegen/NativeNetworkingIOSSpec.g.h +1 -0
- package/codegen/NativePerformanceObserverSpec.g.h +1 -0
- package/codegen/NativePerformanceSpec.g.h +1 -0
- package/codegen/NativePermissionsAndroidSpec.g.h +1 -0
- package/codegen/NativePlatformConstantsAndroidSpec.g.h +1 -0
- package/codegen/NativePlatformConstantsIOSSpec.g.h +1 -0
- package/codegen/NativePlatformConstantsWindowsSpec.g.h +1 -0
- package/codegen/NativePushNotificationManagerIOSSpec.g.h +1 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +1 -0
- package/codegen/NativeRedBoxSpec.g.h +1 -0
- package/codegen/NativeSampleTurboModuleSpec.g.h +1 -0
- package/codegen/NativeSegmentFetcherSpec.g.h +1 -0
- package/codegen/NativeSettingsManagerSpec.g.h +1 -0
- package/codegen/NativeShareModuleSpec.g.h +1 -0
- package/codegen/NativeSoundManagerSpec.g.h +1 -0
- package/codegen/NativeSourceCodeSpec.g.h +1 -0
- package/codegen/NativeStatusBarManagerAndroidSpec.g.h +1 -0
- package/codegen/NativeStatusBarManagerIOSSpec.g.h +1 -0
- package/codegen/NativeTimingSpec.g.h +1 -0
- package/codegen/NativeToastAndroidSpec.g.h +1 -0
- package/codegen/NativeUIManagerSpec.g.h +1 -0
- package/codegen/NativeVibrationSpec.g.h +1 -0
- package/codegen/NativeWebSocketModuleSpec.g.h +1 -0
- package/package.json +3 -3
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +46 -130
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +0 -59
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +0 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.75.
|
|
3
|
+
"version": "0.75.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "14.1.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "14.1.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "14.1.0",
|
|
29
|
-
"@react-native-windows/cli": "0.75.
|
|
29
|
+
"@react-native-windows/cli": "0.75.8",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/assets-registry": "0.75.3",
|
|
32
32
|
"@react-native/codegen": "0.75.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"yargs": "^17.6.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@react-native-windows/codegen": "0.75.
|
|
70
|
+
"@react-native-windows/codegen": "0.75.6",
|
|
71
71
|
"@react-native/metro-config": "0.75.3",
|
|
72
72
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
73
73
|
"@rnw-scripts/eslint-config": "1.2.23",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
#include "NativeModules.h"
|
|
10
10
|
|
|
11
|
+
// A PackageProvider containing any turbo modules you define within this app project
|
|
11
12
|
struct CompReactPackageProvider
|
|
12
13
|
: winrt::implements<CompReactPackageProvider, winrt::Microsoft::ReactNative::IReactPackageProvider> {
|
|
13
14
|
public: // IReactPackageProvider
|
|
@@ -16,151 +17,66 @@ struct CompReactPackageProvider
|
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
float ScaleFactor(HWND hwnd) noexcept {
|
|
24
|
-
return GetDpiForWindow(hwnd) / static_cast<float>(USER_DEFAULT_SCREEN_DPI);
|
|
25
|
-
}
|
|
20
|
+
// The entry point of the Win32 application
|
|
21
|
+
_Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR /* commandLine */, int showCmd) {
|
|
22
|
+
// Initialize WinRT
|
|
23
|
+
winrt::init_apartment(winrt::apartment_type::single_threaded);
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
winrt::Microsoft::UI::Windowing::AppWindow const &window) {
|
|
30
|
-
auto hwnd = winrt::Microsoft::UI::GetWindowFromWindowId(window.Id());
|
|
31
|
-
auto scaleFactor = ScaleFactor(hwnd);
|
|
32
|
-
winrt::Windows::Foundation::Size size{
|
|
33
|
-
window.ClientSize().Width / scaleFactor, window.ClientSize().Height / scaleFactor};
|
|
34
|
-
// Do not relayout when minimized
|
|
35
|
-
if (window.Presenter().as<winrt::Microsoft::UI::Windowing::OverlappedPresenter>().State() !=
|
|
36
|
-
winrt::Microsoft::UI::Windowing::OverlappedPresenterState::Minimized) {
|
|
37
|
-
winrt::Microsoft::ReactNative::LayoutConstraints constraints;
|
|
38
|
-
constraints.LayoutDirection = winrt::Microsoft::ReactNative::LayoutDirection::Undefined;
|
|
39
|
-
constraints.MaximumSize = constraints.MinimumSize = size;
|
|
40
|
-
rootView.Arrange(constraints, {0,0});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
25
|
+
// Enable per monitor DPI scaling
|
|
26
|
+
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
|
43
27
|
|
|
44
|
-
//
|
|
45
|
-
winrt::Microsoft::ReactNative::ReactNativeHost CreateReactNativeHost(
|
|
46
|
-
HWND hwnd,
|
|
47
|
-
const winrt::Microsoft::UI::Composition::Compositor &compositor) {
|
|
28
|
+
// Find the path hosting the app exe file
|
|
48
29
|
WCHAR appDirectory[MAX_PATH];
|
|
49
30
|
GetModuleFileNameW(NULL, appDirectory, MAX_PATH);
|
|
50
31
|
PathCchRemoveFileSpec(appDirectory, MAX_PATH);
|
|
51
32
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// Include any autolinked modules
|
|
55
|
-
RegisterAutolinkedNativeModulePackages(host.PackageProviders());
|
|
33
|
+
// Create a ReactNativeWin32App with the ReactNativeAppBuilder
|
|
34
|
+
auto reactNativeWin32App{winrt::Microsoft::ReactNative::ReactNativeAppBuilder().Build()};
|
|
56
35
|
|
|
57
|
-
|
|
36
|
+
// Configure the initial InstanceSettings for the app's ReactNativeHost
|
|
37
|
+
auto settings{reactNativeWin32App.ReactNativeHost().InstanceSettings()};
|
|
38
|
+
// Register any autolinked native modules
|
|
39
|
+
RegisterAutolinkedNativeModulePackages(settings.PackageProviders());
|
|
40
|
+
// Register any native modules defined within this app project
|
|
41
|
+
settings.PackageProviders().Append(winrt::make<CompReactPackageProvider>());
|
|
58
42
|
|
|
59
43
|
#if BUNDLE
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
// Load the JS bundle from a file (not Metro):
|
|
45
|
+
// Set the path (on disk) where the .bundle file is located
|
|
46
|
+
settings.BundleRootPath(std::wstring(L"file://").append(appDirectory).append(L"\\Bundle\\").c_str());
|
|
47
|
+
// Set the name of the bundle file (without the .bundle extension)
|
|
48
|
+
settings.JavaScriptBundleFile(L"index.windows");
|
|
49
|
+
// Disable hot reload
|
|
50
|
+
settings.UseFastRefresh(false);
|
|
63
51
|
#else
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
// Load the JS bundle from Metro
|
|
53
|
+
settings.JavaScriptBundleFile(L"index");
|
|
54
|
+
// Enable hot reload
|
|
55
|
+
settings.UseFastRefresh(true);
|
|
66
56
|
#endif
|
|
67
|
-
|
|
68
57
|
#if _DEBUG
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
// For Debug builds
|
|
59
|
+
// Enable Direct Debugging of JS
|
|
60
|
+
settings.UseDirectDebugger(true);
|
|
61
|
+
// Enable the Developer Menu
|
|
62
|
+
settings.UseDeveloperSupport(true);
|
|
71
63
|
#else
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
// For Release builds:
|
|
65
|
+
// Disable Direct Debugging of JS
|
|
66
|
+
settings.UseDirectDebugger(false);
|
|
67
|
+
// Disable the Developer Menu
|
|
68
|
+
settings.UseDeveloperSupport(false);
|
|
74
69
|
#endif
|
|
75
70
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
host.InstanceSettings(), compositor);
|
|
81
|
-
|
|
82
|
-
return host;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
_Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR /* commandLine */, int showCmd) {
|
|
86
|
-
// Initialize WinRT.
|
|
87
|
-
winrt::init_apartment(winrt::apartment_type::single_threaded);
|
|
88
|
-
|
|
89
|
-
// Enable per monitor DPI scaling
|
|
90
|
-
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
|
91
|
-
|
|
92
|
-
// Create a DispatcherQueue for this thread. This is needed for Composition, Content, and
|
|
93
|
-
// Input APIs.
|
|
94
|
-
auto dispatcherQueueController{winrt::Microsoft::UI::Dispatching::DispatcherQueueController::CreateOnCurrentThread()};
|
|
95
|
-
|
|
96
|
-
// Create a Compositor for all Content on this thread.
|
|
97
|
-
auto compositor{winrt::Microsoft::UI::Composition::Compositor()};
|
|
98
|
-
|
|
99
|
-
// Create a top-level window.
|
|
100
|
-
auto window = winrt::Microsoft::UI::Windowing::AppWindow::Create();
|
|
101
|
-
window.Title(windowTitle);
|
|
102
|
-
window.Resize({1000, 1000});
|
|
103
|
-
window.Show();
|
|
104
|
-
auto hwnd = winrt::Microsoft::UI::GetWindowFromWindowId(window.Id());
|
|
105
|
-
auto scaleFactor = ScaleFactor(hwnd);
|
|
106
|
-
|
|
107
|
-
auto host = CreateReactNativeHost(hwnd, compositor);
|
|
108
|
-
|
|
109
|
-
// Start the react-native instance, which will create a JavaScript runtime and load the applications bundle
|
|
110
|
-
host.ReloadInstance();
|
|
111
|
-
|
|
112
|
-
// Create a RootView which will present a react-native component
|
|
113
|
-
winrt::Microsoft::ReactNative::ReactViewOptions viewOptions;
|
|
114
|
-
viewOptions.ComponentName(mainComponentName);
|
|
115
|
-
auto rootView = winrt::Microsoft::ReactNative::ReactNativeIsland(compositor);
|
|
116
|
-
rootView.ReactViewHost(winrt::Microsoft::ReactNative::ReactCoreInjection::MakeViewHost(host, viewOptions));
|
|
117
|
-
|
|
118
|
-
// Update the size of the RootView when the AppWindow changes size
|
|
119
|
-
window.Changed([wkRootView = winrt::make_weak(rootView)](
|
|
120
|
-
winrt::Microsoft::UI::Windowing::AppWindow const &window,
|
|
121
|
-
winrt::Microsoft::UI::Windowing::AppWindowChangedEventArgs const &args) {
|
|
122
|
-
if (args.DidSizeChange() || args.DidVisibilityChange()) {
|
|
123
|
-
if (auto rootView = wkRootView.get()) {
|
|
124
|
-
UpdateRootViewSizeToAppWindow(rootView, window);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// Quit application when main window is closed
|
|
130
|
-
window.Destroying(
|
|
131
|
-
[host](winrt::Microsoft::UI::Windowing::AppWindow const &window, winrt::IInspectable const & /*args*/) {
|
|
132
|
-
// Before we shutdown the application - unload the ReactNativeHost to give the javascript a chance to save any
|
|
133
|
-
// state
|
|
134
|
-
auto async = host.UnloadInstance();
|
|
135
|
-
async.Completed([host](auto asyncInfo, winrt::Windows::Foundation::AsyncStatus asyncStatus) {
|
|
136
|
-
assert(asyncStatus == winrt::Windows::Foundation::AsyncStatus::Completed);
|
|
137
|
-
host.InstanceSettings().UIDispatcher().Post([]() { PostQuitMessage(0); });
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// DesktopChildSiteBridge create a ContentSite that can host the RootView ContentIsland
|
|
142
|
-
auto bridge = winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(compositor, window.Id());
|
|
143
|
-
bridge.Connect(rootView.Island());
|
|
144
|
-
bridge.ResizePolicy(winrt::Microsoft::UI::Content::ContentSizePolicy::ResizeContentToParentWindow);
|
|
145
|
-
|
|
146
|
-
rootView.ScaleFactor(scaleFactor);
|
|
147
|
-
|
|
148
|
-
// Set the intialSize of the root view
|
|
149
|
-
UpdateRootViewSizeToAppWindow(rootView, window);
|
|
150
|
-
|
|
151
|
-
bridge.Show();
|
|
152
|
-
|
|
153
|
-
// Run the main application event loop
|
|
154
|
-
dispatcherQueueController.DispatcherQueue().RunEventLoop();
|
|
155
|
-
|
|
156
|
-
// Rundown the DispatcherQueue. This drains the queue and raises events to let components
|
|
157
|
-
// know the message loop has finished.
|
|
158
|
-
dispatcherQueueController.ShutdownQueue();
|
|
71
|
+
// Get the AppWindow so we can configure its initial title and size
|
|
72
|
+
auto appWindow{reactNativeWin32App.AppWindow()};
|
|
73
|
+
appWindow.Title(L"{{ mainComponentName }}");
|
|
74
|
+
appWindow.Resize({1000, 1000});
|
|
159
75
|
|
|
160
|
-
|
|
161
|
-
|
|
76
|
+
// Get the ReactViewOptions so we can set the initial RN component to load
|
|
77
|
+
auto viewOptions{reactNativeWin32App.ReactViewOptions()};
|
|
78
|
+
viewOptions.ComponentName(L"{{ mainComponentName }}");
|
|
162
79
|
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
compositor = nullptr;
|
|
80
|
+
// Start the app
|
|
81
|
+
reactNativeWin32App.Start();
|
|
166
82
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#include "pch.h"
|
|
2
|
-
#include "ReactInstanceSettingsBuilder.h"
|
|
3
|
-
#include "ReactInstanceSettingsBuilder.g.cpp"
|
|
4
|
-
#include "ReactInstanceSettings.h"
|
|
5
|
-
|
|
6
|
-
namespace winrt::ReactNative {
|
|
7
|
-
using namespace winrt::Microsoft::ReactNative;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
namespace winrt::UI {
|
|
11
|
-
using namespace winrt::Microsoft::UI;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
namespace winrt::Microsoft::ReactNative::implementation {
|
|
15
|
-
ReactInstanceSettingsBuilder::ReactInstanceSettingsBuilder() {
|
|
16
|
-
m_reactInstanceSettings = winrt::make<winrt::ReactNative::implementation::ReactInstanceSettings>();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
winrt::ReactNative::ReactInstanceSettings ReactInstanceSettingsBuilder::ReactInstanceSettings() {
|
|
20
|
-
return m_reactInstanceSettings;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
winrt::ReactNative::ReactInstanceSettingsBuilder ReactInstanceSettingsBuilder::UseDirectDebugger(bool const &state) {
|
|
24
|
-
m_reactInstanceSettings.UseDirectDebugger(state);
|
|
25
|
-
|
|
26
|
-
return *this;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
winrt::ReactNative::ReactInstanceSettingsBuilder ReactInstanceSettingsBuilder::UseDeveloperSupport(bool const &state) {
|
|
30
|
-
m_reactInstanceSettings.UseDeveloperSupport(state);
|
|
31
|
-
|
|
32
|
-
return *this;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
winrt::ReactNative::ReactInstanceSettingsBuilder ReactInstanceSettingsBuilder::BundleRootPath(hstring const &path) {
|
|
36
|
-
m_reactInstanceSettings.BundleRootPath(std::wstring(L"file://").append(path.c_str()).append(L"\\Bundle\\").c_str());
|
|
37
|
-
|
|
38
|
-
return *this;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
winrt::ReactNative::ReactInstanceSettingsBuilder ReactInstanceSettingsBuilder::DebugBundlePath(hstring const &path) {
|
|
42
|
-
m_reactInstanceSettings.DebugBundlePath(path.c_str());
|
|
43
|
-
|
|
44
|
-
return *this;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
winrt::ReactNative::ReactInstanceSettingsBuilder ReactInstanceSettingsBuilder::JavaScriptBundleFile(
|
|
48
|
-
hstring const &file) {
|
|
49
|
-
m_reactInstanceSettings.JavaScriptBundleFile(file.c_str());
|
|
50
|
-
|
|
51
|
-
return *this;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
winrt::ReactNative::ReactInstanceSettingsBuilder ReactInstanceSettingsBuilder::UseFastRefresh(bool const &state) {
|
|
55
|
-
m_reactInstanceSettings.UseFastRefresh(state);
|
|
56
|
-
|
|
57
|
-
return *this;
|
|
58
|
-
}
|
|
59
|
-
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
#include "ReactInstanceSettingsBuilder.g.h"
|
|
3
|
-
|
|
4
|
-
namespace winrt::Microsoft::ReactNative::implementation {
|
|
5
|
-
struct ReactInstanceSettingsBuilder : ReactInstanceSettingsBuilderT<ReactInstanceSettingsBuilder> {
|
|
6
|
-
ReactInstanceSettingsBuilder();
|
|
7
|
-
|
|
8
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettings ReactInstanceSettings();
|
|
9
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettingsBuilder UseDirectDebugger(bool const &state);
|
|
10
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettingsBuilder UseDeveloperSupport(bool const &state);
|
|
11
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettingsBuilder BundleRootPath(hstring const &path);
|
|
12
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettingsBuilder DebugBundlePath(hstring const &path);
|
|
13
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettingsBuilder JavaScriptBundleFile(hstring const &file);
|
|
14
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettingsBuilder UseFastRefresh(bool const &state);
|
|
15
|
-
|
|
16
|
-
private:
|
|
17
|
-
winrt::Microsoft::ReactNative::ReactInstanceSettings m_reactInstanceSettings{nullptr};
|
|
18
|
-
};
|
|
19
|
-
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
20
|
-
namespace winrt::Microsoft::ReactNative::factory_implementation {
|
|
21
|
-
struct ReactInstanceSettingsBuilder
|
|
22
|
-
: ReactInstanceSettingsBuilderT<ReactInstanceSettingsBuilder, implementation::ReactInstanceSettingsBuilder> {};
|
|
23
|
-
} // namespace winrt::Microsoft::ReactNative::factory_implementation
|