react-native-windows 0.81.1 → 0.81.3
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/Components/Pressable/Pressable.d.ts +8 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +21 -2
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +26 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.cpp +2 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.h +1 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +65 -32
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +9 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.cpp +4 -7
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextProvider.h +1 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +68 -53
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.h +1 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +18 -14
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +10 -3
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +30 -8
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +3 -2
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +550 -4
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +53 -2
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +8 -1
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +3 -1
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +28 -10
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +2 -1
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -0
- package/Microsoft.ReactNative/Utils/IcuUtils.cpp +84 -0
- package/Microsoft.ReactNative/Utils/IcuUtils.h +42 -0
- package/Microsoft.ReactNative.Cxx/StructInfo.h +8 -1
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Shared/Shared.vcxitems +1 -0
- package/Shared/Shared.vcxitems.filters +1 -0
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +14 -0
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +14 -0
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +14 -0
- package/codegen/react/components/rnwcore/InputAccessory.g.h +14 -0
- package/codegen/react/components/rnwcore/ModalHostView.g.h +14 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +14 -0
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +14 -0
- package/codegen/react/components/rnwcore/Switch.g.h +14 -0
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +14 -0
- package/codegen/react/components/rnwcore/VirtualView.g.h +14 -0
- package/package.json +4 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
|
-
#include <Fabric/Composition/CompositionDynamicAutomationProvider.h>
|
|
4
3
|
#include <Fabric/Composition/CompositionTextProvider.h>
|
|
5
4
|
#include <Fabric/Composition/CompositionViewComponentView.h>
|
|
6
5
|
#include <Fabric/ReactTaggedView.h>
|
|
@@ -12,9 +11,7 @@ namespace winrt::Microsoft::ReactNative::implementation {
|
|
|
12
11
|
|
|
13
12
|
class CompositionTextRangeProvider : public winrt::implements<CompositionTextRangeProvider, ITextRangeProvider> {
|
|
14
13
|
public:
|
|
15
|
-
CompositionTextRangeProvider(
|
|
16
|
-
const winrt::Microsoft::ReactNative::Composition::ComponentView &componentView,
|
|
17
|
-
CompositionDynamicAutomationProvider *parentProvider) noexcept;
|
|
14
|
+
CompositionTextRangeProvider(const winrt::Microsoft::ReactNative::ComponentView &componentView) noexcept;
|
|
18
15
|
|
|
19
16
|
// inherited via ITextRangeProvider
|
|
20
17
|
virtual HRESULT __stdcall Clone(ITextRangeProvider **pRetVal) override;
|
|
@@ -53,7 +50,6 @@ class CompositionTextRangeProvider : public winrt::implements<CompositionTextRan
|
|
|
53
50
|
|
|
54
51
|
private:
|
|
55
52
|
::Microsoft::ReactNative::ReactTaggedView m_view;
|
|
56
|
-
winrt::com_ptr<CompositionDynamicAutomationProvider> m_parentProvider;
|
|
57
53
|
};
|
|
58
54
|
|
|
59
55
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -801,8 +801,8 @@ void ComponentView::updateAccessibilityProps(
|
|
|
801
801
|
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
802
802
|
EnsureUiaProvider(),
|
|
803
803
|
UIA_LiveSettingPropertyId,
|
|
804
|
-
oldViewProps.accessibilityLiveRegion,
|
|
805
|
-
newViewProps.accessibilityLiveRegion);
|
|
804
|
+
winrt::Microsoft::ReactNative::implementation::GetLiveSetting(oldViewProps.accessibilityLiveRegion),
|
|
805
|
+
winrt::Microsoft::ReactNative::implementation::GetLiveSetting(newViewProps.accessibilityLiveRegion));
|
|
806
806
|
|
|
807
807
|
winrt::Microsoft::ReactNative::implementation::UpdateUiaProperty(
|
|
808
808
|
EnsureUiaProvider(), UIA_LevelPropertyId, oldViewProps.accessibilityLevel, newViewProps.accessibilityLevel);
|
|
@@ -857,14 +857,13 @@ void ComponentView::updateAccessibilityProps(
|
|
|
857
857
|
|
|
858
858
|
if ((oldViewProps.accessibilityState.has_value() && oldViewProps.accessibilityState->selected.has_value()) !=
|
|
859
859
|
((newViewProps.accessibilityState.has_value() && newViewProps.accessibilityState->selected.has_value()))) {
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
.try_as<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>();
|
|
863
|
-
if (compProvider) {
|
|
860
|
+
EnsureUiaProvider();
|
|
861
|
+
if (m_innerAutomationProvider) {
|
|
864
862
|
if ((newViewProps.accessibilityState.has_value() && newViewProps.accessibilityState->selected.has_value())) {
|
|
865
|
-
winrt::Microsoft::ReactNative::implementation::AddSelectionItemsToContainer(
|
|
863
|
+
winrt::Microsoft::ReactNative::implementation::AddSelectionItemsToContainer(m_innerAutomationProvider.get());
|
|
866
864
|
} else {
|
|
867
|
-
winrt::Microsoft::ReactNative::implementation::RemoveSelectionItemsFromContainer(
|
|
865
|
+
winrt::Microsoft::ReactNative::implementation::RemoveSelectionItemsFromContainer(
|
|
866
|
+
m_innerAutomationProvider.get());
|
|
868
867
|
}
|
|
869
868
|
}
|
|
870
869
|
}
|
|
@@ -1354,12 +1353,17 @@ std::string ViewComponentView::DefaultControlType() const noexcept {
|
|
|
1354
1353
|
return "group";
|
|
1355
1354
|
}
|
|
1356
1355
|
|
|
1357
|
-
winrt::IInspectable ComponentView::
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
return
|
|
1356
|
+
winrt::Windows::Foundation::IInspectable ComponentView::CreateAutomationProvider() noexcept {
|
|
1357
|
+
Assert(!m_innerAutomationProvider);
|
|
1358
|
+
m_innerAutomationProvider =
|
|
1359
|
+
winrt::make_self<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>(
|
|
1360
|
+
*get_strong());
|
|
1361
|
+
return *m_innerAutomationProvider;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
const winrt::com_ptr<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>
|
|
1365
|
+
&ComponentView::InnerAutomationProvider() const noexcept {
|
|
1366
|
+
return m_innerAutomationProvider;
|
|
1363
1367
|
}
|
|
1364
1368
|
|
|
1365
1369
|
bool IntersectRect(RECT *prcDst, const RECT &prcSrc1, const RECT &prcSrc2) {
|
|
@@ -19,8 +19,11 @@ namespace Microsoft::ReactNative {
|
|
|
19
19
|
struct CompContext;
|
|
20
20
|
} // namespace Microsoft::ReactNative
|
|
21
21
|
|
|
22
|
-
namespace winrt::Microsoft::ReactNative::
|
|
22
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
23
|
+
class CompositionDynamicAutomationProvider;
|
|
24
|
+
}
|
|
23
25
|
|
|
26
|
+
namespace winrt::Microsoft::ReactNative::Composition::implementation {
|
|
24
27
|
struct FocusPrimitive {
|
|
25
28
|
std::shared_ptr<BorderPrimitive> m_focusInnerPrimitive;
|
|
26
29
|
std::shared_ptr<BorderPrimitive> m_focusOuterPrimitive;
|
|
@@ -100,7 +103,9 @@ struct ComponentView : public ComponentViewT<
|
|
|
100
103
|
comp::CompositionPropertySet EnsureCenterPointPropertySet() noexcept;
|
|
101
104
|
void EnsureTransformMatrixFacade() noexcept;
|
|
102
105
|
|
|
103
|
-
winrt::IInspectable
|
|
106
|
+
winrt::Windows::Foundation::IInspectable CreateAutomationProvider() noexcept override;
|
|
107
|
+
const winrt::com_ptr<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>
|
|
108
|
+
&InnerAutomationProvider() const noexcept;
|
|
104
109
|
std::optional<std::string> getAccessiblityValue() noexcept override;
|
|
105
110
|
void setAcccessiblityValue(std::string &&value) noexcept override;
|
|
106
111
|
bool getAcccessiblityIsReadOnly() noexcept override;
|
|
@@ -130,7 +135,9 @@ struct ComponentView : public ComponentViewT<
|
|
|
130
135
|
facebook::react::Point &ptContent,
|
|
131
136
|
facebook::react::Point &localPt) const noexcept;
|
|
132
137
|
|
|
133
|
-
|
|
138
|
+
// Most access should be through EnsureUIAProvider, instead of direct access to this.
|
|
139
|
+
winrt::com_ptr<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>
|
|
140
|
+
m_innerAutomationProvider;
|
|
134
141
|
winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext m_compContext;
|
|
135
142
|
comp::CompositionPropertySet m_centerPropSet{nullptr};
|
|
136
143
|
facebook::react::SharedViewEventEmitter m_eventEmitter;
|
|
@@ -111,12 +111,11 @@ void ContentIslandComponentView::ParentLayoutChanged() noexcept {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
winrt::IInspectable ContentIslandComponentView::
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return m_uiaProvider;
|
|
114
|
+
winrt::Windows::Foundation::IInspectable ContentIslandComponentView::CreateAutomationProvider() noexcept {
|
|
115
|
+
m_innerAutomationProvider =
|
|
116
|
+
winrt::make_self<winrt::Microsoft::ReactNative::implementation::CompositionDynamicAutomationProvider>(
|
|
117
|
+
*get_strong(), m_childSiteLink);
|
|
118
|
+
return *m_innerAutomationProvider;
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
bool ContentIslandComponentView::focusable() const noexcept {
|
|
@@ -126,6 +125,27 @@ bool ContentIslandComponentView::focusable() const noexcept {
|
|
|
126
125
|
return true;
|
|
127
126
|
}
|
|
128
127
|
|
|
128
|
+
facebook::react::Tag ContentIslandComponentView::hitTest(
|
|
129
|
+
facebook::react::Point pt,
|
|
130
|
+
facebook::react::Point &localPt,
|
|
131
|
+
bool ignorePointerEvents) const noexcept {
|
|
132
|
+
facebook::react::Point ptLocal{pt.x - m_layoutMetrics.frame.origin.x, pt.y - m_layoutMetrics.frame.origin.y};
|
|
133
|
+
|
|
134
|
+
// Check if the point is within the bounds of this ContentIslandComponentView.
|
|
135
|
+
// This ensures that hit tests correctly return this view's tag for UIA purposes,
|
|
136
|
+
// even when the actual content (XAML buttons, etc.) is hosted in the ContentIsland.
|
|
137
|
+
auto props = viewProps();
|
|
138
|
+
if ((ignorePointerEvents || props->pointerEvents == facebook::react::PointerEventsMode::Auto ||
|
|
139
|
+
props->pointerEvents == facebook::react::PointerEventsMode::BoxOnly) &&
|
|
140
|
+
ptLocal.x >= 0 && ptLocal.x <= m_layoutMetrics.frame.size.width && ptLocal.y >= 0 &&
|
|
141
|
+
ptLocal.y <= m_layoutMetrics.frame.size.height) {
|
|
142
|
+
localPt = ptLocal;
|
|
143
|
+
return Tag();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return -1;
|
|
147
|
+
}
|
|
148
|
+
|
|
129
149
|
// Helper to convert a FocusNavigationDirection to a FocusNavigationReason.
|
|
130
150
|
winrt::Microsoft::UI::Input::FocusNavigationReason GetFocusNavigationReason(
|
|
131
151
|
winrt::Microsoft::ReactNative::FocusNavigationDirection direction) noexcept {
|
|
@@ -178,14 +198,12 @@ ContentIslandComponentView::~ContentIslandComponentView() noexcept {
|
|
|
178
198
|
void ContentIslandComponentView::MountChildComponentView(
|
|
179
199
|
const winrt::Microsoft::ReactNative::ComponentView &childComponentView,
|
|
180
200
|
uint32_t index) noexcept {
|
|
181
|
-
assert(false);
|
|
182
201
|
base_type::MountChildComponentView(childComponentView, index);
|
|
183
202
|
}
|
|
184
203
|
|
|
185
204
|
void ContentIslandComponentView::UnmountChildComponentView(
|
|
186
205
|
const winrt::Microsoft::ReactNative::ComponentView &childComponentView,
|
|
187
206
|
uint32_t index) noexcept {
|
|
188
|
-
assert(false);
|
|
189
207
|
base_type::UnmountChildComponentView(childComponentView, index);
|
|
190
208
|
}
|
|
191
209
|
|
|
@@ -262,6 +280,10 @@ void ContentIslandComponentView::ConfigureChildSiteLinkAutomation() noexcept {
|
|
|
262
280
|
args.AutomationProvider(nullptr);
|
|
263
281
|
args.Handled(true);
|
|
264
282
|
});
|
|
283
|
+
|
|
284
|
+
if (m_innerAutomationProvider) {
|
|
285
|
+
m_innerAutomationProvider->SetChildSiteLink(m_childSiteLink);
|
|
286
|
+
}
|
|
265
287
|
}
|
|
266
288
|
|
|
267
289
|
} // namespace winrt::Microsoft::ReactNative::Composition::implementation
|
|
@@ -40,7 +40,10 @@ struct ContentIslandComponentView : ContentIslandComponentViewT<ContentIslandCom
|
|
|
40
40
|
|
|
41
41
|
bool focusable() const noexcept override;
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
facebook::react::Tag hitTest(facebook::react::Point pt, facebook::react::Point &localPt, bool ignorePointerEvents)
|
|
44
|
+
const noexcept override;
|
|
45
|
+
|
|
46
|
+
winrt::Windows::Foundation::IInspectable CreateAutomationProvider() noexcept override;
|
|
44
47
|
|
|
45
48
|
void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override;
|
|
46
49
|
|
|
@@ -86,10 +86,11 @@ void DebuggingOverlayComponentView::HandleCommand(
|
|
|
86
86
|
if (auto root = rootComponentView()) {
|
|
87
87
|
auto rootVisual = root->OuterVisual();
|
|
88
88
|
auto brush = m_compContext.CreateColorBrush({204, 200, 230, 255});
|
|
89
|
+
float scaleFactor = m_layoutMetrics.pointScaleFactor;
|
|
89
90
|
for (auto &element : elements) {
|
|
90
91
|
auto overlayVisual = m_compContext.CreateSpriteVisual();
|
|
91
|
-
overlayVisual.Size({element.width, element.height});
|
|
92
|
-
overlayVisual.Offset({element.x, element.y, 0.0f});
|
|
92
|
+
overlayVisual.Size({element.width * scaleFactor, element.height * scaleFactor});
|
|
93
|
+
overlayVisual.Offset({element.x * scaleFactor, element.y * scaleFactor, 0.0f});
|
|
93
94
|
overlayVisual.Brush(brush);
|
|
94
95
|
|
|
95
96
|
rootVisual.InsertAt(overlayVisual, root->overlayIndex() + m_activeOverlays);
|