react-native-windows 0.74.20 → 0.74.22
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/Microsoft.ReactNative/ComponentView.idl +44 -32
- package/Microsoft.ReactNative/Composition.Input.idl +3 -0
- package/Microsoft.ReactNative/CompositionComponentView.idl +43 -24
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiEventEmitter.cpp +21 -0
- package/Microsoft.ReactNative/Fabric/AbiEventEmitter.h +23 -0
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.cpp +7 -0
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +3 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +334 -65
- package/Microsoft.ReactNative/Fabric/ComponentView.h +162 -38
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +29 -7
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +23 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +118 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +12 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +147 -119
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +4 -8
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +129 -106
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +31 -54
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +133 -0
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +61 -0
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +9 -8
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +1 -4
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +3 -5
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +1 -6
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +108 -18
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +33 -5
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +137 -56
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +21 -4
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +45 -10
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +9 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +209 -189
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +2 -5
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +22 -10
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +4 -5
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +115 -168
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +11 -14
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +14 -11
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +12 -4
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +338 -0
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.h +66 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +56 -4
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +7 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +2 -4
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +40 -9
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +4 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +1 -3
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +25 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +4 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +9 -2
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +13 -3
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +64 -4
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +104 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +78 -0
- package/Microsoft.ReactNative/ReactCoreInjection.h +0 -1
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +17 -1
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
- package/Microsoft.ReactNative/Timer.idl +1 -1
- package/Microsoft.ReactNative/packages.lock.json +0 -10
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/WinUI.props +1 -1
- package/Shared/Shared.vcxitems +43 -0
- package/Shared/Shared.vcxitems.filters +3 -0
- package/Shared/TurboModuleManager.cpp +0 -3
- package/just-task.js +1 -1
- package/package.json +3 -3
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +1 -0
|
@@ -102,6 +102,7 @@ void CompositionHwndHost::UpdateSize() noexcept {
|
|
|
102
102
|
// Do not relayout when minimized
|
|
103
103
|
if (!IsIconic(m_hwnd)) {
|
|
104
104
|
winrt::Microsoft::ReactNative::LayoutConstraints constraints;
|
|
105
|
+
constraints.LayoutDirection = winrt::Microsoft::ReactNative::LayoutDirection::Undefined;
|
|
105
106
|
constraints.MinimumSize = constraints.MaximumSize = size;
|
|
106
107
|
m_compRootView.Arrange(constraints, {0, 0});
|
|
107
108
|
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
#include "CompositionHelpers.h"
|
|
24
24
|
#include "RootComponentView.h"
|
|
25
25
|
#include "Theme.h"
|
|
26
|
+
#include "TooltipService.h"
|
|
26
27
|
#include "UiaHelpers.h"
|
|
27
28
|
#include "d2d1helper.h"
|
|
28
29
|
|
|
@@ -31,52 +32,25 @@
|
|
|
31
32
|
|
|
32
33
|
namespace winrt::Microsoft::ReactNative::Composition::implementation {
|
|
33
34
|
|
|
34
|
-
CreateCompositionComponentViewArgs::CreateCompositionComponentViewArgs(
|
|
35
|
-
const winrt::Microsoft::ReactNative::IReactContext &reactContext,
|
|
36
|
-
facebook::react::Tag tag,
|
|
37
|
-
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compositionContext)
|
|
38
|
-
: base_type(reactContext, tag), m_compositionContext(compositionContext){};
|
|
39
|
-
|
|
40
|
-
winrt::Microsoft::UI::Composition::Compositor CreateCompositionComponentViewArgs::Compositor() const noexcept {
|
|
41
|
-
return winrt::Microsoft::ReactNative::Composition::CompositionUIService::GetCompositor(ReactContext().Properties());
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext
|
|
45
|
-
CreateCompositionComponentViewArgs::CompositionContext() const noexcept {
|
|
46
|
-
return m_compositionContext;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
ComponentViewFeatures CreateCompositionComponentViewArgs::Features() const noexcept {
|
|
50
|
-
return m_features;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
void CreateCompositionComponentViewArgs::Features(ComponentViewFeatures value) noexcept {
|
|
54
|
-
m_features = value;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ComponentView::ComponentView(const winrt::Microsoft::ReactNative::Composition::CreateCompositionComponentViewArgs &args)
|
|
58
|
-
: ComponentView(
|
|
59
|
-
winrt::get_self<
|
|
60
|
-
winrt::Microsoft::ReactNative::Composition::implementation::CreateCompositionComponentViewArgs>(args)
|
|
61
|
-
->CompositionContext(),
|
|
62
|
-
args.Tag(),
|
|
63
|
-
args.ReactContext(),
|
|
64
|
-
args.Features(),
|
|
65
|
-
true) {}
|
|
66
|
-
|
|
67
35
|
ComponentView::ComponentView(
|
|
68
36
|
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
|
|
69
37
|
facebook::react::Tag tag,
|
|
70
38
|
winrt::Microsoft::ReactNative::ReactContext const &reactContext,
|
|
71
|
-
ComponentViewFeatures flags
|
|
72
|
-
|
|
73
|
-
: base_type(tag, reactContext, customControl), m_compContext(compContext), m_flags(flags) {
|
|
39
|
+
ComponentViewFeatures flags)
|
|
40
|
+
: base_type(tag, reactContext), m_compContext(compContext), m_flags(flags) {
|
|
74
41
|
m_outerVisual = compContext.CreateSpriteVisual(); // TODO could be a raw ContainerVisual if we had a
|
|
75
42
|
// CreateContainerVisual in ICompositionContext
|
|
76
43
|
m_focusVisual = compContext.CreateFocusVisual();
|
|
77
44
|
m_outerVisual.InsertAt(m_focusVisual.InnerVisual(), 0);
|
|
78
45
|
}
|
|
79
46
|
|
|
47
|
+
ComponentView::~ComponentView() {
|
|
48
|
+
if (m_tooltipTracked) {
|
|
49
|
+
TooltipService::GetCurrent(m_reactContext.Properties())->StopTracking(*this);
|
|
50
|
+
m_tooltipTracked = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
80
54
|
facebook::react::Tag ComponentView::Tag() const noexcept {
|
|
81
55
|
return m_tag;
|
|
82
56
|
}
|
|
@@ -105,14 +79,18 @@ void ComponentView::onThemeChanged() noexcept {
|
|
|
105
79
|
|
|
106
80
|
base_type::onThemeChanged();
|
|
107
81
|
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
winrt::Microsoft::ReactNative::Composition::ComponentView outer(*this);
|
|
111
|
-
outer.OnThemeChanged();
|
|
82
|
+
if (m_themeChangedEvent) {
|
|
83
|
+
m_themeChangedEvent(*this, *this);
|
|
112
84
|
}
|
|
113
85
|
}
|
|
114
86
|
|
|
115
|
-
|
|
87
|
+
winrt::event_token ComponentView::ThemeChanged(
|
|
88
|
+
winrt::Windows::Foundation::EventHandler<winrt::IInspectable> const &handler) noexcept {
|
|
89
|
+
return m_themeChangedEvent.add(handler);
|
|
90
|
+
}
|
|
91
|
+
void ComponentView::ThemeChanged(winrt::event_token const &token) noexcept {
|
|
92
|
+
m_themeChangedEvent.remove(token);
|
|
93
|
+
}
|
|
116
94
|
|
|
117
95
|
void ComponentView::Theme(const winrt::Microsoft::ReactNative::Composition::Theme &value) noexcept {
|
|
118
96
|
theme(winrt::get_self<winrt::Microsoft::ReactNative::Composition::implementation::Theme>(value));
|
|
@@ -160,6 +138,16 @@ void ComponentView::updateProps(
|
|
|
160
138
|
updateShadowProps(oldViewProps, newViewProps);
|
|
161
139
|
}
|
|
162
140
|
|
|
141
|
+
if (oldViewProps.tooltip != newViewProps.tooltip) {
|
|
142
|
+
if (!m_tooltipTracked && newViewProps.tooltip) {
|
|
143
|
+
TooltipService::GetCurrent(m_reactContext.Properties())->StartTracking(*this);
|
|
144
|
+
m_tooltipTracked = true;
|
|
145
|
+
} else if (m_tooltipTracked && !newViewProps.tooltip) {
|
|
146
|
+
TooltipService::GetCurrent(m_reactContext.Properties())->StopTracking(*this);
|
|
147
|
+
m_tooltipTracked = false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
163
151
|
base_type::updateProps(props, oldProps);
|
|
164
152
|
}
|
|
165
153
|
|
|
@@ -170,10 +158,8 @@ void ComponentView::updateLayoutMetrics(
|
|
|
170
158
|
updateBorderLayoutMetrics(layoutMetrics, *viewProps());
|
|
171
159
|
}
|
|
172
160
|
|
|
173
|
-
m_layoutMetrics = layoutMetrics;
|
|
174
|
-
UpdateCenterPropertySet();
|
|
175
|
-
|
|
176
161
|
base_type::updateLayoutMetrics(layoutMetrics, oldLayoutMetrics);
|
|
162
|
+
UpdateCenterPropertySet();
|
|
177
163
|
}
|
|
178
164
|
|
|
179
165
|
const facebook::react::LayoutMetrics &ComponentView::layoutMetrics() const noexcept {
|
|
@@ -277,24 +263,29 @@ void ComponentView::StartBringIntoView(
|
|
|
277
263
|
|
|
278
264
|
void ComponentView::updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept {
|
|
279
265
|
m_eventEmitter = std::static_pointer_cast<facebook::react::ViewEventEmitter const>(eventEmitter);
|
|
266
|
+
base_type::updateEventEmitter(eventEmitter);
|
|
280
267
|
}
|
|
281
268
|
|
|
282
|
-
void ComponentView::HandleCommand(
|
|
283
|
-
|
|
284
|
-
|
|
269
|
+
void ComponentView::HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept {
|
|
270
|
+
base_type::HandleCommand(args);
|
|
271
|
+
if (args.Handled())
|
|
272
|
+
return;
|
|
273
|
+
|
|
274
|
+
auto commandName = args.CommandName();
|
|
285
275
|
if (commandName == L"focus") {
|
|
286
276
|
if (auto root = rootComponentView()) {
|
|
287
|
-
root->TrySetFocusedComponent(*get_strong());
|
|
277
|
+
root->TrySetFocusedComponent(*get_strong(), winrt::Microsoft::ReactNative::FocusNavigationDirection::None);
|
|
288
278
|
}
|
|
289
279
|
return;
|
|
290
280
|
}
|
|
291
281
|
if (commandName == L"blur") {
|
|
292
282
|
if (auto root = rootComponentView()) {
|
|
293
|
-
root->TrySetFocusedComponent(
|
|
283
|
+
root->TrySetFocusedComponent(
|
|
284
|
+
nullptr, winrt::Microsoft::ReactNative::FocusNavigationDirection::None); // Todo store this component as
|
|
285
|
+
// previously focused element
|
|
294
286
|
}
|
|
295
287
|
return;
|
|
296
288
|
}
|
|
297
|
-
assert(false); // Unhandled command
|
|
298
289
|
}
|
|
299
290
|
|
|
300
291
|
bool ComponentView::CapturePointer(const winrt::Microsoft::ReactNative::Composition::Input::Pointer &pointer) noexcept {
|
|
@@ -1318,11 +1309,32 @@ void ComponentView::updateAccessibilityProps(
|
|
|
1318
1309
|
!(oldViewProps.accessibilityState && oldViewProps.accessibilityState->disabled),
|
|
1319
1310
|
!(newViewProps.accessibilityState && newViewProps.accessibilityState->disabled));
|
|
1320
1311
|
|
|
1312
|
+
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
1313
|
+
m_uiaProvider,
|
|
1314
|
+
UIA_IsEnabledPropertyId,
|
|
1315
|
+
!(oldViewProps.accessibilityState && oldViewProps.accessibilityState->busy),
|
|
1316
|
+
!(newViewProps.accessibilityState && newViewProps.accessibilityState->busy));
|
|
1317
|
+
|
|
1321
1318
|
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
1322
1319
|
m_uiaProvider, UIA_ControlTypePropertyId, oldViewProps.accessibilityRole, newViewProps.accessibilityRole);
|
|
1323
1320
|
|
|
1324
1321
|
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
1325
1322
|
m_uiaProvider, UIA_HelpTextPropertyId, oldViewProps.accessibilityHint, newViewProps.accessibilityHint);
|
|
1323
|
+
|
|
1324
|
+
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
1325
|
+
m_uiaProvider,
|
|
1326
|
+
UIA_PositionInSetPropertyId,
|
|
1327
|
+
oldViewProps.accessibilityPosInSet,
|
|
1328
|
+
newViewProps.accessibilityPosInSet);
|
|
1329
|
+
|
|
1330
|
+
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
1331
|
+
m_uiaProvider, UIA_SizeOfSetPropertyId, oldViewProps.accessibilitySetSize, newViewProps.accessibilitySetSize);
|
|
1332
|
+
|
|
1333
|
+
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
1334
|
+
m_uiaProvider,
|
|
1335
|
+
UIA_LiveSettingPropertyId,
|
|
1336
|
+
oldViewProps.accessibilityLiveRegion,
|
|
1337
|
+
newViewProps.accessibilityLiveRegion);
|
|
1326
1338
|
}
|
|
1327
1339
|
|
|
1328
1340
|
std::optional<std::string> ComponentView::getAcccessiblityValue() noexcept {
|
|
@@ -1337,6 +1349,14 @@ bool ComponentView::getAcccessiblityIsReadOnly() noexcept {
|
|
|
1337
1349
|
return true;
|
|
1338
1350
|
}
|
|
1339
1351
|
|
|
1352
|
+
ToggleState ComponentView::getToggleState() noexcept {
|
|
1353
|
+
return ToggleState::ToggleState_Off;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
void ComponentView::Toggle() noexcept {
|
|
1357
|
+
// no-op
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1340
1360
|
void ComponentView::updateBorderLayoutMetrics(
|
|
1341
1361
|
facebook::react::LayoutMetrics const &layoutMetrics,
|
|
1342
1362
|
const facebook::react::ViewProps &viewProps) noexcept {
|
|
@@ -1483,18 +1503,6 @@ std::string ComponentView::DefaultHelpText() const noexcept {
|
|
|
1483
1503
|
return "";
|
|
1484
1504
|
}
|
|
1485
1505
|
|
|
1486
|
-
ViewComponentView::ViewComponentView(
|
|
1487
|
-
const winrt::Microsoft::ReactNative::Composition::CreateCompositionComponentViewArgs &args)
|
|
1488
|
-
: ViewComponentView(
|
|
1489
|
-
ViewComponentView::defaultProps(),
|
|
1490
|
-
winrt::get_self<
|
|
1491
|
-
winrt::Microsoft::ReactNative::Composition::implementation::CreateCompositionComponentViewArgs>(args)
|
|
1492
|
-
->CompositionContext(),
|
|
1493
|
-
args.Tag(),
|
|
1494
|
-
args.ReactContext(),
|
|
1495
|
-
args.Features(),
|
|
1496
|
-
true) {}
|
|
1497
|
-
|
|
1498
1506
|
facebook::react::SharedViewProps ViewComponentView::defaultProps() noexcept {
|
|
1499
1507
|
static auto const defaultViewProps = std::make_shared<facebook::react::ViewProps const>();
|
|
1500
1508
|
return defaultViewProps;
|
|
@@ -1505,33 +1513,42 @@ ViewComponentView::ViewComponentView(
|
|
|
1505
1513
|
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
|
|
1506
1514
|
facebook::react::Tag tag,
|
|
1507
1515
|
winrt::Microsoft::ReactNative::ReactContext const &reactContext,
|
|
1508
|
-
ComponentViewFeatures flags
|
|
1509
|
-
|
|
1510
|
-
: base_type(compContext, tag, reactContext, flags, customComponent),
|
|
1516
|
+
ComponentViewFeatures flags)
|
|
1517
|
+
: base_type(compContext, tag, reactContext, flags),
|
|
1511
1518
|
m_props(defaultProps ? defaultProps : ViewComponentView::defaultProps()) {}
|
|
1512
1519
|
|
|
1513
1520
|
winrt::Microsoft::ReactNative::Composition::Experimental::IVisual ViewComponentView::createVisual() noexcept {
|
|
1514
1521
|
return m_compContext.CreateSpriteVisual();
|
|
1515
1522
|
}
|
|
1516
1523
|
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1524
|
+
void ViewComponentView::CreateVisualHandler(
|
|
1525
|
+
const winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate &handler) {
|
|
1526
|
+
m_createVisualHandler = handler;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate ViewComponentView::CreateVisualHandler()
|
|
1530
|
+
const noexcept {
|
|
1531
|
+
return m_createVisualHandler;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
void ViewComponentView::CreateInternalVisualHandler(
|
|
1535
|
+
const winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate &handler) {
|
|
1536
|
+
m_createInternalVisualHandler = handler;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate
|
|
1540
|
+
ViewComponentView::CreateInternalVisualHandler() const noexcept {
|
|
1541
|
+
return m_createInternalVisualHandler;
|
|
1520
1542
|
}
|
|
1521
1543
|
|
|
1522
1544
|
void ViewComponentView::ensureVisual() noexcept {
|
|
1523
1545
|
if (!m_visual) {
|
|
1524
|
-
if (
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
} else {
|
|
1531
|
-
m_visual =
|
|
1532
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::CreateVisual(
|
|
1533
|
-
outer.CreateVisual());
|
|
1534
|
-
}
|
|
1546
|
+
if (m_createInternalVisualHandler) {
|
|
1547
|
+
m_visual = m_createInternalVisualHandler(*this);
|
|
1548
|
+
} else if (m_createVisualHandler) {
|
|
1549
|
+
m_visual =
|
|
1550
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::CreateVisual(
|
|
1551
|
+
m_createVisualHandler(*this));
|
|
1535
1552
|
} else {
|
|
1536
1553
|
m_visual = createVisual();
|
|
1537
1554
|
}
|
|
@@ -1544,7 +1561,7 @@ winrt::Microsoft::ReactNative::ComponentView ViewComponentView::Create(
|
|
|
1544
1561
|
facebook::react::Tag tag,
|
|
1545
1562
|
winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept {
|
|
1546
1563
|
return winrt::make<ViewComponentView>(
|
|
1547
|
-
ViewComponentView::defaultProps(), compContext, tag, reactContext, ComponentViewFeatures::Default
|
|
1564
|
+
ViewComponentView::defaultProps(), compContext, tag, reactContext, ComponentViewFeatures::Default);
|
|
1548
1565
|
}
|
|
1549
1566
|
|
|
1550
1567
|
void ViewComponentView::MountChildComponentView(
|
|
@@ -1555,10 +1572,20 @@ void ViewComponentView::MountChildComponentView(
|
|
|
1555
1572
|
indexOffsetForBorder(index);
|
|
1556
1573
|
ensureVisual();
|
|
1557
1574
|
|
|
1558
|
-
// TODO if we get mixed children of composition and non-composition ComponentViews the indexes will get mixed up
|
|
1559
|
-
// We could offset the index based on non-composition children in m_children
|
|
1560
1575
|
if (auto compositionChild = childComponentView.try_as<ComponentView>()) {
|
|
1561
|
-
|
|
1576
|
+
auto visualIndex = index;
|
|
1577
|
+
// Most of the time child index will align with visual index.
|
|
1578
|
+
// But if we have non-visual children, we need to account for that.
|
|
1579
|
+
if (m_hasNonVisualChildren) {
|
|
1580
|
+
for (uint32_t i = 0; i <= index; i++) {
|
|
1581
|
+
if (!m_children.GetAt(i).try_as<ComponentView>()) {
|
|
1582
|
+
visualIndex--;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
Visual().InsertAt(compositionChild->OuterVisual(), visualIndex);
|
|
1587
|
+
} else {
|
|
1588
|
+
m_hasNonVisualChildren = true;
|
|
1562
1589
|
}
|
|
1563
1590
|
}
|
|
1564
1591
|
|
|
@@ -1597,7 +1624,6 @@ void ViewComponentView::updateProps(
|
|
|
1597
1624
|
|
|
1598
1625
|
const winrt::Microsoft::ReactNative::IComponentProps ViewComponentView::userProps(
|
|
1599
1626
|
facebook::react::Props::Shared const &props) noexcept {
|
|
1600
|
-
assert(m_customComponent);
|
|
1601
1627
|
const auto &abiViewProps = *std::static_pointer_cast<const ::Microsoft::ReactNative::AbiViewProps>(props);
|
|
1602
1628
|
return abiViewProps.UserProps();
|
|
1603
1629
|
}
|
|
@@ -1663,22 +1689,21 @@ std::string CodeFromVirtualKey(
|
|
|
1663
1689
|
}
|
|
1664
1690
|
|
|
1665
1691
|
void ViewComponentView::OnKeyDown(
|
|
1666
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyboardSource &source,
|
|
1667
1692
|
const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept {
|
|
1668
|
-
auto eventCode = CodeFromVirtualKey(
|
|
1693
|
+
auto eventCode = CodeFromVirtualKey(args.KeyboardSource(), args.Key());
|
|
1669
1694
|
bool fShift =
|
|
1670
|
-
(
|
|
1695
|
+
(args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Shift) &
|
|
1671
1696
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
|
|
1672
1697
|
bool fAlt =
|
|
1673
|
-
(
|
|
1698
|
+
(args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Menu) &
|
|
1674
1699
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
|
|
1675
1700
|
bool fCtrl =
|
|
1676
|
-
(
|
|
1701
|
+
(args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Control) &
|
|
1677
1702
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
|
|
1678
1703
|
bool fMeta =
|
|
1679
|
-
((
|
|
1704
|
+
((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::LeftWindows) &
|
|
1680
1705
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ||
|
|
1681
|
-
((
|
|
1706
|
+
((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::RightWindows) &
|
|
1682
1707
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down);
|
|
1683
1708
|
|
|
1684
1709
|
if (args.OriginalSource() == Tag() && !args.Handled()) {
|
|
@@ -1691,7 +1716,7 @@ void ViewComponentView::OnKeyDown(
|
|
|
1691
1716
|
event.key = ::Microsoft::ReactNative::FromVirtualKey(
|
|
1692
1717
|
args.Key(),
|
|
1693
1718
|
event.shiftKey,
|
|
1694
|
-
!!((
|
|
1719
|
+
!!((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::CapitalLock) &
|
|
1695
1720
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Locked) ==
|
|
1696
1721
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Locked));
|
|
1697
1722
|
event.code = eventCode;
|
|
@@ -1707,26 +1732,25 @@ void ViewComponentView::OnKeyDown(
|
|
|
1707
1732
|
}
|
|
1708
1733
|
}
|
|
1709
1734
|
|
|
1710
|
-
base_type::OnKeyDown(
|
|
1735
|
+
base_type::OnKeyDown(args);
|
|
1711
1736
|
}
|
|
1712
1737
|
|
|
1713
1738
|
void ViewComponentView::OnKeyUp(
|
|
1714
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyboardSource &source,
|
|
1715
1739
|
const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept {
|
|
1716
|
-
auto eventCode = CodeFromVirtualKey(
|
|
1740
|
+
auto eventCode = CodeFromVirtualKey(args.KeyboardSource(), args.Key());
|
|
1717
1741
|
bool fShift =
|
|
1718
|
-
(
|
|
1742
|
+
(args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Shift) &
|
|
1719
1743
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
|
|
1720
1744
|
bool fAlt =
|
|
1721
|
-
(
|
|
1745
|
+
(args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Menu) &
|
|
1722
1746
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
|
|
1723
1747
|
bool fCtrl =
|
|
1724
|
-
(
|
|
1748
|
+
(args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::Control) &
|
|
1725
1749
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down;
|
|
1726
1750
|
bool fMeta =
|
|
1727
|
-
((
|
|
1751
|
+
((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::LeftWindows) &
|
|
1728
1752
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ||
|
|
1729
|
-
((
|
|
1753
|
+
((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::RightWindows) &
|
|
1730
1754
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down);
|
|
1731
1755
|
|
|
1732
1756
|
if (args.OriginalSource() == Tag()) {
|
|
@@ -1739,7 +1763,7 @@ void ViewComponentView::OnKeyUp(
|
|
|
1739
1763
|
event.key = ::Microsoft::ReactNative::FromVirtualKey(
|
|
1740
1764
|
args.Key(),
|
|
1741
1765
|
event.shiftKey,
|
|
1742
|
-
!!((
|
|
1766
|
+
!!((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::CapitalLock) &
|
|
1743
1767
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) ==
|
|
1744
1768
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down));
|
|
1745
1769
|
event.code = eventCode;
|
|
@@ -1755,7 +1779,7 @@ void ViewComponentView::OnKeyUp(
|
|
|
1755
1779
|
}
|
|
1756
1780
|
}
|
|
1757
1781
|
|
|
1758
|
-
base_type::OnKeyUp(
|
|
1782
|
+
base_type::OnKeyUp(args);
|
|
1759
1783
|
}
|
|
1760
1784
|
|
|
1761
1785
|
void ViewComponentView::updateLayoutMetrics(
|
|
@@ -1767,10 +1791,9 @@ void ViewComponentView::updateLayoutMetrics(
|
|
|
1767
1791
|
}
|
|
1768
1792
|
ensureVisual();
|
|
1769
1793
|
base_type::updateLayoutMetrics(layoutMetrics, oldLayoutMetrics);
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
Visual().Size({metrics.Frame.Width * metrics.PointScaleFactor, metrics.Frame.Height * metrics.PointScaleFactor});
|
|
1794
|
+
Visual().Size(
|
|
1795
|
+
{layoutMetrics.frame.size.width * layoutMetrics.pointScaleFactor,
|
|
1796
|
+
layoutMetrics.frame.size.height * layoutMetrics.pointScaleFactor});
|
|
1774
1797
|
}
|
|
1775
1798
|
|
|
1776
1799
|
void ViewComponentView::prepareForRecycle() noexcept {}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
#include "CompositionHelpers.h"
|
|
12
12
|
|
|
13
13
|
#include "Composition.ComponentView.g.h"
|
|
14
|
-
#include "Composition.CreateCompositionComponentViewArgs.g.h"
|
|
15
14
|
#include "Composition.ViewComponentView.g.h"
|
|
16
15
|
|
|
17
16
|
namespace Microsoft::ReactNative {
|
|
@@ -20,39 +19,18 @@ struct CompContext;
|
|
|
20
19
|
|
|
21
20
|
namespace winrt::Microsoft::ReactNative::Composition::implementation {
|
|
22
21
|
|
|
23
|
-
struct
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCreateComponentViewArgs> {
|
|
28
|
-
CreateCompositionComponentViewArgs(
|
|
29
|
-
const winrt::Microsoft::ReactNative::IReactContext &reactContext,
|
|
30
|
-
facebook::react::Tag tag,
|
|
31
|
-
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compositionContext);
|
|
32
|
-
|
|
33
|
-
winrt::Microsoft::UI::Composition::Compositor Compositor() const noexcept;
|
|
34
|
-
|
|
35
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext CompositionContext() const noexcept;
|
|
36
|
-
|
|
37
|
-
ComponentViewFeatures Features() const noexcept;
|
|
38
|
-
void Features(ComponentViewFeatures value) noexcept;
|
|
39
|
-
|
|
40
|
-
private:
|
|
41
|
-
ComponentViewFeatures m_features{ComponentViewFeatures::Default};
|
|
42
|
-
winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext m_compositionContext;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
struct ComponentView
|
|
46
|
-
: public ComponentViewT<ComponentView, winrt::Microsoft::ReactNative::implementation::ComponentView> {
|
|
22
|
+
struct ComponentView : public ComponentViewT<
|
|
23
|
+
ComponentView,
|
|
24
|
+
winrt::Microsoft::ReactNative::implementation::ComponentView,
|
|
25
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::IInternalComponentView> {
|
|
47
26
|
static constexpr size_t SpecialBorderLayerCount = 8;
|
|
48
27
|
|
|
49
|
-
ComponentView(winrt::Microsoft::ReactNative::Composition::CreateCompositionComponentViewArgs const &args);
|
|
50
28
|
ComponentView(
|
|
51
29
|
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
|
|
52
30
|
facebook::react::Tag tag,
|
|
53
31
|
winrt::Microsoft::ReactNative::ReactContext const &reactContext,
|
|
54
|
-
ComponentViewFeatures flags
|
|
55
|
-
|
|
32
|
+
ComponentViewFeatures flags);
|
|
33
|
+
virtual ~ComponentView();
|
|
56
34
|
|
|
57
35
|
virtual winrt::Microsoft::ReactNative::Composition::Experimental::IVisual Visual() const noexcept {
|
|
58
36
|
return nullptr;
|
|
@@ -61,8 +39,7 @@ struct ComponentView
|
|
|
61
39
|
virtual winrt::Microsoft::ReactNative::Composition::Experimental::IVisual OuterVisual() const noexcept;
|
|
62
40
|
void updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept override;
|
|
63
41
|
const facebook::react::SharedViewEventEmitter &GetEventEmitter() const noexcept;
|
|
64
|
-
void HandleCommand(
|
|
65
|
-
override;
|
|
42
|
+
void HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept override;
|
|
66
43
|
facebook::react::Props::Shared props() noexcept override;
|
|
67
44
|
virtual const facebook::react::SharedViewProps &viewProps() const noexcept {
|
|
68
45
|
static facebook::react::SharedViewProps emptyProps;
|
|
@@ -118,6 +95,8 @@ struct ComponentView
|
|
|
118
95
|
std::optional<std::string> getAcccessiblityValue() noexcept override;
|
|
119
96
|
void setAcccessiblityValue(std::string &&value) noexcept override;
|
|
120
97
|
bool getAcccessiblityIsReadOnly() noexcept override;
|
|
98
|
+
ToggleState getToggleState() noexcept override;
|
|
99
|
+
void Toggle() noexcept override;
|
|
121
100
|
virtual winrt::Microsoft::ReactNative::implementation::ClipState getClipState() noexcept;
|
|
122
101
|
|
|
123
102
|
const facebook::react::LayoutMetrics &layoutMetrics() const noexcept;
|
|
@@ -129,9 +108,10 @@ struct ComponentView
|
|
|
129
108
|
winrt::Microsoft::UI::Composition::Compositor Compositor() const noexcept;
|
|
130
109
|
winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext CompositionContext() const noexcept;
|
|
131
110
|
|
|
132
|
-
// Publicaly overridable APIs
|
|
133
111
|
void FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept override;
|
|
134
|
-
|
|
112
|
+
winrt::event_token ThemeChanged(
|
|
113
|
+
winrt::Windows::Foundation::EventHandler<winrt::IInspectable> const &handler) noexcept;
|
|
114
|
+
void ThemeChanged(winrt::event_token const &token) noexcept;
|
|
135
115
|
|
|
136
116
|
protected:
|
|
137
117
|
bool anyHitTestHelper(
|
|
@@ -143,7 +123,6 @@ struct ComponentView
|
|
|
143
123
|
winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext m_compContext;
|
|
144
124
|
comp::CompositionPropertySet m_centerPropSet{nullptr};
|
|
145
125
|
facebook::react::SharedViewEventEmitter m_eventEmitter;
|
|
146
|
-
facebook::react::LayoutMetrics m_layoutMetrics;
|
|
147
126
|
bool m_needsBorderUpdate{false};
|
|
148
127
|
bool m_hasTransformMatrixFacade{false};
|
|
149
128
|
bool m_enableFocusVisual{false};
|
|
@@ -173,14 +152,18 @@ struct ComponentView
|
|
|
173
152
|
const facebook::react::ViewProps &viewProps) noexcept;
|
|
174
153
|
|
|
175
154
|
bool m_FinalizeTransform{false};
|
|
155
|
+
bool m_tooltipTracked{false};
|
|
176
156
|
ComponentViewFeatures m_flags;
|
|
177
157
|
void showFocusVisual(bool show) noexcept;
|
|
178
158
|
winrt::Microsoft::ReactNative::Composition::Experimental::IFocusVisual m_focusVisual{nullptr};
|
|
179
159
|
winrt::Microsoft::ReactNative::Composition::Experimental::IVisual m_outerVisual{nullptr};
|
|
160
|
+
winrt::event<winrt::Windows::Foundation::EventHandler<winrt::IInspectable>> m_themeChangedEvent;
|
|
180
161
|
};
|
|
181
162
|
|
|
182
|
-
struct ViewComponentView : public ViewComponentViewT<
|
|
183
|
-
|
|
163
|
+
struct ViewComponentView : public ViewComponentViewT<
|
|
164
|
+
ViewComponentView,
|
|
165
|
+
ComponentView,
|
|
166
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCreateVisual> {
|
|
184
167
|
[[nodiscard]] static winrt::Microsoft::ReactNative::ComponentView Create(
|
|
185
168
|
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
|
|
186
169
|
facebook::react::Tag tag,
|
|
@@ -200,12 +183,8 @@ struct ViewComponentView : public ViewComponentViewT<ViewComponentView, Componen
|
|
|
200
183
|
void prepareForRecycle() noexcept override;
|
|
201
184
|
bool TryFocus() noexcept;
|
|
202
185
|
bool focusable() const noexcept override;
|
|
203
|
-
void OnKeyDown(
|
|
204
|
-
|
|
205
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
206
|
-
void OnKeyUp(
|
|
207
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyboardSource &source,
|
|
208
|
-
const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
186
|
+
void OnKeyDown(const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
187
|
+
void OnKeyUp(const winrt::Microsoft::ReactNative::Composition::Input::KeyRoutedEventArgs &args) noexcept override;
|
|
209
188
|
std::string DefaultControlType() const noexcept override;
|
|
210
189
|
|
|
211
190
|
const facebook::react::SharedViewProps &viewProps() const noexcept override;
|
|
@@ -227,29 +206,27 @@ struct ViewComponentView : public ViewComponentViewT<ViewComponentView, Componen
|
|
|
227
206
|
const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext,
|
|
228
207
|
facebook::react::Tag tag,
|
|
229
208
|
winrt::Microsoft::ReactNative::ReactContext const &reactContext,
|
|
230
|
-
ComponentViewFeatures flags
|
|
231
|
-
bool customComponent);
|
|
209
|
+
ComponentViewFeatures flags);
|
|
232
210
|
|
|
233
211
|
virtual winrt::Microsoft::ReactNative::Composition::Experimental::IVisual createVisual() noexcept;
|
|
234
212
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
213
|
+
void CreateVisualHandler(const winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate &handler);
|
|
214
|
+
winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate CreateVisualHandler() const noexcept;
|
|
215
|
+
void CreateInternalVisualHandler(
|
|
216
|
+
const winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate &handler);
|
|
217
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate CreateInternalVisualHandler()
|
|
218
|
+
const noexcept;
|
|
238
219
|
|
|
239
220
|
protected:
|
|
240
221
|
virtual winrt::Microsoft::ReactNative::ViewProps ViewPropsInner() noexcept;
|
|
241
222
|
|
|
242
223
|
private:
|
|
224
|
+
bool m_hasNonVisualChildren{false};
|
|
243
225
|
facebook::react::SharedViewProps m_props;
|
|
244
226
|
winrt::Microsoft::ReactNative::Composition::Experimental::IVisual m_visual{nullptr};
|
|
227
|
+
winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate m_createVisualHandler{nullptr};
|
|
228
|
+
winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate m_createInternalVisualHandler{
|
|
229
|
+
nullptr};
|
|
245
230
|
};
|
|
246
231
|
|
|
247
232
|
} // namespace winrt::Microsoft::ReactNative::Composition::implementation
|
|
248
|
-
|
|
249
|
-
namespace winrt::Microsoft::ReactNative::Composition::factory_implementation {
|
|
250
|
-
|
|
251
|
-
struct ComponentView : ComponentViewT<ComponentView, implementation::ComponentView> {};
|
|
252
|
-
|
|
253
|
-
struct ViewComponentView : ViewComponentViewT<ViewComponentView, implementation::ViewComponentView> {};
|
|
254
|
-
|
|
255
|
-
} // namespace winrt::Microsoft::ReactNative::Composition::factory_implementation
|