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
|
@@ -92,6 +92,7 @@ const AppContainer = ({
|
|
|
92
92
|
rootTag,
|
|
93
93
|
showArchitectureIndicator,
|
|
94
94
|
WrapperComponent,
|
|
95
|
+
rootViewStyle,
|
|
95
96
|
}: Props): React.Node => {
|
|
96
97
|
const appContainerRootViewRef: AppContainerRootViewRef = React.useRef(null);
|
|
97
98
|
const innerViewRef: InspectedViewRef = React.useRef(null);
|
|
@@ -141,7 +142,7 @@ const AppContainer = ({
|
|
|
141
142
|
collapsable={reactDevToolsAgent == null && !shouldRenderInspector}
|
|
142
143
|
pointerEvents="box-none"
|
|
143
144
|
key={key}
|
|
144
|
-
style={styles.container}
|
|
145
|
+
style={rootViewStyle || styles.container}
|
|
145
146
|
ref={innerViewRef}>
|
|
146
147
|
{children}
|
|
147
148
|
</View>
|
|
@@ -167,7 +168,7 @@ const AppContainer = ({
|
|
|
167
168
|
<RootTagContext.Provider value={createRootTag(rootTag)}>
|
|
168
169
|
<View
|
|
169
170
|
ref={appContainerRootViewRef}
|
|
170
|
-
style={styles.container}
|
|
171
|
+
style={rootViewStyle || styles.container}
|
|
171
172
|
pointerEvents="box-none">
|
|
172
173
|
{innerView}
|
|
173
174
|
|
|
@@ -23,6 +23,7 @@ const AppContainer = ({
|
|
|
23
23
|
rootTag,
|
|
24
24
|
showArchitectureIndicator,
|
|
25
25
|
WrapperComponent,
|
|
26
|
+
rootViewStyle,
|
|
26
27
|
}: Props): React.Node => {
|
|
27
28
|
let innerView = children;
|
|
28
29
|
|
|
@@ -39,7 +40,7 @@ const AppContainer = ({
|
|
|
39
40
|
|
|
40
41
|
return (
|
|
41
42
|
<RootTagContext.Provider value={createRootTag(rootTag)}>
|
|
42
|
-
<View style={styles.root} pointerEvents="box-none">
|
|
43
|
+
<View style={rootViewStyle || styles.root} pointerEvents="box-none">
|
|
43
44
|
{innerView}
|
|
44
45
|
</View>
|
|
45
46
|
</RootTagContext.Provider>
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {RootTag} from './RootTag';
|
|
12
|
+
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
13
|
|
|
13
14
|
import * as React from 'react';
|
|
14
15
|
|
|
@@ -19,6 +20,7 @@ export type Props = $ReadOnly<{|
|
|
|
19
20
|
initialProps?: {...},
|
|
20
21
|
showArchitectureIndicator?: boolean,
|
|
21
22
|
WrapperComponent?: ?React.ComponentType<any>,
|
|
23
|
+
rootViewStyle?: ?ViewStyleProp,
|
|
22
24
|
internal_excludeLogBox?: boolean,
|
|
23
25
|
internal_excludeInspector?: boolean,
|
|
24
26
|
|}>;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import type * as React from 'react';
|
|
11
11
|
import type {IPerformanceLogger} from '../Utilities/IPerformanceLogger';
|
|
12
|
+
import type {ViewStyle} from '../StyleSheet/StyleSheetTypes';
|
|
12
13
|
|
|
13
14
|
type Task = (taskData: any) => Promise<void>;
|
|
14
15
|
type TaskProvider = () => Task;
|
|
@@ -34,6 +35,8 @@ export type WrapperComponentProvider = (
|
|
|
34
35
|
appParameters: any,
|
|
35
36
|
) => React.ComponentType<any>;
|
|
36
37
|
|
|
38
|
+
export type RootViewStyleProvider = (appParameters: any) => ViewStyle;
|
|
39
|
+
|
|
37
40
|
/**
|
|
38
41
|
* `AppRegistry` is the JS entry point to running all React Native apps. App
|
|
39
42
|
* root components should register themselves with
|
|
@@ -56,6 +59,10 @@ export namespace AppRegistry {
|
|
|
56
59
|
|
|
57
60
|
export function registerConfig(config: AppConfig[]): void;
|
|
58
61
|
|
|
62
|
+
export function setRootViewStyleProvider(
|
|
63
|
+
provider: RootViewStyleProvider,
|
|
64
|
+
): void;
|
|
65
|
+
|
|
59
66
|
export function registerComponent(
|
|
60
67
|
appKey: string,
|
|
61
68
|
getComponentFunc: ComponentProvider,
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {RootTag} from '../Types/RootTagTypes';
|
|
12
12
|
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
|
13
13
|
import type {DisplayModeType} from './DisplayMode';
|
|
14
|
+
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
14
15
|
|
|
15
16
|
import BatchedBridge from '../BatchedBridge/BatchedBridge';
|
|
16
17
|
import BugReporting from '../BugReporting/BugReporting';
|
|
@@ -60,6 +61,7 @@ export type Registry = {
|
|
|
60
61
|
export type WrapperComponentProvider = (
|
|
61
62
|
appParameters: Object,
|
|
62
63
|
) => React$ComponentType<any>;
|
|
64
|
+
export type RootViewStyleProvider = (appParameters: Object) => ViewStyleProp;
|
|
63
65
|
|
|
64
66
|
const runnables: Runnables = {};
|
|
65
67
|
let runCount = 1;
|
|
@@ -70,6 +72,7 @@ let componentProviderInstrumentationHook: ComponentProviderInstrumentationHook =
|
|
|
70
72
|
(component: ComponentProvider) => component();
|
|
71
73
|
|
|
72
74
|
let wrapperComponentProvider: ?WrapperComponentProvider;
|
|
75
|
+
let rootViewStyleProvider: ?RootViewStyleProvider;
|
|
73
76
|
let showArchitectureIndicator = false;
|
|
74
77
|
|
|
75
78
|
/**
|
|
@@ -82,6 +85,10 @@ const AppRegistry = {
|
|
|
82
85
|
wrapperComponentProvider = provider;
|
|
83
86
|
},
|
|
84
87
|
|
|
88
|
+
setRootViewStyleProvider(provider: RootViewStyleProvider) {
|
|
89
|
+
rootViewStyleProvider = provider;
|
|
90
|
+
},
|
|
91
|
+
|
|
85
92
|
enableArchitectureIndicator(enabled: boolean): void {
|
|
86
93
|
showArchitectureIndicator = enabled;
|
|
87
94
|
},
|
|
@@ -130,6 +137,7 @@ const AppRegistry = {
|
|
|
130
137
|
appParameters.initialProps,
|
|
131
138
|
appParameters.rootTag,
|
|
132
139
|
wrapperComponentProvider && wrapperComponentProvider(appParameters),
|
|
140
|
+
rootViewStyleProvider && rootViewStyleProvider(appParameters),
|
|
133
141
|
appParameters.fabric,
|
|
134
142
|
showArchitectureIndicator,
|
|
135
143
|
scopedPerformanceLogger,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
|
12
|
+
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
13
|
|
|
13
14
|
import GlobalPerformanceLogger from '../Utilities/GlobalPerformanceLogger';
|
|
14
15
|
import PerformanceLoggerContext from '../Utilities/PerformanceLoggerContext';
|
|
@@ -32,6 +33,7 @@ export default function renderApplication<Props: Object>(
|
|
|
32
33
|
initialProps: Props,
|
|
33
34
|
rootTag: any,
|
|
34
35
|
WrapperComponent?: ?React.ComponentType<any>,
|
|
36
|
+
rootViewStyle?: ?ViewStyleProp,
|
|
35
37
|
fabric?: boolean,
|
|
36
38
|
showArchitectureIndicator?: boolean,
|
|
37
39
|
scopedPerformanceLogger?: IPerformanceLogger,
|
|
@@ -52,6 +54,7 @@ export default function renderApplication<Props: Object>(
|
|
|
52
54
|
fabric={fabric}
|
|
53
55
|
showArchitectureIndicator={showArchitectureIndicator}
|
|
54
56
|
WrapperComponent={WrapperComponent}
|
|
57
|
+
rootViewStyle={rootViewStyle}
|
|
55
58
|
initialProps={initialProps ?? Object.freeze({})}
|
|
56
59
|
internal_excludeLogBox={isLogBox}>
|
|
57
60
|
<RootComponent {...initialProps} rootTag={rootTag} />
|
|
@@ -30,8 +30,7 @@ void AsynchronousEventBeat::induce() const {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
void AsynchronousEventBeat::request() const {
|
|
33
|
-
bool alreadyRequested = isRequested_;
|
|
34
|
-
EventBeat::request();
|
|
33
|
+
bool alreadyRequested = isRequested_.exchange(true);
|
|
35
34
|
if (!alreadyRequested) {
|
|
36
35
|
if (m_context.UIDispatcher().HasThreadAccess()) {
|
|
37
36
|
induce();
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
#include <windowsx.h>
|
|
15
15
|
#include <winrt/Windows.UI.Input.h>
|
|
16
16
|
#include "Composition.Input.h"
|
|
17
|
-
#include "CompositionRootView.h"
|
|
18
17
|
#include "CompositionViewComponentView.h"
|
|
18
|
+
#include "ReactNativeIsland.h"
|
|
19
19
|
#include "RootComponentView.h"
|
|
20
20
|
|
|
21
21
|
#ifdef USE_WINUI3
|
|
@@ -151,10 +151,10 @@ struct CompositionInputKeyboardSource : winrt::implements<
|
|
|
151
151
|
|
|
152
152
|
CompositionEventHandler::CompositionEventHandler(
|
|
153
153
|
const winrt::Microsoft::ReactNative::ReactContext &context,
|
|
154
|
-
const winrt::Microsoft::ReactNative::
|
|
155
|
-
: m_context(context), m_wkRootView(
|
|
154
|
+
const winrt::Microsoft::ReactNative::ReactNativeIsland &reactNativeIsland)
|
|
155
|
+
: m_context(context), m_wkRootView(reactNativeIsland) {
|
|
156
156
|
#ifdef USE_WINUI3
|
|
157
|
-
if (auto island =
|
|
157
|
+
if (auto island = reactNativeIsland.Island()) {
|
|
158
158
|
auto pointerSource = winrt::Microsoft::UI::Input::InputPointerSource::GetForIsland(island);
|
|
159
159
|
|
|
160
160
|
m_pointerPressedToken =
|
|
@@ -241,9 +241,9 @@ CompositionEventHandler::CompositionEventHandler(
|
|
|
241
241
|
focusedComponent
|
|
242
242
|
? focusedComponent.Tag()
|
|
243
243
|
: static_cast<facebook::react::Tag>(
|
|
244
|
-
winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
244
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(
|
|
245
245
|
strongRootView)
|
|
246
|
-
->
|
|
246
|
+
->RootTag()),
|
|
247
247
|
args);
|
|
248
248
|
auto keyboardSource = winrt::make<CompositionInputKeyboardSource>(source);
|
|
249
249
|
onKeyDown(keyboardSource, keyArgs);
|
|
@@ -264,9 +264,9 @@ CompositionEventHandler::CompositionEventHandler(
|
|
|
264
264
|
focusedComponent
|
|
265
265
|
? focusedComponent.Tag()
|
|
266
266
|
: static_cast<facebook::react::Tag>(
|
|
267
|
-
winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
267
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(
|
|
268
268
|
strongRootView)
|
|
269
|
-
->
|
|
269
|
+
->RootTag()),
|
|
270
270
|
args);
|
|
271
271
|
auto keyboardSource = winrt::make<CompositionInputKeyboardSource>(source);
|
|
272
272
|
onKeyUp(keyboardSource, keyArgs);
|
|
@@ -288,9 +288,9 @@ CompositionEventHandler::CompositionEventHandler(
|
|
|
288
288
|
focusedComponent
|
|
289
289
|
? focusedComponent.Tag()
|
|
290
290
|
: static_cast<facebook::react::Tag>(
|
|
291
|
-
winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
291
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(
|
|
292
292
|
strongRootView)
|
|
293
|
-
->
|
|
293
|
+
->RootTag()),
|
|
294
294
|
args);
|
|
295
295
|
auto keyboardSource = winrt::make<CompositionInputKeyboardSource>(source);
|
|
296
296
|
onCharacterReceived(keyboardSource, charArgs);
|
|
@@ -323,7 +323,7 @@ CompositionEventHandler::~CompositionEventHandler() {
|
|
|
323
323
|
facebook::react::SurfaceId CompositionEventHandler::SurfaceId() const noexcept {
|
|
324
324
|
if (auto strongRootView = m_wkRootView.get()) {
|
|
325
325
|
return static_cast<facebook::react::SurfaceId>(
|
|
326
|
-
winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
326
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(strongRootView)->RootTag());
|
|
327
327
|
}
|
|
328
328
|
return -1;
|
|
329
329
|
}
|
|
@@ -456,11 +456,11 @@ int64_t CompositionEventHandler::SendMessage(HWND hwnd, uint32_t msg, uint64_t w
|
|
|
456
456
|
auto focusedComponent = RootComponentView().GetFocusedComponent();
|
|
457
457
|
auto args = winrt::make<
|
|
458
458
|
winrt::Microsoft::ReactNative::Composition::Input::implementation::CharacterReceivedRoutedEventArgs>(
|
|
459
|
-
focusedComponent
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
459
|
+
focusedComponent
|
|
460
|
+
? focusedComponent.Tag()
|
|
461
|
+
: static_cast<facebook::react::Tag>(
|
|
462
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(strongRootView)
|
|
463
|
+
->RootTag()),
|
|
464
464
|
msg,
|
|
465
465
|
wParam,
|
|
466
466
|
lParam);
|
|
@@ -477,11 +477,11 @@ int64_t CompositionEventHandler::SendMessage(HWND hwnd, uint32_t msg, uint64_t w
|
|
|
477
477
|
if (auto strongRootView = m_wkRootView.get()) {
|
|
478
478
|
auto focusedComponent = RootComponentView().GetFocusedComponent();
|
|
479
479
|
auto args = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::KeyRoutedEventArgs>(
|
|
480
|
-
focusedComponent
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
480
|
+
focusedComponent
|
|
481
|
+
? focusedComponent.Tag()
|
|
482
|
+
: static_cast<facebook::react::Tag>(
|
|
483
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(strongRootView)
|
|
484
|
+
->RootTag()),
|
|
485
485
|
msg,
|
|
486
486
|
wParam,
|
|
487
487
|
lParam);
|
|
@@ -31,7 +31,7 @@ class CompositionEventHandler {
|
|
|
31
31
|
public:
|
|
32
32
|
CompositionEventHandler(
|
|
33
33
|
const winrt::Microsoft::ReactNative::ReactContext &context,
|
|
34
|
-
const winrt::Microsoft::ReactNative::
|
|
34
|
+
const winrt::Microsoft::ReactNative::ReactNativeIsland &ReactNativeIsland);
|
|
35
35
|
virtual ~CompositionEventHandler();
|
|
36
36
|
|
|
37
37
|
int64_t SendMessage(HWND hwnd, uint32_t msg, uint64_t wParam, int64_t lParam) noexcept;
|
|
@@ -154,7 +154,7 @@ class CompositionEventHandler {
|
|
|
154
154
|
PointerId m_touchId = 0;
|
|
155
155
|
|
|
156
156
|
std::map<PointerId, std::vector<ReactTaggedView>> m_currentlyHoveredViewsPerPointer;
|
|
157
|
-
winrt::weak_ref<winrt::Microsoft::ReactNative::
|
|
157
|
+
winrt::weak_ref<winrt::Microsoft::ReactNative::ReactNativeIsland> m_wkRootView;
|
|
158
158
|
winrt::Microsoft::ReactNative::ReactContext m_context;
|
|
159
159
|
|
|
160
160
|
facebook::react::Tag m_pointerCapturingComponentTag{-1}; // Component that has captured input
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
#include <winrt/Microsoft.ReactNative.Composition.Experimental.h>
|
|
18
18
|
#include "CompositionRootAutomationProvider.h"
|
|
19
|
-
#include "
|
|
19
|
+
#include "ReactNativeIsland.h"
|
|
20
20
|
|
|
21
21
|
#if USE_WINUI3
|
|
22
22
|
#include <winrt/Microsoft.UI.Content.h>
|
|
@@ -39,7 +39,7 @@ void CompositionHwndHost::Initialize(uint64_t hwnd) noexcept {
|
|
|
39
39
|
if (auto liftedCompositor =
|
|
40
40
|
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerCompositor(
|
|
41
41
|
compositionContext)) {
|
|
42
|
-
m_compRootView = winrt::Microsoft::ReactNative::
|
|
42
|
+
m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland(liftedCompositor);
|
|
43
43
|
|
|
44
44
|
auto bridge = winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(
|
|
45
45
|
liftedCompositor, winrt::Microsoft::UI::GetWindowIdFromWindow(m_hwnd));
|
|
@@ -52,7 +52,7 @@ void CompositionHwndHost::Initialize(uint64_t hwnd) noexcept {
|
|
|
52
52
|
m_compRootView.ScaleFactor(ScaleFactor());
|
|
53
53
|
bridge.ResizePolicy(winrt::Microsoft::UI::Content::ContentSizePolicy::ResizeContentToParentWindow);
|
|
54
54
|
} else {
|
|
55
|
-
m_compRootView = winrt::Microsoft::ReactNative::
|
|
55
|
+
m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland();
|
|
56
56
|
m_compRootView.as<winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCompositionRootView>()
|
|
57
57
|
.SetWindow(reinterpret_cast<uint64_t>(m_hwnd));
|
|
58
58
|
|
|
@@ -101,8 +101,9 @@ void CompositionHwndHost::UpdateSize() noexcept {
|
|
|
101
101
|
static_cast<float>(m_width / ScaleFactor()), static_cast<float>(m_height / ScaleFactor())};
|
|
102
102
|
// Do not relayout when minimized
|
|
103
103
|
if (!IsIconic(m_hwnd)) {
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
winrt::Microsoft::ReactNative::LayoutConstraints constraints;
|
|
105
|
+
constraints.MinimumSize = constraints.MaximumSize = size;
|
|
106
|
+
m_compRootView.Arrange(constraints, {0, 0});
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
}
|
|
@@ -148,7 +149,7 @@ void CompositionHwndHost::ReactViewHost(ReactNative::IReactViewHost const &value
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
IInspectable CompositionHwndHost::UiaProvider() noexcept {
|
|
151
|
-
auto compRootView = winrt::get_self<implementation::
|
|
152
|
+
auto compRootView = winrt::get_self<implementation::ReactNativeIsland>(m_compRootView);
|
|
152
153
|
auto provider = compRootView->GetUiaProvider();
|
|
153
154
|
auto pRootProvider = static_cast<CompositionRootAutomationProvider *>(provider.as<IRawElementProviderSimple>().get());
|
|
154
155
|
if (pRootProvider != nullptr) {
|
|
@@ -33,7 +33,7 @@ struct CompositionHwndHost : CompositionHwndHostT<CompositionHwndHost> {
|
|
|
33
33
|
float ScaleFactor() noexcept;
|
|
34
34
|
|
|
35
35
|
HWND m_hwnd;
|
|
36
|
-
winrt::Microsoft::ReactNative::
|
|
36
|
+
winrt::Microsoft::ReactNative::ReactNativeIsland m_compRootView{nullptr};
|
|
37
37
|
LONG m_height{0};
|
|
38
38
|
LONG m_width{0};
|
|
39
39
|
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
#include <winrt/Microsoft.UI.Input.h>
|
|
9
9
|
#endif
|
|
10
10
|
|
|
11
|
-
#include <Fabric/Composition/
|
|
11
|
+
#include <Fabric/Composition/ReactNativeIsland.h>
|
|
12
12
|
|
|
13
13
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
14
14
|
|
|
15
15
|
CompositionRootAutomationProvider::CompositionRootAutomationProvider(
|
|
16
|
-
const winrt::Microsoft::ReactNative::
|
|
16
|
+
const winrt::Microsoft::ReactNative::ReactNativeIsland &rootView) noexcept
|
|
17
17
|
: m_wkRootView{rootView} {}
|
|
18
18
|
|
|
19
19
|
// Implementations should return NULL for a top-level element that is hosted in a window. Other elements should return
|
|
@@ -170,7 +170,7 @@ HRESULT __stdcall CompositionRootAutomationProvider::get_ProviderOptions(Provide
|
|
|
170
170
|
winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView *
|
|
171
171
|
CompositionRootAutomationProvider::rootComponentView() noexcept {
|
|
172
172
|
if (auto rootView = m_wkRootView.get()) {
|
|
173
|
-
auto innerRootView = winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
173
|
+
auto innerRootView = winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView);
|
|
174
174
|
if (auto view = innerRootView->GetComponentView()) {
|
|
175
175
|
return view;
|
|
176
176
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
#include <inspectable.h>
|
|
7
7
|
|
|
8
8
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
9
|
-
struct
|
|
9
|
+
struct ReactNativeIsland;
|
|
10
10
|
|
|
11
11
|
class CompositionRootAutomationProvider : public winrt::implements<
|
|
12
12
|
CompositionRootAutomationProvider,
|
|
@@ -39,7 +39,7 @@ class CompositionRootAutomationProvider : public winrt::implements<
|
|
|
39
39
|
virtual HRESULT __stdcall AdviseEventAdded(EVENTID idEvent, SAFEARRAY *psaProperties) override;
|
|
40
40
|
virtual HRESULT __stdcall AdviseEventRemoved(EVENTID idEvent, SAFEARRAY *psaProperties) override;
|
|
41
41
|
|
|
42
|
-
CompositionRootAutomationProvider(const winrt::Microsoft::ReactNative::
|
|
42
|
+
CompositionRootAutomationProvider(const winrt::Microsoft::ReactNative::ReactNativeIsland &rootView) noexcept;
|
|
43
43
|
|
|
44
44
|
void SetHwnd(HWND hwnd) noexcept;
|
|
45
45
|
#ifdef USE_WINUI3
|
|
@@ -72,7 +72,7 @@ class CompositionRootAutomationProvider : public winrt::implements<
|
|
|
72
72
|
// practice ATs tend to only listen to a dozen or so props and events, so std::vector is likely better than maps.
|
|
73
73
|
std::vector<AdvisedEvent> m_advisedEvents{};
|
|
74
74
|
std::vector<AdvisedEvent> m_advisedProperties{};
|
|
75
|
-
winrt::weak_ref<winrt::Microsoft::ReactNative::
|
|
75
|
+
winrt::weak_ref<winrt::Microsoft::ReactNative::ReactNativeIsland> m_wkRootView;
|
|
76
76
|
HWND m_hwnd{nullptr};
|
|
77
77
|
#ifdef USE_WINUI3
|
|
78
78
|
winrt::Microsoft::UI::Content::ContentIsland m_island{nullptr};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
#include <AutoDraw.h>
|
|
10
10
|
#include <Fabric/AbiState.h>
|
|
11
11
|
#include <Fabric/AbiViewProps.h>
|
|
12
|
-
#include <Fabric/Composition/
|
|
12
|
+
#include <Fabric/Composition/ReactNativeIsland.h>
|
|
13
13
|
#include <Fabric/FabricUIManagerModule.h>
|
|
14
14
|
#include <UI.Xaml.Controls.h>
|
|
15
15
|
#include <Utils/KeyboardUtils.h>
|
|
@@ -175,6 +175,10 @@ void ComponentView::updateLayoutMetrics(
|
|
|
175
175
|
base_type::updateLayoutMetrics(layoutMetrics, oldLayoutMetrics);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
const facebook::react::LayoutMetrics &ComponentView::layoutMetrics() const noexcept {
|
|
179
|
+
return m_layoutMetrics;
|
|
180
|
+
}
|
|
181
|
+
|
|
178
182
|
void ComponentView::FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept {
|
|
179
183
|
if ((m_flags & ComponentViewFeatures::NativeBorder) == ComponentViewFeatures::NativeBorder) {
|
|
180
184
|
finalizeBorderUpdates(m_layoutMetrics, *viewProps());
|
|
@@ -266,12 +270,12 @@ bool ComponentView::CapturePointer(const winrt::Microsoft::ReactNative::Composit
|
|
|
266
270
|
if (!root)
|
|
267
271
|
return false;
|
|
268
272
|
|
|
269
|
-
auto rootView
|
|
273
|
+
auto rootView{uiManager->GetReactNativeIsland(root->Tag())};
|
|
270
274
|
if (!rootView) {
|
|
271
275
|
return false;
|
|
272
276
|
}
|
|
273
277
|
|
|
274
|
-
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
278
|
+
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)->CapturePointer(
|
|
275
279
|
pointer, static_cast<facebook::react::Tag>(Tag()));
|
|
276
280
|
}
|
|
277
281
|
|
|
@@ -285,12 +289,12 @@ void ComponentView::ReleasePointerCapture(
|
|
|
285
289
|
if (!root)
|
|
286
290
|
return;
|
|
287
291
|
|
|
288
|
-
auto rootView
|
|
292
|
+
auto rootView{uiManager->GetReactNativeIsland(root->Tag())};
|
|
289
293
|
if (!rootView) {
|
|
290
294
|
return;
|
|
291
295
|
}
|
|
292
296
|
|
|
293
|
-
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::
|
|
297
|
+
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactNativeIsland>(rootView)
|
|
294
298
|
->ReleasePointerCapture(pointer, static_cast<facebook::react::Tag>(Tag()));
|
|
295
299
|
}
|
|
296
300
|
|
|
@@ -120,6 +120,8 @@ struct ComponentView
|
|
|
120
120
|
bool getAcccessiblityIsReadOnly() noexcept override;
|
|
121
121
|
virtual winrt::Microsoft::ReactNative::implementation::ClipState getClipState() noexcept;
|
|
122
122
|
|
|
123
|
+
const facebook::react::LayoutMetrics &layoutMetrics() const noexcept;
|
|
124
|
+
|
|
123
125
|
virtual std::string DefaultControlType() const noexcept;
|
|
124
126
|
virtual std::string DefaultAccessibleName() const noexcept;
|
|
125
127
|
virtual std::string DefaultHelpText() const noexcept;
|